/** * crisp-client * @version v4.7.0 2a24f89 * @author Crisp IM SAS * @date 6/5/2026 */ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["stylesheets/common_default_2a24f89.css","stylesheets/features/chat_default_2a24f89.css","stylesheets/features/overlay_default_2a24f89.css","stylesheets/features/browsing_default_2a24f89.css","stylesheets/features/call_default_2a24f89.css"])))=>i.map(i=>d[i]); var __create=Object.create,__defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty,__commonJSMin=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),__exportAll=(e,t)=>{let r={};for(var l in e)__defProp(r,l,{get:e[l],enumerable:!0});return t||__defProp(r,Symbol.toStringTag,{value:"Module"}),r},__toESM=(e,t,r)=>(r=null!=e?__create(__getProtoOf(e)):{},((e,t,r,l)=>{if(t&&"object"==typeof t||"function"==typeof t)for(var a,u=__getOwnPropNames(t),b=0,n=u.length;bt[e]).bind(null,a),enumerable:!(l=__getOwnPropDesc(t,a))||l.enumerable});return e})(!t&&e&&e.t?r:__defProp(r,"default",{value:e,enumerable:!0}),e));var t=null;function e(){if(null===t)throw new Error("Client not initialized");return t}function s(t){const e=Object.create(null);for(const s of t.split(","))e[s]=1;return t=>t in e}var i,n={},r=[],o=()=>{},u=()=>!1,a=t=>111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),l=t=>t.startsWith("onUpdate:"),h=Object.assign,c=(t,e)=>{const s=t.indexOf(e);s>-1&&t.splice(s,1)},d=Object.prototype.hasOwnProperty,D=(t,e)=>d.call(t,e),f=Array.isArray,p=t=>"[object Map]"===C(t),m=t=>"[object Set]"===C(t),g=t=>"[object Date]"===C(t),F=t=>"function"==typeof t,w=t=>"string"==typeof t,v=t=>"symbol"==typeof t,y=t=>null!==t&&"object"==typeof t,b=t=>(y(t)||F(t))&&F(t.then)&&F(t.catch),E=Object.prototype.toString,C=t=>E.call(t),k=t=>"[object Object]"===C(t),A=t=>w(t)&&"NaN"!==t&&"-"!==t[0]&&""+parseInt(t,10)===t,B=s(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),x=t=>{const e=Object.create(null);return s=>e[s]||(e[s]=t(s))},j=/-\w/g,I=x(t=>t.replace(j,t=>t.slice(1).toUpperCase())),S=/\B([A-Z])/g,R=x(t=>t.replace(S,"-$1").toLowerCase()),O=x(t=>t.charAt(0).toUpperCase()+t.slice(1)),T=x(t=>t?`on${O(t)}`:""),z=(t,e)=>!Object.is(t,e),P=(t,...e)=>{for(let s=0;s{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:i,value:s})},M=t=>{const e=parseFloat(t);return isNaN(e)?t:e},U=()=>i||(i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function q(t){if(f(t)){const e={};for(let s=0;s{if(t){const s=t.split(N);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function J(t){let e="";if(w(t))e=t;else if(f(t))for(let s=0;sY(t,e))}var X,tt=t=>!(!t||!0!==t.Fe),et=t=>w(t)?t:null==t?"":f(t)||y(t)&&(t.toString===E||!F(t.toString))?tt(t)?et(t.value):JSON.stringify(t,st,2):String(t),st=(t,e)=>tt(e)?st(t,e.value):p(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[e,s],i)=>(t[it(e,i)+" =>"]=s,t),{})}:m(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>it(t))}:v(e)?it(e):!y(e)||f(e)||k(e)?e:String(e),it=(t,e="")=>{var s;return v(t)?`Symbol(${null!=(s=t.description)?s:e})`:t};function nt(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}var rt,ot=class{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=X,!t&&X&&(this.index=(X.scopes||(X.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let t,e;if(this._isPaused=!0,this.scopes)for(t=0,e=this.scopes.length;t0&&0===--this._on&&(X=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){let e,s;for(this._active=!1,e=0,s=this.effects.length;e0)return;if(at){let t=at;for(at=void 0;t;){const e=t.next;t.next=void 0,t.flags&=-9,t=e}}let t;for(;ut;){let s=ut;for(ut=void 0;s;){const i=s.next;if(s.next=void 0,s.flags&=-9,1&s.flags)try{s.trigger()}catch(e){t||(t=e)}s=i}}if(t)throw t}function pt(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function _t(t){let e,s=t.depsTail,i=s;for(;i;){const t=i.prevDep;-1===i.version?(i===s&&(s=t),Ft(i),wt(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=t}t.deps=e,t.depsTail=s}function mt(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(gt(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function gt(t){if(4&t.flags&&!(16&t.flags))return;if(t.flags&=-17,t.globalVersion===At)return;if(t.globalVersion=At,!t.isSSR&&128&t.flags&&(!t.deps&&!t._dirty||!mt(t)))return;t.flags|=2;const e=t.dep,s=rt,i=bt;rt=t,bt=!0;try{pt(t);const s=t.fn(t._value);(0===e.version||z(s,t._value))&&(t.flags|=128,t._value=s,e.version++)}catch(n){throw e.version++,n}finally{rt=s,bt=i,_t(t),t.flags&=-3}}function Ft(t,e=!1){const{dep:s,prevSub:i,nextSub:n}=t;if(i&&(i.nextSub=n,t.prevSub=void 0),n&&(n.prevSub=i,t.nextSub=void 0),s.subs===t&&(s.subs=i,!i&&s.computed)){s.computed.flags&=-5;for(let t=s.computed.deps;t;t=t.nextDep)Ft(t,!0)}e||--s.sc||!s.map||s.map.delete(s.key)}function wt(t){const{prevDep:e,nextDep:s}=t;e&&(e.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=e,t.nextDep=void 0)}function vt(t,e){t.effect instanceof ht&&(t=t.effect.fn);const s=new ht(t);e&&h(s,e);try{s.run()}catch(n){throw s.stop(),n}const i=nt(s.run,s);return i.effect=s,i}function yt(t){t.effect.stop()}var bt=!0,Et=[];function Ct(){Et.push(bt),bt=!1}function kt(){const t=Et.pop();bt=void 0===t||t}function $t(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const t=rt;rt=void 0;try{e()}finally{rt=t}}}var At=0,Bt=class{constructor(t,e){this.sub=t,this.dep=e,this.version=e.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},xt=class{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.Be=!0}track(t){if(!rt||!bt||rt===this.computed)return;let e=this.activeLink;if(void 0===e||e.sub!==rt)e=this.activeLink=new Bt(rt,this),rt.deps?(e.prevDep=rt.depsTail,rt.depsTail.nextDep=e,rt.depsTail=e):rt.deps=rt.depsTail=e,jt(e);else if(-1===e.version&&(e.version=this.version,e.nextDep)){const t=e.nextDep;t.prevDep=e.prevDep,e.prevDep&&(e.prevDep.nextDep=t),e.prevDep=rt.depsTail,e.nextDep=void 0,rt.depsTail.nextDep=e,rt.depsTail=e,rt.deps===e&&(rt.deps=t)}return e}trigger(t){this.version++,At++,this.notify(t)}notify(t){Dt();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{ft()}}};function jt(t){if(t.dep.sc++,4&t.sub.flags){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let t=e.deps;t;t=t.nextDep)jt(t)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}}var It=new WeakMap,St=Symbol(""),Rt=Symbol(""),Ot=Symbol("");function Tt(t,e,s){if(bt&&rt){let e=It.get(t);e||It.set(t,e=new Map);let i=e.get(s);i||(e.set(s,i=new xt),i.map=e,i.key=s),i.track()}}function zt(t,e,s,i,n,r){const o=It.get(t);if(!o)return void At++;const u=t=>{t&&t.trigger()};if(Dt(),"clear"===e)o.forEach(u);else{const n=f(t),r=n&&A(s);if(n&&"length"===s){const t=Number(i);o.forEach((e,s)=>{("length"===s||s===Ot||!v(s)&&s>=t)&&u(e)})}else switch((void 0!==s||o.has(void 0))&&u(o.get(s)),r&&u(o.get(Ot)),e){case"add":n?r&&u(o.get("length")):(u(o.get(St)),p(t)&&u(o.get(Rt)));break;case"delete":n||(u(o.get(St)),p(t)&&u(o.get(Rt)));break;case"set":p(t)&&u(o.get(St))}}ft()}function Pt(t){const e=be(t);return e===t?e:(Tt(e,0,Ot),ve(t)?e:e.map(Ce))}function Lt(t){return Tt(t=be(t),0,Ot),t}function Mt(t,e){return we(t)?Fe(t)?ke(Ce(e)):ke(e):Ce(e)}var Ut={__proto__:null,[Symbol.iterator](){return qt(this,Symbol.iterator,t=>Mt(this,t))},concat(...t){return Pt(this).concat(...t.map(t=>f(t)?Pt(t):t))},entries(){return qt(this,"entries",t=>(t[1]=Mt(this,t[1]),t))},every(t,e){return Nt(this,"every",t,e,void 0,arguments)},filter(t,e){return Nt(this,"filter",t,e,t=>t.map(t=>Mt(this,t)),arguments)},find(t,e){return Nt(this,"find",t,e,t=>Mt(this,t),arguments)},findIndex(t,e){return Nt(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return Nt(this,"findLast",t,e,t=>Mt(this,t),arguments)},findLastIndex(t,e){return Nt(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return Nt(this,"forEach",t,e,void 0,arguments)},includes(...t){return Wt(this,"includes",t)},indexOf(...t){return Wt(this,"indexOf",t)},join(t){return Pt(this).join(t)},lastIndexOf(...t){return Wt(this,"lastIndexOf",t)},map(t,e){return Nt(this,"map",t,e,void 0,arguments)},pop(){return Jt(this,"pop")},push(...t){return Jt(this,"push",t)},reduce(t,...e){return Ht(this,"reduce",t,e)},reduceRight(t,...e){return Ht(this,"reduceRight",t,e)},shift(){return Jt(this,"shift")},some(t,e){return Nt(this,"some",t,e,void 0,arguments)},splice(...t){return Jt(this,"splice",t)},toReversed(){return Pt(this).toReversed()},toSorted(t){return Pt(this).toSorted(t)},toSpliced(...t){return Pt(this).toSpliced(...t)},unshift(...t){return Jt(this,"unshift",t)},values(){return qt(this,"values",t=>Mt(this,t))}};function qt(t,e,s){const i=Lt(t),n=i[e]();return i===t||ve(t)||(n._next=n.next,n.next=()=>{const t=n._next();return t.done||(t.value=s(t.value)),t}),n}var Vt=Array.prototype;function Nt(t,e,s,i,n,r){const o=Lt(t),u=o!==t&&!ve(t),a=o[e];if(a!==Vt[e]){const e=a.apply(t,r);return u?Ce(e):e}let l=s;o!==t&&(u?l=function(e,i){return s.call(this,Mt(t,e),i,t)}:s.length>2&&(l=function(e,i){return s.call(this,e,i,t)}));const h=a.call(o,l,i);return u&&n?n(h):h}function Ht(t,e,s,i){const n=Lt(t);let r=s;return n!==t&&(ve(t)?s.length>3&&(r=function(e,i,n){return s.call(this,e,i,n,t)}):r=function(e,i,n){return s.call(this,e,Mt(t,i),n,t)}),n[e](r,...i)}function Wt(t,e,s){const i=be(t);Tt(i,0,Ot);const n=i[e](...s);return-1!==n&&!1!==n||!ye(s[0])?n:(s[0]=be(s[0]),i[e](...s))}function Jt(t,e,s=[]){Ct(),Dt();const i=be(t)[e].apply(t,s);return ft(),kt(),i}var Gt=s("__proto__,__v_isRef,__isVue"),Kt=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>"arguments"!==t&&"caller"!==t).map(t=>Symbol[t]).filter(v));function Zt(t){v(t)||(t=String(t));const e=be(this);return Tt(e,0,t),e.hasOwnProperty(t)}var Yt=class{constructor(t=!1,e=!1){this._isReadonly=t,this._isShallow=e}get(t,e,s){if("__v_skip"===e)return t.Be;const i=this._isReadonly,n=this._isShallow;if("__v_isReactive"===e)return!i;if("__v_isReadonly"===e)return i;if("__v_isShallow"===e)return n;if("__v_raw"===e)return s===(i?n?De:de:n?ce:he).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const r=f(t);if(!i){let t;if(r&&(t=Ut[e]))return t;if("hasOwnProperty"===e)return Zt}const o=Reflect.get(t,e,$e(t)?t:s);if(v(e)?Kt.has(e):Gt(e))return o;if(i||Tt(t,0,e),n)return o;if($e(o)){const t=r&&A(e)?o:o.value;return i&&y(t)?me(t):t}return y(o)?i?me(o):pe(o):o}},Qt=class extends Yt{constructor(t=!1){super(!1,t)}set(t,e,s,i){let n=t[e];const r=f(t)&&A(e);if(!this._isShallow){const t=we(n);if(ve(s)||we(s)||(n=be(n),s=be(s)),!r&&$e(n)&&!$e(s))return t||(n.value=s),!0}const o=r?Number(e)t,ie=t=>Reflect.getPrototypeOf(t);function ne(t){return function(...e){return"delete"!==t&&("clear"===t?void 0:this)}}function re(t,e){const s={get(s){const i=this.__v_raw,n=be(i),r=be(s);t||(z(s,r)&&Tt(n,0,s),Tt(n,0,r));const{has:o}=ie(n),u=e?se:t?ke:Ce;return o.call(n,s)?u(i.get(s)):o.call(n,r)?u(i.get(r)):void(i!==n&&i.get(s))},get size(){const e=this.__v_raw;return!t&&Tt(be(e),0,St),e.size},has(e){const s=this.__v_raw,i=be(s),n=be(e);return t||(z(e,n)&&Tt(i,0,e),Tt(i,0,n)),e===n?s.has(e):s.has(e)||s.has(n)},forEach(s,i){const n=this,r=n.__v_raw,o=be(r),u=e?se:t?ke:Ce;return!t&&Tt(o,0,St),r.forEach((t,e)=>s.call(i,u(t),u(e),n))}};return h(s,t?{add:ne("add"),set:ne("set"),delete:ne("delete"),clear:ne("clear")}:{add(t){e||ve(t)||we(t)||(t=be(t));const s=be(this);return ie(s).has.call(s,t)||(s.add(t),zt(s,"add",t,t)),this},set(t,s){e||ve(s)||we(s)||(s=be(s));const i=be(this),{has:n,get:r}=ie(i);let o=n.call(i,t);o||(t=be(t),o=n.call(i,t));const u=r.call(i,t);return i.set(t,s),o?z(s,u)&&zt(i,"set",t,s):zt(i,"add",t,s),this},delete(t){const e=be(this),{has:s,get:i}=ie(e);let n=s.call(e,t);n||(t=be(t),n=s.call(e,t));i&&i.call(e,t);const r=e.delete(t);return n&&zt(e,"delete",t,void 0),r},clear(){const t=be(this),e=0!==t.size,s=t.clear();return e&&zt(t,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{s[i]=function(t,e,s){return function(...i){const n=this.__v_raw,r=be(n),o=p(r),u="entries"===t||t===Symbol.iterator&&o,a="keys"===t&&o,l=n[t](...i),h=s?se:e?ke:Ce;return!e&&Tt(r,0,a?Rt:St),{next(){const{value:t,done:e}=l.next();return e?{value:t,done:e}:{value:u?[h(t[0]),h(t[1])]:h(t),done:e}},[Symbol.iterator](){return this}}}}(i,t,e)}),s}function oe(t,e){const s=re(t,e);return(e,i,n)=>"__v_isReactive"===i?!t:"__v_isReadonly"===i?t:"__v_raw"===i?e:Reflect.get(D(s,i)&&i in e?s:e,i,n)}var ue={get:oe(!1,!1)},ae={get:oe(!1,!0)},le={get:oe(!0,!1)},he=new WeakMap,ce=new WeakMap,de=new WeakMap,De=new WeakMap;function fe(t){return t.Be||!Object.isExtensible(t)?0:function(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((t=>C(t).slice(8,-1))(t))}function pe(t){return we(t)?t:ge(t,!1,Xt,ue,he)}function _e(t){return ge(t,!1,ee,ae,ce)}function me(t){return ge(t,!0,te,le,de)}function ge(t,e,s,i,n){if(!y(t))return t;if(t.__v_raw&&(!e||!t.__v_isReactive))return t;const r=fe(t);if(0===r)return t;const o=n.get(t);if(o)return o;const u=new Proxy(t,2===r?i:s);return n.set(t,u),u}function Fe(t){return we(t)?Fe(t.__v_raw):!(!t||!t.__v_isReactive)}function we(t){return!(!t||!t.__v_isReadonly)}function ve(t){return!(!t||!t.__v_isShallow)}function ye(t){return!!t&&!!t.__v_raw}function be(t){const e=t&&t.__v_raw;return e?be(e):t}function Ee(t){return!D(t,"__v_skip")&&Object.isExtensible(t)&&L(t,"__v_skip",!0),t}var Ce=t=>y(t)?pe(t):t,ke=t=>y(t)?me(t):t;function $e(t){return!!t&&!0===t.Fe}function Ae(t){return s=!1,$e(e=t)?e:new Be(e,s);var e,s}var Be=class{constructor(t,e){this.dep=new xt,this.Fe=!0,this.__v_isShallow=!1,this._rawValue=e?t:be(t),this._value=e?t:Ce(t),this.__v_isShallow=e}get value(){return this.dep.track(),this._value}set value(t){const e=this._rawValue,s=this.__v_isShallow||ve(t)||we(t);t=s?t:be(t),z(t,e)&&(this._rawValue=t,this._value=s?t:Ce(t),this.dep.trigger())}};var xe={get:(t,e,s)=>{return"__v_raw"===e?t:$e(i=Reflect.get(t,e,s))?i.value:i;var i},set:(t,e,s,i)=>{const n=t[e];return $e(n)&&!$e(s)?(n.value=s,!0):Reflect.set(t,e,s,i)}};function je(t){return Fe(t)?t:new Proxy(t,xe)}var Ie=class{constructor(t,e,s){this.fn=t,this.setter=e,this._value=void 0,this.dep=new xt(this),this.Fe=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=At-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!e,this.isSSR=s}notify(){if(this.flags|=16,!(8&this.flags)&&rt!==this)return dt(this,!0),!0}get value(){const t=this.dep.track();return gt(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}};function Se(t,e,s=!1){let i,n;return F(t)?i=t:(i=t.get,n=t.set),new Ie(i,n,s)}var Re={},Oe=new WeakMap,Te=void 0;function ze(t,e,s=n){const{immediate:i,deep:r,once:u,scheduler:a,augmentJob:l,call:h}=s,d=t=>r?t:ve(t)||!1===r||0===r?Pe(t,1):Pe(t);let D,p,m,g,w=!1,v=!1;if($e(t)?(p=()=>t.value,w=ve(t)):Fe(t)?(p=()=>d(t),w=!0):f(t)?(v=!0,w=t.some(t=>Fe(t)||ve(t)),p=()=>t.map(t=>$e(t)?t.value:Fe(t)?d(t):F(t)?h?h(t,2):t():void 0)):p=F(t)?e?h?()=>h(t,2):t:()=>{if(m){Ct();try{m()}finally{kt()}}const e=Te;Te=D;try{return h?h(t,3,[g]):t(g)}finally{Te=e}}:o,e&&r){const t=p,e=!0===r?1/0:r;p=()=>Pe(t(),e)}const y=X,b=()=>{D.stop(),y&&y.active&&c(y.effects,D)};if(u&&e){const t=e;e=(...e)=>{t(...e),b()}}let E=v?new Array(t.length).fill(Re):Re;const C=t=>{if(1&D.flags&&(D.dirty||t))if(e){const t=D.run();if(r||w||(v?t.some((t,e)=>z(t,E[e])):z(t,E))){m&&m();const s=Te;Te=D;try{const s=[t,E===Re?void 0:v&&E[0]===Re?[]:E,g];E=t,h?h(e,3,s):e(...s)}finally{Te=s}}}else D.run()};return l&&l(C),D=new ht(p),D.scheduler=a?()=>a(C,!1):C,g=t=>function(t,e=!1,s=Te){if(s){let e=Oe.get(s);e||Oe.set(s,e=[]),e.push(t)}}(t,!1,D),m=D.onStop=()=>{const t=Oe.get(D);if(t){if(h)h(t,4);else for(const e of t)e();Oe.delete(D)}},e?i?C(!0):E=D.run():a?a(nt(C,null,!0),!0):D.run(),b.pause=nt(D.pause,D),b.resume=nt(D.resume,D),b.stop=b,b}function Pe(t,e=1/0,s){if(e<=0||!y(t)||t.Be)return t;if(((s=s||new Map).get(t)||0)>=e)return t;if(s.set(t,e),e--,$e(t))Pe(t.value,e,s);else if(f(t))for(let i=0;i{Pe(t,e,s)});else if(k(t)){for(const i in t)Pe(t[i],e,s);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&Pe(t[i],e,s)}return t}var Le={URL_CLIENT:"",URL_IMAGE:""},Me={PROJECT_NAME:"crisp-client",REVISION:"2a24f89",PROTOCOL:"__CRISP__INTERNAL__PROTOCOL__",get URL_CLIENT(){return Le.URL_CLIENT||"https://client.crisp.chat"},set URL_CLIENT(t){Le.URL_CLIENT=t},URL_RELAY_CLIENT:"https://client.relay.crisp.chat",URL_RELAY_STREAM:"https://stream.relay.crisp.chat",URL_WEBSITE:"https://crisp.chat",URL_GO:"https://go.crisp.chat",get URL_IMAGE(){return Le.URL_IMAGE||"https://image.crisp.chat"},set URL_IMAGE(t){Le.URL_IMAGE=t},URL_ASSETS:"https://assets.crisp.chat",URL_HUGO:"https://hugo.ai",PLATFORM_NAME:"crisp-client@v2",PLATFORM_SIGNATURE_KEY:"1k/2y/2u/2z/38/1e/3d/38/2y/23/1e/1y/29/34/1j/26",SOCKET_AFFINITY:!0,RTC_ICE:[{urls:["stun:stun.media.crisp.chat:3478","stun:stun.media.crisp.chat:3479"]},{urls:["turn:turn.media.crisp.chat:3478?transport=udp","turn:turn.media.crisp.chat:3478?transport=tcp","turn:turn.media.crisp.chat:3479?transport=udp","turn:turn.media.crisp.chat:3479?transport=tcp","turns:turn.media.crisp.chat:443?transport=tcp"],username:"client_9F9kh",credential:"DPCEHTqUb7jiJ2mvnzcUmFV4mKK6c8jntUXo4gC8tYCbHTocuy9YJiCxpQ4tmG3p"}],CIRCUIT_BREAKER_DOMAINS:[],CIRCUIT_BREAKER_AGENTS:["Trident","Googlebot","Bingbot","Slurp","DuckDuckBot","Baiduspider","YandexBot","GTmetrix","Lighthouse","Acunetix","Ahrefs","SemrushBot","SiteAuditBot","SplitSignalBot","HeadlessChrome"],CIRCUIT_BREAKER_ENGINES:[{element:"head link[rel='icon'][type='image/x-icon'][href^='https://sellpass.io']"},{element:"head script[src*='/cdn.sellix.io/']"},{element:"head link[rel='preconnect'][href^='https://cdn.sellix.io/']"},{element:"head link[rel='preconnect'][href^='https://api.sellsn.io']"},{element:"head link[rel='author'][href^='https://ereemby.com/']"},{element:"body script[src$='/aiz-core.js']"}],ENVIRONMENT:"production",TEST:!1,LOCALE_DEFAULT:"en",LOCALE_AVAILABLE:["af","ar-ae","ar-sa","ar-ye","ar","az","bg","bn","ca","ckb","cs","da","de","el","en","eo","es","et","eu","fa","fi","fo","fr","gu","he","hi","hr","hu","hy","id","is","it","ja","ka","ko","lt","lv","ml","mn","ms","nl-be","nl","no","pl","ps","pt-br","pt","ro","ru","sk","sl","sr-cyrl-cs","sr","sv","ta","th","tr","uk","uz-cyrl","uz","vi","zh-hk","zh-tw","zh"],LOCALE_WEBSITE:["en","fr","es","pt","de","nl","fi","pl","tr"],FILE_PREVIEW:{IMAGE:["image/jpeg","image/jpg","image/webp","image/png","image/gif"],VIDEO:["video/mp4","video/webm"]},THEME:{DEFAULT_COLOR:"default",AVAILABLE_COLORS:{default:{100:"#E2EEFF",200:"#66788A",500:"#1970F0",600:"#055EE1",700:"#0057D7",800:"#0051C8",900:"#004AB5",reverse:"#FFFFFF"},red:{100:"#FFE5E4",200:"#66788A",500:"#E51E0F",600:"#CC1B0E",700:"#C5170A",800:"#B81206",900:"#A71004",reverse:"#FFFFFF"},pink:{100:"#FFE0EB",200:"#66788A",500:"#F11D64",600:"#DB165A",700:"#CE1454",800:"#C20F4D",900:"#B40A45",reverse:"#FFFFFF"},purple:{100:"#FADDFF",200:"#66788A",500:"#B520CF",600:"#9B19B2",700:"#9614AE",800:"#8A0DA1",900:"#800896",reverse:"#FFFFFF"},deep_purple:{100:"#EDE2FF",200:"#66788A",500:"#682AD5",600:"#581FBB",700:"#5019B0",800:"#441599",900:"#3B0F89",reverse:"#FFFFFF"},indigo:{100:"#DDE2FF",200:"#66788A",500:"#2943D1",600:"#1732C4",700:"#112BB9",800:"#0F249A",900:"#091C87",reverse:"#FFFFFF"},blue:{100:"#E2EEFF",200:"#66788A",500:"#1970F0",600:"#055EE1",700:"#0057D7",800:"#0051C8",900:"#004AB5",reverse:"#FFFFFF"},light_blue:{100:"#DCF0F9",200:"#66788A",500:"#009FDF",600:"#008CCB",700:"#0088C5",800:"#007EB7",900:"#0076AB",reverse:"#FFFFFF"},cyan:{100:"#DBF7F9",200:"#66788A",500:"#01A2B4",600:"#009CAE",700:"#008A9A",800:"#008493",900:"#007B89",reverse:"#FFFFFF"},teal:{100:"#D6EEE9",200:"#66788A",500:"#00947C",600:"#00816C",700:"#007B66",800:"#00705D",900:"#006655",reverse:"#FFFFFF"},green:{100:"#D6F3D7",200:"#66788A",500:"#28A52D",600:"#1A941F",700:"#148919",800:"#0F7B13",900:"#0A6C0E",reverse:"#FFFFFF"},light_green:{100:"#DFF6C6",200:"#66788A",500:"#6EB700",600:"#64A500",700:"#5E9C00",800:"#528800",900:"#487800",reverse:"#FFFFFF"},amber:{100:"#FFF0C1",200:"#66788A",500:"#E1AE01",600:"#CD9E00",700:"#C49700",800:"#B88E00",900:"#A37E00",reverse:"#FFFFFF"},orange:{100:"#FFECCF",200:"#66788A",500:"#EC6800",600:"#E16300",700:"#CE5B00",800:"#BE5400",900:"#B54F00",reverse:"#FFFFFF"},deep_orange:{100:"#FFE8E0",200:"#66788A",500:"#E45300",600:"#CD4A00",700:"#C24702",800:"#B84200",900:"#AC3E00",reverse:"#FFFFFF"},brown:{100:"#F2EAE7",200:"#66788A",500:"#924B32",600:"#8C462D",700:"#7F3D25",800:"#75361F",900:"#692E19",reverse:"#FFFFFF"},grey:{100:"#E5E5E5",200:"#66788A",500:"#7A7A7A",600:"#6B6B6B",700:"#646464",800:"#5B5B5B",900:"#505050",reverse:"#FFFFFF"},blue_grey:{100:"#DCEDF6",200:"#66788A",500:"#447991",600:"#3C7189",700:"#32657C",800:"#2A5A70",900:"#27556A",reverse:"#FFFFFF"},black:{100:"#E9E9E9",200:"#66788A",500:"#2A2A2A",600:"#313131",700:"#454545",800:"#525252",900:"#5B5B5B",reverse:"#FFFFFF"}},DERIVE_COLORS:{100:{percent:65,transparent:!0},200:{percent:13},300:{percent:12},400:{percent:10},600:{percent:-15},700:{percent:-25},800:{percent:-35},900:{percent:-50}}}},Ue="development"===Me.ENVIRONMENT,qe=void 0!==window.console,Ve=Ue&&qe,Ne="anonymous",He={},We=new class{constructor(){this.xe=/^(Error)/,this.Ie=/^(\s*at\s+)/,this.Oe=/(?:(.+?)(?:\s+\(|@))?(?:(.+?):(\d+):(\d+))/}connectLogSink(t,e){if("function"!=typeof e)throw new Error("Invalid function");He[t]=e}disconnectLogSink(t){delete He[t]}warn(...t){const e=this.Te("warn",...t);this.ze("warn",e[0],t)}error(...t){const e=this.Te("error",...t);Ve&&console.error(...e),this.ze("error",e[0],t)}info(...t){const e=this.Te("info",...t);this.ze("info",e[0],t)}log(...t){const e=this.Te("log",...t);this.ze("log",e[0],t)}debug(...t){const e=this.Te("debug",...t);Ve&&console.debug,this.ze("debug",e[0],t)}Pe(){try{let t=(new Error).stack;t=t.replace(this.xe,"").trim();let e=t.split("\n")[3]||"";e=e.replace(this.Ie,"").trim();const s=e.match(this.Oe);if(s){const[,t=Ne,e="unknown",i="?",n="?"]=s,r=t.split("/")[0]||Ne;return{function:r,class:r.includes(".")?r.split(".")[0]:null,file:e.split("/").pop(),line:i,column:n}}return{function:"unknown",class:null,file:"unknown",line:"?",column:"?"}}catch{return{function:"unknown",class:null,file:"unknown",line:"?",column:"?"}}}Te(t,...e){const s=this.Pe();let i;return i=s.function===Ne?`${s.file}:${s.line}`:s.class?`${s.class}:${s.function}`:`${s.function}`,[`[${t.toUpperCase()}] [${i}]`,...e]}ze(t,e,s){for(let i in He)He[i](t,e,s)}};var Je=[],Ge=class{constructor(){Qe(function(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}(this.reset,this),0)}reset(){}};function Ke(t,e){if("object"!=typeof t||!t)return t;if("object"!=typeof e||!e)return t;for(let s in e)e.hasOwnProperty(s)&&("object"!=typeof e[s]||null===e[s]||Array.isArray(e[s])?t[s]=e[s]:(("object"!=typeof t[s]||null===t[s]||Array.isArray(t[s]))&&(t[s]={}),Ke(t[s],e[s])));return t}function Ze(t,e,s){let i=JSON.parse(JSON.stringify(t)),n=pe(Object.assign(e,t));return Qe(()=>{Ke(n,i)},1),"function"==typeof n.reset&&Qe(n.reset,0),n}function Ye(t,e,s){if(!t)throw new Error("Cannot inject session store without a session identifier");if(!(t in s)){let i={};!function(t,e){Ze(JSON.parse(JSON.stringify(t)),e)}(e,i),s[t]=i}return s[t]}function Qe(t,e=0){Je.push({fn:t,priority:e}),Je.sort((t,e)=>e.priority-t.priority)}var Xe=Ze({users_available:!1,last_available:0,was_availability_online:!1,availability:"away"},{receive(t=!1,s=!1){Xe.users_available=t,!0===s&&(Xe.last_available=(new Date).getTime()),e().Action.event("website:availability:changed",Xe.users_available)},apply(){let t=!0===Xe.users_available?"online":"away";Xe.availability=t,!1===Xe.was_availability_online&&"online"===t&&(Xe.was_availability_online=!0)}});function ts(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}var es=Object.defineProperty,ss=Object.defineProperties,is=Object.getOwnPropertyDescriptors,ns=Object.getOwnPropertySymbols,rs=Object.prototype.hasOwnProperty,os=Object.prototype.propertyIsEnumerable,us=(t,e,s)=>e in t?es(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,as=(t,e)=>{for(var s in e||(e={}))rs.call(e,s)&&us(t,s,e[s]);if(ns)for(var s of ns(e))os.call(e,s)&&us(t,s,e[s]);return t},ls=(t,e)=>ss(t,is(e)),hs=(t,e,s)=>(us(t,"symbol"!=typeof e?e+"":e,s),s),cs=!1,ds=[],Ds=Promise.resolve(),fs=t=>Ds.then(t),ps=t=>{ds.includes(t)||ds.push(t),cs||(cs=!0,fs(_s))},_s=()=>{for(const t of ds)t();ds.length=0,cs=!1};setInterval(()=>{_s()},1e3);var ms=Array.isArray,gs=t=>"string"==typeof t,Fs=t=>null!==t&&"object"==typeof t,ws=t=>{const e=Object.create(null);return s=>e[s]||(e[s]=t(s))},vs=/-(\w)/g,ys=ws(t=>t.replace(vs,(t,e)=>e?e.toUpperCase():"")),bs=/\B([A-Z])/g,Es=ws(t=>t.replace(bs,"-$1").toLowerCase());function Cs(t){if(ms(t)){const e={};for(let s=0;s{if(t){const s=t.split($s);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function xs(t){let e="";if(gs(t))e=t;else if(ms(t))for(let s=0;s{let r;"class"===i&&(t._class=t.className),s(()=>{let s=e();if(i)null!=n&&n.camel&&(i=ys(i)),Ss(t,i,s,r);else{for(const e in s)Ss(t,e,s[e],r&&r[e]);for(const e in r)(!s||!(e in s))&&Ss(t,e,null)}r=s})},Ss=(t,e,s,i)=>{if("class"===e)t.setAttribute("class",xs(t._class?[t._class,s]:s)||"");else if("style"===e){s=Cs(s);const{style:e}=t;if(s)if(gs(s))s!==i&&(e.cssText=s);else{for(const t in s)Os(e,t,s[t]);if(i&&!gs(i))for(const t in i)s[t]??Os(e,t,"")}else t.removeAttribute("style")}else t instanceof SVGElement||!(e in t)||js.test(e)?"true-value"===e?t._trueValue=s:"false-value"===e?t._falseValue=s:null!=s?t.setAttribute(e,s):t.removeAttribute(e):(t[e]=s,"value"===e&&(t._value=s))},Rs=/\s*!important$/,Os=(t,e,s)=>{ms(s)?s.forEach(s=>Os(t,e,s)):e.startsWith("--")?t.setProperty(e,s):Rs.test(s)?t.setProperty(Es(e),s.replace(Rs,""),"important"):t[e]=s},Ts=(t,e)=>{const s=t.getAttribute(e);return null!=s&&t.removeAttribute(e),s},zs=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ps=["ctrl","shift","alt","meta"],Ls={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&0!==t.button,middle:t=>"button"in t&&1!==t.button,right:t=>"button"in t&&2!==t.button,exact:(t,e)=>Ps.some(s=>t[`${s}Key`]&&!e[s])},Ms=({el:t,get:e,exp:s,arg:i,ctx:n,modifiers:r})=>{if(i){var o=t=>{zs.test(s)?e(`${s}`)(t):(n.scope.$event=t,e(`${s}`),delete n.scope.$event)};if("vue:mounted"===i)return void fs(o);if("vue:unmounted"===i)return()=>o();if(r){"click"===i&&(r.right&&(i="contextmenu"),r.middle&&(i="mouseup"));const t=o;o=e=>{if(!("key"in e)||Es(e.key)in r){for(const t in r){const s=Ls[t];if(s&&s(e,r))return}return t(e)}}}((t,e,s,i)=>{t.addEventListener(e,s,i)})(t,i,o,r)}},Us=({el:t,get:e,effect:s})=>{s(()=>{t.textContent=qs(e())})},qs=t=>null==t?"":Fs(t)?JSON.stringify(t,null,2):String(t),Vs={true:!0,false:!1,null:null,undefined:void 0},Ns={};"+ - * / % === !== == != < > <= >= && || ! =".split(" ").forEach(function(t){Ns[t]=!0});var Hs={n:"\n",f:"\f",r:"\r",t:"\t",i:"\v",o:"'",u:'"'},Ws=class{constructor(){}h(t){for(this.text=t,this.index=0,this.l=[];this.text.length>this.index;){var e=this.text.charAt(this.index);if('"'===e||"'"===e)this.p(e);else if(this.v(e)||"."===e&&this.v(this.m()))this.k();else if(this.I(this.A()))this.j();else if("?"===e&&"."===this.m())this.l.push({index:this.index,text:"?.",C:!0}),this.index+=2;else if(this.is(e,"(){}[].,;:?"))this.l.push({index:this.index,text:e}),this.index++;else if(this.S(e))this.index++;else{var s=e+this.m(),i=s+this.m(2),n=Ns[s],r=Ns[i];if(Ns[e]||n||r){var o=r?i:n?s:e;this.l.push({index:this.index,text:o,operator:!0}),this.index+=o.length}else this.$("Unexpected next character ",this.index,this.index+1)}}return this.l}is(t,e){return-1!==e.indexOf(t)}m(t){var e=t||1;return this.text.length>this.index+e&&this.text.charAt(this.index+e)}v(t){return t>="0"&&"9">=t&&"string"==typeof t}S(t){return" "===t||"\r"===t||"\t"===t||"\n"===t||"\v"===t||" "===t}I(t){return this.U(t)}U(t){return t>="a"&&"z">=t||t>="A"&&"Z">=t||"_"===t||"$"===t}M(t){return this.T(t)}T(t,e){return this.U(t,e)||this.v(t)}codePointAt(t){return 1===t.length?t.charCodeAt(0):(t.charCodeAt(0)<<10)+t.charCodeAt(1)-56613888}A(){var t=this.text.charAt(this.index),e=this.m();if(!e)return t;var s=t.charCodeAt(0),i=e.charCodeAt(0);return 55296>s||s>56319||56320>i||i>57343?t:t+e}L(t){return"-"===t||"+"===t||this.v(t)}$(t,e,s){s=s||this.index;var i=void 0!==e?"s "+e+"-"+this.index+" ["+this.text.substring(e,s)+"]":" "+s;throw Error("Lexer Error: "+t+" at column"+i+" in expression ["+this.text+"].")}k(){for(var t="",e=this.index;this.text.length>this.index;){var s=this.text.charAt(this.index).toLowerCase();if("."===s||this.v(s))t+=s;else{var i=this.m();if("e"===s&&this.L(i))t+=s;else if(this.L(s)&&i&&this.v(i)&&"e"===t.charAt(t.length-1))t+=s;else{if(!this.L(s)||i&&this.v(i)||"e"!==t.charAt(t.length-1))break;this.$("Invalid exponent")}}this.index++}this.l.push({index:e,text:t,N:!0,value:+t})}j(){var t=this.index;for(this.index+=this.A().length;this.text.length>this.index;){var e=this.A();if(!this.M(e))break;this.index+=e.length}this.l.push({index:t,text:this.text.slice(t,this.index),identifier:!0})}p(t){var e=this.index;this.index++;for(var s="",i=t,n=!1;this.text.length>this.index;){var r=this.text.charAt(this.index);if(i+=r,n){if("u"===r){var o=this.text.substring(this.index+1,this.index+5);o.match(/[\da-f]{4}/i)||this.$("Invalid unicode escape [\\u"+o+"]"),this.index+=4,s+=String.fromCharCode(parseInt(o,16))}else s+=Hs[r]||r;n=!1}else if("\\"===r)n=!0;else{if(r===t)return this.index++,void this.l.push({index:e,text:i,N:!0,value:s});s+=r}this.index++}this.$("Unterminated quote",e)}};function Js(t){return t.type===Ks.O||t.type===Ks.P}var Gs=class{constructor(t,e){hs(this,"wt",{$t:{type:Gs.X},Ut:{type:Gs.Y}}),this.q=t,this.options=e}et(t){this.text=t,this.l=this.q.h(t);const e=this.it();return 0!==this.l.length&&this.$("is an unexpected token",this.l[0]),e}it(){const t=[];for(;;)if(this.l.length>0&&!this.m("}",")",";","]")&&t.push(this.rt()),!this.nt(";"))return{type:Gs.V,body:t}}rt(){return{type:Gs.B,st:this.st()}}st(){return this.ot()}ot(){const t=this.ut();if(this.nt("=")){if(!Js(t))throw Error("Trying to assign a value to a non l-value");return{type:Gs.D,left:t,right:this.ot(),operator:"="}}return t}ut(){const t=this.ht();let e,s;return this.nt("?")&&(e=this.st(),this.ct(":"))?(s=this.st(),{type:Gs.R,test:t,alternate:e,lt:s}):t}ht(){let t=this.ft();for(;this.nt("||");)t={type:Gs.G,operator:"||",left:t,right:this.ft()};return t}ft(){let t=this.vt();for(;this.nt("&&");)t={type:Gs.G,operator:"&&",left:t,right:this.vt()};return t}vt(){let t,e=this.dt();for(;t=this.nt("==","!=","===","!==");)e={type:Gs.W,operator:t.text,left:e,right:this.dt()};return e}dt(){let t,e=this.yt();for(;t=this.nt("<",">","<=",">=");)e={type:Gs.W,operator:t.text,left:e,right:this.yt()};return e}yt(){let t,e=this.xt();for(;t=this.nt("+","-");)e={type:Gs.W,operator:t.text,left:e,right:this.xt()};return e}xt(){let t,e=this.bt();for(;t=this.nt("*","/","%");)e={type:Gs.W,operator:t.text,left:e,right:this.bt()};return e}bt(){let t;return(t=this.nt("+","-","!"))?{type:Gs.Z,operator:t.text,prefix:!0,kt:this.bt()}:this.gt()}gt(){let t,e;for(this.nt("(")?(t=this.st(),this.ct(")")):this.nt("[")?t=this.Et():this.nt("{")?t=this.object():this.wt.hasOwnProperty(this.m().text)?t=Object.assign({},this.wt[this.ct().text]):Vs.hasOwnProperty(this.m().text)?t={type:Gs.F,value:Vs[this.ct().text]}:this.m().identifier?t=this.identifier():this.m().N?t=this.N():this.$("not a primary expression",this.m());e=this.nt("(","[",".","?.");)"("===e.text?(t={type:Gs._,It:t,arguments:this.At()},this.ct(")")):"["===e.text?(t={type:Gs.P,object:t,jt:this.st(),computed:!0},this.ct("]")):"."===e.text?t={type:Gs.P,object:t,jt:this.identifier(),computed:!1}:"?."===e.text&&(this.m("[")?(this.ct("["),t={type:Gs.P,object:t,jt:this.st(),computed:!0,optional:!0},this.ct("]")):t={type:Gs.P,object:t,jt:this.identifier(),computed:!1,optional:!0});return t}At(){const t=[];if(")"!==this.Ct().text)do{t.push(this.st())}while(this.nt(","));return t}identifier(){const t=this.ct();return t.identifier||this.$("is not a valid identifier",t),{type:Gs.O,name:t.text}}N(){return{type:Gs.F,value:this.ct().value}}Et(){const t=[];if("]"!==this.Ct().text)do{if(this.m("]"))break;t.push(this.st())}while(this.nt(","));return this.ct("]"),{type:Gs.H,elements:t}}object(){const t=[];let e;if("}"!==this.Ct().text)do{if(this.m("}"))break;e={type:Gs.J,kind:"init"},this.m().N?(e.key=this.N(),e.computed=!1,this.ct(":"),e.value=this.st()):this.m().identifier?(e.key=this.identifier(),e.computed=!1,this.m(":")?(this.ct(":"),e.value=this.st()):e.value=e.key):this.m("[")?(this.ct("["),e.key=this.st(),this.ct("]"),e.computed=!0,this.ct(":"),e.value=this.st()):this.$("invalid key",this.m()),t.push(e)}while(this.nt(","));return this.ct("}"),{type:Gs.K,properties:t}}$(t,e){throw Error(`Syntax Error: Token '${e.text}' ${t} at column ${e.index+1} of the expression [${this.text}] starting at [${this.text.substring(e.index)}].`)}ct(t){if(0===this.l.length)throw Error("Unexpected end of expression: "+this.text);const e=this.nt(t);return e||this.$("is unexpected, expecting ["+t+"]",this.m()),e}Ct(){if(0===this.l.length)throw Error("Unexpected end of expression: "+this.text);return this.l[0]}m(t,e,s,i){return this.St(0,t,e,s,i)}St(t,e,s,i,n){if(this.l.length>t){const r=this.l[t],o=r.text;if(o===e||o===s||o===i||o===n||!e&&!s&&!i&&!n)return r}return!1}nt(t,e,s,i){const n=this.m(t,e,s,i);return!!n&&(this.l.shift(),n)}},Ks=Gs;function Zs(t,e){let s,i;const n=t.Mt=function(t,e){switch(t.type){case"MemberExpression":if(t.computed)return!1;break;case"UnaryExpression":return 1;case"BinaryExpression":return"+"!==t.operator&&1;case"CallExpression":return!1}return void 0===e?2:e}(t,e);switch(t.type){case Ks.V:s=!0,t.body.forEach(function(t){Zs(t.st,n),s=s&&t.st.N}),t.N=s;break;case Ks.F:t.N=!0,t.Tt=[];break;case Ks.Z:Zs(t.kt,n),t.N=t.kt.N,t.Tt=t.kt.Tt;break;case Ks.W:Zs(t.left,n),Zs(t.right,n),t.N=t.left.N&&t.right.N,t.Tt=t.left.Tt.concat(t.right.Tt);break;case Ks.G:Zs(t.left,n),Zs(t.right,n),t.N=t.left.N&&t.right.N,t.Tt=t.N?[]:[t];break;case Ks.R:Zs(t.test,n),Zs(t.alternate,n),Zs(t.lt,n),t.N=t.test.N&&t.alternate.N&&t.lt.N,t.Tt=t.N?[]:[t];break;case Ks.O:t.N=!1,t.Tt=[t];break;case Ks.P:Zs(t.object,n),t.computed&&Zs(t.jt,n),t.N=t.object.N&&(!t.computed||t.jt.N),t.Tt=t.N?[]:[t];break;case Ks._:s=!1,i=[],t.arguments.forEach(function(t){Zs(t,n),s=s&&t.N,i.push.apply(i,t.Tt)}),t.N=s,t.Tt=[t];break;case Ks.D:Zs(t.left,n),Zs(t.right,n),t.N=t.left.N&&t.right.N,t.Tt=[t];break;case Ks.H:s=!0,i=[],t.elements.forEach(function(t){Zs(t,n),s=s&&t.N,i.push.apply(i,t.Tt)}),t.N=s,t.Tt=i;break;case Ks.K:s=!0,i=[],t.properties.forEach(function(t){Zs(t.value,n),s=s&&t.value.N,i.push.apply(i,t.value.Tt),t.computed&&(Zs(t.key,!1),s=s&&t.key.N,i.push.apply(i,t.key.Tt))}),t.N=s,t.Tt=i;break;case Ks.X:case Ks.Y:t.N=!1,t.Tt=[]}}hs(Ks,"V",1),hs(Ks,"B",2),hs(Ks,"D",3),hs(Ks,"R",4),hs(Ks,"G",5),hs(Ks,"W",6),hs(Ks,"Z",7),hs(Ks,"_",8),hs(Ks,"P",9),hs(Ks,"O",10),hs(Ks,"F",11),hs(Ks,"H",12),hs(Ks,"J",13),hs(Ks,"K",14),hs(Ks,"X",15),hs(Ks,"Y",16),hs(Ks,"tt",17);var Ys=class{compile(t){const e=this;let s,i;Zs(t),(s=function(t){if(1===t.body.length&&Js(t.body[0].st))return{type:Ks.D,left:t.body[0].st,right:{type:Ks.tt},operator:"="}}(t))&&(i=this.Lt(s));const n=function(t){if(1!==t.length)return;const e=t[0].st,s=e.Tt;return 1!==s.length||s[0]!==e?s:void 0}(t.body);let r;n&&(r=[],n.forEach(function(t,s){const i=e.Lt(t);i.Mt=t.Mt,t.input=i,r.push(i),t.Nt=s}));const o=[];t.body.forEach(function(t){o.push(e.Lt(t.st))});const u=0===t.body.length?noop:1===t.body.length?o[0]:function(t,e){let s;return o.forEach(function(i){s=i(t,e)}),s};return i&&(u.assign=function(t,e,s){return i(t,s,e)}),r&&(u.inputs=r),u}Lt(t,e,s){let i,n,r,o=this;if(t.input)return this.inputs(t.input,t.Nt);switch(t.type){case Ks.F:return this.value(t.value,e);case Ks.Z:return n=this.Lt(t.kt),this["unary"+t.operator](n,e);case Ks.W:case Ks.G:return i=this.Lt(t.left),n=this.Lt(t.right),this["binary"+t.operator](i,n,e);case Ks.R:return this["ternary?:"](this.Lt(t.test),this.Lt(t.alternate),this.Lt(t.lt),e);case Ks.O:return o.identifier(t.name,e,s);case Ks.P:return i=this.Lt(t.object,!1,!!s),t.computed||(n=t.jt.name),t.computed&&(n=this.Lt(t.jt)),t.computed?this.Ot(i,n,e,s,t.optional):this.Pt(i,n,e,s,t.optional);case Ks._:return r=[],t.arguments.forEach(function(t){r.push(o.Lt(t))}),n=this.Lt(t.It,!0),function(t,s,i,o){const u=n(t,s,i,o);let a;if(null!=u.value){const e=[];for(let n=0;r.length>n;++n)e.push(r[n](t,s,i,o));a=u.value.apply(u.context,e)}return e?{value:a}:a};case Ks.D:return i=this.Lt(t.left,!0,1),n=this.Lt(t.right),function(t,s,r,o){const u=i(t,s,r,o),a=n(t,s,r,o);return u.context[u.name]=a,e?{value:a}:a};case Ks.H:return r=[],t.elements.forEach(function(t){r.push(o.Lt(t))}),function(t,s,i,n){const o=[];for(let e=0;r.length>e;++e)o.push(r[e](t,s,i,n));return e?{value:o}:o};case Ks.K:return r=[],t.properties.forEach(function(t){r.push(t.computed?{key:o.Lt(t.key),computed:!0,value:o.Lt(t.value)}:{key:t.key.type===Ks.O?t.key.name:""+t.key.value,computed:!1,value:o.Lt(t.value)})}),function(t,s,i,n){const o={};for(let e=0;r.length>e;++e)r[e].computed?o[r[e].key(t,s,i,n)]=r[e].value(t,s,i,n):o[r[e].key]=r[e].value(t,s,i,n);return e?{value:o}:o};case Ks.X:return function(t){return e?{value:t}:t};case Ks.Y:return function(t,s){return e?{value:s}:s};case Ks.tt:return function(t,s,i){return e?{value:i}:i}}}"unary+"(t,e){return function(s,i,n,r){let o=t(s,i,n,r);return o=void 0!==o?+o:0,e?{value:o}:o}}"unary-"(t,e){return function(s,i,n,r){let o=t(s,i,n,r);return o=void 0!==o?-o:-0,e?{value:o}:o}}"unary!"(t,e){return function(s,i,n,r){const o=!t(s,i,n,r);return e?{value:o}:o}}"binary+"(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o),a=(h=e(i,n,r,o),void 0===(l=u)?h:void 0===h?l:l+h);var l,h;return s?{value:a}:a}}"binary-"(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o),a=e(i,n,r,o),l=(void 0!==u?u:0)-(void 0!==a?a:0);return s?{value:l}:l}}"binary*"(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)*e(i,n,r,o);return s?{value:u}:u}}"binary/"(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)/e(i,n,r,o);return s?{value:u}:u}}"binary%"(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)%e(i,n,r,o);return s?{value:u}:u}}"binary==="(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)===e(i,n,r,o);return s?{value:u}:u}}"binary!=="(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)!==e(i,n,r,o);return s?{value:u}:u}}"binary=="(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)==e(i,n,r,o);return s?{value:u}:u}}"binary!="(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)!=e(i,n,r,o);return s?{value:u}:u}}"binary<"(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)"(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)>e(i,n,r,o);return s?{value:u}:u}}"binary<="(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)<=e(i,n,r,o);return s?{value:u}:u}}"binary>="(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)>=e(i,n,r,o);return s?{value:u}:u}}"binary&&"(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)&&e(i,n,r,o);return s?{value:u}:u}}"binary||"(t,e,s){return function(i,n,r,o){const u=t(i,n,r,o)||e(i,n,r,o);return s?{value:u}:u}}"ternary?:"(t,e,s,i){return function(n,r,o,u){const a=t(n,r,o,u)?e(n,r,o,u):s(n,r,o,u);return i?{value:a}:a}}value(t,e){return function(){return e?{context:void 0,name:void 0,value:t}:t}}identifier(t,e,s){return function(i,n,r,o){const u=n&&t in n?n:i;s&&1!==s&&u&&null==u[t]&&(u[t]={});const a=u?u[t]:void 0;return e?{context:u,name:t,value:a}:a}}Ot(t,e,s,i,n){return function(r,o,u,a){const l=t(r,o,u,a);let h,c;return n&&null==l?c=void 0:null!=l&&(h=e(r,o,u,a),h+="",i&&1!==i&&l&&!l[h]&&(l[h]={}),c=l[h]),s?{context:l,name:h,value:c}:c}}Pt(t,e,s,i,n){return function(r,o,u,a){const l=t(r,o,u,a);let h;return n&&null==l?h=void 0:(i&&1!==i&&l&&null==l[e]&&(l[e]={}),h=null!=l?l[e]:void 0),s?{context:l,name:e,value:h}:h}}inputs(t,e){return function(s,i,n,r){return r?r[e]:t(s,i,n)}}},Qs=class{constructor(t,e){this.et=new Ks(t,e),this.qt=new Ys}parse(t){const e=this.Vt(t),s=this.qt.compile(e.et);return s.Bt=function(t){return 0===t.body.length||1===t.body.length&&(t.body[0].st.type===Ks.F||t.body[0].st.type===Ks.H||t.body[0].st.type===Ks.K)}(e.et),s.N=function(t){return t.N}(e.et),s.Dt=e.Dt,s}Vt(t){let e=!1;return":"===(t=t.trim()).charAt(0)&&":"===t.charAt(1)&&(e=!0,t=t.substring(2)),{et:this.et.et(t),Dt:e}}};var Xs=new function(t={}){const e=new Qs(new Ws,t);function s(t){return e.parse(t)}return s.parse=function(t){return e.parse(t)},s},ti=(t,e,s)=>ei(t,e),ei=(t,e,s)=>{try{return Xs(e)(t)}catch(Ui){console.error(Ui)}},si={bind:Is,on:Ms,show:({el:t,get:e,effect:s})=>{const i=t.style.display;s(()=>{t.style.display=e()?i:"none"})},text:Us,html:({el:t,get:e,effect:s})=>{s(()=>{t.innerHTML=e()})},effect:({el:t,ctx:e,exp:s,effect:i})=>{fs(()=>i(()=>ei(e.scope,s)))}},ii=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,ni=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ri=/^\(|\)$/g,oi=/^[{[]\s*((?:[\w_$]+\s*,?\s*)+)[\]}]$/,ui=(t,e,s)=>{const i=e.match(ii);if(!i)return;const n=t.nextSibling,r=t.parentElement,o=new Text("");r.insertBefore(o,t),r.removeChild(t);const u=i[2].trim();let a,l,h,c,d=i[1].trim().replace(ri,"").trim(),D=!1,f="key",p=t.getAttribute(f)||t.getAttribute(f=":key")||t.getAttribute(f="v-bind:key");p&&(t.removeAttribute(f),"key"===f&&(p=JSON.stringify(p))),(c=d.match(ni))&&(d=d.replace(ni,"").trim(),l=c[1].trim(),c[2]&&(h=c[2].trim())),(c=d.match(oi))&&(a=c[1].split(",").map(t=>t.trim()),D="["===d[0]);let m,g,F,w=!1;const v=(t,e,i,n)=>{const r={};a?a.forEach((t,$)=>r[t]=e[D?$:t]):r[d]=e,n?(l&&(r[l]=n),h&&(r[h]=i)):l&&(r[l]=i);const o=gi(s,r),u=p?ti(o.scope,p):i;return t.set(u,i),o.key=u,o},y=(e,s)=>{const i=new wi(t,e);return i.key=e.key,i.insert(r,s),i};return s.effect(()=>{const t=ti(s.scope,u),e=F;if([g,F]=(t=>{const e=new Map,s=[];if(ms(t))for(let i=0;iy(t,o)),w=!0}),n},ai=({el:t,ctx:{scope:{$refs:e}},get:s,effect:i})=>{let n;return i(()=>{const i=s();e[i]=t,n&&i!==n&&delete e[n],n=i}),()=>{n&&delete e[n]}},li=/^(?:v-|:|@)/,hi=/\.([\w-]+)/g,ci=!1,di=(t,e)=>{const s=t.nodeType;if(1===s){const s=t;if(s.hasAttribute("v-pre"))return;let i;if(Ts(s,"v-cloak"),i=Ts(s,"v-if"))return((t,e,s)=>{const i=t.parentElement,n=new Comment("v-if");i.insertBefore(n,t);const r=[{exp:e,el:t}];let o,u;for(;(o=t.nextElementSibling)&&(u=null,""===Ts(o,"v-else")||(u=Ts(o,"v-else-if")));)i.removeChild(o),r.push({exp:u,el:o});const a=t.nextSibling;i.removeChild(t);let l,h=-1;const c=()=>{l&&(i.insertBefore(n,l.el),l.remove(),l=void 0)};return s.effect(()=>{for(let t=0;t{let s=t.firstChild;for(;s;)s=di(s,e)||s.nextSibling},fi=(t,e,s,i)=>{let n,r,o,u=e.replace(hi,(t,e)=>((o||(o={}))[e]=!0,""));if(":"===u[0])n=Is,r=u.slice(1);else if("@"===u[0])n=Ms,r=u.slice(1);else{const t=u.indexOf(":"),e=t>0?u.slice(2,t):u.slice(2);n=si[e]||i.dirs[e],r=t>0?u.slice(t+1):void 0}n&&(n===Is&&"ref"===r&&(n=ai),pi(t,n,s,i,r,o),t.removeAttribute(e))},pi=(t,e,s,i,n,r)=>{const o=e({el:t,get:(t=s)=>ti(i.scope,t),effect:i.effect,ctx:i,exp:s,arg:n,modifiers:r});o&&i.cleanups.push(o)},_i=(t,e)=>{if("#"===e[0]){const s=document.querySelector(e);return void t.appendChild(s.content.cloneNode(!0))}t.innerHTML=e},mi=(t,e)=>{const s=ls(as({delimiters:["{{","}}"],delimitersRE:/\{\{([^]+?)\}\}/g},e),{scope:e?e.scope:t.reactive({}),dirs:e?e.dirs:{},effects:[],blocks:[],cleanups:[],effect:e=>{if(ci)return ps(e),e;const i=t.effect(e,{scheduler:()=>ps(i)});return s.effects.push(i),i},remove:t.remove,stop:t.stop,reactive:t.reactive});return s},gi=(t,e={})=>{const s=t.scope,i=Object.create(s);Object.defineProperties(i,Object.getOwnPropertyDescriptors(e)),i.$refs=Object.create(s.$refs);const n=t.reactive(new Proxy(i,{set:(t,e,i,r)=>r!==n||Object.prototype.hasOwnProperty.call(t,e)?Reflect.set(t,e,i,r):Reflect.set(s,e,i)}));return Fi(n),ls(as({},t),{scope:n,remove:t.remove,stop:t.stop,reactive:t.reactive})},Fi=t=>{for(const e of Object.keys(t))"function"==typeof t[e]&&(t[e]=ts(t[e],t))},wi=class{constructor(t,e,s=!1){hs(this,"template"),hs(this,"ctx"),hs(this,"key"),hs(this,"parentCtx"),hs(this,"isFragment"),hs(this,"start"),hs(this,"end"),this.isFragment=t instanceof HTMLTemplateElement,s?this.template=t:this.isFragment?this.template=t.content.cloneNode(!0):this.template=t.cloneNode(!0),s?this.ctx=e:(this.parentCtx=e,e.blocks.push(this),this.ctx=mi({reactive:e.reactive,effect:e.effect,remove:e.remove,stop:e.stop},e)),di(this.template,this.ctx)}get el(){return this.start||this.template}insert(t,e=null){if(this.isFragment)if(this.start){let s,i=this.start;for(;i&&(s=i.nextSibling,t.insertBefore(i,e),i!==this.end);)i=s}else this.start=new Text(""),this.end=new Text(""),t.insertBefore(this.end,e),t.insertBefore(this.start,this.end),t.insertBefore(this.template,this.end);else t.insertBefore(this.template,e)}remove(){if(this.parentCtx&&this.parentCtx.remove(this.parentCtx.blocks,this),this.start){const t=this.start.parentNode;let e,s=this.start;for(;s&&(e=s.nextSibling,t.removeChild(s),s!==this.end);)s=e}else this.template.parentNode.removeChild(this.template);this.teardown()}teardown(){this.ctx.blocks.forEach(t=>{t.teardown()}),this.ctx.effects.forEach(this.ctx.stop),this.ctx.cleanups.forEach(t=>t())}},vi=t=>t.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),yi=(t,e)=>{const s=mi(t);if(e&&(s.scope=t.reactive(e),Fi(s.scope),e.$delimiters)){const[t,i]=s.delimiters=e.$delimiters;s.delimitersRE=new RegExp(vi(t)+"([^]+?)"+vi(i),"g")}let i;return s.scope.$s=qs,s.scope.$nextTick=fs,s.scope.$refs=Object.create(null),{directive(t,e){return e?(s.dirs[t]=e,this):s.dirs[t]},mount(t){if("string"==typeof t&&!(t=document.querySelector(t)))return;let e;return e=(t=t||document.documentElement).hasAttribute("v-scope")?[t]:[...t.querySelectorAll("[v-scope]")].filter(t=>!t.matches("[v-scope] [v-scope]")),e.length||(e=[t]),i=e.map(t=>new wi(t,s,!0)),this},unmount(){i.forEach(t=>t.teardown())}}};function bi(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}var Ei,Ci,ki=class{constructor(t){this.parent=t,this.smiley_map={angry:":@",blushing:":$",confused:"x)",cool:"8)",crying:":'(",embarrassed:":/",heart:"<3",laughing:":'D",sad:":(",sick:":S","small-smile":":)","big-smile":":D","thumbs-up":"[+1]",surprised:":o",tongue:":P",winking:";)"},this.Le={angry:"((?:=|:)(?:-)?@)",blushing:"((?:=|:)(?:-)?\\$)",cool:"(8(?:-)?\\))",confused:"(x(?:-)?\\))",crying:"((?:=|:)'(?:-)?\\()",embarrassed:"((?:=|:)(?:-)?\\/)",heart:"(<3)",laughing:"((?:=|:)(?:-)?'D)",sad:"((?:=|:)(?:-)?(?:\\(|\\|))",sick:"((?:=|:)(?:-)?S)","small-smile":"((?:=|:)(?:-)?\\))","big-smile":"((?:=|:)(?:-)?D)","thumbs-up":"(\\[\\+1\\])",surprised:"((?:=|:)(?:-)?o)",tongue:"((?:=|:)(?:-)?P)",winking:"(;(?:-)?\\))"},this.Ue()}code(t,e="small"){return this.parent.template.render("smiley",{name:t,size:e})}parse(t){let e,s,i,_,n,r=t;for(e in this.qe)if(this.qe.hasOwnProperty(e))for(s=this.qe[e];null!==(n=r.match(s));)i="small",r===n[2]&&(i="large"),_=this.code(e,i),r=r.replace(s,`$1${_}$3`);return r}count(t){let e,s,i=0,_=t;for(e in this.qe)if(this.qe.hasOwnProperty(e))for(s=this.qe[e];!0===s.test(_);)i++,_=_.replace(s,"$1[]$3");return i}name(t){let e,s,i=null;for(e in this.qe)if(this.qe.hasOwnProperty(e)&&(s=this.qe[e],t.match(s))){i=e;break}return i}Ue(){let t;for(t in this.qe={},this.Le)this.qe[t]=new RegExp(`(^|\\s|\\()${this.Le[t]}($|\\s|\\))`,"i")}},$i=class{constructor(t){this.parent=t,this.Ve=/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g}code(t,e="small"){return this.parent.template.render("emoji",{name:t,size:e})}count(t){let e=t.match(this.Ve);return e?e.length:0}parse(t){let e=this.Ne(t)?"large":"small";return t.replace(this.Ve,t=>this.code(t,e))}Ne(t){let e=this.count(t);return!(e<1||e>3)&&""===t.replace(this.Ve,"").trim()}};var Ai=function(t){return t&&t.He&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}(Ci?Ei:(Ci=1,Ei=["com","net","org","info","biz","mobi","chat","email","help","watch","name","pro","aero","asia","cat","coop","edu","gov","int","jobs","mil","museum","post","tel","travel","xxx","xyz","top","site","online","club","shop","work","app","live","store","space","website","tech","life","dev","blog","cloud","page","link","design","group","company","agency","network","media","immo","ac","ad","ae","af","ag","ai","al","am","an","ao","aq","ar","as","at","au","aw","ax","az","ba","bb","bd","be","bf","bg","bh","bi","bj","bl","bm","bn","bo","bq","br","bs","bt","bv","bw","by","bz","ca","cc","cd","cf","cg","ch","ci","ck","cl","cm","cn","co","cr","cu","cv","cw","cx","cy","cz","de","dj","dk","dm","do","dz","ec","ee","eg","eh","er","es","et","eu","fi","fj","fk","fm","fo","fr","ga","gb","gd","ge","gf","gg","gh","gi","gl","gm","gn","gp","gq","gr","gs","gt","gu","gw","gy","hk","hm","hn","hr","ht","hu","id","ie","il","im","in","io","iq","ir","is","it","je","jm","jo","jp","ke","kg","kh","ki","km","kn","kp","kr","kw","ky","kz","la","lb","lc","li","lk","lr","ls","lt","lu","lv","ly","ma","mc","md","me","mf","mg","mh","mk","ml","mm","mn","mo","mp","mq","mr","ms","mt","mu","mv","mw","mx","my","mz","na","nc","ne","nf","ng","ni","nl","no","np","nr","nu","nz","om","pa","pe","pf","pg","ph","pk","pl","pm","pn","pr","ps","pt","pw","py","qa","re","ro","rs","ru","rw","sa","sb","sc","sd","se","sg","sh","si","sj","sk","sl","sm","sn","so","sr","ss","st","su","sv","sx","sy","sz","tc","td","tf","tg","th","tj","tk","tl","tm","tn","to","tp","tr","tt","tv","tw","tz","ua","ug","uk","um","us","uy","uz","va","vc","ve","vg","vi","vn","vu","wf","ws","ye","yt","za","zm","zw"])),Bi=class{constructor(t){this.parent=t,this.We=Ai,this.Je={"&":/&/g,"<":/</g,">":/>/g,'"':/"/g},this.Ge={"&":/&/g,"<"://g,""":/"/g},this.Ke=/&#(\d+);|&#x([0-9A-Fa-f]+);/g,this.Ze={"\\\\":/\\/g,"\\t":/\t/g,"\\n":/\n/g,"\\u00A0":/\u00A0/g,""":/"/g,"'":/'/g,"_":/_/g,"*":/\*/g,"+":/\+/g,"~":/~/g},this.Ye={"<":/</g,">":/>/g},this.Qe=/[-\/\\^$*+?.()|[\]{}]/g,this.Xe=/([\#$\*\_\-+![\]\(\)`~><\.|{}])/g,this.tn=/\n(\s+)?\n(\s+)?\n/g,this.en=/\n/g,this.sn=/^([a-z]{1,20})\n((?:\n?.*)*)$/,this.nn=new RegExp("^(.+?)(?:\\s+=(?:(\\d+|auto)(?:x(\\d+|auto))?)?)?$"),this.rn=/(,|\.)(\s|$)/g,this.un=/\u0001/g,this.an=/^(www\.)/i,this.ln=/[\x00-\x1F\x7F]/g,this.hn=/^([a-zA-Z][a-zA-Z0-9+.-]*)\s*:/,this.cn={links:{prefix:"(\\s|<[^<>]+\\/>|<[^a][^<>]*>|\\(|^)",suffix:"(\\s||<[^<>]+\\/>|]*>|\\)|$)"},markdown_simple:{prefix:"(^)",suffix:"($)"},markdown_includes:{prefix:"(\\s|<[^<>]+\\/>|<[^<>]+>|\\(|^)",suffix:"(\\s|.|,|:|<[^<>]+\\/>|\\)|$)"},markdown_formatting:{prefix:"(\\s|<[^<>]+\\/>|[\\(''\"¿¡]|^)",suffix:""},markdown_list:{prefix:"(^\\s*)",suffix:"(.*?)($)"}},this.dn=["title","list","code_inline","blockquote","table","emphasis"],this.Dn=["code_block","code_inline"],this.pn=["link_text","link_image","image","frame"],this.mn=["http","https","ftp","ftps","file","mailto","tel"],this.gn=["decode_html_entities","escape","consecutive_lines","markdown","links_uri","links_domain","emails","phones","smileys","emojis","new_lines"],this.Fn={escape:this.wn,decode_html_entities:this.vn,consecutive_lines:this.yn,new_lines:this.bn,emails:this.En,phones:this.Cn,markdown:this.kn,links_domain:this.$n,links_uri:this.An,smileys:this.Bn,emojis:this.xn},this.jn={markdown_link_image:this.In,markdown_image:this.Sn,markdown_code_block:this.Rn,markdown_table:this.On},this.Tn(),this.zn()}format(t,e={},s=[]){let i,_,n=t;for(i=0;i{let i=e?parseInt(e,10):parseInt(s,16);return String.fromCharCode(i)})}yn(t,e={}){return t.replace(this.tn,"\n\n")}bn(t,e={}){let s=this.parent.template.render("new_line",{},e);return t.trim().replace(this.en,s)}En(t,e={}){return this.Pn(t,this.Ln.email,(t,s,i,_)=>`${s}${this.parent.template.render("link_email",{email:i,no_external_link:this.parent.config.runtime.no_external_link||!1},e)}${_}`)}Cn(t,e={}){return this.Pn(t,this.Ln.phone,(t,s,i,_)=>`${s}${this.parent.template.render("link_phone",{phone:i,no_external_link:this.parent.config.runtime.no_external_link||!1},e)}${_}`)}kn(t,e={}){t=`\n${t}\n`;for(let s=0;s`${s}${this.parent.template.render("link_domain",{domain_value:i,domain_name:i,no_external_link:this.parent.config.runtime.no_external_link||!1},e)}${_}`)}An(t,e={}){return this.Pn(t,this.Ln.uri,(t,s,i,_)=>{let n=!0===this.an.test(i)?`http://${i}`:i;return`${s}${this.parent.template.render("link_uri",{uri_value:n,uri_name:i,no_external_link:this.parent.config.runtime.no_external_link||!1},e)}${_}`})}Bn(t,e={}){return this.parent.Smileys.parse(t)}xn(t,e={}){return this.parent.Emojis.parse(t)}In(t){return this.qn("type",t)}Sn(t){return this.qn("value",t)}Rn(t){let e=(t.value||"").match(this.sn);e?.[1]?(t.type=e[1],t.value=e[2]):t.type="none",t.value=(t.value||"").trim()}On(t){let e=t.type.split("|"),s=e.slice(1,e.length-1).map(t=>(t||"").trim()),i=t.value.split("\n").map(t=>{let e=t.split("|"),i=e.slice(1,e.length-1).map(t=>(t||"").trim()),_=s.length-i.length;if(0!==_)if(_<0)i=i.slice(0,s.length);else for(let s=0;s<_;s++)i.push("");return i});t.type=s,t.value=i}Un(t,e={}){return(s,i,_,n,r)=>{let o=`markdown_${t[0]}`,u="",a="",l={type:null,value:null,url_crisp_image:this.parent.config.url.crisp_image,no_external_link:this.parent.config.runtime.no_external_link||!1};if(u=("string"==typeof i?i:null)||"",a=("string"==typeof r?r:null)||"",l.type=_,l.value=n,this.dn.includes(t[0])&&"string"==typeof l.value&&(l.value=l.value.trim()),this.Dn.includes(t[0])&&"string"==typeof l.value&&(l.value=this.Vn(l.value)),this.pn.includes(t[0])&&"string"==typeof l.value&&(l.value=this.sanitize_url(l.value),!l.value))return s;let h=this.jn[o]||null;return null!==h&&bi(h,this)(l),`${u}${this.parent.template.render(o,l,e)}${a}`}}Pn(t,e,s){let i=t.match(e);if(i)for(let n=0;n`${e}${s}`);t=t.replace(i[n],e)}return t.replace(e,(t,e,i,_)=>s(t,e,i,_.replace(this.un,"")))}Vn(t){let e=t;return e=this.wn(e,{},this.Ye),e=e.replace(this.Xe,t=>`&#${t.charCodeAt(0)};`),e}qn(t,e){let s=(e[t]||"").match(this.nn);if(s?.[1]&&s?.[2]&&s?.[3]){e[t]=s[1];let i=s[2],_=s[3]||i;i&&"auto"!==i&&(e.width=i),_&&"auto"!==_&&(e.height=_)}}Nn(t,e="gi",s={}){return new RegExp(`${s.prefix||""}${t}${s.suffix||""}`,e)}Tn(){this.Ln={email:this.Nn("([\\w\\._-]+@[\\w\\.\\/_-]+)","gi",this.cn.links),phone:this.Nn("(\\+[0-9]{1,3}[ \\(\\)\\-0-9]{7,20})","gi",this.cn.links),domain:this.Nn(["((?:[^<>\\(\\)\\s,@]+)(?:\\.(?:",this.We.map(bi(this.escape_regex,this)).join("|"),")))"].join(""),"gim",this.cn.links),uri:this.Nn("((?:(?:(?:https?|ftps?|file):)|(?:www\\.))(?:[^<>\\(\\)\\s]+))","gim",this.cn.links)}}zn(){this.Mn=[["code_block",this.Nn("(`{2,3})((?:\\n+)?(?:(?!\\2).(?:\\n+)?)*)(?:\\2)","gi",{prefix:"(\\s|<[^<>]+\\/>|^)",suffix:"(\\s|\\.|,|:|$)"})],["code_inline",this.Nn("(`{1})([^`]*)(?:\\2)","gim",{prefix:"(\\s|<[^<>]+\\/>|\\(|^)",suffix:"(\\s|\\.|,|:|\\)|<\\/[^<>]+>|$)"})],["title",this.Nn("(#{1})(?:[\\s]+)([^#].*)","gim",this.cn.markdown_simple)],["title",this.Nn("(#{2})(?:[\\s]+)([^#].*)","gim",this.cn.markdown_simple)],["title",this.Nn("(#{3})(?:[\\s]+)([^#].*)","gim",this.cn.markdown_simple)],["title",this.Nn("(#{4})(?:[\\s]+)([^#].*)","gim",this.cn.markdown_simple)],["title",this.Nn("(#{5})(?:[\\s]+)([^#].*)","gim",this.cn.markdown_simple)],["title",this.Nn("(#{6})(?:[\\s]+)([^#].*)","gim",this.cn.markdown_simple)],["link_image",this.Nn("\\[!\\[(?:[^\\[]*)\\]\\(([^\\)]+)\\)\\]\\(([^\\)]+)\\)","gim",this.cn.markdown_includes)],["image",this.Nn("!\\[([^\\[]*)\\]\\(([^\\)]+)\\)","gim",this.cn.markdown_includes)],["link_text",this.Nn("\\[([^\\[]+)\\]\\(([^\\)]+)\\)","gim",{prefix:"(\\s|<[^<>]+\\/>|<[^a][^<>]*>|\\(|^)",suffix:"(\\s|.|,|:|<[^<>]+\\/>|]*>|\\)|$)"})],["youtube",this.Nn("\\$\\{youtube\\}\\[([^\\[]*)\\]\\(([^\\)]+)\\)","gim",this.cn.markdown_includes)],["vimeo",this.Nn("\\$\\{vimeo\\}\\[([^\\[]*)\\]\\(([^\\)]+)\\)","gim",this.cn.markdown_includes)],["dailymotion",this.Nn("\\$\\{dailymotion\\}\\[([^\\[]*)\\]\\(([^\\)]+)\\)","gim",this.cn.markdown_includes)],["frame",this.Nn("\\$\\{frame\\}\\[([^\\[]*)\\]\\(([^\\)]+)\\)","gim",this.cn.markdown_includes)],["bold",this.Nn("(\\*\\*)(.*?)(?:\\2)","gim",this.cn.markdown_formatting)],["underline",this.Nn("(__)(.*?)(?:\\2)","gim",this.cn.markdown_formatting)],["italic",this.Nn("(\\*|_)(.*?)(?:\\2)","gim",this.cn.markdown_formatting)],["delete",this.Nn("(\\~\\~)(.*?)(?:\\2)","gim",this.cn.markdown_formatting)],["highlight",this.Nn("(\\+\\+)(.*?)(?:\\2)","gim",this.cn.markdown_formatting)],["list",this.Nn("(\\*)(?:[\\s]+)","gim",this.cn.markdown_list)],["list",this.Nn("(?:([\\d]{1,2})\\.)(?:[\\s]+)","gim",this.cn.markdown_list)],["blockquote",this.Nn("(>|\\>)(?:[\\s]+)(.*)","gim",this.cn.markdown_simple)],["table",this.Nn("(?:(\\|(?:[^\\|\\r\\n]{0,999}\\|){1,19})(?: *\\n)(?:\\|(?: *\\-{1,99} *\\|){1,19}))((?: *\\n\\|(?:[^\\|\\r\\n]{0,999}\\|){1,19}){1,49})","gi",{prefix:"(\\s|^)",suffix:"(\\s|$)"})],["emphasis",this.Nn("(\\|{1})(?:[\\s]+)([^\\|].*)","gim",this.cn.markdown_simple)],["emphasis",this.Nn("(\\|{2})(?:[\\s]+)([^\\|].*)","gim",this.cn.markdown_simple)],["emphasis",this.Nn("(\\|{3})(?:[\\s]+)([^\\|].*)","gim",this.cn.markdown_simple)],["interpolate",this.Nn('(?:\\{\\{\\s*)([^\\{\\}\\|\\s]+)(?:\\s*\\|\\s*(?:(?:")|")([^&"]*)(?:(?:")|"))?(?:\\s*\\}\\})',"gim",{prefix:"(\\s|\\(|^)",suffix:""})],["line",this.Nn("(-{3,})","gim",{prefix:"(^)(\\s+)?",suffix:"(\\s|$)"})],["color",this.Nn("\\$\\{color\\}\\[(#[0-9A-Fa-f]{6})\\]\\(([^\\)]+)\\)","gim",this.cn.markdown_includes)]]}},xi=class{constructor(t){this.parent=t,this.Hn=/^(\S+)((?:\s+)(.+))?$/}parse_first_name(t){return this.Wn(t,1)}parse_last_name(t){return this.Wn(t,3)}Wn(t,e){let s=(t||"").trim();if(s){let t=s.match(this.Hn);t?.[e]&&(s=t[e].trim())}return s}},ji=class{constructor(t){this.parent=t,this.Jn={type:"none",decision:"index"}}evaluate_filters(t,e="",s=""){for(let i=0;i{let s=this[`render_${t}`];if("function"==typeof s)return function(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}(s,this)(e);throw new Error(`Render service is missing for: ${t}`)}},config:{url:{crisp_image:Me.URL_IMAGE},runtime:{}}})}parse(){return Ii.Parse}name(){return Ii.Name}smileys(){return Ii.Smileys}page(){return Ii.Page}html(t){return this.parse().html(t)}attribute(t){return this.parse().attribute(t)}lower(t){return(t||"").toLowerCase()}filterLinkSafe(t){let e="#";return t&&!1===Oi.test(t)&&(e=t),e}getLinkTarget(){return!0===wu.base.runtime?.mobile_sdk?"":"_blank"}render_new_line(){return'
'}render_link_email(t){let e=this.getLinkTarget();return`${t.email}`}render_link_phone(t){let e=this.getLinkTarget();return`${t.phone}`}render_link_uri(t){let e=this.getLinkTarget();return`${t.uri_name}`}render_link_domain(t){let e=this.getLinkTarget();return`${t.domain_name}`}render_markdown_blockquote(t){return`${t.value}`}render_markdown_table(t){return'
'+t.type.map(t=>``).join("")+""+t.value.map(t=>""+t.map(t=>``).join("")+"").join("")+"
${t}
${t}
"}render_markdown_interpolate(t){return`{{ ${t.type}${t.value?' | "'+t.value+'"':""} }}`}render_markdown_color(t){return`${t.value}`}render_markdown_bold(t){return`${t.value}`}render_markdown_code_inline(t){return`${t.value}`}render_markdown_code_block(t){return`${t.value}`}render_markdown_delete(t){return`${t.value}`}render_markdown_highlight(t){return`${t.value}`}render_markdown_image(t){return`${this.attribute(t.type)}`}render_markdown_italic(t){return`${t.value}`}render_markdown_underline(t){return`${t.value}`}render_markdown_line(){return''}render_markdown_link_text(t){let e=this.getLinkTarget();return`${t.type}`}render_markdown_link_image(t){let e=this.getLinkTarget();return``}render_markdown_list(t){return`${t.value}`}render_markdown_title(t){return`${t.value}`}render_markdown_emphasis(t){return`${t.value}`}render_markdown_youtube(t){let e=`https://www.youtube.com/embed/${encodeURIComponent(t.value)}?autoplay=1&rel=0`,s=encodeURIComponent(`https://img.youtube.com/vi/${encodeURIComponent(t.value)}/hqdefault.jpg`),i=this.getLinkTarget();return`${this.attribute(t.type)}`}render_markdown_vimeo(t){let e=`https://vimeo.com/${encodeURIComponent(t.value)}?autoplay=1`,s=this.getLinkTarget();return`${t.type||e}`}render_markdown_dailymotion(t){let e=`https://www.dailymotion.com/embed/video/${encodeURIComponent(t.value)}`,s=encodeURIComponent(`https://www.dailymotion.com/thumbnail/video/${encodeURIComponent(t.value)}`),i=this.getLinkTarget();return`${this.attribute(t.type)}`}render_markdown_frame(t){let e=this.getLinkTarget();return`${t.type||t.value}`}render_smiley(t){return``}render_emoji(t){return`${t.name}`}};function zi(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}function Pi(t){return t&&t.t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Li=Pi(function(){if(Ri)return Si;Ri=1;var t=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];return Si=function(s){var i,n,r=s,o=s.indexOf("["),u=s.indexOf("]");-1!=o&&-1!=u&&(s=s.substring(0,o)+s.substring(o,u).replace(/:/g,";")+s.substring(u,s.length));for(var a,l,h=t.exec(s||""),c={},d=14;d--;)c[e[d]]=h[d]||"";return-1!=o&&-1!=u&&(c.source=r,c.host=c.host.substring(1,c.host.length-1).replace(/;/g,":"),c.authority=c.authority.replace("[","").replace("]","").replace(/;/g,":"),c.ipv6uri=!0),c.pathNames=(n=(i=c.path).replace(/\/{2,9}/g,"/").split("/"),"/"!=i.substr(0,1)&&0!==i.length||n.splice(0,1),"/"==i.substr(i.length-1,1)&&n.splice(n.length-1,1),n),c.queryKey=(a=c.query,l={},a.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,e,s){e&&(l[e]=s)}),l),c},Si}()),Mi=Object.create(null);Mi.open="0",Mi.close="1",Mi.ping="2",Mi.pong="3",Mi.message="4",Mi.upgrade="5",Mi.noop="6";var Ui=Object.create(null);Object.keys(Mi).forEach(t=>{Ui[Mi[t]]=t});var qi={type:"error",data:"parser error"},Vi="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),Ni="function"==typeof ArrayBuffer,Hi=({type:t,data:e},s,i)=>{return Vi&&e instanceof Blob?s?i(e):Wi(e,i):Ni&&(e instanceof ArrayBuffer||(n=e,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer))?s?i(e):Wi(new Blob([e]),i):i(Mi[t]+(e||""));var n},Wi=(t,e)=>{const s=new FileReader;return s.onload=function(){const t=s.result.split(",")[1];e("b"+(t||""))},s.readAsDataURL(t)},Ji="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let Da=0;Da<64;Da++)Ji["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Da)]=Da;var _,Gi="function"==typeof ArrayBuffer,Ki=(t,e)=>Gi?Zi((t=>{let e,s,i,n,r,o=.75*t.length,u=t.length,a=0;"="===t[t.length-1]&&(o--,"="===t[t.length-2]&&o--);const l=new ArrayBuffer(o),h=new Uint8Array(l);for(e=0;e>4,h[a++]=(15&i)<<4|n>>2,h[a++]=(3&n)<<6|63&r;return l})(t),e):{base64:!0,data:t},Zi=(t,e)=>"blob"===e&&t instanceof ArrayBuffer?new Blob([t]):t,Yi={};var Qi=function(){if(_)return Yi;function t(e){if(e)return function(e){for(var s in t.prototype)e[s]=t.prototype[s];return e}(e)}return _=1,Yi.Emitter=t,t.prototype.on=t.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},t.prototype.once=function(t,e){function s(){this.off(t,s),e.apply(this,arguments)}return s.fn=e,this.on(t,s),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var s,i=this._callbacks["$"+t];if(!i)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var n=0;n=57344?s+=3:(i++,s+=4);return s}(t):Math.ceil(1.33*(t.byteLength||t.size))}var rn,on=class extends Error{constructor(t,e,s){super(t),this.description=e,this.context=s,this.type="TransportError"}},un=class extends Qi.Emitter{constructor(t){super(),this.writable=!1,sn(this,t),this.opts=t,this.query=t.query,this.readyState="",this.socket=t.socket}onError(t,e,s){return super.emitReserved("error",new on(t,e,s)),this}open(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const e=((t,e)=>{if("string"!=typeof t)return{type:"message",data:Zi(t,e)};const s=t.charAt(0);return"b"===s?{type:"message",data:Ki(t.substring(1),e)}:Ui[s]?t.length>1?{type:Ui[s],data:t.substring(1)}:{type:Ui[s]}:qi})(t,this.socket.binaryType);this.onPacket(e)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}},an="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),ln=0;function hn(t){let e="";do{e=an[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}var $="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),cn=Xi.WebSocket||Xi.MozWebSocket,dn="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase(),Dn={websocket:class t extends un{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),e=this.opts.protocols,s=dn?{}:function(t,...e){return e.reduce((e,s)=>(t.hasOwnProperty(s)&&(e[s]=t[s]),e),{})}(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=dn?new cn(t,e,s):e?new cn(t,e):new cn(t)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let e=0;e{try{this.ws.send(t)}catch(t){}i&&$(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){let t=this.query||{};const e=this.opts.secure?"wss":"ws";let s="";this.opts.port&&("wss"===e&&443!==Number(this.opts.port)||"ws"===e&&80!==Number(this.opts.port))&&(s=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=function(){const t=hn(+new Date);return t!==rn?(ln=0,rn=t):t+"."+hn(ln++)}()),this.supportsBinary||(t.b64=1);const i=function(t){let e="";for(let s in t)t.hasOwnProperty(s)&&(e.length&&(e+="&"),e+=encodeURIComponent(s)+"="+encodeURIComponent(t[s]));return e}(t);return e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+s+this.opts.path+(i.length?"?"+i:"")}check(){return!(!cn||"i"in cn&&this.name===t.prototype.name)}}},fn=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,pn=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function _n(t){const e=t,s=t.indexOf("["),i=t.indexOf("]");-1!=s&&-1!=i&&(t=t.substring(0,s)+t.substring(s,i).replace(/:/g,";")+t.substring(i,t.length));let n=fn.exec(t||""),r={},o=14;for(;o--;)r[pn[o]]=n[o]||"";return-1!=s&&-1!=i&&(r.source=e,r.host=r.host.substring(1,r.host.length-1).replace(/;/g,":"),r.authority=r.authority.replace("[","").replace("]","").replace(/;/g,":"),r.ipv6uri=!0),r.pathNames=function(t,e){const s=e.replace(/\/{2,9}/g,"/").split("/");return"/"!=e.substr(0,1)&&0!==e.length||s.splice(0,1),"/"==e.substr(e.length-1,1)&&s.splice(s.length-1,1),s}(0,r.path),r.queryKey=function(t,e){const s={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(t,e,i){e&&(s[e]=i)}),s}(0,r.query),r}var mn,gn=class t extends Qi.Emitter{constructor(t,e={}){super(),t&&"object"==typeof t&&(e=t,t=null),t?(t=_n(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=_n(e.host).host),sn(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},e),this.opts.path=this.opts.path.replace(/\/$/,"")+"/","string"==typeof this.opts.query&&(this.opts.query=function(t){let e={},s=t.split("&");for(let i=0,n=s.length;i{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){const e=function(t){const e={};for(let s in t)t.hasOwnProperty(s)&&(e[s]=t[s]);return e}(this.opts.query);e.EIO=4,e.transport=t,this.id&&(e.sid=this.id);const s=Object.assign({},this.opts.transportOptions[t],this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Dn[t](s)}open(){let e;if(this.opts.rememberUpgrade&&t.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(t){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",zi(this.onDrain,this)).on("packet",zi(this.onPacket,this)).on("error",zi(this.onError,this)).on("close",t=>this.onClose("transport close",t))}probe(e){let s=this.createTransport(e),i=!1;t.priorWebsocketSuccess=!1;const n=()=>{i||(s.send([{type:"ping",data:"probe"}]),s.once("packet",e=>{if(!i)if("pong"===e.type&&"probe"===e.data){if(this.upgrading=!0,this.emitReserved("upgrading",s),!s)return;t.priorWebsocketSuccess="websocket"===s.name,this.transport.pause(()=>{i||"closed"!==this.readyState&&(h(),this.setTransport(s),s.send([{type:"upgrade"}]),this.emitReserved("upgrade",s),s=null,this.upgrading=!1,this.flush())})}else{const t=new Error("probe error");t.transport=s.name,this.emitReserved("upgradeError",t)}}))};function r(){i||(i=!0,h(),s.close(),s=null)}const o=t=>{const e=new Error("probe error: "+t);e.transport=s.name,r(),this.emitReserved("upgradeError",e)};function u(){o("transport closed")}function a(){o("socket closed")}function l(t){s&&t.name!==s.name&&r()}const h=()=>{s.removeListener("open",n),s.removeListener("error",o),s.removeListener("close",u),this.off("close",a),this.off("upgrading",l)};s.once("open",n),s.once("error",o),s.once("close",u),this.once("close",a),this.once("upgrading",l),s.open()}onOpen(){if(this.readyState="open",t.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause){let t=0;const e=this.upgrades.length;for(;t{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let e=0;e0&&t>this.maxPayload)return this.writeBuffer.slice(0,e);t+=2}return this.writeBuffer}write(t,e,s){return this.sendPacket("message",t,e,s),this}send(t,e,s){return this.sendPacket("message",t,e,s),this}sendPacket(t,e,s,i){if("function"==typeof e&&(i=e,e=void 0),"function"==typeof s&&(i=s,s=null),"closing"===this.readyState||"closed"===this.readyState)return;(s=s||{}).compress=!1!==s.compress;const n={type:t,data:e,options:s};this.emitReserved("packetCreate",n),this.writeBuffer.push(n),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},s=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():t()}):this.upgrading?s():t()),this}onError(e){t.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const e=[];let s=0;const i=t.length;for(;s0;case mn.ACK:case mn.BINARY_ACK:return Array.isArray(e)}}destroy(){}},wn=Object.freeze({__proto__:null,Decoder:Fn,Encoder:class{encode(t){return[this.encodeAsString(t)]}encodeAsString(t){let e=""+t.type;return t.type!==mn.BINARY_EVENT&&t.type!==mn.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data)),e}},get PacketType(){return mn},protocol:5});function vn(t,e,s){return t.on(e,s),function(){t.off(e,s)}}var yn,bn,En=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),Cn=class extends Qi.Emitter{constructor(t,e,s){super(),this.connected=!1,this.disconnected=!0,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,s&&s.auth&&(this.auth=s.auth),this.io._autoConnect&&this.open()}subEvents(){if(this.subs)return;const t=this.io;this.subs=[vn(t,"open",zi(this.onopen,this)),vn(t,"packet",zi(this.onpacket,this)),vn(t,"error",zi(this.onerror,this)),vn(t,"close",zi(this.onclose,this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(En.hasOwnProperty(t))throw new Error('"'+t+'" is a reserved event name');e.unshift(t);const s={type:mn.EVENT,data:e,options:{}};if(s.options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]){const t=this.ids++,i=e.pop();this._registerAckCallback(t,i),s.id=t}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?this.packet(s):this.sendBuffer.push(s)),this.flags={},this}_registerAckCallback(t,e){const s=this.flags.timeout;if(void 0===s)return void(this.acks[t]=e);const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let e=0;e{this.io.clearTimeoutFn(i),e.apply(this,[null,...t])}}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth(t=>{this.packet({type:mn.CONNECT,data:t})}):this.packet({type:mn.CONNECT,data:this.auth})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t){this.connected=!1,this.disconnected=!0,delete this.id,this.emitReserved("disconnect",t)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case mn.CONNECT:if(t.data&&t.data.sid){const e=t.data.sid;this.onconnect(e)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case mn.EVENT:this.onevent(t);break;case mn.BINARY_EVENT:break;case mn.ACK:this.onack(t);break;case mn.BINARY_ACK:break;case mn.DISCONNECT:this.ondisconnect();break;case mn.CONNECT_ERROR:this.destroy();const e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){const e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const s of e)s.apply(this,t)}super.emit.apply(this,t)}ack(t){const e=this;let s=!1;return function(...i){s||(s=!0,e.packet({type:mn.ACK,id:t,data:i}))}}onack(t){const e=this.acks[t.id];"function"==typeof e&&(e.apply(this,t.data),delete this.acks[t.id])}onconnect(t){this.id=t,this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>this.packet(t)),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:mn.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const e=this._anyListeners;for(let s=0;s0&&t.jitter<=1?t.jitter:0,this.attempts=0}return bn=1,yn=t,t.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),s=Math.floor(e*this.jitter*t);t=1&Math.floor(10*e)?t+s:t-s}return 0|Math.min(t,this.max)},t.prototype.reset=function(){this.attempts=0},t.prototype.setMin=function(t){this.ms=t},t.prototype.setMax=function(t){this.max=t},t.prototype.setJitter=function(t){this.jitter=t},yn}()),$n=class extends Qi.Emitter{constructor(t,e){var s;super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.opts=e,sn(this,e),this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(s=e.randomizationFactor)&&void 0!==s?s:.5),this.backoff=new kn({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this._readyState="closed",this.uri=t;const i=e.parser||wn;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=!1!==e.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null===(e=this.backoff)||void 0===e||e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null===(e=this.backoff)||void 0===e||e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null===(e=this.backoff)||void 0===e||e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new gn(this.uri,this.opts);const e=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=vn(e,"open",function(){s.onopen(),t&&t()}),n=vn(e,"error",e=>{s.cleanup(),s._readyState="closed",this.emitReserved("error",e),t?t(e):s.maybeReconnectOnOpen()});if(!1!==this._timeout){const t=this._timeout;0===t&&i();const s=this.setTimeoutFn(()=>{i(),e.close(),e.emit("error",new Error("timeout"))},t);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}return this.subs.push(i),this.subs.push(n),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(vn(t,"ping",zi(this.onping,this)),vn(t,"data",zi(this.ondata,this)),vn(t,"error",zi(this.onerror,this)),vn(t,"close",zi(this.onclose,this)),vn(this.decoder,"decoded",zi(this.ondecoded,this)))}onping(){this.emitReserved("ping")}ondata(t){this.decoder.add(t)}ondecoded(t){this.emitReserved("packet",t)}onerror(t){this.emitReserved("error",t)}socket(t,e){let s=this.nsps[t];return s||(s=new Cn(this,t,e),this.nsps[t]=s),s}_destroy(t){const e=Object.keys(this.nsps);for(const s of e)if(this.nsps[s].active)return;this._close()}_packet(t){const e=this.encoder.encode(t);for(let s=0;st()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const e=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect||t.open(e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()}))},e);this.opts.autoUnref&&s.unref(),this.subs.push(function(){clearTimeout(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}},An={};function Bn(t,e){"object"==typeof t&&(e=t,t=void 0);const s=function(t,e="",s){let i=t;s=s||"undefined"!=typeof location&&location,t??=s.protocol+"//"+s.host,"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?s.protocol+t:s.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==s?s.protocol+"//"+t:"https://"+t),i=Li(t)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port="80":/^(http|ws)s$/.test(i.protocol)&&(i.port="443")),i.path=i.path||"/";const n=-1!==i.host.indexOf(":")?"["+i.host+"]":i.host;return i.id=i.protocol+"://"+n+":"+i.port+e,i.href=i.protocol+"://"+n+(s&&s.port===i.port?"":":"+i.port),i}(t,(e=e||{}).path||"/socket.io"),i=s.source,n=s.id,r=s.path,o=An[n]&&r in An[n].nsps;let u;return e.forceNew||e["force new connection"]||!1===e.multiplex||o?u=new $n(i,e):(An[n]||(An[n]=new $n(i,e)),u=An[n]),s.query&&!e.query&&(e.query=s.queryKey),u.socket(s.path,e)}Object.assign(Bn,{Manager:$n,Socket:Cn,io:Bn,connect:Bn});var xn="invalid",jn="undefined"!=typeof ArrayBuffer,In="0123456789abcdef".split(""),Sn=[-2147483648,8388608,32768,128],Rn=[24,16,8,0],On=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Tn=[];function zn(t){t?(Tn[0]=Tn[16]=Tn[1]=Tn[2]=Tn[3]=Tn[4]=Tn[5]=Tn[6]=Tn[7]=Tn[8]=Tn[9]=Tn[10]=Tn[11]=Tn[12]=Tn[13]=Tn[14]=Tn[15]=0,this.blocks=Tn):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}function Pn(t,e){var s,i=typeof t;if("string"===i){var n,r=[],o=t.length,u=0;for(s=0;s>6,r[u++]=128|63&n):n<55296||n>=57344?(r[u++]=224|n>>12,r[u++]=128|n>>6&63,r[u++]=128|63&n):(n=65536+((1023&n)<<10|1023&t.charCodeAt(++s)),r[u++]=240|n>>18,r[u++]=128|n>>12&63,r[u++]=128|n>>6&63,r[u++]=128|63&n);t=r}else{if("object"!==i)throw new Error(xn);if(null===t)throw new Error(xn);if(jn&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||jn&&ArrayBuffer.isView(t)))throw new Error(xn)}t.length>64&&(t=new zn(!0).update(t).digest());var a=[],l=[];for(s=0;s<64;++s){var h=t[s]||0;a[s]=92^h,l[s]=54^h}zn.call(this,e),this.update(l),this.oKeyPad=a,this.inner=!0,this.memory=e}zn.prototype.update=function(t){if(!this.finalized){var e,s=typeof t;if("string"!==s){if("object"!==s)throw new Error(xn);if(null===t)throw new Error(xn);if(jn&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||jn&&ArrayBuffer.isView(t)))throw new Error(xn);e=!0}for(var i,n,r=0,o=t.length,u=this.blocks;r>2]|=t[r]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(u[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=64?(this.block=u[16],this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},zn.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>2]|=Sn[3&e],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}},zn.prototype.hash=function(){var t,e,s,i,n,r,o,u,a,l=this.h0,h=this.h1,c=this.h2,d=this.h3,D=this.h4,f=this.h5,p=this.h6,_=this.h7,m=this.blocks;for(t=16;t<64;++t)e=((n=m[t-15])>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,s=((n=m[t-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,m[t]=m[t-16]+e+m[t-7]+s|0;for(a=h&c,t=0;t<64;t+=4)this.first?(r=704751109,_=(n=m[0]-210244248)-1521486534|0,d=n+143694565|0,this.first=!1):(e=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),i=(r=l&h)^l&c^a,_=d+(n=_+(s=(D>>>6|D<<26)^(D>>>11|D<<21)^(D>>>25|D<<7))+(D&f^~D&p)+On[t]+m[t])|0,d=n+(e+i)|0),e=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),i=(o=d&l)^d&h^r,p=c+(n=p+(s=(_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&D^~_&f)+On[t+1]+m[t+1])|0,e=((c=n+(e+i)|0)>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),i=(u=c&d)^c&l^o,f=h+(n=f+(s=(p>>>6|p<<26)^(p>>>11|p<<21)^(p>>>25|p<<7))+(p&_^~p&D)+On[t+2]+m[t+2])|0,e=((h=n+(e+i)|0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),i=(a=h&c)^h&d^u,D=l+(n=D+(s=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(f&p^~f&_)+On[t+3]+m[t+3])|0,l=n+(e+i)|0;this.h0=this.h0+l|0,this.h1=this.h1+h|0,this.h2=this.h2+c|0,this.h3=this.h3+d|0,this.h4=this.h4+D|0,this.h5=this.h5+f|0,this.h6=this.h6+p|0,this.h7=this.h7+_|0},zn.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,s=this.h2,i=this.h3,n=this.h4,r=this.h5,o=this.h6,u=this.h7;return In[t>>28&15]+In[t>>24&15]+In[t>>20&15]+In[t>>16&15]+In[t>>12&15]+In[t>>8&15]+In[t>>4&15]+In[15&t]+In[e>>28&15]+In[e>>24&15]+In[e>>20&15]+In[e>>16&15]+In[e>>12&15]+In[e>>8&15]+In[e>>4&15]+In[15&e]+In[s>>28&15]+In[s>>24&15]+In[s>>20&15]+In[s>>16&15]+In[s>>12&15]+In[s>>8&15]+In[s>>4&15]+In[15&s]+In[i>>28&15]+In[i>>24&15]+In[i>>20&15]+In[i>>16&15]+In[i>>12&15]+In[i>>8&15]+In[i>>4&15]+In[15&i]+In[n>>28&15]+In[n>>24&15]+In[n>>20&15]+In[n>>16&15]+In[n>>12&15]+In[n>>8&15]+In[n>>4&15]+In[15&n]+In[r>>28&15]+In[r>>24&15]+In[r>>20&15]+In[r>>16&15]+In[r>>12&15]+In[r>>8&15]+In[r>>4&15]+In[15&r]+In[o>>28&15]+In[o>>24&15]+In[o>>20&15]+In[o>>16&15]+In[o>>12&15]+In[o>>8&15]+In[o>>4&15]+In[15&o]+In[u>>28&15]+In[u>>24&15]+In[u>>20&15]+In[u>>16&15]+In[u>>12&15]+In[u>>8&15]+In[u>>4&15]+In[15&u]},zn.prototype.toString=zn.prototype.hex,zn.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,s=this.h2,i=this.h3,n=this.h4,r=this.h5,o=this.h6,u=this.h7;return[t>>24&255,t>>16&255,t>>8&255,255&t,e>>24&255,e>>16&255,e>>8&255,255&e,s>>24&255,s>>16&255,s>>8&255,255&s,i>>24&255,i>>16&255,i>>8&255,255&i,n>>24&255,n>>16&255,n>>8&255,255&n,r>>24&255,r>>16&255,r>>8&255,255&r,o>>24&255,o>>16&255,o>>8&255,255&o,u>>24&255,u>>16&255,u>>8&255,255&u]},Pn.prototype=new zn,Pn.prototype.finalize=function(){if(zn.prototype.finalize.call(this),this.inner){this.inner=!1;var t=this.digest();zn.call(this,this.memory),this.update(this.oKeyPad),this.update(t),zn.prototype.finalize.call(this)}};var Ln,Mn=((Ln=function(t){return new zn(!0).update(t).hex()}).create=function(){return new zn},Ln.update=function(t){return Ln.create().update(t)},Ln);Mn.hmac=function(){var t=function(t,e){return new Pn(t,!0).update(e).hex()};return t.create=function(t){return new Pn(t)},t.update=function(e,s){return t.create(e).update(s)},t}();var Un,qn={exports:{}},Vn=qn.exports;var Nn=Pi(function(){return Un||(Un=1,t=qn,i=function(t){if("object"!=typeof t.document)throw new Error("Cookies.js requires a `window` with a `document` object");var e=function(t,s,i){return 1===arguments.length?e.get(t):e.set(t,s,i)};return e._document=t.document,e._cacheKeyPrefix="cookey.",e._maxExpireDate=new Date("Fri, 31 Dec 9999 23:59:59 UTC"),e.defaults={path:"/",secure:!1},e.get=function(t){e._cachedDocumentCookie!==e._document.cookie&&e._renewCache();var i=e._cache[e._cacheKeyPrefix+t];return i===s?s:decodeURIComponent(i)},e.set=function(t,i,n){return(n=e._getExtendedOptions(n)).expires=e._getExpiresDate(i===s?-1:n.expires),e._document.cookie=e._generateCookieString(t,i,n),e},e.expire=function(t,i){return e.set(t,s,i)},e._getExtendedOptions=function(t){return{path:t&&t.path||e.defaults.path,domain:t&&t.domain||e.defaults.domain,expires:t&&t.expires||e.defaults.expires,secure:t&&t.secure!==s?t.secure:e.defaults.secure}},e._isValidDate=function(t){return"[object Date]"===Object.prototype.toString.call(t)&&!isNaN(t.getTime())},e._getExpiresDate=function(t,s){if(s=s||new Date,"number"==typeof t?t=t===1/0?e._maxExpireDate:new Date(s.getTime()+1e3*t):"string"==typeof t&&(t=new Date(t)),t&&!e._isValidDate(t))throw new Error("`expires` parameter cannot be converted to a valid Date instance");return t},e._generateCookieString=function(t,e,s){var i=(t=(t=t.replace(/[^#$&+\^`|]/g,encodeURIComponent)).replace(/\(/g,"%28").replace(/\)/g,"%29"))+"="+(e=(e+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent));return i+=(s=s||{}).path?";path="+s.path:"",i+=s.domain?";domain="+s.domain:"",(i+=s.expires?";expires="+s.expires.toUTCString():"")+(s.secure?";secure":"")},e._getCacheFromString=function(t){for(var i={},n=t?t.split("; "):[],r=0;r0&&s<=(new Date).getTime()?(e=void 0,"function"==typeof window.localStorage.removeItem&&(window.localStorage.removeItem(t),window.localStorage.removeItem(`${t}:e`))):e=window.localStorage.getItem(t)}}catch{}return void 0!==e?e:null}_set(t,e,s={}){this.parent.cookie.set(t,e,s);try{window.localStorage&&"function"==typeof window.localStorage.setItem&&(window.localStorage.setItem(`${t}:e`,void 0!==s.expires?(new Date).getTime()+s.expires:0),window.localStorage.setItem(t,e))}catch{}}_expire(t,e={}){this.parent.cookie.expire(t,e);try{window.localStorage&&"function"==typeof window.localStorage.removeItem&&(window.localStorage.removeItem(t),window.localStorage.removeItem(`${t}:e`))}catch{}}},Jn=class{constructor(t){this.parent=t,this.h()}setTimeout(t,e=0){let s=setTimeout(()=>{delete this.o[s],t()},e);return this.o[s]=s,s}clearTimeout(t){t in this.o&&(clearTimeout(this.o[t]),delete this.o[t])}setInterval(t,e=0){let s=setInterval(t,e);return this.l[s]=s,s}clearInterval(t){t in this.l&&(clearInterval(this.l[t]),delete this.l[t])}reset(){for(let t in this.o)this.clearTimeout(t);for(let t in this.l)this.clearInterval(t);this.h()}h(){this.o={},this.l={}}},Gn=class{constructor(t){this.parent=t,this.h()}addEventListener(t,e,s,i={}){return window[t].addEventListener(e,s,i),this.u.push({instanceName:t,eventName:e,fnHandler:s,options:i}),s}removeEventListener(t,e,s){let i=this.u.find(i=>i.eventName===e&&i.instanceName===t&&i.fnHandler===s);i&&(i.fnHandler&&window[t].removeEventListener(e,i.fnHandler,i.options),this.u=this.u.filter(i=>i.eventName!==e||i.instanceName!==t||i.fnHandler!==s))}reset(){for(let t in this.u)this.removeEventListener(t.instanceName,t.eventName,t.fnHandler);this.h()}h(){this.u=[]}},Kn=class{constructor(t){this.parent=t,this.h(),this.p()}getState(){this._(this.parent.socket.connected||!1)}reset(){this.h()}h(){this.m=!1,this.v=!1}p(){this.parent.socket.on("connect",()=>{this.m=!0,this._(!0)}),this.parent.socket.on("disconnect",()=>{this._(!1)}),this.parent.socket.on("connect_error",t=>{"TransportError"===t?.type&&this.k()}),this.parent.socket.io.on("reconnect_failed",()=>{this._(!1,!0)})}_(t=!0,e=!1){this.parent.event.emit("socket:state",{connected:t,failed_reconnect:e})}k(){this.parent.ioRelayRescueClient?.url&&!0!==this.m&&!0!==this.v&&!0!==this.parent.socket.connected&&(this.v=!0,this.parent.socket.disconnect(),this.parent.socket.io.uri=this.parent.ioRelayRescueClient.url,this.parent.socket.io.opts.path=this.parent.ioRelayRescueClient.path,this.parent.event.emit("socket:rescued",{}))}},Zn=class{constructor(t){this.parent=t,this.h(),this.p()}reset(){this.h()}_bindTo(t,e,s,i=null,n=null){this.S=t,this.u=e,this.A=s,this.M=i,this.C=n,!0!==this.D?this.parent.stream.connect():this.R()}_unbindFrom(){this.j(),this.parent.stream.disconnect()}h(){this.D=!1,this.S=null,this.u=[],this.A={},this.M=null,this.C=null,this.$=null,this.q=null}p(){this.parent.stream.on("connect",()=>{this.D=!0,this.R()}),this.parent.stream.on("disconnect",()=>{this.D=!1,this.O()}),this.parent.stream.on("socket:bound",()=>{this.I()})}R(){if(this.$!==this.S||this.q!==this.u){this.$=this.S,this.q=this.u;let t=[];this.$&&t.push(this.$),this.parent.stream.emit("socket:bind",{ray:"client",events:this.q,rooms:t,context:this.A})}else this.I()}O(){null!==this.C&&this.C(),this.j(),this.$=null,this.q=null}I(){null!==this.M&&this.M(),this.j()}j(){this.S=null,this.u=[],this.A={},this.M=null,this.C=null}},Yn="crisp-client",Qn=class{constructor(t){this.parent=t,this.h()}init(){this.p()}getStampLocal(t,e=[]){let s=this._generateStoreKey(t,e);return"object"==typeof window.localStorage&&window.localStorage.getItem(s)||""}setStampLocal(t,e=[],s=""){let i=this._generateStoreKey(t,e);return"object"==typeof window.localStorage&&(window.localStorage.setItem(i,s),!0)}reset(){this.T(),this.h()}_update(t,e,s=null,i=function(){},n=function(){}){s=this.parent.Session._getEffectiveSessionId(s);let r={session_id:this.parent.Session._getChildSessionIdOrNone(s),ray:this.N(t),type:t,data:e};this.U(s).push(r.ray),this.P(s)[r.ray]={success:i,error:n},this.parent.socket.emit("storage:sync:update",r),this.parent.event.emit("storage:sync:update",r)}_generateStoreKey(t,e=[]){let s=`${Yn}/${t}`;return e.length>0&&(s+=`/${e.join("/")}`),s}h(){this.B=1,this.L=0,this.H={},this.F={}}p(){this.parent.socket.on("storage:sync:updated",zi(this.V,this))}T(){let t=`${Yn}/`;for(let e=window.localStorage.length-1;e>=0;e--){let s=window.localStorage.key(e);s?.startsWith(t)&&window.localStorage.removeItem(s)}}P(t){return t in this.H||(this.H[t]={}),this.H[t]}U(t){return t in this.F||(this.F[t]=[]),this.F[t]}V(t){let e=this.P(t.session_id),s=this.U(t.session_id);if("object"==typeof e[t.ray]){t.error?"function"==typeof e[t.ray].error&&e[t.ray].error():"function"==typeof e[t.ray].success&&e[t.ray].success(),delete e[t.ray];let i=s.indexOf(t.ray);-1!==i&&s.splice(i,1)}this.parent.event.emit("storage:sync:updated",t)}N(t){return`${t}/${Math.floor(1e5*Math.random())}/${this.L++}`}},Xn=5e5,tr="browsing-consent",er=["browsing:action:start","browsing:action:stop","browsing:action:heartbeat","browsing:assist:start","browsing:assist:stop","browsing:assist:heartbeat","browsing:assist:mouse","browsing:assist:scroll","browsing:assist:click"],sr=class{constructor(t){this.parent=t,this.h(),this.p(),this.J(),this.K()}init(t,e,s){let i=t.session_id||this.parent.Session._getEffectiveSessionId();this.parent.Stream._bindTo(null,er,{session_id:i},()=>{-1===(this.parent.device.capabilities||[]).indexOf("browsing")||!0!==this.parent.Config._ignorePrivacy&&"1"===navigator?.doNotTrack?(this.parent.stream.emit("client:browsing:request:decline",{}),this.G()):(this.W=t.deps.rrweb||null,this.Y=t.deps.fflate||null,this.X=!0,this.Z=i,!0===t.resume&&(this.parent.stream.emit("client:browsing:resume",{browsing_id:this.tt}),this.st(!0),!0===this.it&&this.et(!0))),"function"==typeof e&&e()},()=>{"function"==typeof s&&s()})}accept(){!0===this.X&&(this.st(!0),this.parent.stream.emit("client:browsing:request:accept",{useragent:navigator.userAgent}),this.ht(!0))}decline(){!0===this.X&&(this.parent.stream.emit("client:browsing:request:decline",{}),this.G())}hasAcceptedConsent(){return"true"===this.parent.Storage.getStampLocal(tr,[this.parent.websiteId])}reset(){!0===this.it&&this.G(),this.h(),this.nt()}_restoreBrowsingState(){this.tt&&(!1===this.rt()?this.ot({session_id:this.Z,resume:!0}):this.G())}h(){if(this.parent.Schedule.clearInterval(this.lt),this.parent.Schedule.clearInterval(this.ct),"object"==typeof this.ut)for(let t in this.ut)this.parent.Schedule.clearTimeout(this.ut[t].deadTimeout);this.dt?.deferEvent&&this.parent.Schedule.clearTimeout(this.dt.deferEvent),this.X=!1,this.Z=null,this.tt=null,this.it=!1,this.ft=null,this.lt=null,this.ct=null,this.gt=null,this.W=null,this.Y=null,this._t=null,this.wt=[],this.yt=!1,this.vt=0,this.bt=[],this.ut={assist:{ongoing:!1,lastHeartbeat:null,deadTimeout:null}},this.dt={lastCall:(new Date).getTime(),deferEvent:null}}kt(){return this.parent.Storage._generateStoreKey("browsing",[this.parent.websiteId])}p(){this.parent.socket.on("browsing:request:initiate",zi(this.ot,this)),this.parent.stream.on("client:browsing:request:initiated",zi(this.St,this)),this.parent.stream.on("client:browsing:action:start",zi(this.At,this)),this.parent.stream.on("client:browsing:action:stop",zi(this.Mt,this)),this.parent.stream.on("client:browsing:action:heartbeat",zi(this.Et,this)),this.parent.stream.on("client:browsing:assist:start",zi(this.Ct,this)),this.parent.stream.on("client:browsing:assist:stop",zi(this.Dt,this)),this.parent.stream.on("client:browsing:assist:heartbeat",zi(this.Rt,this)),this.parent.stream.on("client:browsing:assist:mouse",zi(this.jt,this)),this.parent.stream.on("client:browsing:assist:scroll",zi(this.$t,this)),this.parent.stream.on("client:browsing:assist:click",zi(this.qt,this))}J(){if("object"!=typeof window.sessionStorage)return;let t=window.sessionStorage.getItem(this.kt());if(!t)return;let e=JSON.parse(t);this.Z=e.session_id||null,this.tt=e.browsing_id||null,this.it=e.is_playing||!1,this.ft=e.last_heartbeat||null}ot(t){!0===this.X&&!0!==t.resume||(!0!==t.resume&&this.G(),this.parent.event.emit("browsing:request:initiate",t||{}))}St(t){!0===this.X&&(this.tt=t.browsing_id,this.ft=(new Date).getTime(),this.Ot())}At(){!0===this.X&&this.tt&&this.et()}Mt(){!0===this.X&&this.tt&&this.G()}Et(){!0===this.X&&this.tt&&(this.ft=(new Date).getTime(),this.Ot())}Ct(){!0===this.X&&this.tt&&!0===this.It("assist")&&this.parent.event.emit("browsing:assist:started",{})}Dt(){!0===this.X&&this.tt&&!0===this.xt("assist")&&this.parent.event.emit("browsing:assist:stopped",{})}Rt(){!0===this.X&&this.tt&&this.Tt("assist")}jt(t){!0===this.X&&this.tt&&!0===this.ut.assist.ongoing&&this.parent.event.emit("browsing:assist:mouse",t)}$t(t){!0===this.X&&this.tt&&!0===this.ut.assist.ongoing&&this.parent.event.emit("browsing:assist:scroll",t)}qt(t){!0===this.X&&this.tt&&!0===this.ut.assist.ongoing&&this.parent.event.emit("browsing:assist:click",t)}Ot(){"object"==typeof window.sessionStorage&&JSON&&"function"==typeof JSON.stringify&&window.sessionStorage.setItem(this.kt(),JSON.stringify({session_id:this.Z,browsing_id:this.tt,is_playing:this.it,last_heartbeat:this.ft}))}ht(t){!0===t&&this.parent.Storage.setStampLocal(tr,[this.parent.websiteId],"true")}nt(){"object"==typeof window.sessionStorage&&"object"==typeof window.sessionStorage&&window.sessionStorage.removeItem(this.kt())}et(t=!1){this.it=!0,this.ft=(new Date).getTime(),this.Ot(),this.Nt(),this.Ut(!0),!0!==t&&this.parent.stream.emit("client:browsing:action:started",{})}G(){let t=this.it;"function"==typeof this._t&&this._t(),this.h(),this.Ot(),!0===t&&this.parent.stream.emit("client:browsing:action:stopped",{}),this.parent.Stream._unbindFrom()}Nt(){this.Pt(),"function"==typeof this._t&&(this._t(),this._t=null),this.W&&"function"==typeof this.W.record&&(this.wt=[],this.yt=!1,this._t=this.W.record({emit:t=>{this.Bt(t)},inlineStylesheet:!1,inlineImages:!1,collectFonts:!1,recordCanvas:!1,recordCrossOriginIframes:!1,maskAllInputs:!0,sampling:{mousemove:200,scroll:300,input:"last"},maskTextSelector:"[data-browsing-ignore]"}))}Bt(t){if(t&&"number"==typeof t.type){if(!0!==this.yt)return this.wt.push(t),void(2===t.type&&(this.yt=!0,this.gt={f:"initialize",args:this.wt},this.Lt(this.gt),this.wt=[]));this.bt.push(t),this.bt.length>=50&&this.Ht()}}Lt(t){if(!t.f||!t.args||"function"!=typeof JSON.stringify)return;let e=this.vt,s=JSON.stringify(t.args),i=s,n=null;if(this.Y&&"function"==typeof this.Y.deflateSync&&"function"==typeof TextEncoder)try{let t=(new TextEncoder).encode(s),e=this.Y.deflateSync(t,{level:6});i=this.Ft(e),n="drb64"}catch{i=s,n=null}let r=i.length,o=Math.max(1,Math.ceil(r/Xn)),u=o-1;for(let a=0;a{this.xt(t)},45e3)):this.ut[t].lastHeartbeat=null)}K(){this.parent.Listener.addEventListener("window","resize",()=>{null!==this.dt.deferEvent&&this.parent.Schedule.clearTimeout(this.dt.deferEvent),this.dt.deferEvent=this.parent.Schedule.setTimeout(()=>{this.dt.deferEvent=null;let t=this.dt.lastCall,e=(new Date).getTime();this.dt.lastCall=e,t&&e>t+1e3&&!0===this.it&&this.Pt()},1e3)})}rt(){return null===this.ft||null!==this.ft&&(new Date).getTime()-this.ft>=45e3}st(t=!0){null!==this.lt&&this.parent.Schedule.clearInterval(this.lt),!0===t&&(this.lt=this.parent.Schedule.setInterval(()=>{this.parent.stream.emit("client:browsing:heartbeat",{}),!0===this.rt()&&this.G()},1e4))}Ut(t=!0){null!==this.ct&&this.parent.Schedule.clearInterval(this.ct),!0===t&&(this.ct=this.parent.Schedule.setInterval(()=>{this.Ht()},1e3))}Ht(){if(0===this.bt.length)return;let t=this.bt;this.bt=[],this.Lt({f:"applyChanged",args:t})}Ft(t){let e="";for(let s=0;s{this.Vt=t.mode||null,this.zt=t.ice||[],!0===t.has_support?(this.parent.stream.emit("client:call:request:initiated",{call_id:t.call_id}),this.st(!0)):this.parent.stream.emit("client:call:request:decline",{}),"function"==typeof e&&e()},()=>{"function"==typeof s&&s()})}accept(){!0===this.X&&(this.Jt=!0,this.parent.stream.emit("client:call:request:accept",{}))}decline(){!0===this.X&&(this.parent.stream.emit("client:call:request:decline",{}),this.G())}stop(){!0===this.X&&(this.parent.stream.emit("client:call:action:stopped",{}),this.G())}toggleAudio(){return this.Kt("audio","getAudioTracks")}toggleVideo(){return this.Kt("video","getVideoTracks")}toggleScreensharing(){return!0===this.X&&null!==this.Gt.local&&(!1===this.Qt?this.Wt():this.Yt()),this.Qt}isOngoing(){return!0===this.X&&null!==this.Xt&&!0}hasSupportScreensharing(){return!(!navigator.mediaDevices||"function"!=typeof navigator.mediaDevices.getDisplayMedia)}getStream(t){return this.Gt[t]||null}reset(){!0===this.X&&this.G(),this.h()}h(){this.X=!1,this.Qt=!1,this.Jt=!1,this.Zt=!1,this.Xt=null,this.lt=null,this.ts=null,this.Vt=null,this.zt=[],this.Gt={local:null,remote:null},this.ss={video:null}}p(){this.parent.socket.on("call:request:initiate",zi(this.ot,this)),this.parent.stream.on("client:call:request:accepted",zi(this.es,this)),this.parent.stream.on("client:call:request:declined",zi(this.hs,this)),this.parent.stream.on("client:call:action:stopped",zi(this.ns,this)),this.parent.stream.on("client:call:signaling:sdp",zi(this.rs,this)),this.parent.stream.on("client:call:signaling:candidate",zi(this.ls,this))}ot(t){!0!==this.X&&(t.has_support=-1!==(this.parent.device.capabilities||[]).indexOf("call"),this.X=!0,this.parent.event.emit("call:request:initiate",t))}es(){!0===this.X&&!0!==this.Jt&&this.G()}hs(){!0===this.X&&this.G()}ns(){!0===this.X&&this.G()}rs(t){if(!0===this.X){if(this.cs(),"operator"!==t.from)return;this.Xt.setRemoteDescription(new RTCSessionDescription(t.sdp)).then(()=>(this.parent.event.emit("call:peer:remote:success",{}),null===this.Gt.local?this.us():"offer"===t.sdp.type?this.ds("answer"):Promise.resolve())).catch(()=>{this.parent.event.emit("call:peer:remote:error",{})})}}ls(t){if(!0===this.X){if(this.cs(),"operator"!==t.from)return;if("object"!=typeof t.candidate||null===t.candidate)return;this.Xt.addIceCandidate(new RTCIceCandidate({sdpMLineIndex:t.candidate.sdpMLineIndex,candidate:t.candidate.candidate})).catch(()=>{})}}cs(){null===this.Xt&&(this.Xt=new RTCPeerConnection({iceServers:this.zt}),this.Xt.onicecandidate=t=>{t&&t.candidate&&this.parent.stream.emit("client:call:signaling:candidate",{from:"user",candidate:t.candidate})},this.Xt.ontrack=t=>{let e=t.streams[0];this.Gt.remote=e,this.parent.event.emit("call:media:remote:success",{}),e.onremovetrack=()=>{this.parent.event.emit("call:media:remote:success",{})}},this.Xt.oniceconnectionstatechange=()=>{let t=this.Xt;null!==t&&"failed"!==t.iceConnectionState&&"closed"!==t.iceConnectionState||this.fs(),null!==t&&"disconnected"===t.iceConnectionState&&(this.ts=this.parent.Schedule.setTimeout(()=>{this.ts=null,null!==this.Xt&&"connected"===t.iceConnectionState||this.fs()},5e3)),null!==t&&"connected"===t.iceConnectionState&&!0!==this.Zt&&this.parent.Schedule.setTimeout(()=>{this.us(!0)},200)},this.Xt.onnegotiationneeded=()=>{this.ds("offer")},this.Xt.onclose=()=>{this.fs()})}us(t=!1){let e=()=>{this.parent.event.emit("call:peer:local:error",{})};this.ps(s=>{navigator.mediaDevices.getUserMedia({audio:!0,video:"video"===this.Vt&&!0===s.video}).then(e=>(this.Gt.local=e,this.parent.event.emit("call:media:local:success",{retried:t||!1}),!0===t&&(this.Zt=!0),this.gs(e,t))).catch(e)},e)}gs(t,e=!1){let s=t.getTracks();!0===e&&this.Xt.getSenders().forEach(t=>{t.track&&t.track.stop(),this.Xt.removeTrack(t)});for(let i=0;i{for(let t=0;t{let e={OfferToReceiveAudio:!0,OfferToReceiveVideo:!0};return"answer"===t?this.Xt.createAnswer(e):this.Xt.createOffer(e)}).then(t=>(e=t,this.Xt.setLocalDescription(e))).then(()=>(this.parent.stream.emit("client:call:signaling:sdp",{from:"user",sdp:e}),this.parent.event.emit("call:peer:local:success",{}),Promise.resolve())).catch(()=>(this.parent.event.emit("call:peer:local:error",{}),Promise.resolve()))}G(){this.fs()}fs(){if(null!==this.Xt){let t=this.Xt.getSenders();for(let e=0;e{let e=t.getTracks()[0],s=this.Xt.getSenders(),i=null;for(let n=0;n{null!==this.Xt&&(this._s(i),this.parent.event.emit("call:track:local:ended",{media:"screensharing"}))},this.parent.event.emit("call:track:local:started",{media:"screensharing"})}).catch(()=>{this.Qt=!1}))}Yt(){let t=this.Xt.getSenders(),e=null;for(let s=0;s{this.parent.stream.emit("client:call:heartbeat",{})},1e4))}},rr=new RegExp(["(^(?:\\S+(?:(?:\\s+|\\?|\\!|\\.|\\(|\\)|:|;)|(?:[\\u4e00-\\u9fff])|(?:[\\u0e00-\\u0e7f])))+).*$"].join(""),"i"),or=class{constructor(t){this.parent=t,this.h(),this.p()}sendTextMessage(t,e=0){this.ys({type:"text",origin:"chat",content:t,timestamp:(new Date).getTime(),fingerprint:this.generateFingerprint()},e)}sendFileMessage(t,e,s,i=0){this.ys({type:"file",origin:"chat",content:{name:t,url:e,type:s},timestamp:(new Date).getTime(),fingerprint:this.generateFingerprint()},i)}sendAnimationMessage(t,e,s=0){this.ys({type:"animation",origin:"chat",content:{url:t,type:e},timestamp:(new Date).getTime(),fingerprint:this.generateFingerprint()},s)}sendAudioMessage(t,e,s,i=0){this.ys({type:"audio",origin:"chat",content:{url:t,type:e,duration:s},timestamp:(new Date).getTime(),fingerprint:this.generateFingerprint()},i)}sendPickerMessage(t,e,s,i=0){this.ys({type:"picker",origin:"chat",content:{id:t,text:e,choices:s},timestamp:(new Date).getTime(),fingerprint:this.generateFingerprint()},i)}sendFieldMessage(t,e,s,i=0){this.ys({type:"field",origin:"chat",content:{id:t,text:e,explain:s},timestamp:(new Date).getTime(),fingerprint:this.generateFingerprint()},i)}sendCarouselMessage(t,e,s=0){this.ys({type:"carousel",origin:"chat",content:{text:t,targets:e},timestamp:(new Date).getTime(),fingerprint:this.generateFingerprint()},s)}sendMessageCompose(t,e=null){let s=this.parent.Session._getChildSessionIdOrNone(),i=this.vs();(!0!==this.parent.Config._ignorePrivacy&&"1"===navigator?.doNotTrack||!1===this.parent.Config._visitorCompose)&&(e=null),e=this.bs(e);let n=(t!==i.messageCompose.local.type||s!==i.messageCompose.local.session_id)&&!0;(!0===n||e!==(i.messageCompose.local.excerpt||null)||"start"===i.messageCompose.local.type&&i.messageComposeLocalSince&&(new Date).getTime()-i.messageComposeLocalSince>=6e4)&&(i.messageComposeLocalSince=(new Date).getTime(),i.messageCompose.local={session_id:s,type:t},e&&(i.messageCompose.local.excerpt=e),!0===n&&null!==i.deferComposeDebounce&&(this.parent.Schedule.clearTimeout(i.deferComposeDebounce),i.deferComposeDebounce=null),null===i.deferComposeDebounce&&(i.deferComposeDebounce=this.parent.Schedule.setTimeout(()=>{i.deferComposeDebounce=null,this.parent.socket.emit("message:compose:send",i.messageCompose.local),this.parent.event.emit("message:compose:send",i.messageCompose.local)},!0===n?0:6e3)))}sendMessageThread(t,e=""){let s={session_id:this.parent.Session._getChildSessionIdOrNone(),type:t};e&&(s.text=e),this.parent.socket.emit("message:thread",s),this.parent.event.emit("message:thread",s)}receiveMessageLocal(t,e,s,i=null){let n={session_id:this.parent.Session._getChildSessionIdOrNone(),from:"operator",type:t,origin:"local",timestamp:(new Date).getTime(),content:e,fingerprint:null!==i?i:this.generateFingerprint(),user:s};this.parent.socket.emit("message:received:local",n),this.ks(n)}receiveMessageMirror(t,e,s,i,n=null){let r={session_id:this.parent.Session._getChildSessionIdOrNone(n),from:"operator",type:t,origin:e,timestamp:(new Date).getTime(),content:s,fingerprint:i};this.parent.socket.emit("message:received:mirror",r)}updateMessage(t,e,s=null){let i={session_id:this.parent.Session._getChildSessionIdOrNone(s),fingerprint:t,content:e};this.parent.socket.emit("message:update",i),this.Ss(i,"local")}getMessageCompose(t=null){t=this.parent.Session._getEffectiveSessionId(t),this.parent.event.emit("message:compose:received",this.vs(t).messageCompose.remote)}getCachedMessages(t=null){return t=this.parent.Session._getEffectiveSessionId(t),this.vs(t).messages}countMessageHistory(t=null){return t=this.parent.Session._getEffectiveSessionId(t),this.vs(t).length}getMessageHistory(t=null){t=this.parent.Session._getEffectiveSessionId(t);let e=this.vs(t);if(e.messages.length>0){for(let t=0;t{this.parent.socket.emit("message:send",t)};if(-1===i.sendingMessagesIndex.indexOf(t.fingerprint)&&i.sendingMessagesIndex.push(t.fingerprint),this.parent.platformName&&this.parent.platformSignatureKey){let e=[s,t.fingerprint,t.type],i=this.parent.sha256.hmac.create(this.parent.platformSignatureKey.split("/").map(t=>String.fromCharCode(parseInt(t,36))).join(""));i.update(`[${e.join("|")}]`),t.signature=`${this.parent.platformName}:${i.hex()}`}this.parent.event.emit("message:send",t),this.parent.Schedule.setTimeout(()=>{this.parent.ticketGenerator?this.parent.ticketGenerator(s,e=>{null!==e&&(t.ticket=e),n()}):n()},e)}bs(t){let e=null;if(null!==t){let s=t.match(rr);s&&(e=(s[1]||"").trim())}return e}Ls(t,e){let s={session_id:t,origin:"chat",fingerprints:e};this.parent.socket.emit("message:acknowledge:pending",s),this.parent.socket.emit("message:acknowledge:delivered",s)}Hs(t,e){this.parent.socket.emit("message:acknowledge:read:received",{session_id:t,origin:"chat",fingerprints:e})}Fs(t,e,s){let i=this.vs(t),n=!1;!1===s&&(i.unreadMessagesIndex=[],this.Ds(t));for(let r=0;r0&&(!0===i||this.Cs===t)&&(this.Hs(t,n.unreadMessagesIndex),r=!0),!0===r&&this.Fs(t,e,s)}Es(t,e=null,s=null){let i=this.vs(t);if(i.updatedMessagesIndex.length>0){let n=[];for(let t=0;t{n.messagesFingerprints.splice(r,1),n.messages.splice(r,1);let i=n.unreadMessagesIndex.indexOf(e.fingerprint);-1!==i&&(n.unreadMessagesIndex.splice(i,1),this.Ds(t)),"function"==typeof s&&s()},i)):"function"==typeof s&&s()}Js(t,e){let s=this.vs(t),i=s.messagesFingerprints.indexOf(e);return i>=0&&s.messages[i]||null}Vs(t,e){let s=this.vs(t);-1===s.updatedMessagesIndex.indexOf(e.fingerprint)&&s.updatedMessagesIndex.push(e.fingerprint)}$s(t){t.sort((t,e)=>t.timestampe.timestamp?1:0)}As(t,e,s){let i={session_id:t,...e};e.is_me?this.Os(i,s):this.Is(i,s)}Ds(t,e=[]){let s=this.vs(t),i=s.unreadMessagesIndex.length;i!==s.unreadMessagesCount&&(s.unreadMessagesCount=i,"function"==typeof this.Rs&&this.Rs(t,i,s.unreadMessagesIndex,[].concat(s.messages,e)))}Ss(t,e="network"){let s=t.session_id,i=this.Js(s,t.fingerprint);null!==i&&(i.content=t.content,i.edited=!0,this.As(s,i,"update"),"local"!==e&&(this.Vs(s,i),this.Es(s)))}Os(t,e="network"){let s=t.session_id,i=this.vs(s),n=i.sendingMessagesIndex.indexOf(t.fingerprint);-1!==n&&i.sendingMessagesIndex.splice(n,1);let r=t.origin;t.origin=e,t.index={current:1,total:1},this.zs(t,()=>{"chat"===r||"network"!==e&&"diff"!==e||this.Ls(s,[t.fingerprint]),this.parent.event.emit("message:sent",t)}),1===this.countMessageHistory()&&this.parent.Session._triggerEmailKeepAlive()}Is(t,e="network",s="message:received"){let i=t.session_id,n=this.vs(i);t.origin=e,t.index={current:1,total:1},"update"!==e&&(n.unreadMessagesIndex.push(t.fingerprint),this.Ds(i,[t])),this.zs(t,()=>{"network"!==e&&"diff"!==e||this.Ls(i,[t.fingerprint]),this.parent.event.emit(s,t)})}ks(t){this.Is(t,"local","message:received:local")}xs(t){let e=t.session_id,s=this.Js(e,t.fingerprint);null!==s&&(s.removed=!0,this.Ks(e,s,()=>{this.parent.event.emit("message:removed",s)}))}Ts(t){let e=t.session_id;this.vs(e).messageCompose.remote=t,this.parent.event.emit("message:compose:received",t)}Ns(t){let e=t.session_id;!0===this.Ms(e,t.fingerprints,!0)&&this.Es(e),this.parent.event.emit("message:acknowledge:read:send",t)}Us(t){let e=t.session_id,s=this.vs(e);for(let i=0;i0&&this.parent.socket.emit("session:event",e)}sendFeedbackRate(t,e=null,s=null){let i={session_id:this._getChildSessionIdOrNone(s),rating:{stars:t}};null!==e&&(i.rating.comment=e),this.parent.socket.emit("session:feedback:rate",i),this.parent.event.emit("session:feedback:rate",i)}sendIdentityVerify(t,e,s=null){let i={session_id:this._getChildSessionIdOrNone(s),[t]:e};this.parent.socket.emit("session:identity:verify",i),this.parent.event.emit("session:identity:verify",i)}sendPluginAction(t,e){let s={urn:t,data:e};this.parent.socket.emit("session:plugin:action",s),this.parent.event.emit("session:plugin:action",s)}getRequestInitiate(t=null,e=null){e=this.parent.Session._getEffectiveSessionId(e);let s=this.Gs[e]||{};Object.keys&&0===Object.keys(s).length&&this.parent.Message._countMessageHistoryDiff()>0&&this.Qs({session_id:e}),"function"==typeof t&&t()}getState(t=null,e=null){t=this._getEffectiveSessionId(t),this.Ws(t,this.Gs[t],e)}setState(t,e=null,s=null){(e=this._getEffectiveSessionId(e))in this.Gs||(this.Gs[e]={});for(let i in t)this.Gs[e][i]=t;this.parent.Storage._update("state",t,e),this.Ys(t,e,s)}create(){let t={website_id:this.parent.websiteId,website_domain:this.parent.websiteDomain,useragent:this.parent.device.useragent||"",timezone:this.parent.device.timezone||0,capabilities:this.parent.device.capabilities||[],locales:this.parent.device.locales||[]};this.parent.tokenId&&(t.token_id=this.parent.tokenId),this.parent.socket.emit("session:create",t)}createChild(){if(!0!==this.parent.sessionChildren)throw new Error("Session children not enabled");{let t={autojoin:{expire:ur}};this.parent.socket.emit("session:child:create",t),this.parent.event.emit("session:child:create",t)}}getEmail(){return this.Xs.email}setEmail(t,e=!1,s=null){let i={};if(null!==s){let t=typeof s;"string"===t?i.verify=s:"object"===t&&(i=s)}!0===this.Zs("email",t,e,i)&&this._triggerEmailKeepAlive()}getPhone(){return this.Xs.phone}setPhone(t,e=!1){this.Zs("phone",t,e)}getNickname(){return this.Xs.nickname}setNickname(t,e=!1){this.Zs("nickname",t,e)}getAvatar(){return this.Xs.avatar}setAvatar(t,e=!1){this.Zs("avatar",t,e)}getCompany(){return this.Xs.company}setCompany(t,e=!1){this.Zs("company",t,e)}getData(t=null){return null===t?this.Xs.data:this.Xs.data[t]||null}setData(t){if(this.ti.data=this.ti.data||{},t)for(let e in t)this.ti.data[e]=t[e];this.si("data",()=>{this.ii(this.Xs.data||{},this.ti.data),delete this.ti.data})}setSegments(t,e=!1){if(!0===e)this.ti.segments=t||[];else if(this.ti.segments=this.ti.segments||[],t)for(let s=0;s{this.ei(this.Xs.segments||[],this.ti.segments,e),delete this.ti.segments},e||!1)}markActive(){let t=(new Date).getTime();t-Math.min(this.hi||t,this.ft||t)>=9e4&&this.st(!0),this.hi=t}reset(t=!0,e=null,s=null){let i=null;try{for(let t in this.parent){let e=this.parent[t];e!==this&&e&&"object"==typeof e&&"function"==typeof e.reset&&e.reset()}this.h(),!0===t&&this.ni()}catch(t){i=t}i?"function"==typeof s&&s(i):"function"==typeof e&&e()}_sendDevice(){let t=this.ri();null!==t&&this.parent.socket.emit("session:device",t)}_getParentSessionId(){return this.oi}_getChildSessionIdOrNone(t=null){return null!==t?t!==this._getParentSessionId()?t:void 0:this.parent.Config._sessionChildId||void 0}_getEffectiveSessionId(t=null){return t||this._getChildSessionIdOrNone()||this._getParentSessionId()}_triggerEmailKeepAlive(){this.Xs.email&&(this.li&&this.parent.Schedule.clearTimeout(this.li),this.li=this.parent.Schedule.setTimeout(()=>{this.li=null,this.st(!0)},5e3))}h(){if("object"==typeof this.ai)for(let t in this.ai)this.parent.Schedule.clearTimeout(this.ai[t]);this.oi=null,this.ci=[],this.ui=null,this.di=!1,this.hi=0,this.ft=(new Date).getTime(),this.fi=null,this.pi=null,this.gi=null,this.li=null,this.Xs={},this._i={},this.ai={},this.ti={},this.Gs={}}p(){this.parent.socket.on("session:created",zi(this.wi,this)),this.parent.socket.on("session:joined",zi(this.mi,this)),this.parent.socket.on("session:state",zi(this.yi,this)),this.parent.socket.on("session:error",zi(this.bi,this)),this.parent.socket.on("session:request:initiate",zi(this.Qs,this)),this.parent.socket.on("session:request:purge",zi(this.ki,this)),this.parent.socket.on("session:request:feedback",zi(this.Si,this)),this.parent.socket.on("session:request:identity",zi(this.Ai,this)),this.parent.socket.on("session:request:tool",zi(this.Mi,this)),this.parent.socket.on("session:feedback:rated",zi(this.Ei,this)),this.parent.socket.on("session:identity:verified",zi(this.Ci,this)),this.parent.socket.on("session:child:created",zi(this.Di,this)),this.parent.socket.on("connect",()=>{this.di?this.Ri(!0):this.ji()})}wi(t){if(t.error)this.parent.event.emit("session:created",{error:t.error});else{let e=!!this.parent.tokenId;this.oi=t.session_id,this.$i(),this.Ri(e),this.parent.event.emit("session:created",{session_id:this.oi})}}mi(t){t.error?this.parent.event.emit("session:joined",{error:t.error}):(this.di||(this.di=!0),this.parent.Website._setUsersAvailable(t.users_available),this.qi(t.session_id,t.storage),this.Oi(t.session_id,t.sync),this.Ii(t),this.xi(t.children||[]),this.parent.Browsing._restoreBrowsingState(),this.parent.event.emit("session:joined",t),this.Ti(t.last_active))}yi(t){let e=t.session_id;delete t.session_id,this.Ws(e,t)}bi(t){"email:invalid_format"===t.type&&(delete this.Xs.email,delete this._i.email),this.parent.event.emit("session:error",t)}Qs(t){this.parent.event.emit("session:request:initiate",t)}ki(t){this.parent.event.emit("session:request:purge",t)}Si(t){this.parent.event.emit("session:request:feedback",t)}Ai(t){this.parent.event.emit("session:request:identity",t)}Mi(t){this.parent.event.emit("session:request:tool",t)}Ei(t){this.parent.event.emit("session:feedback:rated",t)}Ci(t){this.parent.event.emit("session:identity:verified",t)}Di(t){!0===this.parent.sessionChildren&&(t.session_id&&-1===this.ci.indexOf(t.session_id)&&this.ci.push(t.session_id),this.parent.event.emit("session:child:created",t))}qi(t,e={}){this.Ni(t,e.state),this.parent.Message._storageSessionMessageHandle(t,e.message)}Oi(t,e={}){this.parent.Message._syncMessageComposeDiff(t,e.compose),this.parent.Message._syncMessageHistoryDiff(t,e.messages)}Ii(t){for(let e=0;e{this.gi=null,this.Vi(),this.st()},24e4)}Ti(t=0){this.hi=t||(new Date).getTime(),this.st()}Vi(){!0===this.parent.socket.connected&&(this.ft=(new Date).getTime(),this.parent.socket.emit("session:heartbeat",{last_active:this.hi||0,availability:{type:"online",time:{for:ur}}}))}ri(){let t=document.location.href||"";if(this.fi!==t){this.fi=t;let e=(new Date).getTime();if(e-(this.pi||0)>=3e3){this.pi=e;let s=document.title||"";if(s.length>80&&(s=s.substring(0,77),s+="..."),!0===cr.test(t)){t=t.replace(cr,"$1$3");let e=t[t.length-1];"?"!==e&&"&"!==e||(t=t.substr(0,t.length-1))}if(t.length>240&&(t=t.split("?")[0]||""),t&&s&&t.length<=240){let e={page_url:t,page_title:s},i=(document.referrer||"").split("?")[0]||"";return i?.length<=240&&i&&(e.page_referrer=i),e}}}return null}kt(t=null){let e=[this.parent.websiteId];return t&&e.push(t),this.parent.Storage._generateStoreKey("session",e)}Hi(){return"number"==typeof this.parent.cookieExpire&&this.parent.cookieExpire>0?this.parent.cookieExpire:15768e3}Li(){return"string"==typeof this.parent.cookieDomain&&this.parent.cookieDomain?this.parent.cookieDomain:this.zi()}Fi(){return!0===this.parent.runtimeConfiguration.cross_origin_cookies&&"https:"===document.location.protocol?{policy:"none",secure:!0}:{policy:"lax"}}zi(){let t=document.domain,e=t,s="",i=this.Fi(),n=`samesite=${i.policy};`+(!0===i.secure?"secure;":"");try{let t=0,s=e.split("."),i=this.parent.Storage._generateStoreKey("domain-detect",[`${(new Date).getTime()}`]);for(;t0||t.length!==e.length?(i=[].concat(e),this.Xs.segments=i):i=[]:(i=n,this.Xs.segments=t.concat(i)),i.length>0&&!0===this.di){let t={segments:i};!0===s&&(t.overwrite=!0),this.parent.socket.emit("session:set_segments",t)}}ii(t,e={}){let s=!1,i={};for(let n in e)t[n]!==e[n]&&(s=!0,i[n]=e[n]);this.Xs.data=t;for(let n in i)this.Xs.data[n]=i[n];!0===s&&!0===this.di&&this.parent.socket.emit("session:set_data",{data:i})}Ji(t,e){if(t instanceof Object&&e instanceof Object){let s={};for(let e in t)s[e]=!0;for(let t in e)s[t]=!0;let i=!0;for(let n in s)if(!1===this.Ji(t[n],e[n])){i=!1;break}return i}return t===e&&!0}si(t,e,s=!1){!0===s?(void 0!==this.ai[t]&&(this.parent.Schedule.clearTimeout(this.ai[t]),delete this.ai[t]),e()):void 0===this.ai[t]&&(this.ai[t]=this.parent.Schedule.setTimeout(()=>{delete this.ai[t],e()},500))}},Dr=class{constructor(t){this.parent=t,this.h(),this.p()}getUsersAvailable(){this.Ki(!1)}reset(){this.h()}_setUsersAvailable(t){this.Gi=t}h(){this.Gi=!1}p(){this.parent.socket.on("website:users:available",zi(this.Qi,this))}Qi(t){"boolean"==typeof t&&(this._setUsersAvailable(t),this.Ki(!0))}Ki(t=!1){this.parent.event.emit("website:users:available",{available:this.Gi,changed:t})}},fr=class{constructor(t){this.parent=t,this.p()}getUrlUpload(t,e){let s={session_id:this.parent.Session._getChildSessionIdOrNone(),id:`${(new Date).getTime()}`,from:"visitor",file:{name:t,type:e}};this.parent.socket.emit("bucket:url:upload:generate",s),this.parent.event.emit("bucket:url:upload:generate",s)}p(){this.parent.socket.on("bucket:url:upload:generated",zi(this.Wi,this))}Wi(t){this.parent.event.emit("bucket:url:upload:generated",t)}},pr=class{constructor(t){this.parent=t,this.p()}getAnimationList(t=null,e=1,s=-1){let i={id:(new Date).getTime(),from:"visitor",list:{page:e}};-1!==s&&(i.list.limit=s),t&&(i.list.query=t),this.parent.socket.emit("media:animation:list",i),this.parent.event.emit("media:animation:list",i)}p(){this.parent.socket.on("media:animation:listed",zi(this.Yi,this))}Yi(t){this.parent.event.emit("media:animation:listed",t)}},_r=class{constructor(t){this.parent=t,this.h(),this.p()}getOverlayAnswerSearch(t,e=null){if(t){let s=this.Xi[e||"default"]?.[this.Zi(t)]||null,i="overlay:answer:search",n={id:(new Date).getTime(),from:"visitor",search:{query:t,locale:e}};this.parent.event.emit(i,n),s?.processed&&s?.sources?this.parent.Schedule.setTimeout(()=>{this.te({id:n.id,result:s.processed,search:{query:t}}),this.se({id:n.id,result:s.sources,search:{query:t}})},100):this.parent.socket.emit(i,n)}}reset(){this.h()}h(){this.Xi={}}p(){this.parent.socket.on("overlay:answer:search:partial",zi(this.ie,this)),this.parent.socket.on("overlay:answer:search:processed",zi(this.te,this)),this.parent.socket.on("overlay:answer:search:sources",zi(this.se,this))}Zi(t){return t.trim().toLowerCase()}ie(t){this.parent.event.emit("overlay:answer:search:partial",t)}te(t){if(t.result){let e=null!==t.result.text&&!0;this.ee("processed","result",t,e)}}se(t){t.result&&this.ee("sources","result",t)}ee(t,e,s,i=!0){if(!0===i){let i=this.Xi;if(s.search&&"string"==typeof s.search.query){let n=s.search.locale||"default",r=this.Zi(s.search.query);n in i||(i[n]={}),r in i[n]||(i[n][r]={}),i[n][r][t]=s[e]}}this.parent.event.emit(`overlay:answer:search:${t}`,s)}},mr=class{constructor(t){this.parent=t,this.h(),this.p()}getArticleSearch(t,e=null){return this.he("article","search",this.ne,zi(this.re,this),e,"query",t)}getArticleList(t=null,e=null,s=null){let i={};null!==e&&(i.category_id=e,null!==s&&(i.section_id=s));let n=this.oe(e,s);return this.he("article","list",this.le,zi(this.ae,this),t,null,n,i)}getArticleSuggest(t,e=null){return this.he("article","suggest",this.ce,zi(this.ue,this),e,"part",t)}getCategoryList(t=null){return this.he("category","list",this.de,zi(this.fe,this),t)}reportArticleSearch(t,e=""){if(e=(e||"").trim()){let s={report:{locale:t,query:e}};this.parent.socket.emit("helpdesk:article:report",s),this.parent.event.emit("helpdesk:article:report",s)}}reset(){this.h()}h(){this.ne={},this.le={},this.ce={},this.de={}}p(){this.parent.socket.on("helpdesk:article:searched",zi(this.re,this)),this.parent.socket.on("helpdesk:article:listed",zi(this.ae,this)),this.parent.socket.on("helpdesk:article:suggested",zi(this.ue,this)),this.parent.socket.on("helpdesk:category:listed",zi(this.fe,this))}re(t){return this.pe("article","search",this.ne,t,"query")}ae(t){return this.pe("article","list",this.le,t,null,t=>this.oe(t.category_id,t.section_id))}ue(t){return this.pe("article","suggest",this.ce,t,"part")}fe(t){return this.pe("category","list",this.de,t)}he(t,e,s,i,n=null,r=null,o="",u={}){let a=s[n||"default"]?.[o],l=`helpdesk:${t}:${e}`,h={[e]:{...u,locale:n}};null!==r&&(h[e][r]=o);let c={id:(new Date).getTime(),from:"visitor",...h};this.parent.event.emit(l,c),a?i({id:c.id,results:a,...h}):this.parent.socket.emit(l,c)}pe(t,e,s,i,n=null,r=null){let o=null;if(o="function"==typeof r?r(i[e]||{}):null===n?"":i[e][n],i[e]&&"string"==typeof o){let t=i[e].locale||"default";s[t]=s[t]||{},s[t][o]=i.results}this.parent.event.emit(`helpdesk:${t}:${e}ed`,i)}oe(t,e){let s="";return"string"==typeof t&&t&&(s+=t,"string"==typeof e&&(s+=`/${e||"*"}`)),s}},gr=class{constructor(t){this.parent=t}fired(t,e){let s={identifier:t,name:e};this.parent.socket.emit("trigger:fired",s),this.parent.event.emit("trigger:fired",s)}},Fr=class{constructor(t){this.parent=t}providerRegister(t){this.ge("register",t)}providerUnregister(t){this.ge("unregister",t)}ge(t,e){let s={notification_id:e};this.parent.socket.emit(`notification:provider:${t}`,s),this.parent.event.emit(`notification:provider:${t}`,s)}},wr=class{constructor(t){this.parent=t,this.h()}configure(t){this._e=t.project,this.we=t.revision,this.me=t.environment,this.ye=t.useragent,this.ve=t.page}report(t,e,s){if(!(this._e&&this.we&&this.me&&this.ye&&this.ve))throw new Error("Missing a configuration parameter. Did you call configure() before?");"object"==typeof s&&s instanceof Error&&(s={fileName:s.fileName,lineNumber:s.lineNumber,columnNumber:s.columnNumber,message:s.message,stack:s.stack});let i={project:this._e,revision:this.we,environment:this.me,useragent:this.ye,page:this.ve,level:t,namespace:e,traceback:s};this.parent.socket.emit("issue:report",i),this.parent.event.emit("issue:report",i)}h(){this._e=null,this.we=null,this.me=null,this.ye=null,this.ve=null}},vr=/^((?:https?|wss?):\/\/[^/]+)(\/.*)?$/,yr=new class{constructor(){this.socket=null,this.stream=null,this.cookie=null,this.sha256=null,this.event=null,this.Storage=new Qn(this),this.Schedule=new Jn(this),this.Listener=new Gn(this),this.Config=new Hn(this),this.Register=new Wn(this)}init(t){this.be(),this.ke(t),this.Se(t),this.Socket=new Kn(this),this.Stream=new Zn(this),this.Browsing=new sr(this),this.Call=new nr(this),this.Message=new or(this),this.Session=new dr(this),this.Website=new Dr(this),this.Bucket=new fr(this),this.Media=new pr(this),this.Overlay=new _r(this),this.Helpdesk=new mr(this),this.Trigger=new gr(this),this.Notification=new Fr(this),this.Issue=new wr(this),this.Storage.init(),this.u(),!0===t.connectSocket&&this.socket.connect()}be(){this.h(),this.Ae()}h(){delete this.environment,delete this.urlGo,delete this.websiteDomain,delete this.websiteId,delete this.sessionId,delete this.tokenId,delete this.cookieExpire,delete this.cookieDomain,delete this.platformName,delete this.platformSignatureKey,delete this.ticketGenerator,delete this.sessionChildren,delete this.runtimeConfiguration,delete this.device,delete this.ioRelayClient,delete this.ioRelayStream,delete this.ioRelayRescueClient,this.Me=!1,this.Ee=!1}ke(t){t?.environment&&(this.environment=t.environment||"development"),t?.urlGo&&(this.urlGo=t.urlGo),t?.websiteDomain&&(this.websiteDomain=t.websiteDomain),t?.websiteId&&(this.websiteId=t.websiteId),t?.sessionId&&(this.sessionId=t.sessionId),t?.tokenId&&(this.tokenId=t.tokenId),t?.cookieExpire&&(this.cookieExpire=t.cookieExpire),t?.cookieDomain&&(this.cookieDomain=t.cookieDomain),t?.platformName&&(this.platformName=t.platformName),t?.platformSignatureKey&&(this.platformSignatureKey=t.platformSignatureKey),t?.sessionChildren&&(this.sessionChildren=t.sessionChildren),t?.ticketGenerator&&(this.ticketGenerator=t.ticketGenerator),t?.runtimeConfiguration&&(this.runtimeConfiguration=t.runtimeConfiguration),this.device={},t?.useragent&&(this.device.useragent=t.useragent),t?.timezone&&(this.device.timezone=t.timezone),t?.capabilities&&(this.device.capabilities=t.capabilities),t?.locales&&(this.device.locales=t.locales)}Se(t){let e=["websocket"];this.ioRelayClient=this.Ce(t.urlRelayClient),this.ioRelayStream=this.Ce(t.urlRelayStream),this.ioRelayRescueClient=this.Ce(t.urlRelayRescueClient),this.event=function(t){return{all:t=t||new Map,on:function(e,s){var i=t.get(e);i?i.push(s):t.set(e,[s])},off:function(e,s){var i=t.get(e);i&&(s?i.splice(i.indexOf(s)>>>0,1):t.set(e,[]))},emit:function(e,s){var i=t.get(e);i&&i.slice().map(function(t){t(s)}),(i=t.get("*"))&&i.slice().map(function(t){t(e,s)})}}}(),this.socket=Bn(this.ioRelayClient.url,{path:this.ioRelayClient.path,transports:e,autoConnect:!1,timeout:25e3,reconnectionDelay:15e3,reconnectionDelayMax:6e4,reconnectionAttempts:5,randomizationFactor:.5}),this.stream=Bn(this.ioRelayStream.url,{path:this.ioRelayStream.path,transports:e,reconnection:!1,autoConnect:!1}),this.cookie=Nn,this.sha256=Mn}u(){this.De(),this.Listener.addEventListener("window","pagehide",()=>{this.Me=this.socket.connected||!1,this.Ee=this.stream.connected||!1,!0===this.socket.connected&&this.socket.disconnect(),!0===this.stream.connected&&this.stream.disconnect()}),this.Listener.addEventListener("window","pageshow",()=>{!0===this.Me&&(this.Me=!1,this.socket.connect()),!0===this.Ee&&(this.Ee=!1,this.stream.connect())}),this.Listener.addEventListener("window","crisp-pushstate",()=>{this.Re()}),this.Listener.addEventListener("window","crisp-replacestate",()=>{this.Re()})}Ce(t=""){const e=(t||"").match(vr)||[];return{url:e[1]||null,path:e[2]||"/"}}De(){if("object"!=typeof window.history)return;if("function"!=typeof window.history.pushState)return;if("function"!=typeof window.history.replaceState)return;let t=window.history;this.je=t.pushState,t.pushState=zi(function(...e){let s=this.je.apply(t,e);return window.dispatchEvent(new Event("crisp-pushstate")),s},this),this.$e=t.replaceState,t.replaceState=zi(function(...e){let s=this.$e.apply(t,e);return window.dispatchEvent(new Event("crisp-replacestate")),s},this)}Ae(){this.je&&(window.history.pushState=this.je),this.$e&&(window.history.replaceState=this.$e)}Re(){this.Session._sendDevice(),this.event.emit("window:history",{page_url:document.location.href,page_domain:document.location.hostname})}},br=/([*]{1})/g,Er=/([*]{2})/g,Cr=/^([!]{1})/,kr=/(\[match:single\])/g,$r=/(\[match:double\])/g,Ar=/(\[match:negate\])/g,Br=new RegExp(["^(\\!)?","(?:https?:[\\/]*)?","(?:www\\.)?([^\\/]+)([^#?]*)?","(?:[\\/]+)?","(?:[#?].*)?"].join(""),"i"),xr=new class extends Ge{constructor(){super(),this.Kn()}reset(){this.Kn()}getOrFallback(t,e,s=null){let i=t;return i=null!==s?typeof t!==s?e:t:t||e,i}filterImageUrlResize(t,e,s){let i=Me.URL_IMAGE;return this.Zn(t,`${i}/process/resize/?url=${encodeURIComponent(t)}&width=${e}&height=${s}`)}filterImageUrlOriginal(t){let e=Me.URL_IMAGE;return this.Zn(t,`${e}/process/original/?url=${encodeURIComponent(t)}`)}toHashCode(t){let e=0;if(t.length>0)for(let s=0;s0){let s=0;for(;s0){let e=0;for(;e1&&"/"!==e[e.length-1]&&"*"!==e[e.length-1]&&(e+="/"):e="/",i=`${s}${t}${e}`,i}comparePageRules(t,e,s=null){let i=!1;if(e?.length>0){let n,r=[],o=[],u=[];null===s&&(s=wu.website?.website?.domain);for(let t=0;t{})}openLink(t){let e=window.open();e.opener=null,e.location=t}downloadLocalFile(t,e){if(!window.URL)throw new Error("Cannot download");let s=window.URL.createObjectURL(new Blob([e])),i=document.createElement("a");i.href=s,i.download=t,i.textContent=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(s)}acquireChannelUrlRegex(t,e,s=""){let i=null;if(wu.website.channels[t]&&(i=this.Yn[t]?.[e],!i)){let n=wu.chat.generateChannelLink("helpdesk");i=new RegExp(`^${Ti.parse().escape_regex(n)}${s}$`),this.Yn[t]=this.Yn[t]||{},this.Yn[t][e]=i}return i}nextRender(t){fs(t)}setTimeout(t,e=0){let s=null;if(!yr.Schedule)throw new Error(`Could not set timeout after ${e}ms, as the schedule wrapper is not yet available`);return s=yr.Schedule.setTimeout(t,e),s}clearTimeout(t){if(!yr.Schedule)throw new Error(`Could not clear timeout #${t}, as the schedule wrapper is not yet available`);yr.Schedule.clearTimeout(t)}setInterval(t,e=0){let s=null;if(!yr.Schedule)throw new Error(`Could not set interval every ${e}ms, as the schedule wrapper is not yet available`);return s=yr.Schedule.setInterval(t,e),s}clearInterval(t){if(!yr.Schedule)throw new Error(`Could not clear interval #${t}, as the schedule wrapper is not yet available`);yr.Schedule.clearInterval(t)}addEventListener(t,e,s,i={}){return yr.Listener.addEventListener(t,e,s,i)}removeEventListener(t,e,s){yr.Listener.removeEventListener(t,e,s)}insertLinkQueryValues(t,e={}){let s=t;if(s?.length>0){let t="";for(let s in e)t&&(t+="&"),t+=`${s}=${encodeURIComponent(e[s])}`;if(t?.length>0){let e=s[s.length-1];"?"!==e&&"&"!==e&&(s+=!0===s.includes("?")?"&":"?"),s+=t}}return s}Zn(t,e){let s=Me.URL_IMAGE;return t.substring(0,s.length)===s?t:e}Kn(){this.Yn={}}},jr=Ze({code:"",direction:"ltr"},{});function Ir(t){return{all:t=t||new Map,on:function(e,s){var i=t.get(e);i?i.push(s):t.set(e,[s])},off:function(e,s){var i=t.get(e);i&&(s?i.splice(i.indexOf(s)>>>0,1):t.set(e,[]))},emit:function(e,s){var i=t.get(e);i&&i.slice().map(function(t){t(s)}),(i=t.get("*"))&&i.slice().map(function(t){t(e,s)})}}}function Sr(){return(new Date).getTime()}jr.web=Se(()=>{let t=null;t=Me.LOCALE_DEFAULT;let e=jr.code;return!0===Me.LOCALE_WEBSITE.includes(e)&&(t=e),t});var Rr=class{constructor(){this.Qn=Ir(),this.Xn={},this.tr=[]}subscribe(t,e){this.Qn.on(t,e),this.er(t),this.Xn[t]||(this.Xn[t]=[]),this.Xn[t].push(e)}unsubscribe(t,e){this.Qn.off(t,e),this.Xn[t]&&(this.Xn[t]=this.Xn[t].filter(t=>t!==e))}emit(t,e){xr.setTimeout(()=>{this.tr.length<50&&this.tr.push({event:t,data:e,timestamp:Sr()}),this.Qn.emit(t,e)},1)}er(t){this.tr.forEach(e=>{e.event===t&&e.timestamp>Sr()-1e3&&this.Qn.emit(e.event,e.data)}),this.tr=this.tr.filter(e=>e.event!==t)}},Or=new class extends Rr{constructor(){super()}subscribe(t,e){super.subscribe(t,e)}unsubscribe(t,e){super.unsubscribe(t,e)}blurFromForeground(){super.emit("blur-from-foreground")}focusOnForeground(){super.emit("focus-on-foreground")}scrollTo(t=0){super.emit("scroll-to",t)}scrollToLastMessage(t="to"){super.emit("scroll-to-last-message",t)}checkClearance(){super.emit("check-clearance")}},Tr=new class extends Rr{constructor(){super()}logger(t,e=null){null===e?We.disconnectLogSink(t):We.connectLogSink(t,e)}subscribe(t,e){super.subscribe(t,e)}unsubscribe(t,e){super.unsubscribe(t,e)}onTesterStartNewConversation(){super.emit("tester/start-new-conversation")}onTesterMessageSent(t){super.emit("tester/message-sent",t)}onTesterMessageUpdated(t){super.emit("tester/message-updated",t)}onInterfaceAction(t,e={}){super.emit("interface-action",{action:t,data:e})}onInterfaceLifecycle(t,e={}){super.emit("interface-lifecycle",{state:t,data:e})}initialMode(t){return wu.chat.effectiveInitialMode(t)}changeMode(t){wu.chat.changeMode(t,!0)}showCompose(t,e){wu.messages.showCompose(t,e)}hideCompose(){wu.messages.hideCompose()}injectMessage(t){wu.messages.handleReceived(t,null,!0,!0,!0,!1)}notificationProvider(t,e=!0){e?yr.Notification.providerRegister(t):yr.Notification.providerUnregister(t)}socketConnection(t=!0){t?yr.socket.connect():yr.socket.disconnect()}reset(){e().Action.do_session_reset()}unload(t=null,s=null){e().Base.uninsertAndReset(),yr.Session.reset(!1,t,s)}updateWebsiteChatSetting(t,s){let i=e().Action[`config_${t}`];"function"==typeof i?i(s):wu.website.updateChatValue(t,s)}updateWebsiteOverlaySearchLocale(t,e){wu.website.updateOverlaySearchLocale(t,e)}updatePluginSettings(t,e){wu.website.updatePluginSettings(t,e)}},zr=new class{url(t,e,s,i=null){let n=Me.URL_IMAGE;return null!==i&&"string"==typeof i?Me.TEST||i.substring(0,n.length)===n?i:`${n}/process/thumbnail/?url=${encodeURIComponent(i)}&width=${t}&height=${t}&${wu.website?.website?.buster}`:`${n}/avatar/${e}/${s||"default"}/${t}/?${wu.website?.website?.buster}`}},Pr=["button","alert"],Lr=["[tabindex='0']:not([disabled])","input:not([disabled]):not([type='hidden'])","textarea:not([disabled])","select:not([disabled])","button:not([disabled])","a[href]"].join(", "),Mr={stack:[]},Ur=new class extends Ge{constructor(){super()}reset(){Mr.stack=[]}init(t){let e=this;t.directive("crispAccessibility",{beforeMount:(t,s)=>e.mount(t,s),updated:(t,s)=>e.update(t,s),beforeUnmount:t=>e.unbind(t)})}bindPetiteVue(t){let e=t.el,s={value:{role:t.get().role}};return this.mount(e,s)}mount(t,e){!0!==e?.value?.disabled?(t.$cac={},t.$cac.role=e?.value?.role,t.$cac.fnOnKeydown=e=>{this.sr(t,e)},t.removeEventListener("keydown",t.$cac.fnOnKeydown),t.addEventListener("keydown",t.$cac.fnOnKeydown),t.setAttribute("tabindex",0),t.$cac.role&&t.setAttribute("role",t.$cac.role),Mr.stack.push(t)):this.ir(t)}update(t,e){!0===Mr.stack.includes(t)&&this.mount(t,e)}unbind(t){this.ir(t)}nr(t){return Array.from(t.querySelectorAll(Lr)).filter(t=>{let e=window.getComputedStyle(t);return"hidden"!==e.visibility&&"none"!==e.display&&null!==t.offsetParent})}ir(t){Object.keys(t.$cac||{}).length>0&&t.removeEventListener("keydown",t.$cac.fnOnKeydown);let e=Mr.stack.indexOf(t);e>-1&&Mr.stack.splice(e,1),t.$cac={}}sr(t,e){switch(e.keyCode){case 13:case 32:e.target?.role&&Pr.includes(e.target.role)&&(e.stopImmediatePropagation(),e.preventDefault(),e.target.click());break;case 9:{let s=t.closest(".cc-1mh91");if(s){let i=this.nr(s);if(i.length>0){let s=i[0],n=i[i.length-1];e.shiftKey||t!==n||(e.stopImmediatePropagation(),e.preventDefault(),s.focus()),e.shiftKey&&t===s&&(e.stopImmediatePropagation(),e.preventDefault(),n.focus())}}break}}}},qr=new class{formatText(t,e={}){return Ti.parse().format("string"==typeof t?t:"",e)}generateAvatarUrl(t,e,s,i=null){return zr.url.call(zr,t,e,s,i)}translateText(t,e,s=[]){return bu.text.call(bu,t,e,s)}parseFirstName(t){return Ti.name().parse_first_name("string"==typeof t?t:"")}imageUrlOriginal(t){return xr.filterImageUrlOriginal(t)}imageUrlResize(t,e=null,s=null){return xr.filterImageUrlResize(t,null!==e?e:600,null!==s?s:600)}imageUrlBackground(t,e=!0){return"url('"+t+"')"+(e?" !important":"")}};var Vr=new class{dom(t){let e=document.createElement("div");return e.innerHTML=t,e.firstChild}vue(t){let e={};return e._f=qr.formatText,e._n=qr.parseFirstName,e._e=qr.translateText,e._a=qr.generateAvatarUrl,e.imageUrlResize=qr.imageUrlResize,e.imageUrlOriginal=qr.imageUrlOriginal,e.imageUrlBackground=qr.imageUrlBackground,yi({reactive:pe,effect:vt,stop:yt,remove:c},{$store:wu,$render:e}).directive("crisp-accessibility",function(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}(Ur.bindPetiteVue,Ur)).mount(t)}},Nr="urn:crisp.im:triggers:0",Hr=new class{getTriggers(){return wu.website?.plugins?.["urn:crisp.im:triggers:0"]?.settings||{}}getCustomization(t,e,s=null){let i=null,n=wu.website?.plugins?.["urn:crisp.im:customization:0"]?.settings||null,r=n?.$i18n?.[wu.locale.code]||{};return t in r&&(n=r),i=n?.[t]?.[e]||{},s&&(i=i[s]||null),i}},Wr=Me.THEME.DEFAULT_COLOR,Jr=Me.THEME.AVAILABLE_COLORS,Gr=Me.THEME.DERIVE_COLORS,Kr=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,Zr=/_/g,Yr=new class{applyTheme(t,e=!1){let s=document.querySelector(".crisp-client"),i=this.rr(t,e);for(let n in i)s.style.setProperty(`--crisp-color-theme-${n}`,i[n].rgb)}applyContainerIndex(t){let e=document.querySelector(".crisp-client");t&&e.style.setProperty("--crisp-customization-container-index",t.toString())}applyPosition(t){let e=document.querySelector(".crisp-client"),s=this.ur(t);for(let i in s){let t=i.replace(Zr,"-");e.style.setProperty(`--crisp-customization-${t}`,`${s[i]}px`)}}rr(t,e=!1){let s,i,n={};!0!==e?(s=Hr.getCustomization("color","chatbox"),this.ar(s)):s={},i=Jr[t]||Jr[Wr],this.lr(s,i);for(let r in s)n[r]={hex:s[r],rgb:this.hr(s[r])};return n}ur(t){let e;e=!0===wu.base.runtime.tester_mode?{}:Hr.getCustomization("position","chatbox");for(let s in t)e[s]=t[s];return e}ar(t){let e=t[500];if(e){let i=this.cr(e);for(let n in Gr){let r=Gr[n];if(!t[n])try{t[n]=this.dr(i,r.percent,r.transparent)}catch(s){We.error(`Failed deriving color: ${n} from baseline: ${e}`,s)}}}}dr(t,e,s=!1){let[i,n,r]=t;return s?(i=parseInt(i+(255-i)*e/100),n=parseInt(n+(255-n)*e/100),r=parseInt(r+(255-r)*e/100)):(i=parseInt(i*(100+e)/100),n=parseInt(n*(100+e)/100),r=parseInt(r*(100+e)/100)),i=i<255?i:255,n=n<255?n:255,r=r<255?r:255,"#"+[this.Dr(i),this.Dr(n),this.Dr(r)].join("")}cr(t){let e=t.toString();return[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)]}Dr(t){return(1===t.toString(16).length?`0${t.toString(16)}`:t.toString(16)).toUpperCase()}lr(t,e){for(let s in e)t[s]||(t[s]=e[s])}hr(t){let e=[0,0,0],s=t.match(Kr);return s&&(e[0]=parseInt(s[1],16),e[1]=parseInt(s[2],16),e[2]=parseInt(s[3],16)),`${e[0]}, ${e[1]}, ${e[2]}`}};function Qr(){return(new Date).getTime()}var Xr=/^(?:https?:[/]*)?([^/]+)(?:\/.*)?$/i,to=Ze({website:{name:"",domain:"",mailer:"",buster:1,count_operators:0,active_operators:[],response_metrics:{},last_available:Qr(),status:null,trial:!1,online:!1},channels:{},overlay:{},plugins:{},chat:{country:null,locale:"",color_theme:"default",color_mode:"light",layout_theme:"colorized",allowed_pages:[],blocked_pages:[],blocked_locales:[],tile:"default",website_logo:!1,last_operator_face:!1,ongoing_operator_face:!0,activity_metrics:!0,operator_privacy:!1,visitor_privacy:!1,availability_tooltip:!0,hide_vacation:!1,hide_on_away:!1,hide_on_mobile:!1,position_reverse:!1,email_visitors:!0,phone_visitors:!0,force_identify:!1,ignore_privacy:!1,visitor_compose:!0,file_transfer:!0,audio_record:!0,mode_initial:"chat",home:!1,overlay_search:!1,overlay_mode:!1,helpdesk_link:!0,helpdesk_only:!1,helpdesk_navigate:"frequent",status_health_dead:!0,wait_game:!1,conversations:!0,theme_text:"default",theme_welcome:"default"}},{updateWebsite(t,e){if(Me.TEST){let s=to.pr(t,e);t=s.configuration,e=s.session}to.online=!1,(t=t||{}).settings=t.settings||{};let s={website:{name:t.website||"",domain:xr.extract(Xr,t.domain,Xo.website.domain,1),mailer:t.mailer||"",buster:e.buster||1,count_operators:e.count_operators||0,active_operators:e.active_operators||t.operators||[],response_metrics:e.response_metrics||{},last_available:e.last_available||Qr(),status:e.status||null,trial:t.trial||!1,online:t.online||!1},channels:t.channels||{},overlay:t.overlay||{},plugins:t.plugins||{},chat:{country:xr.getOrFallback(e.context?.country,null),locale:bu.detect(t.settings.locale?[t.settings.locale]:[]),color_theme:xr.getOrFallback(t.settings.color_theme,"default"),color_mode:xr.getOrFallback(t.settings.color_mode,"light"),layout_theme:xr.getOrFallback(t.settings.layout_theme,"colorized"),allowed_pages:xr.getOrFallback(t.settings.allowed_pages,[]),blocked_pages:xr.getOrFallback(t.settings.blocked_pages,[]),blocked_locales:xr.getOrFallback(t.settings.blocked_locales,[]),tile:xr.getOrFallback(t.settings.tile,"default"),website_logo:xr.getOrFallback(t.settings.website_logo,!1,"boolean"),last_operator_face:xr.getOrFallback(t.settings.last_operator_face,!1,"boolean"),ongoing_operator_face:xr.getOrFallback(t.settings.ongoing_operator_face,!1,"boolean"),activity_metrics:xr.getOrFallback(t.settings.activity_metrics,!0,"boolean"),operator_privacy:xr.getOrFallback(t.settings.operator_privacy,!1,"boolean"),visitor_privacy:xr.getOrFallback(t.settings.visitor_privacy,!1,"boolean"),availability_tooltip:xr.getOrFallback(t.settings.availability_tooltip,!0,"boolean"),hide_vacation:xr.getOrFallback(t.settings.hide_vacation,!1,"boolean"),hide_on_away:xr.getOrFallback(t.settings.hide_on_away,!1,"boolean"),hide_on_mobile:xr.getOrFallback(t.settings.hide_on_mobile,!1,"boolean"),position_reverse:xr.getOrFallback(t.settings.position_reverse,!1,"boolean"),email_visitors:xr.getOrFallback(t.settings.email_visitors,!0,"boolean"),phone_visitors:xr.getOrFallback(t.settings.phone_visitors,!0,"boolean"),force_identify:xr.getOrFallback(t.settings.force_identify,!1,"boolean"),ignore_privacy:xr.getOrFallback(t.settings.ignore_privacy,!1,"boolean"),visitor_compose:xr.getOrFallback(t.settings.visitor_compose,!0,"boolean"),file_transfer:xr.getOrFallback(t.settings.file_transfer,!0,"boolean"),audio_record:xr.getOrFallback(t.settings.audio_record,!0,"boolean"),mode_initial:xr.getOrFallback(t.settings.mode_initial,"chat"),home:xr.getOrFallback(t.settings.home,!1,"boolean"),overlay_search:null!==t.overlay?xr.getOrFallback(t.settings.overlay_search,!1,"boolean"):null,overlay_mode:xr.getOrFallback(t.settings.overlay_mode,!1,"boolean"),helpdesk_link:xr.getOrFallback(t.settings.helpdesk_link,!0,"boolean"),helpdesk_only:xr.getOrFallback(t.settings.helpdesk_only,!1,"boolean"),helpdesk_navigate:xr.getOrFallback(t.settings.helpdesk_navigate,"frequent"),status_health_dead:xr.getOrFallback(t.settings.status_health_dead,!0,"boolean"),wait_game:xr.getOrFallback(t.settings.wait_game,!1,"boolean"),conversations:xr.getOrFallback(t.settings.conversations,!0,"boolean"),theme_text:xr.getOrFallback(t.settings.text_theme,"default"),theme_welcome:xr.getOrFallback(t.settings.welcome_message,"default")}};xr.merge(to,s),Po.mode=Po.effectiveInitialMode()},updateChatValue(t,e){if(t in to.chat)return e!==to.chat[t]&&(to.chat[t]=e,!0);throw new Error(`${t} does not exist`)},updateOverlaySearchLocale(t,e){to.overlay.search||(to.overlay.search={}),to.overlay.search[t]=e},updatePluginSettings(t,e){t&&e&&"string"==typeof t&&"object"==typeof e&&(to.plugins||(to.plugins={}),to.plugins[t]||(to.plugins[t]={}),to.plugins[t].settings=e,to.plugins={...to.plugins},to._r(t,e))},_r(t,s){switch(t){case"urn:crisp.im:customization:0":s.color?.chatbox&&Yr.applyTheme(to.chat?.color_theme||"default"),s.position?.chatbox&&Yr.applyPosition({});break;case Nr:e().Trigger.updateAndReapplyDefaults(s.defaults)}},pr:(t,e)=>(window.$mock_website&&(delete t.plugins,xr.merge(t,window.$mock_website)),window.$mock_overlay&&xr.merge(t,window.$mock_overlay),window.$mock_helpdesk&&xr.merge(t,window.$mock_helpdesk),window.$mock_session&&(xr.merge(e,window.$mock_session),e.active_operators=window.$mock_session.active_operators,e.active_operators[0].timestamp=e.last_available),{configuration:t,session:e})});to.show_branding=Se(()=>!0!==Xo.runtime?.hide_branding&&(!to?.plugins["urn:crisp.im:debranding:0"]||!0===to.website?.trial));var eo=["Khtml","Ms","O","Moz","Webkit"],so={macos:/^Mac/,windows:/^Win/,linux:/^Linux/,ios:/^(?:iPhone|iPod|iPad)$/,android:/^Android$/},io=/^[a-z]/,no=/no/,ro=pe(Object.assign({mr(){let t=null,e=document.createElement("audio"),s=Boolean(e.canPlayType&&e.canPlayType('audio/ogg; codecs="vorbis"').replace(no,"")),i=Boolean(e.canPlayType&&e.canPlayType('audio/mp4; codecs="mp4a.40.2"').replace(no,"")),n=Boolean(e.canPlayType&&e.canPlayType("audio/mpeg;").replace(no,""));!0===s?t="oga":!0===i?t="m4a":!0===n&&(t="mp3"),null!==t&&(ro.html_audio_format=t,ro.has_html_audio=!0)},gr(){let t=null,e=window.navigator.platform||null;if(null!==e)for(let s in so)if(!0===so[s].test(e)){t=s;break}null!==t&&(ro.operating_system=t)},Fr(){ro.has_audio_recording=!1,window.MediaRecorder&&window.File&&navigator.mediaDevices&&"function"==typeof window.MediaRecorder.isTypeSupported&&"function"==typeof navigator.mediaDevices.enumerateDevices&&navigator.mediaDevices.enumerateDevices().then(t=>{for(let e=0;e<(t?.length||0);e++)if("audioinput"===t[e].kind){ro.has_audio_recording=!0;break}Xo.features.audio_recording=ro.has_audio_recording}).catch(()=>{})},wr(){ro.has_screen_touch=ro.vr("ontouchstart")||navigator.maxTouchPoints>0;let t=()=>{ro.has_screen_touch=!0,window.removeEventListener("touchstart",t)};window.addEventListener("touchstart",t,!1)},yr(){let t=(t=null)=>{ro.color_scheme_preference=!0===t?.matches?"dark":"light"},e=window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;null!==e&&(t(e),e.addEventListener("change",t))},vr:t=>Boolean(t in window),br(t){let e=!1,s=document.documentElement.style,i=eo.length;if(t in s)e=!0;else for(t=t.replace(io,t=>t.toUpperCase());i--;)if(eo[i]+t in s){e=!0;break}return e}},{has_css_animations:!1,has_audio_recording:!1,has_html_audio:!1,has_screen_touch:!1,operating_system:null,html_audio_format:"mp3",color_scheme_preference:"light"}));ro.has_css_animations=ro.br("animation")&&!0!==Me.TEST,ro.Fr(),ro.wr(),ro.gr(),ro.mr(),ro.yr();var oo="minimized",uo=Ze({paneOpenHandler:function(t){},pane:{is_ongoing:!1,is_waiting:!1,is_offline:!1,animate_entrance:!1,general_entice:{visible:!1,is_concealed:!1,animate_full:!1,animate_short:!1},helpdesk:{url:null,only:!1}},tooltips:{new_messages:{visible:!1,animate:!0}}},{checkIsConcealed(){!0===to.chat?.availability_tooltip&&(uo.pane.general_entice.is_concealed="1"===yr.Storage.getStampLocal(oo,[Xo.website.id,"general_entice","conceal"])&&!0)},checkHelpdesk(){!0===to.chat?.helpdesk_link&&to.channels?.helpdesk&&Xo.page_domain!==to.channels?.helpdesk&&!0===yr.socket.connected&&(uo.pane.helpdesk.url=Po.generateChannelLink("helpdesk"),uo.pane.helpdesk.only=to.chat?.helpdesk_only&&!0)},concealGeneralEntice(){uo.pane.general_entice.is_concealed=!0,yr.Storage.setStampLocal(oo,[Xo.website.id,"general_entice","conceal"],"1")},spawnPane(t,s=!0,i=!1,n=!0){let r=Vr.dom(t);if(e().Base._containerEl.innerHTML="",e().Base._containerEl.appendChild(r),Vr.vue(r),!0===s){let t=to,e=!0!==Xo.is_full_view&&!0===t.chat.availability_tooltip;!0===n&&ro.has_css_animations?(!0===i&&(uo.pane.animate_entrance=!0,xr.setTimeout(()=>{uo.pane.animate_entrance=!1},1e3)),e&&xr.setTimeout(()=>{let t=uo.pane;uo.pane.general_entice.visible=!0;let e=!0===i?"animate_full":"animate_short";t.general_entice[e]=!0,xr.setTimeout(()=>{t.general_entice[e]=!1},500)},1e3*(!0===i?2:.25))):e&&(uo.pane.general_entice.visible=!0)}},onPaneClick(t){let s=t.target;if(s){let t="cc-1nzt8",i=s.getAttribute("data-pop");if(!i){let t=s.closest("[data-pop]");t&&(i=t.getAttribute("data-pop")||null)}if(!0===s?.classList.contains(t))uo.concealGeneralEntice();else switch(i){case"overlay:open":e().Action.do_overlay_open();break;case"helpdesk:search":e().Action.do_helpdesk_search();break;case"minimized:open":uo.paneOpenHandler(t=>{e().Chat.init(t)})}}},paneAuthorized(t=!1,s=!1,i=!0){let n=!1,r=!1;uo.checkIsConcealed(),uo.checkHelpdesk(),uo.spawnPane('
{{ $render._e("minimized", "tooltip_entice_title_search") }}{{ $render._e("theme_text", "default_chat", [$store.website?.chat?.theme_text + "_chat"]) }}{{ $render._e("minimized", "tooltip_entice_status_online") }}{{ $render._e("minimized", "tooltip_entice_status_away") }}
{{ $render._e("minimized", "tooltip_entice_action_chat", [$store.website?.website?.name]) }}
{{ $render._e("minimized", "tooltip_entice_action_search") }}
',!0,t,i),uo.paneOpenHandler=t=>{if(!1===n)if(n=!0,!1===s&&!0!==r){uo.pane.is_waiting=!0,e().Event.triggerInteracted(!0);let s=xr.setTimeout(()=>{Xo.session_id&&(alert(bu.text("chat","minimized_connect_alert_failure")),yr.socket?.disconnect(),uo.pane.is_waiting=!1,e().Action.do_chat_hide())},12e3);e().Broker._fnInitialize.master=e=>{xr.clearTimeout(s),t(e),n=!1},yr.socket.connect(),r=!0}else t(),n=!1,r=!0},Xe.apply()},paneUnauthorized(t=!1,e=!0){uo.spawnPane('
{{ $render._e("minimized", "unauthorized_pane") }}
',!1,t,e),uo.paneOpenHandler=()=>{}}});var ao=Ze({},{states:(t=null)=>Eo.session(t).alert||{},update(t,e,s=null){let i,n,r,o,u=ao.states(s);"object"==typeof t?i=t:(i={},i[t]=e);let a=xr.clone(u);for(n in i)i.hasOwnProperty(n)&&(r=i[n],o=!1,void 0!==u[n]&&u[n]===r&&(o=!0),"lock"===u[n]&&"unlock"!==r&&(o=!0),!1===o&&(a[n]=r));Eo.propagate("alert",a,s)},hook(t,e,s=null){let i=ao.hookMethods[e];"function"==typeof i&&function(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}(i,this)(t,s)},Er(t,e=null){ao.Cr(t,e)},kr(t,e=null){ao.Cr(t,e)},Cr(t,e=null){"show"===t?Qo.checkFormIdentifyLock(e):Qo.checkFormIdentifyUnlock(e)}});ao.hookMethods={warn_reply:ao.Er,email_invalid:ao.kr};var lo=Ze({type:"smiley",is_visible:!1,has_animation:!1,last_search_query:null,selection:{},smiley:{input:""},gif:{results:[],input:""}},{toggle(){lo.last_search_query=null,lo.is_visible=!lo.is_visible,lo.has_animation=!0,lo.type="smiley"},show(t){lo.type!==t&&(lo.hide(),lo.is_visible=!0,lo.type=t,"gif"===t&&lo.loadDataGif())},hide(){lo.last_search_query=null,lo.is_visible=!1,lo.has_animation=!1,lo.smiley.input="",lo.gif.input=""},loadDataGif(t=""){if(lo.last_search_query!==t){lo.last_search_query=t,yr.Media.getAnimationList(t,1,15),lo.gif.results=[];for(let t=0;t<15;t++)lo.gif.results.push({loading:!0})}},backupSelection(t){lo.selection={start:t.selectionStart,end:t.selectionEnd}}}),ho={request(t){_o.update("feedback",void 0,t)},toggle(){co.is_visible=!co.is_visible,!0!==co.is_visible?Or.focusOnForeground():lo.hide()},hide(){co.is_visible=!1},show(t=null){co.session_id=t,co.is_visible=!0},markAvailable(t=!1){co.is_available=t}};Me.TEST&&(window.$markFeedbackAvailable=()=>{co.is_available=!0});var co=Ze({is_visible:!1,is_available:!1,session_id:null,stars:{hovered:0,selected:0},comment:""},ho),Do=Ze({is_visible:!1,is_pending:!1,last_error:null,session_id:null,method:"",identity:"",annotation:""},{request(t,e,s,i){"link"===e&&_o.update("authenticate",[e,s,i].join("/"),t)},submit:t=>!0!==Do.is_pending&&(Do.is_pending=!0,Do.last_error=null,yr.Session.sendIdentityVerify(Do.method,{token:t,identity:Do.identity,recipient:Do.annotation},Do.session_id),!0),acknowledge(t,e,s,i,n=null){Do.method===e&&Do.identity===s&&Do.annotation===i&&(Do.is_pending=!1,Do.last_error=n,null===n&&_o.update("authenticate",!1,t))},hide(t=null){t===Do.session_id&&(Do.is_visible=!1)},show(t,e,s,i=null){Do.is_pending=!1,Do.last_error=null,Do.is_visible=!0,Do.session_id=i,Do.method=t,Do.identity=e,Do.annotation=s},showFromIntent(t,e=null){let[s,i,n]=t.split("/");s&&i&&n&&Do.show(s,i,n,e)}});var fo=["identity","authenticate","game","feedback"],po={states:(t=null)=>Eo.session(t).intent||{},update(t,e="default",s=null,i=!1){let n=_o.states(s);if(!0===fo.includes(t)){if(!0===i||!1!==n[t]){let i=xr.clone(n);e||!1===e?i[t]=e:delete i[t],Eo.propagate("intent",i,s)}}else We.error(`Unknown intent: ${t}`)},cleanup(t=null,e=null){let s=_o.states(e);for(let i=0;i{_o.update("game")});var _o=Ze({},po);_o.toggleMethods={identity:_o.$r,authenticate:_o.Ar,game:_o.Br,feedback:_o.jr},_o.current_identity=Se(()=>_o.states().identity||null);var mo=Ze({opened:!1,loaded:!1,target:"",title:""},{open(t,e="",s={}){s.website_id=Xo.website.id,s.session_id=Po.effectiveSessionId();let i=xr.insertLinkQueryValues(t,s);!0===mo.opened&&mo.target!==i&&mo.close(),!1===mo.opened&&(mo.loaded=!1,mo.target=i,mo.title=e||"",mo.opened=!0)},close(){!0===mo.opened&&(mo.opened=!1,mo.target="",mo.title="",mo.loaded=!1)}}),go=Ze({loaded:!1,visible:!1},{start(){go.visible=!0,go.loaded=!1},stop(){go.visible=!1}});function Fo(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}var wo=["intent"],vo=[["show","unlock"],["unlock","show"],["hide","lock"],["lock","hide"],["lock","show"]],yo={defaultStates:()=>({conversation:"default",trigger:e().Trigger._processed,textarea:"",maximized:!0,expanded:!1,alert:{},intent:{},operator:{}}),session:(t=null)=>Eo.Ir(t).session,receive(t,e=null,s=!1){let i,n=Eo.Ir(e),r=[];for(let o in t)t.hasOwnProperty(o)&&(xr.isEqual(t[o],n.session[o])||(r.push(o),n.session[o]=t[o],!1===s&&void 0!==n.pending[o]&&delete n.pending[o]));for(let o=0;o{if(xr.isEmpty(u.pending))"function"==typeof r&&r(!1);else{let t=xr.clone(u.pending);u.pending={},u.pendingTimeout=null,yr.Session.setState(t,s,t=>{t?"function"==typeof o&&o():"function"==typeof r&&r(!0)})}},!0===n?0:250)}},restore(t,e=null){let s=Eo.Ir(e);!0===Xo.is_full_view&&!0!==Xo.runtime?.lock_maximized&&(t.maximized=!1);let i=Eo.defaultStates();for(let n in i)void 0===t[n]&&(t[n]=i[n]);s.isRestored=!0,s.session=t,s.restoredState=xr.keys(t)},retrigger(t,e=null){let s=Eo.defaultStates();Eo.Sr(t,s[t],e)},initialize(t=null,e=wo){let s=Eo.defaultStates();for(let i in s)s.hasOwnProperty(i)&&Eo.Sr(i,s[i],t,e.includes(i))},Sr(t,e,s=null,i=!1){let n=Eo.Ir(s);"function"==typeof Eo.register[t]&&(void 0===n.session[t]&&(n.session[t]=e),Fo(Eo.register[t],this)(n.session[t],s,i))},Rr(t,e=null){let s=Eo.Ir(e),i=!1,n=s.restoredState.indexOf(t);return-1!==n&&(s.restoredState.splice(n,1),i=!0),i},Or(t,s=null,i=!1){if(!0===i)return;if(Eo.Rr("conversation",s),s!==Xo.session_id)return;let n;n="default"===t?Xo.session_id:t||null;let r=Po.conversations.all_session_ids;null!==n&&!1===r.includes(n)&&(n=null),yr.Config.setCurrentSessionChildId(n),Po.conversations.current_session_id=n,null!==n&&"chat"===Po.mode&&(e().Chat.Interface.applyChatFocus(),e().Chat.Interface.requestDynamicSizingProperties(),Or.focusOnForeground(),Or.scrollToLastMessage())},Tr(t,s=null,i=!1){if(!0!==i&&(Eo.Rr("trigger",s),s===Xo.session_id&&t?.length>0))for(let n=0;nYe(t=Po.effectiveSessionId(t)||"default",bo,Eo.Vr)},bo={isRestored:!1,session:{},pending:{},pendingTimeout:null,restoredState:[]},Eo=Ze({Vr:{}},yo);Qe(()=>{Eo.Vr={}}),Eo.register={conversation:Eo.Or,trigger:Eo.Tr,alert:Eo.zr,intent:Eo.Pr,operator:Eo.Lr,maximized:Eo.Mr,expanded:Eo.Ur,textarea:Eo.qr};var Co=new class extends Rr{constructor(){super()}subscribe(t,e){super.subscribe(t,e)}unsubscribe(t,e){super.unsubscribe(t,e)}handleAutocomplete(t=[]){super.emit("handle-autocomplete",t)}},ko=["home","helpdesk"],$o=Ze({Nr:null,Hr:null,activeSearchQuery:"",search:{input:"",url:"",entity:null,results:[],active:!1,initialized:!1,loading:!1},viewer:{url:"",loaded:!1},navigation:{current:{title:"",description:"",summary:"",filter:{categoryId:null,sectionId:null},origin:{method:null,arguments:[]}},previous:[]}},{isAvailable:()=>!!Po.generateChannelLink("helpdesk"),open(t=!1){let e=!1,s=Po.generateChannelLink("helpdesk");return s&&(e=!0,"helpdesk"!==Po.mode&&($o.search.input="",$o.search.url=s,$o.search.results=[],$o.search.active=!1,Po.mode="helpdesk"),!0===t&&$o.showSearch()),e},proceedSearch(t=""){t!==$o.activeSearchQuery&&($o.Wr(),$o.search.loading=!0,$o.Hr=xr.setTimeout(()=>{if($o.Hr=null,$o.activeSearchQuery=t,t){$o.acquireQueryResults(t);let e=t.substring(t.lastIndexOf(" ")+1).trim();e&&e.length>=2&&yr.Helpdesk.getArticleSuggest(e,jr.code)}else $o.Jr()},100))},acquireQueryResults(t=""){$o.search.loading=!0,yr.Helpdesk.getArticleSearch(t,jr.code)},showSearch(t=1){return $o.Gr(()=>{$o.Kr(null,()=>{$o.search.initialized=!1,$o.search.input?$o.acquireQueryResults($o.search.input):$o.Jr(),e().Chat.Interface.requestDynamicSizingProperties()},{fn:"showSearch",args:arguments,direction:t})})},showCategory(t,e,s,i=null,n=null,r=[],o=1){return $o.Gr(()=>{$o.Kr(s,s=>{s.filter.categoryId=e,s.description=i||"",s.summary=n||"",$o.search.initialized=!1;let o=1!==r.length||r[0].section_id?null:"";null!==o?(s.filter.sectionId=o,yr.Helpdesk.getArticleList(t,e,o)):yr.Helpdesk.getCategoryList(t)},{fn:"showCategory",args:arguments,direction:o})})},showSection(t,e,s,i,n=null,r=null,o=1){return $o.Gr(()=>{$o.Kr(i,i=>{i.filter.categoryId=e,i.filter.sectionId=s,i.description=n||"",i.summary=r||"",$o.search.initialized=!1,yr.Helpdesk.getArticleList(t,e,s)},{fn:"showSection",args:arguments,direction:o})})},showArticle(t,s,i=null,n=null,r=null,o=1){return $o.Gr(u=>{let a=`${u}${t}/article/${s}/`;$o.viewer.url!==a&&($o.viewer.loaded=!1,$o.Kr(i||bu.text("chat","chat_helpdesk_viewer_article_reader"),t=>{t.summary="",t.description=r?bu.text("chat","chat_helpdesk_viewer_updated",[new Date(r).toLocaleDateString()]):n||"",$o.viewer.url=a,!1===Po.is_expanded&&(Po.was_auto_expanded.helpdesk_article=!0,e().Chat.Interface.requestDynamicSizingProperties())},{fn:"showArticle",args:arguments,direction:o}))})},handleArticles(t=[],e={},s=!1){!0===ko.includes(Po.mode)&&(Me.TEST&&window.$mock_helpdesk?.search?.results&&(t=window.$mock_helpdesk.search.results),$o.Zr("articles",t,s),null!==$o.Nr&&xr.clearTimeout($o.Nr),e.query&&($o.Nr=xr.setTimeout(()=>{$o.Nr=null;let s=(e.query||"").trim(),i=e.locale||null;t[0]&&t[0].locale&&(i=t[0].locale),i&&s&&yr.Helpdesk.reportArticleSearch(i,s)},1e3)))},handleCategories(t=[]){"helpdesk"===Po.mode&&(0===t.length?(to.chat.helpdesk_navigate="frequent",$o.Jr()):$o.Zr("categories",t))},handleAutocomplete(t=[]){"helpdesk"===Po.mode&&Co.handleAutocomplete(t)},Jr(){$o.search.loading=!0;let t=to.chat.helpdesk_navigate;switch(t){case"deep":yr.Helpdesk.getCategoryList(jr.code);break;case"frequent":$o.acquireQueryResults();break;default:throw $o.search.loading=!1,new Error(`Unsupported helpdesk view mode: ${t}`)}},Wr(){null!==$o.Hr&&(xr.clearTimeout($o.Hr),$o.Hr=null),null!==$o.Nr&&(xr.clearTimeout($o.Nr),$o.Nr=null)},Zr(t,e,s=!1){$o.search.active=s,$o.search.entity=t,$o.search.results=e,$o.search.initialized=!0,$o.search.loading=!1},Gr(t){let e=!1,s=Po.generateChannelLink("helpdesk");return s&&(e=!0,t(s)),e},Kr(t,e,{fn:s,args:i=[],direction:n=1}){let r=$o.navigation.current;n>0&&(null===t?$o.navigation.previous=[]:r.origin.method&&$o.navigation.previous.push(xr.clone(r))),r.title=t||"",r.description="",r.summary="",r.filter.categoryId=null,r.filter.sectionId=null,$o.viewer.url="",e(r),r.origin.method=s,r.origin.arguments=Array.from(i)}});$o.settings_search=Se(()=>!(""===to.website.domain||!to.chat.helpdesk_link||!to.channels.helpdesk)),$o.settings_only=Se(()=>$o.settings_search&&to.chat.helpdesk_only);var Ao=function(){const t="undefined"!=typeof document&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}(),Bo={},xo=function(t,e,s){let i=Promise.resolve();if(e&&e.length>0){const t=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),o=r?.nonce||r?.getAttribute("nonce");n=e.map(e=>{if((e=function(t){return"https://client.crisp.chat/static/"+t}(e))in Bo)return;Bo[e]=!0;const i=e.endsWith(".css"),n=i?'[rel="stylesheet"]':"";if(s)for(let s=t.length-1;s>=0;s--){const n=t[s];if(n.href===e&&(!i||"stylesheet"===n.rel))return}else if(document.querySelector(`link[href="${e}"]${n}`))return;const r=document.createElement("link");return r.rel=i?"stylesheet":Ao,i||(r.as="script"),r.crossOrigin="",r.href=e,o&&r.setAttribute("nonce",o),document.head.appendChild(r),i?new Promise((t,s)=>{r.addEventListener("load",t),r.addEventListener("error",()=>s(new Error(`Unable to preload CSS for ${e}`)))}):void 0}),i=Promise.all(n.map(t=>Promise.resolve(t).then(t=>({status:"fulfilled",value:t}),t=>({status:"rejected",reason:t}))))}var n;function r(t){const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=t,window.dispatchEvent(e),!e.defaultPrevented)throw t}return i.then(e=>{for(const t of e||[])"rejected"===t.status&&r(t.reason);return t().catch(r)})},jo="overlay",Io=null,So=Ze({is_loading:!1,browse_recent:[],prompt:{query:"",asked:!1,thinking:!1},results:{query:"",answer:[],sources:[],expanded:0,empty:!1,error:!1}},{isAvailable:()=>!0===to.chat.overlay_search&&!0,isOpened:()=>"search"===Po.mode&&!0,isOpenedAndReady:()=>So.isOpened()&&null!==Io&&!0,open(t=null){let e=!1;return!0===So.isAvailable()&&("search"!==Po.mode?(Po.mode="search",this.Yr(t)):this.updatePromptField(""),e=!0),e},updatePromptField(t){So.prompt.query!==t&&!0!==So.prompt.thinking&&(So.prompt.query=t,So.proceedSearch())},proceedSearch(){if(!0!==So.prompt.thinking){let t=(So.prompt.query||"").trim(),e=yr.socket.connected;So.prompt.thinking=t.length>0,So.results.query=t,So.results.answer=[],So.results.sources=[],So.results.expanded=0,So.results.empty=!1,So.results.error=!1,t?(So.prompt.asked=!0,!0===e?yr.Overlay.getOverlayAnswerSearch(t,jr.code):So.handleSearchSources(null,!0)):So.prompt.asked=!1}},handleSearchChunk(t){So.results.answer.push(t)},handleSearchAnswer(t=null,e=null){if(t?So.results.answer=[t]:""===t?(So.results.answer=[bu.text("search","results_answer_quickie_empty")],So.results.empty=!0):(So.results.answer=[],So.results.error=!0),So.prompt.thinking=!1,null!==e){let t=So.browse_recent;t.includes(e)||(t.unshift(e),t.length>3&&t.splice(3),So.Qr(t))}Or.focusOnForeground()},handleSearchSources(t=null,e=!1){So.results.sources=t||[],!0===e&&(null===t&&(So.results.error=!0),So.prompt.thinking=!1)},reset(){So.Qr([])},Yr(t=null){!0!==So.is_loading&&(So.is_loading=!0,So.browse_recent=So.Xr()||[],xo(()=>import("./main_default_2a24f894.js").then(s=>{Io=s.default(".cc-15mn6"),Or.focusOnForeground(),So.is_loading=!1,!1===Po.is_expanded&&(Po.was_auto_expanded.search=!0,e().Chat.Interface.requestDynamicSizingProperties()),"function"==typeof t&&t()}),__vite__mapDeps([0,1,2])))},Xr(){if("function"==typeof JSON?.parse){let t=yr.Storage.getStampLocal(jo,[Xo.website.id,"browse","recent"])||null;if(null!==t)return JSON.parse(t)}return null},Qr(t=[]){"function"==typeof JSON?.stringify&&yr.Storage.setStampLocal(jo,[Xo.website.id,"browse","recent"],JSON.stringify(t))}});So.branding_link=Se(()=>`${Me.URL_WEBSITE}/${jr.web}/livechat/?ref=overlay&domain=${Xo.website.domain}&name=${encodeURIComponent(to.website.name)}`),So.browse_frequent=Se(()=>{let t=to.overlay,e=jr.code;return t.search?.[e]||t.search?.default||[]});var Ro=Ze({},{});Ro.has_form_disabled=Se(()=>!0!==Xo.runtime.lock_maximized&&(!0===to.chat?.hide_vacation||!0===Xo.is_blocked));var Oo=Ze({is_start_visible:!1},{showStart(){Oo.is_start_visible=!0},hideStart(){Oo.is_start_visible=!1}});function To(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}var zo=[["email","Email"],["phone","Phone"],["messenger","Messenger"],["telegram","Telegram"],["twitter","X (Twitter)"],["whatsapp","WhatsApp"],["instagram","Instagram"]],Po=Ze({mode:"chat",is_maximized:!1,is_expanded:!1,is_opened:!1,was_auto_expanded:{chat:!1,helpdesk_article:!1,search:!1},has_offline:!1,has_channels:!1,has_pad_popover:!1,has_window_focus:!1,show_operator_count:!0,animate_minimize:!1,animate_maximize:!1,reconnect_failed:!1,reconnect_inactive:!1,message_field_value:"",conversations:{is_starting:!1,last_start_error:null,current_session_id:null,all_session_ids:[],all_unread_count:0},quick_replies:{choices:[]},activity:{metrics:null,last:null},status:{url:""},status_markers:{},ongoing_operators:{}},{effectiveSessionId:(t=null)=>t||Po.conversations.current_session_id||Xo.session_id,eachSessionId(t){let e=Po.conversations.all_session_ids,s=[];for(let i=0;i{Or.scrollTo()})},expand(t){!1!==t||!0!==Po.was_auto_expanded.helpdesk_article&&!0!==Po.was_auto_expanded.search||(Po.was_auto_expanded.helpdesk_article=!1,Po.was_auto_expanded.search=!1,t===Po.is_expanded&&e().Chat.Interface.requestDynamicSizingProperties()),Eo.propagate("expanded",t,Xo.session_id)},toggleChannelDropdown(t=null){Po.eo("has_channels",t)},togglePadPopover(t=null){Po.eo("has_pad_popover",t)},startNewConversation(){!0===Xo.runtime.tester_mode&&Tr.onTesterStartNewConversation(),!0!==Po.conversations.is_starting&&(Po.conversations.is_starting=!0,Po.conversations.last_start_error=null,yr.Session.createChild())},handleConversationStarted(t=null,e=null,s=null){if(!0===Po.conversations.is_starting){Po.conversations.is_starting=!1;let i=t=>{Po.conversations.last_start_error=null,Oo.hideStart(),Po.openConversation(t)};null!==e&&s?.session_id?i(s.session_id):null!==t?(Po.conversations.all_session_ids.push(t),Eo.initialize(t),Qo.restoreHistory(t),i(t)):Po.conversations.last_start_error=e}},initializeConversations(t,e=[]){Po.conversations.all_session_ids=[],t.session_id&&Po.conversations.all_session_ids.push(t.session_id);for(let s=0;s1?Po.conversations.current_session_id&&Po.openConversation():r=!0,i=!0,n=!0;break;case"helpdesk":$o.open(!0),i=!0;break;case"search":So.open(),i=!0}e().Chat.Interface.applyChatFocus(),!0===i&&Or.focusOnForeground(),Po.toggleChannelDropdown(!1),!0===n&&e().Chat.Interface.requestDynamicSizingProperties(),!0===r&&Or.scrollToLastMessage()}},generateChannelLink(t){let e="",s=to.channels[t]||null;switch(t){case"email":{let t=Xo.session_hash;if(t){let s=to.website.name,i=`s.${t}.i@${to.website.mailer}`;e="mailto:",s&&(e+=`"${encodeURI(s)}"`),e+=`<${encodeURI(i)}>`}else s&&(e=`mailto:${s}`);break}case"phone":s&&(e=`tel:${s}`);break;case"messenger":s&&(e=`https://m.me/${encodeURI(s)}`);break;case"telegram":s&&(e=`https://telegram.me/${encodeURI(s)}`);break;case"twitter":s&&(e=`https://x.com/${encodeURI(s)}`);break;case"whatsapp":s&&(e=`https://wa.me/${encodeURI(s)}`);break;case"instagram":s&&(e=`https://www.instagram.com/${encodeURI(s)}/`);break;case"helpdesk":case"status":s&&(e=`${"production"===Me.ENVIRONMENT?"https":"http"}://${s}/`)}return e},eo(t,e=null){null===e&&(e=!Po[t]),e!==Po[t]&&(Po[t]=e)}});Po.is_visible=Se(()=>Po.is_maximized&&!0!==Xo.is_hidden),Po.has_health=Se(()=>Po.status.url&&!0===to.chat.status_health_dead&&"dead"===to.website.status?.health&&(new Date).getTime()-to.website.status.since>=18e4),Po.has_chat_focus=Se(()=>!!(Po.has_window_focus&&Po.is_visible&&"chat"===Po.mode&&Po.conversations.current_session_id)),Po.branding_links=Se(()=>{let t=`ref=chatbox&domain=${Xo.website.domain}&name=${encodeURIComponent(to.website.name)}`;return{default:`${Me.URL_WEBSITE}/${jr.web}/livechat/?${t}`,agent:`${Me.URL_HUGO}/?${t}`}}),Po.activity_metrics=Se(()=>{let t=to.website.response_metrics;return t?.mean&&t.mean>=1e3&&t.mean<216e5?t.mean:null}),Po.activity_last=Se(()=>{let t=to.website.last_available;return t&&t>0?t:null}),Po.channels=Se(()=>{let t=[];for(let e=0;eRo.has_form_disabled||Qo.conversation.locks.identify||Qo.conversation.locks.prompt||!0===Qo.conversation.compose.is_active&&!0===Qo.conversation.compose.is_automated),Po.is_mode_embedded=Se(()=>"search"===Po.mode&&!So.prompt.asked),Po.current_quick_replies=Se(()=>0===Po.quick_replies.choices.length||!0===Qo.conversation.has_received_messages||!0===Qo.conversation.has_sent_messages?null:Po.quick_replies.choices),Po.current_alerts=Se(()=>{let t=Eo.session().alert||{},e=!1,s={};for(let i in t){let n=t[i];"show"!==n&&"unlock"!==n||(e=!0,s[i]=n)}return!0===e?s:null}),Po.current_unread_preview=Se(()=>{if(Qo.conversation.preview.length>0)return Qo.conversation;let t=Po.conversations.all_session_ids;for(let e=0;e0)return s}return null}),Po.current_ongoing_operator=Se(()=>{let t=Po.ongoing_operators[Po.effectiveSessionId()]||null;return null!==t?t:{user_id:"",type:"",name:"",url:""}}),Po.current_status_marker=Se(()=>Po.status_markers[Po.effectiveSessionId()]||"none"),Po.conversations.all_unread_count=Se(()=>{let t=0;return Po.eachSessionId(e=>{t+=Qo.getUnread(e)}),t});var Lo={events:["chat-message-receive","chat-message-action"],call:["call-established","call-hangup","call-ring"]},Mo=new class extends Ge{constructor(){super(),this.Kn()}reset(){this.stop(),this.Kn()}allow(t=!0){this.so=t}mute(t=!0){this.no=t}initialize(t){if(!1===this.so)return;this.ro[t]=this.ro[t]||{};let e=Lo[t];for(let s=0;s{if(null!==this.ao){"suspended"===this.ao.state&&this.ao.resume();let r=this.ao.createGain();r.gain.setValueAtTime(i/100,0),r.connect(this.ao.destination),this.lo=this.ao.createBufferSource(),this.lo.buffer=n,this.lo.loop=s,this.lo.connect(r),this.lo.start(),this.ho=t,this.co=e}},t=>{})):We.error(`Sound does not exist: ${e} in subset ${t}`):We.error(`Subset does not exist: ${t}`)}}stop(t=null,e=null){try{null===this.lo||null!==t&&t!==this.ho||null!==e&&e!==this.co||(this.lo.stop(),this.lo=null,this.ho=null,this.co=null)}catch(s){We.error(s)}}oo(t,e,s=null,i=null){try{if(this.ro[t]=this.ro[t]||{},this.Do[t]=this.Do[t]||{},void 0===this.Do[t][e])if(this.Do[t][e]={success:"function"==typeof s?[s]:[],error:"function"==typeof i?[i]:[]},void 0!==this.ro[t][e])this.fo("success",t,e,this.ro[t][e]);else{let s=this.po(t,e);if(s){let i=new window.XMLHttpRequest;i.open("GET",s,!0),i.responseType="arraybuffer",i.onload=()=>{null===this.ao&&(this.ao=this._o()),null!==this.ao?this.ao.decodeAudioData(i.response,s=>{this.ro[t]=this.ro[t]||{},this.ro[t][e]=s,this.fo("success",t,e,s)},s=>{this.fo("error",t,e,s)}):this.fo("error",t,e)},i.onerror=s=>{this.fo("error",t,e,s)},i.send()}}else"function"==typeof s&&this.Do[t][e].success.push(s),"function"==typeof i&&this.Do[t][e].error.push(i)}catch(n){We.error(n)}}fo(t,e,s,i=null){let n=this.Do[e]?.[s];if(void 0!==n){for(let e=0;eQo.mo(t),list:(t=null)=>Qo.mo(t).list,get(t,e=null){let s=Qo.mo(e),i=null;for(let n=0;n0&&o.compose.timestamp{Or.scrollToLastMessage("from"),xr.setTimeout(()=>{Or.scrollToLastMessage("from")},400)})},update(t,e=null){!0===Xo.runtime.tester_mode?(Tr.onTesterMessageUpdated(t),Qo.Fo(t,e)):yr.Message.updateMessage(t.fingerprint,t.content,e)},remove(t,e=null){let s=Qo.mo(e);for(let i=0;i0)for(let s=0;s=0&&"local"===n[r].user?.source;r--)i.push(n[r]);for(let r=0;r()=>{_o.update("identity",t,e)},n=[];for(let r=0;r0&&Qo.$o("identity","default","picker",{id:"ask-identity",text:s,choices:n},e,t,t)},hideIdentity(t=null){Qo.Ao("identity",t)},showGame(t=!0,e=null){let s=`**${bu.text("chat","chat_message_text_game_main")}**\n_${bu.text("chat","chat_message_text_game_ask")}_`;Qo.$o("game","default","picker",{id:"ask-game",text:s,choices:[{value:"play",icon:"🕹️",selected:!1,label:bu.text("chat","chat_message_text_game_pick_yes"),handler:()=>{go.start(),_o.update("game",!1,e)}},{value:"ignore",selected:!1,label:bu.text("chat","chat_message_text_game_pick_no"),handler:()=>{_o.update("game",!1,e)}}]},e,t,t)},hideGame(t=null){Qo.Ao("game",t)},showFeedback(t=!0,e=null){let s=`**${bu.text("chat","chat_message_text_feedback_main")}**\n_${bu.text("chat","chat_message_text_feedback_ask")}_`;Qo.$o("feedback","default","picker",{id:"ask-feedback",text:s,choices:[{value:"rate",icon:"⭐️",selected:!1,label:bu.text("chat","chat_message_text_feedback_pick_rate"),handler:()=>{co.show(e),_o.update("feedback","rate",e)}},{value:"ignore",selected:!1,label:bu.text("chat","chat_message_text_feedback_pick_ignore"),handler:()=>{_o.update("feedback",!1,e)}}]},e,t,t)},hideFeedback(t=null){Qo.Ao("feedback",t)},showFeedbackSubmitted(t=!0,e=null){let s=bu.text("chat","chat_message_text_feedback_submitted");Qo.$o("feedback","submitted","text",s,e,t,t)},showCompose(t,e=!1,s=null){let i=Qo.mo(s),n=i.compose.is_active||!1;i.compose.timestamp=t,i.compose.is_active=!0,i.compose.is_automated=e,!0!==n&&(Qo.Bo(s),!0===Po.isCurrentSessionId(s)&&Or.scrollToLastMessage("from"))},hideCompose(t=null){let e=Qo.mo(t);e.compose.is_active=!1,e.compose.is_automated=!1,e.compose.timestamp=null},downloadTranscript(t=null){let e=Qo.mo(t),s=(new Date).toLocaleDateString(),i=bu.text("chat","chat_message_transcript_name",[s.replace(Ko,"-")]),n=bu.text("chat","chat_message_transcript_content_title",[to.website.name,s]);n+="\n";let r="";for(let o=0;o0&&t.content&&t.user&&!Ho.includes(t.user.source)){let e,s=new Date(t.timestamp).toLocaleTimeString(),i=new Date(t.timestamp).toLocaleDateString(),o=Ti.name().parse_first_name(t.user?.nickname||"(?)");switch(t.type){case"text":e=t.content;break;case"file":{let s=t.content;e=s.name?`${s.name} ${s.url}`:s.url;break}case"animation":case"audio":e=t.content.url;break;case"picker":case"field":case"carousel":e=t.content.text}e&&"string"==typeof e&&(r!==i&&(r=i,n+="\n---\n\n",n+=`${i}\n\n`),n+=`[${s}] ${o}: ${e}\n`)}}xr.downloadLocalFile(`${i}.txt`,n)},checkUserIdentity(t=!1,s=null){let i=Qo.mo(s),n=!0===to.chat.force_identify;if(!0===(void 0===_o.states(s).identity||"default"===_o.states(s).identity&&n)){let r=e().Action.get_user_email(),o=e().Action.get_user_phone(),u=to.chat.email_visitors,a=to.chat.phone_visitors;return(!r&&!0===u||!o&&!0===a)&&!r&&!o&&(null!==i.timeouts.showIdentity&&xr.clearTimeout(i.timeouts.showIdentity),i.timeouts.showIdentity=xr.setTimeout(()=>{if(i.timeouts.showIdentity=null,!0===t&&!1===n)return null;if(!0===i.compose.is_active&&!0===i.compose.is_automated)return void Qo.checkUserIdentity(!1,s);let e=!0;!0===i.has_received_messages&&i.message_last_timestamp_automated>0&&Uo()-i.message_last_timestamp_automated<=qo&&(e=!1);let r="default";!1===(u&&a)&&e&&(!0===u?r="email":!0===a&&(r="phone")),_o.update("identity",r,s),ao.update("warn_reply","show",s)},n?0:qo),n&&Qo.checkFormIdentifyLock(s),!0)}return null},registerUnreadHandler(){yr.Message.setUnreadMessagesCallback((t,e,s,i)=>{xr.setTimeout(()=>{Qo.updateUnread(e,s,i,t)},0)})},getUnread:(t=null)=>Qo.mo(t).unread_count,updateUnread(t=0,e=[],s=[],i=null){let n=Qo.mo(i),r=uo.tooltips;n.unread_count=t;let o=Po.conversations.all_unread_count||0;if(t>0){let t=!1===r.new_messages.visible;Qo.xo(e,s,t,i),!0===t&&(null!==n.timeouts.tooltipShowDelay&&xr.clearTimeout(n.timeouts.tooltipShowDelay),n.timeouts.tooltipShowDelay=xr.setTimeout(()=>{n.timeouts.tooltipShowDelay=null,r.new_messages.visible=!0,r.new_messages.animate=!0,xr.setTimeout(()=>{r.new_messages.animate=!1},500)},100))}else null!==n.timeouts.tooltipShowDelay&&xr.clearTimeout(n.timeouts.tooltipShowDelay),r.new_messages.visible=!1,r.new_messages.animate=!1;null===Xo.page_title_current&&(Xo.page_title_current=document.title),Xo.page_title_current&&(o>0&&!0!==Xo.is_invisible?document.title=`💬${o} - ${Xo.page_title_current}`:document.title=Xo.page_title_current)},synchronizeHistoryAndNew(t=null){yr.Message.getMessageCompose(t),yr.Message.getUnreadMessages(t),yr.Message.getMessageHistory(t),0===yr.Message.countMessageHistory(t)&&Qo.jo(t)},restoreHistory(t=null){Qo.Io(t),Qo.synchronizeHistoryAndNew(t)},handleHistory(t=[],e=null){let s=Qo.mo(e);for(let i=0;i0)for(let s=0;s0&&r>a.compose.timestamp&&!0===l&&Qo.hideCompose(u),r>0&&!0===l&&(ao.update("wait_reply","lock",u),_o.update("game",!1,u),Qo.Oo(t,e,s,u))),r>0&&(a.has_messages=!0,a.message_last_timestamp=r,!0===l&&("operator"===i?(a.has_received_messages=!0,!0===o&&(a.message_last_timestamp_automated=r)):a.has_sent_messages=!0),Qo.To(u)),!1===Xo.has_local_messages&&"local"===n.source&&(Xo.has_local_messages=!0)},Ro(t,e,s,i,n,r=null){"operator"===i&&n>0&&Qo.zo(t,e,s,r)},yo(t,e=null,s=null){let i=Qo.mo(e),n=Qo.get(t,e),r=!1;return n&&(n.metas.is_pending=!1,n.metas.error=s),t in i.timeouts.acknowledgements&&(xr.clearTimeout(i.timeouts.acknowledgements[t]),delete i.timeouts.acknowledgements[t],r=!0),r},jo(t=null){let e=Qo.mo(t);e.sent_read_fingerprints.length>0&&(Qo.acknowledgeReadSend(e.sent_read_fingerprints,t,!0),e.sent_read_fingerprints=[]),Eo.retrigger("intent",t),Eo.retrigger("scroll",t),Or.focusOnForeground(),!0===Po.isCurrentSessionId(t)&&Or.scrollToLastMessage(),Qo.bo(!0,t)},Eo(t){!1===Po.is_expanded&&!1===Po.was_auto_expanded.chat&&!0===t.automated&&"text"===t.type&&t.content.length>500&&(Po.was_auto_expanded.chat=!0,Po.expand(!0))},Co(t,e=null,s=!0){if(t.properties){let i=t.properties["x-client-intent"]||null;null!==i&&!0===s&&this.Po(i,e)}},Po(t,s=null){switch(t){case"ask-email":_o.update("identity","email",s);break;case"ask-phone":_o.update("identity","phone",s);break;case"state-start":Oo.showStart();break;case"state-escalate":{let t=e().Action.get_user_email(),i=to.chat.email_visitors;t||!0!==i||xr.setTimeout(()=>{_o.update("identity","email",s,!0)},qo);break}}},Io(t=null){let e=bu.text("theme_welcome",["default_chat",`${to.chat?.theme_welcome}_chat`],[to.website?.name]);Qo.$o("welcome","default","text",e,t,!1,!1)},$o(t,e,s,i,n=null,r=!1,o=!0){let u=Qo.mo(n);if(Ho.includes(t)&&u.website_messages_parts[t]!==e){u.website_messages_parts[t]=e;let a=(new Date).getTime();"welcome"===t&&(a=0),Qo.handleReceived({type:s,timestamp:a,content:i,fingerprint:`$${t}`,from:"operator",user:{source:t,type:"website",user_id:Xo.website?.id}},n,!1,r,o,!0)}},Ao(t,e=null){let s=Qo.mo(e);Ho.includes(t)?s.website_messages_parts[t]&&(delete s.website_messages_parts[t],Qo.remove(`$${t}`,e)):We.error(`Source ${t} not allowed`)},Bo(t=null){let e=Qo.mo(t);e.compose.timestamp&&(Uo()-e.compose.timestamp>=12e4?Qo.hideCompose(t):xr.setTimeout(()=>{Qo.Bo(t)},5e3))},To(t=null){let s=!0===Qo.mo(t).has_messages&&!0!==Xo.is_activity_outdated;if(Xo.is_activity_ongoing!==s){Xo.is_activity_ongoing=s;let t=(document.activeElement?.tagName||"").toLowerCase();"input"!==t&&"textarea"!==t&&e().Chat.Interface.requestDynamicSizingProperties()}},Oo(t,e,s,i=null){let n=Qo.mo(i);if(!0===Go.includes(t)&&!0===e.required){let r=!1;switch(t){case"field":e.value&&(r=!0);break;case"picker":{let t=e;for(let e=0;e-1&&n.prompt_fingerprints.splice(o,1),n.locks.prompt=n.prompt_fingerprints.length>0,ao.update("warn_prompt",n.locks.prompt?"show":"hide",i)}},zo(t,e,s,i=null){let n=Qo.mo(i);if(!0===Go.includes(t)&&!0===e.required){let t=n.prompt_fingerprints.indexOf(s);t>-1&&(n.prompt_fingerprints.splice(t,1),0===n.prompt_fingerprints.length&&(n.locks.prompt=!1,ao.update("warn_prompt","hide",i)))}},bo(t=!1,e=null){let s=Qo.mo(e);!1!==_o.states(e).game&&!0===s.has_sent_messages&&!0!==s.has_received_messages&&null===s.timeouts.reply&&(s.timeouts.reply=xr.setTimeout(()=>{s.timeouts.reply=null,!0!==s.has_received_messages&&!0===to.chat?.wait_game&&_o.update("game",void 0,e)},!0===t?3e4:6e4))},vo(t,e=null){let s=Qo.mo(e),i=Qo.get(t,e);i&&(xr.setTimeout(()=>{void 0===i.metas.is_pending&&(i.metas.is_pending=!0)},1500),s.timeouts.acknowledgements[t]=xr.setTimeout(()=>{Qo.errorRejected(t,e,"timeout")},3e4))},wo(t,e=null){let s=Qo.get(t,e);s&&(s.metas.is_new=!0,xr.setTimeout(()=>{s.metas.is_new=!1},400))},xo(t,e,s,i=null){let n=Qo.mo(i),r=[],o=null,u=[];for(let a=e.length-1;a>=0&&!(t.includes(e[a].fingerprint)&&(r.unshift(e[a]),r.length>=3));a--);n.preview=[];for(let a=0;a{for(let t=0;t{Qo.showCompose(t,e)},window.$hideCompose=()=>{Qo.hideCompose()});var Qo=Ze({Vr:{}},Zo);Qe(()=>{Qo.Vr={}}),Qo.conversation=Se(()=>Qo.mo());var Xo=Ze({session_id:null,session_hash:null,forced_session_id:null,token_id:null,cookie_expire:null,cookie_domain:null,browser_useragent:null,browser_timezone:null,browser_capabilities:[],browser_locales:[],page_domain:null,page_url:null,page_title_current:null,is_hidden:!1,is_full_view:!1,is_small_view:!1,is_large_view:!1,is_activity_ongoing:!1,has_interacted:!1,has_local_messages:!1,force_show:!1,error_mode:!1,website:{id:"",domain:""},features:{audio_recording:!1},runtime:{}},{checkIsFullView:()=>!0===Xo.runtime?.lock_full_view||(window.innerHeight<600||window.innerWidth<480),checkIsSmallView:()=>window.innerHeight<720||window.innerWidth<540,checkIsLargeView:()=>window.innerHeight>840&&window.innerWidth>640,applySizing(){Xo.is_full_view=Xo.checkIsFullView(),Xo.is_small_view=Xo.checkIsSmallView(),Xo.is_large_view=Xo.checkIsLargeView()}});Xo.is_mobile_view=Se(()=>!0===Xo.is_full_view&&!0===ro.has_screen_touch),Xo.is_blocked=Se(()=>(!0===Xo.is_blocked_page||!0===Xo.is_blocked_locale)&&!0),Xo.is_activity_outdated=Se(()=>Qo.conversation.message_last_timestamp>0&&(new Date).getTime()-Qo.conversation.message_last_timestamp>=6e5),Xo.is_blocked_locale=Se(()=>{let t=jr.code;return!!to.chat?.blocked_locales?.includes(t)}),Xo.is_blocked_page=Se(()=>!(!(to.chat?.allowed_pages?.length>0)||xr.comparePageRules(Xo.page_url,to.chat?.allowed_pages))||xr.comparePageRules(Xo.page_url,to.chat?.blocked_pages)&&!0),Xo.is_invisible=Se(()=>{let t=!1;return!0===Xo.runtime.lock_maximized||!0===Qo.conversation.has_messages&&!0!==Xo.is_activity_outdated||(!0===Xo.is_blocked&&(t=!0),!0===to.chat?.hide_vacation&&(t=!0),!0===to.chat?.hide_on_away&&!0!==Xe.was_availability_online&&!0!==Xe.users_available&&(t=!0),!0===to.chat?.hide_on_mobile&&!0===Xo.is_mobile_view&&(t=!0)),t}),Xo.has_autofocus=Se(()=>!0!==Xo.is_mobile_view),Xo.active_operators=Se(()=>{let t=[],e=to?.website?.active_operators;if(e?.length>0)for(let s=0;s{let t=0,e=to,s=e?.website?.active_operators?.length||0;return e?.website?.count_operators>s&&(t=e?.website?.count_operators-s),t});var tu=new class extends Rr{constructor(){super()}subscribe(t,e){super.subscribe(t,e)}unsubscribe(t,e){super.unsubscribe(t,e)}assistMouse(t){super.emit("assist-mouse",t)}assistScroll(t){super.emit("assist-scroll",t)}assistClick(t){super.emit("assist-click",t)}},eu="assist",su=null,iu=Ze({data:null,type:null,is_consent_required:!1},{prepare(t){iu.data=t,iu.is_consent_required=!0!==to.chat.ignore_privacy&&!0!==yr.Browsing.hasAcceptedConsent(),xo(()=>import("./main_default_2a24f89.js").then(t=>{su=t.default(".cc-84c2j")}),__vite__mapDeps([0,3]))},acceptConsent(){iu.is_consent_required=!1,yr.Browsing.accept()},declineConsent(){iu.is_consent_required=!1,yr.Browsing.decline(),su&&(su.unmount(),su=null)},startAssist(){null===iu.type&&(iu.type=eu)},stopAssist(){iu.type===eu&&(iu.type=null),su.unmount(),su=null},pipeMouse(t){iu.type===eu&&tu.assistMouse(t)},pipeScroll(t){iu.type===eu&&tu.assistScroll(t)},pipeClick(t){iu.type===eu&&tu.assistClick(t)}}),nu=new class extends Rr{constructor(){super()}subscribe(t,e){super.subscribe(t,e)}unsubscribe(t,e){super.unsubscribe(t,e)}success(t){super.emit("success",t)}},ru=null,ou=Ze({is_opened:!1,is_ringing:!1,is_calling:!1,mode:null,state:null,user:{user_id:"",nickname:"",type:""},muted:{audio:!1,video:!1},actions:[]},{ring(t){ou.Lo(),Mo.initialize("call"),ou.mode=t.mode,ou.state=null,ou.user.user_id=t.user.user_id||Xo.website.id,ou.user.nickname=Ti.name().parse_first_name(t.user.nickname)||to.website.name,ou.user.type=t.user.user_id?"operator":"website",ou.actions=ou.Mo(t.mode),ou.muted.audio=!1,ou.muted.video=!1,ou.is_ringing=!0,xo(()=>import("./main_default_2a24f892.js").then(t=>{ru=t.default(".cc-1frb5"),ou.is_opened=!0,Mo.start("call","call-ring",!0)}),__vite__mapDeps([0,4]))},screen(){ou.Lo(!1),ou.toggleState("connecting"),ou.is_ringing=!1,ou.is_calling=!0},stop(){ou.Lo(),ou.is_calling=!1,ou.is_ringing=!1,ou.is_opened=!1,Mo.start("call","call-hangup")},success(t){nu.success(t)},error(){ou.Lo(),Mo.start("call","call-hangup")},toggleMediaStatus(t,e=!1){let s=null;for(let i=0;i[{type:"audio",value:!0,visible:!0,supported:!0},{type:"video",value:!0,visible:!0,supported:"video"===t},{type:"hangup",value:!1,visible:!0,supported:!0},{type:"toggle",value:!1,visible:!0,supported:!0},{type:"screensharing",value:!1,visible:!0,supported:yr.Call.hasSupportScreensharing()}]});function uu(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}var au="File",lu="application/octet-stream",hu=1e6,cu={maxSize:2800,quality:.9},du={"image/jpeg":"image","image/png":"image","image/webp":"image","image/heic":"image-heic","image/heif":"image-heic"},Du="image/jpeg",fu=".jpg",pu=Ze({Uo:[],qo:null,Vo:null,has_drop_zone:!1,state:"none",files:[]},{async uploadGenerated(t,e,s){let i=pu.getCurrentFileFromStack();if(!i)return void pu.No();if(!t||!e)return alert(bu.text("chat","chat_form_attach_alert_quota")),pu.Ho(),void pu.No();let n=await pu.Wo(i);if(pu.Uo[0]=n,pu.files.find(t=>t.file===i).file=n,n.size>=s)return alert(bu.text("chat","chat_form_attach_alert_size",[pu.Jo(s)])),pu.Ho(),void pu.No();pu.qo=e,pu.Go(t,n)},setDropZone(t){!0===to.chat?.file_transfer&&(pu.has_drop_zone=t)},handleFileChange(t=[]){if(!1!==Qo.checkIntentSend()&&0!==t.length&&"none"===pu.state){pu.Uo=[];for(let e=0;et.file.name===s.name&&t.file.lastModified===s.lastModified)||(pu.files.push({file:s,uploading:!0,error:!1,send:!1,params:null}),pu.Uo.push(s))}pu.Uo.length>0&&pu.Ko()}},getCurrentFileFromStack:()=>pu.Uo[0]||null,removeFile(t){let e=pu.files.findIndex(e=>e.file===t);-1!==e&&pu.files.splice(e,1)},sendPendingFiles(){[...pu.files].forEach(t=>{!0!==t.uploading?!0!==t.error?pu.Zo(t):pu.removeFile(t.file):t.send=!0})},async Wo(t){switch(du[t.type]||null){case"image":return await this.Yo(t);case"image-heic":{let e=await this.Qo(t);return null===e?t:await this.Yo(e)}}return t},async Yo(t){try{let e=(await xo(async()=>{const{default:t}=await import("./vendor-compressorjs_default_2a24f89.js").then(t=>__toESM(t.t(),1));return{default:t}},[])).default,s=cu,i=await new Promise((i,n)=>{new e(t,{quality:s.quality,maxWidth:s.maxSize,maxHeight:s.maxSize,mimeType:t.type,checkOrientation:!0,success(t){i(t)},error(t){n(t)}})}),n=new File([i],t.name,{type:i.type,lastModified:t.lastModified});return n.size{const{default:t}=await import("./vendor-canvas-heic-to-jpeg_default_2a24f89.js").then(t=>t.t);return{default:t}},[])).default,s=await(new e).convert(t,{mimeType:Du,quality:1}),i=t.name.replace(/\.(heic|heif)$/i,fu);return i!==t.name||/\.(jpe?g)$/i.test(i)||(i=`${t.name}${fu}`),new File([s],i,{type:Du,lastModified:t.lastModified})}catch(e){return We.error(`Error attempting converting HEIC file to JPEG: ${t.name}`,e),null}},Zo(t){if(!t.params)return;let s=t.file,i=t.params;s.type?.includes("audio/")&&"number"==typeof s.duration?e().Action.do_message_send("audio",{url:i.resource,type:s.type,duration:s.duration}):e().Action.do_message_send("file",{url:i.resource,name:s.name||au,type:s.type||lu}),pu.removeFile(s)},Jo(t){let e,s;return t>=hu?(e=t/hu,s="MB"):t>=1e3?(e=t/1e3,s="KB"):(e=t,s="B"),`${Math.round(10*e)/10} ${s}`},Ho(){let t=pu.getCurrentFileFromStack();if(null!==t){let e=pu.files.find(e=>e.file===t);e&&(e.uploading=!1,e.error=!0)}},Go(t,e){pu.Vo=new window.XMLHttpRequest,pu.Vo.file=e,pu.Vo.addEventListener("loadstart",uu(pu.Xo,this),!1),pu.Vo.addEventListener("error",uu(pu.tu,this),!1),pu.Vo.addEventListener("abort",uu(pu.tu,this),!1),pu.Vo.addEventListener("load",uu(pu.eu,this),!1),pu.Vo.open("PUT",t,!0),pu.Vo.setRequestHeader("Content-Disposition","attachment"),pu.Vo.send(e)},Xo(){pu.state="uploading"},tu(){pu.Uo.length>0&&pu.Ho(),pu.No()},eu(){if(200!==pu.Vo.status&&201!==pu.Vo.status)return pu.tu();if(0===pu.Uo.length)return;if(!pu.qo)return;let t=pu.getCurrentFileFromStack(),e=pu.files.find(e=>e.file===t);t&&e&&(e.params={resource:pu.qo,name:t.name||au,type:t.type||lu},e.uploading=!1,!0===e.send&&xr.setTimeout(()=>{pu.Zo(e)},2e3)),pu.No()},No(){pu.Vo&&(pu.Vo.removeEventListener("loadstart",pu.Xo,!1),pu.Vo.removeEventListener("error",pu.tu,!1),pu.Vo.removeEventListener("abort",pu.tu,!1),pu.Vo.removeEventListener("load",pu.eu,!1));let t=document.querySelector(".cc-yfreg");t&&(t.value=null),pu.state="none",pu.qo=null,pu.Uo.shift(),pu.Uo.length>0&&pu.Ko()},Ko(){let t=pu.getCurrentFileFromStack();null!==t&&(pu.state="preparing",yr.Bucket.getUrlUpload(t.name||au,t.type||lu))}});function _u(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}var mu=[["weba","audio/webm; codecs=opus"],["weba","audio/webm; codecs=vorbis"],["oga","audio/ogg; codecs=vorbis"],["m4a","audio/mp4; codecs=mp4a.40.5"]],gu=Ze({su:null,iu:null,nu:!1,ru:!1,ou:null,state:"none",duration:0,progress:0,mime:"",chunks:[],extension:null,streamAcquired:null},{record(){!1!==ro.has_audio_recording&&!0===to.chat.audio_record&&null===gu.su&&navigator.mediaDevices.getUserMedia({audio:!0,video:!1}).then(t=>{for(let e=0;e{alert(bu.text("chat","chat_form_speech_capture_error"))})},cancel(){null!==gu.su&&!0!==gu.nu&&(gu.nu=!0,gu.ru=!0,gu.su.stop())},send(){null!==gu.su&&!0!==gu.nu&&(gu.nu=!0,gu.su.stop())},setStreamAcquiredCallback(t){"function"==typeof t&&(gu.streamAcquired=t,null!==gu.iu&&t(gu.iu))},uu(){gu.duration=0,gu.progress=0,gu.lu()},au(){if(gu.state="none",gu.Du(),!0!==gu.ru){let t=(new Date).getTime(),e=new window.File(gu.chunks,`audio_${t}.${gu.extension}`,{type:gu.mime.split(";")[0].trim(),lastModified:t});e.duration=gu.duration,pu.handleFileChange([e])}let t=gu.su.stream.getTracks();for(let e=0;e0&&gu.chunks.push(t.data)},du(t){alert(bu.text("chat","chat_form_speech_capture_error"))},pu(){if(null===gu.ou){let t=90;gu.ou=xr.setInterval(()=>{gu.duration>=t?gu.su.pause():(gu.duration++,gu.progress=Math.floor(100*Math.min(gu.duration/t,1)))},1e3)}},Du(){null!==gu.ou&&(xr.clearInterval(gu.ou),gu.ou=null)},fu(){gu.su=null,gu.iu=null,gu.nu=!1,gu.ru=!1,gu.ou=null,gu.duration=0,gu.progress=0,gu.mime="",gu.chunks=[],gu.extension=null}}),Fu=Ze({bundle:{pending:{chat:!1,overlay:!1,magnify:!1}}},{}),wu={availability:Xe,base:Xo,browsing:iu,call:ou,chat:Po,chatAlert:ao,chatFrame:mo,chatIntent:_o,chatFeedback:co,chatAuthenticate:Do,chatPicker:lo,chatFile:pu,chatSpeech:gu,chatState:Oo,common:Ro,feature:ro,game:go,helpdesk:$o,messages:Qo,minimized:uo,overlay:So,partial:Fu,state:Eo,locale:jr,website:to},vu=new class{constructor(){this.$store=wu}install(t){t.config.globalProperties.$store=wu}},yu=["ltr","rtl"],bu=new class extends Ge{constructor(){super(),this._u=Me.LOCALE_AVAILABLE,this.Kn()}reset(){this.Kn()}detect(t=[]){let e,s=Me.LOCALE_DEFAULT,i=!1,n=[];t.length>0?(this._u=xr.intersect(t,Me.LOCALE_AVAILABLE),this._u.length>0&&!this._u.includes(s)&&(s=this._u[0])):this._u=Me.LOCALE_AVAILABLE;for(let r=0;r{const i=e.lastIndexOf("?"),n=t[-1===i||i{("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(t.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==s?". Note that variables only represent file names one level deep.":""))))})})(Object.assign({"../locales/af.json":()=>xo(()=>import("./af_default_2a24f89.js").then(t=>t.t),[]),"../locales/ar-ae.json":()=>xo(()=>import("./ar-ae_default_2a24f89.js").then(t=>t.t),[]),"../locales/ar-sa.json":()=>xo(()=>import("./ar-sa_default_2a24f89.js").then(t=>t.t),[]),"../locales/ar-ye.json":()=>xo(()=>import("./ar-ye_default_2a24f89.js").then(t=>t.t),[]),"../locales/ar.json":()=>xo(()=>import("./ar_default_2a24f89.js").then(t=>t.t),[]),"../locales/az.json":()=>xo(()=>import("./az_default_2a24f89.js").then(t=>t.t),[]),"../locales/bg.json":()=>xo(()=>import("./bg_default_2a24f89.js").then(t=>t.t),[]),"../locales/bn.json":()=>xo(()=>import("./bn_default_2a24f89.js").then(t=>t.t),[]),"../locales/ca.json":()=>xo(()=>import("./ca_default_2a24f89.js").then(t=>t.t),[]),"../locales/ckb.json":()=>xo(()=>import("./ckb_default_2a24f89.js").then(t=>t.t),[]),"../locales/cs.json":()=>xo(()=>import("./cs_default_2a24f89.js").then(t=>t.t),[]),"../locales/da.json":()=>xo(()=>import("./da_default_2a24f89.js").then(t=>t.t),[]),"../locales/de.json":()=>xo(()=>import("./de_default_2a24f89.js").then(t=>t.t),[]),"../locales/el.json":()=>xo(()=>import("./el_default_2a24f89.js").then(t=>t.t),[]),"../locales/en.json":()=>xo(()=>import("./en_default_2a24f89.js").then(t=>t.t),[]),"../locales/eo.json":()=>xo(()=>import("./eo_default_2a24f89.js").then(t=>t.t),[]),"../locales/es.json":()=>xo(()=>import("./es_default_2a24f89.js").then(t=>t.t),[]),"../locales/et.json":()=>xo(()=>import("./et_default_2a24f89.js").then(t=>t.t),[]),"../locales/eu.json":()=>xo(()=>import("./eu_default_2a24f89.js").then(t=>t.t),[]),"../locales/fa.json":()=>xo(()=>import("./fa_default_2a24f89.js").then(t=>t.t),[]),"../locales/fi.json":()=>xo(()=>import("./fi_default_2a24f89.js").then(t=>t.t),[]),"../locales/fo.json":()=>xo(()=>import("./fo_default_2a24f89.js").then(t=>t.t),[]),"../locales/fr.json":()=>xo(()=>import("./fr_default_2a24f89.js").then(t=>t.t),[]),"../locales/gu.json":()=>xo(()=>import("./gu_default_2a24f89.js").then(t=>t.t),[]),"../locales/he.json":()=>xo(()=>import("./he_default_2a24f89.js").then(t=>t.t),[]),"../locales/hi.json":()=>xo(()=>import("./hi_default_2a24f89.js").then(t=>t.t),[]),"../locales/hr.json":()=>xo(()=>import("./hr_default_2a24f89.js").then(t=>t.t),[]),"../locales/hu.json":()=>xo(()=>import("./hu_default_2a24f89.js").then(t=>t.t),[]),"../locales/hy.json":()=>xo(()=>import("./hy_default_2a24f89.js").then(t=>t.t),[]),"../locales/id.json":()=>xo(()=>import("./id_default_2a24f89.js").then(t=>t.t),[]),"../locales/is.json":()=>xo(()=>import("./is_default_2a24f89.js").then(t=>t.t),[]),"../locales/it.json":()=>xo(()=>import("./it_default_2a24f89.js").then(t=>t.t),[]),"../locales/ja.json":()=>xo(()=>import("./ja_default_2a24f89.js").then(t=>t.t),[]),"../locales/ka.json":()=>xo(()=>import("./ka_default_2a24f89.js").then(t=>t.t),[]),"../locales/ko.json":()=>xo(()=>import("./ko_default_2a24f89.js").then(t=>t.t),[]),"../locales/lt.json":()=>xo(()=>import("./lt_default_2a24f89.js").then(t=>t.t),[]),"../locales/lv.json":()=>xo(()=>import("./lv_default_2a24f89.js").then(t=>t.t),[]),"../locales/ml.json":()=>xo(()=>import("./ml_default_2a24f89.js").then(t=>t.t),[]),"../locales/mn.json":()=>xo(()=>import("./mn_default_2a24f89.js").then(t=>t.t),[]),"../locales/ms.json":()=>xo(()=>import("./ms_default_2a24f89.js").then(t=>t.t),[]),"../locales/nl-be.json":()=>xo(()=>import("./nl-be_default_2a24f89.js").then(t=>t.t),[]),"../locales/nl.json":()=>xo(()=>import("./nl_default_2a24f89.js").then(t=>t.t),[]),"../locales/no.json":()=>xo(()=>import("./no_default_2a24f89.js").then(t=>t.t),[]),"../locales/pl.json":()=>xo(()=>import("./pl_default_2a24f89.js").then(t=>t.t),[]),"../locales/ps.json":()=>xo(()=>import("./ps_default_2a24f89.js").then(t=>t.t),[]),"../locales/pt-br.json":()=>xo(()=>import("./pt-br_default_2a24f89.js").then(t=>t.t),[]),"../locales/pt.json":()=>xo(()=>import("./pt_default_2a24f89.js").then(t=>t.t),[]),"../locales/ro.json":()=>xo(()=>import("./ro_default_2a24f89.js").then(t=>t.t),[]),"../locales/ru.json":()=>xo(()=>import("./ru_default_2a24f89.js").then(t=>t.t),[]),"../locales/sk.json":()=>xo(()=>import("./sk_default_2a24f89.js").then(t=>t.t),[]),"../locales/sl.json":()=>xo(()=>import("./sl_default_2a24f89.js").then(t=>t.t),[]),"../locales/sr-cyrl-cs.json":()=>xo(()=>import("./sr-cyrl-cs_default_2a24f89.js").then(t=>t.t),[]),"../locales/sr.json":()=>xo(()=>import("./sr_default_2a24f89.js").then(t=>t.t),[]),"../locales/sv.json":()=>xo(()=>import("./sv_default_2a24f89.js").then(t=>t.t),[]),"../locales/ta.json":()=>xo(()=>import("./ta_default_2a24f89.js").then(t=>t.t),[]),"../locales/th.json":()=>xo(()=>import("./th_default_2a24f89.js").then(t=>t.t),[]),"../locales/tr.json":()=>xo(()=>import("./tr_default_2a24f89.js").then(t=>t.t),[]),"../locales/uk.json":()=>xo(()=>import("./uk_default_2a24f89.js").then(t=>t.t),[]),"../locales/uz-cyrl.json":()=>xo(()=>import("./uz-cyrl_default_2a24f89.js").then(t=>t.t),[]),"../locales/uz.json":()=>xo(()=>import("./uz_default_2a24f89.js").then(t=>t.t),[]),"../locales/vi.json":()=>xo(()=>import("./vi_default_2a24f89.js").then(t=>t.t),[]),"../locales/zh-hk.json":()=>xo(()=>import("./zh-hk_default_2a24f89.js").then(t=>t.t),[]),"../locales/zh-tw.json":()=>xo(()=>import("./zh-tw_default_2a24f89.js").then(t=>t.t),[]),"../locales/zh.json":()=>xo(()=>import("./zh_default_2a24f89.js").then(t=>t.t),[])}),`../locales/${e}.json`,3),this.gu(e,t),wu.locale.code=t._meta.locale_code||e,wu.locale.direction=this.direction()}}catch(e){throw We.error(e),new Error("LocaleHelper.load: "+e)}}direction(){let t=null;if(!this.mu?._meta?.locale_direction)throw new Error("Cannot get locale direction, locale data not loaded");return t=this.mu._meta.locale_direction,yu.includes(t)||(t="ltr"),t}text(t,e,s=[]){let i,n,r=null;"object"==typeof e?(i=e[0],n=e[1]):i=n=e;let o=`${t}.${i}.${n}`;return null===this.mu||void 0===this.mu._strings[t]||void 0===this.mu._strings[t][n]?o:(r=(Hr.getCustomization("text",t,i)||"").trim()||this.mu._strings[t][n],r=Ti.parse().replace(r,s),r=this.Fu(r),r)}gu(t,e){if(null!==this.mu)throw new Error("Locale has already been loaded (double requested handled?)");if("object"!=typeof e)throw new Error("Did not receive a proper locale data file");if(e._meta.locale_code!==t)throw new Error(`Received a mismatching locale code, expected: ${t}`);this.mu=e}Fu(t){let e=null;try{e=decodeURIComponent(escape(t))}catch{e=t}return e}Kn(){this.mu=null}},Eu=/^(([^\s@]+)@([^\s@]+)\.([^\s@]+))$/,Cu=new RegExp(["^(?:(?:\\(?(?:00|\\+)([1-4]\\d\\d|[1-9]\\d?)\\)?)?","[\\-\\.\\ \\\\\\/]?)?((?:\\(?\\d{1,}\\)?[\\-\\.\\ \\\\\\/]?){0,})","(?:[\\-\\.\\ \\\\\\/]?(?:#|ext\\.?|extension|x)[\\-\\.\\ \\\\/]?","(\\d+))?$"].join(""),"i"),ku=/^https?:\/\/(.+)$/,$u=/^([A-Za-z0-9_\\-]{1,50})$/,Au=new class{isEmail(t){return Eu.test(t)}isPhone(t){return Cu.test(t)}isAvatar(t){return ku.test(t)}isData(t){let e=!1;if(t instanceof Object){e=xr.keys(t).length>0&&!0;for(let s in t){let i=t[s];if("string"!=typeof s||!0!==$u.test(s)||"string"!=typeof i&&"boolean"!=typeof i&&"number"!=typeof i){e=!1;break}}}return e}areEvents(t){let e=!1;if(t instanceof Array){e=t.length>0&&!0;for(let s=0;s80||s.includes(r)){e=!1;break}s.push(r)}}return e}};function Bu(t,e,...s){return t.bind&&/\[native code\]/.test(t.bind.toString())?t.bind(e,...s):function(...i){return t.apply(e,[...s,...i])}}var xu=["session:loaded","chat:initiated","chat:opened","chat:closed","message:sent","message:received","message:compose:sent","message:compose:received","user:email:changed","user:phone:changed","user:nickname:changed","user:avatar:changed","website:availability:changed","helpdesk:queried"],ju="hugo:tool:",Iu={bot:"urn:crisp.im:bot:0",hugo:"urn:crisp.im:hugo:0"},Su=/^(light|dark|auto)$/,Ru=/^(default|colorized)$/,Ou=/^(default|([a-z0-9-]+))$/,Tu=/^([a-f0-9]{64})$/,zu=class extends Ge{constructor(t){super(),this.client=t,this._eventPipeMethods={on:Bu(this.wu,this),off:Bu(this.vu,this)},this.yu={}}reset(){void 0===this.client.Base._dollarCrisp?.__spool?.pending_actions&&this.client.Base._dollarCrisp?.__spool&&(this.client.Base._dollarCrisp.__spool.pending_actions=[])}do_chat_open(t=null){!0===this.client.Chat._isInitialized?(wu.chat.maximize(),"function"==typeof t&&t()):wu.minimized.paneOpenHandler(e=>{this.client.Chat.init(e,t)})}do_chat_close(){!0===this.client.Chat._isInitialized&&wu.chat.minimize()}do_chat_toggle(){!0===this.is_chat_closed()?this.do_chat_open():this.do_chat_close()}do_chat_show(){!1!==this.is_chat_hidden()&&(wu.base.is_hidden=!1,wu.base.force_show=!0,!0===this.client.Chat._isInitialized&&(this.client.Chat.Interface.requestDynamicSizingProperties(),this.client.Chat.Interface.applyChatFocus()))}do_chat_hide(){!1!==this.is_chat_visible()&&(wu.base.is_hidden=!0,wu.base.force_show=!1,!0===this.client.Chat._isInitialized&&this.client.Chat.Interface.applyChatFocus())}do_helpdesk_search(){if(!0!==wu.helpdesk.isAvailable())throw new Error("Helpdesk search is unavailable");this.do_chat_show(),this.do_chat_open(()=>{wu.helpdesk.open(!0)})}do_helpdesk_article_open(t,e,s=null,i=null){if("string"!=typeof t||!t)throw new Error("Invalid article locale");if("string"!=typeof e||!e)throw new Error("Invalid article slug");if(!0!==wu.helpdesk.isAvailable())throw new Error("Helpdesk article is unavailable");this.do_chat_show(),this.do_chat_open(()=>{wu.helpdesk.showArticle(t,e,s,i),wu.helpdesk.open()})}do_helpdesk_query(t=""){this.client.Base.ensureSocket().then(()=>{wu.helpdesk.acquireQueryResults(t)})}do_overlay_open(t=null){if(!0!==wu.overlay.isAvailable())throw new Error("Overlay is unavailable (was it disabled?)");this.do_chat_show(),this.do_chat_open(()=>{wu.overlay.open(t)})}do_overlay_close(){!0===wu.overlay.isOpened()&&!0===this.client.Chat._isInitialized&&wu.chat.minimize()}do_message_send(t,e){this.client.Base.ensureSocket().then(()=>{let s=this.bu(t,e);null!==s.type&&null!==s.content&&this.client.Chat.startMaximized(()=>{let t=!0===wu.messages.triggerWillSendHooks()?500:0;if(!0===wu.base.runtime.tester_mode)return s.fingerprint=yr.Message.generateFingerprint(),s.timestamp=(new Date).getTime(),wu.messages.handleSent(s),void wu.messages.handleSentAcknowledgement(s);switch(s.type){case"text":yr.Message.sendTextMessage(s.content,t);break;case"file":yr.Message.sendFileMessage(s.content.name,s.content.url,s.content.type,t);break;case"animation":yr.Message.sendAnimationMessage(s.content.url,s.content.type,t);break;case"audio":yr.Message.sendAudioMessage(s.content.url,s.content.type,s.content.duration,t);break;case"picker":yr.Message.sendPickerMessage(s.content.id,s.content.text,s.content.choices,t);break;case"field":yr.Message.sendFieldMessage(s.content.id,s.content.text,s.content.explain,t);break;case"carousel":yr.Message.sendCarouselMessage(s.content.text,s.content.targets,t)}})})}do_message_show(t,e,s=null,i=!1){this.client.Base.ensureSocket().then(()=>{let n=this.bu(t,e);null!==n.type&&null!==n.content&&wu.messages.dispatchLocal(n.type,n.content,s,i)})}do_message_read(){!0===this.client.Chat._isInitialized&&wu.chat.eachSessionId(t=>{yr.Message.markMessagesAsRead(t)})}do_message_thread_start(t){if("string"!=typeof t||!t)throw new Error("Invalid message thread start text");if(!0!==this.client.Chat._isInitialized)throw new Error("Chat must be active for message thread to start");this.client.Base.ensureSocket().then(()=>{yr.Message.sendMessageThread("start",t)})}do_message_thread_end(t=""){if("string"!=typeof t&&!t)throw new Error("Invalid message thread end text");if(!0!==this.client.Chat._isInitialized)throw new Error("Chat must be active for message thread to end");this.client.Base.ensureSocket().then(()=>{yr.Message.sendMessageThread("end",t||"")})}do_session_reset(t=!1){!1===t&&this.client.Base.uninsertAndReset(),this.client.Base.updateSocketCookieKey(!1,!0),yr.Session.reset(),!1===t?xr.nextRender(()=>{this.client.Base.reTriggerLoader()}):document.location.reload()}do_trigger_run(t){if(!0!==this.client.Trigger.run(t))throw new Error("Trigger does not exist")}do_bot_scenario_run(t,e=null){if("string"!=typeof t||!t)throw new Error("Invalid bot scenario identifier");{let s=Au.sanitizeVariables(e);this.client.Base.ensureSocket(!0).then(()=>{let e={action:"run",scenario:t};null!==s&&(e.variables=s),yr.Session.sendPluginAction(Iu.bot,e),yr.Session.sendPluginAction(Iu.hugo,e)})}}is_chat_opened(){return!(!0!==wu.chat.is_opened||!0!==this.client.Chat._isInitialized)}is_chat_closed(){return!1===this.is_chat_opened()&&!0}is_chat_visible(){return!1===this.is_chat_hidden()&&!0}is_chat_hidden(){return!0===wu.base.is_hidden||(null===this.client.Base._containerEl||null===this.client.Base._containerEl.firstChild?.offsetParent)}is_chat_small(){return!1===wu.base.is_full_view&&!0}is_chat_large(){return!1===this.is_chat_small()&&!0}is_session_ongoing(){return(!0===wu.messages.conversation.has_sent_messages||!0===wu.messages.conversation.has_received_messages)&&!0}is_website_available(){return wu.availability.users_available&&!0}is_overlay_opened(){return!0===wu.overlay.isOpenedAndReady()&&!0}is_overlay_closed(){return!1===this.is_overlay_opened()&&!0}get_chat_unread_count(){return wu.chat.conversations.all_unread_count||0}get_message_text(){return!0===this.client.Chat._isInitialized&&wu.chat.message_field_value||""}get_session_identifier(){return wu.base.session_id||null}get_session_data(t=null){return yr.Session.getData(t)||null}get_user_email(){return yr.Session.getEmail()||null}get_user_phone(){return yr.Session.getPhone()||null}get_user_nickname(){return yr.Session.getNickname()||null}get_user_avatar(){return yr.Session.getAvatar()||null}get_user_company(){let t=yr.Session.getCompany()||null;return t?.employment?.title&&(t.employment=[t.employment.title,t.employment.role]),t?.geolocation?.country&&(t.geolocation=[t.geolocation.country,t.geolocation.city||null]),t}set_message_text(t=null){wu.chat.setMessageText(t)}set_session_data(t,e){this.client.Base.ensureSocket(!0).then(()=>{let s=t instanceof Array&&t[0]instanceof Array?t:[[t,e]],i={};for(let t=0;t{if(!t||!0!==Au.areSegments(t))throw new Error("Invalid segments value");yr.Session.setSegments(t,e)})}set_session_event(t,e=null,s=null){this.client.Base.ensureSocket(!0).then(()=>{let i=t instanceof Array&&t[0]instanceof Array?t:[[t,e,s]];if(!0!==Au.areEvents(i))throw new Error("Invalid event text or data");yr.Session.sendEvent(i);for(let t=0;t{try{this.yu[t].apply(window,e instanceof Array?e:void 0!==e?[e]:[])}catch{}})}unstackPending(){let t=this.client.Base._dollarCrisp?.__spool?.pending_actions;if(delete this.client.Base._dollarCrisp?.__spool?.pending_actions,t?.length>0)for(let e=0;e{try{let e=this.yu[u].call(window,o,n,t.session_id);this.Cu(s,n,r,e)}catch(e){We.error(`Tool execution error for ${u}: ${e}`)}})}isToolEvent(t){return"string"==typeof t&&!0===t.startsWith(ju)}wu(t,e){if("function"!=typeof e)throw new Error("Handler must be a function");this.yu[t]=e}vu(t){void 0!==this.yu[t]&&delete this.yu[t]}Cu(t,e,s,i=null){let n={type:"tool:result",id:e,tool:s};void 0!==i&&(n.result=i),yr.Session.sendPluginAction(t,n)}Eu(){!0===this.client.Chat._isInitialized&&(!0===wu.messages.conversation.has_sent_messages&&wu.chatAlert.update("wait_reply","show"),wu.chat.eachSessionId(t=>{wu.chatAlert.update("warn_reply","hide",t),wu.chatAlert.update("email_invalid","hide",t),wu.chatIntent.update("identity",!1,t),wu.messages.checkFormIdentifyUnlock(t)}))}bu(t,e){let s={type:null,content:null};switch(t){case"text":if("string"!=typeof e||!e)throw new Error("Invalid text message");s.type="text",s.content=e;break;case"file":if("object"!=typeof e||!e.name||!e.url||!e.type)throw new Error("Invalid file message");s.type="file",s.content={name:e.name,url:e.url,type:e.type};break;case"animation":if("object"!=typeof e||!e.url||!e.type)throw new Error("Invalid animation message");s.type="animation",s.content={url:e.url,type:e.type};break;case"audio":if("object"!=typeof e||!e.url||!e.type||!e.duration)throw new Error("Invalid audio message");s.type="audio",s.content={url:e.url,type:e.type,duration:e.duration};break;case"picker":if("object"!=typeof e||!e.id||!e.text||0===(e.choices||[]).length)throw new Error("Invalid picker message");s.type="picker",s.content={id:e.id,text:e.text,choices:e.choices};break;case"field":if("object"!=typeof e||!e.id||!e.text||!e.explain)throw new Error("Invalid field message");s.type="field",s.content={id:e.id,text:e.text,explain:e.explain};break;case"carousel":if("object"!=typeof e||!e.text||0===(e.targets||[]).length)throw new Error("Invalid carousel message");s.type="carousel",s.content={text:e.text,targets:e.targets}}return s}},Pu=["get","set","is","do","on","off","config","safe","help"],Lu=["on","off"],Mu=/:/g,Uu=new class{constructor(){this._safeMode=!1,this.Kn()}reset(){this.Kn()}push(t){let e=window.$__CRISP_INSTANCE?.__spool||{};void 0!==e.pending_actions?e.pending_actions.push(t):t[0]&&void 0!==t[1]&&Pu.includes(t[0])&&"function"==typeof this[t[0]]&&this[t[0]](t[1],t[2]||[])}get(t,e=[]){return this.ku("get",t,this.$u(e))}set(t,e=[]){return this.ku("set",t,this.$u(e))}is(t){return this.ku("is",t)}do(t,e=[]){return this.ku("do",t,this.$u(e))}on(t,e){return this.Au("on",t,[t,e])}off(t){return this.Au("off",t,[t])}config(t,e=[]){return this.ku("config",t,this.$u(e))}safe(t=!0){if("boolean"!=typeof t)throw new Error("Safe mode value must be 'true' or 'false'.");this._safeMode=t}help(){let t=[],s=e().Action,i=Object.getOwnPropertyNames(Object.getPrototypeOf(s));for(let e=0;e1&&Pu.includes(n[0])&&"function"==typeof s[i[e]]&&t.push(`$crisp.${n[0]}('${n.slice(1).join(":")}')`)}for(let e=0;e{null!==this.ju&&(xr.clearTimeout(this.ju),this.ju=null),wu.base.is_mobile_view?(this.client.Chat.executeResize(),xr.setTimeout(()=>{this.client.Chat.executeResize()},300),this.ju=xr.setTimeout(()=>{this.ju=null,this.client.Chat.executeResize()},800)):this.client.Chat.executeResize()})}Mu(){screen.orientation&&(this.Iu=()=>{screen.orientation.type,screen.orientation.angle,Or.blurFromForeground(),xr.setTimeout(()=>{this.client.Chat.executeResize()},300),xr.setTimeout(()=>{this.client.Chat.executeResize()},800)},screen.orientation.addEventListener("change",this.Iu))}Uu(){this.Su(),xr.addEventListener("window","click",Vu(this.Vu,this),Nu),xr.addEventListener("window","touchend",Vu(this.Vu,this),Nu),xr.addEventListener("window","touchmove",Vu(this.Vu,this),Nu),xr.addEventListener("window","keydown",Vu(this.Vu,this),Nu),xr.addEventListener("window","mousemove",Vu(this.Su,this),Nu),xr.addEventListener("window","focus",Vu(this.Su,this),Nu),xr.addEventListener("window","blur",Vu(this.Su,this),Nu)}qu(){this.Ru()}Vu(){this.triggerInteracted()}Su(){null!==this.Ou&&xr.clearTimeout(this.Ou),this.Ou=xr.setTimeout(()=>{this.Ou=null,this.Tu()},6e5),!0===this._isInactive&&!1===this._isZombie&&yr.socket.connect(),this._isInactive=!1,yr.Session.markActive()}Tu(){!0===yr.socket.connected&&(this._isInactive=!0,yr.socket.disconnect())}Ru(){null!==this.zu&&xr.clearTimeout(this.zu),this.zu=xr.setTimeout(()=>{this.zu=null,this.Pu()},36e5),!0===this._isZombie&&yr.socket.connect(),this._isZombie=!1}Pu(){!0!==yr.socket.connected&&!0!==this._isInactive||(this._isZombie=!0,!0===yr.socket.connected&&yr.socket?.disconnect())}Kn(){this._isInactive=!1,this._isZombie=!1,this.Ou=null,this.zu=null,this.ju=null,this.Iu=null}},Wu=class extends Ge{constructor(t){super(),this.client=t,this.Nu=!1,this.Hu=null,this.Kn()}init(){this.Wu()}reset(){this.Kn()}toggleChatMode(t=!1){"chat"===wu.chat.mode||!0!==t&&!0===wu.helpdesk.settings_only||(wu.chat.mode="chat",this.requestDynamicSizingProperties())}toggleVisibility(t="pane",e=!0){let s=(t,e)=>{t!==e==!0&&(wu.chat.is_opened=t,xr.nextRender(()=>{this.Ju(t)}))};(t=>{let i=wu.chat.is_opened;if(wu.chat.is_maximized=t,!0===e){let e=!0!==t?"animate_minimize":"animate_maximize";!0===t?wu.chat.is_opened=!0:this.Ju(!1),null!==this.Gu&&(xr.clearTimeout(this.Gu),wu.chat.animate_minimize=!1,wu.chat.animate_maximize=!1),wu.chat[e]=!0,this.Gu=xr.setTimeout(()=>{this.Gu=null,wu.chat[e]=!1,s(t,i)},350)}else s(t,i)})("pane"!==t),!0===e&&this.applyChatFocus()}toggleSocketState(t=!1,e=!1){null!==this.Ku&&xr.clearTimeout(this.Ku),this.Ku=xr.setTimeout(()=>{this.Ku=null,wu.chat.has_offline=!0!==t;let s={failed:e,inactive:this.client.Event._isInactive||this.client.Event._isZombie||!1};for(let t in s)wu.chat[`reconnect_${t}`]=s[t]},!0===t?0:1e3)}applyChatFocus(){let t=wu.chat.has_chat_focus,e=wu.chat.conversations.current_session_id||null;yr.Message.setMessagesInView(t,e)}pane(){this.Zu(),this.Hu=Vr.dom('
📦 {{ message?.content?.name }}🎧{{ (message.user?.type === \'website\') ? message.user?.nickname : $render._n(message.user?.nickname) }}
{{ $render._e("chat", "minimized_tooltip_message_compose") }}
{{ $store.chat.conversations.all_unread_count }}
'),this.client.Base._containerEl.innerHTML="",this.client.Base._containerEl.appendChild(this.Hu),Vr.vue(this.Hu),this.client.Chat.Viewport.bindAll(),wu.chat.is_maximized=!1,wu.chat.is_opened=!1}requestDynamicSizingProperties(t=!1){!0!==this.Nu&&(this.Nu=!0,xr.nextRender(()=>{"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame(()=>{this.Yu(t),this.Nu=!1}):(this.Yu(t),this.Nu=!1)}))}refreshResizePageScroll(t=!1){if(window.scroll&&!0===wu.chat.is_opened&&this.Qu>-1)if(!0!==t&&wu.base.is_mobile_view)window.scrollTo(0,-1);else{let t=document.querySelector("html");t&&t.classList.remove("cc-1rplw"),this.Xu&&(xr.removeEventListener("document","touchstart",this.Xu),this.Xu=null),this.ta&&(xr.removeEventListener("document","touchmove",this.ta),this.ta=null),window.scroll(window.scrollX,this.Qu),this.Qu=-1}}Zu(){let t={status:{url:wu.chat.generateChannelLink("status")}};xr.merge(wu.chat,t)}Yu(t=!1){if(!wu.base.runtime?.mount&&!0===this.client.Action.is_chat_visible()){let e,s=wu.base.is_full_view,i=Hr.getCustomization("position","chatbox");wu.base.applySizing(),!0===wu.base.is_large_view?(this.ea=730,this.sa=400,e=600):!0===wu.base.is_small_view?(this.ea=490,this.sa=320,e=440):(this.ea=610,this.sa=360,e=500);let n="helpdesk"===wu.chat.mode&&wu.helpdesk.viewer.url&&!0,r="search"===wu.chat.mode&&!0;!1===n&&!0===wu.chat.was_auto_expanded.helpdesk_article&&(wu.chat.was_auto_expanded.helpdesk_article=!1),!1===r&&!0===wu.chat.was_auto_expanded.search&&(wu.chat.was_auto_expanded.search=!1);let o=!0===n&&!0===wu.chat.was_auto_expanded.helpdesk_article,u=!0===r&&!0===wu.chat.was_auto_expanded.search;if(this.Hu&&(!0===o||!0===u||!0===wu.chat.is_expanded)){let t=this.Hu.querySelector(".cc-w7v18"),s=window.innerHeight-t.getBoundingClientRect().bottom;this.sa=e,this.ea=window.innerHeight-s-22}if(!0===wu.base.is_full_view&&(this.ea=window.innerHeight,this.sa=window.innerWidth,window.visualViewport&&(this.ea=window.visualViewport.height+window.visualViewport.offsetTop)),!1===wu.base.is_full_view&&i?.default_button_vertical&&(this.ea-=i.default_button_vertical),this.Hu&&(!0===this.client.Chat._isInitialized||!0===t)){let t=this.Hu.querySelector(".cc-w7v18");if(s&&!1===wu.base.is_full_view){let e=t.style.getPropertyValue("transition");t.style.setProperty("transition","none","important"),requestAnimationFrame(()=>{t.style.setProperty("transition",e,"important")})}t.style.setProperty("width",`${this.sa}px`,"important"),t.style.setProperty("height",`${this.ea}px`,"important"),wu.base.is_full_view&&!0===this.client.Action.is_chat_opened()?this.client.Chat.Viewport.adapt():this.client.Chat.Viewport.unadapt()}Mo.allow(!wu.base.is_mobile_view)}}Ju(t=!1){if(wu.base.is_mobile_view&&window.scroll)if(!0===t){if(-1===this.Qu){this.Qu=window.scrollY;let t=document.querySelector("html");t&&t.classList.add("cc-1rplw"),window.scroll(window.scrollX,0);let e=0;this.Xu&&(xr.removeEventListener("document","touchstart",this.Xu),this.Xu=null),this.Xu=xr.addEventListener("document","touchstart",t=>{t.changedTouches?.[0]&&(e=t.changedTouches[0].pageY)}),this.ta&&(xr.removeEventListener("document","touchmove",this.ta),this.ta=null),this.ta=xr.addEventListener("document","touchmove",t=>{if(document.activeElement&&t.changedTouches?.[0]){"input"!==document.activeElement.tagName&&"textarea"!==document.activeElement.tagName||t.preventDefault();let s=t.changedTouches[0].pageY||0;Math.abs(s-e)>10&&document.activeElement.blur()}},{passive:!1,capture:!0})}}else this.refreshResizePageScroll(!0);else this.refreshResizePageScroll(!0)}Wu(){wu.chat.has_window_focus=(!window.hasFocus||window.hasFocus())&&!0,xr.addEventListener("window","focus",()=>{wu.chat.has_window_focus=!0,this.applyChatFocus()},{capture:!1}),xr.addEventListener("window","blur",()=>{wu.chat.has_window_focus=!1,this.applyChatFocus()},{capture:!1})}Kn(){this.Ku=null,this.Gu=null,this.Qu=-1,this.Xu=null,this.ta=null}},Ju=/;/g,Gu=class extends Ge{constructor(t){super(),this.client=t,this.Kn()}init(){}reset(){this.Kn()}bindAll(){this._viewportEl=document.querySelector('head meta[name="viewport"]')}adapt(){if(!0===wu.base.is_full_view){if(!1===this.ia){null===this.na&&(this.na=this.Wn());let t=xr.clone(this.na);t.width="device-width",t["initial-scale"]="1",t["maximum-scale"]="1",t["user-scalable"]="0",t["viewport-fit"]="cover";let e=this.ra(t);null!==this._viewportEl?this._viewportEl.setAttribute("content",e):(this._viewportEl=document.createElement("meta"),this._viewportEl.setAttribute("name","viewport"),this._viewportEl.setAttribute("content",e),document.querySelector("head").appendChild(this._viewportEl))}this.ia=!0}else this.ia=!1}unadapt(){if(!0===this.ia){if(null!==this._viewportEl&&this._viewportEl.length>0){let t=this.ra(this.na);t?this._viewportEl.setAttribute("content",t):(this._viewportEl.remove(),this._viewportEl=null)}this.ia=!1}}Wn(){let t={};if(null!==this._viewportEl){let e=this._viewportEl.getAttribute("content").trim().replace(Ju,",");if(e){let s;s=!0===e.includes(",")?e.split(","):[e];for(let e=0;exo(()=>import("./main_default_2a24f893.js"),__vite__mapDeps([0,1])),e=>{this.aa(t,!0),e.default(".cc-w7v18"),Tr.onInterfaceLifecycle("ready")},e=>{We.error(e),this.aa(t,!1),Tr.onInterfaceLifecycle("error",{origin:"partial"})}))):("function"==typeof e&&e(),Tr.onInterfaceLifecycle("ready"))}reset(){this.Kn()}startMinimized(t=null){this.la(!1,t)}startMaximized(t=null){this.la(!0,t)}executeResize(){!0===this._isInitialized?(this.Interface.refreshResizePageScroll(),this.Interface.requestDynamicSizingProperties()):wu.base.applySizing()}aa(t=null,e=!0){if(this.ua=!1,!0===e){for(this.ha(),this.client.Chat.Interface.pane(),this.client.Base.updateSocketCookieKey(!1),this.ca(t),this._isInitialized=!0;this.oa.length>0;)this.oa.shift()();wu.messages.checkUserIdentity(!0)}else this.oa=[]}la(t=!1,e=null){let s=()=>{"function"==typeof e&&e()};!0!==this._isInitialized?this.init({maximized:t},()=>{wu.state.propagate("maximized",t,wu.base.session_id,!0),s()}):s()}ha(){let t,e=[this.client.Chat.Viewport,this.client.Chat.Interface];for(t=0;t{wu.state.initialize(t),wu.messages.restoreHistory(t)})}Kn(){this._isInitialized=!1,this.ua=!1,this.oa=[]}},Zu=class extends Ge{constructor(t){super(),this.client=t}init(t=!0,e=!1,s=!1,i=!0){!0!==s&&wu.chat.eachSessionId(t=>{yr.Message.getMessageHistory(t)}),this.ca(e,s,t,i)}reset(){}ca(t=!1,e=!1,s=!1,i=!0){!0!==e?wu.minimized.paneAuthorized(t,s,i):wu.minimized.paneUnauthorized(t,i),!0===wu.base.runtime.lock_maximized&&wu.minimized.paneOpenHandler(t=>{this.client.Chat.init(t)})}},Yu=/\{\s*\[native code\]\s*\}$/,Qu=new class extends Ge{constructor(){super(),this.Kn()}reset(){this.Kn()}scheduleWarnIncompatible(t=!1){null!==this.da&&clearTimeout(this.da),this.da=setTimeout(()=>{this.da=null,!0!==Uu._safeMode&&(this.Da(),this.fa())},!0===t?0:2e4)}Da(){"UTF-8"!==(document.characterSet||document.charset||"").toUpperCase()&&window.console&&window.console.warn}fa(){let t=window;if(t?.console&&"function"==typeof t.console.warn&&"function"==typeof Function.prototype.toString){let e,s,i,n,r=[[null,t,["eval","escape","unescape","decodeURI","encodeURI","decodeURIComponent","encodeURIComponent","setTimeout","clearTimeout","setInterval","clearInterval","parseInt","parseFloat","RTCPeerConnection","MutationObserver","XMLHttpRequest","AudioContext","WebSocket","Proxy","Text","Comment"]],[null,t,["Array","Object","String","Number","Date","Function","RegExp","Symbol","Set","Map","WeakMap","Event","Error"]],["Array",t.Array,["from","isArray"]],["Array.prototype",t.Array.prototype,["push","pop","indexOf","includes","sort","splice","slice","shift","unshift","map","filter","find","findIndex","forEach"]],["Object",t.Object,["assign","create","keys","values","is","isExtensible","defineProperty","defineProperties","getOwnPropertyNames","getOwnPropertyDescriptors"]],["Object.prototype",t.Object.prototype,["hasOwnProperty","propertyIsEnumerable","toString"]],["String",t.String,["fromCharCode"]],["String.prototype",t.String.prototype,["indexOf","charAt","charCodeAt","trim","toLowerCase","toUpperCase","slice","replace","match"]],["Math",t.Math,["random","round","floor","ceil","abs"]],["Date",t.Date,["now"]],["Date.prototype",t.Date.prototype,["getTime","toISOString"]],["Function.prototype",t.Function.prototype,["bind","apply","call"]],["RegExp.prototype",t.RegExp.prototype,["test","exec"]],["Event.prototype",t.Event.prototype,["preventDefault","stopPropagation"]],["Reflect",t.Reflect,["get","set","has","ownKeys","deleteProperty"]],["document",t.document,["querySelector","querySelectorAll","createElement","createEvent","addEventListener","removeEventListener"]],["JSON",t.JSON,["stringify","parse"]],["localStorage",t.localStorage,["setItem","getItem","removeItem"]],["sessionStorage",t.sessionStorage,["setItem","getItem","removeItem"]]],o=[];for(let t=0;t{this.wa=t.socket,this.va=t.buster||1,this.ya=t.endpoints||{};let e=!document.cookie.includes(this.ba(!0))&&!1!==this.wa&&!0;!1===e&&!0===wu.base.runtime.lock_maximized&&(e=!0),!0===e?this.Ea():this.runStatic(),this.client.Event.init()}).catch(t=>{"invalid_website_id"===t&&this.runError()})):wu.base.runtime.mount&&this.Ca(0)}reset(){let t=this.ga;this.Kn(),this.pa(),this.ga=t,Je.forEach(t=>{try{"function"==typeof t.fn&&t.fn()}catch(e){We.error(e)}})}spawnClient(t=!1){!0===t&&(wu.base.error_mode=!0,Tr.onInterfaceLifecycle("error",{origin:"spawn"}),We.error("Spawn client with error mode")),this.ka(),Ti.init(),!0!==t&&(yr.Config.setIgnorePrivacy(wu.website.chat.ignore_privacy),yr.Config.setVisitorCompose(wu.website.chat.visitor_compose)),this.client.Trigger.init(Hr.getTriggers()),this.Zu(),this._clientEl=Vr.dom('
'),this._containerEl=this._clientEl.querySelector(".cc-165wh"),this.$a(),this.insertStyle()}runStatic(t=!0){!1!==t&&this.Aa(!1),this.acquireWebsiteSettings({},this.va).then(t=>{!0!==t&&(wu.availability.receive(wu.website.website.online||!1,!1),this.spawnClient(t),this.client.Minimized.init(!1,!1,t),xr.nextRender(()=>{this.triggerSessionLoaded()}))})}runError(){bu.load("en").then(()=>{this.spawnClient(!0),this.client.Minimized.init(!0,!1,!0)}).catch(t=>{We.error(t)})}triggerSessionLoaded(){if("function"==typeof this.ma)try{this.ma(),this.ma=null}catch{}this.client.Action.unstackPending(),!0===this.client.Chat._isInitialized&&this.client.Chat.Interface.applyChatFocus(),this.client.Action.event("session:loaded",wu.base.session_id),Qu.scheduleWarnIncompatible(!0)}updateSocketCookieKey(t=!0,e=!1){let s,i=this.ba(t);s=!0===e?new Date(0):new Date((new Date).getTime()+(!0===t?6e5:1728e5)),document.cookie=`${i}; expires=${s.toUTCString()}; path=/; samesite=lax;`}updateConfiguration(t,e=!1){typeof wu.website.chat?.[t]==typeof e&&(wu.website.chat[t]=e)}insertStyle(){let t=this.Ba;Yr.applyTheme(t.color.theme||wu.website?.chat?.color_theme,!!t.color.theme),Yr.applyContainerIndex(t.other.container_index),Yr.applyPosition(t.position)}acquireWebsiteSettings(t,e=null){let s=!1;return this.client.Partial.loadSettings(`settings/website/${encodeURIComponent(wu.base.website.id)}/`,e||t.buster).catch(()=>(We.error("Failed to acquire website settings"),Promise.reject(null))).then(e=>(s=!(e&&!e.error),wu.website.updateWebsite(e,t),bu.load(wu.website.chat.locale))).then(()=>Promise.resolve(s)).catch(t=>(We.error(t),Promise.resolve(!0)))}ensureSocket(t=!1){return!0===yr.socket?.connected?Promise.resolve():new Promise(e=>{!1!==this.wa&&(this.client.Broker._fnInitialize.actions.push(e),null===this.client.Broker._fnInitialize.master&&(this.client.Broker._fnInitialize.master=()=>{!0===t&&this.client.Minimized.init(!0,!1,!1,!1)}),yr.socket?.connect())})}configureConsoleSink(){"production"===Me.ENVIRONMENT&&(yr.Issue.configure({project:Me.PROJECT_NAME,revision:Me.REVISION,environment:Me.ENVIRONMENT,useragent:wu.base.browser_useragent,page:wu.base.page_url}),We.connectLogSink("internal",(t,e,s)=>{if("error"===t){Array.isArray(s)&&(s=s[0]),"object"==typeof this._dollarCrisp?.__spool&&(this._dollarCrisp.__spool.error_last={ns:e,value:s});let i=(new Date).getTime();i-this.xa>=1e4&&(this.xa=i,yr.Issue.report(t,e,s))}}))}uninsertAndReset(){this.uninsertClient(),this.reset()}uninsertClient(){"MutationObserver"in window&&(this.ja("html"),this.ja("body")),yr.socket?.disconnect(),this.ka()}reTriggerLoader(){"function"==typeof this.ga&&this.ga()}Fa(){let t=new Date,e=`${t.getFullYear()}-${t.getMonth()}-${t.getDate()}-${t.getHours()}-${t.getMinutes()}`;return this.client.Partial.loadSettings(`settings/website/${encodeURIComponent(wu.base.website.id)}/prelude/`,e).then(t=>(Me.TEST&&window.$mock_prelude&&xr.merge(t,window.$mock_prelude),t.error?Promise.reject(t.error):Promise.resolve(t||Xu))).catch(t=>(We.error("Error loading website prelude:",t),Promise.reject(t)))}$a(){this.Ia(),"MutationObserver"in window&&(this.Sa(document.documentElement),this.Ra(document.body))}Ia(){let t=document.querySelector("body");if(wu.base.runtime.mount){let t=document.getElementById(wu.base.runtime.mount);t&&t.appendChild(this._clientEl)}else t&&t.appendChild(this._clientEl);Vr.vue(this._clientEl),Tr.onInterfaceLifecycle("mounted")}ka(){null!==this._clientEl&&(this._clientEl.remove(),this._clientEl=null,Tr.onInterfaceLifecycle("unmounted"))}Ea(){this.Aa(!0)}Aa(t=!1){let e=!0===Me.SOCKET_AFFINITY,s=this.ya.socket||{},i=this.ya.rescue?.socket||{},n=(e?s.client:null)||Me.URL_RELAY_CLIENT,r=(e?s.stream:null)||Me.URL_RELAY_STREAM,o=e&&i.client||null;this.client.Broker.init(n,r,o,t)}Sa(t){this.ja("html"),this.Oa.html=new window.MutationObserver(t=>{for(let e=0;e<(t?.length||0);e++){let s=t[e];if("childList"===s.type&&s.addedNodes)for(let t=0;t{for(let e=0;e<(t?.length||0);e++){let s=t[e];if("childList"===s.type&&s.removedNodes)for(let t=0;t{this.Ta=null,this.Ia()},t))}ba(t=!0){return`${encodeURIComponent("crisp-client/socket/"+wu.base.website.id)}=${encodeURIComponent(!0===t?"0":"1")}`}Zu(){xr.merge(wu.base,{is_full_view:!1,is_small_view:!1,is_large_view:!1}),wu.base.is_full_view=wu.base.checkIsFullView(),wu.base.is_small_view=wu.base.checkIsSmallView(),wu.base.is_large_view=wu.base.checkIsLargeView()}pa(){this._clientEl=null,this._containerEl=null}Kn(){this._isInitialized=!1,this.va=1,this.wa=!0,this.ya={},this.ga=null,this.ma=null,this.xa=0,this.Ta=null,this.Ba={color:{},other:{}},this.Oa={}}},sa=class extends Ge{constructor(t){super(),this.client=t,this.Kn()}init(t,e,s=null,i=!0){yr.init({ticketGenerator:(t,e)=>{this.client.Ticket.acquire(t,e)},environment:Me.ENVIRONMENT,urlRelayClient:t,urlRelayStream:e,urlRelayRescueClient:s,websiteDomain:wu.base.website.domain,websiteId:wu.base.website.id,sessionId:wu.base.forced_session_id,tokenId:wu.base.token_id,cookieExpire:wu.base.cookie_expire,cookieDomain:wu.base.cookie_domain,useragent:wu.base.browser_useragent,timezone:wu.base.browser_timezone,capabilities:wu.base.browser_capabilities,locales:wu.base.browser_locales,runtimeConfiguration:wu.base.runtime,connectSocket:i,sessionChildren:!0,platformName:Me.PLATFORM_NAME,platformSignatureKey:Me.PLATFORM_SIGNATURE_KEY}),wu.messages.registerUnreadHandler(),this.za=yr.event,this.Pa=i,this.client.Base.configureConsoleSink(),this.La(),this.Ma(),this.Ua(),this.qa(),this.Va(),this.Na(),this.Ha(),this.Wa(),this.Ja(),this.Ga(),this.Ka(),this.Za(),this.Ya(),this.Qa(),this.Xa(),this.tl(),this.sl(),this.il(),this.nl(),this.rl(),this.ol(),this.ul(),this.al(),this.ll(),this.hl(),this.cl(),this.dl(),this.Dl(),this.fl(),this.pl(),this._l(),this.ml(),this.gl(),this.Fl(),this.wl(),this.vl(),this.yl(),this.bl(),this.El(),this.Cl(),this.kl(),this.$l(),this.Al(),this.Bl(),this.xl(),this.jl(),this.Il(),this.Sl(),this.Rl(),this.Ol(),this.Tl(),this.zl(),this.Pl(),this.Ll(),this.Ml(),this.Ul()}reset(){this.Kn()}La(){this.za.on("socket:state",t=>{t.connected===this._socketConnected&&t.failed_reconnect===this.ql||(this._socketConnected=t.connected||!1,this.ql=t.failed_reconnect||!1,this.client.Chat.Interface.toggleSocketState(this._socketConnected,this.ql),wu.minimized.pane.is_offline=!0!==this._socketConnected,!0===this._socketConnected&&this.client.Event.checkActivityAutokill())})}Ma(){this.za.on("socket:rescued",()=>{!1===this.Pa?yr.socket.connect():null===this.client.Base._containerEl&&(this.client.Base.updateSocketCookieKey(!0),this.client.Base.runStatic(!1))})}Ua(){this.za.on("session:created",t=>{t.error?"invalid_website_id"===t.error&&this.client.Base.runError():t.session_id?this.Vl=!0:We.error("Unrecognized session creation error")})}qa(){this.za.on("session:joined",t=>{t.error?"invalid_session"===t.error&&++this.Nl<=1&&yr.Session.reset(!0,()=>{yr.Session.create()},()=>{}):(wu.base.session_id=t.session_id||null,wu.base.session_hash=t.session_hash||null,wu.chat.initializeConversations(t,t.children),!1===t.socket&&!0!==t.initiated&&this.client.Base.updateSocketCookieKey(!0),!0===this.Hl?(this.Hl=!1,this.client.Base.acquireWebsiteSettings(t).then(t=>{!0!==t&&(this.client.Base.spawnClient(t),yr.Website.getUsersAvailable())})):wu.chat.eachSessionId(t=>{wu.messages.synchronizeHistoryAndNew(t)}))})}Va(){this.za.on("session:state",t=>{let e=t.session_id;delete t.session_id;let s=e===wu.base.session_id;if(s&&1===this.Wl&&(this.Wl++,this.Jl=!0),!1===this.client.Chat._isInitialized)if(s){let e=()=>{xr.nextRender(()=>{this.client.Base.triggerSessionLoaded()})};if(null!==this._fnInitialize.master){this._fnInitialize.master(xr.isEmpty(t)?null:t);for(let t=0;t{if("email:invalid_format"===t.type)wu.chatAlert.update("email_invalid","show",t.session_id),wu.messages.checkFormIdentifyLock(t.session_id)})}Ha(){this.za.on("session:request:purge",()=>{this.client.Action.do_session_reset()})}Wa(){this.za.on("session:request:feedback",t=>{wu.chatFeedback.request(t.session_id)})}Ja(){this.za.on("session:request:identity",t=>{wu.chatAuthenticate.request(t.session_id,t.method,t.identity,t.annotation)})}Ga(){this.za.on("session:request:tool",t=>{this.client.Action.handleToolEventRequest(t)})}Ka(){this.za.on("session:identity:verified",t=>{let e=t.verification,s=t.error||null;wu.chatAuthenticate.acknowledge(t.session_id,e.method,e.identity,e.annotation,s)})}Za(){this.za.on("session:child:create",()=>{})}Ya(){this.za.on("session:child:created",t=>{t.error,wu.chat.handleConversationStarted(t.session_id,t.error,t.redirect)})}Qa(){this.za.on("website:users:available",t=>{Me.TEST&&window.$mock_users_available&&(t=window.$mock_users_available),wu.availability.receive(t.available,t.changed),0===this.Wl?(this.Wl++,wu.chat.eachSessionId(t=>{yr.Session.getState(t)})):wu.availability.apply()})}Xa(){this.za.on("message:received",t=>{this.Kl(t)})}tl(){this.za.on("message:received:local",t=>{this.Kl(t)})}sl(){this.za.on("message:send",t=>{wu.messages.handleSent(t,t.session_id)})}il(){this.za.on("message:sent",t=>{wu.messages.handleSentAcknowledgement(t,t.session_id),this.client.Action.event("message:sent",t)})}nl(){this.za.on("message:removed",t=>{wu.messages.handleRemoved(t,t.session_id)})}ol(){this.za.on("message:compose:send",t=>{this.client.Action.event("message:compose:sent",t)})}ul(){this.za.on("message:acknowledge:read:send",t=>{wu.messages.acknowledgeReadSend(t.fingerprints,t.session_id)})}al(){this.za.on("message:error:rejected",t=>{wu.messages.errorRejected(t.fingerprint,t.session_id,t.reason)})}rl(){this.za.on("message:compose:received",t=>{if(!0!==wu.website?.chat?.operator_privacy||!0===t.automated)switch(t.type){case"start":wu.messages.showCompose(t.timestamp,t.automated,t.session_id);break;case"stop":wu.messages.hideCompose(t.session_id)}this.client.Action.event("message:compose:received",t)})}ll(){this.za.on("history:messages",t=>{wu.messages.handleHistory(t.messages,t.session_id)})}hl(){this.za.on("overlay:answer:search",t=>{this._responseSpool.overlay_answer_search=t.id})}cl(){this.za.on("overlay:answer:search:partial",t=>{this._responseSpool.overlay_answer_search===t.id&&wu.overlay.handleSearchChunk(t.partial.chunk)})}dl(){this.za.on("overlay:answer:search:processed",t=>{this._responseSpool.overlay_answer_search===t.id&&wu.overlay.handleSearchAnswer(t.result.text,t.search.query)})}Dl(){this.za.on("overlay:answer:search:sources",t=>{this._responseSpool.overlay_answer_search===t.id&&wu.overlay.handleSearchSources(t.result.sources)})}fl(){this.za.on("call:request:initiate",t=>{yr.Call.init({session_id:t.session_id,call_id:t.call_id,ice:Me.RTC_ICE,mode:t.mode,has_support:t.has_support},()=>{wu.call.ring(t)},()=>{})})}pl(){this.za.on("call:action:stopped",()=>{wu.call.stop()})}_l(){this.za.on("call:peer:local:error",()=>{wu.call.error()})}ml(){this.za.on("call:peer:remote:error",()=>{wu.call.error()})}gl(){this.za.on("call:media:local:success",()=>{wu.call.success("media_local")})}Fl(){this.za.on("call:media:local:error",()=>{wu.call.error()})}wl(){this.za.on("call:media:remote:success",()=>{wu.call.success("media_remote")})}vl(){this.za.on("call:track:local:started",t=>{wu.call.toggleMediaStatus(t.media,!0)})}yl(){this.za.on("call:track:local:ended",t=>{wu.call.toggleMediaStatus(t.media,!1)})}bl(){this.za.on("browsing:request:initiate",t=>{this.Zl.push(()=>{wu.browsing.prepare(t)}),this.Gl()})}El(){this.za.on("browsing:assist:started",()=>{wu.browsing.startAssist()})}Cl(){this.za.on("browsing:assist:stopped",()=>{wu.browsing.stopAssist()})}kl(){this.za.on("browsing:assist:mouse",t=>{wu.browsing.pipeMouse(t)})}$l(){this.za.on("browsing:assist:scroll",t=>{wu.browsing.pipeScroll(t)})}Al(){this.za.on("browsing:assist:click",t=>{wu.browsing.pipeClick(t)})}Bl(){this.za.on("bucket:url:upload:generate",t=>{this._responseSpool.bucket_url_upload_generate=t.id})}xl(){this.za.on("bucket:url:upload:generated",t=>{if(this._responseSpool.bucket_url_upload_generate===t.id&&"preparing"===(wu.chatFile.state||null)){let e=t.url?.signed||"",s=t.url?.resource||"",i=t.policy?.size_limit||0;wu.chatFile.uploadGenerated(e,s,i)}})}jl(){this.za.on("media:animation:list",t=>{this._responseSpool.media_animation_list=t.id})}Il(){this.za.on("media:animation:listed",t=>{this._responseSpool.media_animation_list===t.id&&(wu.chatPicker.gif.results=t.results)})}Sl(){this.za.on("helpdesk:article:search",t=>{this._responseSpool.helpdesk_article_search=t.id})}Rl(){this.za.on("helpdesk:article:searched",t=>{if(this._responseSpool.helpdesk_article_search===t.id){let e=!!t.search.query;wu.helpdesk.handleArticles(t.results,t.search,e);let s=wu.chat.generateChannelLink("helpdesk");if(s){let e,i=[];for(let n=0;n{this._responseSpool.helpdesk_article_list=t.id})}Tl(){this.za.on("helpdesk:article:listed",t=>{this._responseSpool.helpdesk_article_list===t.id&&wu.helpdesk.handleArticles(t.results)})}zl(){this.za.on("helpdesk:article:suggest",t=>{this._responseSpool.helpdesk_article_suggest=t.id})}Pl(){this.za.on("helpdesk:article:suggested",t=>{this._responseSpool.helpdesk_article_suggest===t.id&&wu.helpdesk.handleAutocomplete(t.results)})}Ll(){this.za.on("helpdesk:category:list",t=>{this._responseSpool.helpdesk_category_list=t.id})}Ml(){this.za.on("helpdesk:category:listed",t=>{this._responseSpool.helpdesk_category_list===t.id&&wu.helpdesk.handleCategories(t.results)})}Ul(){this.za.on("window:history",t=>{wu.base.page_url=t.page_url,wu.base.page_domain=t.page_domain,null!==this.client.Base._containerEl&&!1===wu.base.is_blocked&&this.client.Chat.Interface.requestDynamicSizingProperties(),this.client.Trigger.reprocessEventsPage()})}Kl(t){this.client.Chat.startMinimized(()=>{let e="network"===t.origin&&!0;wu.messages.handleReceived(t,t.session_id,e,e,!0,!1),this.client.Action.event("message:received",t)})}Gl(){if(!0===this.Jl)for(;this.Zl.length>0;)this.Zl.shift()()}Kn(){this._socketConnected=!1,this._responseSpool={},this._fnInitialize={master:null,actions:[]},this.za=null,this.Vl=!1,this.Hl=!0,this.Pa=!1,this.ql=!1,this.Wl=0,this.Jl=!1,this.Zl=[],this.Nl=0}},ia=class extends Ge{constructor(t){super(),this.client=t}loadSettings(t,e=null,s={}){let i=`${Me.URL_CLIENT}/${t}`,n="?";e&&(i+=`${n}${encodeURIComponent(e)}`,n="&");for(let r in s)null!==s[r]&&(i+=`${n}${r}=${encodeURIComponent(s[r])}`,n="&");return fetch(i).then(t=>t.json()).then(t=>Promise.resolve(t)).catch(t=>(We.error("Failed to load settings on",i),Promise.reject(t)))}spawnWorker(t,e,s,i,n=!1){try{if(window.Worker&&window.URL){let r=`${Me.URL_CLIENT}/static/javascripts/workers/${t}_${Me.REVISION}.js`,o=new window.XMLHttpRequest;o.open("GET",r,!0),o.responseType="blob",o.onload=()=>{try{let t=window.URL.createObjectURL(o.response),r=new window.Worker(t);r.addEventListener("message",e=>{try{s(e.data),!0===n&&(r.terminate(),window.URL.revokeObjectURL(t))}catch(i){We.error(i)}}),r.addEventListener("error",t=>{try{i(t.message||"Cannot spawn")}catch(e){We.error(e)}}),e(r,t)}catch(t){We.error(t),i(t)}},o.onerror=()=>{i(new Error("Could not load worker runtime"))},o.send()}else i(new Error("Workers are not supported"))}catch(r){We.error(r),i(r)}}spawnFeatureBundle(t,e,s,i){try{wu.partial.bundle.pending[t]=!0,e().then(e=>{s(e),wu.partial.bundle.pending[t]=!1}).catch(t=>{We.error(t),i(t)})}catch(n){wu.partial.bundle.pending[t]=!1,We.error(n)}}},na="ticket",ra=["token","expire","session"],oa=class extends Ge{constructor(t){super(),this.client=t,this.Kn()}reset(){this.Kn()}acquire(t,e){let s=()=>{let s=this.Yl(t);s.token?e({token:s.token}):e(null)};this.Ql!==t&&(this.Ql=t,this.Xl(t));let i=new Date;(this.Yl(t).refreshAfter||0)-i.getTime()<=0==!0?this.th(t,i,s):s()}th(t,e,s){this.eh.push(s),1===this.eh.length&&this.sh(t,e,()=>{for(;this.eh.length>0;)this.eh.shift()()})}sh(t,e,s){let i=`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}-${e.getHours()}-${e.getMinutes()}-${e.getSeconds()}`,n=`settings/session/${encodeURIComponent(t)}`;this.client.Partial.loadSettings(`${n}/challenge/`,i).then(i=>{this.ih(i.mint||{},r=>{let o={mint_signature:i.mint?.signature||null,mint_proof:r?.token||null,mint_cost:r?.duration||null};this.client.Partial.loadSettings(`${n}/ticket/`,null,o).then(i=>{i.token&&this.nh(t,i,e),s()}).catch(()=>{s()})})}).catch(()=>{s()})}ih(t,e){try{if(1!==t.version)throw new Error(`Mint version unsupported: V${t.version||0}`);this.rh(t.vector,e)}catch(s){We.error(s),e(null,s)}}rh(t,e){try{this.client.Partial.spawnWorker("ticket",e=>{e.postMessage({action:"mint",data:t})},t=>{e(t)},s=>{setTimeout(()=>{this.oh(t,e)},0)},!0)}catch(s){We.error(s)}}oh(t,e){try{xo(()=>import("./mint_default_2a24f89.js").then(s=>{e(s.default.mint(t,yr.sha256))}),__vite__mapDeps([0,1]))}catch(s){We.error(s),e(null,s)}}Xl(t){let e={};for(let s=0;s{wu.state.propagate("trigger",s,wu.base.session_id,!1,!0,s=>{!0===s&&!0===this.Th(e)&&!0===this.Lh(t,e)&&yr.Trigger.fired(t,e.name)})})}else{let s=this.Mh(e);null!==s&&this.Lh(t,e,s)}}Lh(t,e,s=null){let i=!1,n=s||e.actions||null;if(null!==n){let s;for(let r in n)s=n[r],!0===s.enabled&&!0===this.Uh(t,e,r,s)&&(i=!0)}return i}Uh(t,e,s,i){let n=this.Fh[s],r=!1;return"function"==typeof n?(ua(n,this)(t,e,i.settings||{}),r=!0):We.error(`Did not execute ${s} action for trigger: ${t} because: no such action processor`),r}Ph(t){this.client.Base.ensureSocket().then(()=>{!0!==this.qh?(this.qh=!0,this.client.Chat.startMinimized(t)):t()})}Th(t){let e=!1;if(e=!1===wu.base.is_invisible,!0===this.Vh(t,"if_website_online")&&(e=!0===this.client.Action.is_website_available()&&e),!0===this.Vh(t,"if_first_visit")&&(e="1"===yr.Storage.getStampLocal(ha,this.Nh("count"))&&e),!0===this.Vh(t,"if_trigger_sole")&&(e=!0!==wu.messages.conversation.has_messages&&e),!0===this.Vh(t,"if_countries")){let s=!1,i=t.behaviors.if_countries?.settings,n=wu.website.chat.country;if(i)for(let t in i)t===n&&(s=!0);e=!0===s&&e}return!1===wu.base.is_mobile_view&&!1===this.Hh(t,"desktop")&&(e=!1),wu.base.is_mobile_view&&!1===this.Hh(t,"mobile")&&(e=!1),e}Mh(t){let e=null;if(t.actions){let s;for(let i in t.actions)s=t.actions[i],!0===s.enabled&&!0===la.includes(i)&&(null===e&&(e={}),e[i]=s)}return e}Wh(t=!1,e={}){let s=100;return!0===t&&e.after&&e.after>0&&(s=1e3*e.after),s}dh(t,e,s,i){if(i.after&&i.after>0){let n=!1;for(let t in s)if("delay"!==t&&!0===s[t].enabled){n=!0;break}!1===n&&this.Jh(t,e,{enabled:!0,settings:i})}}Dh(t,e,s){let i=!0;for(let n=0;n{!0===this.Kh&&!i.relatedTarget&&!i.toElement&&i.clientY<=this.Zh&&(this.Kh=!1,null===this.Yh&&(this.Yh=this.Jh(t,e,s.delay)))}),xr.removeEventListener("window","mouseover",this.Qh),this.Qh=xr.addEventListener("window","mouseover",()=>{!0!==this.Kh&&(this.Kh=!0,null!==this.Yh&&(xr.clearTimeout(this.Yh),this.Yh=null))}))}fh(t,e,s,i){i.ids?.length>0&&(this.Xh&&xr.removeEventListener("document","click",this.Xh),this.Xh=xr.addEventListener("document","click",n=>{try{if(n?.target&&"a"===(n.target.nodeName||"").toLowerCase())for(let r=0;r0)for(let t=0;t0&&this.tc("user_data",n=>{let r=`${n.value}`;n.key&&r&&`${i.points[n.key]}`===r&&this.Jh(t,e,s.delay)})}gh(t,e,s,i){i.texts?.length>0&&this.tc("user_event",n=>{i.texts.includes(n.text)&&this.Jh(t,e,s.delay)})}wh(t,e,s){if(s){let i=(s[wu.locale.code]||s.default||"").trim();if(i){let s=xr.toHashCode(`trigger/${t}`),n=!1;!0===this.Vh(e,"show_as_website")&&(n=!0),this.client.Action.do_message_show("text",i,s,n)}}}yh(t,e){this.client.Action.do_chat_open()}bh(t,e){Mo.start("events","chat-message-receive")}Eh(t,e,s){s&&this.Rh(s)}kh(t){let e=!1,s=t.page?.settings;return s?.urls?.length>0&&(e=xr.comparePageRules(wu.base.page_url,s.urls)),e}$h(t){let e=!1,s=t.url_parameter?.settings||{};if(xr.keys(s.parameters||{}).length>0){let t=document.location.search||"",i=t.slice(t.indexOf("?")+1).split("&"),n={};for(let e=0;e{this.Ih(t,e)},this.Wh(s?.enabled,s?.settings)),i}tc(t,e){this.Sh[t]=this.Sh[t]||[],this.Sh[t].push(e)}Vh(t,e){return!0===t.behaviors?.[e]?.enabled}zh(t){let e=this._processed.includes(t)&&!0;return!0!==e&&(e="1"===yr.Storage.getStampLocal(ha,[wu.base.website.id,"status",t])&&!0),e}Hh(t,e){return!1!==t.platforms?.[e]?.enabled}Rh(t={}){let e=t[wu.locale.code]||t.default||[];wu.chat.quick_replies.choices=e}Oh(){let t=this.Nh("last"),e=this.Nh("count"),s=parseInt(yr.Storage.getStampLocal(ha,t)||"0",10),i=parseInt(yr.Storage.getStampLocal(ha,e)||"0",10),n=(new Date).getTime();(isNaN(s)||isNaN(i)||i<=0||n-s>=18e5)&&(i+=1,s=n,yr.Storage.setStampLocal(ha,e,`${i}`)),yr.Storage.setStampLocal(ha,t,`${n}`)}Nh(t){return[wu.base.website.id,"visit",t]}Kn(){this._processed=[],this.Ah=null,this.Bh=null,this.qh=!1,this.Kh=!1,this.Yh=null,this.Zh=10,this.Xh=null,this.Gh=null,this.Qh=null,this.Sh={}}},da=(new class{constructor(){t=this,this.Partial=new ia(this),this.Action=new zu(this),this.Ticket=new oa(this),this.Broker=new sa(this),this.Event=new Hu(this),this.Trigger=new ca(this),this.Base=new ea(this),this.Minimized=new Zu(this),this.Chat=new Ku(this),function(t){try{var e={push:qu(Uu.push,Uu),get:qu(Uu.get,Uu),set:qu(Uu.set,Uu),is:qu(Uu.is,Uu),on:qu(Uu.on,Uu),off:qu(Uu.off,Uu),do:qu(Uu.do,Uu),config:qu(Uu.config,Uu),safe:qu(Uu.safe,Uu),help:qu(Uu.help,Uu)};if(Object.defineProperty(e,"__init",{enumerable:!1,value:qu(t.Base.init,t.Base)}),Object.defineProperty(e,"__spool",{enumerable:!1,value:{}}),Object.defineProperty(e,"__debug",{enumerable:!1,value:{}}),t._dollarCrisp=e,t.__spool=e.__spool,t.__debug=e.__debug,e.__spool.pending_actions=[],"object"==typeof window.$crisp&&window.$crisp.length>0)for(var s=0;s{const s=t.ec||t;for(const[i,n]of e)s[i]=n;return s});export{U as $,Ct as A,ke as B,Se as C,e as Ct,$e as D,we as E,kt as F,r as G,Pe as H,_e as I,o as J,n as K,Lt as L,pe as M,me as N,ve as O,Ae as P,h as Q,be as R,ht as S,T as St,Fe as T,zt as U,Tt as V,ze as W,O as X,I as Y,L as Z,Ti as _,M as _t,nu as a,F as at,Me as b,c as bt,xo as c,a as ct,Ur as d,m as dt,D as et,Tr as f,K as ft,yr as g,Q as gt,xr as h,Y as ht,vu as i,f as it,je as j,Ee as k,Co as l,b as lt,Ir as m,v as mt,bu as n,Z as nt,tu as o,l as ot,Or as p,w as pt,u as q,wu as r,P as rt,Mo as s,y as st,da as t,R as tt,qr as u,B as ut,Ge as v,J as vt,ye as w,ot as x,et as xt,We as y,q as yt,Ce as z};