@talkjs/web-components 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +1 -1
- package/default.css +1 -1
- package/default.js +1 -1
- package/default.standalone.js +1 -1
- package/package.json +1 -1
- package/theming.js +1 -1
package/default.standalone.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var TalkChatbox=function(e){"use strict";var t,n,r,i,o,s,a,u,l,c,d,h,p={},f=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,E=Array.isArray;function g(e,t){for(var n in t)e[n]=t[n];return e}function _(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function A(e,n,r){var i,o,s,a={};for(s in n)"key"==s?i=n[s]:"ref"==s?o=n[s]:a[s]=n[s];if(arguments.length>2&&(a.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)null==a[s]&&(a[s]=e.defaultProps[s]);return D(e,a,i,o,null)}function D(e,t,i,o,s){var a={type:e,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++r:s,__i:-1,__u:0};return null==s&&null!=n.vnode&&n.vnode(a),a}function v(){return{current:null}}function O(e){return e.children}function T(e,t){this.props=e,this.context=t}function S(e,t){if(null==t)return e.__?S(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?S(e):null}function y(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return y(e)}}function C(e){(!e.__d&&(e.__d=!0)&&i.push(e)&&!N.__r++||o!=n.debounceRendering)&&((o=n.debounceRendering)||s)(N)}function N(){for(var e,t,r,o,s,u,l,c=1;i.length;)i.length>c&&i.sort(a),e=i.shift(),c=i.length,e.__d&&(r=void 0,s=(o=(t=e).__v).__e,u=[],l=[],t.__P&&((r=g({},o)).__v=o.__v+1,n.vnode&&n.vnode(r),M(t.__P,r,o,t.__n,t.__P.namespaceURI,32&o.__u?[s]:null,u,null==s?S(o):s,!!(32&o.__u),l),r.__v=o.__v,r.__.__k[r.__i]=r,F(u,r,l),r.__e!=s&&y(r)));N.__r=0}function b(e,t,n,r,i,o,s,a,u,l,c){var d,h,m,g,_,A,v=r&&r.__k||f,T=t.length;for(u=function(e,t,n,r,i){var o,s,a,u,l,c=n.length,d=c,h=0;for(e.__k=new Array(i),o=0;o<i;o++)null!=(s=t[o])&&"boolean"!=typeof s&&"function"!=typeof s?(u=o+h,(s=e.__k[o]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?D(null,s,null,null,null):E(s)?D(O,{children:s},null,null,null):null==s.constructor&&s.__b>0?D(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,-1!=(l=s.__i=w(s,n,u,d))&&(d--,(a=n[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(i>c?h--:i<c&&h++),"function"!=typeof s.type&&(s.__u|=4)):l!=u&&(l==u-1?h--:l==u+1?h++:(l>u?h--:h++,s.__u|=4))):e.__k[o]=null;if(d)for(o=0;o<c;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==r&&(r=S(a)),U(a,a));return r}(n,t,v,u,T),d=0;d<T;d++)null!=(m=n.__k[d])&&(h=-1==m.__i?p:v[m.__i]||p,m.__i=d,A=M(e,m,h,i,o,s,a,u,l,c),g=m.__e,m.ref&&h.ref!=m.ref&&(h.ref&&P(h.ref,null,m),c.push(m.ref,m.__c||g,m)),null==_&&null!=g&&(_=g),4&m.__u||h.__k===m.__k?u=I(m,u,e):"function"==typeof m.type&&void 0!==A?u=A:g&&(u=g.nextSibling),m.__u&=-7);return n.__e=_,u}function I(e,t,n){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=I(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=S(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function R(e,t){return t=t||[],null==e||"boolean"==typeof e||(E(e)?e.some((function(e){R(e,t)})):t.push(e)),t}function w(e,t,n,r){var i,o,s=e.key,a=e.type,u=t[n];if(null===u&&null==e.key||u&&s==u.key&&a==u.type&&!(2&u.__u))return n;if(r>(null==u||2&u.__u?0:1))for(i=n-1,o=n+1;i>=0||o<t.length;){if(i>=0){if((u=t[i])&&!(2&u.__u)&&s==u.key&&a==u.type)return i;i--}if(o<t.length){if((u=t[o])&&!(2&u.__u)&&s==u.key&&a==u.type)return o;o++}}return-1}function k(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||m.test(t)?n:n+"px"}function L(e,t,n,r,i){var o,s;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||k(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||k(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(u,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=l,e.addEventListener(t,o?d:c,o)):e.removeEventListener(t,o?d:c,o);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function x(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=l++;else if(t.t<r.u)return;return r(n.event?n.event(t):t)}}}function M(e,r,i,o,s,a,u,l,c,d){var h,f,m,A,D,v,y,C,N,I,R,w,k,x,M,F,P,U=r.type;if(null!=r.constructor)return null;128&i.__u&&(c=!!(32&i.__u),a=[l=r.__e=i.__e]),(h=n.__b)&&h(r);e:if("function"==typeof U)try{if(C=r.props,N="prototype"in U&&U.prototype.render,I=(h=U.contextType)&&o[h.__c],R=h?I?I.props.value:h.__:o,i.__c?y=(f=r.__c=i.__c).__=f.__E:(N?r.__c=f=new U(C,R):(r.__c=f=new T(C,R),f.constructor=U,f.render=H),I&&I.sub(f),f.props=C,f.state||(f.state={}),f.context=R,f.__n=o,m=f.__d=!0,f.__h=[],f._sb=[]),N&&null==f.__s&&(f.__s=f.state),N&&null!=U.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=g({},f.__s)),g(f.__s,U.getDerivedStateFromProps(C,f.__s))),A=f.props,D=f.state,f.__v=r,m)N&&null==U.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),N&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(N&&null==U.getDerivedStateFromProps&&C!==A&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(C,R),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(C,f.__s,R)||r.__v==i.__v){for(r.__v!=i.__v&&(f.props=C,f.state=f.__s,f.__d=!1),r.__e=i.__e,r.__k=i.__k,r.__k.some((function(e){e&&(e.__=r)})),w=0;w<f._sb.length;w++)f.__h.push(f._sb[w]);f._sb=[],f.__h.length&&u.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(C,f.__s,R),N&&null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(A,D,v)}))}if(f.context=R,f.props=C,f.__P=e,f.__e=!1,k=n.__r,x=0,N){for(f.state=f.__s,f.__d=!1,k&&k(r),h=f.render(f.props,f.state,f.context),M=0;M<f._sb.length;M++)f.__h.push(f._sb[M]);f._sb=[]}else do{f.__d=!1,k&&k(r),h=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++x<25);f.state=f.__s,null!=f.getChildContext&&(o=g(g({},o),f.getChildContext())),N&&!m&&null!=f.getSnapshotBeforeUpdate&&(v=f.getSnapshotBeforeUpdate(A,D)),F=h,null!=h&&h.type===O&&null==h.key&&(F=B(h.props.children)),l=b(e,E(F)?F:[F],r,i,o,s,a,u,l,c,d),f.base=r.__e,r.__u&=-161,f.__h.length&&u.push(f),y&&(f.__E=f.__=null)}catch(e){if(r.__v=null,c||null!=a)if(e.then){for(r.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,r.__e=l}else for(P=a.length;P--;)_(a[P]);else r.__e=i.__e,r.__k=i.__k;n.__e(e,r,i)}else null==a&&r.__v==i.__v?(r.__k=i.__k,r.__e=i.__e):l=r.__e=function(e,r,i,o,s,a,u,l,c){var d,h,f,m,g,A,D,v=i.props,O=r.props,T=r.type;if("svg"==T?s="http://www.w3.org/2000/svg":"math"==T?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=a)for(d=0;d<a.length;d++)if((g=a[d])&&"setAttribute"in g==!!T&&(T?g.localName==T:3==g.nodeType)){e=g,a[d]=null;break}if(null==e){if(null==T)return document.createTextNode(O);e=document.createElementNS(s,T,O.is&&O),l&&(n.__m&&n.__m(r,a),l=!1),a=null}if(null==T)v===O||l&&e.data==O||(e.data=O);else{if(a=a&&t.call(e.childNodes),v=i.props||p,!l&&null!=a)for(v={},d=0;d<e.attributes.length;d++)v[(g=e.attributes[d]).name]=g.value;for(d in v)if(g=v[d],"children"==d);else if("dangerouslySetInnerHTML"==d)f=g;else if(!(d in O)){if("value"==d&&"defaultValue"in O||"checked"==d&&"defaultChecked"in O)continue;L(e,d,null,g,s)}for(d in O)g=O[d],"children"==d?m=g:"dangerouslySetInnerHTML"==d?h=g:"value"==d?A=g:"checked"==d?D=g:l&&"function"!=typeof g||v[d]===g||L(e,d,g,v[d],s);if(h)l||f&&(h.__html==f.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),r.__k=[];else if(f&&(e.innerHTML=""),b("template"==r.type?e.content:e,E(m)?m:[m],r,i,o,"foreignObject"==T?"http://www.w3.org/1999/xhtml":s,a,u,a?a[0]:i.__k&&S(i,0),l,c),null!=a)for(d=a.length;d--;)_(a[d]);l||(d="value","progress"==T&&null==A?e.removeAttribute("value"):null!=A&&(A!==e[d]||"progress"==T&&!A||"option"==T&&A!=v[d])&&L(e,d,A,v[d],s),d="checked",null!=D&&D!=e[d]&&L(e,d,D,v[d],s))}return e}(i.__e,r,i,o,s,a,u,c,d);return(h=n.diffed)&&h(r),128&r.__u?void 0:l}function F(e,t,r){for(var i=0;i<r.length;i++)P(r[i],r[++i],r[++i]);n.__c&&n.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){n.__e(e,t.__v)}}))}function B(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:E(e)?e.map(B):g({},e)}function P(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){n.__e(e,r)}}function U(e,t,r){var i,o;if(n.unmount&&n.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||P(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){n.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&U(i[o],t,r||"function"!=typeof e.type);r||_(e.__e),e.__c=e.__=e.__e=void 0}function H(e,t,n){return this.constructor(e,n)}function j(e,r,i){var o,s,a,u;r==document&&(r=document.documentElement),n.__&&n.__(e,r),s=(o="function"==typeof i)?null:i&&i.__k||r.__k,a=[],u=[],M(r,e=(!o&&i||r).__k=A(O,null,[e]),s||p,p,r.namespaceURI,!o&&i?[i]:s?null:r.firstChild?t.call(r.childNodes):null,a,!o&&i?i:s?s.__e:r.firstChild,o,u),F(a,e,u)}function $(e,t){j(e,t,$)}function Y(e,n,r){var i,o,s,a,u=g({},e.props);for(s in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),n)"key"==s?i=n[s]:"ref"==s?o=n[s]:u[s]=null==n[s]&&null!=a?a[s]:n[s];return arguments.length>2&&(u.children=arguments.length>3?t.call(arguments,2):r),D(e.type,u,i||e.key,o||e.ref,null)}function z(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach((function(e){e.__e=!0,C(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+h++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}t=f.slice,n={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},r=0,T.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=g({},this.state),"function"==typeof e&&(e=e(g({},n),this.props)),e&&g(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),C(this))},T.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},T.prototype.render=O,i=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,a=function(e,t){return e.__v.__b-t.__v.__b},N.__r=0,u=/(PointerCapture)$|Capture$/i,l=0,c=x(!1),d=x(!0),h=0;var V,G,W,X,K=0,q=[],J=n,Z=J.__b,Q=J.__r,ee=J.diffed,te=J.__c,ne=J.unmount,re=J.__;function ie(e,t){J.__h&&J.__h(G,e,K||t),K=0;var n=G.__H||(G.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function oe(e){return K=1,se(Oe,e)}function se(e,t,n){var r=ie(V++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Oe(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=G,!G.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(e){return!!e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=r.__c.props!==e;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),o&&o.call(this,e,t,n)||s};G.__f=!0;var o=G.shouldComponentUpdate,s=G.componentWillUpdate;G.componentWillUpdate=function(e,t,n){if(this.__e){var r=o;o=void 0,i(e,t,n),o=r}s&&s.call(this,e,t,n)},G.shouldComponentUpdate=i}return r.__N||r.__}function ae(e,t){var n=ie(V++,3);!J.__s&&ve(n.__H,t)&&(n.__=e,n.u=t,G.__H.__h.push(n))}function ue(e,t){var n=ie(V++,4);!J.__s&&ve(n.__H,t)&&(n.__=e,n.u=t,G.__h.push(n))}function le(e){return K=5,de((function(){return{current:e}}),[])}function ce(e,t,n){K=6,ue((function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}}),null==n?n:n.concat(e))}function de(e,t){var n=ie(V++,7);return ve(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function he(e,t){return K=8,de((function(){return e}),t)}function pe(e){var t=G.context[e.__c],n=ie(V++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(G)),t.props.value):e.__}function fe(e,t){J.useDebugValue&&J.useDebugValue(t?t(e):e)}function me(){var e=ie(V++,11);if(!e.__){for(var t=G.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Ee(){for(var e;e=q.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ae),e.__H.__h.forEach(De),e.__H.__h=[]}catch(t){e.__H.__h=[],J.__e(t,e.__v)}}J.__b=function(e){G=null,Z&&Z(e)},J.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),re&&re(e,t)},J.__r=function(e){Q&&Q(e),V=0;var t=(G=e.__c).__H;t&&(W===G?(t.__h=[],G.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(Ae),t.__h.forEach(De),t.__h=[],V=0)),W=G},J.diffed=function(e){ee&&ee(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==q.push(t)&&X===J.requestAnimationFrame||((X=J.requestAnimationFrame)||_e)(Ee)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),W=G=null},J.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Ae),e.__h=e.__h.filter((function(e){return!e.__||De(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],J.__e(n,e.__v)}})),te&&te(e,t)},J.unmount=function(e){ne&&ne(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Ae(e)}catch(e){t=e}})),n.__H=void 0,t&&J.__e(t,n.__v))};var ge="function"==typeof requestAnimationFrame;function _e(e){var t,n=function(){clearTimeout(r),ge&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);ge&&(t=requestAnimationFrame(n))}function Ae(e){var t=G,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),G=t}function De(e){var t=G;e.__c=e.__(),G=t}function ve(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Oe(e,t){return"function"==typeof t?t(e):t}function Te(e,t){for(var n in t)e[n]=t[n];return e}function Se(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function ye(e,t){var n=t(),r=oe({t:{__:n,u:t}}),i=r[0].t,o=r[1];return ue((function(){i.__=n,i.u=t,Ce(i)&&o({t:i})}),[e,n,t]),ae((function(){return Ce(i)&&o({t:i}),e((function(){Ce(i)&&o({t:i})}))}),[e]),n}function Ce(e){var t,n,r=e.u,i=e.__;try{var o=r();return!((t=i)===(n=o)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}function Ne(e){e()}function be(e){return e}function Ie(){return[!1,Ne]}var Re=ue;function we(e,t){this.props=e,this.context=t}function ke(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:Se(this.props,e)}function r(t){return this.shouldComponentUpdate=n,A(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(we.prototype=new T).isPureReactComponent=!0,we.prototype.shouldComponentUpdate=function(e,t){return Se(this.props,e)||Se(this.state,t)};var Le=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Le&&Le(e)};var xe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Me(e){function t(t){var n=Te({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=xe,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Fe=function(e,t){return null==e?null:R(R(e).map(t))},Be={map:Fe,forEach:Fe,count:function(e){return e?R(e).length:0},only:function(e){var t=R(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:R},Pe=n.__e;n.__e=function(e,t,n,r){if(e.then)for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t);Pe(e,t,n,r)};var Ue=n.unmount;function He(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=Te({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return He(e,t,n)}))),e}function je(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return je(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function $e(){this.__u=0,this.o=null,this.__b=null}function Ye(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ze(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return A(n,i)}return i.displayName="Lazy",i.__f=!0,i}function Ve(){this.i=null,this.l=null}n.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ue&&Ue(e)},($e.prototype=new T).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var i=Ye(r.__v),o=!1,s=function(){o||(o=!0,n.__R=null,i?i(a):a())};n.__R=s;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=je(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},$e.prototype.componentWillUnmount=function(){this.o=[]},$e.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=He(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&A(O,null,e.fallback);return i&&(i.__u&=-33),[A(O,null,t.__a?null:e.children),i]};var Ge=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function We(e){return this.getChildContext=function(){return e.context},e.children}function Xe(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){j(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;null!==r&&!r.__m&&null!==r.__;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}j(A(We,{context:t.context},e.__v),t.v)}function Ke(e,t){var n=A(Xe,{__v:e,h:t});return n.containerInfo=t,n}(Ve.prototype=new T).__a=function(e){var t=this,n=Ye(t.__v),r=t.l.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),Ge(t,e,r)):i()};n?n(o):o()}},Ve.prototype.render=function(e){this.i=null,this.l=new Map;var t=R(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ve.prototype.componentDidUpdate=Ve.prototype.componentDidMount=function(){var e=this;this.l.forEach((function(t,n){Ge(e,n,t)}))};var qe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Je=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ze=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Qe=/[A-Z0-9]/g,et="undefined"!=typeof document,tt=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function nt(e,t,n){return null==t.__k&&(t.textContent=""),j(e,t),"function"==typeof n&&n(),e?e.__c:null}function rt(e,t,n){return $(e,t),"function"==typeof n&&n(),e?e.__c:null}T.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(T.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var it=n.event;function ot(){}function st(){return this.cancelBubble}function at(){return this.defaultPrevented}n.event=function(e){return it&&(e=it(e)),e.persist=ot,e.isPropagationStopped=st,e.isDefaultPrevented=at,e.nativeEvent=e};var ut,lt={enumerable:!1,configurable:!0,get:function(){return this.class}},ct=n.vnode;n.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},i=-1===n.indexOf("-");for(var o in t){var s=t[o];if(!("value"===o&&"defaultValue"in t&&null==s||et&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===s?s="":"translate"===a&&"no"===s?s=!1:"o"===a[0]&&"n"===a[1]?"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||tt(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":Ze.test(o)&&(o=a):a=o="oninput":i&&Je.test(o)?o=o.replace(Qe,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=s}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=R(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=R(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",lt)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=qe,ct&&ct(e)};var dt=n.__r;n.__r=function(e){dt&&dt(e),ut=e.__c};var ht=n.diffed;n.diffed=function(e){ht&&ht(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),ut=null};var pt={ReactCurrentDispatcher:{current:{readContext:function(e){return ut.__n[e.__c].props.value},useCallback:he,useContext:pe,useDebugValue:fe,useDeferredValue:be,useEffect:ae,useId:me,useImperativeHandle:ce,useInsertionEffect:Re,useLayoutEffect:ue,useMemo:de,useReducer:se,useRef:le,useState:oe,useSyncExternalStore:ye,useTransition:Ie}}};function ft(e){return A.bind(null,e)}function mt(e){return!!e&&e.$$typeof===qe}function Et(e){return mt(e)&&e.type===O}function gt(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function _t(e){return mt(e)?Y.apply(null,arguments):e}function At(e){return!!e.__k&&(j(null,e),!0)}function Dt(e){return e&&(e.base||1===e.nodeType&&e)||null}var vt=function(e,t){return e(t)},Ot=function(e,t){return e(t)},Tt=O,St=mt,yt={useState:oe,useId:me,useReducer:se,useEffect:ae,useLayoutEffect:ue,useInsertionEffect:Re,useTransition:Ie,useDeferredValue:be,useSyncExternalStore:ye,startTransition:Ne,useRef:le,useImperativeHandle:ce,useMemo:de,useCallback:he,useContext:pe,useDebugValue:fe,version:"18.3.1",Children:Be,render:nt,hydrate:rt,unmountComponentAtNode:At,createPortal:Ke,createElement:A,createContext:z,createFactory:ft,cloneElement:_t,createRef:v,Fragment:O,isValidElement:mt,isElement:St,isFragment:Et,isMemo:gt,findDOMNode:Dt,Component:T,PureComponent:we,memo:ke,forwardRef:Me,flushSync:Ot,unstable_batchedUpdates:vt,StrictMode:Tt,Suspense:$e,SuspenseList:Ve,lazy:ze,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:pt};const Ct=Object.freeze(Object.defineProperty({__proto__:null,Children:Be,Component:T,Fragment:O,PureComponent:we,StrictMode:Tt,Suspense:$e,SuspenseList:Ve,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:pt,cloneElement:_t,createContext:z,createElement:A,createFactory:ft,createPortal:Ke,createRef:v,default:yt,findDOMNode:Dt,flushSync:Ot,forwardRef:Me,hydrate:rt,isElement:St,isFragment:Et,isMemo:gt,isValidElement:mt,lazy:ze,memo:ke,render:nt,startTransition:Ne,unmountComponentAtNode:At,unstable_batchedUpdates:vt,useCallback:he,useContext:pe,useDebugValue:fe,useDeferredValue:be,useEffect:ae,useErrorBoundary:function(e){var t=ie(V++,10),n=oe();return t.__=e,G.componentDidCatch||(G.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]},useId:me,useImperativeHandle:ce,useInsertionEffect:Re,useLayoutEffect:ue,useMemo:de,useReducer:se,useRef:le,useState:oe,useSyncExternalStore:ye,useTransition:Ie,version:"18.3.1"},Symbol.toStringTag,{value:"Module"}));var Nt=0;function bt(e,t,r,i,o,s){t||(t={});var a,u,l=t;if("ref"in l)for(u in l={},t)"ref"==u?a=t[u]:l[u]=t[u];var c={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Nt,__i:-1,__u:0,__source:o,__self:s};if("function"==typeof e&&(a=e.defaultProps))for(u in a)void 0===l[u]&&(l[u]=a[u]);return n.vnode&&n.vnode(c),c}const It=z(null),Rt={didCatch:!1,error:null};class wt extends T{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Rt}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:i,reason:"imperative-api"}),this.setState(Rt)}}componentDidCatch(e,t){var n,r;null===(n=(r=this.props).onError)||void 0===n||n.call(r,e,t)}componentDidUpdate(e,t){const{didCatch:n}=this.state,{resetKeys:r}=this.props;var i,o;n&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some(((e,n)=>!Object.is(e,t[n])))}(e.resetKeys,r)&&(null===(i=(o=this.props).onReset)||void 0===i||i.call(o,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(Rt))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:o}=this.state;let s=e;if(i){const e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)s=t(e);else if(n)s=A(n,e);else{if(void 0===r)throw o;s=r}}return A(It.Provider,{value:{didCatch:i,error:o,resetErrorBoundary:this.resetErrorBoundary}},s)}}var kt=Object.prototype.hasOwnProperty;function Lt(e){return Array.isArray(e)}function xt(e){return!(!e||"object"!=typeof e||e instanceof Date||Lt(e))}function Mt(e){return"function"==typeof e}function Ft(e){const t=typeof e;return void 0!==e&&(Bt(e)||"object"!==t&&"function"!==t)}function Bt(e){return e instanceof Date}function Pt(e){return"boolean"==typeof e}function Ut(e){return e instanceof Promise}function Ht(e){return e instanceof Map}function jt(e){if(!e)return!1;if(Lt(e))return 0===e.length;for(const t in e)if(kt.call(e,t))return!1;return!0}function $t(e){return null==e}var Yt=new Set(["boolean","string","number"]);function zt(e){return!!e.parent}var Vt=Symbol.toPrimitive,Gt=Symbol("getNode"),Wt=Symbol("delete"),Xt=Symbol("opaque"),Kt=Symbol("optimized"),qt=Symbol("linked"),Jt={isLoadingLocal:!1,isMerging:!1,isLoadingRemote:!1,activateSyncedNode:void 0,pendingNodes:new Map,dirtyNodes:new Set,replacer:void 0,reviver:void 0};function Zt(e){return Lt(e)?"array":Ht(e)?"map":e instanceof Set?"set":"object"}function Qt(e,t){return Ht(t)?{__LSType:"Map",value:Array.from(t.entries())}:t instanceof Set?{__LSType:"Set",value:Array.from(t)}:(Jt.replacer&&(t=Jt.replacer(e,t)),t)}var en=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/;function tn(e,t){if(t){if("string"==typeof t&&en.test(t))return new Date(t);if("object"==typeof t){if("Map"===t.__LSType)return new Map(t.value);if("Set"===t.__LSType)return new Set(t.value)}Jt.reviver&&(t=Jt.reviver(e,t))}return t}function nn(e){return e?JSON.stringify(e,Qt):e}function rn(e){return e?JSON.parse(e,tn):e}function on(e){return rn(nn(e))}function sn(e){return!!e&&!!e[Gt]}function an(e){return e&&e[Gt]}function un(e,t){var n,r,i;const o=null!=(n=e.parent)?n:e,s=e.parent?e.key:"_",a=t===Wt;a&&(t=void 0);const u=e.parent?hn(o):o.root,l=u[s],c=Mt(t);if(t=o.isAssigning||!c||Mt(l)?t:t(l),!Jt.isMerging||$t(l)||Mt(l)||!(null==(i=null==(r=e.parent)?void 0:r.functions)?void 0:i.get(s)))try{o.isSetting=(o.isSetting||0)+1;const e=Ht(u);a?e?u.delete(s):delete u[s]:Ht(u)?u.set(s,t):u[s]=t}finally{o.isSetting--}return{prevValue:l,newValue:t}}var ln=[];function cn(e){let t=0,n=e;for(;zt(n);)ln[t++]=n.key,n=n.parent;let r=e.root._;for(let i=t-1;r&&i>=0;i--){const e=ln[i];r="size"!==e&&(Ht(r)||r instanceof WeakMap)?r.get(e):r[e]}return r}function dn(e,t,n){var r,i;let o=null==(r=e.children)?void 0:r.get(t);return o||(o={root:e.root,parent:e,key:t,lazy:!0,numListenersRecursive:0},1===(null==(i=e.lazyFn)?void 0:i.length)&&(n=e.lazyFn.bind(e,t)),Mt(n)&&(o=Object.assign((()=>{}),o),o.lazyFn=n),e.children||(e.children=new Map),e.children.set(t,o)),o}function hn(e){let t=cn(e);return t&&!Mt(t)||(t=zt(e)?hn(e.parent)[e.key]={}:e.root._={}),t}function pn(e,t){var n,r;let i=sn(e)?void 0:xt(e)?"id"in e?"id":"key"in e?"key":"_id"in e?"_id":"__id"in e?"__id":void 0:void 0;if(!i&&t.parent){const e=t.key+"_keyExtractor",o=null!=(r=null==(n=t.functions)?void 0:n.get(e))?r:cn(t.parent)[t.key+"_keyExtractor"];o&&Mt(o)&&(i=o)}return i}function fn(e,t,n){e.functions||(e.functions=new Map),e.functions.set(t,n)}function mn(e,t){return e===t||Bt(e)&&Bt(t)&&+e==+t}function En(e,t,n){let r=e;return!sn(r)&&Mt(r)&&(r=t?r(t):r()),sn(r)&&!n?r.get():r}function gn(e){return e&&(e[Xt]=!0),e}var _n,An=(e,t)=>e&&e[t];function Dn(e,t,n,r,i,o,s){let a,u=e;if(t.length>0){let i=o;for(let o=0;o<t.length;o++){if(a=t[o],u[a]===Wt)return i&&(u[a]=i[a],null==s||s(t.slice(0,o+1),u[a])),e;if(void 0===u[a]&&void 0===r&&o===t.length-1)return e;void 0!==u[a]&&null!==u[a]||(u[a]=On(n[o])),o<t.length-1&&(u=u[a],i&&(i=i[a]))}}return void 0===a?e="merge"===i?vn(e,r):r:"merge"===i?u[a]=vn(u[a],r):Ht(u)?u.set(a,r):u[a]=r,e}function vn(e,t,n){var r;sn(t)&&(t=t.peek());const i=sn(e),o=i?e.peek():e,s=Lt(o);if(!s&&xt(o)&&xt(t)&&!jt(o)||s&&o.length>0){const n=Object.keys(t);for(let o=0;o<n.length;o++){const s=n[o],a=t[s];if(a===Wt)i&&(null==(r=e[s])?void 0:r.delete)?e[s].delete():delete e[s];else{const t=xt(a),n=!t&&Lt(a),r=e[s];if(!t&&!n||!r||!i&&jt(r))if(i)r.set(a);else{const t=xt(a)?{...a}:Lt(a)?[...a]:a;e[s]=t}else i||r&&(t?xt(r):Lt(r))?vn(r,a):e[s]=a}}}else void 0!==t&&(i?e.set(t):e=t);return e}function On(e){switch(e){case"array":return[];case"object":return{};case"map":return new Map;case"set":return new Set}}function Tn(e,t,n){const{path:r,valueAtPath:i,prevAtPath:o,pathTypes:s}=t;return Dn(e,r,s,o)}var Sn=0,yn=!1,Cn=!1,Nn=new Map;function bn(){Nn.size>0&&Bn(!0)}function In(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Rn(e,t){return function(){return function(e,t){try{return function(e,t){for(let n=0;n<t.length;n++)e=Tn(e,t[n]);return e}(e?on(e):{},t)}catch(e){return}}(e,t)}}function wn(e,t,n,r,i){const o=new Map;kn(o,e,Jt.isLoadingLocal,Jt.isLoadingRemote,t,[],[],t,n,!0,r,i),o.size&&Ln(o,!0);const s=Nn.get(e);s?s.value=t:Nn.set(e,{value:t,prev:n,level:r,whenOptimizedOnlyIf:i,remote:Jt.isLoadingRemote,loading:Jt.isLoadingLocal}),Sn<=0&&xn()}function kn(e,t,n,r,i,o,s,a,u,l,c,d){if(function(e,t,n,r,i,o,s,a,u,l,c,d){if(l?t.listenersImmediate:t.listeners){const l={path:o,pathTypes:s,valueAtPath:a,prevAtPath:u},h=e.get(t);if(h&&o.length>0){const{changes:e}=h;In(e[0].path,l.path)||e.push(l)}else e.set(t,{level:c,value:i,remote:r,loading:n,whenOptimizedOnlyIf:d,changes:[l]})}}(e,t,n,r,i,o,s,a,u,l,c,d),t.linkedFromNodes)for(const h of t.linkedFromNodes)kn(e,Pn(h,o),n,r,a,[],[],a,u,l,0,d);if(t.parent){const h=t.parent;h&&kn(e,h,n,r,cn(h),[t.key].concat(o),[Zt(i)].concat(s),a,u,l,c+1,d)}}function Ln(e,t){const n=new Set;e.forEach((({changes:e,level:r,value:i,loading:o,remote:s,whenOptimizedOnlyIf:a},u)=>{const l=t?u.listenersImmediate:u.listeners;if(l){let t;const u=Array.from(l);for(let l=0;l<u.length;l++){const c=u[l],{track:d,noArgs:h,listener:p}=c;n.has(p)||(!0===d?r<=0:d!==Kt||a&&r<=0)&&(h||t||(t={value:i,loading:o,remote:s,getPrevious:Rn(i,e),changes:e}),d||n.add(p),p(t))}}}))}function xn(){const e=Array.from(Jt.dirtyNodes);Jt.dirtyNodes.clear(),e.forEach((e=>{const t=e.dirtyFn;t&&(e.dirtyFn=void 0,t())}));const t=Nn;Nn=new Map;const n=new Map;t.forEach((({value:e,prev:t,level:r,loading:i,remote:o,whenOptimizedOnlyIf:s},a)=>{kn(n,a,i,o,e,[],[],e,t,!1,r,s)})),n.size&&Ln(n,!1)}function Mn(e){Fn();try{e()}finally{Bn()}}function Fn(){Sn++,_n||(_n=setTimeout(bn,0))}function Bn(e){(--Sn<=0||e)&&(yn?Cn=!0:(_n&&(clearTimeout(_n),_n=void 0),Sn=0,yn=!0,xn(),yn=!1,Cn&&(Cn=!1,Bn(!0))))}function Pn(e,t){let n=e;for(let r=0;r<t.length;r++)n=dn(n,t[r]);return n}function Un(e,t,n,r,i){if(sn(e))return e;const o=Ut(e);let s={root:{_:e},lazy:!0,numListenersRecursive:0};var a;Mt(e)&&(s=Object.assign((()=>{}),s),s.lazyFn=e);const u=(a=e,Yt.has(typeof a)?new i(s):r(s));return o&&(un(s,void 0),n(s,e)),u}function Hn(e,t,n={},r){var i;const{initial:o,immediate:s,noArgs:a}=n,{trackingType:u}=n;let l=s?e.listenersImmediate:e.listeners;l||(l=new Set,s?e.listenersImmediate=l:e.listeners=l);const c={listener:t,track:u,noArgs:a};if(l.add(c),o){const n=cn(e);t({value:n,loading:!0,remote:!1,changes:[{path:[],pathTypes:[],prevAtPath:n,valueAtPath:n}],getPrevious:()=>{}})}let d;function h(i,o=t,s){if(!(null==r?void 0:r.has(i))){r||(r=new Set),r.add(s||e),o||(o=t);const a={trackingType:!0,...n};d=[...d||[],Hn(i,o,a,r)]}}e.linkedToNode&&h(e.linkedToNode),null==(i=e.linkedFromNodes)||i.forEach((e=>h(e))),e.numListenersRecursive++;let p=e.parent,f=[e.key];for(;p;){if(p.linkedFromNodes)for(const e of p.linkedFromNodes)(null==r?void 0:r.has(e))||h(e,jn(e,f,t),p);p.numListenersRecursive++,f=[p.key,...f],p=p.parent}return()=>{l.delete(c),null==d||d.forEach((e=>e()));let t=e;for(;t;)t.numListenersRecursive--,t=t.parent}}function jn(e,t,n){let{valueAtPath:r}=$n(cn(e),t);return function({value:e,loading:i,remote:o}){const{valueAtPath:s}=$n(e,t);s!==r&&n({value:s,loading:i,remote:o,changes:[{path:[],pathTypes:[],prevAtPath:r,valueAtPath:s}],getPrevious:()=>r}),r=s}}function $n(e,t){let n=e;const r=[];for(let i=0;n&&i<t.length;i++)r.push(Lt(n)?"array":"object"),n=n[t[i]];return{valueAtPath:n,pathTypes:r}}var Yn=0,zn=[],Vn={current:void 0};function Gn(e,t){if(Yn){const n=Vn.current;if(n){n.nodes||(n.nodes=new Map);const r=n.nodes.get(e);r?(r.track=r.track||t,r.num++):n.nodes.set(e,{node:e,track:t,num:1})}}}function Wn(e,t,n,r,i){let o,s=t;zn.push(Vn.current),Yn++,Vn.current={};const a=e?En(e,n,null==r?void 0:r.fromComputed):e,u=Vn.current.nodes;return--Yn<0&&(Yn=0),Vn.current=zn.pop(),(null==n?void 0:n.cancel)||(o=function(e,t,n,r){let i=[];return null==e||e.forEach((e=>{const{node:n,track:o}=e;i.push(Hn(n,t,{trackingType:o,immediate:r,noArgs:false}))})),()=>{if(i){for(let e=0;e<i.length;e++)i[e]();i=void 0}}}(u,s,0,null==r?void 0:r.immediate)),{nodes:u,value:a,dispose:o,resubscribe:void 0}}function Xn(e,t,n){let r,i;Mt(t)?r=t:n=t;const o={num:0},s=function(){o.onCleanup&&(o.onCleanup(),o.onCleanup=void 0),Fn(),delete o.value,null==i||i();const{dispose:t,value:a,nodes:u}=Wn(e,s,o,n);i=t,o.value=a,o.nodes=u,o.refresh=s,o.onCleanupReaction&&(o.onCleanupReaction(),o.onCleanupReaction=void 0),Bn(),r&&((null==n?void 0:n.fromComputed)||(o.num>0||!function(e){var t;return e&&(null==(t=e[Gt])?void 0:t.isEvent)}(e))&&(o.previous!==o.value||"object"==typeof o.value))&&r(o),o.previous=o.value,o.num++};return s(),()=>{var e,t;null==(e=o.onCleanup)||e.call(o),o.onCleanup=void 0,null==(t=o.onCleanupReaction)||t.call(o),o.onCleanupReaction=void 0,null==i||i()}}function Kn(e,t,n){if(Ut(e))return t?e.then(t):e;let r,i;return Xn((function(t){const i=En(e);if(!Ut(i))return!Ut(i)&&(n?function(e){return!(!e||(xt(e)||Lt(e))&&jt(e))}(i):i)&&(r=i,t.cancel=!0),r;r=i}),(function(){i=null==t?void 0:t(r)})),Ut(r)?t?r.then(t):r:void 0!==r?t?i:Promise.resolve(r):new Promise((e=>{if(t){const n=t;t=t=>{const r=n(t);e(Ut(r)?r.then((e=>e)):r)}}else t=e}))}function qn(e,t){return Kn(e,t,!1)}function Jn(e,t){return Kn(e,t,!0)}var Zn=new Set(["copyWithin","fill","from","pop","push","reverse","shift","sort","splice","unshift"]),Qn=new Set(["every","filter","find","findIndex","forEach","join","map","reduce","some"]),er=new Set(["filter","find"]),tr=new Map,nr=new Map([["get",mr],["set",cr],["peek",Er],["onChange",Hn],["assign",function(e,t){const n=ar(e);if(Fn(),Ft(e.root._)&&(e.root._={}),Ht(t)){const n=cn(e);Ht(n)&&t.forEach(((e,t)=>n.set(t,e)))}else{e.isAssigning=(e.isAssigning||0)+1;try{Object.assign(n,t)}finally{e.isAssigning--}}return Bn(),n}],["delete",function(e,t){void 0===t&&zt(e)&&(t=e.key,e=e.parent);const n=cn(e);Lt(n)?rr(e,n,"splice",t,1):dr(e,null!=t?t:"_",Wt,-1)}],["toggle",function(e){const t=cn(e);(null==t||Pt(t))&&cr(e,!t)}]]);function rr(e,t,n,...r){var i;if("push"!==n||1!==r.length){const o=t.slice(),s=t[n].apply(t,r);if(e){const n=zt(e),r=n?e.key:"_";(n?cn(e.parent):e.root)[r]=o,dr(null!=(i=e.parent)?i:e,r,t)}return s}dr(e,t.length+"",r[0])}function ir(e,t,n){return t?void 0:e?n?Array.from(e.keys()):Object.keys(e):[]}function or(e,t,n){var r,i,o;if(xt(t)&&t[Xt]||xt(n)&&n[Xt]){const r=t!==n;return r&&(e.listeners||e.listenersImmediate)&&wn(e,t,n,0),r}const s=Lt(t);let a,u;const l=Ht(t),c=Ht(n),d=ir(t,s,l),h=ir(n,s,c),p=(null==(r=d||t)?void 0:r.length)||0,f=(null==(i=h||n)?void 0:i.length)||0;let m,E,g,_=!1;if(s&&Lt(n)){if(n.length>0){const r=n[0];if(void 0!==r&&(m=pn(r,e),m&&(E=Mt(m),a=new Map,u=[]),e.children))for(let i=0;i<n.length;i++){const r=n[i];if(r){const n=e.children.get(i+"");if(n&&(t[i]||sr(n,r),m)){const e=E?m(r):r[m];a.set(e,n)}}}}}else if(n&&(!t||xt(t))){const t=h.length;for(let r=0;r<t;r++){const t=h[r];if(!d.includes(t)){_=!0;const r=dn(e,t),i=c?n.get(t):n[t];void 0!==i&&sr(r,i)}}}if(t&&!Ft(t)){_=_||p!==f;const r=_;let i=!1;for(let h=0;h<p;h++){const p=s?h+"":d[h];let f=l?t.get(p):t[p];const g=c?null==n?void 0:n.get(p):null==n?void 0:n[p];let A=!mn(f,g);if(A){const c=m&&f?E?m(f):f[m]:void 0,d=null==(o=e.children)?void 0:o.get(p);if(sn(f)){const e=an(f);if((null==d?void 0:d.linkedToNode)===e){const n=cn(e);l?t.set(p,n):t[p]=n;continue}const n=f;f=()=>n}let h=dn(e,p,f);if(h.lazy||!Mt(f)&&!sn(f)||(Ar(h,f),_r(h)),s&&void 0!==c){const t=void 0!==c?null==a?void 0:a.get(c):void 0;if(t){if(void 0!==t&&t.key!==p){const o=n[t.key];r&&(h=t,e.children.delete(h.key),h.key=p,u.push([p,h])),i=!0,A=o!==f}}else _=!0}if(A)if(Mt(f)||sn(f))fr(e,p,f);else if(Ft(f))_=!0;else{const e=or(h,f,g);_=_||e,A=e}(A||s&&!r)&&(h.listeners||h.listenersImmediate)&&wn(h,f,g,0,!r)}}if(u)for(let t=0;t<u.length;t++){const[n,r]=u[t];e.children.set(n,r)}g=_||i}else void 0!==n&&(g=!0);return null!=g&&g}function sr(e,t){var n,r;null==(n=e.linkedToNodeDispose)||n.call(e),null==(r=e.activatedObserveDispose)||r.call(e),Ft(t)||or(e,void 0,t),(e.listeners||e.listenersImmediate)&&wn(e,void 0,t,0)}function ar(e,t,n){return void 0!==t&&(e=dn(e,t,n)),e.proxy||(e.proxy=new Proxy(e,lr))}function ur(){if(Jt.pendingNodes.size>0){const e=Array.from(Jt.pendingNodes.values());Jt.pendingNodes.clear(),e.forEach((e=>e()))}}var lr={get(e,t,n){var r,i;if(t===Vt)throw new Error("[legend-state] observable is not a primitive.");if(t===Gt)return e;if("apply"===t){const t=cn(e);if(Mt(t))return t.apply}let o=_r(e,"get"===t||"peek"===t);const s=e.linkedToNode||(null==o?void 0:o[Gt]);if(s&&"onChange"!==t)return lr.get(s,t,n);if(Ht(o)||o instanceof WeakMap||o instanceof Set||o instanceof WeakSet){const n=function(e,t,n){const r=null==n?void 0:n[t];return"size"===t?ar(e,t):Mt(r)?function(r,i,o){const s=arguments.length,a=n;if("get"===t){if(s>0&&"boolean"!=typeof r&&r!==Kt)return ar(e,r)}else if("set"===t){if(2===s){const t=a.get(r),n=a.set(r,i);return t!==i&&hr(dn(e,r),i,t),n}1===s&&Ht(n)&&cr(e,r)}else if("delete"===t){if(s>0){const t=n.get?a.get(r):r,i=n.delete(r);return i&&hr(dn(e,r),void 0,t),i}}else{if("clear"===t){const t=new Map(a),r=a.size;return a.clear(),void(r&&hr(e,n,t))}if("add"===t){const i=new Set(n),o=n.add(r);return n.has(t)||wn(e,o,i,0),o}}const u=nr.get(t);if(!u)return n[t](r,i);switch(s){case 0:return u(e);case 1:return u(e,r);case 2:return u(e,r,i);default:return u(e,r,i,o)}}:void 0}(e,t,o);if(void 0!==n)return n}const a=nr.get(t);if(a)return"get"!==t&&"peek"!==t||ur(),function(t,n,r){switch(arguments.length){case 0:return a(e);case 1:return a(e,t);case 2:return a(e,t,n);default:return a(e,t,n,r)}};const u=tr.get(t);if(u)return u.get(e);let l=null==o?void 0:o[t];if(xt(o)&&o[Xt])return l;const c=null==(r=e.functions)?void 0:r.get(t);if(c)return sn(c)?c:ar(e,t,c);if(l=function(e,t){if(e){const n=Object.getOwnPropertyDescriptor(e,t);return(null==n?void 0:n.get)&&(delete e[t],e[t]=n.set?function(e){Mt(e)&&(e={get:e});const t=function(){return{[qt]:e}};return t.prototype[qt]=e,t}({get:n.get,set:({value:e})=>n.set(e)}):n.get),e[t]}}(o,t),$t(o)&&void 0===l&&(Zn.has(t)||Qn.has(t))&&(o=[],un(e,o),l=o[t]),Mt(l)){if(Lt(o)){if(Zn.has(t))return(...n)=>rr(e,o,t,...n);if(Qn.has(t))return Gn(e,!0),function(n,r){const i="reduce"===t,s=i?(t,r,i,o)=>n(t,ar(e,i+"",r),i,o):(t,r,i)=>n(ar(e,r+"",t),r,i);if(i||!er.has(t))return o[t](s,r);const a="find"===t,u=[];for(let t=0;t<o.length;t++)if(s(o[t],t,o)){const n=ar(e,t+"");if(a)return n;u.push(n)}return a?void 0:u}}fr(e,t,l);const n=null==(i=e.functions)?void 0:i.get(t);return n?ar(e,t,n):l.bind(o)}return Ft(l)&&Lt(o)&&"length"===t?(Gn(e,!0),l):ar(e,t)},getPrototypeOf(e){const t=cn(e);return null!==t&&"object"==typeof t?Reflect.getPrototypeOf(t):null},ownKeys(e){_r(e);const t=mr(e,!0);if(Ft(t))return[];const n=t?Reflect.ownKeys(t):[];if(Lt(t)&&"length"===n[n.length-1]&&n.splice(n.length-1,1),Mt(e)){const t=Reflect.ownKeys(e);["caller","arguments","prototype"].forEach((e=>t.includes(e)&&n.push(e)))}return n},getOwnPropertyDescriptor(e,t){if("caller"===t||"arguments"===t||"prototype"===t)return{configurable:!1,enumerable:!1};const n=cn(e);return Ft(n)?void 0:Reflect.getOwnPropertyDescriptor(n,t)},set(e,t,n){if(e.isSetting)return Reflect.set(e,t,n);if(e.isAssigning)return dr(e,t,n),!0;const r=tr.get(t);return!!r&&(r.set(e,n),!0)},deleteProperty:(e,t)=>!!e.isSetting&&Reflect.deleteProperty(e,t),has(e,t){const n=cn(e);return Reflect.has(n,t)},apply:(e,t,n)=>(sn(t)&&(t=t.peek()),Reflect.apply(e.lazyFn||e,t,n))};function cr(e,t){e.parent?dr(e.parent,e.key,t):dr(e,"_",t)}function dr(e,t,n,r){const i=!e.parent&&"_"===t;!e.parent||cn(e)||Mt(n)||cr(e,{[t]:n});const o=i?e:dn(e,t,n);if(sn(n))vr(o,n);else{const{newValue:s,prevValue:a}=un(o,n),u=Ft(s)||s instanceof Date;mn(s,a)||hr(e,s,a,o,u,i,r),u||(o.needsExtract=!0),fr(e,t,s)}}function hr(e,t,n,r,i,o,s){r||(r=e),Fn(),void 0===i&&(i=Ft(t));let a=i,u=!1;(!i||n&&!Ft(n))&&(a=or(r,t,n),Lt(t)&&(u=(null==t?void 0:t.length)!==(null==n?void 0:n.length))),(i||!t||jt(t)&&!jt(n)?t!==n:a)&&wn(i&&o?e:r,t,n,(null!=s?s:void 0===n)?-1:a?0:1,u),Bn()}function pr(e,t,n){e.state||(e.state=Un({isLoaded:!1},0,pr,ar)),t.then((t=>{n?n({value:t}):cr(e,t),e.state.assign({isLoaded:!0,error:void 0})})).catch((t=>{e.state.error.set(t)}))}function fr(e,t,n){if(Ut(n)){const r=dn(e,t);return pr(r,n),void un(r,void 0)}if(sn(n)){const r=()=>n;fn(e,t,r);const i=dn(e,t,r);return un(i,Er(an(n))),cn(i)}if("function"==typeof n)return fn(e,t,n),t}function mr(e,t){return Gn(e,t?xt(t)?t.shallow:t:void 0),Er(e)}function Er(e){return _r(e,!0)}var gr=!1;function _r(e,t){var n;if(gr=!0,t&&(null==(n=e.dirtyChildren)?void 0:n.size)){const t=Array.from(e.dirtyChildren);e.dirtyChildren.clear(),t.forEach((e=>e.dirtyFn&&_r(e)))}if(e.dirtyFn){const t=e.dirtyFn;e.dirtyFn=void 0,Jt.dirtyNodes.delete(e),t()}gr=!1;let r=cn(e);return r=function(e,t,n){const r=t,i=e.lazy;if(i){const n=e.lazyFn;if(delete e.lazy,Mt(n))if(1===n.length)t={};else{if(e.parent){const t=cn(e.parent);t?delete t[e.key]:e.root._=void 0}t=function(e,t){let n,r,i,o=!0;const s=t;let a,u,l=[];function c(){e.dirtyFn=u,Jt.dirtyNodes.add(e)}return e.activatedObserveDispose=Xn((()=>{var t,a,l,c;if(o)o=!1,un(e,void 0);else if(!gr&&u&&function(e,t){if(!gr){const n=function(e){var t,n;let r=e,i=e.numListenersRecursive>0;for(;r&&!i;)((null==(t=r.listeners)?void 0:t.size)||(null==(n=r.listenersImmediate)?void 0:n.size))&&(i=!0),r=r.parent;return i}(e);if(!n){t&&(e.dirtyFn=t);let n=e;for(;n;)n.dirtyChildren||(n.dirtyChildren=new Set),n.dirtyChildren.add(e),n=n.parent;return!0}}}(e,u))return void(i=!0);let d=s(),h=!1;sn(d)&&(h=!0,d=vr(e,d)),Mt(d)&&(d=d());const p=sn(d)||null==d?void 0:d[qt];if(p&&(e.activationState=p,d=void 0),i=!1,r=Ut(d),e.activated){if(e.activationState){const n=e.activationState;(null==(a=null==(t=e.state)?void 0:t.peek())?void 0:a.sync)?(e.state.sync(),i=!0):d=null!=(c=null==(l=n.get)?void 0:l.call(n))?c:n.initial}}else{e.activated=!0;let t=Dr;(null==p?void 0:p.synced)&&(t=Jt.activateSyncedNode,i=!0);const r=t(e,d);n=r.update;let o=r.value;!h&&sn(o)&&(o=vr(e,o)),d=null!=o?o:null==p?void 0:p.initial}return r=r||Ut(d),d}),(t=>{const{value:o,nodes:s,refresh:d}=t;if(u=d,!i){if(!r||!Jt.isLoadingRemote)if(r)if(e.activationState){const{initial:t}=e.activationState;o&&Ut(o)&&pr(e,o,n),Mt(cn(e))&&un(e,null!=t?t:void 0)}else e.activated&&(pr(e,o,n),Mt(cn(e))&&un(e,void 0));else a=o,e.state.isLoaded.peek()?(e.isComputing=!0,cr(e,o),e.isComputing=!1):(un(e,o),e.state.assign({isLoaded:!0,error:void 0}));l.forEach((e=>e())),l=[],null==s||s.forEach((({node:e,track:t})=>{l.push(Hn(e,c,{immediate:!0,trackingType:t}))}))}t.cancel=!0}),{fromComputed:!0}),a}(e,n)}else sn(t)&&(t=fr(e.parent,e.key,t))}return!i&&!e.needsExtract||sn(t)||Ft(t)||(n&&function(e,t){if((xt(e)||Lt(e))&&!e[Xt]){const n=[],r=()=>{var e;let r=t;for(let t=0;t<n.length;t++){const{key:i}=n[t],o=null==(e=cn(r))?void 0:e[i];r=dn(r,i,Mt(o)?o:void 0),_r(r)}return r};Or(e,n,r)}}(t,e),e.parent&&fr(e.parent,e.key,r)),t}(e,r,!!t),r}function Ar(e,t){var n,r;null==(n=e.activatedObserveDispose)||n.call(e),null==(r=e.linkedToNodeDispose)||r.call(e),e.activatedObserveDispose=e.linkedToNodeDispose=e.linkedToNode=void 0,e.lazyFn=t,e.lazy=!0}function Dr(e,t){if(e.state||(e.state=Un({isLoaded:!1},0,pr,ar)),e.activationState){const{set:n,get:r,initial:i}=e.activationState;if(null!=(t=null==r?void 0:r())&&null!==t||(t=i),n){let t,r=[],i=0;const o=o=>{if(r.length>0){let s,a,u,l=!1,c=!1;o?(s=o.changes,a=o.value,l=o.loading,c=o.remote,u=o.getPrevious):(s=r,a=t,u=Rn(a,s)),r=[],t=void 0,Jt.pendingNodes.delete(e),i++;const d=i,h=()=>{d===i&&(e.isComputing=!0,n({value:a,changes:s,loading:l,remote:c,getPrevious:u}),e.isComputing=!1)};Jn(e.state.isLoaded,h)}};Hn(e,(({value:n,changes:i})=>{e.isComputing||(i.length>1||!Mt(i[0].prevAtPath))&&(t=n,r.length>0&&(i=i.filter((e=>!In(r[0].path,e.path)))),r.push(...i),Jt.pendingNodes.set(e,o))}),{immediate:!0}),Hn(e,o)}}return{update:({value:t})=>{e.isComputing||(e.isComputing=!0,cr(e,t),e.isComputing=!1)},value:t}}function vr(e,t){var n;const r=an(t);return r!==e&&(null==r?void 0:r.linkedToNode)!==e&&(e.linkedToNode=r,r.linkedFromNodes||(r.linkedFromNodes=new Set),r.linkedFromNodes.add(e),null==(n=e.linkedToNodeDispose)||n.call(e),e.linkedToNodeDispose=Hn(r,(()=>{t=_r(r),cr(e,t)}),{initial:!0},new Set([e]))),t}function Or(e,t,n){var r;if((xt(e)||Lt(e))&&!e[Xt])for(const i in e)if(kt.call(e,i)){const o=e[i];if(sn(o)){const e=n();fr(e,i,o),delete e.lazy}else{const e=Mt(o)&&(null==(r=o.prototype)?void 0:r[qt]);if(e){const t=e.activate;t&&"auto"!==t||Er(dn(n(),i,o))}}"object"==typeof o&&(t.push({key:i,value:o}),Or(o,t,n),t.pop())}}var Tr=["get","set","peek","onChange","toggle"];function Sr(e){this._node=e;for(let t=0;t<Tr.length;t++){const e=Tr[t];this[e]=this[e].bind(this)}}function yr(e,t){Sr.prototype[e]=function(...e){return t.call(this,this._node,...e)}}function Cr(e){return Un(e,0,pr,ar,Sr)}yr("peek",(e=>(ur(),Er(e)))),yr("get",((e,t)=>(ur(),mr(e,t)))),yr("set",cr),yr("onChange",Hn),Object.defineProperty(Sr.prototype,Gt,{configurable:!0,get(){return this._node}}),Sr.prototype.toggle=function(){const e=this.peek();(null==e||Pt(e))&&this.set(!e)},Sr.prototype.delete=function(){return this.set(void 0),this};var Nr={createPreviousHandler:Rn,clone:on,ensureNodeValue:hn,findIDKey:pn,get:mr,getNode:an,getNodeValue:cn,getPathType:Zt,getProxy:ar,getValueAtPath:function(e,t){return t.reduce(An,e)},globalState:Jt,initializePathType:On,observableFns:nr,optimized:Kt,peek:Er,runWithRetry:function(e,t,n){const{waitFor:r}=e.activationState,{retry:i}=t,o={cancel:!1};let s;if(s=r?Jn(r,(()=>(e.activationState.waitFor=void 0,n(o)))):n(o),Ut(s)&&i){let r;return new Promise((a=>{const u=()=>{s.then((t=>{e.activationState.persistedRetry=!1,a(t)})).catch((()=>{t.attemptNum++,r&&clearTimeout(r),o.cancel||(r=function(e,t,n){const r=function(e,t){const{backoff:n,delay:r=1e3,infinite:i,times:o=3,maxDelay:s=3e4}=e;return i||t<o?Math.min(r*("constant"===n?1:2**t),s):null}(e,t);if(r)return setTimeout(n,r)}(i,t.attemptNum,(()=>{s=n(o),u()})))})).finally((()=>{e.activationState.persistedRetry=!1}))};u()}))}return s},safeParse:rn,safeStringify:nn,set:cr,setAtPath:Dn,setNodeValue:un,symbolLinked:qt,symbolDelete:Wt,tracking:Vn},br="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rr={exports:{}},wr={},kr=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}(Ct),Lr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},xr=kr.useState,Mr=kr.useEffect,Fr=kr.useLayoutEffect,Br=kr.useDebugValue;function Pr(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch(e){return!0}}var Ur="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=xr({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return Fr((function(){i.value=n,i.getSnapshot=t,Pr(i)&&o({inst:i})}),[e,n,t]),Mr((function(){return Pr(i)&&o({inst:i}),e((function(){Pr(i)&&o({inst:i})}))}),[e]),Br(n),n};wr.useSyncExternalStore=void 0!==kr.useSyncExternalStore?kr.useSyncExternalStore:Ur,Rr.exports=wr;var Hr=Rr.exports,jr={inObserver:!1},$r=void 0;function Yr(e,t){if(jr.inObserver&&sn(e)&&!(null==t?void 0:t.suspense))return En(e);let n;try{const r=pe($r||($r=z(null))),i=de((()=>function(e,t){let n,r,i,o,s,a=0;const u=()=>{null==r||r();const{value:e,dispose:t,resubscribe:n}=Wn(i,l,void 0,void 0);return r=t,e},l=({value:r})=>{if(null==t?void 0:t.peek()){const e=s;s=r,void 0===e&&qn((()=>!t.get()),(()=>{const e=s;s=void 0,l({value:e})}))}else{let t=null==e?void 0:e.skipCheck;if(!t){const e=u();(e!==o||!Ft(e)&&e===r)&&(t=!0)}t&&(a++,null==n||n())}};return{subscribe:e=>(n=e,()=>{null==r||r(),r=void 0}),getVersion:()=>a,run:e=>(i=e,o=u())}}(t,r)),[]),{subscribe:o,getVersion:s,run:a}=i;n=a(e),Hr.useSyncExternalStore(o,s,s)}catch(e){throw e}if(null==t?void 0:t.suspense){const t=Ut(n);if(Ut(n)||!n&&sn(e)){const r=t?n:qn(e);if(!yt.use)throw r;yt.use(r)}}return n}function zr({children:e}){return Yr((()=>En(En(e))),{skipCheck:!0})}var Vr="function"==typeof Symbol&&Symbol.for;function Gr(e,t,n,r){const i=Vr?Symbol.for("react.forward_ref"):Me((e=>null)).$$typeof,o=Vr?Symbol.for("react.memo"):ke((e=>null)).$$typeof;if(e.__legend_proxied)return e;let s=!1,a=!1,u=e;o&&u.$$typeof===o&&u.type&&(a=!0,u=u.type),i&&u.$$typeof===i&&(s=!0,u=u.render);const l={apply(e,i,o){if(n){const e=o[0],t={},n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i],s=e[o];if("children"===o&&(Mt(s)||sn(s)))e[o]=Yr(s,{skipCheck:!0});else if(o.startsWith("$")||o.endsWith("$")){const n=o.endsWith("$")?o.slice(0,-1):o.slice(1),i=null==r?void 0:r[n],a=i&&sn(s);if(t[n]=a&&(null==i?void 0:i.selector)?i.selector(t,s):Yr(s),a&&(void 0!==i.defaultValue&&void 0===t[n]&&(t[n]=i.defaultValue),i.handler&&i.getValue)){const n=t=>{var n;s.set(i.getValue(t)),null==(n=e[i.handler])||n.call(e,t)};t[i.handler]=he(n,[e[i.handler],r])}delete t[o]}else void 0===t[o]&&(t[o]=s)}o[0]=t}return t?Yr((()=>{jr.inObserver=!0;try{return Reflect.apply(e,i,o)}finally{jr.inObserver=!1}}),{skipCheck:!0}):Reflect.apply(e,i,o)}},c=new Proxy(u,l);let d;return s?(d=Me(c),d.__legend_proxied=!0):d=c,t||a?ke(d):d}var{findIDKey:Wr,getNode:Xr,optimized:Kr}=Nr,qr=new Map;function Jr({each:e,optimized:t,item:n,itemProps:r,sortValues:i,children:o}){var s;if(!e)return null;const a=Yr((()=>e.get(!t||Kr)));if(!n&&o){const e=le();e.current=o,n=de((()=>{return t=({item$:t,id:n})=>e.current(t,n),Gr(t,!0);var t}),[])}else if(n.$$typeof!==Symbol.for("react.memo")){let e=qr.get(n);e||(e=ke(n),qr.set(n,e)),n=e}if(!a)return null;const u=[];if(Lt(a)){const t=a[0],i=Xr(e),o=a.length,l=o>0?i&&Wr(t,i)||(void 0!==t.id?"id":void 0!==t.key?"key":void 0):void 0,c=Mt(l);for(let d=0;d<o;d++)if(a[d]){const t=a[d],i=null!=(s=c?l(t):t[l])?s:d,o=e[d],h={key:i,id:i,item$:o,item:o};u.push(A(n,r?Object.assign(h,r):h))}}else{const t=Ht(a),o=t?Array.from(a.keys()):Object.keys(a);i&&o.sort(((e,n)=>i(t?a.get(e):a[e],t?a.get(n):a[n],e,n)));for(let i=0;i<o.length;i++){const s=o[i];if(t?a.get(s):a[s]){const i=t?e.get(s):e[s],o={key:s,id:s,item$:i,item:i};u.push(A(n,r?Object.assign(o,r):o))}}}return u}ke(zr,(()=>!0));var Zr=new Map,Qr=new Map;function ei(e,t){var n;const r=le({});if(r.current.value=e,!(null==(n=r.current)?void 0:n.obs$)){const t=e;r.current.obs$=Cr(t)}return r.current.obs$}new Proxy({},{get(e,t){if(!e[t]){const n=Zr.get(t)||t,r=Me(((e,t)=>{const r={...e};return!t||!Mt(t)&&jt(t)||(r.ref=t),A(n,r)}));e[t]=Gr(r,!1,!0,Qr.get(t))}return e[t]}});function ti(e,t,n){let r;Mt(t)?r=t:n=t;const i=le({selector:e});i.current={selector:e,reaction:r},function(e){ae((()=>{const t=e();if(!Ut(t))return t}),[])}((()=>Xn((e=>{const{selector:t}=i.current;return Mt(t)?t(e):t}),(e=>{var t,n;return null==(n=(t=i.current).reaction)?void 0:n.call(t,e)}),n)))}class ni extends Error{}function ri(e,t){if(!e)throw new ni(t??"Assertion failed")}const ii=Object.assign(ri,{is:function(e,t,n){return ri(t,n)},unreachable:function(){throw new Error("Unreachable code")},keyNonNullable:function(e,t){if(!(t in e))throw new ni(`Missing key "${t}"`);if(null==e[t])throw new ni(`Key "${t}" is null or undefined`)},insideObservingContext:function(){if(!Vn.current)throw new Error("You aren't inside an observing context")},never:function(e){throw new Error("Unreachable")},defined:function(e){if(null==e)throw new ni("Value is not defined")}}),oi=z(void 0),si=hi(oi),ai=z(void 0),ui=hi(ai),li=z(void 0),ci=hi(li),di=z(void 0);function hi(e){return()=>{const t=pe(e);return ii(void 0!==t),t}}z(di);class pi{constructor(e={}){this._handlers=new Set,this._meta=e}meta(e){return new pi(e)}_emit(e,t){for(const n of this._handlers)n({level:e,data:t,timestamp:Date.now(),meta:this._meta})}error(...e){return this._emit("error",e)}warn(...e){return this._emit("warn",e)}info(...e){return this._emit("info",e)}log(...e){return this._emit("log",e)}trace(...e){return this._emit("trace",e)}registerHandler(e){return this._handlers.add(e),()=>this._handlers.delete(e)}}const fi=new pi,mi=new pi,Ei={code:"en-US",name:"English (US)",translation:{YESTERDAY:"Yesterday",TODAY:"Today",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"just now",LOCATION:"Location",CANCEL:"Cancel",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Browser notifications",DESKTOP_NOTIFICATIONS_ERROR:"Can't enable browser notifications because your browser actively blocks them. Try looking in the settings or using a different browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notification`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"If you keep your browser tab open, you'll see this pop up when someone talks to you.",SEND_BUTTON_TEXT:"Send",ENTRYBOX_TEXT_LIMIT:"Only 10,000 characters are allowed.",ENTRYBOX_PLACEHOLDER:"Say something...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"This conversation is no longer active.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"You can read, but not send messages.",MESSAGELIST_LOADING_OLDER:"Loading older messages...",MESSAGELIST_SHOW_OLDER:"Show older messages",MESSAGELIST_NEW_MARKER:"New",MESSAGE_SENT_VIA_EMAIL:"This message was sent via email",YOU_MARKER:"you",UPLOAD_IN_PROGRESS:"Uploading...",UPLOAD_SEND_FILE:"Send file",UPLOAD_SHARE_LOCATION:"Share location",UPLOAD_ERROR:"Unfortunately, something went wrong uploading. The file might be unsupported or too large.",SHARE_LOCATION_ERROR:"Cannot share location: ",LOADING:"Loading...",HUB_EMPTY:"Your chat history will show up here",HUB_SHOW_EARLIER:"Show earlier chats",INBOX_NO_CHATS_TITLE:"No chats yet!",INBOX_NO_CHATS_BODY:"Once you've had one or more conversations, they will show up here.",ENABLE_TRANSLATION:"Translate this conversation to English",DISABLE_TRANSLATION:"Show original",SEARCH_PLACEHOLDER_TEXT:"Search...",SEARCH_SEARCHING:"Searching...",SEARCH_NO_RESULTS:"No results found",SEARCH_NO_MORE_RESULTS:"No more results",CHAT_NOT_FOUND:"Chat not found",DELETE_MESSAGE:"Delete message",DELETION_EXPLANATION:"If you delete this message, it will disappear for everybody.",EDIT_MESSAGE:"Edit message",SAVE:"Save",EDITED_INDICATOR:"edited",REPLY_TO_MESSAGE:"Reply",REPLY_TO_ARIA_LABEL:(e,t)=>`Replying to ${e}: ${t}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Exit reply mode",ADD_REACTION:"Add reaction",AUTH_EXPIRED_OVERLAY_TITLE:"Your chat session has expired",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Refresh the page to continue",VOICE_MESSAGE:"Voice message",LEAVE_CONVERSATION:"Leave conversation",MARK_CONVERSATION_AS_UNREAD:"Mark as unread",STATUS_INDICATOR_ONLINE:"Active",STATUS_INDICATOR_OFFLINE:"Away",CONTACT_INFORMATION_HIDDEN:"hidden information"}},gi={code:"ar",name:"Arabic",translation:{YESTERDAY:"الأمس",TODAY:"اليوم",DAYS:"يوم",HOURS:"ساعة",MINUTES:"دقيقة",JUST_NOW:"فقط الآن",LOCATION:"الموقع",CANCEL:"إلغاء",INBOX:"علبة الوارد",DESKTOP_NOTIFICATIONS:"إشعارات المتصفح",DESKTOP_NOTIFICATIONS_ERROR:"لا يمكن تمكين إشعارات المتصفح لأن متصفحك يمنعها بشكل نشط. جرّب البحث في الإعدادات أو استخدام متصفح آخر.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`إعلام ${e} التجريبي`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"إذا أبقيت علامة تبويب المتصفح مفتوحة ، فسترى هذا ينبثق عندما يتحدث شخص معك.",SEND_BUTTON_TEXT:"إرسال",ENTRYBOX_TEXT_LIMIT:"يُسمح فقط بـ 10.000 حرف.",ENTRYBOX_PLACEHOLDER:"قل شيئًا ...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"هذه المحادثة لم تعد نشطة.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"يمكنك القراءة ، لكن لا يمكنك إرسال الرسائل.",MESSAGELIST_LOADING_OLDER:"جارٍ تحميل الرسائل القديمة ...",MESSAGELIST_SHOW_OLDER:"عرض الرسائل الأقدم",MESSAGELIST_NEW_MARKER:"جديد",MESSAGE_SENT_VIA_EMAIL:"تم إرسال هذه الرسالة عبر البريد الإلكتروني",YOU_MARKER:"أنت",UPLOAD_IN_PROGRESS:"جارٍ التحميل ...",UPLOAD_SEND_FILE:"إرسال ملف",UPLOAD_SHARE_LOCATION:"مشاركة الموقع",UPLOAD_ERROR:"حدث خطأ ما في تحميل شيء. ربما يكون الملف غير متوافق أو كبير جدًا.",SHARE_LOCATION_ERROR:"لا يمكن مشاركة الموقع:",LOADING:"جارٍ التحميل ...",HUB_EMPTY:"سوف يظهر سجل الدردشات هنا",HUB_SHOW_EARLIER:"إظهار الدردشات السابقة",INBOX_NO_CHATS_TITLE:"لا توجد دردشات بعد!",INBOX_NO_CHATS_BODY:"بمجرد أن يكون لديك واحد أو أكثر من المحادثات ، سوف تظهر هنا.",ENABLE_TRANSLATION:"ترجم هذه المحادثة إلى العربية",DISABLE_TRANSLATION:"إظهار الأصلي",SEARCH_PLACEHOLDER_TEXT:"...بحث",SEARCH_SEARCHING:"...يتم الآن البحث",SEARCH_NO_RESULTS:"لم يتم العثور على نتائج",SEARCH_NO_MORE_RESULTS:"لا يوجد المزيد من النتائج",CHAT_NOT_FOUND:"لم يتم العثور على الدردشة",DELETE_MESSAGE:"احذف الرسالة",DELETION_EXPLANATION:"إذا قمت بحذف هذه الرسالة، فهي ستختفي للجميع.",EDIT_MESSAGE:"تعديل الرسالة",SAVE:"حفظ",EDITED_INDICATOR:"معدّلة",REPLY_TO_MESSAGE:"رد",ADD_REACTION:"أضف تفاعلاً",AUTH_EXPIRED_OVERLAY_TITLE:"انتهت جلسة الدردشة المخصصة لك",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"يُرجى إعادة تحميل الصفحة للمتابعة",VOICE_MESSAGE:"رسالة صوتية",CONTACT_INFORMATION_HIDDEN:"المعلومات المخفية",LEAVE_CONVERSATION:"الخروج من المحادثة",MARK_CONVERSATION_AS_UNREAD:"وضع علامة غير مقروءة",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},_i={code:"bg-BG",name:"Bulgarian",translation:{YESTERDAY:"Вчера",TODAY:"Днес",DAYS:"Ден",HOURS:"Час",MINUTES:"m",JUST_NOW:"Току-що",LOCATION:"местоположението",CANCEL:"Откажи",INBOX:"Кутия",DESKTOP_NOTIFICATIONS:"Известия на браузъра",DESKTOP_NOTIFICATIONS_ERROR:"Не можете да активирате известията на браузъра, защото браузърът ви ги блокира активно. Опитайте да погледнете в настройките или да използвате друг браузър.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} демо известие`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ако държите раздела на браузъра си отворен, ще видите този изскачащ прозорец, когато някой говори с вас.",SEND_BUTTON_TEXT:"Изпрати",ENTRYBOX_TEXT_LIMIT:"Разрешени са само до 10.000 знака.",ENTRYBOX_PLACEHOLDER:"Кажете нещо...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Този разговор вече не е активен.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Можете да четете, но не и да изпращате съобщения.",MESSAGELIST_LOADING_OLDER:"Зареждане на по-стари съобщения...",MESSAGELIST_SHOW_OLDER:"Показване на по-стари съобщения",MESSAGELIST_NEW_MARKER:"Нови",MESSAGE_SENT_VIA_EMAIL:"Това съобщение беше изпратено по имейл",YOU_MARKER:"Вие",UPLOAD_IN_PROGRESS:"Качване...",UPLOAD_SEND_FILE:"Изпращане на файл",UPLOAD_SHARE_LOCATION:"Споделяне на местоположението",UPLOAD_ERROR:"За съжаление нещо се обърка при качването. Файлът може да не се поддържа или е твърде голям.",SHARE_LOCATION_ERROR:"Не може да се сподели местоположението: ",LOADING:"Зареждане...",HUB_EMPTY:"Историята на вашите разговори ще се покаже тук",HUB_SHOW_EARLIER:"Показване на по-ранни чатове",INBOX_NO_CHATS_TITLE:"Все още нямате разговори!",INBOX_NO_CHATS_BODY:"След като проведете един или повече разговори, те ще се покажат тук.",ENABLE_TRANSLATION:"Преведете този разговор на български",DISABLE_TRANSLATION:"Показване на оригинал",SEARCH_PLACEHOLDER_TEXT:"Търсене...",SEARCH_SEARCHING:"Търсене...",SEARCH_NO_RESULTS:"Няма намерени резултати",SEARCH_NO_MORE_RESULTS:"Няма повече резултати",CHAT_NOT_FOUND:"Чатът не е намерен",DELETE_MESSAGE:"Изтриване на съобщение",DELETION_EXPLANATION:"Ако изтриете това съобщение, то ще изчезне за всички.",EDIT_MESSAGE:"Редактиране на съобщението",SAVE:"Запиши",EDITED_INDICATOR:"редактирано",REPLY_TO_MESSAGE:"Отговори",ADD_REACTION:"Добави реакция",AUTH_EXPIRED_OVERLAY_TITLE:"Вашата чат сесия е изтекла",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Обновете страницата, за да продължите",VOICE_MESSAGE:"Гласово съобщение",CONTACT_INFORMATION_HIDDEN:"Скрита информация",LEAVE_CONVERSATION:"Напускане на разговора",MARK_CONVERSATION_AS_UNREAD:"Маркирай като непрочетено",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ai={code:"bs-BA",name:"Bosnian",translation:{YESTERDAY:"Jučer",TODAY:"Danas",DAYS:"d",HOURS:"s",MINUTES:"m",JUST_NOW:"Upravo sad",LOCATION:"Lokacija",CANCEL:"Otkaži",INBOX:"Pretinac",DESKTOP_NOTIFICATIONS:"Obavijesti preglednika",DESKTOP_NOTIFICATIONS_ERROR:"Notifikacije preglednika se ne mogu omogućiti jer ih vaš preglednik aktivno blokira. Pokušajte pregledati postavke ili koristiti drugi preglednik.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notifikacija`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ako karticu preglednika ostavite otvorenu, pojavit će se ovaj pop-up kada netko razgovara s vama.",SEND_BUTTON_TEXT:"Pošalji",ENTRYBOX_TEXT_LIMIT:"Dozvoljeno je samo 10.000 znakova.",ENTRYBOX_PLACEHOLDER:"Reci nešto...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ovaj razgovor više nije aktivan.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Možeš čitati, ali ne i slati poruke.",MESSAGELIST_LOADING_OLDER:"Učitavam starije poruke...",MESSAGELIST_SHOW_OLDER:"Prikaži starije poruke",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Ova poruka je poslana e-poštom",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Učitavam...",UPLOAD_SEND_FILE:"Pošalji datoteku",UPLOAD_SHARE_LOCATION:"Podijeli lokaciju",UPLOAD_ERROR:"Nažalost, nešto je pošlo krivo. Datoteka možda nije podržana ili je prevelika.",SHARE_LOCATION_ERROR:"Nije moguće podijeliti lokaciju: ",LOADING:"Učitavam...",HUB_EMPTY:"Ovdje će se prikazati vaša povijest razgovora",HUB_SHOW_EARLIER:"Prikaži ranije razgovore",INBOX_NO_CHATS_TITLE:"Nema razgovora!",INBOX_NO_CHATS_BODY:"Nakon što vodite jedan ili više razgovora, oni će se pojaviti ovdje.",ENABLE_TRANSLATION:"Prevedi ovaj razgovor na bosanski jezik",DISABLE_TRANSLATION:"Prikaži original",SEARCH_PLACEHOLDER_TEXT:"Pretraži...",SEARCH_SEARCHING:"Pretraživanje...",SEARCH_NO_RESULTS:"Nema rezultata",SEARCH_NO_MORE_RESULTS:"Nema više rezultata",CHAT_NOT_FOUND:"Ćaskanje nije pronađeno",DELETE_MESSAGE:"Obriši poruku",DELETION_EXPLANATION:"Ako izbrišete ovu poruku, ona će nestati za sve.",EDIT_MESSAGE:"Uredi poruku",SAVE:"Sačuvati",EDITED_INDICATOR:"uređeno",REPLY_TO_MESSAGE:"Odgovorite",ADD_REACTION:"Dodajte reakciju",AUTH_EXPIRED_OVERLAY_TITLE:"Vaša chat sesija je istekla",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Osvježite stranicu da nastavite",VOICE_MESSAGE:"Glasovna poruka",CONTACT_INFORMATION_HIDDEN:"Skrivene informacije",LEAVE_CONVERSATION:"Napusti razgovor",MARK_CONVERSATION_AS_UNREAD:"Označi kao nepročitano",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Di={code:"cs-CZ",name:"Czech",translation:{YESTERDAY:"Včera",TODAY:"Dnes",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"právě teď",LOCATION:"Lokace",CANCEL:"Zrušit",INBOX:"Doručené",DESKTOP_NOTIFICATIONS:"Oznámení v prohlížeči",DESKTOP_NOTIFICATIONS_ERROR:"Nelze povolit notifikace prohlížeče, protože váš prohlížeč je aktivně blokuje. Zkuste se podívat na nastavení nebo zkuste použít jiný prohlížeč.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notifikace`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Pokud necháte kartu prohlížeče otevřenou, uvidíte tento popup jakmile s vámi bude někdo mluvit.",SEND_BUTTON_TEXT:"Odeslat",ENTRYBOX_TEXT_LIMIT:"Je povoleno Maximálně 10.000 znaků.",ENTRYBOX_PLACEHOLDER:"Napište něco...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Tato konverzace již není aktivní.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Můžete číst, ale nemůžete posílat zprávy.",MESSAGELIST_LOADING_OLDER:"Nahrávám starší zprávy...",MESSAGELIST_SHOW_OLDER:"Zobrazit starší zprávy",MESSAGELIST_NEW_MARKER:"Nové",MESSAGE_SENT_VIA_EMAIL:"Tato zpráva byla odeslána přes mail.",YOU_MARKER:"vy",UPLOAD_IN_PROGRESS:"Nahrávám...",UPLOAD_SEND_FILE:"Poslat soubor",UPLOAD_SHARE_LOCATION:"Sdílet pozici",UPLOAD_ERROR:"Nepodařilo se nahrát soubor. Ten je buď nepodporován a/nebo příliš velký.",SHARE_LOCATION_ERROR:"Není možné sdílet pozici: ",LOADING:"Nahrávám...",HUB_EMPTY:"Vaše historie se zde zobrazí",HUB_SHOW_EARLIER:"Zobrazit dřívější konverzace",INBOX_NO_CHATS_TITLE:"Zatím zde nejsou žádné konverzace!",INBOX_NO_CHATS_BODY:"Jakmile budete mít jednu nebo více konverzací, objeví se zde.",ENABLE_TRANSLATION:"Přeložit tuto konverzaci do češtiny",DISABLE_TRANSLATION:"Zobrazit původní",SEARCH_PLACEHOLDER_TEXT:"Hledat...",SEARCH_SEARCHING:"Hledání...",SEARCH_NO_RESULTS:"Nenašly se žádné výsledky",SEARCH_NO_MORE_RESULTS:"Žádné další výsledky",CHAT_NOT_FOUND:"Chat nenalezen",DELETE_MESSAGE:"Smazat zprávu",DELETION_EXPLANATION:"Pokud tuto zprávu smažete, zmizí pro všechny.",EDIT_MESSAGE:"Upravit zprávu",SAVE:"Uložit",EDITED_INDICATOR:"upraveno",REPLY_TO_MESSAGE:"Odpovědět",ADD_REACTION:"Reagovat",AUTH_EXPIRED_OVERLAY_TITLE:"Váš chat byl kvůli nečinnosti odpojen",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Pro pokračování obnovte stránku",VOICE_MESSAGE:"Hlasová zpráva",CONTACT_INFORMATION_HIDDEN:"Skrytá informace",LEAVE_CONVERSATION:"Opustit konverzaci",MARK_CONVERSATION_AS_UNREAD:"Označit jako nepřečtené",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},vi={code:"da-DK",name:"Danish",translation:{YESTERDAY:"I går",TODAY:"I dag",DAYS:"d",HOURS:"t",MINUTES:"m",JUST_NOW:"lige nu",LOCATION:"Placering",CANCEL:"Annuller",INBOX:"Indbakke",DESKTOP_NOTIFICATIONS:"Browsermeddelelser",DESKTOP_NOTIFICATIONS_ERROR:"Kan ikke aktivere Browsermeddelelser, fordi din browser aktivt blokerer dem. Prøv at kigge i indstillingerne eller benyt en anden browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demomeddelelse`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Hvis du holder dit browser-faneblad åben, vil du se det her komme op, når nogen taler til dig.",SEND_BUTTON_TEXT:"Send",ENTRYBOX_TEXT_LIMIT:"Kun 10.000 tegn er tilladt.",ENTRYBOX_PLACEHOLDER:"Sig noget...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Denne samtale er ikke længere aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Du kan læse, men ikke sende beskeder.",MESSAGELIST_LOADING_OLDER:"Indlæser ældre beskeder...",MESSAGELIST_SHOW_OLDER:"Vis ældre beskeder",MESSAGELIST_NEW_MARKER:"Ny",MESSAGE_SENT_VIA_EMAIL:"Denne besked blev sendt via e-mail",YOU_MARKER:"dig",UPLOAD_IN_PROGRESS:"Overfører...",UPLOAD_SEND_FILE:"Send fil",UPLOAD_SHARE_LOCATION:"Del placering",UPLOAD_ERROR:"Der er sket noget forkert ved upload. Filen kan ikke understøttes eller filen er for stor.",SHARE_LOCATION_ERROR:"Kan ikke dele placering: ",LOADING:"Indlæser...",HUB_EMPTY:"Dine samtaler vises her",HUB_SHOW_EARLIER:"Vis tidligere chats",INBOX_NO_CHATS_TITLE:"Ingen chats endnu!",INBOX_NO_CHATS_BODY:"Når du har haft en eller flere samtaler, vises de her.",ENABLE_TRANSLATION:"Oversæt denne konversation til dansk",DISABLE_TRANSLATION:"Vis den oprindelige",SEARCH_PLACEHOLDER_TEXT:"Søg...",SEARCH_SEARCHING:"Søger...",SEARCH_NO_RESULTS:"Ingen resultater fundet",SEARCH_NO_MORE_RESULTS:"Ikke flere resultater",CHAT_NOT_FOUND:"Chat ikke fundet",DELETE_MESSAGE:"Slet besked",DELETION_EXPLANATION:"Hvis du sletter denne besked, vil ingen kunne se den.",EDIT_MESSAGE:"Rediger besked",SAVE:"Gem",EDITED_INDICATOR:"redigeret",REPLY_TO_MESSAGE:"Svar",ADD_REACTION:"Tilføj reaktion",AUTH_EXPIRED_OVERLAY_TITLE:"Din chatsession er udløbet",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Opdater siden for at fortsætte",VOICE_MESSAGE:"Talebesked",CONTACT_INFORMATION_HIDDEN:"Skjulte oplysninger",LEAVE_CONVERSATION:"Forlad samtale",MARK_CONVERSATION_AS_UNREAD:"Marker som ulæst",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Oi={code:"de-DE",name:"German",translation:{YESTERDAY:"Gestern",TODAY:"Heute",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"gerade jetzt",LOCATION:"Standort",CANCEL:"Abbrechen",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Browser-Benachrichtigungen",DESKTOP_NOTIFICATIONS_ERROR:"Browser-Benachrichtigungen können nicht aktiviert werden, da Ihr Browser sie aktiv blockiert. Versuchen Sie, in den Einstellungen nachzuschlagen oder einen anderen Browser zu verwenden.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} Demo-Benachrichtigung`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Wenn Sie Ihre Browser-Registerkarte geöffnet lassen, wird dies angezeigt, wenn jemand mit Ihnen spricht.",SEND_BUTTON_TEXT:"Senden",ENTRYBOX_TEXT_LIMIT:"Nur 10.000 Zeichen sind erlaubt.",ENTRYBOX_PLACEHOLDER:"Sag etwas...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Diese Konversation ist nicht mehr aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Sie können Nachrichten lesen, aber nicht senden.",MESSAGELIST_LOADING_OLDER:"Ältere Nachrichten werden geladen...",MESSAGELIST_SHOW_OLDER:"Zeige ältere Nachrichten",MESSAGELIST_NEW_MARKER:"Neu",MESSAGE_SENT_VIA_EMAIL:"Diese Nachricht wurde per E-Mail gesendet",YOU_MARKER:"du",UPLOAD_IN_PROGRESS:"Hochladen...",UPLOAD_SEND_FILE:"Datei senden",UPLOAD_SHARE_LOCATION:"Standort teilen",UPLOAD_ERROR:"Beim Hochladen ist ein Fehler aufgetreten. Die Datei ist möglicherweise nicht unterstützt oder zu groß.",SHARE_LOCATION_ERROR:"Standort kann nicht freigegeben werden: ",LOADING:"Laden...",HUB_EMPTY:"Ihr Chat-Verlauf wird hier angezeigt",HUB_SHOW_EARLIER:"Zeige frühere Chats",INBOX_NO_CHATS_TITLE:"Noch keine Chats!",INBOX_NO_CHATS_BODY:"Sobald Sie eine oder mehrere Unterhaltungen geführt haben, werden sie hier angezeigt.",ENABLE_TRANSLATION:"Dieses Gespräch auf Deutsch übersetzen",DISABLE_TRANSLATION:"Originaltext anzeigen",SEARCH_PLACEHOLDER_TEXT:"Suche...",SEARCH_SEARCHING:"Suchen...",SEARCH_NO_RESULTS:"Keine Suchergebnisse gefunden",SEARCH_NO_MORE_RESULTS:"Keine weiteren Suchergebnisse",CHAT_NOT_FOUND:"Chat nicht gefunden",DELETE_MESSAGE:"Nachricht löschen",DELETION_EXPLANATION:"Wenn Sie diese Nachricht löschen, wird sie für alle verschwinden.",EDIT_MESSAGE:"Nachricht bearbeiten",SAVE:"Speichern",EDITED_INDICATOR:"bearbeitet",REPLY_TO_MESSAGE:"Antworten",ADD_REACTION:"Reaktion hinzufügen",AUTH_EXPIRED_OVERLAY_TITLE:"Ihre Chatsitzung ist abgelaufen",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Laden Sie zum Fortfahren die Seite neu",VOICE_MESSAGE:"Sprachnachricht",CONTACT_INFORMATION_HIDDEN:"Geschützte Angaben",LEAVE_CONVERSATION:"Unterhaltung verlassen",MARK_CONVERSATION_AS_UNREAD:"als ungelesen markieren",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ti={code:"el-GR",name:"Greek (Greece)",translation:{YESTERDAY:"Χθές",TODAY:"Σήμερα",DAYS:"Ημέρες",HOURS:"'Ωρες",MINUTES:"Λεπτά",JUST_NOW:"Μόλις τώρα",LOCATION:"Τοποθεσία",CANCEL:"Ακύρωση",INBOX:"Εισερχόμενα",DESKTOP_NOTIFICATIONS:"Ειδοποιήσεις περιηγητή",DESKTOP_NOTIFICATIONS_ERROR:"Δεν είναι δυνατή η ενεργοποίηση των ειδοποιήσεων του προγράμματος περιήγησης, επειδή το πρόγραμμα περιήγησης τις αποκλείει ενεργά. Δοκιμάστε να τσεκάρετε τις ρυθμίσεις ή να χρησιμοποιήσετε διαφορετικό πρόγραμμα περιήγησης.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} Δοκιμαστική επίδειξη`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Αν διατηρήσετε ανοιχτή τη σελίδα του προγράμματος περιήγησης, θα δείτε αυτό το pop up (παράθυρο) όταν κάποιος σας μιλάει.",SEND_BUTTON_TEXT:"Αποστολή",ENTRYBOX_TEXT_LIMIT:"Επιτρέπονται μόνο 10.000 χαρακτήρες.",ENTRYBOX_PLACEHOLDER:"Πείτε κάτι...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Αυτή η συζήτηση δεν είναι πλέον ενεργή.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Μπορείτε να διαβάσετε αλλά δεν μπορείτε να στείλετε μηνύματα.",MESSAGELIST_LOADING_OLDER:"Φόρτωση παλαιοτέρων μηνυμάτων...",MESSAGELIST_SHOW_OLDER:"Εμφάνιση παλαιότερων μηνυμάτων",MESSAGELIST_NEW_MARKER:"Νέο",MESSAGE_SENT_VIA_EMAIL:"Αυτό το μήνυμα εστάλη μέσω ηλεκτρονικού ταχυδρομείου",YOU_MARKER:"Εσείς",UPLOAD_IN_PROGRESS:"Ανέβασμα...",UPLOAD_SEND_FILE:"Αποστολή αρχείου",UPLOAD_SHARE_LOCATION:"Κοινή χρήση τοποθεσίας",UPLOAD_ERROR:"Κάτι πήγε στραβά κατά τη φόρτωση. Το αρχείο ενδέχεται να μην υποστηρίζεται ή να είναι υπερβολικά μεγάλο.",SHARE_LOCATION_ERROR:"Δεν είναι δυνατή η χρήση κοινής τοποθεσίας: ",LOADING:"Φόρτωση...",HUB_EMPTY:"Το ιστορικό των συνομιλιών σας θα εμφανιστεί εδώ",HUB_SHOW_EARLIER:"Εμφάνιση προηγούμενων συνομιλιών",INBOX_NO_CHATS_TITLE:"Δεν υπάρχουν ακόμα συζητήσεις!",INBOX_NO_CHATS_BODY:"Μόλις έχετε μία ή περισσότερες συνομιλίες, θα εμφανιστούν εδώ.",ENABLE_TRANSLATION:"Μετάφραση αυτής της συνομιλίας στα ελληνικά",DISABLE_TRANSLATION:"Προβολή πρωτοτύπου",SEARCH_PLACEHOLDER_TEXT:"Αναζήτηση...",SEARCH_SEARCHING:"Αναζήτηση...",SEARCH_NO_RESULTS:"Δεν βρέθηκαν αποτελέσματα",SEARCH_NO_MORE_RESULTS:"Δεν υπάρχουν περισσότερα αποτελέσματα",CHAT_NOT_FOUND:"Η συνομιλία δεν βρέθηκε",DELETE_MESSAGE:"Διαγραφή μηνύματος",DELETION_EXPLANATION:"Εάν διαγράψετε αυτό το μήνυμα, θα εξαφανιστεί για όλους.",EDIT_MESSAGE:"Επεξεργασία μηνύματος",SAVE:"Αποθήκευση",EDITED_INDICATOR:"επεξεργασμένο",REPLY_TO_MESSAGE:"Απάντηση",ADD_REACTION:"Προσθήκη αντίδρασης",AUTH_EXPIRED_OVERLAY_TITLE:"Η συνεδρία της συνομιλίας σας έχει λήξει",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Ανανεώστε τη σελίδα για να συνεχίσετε",VOICE_MESSAGE:"Ηχητικό μήνυμα",CONTACT_INFORMATION_HIDDEN:"Κρυμμένες πληροφορίες",LEAVE_CONVERSATION:"Αποσυρθείτε από τη συζήτηση",MARK_CONVERSATION_AS_UNREAD:"Επισήμανση ως μη αναγνωσμένα",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Si={code:"es-ES",name:"Spanish",translation:{YESTERDAY:"Ayer",TODAY:"Hoy",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"justo ahora",LOCATION:"Ubicación",CANCEL:"Cancelar",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Notificaciones del navigator",DESKTOP_NOTIFICATIONS_ERROR:"No se logró habilitar las notificaciones del navigador, comprueba que tu navegador no las esté bloqueando o intenta con otro navegador.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} notificación de prueba`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Si dejas esta pestaña abierta, verás este pop up cuando alguien te hable.",SEND_BUTTON_TEXT:"Enviar",ENTRYBOX_TEXT_LIMIT:"Sólo 10.000 caracteres permitidos.",ENTRYBOX_PLACEHOLDER:"Escribe algo...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Esta conversación ya no está activa.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Puedes leer pero no enviar mensajes.",MESSAGELIST_LOADING_OLDER:"Cargando mensajes pasados...",MESSAGELIST_SHOW_OLDER:"Ver mensajes pasados",MESSAGELIST_NEW_MARKER:"Nuevo",MESSAGE_SENT_VIA_EMAIL:"Este mensaje ha sido enviado vía email",YOU_MARKER:"tú",UPLOAD_IN_PROGRESS:"Subir...",UPLOAD_SEND_FILE:"Enviar archivo",UPLOAD_SHARE_LOCATION:"Compartir ubicación",UPLOAD_ERROR:"Ocurrió un problema subiendo el archivo. Puede que el archivo esté en un formato no soportado o que sea demasiado grande.",SHARE_LOCATION_ERROR:"No se logró compartir la ubicación: ",LOADING:"Cargando...",HUB_EMPTY:"Tu historial de conversaciones se mostrará aquí",HUB_SHOW_EARLIER:"Ver conversaciones pasadas",INBOX_NO_CHATS_TITLE:"¡Aún sin conversaciones!",INBOX_NO_CHATS_BODY:"Una vez que tengas una o más conversaciones, se mostrarán aquí.",ENABLE_TRANSLATION:"Traducir esta conversación al español",DISABLE_TRANSLATION:"Mostrar la conversación original",SEARCH_PLACEHOLDER_TEXT:"Buscar...",SEARCH_SEARCHING:"Buscando...",SEARCH_NO_RESULTS:"No se encontraron resultados",SEARCH_NO_MORE_RESULTS:"No hay más resultados",CHAT_NOT_FOUND:"Chat no encontrado",DELETE_MESSAGE:"Eliminar mensaje",DELETION_EXPLANATION:"Este mensaje desaparecerá para todos si lo borras.",EDIT_MESSAGE:"Editar mensaje",SAVE:"Guardar",EDITED_INDICATOR:"editado",REPLY_TO_MESSAGE:"Responder",ADD_REACTION:"Añadir reacción",AUTH_EXPIRED_OVERLAY_TITLE:"Su sesión de chat ha expirado",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Actualice la página para continuar",VOICE_MESSAGE:"Mensaje de voz",CONTACT_INFORMATION_HIDDEN:"Información oculta",LEAVE_CONVERSATION:"Abandonar conversación",MARK_CONVERSATION_AS_UNREAD:"Marcar como no leída",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},yi={code:"et-EE",name:"Estonian",translation:{YESTERDAY:"Eile",TODAY:"Täna",DAYS:"p",HOURS:"t",MINUTES:"m",JUST_NOW:"Just nüüd",LOCATION:"Asukoht",CANCEL:"Katkesta",INBOX:"Postkast",DESKTOP_NOTIFICATIONS:"Veebibrauseri teated",DESKTOP_NOTIFICATIONS_ERROR:"Töölaua teatisi ei saa lubada, kuna Teie brauser blokeerib need aktiivselt. Proovige muuta seadeid või kasutada mõnda muud brauserit.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo teavitus`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Kui hoiate oma brauseri vahekaardi lahti ja näete seda hüpikakent, siis keegi soovib Teiega rääkida.",SEND_BUTTON_TEXT:"Saada",ENTRYBOX_TEXT_LIMIT:"Ainult kuni 10.000 tähemärki on lubatud.",ENTRYBOX_PLACEHOLDER:"Kirjuta midagi...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"See vestlus ei ole enam aktiivne.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Sa saad lugeda teateid, aga mitte kirjutada.",MESSAGELIST_LOADING_OLDER:"Laen vanemaid teateid...",MESSAGELIST_SHOW_OLDER:"Näita vanemaid teateid",MESSAGELIST_NEW_MARKER:"Uus",MESSAGE_SENT_VIA_EMAIL:"See teade on saadetud e-postiga",YOU_MARKER:"Sina",UPLOAD_IN_PROGRESS:"Laen...",UPLOAD_SEND_FILE:"Saada fail",UPLOAD_SHARE_LOCATION:"Jaga faili asukohta",UPLOAD_ERROR:"Nüüd läks midagi nihu, seoses faili ülesse laadimisega. Tundmatu fail või liiga suur.",SHARE_LOCATION_ERROR:"Ei suuda jagada faili asukohta: ",LOADING:"Laen...",HUB_EMPTY:"Siin on Sinu vestluste ajalugu",HUB_SHOW_EARLIER:"Näita vanemaid vestlusi",INBOX_NO_CHATS_TITLE:"Pole ühtegi vestlust!",INBOX_NO_CHATS_BODY:"Kui Sul tekib üks või rohkem vestlust, siis on need kuvatakse siin.",ENABLE_TRANSLATION:"Tõlgi see vestlus eesti keelde",DISABLE_TRANSLATION:"Näita algteksti",SEARCH_PLACEHOLDER_TEXT:"Otsi...",SEARCH_SEARCHING:"Otsin...",SEARCH_NO_RESULTS:"Otsingu tulemused puuduvad",SEARCH_NO_MORE_RESULTS:"Rohkem tulemusi ei ole ",CHAT_NOT_FOUND:"Vestlust ei leitud",DELETE_MESSAGE:"Kustuta sõnum",DELETION_EXPLANATION:"Kui kustutate selle sõnumi, kaob see kõigi jaoks.",EDIT_MESSAGE:"Redigeeri sõnumit",SAVE:"Salvesta",EDITED_INDICATOR:"muudetud",REPLY_TO_MESSAGE:"Vasta",ADD_REACTION:"Lisa reaktsioon",AUTH_EXPIRED_OVERLAY_TITLE:"Teie vestlussessioon on lõppenud",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Jätkamiseks värskendage lehte",VOICE_MESSAGE:"Häälsõnum",CONTACT_INFORMATION_HIDDEN:"Varjatud informatsioon",LEAVE_CONVERSATION:"Lahku vestlusest",MARK_CONVERSATION_AS_UNREAD:"Märgi mitteloetuks",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ci={code:"fa",name:"Persian (Farsi)",translation:{YESTERDAY:"دیروز",TODAY:"امروز",DAYS:"روز",HOURS:"ساعت",MINUTES:"دقیقه",JUST_NOW:"هم اکنون",LOCATION:"مکان",CANCEL:"لغو",INBOX:"صندوق",DESKTOP_NOTIFICATIONS:"اطلاعیههای مرورگر",DESKTOP_NOTIFICATIONS_ERROR:"خطا در فعال سازی اعلان های مرورگر، مرورگر شما آنها را مسدود می کند سعی کنید تنظیمات مرورگر را تغییر دهید یا از یک مرورگر دیگر استفاده کنید.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`نوتیفیکیشن دمو ${e}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"اگر صفحه ی مرورگر را باز نگهدارید این را موقعه ای که کسی با شما صحبت کند خواهید دید",SEND_BUTTON_TEXT:"بفرست",ENTRYBOX_TEXT_LIMIT:"فقط ۱۰،۰۰۰ حروف مجاز می باشد.",ENTRYBOX_PLACEHOLDER:"...چیزی بنویسید",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:".این مکالمه دیگر فعال نمی باشد",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"شما می توانید بخوانید اما نمی توانید پیام بفرستید",MESSAGELIST_LOADING_OLDER:"...در حال بارگذاری پیام های قدیمی تر",MESSAGELIST_SHOW_OLDER:"نشان دادن پیام های قدیمی",MESSAGELIST_NEW_MARKER:"جدید",MESSAGE_SENT_VIA_EMAIL:"پیام توسط ایمل ارسال شد",YOU_MARKER:"شما",UPLOAD_IN_PROGRESS:"...در حال بارگذاری",UPLOAD_SEND_FILE:"فرستادن پوشه",UPLOAD_SHARE_LOCATION:"اشتراک گذاری مکان",UPLOAD_ERROR:"متاسفانه بارگذاری با مشکل روبه رو شد. ممکن است فایل حجیم باشد یا ساپورت نشده باشد.",SHARE_LOCATION_ERROR:"خطا در اشتراک گذاری مکان: ",LOADING:"...بارگذاری",HUB_EMPTY:"تاریخچه گفتگو اینجا نمایان می شود",HUB_SHOW_EARLIER:"دیدن گفتگو های قبلی",INBOX_NO_CHATS_TITLE:"هنوز گفتگویی وجود ندارد",INBOX_NO_CHATS_BODY:"بعد از داشتن یک مکالمه یا بیشتر، آنها اینجا نمایان می شوند.",ENABLE_TRANSLATION:"این مکالمه را به فارسی ترجمه کن",DISABLE_TRANSLATION:"زبان اصلی را نشان بده",SEARCH_PLACEHOLDER_TEXT:"...جستجو",SEARCH_SEARCHING:"...در حال جستجو",SEARCH_NO_RESULTS:"نتیجه ای یافت نشد",SEARCH_NO_MORE_RESULTS:"نتیجه بیشتری وجود ندارد",CHAT_NOT_FOUND:"مکالمه پیدا نشد",DELETE_MESSAGE:"حذف پیام ",DELETION_EXPLANATION:"اگر این پیام را حذف کنید، برای همه ناپدید می شود.",EDIT_MESSAGE:"ویرایش پیام",SAVE:"ذخیره",EDITED_INDICATOR:"ویرایششده",REPLY_TO_MESSAGE:"پاسخ دادن",ADD_REACTION:"واکنش را اضافه کنید",AUTH_EXPIRED_OVERLAY_TITLE:"جلسه چت شما منقضی شده است",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"برای ادامه صفحه را بازخوانی کنید",VOICE_MESSAGE:"پیام صوتی",CONTACT_INFORMATION_HIDDEN:"اطلاعات پنهان",LEAVE_CONVERSATION:"خروج از گفتگو",MARK_CONVERSATION_AS_UNREAD:"به عنوان خوانده نشده علامت گذاری کن",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ni={code:"fi-FI",name:"Finnish",translation:{YESTERDAY:"Eilen",TODAY:"Tänään",DAYS:"p",HOURS:"t",MINUTES:"m",JUST_NOW:"juuri nyt",LOCATION:"Sijainti",CANCEL:"Peruuta",INBOX:"Saapuneet",DESKTOP_NOTIFICATIONS:"Selaimen ilmoitukset",DESKTOP_NOTIFICATIONS_ERROR:"Työpöydän ilmoituksia ei voitu kytkeä päälle, koska selaimesi estää ne aktiivisesti. Koeta tutkia sen asetuksia tai vaihda selainta.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo ilmoitus`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Jos pidät tämän sivun auki, näet vastaavan ilmoituksen kun joku puhuu sinulle.",SEND_BUTTON_TEXT:"Lähetä",ENTRYBOX_TEXT_LIMIT:"Maksimissaan 10000 merkkiä.",ENTRYBOX_PLACEHOLDER:"Sano jotain...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Tämä keskustelu ei ole enää aktiivinen.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Voit lukea, mutta et lähettää viestejä.",MESSAGELIST_LOADING_OLDER:"Ladataan vanhoja viestejä..",MESSAGELIST_SHOW_OLDER:"Näytä vanhat viestit",MESSAGELIST_NEW_MARKER:"Uusi",MESSAGE_SENT_VIA_EMAIL:"Tämä viesti on lähetetty sähköpostin välityksellä",YOU_MARKER:"sinä",UPLOAD_IN_PROGRESS:"Ladataan...",UPLOAD_SEND_FILE:"Lähetä tiedosto",UPLOAD_SHARE_LOCATION:"Jaa sijainti",UPLOAD_ERROR:"Valitettavasti jokin meni vikaan. Tiedostotyyppiä ei ehkä tueta tai se saattaa olla liian suuri.",SHARE_LOCATION_ERROR:"Sijaintia ei pystytty jakamaan: ",LOADING:"Ladataan...",HUB_EMPTY:"Keskusteluhistoriasi näkyy tässä",HUB_SHOW_EARLIER:"Näytä aiemmat keskustelut",INBOX_NO_CHATS_TITLE:"Ei keskusteluja, vielä!",INBOX_NO_CHATS_BODY:"Kun olet käynyt yhden tai useamman keskustelun, ne näkyvät täällä.",ENABLE_TRANSLATION:"Käännä keskustelu kielelle suomi",DISABLE_TRANSLATION:"Näytä alkuperäinen",SEARCH_PLACEHOLDER_TEXT:"Etsi...",SEARCH_SEARCHING:"Etsiminen...",SEARCH_NO_RESULTS:"Tuloksia ei löytynyt",SEARCH_NO_MORE_RESULTS:"Ei enempää tuloksia",CHAT_NOT_FOUND:"Keskustelua ei löytynyt",DELETE_MESSAGE:"Poista viesti",DELETION_EXPLANATION:"Jos poistat tämän viestin, se häviää kaikilta.",EDIT_MESSAGE:"Muokkaa viestiä",SAVE:"Tallenna",EDITED_INDICATOR:"muokattu",REPLY_TO_MESSAGE:"Vastaa",ADD_REACTION:"Lisää reaktio",AUTH_EXPIRED_OVERLAY_TITLE:"Istuntosi on vanhentunut",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Päivitä sivu jatkaaksesi",VOICE_MESSAGE:"Ääniviesti",CONTACT_INFORMATION_HIDDEN:"Piilotetut tiedot",LEAVE_CONVERSATION:"Poistu keskustelusta",MARK_CONVERSATION_AS_UNREAD:"Merkitse lukemattomaksi",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},bi={code:"fr-FR",name:"French",translation:{YESTERDAY:"Hier",TODAY:"Aujourd'hui",DAYS:"j",HOURS:"h",MINUTES:"m",JUST_NOW:"maintenant",LOCATION:"Emplacement",CANCEL:"Annuler",INBOX:"Boîte de réception",DESKTOP_NOTIFICATIONS:"Notifications du navigateur",DESKTOP_NOTIFICATIONS_ERROR:"Impossible d'activer les notifications du navigateur car votre navigateur les bloque. Essayez de changer ses paramètres ou de changer de navigateur.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`Notification de démonstration ${e}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Si vous maintenez l'onglet ouvert dans votre navigateur vous verrez apparaître une alerte lorsque quelqu'un vous parlera.",SEND_BUTTON_TEXT:"Envoyer",ENTRYBOX_TEXT_LIMIT:"Seuls 10.000 caractères sont autorisés.",ENTRYBOX_PLACEHOLDER:"Ecrivez quelque chose...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Cette conversation n'est plus active.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Vous pouvez lire, mais pas envoyer de messages.",MESSAGELIST_LOADING_OLDER:"Chargement des anciens messages ...",MESSAGELIST_SHOW_OLDER:"Afficher les anciens messages",MESSAGELIST_NEW_MARKER:"Nouveau",MESSAGE_SENT_VIA_EMAIL:"Ce message a été envoyé par e-mail",YOU_MARKER:"vous",UPLOAD_IN_PROGRESS:"Envoi en cours...",UPLOAD_SEND_FILE:"Envoyer un fichier",UPLOAD_SHARE_LOCATION:"Partager mon emplacement",UPLOAD_ERROR:"Un problème est survenu lors de l'envoi: le fichier est peut-être non pris en charge ou trop volumineux.",SHARE_LOCATION_ERROR:"Impossible de partager votre emplacement: ",LOADING:"Chargement en cours...",HUB_EMPTY:"Votre historique de discussion apparaîtra ici",HUB_SHOW_EARLIER:"Afficher les conversations précédentes",INBOX_NO_CHATS_TITLE:"Aucune conversation pour l'instant!",INBOX_NO_CHATS_BODY:"Une fois que vous aurez eu une ou plusieurs conversations, elles apparaîtront ici.",ENABLE_TRANSLATION:"Traduire cette conversation en français",DISABLE_TRANSLATION:"Remontrer la conversation originale",SEARCH_PLACEHOLDER_TEXT:"Rechercher...",SEARCH_SEARCHING:"Recherche...",SEARCH_NO_RESULTS:"Aucun résultat trouvé",SEARCH_NO_MORE_RESULTS:"Il n’y a plus de résultats",CHAT_NOT_FOUND:"Conversation introuvable",DELETE_MESSAGE:"Supprimer le message",DELETION_EXPLANATION:"Si vous supprimez ce message, il disparaîtra pour tout le monde.",EDIT_MESSAGE:"Modifier le message",SAVE:"Enregistrer",EDITED_INDICATOR:"modifié",REPLY_TO_MESSAGE:"Répondre",ADD_REACTION:"Ajouter une réaction",AUTH_EXPIRED_OVERLAY_TITLE:"Votre session de chat a expiré",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Actualisez la page pour continuer",VOICE_MESSAGE:"Message vocal",CONTACT_INFORMATION_HIDDEN:"Informations masquées",LEAVE_CONVERSATION:"Quitter la conversation",MARK_CONVERSATION_AS_UNREAD:"Marquer comme non lu",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ii={code:"he-IL",name:"Hebrew",translation:{YESTERDAY:"אתמול",TODAY:"היום",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"עכשיו",LOCATION:"מיקום",CANCEL:"בטל",INBOX:"דואר נכנס",DESKTOP_NOTIFICATIONS:"התראות דפדפן",DESKTOP_NOTIFICATIONS_ERROR:"לא ניתן להפעיל התראות במרועה דפדפן מכיוון שהדפדפן שלך חוסם אותן באופן פעיל. נסה להסתכל בהגדרות או להשתמש בדפדפן אחר.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} הודעה על הדגמה`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"אם אתה שומר על כרטיסיית הדפדפן שלך פתוחה, תראה את זה צץ כשמישהו ידבר איתך.",SEND_BUTTON_TEXT:"שלח",ENTRYBOX_TEXT_LIMIT:"רק 10.000 תווים",ENTRYBOX_PLACEHOLDER:"תגיד משהו...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"שיחה זו אינה פעילה עוד.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"אתה יכול לקרוא, אך לא לשלוח הודעות.",MESSAGELIST_LOADING_OLDER:"טוען הודעות ישנות...",MESSAGELIST_SHOW_OLDER:"הצג הודעות ישנות",MESSAGELIST_NEW_MARKER:"חדש",MESSAGE_SENT_VIA_EMAIL:"הודעה זאת נשלחה דרך אימייל",YOU_MARKER:"אתה",UPLOAD_IN_PROGRESS:"מעלה ...",UPLOAD_SEND_FILE:"שלח קובץ",UPLOAD_SHARE_LOCATION:"שתף מיקום",UPLOAD_ERROR:"לרוע המזל משהו השתבש בהעלאה. ייתכן שהקובץ אינו נתמך או גדול מדי.",SHARE_LOCATION_ERROR:"לא ניתן לשתף מיקום: ",LOADING:"טוען...",HUB_EMPTY:"היסטוריית הצ'אט שלך תופיע כאן",HUB_SHOW_EARLIER:"הצג צ'אטים קודמים",INBOX_NO_CHATS_TITLE:"אין עדיין צ'אטים!",INBOX_NO_CHATS_BODY:"לאחר שניהלת שיחה אחת או יותר, הם יופיעו כאן.",ENABLE_TRANSLATION:"תרגם שיחה זו לעברית",DISABLE_TRANSLATION:"הצג מקור",SEARCH_PLACEHOLDER_TEXT:"...חפש",SEARCH_SEARCHING:"...מחפש",SEARCH_NO_RESULTS:"לא נמצאו תוצאות",SEARCH_NO_MORE_RESULTS:"אין תוצאות נוספות",CHAT_NOT_FOUND:"הצ'אט לא נמצא",DELETE_MESSAGE:"מחיקת הודעה",DELETION_EXPLANATION:"אם תמחק הודעה זו, היא תיעלם עבור כולם.",EDIT_MESSAGE:"עריכת הודעה",SAVE:"שמור",EDITED_INDICATOR:"ערוך",REPLY_TO_MESSAGE:"השב",ADD_REACTION:"הוספת תגובה",AUTH_EXPIRED_OVERLAY_TITLE:"הפעלת הצ׳אט שלכם פגה",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"רעננו את העמוד כדי להמשיך",VOICE_MESSAGE:"הודעה קולית",CONTACT_INFORMATION_HIDDEN:"מידע מוסתר",LEAVE_CONVERSATION:"צא מהשיחה",MARK_CONVERSATION_AS_UNREAD:"סמן כלא נקרא",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ri={code:"hi-IN",name:"Hindi (IN)",translation:{YESTERDAY:"कल",TODAY:"आज",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"अभी",LOCATION:"जगह",CANCEL:"रद्द करें",INBOX:"इनबॉक्स",DESKTOP_NOTIFICATIONS:"ब्राउज़र सूचनाएं",DESKTOP_NOTIFICATIONS_ERROR:"ब्राउज़र सूचनाएं सक्षम नहीं कर सकता क्योंकि आपका ब्राउज़र सक्रिय रूप से उन्हें ब्लॉक करता है। सेटिंग्स में देखने या एक अलग ब्राउज़र का उपयोग करने का प्रयास करें।",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} डेमो अधिसूचना`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"यदि आप अपना ब्राउज़र टैब खुला रखते हैं, तो यह पॉप अप आपको तब दिखाई देगा जब कोई आपसे बात करेगा।",SEND_BUTTON_TEXT:"भेजें",ENTRYBOX_TEXT_LIMIT:"केवल 10,000 वर्णों की अनुमति है।",ENTRYBOX_PLACEHOLDER:"कुछ कहिए...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"यह चैट अब सक्रिय नहीं है।",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"आप पढ़ सकते हैं, लेकिन संदेश नहीं भेज सकते।",MESSAGELIST_LOADING_OLDER:"पुराने संदेश लोड हो रहे हैं ...",MESSAGELIST_SHOW_OLDER:"पुराने संदेश दिखाएं",MESSAGELIST_NEW_MARKER:"नया",MESSAGE_SENT_VIA_EMAIL:"यह संदेश ईमेल के माध्यम से भेजा गया था",YOU_MARKER:"आप",UPLOAD_IN_PROGRESS:"अपलोड हो रहा है...",UPLOAD_SEND_FILE:"फाइल भेजें",UPLOAD_SHARE_LOCATION:"जगह शेयर करें",UPLOAD_ERROR:"दुर्भाग्य से, अपलोड करते समय कुछ गलत हो गया। फ़ाइल असमर्थित या बहुत बड़ी हो सकती है।",SHARE_LOCATION_ERROR:"जगह शेयर नहीं हो पाया: ",LOADING:"लोड हो रहा है...",HUB_EMPTY:"आपका चैट इतिहास यहां दिखाई देगा",HUB_SHOW_EARLIER:"पहले की चैट दिखाओ",INBOX_NO_CHATS_TITLE:"अभी तक कोई चैट नहीं!",INBOX_NO_CHATS_BODY:"एक बार जब आप एक या अधिक चैट कर लेते हैं, तो वे यहां दिखाई देंगे।",ENABLE_TRANSLATION:"इस बातचीत का हिंदी में अनुवाद कीजिए",DISABLE_TRANSLATION:"मूल दिखाएँ",SEARCH_PLACEHOLDER_TEXT:"खोजें...",SEARCH_SEARCHING:"खोज जारी है...",SEARCH_NO_RESULTS:"कोई परिणाम नहीं मिला",SEARCH_NO_MORE_RESULTS:"और कोई परिणाम नहीं",CHAT_NOT_FOUND:"चैट नहीं मिली",DELETE_MESSAGE:"संदेश डिलीट करें",DELETION_EXPLANATION:"यदि आप इस संदेश को हटाते हैं, तो यह सभी के लिए गायब हो जाएगा.",EDIT_MESSAGE:"संदेश में बदलाव करें",SAVE:"सहेजें",EDITED_INDICATOR:"संपादित किया गया",REPLY_TO_MESSAGE:"जवाब दीजिए ।",ADD_REACTION:"प्रतिक्रिया जोड़ें",AUTH_EXPIRED_OVERLAY_TITLE:"आपका चैट सेशन समाप्त हो चुका है",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"आगे बढ़ने के लिए रिफ्रेश करें",VOICE_MESSAGE:"वॉयस मैसेज",CONTACT_INFORMATION_HIDDEN:"छुपी हुई जानकारी",LEAVE_CONVERSATION:"बातचीत को ख़त्म करें",MARK_CONVERSATION_AS_UNREAD:"अपठित के रूप में चिह्नित करें",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},wi={code:"hr-HR",name:"Croatian",translation:{YESTERDAY:"Jučer",TODAY:"Danas",DAYS:"d",HOURS:"s",MINUTES:"m",JUST_NOW:"Upravo sad",LOCATION:"Lokacija",CANCEL:"Otkaži",INBOX:"Pretinac",DESKTOP_NOTIFICATIONS:"Obavijesti preglednika",DESKTOP_NOTIFICATIONS_ERROR:"Notifikacije preglednika nisu omogućene jer ih vaš preglednik aktivno blokira. Pokušajte pogledati postavke ili koristiti neki drugi preglednik.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notifikacija`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ako karticu preglednika ostavite otvorenu, pojavit će se ovaj pop-up kada netko razgovara s vama.",SEND_BUTTON_TEXT:"Pošalji",ENTRYBOX_TEXT_LIMIT:"Dozvoljeno je samo 10.000 znakova.",ENTRYBOX_PLACEHOLDER:"Reci nešto...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ovaj razgovor više nije aktivan.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Možeš čitati, ali ne i slati poruke.",MESSAGELIST_LOADING_OLDER:"Učitavam starije poruke...",MESSAGELIST_SHOW_OLDER:"Prikaži starije poruke",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Ova poruka je poslana e-poštom",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Učitavam...",UPLOAD_SEND_FILE:"Pošalji datoteku",UPLOAD_SHARE_LOCATION:"Podijeli lokaciju",UPLOAD_ERROR:"Nažalost, nešto je pošlo krivo. Datoteka možda nije podržana ili je prevelika.",SHARE_LOCATION_ERROR:"Nije moguće podijeliti lokaciju: ",LOADING:"Učitavam...",HUB_EMPTY:"Ovdje će se prikazati vaša povijest razgovora",HUB_SHOW_EARLIER:"Prikaži ranije razgovore",INBOX_NO_CHATS_TITLE:"Nema razgovora!",INBOX_NO_CHATS_BODY:"Nakon što vodite jedan ili više razgovora, oni će se pojaviti ovdje.",ENABLE_TRANSLATION:"Prevedi ovaj razgovor na hrvatski jezik",DISABLE_TRANSLATION:"Prikaži original",SEARCH_PLACEHOLDER_TEXT:"Pretraži...",SEARCH_SEARCHING:"Pretraživanje...",SEARCH_NO_RESULTS:"Nema rezultata",SEARCH_NO_MORE_RESULTS:"Nema više rezultata",CHAT_NOT_FOUND:"Razgovor nije pronađen",DELETE_MESSAGE:"Obriši poruku",DELETION_EXPLANATION:"Ako izbrišete ovu poruku, nestat će za sve.",EDIT_MESSAGE:"Uredi poruku",SAVE:"Spremi",EDITED_INDICATOR:"uređivao",REPLY_TO_MESSAGE:"Odgovorite",ADD_REACTION:"Dodajte reakciju",AUTH_EXPIRED_OVERLAY_TITLE:"Vaša sesija razgovora je istekla",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Osvježite stranicu za nastavak",VOICE_MESSAGE:"Glasovna poruka",CONTACT_INFORMATION_HIDDEN:"Skrivene informacije",LEAVE_CONVERSATION:"Napustiti razgovor",MARK_CONVERSATION_AS_UNREAD:"Označi kao nepročitano",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},ki={code:"hu-HU",name:"Hungarian",translation:{YESTERDAY:"Tegnap",TODAY:"Ma",DAYS:"n",HOURS:"ó",MINUTES:"p",JUST_NOW:"éppen most",LOCATION:"Helyszín",CANCEL:"Visszavonás",INBOX:"Postaláda",DESKTOP_NOTIFICATIONS:"Böngésző értesítések",DESKTOP_NOTIFICATIONS_ERROR:"Azért nem tudja bekapcsolni a böngésző értesítések funkciót, mert böngészője aktívan blokkolja azt. Tekintse meg a beállításokat vagy használjon másik böngészőt.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo értesítés`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ha nyitva hagyja böngészőjét, felugró ablak fog megjelenni, ha valaki beszélni szeretne Önnel.",SEND_BUTTON_TEXT:"Küldés",ENTRYBOX_TEXT_LIMIT:"Mindőssze 10.000 karakter megengedett.",ENTRYBOX_PLACEHOLDER:"Mondjon valamit...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ez a beszélgetés már nem aktív.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Elolvashatja az üzeneteket, de nem küldhet újat.",MESSAGELIST_LOADING_OLDER:"Korábbi üzenetek betöltése...",MESSAGELIST_SHOW_OLDER:"Korábbi üzenetek megjelenítése",MESSAGELIST_NEW_MARKER:"Új",MESSAGE_SENT_VIA_EMAIL:"Ez az üzenet e-mailben került elküldésre",YOU_MARKER:"Ön",UPLOAD_IN_PROGRESS:"Feltöltés...",UPLOAD_SEND_FILE:"Fájl küldése",UPLOAD_SHARE_LOCATION:"Helyszín megosztása",UPLOAD_ERROR:"Sajnos hiba történt a feltöltés során. A fájl nem támogatott vagy túl nagy.",SHARE_LOCATION_ERROR:"Helyszín megosztása nem lehetséges: ",LOADING:"Betöltés...",HUB_EMPTY:"A beszélgetések előzményei itt láthatók",HUB_SHOW_EARLIER:"Korábbi beszélgetések megjelenítése",INBOX_NO_CHATS_TITLE:"Még nincs megjeleníthető beszélgetés!",INBOX_NO_CHATS_BODY:"Amint egy vagy több beszélgetéssel rendelkezik, azok itt fognak megjelenni.",ENABLE_TRANSLATION:"A beszélgetés lefordítása erre a nyelvre: magyar",DISABLE_TRANSLATION:"Eredeti megjelenítése",SEARCH_PLACEHOLDER_TEXT:"Keresés...",SEARCH_SEARCHING:"Keresés...",SEARCH_NO_RESULTS:"Nincs találat",SEARCH_NO_MORE_RESULTS:"Nincs több találat",CHAT_NOT_FOUND:"A csevegés nem található",DELETE_MESSAGE:"Üzenet törlése",DELETION_EXPLANATION:"Ha törlöd ezt az üzenetet, az mindenki számára eltűnik.",EDIT_MESSAGE:"Üzenet szerkesztése",SAVE:"Mentés",EDITED_INDICATOR:"szerkesztve",REPLY_TO_MESSAGE:"Válaszadás",ADD_REACTION:"Reagálás erre",AUTH_EXPIRED_OVERLAY_TITLE:"Chat munkamenete lejárt",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Folytatáshoz frissítse az oldalt",VOICE_MESSAGE:"Hangüzenet",CONTACT_INFORMATION_HIDDEN:"Rejtett információ",LEAVE_CONVERSATION:"Kilépés a beszélgetésből",MARK_CONVERSATION_AS_UNREAD:"Megjelölés olvasatlanként",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Li={code:"id-ID",name:"Bahasa Indonesia",translation:{YESTERDAY:"Kemarin",TODAY:"Hari ini",DAYS:"h",HOURS:"j",MINUTES:"m",JUST_NOW:"sekarang",LOCATION:"Lokasi",CANCEL:"Batal",INBOX:"Kotak Masuk",DESKTOP_NOTIFICATIONS:"Notifikasi peramban",DESKTOP_NOTIFICATIONS_ERROR:"Tidak dapat mengaktifkan pemberitahuan browser karena browser Anda secara aktif memblokir mereka. Coba cari di pengaturan atau menggunakan browser yang berbeda.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`pemberitahuan demo ${e}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Jika Anda membiarkan tab browser tetap terbuka, Anda akan melihat ini muncul ketika seseorang berbicara kepada Anda.",SEND_BUTTON_TEXT:"Kirim",ENTRYBOX_TEXT_LIMIT:"Hanya 10.000 karakter yang diizinkan.",ENTRYBOX_PLACEHOLDER:"Katakan sesuatu...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Percakapan ini tidak lagi aktif.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Anda dapat membaca, tetapi tidak mengirim pesan.",MESSAGELIST_LOADING_OLDER:"Memuat pesan lama...",MESSAGELIST_SHOW_OLDER:"Tampilkan pesan yang lebih lama",MESSAGELIST_NEW_MARKER:"Baru",MESSAGE_SENT_VIA_EMAIL:"Pesan ini dikirim melalui email",YOU_MARKER:"Anda",UPLOAD_IN_PROGRESS:"Mengunggah...",UPLOAD_SEND_FILE:"Kirim mengajukan",UPLOAD_SHARE_LOCATION:"Bagikan lokasi",UPLOAD_ERROR:"Ada yang salah diunggah. File mungkin tidak didukung atau terlalu besar.",SHARE_LOCATION_ERROR:"Tidak dapat membagikan lokasi: ",LOADING:"Memuat...",HUB_EMPTY:"Riwayat obrolan Anda akan muncul di sini",HUB_SHOW_EARLIER:"Tampilkan obrolan sebelumnya",INBOX_NO_CHATS_TITLE:"Belum ada obrolan!",INBOX_NO_CHATS_BODY:"Setelah Anda melakukan satu atau lebih percakapan, mereka akan muncul di sini.",ENABLE_TRANSLATION:"Terjemahkan percakapan ini ke Indonesia",DISABLE_TRANSLATION:"Perlihatkan asli",SEARCH_PLACEHOLDER_TEXT:"Cari...",SEARCH_SEARCHING:"Mencari...",SEARCH_NO_RESULTS:"Tidak ditemukan hasil",SEARCH_NO_MORE_RESULTS:"Tidak ada hasil lainnya",CHAT_NOT_FOUND:"Obrolan tidak ditemukan",DELETE_MESSAGE:"Hapus pesan",DELETION_EXPLANATION:"Jika pesan ini Anda hapus, pesan ini akan tidak terlihat bagi siapa pun.",EDIT_MESSAGE:"Sunting pesan",SAVE:"Mentés",EDITED_INDICATOR:"diedit",REPLY_TO_MESSAGE:"Balas",ADD_REACTION:"Tambah reaksi",AUTH_EXPIRED_OVERLAY_TITLE:"Sesi obrolan Anda sudah lewat batas waktu",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Muat ulang halaman untuk melanjutkan",VOICE_MESSAGE:"Pesan suara",CONTACT_INFORMATION_HIDDEN:"Informasi tersembunyi",LEAVE_CONVERSATION:"Tinggalkan percakapan",MARK_CONVERSATION_AS_UNREAD:"Tandai sebagai Belum dibaca",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},xi={code:"it-IT",name:"Italian",translation:{YESTERDAY:"Ieri",TODAY:"Oggi",DAYS:"g",HOURS:"o",MINUTES:"m",JUST_NOW:"adesso",LOCATION:"Posizione",CANCEL:"Annulla",INBOX:"Posta in arrivo",DESKTOP_NOTIFICATIONS:"Notifiche browser",DESKTOP_NOTIFICATIONS_ERROR:"Impossibile abilitare le notifiche browser perché il browser le blocca attivamente. Prova a cercare le impostazioni o utilizzare un browser diverso.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notification`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Se si mantiene aperta la scheda del browser, questo verrà visualizzato quando qualcuno ti parla.",SEND_BUTTON_TEXT:"Invia",ENTRYBOX_TEXT_LIMIT:"Sono consentiti solo 10.000 caratteri.",ENTRYBOX_PLACEHOLDER:"Dì qualcosa...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Questa conversazione non è più attiva.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Puoi leggere, ma non inviare messaggi.",MESSAGELIST_LOADING_OLDER:"Caricamento dei messaggi precedenti...",MESSAGELIST_SHOW_OLDER:"Mostra messaggi precedenti",MESSAGELIST_NEW_MARKER:"Nuovo",MESSAGE_SENT_VIA_EMAIL:"Questo messaggio è stato inviato via email",YOU_MARKER:"tu",UPLOAD_IN_PROGRESS:"Caricamento in corso...",UPLOAD_SEND_FILE:"Invia file",UPLOAD_SHARE_LOCATION:"Condividi posizione",UPLOAD_ERROR:"Qualcosa è andato storto durante il caricamento. Il file potrebbe non essere supportato o troppo grande.",SHARE_LOCATION_ERROR:"Impossibile condividere la posizione: ",LOADING:"Caricamento in corso...",HUB_EMPTY:"La cronologia della tua chat verrà mostrata qui",HUB_SHOW_EARLIER:"Mostra chat precedenti",INBOX_NO_CHATS_TITLE:"Non ci sono ancora chat!",INBOX_NO_CHATS_BODY:"Una volta che hai avuto una o più conversazioni, verranno visualizzate qui.",ENABLE_TRANSLATION:"Traduci questa conversazione in italiano",DISABLE_TRANSLATION:"Mostra l'originale",SEARCH_PLACEHOLDER_TEXT:"Cerca...",SEARCH_SEARCHING:"Cercando...",SEARCH_NO_RESULTS:"Nessun risultato trovato",SEARCH_NO_MORE_RESULTS:"Non ci sono più risultati",CHAT_NOT_FOUND:"Chat non trovata",DELETE_MESSAGE:"Elimina messaggio",DELETION_EXPLANATION:"Se elimini il messaggio, questo scomparirà per tutti.",EDIT_MESSAGE:"Modifica messaggio",SAVE:"Salva",EDITED_INDICATOR:"modificato",REPLY_TO_MESSAGE:"Rispondi",ADD_REACTION:"Aggiungi reazione",AUTH_EXPIRED_OVERLAY_TITLE:"La sessione di chat è scaduta",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Aggiorna la pagina per continuare",VOICE_MESSAGE:"Messaggio vocale",CONTACT_INFORMATION_HIDDEN:"Informazioni nascoste",LEAVE_CONVERSATION:"Abbandona la conversazione",MARK_CONVERSATION_AS_UNREAD:"Segna come non letto",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Mi={code:"ja-JP",name:"Japanese",translation:{YESTERDAY:"昨日",TODAY:"今日",DAYS:"日前",HOURS:"時間前",MINUTES:"分前",JUST_NOW:"たった今",LOCATION:"場所",CANCEL:"キャンセル",INBOX:"受信箱",DESKTOP_NOTIFICATIONS:"ブラウザの通知",DESKTOP_NOTIFICATIONS_ERROR:"ブラウザの通知はブロックされているため、ブラウザの通知を有効にできません。設定を確認するか、別のブラウザを使用してください。",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} デモ通知`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"ブラウザのタブを開いたままにしておくと、誰かがあなたに話しかけたときにこのポップアップが表示されます。",SEND_BUTTON_TEXT:"送信",ENTRYBOX_TEXT_LIMIT:"許可されているのは10.000文字までです。",ENTRYBOX_PLACEHOLDER:"メッセージを入力してください",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"この会話はもうアクティブではありません。",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"あなたは読むことはできますが、メッセージを送ることはできません。",MESSAGELIST_LOADING_OLDER:"古いメッセージを読み込んでいます...",MESSAGELIST_SHOW_OLDER:"古いメッセージを表示",MESSAGELIST_NEW_MARKER:"新着",MESSAGE_SENT_VIA_EMAIL:"このメッセージはメールで送信されました",YOU_MARKER:"あなたは",UPLOAD_IN_PROGRESS:"アップロード中...",UPLOAD_SEND_FILE:"ファイル送信",UPLOAD_SHARE_LOCATION:"共有場所",UPLOAD_ERROR:"アップロード中に問題が発生しました。ファイルがサポートされていないか、大きすぎる可能性があります。",SHARE_LOCATION_ERROR:"場所を共有できません: ",LOADING:"読み込み中...",HUB_EMPTY:"あなたのチャット履歴がここに表示されます",HUB_SHOW_EARLIER:"以前のチャットを表示",INBOX_NO_CHATS_TITLE:"まだチャットがありません!",INBOX_NO_CHATS_BODY:"会話が1つ以上あると、ここに表示されます",ENABLE_TRANSLATION:"この会話を日本語に翻訳する",DISABLE_TRANSLATION:"オリジナルを表示",SEARCH_PLACEHOLDER_TEXT:"検索...",SEARCH_SEARCHING:"検索中...",SEARCH_NO_RESULTS:"結果が見つかりません",SEARCH_NO_MORE_RESULTS:"これ以上結果はありません",CHAT_NOT_FOUND:"チャットが見つかりませんでした",DELETE_MESSAGE:"メッセージを削除する",DELETION_EXPLANATION:"このメッセージを削除すると、全ての人に表示されなくなります。",EDIT_MESSAGE:"メッセージを編集する",SAVE:"上書き保存",EDITED_INDICATOR:"編集",REPLY_TO_MESSAGE:"返信する",ADD_REACTION:"リアクションを追加",AUTH_EXPIRED_OVERLAY_TITLE:"チャットセッションの有効期限が切れました",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"続けるにはページを更新してください",VOICE_MESSAGE:"ボイスメッセージ",CONTACT_INFORMATION_HIDDEN:"機密情報",LEAVE_CONVERSATION:"会話をやめる",MARK_CONVERSATION_AS_UNREAD:"未読としてマーク",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Fi={code:"ka-GE",name:"Georgian",translation:{YESTERDAY:"გუშინ",TODAY:"დღეს",DAYS:"დღ",HOURS:"სთ",MINUTES:"წთ",JUST_NOW:"ახლა",LOCATION:"ადგილმდებარეობა",CANCEL:"გაუქმება",INBOX:"მიღებული შეტყობინება",DESKTOP_NOTIFICATIONS:"ბრაუზერის შეტყობინებები",DESKTOP_NOTIFICATIONS_ERROR:"შეუძლებელია ბრაუზერის შეტკობინებების ჩართვა. ეს ბრაუზერი ბლოკავს მათ. სცადე ცვლილება ოპციებიდან ან გამოიყენე სხვა ბრაუზერი.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} შეტყობინებების დემო ვერსია`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"თუ დატოვებ ბრაუზერის ფანჯარას გახსნილს, როცა ვიღაც მოგწერს საუბარი ამოვარდება დესკტოპზე.",SEND_BUTTON_TEXT:"გაგზავნა",ENTRYBOX_TEXT_LIMIT:"დაშვებულია მხოლოდ 10.000 სიმბოლო.",ENTRYBOX_PLACEHOLDER:"დაწერე რაღაც...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"ეს დიალოგი აღარ არის ხელმისაწვდომი.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"შეგიძლია წაიკითხო, მაგრამ ვერ გააგზავნი შეტყობინებას.",MESSAGELIST_LOADING_OLDER:"იტვირთება ძველი შეტყობინებები...",MESSAGELIST_SHOW_OLDER:"ძველი შეტყობინებების ჩვენება",MESSAGELIST_NEW_MARKER:"ახალი",MESSAGE_SENT_VIA_EMAIL:"ეს შეტყობინება გამოგზავნილია იმეილით",YOU_MARKER:"you",UPLOAD_IN_PROGRESS:"იტვირთება...",UPLOAD_SEND_FILE:"ფაილის გაგზავნა",UPLOAD_SHARE_LOCATION:"ადგილმდებარეობის გაზიარება",UPLOAD_ERROR:"პრობლემაა ატვირთვისას. ფაილის შესაძლოა არის არათავსებადი ან ძალიან დიდი.",SHARE_LOCATION_ERROR:"შეუძლებელია ადგილმდებარეობის გაზიარება: ",LOADING:"იტვირთება...",HUB_EMPTY:"საუბრების ისტორია გამოჩნდება აქ",HUB_SHOW_EARLIER:"წინა საუბრების ნახვა",INBOX_NO_CHATS_TITLE:"ჯერ-ჯერობით არ არის საუბრები!",INBOX_NO_CHATS_BODY:"უკვე დასრულებული საუბარები გამოჩნდება აქ",ENABLE_TRANSLATION:"თარგმნეთ ეს საუბარი ინგლისურად",DISABLE_TRANSLATION:"ორიგინალის ჩვენება",SEARCH_PLACEHOLDER_TEXT:"ძიება...",SEARCH_SEARCHING:"მიმდინარეობს ძიება...",SEARCH_NO_RESULTS:"შედეგები ვერ ქართველი",SEARCH_NO_MORE_RESULTS:"სხვა შედეგი ვერ მოიძებნა",CHAT_NOT_FOUND:"ჩატი ვერ მოიძებნა",DELETE_MESSAGE:"შეტყობინების წაშლა ",DELETION_EXPLANATION:"თუ ამ შეტყობინებას წაშლით, ის ყველასთვის გაქრება.",EDIT_MESSAGE:"შეტყობინების რედაქტირება",SAVE:"შენახვა",EDITED_INDICATOR:"რედაქტირებულია",REPLY_TO_MESSAGE:"პასუხის გაცემა",ADD_REACTION:"დაამატეთ რეაქცია",AUTH_EXPIRED_OVERLAY_TITLE:"თქვენი ჩეთის სესიის ვადა ამოიწურა",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"განაახლეთ გვერდი გასაგრძელებლად",VOICE_MESSAGE:"ხმოვანი შეტყობინება",CONTACT_INFORMATION_HIDDEN:"ფარული ინფორმაცია",LEAVE_CONVERSATION:"საუბრის დატოვება",MARK_CONVERSATION_AS_UNREAD:"წაუკითხავად მონიშვნა",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Bi={code:"ko-KR",name:"Korean (South Korea)",translation:{YESTERDAY:"어제",TODAY:"오늘",DAYS:"일 전",HOURS:"시간 전",MINUTES:"분 전",JUST_NOW:"방금",LOCATION:"위치",CANCEL:"취소",INBOX:"대화 목록",DESKTOP_NOTIFICATIONS:"브라우저 알림",DESKTOP_NOTIFICATIONS_ERROR:"브라우저 알림을 표시할 수 없습니다. 브라우저 설정을 확인하거나 다른 브라우저를 사용해주세요.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} 데모 알림`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"브라우저 탭을 열어 둔 상태에서 누군가 대화 할 때 이 팝업이 표시됩니다.",SEND_BUTTON_TEXT:"전송",ENTRYBOX_TEXT_LIMIT:"최대 10,000자까지 입력할 수 있습니다.",ENTRYBOX_PLACEHOLDER:"메세지를 입력하세요...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"채팅이 종료되었습니다.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"읽기만 가능하며 메시지를 보낼 수 없습니다.",MESSAGELIST_LOADING_OLDER:"이전 메시지 로드 중...",MESSAGELIST_SHOW_OLDER:"이전 메시지 표시",MESSAGELIST_NEW_MARKER:"새 메시지",MESSAGE_SENT_VIA_EMAIL:"이 메시지는 이메일을 통해 전송되었습니다.",YOU_MARKER:"나",UPLOAD_IN_PROGRESS:"업로드 중...",UPLOAD_SEND_FILE:"파일 전송",UPLOAD_SHARE_LOCATION:"위치 공유",UPLOAD_ERROR:"업로드가 실패했습니다. 파일이 지원되지 않거나 너무 클 수 있습니다.",SHARE_LOCATION_ERROR:"위치를 공유 할 수 없습니다: ",LOADING:"로드 중...",HUB_EMPTY:"채팅 기록이 여기에 표시됩니다",HUB_SHOW_EARLIER:"이전 채팅보기",INBOX_NO_CHATS_TITLE:"아직 채팅이 없습니다!",INBOX_NO_CHATS_BODY:"대화가 하나 이상 있으면 여기에 표시됩니다.",ENABLE_TRANSLATION:"이 대화를 한국어로 번역",DISABLE_TRANSLATION:"원본 표시",SEARCH_PLACEHOLDER_TEXT:"검색...",SEARCH_SEARCHING:"검색 중...",SEARCH_NO_RESULTS:"검색 결과 없음",SEARCH_NO_MORE_RESULTS:"추가 검색 결과 없음",CHAT_NOT_FOUND:"대화를 찾지 못했습니다",DELETE_MESSAGE:"메시지 삭제",DELETION_EXPLANATION:"이 메시지를 삭제하면 모든 사람이 볼 수 없게 됩니다.",EDIT_MESSAGE:"메시지 편집하기",SAVE:"저장",EDITED_INDICATOR:"편집",REPLY_TO_MESSAGE:"회신",ADD_REACTION:"반응 추가",AUTH_EXPIRED_OVERLAY_TITLE:"채팅 세션이 만료되었습니다",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"계속하려면 페이지를 새로고침하세요",VOICE_MESSAGE:"음성 메시지",CONTACT_INFORMATION_HIDDEN:"숨겨진 정보",LEAVE_CONVERSATION:"대화 떠나기",MARK_CONVERSATION_AS_UNREAD:"읽지 않은 상태로 표시",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Pi={code:"nb-NO",name:"Norwegian (Bokmål)",translation:{YESTERDAY:"I går",TODAY:"I dag",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"Nå",LOCATION:"Plassering",CANCEL:"Avbryt",INBOX:"Innboks",DESKTOP_NOTIFICATIONS:"Nettleservarsler",DESKTOP_NOTIFICATIONS_ERROR:"Kan ikke aktivere Nettleservarsler fordi nettleseren din aktivt blokkerer dem. Prøv å se i innstillingene eller bruke en annen nettleser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo varslinger`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Hvis du holder nettleservinduet åpent, vil du se dette varsel når noen snakker til deg.",SEND_BUTTON_TEXT:"Send",ENTRYBOX_TEXT_LIMIT:"Kun 10.000 tegn er tillatt.",ENTRYBOX_PLACEHOLDER:"Si noe...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Denne samtale er ikke lengre aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Du kan lese, men ikke sende meldinger.",MESSAGELIST_LOADING_OLDER:"Laster eldre meldinger...",MESSAGELIST_SHOW_OLDER:"Vis eldre meldinger",MESSAGELIST_NEW_MARKER:"Ny",MESSAGE_SENT_VIA_EMAIL:"Denne meldingen er sendt via e-post",YOU_MARKER:"deg",UPLOAD_IN_PROGRESS:"Laster opp...",UPLOAD_SEND_FILE:"Send fil",UPLOAD_SHARE_LOCATION:"Del din plassering",UPLOAD_ERROR:"Noe gikk galt i uplastingen. Det kan være filen ikke støttes eller for stor.",SHARE_LOCATION_ERROR:"Kan ikke dele plasseringen: ",LOADING:"Laster...",HUB_EMPTY:"Din chats historikk vil vises her",HUB_SHOW_EARLIER:"Vis tidligere chats",INBOX_NO_CHATS_TITLE:"Ingen chats enda!",INBOX_NO_CHATS_BODY:"Så snart du får en eller flere samtaler, vil de vises her.",ENABLE_TRANSLATION:"Oversett denne samtalen til norsk",DISABLE_TRANSLATION:"Vis original",SEARCH_PLACEHOLDER_TEXT:"Søk...",SEARCH_SEARCHING:"Søker...",SEARCH_NO_RESULTS:"Finner ingen resultater",SEARCH_NO_MORE_RESULTS:"Ingen flere resultater",CHAT_NOT_FOUND:"Chat ikke funnet",DELETE_MESSAGE:"Slett melding",DELETION_EXPLANATION:"Hvis du sletter denne meldingen, forsvinner den for alle.",EDIT_MESSAGE:"Rediger melding",SAVE:"Lagre",EDITED_INDICATOR:"redigert",REPLY_TO_MESSAGE:"Svar",ADD_REACTION:"Legg til reaksjon",AUTH_EXPIRED_OVERLAY_TITLE:"Chatøkten er utløpt",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Oppdater siden for å fortsette",VOICE_MESSAGE:"Lydmelding",CONTACT_INFORMATION_HIDDEN:"Skjult informasjon",LEAVE_CONVERSATION:"Forlat samtalen",MARK_CONVERSATION_AS_UNREAD:"Merk som ulest",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ui={code:"nl-NL",name:"Dutch",translation:{YESTERDAY:"Gisteren",TODAY:"Vandaag",DAYS:"d",HOURS:"u",MINUTES:"m",JUST_NOW:"zojuist",LOCATION:"Locatie",CANCEL:"Annuleren",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Browsermeldingen",DESKTOP_NOTIFICATIONS_ERROR:"Browsermeldingen kunnen niet geactiveerd worden omdat de browser het blokkeert. Check de instellingen van je browser of probeer een andere browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notificatie`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Als je je browser open houdt, zie je deze popup als iemand tegen je praat.",SEND_BUTTON_TEXT:"Verzenden",ENTRYBOX_TEXT_LIMIT:"Maximaal 10.000 tekens toegestaan.",ENTRYBOX_PLACEHOLDER:"Typ een bericht...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Dit gesprek is niet actief meer.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Je kunt geen berichten sturen.",MESSAGELIST_LOADING_OLDER:"Eerdere berichten laden...",MESSAGELIST_SHOW_OLDER:"Laad eerdere berichten",MESSAGELIST_NEW_MARKER:"Nieuw",MESSAGE_SENT_VIA_EMAIL:"Dit bericht is verstuurd via e-mail",YOU_MARKER:"jij",UPLOAD_IN_PROGRESS:"Uploaden...",UPLOAD_SEND_FILE:"Verzend bestand",UPLOAD_SHARE_LOCATION:"Deel locatie",UPLOAD_ERROR:"Er ging iets mis. Het bestand wordt niet ondersteund of is te groot.",SHARE_LOCATION_ERROR:"Locatie delen mislukt: ",LOADING:"Bezig met laden...",HUB_EMPTY:"Berichtengeschiedenis wordt hier weergegeven",HUB_SHOW_EARLIER:"Laat eerdere berichten zien",INBOX_NO_CHATS_TITLE:"Nog geen chats!",INBOX_NO_CHATS_BODY:"Zodra je een of meerdere conversaties hebt gehad, worden deze hier weergegeven.",ENABLE_TRANSLATION:"Vertaal dit gesprek naar het Nederlands",DISABLE_TRANSLATION:"Toon oorspronkelijk gesprek",SEARCH_PLACEHOLDER_TEXT:"Zoek...",SEARCH_SEARCHING:"Zoeken...",SEARCH_NO_RESULTS:"Geen resultaten gevonden",SEARCH_NO_MORE_RESULTS:"Niet meer resultaten",CHAT_NOT_FOUND:"Chat niet gevonden",DELETE_MESSAGE:"Bericht verwijderen",DELETION_EXPLANATION:"Als je dit bericht verwijdert, zal het voor iedereen verdwijnen.",EDIT_MESSAGE:"Bericht bewerken",SAVE:"Opslaan",EDITED_INDICATOR:"bewerkt",REPLY_TO_MESSAGE:"Beantwoorden",ADD_REACTION:"Reactie toevoegen",AUTH_EXPIRED_OVERLAY_TITLE:"Je chatsessie is verlopen",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Ververs de pagina om door te gaan",VOICE_MESSAGE:"Spraakbericht",CONTACT_INFORMATION_HIDDEN:"verborgen informatie",LEAVE_CONVERSATION:"Gesprek verlaten",MARK_CONVERSATION_AS_UNREAD:"Markeren als ongelezen",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Hi={code:"pl-PL",name:"Polish",translation:{YESTERDAY:"Wczoraj",TODAY:"Dzisiaj",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"teraz",LOCATION:"Lokalizacja",CANCEL:"Anuluj",INBOX:"Skrzynka odbiorcza",DESKTOP_NOTIFICATIONS:"Powiadomienia",DESKTOP_NOTIFICATIONS_ERROR:"Nie można aktywować powiadomień, ponieważ twoja przeglądarka je blokuje. Proszę zmienić ustawienie lub spróbować innej przeglądarki.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} przykładowe powiadomienie`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Jeśli zostawisz tę kartę otwartą, zobaczysz takie powiadomienie, gdy ktoś napisze do Ciebie.",SEND_BUTTON_TEXT:"Wyślij",ENTRYBOX_TEXT_LIMIT:"Nie można wysyłać więcej niż 10000 znaków.",ENTRYBOX_PLACEHOLDER:"Napisz coś...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ten czat nie jest aktywny.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Możesz czytać wiadomości, ale nie możesz ich wysyłać.",MESSAGELIST_LOADING_OLDER:"Wczytuję starsze wiadomości...",MESSAGELIST_SHOW_OLDER:"Zobacz starsze wiadomości",MESSAGELIST_NEW_MARKER:"Nowe",MESSAGE_SENT_VIA_EMAIL:"Ta wiadomość została wysłana przez email.",YOU_MARKER:"ty",UPLOAD_IN_PROGRESS:"Przesyłanie...",UPLOAD_SEND_FILE:"Prześlij plik",UPLOAD_SHARE_LOCATION:"Udostępnij lokalizację",UPLOAD_ERROR:"Coś poszło nie tak. Plik może być zbyt duży lub jest nieobsługiwany.",SHARE_LOCATION_ERROR:"Nie da się udostępnić lokalizacji: ",LOADING:"Ładowanie...",HUB_EMPTY:"Twoje czaty pojawią się tutaj",HUB_SHOW_EARLIER:"Zobacz starsze czaty",INBOX_NO_CHATS_TITLE:"Brak czatów!",INBOX_NO_CHATS_BODY:"Rozpoczęte konwersacje pojawią się tutaj.",ENABLE_TRANSLATION:"Przetłumacz tę konwersację na język polski",DISABLE_TRANSLATION:"Pokaż oryginał",SEARCH_PLACEHOLDER_TEXT:"Wyszukaj...",SEARCH_SEARCHING:"Wyszukiwanie...",SEARCH_NO_RESULTS:"Nie znaleziono wyników",SEARCH_NO_MORE_RESULTS:"Nie ma innych wyników",CHAT_NOT_FOUND:"Nie znaleziono konwersacji",DELETE_MESSAGE:"Usuń wiadomość",DELETION_EXPLANATION:"Jeśli usuniesz tę wiadomość, przestanie być widoczna dla wszystkich.",EDIT_MESSAGE:"Edytuj wiadomość",SAVE:"Zapisz",EDITED_INDICATOR:"edytowano",REPLY_TO_MESSAGE:"Odpowiedz",ADD_REACTION:"Dodaj reakcję",AUTH_EXPIRED_OVERLAY_TITLE:"Twoja sesja wygasła",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Odśwież stronę, aby kontynuować",VOICE_MESSAGE:"Wiadomość głosowa",CONTACT_INFORMATION_HIDDEN:"Ukryte informacje",LEAVE_CONVERSATION:"Opuść konwersację",MARK_CONVERSATION_AS_UNREAD:"Oznacz jako nieprzeczytane",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},ji={code:"pt-BR",name:"Portuguese (Brazil)",translation:{YESTERDAY:"Ontem",TODAY:"Hoje",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"agora mesmo",LOCATION:"Localização",CANCEL:"Cancelar",INBOX:"Caixa de entrada",DESKTOP_NOTIFICATIONS:"Notificações do navegador",DESKTOP_NOTIFICATIONS_ERROR:"Não é possível ativar as notificações da navegador porque seu navegador as bloqueia. Tente procurar nas configurações ou usar um navegador diferente.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} notificação de demonstração`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Se você mantiver a guia do navegador aberta, verá essa mensagem quando alguém falar com você.",SEND_BUTTON_TEXT:"Enviar",ENTRYBOX_TEXT_LIMIT:"Apenas 10.000 caracteres são permitidos.",ENTRYBOX_PLACEHOLDER:"Diga algo...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Esta conversa não está mais ativa.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Você pode ler, mas não enviar mensagens.",MESSAGELIST_LOADING_OLDER:"Carregando mensagens antigas...",MESSAGELIST_SHOW_OLDER:"Mostrar mensagens mais antigas",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Esta mensagem foi enviada via email.",YOU_MARKER:"Você",UPLOAD_IN_PROGRESS:"Carregando...",UPLOAD_SEND_FILE:"Enviar arquivo",UPLOAD_SHARE_LOCATION:"Compartilhar localização",UPLOAD_ERROR:"Algo deu errado ao fazer o upload. O arquivo pode não ter suporte ou ser muito grande.",SHARE_LOCATION_ERROR:"Não é possível compartilhar o local: ",LOADING:"Carregando...",HUB_EMPTY:"Seu histórico de conversas será exibido aqui",HUB_SHOW_EARLIER:"Mostrar conversas anteriores",INBOX_NO_CHATS_TITLE:"Ainda não há chats!",INBOX_NO_CHATS_BODY:"Depois de ter uma ou mais conversas, elas serão exibidas aqui.",ENABLE_TRANSLATION:"Traduzir esta conversa para português",DISABLE_TRANSLATION:"Ver a conversa não traduzida",SEARCH_PLACEHOLDER_TEXT:"Busca...",SEARCH_SEARCHING:"Consultando...",SEARCH_NO_RESULTS:"Resultados nao encontrados",SEARCH_NO_MORE_RESULTS:"Não há mais resultados",CHAT_NOT_FOUND:"Conversa não encontrada",DELETE_MESSAGE:"Excluir mensagem",DELETION_EXPLANATION:"Se você excluir esta mensagem, ela desaparecerá para todos.",EDIT_MESSAGE:"Editar mensagem",SAVE:"Salvar",EDITED_INDICATOR:"editada",REPLY_TO_MESSAGE:"Responder",ADD_REACTION:"Adicionar reação",AUTH_EXPIRED_OVERLAY_TITLE:"Sua sessão de chat expirou",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Atualize a página para continuar",VOICE_MESSAGE:"Mensagem de voz",LEAVE_CONVERSATION:"Sair da conversa",MARK_CONVERSATION_AS_UNREAD:"Marcar como não lida",CONTACT_INFORMATION_HIDDEN:"Informação oculta",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},$i={code:"ro-RO",name:"Romanian (Romania)",translation:{YESTERDAY:"Ieri",TODAY:"Astăzi",DAYS:"z",HOURS:"o",MINUTES:"m",JUST_NOW:"chiar acum",LOCATION:"Locație",CANCEL:"Anulare",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Notificări browser",DESKTOP_NOTIFICATIONS_ERROR:"Nu se pot activa notificări browser deoarece browserul dvs. le blochează în mod activ. Încercați să căutați în setări sau utilizând un alt browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`Notificare de debit ${e}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Dacă țineți fișa browserului deschis, veți vedea acest pop-up atunci când cineva vorbește cu dvs.",SEND_BUTTON_TEXT:"Trimiteți",ENTRYBOX_TEXT_LIMIT:"Sunt permise numai 10.000 de caractere.",ENTRYBOX_PLACEHOLDER:"Spune ceva...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Această conversație nu mai este activă.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Puteți citi, dar nu puteți trimite mesaje.",MESSAGELIST_LOADING_OLDER:"Încărcarea mesajelor mai vechi...",MESSAGELIST_SHOW_OLDER:"Afișați mesaje mai vechi",MESSAGELIST_NEW_MARKER:"Nou",MESSAGE_SENT_VIA_EMAIL:"Acest mesaj a fost trimis prin e-mail",YOU_MARKER:"voi",UPLOAD_IN_PROGRESS:"Încărcarea...",UPLOAD_SEND_FILE:"Trimiteți fișierul",UPLOAD_SHARE_LOCATION:"Distribuiți locația",UPLOAD_ERROR:"Sa încărcat ceva în mod greșit. Fișierul ar putea fi neacceptat sau prea mare.",SHARE_LOCATION_ERROR:"Nu se poate partaja locația: ",LOADING:"Încărcare...",HUB_EMPTY:"Istoricul chat-ului dvs. va apărea aici",HUB_SHOW_EARLIER:"Afișați discuțiile anterioare",INBOX_NO_CHATS_TITLE:"Încă nu vorbești!",INBOX_NO_CHATS_BODY:"După ce ați avut una sau mai multe conversații, acestea vor apărea aici.",ENABLE_TRANSLATION:"Traduceți această conversație în română",DISABLE_TRANSLATION:"Arată originalul",SEARCH_PLACEHOLDER_TEXT:"Căutare...",SEARCH_SEARCHING:"Se caută...",SEARCH_NO_RESULTS:"Nu s-au găsit rezultate",SEARCH_NO_MORE_RESULTS:"Nu mai există rezultate",CHAT_NOT_FOUND:"Conversația nu a fost găsită",DELETE_MESSAGE:"Șterge mesajul",DELETION_EXPLANATION:"Dacă ștergi acest mesaj, acesta va dispărea pentru toată lumea.",EDIT_MESSAGE:"Redactează mesajul",SAVE:"Salvare",EDITED_INDICATOR:"editat",REPLY_TO_MESSAGE:"Răspundeți",ADD_REACTION:"Adaugă o reacție",AUTH_EXPIRED_OVERLAY_TITLE:"Sesiunea dumneavoastră de chat a expirat",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Reîmprospătați pagina pentru a continua",VOICE_MESSAGE:"Mesaj vocal",CONTACT_INFORMATION_HIDDEN:"Informații ascunse",LEAVE_CONVERSATION:"Părăsește conversația",MARK_CONVERSATION_AS_UNREAD:"Marcheaza ca necitit",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Yi={code:"ru-RU",name:"Russian",translation:{YESTERDAY:"Вчера",TODAY:"Сегодня",DAYS:"д",HOURS:"ч",MINUTES:"м",JUST_NOW:"только что",LOCATION:"Местоположение",CANCEL:"Отмена",INBOX:"Входящие",DESKTOP_NOTIFICATIONS:"Оповещения",DESKTOP_NOTIFICATIONS_ERROR:"Невозможно включить оповещения, потому что ваш браузер активно блокирует их. Проверьте ваши настройки или попробуйте другой браузер.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} демо-оповещение`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Если вкладка вашего браузера открыта, вы увидите всплывающее окошко оповещения когда кто-то отправит вам сообщение.",SEND_BUTTON_TEXT:"Отправить",ENTRYBOX_TEXT_LIMIT:"Разрешено использовать только 10 тысяч символов.",ENTRYBOX_PLACEHOLDER:"Напишите что-нибудь...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Этот разговор больше неактивен.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Вы можете читать, но не отправлять сообщения.",MESSAGELIST_LOADING_OLDER:"Загрузка старых сообщения...",MESSAGELIST_SHOW_OLDER:"Показать старые сообщения",MESSAGELIST_NEW_MARKER:"Новые",MESSAGE_SENT_VIA_EMAIL:"Это сообщение было отправлено по электронной почте",YOU_MARKER:"вы",UPLOAD_IN_PROGRESS:"Загрузка...",UPLOAD_SEND_FILE:"Отправить файл",UPLOAD_SHARE_LOCATION:"Поделиться местоположением",UPLOAD_ERROR:"Что-то пошло не так: такой файл не поддерживается или он слишком большой.",SHARE_LOCATION_ERROR:"Не удается поделиться местоположением: ",LOADING:"Загрузка...",HUB_EMPTY:"Здесь появится ваша история чата",HUB_SHOW_EARLIER:"Показать предыдущие чаты",INBOX_NO_CHATS_TITLE:"Пока нет чатов!",INBOX_NO_CHATS_BODY:"Как только у вас будет один или несколько разговоров, они появятся здесь.",ENABLE_TRANSLATION:"Переведите этот разговор на русский",DISABLE_TRANSLATION:"Show source",SEARCH_PLACEHOLDER_TEXT:"поиск...",SEARCH_SEARCHING:"Поиск...",SEARCH_NO_RESULTS:"Результаты не найдены",SEARCH_NO_MORE_RESULTS:"Больше результатов нет",CHAT_NOT_FOUND:"Чат не найден",DELETE_MESSAGE:"Удалить сообщение",DELETION_EXPLANATION:"Если вы удалите это сообщение, оно исчезнет для всех.",EDIT_MESSAGE:"Изменить сообщение",SAVE:"сохранить",EDITED_INDICATOR:"изменено",REPLY_TO_MESSAGE:"Ответить",ADD_REACTION:"Добавить реакцию",AUTH_EXPIRED_OVERLAY_TITLE:"Срок действия вашего сеанса чата истек",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Обновите страницу, чтобы продолжить",VOICE_MESSAGE:"Голосовое сообщение",CONTACT_INFORMATION_HIDDEN:"Информация скрыта",LEAVE_CONVERSATION:"Выйти из беседы",MARK_CONVERSATION_AS_UNREAD:"Отметить как непрочитанное",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},zi={code:"sq-AL",name:"Albanian",translation:{YESTERDAY:"Dje",TODAY:"Sot",DAYS:"d",HOURS:"o",MINUTES:"m",JUST_NOW:"Tani",LOCATION:"Pozicion",CANCEL:"Anulo",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Njoftimet e shfletuesit",DESKTOP_NOTIFICATIONS_ERROR:"Nuk mund të aktivizohen njoftimet në shfletues sepse shfletuesi juaj i bllokon ato në mënyrë aktive. Provoni të shikoni cilësimet ose përdorni një shfletues të ndryshëm.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} njoftime në desktop`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Lënia e skedës së shfletuesit tuaj të hapur do të pop-up kur dikush flet me ju.",SEND_BUTTON_TEXT:"Dërgo",ENTRYBOX_TEXT_LIMIT:"Lejohen vetëm 10,000 karaktere",ENTRYBOX_PLACEHOLDER:"Thuaj diçka...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Kjo bisedë nuk është më aktive.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Mund të lexoni por jo të dërgoni mesazhe.",MESSAGELIST_LOADING_OLDER:"Duke ngarkuar mesazhe më të vjetra...",MESSAGELIST_SHOW_OLDER:"Trego mesazhe më të vjetra",MESSAGELIST_NEW_MARKER:"E ri",MESSAGE_SENT_VIA_EMAIL:"Ky mesazh u dërgua si email",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Ngarkim...",UPLOAD_SEND_FILE:"Dërgo datotekën",UPLOAD_SHARE_LOCATION:"Ndani lokacionin",UPLOAD_ERROR:"Na vjen keq, diçka nuk shkoi si duhet. Dosja mund të mos ket mbështetje ose mund të jetë shumë e madhe.",SHARE_LOCATION_ERROR:"Nuk mund të ndahet lokacioni: ",LOADING:"Ngarkim...",HUB_EMPTY:"Këtu do të paraqitet/ shfaqet historia e bisedës tuaj",HUB_SHOW_EARLIER:"Shfaqi bisedat e mëparshme",INBOX_NO_CHATS_TITLE:"Nuk ka biseda!",INBOX_NO_CHATS_BODY:"Pasi të keni një ose më shumë biseda, ato do të paraqiten/shfaqen këtu.",ENABLE_TRANSLATION:"Përkthejeni këtë bisedë në shqiptare",DISABLE_TRANSLATION:"Shikoni origjinalin",SEARCH_PLACEHOLDER_TEXT:"Kërko...",SEARCH_SEARCHING:"Kërko...",SEARCH_NO_RESULTS:"Nuk ka rezultate",SEARCH_NO_MORE_RESULTS:"Nuk ka më rezultate",CHAT_NOT_FOUND:"Biseda nuk u gjet",DELETE_MESSAGE:"Fshi mesazhin",DELETION_EXPLANATION:"Nëse e fshini këtë mesazh, ai do të zhduket për të gjithë.",EDIT_MESSAGE:"Redakto mesazhin",SAVE:"Ruaj",EDITED_INDICATOR:"redaktuar",REPLY_TO_MESSAGE:"Përgjigj",ADD_REACTION:"Shtoni reagimin",AUTH_EXPIRED_OVERLAY_TITLE:"Sesioni juaj i bisedës ka skaduar",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Rifresko faqen për të vazhduar",VOICE_MESSAGE:"Mesazh zanor",CONTACT_INFORMATION_HIDDEN:"informacione të fshehura",LEAVE_CONVERSATION:"Largohu nga bashkëbisedimi",MARK_CONVERSATION_AS_UNREAD:"Shëno si të palexuar",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Vi={code:"sv-SE",name:"Swedish (Sweden)",translation:{YESTERDAY:"Igår",TODAY:"Idag",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"just nu",LOCATION:"Plats",CANCEL:"Avbryt",INBOX:"Inkorg",DESKTOP_NOTIFICATIONS:"Webbläsarnotiser",DESKTOP_NOTIFICATIONS_ERROR:"Kan inte aktivera webbläsarnotiser eftersom din webbläsare aktivt blockerar dem. Se över inställningarna eller använd en annan webbläsare.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demonotis`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Om du har fliken i webbläsaren öppen så kommer den här notisen visas när någon pratar med dig.",SEND_BUTTON_TEXT:"Skicka",ENTRYBOX_TEXT_LIMIT:"Max 10 000 tecken är tillåtet.",ENTRYBOX_PLACEHOLDER:"Skriv ett meddelande...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Den här konversationen är inte längre aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Du kan läsa men inte skicka meddelanden.",MESSAGELIST_LOADING_OLDER:"Läser in tidigare meddelanden...",MESSAGELIST_SHOW_OLDER:"Visa tidigare meddelanden",MESSAGELIST_NEW_MARKER:"Nytt",MESSAGE_SENT_VIA_EMAIL:"Detta meddelande skickades via e-post",YOU_MARKER:"du",UPLOAD_IN_PROGRESS:"Laddar upp...",UPLOAD_SEND_FILE:"Skicka fil",UPLOAD_SHARE_LOCATION:"Dela plats",UPLOAD_ERROR:"Något gick fel vid uppladdningen. Filen kan vara av en typ som inte stöds eller är för stor.",SHARE_LOCATION_ERROR:"Kan inte dela plats: ",LOADING:"Laddar...",HUB_EMPTY:"Din chatthistorik kommer att visas här",HUB_SHOW_EARLIER:"Visa tidigare chattar",INBOX_NO_CHATS_TITLE:"Inga chattar ännu!",INBOX_NO_CHATS_BODY:"När du har haft en eller flera konversationer kommer de att visas här.",ENABLE_TRANSLATION:"Översätt den här konversationen till svenska",DISABLE_TRANSLATION:"Visa original",SEARCH_PLACEHOLDER_TEXT:"Sök...",SEARCH_SEARCHING:"Söker...",SEARCH_NO_RESULTS:"Inga resultat hittades",SEARCH_NO_MORE_RESULTS:"Inga fler resultat",CHAT_NOT_FOUND:"Chatten hittades inte",DELETE_MESSAGE:"Radera meddelandet",DELETION_EXPLANATION:"Om du raderar det här meddelandet försvinner det för alla.",EDIT_MESSAGE:"Redigera meddelandet",SAVE:"Spara",EDITED_INDICATOR:"redigerad",REPLY_TO_MESSAGE:"Svara",ADD_REACTION:"Lägg till reaktion",AUTH_EXPIRED_OVERLAY_TITLE:"Din chatsession har gått ut",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Uppdatera sidan för att fortsätta",VOICE_MESSAGE:"Röstmeddelande",CONTACT_INFORMATION_HIDDEN:"Dold information",LEAVE_CONVERSATION:"Lämna konversationen",MARK_CONVERSATION_AS_UNREAD:"Markera som oläst",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Gi={code:"tr-TR",name:"Turkish",translation:{YESTERDAY:"Dün",TODAY:"Bugün",DAYS:"g",HOURS:"s",MINUTES:"d",JUST_NOW:"az önce",LOCATION:"Konum",CANCEL:"İptal",INBOX:"Gelen Kutusu",SEND_BUTTON_TEXT:"Gönder",ENTRYBOX_TEXT_LIMIT:"En fazla 10.000 karaktere izin veriliyor.",ENTRYBOX_PLACEHOLDER:"Bir şeyler söyle...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Bu konuşma artık aktif değil.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Mesajları okuyabilirsiniz ancak mesaj gönderemezsiniz.",MESSAGELIST_LOADING_OLDER:"Eski mesajlar yükleniyor...",MESSAGELIST_SHOW_OLDER:"Eski mesajları göster",MESSAGELIST_NEW_MARKER:"Yeni",DESKTOP_NOTIFICATIONS:"Tarayıcı bildirimleri",DESKTOP_NOTIFICATIONS_ERROR:"Tarayıcınız aktif olarak engellediğinden tarayıcı bildirimlerini etkinleştiremiyoruz. Ayarları kontrol etmeyi veya farklı bir tarayıcı kullanmayı deneyebilirsiniz.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} test bildirimi`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Eğer tarayıcınızın penceresini açık tutarsanız biri mesaj yazdığında bu bildirimi göreceksiniz.",MESSAGE_SENT_VIA_EMAIL:"Bu mesaj e-posta ile gönderilmiştir.",YOU_MARKER:"siz",UPLOAD_IN_PROGRESS:"Yükleniyor...",UPLOAD_SEND_FILE:"Dosya gönder",UPLOAD_SHARE_LOCATION:"Konum paylaş",UPLOAD_ERROR:"Yükleme sırasında bir şeyler yanlış gitti. Dosya desteklenmiyor veya izin verilenden büyük olabilir.",SHARE_LOCATION_ERROR:"Konum paylaşılamadı: ",LOADING:"Yükleniyor...",HUB_EMPTY:"Konuşma geçmişiniz burada görünecek",HUB_SHOW_EARLIER:"Önceki konuşmaları göster",INBOX_NO_CHATS_TITLE:"Henüz konuşma yok!",INBOX_NO_CHATS_BODY:"Bir veya daha fazla konuşma başlattığınız konuşmalar burada belirecek.",ENABLE_TRANSLATION:"Bu konuşmayı Türkçe'ye çevir",DISABLE_TRANSLATION:"Orijinali göster",SEARCH_PLACEHOLDER_TEXT:"Ara...",SEARCH_SEARCHING:"Arıyor...",SEARCH_NO_RESULTS:"Sonuç bulunamadı",SEARCH_NO_MORE_RESULTS:"Başka sonuç bulunamadı.",CHAT_NOT_FOUND:"Sohbet bulunamadı",DELETE_MESSAGE:"Mesajı sil",DELETION_EXPLANATION:"Bu mesajı silerseniz herkes için görünmez olacaktır.",EDIT_MESSAGE:"Mesajı düzenle",SAVE:"Kaydet",EDITED_INDICATOR:"düzenlenmiş",REPLY_TO_MESSAGE:"Yanıtla",ADD_REACTION:"Tepki ekle",AUTH_EXPIRED_OVERLAY_TITLE:"Sohbet oturumunuz sona erdi",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Devam etmek için sayfayı yenileyin",VOICE_MESSAGE:"Sesli mesaj",CONTACT_INFORMATION_HIDDEN:"Gizli bilgi",LEAVE_CONVERSATION:"Konuşmadan ayrıl",MARK_CONVERSATION_AS_UNREAD:"Okunmamış olarak işaretle",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Wi={code:"uk-UA",name:"Ukrainian (Ukraine)",translation:{YESTERDAY:"Вчора",TODAY:"Сьогодні",DAYS:"d",HOURS:"h",MINUTES:"м",JUST_NOW:"просто зараз",LOCATION:"Місцезнаходження",CANCEL:"Скасувати",INBOX:"Вхідні",DESKTOP_NOTIFICATIONS:"Сповіщення в браузері",DESKTOP_NOTIFICATIONS_ERROR:"Неможливо ввімкнути сповіщення в браузері, оскільки ваш веб-переглядач активно їх блокує. Спробуйте переглянути налаштування або використовувати інший браузер.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`Демо-повідомлення про ${e}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Якщо ви відкриєте вкладку веб-переглядача відкритою, ви побачите це спливаюче вікно, коли хтось спілкується з вами.",SEND_BUTTON_TEXT:"Надіслати",ENTRYBOX_TEXT_LIMIT:"Дозволено лише 10 000 символів.",ENTRYBOX_PLACEHOLDER:"Скажи щось...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ця розмова більше не активна.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Ви можете читати, але не надсилати повідомлення.",MESSAGELIST_LOADING_OLDER:"Завантаження старих повідомлень...",MESSAGELIST_SHOW_OLDER:"Показати старіші повідомлення",MESSAGELIST_NEW_MARKER:"Нові",MESSAGE_SENT_VIA_EMAIL:"Це повідомлення надіслано електронною поштою",YOU_MARKER:"ти",UPLOAD_IN_PROGRESS:"Завантаження...",UPLOAD_SEND_FILE:"Надіслати файл",UPLOAD_SHARE_LOCATION:"Поділитися місцезнаходженням",UPLOAD_ERROR:"На жаль, під час завантаження щось не вдалось. Файл може бути непідтримуваним або занадто великим.",SHARE_LOCATION_ERROR:"Неможливо поділити місцезнаходження: ",LOADING:"Завантаження...",HUB_EMPTY:"Тут відобразиться ваша історія чатів",HUB_SHOW_EARLIER:"Показати попередні чати",INBOX_NO_CHATS_TITLE:"Чатів ще немає!",INBOX_NO_CHATS_BODY:"Після того, як ви проведете одну чи кілька бесід, вони з’являться тут.",ENABLE_TRANSLATION:"Перекласти цю розмову англійською",DISABLE_TRANSLATION:"Показати оригінал",SEARCH_PLACEHOLDER_TEXT:"Пошук...",SEARCH_SEARCHING:"Пошук...",SEARCH_NO_RESULTS:"Не знайдено результатів",SEARCH_NO_MORE_RESULTS:"Більше немає результатів",CHAT_NOT_FOUND:"Чат не знайдено",DELETE_MESSAGE:"Видалити повідомлення",DELETION_EXPLANATION:"Якщо ви видалите це повідомлення, воно зникне для всіх.",EDIT_MESSAGE:"Редагувати повідомлення",SAVE:"Зберегти",EDITED_INDICATOR:"відредаговано",REPLY_TO_MESSAGE:"Відповісти",ADD_REACTION:"Додати реакцію",AUTH_EXPIRED_OVERLAY_TITLE:"Ваша сесія в чаті закінчилась",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Оновіть сторінку, щоб продовжити",VOICE_MESSAGE:"Голосове повідомлення",CONTACT_INFORMATION_HIDDEN:"Прихована інформація",LEAVE_CONVERSATION:"Залишити розмову",MARK_CONVERSATION_AS_UNREAD:"Відзначити як непрочитане",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Xi={code:"vi-VN",name:"Vietnamese",translation:{YESTERDAY:"Hôm qua",TODAY:"Hôm nay",DAYS:"ngày",HOURS:"giờ",MINUTES:"phút",JUST_NOW:"vừa xong",LOCATION:"Địa điểm",CANCEL:"Hủy",INBOX:"Hộp thư đến",DESKTOP_NOTIFICATIONS:"Thông báo trình duyệt",DESKTOP_NOTIFICATIONS_ERROR:"Không thể bật thông báo trên trình duyệt vì trình duyệt của bạn đang tắt chức năng này. Hãy thử tìm trong cài đặt trình duyệt hoặc sử dụng một trình duyệt khác.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} thông báo thử nghiệm`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Nếu bạn giữ tab trình duyệt của bạn mở, bạn sẽ thấy cửa sổ bật lên khi ai đó nói chuyện với bạn.",SEND_BUTTON_TEXT:"Gửi",ENTRYBOX_TEXT_LIMIT:"Tối đa 10.000 ký tự.",ENTRYBOX_PLACEHOLDER:"Nói gì đó...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Cuộc hội thoại này không còn hoạt động.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Bạn có thể đọc, nhưng không thể gửi tin nhắn.",MESSAGELIST_LOADING_OLDER:"Đang tải tin nhắn cũ...",MESSAGELIST_SHOW_OLDER:"Hiển thị tin nhắn trước đó",MESSAGELIST_NEW_MARKER:"Mới",MESSAGE_SENT_VIA_EMAIL:"Tin nhắn này đã được gửi qua email",YOU_MARKER:"bạn",UPLOAD_IN_PROGRESS:"Đang tải lên...",UPLOAD_SEND_FILE:"Gửi tệp",UPLOAD_SHARE_LOCATION:"Chia sẻ vị trí",UPLOAD_ERROR:"Thật không may, quá trình tải lên không thành công. Tệp không được hỗ trợ hoặc quá lớn.",SHARE_LOCATION_ERROR:"Không thể chia sẻ vị trí: ",LOADING:"Đang tải...",HUB_EMPTY:"Lịch sử trò chuyện của bạn sẽ hiển thị ở đây",HUB_SHOW_EARLIER:"Hiển thị các cuộc trò chuyện trước đó",INBOX_NO_CHATS_TITLE:"Chưa có cuộc trò chuyện nào!",INBOX_NO_CHATS_BODY:"Khi bạn đã có một hoặc nhiều cuộc trò chuyện, chúng sẽ hiển thị ở đây.",ENABLE_TRANSLATION:"Dịch cuộc hội thoại sang Tiếng Việt",DISABLE_TRANSLATION:"Hiển thị nội dung gốc",SEARCH_PLACEHOLDER_TEXT:"TÌm kiếm...",SEARCH_SEARCHING:"Đang tìm kiếm...",SEARCH_NO_RESULTS:"Không tìm thấy kết quả nào",SEARCH_NO_MORE_RESULTS:"Không có kết quả nào khác",CHAT_NOT_FOUND:"Không tìm thấy cuộc trò chuyện",DELETE_MESSAGE:"Xóa tin nhắn",DELETION_EXPLANATION:"Nếu bạn xóa tin nhắn này, tất cả mọi người sẽ không còn thấy nó.",EDIT_MESSAGE:"Chỉnh sửa tin nhắn",SAVE:"lưu",EDITED_INDICATOR:"đã chỉnh sửa",REPLY_TO_MESSAGE:"đáp lại",ADD_REACTION:"Thêm biểu tượng cảm xúc",AUTH_EXPIRED_OVERLAY_TITLE:"Phiên trò chuyện của bạn đã hết hạn",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Hãy làm mới trang để tiếp tục",VOICE_MESSAGE:"Tin nhắn thoại",CONTACT_INFORMATION_HIDDEN:"Thông tin ẩn",LEAVE_CONVERSATION:"Thoát khỏi cuộc trò chuyện",MARK_CONVERSATION_AS_UNREAD:"Đánh dấu là chưa đọc",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ki={code:"zh-CN",name:"Chinese (Simplified)",translation:{YESTERDAY:"昨天",TODAY:"今天",DAYS:"天",HOURS:"小时",MINUTES:"分钟",JUST_NOW:"刚才",LOCATION:"地点",CANCEL:"取消",INBOX:"收件箱",DESKTOP_NOTIFICATIONS:"浏览器通知",DESKTOP_NOTIFICATIONS_ERROR:"因浏览器设置为阻止,所以无法激活浏览器提醒。请去设置里查看或者尝试其他的浏览器。",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} 演示提醒`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"只要保持浏览器开着,如果有人和你对话,将会自动弹出对话窗口。",SEND_BUTTON_TEXT:"发送",ENTRYBOX_TEXT_LIMIT:"不超过10,000个字符。",ENTRYBOX_PLACEHOLDER:"写点什么吧……",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"该对话已结束。",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"你只能阅读信息,不能发送信息。",MESSAGELIST_LOADING_OLDER:"载入之前的信息……",MESSAGELIST_SHOW_OLDER:"显示之前的信息",MESSAGELIST_NEW_MARKER:"新消息",MESSAGE_SENT_VIA_EMAIL:"该信息已通过邮件发送。",YOU_MARKER:"你",UPLOAD_IN_PROGRESS:"上传中……",UPLOAD_SEND_FILE:"发送文件",UPLOAD_SHARE_LOCATION:"分享地址",UPLOAD_ERROR:"上传出错。文件格式不支持或者太大。",SHARE_LOCATION_ERROR:"无法分享地址: ",LOADING:"正在载入……",HUB_EMPTY:"你的聊天记录将在此显示。",HUB_SHOW_EARLIER:"显示之前的聊天记录。",INBOX_NO_CHATS_TITLE:"暂无任何聊天记录!",INBOX_NO_CHATS_BODY:"如果你有一个或多个对话窗口进行中,将显示在这里。",ENABLE_TRANSLATION:"翻译至简体中文",DISABLE_TRANSLATION:"查看原文",SEARCH_PLACEHOLDER_TEXT:"搜索...",SEARCH_SEARCHING:"正在搜索...",SEARCH_NO_RESULTS:"未找到结果",SEARCH_NO_MORE_RESULTS:"无更多结果",CHAT_NOT_FOUND:"未找到“聊天”",DELETE_MESSAGE:"删除消息",DELETION_EXPLANATION:"如果您删除此消息,那么所有人都将无法再看到它。",EDIT_MESSAGE:"编辑消息",SAVE:"保存",EDITED_INDICATOR:"本消息有改动",REPLY_TO_MESSAGE:"回复",ADD_REACTION:"添加反应",AUTH_EXPIRED_OVERLAY_TITLE:"您的聊天会话已过期",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"刷新页面以继续",VOICE_MESSAGE:"语音消息",CONTACT_INFORMATION_HIDDEN:"隐藏信息",LEAVE_CONVERSATION:"离开对话",MARK_CONVERSATION_AS_UNREAD:"标记为未读",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},qi={code:"zh-TW",name:"Chinese (Traditional)",translation:{YESTERDAY:"昨天",TODAY:"昨天",DAYS:"天",HOURS:"小時",MINUTES:"分",JUST_NOW:"現在",LOCATION:"地點",CANCEL:"取消",INBOX:"收件箱",DESKTOP_NOTIFICATIONS:"瀏覽器通知",DESKTOP_NOTIFICATIONS_ERROR:"無法啟用瀏覽器通知,因為您的瀏覽器主動阻止它們。 嘗試查看設置或使用其他瀏覽器。",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} 演示通知`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"如果您持續打開瀏覽器標籤頁,當有人與您通話時,您會看到此彈出窗口。",SEND_BUTTON_TEXT:"發送",ENTRYBOX_TEXT_LIMIT:"只允許10.000個字符。",ENTRYBOX_PLACEHOLDER:"說些什麼...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"此對話不再有效。",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"您可以閱讀,但不能發送消息。",MESSAGELIST_LOADING_OLDER:"加載舊訊息...",MESSAGELIST_SHOW_OLDER:"顯示較舊的訊息",MESSAGELIST_NEW_MARKER:"新的",MESSAGE_SENT_VIA_EMAIL:"此訊息是通過電郵發送的",YOU_MARKER:"您",UPLOAD_IN_PROGRESS:"上傳中...",UPLOAD_SEND_FILE:"發送文件",UPLOAD_SHARE_LOCATION:"共享位置",UPLOAD_ERROR:"不幸的是,上傳出了問題。 該文件可能不受支持或太大。",SHARE_LOCATION_ERROR:"無法分享位置:",LOADING:"載入中...",HUB_EMPTY:"您的聊天記錄將顯示在此處",HUB_SHOW_EARLIER:"顯示早先的聊天記錄",INBOX_NO_CHATS_TITLE:"還沒聊天!",INBOX_NO_CHATS_BODY:"一旦您進行了一次或多次對話,他們就會顯示在此處。",ENABLE_TRANSLATION:"翻譯此對話至繁體中文",DISABLE_TRANSLATION:"顯示原文",SEARCH_PLACEHOLDER_TEXT:"搜尋...",SEARCH_SEARCHING:"正在搜尋...",SEARCH_NO_RESULTS:"找不到任何結果",SEARCH_NO_MORE_RESULTS:"沒有其他結果",CHAT_NOT_FOUND:"查無對話",DELETE_MESSAGE:"刪除訊息",DELETION_EXPLANATION:"您如果刪除這條訊息,所有人都將看不到它。",EDIT_MESSAGE:"編輯訊息",SAVE:"儲存",EDITED_INDICATOR:"已編輯",REPLY_TO_MESSAGE:"回覆",ADD_REACTION:"加入表情回應",AUTH_EXPIRED_OVERLAY_TITLE:"您的會話過程已過期",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"請刷新頁面以繼續",VOICE_MESSAGE:"語音訊息",CONTACT_INFORMATION_HIDDEN:"隱藏訊息",LEAVE_CONVERSATION:"離開對話",MARK_CONVERSATION_AS_UNREAD:"標記為未讀",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ji={ar:gi,bg:_i,bs:Ai,ca:{code:"ca-ES",name:"Catalan (ES)",translation:{YESTERDAY:"Ahir",TODAY:"Avui",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"ara mateix",LOCATION:"Ubicació",CANCEL:"Cancel·lar",INBOX:"Safata d'entrada",DESKTOP_NOTIFICATIONS:"Notificacions d'escriptori",DESKTOP_NOTIFICATIONS_ERROR:"No es poden habilitar les notificacions del navegador perquè el teu navegador les bloqueja activament. Prova de buscar a la configuració o utilitza un altre navegador.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`Notificació de demostració de ${e}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Si mantens la pestanya del navegador oberta, veuràs aquesta notificació quan algú et parli.",SEND_BUTTON_TEXT:"Enviar",ENTRYBOX_TEXT_LIMIT:"Només es permeten 10.000 caràcters.",ENTRYBOX_PLACEHOLDER:"Digues alguna cosa...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Aquesta conversa ja no està activa.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Pots llegir, però no enviar missatges.",MESSAGELIST_LOADING_OLDER:"Carregant missatges antics...",MESSAGELIST_SHOW_OLDER:"Mostrar missatges més antics",MESSAGELIST_NEW_MARKER:"Nou",MESSAGE_SENT_VIA_EMAIL:"Aquest missatge s'ha enviat per correu electrònic",YOU_MARKER:"tu",UPLOAD_IN_PROGRESS:"S'està pujant...",UPLOAD_SEND_FILE:"Enviar arxiu",UPLOAD_SHARE_LOCATION:"Compartir ubicació",UPLOAD_ERROR:"Desafortunadament, alguna cosa ha anat malament en pujar. L'arxiu pot ser no compatible o massa gran.",SHARE_LOCATION_ERROR:"No es pot compartir la ubicació: ",LOADING:"Carregant...",HUB_EMPTY:"El teu historial de xat apareixerà aquí",HUB_SHOW_EARLIER:"Mostra xats anteriors",INBOX_NO_CHATS_TITLE:"Encara no hi ha xats!",INBOX_NO_CHATS_BODY:"Un cop hagis tingut una o més converses, apareixeran aquí.",ENABLE_TRANSLATION:"Traduir aquesta conversa al català",DISABLE_TRANSLATION:"Mostrar original",SEARCH_PLACEHOLDER_TEXT:"Cerca...",SEARCH_SEARCHING:"Buscant...",SEARCH_NO_RESULTS:"No s'han trobat resultats",SEARCH_NO_MORE_RESULTS:"No hi ha més resultats",CHAT_NOT_FOUND:"Xat no trobat",DELETE_MESSAGE:"Esborrar missatge",DELETION_EXPLANATION:"Si esborres aquest missatge, desapareixerà per a tothom.",EDIT_MESSAGE:"Editar missatge",SAVE:"Desar",EDITED_INDICATOR:"editat",REPLY_TO_MESSAGE:"Respondre",REPLY_TO_ARIA_LABEL:(e,t)=>`Responent a ${e}: ${t}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Sortir del mode de resposta",ADD_REACTION:"Afegir reacció",VOICE_MESSAGE:"Missatge de veu",LEAVE_CONVERSATION:"Abandonar la conversa",MARK_CONVERSATION_AS_UNREAD:"marcar com no llegit",STATUS_INDICATOR_ONLINE:"Actiu",STATUS_INDICATOR_OFFLINE:"Absent",CONTACT_INFORMATION_HIDDEN:"informació oculta",AUTH_EXPIRED_OVERLAY_TITLE:"La teva sessió de xat ha caducat",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Actualitza la pàgina per continuar"}},cs:Di,da:vi,de:Oi,el:Ti,en:Ei,es:Si,et:yi,fa:Ci,fi:Ni,fr:bi,he:Ii,hi:Ri,hr:wi,hu:ki,id:Li,is:{code:"is-IS",name:"Íslenska",translation:{YESTERDAY:"Í gær",TODAY:"Í dag",DAYS:"dagar",HOURS:"klst.",MINUTES:"mín.",JUST_NOW:"núna",LOCATION:"Staðsetning",CANCEL:"Hætta við",INBOX:"Pósthólf",DESKTOP_NOTIFICATIONS:"Tilkynningar í vafra",DESKTOP_NOTIFICATIONS_ERROR:"Ekki er hægt að birta tilkynningar í vafra vegna þess að vafrinn sem þú notar hindrar það. Reyndu að leita að stillingum eða að nota annan vafra.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} prufutilkynning`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ef flipinn í vafranum er opinn muntu sjá þessa tilkynningu birtast þegar einhver sendir þér skilaboð.",SEND_BUTTON_TEXT:"Senda",ENTRYBOX_TEXT_LIMIT:"Aðeins 10.000 stafir komast fyrir.",ENTRYBOX_PLACEHOLDER:"Segðu eitthvað...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Þessar samræður eru ekki lengar virkar.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Þú getur lesið, en ekki sent skilaboð.",MESSAGELIST_LOADING_OLDER:"Sæki eldri skilaboð...",MESSAGELIST_SHOW_OLDER:"Sýna eldri skilaboð",MESSAGELIST_NEW_MARKER:"Ný",MESSAGE_SENT_VIA_EMAIL:"Þessi skilaboð voru send með tölvupósti",YOU_MARKER:"þú",UPLOAD_IN_PROGRESS:"Hleð upp...",UPLOAD_SEND_FILE:"Senda skrá",UPLOAD_SHARE_LOCATION:"Deila staðsetningu",UPLOAD_ERROR:"Því miður fór eitthvað úrskeiðis við að hlaða upp. Skráin gæti verið af rangri tegund eð of stór.",SHARE_LOCATION_ERROR:"Ekki er hægt að deila staðsetningu: ",LOADING:"Hleð...",HUB_EMPTY:"Fyrri samtöl munu birtast hér",HUB_SHOW_EARLIER:"Sýna fyrri samtöl",INBOX_NO_CHATS_TITLE:"Engin samtöl enn!",INBOX_NO_CHATS_BODY:"Þegar þú hefur átt eitt eða fleiri samtöl, munu þau birtast hér.",ENABLE_TRANSLATION:"Þýða þetta samtal á ensku",DISABLE_TRANSLATION:"Sýna upprunalegt",SEARCH_PLACEHOLDER_TEXT:"Leita...",SEARCH_SEARCHING:"Leita...",SEARCH_NO_RESULTS:"Ekkert fannst",SEARCH_NO_MORE_RESULTS:"Engar fleiri niðurstöður",CHAT_NOT_FOUND:"Samtal fannst ekki",DELETE_MESSAGE:"Eyða skilaboðum",DELETION_EXPLANATION:"Ef þú eyðir þessum skilaboðum munu þau hverfa hjá öllum.",EDIT_MESSAGE:"Breyta skilaboðum",SAVE:"Vista",EDITED_INDICATOR:"breytt",REPLY_TO_MESSAGE:"Svara",REPLY_TO_ARIA_LABEL:(e,t)=>`Svara ${e}: ${t}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Fara úr svari",ADD_REACTION:"Setja inn viðbrögð",AUTH_EXPIRED_OVERLAY_TITLE:"Spjallið hefur runnið út",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Endurnýjaðu síðuna til að halda áfram",VOICE_MESSAGE:"Raddskilaboð",LEAVE_CONVERSATION:"Skilja eftir skilaboð",MARK_CONVERSATION_AS_UNREAD:"Merkja sem ólesið",STATUS_INDICATOR_ONLINE:"Virk",STATUS_INDICATOR_OFFLINE:"Ekki við",CONTACT_INFORMATION_HIDDEN:"faldar upplýsingar"}},it:xi,ja:Mi,ka:Fi,ko:Bi,nb:Pi,nl:Ui,pl:Hi,pt:ji,ro:$i,ru:Yi,sq:zi,sr:{code:"sr-SP",name:"Serbian",translation:{YESTERDAY:"Juče",TODAY:"Danas",DAYS:"d",HOURS:"s",MINUTES:"m",JUST_NOW:"Upravo sad",LOCATION:"Lokacija",CANCEL:"Otkaži",INBOX:"Pretinac",DESKTOP_NOTIFICATIONS:"Browser Notifikacija",DESKTOP_NOTIFICATIONS_ERROR:"Browser notifikacije nisu omogućene jer ih vaš pregledač aktivno blokira. Pokušajte pogledati postavke ili koristiti neki drugi pregledač.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notifikacija`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ako karticu pregledača ostavite otvorenu, pojaviće se ovaj pop-up kada neko razgovara s vama.",SEND_BUTTON_TEXT:"Pošalji",ENTRYBOX_TEXT_LIMIT:"Dozvoljeno je samo 10.000 znakova.",ENTRYBOX_PLACEHOLDER:"Kaži nešto...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ovaj razgovor više nije aktivan.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Možete da čitate, ali ne i da šaljete poruke.",MESSAGELIST_LOADING_OLDER:"Učitavam starije poruke...",MESSAGELIST_SHOW_OLDER:"Prikaži starije poruke",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Ova poruka je poslana imejlom",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Učitavam...",UPLOAD_SEND_FILE:"Pošalji datoteku",UPLOAD_SHARE_LOCATION:"Podeli lokaciju",UPLOAD_ERROR:"Nažalost, nešto je pošlo krivo. Datoteka možda nije podržana ili je prevelika.",SHARE_LOCATION_ERROR:"Nije moguće podeliti lokaciju: ",LOADING:"Učitavam...",HUB_EMPTY:"Ovde će biti prikazana istorija razgovora",HUB_SHOW_EARLIER:"Prikaži ranije razgovore",INBOX_NO_CHATS_TITLE:"Nema razgovora!",INBOX_NO_CHATS_BODY:"Nakon što vodite jedan ili više razgovora, oni će se pojaviti ovde.",ENABLE_TRANSLATION:"Prevedi ovaj razgovor na srpski jezik",DISABLE_TRANSLATION:"Prikaži original",SEARCH_PLACEHOLDER_TEXT:"Pretraži...",SEARCH_SEARCHING:"Pretraživanje...",SEARCH_NO_RESULTS:"Nema rezultata",SEARCH_NO_MORE_RESULTS:"Nema više rezultata",CHAT_NOT_FOUND:"Ćaskanje nije pronađeno",DELETE_MESSAGE:"Izbriši poruku",DELETION_EXPLANATION:"Ako obrišete ovu poruku, ona neće biti vidljiva ni za koga.",EDIT_MESSAGE:"Ispravi poruku",SAVE:"Sačuvaj",EDITED_INDICATOR:"ispravljeno",REPLY_TO_MESSAGE:"Odgovorite",ADD_REACTION:"Dodaj reakciju",AUTH_EXPIRED_OVERLAY_TITLE:"Vaša sesija ćaskanja je istekla",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Osvežite stranicu da biste nastavili",VOICE_MESSAGE:"Glasovna poruka",CONTACT_INFORMATION_HIDDEN:"Sakrivene informacije",LEAVE_CONVERSATION:"Napusti razgovor",MARK_CONVERSATION_AS_UNREAD:"Označi kao nepročitanu",REPLY_TO_ARIA_LABEL:(e,t)=>`Odgovarate korisniku ${e}: ${t}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Izađi iz moda pisanja odgovora",STATUS_INDICATOR_ONLINE:"Aktivan",STATUS_INDICATOR_OFFLINE:"Neaktivan"}},sv:Vi,tr:Gi,uk:Wi,vi:Xi,zh:Ki,zhTw:qi},Zi={canReplyToMessage:!1,canDeleteMessage:!1};class Qi{constructor(){this.messageSubscription=null,this.readyForNewMessagesPromise=Promise.resolve(),this.participantSubscription=null,this.onlineSubscriptions={},this.state$=Cr({extUserId:null,extCurrentConversationId:null,appId:null,editor:{isEmpty:!0,isTyping:!1,atTextLimit:!1,characterCount:0,showEmojiPicker:!1},referencedMessageId:null,currentUser:null,currentConversation:null,app:null,device:null,errors:{unknownConversation:!1,unknownUser:!1,wrongAppId:!1,serverError:!1},messages:{},participants:{},typing:{},isUserConnected:{},ephemeralMessages:{},ephemeralMessageIdMapping:{},localFileBlobUrls:{},authTokenState:"idle",userPermissions:()=>{const e=this.state$.app.role.general.get(),t=this.state$.app.role.permissions.get();return ii.defined(e),ii.defined(t),{showTypingIndicator:e.showTypingIndicators,canShareFile:e.enableFileTransfers,canShareLocation:e.enableLocation,canMention:e.enableMentions,showOnlineStatus:!1!==e.enablePresence,canSendVoiceMessage:e.enableVoiceRecording,canLeaveConversation:"all"===t.conversations.leave,canMarkConversationAsUnread:"all"===t.conversations.markAsUnread}},messagePermissions:()=>{const e=this.state$.app.role.permissions.get();ii.defined(e);const t=this.state$.userPermissions.get();return{system:{...Zi,...t},own:{canReplyToMessage:eo(e.messages.reply,!0),canDeleteMessage:eo(e.messages.delete,!0),...t},other:{canReplyToMessage:eo(e.messages.reply,!1),canDeleteMessage:eo(e.messages.delete,!1),...t}}},themeCustom:gn({value:void 0})}),this.locale$=Cr((()=>{const e=this.state$.extUserId.get(),t=this.state$.app.appMetadata.defaultLocale.get(),n=this.state$.currentUser.locale.get();return(e&&n)??t??"en-US"})),this.t$=Cr((()=>function(e){const t=e.replace(/_/g,"-").toLowerCase(),n=Ji[t];if(n)return{...n.translation,locale:t};const r=t.slice(0,2),i=Ji[r];return i?{...i.translation,locale:r}:(mi.warn(`User locale '${e}' not supported; falling back to English.`),{...Ei.translation,locale:"en-US"})}(this.locale$.get()))),this.referencedMessage$=Cr((()=>{const e=this.state$.extCurrentConversationId.get(),t=this.state$.referencedMessageId.get();return e&&t?this.state$.messages.child(e).lookup.child(t).get():null})),this.chatItems$=Cr((()=>{const e=this.state$.extCurrentConversationId.get();if(!e)return[];const t=this.state$.currentConversation.readUntil.get(),n=this.state$.messages.child(e).state.get()??[],r=Object.values(this.state$.ephemeralMessages.child(e).get()??{}),i=0===r.length?n:r.concat(n).sort(((e,t)=>t.createdAt-e.createdAt)),o=i.map((t=>{const n=t.content[0],r=n?.type;if(!n||"file"!==r)return t;const i=n.size+","+n.filename,o=this.state$.localFileBlobUrls.child(e).child(i).url.get();return o?{...t,content:[{...n,url:o}]}:t}));let s=null,a=0,u=!1;const l=[];for(const c of o){const e=new Date(c.createdAt),n=new Date(e).setHours(0,0,0,0),r=a&&n!==a,i=e.getTime()>t,o=!(!u||i||s?.id.startsWith("ephemeral"));(o||r)&&l.push(new to({id:"border-before-"+c.id,isDayMarker:!!r,isReadMarker:!!o,timestamp:r?a:void 0})),l.push(c),u=i,a=n,s=c}return function(e,t){const n=[];let r=[];const i=Symbol("NO_KEY");let o=i;for(const s of e){const e=t(s);o===i||o===e?r.push(s):(n.push(r),r=[s]),o=e}return 0!==r.length&&n.push(r),n}(l,(e=>e instanceof to?e.id:e.sender?.id)).map((e=>(e.id=e.map((e=>e.id)).join(","),e)))}))}resetState(e,t,n){this.state$.assign({referencedMessageId:null,errors:{unknownConversation:!1,unknownUser:!1,wrongAppId:!1,serverError:!1},extUserId:t,extCurrentConversationId:n,appId:e,currentUser:null,currentConversation:null})}storeTyping(e,t){this.state$.typing.child(e).set(t)}userPermissions$(){return this.state$.userPermissions}messagePermissions$(e){const t=this.state$.currentUser.get();if(!t)throw new Error("Unreachable");return e.sender?t.id===e.sender.id?this.state$.messagePermissions.own:this.state$.messagePermissions.other:this.state$.messagePermissions.system}storeMessages(e,t,n){Mn((()=>{const r=t.reduce(((e,t)=>(e[t.id]=t,e)),{}),i=this.state$.extCurrentConversationId.peek(),o=this.state$.extUserId.peek();ii(o&&i),this.state$.messages.child(e).set({state:t,lookup:r,loadedAll:n});const s=this.state$.ephemeralMessages.child(e);for(const n of t){const t=this.state$.ephemeralMessageIdMapping.child(e).child(n.id).peek();t&&s.child(t).delete();const r=n.content[0];if(n.sender?.id!==o||"file"!==r.type)continue;const a=r.size+","+r.filename,u=this.state$.localFileBlobUrls.child(i).child(a);if(!1!==u.fetching.peek())continue;const l=()=>u.delete();if("image"===r.subtype){u.fetching.set(!0);const e=document.createElement("img");e.addEventListener("load",l,{once:!0}),e.src=r.url}else if("video"===r.subtype){u.fetching.set(!0);const e=document.createElement("video");e.addEventListener("loaddata",l,{once:!0}),e.src=r.url}else if("audio"===r.subtype){u.fetching.set(!0);const e=document.createElement("audio");e.addEventListener("loaddata",l,{once:!0}),e.src=r.url}}}))}messageStatus(e){const t=this.state$.extCurrentConversationId.get(),n=this.state$.messages.child(t).lookup.child(e).get(),r=this.state$.ephemeralMessages.child(t).child(e).get();if(ii(n||r,"Message ID should be present in the store"),n){const e=this.state$.currentConversation.everyoneReadUntil.peek();return n.createdAt<=e?"everyoneRead":"sent"}return"sending"}}function eo(e,t){return"all"===e||"own"===e&&t||"other"===e&&!t}class to{constructor({id:e,isDayMarker:t,isReadMarker:n,timestamp:r}){this.id=e,this.isDayMarker=t,this.isReadMarker=n,this.timestamp=t?r:void 0}}function no({extConversationId:e,controller:t}){const n=ci(),r=si(),i=le(!0),o=le(null);ue((()=>{i.current=o.current.scrollTop>-30})),ae((()=>{i.current&&(o.current.scrollTop=0)}));const s=he((e=>{const t=e.currentTarget;t.scrollHeight-t.clientHeight+t.scrollTop<90&&n.messageSubscription&&n.messageSubscription.loadMore(10)}),[n.messageSubscription]),a=Yr(n.state$.typing.child(e));return bt("div",{className:"t-message-list",ref:o,"t-menu-boundary":"",onScroll:s,children:[a&&bt(r.MessageListFooter,{typing:a,t:n.t$.get(),conversation:n.state$.currentConversation.get(),currentUser:n.state$.currentUser.get(),participants:n.state$.participants.child(e).get(),chatbox:t,themeCustom:n.state$.themeCustom.get().value}),bt(Jr,{each:n.chatItems$,children:n=>bt("div",{className:"t-message-group",children:bt(Jr,{each:n,item:ro,itemProps:{controller:t,extConversationId:e}})})})]})}function ro({item$:e,controller:t,extConversationId:n}){const r=si(),i=ci(),o=Yr(e);return bt(zr,o instanceof to?{children:()=>bt(r.MessageDivider,{timestamp:o.timestamp,isReadMarker:o.isReadMarker,isDayMarker:o.isDayMarker,app:i.state$.app.appMetadata.get(),currentUser:i.state$.currentUser.get(),conversation:i.state$.currentConversation.get(),t:i.t$.get(),themeCustom:i.state$.themeCustom.get().value})}:{children:()=>bt(r.Message,{app:i.state$.app.appMetadata.get(),currentUser:i.state$.currentUser.get(),message:o,messageStatus:i.messageStatus(o.id),conversation:i.state$.currentConversation.get(),participants:i.state$.participants.child(n).get(),t:i.t$.get(),permissions:i.messagePermissions$(o).get(),chatbox:t,themeCustom:i.state$.themeCustom.get().value,device:i.state$.device.get()})})}function io(){const e=ci(),t=si(),n=Yr(e.t$),r=Yr(e.state$.themeCustom).value;return bt(t.Icon,{type:"spinner","aria-label":n.LOADING,className:"t-loading-icon",themeCustom:r})}const oo=new Set(["ByV39eoc","B1FxElnd","aW4c49tW","qGfuGtx","SbERe5ee","ilaVEa15","FOlWOSaH","dao5gGmT","DLUgAhzL","fqXFumr6","FtiWHMYT","66iWOyWt","1375amYi","mWbJgzpt","jO7GqAvL","SkFIKxo5","2z4ILc3y","aDr8oPL1","Hku1c4Pt"]);function so({appId:e,chatboxState:t}){const n="t"===e.charAt(0)||oo.has(e);return ae((()=>{switch(t.type){case"auth-failed":mi.error("Could not authenticate user. Check if you are authenticating correctly.");break;case"unknown-user":mi.error(`User \`${t.userId}\` not found. Please verify that you synchronized this user's data with TalkJS, either using the JS SDK or through the REST API.`);break;case"unexpected-error":mi.error(t.error);break;case"wrong-app-id":mi.error(`Could not find given appId: "${t.appId}". You can find your appId on https://talkjs.com/dashboard.`);break;case"server-error":break;default:ii.never(t)}}),[t]),bt("div",{className:"t-panel t-error-panel",children:[bt("span",{className:"t-heading",children:"Something went wrong."}),bt("p",{children:"Please reload the page and try again."}),bt("p",n?{style:{fontStyle:"italic"},children:["Developer note: check your browser's developer tools console for messages that may help solve the problem.",bt("br",{}),bt("small",{children:"This message only shows up in test mode."})]}:{children:"If things keep not working, do not hesitate to get in touch with us."})]})}function ao({t:e}){return bt("div",{className:"t-panel t-error-panel",children:bt("span",{className:"t-heading",style:{fontStyle:"italic"},children:e.CHAT_NOT_FOUND})})}function uo(){return bt("div",{className:"t-panel t-loading-panel",children:bt(io,{})})}function lo({t:e}){return bt("div",{className:"t-panel t-error-panel",children:[bt("span",{className:"t-heading",style:{fontStyle:"italic"},children:e.AUTH_EXPIRED_OVERLAY_TITLE}),bt("p",{children:e.AUTH_EXPIRED_OVERLAY_DESCRIPTION})]})}class co{constructor(e,t,n,r,i){this.send=t,this.attachFile=n,this.shareLocation=r,this.toggleEmojiPicker=i,this.isEmpty=e.isEmpty,this.isTyping=e.isTyping,this.atTextLimit=e.atTextLimit,this.characterCount=e.characterCount,this.showEmojiPicker=e.showEmojiPicker}}var ho={};function po(e){return String.fromCharCode(parseInt(e.slice(1),16))}Object.defineProperty(ho,"__esModule",{value:!0});var fo=ho.encode=function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,po))};function mo(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}ho.decode=function(e){return decodeURIComponent(Array.from(atob(e),mo).join(""))};const Eo=/[^a-zA-Z\u00C0-\u024F\u1E00-\u1EFF\u0400-\u044f\u0300-\u036e]+/;function go(e){const t=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(e)%Oo.length;return Oo[t]}function _o(e,t){const n=t.lastIndex;let r;const i=[];for(;null!==(r=t.exec(e));)i.push(r);return t.lastIndex=n,i}function Ao(e,t,n){let r=0;const i=[];for(const o of t)o.offset<r||(o.offset>r&&i.push(e.substring(r,o.offset)),i.push(...n(o)),r=o.offset+o.matchedText.length);return r<e.length&&i.push(e.substring(r)),i}function Do(e){{const t=document.createElement("a");return t.href=e,t.hostname}}function vo(e){const t=e.replace(/%2F/g,"/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/,"$1");return decodeURIComponent(t)}const Oo=["#996666","#9A6E61","#8D7662","#8E775E","#948771","#8A8360","#888D65","#6F8E63","#749378","#678975","#779E86","#639A8F","#6D92A1","#65869F","#697E9A","#736C9F","#8C6495","#956387","#B05D54","#B16D52","#AF8751","#AC8A56","#B7A458","#B5B35C","#83AA5D","#4F9D5D","#5FA777","#66B58F","#5FB3AC","#589AAF","#4E7F9E","#456CAC","#6456B7","#714AB2","#9771B5","#C154C1","#B05E81","#B04C6A","#B94E48","#AF593E","#C5994B","#B8C25D","#87AB39","#4FA83D","#40A860","#41AA78","#3AB09E","#3FC1AA","#56B4BE","#3EABBF","#4682B4","#7A58C1","#9966CC","#C54B8C","#B44668","#AE4560","#A3807B","#AB917A","#ACA586","#A8AF8E","#9EA587","#8BA690","#7DA98D","#7CB0A1","#8BA9A5","#7CA1A6","#859FAF","#8D90A1","#A397B4","#AE809E","#C08081","#BB8983","#B19461","#B5A27F","#B8B56A","#9AB973","#7AC488","#7CB7BB","#80B3C4","#788BBA","#7A89B8","#9678B6","#CB8FA9","#B57281","#C6726B","#C88A65","#C2955D","#C8B568","#B9C46A","#74C365","#6FD0C5","#6093D1","#7666C6","#D06DA1"],To=()=>!0;async function So(e,t,{initialDelay:n,maxDelay:r,log:i,shouldRetry:o=To}){return t().catch((async s=>{if(i&&i(`[TalkJS] Retries left: ${e}. Error: ${JSON.stringify(s)}.`),0===e)throw s;if(!(await o(s)))throw s;const a=1e3*n*1.2,u=(r?Math.min(1e3*r,a):a)*(1-.05+2*Math.random()*.05);return function(e){return e<=0?Promise.resolve():new Promise((t=>setTimeout(t,e)))}(u).then((()=>So(e-1,t,{initialDelay:u/1e3,maxDelay:r,log:i,shouldRetry:o})))}))}function yo(){const e={},t=new Promise((function(t,n){e.resolve=t,e.reject=n}));return e.promise=t,e}function Co(e,t,n){const{beforeBrowserPermissionPrompt:r,onMissingBrowserPermissionCallback:i}=pe(di);return he((async()=>{function n(t){"denied"===t&&i({type:e})}if(!r||!(await async function(e){if(!("permissions"in navigator))return!1;const t=e;try{return"prompt"===(await navigator.permissions.query({name:t})).state}catch(e){return!1}}(e)))return t((e=>{n(e)}));const o=yo(),s=yo(),a={type:e,showPrompt:async()=>(s.resolve({cancelled:!1}),await o.promise),cancel:()=>{s.resolve({cancelled:!0})}};try{r(a)}catch(e){mi.error("Your beforeBrowserPermissionPrompt callback threw an error: ",e),s.resolve({cancelled:!0})}const{cancelled:u}=await s.promise;return u?void 0:t((e=>{o.resolve(e),n(e)}))}),[r,i,e,t,...n])}async function No(e,t,n){const r=document.createElement(e);try{return r.src=URL.createObjectURL(t),await new Promise(((t,i)=>{const o="img"===e?"load":"loadedmetadata";r.addEventListener(o,(()=>{try{t(n(r))}catch(e){i(e)}}),{once:!0})}))}finally{URL.revokeObjectURL(r.src)}}var bo=function(e,t,n,r){var i;t[0]=0;for(var o=1;o<t.length;o++){var s=t[o++],a=t[o]?(t[0]|=s?1:2,n[t[o++]]):t[++o];3===s?r[0]=a:4===s?r[1]=Object.assign(r[1]||{},a):5===s?(r[1]=r[1]||{})[t[++o]]=a:6===s?r[1][t[++o]]+=a+"":s?(i=e.apply(a,bo(e,a,n,["",null])),r.push(i),a[0]?t[0]|=2:(t[o-2]=0,t[o]=i)):r.push(a)}return r},Io=new Map;function Ro(e){var t=Io.get(this);return t||(t=new Map,Io.set(this,t)),(t=bo(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,i="",o="",s=[0],a=function(e){1===r&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(0,e,i):3===r&&(e||i)?(s.push(3,e,i),r=2):2===r&&"..."===i&&e?s.push(4,e,0):2===r&&i&&!e?s.push(5,0,!0,i):r>=5&&((i||!e&&5===r)&&(s.push(r,0,i,n),r=6),e&&(s.push(r,e,0,n),r=6)),i=""},u=0;u<e.length;u++){u&&(1===r&&a(),a(u));for(var l=0;l<e[u].length;l++)t=e[u][l],1===r?"<"===t?(a(),s=[s],r=3):i+=t:4===r?"--"===i&&">"===t?(r=1,i=""):i=t+i[0]:o?t===o?o="":i+=t:'"'===t||"'"===t?o=t:">"===t?(a(),r=1):r&&("="===t?(r=5,n=i,i=""):"/"===t&&(r<5||">"===e[u][l+1])?(a(),3===r&&(s=s[0]),r=s,(s=s[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),r=2):i+=t),3===r&&"!--"===i&&(r=4,s=s[0])}return a(),s}(e)),t),arguments,[])).length>1?t:t[0]}const wo={TALK_GMK:"AIzaSyAs_WXNLlj31EHJI_Lw8siO2B3ZJLUzBH0",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}.TALK_GMK;function ko(e){e=Math.floor(e);const t=Math.floor(e/3600);e%=3600;const n=Math.floor(e/60);e%=60;const r=e=>e.toString().padStart(2,"0");let i=`${r(n)}:${r(e)}`;return t>0&&(i=`${r(t)}:${i}`),i}const Lo=36e5,xo=864e5;function Mo(e,t,n){return new Intl.RelativeTimeFormat(n).format(-e,t)}function Fo(){}function Bo(){}function Po(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}Bo.resetWarningCache=Fo,function(){function e(e,t,n,r,i,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Bo,resetWarningCache:Fo};n.PropTypes=n}();var Uo=Po()?ue:ae;function Ho(){var e=oe(Object.create(null))[1];return he((function(){e(Object.create(null))}),[])}var jo,$o=function(e){var t=e.children,n=e.type,r=void 0===n?"reach-portal":n,i=le(null),o=le(null),s=Ho();return Uo((function(){if(i.current){var e=i.current.ownerDocument;return o.current=null==e?void 0:e.createElement(r),e.body.appendChild(o.current),s(),function(){o.current&&o.current.ownerDocument&&o.current.ownerDocument.body.removeChild(o.current)}}}),[r,s]),o.current?Ke(t,o.current):A("span",{ref:i})},Yo=["bottom","height","left","right","top","width"],zo=new Map,Vo=function e(){var t=[];zo.forEach((function(e,n){var r=n.getBoundingClientRect();(function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),Yo.some((function(n){return e[n]!==t[n]}))})(r,e.rect)&&(e.rect=r,t.push(e))})),t.forEach((function(e){e.callbacks.forEach((function(t){return t(e.rect)}))})),jo=window.requestAnimationFrame(e)};function Go(e){return!(!e||"[object Function]"!={}.toString.call(e))}function Wo(e,t,n){var r,i,o;"boolean"==typeof t?r=t:(r=null==(o=null==t?void 0:t.observe)||o,i=null==t?void 0:t.onChange),Go(n)&&(i=n);var s=oe(e.current),a=s[0],u=s[1],l=le(!1),c=le(!1),d=oe(null),h=d[0],p=d[1],f=le(i);return Uo((function(){f.current=i,e.current!==a&&u(e.current)})),Uo((function(){a&&!l.current&&(l.current=!0,p(a.getBoundingClientRect()))}),[a]),Uo((function(){if(r){var t=a;if(c.current||(c.current=!0,t=e.current),t){var n,i,o=(n=t,i=function(e){null==f.current||f.current(e),p(e)},{observe:function(){var e=0===zo.size;zo.has(n)?zo.get(n).callbacks.push(i):zo.set(n,{rect:void 0,hasRectChanged:!1,callbacks:[i]}),e&&Vo()},unobserve:function(){var e=zo.get(n);if(e){var t=e.callbacks.indexOf(i);t>=0&&e.callbacks.splice(t,1),e.callbacks.length||zo.delete(n),zo.size||cancelAnimationFrame(jo)}}});return o.observe(),function(){o.unobserve()}}}}),[r,a,e]),h}function Xo(e){return Po()?e?e.ownerDocument:document:null}function Ko(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qo(e,t){if(null!=e)if(Go(e))e(t);else try{e.current=t}catch(n){throw new Error('Cannot assign value "'+t+'" to ref "'+e+'"')}}function Jo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return he((function(e){for(var n,r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ko(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ko(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(t);!(n=r()).done;)qo(n.value,e)}),t)}var Zo=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],Qo=Zo.join(","),es="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function ts(e,t){t=t||{};var n,r,i,o=[],s=[],a=e.querySelectorAll(Qo);for(t.includeContainer&&es.call(e,Qo)&&(a=Array.prototype.slice.apply(a)).unshift(e),n=0;n<a.length;n++)ns(r=a[n])&&(0===(i=ss(r))?o.push(r):s.push({documentOrder:n,tabIndex:i,node:r}));var u=s.sort(as).map((function(e){return e.node})).concat(o);return u}function ns(e){return!(!rs(e)||function(e){return function(e){return us(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t=function(e){for(var t=0;t<e.length;t++)if(e[t].checked)return e[t]}(e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]'));return!t||t===e}(e)}(e)||ss(e)<0)}function rs(e){return!(e.disabled||function(e){return us(e)&&"hidden"===e.type}(e)||function(e){return null===e.offsetParent||"hidden"===getComputedStyle(e).visibility}(e))}ts.isTabbable=function(e){if(!e)throw new Error("No node provided");return!1!==es.call(e,Qo)&&ns(e)},ts.isFocusable=function(e){if(!e)throw new Error("No node provided");return!1!==es.call(e,is)&&rs(e)};var is=Zo.concat("iframe").join(",");function ss(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:e.tabIndex:t}function as(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function us(e){return"INPUT"===e.tagName}const ls=Ir(ts);function cs(){return cs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cs.apply(this,arguments)}var ds=["as","targetRef","position","unstable_observableRefs"],hs=Me((function(e,t){return A($o,null,A(ps,cs({ref:t},e)))})),ps=Me((function(e,t){var n=e.as,r=void 0===n?"div":n,i=e.targetRef,o=e.position,s=void 0===o?ms:o,a=e.unstable_observableRefs,u=void 0===a?[]:a,l=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,ds),c=le(null),d=Wo(c,{observe:!l.hidden}),h=Wo(i,{observe:!l.hidden}),p=Jo(c,t);return function(e,t){var n=Xo(e.current);function r(e){"Tab"===e.key&&t.current&&0===ls(t.current).length||("Tab"===e.key&&e.shiftKey?function(e){if(e.shiftKey){var t=i();return e.target===t}}(e)?function(e){var n=t.current&&ls(t.current),r=n&&n[n.length-1];r&&(e.preventDefault(),r.focus())}(e):function(e){var n=t.current&&ls(t.current);return!!n&&0!==n.length&&e.target===n[0]}(e)?s(e):function(e){return e.target===ls(n)[0]}(e)&&u():"Tab"===e.key&&(o()?function(e){var n=t.current&&ls(t.current);n&&n[0]&&(e.preventDefault(),n[0].focus())}(e):function(){if(t.current&&t.current.contains(n.activeElement||null)){var e=t.current&&ls(t.current);return Boolean(e&&e[e.length-1]===n.activeElement)}return!1}()?function(e){var t=i();t&&(e.preventDefault(),t.focus())}(e):function(e){var r=t.current?ls(n).filter((function(e){return!t.current.contains(e)})):null;return!!r&&e.target===r[r.length-1]}(e)&&u()))}function i(){var r=ls(n),i=r&&e.current?r.indexOf(e.current):-1,o=r&&r[i+1];return(!t.current||!t.current.contains(o||null))&&o}function o(){return!!e.current&&e.current===n.activeElement}function s(t){var n;t.preventDefault(),null==(n=e.current)||n.focus()}ae((function(){return n.addEventListener("keydown",r),function(){n.removeEventListener("keydown",r)}}),[]);var a=[];function u(){var e=t.current&&ls(t.current);e&&(e.forEach((function(e){a.push([e,e.tabIndex]),e.tabIndex=-1})),n.addEventListener("focusin",l))}function l(){n.removeEventListener("focusin",l),a.forEach((function(e){var t=e[0],n=e[1];t.tabIndex=n}))}}(i,c),A(r,cs({"data-reach-popover":"",ref:p},l,{style:cs({position:"absolute"},fs.apply(void 0,[s,h,d].concat(u)),l.style)}))}));function fs(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];return n?e.apply(void 0,[t,n].concat(i.map((function(e){return e.current})))):{visibility:"hidden"}}var ms=function(e,t){if(!e||!t)return{};var n=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i={top:e.top-t.height<0,right:window.innerWidth<e.left+t.width-n,bottom:window.innerHeight<e.bottom+t.height-r,left:e.left+e.width-t.width<0};return{directionRight:i.right&&!i.left,directionLeft:i.left&&!i.right,directionUp:i.bottom&&!i.top,directionDown:i.top&&!i.bottom}}(e,t),r=n.directionRight,i=n.directionUp;return cs({left:r?e.right-t.width+window.pageXOffset+"px":e.left+window.pageXOffset+"px"},function(e,t,n){return{top:n?e.top-t.height+window.pageYOffset+"px":e.top+e.height+window.pageYOffset+"px"}}(e,t,i))},Es=!1,gs=0,_s=function(){return++gs};function As(e,t){return z(t)}function Ds(){}function vs(){return vs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vs.apply(this,arguments)}var Os=["element","index"];function Ts(e){var t=e.context,n=e.children,r=e.items,i=e.set,o=he((function(e){var t=e.element,n=e.index,r=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Os);t&&i((function(e){var i;if(null!=n)return[].concat(e,[vs({},r,{element:t,index:n})]).sort((function(e,t){return e.index-t.index}));if(0===e.length)i=[vs({},r,{element:t,index:0})];else if(e.find((function(e){return e.element===t})))i=e;else{var o=e.findIndex((function(e){return!(!e.element||!t)&&Boolean(e.element.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)})),s=vs({},r,{element:t,index:o});i=-1===o?[].concat(e,[s]):[].concat(e.slice(0,o),[s],e.slice(o))}return i.map((function(e,t){return vs({},e,{index:t})}))}))}),[]),s=he((function(e){e&&i((function(t){return t.filter((function(t){return e!==t.element}))}))}),[]);return A(t.Provider,{value:de((function(){return{descendants:r,registerDescendant:o,unregisterDescendant:s}}),[r,o,s])},n)}function Ss(e){return"which"in e?3===e.which:"button"in e&&2===e.button}function ys(e){var t=le(null);return ae((function(){t.current=e}),[e]),t.current}function Cs(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return null!=e})).join("--")}function Ns(e,t){return function(n){if(e&&e(n),!n.defaultPrevented)return t(n)}}function bs(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function Is(){return Is=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Is.apply(this,arguments)}var Rs=["onKeyDown","onMouseDown","id","ref"],ws=["index","isLink","onClick","onDragStart","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseUp","onSelect","disabled","onFocus","valueText","ref"],ks=["id","onKeyDown","ref"],Ls=["onBlur","portal","position","ref"],xs="CLEAR_SELECTION_INDEX",Ms="CLICK_MENU_ITEM",Fs="CLOSE_MENU",Bs="OPEN_MENU_AT_INDEX",Ps="OPEN_MENU_CLEARED",Us="SEARCH_FOR_ITEM",Hs="SELECT_ITEM_AT_INDEX",js="SET_BUTTON_ID",$s=function(e,t){return void 0===t&&(t={}),As(0,vs({descendants:[],registerDescendant:Ds,unregisterDescendant:Ds},t))}(),Ys=As(0,{}),zs={triggerId:null,isExpanded:!1,typeaheadQuery:"",selectionIndex:-1},Vs=function(e){var t=e.id,n=e.children,r=le(null),i=le(null),o=le(null),s=oe([]),a=s[0],u=s[1],l=function(e){var t=oe(e||(Es?_s():null)),n=t[0],r=t[1];return Uo((function(){null===n&&r(_s())}),[]),ae((function(){!1===Es&&(Es=!0)}),[]),null!=n?String(n):void 0}(t),c=t||Cs("menu",l),d=Cs("menu-button",c),h=se(Xs,Is({},zs,{triggerId:d})),p=h[0],f=h[1],m=le(!1),E=le([]),g=le(!1),_=le({x:0,y:0}),D={dispatch:f,dropdownId:c,dropdownRef:i,mouseDownStartPosRef:_,popoverRef:o,readyToSelect:g,selectCallbacks:E,state:p,triggerClickedRef:m,triggerRef:r};return ae((function(){p.isExpanded?(window.__REACH_DISABLE_TOOLTIPS=!0,window.requestAnimationFrame((function(){Ws(i.current)}))):window.__REACH_DISABLE_TOOLTIPS=!1}),[p.isExpanded]),A(Ts,{context:$s,items:a,set:u},A(Ys.Provider,{value:D},Go(n)?n({isExpanded:p.isExpanded,isOpen:p.isExpanded}):n))};function Gs(e){var t=pe(Ys).dropdownId;return null!=e&&e>-1?Cs("option-"+e,t):void 0}function Ws(e){e&&e.focus()}function Xs(e,t){switch(void 0===t&&(t={}),t.type){case Ms:case Fs:return Is({},e,{isExpanded:!1,selectionIndex:-1});case"OPEN_MENU_AT_FIRST_ITEM":return Is({},e,{isExpanded:!0,selectionIndex:0});case Bs:return Is({},e,{isExpanded:!0,selectionIndex:t.payload.index});case Ps:return Is({},e,{isExpanded:!0,selectionIndex:-1});case Hs:var n=t.payload.dropdownRef,r=void 0===n?{current:null}:n;if(t.payload.index>=0&&t.payload.index!==e.selectionIndex){if(r.current){var i=Xo(r.current);r.current!==(null==i?void 0:i.activeElement)&&r.current.focus()}return Is({},e,{selectionIndex:null!=t.payload.max?Math.min(Math.max(t.payload.index,0),t.payload.max):Math.max(t.payload.index,0)})}return e;case xs:return Is({},e,{selectionIndex:-1});case js:return Is({},e,{triggerId:t.payload});case Us:return void 0!==t.payload?Is({},e,{typeaheadQuery:t.payload}):e;default:return e}}function Ks(){return pe(Ys)}function qs(){return pe($s).descendants}var Js={exports:{}},Zs={},Qs="function"==typeof Symbol&&Symbol.for,ea=Qs?Symbol.for("react.element"):60103,ta=Qs?Symbol.for("react.portal"):60106,na=Qs?Symbol.for("react.fragment"):60107,ra=Qs?Symbol.for("react.strict_mode"):60108,ia=Qs?Symbol.for("react.profiler"):60114,oa=Qs?Symbol.for("react.provider"):60109,sa=Qs?Symbol.for("react.context"):60110,aa=Qs?Symbol.for("react.async_mode"):60111,ua=Qs?Symbol.for("react.concurrent_mode"):60111,la=Qs?Symbol.for("react.forward_ref"):60112,ca=Qs?Symbol.for("react.suspense"):60113,da=Qs?Symbol.for("react.suspense_list"):60120,ha=Qs?Symbol.for("react.memo"):60115,pa=Qs?Symbol.for("react.lazy"):60116,fa=Qs?Symbol.for("react.block"):60121,ma=Qs?Symbol.for("react.fundamental"):60117,Ea=Qs?Symbol.for("react.responder"):60118,ga=Qs?Symbol.for("react.scope"):60119;function _a(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case ea:switch(e=e.type){case aa:case ua:case na:case ia:case ra:case ca:return e;default:switch(e=e&&e.$$typeof){case sa:case la:case pa:case ha:case oa:return e;default:return t}}case ta:return t}}}function Aa(e){return _a(e)===ua}Zs.AsyncMode=aa,Zs.ConcurrentMode=ua,Zs.ContextConsumer=sa,Zs.ContextProvider=oa,Zs.Element=ea,Zs.ForwardRef=la,Zs.Fragment=na,Zs.Lazy=pa,Zs.Memo=ha,Zs.Portal=ta,Zs.Profiler=ia,Zs.StrictMode=ra,Zs.Suspense=ca,Zs.isAsyncMode=function(e){return Aa(e)||_a(e)===aa},Zs.isConcurrentMode=Aa,Zs.isContextConsumer=function(e){return _a(e)===sa},Zs.isContextProvider=function(e){return _a(e)===oa},Zs.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===ea},Zs.isForwardRef=function(e){return _a(e)===la},Zs.isFragment=function(e){return _a(e)===na},Zs.isLazy=function(e){return _a(e)===pa},Zs.isMemo=function(e){return _a(e)===ha},Zs.isPortal=function(e){return _a(e)===ta},Zs.isProfiler=function(e){return _a(e)===ia},Zs.isStrictMode=function(e){return _a(e)===ra},Zs.isSuspense=function(e){return _a(e)===ca},Zs.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===na||e===ua||e===ia||e===ra||e===ca||e===da||"object"==typeof e&&null!==e&&(e.$$typeof===pa||e.$$typeof===ha||e.$$typeof===oa||e.$$typeof===sa||e.$$typeof===la||e.$$typeof===ma||e.$$typeof===Ea||e.$$typeof===ga||e.$$typeof===fa)},Zs.typeOf=_a,Js.exports=Zs;var Da=Js.exports;function va(){return va=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},va.apply(this,arguments)}function Oa(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var Ta=["as","id","children"],Sa=["as"],ya=["as"],Ca=["as"],Na=["as"],ba=["as"],Ia=Me((function(e,t){var n=e.as,r=void 0===n?O:n,i=e.id,o=e.children,s=Oa(e,Ta),a=de((function(){try{return Da.isFragment(A(r,null))}catch(e){return!1}}),[r])?{}:va({ref:t,id:i,"data-reach-menu":""},s);return A(r,a,A(Vs,{id:i,children:o}))})),Ra=Me((function(e,t){var n=e.as,r=void 0===n?"button":n,i=function(e){var t=e.onKeyDown,n=e.onMouseDown,r=e.id,i=e.ref,o=bs(e,Rs),s=Ks(),a=s.dispatch,u=s.dropdownId,l=s.mouseDownStartPosRef,c=s.triggerClickedRef,d=s.triggerRef,h=s.state,p=h.triggerId,f=h.isExpanded,m=Jo(d,i),E=qs(),g=de((function(){return E.findIndex((function(e){return!e.disabled}))}),[E]);return ae((function(){null!=r&&r!==p&&a({type:js,payload:r})}),[p,a,r]),{data:{isExpanded:f,controls:u},props:Is({},o,{ref:m,id:p||void 0,onKeyDown:Ns(t,(function(e){switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),a({type:Bs,payload:{index:g}});break;case"Enter":case" ":a({type:Bs,payload:{index:g}})}})),onMouseDown:Ns(n,(function(e){Ss(e.nativeEvent)||(l.current={x:e.clientX,y:e.clientY},f||(c.current=!0),a(f?{type:Fs}:{type:Ps}))})),type:"button"})}}(va({},Oa(e,Sa),{ref:t})),o=i.data;return A(r,va({"aria-expanded":!!o.isExpanded||void 0,"aria-haspopup":!0,"aria-controls":o.controls},i.props,{"data-reach-menu-button":""}))})),wa=Me((function(e,t){var n=e.as,r=void 0===n?"div":n,i=function(e){var t=e.index,n=e.isLink,r=void 0!==n&&n,i=e.onClick,o=e.onDragStart,s=e.onMouseDown,a=e.onMouseEnter,u=e.onMouseLeave,l=e.onMouseMove,c=e.onMouseUp,d=e.onSelect,h=e.disabled,p=e.onFocus,f=e.valueText,m=e.ref,E=bs(e,ws),g=Ks(),_=g.dispatch,A=g.dropdownRef,D=g.mouseDownStartPosRef,v=g.readyToSelect,O=g.selectCallbacks,T=g.triggerRef,S=g.state,y=S.selectionIndex,C=S.isExpanded,N=le(null),b=oe(f||""),I=b[0],R=b[1],w=he((function(e){!f&&null!=e&&e.textContent&&R(e.textContent)}),[f]),k=le(!1),L=function(e){var t=oe(null),n=t[0],r=t[1];return[n,he((function(t){e.current=t,r(t)}),[])]}(N),x=L[0],M=L[1],F=function(e,t,n){var r=Ho(),i=pe(t),o=i.registerDescendant,s=i.unregisterDescendant,a=i.descendants,u=null!=n?n:a.findIndex((function(t){return t.element===e.element}));return Uo((function(){return e.element||r(),o(vs({},e,{index:u})),function(){s(e.element)}}),[e,r,u,o,s].concat(Object.values(e))),u}(de((function(){return{element:x,key:I,disabled:h,isLink:r}}),[h,x,r,I]),$s,t),B=F===y&&!h,P=Jo(m,M,w);function U(){Ws(T.current),d&&d(),_({type:Ms})}return O.current[F]=d,ae((function(){if(C){var e=window.setTimeout((function(){v.current=!0}),400);return function(){window.clearTimeout(e)}}v.current=!1}),[C,v]),ae((function(){var e=Xo(N.current);return e.addEventListener("mouseup",t),function(){e.removeEventListener("mouseup",t)};function t(){k.current=!1}}),[]),{data:{disabled:h},props:Is({id:Gs(F),tabIndex:-1},E,{ref:P,"data-disabled":h?"":void 0,"data-selected":B?"":void 0,"data-valuetext":I,onClick:Ns(i,(function(e){Ss(e.nativeEvent)||r&&(h?e.preventDefault():U())})),onDragStart:Ns(o,(function(e){r&&e.preventDefault()})),onMouseDown:Ns(s,(function(e){Ss(e.nativeEvent)||(r?k.current=!0:e.preventDefault())})),onMouseEnter:Ns(a,(function(e){var t=Xo(A.current);B||null==F||h||(null!=A&&A.current&&A.current!==t.activeElement&&N.current!==t.activeElement&&A.current.focus(),_({type:Hs,payload:{index:F}}))})),onMouseLeave:Ns(u,(function(e){_({type:xs})})),onMouseMove:Ns(l,(function(e){if(!v.current){var t=Math.abs(e.clientX-D.current.x),n=Math.abs(e.clientY-D.current.y);(t>8||n>8)&&(v.current=!0)}B||null==F||h||_({type:Hs,payload:{index:F,dropdownRef:A}})})),onFocus:Ns(p,(function(){v.current=!0,B||null==F||h||_({type:Hs,payload:{index:F}})})),onMouseUp:Ns(c,(function(e){Ss(e.nativeEvent)||(v.current?r?k.current?k.current=!1:N.current&&N.current.click():h||U():v.current=!0)}))})}}(va({},Oa(e,ya),{ref:t})),o=i.data.disabled;return A(r,va({role:"menuitem"},i.props,{"aria-disabled":o||void 0,"data-reach-menu-item":""}))})),ka=Me((function(e,t){var n=e.as,r=void 0===n?"div":n,i=Oa(e,Ca);return A(wa,va({},i,{ref:t,as:r}))})),La=Me((function(e,t){var n=e.as,r=void 0===n?"div":n,i=function(e){e.id;var t=e.onKeyDown,n=e.ref,r=bs(e,ks),i=Ks(),o=i.dispatch,s=i.triggerRef,a=i.dropdownRef,u=i.selectCallbacks,l=i.dropdownId,c=i.state,d=c.isExpanded,h=c.triggerId,p=c.selectionIndex,f=c.typeaheadQuery,m=qs(),E=Jo(a,n);ae((function(){var e=function(e,t){if(void 0===t&&(t=""),!t)return null;var n=e.find((function(e){var n,r,i;return!e.disabled&&(null==(n=e.element)||null==(r=n.dataset)||null==(i=r.valuetext)?void 0:i.toLowerCase().startsWith(t))}));return n?e.indexOf(n):null}(m,f);f&&null!=e&&o({type:Hs,payload:{index:e,dropdownRef:a}});var t=window.setTimeout((function(){return f&&o({type:Us,payload:""})}),1e3);return function(){return window.clearTimeout(t)}}),[o,m,f,a]);var g=ys(m.length),_=ys(m[p]),A=ys(p);ae((function(){p>m.length-1?o({type:Hs,payload:{index:m.length-1,dropdownRef:a}}):g!==m.length&&p>-1&&_&&A===p&&m[p]!==_&&o({type:Hs,payload:{index:m.findIndex((function(e){return e.key===(null==_?void 0:_.key)})),dropdownRef:a}})}),[a,o,m,g,_,A,p]);var D=Ns((function(e){var t=e.key;if(d)switch(t){case"Enter":case" ":var n=m.find((function(e){return e.index===p}));n&&!n.disabled&&(e.preventDefault(),n.isLink&&n.element?n.element.click():(Ws(s.current),u.current[n.index]&&u.current[n.index](),o({type:Ms})));break;case"Escape":Ws(s.current),o({type:Fs});break;case"Tab":e.preventDefault();break;default:if("string"==typeof t&&1===t.length){var r=f+t.toLowerCase();o({type:Us,payload:r})}}}),function(e,t){var n=pe(e).descendants,r=t.callback,i=t.currentIndex,o=t.filter,s=t.key,a=void 0===s?"index":s,u=t.orientation,l=void 0===u?"vertical":u,c=t.rotate,d=void 0===c||c,h=t.rtl,p=void 0!==h&&h;return function(e){if(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(e.key)){var t=null!=i?i:-1,s=o?n.filter(o):n;if(s.length){var u=s.findIndex((function(e){return e.index===i}));switch(e.key){case"ArrowDown":if("vertical"===l||"both"===l){e.preventDefault();var c=D();r("option"===a?c:c[a])}break;case"ArrowUp":if("vertical"===l||"both"===l){e.preventDefault();var h=v();r("option"===a?h:h[a])}break;case"ArrowLeft":if("horizontal"===l||"both"===l){e.preventDefault();var f=(p?D:v)();r("option"===a?f:f[a])}break;case"ArrowRight":if("horizontal"===l||"both"===l){e.preventDefault();var m=(p?v:D)();r("option"===a?m:m[a])}break;case"PageUp":e.preventDefault();var E=(e.ctrlKey?v:O)();r("option"===a?E:E[a]);break;case"Home":e.preventDefault();var g=O();r("option"===a?g:g[a]);break;case"PageDown":e.preventDefault();var _=(e.ctrlKey?D:T)();r("option"===a?_:_[a]);break;case"End":e.preventDefault();var A=T();r("option"===a?A:A[a])}}}function D(){return t===T().index?d?O():s[u]:s[(u+1)%s.length]}function v(){return t===O().index?d?T():s[u]:s[(u-1+s.length)%s.length]}function O(){return s[0]}function T(){return s[s.length-1]}}}($s,{currentIndex:p,orientation:"vertical",rotate:!1,filter:function(e){return!e.disabled},callback:function(e){o({type:Hs,payload:{index:e,dropdownRef:a}})},key:"index"}));return{data:{activeDescendant:Gs(p)||void 0,triggerId:h},props:Is({tabIndex:-1},r,{ref:E,id:l,onKeyDown:Ns(t,D)})}}(va({},Oa(e,Na),{ref:t})),o=i.data;return A(r,va({"aria-activedescendant":o.activeDescendant,"aria-labelledby":o.triggerId||void 0,role:"menu"},i.props,{"data-reach-menu-items":""}))})),xa=Me((function(e,t){var n=e.as,r=void 0===n?"div":n,i=function(e){var t=e.onBlur,n=e.portal,r=void 0===n||n,i=e.position,o=e.ref,s=bs(e,Ls),a=Ks(),u=a.triggerRef,l=a.triggerClickedRef,c=a.dispatch,d=a.dropdownRef,h=a.popoverRef,p=a.state.isExpanded,f=Jo(h,o);return ae((function(){if(p){var e=Xo(h.current);return e.addEventListener("mousedown",t),function(){e.removeEventListener("mousedown",t)}}function t(e){var t,n;l.current?l.current=!1:(t=h.current,n=e.target,t&&t.contains(n)||c({type:Fs}))}}),[l,u,c,d,h,p]),{data:{portal:r,position:i,targetRef:u,isExpanded:p},props:Is({ref:f,hidden:!p,onBlur:Ns(t,(function(e){e.currentTarget.contains(e.relatedTarget)||c({type:Fs})}))},s)}}(va({},Oa(e,ba),{ref:t})),o=i.data,s=o.portal,a=o.targetRef,u=o.position,l=i.props,c={"data-reach-menu-popover":""};return s?A(hs,va({},l,c,{as:r,targetRef:a,position:u})):A(r,va({},l,c))})),Ma=[],Fa=function(e){return void 0===e},Ba=/\s*(\.\d+|\d+(?:\.\d+)?)(%|deg)?\s*/,Pa=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,Ua=new RegExp("^(rgb|hsl|hsv)a?\\("+Ba.source+"[, ]"+Ba.source+"[, ]"+Ba.source+"(?:[,/]"+Ba.source+")?\\)$","i");function Ha(e,t,n){return"%"===e?100:"deg"===e||n&&0===t?360:e?void 0:255}function ja(e){if(Array.isArray(e)){if("string"==typeof e[0]&&"function"==typeof ja[e[0]])return new ja[e[0]](e.slice(1,e.length));if(4===e.length)return new ja.RGB(e[0]/255,e[1]/255,e[2]/255,e[3]/255)}else if("string"==typeof e){var t=e.toLowerCase();ja.namedColors[t]&&(e="#"+ja.namedColors[t]),"transparent"===t&&(e="rgba(0,0,0,0)");var n=e.match(Ua);if(n){var r=n[1].toUpperCase(),i="H"===r[0];if(Fa(ja[r]))throw new Error("color."+r+" is not installed.");let e=Fa(n[8])?1:void 0;return void 0===e&&(e="%"===n[9]?parseFloat(n[8])/100:parseFloat(n[8])),new ja[r](parseFloat(n[2])/Ha(n[3],0,i),parseFloat(n[4])/Ha(n[5],1,i),parseFloat(n[6])/Ha(n[7],2,i),e)}e.length<6&&(e=e.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,"$1$1$2$2$3$3$4$4"));var o=e.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])?$/i);if(o)return new ja.RGB(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255,o[4]?parseInt(o[4],16)/255:1);if(ja.CMYK){var s=e.match(new RegExp("^cmyk\\("+Pa.source+","+Pa.source+","+Pa.source+","+Pa.source+"\\)$","i"));if(s)return new ja.CMYK(parseFloat(s[1])/100,parseFloat(s[2])/100,parseFloat(s[3])/100,parseFloat(s[4])/100)}}else if("object"==typeof e&&e.isColor)return e;return!1}ja.namedColors={},ja.installColorSpace=function(e,t,n){ja[e]=function(n){var r=Array.isArray(n)?n:arguments;t.forEach((function(n,i){var o=r[i];if("alpha"===n)this._alpha=isNaN(o)||o>1?1:o<0?0:o;else{if(isNaN(o))throw new Error("["+e+"]: Invalid color: ("+t.join(",")+")");"hue"===n?this._hue=o<0?o-Math.floor(o):o%1:this["_"+n]=o<0?0:o>1?1:o}}),this)},ja[e].propertyNames=t;var r=ja[e].prototype;for(var i in["valueOf","hex","hexa","css","cssa"].forEach((function(t){r[t]=r[t]||("RGB"===e?r.hex:function(){return this.rgb()[t]()})})),r.isColor=!0,r.equals=function(n,r){Fa(r)&&(r=1e-10),n=n[e.toLowerCase()]();for(var i=0;i<t.length;i+=1)if(Math.abs(this["_"+t[i]]-n["_"+t[i]])>r)return!1;return!0},r.toJSON=function(){return[e].concat(t.map((function(e){return this["_"+e]}),this))},n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=i.match(/^from(.*)$/);o?ja[o[1].toUpperCase()].prototype[e.toLowerCase()]=n[i]:r[i]=n[i]}function s(e,t){var n={};for(var r in n[t.toLowerCase()]=function(){return this.rgb()[t.toLowerCase()]()},ja[t].propertyNames.forEach((function(e){var r="black"===e?"k":e.charAt(0);n[e]=n[r]=function(n,r){return this[t.toLowerCase()]()[e](n,r)}})),n)Object.prototype.hasOwnProperty.call(n,r)&&void 0===ja[e].prototype[r]&&(ja[e].prototype[r]=n[r])}return r[e.toLowerCase()]=function(){return this},r.toString=function(){return"["+e+" "+t.map((function(e){return this["_"+e]}),this).join(", ")+"]"},t.forEach((function(e){var n="black"===e?"k":e.charAt(0);r[e]=r[n]=function(n,r){return void 0===n?this["_"+e]:r?new this.constructor(t.map((function(t){return this["_"+t]+(e===t?n:0)}),this)):new this.constructor(t.map((function(t){return e===t?n:this["_"+t]}),this))}})),Ma.forEach((function(t){s(e,t),s(t,e)})),Ma.push(e),ja},ja.pluginList=[],ja.use=function(e){return-1===ja.pluginList.indexOf(e)&&(this.pluginList.push(e),e(ja)),ja},ja.installMethod=function(e,t){return Ma.forEach((function(n){ja[n].prototype[e]=t})),this},ja.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var e=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-e.length)+e},hexa:function(){var e=Math.round(255*this._alpha).toString(16);return this.hex()+"00".substr(0,2-e.length)+e},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}});var $a=function(e){e.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var t=function(e){return e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92},n=t(this._red),r=t(this._green),i=t(this._blue);return new e.XYZ(.4124564*n+.3575761*r+.1804375*i,.2126729*n+.7151522*r+.072175*i,.0193339*n+.119192*r+.9503041*i,this._alpha)},rgb:function(){var t=this._x,n=this._y,r=this._z,i=function(e){return e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e};return new e.RGB(i(3.2404542*t+-1.5371385*n+-.4985314*r),i(-.969266*t+1.8760108*n+.041556*r),i(.0556434*t+-.2040259*n+1.0572252*r),this._alpha)},lab:function(){var t=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},n=t(this._x/95.047),r=t(this._y/100),i=t(this._z/108.883);return new e.LAB(116*r-16,500*(n-r),200*(r-i),this._alpha)}})},Ya=function(e){e.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var t,n,r,i=this._hue,o=this._saturation,s=this._value,a=Math.min(5,Math.floor(6*i)),u=6*i-a,l=s*(1-o),c=s*(1-u*o),d=s*(1-(1-u)*o);switch(a){case 0:t=s,n=d,r=l;break;case 1:t=c,n=s,r=l;break;case 2:t=l,n=s,r=d;break;case 3:t=l,n=c,r=s;break;case 4:t=d,n=l,r=s;break;case 5:t=s,n=l,r=c}return new e.RGB(t,n,r,this._alpha)},hsl:function(){var t,n=(2-this._saturation)*this._value,r=this._saturation*this._value,i=n<=1?n:2-n;return t=i<1e-9?0:r/i,new e.HSL(this._hue,t,n/2,this._alpha)},fromRgb:function(){var t,n=this._red,r=this._green,i=this._blue,o=Math.max(n,r,i),s=o-Math.min(n,r,i),a=0===o?0:s/o,u=o;if(0===s)t=0;else switch(o){case n:t=(r-i)/s/6+(r<i?1:0);break;case r:t=(i-n)/s/6+1/3;break;case i:t=(n-r)/s/6+2/3}return new e.HSV(t,a,u,this._alpha)}})},za=function(e){e.use(Ya),e.installColorSpace("HSL",["hue","saturation","lightness","alpha"],{hsv:function(){var t,n=2*this._lightness,r=this._saturation*(n<=1?n:2-n);return t=n+r<1e-9?0:2*r/(n+r),new e.HSV(this._hue,t,(n+r)/2,this._alpha)},rgb:function(){return this.hsv().rgb()},fromRgb:function(){return this.hsv().hsl()}})},Va=function(e){function t(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}e.installMethod("luminance",(function(){var e=this.rgb();return.2126*t(e._red)+.7152*t(e._green)+.0722*t(e._blue)}))},Ga=function(e){e.installMethod("isDark",(function(){var e=this.rgb();return(255*e._red*299+255*e._green*587+255*e._blue*114)/1e3<128}))},Wa=ja.use($a).use((function(e){e.use($a),e.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var t=function(e){var t=Math.pow(e,3);return t>.008856?t:(e-16/116)/7.87},n=(this._l+16)/116,r=this._a/500+n,i=n-this._b/200;return new e.XYZ(95.047*t(r),100*t(n),108.883*t(i),this._alpha)}})})).use(Ya).use(za).use((function(e){e.installColorSpace("CMYK",["cyan","magenta","yellow","black","alpha"],{rgb:function(){return new e.RGB(1-this._cyan*(1-this._black)-this._black,1-this._magenta*(1-this._black)-this._black,1-this._yellow*(1-this._black)-this._black,this._alpha)},fromRgb:function(){var t=this._red,n=this._green,r=this._blue,i=1-t,o=1-n,s=1-r,a=1;return t||n||r?(i=(i-(a=Math.min(i,Math.min(o,s))))/(1-a),o=(o-a)/(1-a),s=(s-a)/(1-a)):a=1,new e.CMYK(i,o,s,a,this._alpha)}})})).use((function(e){e.namedColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}})).use((function(e){e.installMethod("clearer",(function(e){return this.alpha(isNaN(e)?-.1:-e,!0)}))})).use((function(e){e.use(Va),e.installMethod("contrast",(function(e){var t=this.luminance(),n=e.luminance();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)}))})).use((function(e){e.use(za),e.installMethod("darken",(function(e){return this.lightness(isNaN(e)?-.1:-e,!0)}))})).use((function(e){e.use(za),e.installMethod("desaturate",(function(e){return this.saturation(isNaN(e)?-.1:-e,!0)}))})).use((function(e){function t(){var t=this.rgb(),n=.3*t._red+.59*t._green+.11*t._blue;return new e.RGB(n,n,n,t._alpha)}e.installMethod("greyscale",t).installMethod("grayscale",t)})).use(Ga).use((function(e){e.use(Ga),e.installMethod("isLight",(function(){return!this.isDark()}))})).use((function(e){e.use(za),e.installMethod("lighten",(function(e){return this.lightness(isNaN(e)?.1:e,!0)}))})).use(Va).use((function(e){e.installMethod("mix",(function(t,n){t=e(t).rgb();var r=2*(n=1-(isNaN(n)?.5:n))-1,i=this._alpha-t._alpha,o=((r*i==-1?r:(r+i)/(1+r*i))+1)/2,s=1-o,a=this.rgb();return new e.RGB(a._red*o+t._red*s,a._green*o+t._green*s,a._blue*o+t._blue*s,a._alpha*n+t._alpha*(1-n))}))})).use((function(e){e.installMethod("negate",(function(){var t=this.rgb();return new e.RGB(1-t._red,1-t._green,1-t._blue,this._alpha)}))})).use((function(e){e.installMethod("opaquer",(function(e){return this.alpha(isNaN(e)?.1:e,!0)}))})).use((function(e){e.use(za),e.installMethod("rotate",(function(e){return this.hue((e||0)/360,!0)}))})).use((function(e){e.use(za),e.installMethod("saturate",(function(e){return this.saturation(isNaN(e)?.1:e,!0)}))})).use((function(e){e.installMethod("toAlpha",(function(e){var t=this.rgb(),n=e(e).rgb(),r=new e.RGB(0,0,0,t._alpha),i=["_red","_green","_blue"];return i.forEach((function(e){t[e]<1e-10?r[e]=t[e]:t[e]>n[e]?r[e]=(t[e]-n[e])/(1-n[e]):t[e]>n[e]?r[e]=(n[e]-t[e])/n[e]:r[e]=0})),r._red>r._green?r._red>r._blue?t._alpha=r._red:t._alpha=r._blue:r._green>r._blue?t._alpha=r._green:t._alpha=r._blue,t._alpha<1e-10||(i.forEach((function(e){t[e]=(t[e]-n[e])/t._alpha+n[e]})),t._alpha*=r._alpha),t}))}));const Xa=Ir(Wa);function Ka(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;let qa=class{constructor(){this.listeners={}}on(e,t,n){if(this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(t),null==n?void 0:n.once){const n=()=>{this.un(e,n),this.un(e,t)};return this.on(e,n),n}return()=>this.un(e,t)}un(e,t){var n;null===(n=this.listeners[e])||void 0===n||n.delete(t)}once(e,t){return this.on(e,t,{once:!0})}unAll(){this.listeners={}}emit(e,...t){this.listeners[e]&&this.listeners[e].forEach((e=>e(...t)))}};const Ja={decode:function(e,t){return Ka(this,void 0,void 0,(function*(){const n=new AudioContext({sampleRate:t});return n.decodeAudioData(e).finally((()=>n.close()))}))},createBuffer:function(e,t){return"number"==typeof e[0]&&(e=[e]),function(e){const t=e[0];if(t.some((e=>e>1||e<-1))){const n=t.length;let r=0;for(let e=0;e<n;e++){const n=Math.abs(t[e]);n>r&&(r=n)}for(const t of e)for(let e=0;e<n;e++)t[e]/=r}}(e),{duration:t,length:e[0].length,sampleRate:e[0].length/t,numberOfChannels:e.length,getChannelData:t=>null==e?void 0:e[t],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Za(e,t){const n=t.xmlns?document.createElementNS(t.xmlns,e):document.createElement(e);for(const[r,i]of Object.entries(t))if("children"===r)for(const[e,o]of Object.entries(t))"string"==typeof o?n.appendChild(document.createTextNode(o)):n.appendChild(Za(e,o));else"style"===r?Object.assign(n.style,i):"textContent"===r?n.textContent=i:n.setAttribute(r,i.toString());return n}function Qa(e,t,n){const r=Za(e,t||{});return null==n||n.appendChild(r),r}var eu=Object.freeze({__proto__:null,createElement:Qa,default:Qa});const tu={fetchBlob:function(e,t,n){return Ka(this,void 0,void 0,(function*(){const r=yield fetch(e,n);if(r.status>=400)throw new Error(`Failed to fetch ${e}: ${r.status} (${r.statusText})`);return function(e,t){Ka(this,void 0,void 0,(function*(){if(!e.body||!e.headers)return;const n=e.body.getReader(),r=Number(e.headers.get("Content-Length"))||0;let i=0;const o=e=>Ka(this,void 0,void 0,(function*(){i+=(null==e?void 0:e.length)||0;const n=Math.round(i/r*100);t(n)})),s=()=>Ka(this,void 0,void 0,(function*(){let e;try{e=yield n.read()}catch(e){return}e.done||(o(e.value),yield s())}));s()}))}(r.clone(),t),r.blob()}))}};let nu=class extends qa{constructor(e){super(),this.isExternalMedia=!1,e.media?(this.media=e.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),e.mediaControls&&(this.media.controls=!0),e.autoplay&&(this.media.autoplay=!0),null!=e.playbackRate&&this.onMediaEvent("canplay",(()=>{null!=e.playbackRate&&(this.media.playbackRate=e.playbackRate)}),{once:!0})}onMediaEvent(e,t,n){return this.media.addEventListener(e,t,n),()=>this.media.removeEventListener(e,t,n)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const e=this.getSrc();e.startsWith("blob:")&&URL.revokeObjectURL(e)}canPlayType(e){return""!==this.media.canPlayType(e)}setSrc(e,t){const n=this.getSrc();if(e&&n===e)return;this.revokeSrc();const r=t instanceof Blob&&(this.canPlayType(t.type)||!e)?URL.createObjectURL(t):e;try{this.media.src=r}catch(t){this.media.src=e}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(e){this.media=e}play(){return Ka(this,void 0,void 0,(function*(){return this.media.play()}))}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(e){this.media.currentTime=e}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(e){this.media.volume=e}getMuted(){return this.media.muted}setMuted(e){this.media.muted=e}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(e,t){null!=t&&(this.media.preservesPitch=t),this.media.playbackRate=e}getMediaElement(){return this.media}setSinkId(e){return this.media.setSinkId(e)}},ru=class e extends qa{constructor(e,t){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.subscriptions=[],this.options=e;const n=this.parentFromOptionsContainer(e.container);this.parent=n;const[r,i]=this.initHtml();n.appendChild(r),this.container=r,this.scrollContainer=i.querySelector(".scroll"),this.wrapper=i.querySelector(".wrapper"),this.canvasWrapper=i.querySelector(".canvases"),this.progressWrapper=i.querySelector(".progress"),this.cursor=i.querySelector(".cursor"),t&&i.appendChild(t),this.initEvents()}parentFromOptionsContainer(e){let t;if("string"==typeof e?t=document.querySelector(e):e instanceof HTMLElement&&(t=e),!t)throw new Error("Container not found");return t}initEvents(){const e=e=>{const t=this.wrapper.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;return[n/t.width,r/t.height]};if(this.wrapper.addEventListener("click",(t=>{const[n,r]=e(t);this.emit("click",n,r)})),this.wrapper.addEventListener("dblclick",(t=>{const[n,r]=e(t);this.emit("dblclick",n,r)})),!0!==this.options.dragToSeek&&"object"!=typeof this.options.dragToSeek||this.initDrag(),this.scrollContainer.addEventListener("scroll",(()=>{const{scrollLeft:e,scrollWidth:t,clientWidth:n}=this.scrollContainer,r=e/t,i=(e+n)/t;this.emit("scroll",r,i,e,e+n)})),"function"==typeof ResizeObserver){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver((()=>{e().then((()=>this.onContainerResize())).catch((()=>{}))})),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const e=this.parent.clientWidth;e===this.lastContainerWidth&&"auto"!==this.options.height||(this.lastContainerWidth=e,this.reRender())}initDrag(){this.subscriptions.push(function(e,t,n,r,i=3,o=0,s=100){if(!e)return()=>{};const a=matchMedia("(pointer: coarse)").matches;let u=()=>{};const l=l=>{if(l.button!==o)return;l.preventDefault(),l.stopPropagation();let c=l.clientX,d=l.clientY,h=!1;const p=Date.now(),f=r=>{if(r.preventDefault(),r.stopPropagation(),a&&Date.now()-p<s)return;const o=r.clientX,u=r.clientY,l=o-c,f=u-d;if(h||Math.abs(l)>i||Math.abs(f)>i){const r=e.getBoundingClientRect(),{left:i,top:s}=r;h||(null==n||n(c-i,d-s),h=!0),t(l,f,o-i,u-s),c=o,d=u}},m=t=>{if(h){const n=t.clientX,i=t.clientY,o=e.getBoundingClientRect(),{left:s,top:a}=o;null==r||r(n-s,i-a)}u()},E=e=>{e.relatedTarget&&e.relatedTarget!==document.documentElement||m(e)},g=e=>{h&&(e.stopPropagation(),e.preventDefault())},_=e=>{h&&e.preventDefault()};document.addEventListener("pointermove",f),document.addEventListener("pointerup",m),document.addEventListener("pointerout",E),document.addEventListener("pointercancel",E),document.addEventListener("touchmove",_,{passive:!1}),document.addEventListener("click",g,{capture:!0}),u=()=>{document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",m),document.removeEventListener("pointerout",E),document.removeEventListener("pointercancel",E),document.removeEventListener("touchmove",_),setTimeout((()=>{document.removeEventListener("click",g,{capture:!0})}),10)}};return e.addEventListener("pointerdown",l),()=>{u(),e.removeEventListener("pointerdown",l)}}(this.wrapper,((e,t,n)=>{this.emit("drag",Math.max(0,Math.min(1,n/this.wrapper.getBoundingClientRect().width)))}),(e=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))}),(e=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))})))}getHeight(e,t){var n;const r=(null===(n=this.audioData)||void 0===n?void 0:n.numberOfChannels)||1;if(null==e)return 128;if(!isNaN(Number(e)))return Number(e);if("auto"===e){const e=this.parent.clientHeight||128;return(null==t?void 0:t.every((e=>!e.overlay)))?e/r:e}return 128}initHtml(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"});return t.innerHTML=`\n <style>\n :host {\n user-select: none;\n min-width: 1px;\n }\n :host audio {\n display: block;\n width: 100%;\n }\n :host .scroll {\n overflow-x: auto;\n overflow-y: hidden;\n width: 100%;\n position: relative;\n }\n :host .noScrollbar {\n scrollbar-color: transparent;\n scrollbar-width: none;\n }\n :host .noScrollbar::-webkit-scrollbar {\n display: none;\n -webkit-appearance: none;\n }\n :host .wrapper {\n position: relative;\n overflow: visible;\n z-index: 2;\n }\n :host .canvases {\n min-height: ${this.getHeight(this.options.height,this.options.splitChannels)}px;\n }\n :host .canvases > div {\n position: relative;\n }\n :host canvas {\n display: block;\n position: absolute;\n top: 0;\n image-rendering: pixelated;\n }\n :host .progress {\n pointer-events: none;\n position: absolute;\n z-index: 2;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n overflow: hidden;\n }\n :host .progress > div {\n position: relative;\n }\n :host .cursor {\n pointer-events: none;\n position: absolute;\n z-index: 5;\n top: 0;\n left: 0;\n height: 100%;\n border-radius: 2px;\n }\n </style>\n\n <div class="scroll" part="scroll">\n <div class="wrapper" part="wrapper">\n <div class="canvases" part="canvases"></div>\n <div class="progress" part="progress"></div>\n <div class="cursor" part="cursor"></div>\n </div>\n </div>\n `,[e,t]}setOptions(e){if(this.options.container!==e.container){const t=this.parentFromOptionsContainer(e.container);t.appendChild(this.container),this.parent=t}!0!==e.dragToSeek&&"object"!=typeof this.options.dragToSeek||this.initDrag(),this.options=e,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(e){this.scrollContainer.scrollLeft=e}setScrollPercentage(e){const{scrollWidth:t}=this.scrollContainer,n=t*e;this.setScroll(n)}destroy(){var e,t;this.subscriptions.forEach((e=>e())),this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(t=this.unsubscribeOnScroll)||void 0===t||t.call(this)}createDelay(e=10){let t,n;const r=()=>{t&&clearTimeout(t),n&&n()};return this.timeouts.push(r),()=>new Promise(((i,o)=>{r(),n=o,t=setTimeout((()=>{t=void 0,n=void 0,i()}),e)}))}convertColorValues(e){if(!Array.isArray(e))return e||"";if(e.length<2)return e[0]||"";const t=document.createElement("canvas"),n=t.getContext("2d"),r=t.height*(window.devicePixelRatio||1),i=n.createLinearGradient(0,0,0,r),o=1/(e.length-1);return e.forEach(((e,t)=>{const n=t*o;i.addColorStop(n,e)})),i}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(e,t,n,r){const i=e[0],o=e[1]||e[0],s=i.length,{width:a,height:u}=n.canvas,l=u/2,c=this.getPixelRatio(),d=t.barWidth?t.barWidth*c:1,h=t.barGap?t.barGap*c:t.barWidth?d/2:0,p=t.barRadius||0,f=a/(d+h)/s,m=p&&"roundRect"in n?"roundRect":"rect";n.beginPath();let E=0,g=0,_=0;for(let A=0;A<=s;A++){const e=Math.round(A*f);if(e>E){const i=Math.round(g*l*r),o=i+Math.round(_*l*r)||1;let s=l-i;"top"===t.barAlign?s=0:"bottom"===t.barAlign&&(s=u-o),n[m](E*(d+h),s,d,o,p),E=e,g=0,_=0}const s=Math.abs(i[A]||0),a=Math.abs(o[A]||0);s>g&&(g=s),a>_&&(_=a)}n.fill(),n.closePath()}renderLineWaveform(e,t,n,r){const i=t=>{const i=e[t]||e[0],o=i.length,{height:s}=n.canvas,a=s/2,u=n.canvas.width/o;n.moveTo(0,a);let l=0,c=0;for(let e=0;e<=o;e++){const o=Math.round(e*u);if(o>l){const e=a+(Math.round(c*a*r)||1)*(0===t?-1:1);n.lineTo(l,e),l=o,c=0}const s=Math.abs(i[e]||0);s>c&&(c=s)}n.lineTo(l,a)};n.beginPath(),i(0),i(1),n.fill(),n.closePath()}renderWaveform(e,t,n){if(n.fillStyle=this.convertColorValues(t.waveColor),t.renderFunction)return void t.renderFunction(e,n);let r=t.barHeight||1;if(t.normalize){const t=Array.from(e[0]).reduce(((e,t)=>Math.max(e,Math.abs(t))),0);r=t?1/t:1}t.barWidth||t.barGap||t.barAlign?this.renderBarWaveform(e,t,n,r):this.renderLineWaveform(e,t,n,r)}renderSingleCanvas(e,t,n,r,i,o,s){const a=this.getPixelRatio(),u=document.createElement("canvas");u.width=Math.round(n*a),u.height=Math.round(r*a),u.style.width=`${n}px`,u.style.height=`${r}px`,u.style.left=`${Math.round(i)}px`,o.appendChild(u);const l=u.getContext("2d");if(this.renderWaveform(e,t,l),u.width>0&&u.height>0){const e=u.cloneNode(),n=e.getContext("2d");n.drawImage(u,0,0),n.globalCompositeOperation="source-in",n.fillStyle=this.convertColorValues(t.progressColor),n.fillRect(0,0,u.width,u.height),s.appendChild(e)}}renderMultiCanvas(t,n,r,i,o,s){const a=this.getPixelRatio(),{clientWidth:u}=this.scrollContainer;if(u*a>=r)return void this.renderSingleCanvas(t,n,u,i,0,o,s);const l=r/a;let c=Math.min(e.MAX_CANVAS_WIDTH,u,l),d={};if(n.barWidth||n.barGap){const e=n.barWidth||.5,t=e+(n.barGap||e/2);c%t!=0&&(c=Math.floor(c/t)*t)}const h=e=>{if(e<0||e>=p)return;if(d[e])return;d[e]=!0;const r=e*c,a=Math.min(l-r,c);if(a<=0)return;const u=t.map((e=>{const t=Math.floor(r/l*e.length),n=Math.floor((r+a)/l*e.length);return e.slice(t,n)}));this.renderSingleCanvas(u,n,a,i,r,o,s)},p=Math.ceil(l/c),f=this.scrollContainer.scrollLeft/l,m=Math.floor(f*p);h(m-1),h(m),h(m+1),p>1&&(this.unsubscribeOnScroll=this.on("scroll",(()=>{const{scrollLeft:t}=this.scrollContainer,n=Math.floor(t/l*p);Object.keys(d).length>e.MAX_NODES&&(o.innerHTML="",s.innerHTML="",d={}),h(n-1),h(n),h(n+1)})))}renderChannel(e,t,n,r){var{overlay:i}=t,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(t,["overlay"]);const s=document.createElement("div"),a=this.getHeight(o.height,o.splitChannels);s.style.height=`${a}px`,i&&r>0&&(s.style.marginTop=`-${a}px`),this.canvasWrapper.style.minHeight=`${a}px`,this.canvasWrapper.appendChild(s);const u=s.cloneNode();this.progressWrapper.appendChild(u),this.renderMultiCanvas(e,o,n,a,s,u)}render(e){return Ka(this,void 0,void 0,(function*(){var t;this.timeouts.forEach((e=>e())),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",null!=this.options.width&&(this.scrollContainer.style.width="number"==typeof this.options.width?`${this.options.width}px`:this.options.width);const n=this.getPixelRatio(),r=this.scrollContainer.clientWidth,i=Math.ceil(e.duration*(this.options.minPxPerSec||0));this.isScrollable=i>r;const o=this.options.fillParent&&!this.isScrollable,s=(o?r:i)*n;if(this.wrapper.style.width=o?"100%":`${i}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=e,this.emit("render"),this.options.splitChannels)for(let a=0;a<e.numberOfChannels;a++){const n=Object.assign(Object.assign({},this.options),null===(t=this.options.splitChannels)||void 0===t?void 0:t[a]);this.renderChannel([e.getChannelData(a)],n,s,a)}else{const t=[e.getChannelData(0)];e.numberOfChannels>1&&t.push(e.getChannelData(1)),this.renderChannel(t,this.options,s,0)}Promise.resolve().then((()=>this.emit("rendered")))}))}reRender(){var e;if(null===(e=this.unsubscribeOnScroll)||void 0===e||e.call(this),delete this.unsubscribeOnScroll,!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:n}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:e}=this.progressWrapper.getBoundingClientRect();let t=e-n;t*=2,t=t<0?Math.floor(t):Math.ceil(t),t/=2,this.scrollContainer.scrollLeft+=t}}zoom(e){this.options.minPxPerSec=e,this.reRender()}scrollIntoView(e,t=!1){const{scrollLeft:n,scrollWidth:r,clientWidth:i}=this.scrollContainer,o=e*r,s=n,a=n+i,u=i/2;if(this.isDragging){const e=30;o+e>a?this.scrollContainer.scrollLeft+=e:o-e<s&&(this.scrollContainer.scrollLeft-=e)}else{(o<s||o>a)&&(this.scrollContainer.scrollLeft=o-(this.options.autoCenter?u:0));const e=o-n-u;t&&this.options.autoCenter&&e>0&&(this.scrollContainer.scrollLeft+=Math.min(e,10))}{const e=this.scrollContainer.scrollLeft,t=e/r,n=(e+i)/r;this.emit("scroll",t,n,e,e+i)}}renderProgress(e,t){if(isNaN(e))return;const n=100*e;this.canvasWrapper.style.clipPath=`polygon(${n}% 0, 100% 0, 100% 100%, ${n}% 100%)`,this.progressWrapper.style.width=`${n}%`,this.cursor.style.left=`${n}%`,this.cursor.style.transform=`translateX(-${100===Math.round(n)?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(e,t)}exportImage(e,t,n){return Ka(this,void 0,void 0,(function*(){const r=this.canvasWrapper.querySelectorAll("canvas");if(!r.length)throw new Error("No waveform data");if("dataURL"===n){const n=Array.from(r).map((n=>n.toDataURL(e,t)));return Promise.resolve(n)}return Promise.all(Array.from(r).map((n=>new Promise(((r,i)=>{n.toBlob((e=>{e?r(e):i(new Error("Could not export image"))}),e,t)})))))}))}};ru.MAX_CANVAS_WIDTH=8e3,ru.MAX_NODES=10;let iu=class extends qa{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",(()=>{requestAnimationFrame((()=>{this.emit("tick")}))})),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}},ou=class extends qa{constructor(e=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=e,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return Ka(this,void 0,void 0,(function*(){}))}get src(){return this.currentSrc}set src(e){if(this.currentSrc=e,this._duration=void 0,!e)return this.buffer=null,void this.emit("emptied");fetch(e).then((t=>{if(t.status>=400)throw new Error(`Failed to fetch ${e}: ${t.status} (${t.statusText})`);return t.arrayBuffer()})).then((t=>this.currentSrc!==e?null:this.audioContext.decodeAudioData(t))).then((t=>{this.currentSrc===e&&(this.buffer=t,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())}))}_play(){var e;if(!this.paused)return;this.paused=!1,null===(e=this.bufferNode)||void 0===e||e.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let t=this.playedDuration*this._playbackRate;t>=this.duration&&(t=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,t),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var e;this.paused=!0,null===(e=this.bufferNode)||void 0===e||e.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return Ka(this,void 0,void 0,(function*(){this.paused&&(this._play(),this.emit("play"))}))}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(e){var t,n;const r=e-this.currentTime;null===(t=this.bufferNode)||void 0===t||t.stop(this.audioContext.currentTime+r),null===(n=this.bufferNode)||void 0===n||n.addEventListener("ended",(()=>{this.bufferNode=null,this.pause()}),{once:!0})}setSinkId(e){return Ka(this,void 0,void 0,(function*(){return this.audioContext.setSinkId(e)}))}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this.bufferNode&&(this.bufferNode.playbackRate.value=e)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(e){const t=!this.paused;t&&this._pause(),this.playedDuration=e/this._playbackRate,t&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var e,t;return null!==(e=this._duration)&&void 0!==e?e:(null===(t=this.buffer)||void 0===t?void 0:t.duration)||0}set duration(e){this._duration=e}get volume(){return this.gainNode.gain.value}set volume(e){this.gainNode.gain.value=e,this.emit("volumechange")}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(e){return/^(audio|video)\//.test(e)}getGainNode(){return this.gainNode}getChannelData(){const e=[];if(!this.buffer)return e;const t=this.buffer.numberOfChannels;for(let n=0;n<t;n++)e.push(this.buffer.getChannelData(n));return e}};const su={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};let au=class e extends nu{static create(t){return new e(t)}constructor(e){const t=e.media||("WebAudio"===e.backend?new ou:void 0);super({media:t,mediaControls:e.mediaControls,autoplay:e.autoplay,playbackRate:e.audioRate}),this.plugins=[],this.decodedData=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},su,e),this.timer=new iu;const n=t?void 0:this.getMediaElement();this.renderer=new ru(this.options,n),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const r=this.options.url||this.getSrc()||"";Promise.resolve().then((()=>{this.emit("init");const{peaks:e,duration:t}=this.options;(r||e&&t)&&this.load(r,e,t).catch((()=>null))}))}updateProgress(e=this.getCurrentTime()){return this.renderer.renderProgress(e/this.getDuration(),this.isPlaying()),e}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",(()=>{if(!this.isSeeking()){const e=this.updateProgress();this.emit("timeupdate",e),this.emit("audioprocess",e)}})))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",(()=>{const e=this.updateProgress();this.emit("timeupdate",e)})),this.onMediaEvent("play",(()=>{this.emit("play"),this.timer.start()})),this.onMediaEvent("pause",(()=>{this.emit("pause"),this.timer.stop()})),this.onMediaEvent("emptied",(()=>{this.timer.stop()})),this.onMediaEvent("ended",(()=>{this.emit("finish")})),this.onMediaEvent("seeking",(()=>{this.emit("seeking",this.getCurrentTime())})),this.onMediaEvent("error",(e=>{this.emit("error",e.error)})))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",((e,t)=>{this.options.interact&&(this.seekTo(e),this.emit("interaction",e*this.getDuration()),this.emit("click",e,t))})),this.renderer.on("dblclick",((e,t)=>{this.emit("dblclick",e,t)})),this.renderer.on("scroll",((e,t,n,r)=>{const i=this.getDuration();this.emit("scroll",e*i,t*i,n,r)})),this.renderer.on("render",(()=>{this.emit("redraw")})),this.renderer.on("rendered",(()=>{this.emit("redrawcomplete")})),this.renderer.on("dragstart",(e=>{this.emit("dragstart",e)})),this.renderer.on("dragend",(e=>{this.emit("dragend",e)})));{let e;this.subscriptions.push(this.renderer.on("drag",(t=>{if(!this.options.interact)return;let n;this.renderer.renderProgress(t),clearTimeout(e),this.isPlaying()?n=0:!0===this.options.dragToSeek?n=200:"object"==typeof this.options.dragToSeek&&void 0!==this.options.dragToSeek&&(n=this.options.dragToSeek.debounceTime),e=setTimeout((()=>{this.seekTo(t)}),n),this.emit("interaction",t*this.getDuration()),this.emit("drag",t)})))}}initPlugins(){var e;(null===(e=this.options.plugins)||void 0===e?void 0:e.length)&&this.options.plugins.forEach((e=>{this.registerPlugin(e)}))}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach((e=>e())),this.mediaSubscriptions=[]}setOptions(e){this.options=Object.assign({},this.options,e),this.renderer.setOptions(this.options),e.audioRate&&this.setPlaybackRate(e.audioRate),null!=e.mediaControls&&(this.getMediaElement().controls=e.mediaControls)}registerPlugin(e){return e._init(this),this.plugins.push(e),this.subscriptions.push(e.once("destroy",(()=>{this.plugins=this.plugins.filter((t=>t!==e))}))),e}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(e){return this.renderer.setScroll(e)}setScrollTime(e){const t=e/this.getDuration();this.renderer.setScrollPercentage(t)}getActivePlugins(){return this.plugins}loadAudio(e,t,n,r){return Ka(this,void 0,void 0,(function*(){var i;if(this.emit("load",e),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,!t&&!n){const n=this.options.fetchParams||{};window.AbortController&&!n.signal&&(this.abortController=new AbortController,n.signal=null===(i=this.abortController)||void 0===i?void 0:i.signal);const r=e=>this.emit("loading",e);t=yield tu.fetchBlob(e,r,n)}this.setSrc(e,t);const o=yield new Promise((e=>{const t=r||this.getDuration();t?e(t):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",(()=>e(this.getDuration())),{once:!0}))}));if(!e&&!t){const e=this.getMediaElement();e instanceof ou&&(e.duration=o)}if(n)this.decodedData=Ja.createBuffer(n,o||0);else if(t){const e=yield t.arrayBuffer();this.decodedData=yield Ja.decode(e,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())}))}load(e,t,n){return Ka(this,void 0,void 0,(function*(){try{return yield this.loadAudio(e,void 0,t,n)}catch(e){throw this.emit("error",e),e}}))}loadBlob(e,t,n){return Ka(this,void 0,void 0,(function*(){try{return yield this.loadAudio("",e,t,n)}catch(e){throw this.emit("error",e),e}}))}zoom(e){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(e),this.emit("zoom",e)}getDecodedData(){return this.decodedData}exportPeaks({channels:e=2,maxLength:t=8e3,precision:n=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const r=Math.min(e,this.decodedData.numberOfChannels),i=[];for(let o=0;o<r;o++){const e=this.decodedData.getChannelData(o),r=[],s=e.length/t;for(let i=0;i<t;i++){const t=e.slice(Math.floor(i*s),Math.ceil((i+1)*s));let o=0;for(let e=0;e<t.length;e++){const n=t[e];Math.abs(n)>Math.abs(o)&&(o=n)}r.push(Math.round(o*n)/n)}i.push(r)}return i}getDuration(){let e=super.getDuration()||0;return 0!==e&&e!==1/0||!this.decodedData||(e=this.decodedData.duration),e}toggleInteraction(e){this.options.interact=e}setTime(e){super.setTime(e),this.updateProgress(e),this.emit("timeupdate",e)}seekTo(e){const t=this.getDuration()*e;this.setTime(t)}playPause(){return Ka(this,void 0,void 0,(function*(){return this.isPlaying()?this.pause():this.play()}))}stop(){this.pause(),this.setTime(0)}skip(e){this.setTime(this.getCurrentTime()+e)}empty(){this.load("",[[0]],.001)}setMediaElement(e){this.unsubscribePlayerEvents(),super.setMediaElement(e),this.initPlayerEvents()}exportImage(){return Ka(this,arguments,void 0,(function*(e="image/png",t=1,n="dataURL"){return this.renderer.exportImage(e,t,n)}))}destroy(){var e;this.emit("destroy"),null===(e=this.abortController)||void 0===e||e.abort(),this.plugins.forEach((e=>e.destroy())),this.subscriptions.forEach((e=>e())),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}};function uu({src:e,onError:t,filename:n,className:r=""}){const i=si(),o=ci(),s=le(null),a=le(),u=le(),[l,c]=oe(!1),[d,h]=oe(0),[p,f]=oe(1),m=le(),[E,g]=oe(!1);ae((()=>{a.current=new Audio;const r={normalize:!0,height:50,container:s.current};function i(){const e=a.current;e&&("PIPELINE_ERROR_READ: FFmpegDemuxer: demuxer seek failed"===e.error.message?(e.load(),c(!1)):(g(!0),c(!1),t?.()))}const o=n.slice(n.lastIndexOf(".")+1);if(function(e){return/(?:^|\/)talkjs_audio_message_[0-9]+_([0-9]+)[.](?:mp3|webm)$/.test(e)}(n)&&"webm"===o&&!a.current.canPlayType("audio/webm;codecs=opus"))r.backend="WebAudio",u.current=new Audio("data:audio/mp3;base64,//MkxAAHiAICWABElBeKPL/RANb2w+yiT1g/gTok//lP/W/l3h8QO/OCdCqCW2Cw//MkxAQHkAIWUAhEmAQXWUOFW2dxPu//9mr60ElY5sseQ+xxesmHKtZr7bsqqX2L//MkxAgFwAYiQAhEAC2hq22d3///9FTV6tA36JdgBJoOGgc+7qvqej5Zu7/7uI9l//MkxBQHAAYi8AhEAO193vt9KGOq+6qcT7hhfN5FTInmwk8RkqKImTM55pRQHQSq//MkxBsGkgoIAABHhTACIJLf99nVI///yuW1uBqWfEu7CgNPWGpUadBmZ////4sL//MkxCMHMAH9iABEmAsKioqKigsLCwtVTEFNRTMuOTkuNVVVVVVVVVVVVVVVVVVV//MkxCkECAUYCAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),u.current.controls=!1;else{const t=a.current;t.addEventListener("error",i),t.src=e,t.preload="auto",t.preservesPitch=!0,r.media=t}m.current=function(e){if(!e.container)return;const t=getComputedStyle(e.container);let n=Xa(t.color);return n||(n=Xa("rgb(255,255,255)")),au.create({...e,barGap:e.barGap??2,barRadius:e.barRadius??0,barWidth:e.barWidth??2,barHeight:e.barHeight,hideScrollbar:!0,cursorWidth:e.cursorWidth??0,cursorColor:e.cursorColor,height:e.height??24,progressColor:e.progressColor??n.cssa(),waveColor:e.waveColor??n.alpha(n.alpha()/2).cssa()})}(r);const l=m.current;return l.on("finish",(()=>{a.current.loop=!0,c(!1)})),l.on("ready",(e=>h(Math.trunc(e)))),l.on("timeupdate",(e=>h(Math.trunc(e)))),"WebAudio"===r.backend&&l.load(e).catch((()=>{g(!0),c(!1),t?.()})),()=>{a.current?.removeEventListener("error",i),a.current=void 0,l.destroy(),m.current=void 0}}),[e,n,t]);const _=he((()=>{if("WebAudio"===m.current.options.backend)m.current.isPlaying()||u.current.play(),m.current.playPause(),c(m.current.isPlaying()??!1);else{const e=a.current;e.paused?e.play():e.pause(),e.loop=!1,!e.paused&&e.ended&&(e.load(),e.play()),c(!e.paused)}}),[]),A=he((e=>{m.current.setPlaybackRate(e),f(e)}),[]);return bt("div",E?{}:{className:`t-audio-player ${r}`,children:[bt("button",{onClick:_,children:bt(i.Icon,{className:"t-play-pause-icon",type:l?"pause":"play","aria-label":l?"pause audio":"play audio",themeCustom:o.state$.themeCustom.peek().value})}),bt("div",{className:"t-waveform",ref:s}),bt("div",{className:"t-duration",children:ko(d)}),bt(Ia,{as:"div",children:({isExpanded:e})=>bt(O,{children:[bt(Ra,{className:"t-playback-speed","aria-label":"set playback speed",children:[p,"x",bt(i.Icon,{type:"updown","aria-hidden":!0,className:"t-up-down-icon",themeCustom:o.state$.themeCustom.peek().value})]}),e&&bt(xa,{children:bt(La,{className:"t-action-menu",children:[bt("div",{className:"t-playback-heading",children:"Playback Speed"}),[.25,.5,.75,1,1.25,1.5,2].map(((e,t)=>bt(ka,{onSelect:()=>A(e),children:[bt("span",{className:"t-playback-checkmark",children:p==e?"✓":""}),e,"x"]},t)))]})})]})})]})}function lu(e){this.content=e}function cu(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=cu(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function du(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),u=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=du(s.content,a.content,n-1,r-1);if(e)return e}n-=u,r-=u}else n-=u,r-=u}}au.BasePlugin=class extends qa{constructor(e){super(),this.subscriptions=[],this.options=e}onInit(){}_init(e){this.wavesurfer=e,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach((e=>e()))}},au.dom=eu,lu.prototype={constructor:lu,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new lu(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new lu(n)},addToStart:function(e,t){return new lu([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new lu(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new lu(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=lu.from(e)).size?new lu(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=lu.from(e)).size?new lu(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=lu.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},lu.from=function(e){if(e instanceof lu)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new lu(t)};class hu{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],u=s+a.nodeSize;if(u>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{let u=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=u}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new hu(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new hu(n,r)}cutByIndex(e,t){return e==t?hu.empty:0==e&&t==this.content.length?this:new hu(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new hu(r,i)}addToStart(e){return new hu([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new hu(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return cu(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return du(this,e,t,n)}findIndex(e,t=-1){if(0==e)return fu(0,e);if(e==this.size)return fu(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?fu(n+1,i):fu(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return hu.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new hu(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return hu.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new hu(t||e,n)}static from(e){if(!e)return hu.empty;if(e instanceof hu)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new hu([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}hu.empty=new hu([],0);const pu={index:0,offset:0};function fu(e,t){return pu.index=e,pu.offset=t,pu}function mu(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!mu(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!mu(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class Eu{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&mu(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return Eu.none;if(e instanceof Eu)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}Eu.none=[];class gu extends Error{}class _u{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Du(this.content,e+this.openStart,t);return n&&new _u(n,this.openStart,this.openEnd)}removeBetween(e,t){return new _u(Au(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return _u.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new _u(hu.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new _u(e,n,r)}}function Au(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(Au(o.content,t-i-1,n-i-1)))}function Du(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return e.cut(0,t).append(n).append(e.cut(t));let a=Du(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function vu(e,t,n){if(n.openStart>e.depth)throw new gu("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new gu("Inconsistent open depths");return Ou(e,t,n,0)}function Ou(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=Ou(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)r=t.node(i).copy(hu.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Nu(o,bu(e,i,s,t,r))}{let r=e.parent,i=r.content;return Nu(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return Nu(o,Iu(e,t,r))}function Tu(e,t){if(!t.type.compatibleContent(e.type))throw new gu("Cannot join "+t.type.name+" onto "+e.type.name)}function Su(e,t,n){let r=e.node(n);return Tu(r,t.node(n)),r}function yu(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Cu(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(yu(e.nodeAfter,r),o++));for(let a=o;a<s;a++)yu(i.child(a),r);t&&t.depth==n&&t.textOffset&&yu(t.nodeBefore,r)}function Nu(e,t){return e.type.checkContent(t),e.copy(t)}function bu(e,t,n,r,i){let o=e.depth>i&&Su(e,t,i+1),s=r.depth>i&&Su(n,r,i+1),a=[];return Cu(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(Tu(o,s),yu(Nu(o,bu(e,t,n,r,i+1)),a)):(o&&yu(Nu(o,Iu(e,t,i+1)),a),Cu(t,n,i,a),s&&yu(Nu(s,Iu(n,r,i+1)),a)),Cu(r,null,i,a),new hu(a)}function Iu(e,t,n){let r=[];return Cu(null,e,n,r),e.depth>n&&yu(Nu(Su(e,t,n+1),Iu(e,t,n+1)),r),Cu(t,null,n,r),new hu(r)}_u.empty=new _u(hu.empty,0,0);class Ru{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let i=0;i<e;i++)r+=n.child(i).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return Eu.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new xu(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let o=e;;){let{index:e,offset:t}=o.content.findIndex(i),s=i-t;if(n.push(o,e,r+t),!s)break;if(o=o.child(e),o.isText)break;i=s-1,r+=t+1}return new Ru(t,n,i)}static resolveCached(e,t){for(let r=0;r<wu.length;r++){let n=wu[r];if(n.pos==t&&n.doc==e)return n}let n=wu[ku]=Ru.resolve(e,t);return ku=(ku+1)%Lu,n}}let wu=[],ku=0,Lu=12;class xu{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Mu=Object.create(null);let Fu=class e{constructor(e,t,n,r=Eu.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||hu.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&mu(this.attrs,t||e.defaultAttrs||Mu)&&Eu.sameSet(this.marks,n||Eu.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return _u.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new _u(a,r.depth-o,i.depth-o)}replace(e,t,n){return vu(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Ru.resolveCached(this,e)}resolveNoCache(e){return Ru.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Pu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=hu.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let a=r;a<i;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=Eu.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Eu.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=hu.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};Fu.prototype.text=void 0;class Bu extends Fu{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Pu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Bu(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Bu(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Pu(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Uu{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Hu(e,t);if(null==n.next)return Uu.empty;let r=ju(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Wu(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new Uu(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Gu);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}(Wu(e,0))}(function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(e(n,o))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return i(e(t.expr,o),s),i(e(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(o)].concat(e(t.expr,o));if("range"==t.type){let s=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,s),r),s=r}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;o++){let o=n();r(s,o),i(e(t.expr,s),o),s=o}return[r(s)]}if("name"==t.type)return[r(o,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=e(t.exprs[r],o);if(r==t.exprs.length-1)return s;i(s,o=n())}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((e=>e.to=t))}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return hu.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let i=0;i<t.next.length;i++)r+=(i?", ":"")+t.next[i].type.name+"->"+e.indexOf(t.next[i].next);return r})).join("\n")}}Uu.empty=new Uu(!0);class Hu{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function ju(e){let t=[];do{t.push($u(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function $u(e){let t=[];do{t.push(Yu(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Yu(e){let t=function(e){if(e.eat("(")){let t=ju(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let e=n[o];e.groups.indexOf(t)>-1&&i.push(e)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Vu(e,t)}return t}function zu(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Vu(e,t){let n=zu(e),r=n;return e.eat(",")&&(r="}"!=e.next?zu(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Gu(e,t){return t-e}function Wu(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(Gu)}function Xu(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Ku(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function qu(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Zu(e[n]);return t}let Ju=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=qu(n.attrs),this.defaultAttrs=Xu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Uu.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Ku(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Fu(this,this.computeAttrs(e),hu.from(t),Eu.setFrom(n))}createChecked(e=null,t,n){return t=hu.from(t),this.checkContent(t),new Fu(this,this.computeAttrs(e),t,Eu.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=hu.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(hu.empty,!0);return i?new Fu(this,e,t.append(i),Eu.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Eu.none:e}static compile(t,n){let r=Object.create(null);t.forEach(((t,i)=>r[t]=new e(t,n,i)));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Zu{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Qu{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=qu(r.attrs),this.excluded=null;let i=Xu(this.attrs);this.instance=i?new Eu(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Eu(this,Ku(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new Qu(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}function el(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class tl{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new al(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new al(this,t,!0);return n.addAll(e,t.from,t.to),_u.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(ul(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let r in e.marks){let t=e.marks[r].spec.parseDOM;t&&t.forEach((e=>{n(e=ll(e)),e.mark||e.ignore||e.clearMark||(e.mark=r)}))}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach((e=>{n(e=ll(e)),e.node||e.ignore||e.mark||(e.node=r)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new tl(e,tl.schemaRules(e)))}}const nl={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},rl={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},il={ol:!0,ul:!0};function ol(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class sl{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Eu.none,this.stashMarks=[],this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(hu.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=hu.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(hu.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):cl(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!nl.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class al{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=ol(null,t.preserveWhitespace,0)|(n?4:0);r=i?new sl(i.type,i.attrs,Eu.none,Eu.none,!0,t.topMatch||i.type.contentMatch,o):new sl(n?null:e.schema.topNodeType,null,Eu.none,Eu.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){3==e.nodeType?this.addTextNode(e):1==e.nodeType&&this.addElement(e)}withStyleRules(e,t){let n=e.getAttribute("style");if(!n)return t();let r=this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(n));if(!r)return;let[i,o]=r,s=this.top;for(let a=0;a<o.length;a++)this.removePendingMark(o[a],s);for(let a=0;a<i.length;a++)this.addPendingMark(i[a]);t();for(let a=0;a<i.length;a++)this.removePendingMark(i[a],s);for(let a=0;a<o.length;a++)this.addPendingMark(o[a])}addTextNode(e){let t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();il.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&il.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:rl.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,n=this.top,o=this.needsBlock;if(nl.hasOwnProperty(r))n.content.length&&n.content[0].isInline&&this.open&&(this.open--,n=this.top),t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);i&&i.skip?this.addAll(e):this.withStyleRules(e,(()=>this.addAll(e))),t&&this.sync(n),this.needsBlock=o}else this.withStyleRules(e,(()=>{this.addElementByRule(e,i,!1===i.consuming?n:void 0)}))}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Eu.none,n=Eu.none;for(let r=0;r<e.length;r+=2)for(let i;;){let o=this.parser.matchStyle(e[r],e[r+1],this,i);if(!o)break;if(o.ignore)return null;if(o.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach((e=>{o.clearMark(e)&&(n=e.addToSet(n))})):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;i=o}return[t,n]}addElementByRule(e,t,n){let r,i,o;t.node?(i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace)):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let r=0;r<t.length;r++)this.enterInner(t[r],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=ol(e,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new sl(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function ul(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ll(e){let t={};for(let n in e)t[n]=e[n];return t}function cl(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class dl{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=pl(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=dl.renderSpec(pl(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&dl.renderSpec(pl(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],u=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){u=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let l=u;l<t.length;l++){let i=t[l];if(0===i){if(l<t.length-1||l>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=dl.renderSpec(e,i,n);if(s.appendChild(t),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new dl(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=hl(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return hl(e.marks)}}function hl(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function pl(e){return e.document||window.document}const fl=Math.pow(2,16);function ml(e,t){return e+t*fl}function El(e){return 65535&e}let gl=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}},_l=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=El(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/fl}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let u=this.ranges[s+i],l=this.ranges[s+o],c=a+u;if(e<=c){let i=a+r+((u?e==a?-1:e==c?1:t:t)<0?0:l);if(n)return i;let o=e==(t<0?a:c)?null:ml(s/3,e-a),d=e==a?2:e==c?1:4;return(t<0?e!=a:e!=c)&&(d|=8),new gl(i,d,o)}r+=l-u}return n?e+r:new gl(e+r,0,null)}touches(e,t){let n=0,r=El(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let t=this.ranges[s]-(this.inverted?n:0);if(t>e)break;let a=this.ranges[s+i];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),u=this.ranges[r+t],l=this.ranges[r+n];e(s,s+u,a,a+l),i+=l-u}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};_l.empty=new _l([]);let Al=class e{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(t=0,n=this.maps.length){return new e(this.maps,this.mirror,t,n)}copy(){return new e(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let i=this.from;i<this.to;i++){let n=this.maps[i].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(i);if(null!=t&&t>i&&t<this.to){i=t,e=this.maps[t].recover(n.recover);continue}}r|=n.delInfo,e=n.pos}return n?e:new gl(e,r,null)}};const Dl=Object.create(null);let vl=class{getMap(){return _l.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Dl[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Dl)throw new RangeError("Duplicate use of step JSON ID "+e);return Dl[e]=t,t.prototype.jsonID=e,t}},Ol=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof gu)return e.fail(t.message);throw t}}};function Tl(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Tl(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return hu.fromArray(r)}let Sl=class e extends vl{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new _u(Tl(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Ol.fromReplace(e,this.from,this.to,i)}invert(){return new yl(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};vl.jsonID("addMark",Sl);let yl=class e extends vl{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new _u(Tl(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Ol.fromReplace(e,this.from,this.to,n)}invert(){return new Sl(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};vl.jsonID("removeMark",yl);let Cl=class e extends vl{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ol.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ol.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Nl(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};vl.jsonID("addNodeMark",Cl);let Nl=class e extends vl{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ol.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ol.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Cl(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};vl.jsonID("removeNodeMark",Nl);let bl=class e extends vl{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Rl(e,this.from,this.to)?Ol.fail("Structure replace would overwrite content"):Ol.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new _l([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?_u.empty:new _u(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}}{let n=this.slice.size+t.slice.size==0?_u.empty:new _u(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,_u.fromJSON(t,n.slice),!!n.structure)}};vl.jsonID("replace",bl);let Il=class e extends vl{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Rl(e,this.from,this.gapFrom)||Rl(e,this.gapTo,this.to)))return Ol.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ol.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Ol.fromReplace(e,this.from,this.to,n):Ol.fail("Content does not fit in gap")}getMap(){return new _l([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new e(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,_u.fromJSON(t,n.slice),n.insert,!!n.structure)}};function Rl(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function wl(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}vl.jsonID("replaceAround",Il);let kl=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=hu.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=hu.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new _u(i,o,s);return e>-1?new Il(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new bl(n.pos,r.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Ml(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let o=this.depth;o>=0;o--){let e,{type:s,match:a}=this.frontier[o],u=null;if(1==t&&(i?a.matchType(i.type)||(u=a.fillBefore(hu.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:o,parent:r,inject:u};if(2==t&&i&&(e=a.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:r,wrap:e};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ml(e,t);return!(!r.childCount||r.firstChild.isLeaf||(this.unplaced=new _u(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ml(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new _u(Ll(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new _u(Ll(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let f=0;f<i.length;f++)this.openFrontierNode(i[f]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,u=0,l=[],{match:c,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));c=c.matchFragment(r)}let h=s.size+e-(o.content.size-o.openEnd);for(;u<s.childCount;){let e=s.child(u),t=c.matchType(e.type);if(!t)break;u++,(u>1||0==a||e.content.size)&&(c=t,l.push(Fl(e.mark(d.allowedMarks(e.marks)),1==u?a:0,u==s.childCount?h:-1)))}let p=u==s.childCount;p||(h=-1),this.placed=xl(this.placed,t,hu.from(l)),this.frontier[t].match=c,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=s;f<h;f++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=p?0==e?_u.empty:new _u(Ll(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new _u(Ll(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Bl(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Bl(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Bl(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=xl(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=xl(this.placed,this.depth,hu.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(hu.empty,!0);e.childCount&&(this.placed=xl(this.placed,this.frontier.length,e))}};function Ll(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Ll(e.firstChild.content,t-1,n)))}function xl(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(xl(e.lastChild.content,t-1,n)))}function Ml(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Fl(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Fl(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(hu.empty,!0)))),e.copy(r)}function Bl(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function Pl(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Pl(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(hu.empty,!0))}return e}function Ul(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}let Hl=class e extends vl{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ol.fail("No node at attribute step's position");let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Ol.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(r),0,t.isLeaf?0:1))}getMap(){return _l.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new e(n.pos,n.attr,n.value)}};vl.jsonID("attr",Hl);let jl=class e extends vl{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Ol.ok(n)}getMap(){return _l.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if("string"!=typeof n.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new e(n.attr,n.value)}};vl.jsonID("docAttr",jl);let $l=class extends Error{};$l=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},($l.prototype=Object.create(Error.prototype)).constructor=$l,$l.prototype.name="TransformError";class Yl{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Al}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new $l(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=_u.empty){let r=function(e,t,n=t,r=_u.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return wl(i,o,r)?new bl(t,n,r):new kl(i,o,r).fit()}(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new _u(hu.from(n),0,0))}delete(e,t){return this.replace(e,t,_u.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(wl(i,o,r))return e.step(new bl(t,n,r));let s=Ul(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let p=i.depth,f=i.pos-1;p>0;p--,f--){let e=i.node(p).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;s.indexOf(p)>-1?a=p:i.before(p)==f&&s.splice(1,0,-p)}let u=s.indexOf(a),l=[],c=r.openStart;for(let p=r.content,f=0;;f++){let e=p.firstChild;if(l.push(e),f==r.openStart)break;p=e.content}for(let p=c-1;p>=0;p--){let e=l[p],t=(d=e.type).spec.defining||d.spec.definingForContent;if(t&&!e.sameMarkup(i.node(Math.abs(a)-1)))c=p;else if(t||!e.type.isTextblock)break}var d;for(let p=r.openStart;p>=0;p--){let t=(p+c+1)%(r.openStart+1),a=l[t];if(a)for(let l=0;l<s.length;l++){let c=s[(l+u)%s.length],d=!0;c<0&&(d=!1,c=-c);let h=i.node(c-1),p=i.index(c-1);if(h.canReplaceWith(p,p,a.type,a.marks))return e.replace(i.before(c),d?o.after(c):n,new _u(Pl(r.content,0,r.openStart,t),t,r.openEnd))}}let h=e.steps.length;for(let p=s.length-1;p>=0&&(e.replace(t,n,r),!(e.steps.length>h));p--){let e=s[p];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let e=r.index(i);if(r.node(i).canReplaceWith(e,e,n))return r.before(i+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let e=r.indexAfter(i);if(r.node(i).canReplaceWith(e,e,n))return r.after(i+1);if(e<r.node(i).childCount)return null}return null}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new _u(hu.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=Ul(r,i);for(let s=0;s<o.length;s++){let t=o[s],n=s==o.length-1;if(n&&0==t||r.node(t).type.contentMatch.validEnd)return e.delete(r.start(t),i.end(t));if(t>0&&(n||r.node(t-1).canReplace(r.index(t-1),i.indexAfter(t-1))))return e.delete(r.before(t),i.after(t))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),u=s,l=a,c=hu.empty,d=0;for(let f=o,m=!1;f>n;f--)m||r.index(f)>0?(m=!0,c=hu.from(r.node(f).copy(c)),d++):u--;let h=hu.empty,p=0;for(let f=o,m=!1;f>n;f--)m||i.after(f+1)<i.end(f)?(m=!0,h=hu.from(i.node(f).copy(h)),p++):l++;e.step(new Il(u,l,s,a,new _u(c.append(h),d,p),c.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new bl(t-n,t+n,_u.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=hu.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let e=n[s].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=hu.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new Il(i,o,i,o,new _u(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);let s=e.mapping.slice(o),a=s.map(n,1),u=s.map(n+t.nodeSize,1);return e.step(new Il(a,u,a+1,u-1,new _u(hu.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Il(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new _u(hu.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Hl(e,t,n)),this}setDocAttribute(e,t){return this.step(new jl(e,t)),this}addNodeMark(e,t){return this.step(new Cl(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Eu)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new Nl(e,t)),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=hu.empty,s=hu.empty;for(let a=i.depth,u=i.depth-n,l=n-1;a>u;a--,l--){o=hu.from(i.node(a).copy(o));let e=r&&r[l];s=hu.from(e?e.type.create(e.attrs,s):i.node(a).copy(s))}e.step(new bl(t,t,new _u(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,u,l)=>{if(!e.isInline)return;let c=e.marks;if(!r.isInSet(c)&&l.type.allowsMarkType(r.type)){let l=Math.max(u,t),d=Math.min(u+e.nodeSize,n),h=r.addToSet(c);for(let e=0;e<c.length;e++)c[e].isInSet(h)||(i&&i.to==l&&i.mark.eq(c[e])?i.to=d:s.push(i=new yl(l,d,c[e])));o&&o.to==l?o.to=d:a.push(o=new Sl(l,d,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof Qu){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,u=a[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&u.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=o):i.push({style:u,from:Math.max(s,t),to:r,step:o})}}})),i.forEach((t=>e.step(new yl(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],s=t+1;for(let a=0;a<i.childCount;a++){let t=i.child(a),u=s+t.nodeSize,l=r.matchType(t.type);if(l){r=l;for(let r=0;r<t.marks.length;r++)n.allowsMarkType(t.marks[r].type)||e.step(new yl(s,u,t.marks[r]));if(t.isText&&!n.spec.code){let e,r,i=/\r?\n|\r/g;for(;e=i.exec(t.text);)r||(r=new _u(hu.from(n.schema.text(" ",n.allowedMarks(t.marks))),0,0)),o.push(new bl(s+e.index,s+e.index+e[0].length,r))}}else o.push(new bl(s,u,_u.empty));s=u}if(!r.validEnd){let t=r.fillBefore(hu.empty,!0);e.replace(s,s,new _u(t,0,0))}for(let a=o.length-1;a>=0;a--)e.step(o[a])}(this,e,t,n),this}}const zl=Object.create(null);class Vl{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Gl(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=_u.empty){let n=t.content.lastChild,r=null;for(let s=0;s<t.openEnd;s++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:u}=o[s],l=e.mapping.slice(i);e.replaceRange(l.map(a.pos),l.map(u.pos),s?_u.empty:t),0==s&&nc(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),u=a.map(o.pos),l=a.map(s.pos);i?e.deleteRange(u,l):(e.replaceRangeWith(u,l,t),nc(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Kl(e):tc(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let i=e.depth-1;i>=0;i--){let r=t<0?tc(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):tc(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Ql(e.node(0))}static atStart(e){return tc(e,e,0,0,1)||new Ql(e)}static atEnd(e){return tc(e,e,e.content.size,e.childCount,-1)||new Ql(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=zl[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in zl)throw new RangeError("Duplicate use of selection JSON ID "+e);return zl[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Kl.between(this.$anchor,this.$head).getBookmark()}}Vl.prototype.visible=!0;class Gl{constructor(e,t){this.$from=e,this.$to=t}}let Wl=!1;function Xl(e){Wl||e.parent.inlineContent||(Wl=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Kl extends Vl{constructor(e,t=e){Xl(e),Xl(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return Vl.near(n);let r=e.resolve(t.map(this.anchor));return new Kl(r.parent.inlineContent?r:n,n)}replace(e,t=_u.empty){if(super.replace(e,t),t==_u.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof Kl&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ql(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Kl(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=Vl.findFrom(t,n,!0)||Vl.findFrom(t,-n,!0);if(!e)return Vl.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(Vl.findFrom(e,-n,!0)||Vl.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new Kl(e,t)}}Vl.jsonID("text",Kl);class ql{constructor(e,t){this.anchor=e,this.head=t}map(e){return new ql(e.map(this.anchor),e.map(this.head))}resolve(e){return Kl.between(e.resolve(this.anchor),e.resolve(this.head))}}class Jl extends Vl{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?Vl.near(i):new Jl(i)}content(){return new _u(hu.from(this.node),0,0)}eq(e){return e instanceof Jl&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Zl(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Jl(e.resolve(t.anchor))}static create(e,t){return new Jl(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Jl.prototype.visible=!1,Vl.jsonID("node",Jl);class Zl{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new ql(n,n):new Zl(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Jl.isSelectable(n)?new Jl(t):Vl.near(t)}}class Ql extends Vl{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=_u.empty){if(t==_u.empty){e.delete(0,e.doc.content.size);let t=Vl.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ql(e)}map(e){return new Ql(e)}eq(e){return e instanceof Ql}getBookmark(){return ec}}Vl.jsonID("all",Ql);const ec={map(){return this},resolve:e=>new Ql(e)};function tc(e,t,n,r,i,o=!1){if(t.inlineContent)return Kl.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&Jl.isSelectable(r))return Jl.create(e,n-(i<0?r.nodeSize:0))}else{let t=tc(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function nc(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,o=e.steps[r];(o instanceof bl||o instanceof Il)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(Vl.near(e.doc.resolve(i),n)))}class rc extends Yl{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Eu.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Eu.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(Vl.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function ic(e,t){return t&&e?e.bind(t):e}class oc{constructor(e,t,n){this.name=e,this.init=ic(t.init,n),this.apply=ic(t.apply,n)}}const sc=[new oc("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new oc("selection",{init:(e,t)=>e.selection||Vl.atStart(t.doc),apply:e=>e.selection}),new oc("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new oc("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class ac{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=sc.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new oc(e.key,e.spec.state,e))}))}}class uc{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,u=r?r[o].state:this,l=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,u,n);if(l&&n.filterTransaction(l,o)){if(l.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new uc(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new rc(this)}static create(e){let t=new ac(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new uc(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new ac(this.schema,e.plugins),n=t.fields,r=new uc(t);for(let i=0;i<n.length;i++){let t=n[i].name;r[t]=this.hasOwnProperty(t)?this[t]:n[i].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new ac(e.schema,e.plugins),i=new uc(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=Fu.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=Vl.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function lc(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=lc(i,t,{})),n[r]=i}return n}class cc{constructor(e){this.spec=e,this.props={},e.props&&lc(e.props,this,this.props),this.key=e.key?e.key.key:hc("plugin")}getState(e){return e[this.key]}}const dc=Object.create(null);function hc(e){return e in dc?e+"$"+ ++dc[e]:(dc[e]=0,e+"$")}class pc{constructor(e="key"){this.key=hc(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const fc=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},mc=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Ec=null;const gc=function(e,t,n){let r=Ec||(Ec=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},_c=function(e,t,n,r){return n&&(Dc(e,t,n,r,-1)||Dc(e,t,n,r,1))},Ac=/^(img|br|input|textarea|hr)$/i;function Dc(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:vc(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Oc(e)||Ac.test(e.nodeName)||"false"==e.contentEditable)return!1;t=fc(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?vc(e):0}}}function vc(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Oc(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Tc=function(e){return e.focusNode&&_c(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Sc(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const yc="undefined"!=typeof navigator?navigator:null,Cc="undefined"!=typeof document?document:null,Nc=yc&&yc.userAgent||"",bc=/Edge\/(\d+)/.exec(Nc),Ic=/MSIE \d/.exec(Nc),Rc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Nc),wc=!!(Ic||Rc||bc),kc=Ic?document.documentMode:Rc?+Rc[1]:bc?+bc[1]:0,Lc=!wc&&/gecko\/(\d+)/i.test(Nc);Lc&&(/Firefox\/(\d+)/.exec(Nc)||[0,0])[1];const xc=!wc&&/Chrome\/(\d+)/.exec(Nc),Mc=!!xc,Fc=xc?+xc[1]:0,Bc=!wc&&!!yc&&/Apple Computer/.test(yc.vendor),Pc=Bc&&(/Mobile\/\w+/.test(Nc)||!!yc&&yc.maxTouchPoints>2),Uc=Pc||!!yc&&/Mac/.test(yc.platform),Hc=!!yc&&/Win/.test(yc.platform),jc=/Android \d/.test(Nc),$c=!!Cc&&"webkitFontSmoothing"in Cc.documentElement.style,Yc=$c?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function zc(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Vc(e,t){return"number"==typeof e?e:e[t]}function Gc(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Wc(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=mc(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?zc(o):Gc(e),u=0,l=0;if(t.top<a.top+Vc(r,"top")?l=-(a.top-t.top+Vc(i,"top")):t.bottom>a.bottom-Vc(r,"bottom")&&(l=t.bottom-t.top>a.bottom-a.top?t.top+Vc(i,"top")-a.top:t.bottom-a.bottom+Vc(i,"bottom")),t.left<a.left+Vc(r,"left")?u=-(a.left-t.left+Vc(i,"left")):t.right>a.right-Vc(r,"right")&&(u=t.right-a.right+Vc(i,"right")),u||l)if(n)o.defaultView.scrollBy(u,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),u&&(e.scrollLeft+=u);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Xc(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=mc(r));return t}function Kc(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let qc=null;function Jc(e,t){let n,r,i,o,s=2e8,a=0,u=t.top,l=t.top;for(let c=e.firstChild,d=0;c;c=c.nextSibling,d++){let e;if(1==c.nodeType)e=c.getClientRects();else{if(3!=c.nodeType)continue;e=gc(c).getClientRects()}for(let h=0;h<e.length;h++){let p=e[h];if(p.top<=u&&p.bottom>=l){u=Math.max(p.bottom,u),l=Math.min(p.top,l);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<s){n=c,s=e,r=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==c.nodeType&&e&&(a=d+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!i&&p.left<=t.left&&p.right>=t.left&&(i=c,o={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&i&&(n=i,r=o,s=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=nd(r,1);if(n.top!=n.bottom&&Zc(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:a}:Jc(n,r)}function Zc(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Qc(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Zc(t,i))return Qc(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function ed(e,t){let n,r=e.dom.ownerDocument,i=0,o=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}(r,t.left,t.top);o&&({node:n,offset:i}=o);let s,a=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!a||!e.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=e.dom.getBoundingClientRect();if(!Zc(t,n))return null;if(a=Qc(e.dom,t,n),!a)return null}if(Bc)for(let l=a;n&&l;l=mc(l))l.draggable&&(n=void 0);if(a=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(a,t),n){if(Lc&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}let r;$c&&i&&1==n.nodeType&&1==(r=n.childNodes[i-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&i--,n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let t=e.docView.nearestDesc(o,!0);if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent&&!s||!t.contentDOM)){let e=t.dom.getBoundingClientRect();if(t.node.isBlock&&t.parent&&!s&&(s=!0,e.left>r.left||e.top>r.top?i=t.posBefore:(e.right<r.left||e.bottom<r.top)&&(i=t.posAfter)),!t.contentDOM&&i<0&&!t.node.isText)return(t.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2)?t.posBefore:t.posAfter}o=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,n,i,t))}null==s&&(s=function(e,t,n){let{node:r,offset:i}=Jc(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,a,t));let u=e.docView.nearestDesc(a,!0);return{pos:s,inside:u?u.posAtStart-u.border:-1}}function td(e){return e.top<e.bottom||e.left<e.right}function nd(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(td(e))return e}return Array.prototype.find.call(n,td)||e.getBoundingClientRect()}const rd=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function id(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=$c||Lc;if(3==r.nodeType){if(!s||!rd.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,od(nd(gc(r,e,t),o),o<0)}{let e=nd(gc(r,i,i),n);if(Lc&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=nd(gc(r,i-1,i-1),-1);if(t.top==e.top){let n=nd(gc(r,i,i+1),-1);if(n.top!=e.top)return od(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==vc(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return sd(e.getBoundingClientRect(),!1)}if(null==o&&i<vc(r)){let e=r.childNodes[i];if(1==e.nodeType)return sd(e.getBoundingClientRect(),!0)}return sd(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==vc(r))){let e=r.childNodes[i-1],t=3==e.nodeType?gc(e,vc(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return od(nd(t,1),!1)}if(null==o&&i<vc(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?gc(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return od(nd(t,-1),!0)}return od(nd(3==r.nodeType?gc(r):r,-n),n>=0)}function od(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function sd(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function ad(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const ud=/[\u0590-\u08ac]/;let ld=null,cd=null,dd=!1;class hd{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>fc(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let i=0;n<this.children.length;n++){let t=this.children[n],o=i+t.size;if(o>e||t instanceof Ad){r=e-i;break}i=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof pd&&i.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?fc(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?fc(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=fc(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=fc(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let d=0,h=0;d<this.children.length;d++){let s=this.children[d],a=h+s.size;if(i>h&&o<a)return s.setSelection(e-h-s.border,t-h-s.border,n,r);h=a}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),u=n.getSelection(),l=!1;if((Lc||Bc)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(l=!(!t||"\n"!=e.nodeValue[t-1]),l&&t==e.nodeValue.length)for(let n,r=e;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(s=a={node:n.parentNode,offset:fc(n)+1});break}let e=r.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];l=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(Lc&&u.focusNode&&u.focusNode!=a.node&&1==u.focusNode.nodeType){let e=u.focusNode.childNodes[u.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||l&&Bc)&&_c(s.node,s.offset,u.anchorNode,u.anchorOffset)&&_c(a.node,a.offset,u.focusNode,u.focusOffset))return;let c=!1;if((u.extend||e==t)&&!l){u.collapse(s.node,s.offset);try{e!=t&&u.extend(a.node,a.offset),c=!0}catch(e){}}if(!c){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),u.removeAllRanges(),u.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class pd extends hd{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class fd extends hd{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class md extends hd{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=dl.renderSpec(document,t.type.spec.toDOM(t,n))),new md(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=md.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=kd(i,t,o,n)),e>0&&(i=kd(i,0,e,n));for(let s=0;s<i.length;s++)i[s].parent=r;return r.children=i,r}}class Ed extends hd{constructor(e,t,n,r,i,o,s,a,u){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,i,o){let s,a=i.nodeViews[t.type.name],u=a&&a(t,i,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),l=u&&u.dom,c=u&&u.contentDOM;if(t.isText)if(l){if(3!=l.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else l=document.createTextNode(t.text);else l||({dom:l,contentDOM:c}=dl.renderSpec(document,t.type.spec.toDOM(t)));c||t.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),t.type.spec.draggable&&(l.draggable=!0));let d=l;return l=Nd(l,n,t),u?s=new Dd(e,t,n,r,l,c||null,d,u,i,o+1):t.isText?new _d(e,t,n,r,l,d,i):new Ed(e,t,n,r,l,c||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>hu.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&bd(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new Rd(this,o&&o.node,e);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],u=null;for(let l=0;;){let c,d,h,p;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(c?(d||(d=[c])).push(e):c=e)}if(c)if(d){d.sort(wd);for(let e=0;e<d.length;e++)n(d[e],l,!!u)}else n(c,l,!!u);if(u)p=-1,h=u,u=null;else{if(!(l<e.childCount))break;p=l,h=e.child(l++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let f=o+h.nodeSize;if(h.isText){let e=f;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(u=h.cut(e-o),h=h.cut(0,e-o),f=e,p=-1)}else for(;s<i.length&&i[s].to<=f;)s++;let m=h.isInline&&!h.isLeaf?a.filter((e=>!e.inline)):a.slice();r(h,m,t.forChild(o,h),p),o=f}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?Eu.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,u,l)=>{let c;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,u,l)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(c=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,u,c,e)||a.updateNextNode(t,o,u,e,l,r)||a.addNode(t,o,u,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),vd(this.contentDOM,this.children,e),Pc&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Kl)||n<t||r>t+this.node.content.size)return null;let i=e.domSelectionRange(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=vc(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let u=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;u+=t.text}if(o>=n){if(o>=r&&u.slice(r-t.length-a,r-a)==t)return r-t.length;let e=a<r?u.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&u.length>=r+t.length-a&&u.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new fd(this,i,t,r);e.input.compositionNodes.push(o),this.children=kd(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,n,r),0))}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(bd(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=yd(this.dom,this.nodeDOM,Sd(this.outerDeco,this.node,t),Sd(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function gd(e,t,n,r,i){Nd(r,t,e);let o=new Ed(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class _d extends Ed{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new _d(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Ad extends hd{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Dd extends Ed{constructor(e,t,n,r,i,o,s,a,u,l){super(e,t,n,r,i,o,s,u,l),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function vd(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=Id(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof md){let t=r?r.previousSibling:e.lastChild;vd(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Id(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Od=function(e){e&&(this.nodeName=e)};Od.prototype=Object.create(null);const Td=[new Od];function Sd(e,t,n){if(0==e.length)return Td;let r=n?Td[0]:new Od,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Od(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new Od(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function yd(e,t,n,r){if(n==Td&&r==Td)return t;let i=t;for(let o=0;o<r.length;o++){let t=r[o],s=n[o];if(o){let n;s&&s.nodeName==t.nodeName&&i!=e&&(n=i.parentNode)&&n.nodeName.toLowerCase()==t.nodeName||(n=document.createElement(t.nodeName),n.pmIsDeco=!0,n.appendChild(i),s=Td[0]),i=n}Cd(i,s||Td[0],t)}return i}function Cd(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function Nd(e,t,n){return yd(e,e,Td,Sd(t,n,1!=e.nodeType))}function bd(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Id(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Rd{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof md)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=a.node;if(u){if(u!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=md.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s<a;s++){let r=this.top.children[s];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){o=s;break}}return!(o<0||(this.destroyBetween(this.index,o),this.index++,0))}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i,o){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof Ed){let u=this.preMatch.matched.get(a);if(null!=u&&u!=i)return!1;let l,c=a.dom,d=this.isLocked(c)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&bd(t,a.outerDeco));if(!d&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!d&&(l=this.recreateWrapper(a,e,t,n,r,o)))return this.top.children[this.index]=l,l.contentDOM&&(l.dirty=2,l.updateChildren(r,o+1),l.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let s=Ed.create(this.top,t,n,r,i,o);if(s.contentDOM){s.children=e.children,e.children=[];for(let e of s.children)e.parent=s}return e.destroy(),s}addNode(e,t,n,r,i){let o=Ed.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new pd(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof md;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof _d)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Bc||Mc)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new Ad(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function wd(e,t){return e.type.side-t.type.side}function kd(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let u=e[s],l=a,c=a+=u.size;l>=n||c<=t?o.push(u):(l<t&&o.push(u.slice(0,t-l,r)),i&&(o.push(i),i=void 0),c>n&&o.push(u.slice(n-l,u.size,r)))}return o}function Ld(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,u,l=r.resolve(s);if(Tc(n)){for(a=l;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&Jl.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==vc(e);r||i;){if(e==n)return!0;let t=fc(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==vc(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;u=new Jl(s==e?l:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}return u||(u=$d(e,a,l,"pointer"==t||e.state.selection.head<l.pos&&!o?1:-1)),u}function xd(e){return e.editable?e.hasFocus():zd(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Md(e,t=!1){let n=e.state.selection;if(Hd(e,n),xd(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Mc){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&_c(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,fc(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&wc&&kc<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!Fd||n instanceof Kl||(n.$from.parent.inlineContent||(r=Bd(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=Bd(e,n.to))),e.docView.setSelection(o,s,e.root,t),Fd&&(r&&Ud(r),i&&Ud(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{xd(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Fd=Bc||Mc&&Fc<63;function Bd(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Bc&&i&&"false"==i.contentEditable)return Pd(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return Pd(i);if(o)return Pd(o)}}function Pd(e){return e.contentEditable="true",Bc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ud(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Hd(e,t){if(t instanceof Jl){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(jd(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else jd(e)}function jd(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function $d(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||Kl.between(t,n,r)}function Yd(e){return!(e.editable&&!e.hasFocus())&&zd(e)}function zd(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function Vd(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&Vl.findFrom(o,t)}function Gd(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Wd(e,t,n){let r=e.state.selection;if(!(r instanceof Kl)){if(r instanceof Jl&&r.node.isInline)return Gd(e,new Kl(t>0?r.$to:r.$from));{let n=Vd(e.state,t);return!!n&&Gd(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return Gd(e,new Kl(r.$anchor,o))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Vd(e.state,t);return!!(n&&n instanceof Jl)&&Gd(e,n)}if(!(Uc&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Jl.isSelectable(o)?Gd(e,new Jl(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!$c&&Gd(e,new Kl(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function Xd(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Kd(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function qd(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Lc&&1==n.nodeType&&r<Xd(n)&&Kd(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(Kd(e,-1))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Jd(n))break;{let t=n.previousSibling;for(;t&&Kd(t,-1);)i=n.parentNode,o=fc(t),t=t.previousSibling;if(t)n=t,r=Xd(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Zd(e,n,r):i&&Zd(e,i,o)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=Xd(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Kd(n.childNodes[r],1))break;i=n,o=++r}else{if(Jd(n))break;{let t=n.nextSibling;for(;t&&Kd(t,1);)i=t.parentNode,o=fc(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=Xd(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&Zd(e,i,o)}(e)}function Jd(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Zd(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!Oc(e);)t=fc(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!Oc(e);)t=fc(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(Tc(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&Md(e)}),50)}function Qd(e,t){let n=e.state.doc.resolve(t);if(!Mc&&!Hc&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function eh(e,t,n){let r=e.state.selection;if(r instanceof Kl&&!r.empty||n.indexOf("s")>-1)return!1;if(Uc&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Vd(e.state,t);if(n&&n instanceof Jl)return Gd(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof Ql?Vl.near(n,t):Vl.findFrom(n,t);return!!s&&Gd(e,s)}return!1}function th(e,t){if(!(e.state.selection instanceof Kl))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function nh(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function rh(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||dl.fromSchema(e.state.schema),a=ph(),u=a.createElement("div");u.appendChild(s.serializeFragment(r,{document:a}));let l,c=u.firstChild,d=0;for(;c&&1==c.nodeType&&(l=dh[c.nodeName.toLowerCase()]);){for(let e=l.length-1;e>=0;e--){let t=a.createElement(l[e]);for(;u.firstChild;)t.appendChild(u.firstChild);u.appendChild(t),d++}c=u.firstChild}c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let h=e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:u,text:h}}function ih(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let u=t&&(r||a||!n);if(u){if(e.someProp("transformPastedText",(n=>{t=n(t,a||r,e)})),a)return t?new _u(hu.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):_u.empty;let n=e.someProp("clipboardTextParser",(n=>n(t,i,r,e)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=dl.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=ph().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);if((n=i&&dh[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join("")),r.innerHTML=e,n)for(let o=0;o<n.length;o++)r=r.querySelector(n[o])||r;return r}(n),$c&&function(e){let t=e.querySelectorAll(Mc?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let l=o&&o.querySelector("[data-pm-slice]"),c=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let e=o.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;o=e}if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||tl.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!u&&!c),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||oh.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=n.length-2;a>=0;a-=2){let e=r.nodes[n[a]];if(!e||e.hasRequiredAttrs())break;i=hu.from(e.create(n[a+1],i)),o++,s++}return new _u(i,o,s)}(ch(s,+c[1],+c[2]),c[4]);else if(s=_u.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&ah(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=uh(o[o.length-1],r.length));let t=sh(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return hu.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let n=s.content.firstChild;e<s.openStart&&!n.type.spec.isolating;e++,n=n.firstChild);for(let n=s.content.lastChild;t<s.openEnd&&!n.type.spec.isolating;t++,n=n.lastChild);s=ch(s,e,t)}return e.someProp("transformPasted",(t=>{s=t(s,e)})),s}const oh=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function sh(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,hu.from(e));return e}function ah(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=ah(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(hu.from(sh(n,e,i+1))))}}function uh(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,uh(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(hu.empty,!0);return e.copy(n.append(r))}function lh(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=lh(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(hu.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function ch(e,t,n){return t<e.openStart&&(e=new _u(lh(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new _u(lh(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const dh={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let hh=null;function ph(){return hh||(hh=document.implementation.createHTMLDocument("title"))}const fh={},mh={},Eh={touchstart:!0,touchmove:!0};class gh{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function _h(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Ah(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Dh(e,t))}))}function Dh(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function vh(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Oh(e){return{left:e.clientX,top:e.clientY}}function Th(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,(t=>s>o.depth?t(e,n,o.nodeAfter,o.before(s),i,!0):t(e,n,o.node(s),o.before(s),i,!1))))return!0;return!1}function Sh(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function yh(e,t,n,r){return Th(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Ch(e,t,n,r){return Th(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Sh(e,Kl.create(r,0,r.content.size)),!0);let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let t=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(t.inlineContent)Sh(e,Kl.create(r,n+1,n+1+t.content.size));else{if(!Jl.isSelectable(t))continue;Sh(e,Jl.create(r,n))}return!0}}(e,n,r)}function Nh(e){return xh(e)}mh.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Rh(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!jc||!Mc||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Pc||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||function(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||Uc&&72==n&&"c"==r)return th(e,-1)||qd(e,-1);if(46==n&&!t.shiftKey||Uc&&68==n&&"c"==r)return th(e,1)||qd(e,1);if(13==n||27==n)return!0;if(37==n||Uc&&66==n&&"c"==r){let t=37==n?"ltr"==Qd(e,e.state.selection.from)?-1:1:-1;return Wd(e,t,r)||qd(e,t)}if(39==n||Uc&&70==n&&"c"==r){let t=39==n?"ltr"==Qd(e,e.state.selection.from)?1:-1:1;return Wd(e,t,r)||qd(e,t)}return 38==n||Uc&&80==n&&"c"==r?eh(e,-1,r)||qd(e,-1):40==n||Uc&&78==n&&"c"==r?function(e){if(!Bc||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;nh(e,n,"true"),setTimeout((()=>nh(e,n,"false")),20)}return!1}(e)||eh(e,1,r)||qd(e,1):r==(Uc?"m":"c")&&(66==n||73==n||89==n||90==n)}(e,n)?n.preventDefault():_h(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,Sc(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},mh.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},mh.keypress=(e,t)=>{let n=t;if(Rh(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Uc&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof Kl&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const bh=Uc?"metaKey":"ctrlKey";fh.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Nh(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[bh]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(Oh(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Ih(e,s,n,!!r)):("doubleClick"==o?yh:Ch)(e,s.pos,s.inside,n)?n.preventDefault():_h(e,"pointer"))};class Ih{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[bh],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:u}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||u instanceof Jl&&u.from<=o&&u.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Lc||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),_h(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Md(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Oh(e))),this.updateAllowDefault(e),this.allowDefault||!t?_h(this.view,"pointer"):function(e,t,n,r,i){return Th(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof Jl&&(n=i.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let e=s>o.depth?o.nodeAfter:o.node(s);if(Jl.isSelectable(e)){r=n&&i.$from.depth>0&&s>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(s);break}}return null!=r&&(Sh(e,Jl.create(e.state.doc,r)),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&Jl.isSelectable(r))&&(Sh(e,new Jl(n)),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Bc&&this.mightDrag&&!this.mightDrag.node.isAtom||Mc&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Sh(this.view,Vl.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):_h(this.view,"pointer")}move(e){this.updateAllowDefault(e),_h(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function Rh(e,t){return!!e.composing||!!(Bc&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}fh.touchstart=e=>{e.input.lastTouch=Date.now(),Nh(e),_h(e,"pointer")},fh.touchmove=e=>{e.input.lastTouch=Date.now(),_h(e,"pointer")},fh.contextmenu=e=>Nh(e);const wh=jc?5e3:-1;function kh(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>xh(e)),t))}function Lh(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function xh(e,t=!1){if(!(jc&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Lh(e),t||e.docView&&e.docView.dirty){let t=Ld(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}mh.compositionstart=mh.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),xh(e,!0),e.markCursor=null;else if(xh(e),Lc&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){e.domSelection().collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}kh(e,wh)},mh.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,kh(e,20))};const Mh=wc&&kc<15||Pc&&Yc<604;function Fh(e,t,n,r,i){let o=ih(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,i,o||_u.empty))))return!0;if(!o)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Bh(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}fh.copy=mh.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Mh?null:n.clipboardData,s=r.content(),{dom:a,text:u}=rh(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",u)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},mh.paste=(e,t)=>{let n=t;if(e.composing&&!jc)return;let r=Mh?null:n.clipboardData,i=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&Fh(e,Bh(r),r.getData("text/html"),i,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Fh(e,r.value,null,i,t):Fh(e,r.textContent,r.innerHTML,i,t)}),50)}(e,n)};class Ph{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const Uh=Uc?"altKey":"ctrlKey";fh.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i,o=e.state.selection,s=o.empty?null:e.posAtCoords(Oh(n));if(s&&s.pos>=o.from&&s.pos<=(o instanceof Jl?o.to-1:o.to));else if(r&&r.mightDrag)i=Jl.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(i=Jl.create(e.state.doc,t.posBefore))}let a=(i||e.state.selection).content(),{dom:u,text:l}=rh(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Mh?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Mh||n.dataTransfer.setData("text/plain",l),e.dragging=new Ph(a,!n[Uh],i)},fh.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},mh.dragover=mh.dragenter=(e,t)=>t.preventDefault(),mh.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Oh(n));if(!i)return;let o=e.state.doc.resolve(i.pos),s=r&&r.slice;s?e.someProp("transformPasted",(t=>{s=t(s,e)})):s=ih(e,Bh(n.dataTransfer),Mh?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[Uh]);if(e.someProp("handleDrop",(t=>t(e,n,s||_u.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let u=s?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(0==n.openStart&&n.size?2:1);o++)for(let e=r.depth;e>=0;e--){let t=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,n=r.index(e)+(t>0?1:0),s=r.node(e),a=!1;if(1==o)a=s.canReplace(n,n,i);else{let e=s.contentMatchAt(n).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(n,n,e[0])}if(a)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}(e.state.doc,o.pos,s):o.pos;null==u&&(u=o.pos);let l=e.state.tr;if(a){let{node:e}=r;e?e.replace(l):l.deleteSelection()}let c=l.mapping.map(u),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,h=l.doc;if(d?l.replaceRangeWith(c,c,s.content.firstChild):l.replaceRange(c,c,s),l.doc.eq(h))return;let p=l.doc.resolve(c);if(d&&Jl.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new Jl(p));else{let t=l.mapping.map(u);l.mapping.maps[l.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),l.setSelection($d(e,p,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))},fh.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Md(e)}),20))},fh.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},fh.beforeinput=(e,t)=>{if(Mc&&jc&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,Sc(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in mh)fh[os]=mh[os];function Hh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class jh{constructor(e,t){this.toDOM=e,this.spec=t||Gh,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new zh(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof jh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Hh(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class $h{constructor(e,t){this.attrs=e,this.spec=t||Gh}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new zh(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof $h&&Hh(this.attrs,e.attrs)&&Hh(this.spec,e.spec)}static is(e){return e.type instanceof $h}destroy(){}}class Yh{constructor(e,t){this.attrs=e,this.spec=t||Gh}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new zh(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof Yh&&Hh(this.attrs,e.attrs)&&Hh(this.spec,e.spec)}destroy(){}}class zh{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new zh(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new zh(e,e,new jh(t,n))}static inline(e,t,n,r){return new zh(e,t,new $h(n,r))}static node(e,t,n,r){return new zh(e,t,new Yh(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof $h}get widget(){return this.type instanceof jh}}const Vh=[],Gh={};class Wh{constructor(e,t){this.local=e.length?e:Vh,this.children=t.length?t:Vh}static create(e,t){return t.length?Qh(t,e,0,Gh):Xh}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==Xh||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Gh)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice();for(let l=0,c=o;l<n.maps.length;l++){let e=0;n.maps[l].forEach(((t,n,r,i)=>{let o=i-r-(n-t);for(let s=0;s<a.length;s+=3){let r=a[s+1];if(r<0||t>r+c-e)continue;let i=a[s]+c-e;n>=i?a[s+1]=t<=i?-2:-1:t>=c&&o&&(a[s]+=o,a[s+1]+=o)}e+=o})),c=n.maps[l].map(c,-1)}let u=!1;for(let l=0;l<a.length;l+=3)if(a[l+1]<0){if(-2==a[l+1]){u=!0,a[l+1]=-1;continue}let t=n.map(e[l]+o),c=t-i;if(c<0||c>=r.content.size){u=!0;continue}let d=n.map(e[l+1]+o,-1)-i,{index:h,offset:p}=r.content.findIndex(c),f=r.maybeChild(h);if(f&&p==c&&p+f.nodeSize==d){let r=a[l+2].mapInner(n,f,t+1,e[l]+o+1,s);r!=Xh?(a[l]=c,a[l+1]=d,a[l+2]=r):(a[l+1]=-2,u=!0)}else u=!0}if(u){let u=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let u=0;u<e.length;u+=3)-1==e[u+1]&&a(e[u+2],t[u]+o+1);return n}(a,e,t,n,i,o,s),l=Qh(u,r,0,s);t=l.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<l.children.length;e+=3){let n=l.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,l.children[e],l.children[e+1],l.children[e+2])}}return new Wh(t.sort(ep),a)}(this.children,o||[],e,t,n,r,i):o?new Wh(o.sort(ep),Vh):Xh}add(e,t){return t.length?this==Xh?Wh.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=Jh(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,Qh(s,e,a+1,Gh)),i+=3}}));let o=qh(i?Zh(t):t,-n);for(let s=0;s<o.length;s++)o[s].type.valid(e,o[s])||o.splice(s--,1);return new Wh(o.length?this.local.concat(o).sort(ep):this.local,r||this.children)}remove(e){return 0==e.length||this==Xh?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let i=0;i<n.length;i+=3){let r,o=n[i]+t,s=n[i+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(r||(r=[])).push(t));if(!r)continue;n==this.children&&(n=this.children.slice());let a=n[i+2].removeInner(r,o+1);a!=Xh?n[i+2]=a:(n.splice(i,3),i-=3)}if(r.length)for(let i,o=0;o<e.length;o++)if(i=e[o])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Wh(r,n):Xh}forChild(e,t){if(this==Xh)return this;if(t.isLeaf)return Wh.empty;let n,r;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=e){this.children[s]==e&&(n=this.children[s+2]);break}let i=e+1,o=i+t.content.size;for(let s=0;s<this.local.length;s++){let e=this.local[s];if(e.from<o&&e.to>i&&e.type instanceof $h){let t=Math.max(i,e.from)-i,n=Math.min(o,e.to)-i;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let e=new Wh(r.sort(ep),Vh);return n?new Kh([e,n]):e}return n||Xh}eq(e){if(this==e)return!0;if(!(e instanceof Wh)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return tp(this.localsInner(e))}localsInner(e){if(this==Xh)return Vh;if(e.inlineContent||!this.local.some($h.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof $h||t.push(this.local[n]);return t}}Wh.empty=new Wh([],[]),Wh.removeOverlap=tp;const Xh=Wh.empty;class Kh{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,Gh)));return Kh.from(n)}forChild(e,t){if(t.isLeaf)return Wh.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=Xh&&(i instanceof Kh?n=n.concat(i.members):n.push(i))}return Kh.from(n)}eq(e){if(!(e instanceof Kh)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?tp(n?t:t.sort(ep)):Vh}static from(e){switch(e.length){case 0:return Xh;case 1:return e[0];default:return new Kh(e.every((e=>e instanceof Wh))?e:e.reduce(((e,t)=>e.concat(t instanceof Wh?t:t.members)),[]))}}}function qh(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new zh(i.from+t,i.to+t,i.type))}return n}function Jh(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o,s=0;s<e.length;s++)(o=e[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[s]=null);return i}function Zh(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Qh(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=Jh(e,t,s+n);if(a){o=!0;let e=Qh(a,t,n+s+1,r);e!=Xh&&i.push(s,s+t.nodeSize,e)}}));let s=qh(o?Zh(e):e,-n).sort(ep);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Wh(s,i):Xh}function ep(e,t){return e.from-t.from||e.to-t.to}function tp(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),np(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),np(t,i+1,o.copy(r.to,o.to)))}}return t}function np(e,t,n){for(;t<e.length&&ep(n,e[t])>0;)t++;e.splice(t,0,n)}function rp(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=Xh&&t.push(r)})),e.cursorWrapper&&t.push(Wh.create(e.state.doc,[e.cursorWrapper.deco])),Kh.from(t)}const ip={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},op=wc&&kc<=11;class sp{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class ap{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new sp,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);wc&&kc<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),op&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ip)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(Yd(this.view)){if(this.suppressingSelectionUpdates)return Md(this.view);if(wc&&kc<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&_c(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let i=e.focusNode;i;i=mc(i))n.add(i);for(let i=e.anchorNode;i;i=mc(i))if(n.has(i)){t=i;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Yd(e)&&!this.ignoreSelectionChange(n),i=-1,o=-1,s=!1,a=[];if(e.editable)for(let l=0;l<t.length;l++){let e=this.registerMutation(t[l],a);e&&(i=i<0?e.from:Math.min(e.from,i),o=o<0?e.to:Math.max(e.to,o),e.typeOver&&(s=!0))}if(Lc&&a.length>1){let e=a.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}let u=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Tc(n)&&(u=Ld(e))&&u.eq(Vl.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Md(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,o),function(e){if(!up.has(e)&&(up.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=Lc,lp)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),lp=!0}}(e)),this.handleDOMChange(i,o,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Md(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(wc&&kc<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?fc(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?fc(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let up=new WeakMap,lp=!1;function cp(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Bc&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Bc&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const dp=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function hp(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:$d(e,t.resolve(n.anchor),t.resolve(n.head))}function pp(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function fp(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class mp{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new gh,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Dp),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=_p(this),gp(this),this.nodeViews=Ap(this),this.docView=gd(this.state.doc,Ep(this),rp(this),this.dom,this),this.domObserver=new ap(this,((e,t,n,r)=>function(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Ld(e,t);if(n&&!e.state.selection.eq(n)){if(Mc&&jc&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(t=>t(e,Sc(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),o&&r.setMeta("composition",o),e.dispatch(r)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let u,l,c=e.state.selection,d=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:u}=e.docView.parseRange(t,n),l=e.domSelectionRange(),c=l.anchorNode;if(c&&e.dom.contains(1==c.nodeType?c:c.parentNode)&&(r=[{node:c,offset:l.anchorOffset}],Tc(l)||r.push({node:l.focusNode,offset:l.focusOffset})),Mc&&8===e.input.lastKeyCode)for(let E=s;E>o;E--){let e=i.childNodes[E-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){s=E;break}if(!t||t.size)break}let d=e.state.doc,h=e.someProp("domParser")||tl.fromSchema(e.state.schema),p=d.resolve(a),f=null,m=h.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:cp,context:p});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:u}}(e,t,n),h=e.state.doc,p=h.slice(d.from,d.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(u=e.state.selection.to,l="end"):(u=e.state.selection.from,l="start"),e.input.lastKeyCode=null;let f=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i&&(r-=s+Math.max(0,o-Math.min(s,a))-o),s<o&&e.size<t.size){let e=r<=o&&r>=s?o-r:0;o-=e,o&&o<t.size&&fp(t.textBetween(o-1,o+1))&&(o+=e?1:-1),a=o+(a-s),s=o}else if(a<o){let t=r<=o&&r>=a?o-r:0;o-=t,o&&o<e.size&&fp(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(p.content,d.doc.content,d.from,u,l);if((Pc&&e.input.lastIOSEnter>Date.now()-225||jc)&&i.some((e=>1==e.nodeType&&!dp.test(e.nodeName)))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",(t=>t(e,Sc(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&c instanceof Kl&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){let t=hp(e,e.state.doc,d.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);o&&n.setMeta("composition",o),e.dispatch(n)}}return}f={start:c.from,endA:c.to,endB:c.to}}if(Mc&&e.cursorWrapper&&d.sel&&d.sel.anchor==e.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let e=f.endB-f.start;d.sel={anchor:d.sel.anchor+e,head:d.sel.anchor+e}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof Kl&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),wc&&kc<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>d.from&&" "==d.doc.textBetween(f.start-d.from-1,f.start-d.from+1)&&(f.start--,f.endA--,f.endB--);let m,E=d.doc.resolveNoCache(f.start-d.from),g=d.doc.resolveNoCache(f.endB-d.from),_=h.resolve(f.start),A=E.sameParent(g)&&E.parent.inlineContent&&_.end()>=f.endA;if((Pc&&e.input.lastIOSEnter>Date.now()-225&&(!A||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!A&&E.pos<d.doc.content.size&&!E.sameParent(g)&&(m=Vl.findFrom(d.doc.resolve(E.pos+1),1,!0))&&m.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,Sc(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||pp(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(pp(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||pp(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(h,f.start,f.endA,E,g)&&e.someProp("handleKeyDown",(t=>t(e,Sc(8,"Backspace")))))return void(jc&&Mc&&e.domObserver.suppressSelectionUpdates());Mc&&jc&&f.endB==f.start&&(e.input.lastAndroidDelete=Date.now()),jc&&!A&&E.start()!=g.start()&&0==g.parentOffset&&E.depth==g.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==f.endA&&(f.endB-=2,g=d.doc.resolveNoCache(f.endB-d.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,Sc(13,"Enter"))}))}),20));let D,v,O,T=f.start,S=f.endA;if(A)if(E.pos==g.pos)wc&&kc<=11&&0==E.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Md(e)),20)),D=e.state.tr.delete(T,S),v=h.resolve(f.start).marksAcross(h.resolve(f.endA));else if(f.endA==f.endB&&(O=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,u=s;for(let c=0;c<s.length;c++)a=s[c].removeFromSet(a);for(let c=0;c<o.length;c++)u=o[c].removeFromSet(u);if(1==a.length&&0==u.length)r=a[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=u.length)return null;r=u[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let l=[];for(let c=0;c<t.childCount;c++)l.push(i(t.child(c)));if(hu.from(l).eq(e))return{mark:r,type:n}}(E.parent.content.cut(E.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,f.endA-_.start()))))D=e.state.tr,"add"==O.type?D.addMark(T,S,O.mark):D.removeMark(T,S,O.mark);else if(E.parent.child(E.index()).isText&&E.index()==g.index()-(g.textOffset?0:1)){let t=E.parent.textBetween(E.parentOffset,g.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,T,S,t))))return;D=e.state.tr.insertText(t,T,S)}if(D||(D=e.state.tr.replace(T,S,d.doc.slice(f.start-d.from,f.endB-d.from))),d.sel){let t=hp(e,D.doc,d.sel);t&&!(Mc&&jc&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==T||t.head==D.mapping.map(S)-1)||wc&&t.empty&&t.head==T)&&D.setSelection(t)}v&&D.ensureMarks(v),o&&D.setMeta("composition",o),e.dispatch(D.scrollIntoView())}(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in fh){let n=fh[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!vh(e,t)||Dh(e,t)||!e.editable&&t.type in mh||n(e,t)},Eh[t]?{passive:!0}:void 0)}Bc&&e.dom.addEventListener("input",(()=>null)),Ah(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ah(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Dp),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Lh(this),o=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Ap(this);(function(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,i=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Ah(this),this.editable=_p(this),gp(this);let a=rp(this),u=Ep(this),l=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",c=i||!this.docView.matchesNode(e.doc,u,a);!c&&e.selection.eq(r.selection)||(o=!0);let d="preserve"==l&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:Xc(e.dom)}}(this);if(o){this.domObserver.stop();let t=c&&(wc||Mc)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(c){let n=Mc?this.trackWrites=this.domSelectionRange().focusNode:null;!i&&this.docView.update(e.doc,u,a,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=gd(e.doc,u,a,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return _c(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Md(this,t):(Hd(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():d&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Kc(n,0==r?0:r-t)}(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof Jl){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&Wc(this,t.getBoundingClientRect(),e)}else Wc(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Ph(e.slice,e.move,r<0?void 0:Jl.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let o=0;o<this.directPlugins.length;o++){let r=this.directPlugins[o].props[e];if(null!=r&&(n=t?t(r):r))return n}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let r=i[o].props[e];if(null!=r&&(n=t?t(r):r))return n}}hasFocus(){if(wc){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(qc)return e.focus(qc);let t=Xc(e);e.focus(null==qc?{get preventScroll(){return qc={preventScroll:!0},!0}}:void 0),qc||(qc=!1,Kc(t,0))}(this.dom),Md(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return ed(this,e)}coordsAtPos(e,t=1){return id(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){return ld==t&&cd==n?dd:(ld=t,cd=n,dd="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return ad(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=id(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=gc(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return ud.test(r.parent.textContent)&&a.modify?ad(e,t,(()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:s}=e.domSelectionRange(),u=a.caretBidiLevel;a.modify("move",n,"character");let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:c,focusOffset:d}=e.domSelectionRange(),h=c&&!l.contains(1==c.nodeType?c:c.parentNode)||t==c&&i==d;try{a.collapse(o,s),t&&(t!=o||i!=s)&&a.extend&&a.extend(t,i)}catch(e){}return null!=u&&(a.caretBidiLevel=u),h})):"left"==n||"backward"==n?o:s}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return Fh(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Fh(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rp(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Dh(e,t)||!fh[t.type]||!e.editable&&t.type in mh||fh[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Bc&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom?function(e){let t;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,i=t.startOffset,o=t.endContainer,s=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return _c(a.node,a.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Ep(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),t.translate||(t.translate="no"),[zh.node(0,e.state.doc.content.size,t)]}function gp(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:zh.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function _p(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Ap(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Dp(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const vp=new class{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=lu.from(e.nodes),t.marks=lu.from(e.marks||{}),this.nodes=Ju.compile(this.spec.nodes,this),this.marks=Qu.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let e=this.nodes[r],t=e.spec.content||"",i=e.spec.marks;e.contentMatch=n[t]||(n[t]=Uu.parse(t,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==i?null:i?el(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let r in this.marks){let e=this.marks[r],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:el(this,t.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Ju))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Bu(n,n.defaultAttrs,e,Eu.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Fu.fromJSON(this,e)}markFromJSON(e){return Eu.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}({nodes:{doc:{content:"paragraph+"},paragraph:{code:!0,content:"inline*",parseDOM:[{tag:"p"}],toDOM:()=>["p",0]},text:{group:"inline"},mention:{group:"inline",inline:!0,attrs:{id:{},name:{}},content:"text*",toDOM:e=>["span",{"data-mention-id":e.attrs.id},`@${e.attrs.name}`],parseDOM:[{tag:"span[data-mention-id]",getAttrs:e=>({id:e.dataset["mention-id"]})}]}},marks:{literal:{toDOM:()=>["span",{"data-literal":""}],parseDOM:[{tag:"span[data-literal]"}]},bold:{toDOM:()=>["b"],parseDOM:[{tag:"b"}]},italic:{toDOM:()=>["i"],parseDOM:[{tag:"i"}]},strikethrough:{toDOM:()=>["del"],parseDOM:[{tag:"del"}]},emoji:{attrs:{emoji:{}},toDOM:e=>["span",{"data-emoji":e.attrs.emoji},e.attrs.emoji],parseDOM:[{tag:"span[data-emoji]",getAttrs:e=>({emoji:e.dataset.emoji})}]}}}),Op=new pc("placeholder"),Tp=new cc({key:Op,props:{decorations(e){if(Sp(e.doc))return;const t=e.doc.firstChild,n=zh.node(0,t.nodeSize,{class:"empty-node","data-placeholder":Op.getState(e)});return Wh.create(e.doc,[n])}},state:{init:()=>"",apply:(e,t)=>e.getMeta(Op)??t}});function Sp(e){return 1!==e.childCount||0!==e.firstChild.childCount}for(var yp={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Cp={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Np="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),bp="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Ip="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Rp="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),wp="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),kp=Np&&(Rp||+Np[1]<57)||Ip&&Rp,Lp=0;Lp<10;Lp++)yp[48+Lp]=yp[96+Lp]=String(Lp);for(Lp=1;Lp<=24;Lp++)yp[Lp+111]="F"+Lp;for(Lp=65;Lp<=90;Lp++)yp[Lp]=String.fromCharCode(Lp+32),Cp[Lp]=String.fromCharCode(Lp);for(var xp in yp)Cp.hasOwnProperty(xp)||(Cp[xp]=yp[xp]);const Mp="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Fp(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let a=0;a<o.length-1;a++){let e=o[a];if(/^(cmd|meta|m)$/i.test(e))i=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))n=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);Mp?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Bp(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function Pp(e){return new cc({props:{handleKeyDown:Up(e)}})}function Up(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Fp(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(kp&&(e.ctrlKey||e.altKey||e.metaKey)||(bp||wp)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?Cp:yp)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=t[Bp(i,n)];if(o&&o(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[Bp(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=yp[n.keyCode])&&r!=i){let i=t[Bp(r,n)];if(i&&i(e.state,e.dispatch,e))return!0}}return!1}}var Hp=200,jp=function(){};jp.prototype.append=function(e){return e.length?(e=jp.from(e),!this.length&&e||e.length<Hp&&this.leafAppend(e)||this.length<Hp&&e.leafPrepend(this)||this.appendInner(e)):this},jp.prototype.prepend=function(e){return e.length?jp.from(e).append(this):this},jp.prototype.appendInner=function(e){return new Yp(this,e)},jp.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?jp.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},jp.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},jp.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},jp.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},jp.from=function(e){return e instanceof jp?e:e&&e.length?new $p(e):jp.empty};var $p=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Hp)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Hp)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(jp);jp.empty=new $p([]);var Yp=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(jp),zp=jp;const Vp=Math.pow(2,16);function Gp(e,t){return e+t*Vp}function Wp(e){return 65535&e}let Xp=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}},Kp=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Wp(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Vp}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let u=this.ranges[s+i],l=this.ranges[s+o],c=a+u;if(e<=c){let i=a+r+((u?e==a?-1:e==c?1:t:t)<0?0:l);if(n)return i;let o=e==(t<0?a:c)?null:Gp(s/3,e-a),d=e==a?2:e==c?1:4;return(t<0?e!=a:e!=c)&&(d|=8),new Xp(i,d,o)}r+=l-u}return n?e+r:new Xp(e+r,0,null)}touches(e,t){let n=0,r=Wp(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let t=this.ranges[s]-(this.inverted?n:0);if(t>e)break;let a=this.ranges[s+i];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),u=this.ranges[r+t],l=this.ranges[r+n];e(s,s+u,a,a+l),i+=l-u}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Kp.empty=new Kp([]);class qp{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new qp(this.maps,this.mirror,e,t)}copy(){return new qp(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new qp;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let i=this.from;i<this.to;i++){let n=this.maps[i].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(i);if(null!=t&&t>i&&t<this.to){i=t,e=this.maps[t].recover(n.recover);continue}}r|=n.delInfo,e=n.pos}return n?e:new Xp(e,r,null)}}const Jp=Object.create(null);let Zp=class{getMap(){return Kp.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Jp[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Jp)throw new RangeError("Duplicate use of step JSON ID "+e);return Jp[e]=t,t.prototype.jsonID=e,t}},Qp=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof gu)return e.fail(t.message);throw t}}};function ef(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(ef(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return hu.fromArray(r)}let tf=class e extends Zp{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new _u(ef(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Qp.fromReplace(e,this.from,this.to,i)}invert(){return new nf(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};Zp.jsonID("addMark",tf);let nf=class e extends Zp{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new _u(ef(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Qp.fromReplace(e,this.from,this.to,n)}invert(){return new tf(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};Zp.jsonID("removeMark",nf);let rf=class e extends Zp{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Qp.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Qp.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new of(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};Zp.jsonID("addNodeMark",rf);let of=class e extends Zp{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Qp.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Qp.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new rf(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};function sf(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}Zp.jsonID("removeNodeMark",of),Zp.jsonID("replace",class e extends Zp{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&sf(e,this.from,this.to)?Qp.fail("Structure replace would overwrite content"):Qp.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Kp([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?_u.empty:new _u(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}}{let n=this.slice.size+t.slice.size==0?_u.empty:new _u(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,_u.fromJSON(t,n.slice),!!n.structure)}}),Zp.jsonID("replaceAround",class e extends Zp{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(sf(e,this.from,this.gapFrom)||sf(e,this.gapTo,this.to)))return Qp.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Qp.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Qp.fromReplace(e,this.from,this.to,n):Qp.fail("Content does not fit in gap")}getMap(){return new Kp([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new e(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,_u.fromJSON(t,n.slice),n.insert,!!n.structure)}}),Zp.jsonID("attr",class e extends Zp{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Qp.fail("No node at attribute step's position");let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Qp.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(r),0,t.isLeaf?0:1))}getMap(){return Kp.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new e(n.pos,n.attr,n.value)}}),Zp.jsonID("docAttr",class e extends Zp{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Qp.ok(n)}getMap(){return Kp.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if("string"!=typeof n.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new e(n.attr,n.value)}});let af=class extends Error{};af=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(af.prototype=Object.create(Error.prototype)).constructor=af,af.prototype.name="TransformError";class uf{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,u=[],l=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void l.push(e);if(n){l.push(new lf(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],u.push(new lf(t,void 0,void 0,u.length+l.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new uf(this.items.slice(0,i).append(l.reverse().concat(u)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let l=0;l<e.steps.length;l++){let n,u=e.steps[l].invert(e.docs[l]),c=new lf(e.mapping.maps[l],u,t);(n=a&&a.merge(c))&&(c=n,l?i.pop():s=s.slice(0,s.length-1)),i.push(c),t&&(o++,t=void 0),r||(a=c)}let u=o-n.depth;return u>df&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,u),o-=u),new uf(s.append(i),o)}remapping(e,t){let n=new qp;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new uf(this.items.append(e.map((e=>new lf(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let u=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),l=t.selection&&t.selection.map(i.slice(a+1,r));l&&s++,n.push(new lf(u,o,l))}else n.push(new lf(u))}),r);let u=[];for(let d=t;d<o;d++)u.push(new lf(i.maps[d]));let l=this.items.slice(0,r).append(u).append(n),c=new uf(l,s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let u,l=new lf(s.invert(),e,a),c=r.length-1;(u=r.length&&r[c].merge(l))?r[c]=u:r.push(l)}}else o.map&&n--}),this.items.length,0),new uf(zp.from(r.reverse()),i)}}uf.empty=new uf(zp.empty,0);let lf=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}};class cf{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const df=20;function hf(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,i)=>t.push(r,i)));return t}function pf(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}let ff=!1,mf=null;function Ef(e){let t=e.plugins;if(mf!=t){ff=!1,mf=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){ff=!0;break}}return ff}const gf=new pc("history"),_f=new pc("closeHistory");function Af(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new cc({key:gf,state:{init:()=>new cf(uf.empty,uf.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(gf);if(o)return o.historyState;n.getMeta(_f)&&(e=new cf(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(gf))return s.getMeta(gf).redo?new cf(e.done.addTransform(n,void 0,r,Ef(t)),e.undone,hf(n.mapping.maps),e.prevTime,e.prevComposition):new cf(e.done,e.undone.addTransform(n,void 0,r,Ef(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new cf(e.done.rebased(n,i),e.undone.rebased(n,i),pf(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new cf(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),pf(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),a=s?pf(e.prevRanges,n.mapping):hf(n.mapping.maps);return new cf(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,Ef(t)),uf.empty,a,n.time,null==i?e.prevComposition:i)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?vf:"historyRedo"==n?Of:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Df(e,t){return(n,r)=>{let i=gf.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=Ef(t),i=gf.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),u=new cf(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(gf,{redo:n,historyState:u})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const vf=Df(!1,!0),Of=Df(!0,!0),Tf=Math.pow(2,16);function Sf(e,t){return e+t*Tf}function yf(e){return 65535&e}class Cf{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Nf{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Nf.empty)return Nf.empty}recover(e){let t=0,n=yf(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Tf}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let u=this.ranges[s+i],l=this.ranges[s+o],c=a+u;if(e<=c){let i=a+r+((u?e==a?-1:e==c?1:t:t)<0?0:l);if(n)return i;let o=e==(t<0?a:c)?null:Sf(s/3,e-a),d=e==a?2:e==c?1:4;return(t<0?e!=a:e!=c)&&(d|=8),new Cf(i,d,o)}r+=l-u}return n?e+r:new Cf(e+r,0,null)}touches(e,t){let n=0,r=yf(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let t=this.ranges[s]-(this.inverted?n:0);if(t>e)break;let a=this.ranges[s+i];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),u=this.ranges[r+t],l=this.ranges[r+n];e(s,s+u,a,a+l),i+=l-u}}invert(){return new Nf(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Nf.empty:new Nf(e<0?[0,-e,0]:[0,0,e])}}Nf.empty=new Nf([]);const bf=Object.create(null);class If{getMap(){return Nf.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=bf[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in bf)throw new RangeError("Duplicate use of step JSON ID "+e);return bf[e]=t,t.prototype.jsonID=e,t}}class Rf{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Rf(e,null)}static fail(e){return new Rf(null,e)}static fromReplace(e,t,n,r){try{return Rf.ok(e.replace(t,n,r))}catch(e){if(e instanceof gu)return Rf.fail(e.message);throw e}}}function wf(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(wf(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return hu.fromArray(r)}class kf extends If{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new _u(wf(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Rf.fromReplace(e,this.from,this.to,i)}invert(){return new Lf(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new kf(t.pos,n.pos,this.mark)}merge(e){return e instanceof kf&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new kf(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new kf(t.from,t.to,e.markFromJSON(t.mark))}}If.jsonID("addMark",kf);class Lf extends If{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new _u(wf(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Rf.fromReplace(e,this.from,this.to,n)}invert(){return new kf(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Lf(t.pos,n.pos,this.mark)}merge(e){return e instanceof Lf&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Lf(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Lf(t.from,t.to,e.markFromJSON(t.mark))}}If.jsonID("removeMark",Lf);class xf extends If{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Rf.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Rf.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new xf(this.pos,t.marks[n]);return new xf(this.pos,this.mark)}}return new Mf(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new xf(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new xf(t.pos,e.markFromJSON(t.mark))}}If.jsonID("addNodeMark",xf);class Mf extends If{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Rf.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Rf.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new xf(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Mf(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Mf(t.pos,e.markFromJSON(t.mark))}}If.jsonID("removeNodeMark",Mf);class Ff extends If{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Pf(e,this.from,this.to)?Rf.fail("Structure replace would overwrite content"):Rf.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Nf([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ff(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Ff(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Ff)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?_u.empty:new _u(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ff(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?_u.empty:new _u(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ff(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ff(t.from,t.to,_u.fromJSON(e,t.slice),!!t.structure)}}If.jsonID("replace",Ff);class Bf extends If{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Pf(e,this.from,this.gapFrom)||Pf(e,this.gapTo,this.to)))return Rf.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Rf.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Rf.fromReplace(e,this.from,this.to,n):Rf.fail("Content does not fit in gap")}getMap(){return new Nf([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Bf(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new Bf(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Bf(t.from,t.to,t.gapFrom,t.gapTo,_u.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Pf(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Uf(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Hf(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!Uf(r,i,o))break}return null}function jf(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let l=i.depth-1,c=n-2;l>o;l--,c--){let e=i.node(l),t=i.index(l);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),o=r&&r[c+1];o&&(n=n.replaceChild(0,o.type.create(o.attrs)));let s=r&&r[c]||e;if(!e.canReplace(t+1,e.childCount)||!s.type.validContent(n))return!1}let a=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(a,a,u?u.type:i.node(o+1).type)}function $f(e,t){let n=e.resolve(t),r=n.index();return function(e,t){return!(!e||!t||e.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n)return!1;if(!e.type.allowsMarks(o.marks))return!1}return n.validEnd}(e,t))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Yf(e,t,n=t,r=_u.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return function(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}(i,o,r)?new Ff(t,n,r):new zf(i,o,r).fit()}If.jsonID("replaceAround",Bf);class zf{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=hu.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=hu.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new _u(i,o,s);return e>-1?new Bf(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Ff(n.pos,r.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Wf(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let o=this.depth;o>=0;o--){let e,{type:s,match:a}=this.frontier[o],u=null;if(1==t&&(i?a.matchType(i.type)||(u=a.fillBefore(hu.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:o,parent:r,inject:u};if(2==t&&i&&(e=a.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:r,wrap:e};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Wf(e,t);return!(!r.childCount||r.firstChild.isLeaf||(this.unplaced=new _u(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Wf(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new _u(Vf(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new _u(Vf(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let f=0;f<i.length;f++)this.openFrontierNode(i[f]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,u=0,l=[],{match:c,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));c=c.matchFragment(r)}let h=s.size+e-(o.content.size-o.openEnd);for(;u<s.childCount;){let e=s.child(u),t=c.matchType(e.type);if(!t)break;u++,(u>1||0==a||e.content.size)&&(c=t,l.push(Xf(e.mark(d.allowedMarks(e.marks)),1==u?a:0,u==s.childCount?h:-1)))}let p=u==s.childCount;p||(h=-1),this.placed=Gf(this.placed,t,hu.from(l)),this.frontier[t].match=c,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=s;f<h;f++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=p?0==e?_u.empty:new _u(Vf(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new _u(Vf(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Kf(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Kf(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Kf(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Gf(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Gf(this.placed,this.depth,hu.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(hu.empty,!0);e.childCount&&(this.placed=Gf(this.placed,this.frontier.length,e))}}function Vf(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Vf(e.firstChild.content,t-1,n)))}function Gf(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Gf(e.lastChild.content,t-1,n)))}function Wf(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Xf(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Xf(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(hu.empty,!0)))),e.copy(r)}function Kf(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}class qf extends If{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Rf.fail("No node at attribute step's position");let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Rf.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(r),0,t.isLeaf?0:1))}getMap(){return Nf.empty}invert(e){return new qf(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new qf(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new qf(t.pos,t.attr,t.value)}}If.jsonID("attr",qf);class Jf extends If{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Rf.ok(n)}getMap(){return Nf.empty}invert(e){return new Jf(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Jf(t.attr,t.value)}}If.jsonID("docAttr",Jf);let Zf=class extends Error{};Zf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Zf.prototype=Object.create(Error.prototype)).constructor=Zf,Zf.prototype.name="TransformError";const Qf=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function em(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function tm(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function nm(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function rm(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function im(e,t,n,r){let i,o,s=t.nodeBefore,a=t.nodeAfter,u=s.type.spec.isolating||a.type.spec.isolating;if(!u&&function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!$f(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let l=!u&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(i=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(i[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,o=hu.empty;for(let e=i.length-1;e>=0;e--)o=hu.from(i[e].create(null,o));o=hu.from(s.copy(o));let u=e.tr.step(new Bf(t.pos-1,r,t.pos,r,new _u(o,1,0),i.length,!0)),l=u.doc.resolve(r+2*i.length);l.nodeAfter&&l.nodeAfter.type==s.type&&$f(u.doc,l.pos)&&u.join(l.pos),n(u.scrollIntoView())}return!0}let c=a.type.spec.isolating||r>0&&u?null:Vl.findFrom(t,1),d=c&&c.$from.blockRange(c.$to),h=d&&Hf(d);if(null!=h&&h>=t.depth)return n&&n(e.tr.lift(d,h).scrollIntoView()),!0;if(l&&em(a,"start",!0)&&em(s,"end")){let r=s,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let o=a,u=1;for(;!o.isTextblock;o=o.firstChild)u++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(n){let r=hu.empty;for(let e=i.length-1;e>=0;e--)r=hu.from(i[e].copy(r));n(e.tr.step(new Bf(t.pos-i.length,t.pos+a.nodeSize,t.pos+u,t.pos+a.nodeSize-u,new _u(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function om(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(Kl.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const sm=om(-1),am=om(1);function um(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let lm=um(Qf,((e,t,n)=>{let r=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}(e,n);if(!r)return!1;let i=tm(r);if(!i){let n=r.blockRange(),i=n&&Hf(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(im(e,i,t,-1))return!0;if(0==r.parent.content.size&&(em(o,"end")||Jl.isSelectable(o)))for(let s=r.depth;;s--){let n=Yf(e.doc,r.before(s),r.after(s),_u.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(em(o,"end")?Vl.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):Jl.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}if(1==s||r.node(s-1).childCount>1)break}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),0))}),((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=tm(r)}let s=o&&o.nodeBefore;return!(!s||!Jl.isSelectable(s)||(t&&t(e.tr.setSelection(Jl.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),0))})),cm=um(Qf,((e,t,n)=>{let r=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}(e,n);if(!r)return!1;let i=nm(r);if(!i)return!1;let o=i.nodeAfter;if(im(e,i,t,1))return!0;if(0==r.parent.content.size&&(em(o,"start")||Jl.isSelectable(o))){let n=Yf(e.doc,r.before(),r.after(),_u.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(em(o,"start")?Vl.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):Jl.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),0))}),((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=nm(r)}let s=o&&o.nodeAfter;return!(!s||!Jl.isSelectable(s)||(t&&t(e.tr.setSelection(Jl.create(e.doc,o.pos)).scrollIntoView()),0))}));const dm={Enter:um(((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))}),((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ql||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=rm(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(Kl.create(s.doc,n+1)),t(s.scrollIntoView())}return!0}),((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(jf(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Hf(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)}),((e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Jl&&e.selection.node.isBlock)return!(!n.parentOffset||!jf(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let i,o,s=[],a=!1,u=!1;for(let h=n.depth;;h--){if(n.node(h).isBlock){a=n.end(h)==n.pos+(n.depth-h),u=n.start(h)==n.pos-(n.depth-h),o=rm(n.node(h-1).contentMatchAt(n.indexAfter(h-1))),s.unshift(a&&o?{type:o}:null),i=h;break}if(1==h)return!1;s.unshift(null)}let l=e.tr;(e.selection instanceof Kl||e.selection instanceof Ql)&&l.deleteSelection();let c=l.mapping.map(n.pos),d=jf(l.doc,c,s.length,s);if(d||(s[0]=o?{type:o}:null,d=jf(l.doc,c,s.length,s)),l.split(c,s.length,s),!a&&u&&n.node(i).type!=o){let e=l.mapping.map(n.before(i)),t=l.doc.resolve(e);o&&n.node(i-1).canReplaceWith(t.index(),t.index()+1,o)&&l.setNodeMarkup(l.mapping.map(n.before(i)),o)}return t&&t(l.scrollIntoView()),!0})),"Mod-Enter":(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=rm(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(Vl.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Backspace:lm,"Mod-Backspace":lm,"Shift-Backspace":lm,Delete:cm,"Mod-Delete":cm,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new Ql(e.doc))),!0)},hm={"Ctrl-h":dm.Backspace,"Alt-Backspace":dm["Mod-Backspace"],"Ctrl-d":dm.Delete,"Ctrl-Alt-Backspace":dm["Mod-Delete"],"Alt-Delete":dm["Mod-Delete"],"Alt-d":dm["Mod-Delete"],"Ctrl-a":sm,"Ctrl-e":am};for(let os in dm)hm[os]=dm[os];const pm=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&"darwin"==os.platform())?hm:dm;function fm(e,t){return e.reduce(((e,n,r)=>e.concat(t(n,r))),[])}const mm=(e,t,n=void 0)=>fm(e,(e=>{if("string"==typeof e)return t(e,n);switch(e.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return[{type:e.type,children:mm(e.children,t,e.type)}];case"link":return[{type:e.type,url:e.url,children:mm(e.children,t,e.type)}];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return[{type:e.type,action:e.action,params:e.params,children:mm(e.children,t,e.type)}];case"mention":case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return[e]}}));function Em(e,t){return n=>{const r=n;let i=0;const o=[];for(const s of _o(n,e)){s.index-i>0&&o.push(r.substring(i,s.index));const e=t(s);Array.isArray(e)?o.push(...e):o.push(e),i=s.index+s[0].length}return i<n.length&&o.push(n.substring(i)),o}}const gm="’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var _m=(e=>(e[e.italic=1]="italic",e[e.strikethrough=2]="strikethrough",e[e.bold=4]="bold",e))(_m||{});const Am=[0,1,2,3,4,5,6].map((e=>{const t=[];return 1&e||t.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/),2&e||t.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/),4&e||t.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/),new RegExp(t.map((e=>e.source)).join("|"),"g")})),Dm={_:1,"*":4,"~":2};function vm(e){return Om(e,0)}function Om(e,t=0){const n=Am[t],r=n?function(e){const t=Em(Tm.getOrCompute(e,(()=>new RegExp(`(?:^|[\\s${gm}])(?:${e.source})(?=[\\s${gm}]|$)`,"g"))),(e=>{const t=e[0][1],n=e[1]||e[2]||e[3]||e[4]||e[5]||e[6];return[" ",{type:_m[Dm[t]],children:[n]}]}));return e=>{const[n,...r]=t(" "+e);return n.length>1&&r.unshift(n.substring(1)),r}}(n):()=>[e];return mm(r(e),((e,n)=>"bold"===n||"italic"===n||"strikethrough"===n?Om(e,t|_m[n]):[e]))}const Tm=function(){const e=function(){try{return new WeakMap}catch(e){const n={has:()=>!1,get:()=>{},set:()=>n};return n}}();return{getOrCompute(t,n){if(e.has(t))return e.get(t);const r=n();return e.set(t,r),r}}}();function Sm(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function ym(e,t){for(var n=e.length-1;n>=0;n--)!0===t(e[n])&&e.splice(n,1)}function Cm(e){throw new Error("Unhandled case for value: '"+e+"'")}var Nm=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=n?n.split(r):[],o=e.split(r);t=o.shift();)-1===Sm(i,t)&&i.push(t);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=n?n.split(r):[],o=e.split(r);i.length&&(t=o.shift());){var s=Sm(i,t);-1!==s&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")},e}(),bm=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new Nm({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},n=this.createCssClass(e);return n&&(t.class=n),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var n=[t],r=e.getCssClassSuffixes(),i=0,o=r.length;i<o;i++)n.push(t+"-"+r[i]);return n.join(" ")}return""},e.prototype.processAnchorText=function(e){return this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var n=t.length,r=t.location;return"smart"===r?function(e,t,n){var r,i;null==n?(n="…",i=3,r=8):(i=n.length,r=n.length);var o=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},s=function(e,t){var r=t/2,i=Math.ceil(r),o=-1*Math.floor(r),s="";return o<0&&(s=e.substr(o)),e.substr(0,i)+n+s};if(e.length<=t)return e;var a=t-i,u=function(e){var t={},n=e,r=n.match(/^([a-z]+):\/\//i);return r&&(t.scheme=r[1],n=n.substr(r[0].length)),(r=n.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=r[1],n=n.substr(r[0].length)),(r=n.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=r[1],n=n.substr(r[0].length)),(r=n.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=r[1],n=n.substr(r[0].length)),(r=n.match(/^#(.*?)$/i))&&(t.fragment=r[1]),t}(e);if(u.query){var l=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);l&&(u.query=u.query.substr(0,l[1].length),e=o(u))}if(e.length<=t)return e;if(u.host&&(u.host=u.host.replace(/^www\./,""),e=o(u)),e.length<=t)return e;var c="";if(u.host&&(c+=u.host),c.length>=a)return u.host.length==t?(u.host.substr(0,t-i)+n).substr(0,a+r):s(c,a).substr(0,a+r);var d="";if(u.path&&(d+="/"+u.path),u.query&&(d+="?"+u.query),d){if((c+d).length>=a)return(c+d).length==t?(c+d).substr(0,t):(c+s(d,a-c.length)).substr(0,a+r);c+=d}if(u.fragment){var h="#"+u.fragment;if((c+h).length>=a)return(c+h).length==t?(c+h).substr(0,t):(c+s(h,a-c.length)).substr(0,a+r);c+=h}if(u.scheme&&u.host){var p=u.scheme+"://";if((c+p).length<a)return(p+c).substr(0,t)}if(c.length<=t)return c;var f="";return a>0&&(f=c.substr(-1*Math.floor(a/2))),(c.substr(0,Math.ceil(a/2))+n+f).substr(0,a+r)}(e,n):"middle"===r?function(e,t,n){if(e.length<=t)return e;var r,i;null==n?(n="…",r=8,i=3):(r=n.length,i=n.length);var o=t-i,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+r)}(e,n):function(e,t){return function(e,t,n){var r;return e.length>t&&(null==n?(n="…",r=3):r=n.length,e=e.substring(0,t-r)+n),e}(e,t,void 0)}(e,n)},e}(),Im=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),Rm=function(e,t){return Rm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Rm(e,t)};function wm(e,t){function n(){this.constructor=e}Rm(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var km,Lm=function(){return Lm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Lm.apply(this,arguments)},xm=function(e){function t(t){var n=e.call(this,t)||this;return n.email="",n.email=t.email,n}return wm(t,e),t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Im),Mm=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="",n.hashtag="",n.serviceName=t.serviceName,n.hashtag=t.hashtag,n}return wm(t,e),t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t}(Im),Fm=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.mention="",n.mention=t.mention,n.serviceName=t.serviceName,n}return wm(t,e),t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var t=e.prototype.getCssClassSuffixes.call(this),n=this.getServiceName();return n&&t.push(n),t},t}(Im),Bm=function(e){function t(t){var n=e.call(this,t)||this;return n.number="",n.plusSign=!1,n.number=t.number,n.plusSign=t.plusSign,n}return wm(t,e),t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Im),Pm=function(e){function t(t){var n=e.call(this,t)||this;return n.url="",n.urlMatchType="scheme",n.protocolUrlMatch=!1,n.protocolRelativeMatch=!1,n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.schemePrefixRegex=/^(https?:\/\/)?/i,n.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,n.protocolRelativeRegex=/^\/\//,n.protocolPrepended=!1,n.urlMatchType=t.urlMatchType,n.url=t.url,n.protocolUrlMatch=t.protocolUrlMatch,n.protocolRelativeMatch=t.protocolRelativeMatch,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return wm(t,e),t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},t.prototype.getAnchorHref=function(){return this.getUrl().replace(/&/g,"&")},t.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),this.decodePercentEncoding&&(e=this.removePercentEncoding(e)),e},t.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},t.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},t.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},t.prototype.removeTrailingSlash=function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e},t.prototype.removePercentEncoding=function(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch(e){return t}},t}(Im),Um=function(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder},Hm=/[A-Za-z]/,jm=/[\d]/,$m=/[\D]/,Ym=/\s/,zm=/['"]/,Vm=/[\x00-\x1F\x7F]/,Gm=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,Wm=Gm+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,Xm=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,Km=Wm+Xm,qm=Wm+Xm,Jm="(?:["+Xm+"]{1,3}\\.){3}["+Xm+"]{1,3}",Zm="["+qm+"](?:["+qm+"\\-]{0,61}["+qm+"])?",Qm=function(e){return"(?=("+Zm+"))\\"+e},eE=function(e){return"(?:"+Qm(e)+"(?:\\."+Qm(e+1)+"){0,126}|"+Jm+")"},tE=new RegExp("["+qm+"]"),nE=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|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|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|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|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,rE=new RegExp("["+qm+"!#$%&'*+/=?^_`{|}~-]"),iE=new RegExp("^"+nE.source+"$"),oE=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.localPartCharRegex=rE,t.strictTldRegex=iE,t}return wm(t,e),t.prototype.parseMatches=function(e){for(var t=this.tagBuilder,n=this.localPartCharRegex,r=this.strictTldRegex,i=[],o=e.length,s=new sE,a={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},u=0,l=0,c=s;u<o;){var d=e.charAt(u);switch(l){case 0:h(d);break;case 1:p(e.charAt(u-1),d);break;case 2:f(d);break;case 3:m(d);break;case 4:E(d);break;case 5:g(d);break;case 6:_(d);break;case 7:A(d);break;default:Cm(l)}u++}return O(),i;function h(e){"m"===e?D(1):n.test(e)&&D()}function p(e,t){":"===e?n.test(t)?(l=2,c=new sE(Lm(Lm({},c),{hasMailtoPrefix:!0}))):v():a[e]===t||(n.test(t)?l=2:"."===t?l=3:"@"===t?l=4:v())}function f(e){"."===e?l=3:"@"===e?l=4:n.test(e)||v()}function m(e){"."===e||"@"===e?v():n.test(e)?l=2:v()}function E(e){tE.test(e)?l=5:v()}function g(e){"."===e?l=7:"-"===e?l=6:tE.test(e)||O()}function _(e){"-"===e||"."===e?O():tE.test(e)?l=5:O()}function A(e){"."===e||"-"===e?O():tE.test(e)?(l=5,c=new sE(Lm(Lm({},c),{hasDomainDot:!0}))):O()}function D(e){void 0===e&&(e=2),l=e,c=new sE({idx:u})}function v(){l=0,c=s}function O(){if(c.hasDomainDot){var n=e.slice(c.idx,u);/[-.]$/.test(n)&&(n=n.slice(0,-1));var o=c.hasMailtoPrefix?n.slice(7):n;(function(e){var t=(e.split(".").pop()||"").toLowerCase();return r.test(t)})(o)&&i.push(new xm({tagBuilder:t,matchedText:n,offset:c.idx,email:o}))}v()}},t}(Um),sE=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot},aE=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},e.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},e.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),n=t&&t[0].toLowerCase();return"javascript:"!==n&&"vbscript:"!==n},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t||this.hasFullProtocolRegex.test(t)||this.hasWordCharAfterProtocolRegex.test(e))},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+Gm+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),uE=(km=new RegExp("[/?#](?:["+qm+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+qm+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,eE(2),")","|","(","(//)?",/(?:www\.)/.source,eE(6),")","|","(","(//)?",eE(10)+"\\.",nE.source,"(?![-"+Km+"])",")",")","(?::[0-9]+)?","(?:"+km.source+")?"].join(""),"gi")),lE=new RegExp("["+qm+"]"),cE=function(e){function t(t){var n=e.call(this,t)||this;return n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.matcherRegex=uE,n.wordCharRegExp=lE,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return wm(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.stripPrefix,i=this.stripTrailingSlash,o=this.decodePercentEncoding,s=this.tagBuilder,a=[],u=function(){var n=t[0],u=t[1],c=t[4],d=t[5],h=t[9],p=t.index,f=d||h,m=e.charAt(p-1);if(!aE.isValid(n,u))return"continue";if(p>0&&"@"===m)return"continue";if(p>0&&f&&l.wordCharRegExp.test(m))return"continue";if(/\?$/.test(n)&&(n=n.substr(0,n.length-1)),l.matchHasUnbalancedClosingParen(n))n=n.substr(0,n.length-1);else{var E=l.matchHasInvalidCharAfterTld(n,u);E>-1&&(n=n.substr(0,E))}var g=["http://","https://"].find((function(e){return!!u&&-1!==u.indexOf(e)}));if(g){var _=n.indexOf(g);n=n.substr(_),u=u.substr(_),p+=_}var A=u?"scheme":c?"www":"tld",D=!!u;a.push(new Pm({tagBuilder:s,matchedText:n,offset:p,urlMatchType:A,url:n,protocolUrlMatch:D,protocolRelativeMatch:!!f,stripPrefix:r,stripTrailingSlash:i,decodePercentEncoding:o}))},l=this;null!==(t=n.exec(e));)u();return a},t.prototype.matchHasUnbalancedClosingParen=function(e){var t,n=e.charAt(e.length-1);if(")"===n)t="(";else if("]"===n)t="[";else{if("}"!==n)return!1;t="{"}for(var r=0,i=0,o=e.length-1;i<o;i++){var s=e.charAt(i);s===t?r++:s===n&&(r=Math.max(r-1,0))}return 0===r},t.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var n=0;t&&(n=e.indexOf(":"),e=e.slice(n));var r=new RegExp("^((.?//)?[-."+qm+"]*[-"+qm+"]\\.[-"+qm+"]+)").exec(e);return null===r?-1:(n+=r[1].length,e=e.slice(r[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?n:-1)},t}(Um),dE=new RegExp("#[_"+qm+"]{1,139}(?![_"+qm+"])","g"),hE=new RegExp("[^"+qm+"]"),pE=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegex=dE,n.nonWordCharRegex=hE,n.serviceName=t.serviceName,n}return wm(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,i=this.serviceName,o=this.tagBuilder,s=[];null!==(t=n.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||r.test(u)){var l=t[0],c=t[0].slice(1);s.push(new Mm({tagBuilder:o,matchedText:l,offset:a,serviceName:i,hashtag:c}))}}return s},t}(Um),fE=new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source+"|"+/(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source,"g"),mE=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.matcherRegex=fE,t}return wm(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,i=[];null!==(t=n.exec(e));){var o=t[0],s=o.replace(/[^0-9,;#]/g,""),a=!(!t[1]&&!t[2]),u=0==t.index?"":e.substr(t.index-1,1),l=e.substr(t.index+o.length,1),c=!u.match(/\d/)&&!l.match(/\d/);this.testMatch(t[3])&&this.testMatch(o)&&c&&i.push(new Bm({tagBuilder:r,matchedText:o,offset:t.index,number:s,plusSign:a}))}return i},t.prototype.testMatch=function(e){return $m.test(e)},t}(Um),EE=new RegExp("@[_"+qm+"]{1,50}(?![_"+qm+"])","g"),gE=new RegExp("@[_."+qm+"]{1,30}(?![_"+qm+"])","g"),_E=new RegExp("@[-_."+qm+"]{1,50}(?![-_"+qm+"])","g"),AE=new RegExp("[^"+qm+"]"),DE=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegexes={twitter:EE,instagram:gE,soundcloud:_E},n.nonWordCharRegex=AE,n.serviceName=t.serviceName,n}return wm(t,e),t.prototype.parseMatches=function(e){var t,n=this.serviceName,r=this.matcherRegexes[this.serviceName],i=this.nonWordCharRegex,o=this.tagBuilder,s=[];if(!r)return s;for(;null!==(t=r.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||i.test(u)){var l=t[0].replace(/\.+$/g,""),c=l.slice(1);s.push(new Fm({tagBuilder:o,matchedText:l,offset:a,serviceName:n,mention:c}))}}return s},t}(Um);var vE=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing},OE=function(){function e(t){void 0===t&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(t.urls),this.email="boolean"==typeof t.email?t.email:this.email,this.phone="boolean"==typeof t.phone?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow="boolean"==typeof t.newWindow?t.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(t.stripPrefix),this.stripTrailingSlash="boolean"==typeof t.stripTrailingSlash?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding="boolean"==typeof t.decodePercentEncoding?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(!1!==n&&"twitter"!==n&&"instagram"!==n&&"soundcloud"!==n)throw new Error("invalid `mention` cfg - see docs");var r=this.hashtag;if(!1!==r&&"twitter"!==r&&"facebook"!==r&&"instagram"!==r)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){return new e(n).link(t)},e.parse=function(t,n){return new e(n).parse(t)},e.prototype.normalizeUrlsCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},e.prototype.normalizeStripPrefixCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},e.prototype.normalizeTruncateCfg=function(e){return"number"==typeof e?{length:e,location:"end"}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=t[n]);return e}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},e.prototype.parse=function(e){var t=this,n=["a","style","script"],r=0,i=[];return function(e,t){for(var n,r=t.onOpenTag,i=t.onCloseTag,o=t.onText,s=t.onComment,a=t.onDoctype,u=new vE,l=0,c=e.length,d=0,h=0,p=u;l<c;){var f=e.charAt(l);switch(d){case 0:m(f);break;case 1:E(f);break;case 2:_(f);break;case 3:g(f);break;case 4:A(f);break;case 5:D(f);break;case 6:v(f);break;case 7:O(f);break;case 8:T(f);break;case 9:S(f);break;case 10:y(f);break;case 11:C(f);break;case 12:N(f);break;case 13:b();break;case 14:I(f);break;case 15:R(f);break;case 16:w(f);break;case 17:k(f);break;case 18:L(f);break;case 19:x(f);break;case 20:M(f);break;default:Cm(d)}l++}function m(e){"<"===e&&B()}function E(e){"!"===e?d=13:"/"===e?(d=2,p=new vE(Lm(Lm({},p),{isClosing:!0}))):"<"===e?B():Hm.test(e)?(d=3,p=new vE(Lm(Lm({},p),{isOpening:!0}))):(d=0,p=u)}function g(e){Ym.test(e)?(p=new vE(Lm(Lm({},p),{name:U()})),d=4):"<"===e?B():"/"===e?(p=new vE(Lm(Lm({},p),{name:U()})),d=12):">"===e?(p=new vE(Lm(Lm({},p),{name:U()})),P()):Hm.test(e)||jm.test(e)||":"===e||F()}function _(e){">"===e?F():Hm.test(e)?d=3:F()}function A(e){Ym.test(e)||("/"===e?d=12:">"===e?P():"<"===e?B():"="===e||zm.test(e)||Vm.test(e)?F():d=5)}function D(e){Ym.test(e)?d=6:"/"===e?d=12:"="===e?d=7:">"===e?P():"<"===e?B():zm.test(e)&&F()}function v(e){Ym.test(e)||("/"===e?d=12:"="===e?d=7:">"===e?P():"<"===e?B():zm.test(e)?F():d=5)}function O(e){Ym.test(e)||('"'===e?d=8:"'"===e?d=9:/[>=`]/.test(e)?F():"<"===e?B():d=10)}function T(e){'"'===e&&(d=11)}function S(e){"'"===e&&(d=11)}function y(e){Ym.test(e)?d=4:">"===e?P():"<"===e&&B()}function C(e){Ym.test(e)?d=4:"/"===e?d=12:">"===e?P():"<"===e?B():(d=4,l--)}function N(e){">"===e?(p=new vE(Lm(Lm({},p),{isClosing:!0})),P()):d=4}function b(t){"--"===e.substr(l,2)?(l+=2,p=new vE(Lm(Lm({},p),{type:"comment"})),d=14):"DOCTYPE"===e.substr(l,7).toUpperCase()?(l+=7,p=new vE(Lm(Lm({},p),{type:"doctype"})),d=20):F()}function I(e){"-"===e?d=15:">"===e?F():d=16}function R(e){"-"===e?d=18:">"===e?F():d=16}function w(e){"-"===e&&(d=17)}function k(e){d="-"===e?18:16}function L(e){">"===e?P():"!"===e?d=19:"-"===e||(d=16)}function x(e){"-"===e?d=17:">"===e?P():d=16}function M(e){">"===e?P():"<"===e&&B()}function F(){d=0,p=u}function B(){d=1,p=new vE({idx:l})}function P(){var t=e.slice(h,p.idx);t&&o(t,h),"comment"===p.type?s(p.idx):"doctype"===p.type?a(p.idx):(p.isOpening&&r(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),F(),h=l+1}function U(){var t=p.idx+(p.isClosing?2:1);return e.slice(t,l).toLowerCase()}h<l&&(n=e.slice(h,l),o(n,h),h=l+1)}(e,{onOpenTag:function(e){n.indexOf(e)>=0&&r++},onText:function(e,n){if(0===r){var o=function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],i=0;n=t.exec(e);)r.push(e.substring(i,n.index)),r.push(n[0]),i=n.index+n[0].length;return r.push(e.substring(i)),r}(e,/( | |<|<|>|>|"|"|')/gi),s=n;o.forEach((function(e,n){if(n%2==0){var r=t.parseText(e,s);i.push.apply(i,r)}s+=e.length}))}},onCloseTag:function(e){n.indexOf(e)>=0&&(r=Math.max(r-1,0))},onComment:function(e){},onDoctype:function(e){}}),i=this.compactMatches(i),i=this.removeUnwantedMatches(i)},e.prototype.compactMatches=function(e){e.sort((function(e,t){return e.getOffset()-t.getOffset()}));for(var t=0;t<e.length-1;t++){var n=e[t],r=n.getOffset(),i=n.getMatchedText().length,o=r+i;if(t+1<e.length){if(e[t+1].getOffset()===r){var s=e[t+1].getMatchedText().length>i?t:t+1;e.splice(s,1);continue}e[t+1].getOffset()<o&&e.splice(t+1,1)}}return e},e.prototype.removeUnwantedMatches=function(e){return this.hashtag||ym(e,(function(e){return"hashtag"===e.getType()})),this.email||ym(e,(function(e){return"email"===e.getType()})),this.phone||ym(e,(function(e){return"phone"===e.getType()})),this.mention||ym(e,(function(e){return"mention"===e.getType()})),this.urls.schemeMatches||ym(e,(function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()})),this.urls.wwwMatches||ym(e,(function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()})),this.urls.tldMatches||ym(e,(function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()})),e},e.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var n=this.getMatchers(),r=[],i=0,o=n.length;i<o;i++){for(var s=n[i].parseMatches(e),a=0,u=s.length;a<u;a++)s[a].setOffset(t+s[a].getOffset());r.push.apply(r,s)}return r},e.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"<").replace(/>/g,">"));for(var t=this.parse(e),n=[],r=0,i=0,o=t.length;i<o;i++){var s=t[i];n.push(e.substring(r,s.getOffset())),n.push(this.createMatchReturnVal(s)),r=s.getOffset()+s.getMatchedText().length}return n.push(e.substring(r)),n.join("")},e.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof Nm?t.toAnchorString():e.buildTag().toAnchorString()},e.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new pE({tagBuilder:e,serviceName:this.hashtag}),new oE({tagBuilder:e}),new mE({tagBuilder:e}),new DE({tagBuilder:e,serviceName:this.mention}),new cE({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},e.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new bm({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},e.version="3.14.3",e.AnchorTagBuilder=bm,e.HtmlTag=Nm,e.matcher={Email:oE,Hashtag:pE,Matcher:Um,Mention:DE,Phone:mE,Url:cE},e.match={Email:xm,Hashtag:Mm,Match:Im,Mention:Fm,Phone:Bm,Url:Pm},e}();function TE(e,t=e){return{type:"autolink",url:e,text:t}}const SE=Em(/<!!mention:([^>\s]*?)\|(.*?)>/gm,(([e,t,n])=>function(e,t){return{type:"mention",id:e,text:t}}(decodeURIComponent(t),n))),yE=Em(/<!!customemoji:(.*?)>/gm,(([e,t])=>function(e){return{type:"customemoji",text:e}}(t))),CE=Em(/<((?:https?|mailto):.*?)\|(.*?)>/gi,(([e,t,n])=>function(e,t=[]){return{type:"link",url:e,children:t}}(t,[n]))),NE=Em(/<actionlink:([^|]+)[|]([^>]*)>/gi,(([e,t,n])=>{const{action:r,params:i}=IE(t);return function(e,t,n=[]){return{type:"actionlink",action:e,params:t,children:n}}(r,i,[n])})),bE=Em(/<actionbutton:([^|]+)[|]([^>]*)>/gi,(([e,t,n])=>{const{action:r,params:i}=IE(t);return function(e,t,n=[]){return{type:"actionbutton",action:e,params:t,children:n}}(r,i,[n])}));function IE(e){const t=e.indexOf("?");return-1===t?{action:e,params:{}}:{action:e.slice(0,t),params:Object.fromEntries(new URLSearchParams(e.slice(t)))}}const RE=Em(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g,(([e])=>function(e=[]){return{type:"bulletlist",children:e}}([e.startsWith("\n")?e.slice(1):e]))),wE=Em(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm,(([e,t])=>({type:"bulletpoint",children:[t]}))),kE=e=>{const t=/(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;let n=0;const r=[];for(const i of _o(e,t)){const t=i[0],o=i[1],s=t.startsWith(o)?i.index:i.index+1;s-n>0&&r.push(e.substring(n,s));const a=TE("tel:"+o.replace(/[^0-9+]/g,""),o);r.push(a),n=s+o.length}return n<e.length&&r.push(e.substring(n)),r},LE=e=>CE(e).flatMap((e=>"string"==typeof e?xE(e):["<",...xE(e.url),...xE("|"+e.children[0]+">")])),xE=e=>{const t=OE.parse(e,{urls:!0,email:!0,phone:!1,hashtag:!1,mention:!1}),n=[];let r=0;for(const i of t){const t=i.getOffset(),o=i.getMatchedText(),s=o.length;let a=o;i instanceof xm?a="mailto:"+i.getEmail():i instanceof Pm&&(a=i.getUrl()),t>r&&n.push(e.substring(r,t)),n.push(TE(a,o)),r=t+s}return r<e.length&&n.push(e.substring(r)),n},ME=["Codeblock","Codespan","FormattedLink","Wikitext","Autolink","Actions","Mention","Mention","BulletPoint","CustomEmoji"];const FE=function(){const e=RegExp("[^\n]+\n?|\n","g");return t=>Array.from(t.match(e)||[])}();function BE(e,t={except:[]}){let n=function(e,t){let n=[e];return n=PE(n,t.multilineSteps),n=PE(n,[FE]),n=PE(n,t.singlelineSteps),n=UE(n),n}(e,function(e={except:[]}){const t={multilineSteps:[],singlelineSteps:[]},n=e.except??ME.filter((t=>!e.only.includes(t)));return n.includes("BulletPoint")||t.multilineSteps.push(RE,wE),n.includes("Mention")||t.singlelineSteps.push(SE),n.includes("CustomEmoji")||t.singlelineSteps.push(yE),n.includes("Codespan")||t.multilineSteps.push(Em(/```([^]+?)```/g,(([e,t])=>({type:"codespan",text:t})))),n.includes("FormattedLink")||t.singlelineSteps.push(CE),n.includes("Actions")||(t.singlelineSteps.push(NE),t.singlelineSteps.push(bE)),n.includes("Wikitext")||t.singlelineSteps.push(vm),n.includes("Autolink")||t.singlelineSteps.push(LE,kE),t}(t));return n=HE(n,!1),n}function PE(e,t){return t.reduce(((e,t)=>mm(e,t)),e)}function UE(e){const t=[];let n=-1;for(const r of e)"string"==typeof r?"string"==typeof t[n]?t[n]+=r:t[++n]=r:t[++n]="children"in r?{...r,children:UE(r.children)}:r;return t}function HE(e,t){const n=[];let r=[];for(let i=0;i<e.length;i++){const o=e[i];"string"==typeof o?r.push(o):"children"in o?(r.length>0&&(n.push(r.join("")),r=[]),o.children=HE(o.children,t||"link"===o.type||"actionbutton"===o.type||"actionlink"===o.type),n.push(o)):"autolink"===o.type&&t?r.push(o.text):(r.length>0&&(n.push(r.join("")),r=[]),n.push(o))}return r.length>0&&(n.push(r.join("")),r=[]),n}function jE(e,t,n,r=0,i=[]){for(const o of n)if("string"==typeof o){for(const n of i)e.addMark(t+r,t+r+o.length,n.create());r+=o.length}else if("bold"===o.type||"italic"===o.type||"strikethrough"===o.type){r+=1;const n=vp.marks[o.type],s=[...i,n];[e,r]=jE(e,t,o.children,r,s),r+=1}else ii.unreachable();return[e,r]}function $E(e){return(t,n)=>{if(!n)return!0;let r=t.tr;const i=Kl.between(t.selection.$from,t.selection.$to);return r=r.replaceRangeWith(i.from,i.from,vp.text(e,r.storedMarks)),r=r.replaceRangeWith(i.to+1,i.to+1,vp.text(e,r.storedMarks)),r=r.setSelection(Kl.near(r.doc.resolve(i.to+1))),n(r),!0}}function YE({placeholder:e,disabled:t,className:n="",characterLimit:r,spellcheck:i}){const o=ui(),s=le(),a=le(null);return ae((()=>(s.current=function(e,t,n,r){const i=uc.create({schema:vp,plugins:[...[].filter(VE),Af(),Pp({...pm,"Mod-z":vf,"Mod-y":Of,"Mod-b":$E("*"),"Mod-i":$E("_"),"Mod-Enter":pm.Enter,"Shift-Enter":pm.Enter,Enter:n}),Pp({Enter:pm.Enter}),Tp]}),o=function(){let e,t=0;return n=>{const r=(r=Date.now())=>{window.clearTimeout(e),e=void 0,t=r;const i=function(e){(e=(e=(e=e.removeMark(0,e.doc.content.size,vp.marks.bold)).removeMark(0,e.doc.content.size,vp.marks.italic)).removeMark(0,e.doc.content.size,vp.marks.strikethrough)).doc.firstChild;const t=function(e){const t=[];let n,r="";return e.descendants(((e,i)=>(e.isText?(r+=e.text,n??=i):r&&void 0!==n&&(t.push({text:r,pos:n}),r="",n=void 0),e.type!==vp.nodes.mention))),r&&void 0!==n&&t.push({text:r,pos:n}),t}(e.doc);for(const{text:n,pos:r}of t){const t=BE(n,{only:["Wikitext"]});[e]=jE(e,r,t)}return e}(n.state.tr);n.dispatch(i)},i=Date.now();i-t<300?e||(e=window.setTimeout(r,300)):r(i)}}(),s=new mp(e,{handlePaste:(e,t,n)=>function(e,t,n){const r=t.clipboardData;if(!r)return!1;const i=function(e){const t=e.items||[],n={"image/gif":"gif","image/png":"png","image/jpeg":"jpg","image/svg+xml":"svg"},r=Array.from(t).filter((e=>"file"===e.kind&&n[e.type]));if(0===r.length)return;if(e.types.includes("text/rtf"))return;const i=r[0];let o=i.getAsFile();if(!o.name){const e="image."+n[i.type];o=new File([o],e,{type:i.type,lastModified:Date.now()})}return o}(r);return i?n(i):function(e,t){const n=e.state.tr.insertText(t).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");e.dispatch(n)}(e,r.getData("text/plain")),!0}(e,t,r),clipboardTextSerializer(e){const t=[];return e.content.forEach((e=>{e&&t.push(e.textContent.replace(/<!!mention:.*?\|([^>]*)>/gim,"@$1"))})),t.join()},state:i,dispatchTransaction(e){e=(e=e.removeStoredMark(vp.marks.literal)).removeStoredMark(vp.marks.emoji);const n=s.state.apply(e);s.state.doc.eq(n.doc)||t(new zE(n.doc)),s.updateState(n),e.steps.some((e=>e instanceof Ff))&&setTimeout((()=>o(s)),0)}});return s}(a.current,(e=>o.onChange(e)),(()=>!!o.onEnter&&(o.onEnter(),!0)),(e=>o.onPasteImage(e))),o.editorView=s.current,()=>{o.editorView=void 0,s.current?.destroy()})),[o]),ae((()=>{s.current?.setProps({editable:()=>!t})}),[t]),ae((()=>Xn((()=>s.current?.setProps({attributes:{spellcheck:String(o.spellcheck$.get()??i??!1),class:"t-text-input","aria-label":"Message Field",role:"textbox"}})))),[o,i]),ae((()=>Xn((()=>{const t=s.current;t?.dispatch(t.state.tr.setMeta(Tp,o.placeholder$.get()??e))}))),[o,e]),ae((()=>{r&&Number.isInteger(r)&&o.setMaxLength(r)}),[r,o]),bt("div",{className:`t-editor ${n}`,ref:a})}class zE{constructor(e){this.doc=e,this.size=this.doc.content.size,this.hasContent=Sp(this.doc)}static{this.EMPTY=new zE(vp.topNodeType.create())}asText(){return this.doc.textContent.replace(/\xa0/g," ")}}function VE(e){return null!=e}function GE(e,t){e()||t||(t=e.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/,"`$1`")+" was not true")}(e=>{function t(e,t){(function(e,t){switch(t){case"undefined":return void 0===e;case String:return"string"==typeof e||e instanceof String;case Boolean:return"boolean"==typeof e||e instanceof Boolean;case Number:return"number"==typeof e||e instanceof Number;default:return e instanceof t}})(e,t)||(t.name,String(e))}e.defined=function(e){},e.has=function(e,t){e[t]},e.is=t,e.equals=function(e,t){},e.oneOf=function(e,t){t.includes(e)||JSON.stringify(t)},e.isArray=function(e,n){t(e,Array),e&&e.length>0&&t(e[0],n)},e.optional=function(e,n){void 0!==e&&t(e,n)},e.falsy=function(e){},e.never=function(e){}})(GE||(GE={}));const WE=GE,XE=/^\/.*[^\\]\/[im]*$/;function KE(e){return!!XE.test(e)&&!qE(e).test("")}function qE(e){const t=e.match(/^\/(.*[^\\])\/(.*)$/);if(!t)throw new Error(`Expected ${e} to be a (non-empty) regex`);let n=t[2]||"";return n=n.replace(/[^im]/g,"")+"g",new RegExp(t[1],n)}function JE(e){const t=e.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp("^"+t+"$","i")}function ZE(e,t){const n=Do(t),r=JE(e);return void 0!==n&&r.test(n)}const QE=/^[]/g;function eg(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}class tg{constructor({mode:e,allowedHostnames:t,allowedPhoneNrs:n,allowedMatches:r,forbiddenMatches:i,suppressLinks:o,suppressEmailAddresses:s,suppressPhoneNumbers:a,replacement:u}){WE.oneOf(e,["all","otherOnly","off"]),this.mode=e,this.suppressLinks=!1!==o,this.suppressEmailAddresses=!1!==s,this.suppressPhoneNumbers=!1!==a,this.allowedHostnames=t||[],this.allowedPhoneNrs=(n||[]).filter((e=>e)).map((e=>e.replace(/[^0-9]/g,""))),this.allowedMatches=(r||[]).filter(KE).map((e=>qE(e))),this.forbiddenMatches=(i||[]).filter(KE).map((e=>qE(e))),WE((()=>this.allowedMatches.every((e=>e.flags.includes("g")))),"All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"),WE((()=>this.forbiddenMatches.every((e=>e.flags.includes("g")))),"All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"),u=u?.trim(),this.replacement=u&&u.length>0?u:void 0}shouldSuppress({isContentBySender:e}){return"all"===this.mode||"otherOnly"===this.mode&&!e}}const ng=new RegExp(":arslan:|"+/[#*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\uDC70\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-\uDED7\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\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\uDD3D\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-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\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]|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\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.source,"g"),rg=/\uFE0F/g,ig=String.fromCharCode(8205);function og(e){if(":arslan:"===e)return"https://cdn.talkjs.com/__assets/5461191341cea882b3f227c085d5772c.gif";const t=function(e){const t=[];let n=0,r=0,i=0;for(;i<e.length;)n=e.charCodeAt(i++),r?(t.push((65536+(r-55296<<10)+(n-56320)).toString(16)),r=0):55296<=n&&n<=56319?r=n:t.push(n.toString(16));return t.join("-")}((n=e).indexOf(ig)<0?n.replace(rg,""):n);var n;return`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/${t}.svg`}function sg(e){let t="";return e.t&&(t=`(${e.t("CONTACT_INFORMATION_HIDDEN")})`),{formattedLinks:e.formattedLinks??"plaintext",markup:e.markup??!1,useFallbackMentions:e.useFallbackMentions??!1,sameTabLinkRules:e.sameTabLinkRules??[],enableEmojiImageFallback:e.enableEmojiImageFallback??!1,highlight:e.highlight??[],contactInfo:e.contactInfo??!1,suppression:e.suppression??new tg({mode:"off"}),contactInfoHiddenText:e.contactInfoHiddenText??e.suppression?.replacement??t,customEmojiUrls:e.customEmojiUrls??{}}}function ag(e,t){return ug(e,sg(t))}function ug(e,t){return e.flatMap((e=>{if("string"==typeof e){let n=[e];return n=lg(n,(e=>function(e,t){const{suppression:{forbiddenMatches:n,allowedMatches:r}}=t,i=fm(n,(t=>_o(e,t))).filter((([e])=>!r.some((t=>null!==e.match(t))))).map((e=>({offset:e.index,matchedText:e[0]})));return Ao(e,i,(()=>[{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"}]))}(e,t))),n=lg(n,(e=>function(e){return Ao(e,function(e){const t=[];let n;for(;n=ng.exec(e);){const e=n[0],r=n.index;t.push({offset:r,matchedText:e})}return t}(e),(e=>[{type:"emoji",text:e.matchedText}]))}(e))),n}switch(e.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return{type:e.type,children:ug(e.children,t)};case"codespan":case"codeSpan":case"codeblock":case"codeBlock":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return e;case"mention":return{type:"mention",id:e.id,text:e.text};case"autolink":case"autoLink":return function(e,t){return"link"===t.contactInfo?e:"suppress"===t.contactInfo?function(e,t){if(t.allowedMatches.some((t=>null!==e.match(t))))return!0;if(t.forbiddenMatches.some((t=>null!==e.match(t))))return!1;if(e.startsWith("mailto:")){const n=e.substring(7).replace(/^.*@/,"");return!t.suppressEmailAddresses||cg(t.allowedHostnames,n)}if(e.startsWith("tel:")){const n=e.substring(4).replace(/[^0-9]/g,"");return!t.suppressPhoneNumbers||t.allowedPhoneNrs.some((e=>n.endsWith(e)))}return!t.suppressLinks||cg(t.allowedHostnames,Do(e))}(e.url,t.suppression)?e:{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"}:e.text}(e,t);case"link":return{type:"link",url:e.url,children:ug(e.children,t)};case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return{type:e.type,action:e.action,params:e.params,children:ug(e.children,t)}}}))}function lg(e,t){return fm(e,(e=>"string"==typeof e?t(e):[e]))}function cg(e,t){for(const n of e)if(JE(n).test(t))return!0;return!1}const dg=()=>{const e=document.createElement("canvas");e.width=e.height=1;const t=e.getContext("2d");return t.textBaseline="top",t.font='100px "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Twemoji Mozilla","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',t.scale(.01,.01),t},hg=(e,t)=>{const n=dg();return n.fillStyle=t,n.fillText(e,0,0),n.getImageData(0,0,1,1).data};function pg(e,t){return e.flatMap((e=>{if("string"==typeof e)return fg(e,t.highlight);switch(e.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletpoint":case"bulletPoint":return mg(e,t);case"bulletlist":case"bulletList":return[yt.createElement("ul",null,...pg(e.children,t))];case"autolink":case"autoLink":return Eg(e,t);case"link":return _g(e,t);case"codeblock":case"codeBlock":return[bt("code",{"data-language":e.language,children:fg(e.text,t.highlight)})];case"codespan":case"codeSpan":return bt("code",{children:fg((n=e.text,n.replace(/^\s*\n/m,"").replace(/\n\s*$/m,"")),t.highlight)});case"mention":return t.useFallbackMentions?bt("span",{className:"mention",children:["@",e.text]}):bt("div",{"data-name":"mention","data-text":e.text});case"suppressed":return[bt("i",{children:t.contactInfoHiddenText})];case"emoji":return t.enableEmojiImageFallback?[bt(gg,{unicode:e.text})]:[e.text];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return Ag(e,t);case"customemoji":case"customEmoji":return e.text;default:WE.never(e)}var n}))}function fg(e,t){if(0===t.length)return[e];const n=function(e){const t=e.map((e=>e.trim())).filter((e=>e));if(0===t.length)return QE;const n=t.map(eg).join("|");return new RegExp(n,"gi")}(t);return Ao(e,_o(e,n).map((e=>({offset:e.index,matchedText:e[0]}))),(({matchedText:e})=>[bt("span",{className:"highlighted-text",children:e})]))}const mg=(e,t)=>{const n={bold:"strong",italic:"em",strikethrough:"del",blockquote:"blockquote",bulletpoint:"li",bulletPoint:"li"}[e.type];return[yt.createElement(n,null,...pg(e.children,t))]},Eg=(e,t)=>[bt("a",{target:Dg(t.sameTabLinkRules,e.url),href:e.url,rel:"noreferrer",children:e.text})];function gg({unicode:e}){const[t,n]=oe((()=>":arslan:"!==e));return ae((()=>{t&&!function(e){try{return function(e){const t=hg(e,"#000"),n=hg(e,"#fff"),r=(e=>!e.includes("")||dg().measureText(e).width<160)(e);return t&&n&&r&&((e,t)=>{const n=[...e].join(",");return n===[...t].join(",")&&!n.startsWith("0,0,0,")})(t,n)}(e)}catch(e){return!0}}(e)&&n(!1)}),[]),t?bt("span",{className:"t-emoji",children:e}):bt("img",{className:"t-emoji",src:og(e),alt:e})}const _g=(e,t)=>{switch(t.formattedLinks){case"link":return[A("a",{target:Dg(t.sameTabLinkRules,e.url),href:e.url},...pg(e.children,t))];case"plaintext":case!1:return[yt.createElement("span",null,...pg(e.children,t))];default:WE.never(t.formattedLinks)}},Ag=(e,t)=>[A("button",{"data-type":e.type,"data-action":e.action,"data-params":JSON.stringify(e.params),disabled:!0},...pg(e.children,t))];function Dg(e,t){for(const n of e)if(XE.test(n)){if(qE(n).test(t))return"_top"}else if(ZE(n,t))return"_top";return"_blank"}function vg({block:e,className:t=""}){const n=function(e,t={}){return pg(e,sg(t))}(ag(e.children,{contactInfo:"link"}),{enableEmojiImageFallback:!0});return A("span",{className:`t-text ${t}`},...n)}function Og(e){const t=si(),n=ci(),{className:r="",...i}=e,o=Yr((()=>n.state$.messages.child(n.state$.extCurrentConversationId.get()).lookup.child(e.message.id).content.child(0).url.get()));return bt("div",{className:`t-message-content ${r}`,children:e.message.content.map((n=>bt(Tg,{block:n,theme:t,downloadUrl:o,...i},e.message.createdAt+(e.message.editedAt??0))))})}function Tg({block:e,currentUser:t,message:n,t:r,theme:i,themeCustom:o,downloadUrl:s}){const a=function(e,t){switch(t.type){case"text":return e.TextBlock;case"location":return e.LocationBlock;case"file":switch(t.subtype){case"image":return e.ImageBlock;case"video":return e.VideoBlock;case"voice":return e.VoiceBlock;case"audio":return e.AudioBlock;default:return e.FileBlock}default:ii.never(t)}}(i,e);return bt(a,{block:e,t:r,currentUser:t,message:n,themeCustom:o,downloadUrl:s})}function Sg(e,t=!0){const n=he((t=>{27===t.keyCode&&e()}),[e]);ae((()=>{if(t)return window.addEventListener("keydown",n,!0),()=>window.removeEventListener("keydown",n,!0)}),[t,n])}const yg=function(e){let t;return()=>(void 0===t&&(t={value:e()}),t.value)}((async function(){if("undefined"==typeof window||void 0===window.document)return new Promise((()=>{}));try{const e=new((await import("https://cdn.jsdelivr.net/npm/emoji-picker-element@1.26.3/+esm")).Database);await e.ready()}catch(e){fi.error("Failed to load emoji picker:",e)}}));function Cg(e){const t=ui(),n=yt.useRef(null),r=function(e){const[t,n]=oe();return ae((()=>{let t=!0;return e().then((e=>{t&&n({value:e})})),()=>{t=!1}}),[e]),t}(yg);return yt.useEffect((()=>{if(!r)return;ii.defined(n.current);const e=n.current,i=e.shadowRoot;!function(e){const t=document.createElement("style");t.textContent=".search-row{margin-right:var(--emoji-padding)}.emoji-menu{padding:var(--emoji-padding)}.emoji,button.emoji{border-radius:8px}.favorites{border-top-width:1px}input.search:focus{border-color:var(--input-focused-border-color);outline:0}.picker{container-type:size}@container (height < 300px){.favorites{display:none}}#skintone-button{margin:0 -3px 0 4px}.custom-emoji{padding:0}#emo-🏻,#emo-🏼,#emo-🏽,#emo-🏾,#emo-🏿{display:none}[data-has-mouse] .emoji:hover{background-color:var(--button-hover-background)}",e.appendChild(t)}(i);const o=e=>{const n=e.detail.unicode??e.detail.name;t.insertEmoji(n)};function s(e){"mouse"===e.pointerType&&(i.querySelector("section").dataset.hasMouse="true")}return e.addEventListener("emoji-click",o),e.addEventListener("pointermove",s,{once:!0}),()=>{e.removeEventListener("emoji-click",o),e.removeEventListener("pointermove",s)}}),[r,t]),yt.useEffect((()=>{r&&n.current&&n.current.shadowRoot.getElementById("search")?.focus()}),[r]),Sg((()=>t.toggleEmojiPicker(!1))),bt("div",r?{className:"t-emoji-picker",children:bt("emoji-picker",{ref:n,class:e.colorScheme})}:{className:"t-emoji-picker","t-loading":"",children:bt(io,{})})}function Ng(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function bg(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Ig(...e){return t=>{let n=!1;const r=e.map((e=>{const r=bg(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():bg(e[t],null)}}}}function Rg(...e){return he(Ig(...e),e)}function wg(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>z(e)));return function(n){const r=n?.[e]||t;return de((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const i=z(r),o=n.length;n=[...n,r];const s=t=>{const{scope:n,children:r,...s}=t,a=n?.[e]?.[o]||i,u=de((()=>s),Object.values(s));return bt(a.Provider,{value:u,children:r})};return s.displayName=t+"Provider",[s,function(n,s){const a=pe(s?.[e]?.[o]||i);if(a)return a;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},kg(r,...t)]}function kg(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return de((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}var Lg=globalThis?.document?ue:()=>{},xg=Ct[" useInsertionEffect ".trim().toString()]||Lg;function Mg({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=function({defaultProp:e,onChange:t}){const[n,r]=oe(e),i=le(n),o=le(t);return xg((()=>{o.current=t}),[t]),ae((()=>{i.current!==n&&(o.current?.(n),i.current=n)}),[n,i]),[n,r,o]}({defaultProp:t,onChange:n}),a=void 0!==e,u=a?e:i;{const t=le(void 0!==e);ae((()=>{const e=t.current;if(e!==a){const t=e?"controlled":"uncontrolled",n=a?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=a}),[a,r])}const l=he((t=>{if(a){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)}),[a,e,o,s]);return[u,l]}function Fg(e){const t=function(e){const t=Me(((e,t)=>{const{children:n,...r}=e;if(mt(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(n),i=function(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{const t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==O&&(i.ref=t?Ig(t,e):e),_t(n,i)}return Be.count(n)>1?Be.only(null):null}));return t.displayName=`${e}.SlotClone`,t}(e),n=Me(((e,n)=>{const{children:r,...i}=e,o=Be.toArray(r),s=o.find(Pg);if(s){const e=s.props.children,r=o.map((t=>t===s?Be.count(e)>1?Be.only(null):mt(e)?e.props.children:null:t));return bt(t,{...i,ref:n,children:mt(e)?_t(e,void 0,r):null})}return bt(t,{...i,ref:n,children:r})}));return n.displayName=`${e}.Slot`,n}var Bg=Symbol("radix.slottable");function Pg(e){return mt(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Bg}var Ug=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce(((e,t)=>{const n=Fg(`Primitive.${t}`),r=Me(((e,r)=>{const{asChild:i,...o}=e,s=i?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),bt(s,{...o,ref:r})}));return r.displayName=`Primitive.${t}`,{...e,[t]:r}}),{});function Hg(e,t){e&&Ot((()=>e.dispatchEvent(t)))}function jg(e){const t=e+"CollectionProvider",[n,r]=wg(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:t,children:n}=e,r=yt.useRef(null),o=yt.useRef(new Map).current;return bt(i,{scope:t,itemMap:o,collectionRef:r,children:n})};s.displayName=t;const a=e+"CollectionSlot",u=Fg(a),l=yt.forwardRef(((e,t)=>{const{scope:n,children:r}=e,i=Rg(t,o(a,n).collectionRef);return bt(u,{ref:i,children:r})}));l.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",h=Fg(c),p=yt.forwardRef(((e,t)=>{const{scope:n,children:r,...i}=e,s=yt.useRef(null),a=Rg(t,s),u=o(c,n);return yt.useEffect((()=>(u.itemMap.set(s,{ref:s,...i}),()=>{u.itemMap.delete(s)}))),bt(h,{[d]:"",ref:a,children:r})}));return p.displayName=c,[{Provider:s,Slot:l,ItemSlot:p},function(t){const n=o(e+"CollectionConsumer",t),r=yt.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${d}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}var $g=z(void 0);function Yg(e){const t=pe($g);return e||t||"ltr"}function zg(e){const t=le(e);return ae((()=>{t.current=e})),de((()=>(...e)=>t.current?.(...e)),[])}var Vg,Gg="dismissableLayer.update",Wg=z({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xg=Me(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...u}=e,l=pe(Wg),[c,d]=oe(null),h=c?.ownerDocument??globalThis?.document,[,p]=oe({}),f=Rg(t,(e=>d(e))),m=Array.from(l.layers),[E]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(E),_=c?m.indexOf(c):-1,A=l.layersWithOutsidePointerEventsDisabled.size>0,D=_>=g,v=function(e,t=globalThis?.document){const n=zg(e),r=le(!1),i=le((()=>{}));return ae((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Jg("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=r,t.addEventListener("click",i.current,{once:!0})):r()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...l.branches].some((e=>e.contains(t)));D&&!n&&(i?.(e),s?.(e),e.defaultPrevented||a?.())}),h),O=function(e,t=globalThis?.document){const n=zg(e),r=le(!1);return ae((()=>{const e=e=>{e.target&&!r.current&&Jg("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...l.branches].some((e=>e.contains(t)))||(o?.(e),s?.(e),e.defaultPrevented||a?.())}),h);return function(e,t=globalThis?.document){const n=zg(e);ae((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{_===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&a&&(e.preventDefault(),a()))}),h),ae((()=>{if(c)return n&&(0===l.layersWithOutsidePointerEventsDisabled.size&&(Vg=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),qg(),()=>{n&&1===l.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Vg)}}),[c,h,n,l]),ae((()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),qg())}),[c,l]),ae((()=>{const e=()=>p({});return document.addEventListener(Gg,e),()=>document.removeEventListener(Gg,e)}),[]),bt(Ug.div,{...u,ref:f,style:{pointerEvents:A?D?"auto":"none":void 0,...e.style},onFocusCapture:Ng(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ng(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ng(e.onPointerDownCapture,v.onPointerDownCapture)})}));Xg.displayName="DismissableLayer";var Kg=Me(((e,t)=>{const n=pe(Wg),r=le(null),i=Rg(t,r);return ae((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),bt(Ug.div,{...e,ref:i})}));function qg(){const e=new CustomEvent(Gg);document.dispatchEvent(e)}function Jg(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Hg(i,o):i.dispatchEvent(o)}Kg.displayName="DismissableLayerBranch";var Zg=0;function Qg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var e_="focusScope.autoFocusOnMount",t_="focusScope.autoFocusOnUnmount",n_={bubbles:!1,cancelable:!0},r_=Me(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,u]=oe(null),l=zg(i),c=zg(o),d=le(null),h=Rg(t,(e=>u(e))),p=le({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;ae((()=>{if(r){let e=function(e){if(p.paused||!a)return;const t=e.target;a.contains(t)?d.current=t:a_(d.current,{select:!0})},t=function(e){if(p.paused||!a)return;const t=e.relatedTarget;null!==t&&(a.contains(t)||a_(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&a_(a)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return a&&r.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,a,p.paused]),ae((()=>{if(a){u_.add(p);const e=document.activeElement;if(!a.contains(e)){const t=new CustomEvent(e_,n_);a.addEventListener(e_,l),a.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(a_(r,{select:t}),document.activeElement!==n)return}(i_(a).filter((e=>"A"!==e.tagName)),{select:!0}),document.activeElement===e&&a_(a))}return()=>{a.removeEventListener(e_,l),setTimeout((()=>{const t=new CustomEvent(t_,n_);a.addEventListener(t_,c),a.dispatchEvent(t),t.defaultPrevented||a_(e??document.body,{select:!0}),a.removeEventListener(t_,c),u_.remove(p)}),0)}}}),[a,l,c,p]);const f=he((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){const t=e.currentTarget,[r,o]=function(e){const t=i_(e);return[o_(t,e),o_(t.reverse(),e)]}(t);r&&o?e.shiftKey||i!==o?e.shiftKey&&i===r&&(e.preventDefault(),n&&a_(o,{select:!0})):(e.preventDefault(),n&&a_(r,{select:!0})):i===t&&e.preventDefault()}}),[n,r,p.paused]);return bt(Ug.div,{tabIndex:-1,...s,ref:h,onKeyDown:f})}));function i_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function o_(e,t){for(const n of e)if(!s_(n,{upTo:t}))return n}function s_(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function a_(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}r_.displayName="FocusScope";var u_=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=l_(e,t),e.unshift(t)},remove(t){e=l_(e,t),e[0]?.resume()}}}();function l_(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var c_=Ct[" useId ".trim().toString()]||(()=>{}),d_=0;function h_(e){const[t,n]=oe(c_());return Lg((()=>{e||n((e=>e??String(d_++)))}),[e]),e||(t?`radix-${t}`:"")}const p_=["top","right","bottom","left"],f_=Math.min,m_=Math.max,E_=Math.round,g_=Math.floor,__=e=>({x:e,y:e}),A_={left:"right",right:"left",bottom:"top",top:"bottom"},D_={start:"end",end:"start"};function v_(e,t,n){return m_(e,f_(t,n))}function O_(e,t){return"function"==typeof e?e(t):e}function T_(e){return e.split("-")[0]}function S_(e){return e.split("-")[1]}function y_(e){return"x"===e?"y":"x"}function C_(e){return"y"===e?"height":"width"}function N_(e){return["top","bottom"].includes(T_(e))?"y":"x"}function b_(e){return y_(N_(e))}function I_(e){return e.replace(/start|end/g,(e=>D_[e]))}function R_(e){return e.replace(/left|right|bottom|top/g,(e=>A_[e]))}function w_(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function k_(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function L_(e,t,n){let{reference:r,floating:i}=e;const o=N_(t),s=b_(t),a=C_(s),u=T_(t),l="y"===o,c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(u){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(S_(t)){case"start":p[s]-=h*(n&&l?-1:1);break;case"end":p[s]+=h*(n&&l?-1:1)}return p}async function x_(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=O_(t,e),f=w_(p),m=a[h?"floating"===d?"reference":"floating":d],E=k_(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:c,strategy:u})),g="floating"===d?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,_=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),A=await(null==o.isElement?void 0:o.isElement(_))&&await(null==o.getScale?void 0:o.getScale(_))||{x:1,y:1},D=k_(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:_,strategy:u}):g);return{top:(E.top-D.top+f.top)/A.y,bottom:(D.bottom-E.bottom+f.bottom)/A.y,left:(E.left-D.left+f.left)/A.x,right:(D.right-E.right+f.right)/A.x}}function M_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function F_(e){return p_.some((t=>e[t]>=0))}function B_(){return"undefined"!=typeof window}function P_(e){return j_(e)?(e.nodeName||"").toLowerCase():"#document"}function U_(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function H_(e){var t;return null==(t=(j_(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function j_(e){return!!B_()&&(e instanceof Node||e instanceof U_(e).Node)}function $_(e){return!!B_()&&(e instanceof Element||e instanceof U_(e).Element)}function Y_(e){return!!B_()&&(e instanceof HTMLElement||e instanceof U_(e).HTMLElement)}function z_(e){return!(!B_()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof U_(e).ShadowRoot)}function V_(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=J_(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function G_(e){return["table","td","th"].includes(P_(e))}function W_(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function X_(e){const t=K_(),n=$_(e)?J_(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function K_(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function q_(e){return["html","body","#document"].includes(P_(e))}function J_(e){return U_(e).getComputedStyle(e)}function Z_(e){return $_(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Q_(e){if("html"===P_(e))return e;const t=e.assignedSlot||e.parentNode||z_(e)&&e.host||H_(e);return z_(t)?t.host:t}function eA(e){const t=Q_(e);return q_(t)?e.ownerDocument?e.ownerDocument.body:e.body:Y_(t)&&V_(t)?t:eA(t)}function tA(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=eA(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),s=U_(i);if(o){const e=nA(s);return t.concat(s,s.visualViewport||[],V_(i)?i:[],e&&n?tA(e):[])}return t.concat(i,tA(i,[],n))}function nA(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rA(e){const t=J_(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Y_(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=E_(n)!==o||E_(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function iA(e){return $_(e)?e:e.contextElement}function oA(e){const t=iA(e);if(!Y_(t))return __(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=rA(t);let s=(o?E_(n.width):n.width)/r,a=(o?E_(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const sA=__(0);function aA(e){const t=U_(e);return K_()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:sA}function uA(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),o=iA(e);let s=__(1);t&&(r?$_(r)&&(s=oA(r)):s=oA(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==U_(e))&&t}(o,n,r)?aA(o):__(0);let u=(i.left+a.x)/s.x,l=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const e=U_(o),t=r&&$_(r)?U_(r):r;let n=e,i=nA(n);for(;i&&r&&t!==n;){const e=oA(i),t=i.getBoundingClientRect(),r=J_(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,l*=e.y,c*=e.x,d*=e.y,u+=o,l+=s,n=U_(i),i=nA(n)}}return k_({width:c,height:d,x:u,y:l})}function lA(e,t){const n=Z_(e).scrollLeft;return t?t.left+n:uA(H_(e)).left+n}function cA(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:lA(e,r)),y:r.top+t.scrollTop}}function dA(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=U_(e),r=H_(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,u=0;if(i){o=i.width,s=i.height;const e=K_();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:a,y:u}}(e,n);else if("document"===t)r=function(e){const t=H_(e),n=Z_(e),r=e.ownerDocument.body,i=m_(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=m_(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+lA(e);const a=-n.scrollTop;return"rtl"===J_(r).direction&&(s+=m_(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}(H_(e));else if($_(t))r=function(e,t){const n=uA(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Y_(e)?oA(e):__(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n=aA(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return k_(r)}function hA(e,t){const n=Q_(e);return!(n===t||!$_(n)||q_(n))&&("fixed"===J_(n).position||hA(n,t))}function pA(e,t,n){const r=Y_(t),i=H_(t),o="fixed"===n,s=uA(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const u=__(0);function l(){u.x=lA(i)}if(r||!r&&!o)if(("body"!==P_(t)||V_(i))&&(a=Z_(t)),r){const e=uA(t,!0,o,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else i&&l();o&&!r&&i&&l();const c=!i||r||o?__(0):cA(i,a);return{x:s.left+a.scrollLeft-u.x-c.x,y:s.top+a.scrollTop-u.y-c.y,width:s.width,height:s.height}}function fA(e){return"static"===J_(e).position}function mA(e,t){if(!Y_(e)||"fixed"===J_(e).position)return null;if(t)return t(e);let n=e.offsetParent;return H_(e)===n&&(n=n.ownerDocument.body),n}function EA(e,t){const n=U_(e);if(W_(e))return n;if(!Y_(e)){let t=Q_(e);for(;t&&!q_(t);){if($_(t)&&!fA(t))return t;t=Q_(t)}return n}let r=mA(e,t);for(;r&&G_(r)&&fA(r);)r=mA(r,t);return r&&q_(r)&&fA(r)&&!X_(r)?n:r||function(e){let t=Q_(e);for(;Y_(t)&&!q_(t);){if(X_(t))return t;if(W_(t))return null;t=Q_(t)}return null}(e)||n}const gA={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o="fixed"===i,s=H_(r),a=!!t&&W_(t.floating);if(r===s||a&&o)return n;let u={scrollLeft:0,scrollTop:0},l=__(1);const c=__(0),d=Y_(r);if((d||!d&&!o)&&(("body"!==P_(r)||V_(s))&&(u=Z_(r)),Y_(r))){const e=uA(r);l=oA(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const h=!s||d||o?__(0):cA(s,u,!0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+c.x+h.x,y:n.y*l.y-u.scrollTop*l.y+c.y+h.y}},getDocumentElement:H_,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o="clippingAncestors"===n?W_(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=tA(e,[],!1).filter((e=>$_(e)&&"body"!==P_(e))),i=null;const o="fixed"===J_(e).position;let s=o?Q_(e):e;for(;$_(s)&&!q_(s);){const t=J_(s),n=X_(s);n||"fixed"!==t.position||(i=null),(o?!n&&!i:!n&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||V_(s)&&!n&&hA(e,s))?r=r.filter((e=>e!==s)):i=t,s=Q_(s)}return t.set(e,r),r}(t,this._c):[].concat(n),s=[...o,r],a=s[0],u=s.reduce(((e,n)=>{const r=dA(t,n,i);return e.top=m_(r.top,e.top),e.right=f_(r.right,e.right),e.bottom=f_(r.bottom,e.bottom),e.left=m_(r.left,e.left),e}),dA(t,a,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:EA,getElementRects:async function(e){const t=this.getOffsetParent||EA,n=this.getDimensions,r=await n(e.floating);return{reference:pA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=rA(e);return{width:t,height:n}},getScale:oA,isElement:$_,isRTL:function(e){return"rtl"===J_(e).direction}};function _A(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const AA=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,u=await async function(e,t){const{placement:n,platform:r,elements:i}=e,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),s=T_(n),a=S_(n),u="y"===N_(n),l=["left","top"].includes(s)?-1:1,c=o&&u?-1:1,d=O_(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),u?{x:p*c,y:h*l}:{x:h*l,y:p*c}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:s}}}}},DA=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=O_(e,t),l={x:n,y:r},c=await x_(t,u),d=N_(T_(i)),h=y_(d);let p=l[h],f=l[d];if(o){const e="y"===h?"bottom":"right";p=v_(p+c["y"===h?"top":"left"],p,p-c[e])}if(s){const e="y"===d?"bottom":"right";f=v_(f+c["y"===d?"top":"left"],f,f-c[e])}const m=a.fn({...t,[h]:p,[d]:f});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:o,[d]:s}}}}}},vA=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:u,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...E}=O_(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const g=T_(i),_=N_(a),A=T_(a)===a,D=await(null==u.isRTL?void 0:u.isRTL(l.floating)),v=h||(A||!m?[R_(a)]:function(e){const t=R_(e);return[I_(e),t,I_(t)]}(a)),O="none"!==f;!h&&O&&v.push(...function(e,t,n,r){const i=S_(e);let o=function(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}(T_(e),"start"===n,r);return i&&(o=o.map((e=>e+"-"+i)),t&&(o=o.concat(o.map(I_)))),o}(a,m,f,D));const T=[a,...v],S=await x_(t,E),y=[];let C=(null==(r=o.flip)?void 0:r.overflows)||[];if(c&&y.push(S[g]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=S_(e),i=b_(e),o=C_(i);let s="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=R_(s)),[s,R_(s)]}(i,s,D);y.push(S[e[0]],S[e[1]])}if(C=[...C,{placement:i,overflows:y}],!y.every((e=>e<=0))){var N,b;const e=((null==(N=o.flip)?void 0:N.index)||0)+1,t=T[e];if(t&&("alignment"!==d||_===N_(t)||C.every((e=>e.overflows[0]>0&&N_(e.placement)===_))))return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(b=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:b.placement;if(!n)switch(p){case"bestFit":{var I;const e=null==(I=C.filter((e=>{if(O){const t=N_(e.placement);return t===_||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:I[0];e&&(n=e);break}case"initialPlacement":n=a}if(i!==n)return{reset:{placement:n}}}return{}}}},OA=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:u=()=>{},...l}=O_(e,t),c=await x_(t,l),d=T_(i),h=S_(i),p="y"===N_(i),{width:f,height:m}=o.floating;let E,g;"top"===d||"bottom"===d?(E=d,g=h===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,E="end"===h?"top":"bottom");const _=m-c.top-c.bottom,A=f-c.left-c.right,D=f_(m-c[E],_),v=f_(f-c[g],A),O=!t.middlewareData.shift;let T=D,S=v;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=A),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(T=_),O&&!h){const e=m_(c.left,0),t=m_(c.right,0),n=m_(c.top,0),r=m_(c.bottom,0);p?S=f-2*(0!==e||0!==t?e+t:m_(c.left,c.right)):T=m-2*(0!==n||0!==r?n+r:m_(c.top,c.bottom))}await u({...t,availableWidth:S,availableHeight:T});const y=await s.getDimensions(a.floating);return f!==y.width||m!==y.height?{reset:{rects:!0}}:{}}}},TA=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=O_(e,t);switch(r){case"referenceHidden":{const e=M_(await x_(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:F_(e)}}}case"escaped":{const e=M_(await x_(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:F_(e)}}}default:return{}}}}},SA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:u}=t,{element:l,padding:c=0}=O_(e,t)||{};if(null==l)return{};const d=w_(c),h={x:n,y:r},p=b_(i),f=C_(p),m=await s.getDimensions(l),E="y"===p,g=E?"top":"left",_=E?"bottom":"right",A=E?"clientHeight":"clientWidth",D=o.reference[f]+o.reference[p]-h[p]-o.floating[f],v=h[p]-o.reference[p],O=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l));let T=O?O[A]:0;T&&await(null==s.isElement?void 0:s.isElement(O))||(T=a.floating[A]||o.floating[f]);const S=D/2-v/2,y=T/2-m[f]/2-1,C=f_(d[g],y),N=f_(d[_],y),b=C,I=T-m[f]-N,R=T/2-m[f]/2+S,w=v_(b,R,I),k=!u.arrow&&null!=S_(i)&&R!==w&&o.reference[f]/2-(R<b?C:N)-m[f]/2<0,L=k?R<b?R-b:R-I:0;return{[p]:h[p]+L,data:{[p]:w,centerOffset:R-w-L,...k&&{alignmentOffset:L}},reset:k}}}),yA=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:u=!0,crossAxis:l=!0}=O_(e,t),c={x:n,y:r},d=N_(i),h=y_(d);let p=c[h],f=c[d];const m=O_(a,t),E="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const e="y"===h?"height":"width",t=o.reference[h]-o.floating[e]+E.mainAxis,n=o.reference[h]+o.reference[e]-E.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){var g,_;const e="y"===h?"width":"height",t=["top","left"].includes(T_(i)),n=o.reference[d]-o.floating[e]+(t&&(null==(g=s.offset)?void 0:g[d])||0)+(t?0:E.crossAxis),r=o.reference[d]+o.reference[e]+(t?0:(null==(_=s.offset)?void 0:_[d])||0)-(t?E.crossAxis:0);f<n?f=n:f>r&&(f=r)}return{[h]:p,[d]:f}}}};var CA="undefined"!=typeof document?ue:function(){};function NA(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!NA(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){const n=i[r];if(!("_owner"===n&&e.$$typeof||NA(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function bA(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function IA(e,t){const n=bA(e);return Math.round(t*n)/n}function RA(e){const t=le(e);return CA((()=>{t.current=e})),t}const wA=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(i=n,{}.hasOwnProperty.call(i,"current"))?null!=n.current?SA({element:n.current,padding:r}).fn(t):{}:n?SA({element:n,padding:r}).fn(t):{};var i}}),kA=(e,t)=>({...AA(e),options:[e,t]}),LA=(e,t)=>({...DA(e),options:[e,t]}),xA=(e,t)=>({...yA(e),options:[e,t]}),MA=(e,t)=>({...vA(e),options:[e,t]}),FA=(e,t)=>({...OA(e),options:[e,t]}),BA=(e,t)=>({...TA(e),options:[e,t]}),PA=(e,t)=>({...wA(e),options:[e,t]});var UA=Me(((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return bt(Ug.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:bt("polygon",{points:"0,0 30,0 15,10"})})}));UA.displayName="Arrow";var HA=UA,jA="Popper",[$A,YA]=wg(jA),[zA,VA]=$A(jA),GA=e=>{const{__scopePopper:t,children:n}=e,[r,i]=oe(null);return bt(zA,{scope:t,anchor:r,onAnchorChange:i,children:n})};GA.displayName=jA;var WA="PopperAnchor",XA=Me(((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=VA(WA,n),s=le(null),a=Rg(t,s);return ae((()=>{o.onAnchorChange(r?.current||s.current)})),r?null:bt(Ug.div,{...i,ref:a})}));XA.displayName=WA;var KA="PopperContent",[qA,JA]=$A(KA),ZA=Me(((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:f,...m}=e,E=VA(KA,n),[g,_]=oe(null),A=Rg(t,(e=>_(e))),[D,v]=oe(null),O=function(e){const[t,n]=oe(void 0);return Lg((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let i,o;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,o=t.blockSize}else i=e.offsetWidth,o=e.offsetHeight;n({width:i,height:o})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(D),T=O?.width??0,S=O?.height??0,y=r+("center"!==o?"-"+o:""),C="number"==typeof c?c:{top:0,right:0,bottom:0,left:0,...c},N=Array.isArray(l)?l:[l],b=N.length>0,I={padding:C,boundary:N.filter(nD),altBoundary:b},{refs:R,floatingStyles:w,placement:k,isPositioned:L,middlewareData:x}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:u,open:l}=e,[c,d]=oe({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=oe(r);NA(h,r)||p(r);const[f,m]=oe(null),[E,g]=oe(null),_=he((e=>{e!==O.current&&(O.current=e,m(e))}),[]),A=he((e=>{e!==T.current&&(T.current=e,g(e))}),[]),D=o||f,v=s||E,O=le(null),T=le(null),S=le(c),y=null!=u,C=RA(u),N=RA(i),b=RA(l),I=he((()=>{if(!O.current||!T.current)return;const e={placement:t,strategy:n,middleware:h};N.current&&(e.platform=N.current),((e,t,n)=>{const r=new Map,i={platform:gA,...n},o={...i.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),u=await(null==s.isRTL?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=L_(l,r,u),h=r,p={},f=0;for(let m=0;m<a.length;m++){const{name:n,fn:o}=a[m],{x:E,y:g,data:_,reset:A}=await o({x:c,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:l,platform:s,elements:{reference:e,floating:t}});c=null!=E?E:c,d=null!=g?g:d,p={...p,[n]:{...p[n],..._}},A&&f<=50&&(f++,"object"==typeof A&&(A.placement&&(h=A.placement),A.rects&&(l=!0===A.rects?await s.getElementRects({reference:e,floating:t,strategy:i}):A.rects),({x:c,y:d}=L_(l,h,u))),m=-1)}return{x:c,y:d,placement:h,strategy:i,middlewareData:p}})(e,t,{...i,platform:o})})(O.current,T.current,e).then((e=>{const t={...e,isPositioned:!1!==b.current};R.current&&!NA(S.current,t)&&(S.current=t,Ot((()=>{d(t)})))}))}),[h,t,n,N,b]);CA((()=>{!1===l&&S.current.isPositioned&&(S.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[l]);const R=le(!1);CA((()=>(R.current=!0,()=>{R.current=!1})),[]),CA((()=>{if(D&&(O.current=D),v&&(T.current=v),D&&v){if(C.current)return C.current(D,v,I);I()}}),[D,v,I,C,y]);const w=de((()=>({reference:O,floating:T,setReference:_,setFloating:A})),[_,A]),k=de((()=>({reference:D,floating:v})),[D,v]),L=de((()=>{const e={position:n,left:0,top:0};if(!k.floating)return e;const t=IA(k.floating,c.x),r=IA(k.floating,c.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...bA(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,k.floating,c.x,c.y]);return de((()=>({...c,update:I,refs:w,elements:k,floatingStyles:L})),[c,I,w,k,L])}({strategy:"fixed",placement:y,whileElementsMounted:(...e)=>function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,l=iA(e),c=i||o?[...l?tA(l):[],...tA(t)]:[];c.forEach((e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));const d=l&&a?function(e,t){let n,r=null;const i=H_(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,u){void 0===a&&(a=!1),void 0===u&&(u=1),o();const l=e.getBoundingClientRect(),{left:c,top:d,width:h,height:p}=l;if(a||t(),!h||!p)return;const f={rootMargin:-g_(d)+"px "+-g_(i.clientWidth-(c+h))+"px "+-g_(i.clientHeight-(d+p))+"px "+-g_(c)+"px",threshold:m_(0,f_(1,u))||1};let m=!0;function E(t){const r=t[0].intersectionRatio;if(r!==u){if(!m)return s();r?s(!1,r):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}1!==r||_A(l,e.getBoundingClientRect())||s(),m=!1}try{r=new IntersectionObserver(E,{...f,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(E,f)}r.observe(e)}(!0),o}(l,n):null;let h,p=-1,f=null;s&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),l&&!u&&f.observe(l),f.observe(t));let m=u?uA(e):null;return u&&function t(){const r=uA(e);m&&!_A(m,r)&&n(),m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,u&&cancelAnimationFrame(h)}}(...e,{animationFrame:"always"===p}),elements:{reference:E.anchor},middleware:[kA({mainAxis:i+S,alignmentAxis:s}),u&&LA({mainAxis:!0,crossAxis:!1,limiter:"partial"===d?xA():void 0,...I}),u&&MA({...I}),FA({...I,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:i,height:o}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${i}px`),s.setProperty("--radix-popper-anchor-height",`${o}px`)}}),D&&PA({element:D,padding:a}),rD({arrowWidth:T,arrowHeight:S}),h&&BA({strategy:"referenceHidden",...I})]}),[M,F]=iD(k),B=zg(f);Lg((()=>{L&&B?.()}),[L,B]);const P=x.arrow?.x,U=x.arrow?.y,H=0!==x.arrow?.centerOffset,[j,$]=oe();return Lg((()=>{g&&$(window.getComputedStyle(g).zIndex)}),[g]),bt("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...w,transform:L?w.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:j,"--radix-popper-transform-origin":[x.transformOrigin?.x,x.transformOrigin?.y].join(" "),...x.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:bt(qA,{scope:n,placedSide:M,onArrowChange:v,arrowX:P,arrowY:U,shouldHideArrow:H,children:bt(Ug.div,{"data-side":M,"data-align":F,...m,ref:A,style:{...m.style,animation:L?void 0:"none"}})})})}));ZA.displayName=KA;var QA="PopperArrow",eD={top:"bottom",right:"left",bottom:"top",left:"right"},tD=Me((function(e,t){const{__scopePopper:n,...r}=e,i=JA(QA,n),o=eD[i.placedSide];return bt("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:bt(HA,{...r,ref:t,style:{...r.style,display:"block"}})})}));function nD(e){return null!==e}tD.displayName=QA;var rD=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,o=0!==i.arrow?.centerOffset,s=o?0:e.arrowWidth,a=o?0:e.arrowHeight,[u,l]=iD(n),c={start:"0%",center:"50%",end:"100%"}[l],d=(i.arrow?.x??0)+s/2,h=(i.arrow?.y??0)+a/2;let p="",f="";return"bottom"===u?(p=o?c:`${d}px`,f=-a+"px"):"top"===u?(p=o?c:`${d}px`,f=`${r.floating.height+a}px`):"right"===u?(p=-a+"px",f=o?c:`${h}px`):"left"===u&&(p=`${r.floating.width+a}px`,f=o?c:`${h}px`),{data:{x:p,y:f}}}});function iD(e){const[t,n="center"]=e.split("-");return[t,n]}var oD=GA,sD=XA,aD=ZA,uD=tD,lD=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=oe(),r=le(null),i=le(e),o=le("none"),s=e?"mounted":"unmounted",[a,u]=function(e,t){return se(((e,n)=>t[e][n]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ae((()=>{const e=cD(r.current);o.current="mounted"===a?e:"none"}),[a]),Lg((()=>{const t=r.current,n=i.current;if(n!==e){const r=o.current,s=cD(t);u(e?"MOUNT":"none"===s||"none"===t?.display?"UNMOUNT":n&&r!==s?"ANIMATION_OUT":"UNMOUNT"),i.current=e}}),[e,u]),Lg((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,s=o=>{const s=cD(r.current).includes(o.animationName);if(o.target===t&&s&&(u("ANIMATION_END"),!i.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},a=e=>{e.target===t&&(o.current=cD(r.current))};return t.addEventListener("animationstart",a),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",a),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}u("ANIMATION_END")}),[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:he((e=>{r.current=e?getComputedStyle(e):null,n(e)}),[])}}(t),i="function"==typeof n?n({present:r.isPresent}):Be.only(n),o=Rg(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(i));return"function"==typeof n||r.isPresent?_t(i,{ref:o}):null};function cD(e){return e?.animationName||"none"}lD.displayName="Presence";var dD="rovingFocusGroup.onEntryFocus",hD={bubbles:!1,cancelable:!0},pD="RovingFocusGroup",[fD,mD,ED]=jg(pD),[gD,_D]=wg(pD,[ED]),[AD,DD]=gD(pD),vD=Me(((e,t)=>bt(fD.Provider,{scope:e.__scopeRovingFocusGroup,children:bt(fD.Slot,{scope:e.__scopeRovingFocusGroup,children:bt(OD,{...e,ref:t})})})));vD.displayName=pD;var OD=Me(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:c=!1,...d}=e,h=le(null),p=Rg(t,h),f=Yg(o),[m,E]=Mg({prop:s,defaultProp:a??null,onChange:u,caller:pD}),[g,_]=oe(!1),A=zg(l),D=mD(n),v=le(!1),[O,T]=oe(0);return ae((()=>{const e=h.current;if(e)return e.addEventListener(dD,A),()=>e.removeEventListener(dD,A)}),[A]),bt(AD,{scope:n,orientation:r,dir:f,loop:i,currentTabStopId:m,onItemFocus:he((e=>E(e)),[E]),onItemShiftTab:he((()=>_(!0)),[]),onFocusableItemAdd:he((()=>T((e=>e+1))),[]),onFocusableItemRemove:he((()=>T((e=>e-1))),[]),children:bt(Ug.div,{tabIndex:g||0===O?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Ng(e.onMouseDown,(()=>{v.current=!0})),onFocus:Ng(e.onFocus,(e=>{const t=!v.current;if(e.target===e.currentTarget&&t&&!g){const t=new CustomEvent(dD,hD);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=D().filter((e=>e.focusable));CD([e.find((e=>e.active)),e.find((e=>e.id===m)),...e].filter(Boolean).map((e=>e.ref.current)),c)}}v.current=!1})),onBlur:Ng(e.onBlur,(()=>_(!1)))})})})),TD="RovingFocusGroupItem",SD=Me(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:s,...a}=e,u=h_(),l=o||u,c=DD(TD,n),d=c.currentTabStopId===l,h=mD(n),{onFocusableItemAdd:p,onFocusableItemRemove:f,currentTabStopId:m}=c;return ae((()=>{if(r)return p(),()=>f()}),[r,p,f]),bt(fD.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:bt(Ug.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:Ng(e.onMouseDown,(e=>{r?c.onItemFocus(l):e.preventDefault()})),onFocus:Ng(e.onFocus,(()=>c.onItemFocus(l))),onKeyDown:Ng(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:yD[r]}(e,c.orientation,c.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=h().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)i.reverse();else if("prev"===t||"next"===t){"prev"===t&&i.reverse();const o=i.indexOf(e.currentTarget);i=c.loop?(r=o+1,(n=i).map(((e,t)=>n[(r+t)%n.length]))):i.slice(o+1)}setTimeout((()=>CD(i)))}var n,r})),children:"function"==typeof s?s({isCurrentTabStop:d,hasTabStop:null!=m}):s})})}));SD.displayName=TD;var yD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function CD(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var ND=vD,bD=SD,ID=new WeakMap,RD=new WeakMap,wD={},kD=0,LD=function(e){return e&&(e.host||LD(e.parentNode))},xD=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),function(e,t,n,r){var i=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=LD(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);wD[n]||(wD[n]=new WeakMap);var o=wD[n],s=[],a=new Set,u=new Set(i),l=function(e){e&&!a.has(e)&&(a.add(e),l(e.parentNode))};i.forEach(l);var c=function(e){e&&!u.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))c(e);else try{var t=e.getAttribute(r),i=null!==t&&"false"!==t,u=(ID.get(e)||0)+1,l=(o.get(e)||0)+1;ID.set(e,u),o.set(e,l),s.push(e),1===u&&i&&RD.set(e,!0),1===l&&e.setAttribute(n,"true"),i||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}}))};return c(t),a.clear(),kD++,function(){s.forEach((function(e){var t=ID.get(e)-1,i=o.get(e)-1;ID.set(e,t),o.set(e,i),t||(RD.has(e)||e.removeAttribute(r),RD.delete(e)),i||e.removeAttribute(n)})),--kD||(ID=new WeakMap,ID=new WeakMap,RD=new WeakMap,wD={})}}(r,i,n,"aria-hidden")):function(){return null}},MD=function(){return MD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},MD.apply(this,arguments)},FD="right-scroll-bar-position",BD="width-before-scroll-bar";function PD(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var UD="undefined"!=typeof window?ue:ae,HD=new WeakMap;var jD=function(){return jD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},jD.apply(this,arguments)};function $D(e){return e}"function"==typeof SuppressedError&&SuppressedError;var YD=function(e){var t=e.sideCar,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return A(r,jD({},n))};YD.isSideCarExport=!0;var zD=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=$D);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:null},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter((function(e){return e!==i}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var o=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(o)};s(),n={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),n}}}};return i}();return t.options=jD({async:!0,ssr:!1},e),t}(),VD=function(){},GD=Me((function(e,t){var n=le(null),r=oe({onScrollCapture:VD,onWheelCapture:VD,onTouchMoveCapture:VD}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,u=e.className,l=e.removeScrollBar,c=e.enabled,d=e.shards,h=e.sideCar,p=e.noRelative,f=e.noIsolation,m=e.inert,E=e.allowPinchZoom,g=e.as,_=void 0===g?"div":g,D=e.gapMode,v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=h,S=function(e){var t,n,r=(t=function(t){return e.forEach((function(e){return PD(e,t)}))},(n=oe((function(){return{value:null,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}}))[0]).callback=t,n.facade);return UD((function(){var t=HD.get(r);if(t){var n=new Set(t),i=new Set(e),o=r.current;n.forEach((function(e){i.has(e)||PD(e,null)})),i.forEach((function(e){n.has(e)||PD(e,o)}))}HD.set(r,e)}),[e]),r}([n,t]),y=MD(MD({},v),i);return A(O,null,c&&A(T,{sideCar:zD,removeScrollBar:l,shards:d,noRelative:p,noIsolation:f,inert:m,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:D}),s?_t(Be.only(a),MD(MD({},y),{ref:S})):A(_,MD({},y,{className:u,ref:S}),a))}));GD.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},GD.classNames={fullWidth:BD,zeroRight:FD};var WD=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},XD=function(){var e,t=(e=WD(),function(t,n){ae((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},KD={left:0,top:0,right:0,gap:0},qD=function(e){return parseInt(e||"",10)||0},JD=XD(),ZD="data-scroll-locked",QD=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(a,"px ").concat(r,";\n }\n body[").concat(ZD,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(FD," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(BD," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(FD," .").concat(FD," {\n right: 0 ").concat(r,";\n }\n \n .").concat(BD," .").concat(BD," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(ZD,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},ev=function(){var e=parseInt(document.body.getAttribute(ZD)||"0",10);return isFinite(e)?e:0},tv=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=void 0===r?"margin":r;ae((function(){return document.body.setAttribute(ZD,(ev()+1).toString()),function(){var e=ev()-1;e<=0?document.body.removeAttribute(ZD):document.body.setAttribute(ZD,e.toString())}}),[]);var o=de((function(){return function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return KD;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[qD(n),qD(r),qD(i)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}}(i)}),[i]);return A(JD,{styles:QD(o,!t,i,n?"":"!important")})},nv=!1;if("undefined"!=typeof window)try{var rv=Object.defineProperty({},"passive",{get:function(){return nv=!0,!0}});window.addEventListener("test",rv,rv),window.removeEventListener("test",rv,rv)}catch(e){nv=!1}var iv=!!nv&&{passive:!1},ov=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},sv=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),av(e,r)){var i=uv(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},av=function(e,t){return"v"===e?function(e){return ov(e,"overflowY")}(t):function(e){return ov(e,"overflowX")}(t)},uv=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},lv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cv=function(e){return[e.deltaX,e.deltaY]},dv=function(e){return e&&"current"in e?e.current:e},hv=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},pv=0,fv=[];function mv(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ev=(gv=function(e){var t=le([]),n=le([0,0]),r=le(),i=oe(pv++)[0],o=oe(XD)[0],s=le(e);ae((function(){s.current=e}),[e]),ae((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=function(e,t){for(var n,r=0,i=t.length;r<i;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(dv)).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(i))})),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(i))}))}}}),[e.inert,e.lockRef.current,e.shards]);var a=he((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var i,o=lv(e),a=n.current,u="deltaX"in e?e.deltaX:a[0]-o[0],l="deltaY"in e?e.deltaY:a[1]-o[1],c=e.target,d=Math.abs(u)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var h=sv(d,c);if(!h)return!0;if(h?i=d:(i="v"===d?"h":"v",h=sv(d,c)),!h)return!1;if(!r.current&&"changedTouches"in e&&(u||l)&&(r.current=i),!i)return!0;var p=r.current||i;return function(e,t,n,r,i){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,u=t.contains(a),l=!1,c=s>0,d=0,h=0;do{if(!a)break;var p=uv(e,a),f=p[0],m=p[1]-p[2]-o*f;(f||m)&&av(e,a)&&(d+=m,h+=f);var E=a.parentNode;a=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return c&&Math.abs(d)<1?l=!0:c||!(Math.abs(h)<1)&&i||(l=!0),l}(p,t,e,"h"===p?u:l,!0)}),[]),u=he((function(e){var n=e;if(fv.length&&fv[fv.length-1]===o){var r="deltaY"in n?cv(n):lv(n),i=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)}))[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var u=(s.current.shards||[]).map(dv).filter(Boolean).filter((function(e){return e.contains(n.target)}));(u.length>0?a(n,u[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),l=he((function(e,n,r,i){var o={name:e,delta:n,target:r,should:i,shadowParent:mv(r)};t.current.push(o),setTimeout((function(){t.current=t.current.filter((function(e){return e!==o}))}),1)}),[]),c=he((function(e){n.current=lv(e),r.current=void 0}),[]),d=he((function(t){l(t.type,cv(t),t.target,a(t,e.lockRef.current))}),[]),h=he((function(t){l(t.type,lv(t),t.target,a(t,e.lockRef.current))}),[]);ae((function(){return fv.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",u,iv),document.addEventListener("touchmove",u,iv),document.addEventListener("touchstart",c,iv),function(){fv=fv.filter((function(e){return e!==o})),document.removeEventListener("wheel",u,iv),document.removeEventListener("touchmove",u,iv),document.removeEventListener("touchstart",c,iv)}}),[]);var p=e.removeScrollBar;return A(O,null,e.inert?A(o,{styles:hv(i)}):null,p?A(tv,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},zD.useMedium(gv),YD);var gv,_v=Me((function(e,t){return A(GD,MD({},e,{ref:t,sideCar:Ev}))}));_v.classNames=GD.classNames;var Av=["Enter"," "],Dv=["ArrowUp","PageDown","End"],vv=["ArrowDown","PageUp","Home",...Dv],Ov={ltr:[...Av,"ArrowRight"],rtl:[...Av,"ArrowLeft"]},Tv={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sv="Menu",[yv,Cv,Nv]=jg(Sv),[bv,Iv]=wg(Sv,[Nv,YA,_D]),Rv=YA(),wv=_D(),[kv,Lv]=bv(Sv),[xv,Mv]=bv(Sv),Fv=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=Rv(t),[u,l]=oe(null),c=le(!1),d=zg(o),h=Yg(i);return ae((()=>{const e=()=>{c.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>c.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),bt(oD,{...a,children:bt(kv,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:l,children:bt(xv,{scope:t,onClose:he((()=>d(!1)),[d]),isUsingKeyboardRef:c,dir:h,modal:s,children:r})})})};Fv.displayName=Sv;var Bv=Me(((e,t)=>{const{__scopeMenu:n,...r}=e,i=Rv(n);return bt(sD,{...i,...r,ref:t})}));Bv.displayName="MenuAnchor";var[Pv,Uv]=bv("MenuPortal",{forceMount:void 0}),Hv="MenuContent",[jv,$v]=bv(Hv),Yv=Me(((e,t)=>{const n=Uv(Hv,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Lv(Hv,e.__scopeMenu),s=Mv(Hv,e.__scopeMenu);return bt(yv.Provider,{scope:e.__scopeMenu,children:bt(lD,{present:r||o.open,children:bt(yv.Slot,{scope:e.__scopeMenu,children:s.modal?bt(zv,{...i,ref:t}):bt(Vv,{...i,ref:t})})})})})),zv=Me(((e,t)=>{const n=Lv(Hv,e.__scopeMenu),r=le(null),i=Rg(t,r);return ae((()=>{const e=r.current;if(e)return xD(e)}),[]),bt(Wv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ng(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})})),Vv=Me(((e,t)=>{const n=Lv(Hv,e.__scopeMenu);return bt(Wv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})})),Gv=Fg("MenuContent.ScrollLock"),Wv=Me(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,disableOutsideScroll:f,...m}=e,E=Lv(Hv,n),g=Mv(Hv,n),_=Rv(n),A=wv(n),D=Cv(n),[v,T]=oe(null),S=le(null),y=Rg(t,S,E.onContentChange),C=le(0),N=le(""),b=le(0),I=le(null),R=le("right"),w=le(0),k=f?_v:O,L=f?{as:Gv,allowPinchZoom:!0}:void 0;ae((()=>()=>window.clearTimeout(C.current)),[]),ae((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Qg()),document.body.insertAdjacentElement("beforeend",e[1]??Qg()),Zg++,()=>{1===Zg&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Zg--}}),[]);const x=he((e=>R.current===I.current?.side&&function(e,t){if(!t)return!1;return function(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const e=t[o],a=t[s],u=e.x,l=e.y,c=a.x,d=a.y;l>r!=d>r&&n<(c-u)*(r-l)/(d-l)+u&&(i=!i)}return i}({x:e.clientX,y:e.clientY},t)}(e,I.current?.area)),[]);return bt(jv,{scope:n,searchRef:N,onItemEnter:he((e=>{x(e)&&e.preventDefault()}),[x]),onItemLeave:he((e=>{x(e)||(S.current?.focus(),T(null))}),[x]),onTriggerLeave:he((e=>{x(e)&&e.preventDefault()}),[x]),pointerGraceTimerRef:b,onPointerGraceIntentChange:he((e=>{I.current=e}),[]),children:bt(k,{...L,children:bt(r_,{asChild:!0,trapped:i,onMountAutoFocus:Ng(o,(e=>{e.preventDefault(),S.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:s,children:bt(Xg,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,children:bt(ND,{asChild:!0,...A,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:v,onCurrentTabStopIdChange:T,onEntryFocus:Ng(u,(e=>{g.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:bt(aD,{role:"menu","aria-orientation":"vertical","data-state":AO(E.open),"data-radix-menu-content":"",dir:g.dir,..._,...m,ref:y,style:{outline:"none",...m.style},onKeyDown:Ng(m.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&(e=>{const t=N.current+e,n=D().filter((e=>!e.disabled)),r=document.activeElement,i=n.find((e=>e.ref.current===r))?.textValue,o=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),i=r?t[0]:t,o=n?e.indexOf(n):-1;let s=(a=e,u=Math.max(o,0),a.map(((e,t)=>a[(u+t)%a.length])));var a,u;1===i.length&&(s=s.filter((e=>e!==n)));const l=s.find((e=>e.toLowerCase().startsWith(i.toLowerCase())));return l!==n?l:void 0}(n.map((e=>e.textValue)),t,i),s=n.find((e=>e.textValue===o))?.ref.current;!function e(t){N.current=t,window.clearTimeout(C.current),""!==t&&(C.current=window.setTimeout((()=>e("")),1e3))}(t),s&&setTimeout((()=>s.focus()))})(e.key));const i=S.current;if(e.target!==i)return;if(!vv.includes(e.key))return;e.preventDefault();const o=D().filter((e=>!e.disabled)).map((e=>e.ref.current));Dv.includes(e.key)&&o.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(o)})),onBlur:Ng(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(C.current),N.current="")})),onPointerMove:Ng(e.onPointerMove,OO((e=>{const t=e.target,n=w.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>w.current?"right":"left";R.current=t,w.current=e.clientX}})))})})})})})})}));Yv.displayName=Hv;var Xv=Me(((e,t)=>{const{__scopeMenu:n,...r}=e;return bt(Ug.div,{role:"group",...r,ref:t})}));Xv.displayName="MenuGroup";var Kv=Me(((e,t)=>{const{__scopeMenu:n,...r}=e;return bt(Ug.div,{...r,ref:t})}));Kv.displayName="MenuLabel";var qv="MenuItem",Jv="menu.itemSelect",Zv=Me(((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=le(null),s=Mv(qv,e.__scopeMenu),a=$v(qv,e.__scopeMenu),u=Rg(t,o),l=le(!1);return bt(Qv,{...i,ref:u,disabled:n,onClick:Ng(e.onClick,(()=>{const e=o.current;if(!n&&e){const t=new CustomEvent(Jv,{bubbles:!0,cancelable:!0});e.addEventListener(Jv,(e=>r?.(e)),{once:!0}),Hg(e,t),t.defaultPrevented?l.current=!1:s.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Ng(e.onPointerUp,(e=>{l.current||e.currentTarget?.click()})),onKeyDown:Ng(e.onKeyDown,(e=>{const t=""!==a.searchRef.current;n||t&&" "===e.key||Av.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));Zv.displayName=qv;var Qv=Me(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=$v(qv,n),a=wv(n),u=le(null),l=Rg(t,u),[c,d]=oe(!1),[h,p]=oe("");return ae((()=>{const e=u.current;e&&p((e.textContent??"").trim())}),[o.children]),bt(yv.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:bt(bD,{asChild:!0,...a,focusable:!r,children:bt(Ug.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:l,onPointerMove:Ng(e.onPointerMove,OO((e=>{r?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))}))),onPointerLeave:Ng(e.onPointerLeave,OO((e=>s.onItemLeave(e)))),onFocus:Ng(e.onFocus,(()=>d(!0))),onBlur:Ng(e.onBlur,(()=>d(!1)))})})})})),eO=Me(((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return bt(uO,{scope:e.__scopeMenu,checked:n,children:bt(Zv,{role:"menuitemcheckbox","aria-checked":DO(n)?"mixed":n,...i,ref:t,"data-state":vO(n),onSelect:Ng(i.onSelect,(()=>r?.(!!DO(n)||!n)),{checkForDefaultPrevented:!1})})})}));eO.displayName="MenuCheckboxItem";var tO="MenuRadioGroup",[nO,rO]=bv(tO,{value:void 0,onValueChange:()=>{}}),iO=Me(((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=zg(r);return bt(nO,{scope:e.__scopeMenu,value:n,onValueChange:o,children:bt(Xv,{...i,ref:t})})}));iO.displayName=tO;var oO="MenuRadioItem",sO=Me(((e,t)=>{const{value:n,...r}=e,i=rO(oO,e.__scopeMenu),o=n===i.value;return bt(uO,{scope:e.__scopeMenu,checked:o,children:bt(Zv,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":vO(o),onSelect:Ng(r.onSelect,(()=>i.onValueChange?.(n)),{checkForDefaultPrevented:!1})})})}));sO.displayName=oO;var aO="MenuItemIndicator",[uO,lO]=bv(aO,{checked:!1}),cO=Me(((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=lO(aO,n);return bt(lD,{present:r||DO(o.checked)||!0===o.checked,children:bt(Ug.span,{...i,ref:t,"data-state":vO(o.checked)})})}));cO.displayName=aO;var dO=Me(((e,t)=>{const{__scopeMenu:n,...r}=e;return bt(Ug.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})}));dO.displayName="MenuSeparator";var hO=Me(((e,t)=>{const{__scopeMenu:n,...r}=e,i=Rv(n);return bt(uD,{...i,...r,ref:t})}));hO.displayName="MenuArrow";var[pO,fO]=bv("MenuSub"),mO="MenuSubTrigger",EO=Me(((e,t)=>{const n=Lv(mO,e.__scopeMenu),r=Mv(mO,e.__scopeMenu),i=fO(mO,e.__scopeMenu),o=$v(mO,e.__scopeMenu),s=le(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=o,l={__scopeMenu:e.__scopeMenu},c=he((()=>{s.current&&window.clearTimeout(s.current),s.current=null}),[]);return ae((()=>c),[c]),ae((()=>{const e=a.current;return()=>{window.clearTimeout(e),u(null)}}),[a,u]),bt(Bv,{asChild:!0,...l,children:bt(Qv,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":AO(n.open),...e,ref:Ig(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ng(e.onPointerMove,OO((t=>{o.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||s.current||(o.onPointerGraceIntentChange(null),s.current=window.setTimeout((()=>{n.onOpenChange(!0),c()}),100))}))),onPointerLeave:Ng(e.onPointerLeave,OO((e=>{c();const t=n.content?.getBoundingClientRect();if(t){const r=n.content?.dataset.side,i="right"===r,s=i?-5:5,u=t[i?"left":"right"],l=t[i?"right":"left"];o.onPointerGraceIntentChange({area:[{x:e.clientX+s,y:e.clientY},{x:u,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:u,y:t.bottom}],side:r}),window.clearTimeout(a.current),a.current=window.setTimeout((()=>o.onPointerGraceIntentChange(null)),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}}))),onKeyDown:Ng(e.onKeyDown,(t=>{const i=""!==o.searchRef.current;e.disabled||i&&" "===t.key||Ov[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())}))})})}));EO.displayName=mO;var gO="MenuSubContent",_O=Me(((e,t)=>{const n=Uv(Hv,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Lv(Hv,e.__scopeMenu),s=Mv(Hv,e.__scopeMenu),a=fO(gO,e.__scopeMenu),u=le(null),l=Rg(t,u);return bt(yv.Provider,{scope:e.__scopeMenu,children:bt(lD,{present:r||o.open,children:bt(yv.Slot,{scope:e.__scopeMenu,children:bt(Wv,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Ng(e.onFocusOutside,(e=>{e.target!==a.trigger&&o.onOpenChange(!1)})),onEscapeKeyDown:Ng(e.onEscapeKeyDown,(e=>{s.onClose(),e.preventDefault()})),onKeyDown:Ng(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=Tv[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),a.trigger?.focus(),e.preventDefault())}))})})})})}));function AO(e){return e?"open":"closed"}function DO(e){return"indeterminate"===e}function vO(e){return DO(e)?"indeterminate":e?"checked":"unchecked"}function OO(e){return t=>"mouse"===t.pointerType?e(t):void 0}_O.displayName=gO;var TO=Fv,SO=Bv,yO=Yv,CO=Xv,NO=Kv,bO=Zv,IO=eO,RO=iO,wO=sO,kO=cO,LO=dO,xO=hO,MO=EO,FO=_O,BO="DropdownMenu",[PO,UO]=wg(BO,[Iv]),HO=Iv(),[jO,$O]=PO(BO),YO=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,u=HO(t),l=le(null),[c,d]=Mg({prop:i,defaultProp:o??!1,onChange:s,caller:BO});return bt(jO,{scope:t,triggerId:h_(),triggerRef:l,contentId:h_(),open:c,onOpenChange:d,onOpenToggle:he((()=>d((e=>!e))),[d]),modal:a,children:bt(TO,{...u,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};YO.displayName=BO;var zO="DropdownMenuTrigger",VO=Me(((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=$O(zO,n),s=HO(n);return bt(SO,{asChild:!0,...s,children:bt(Ug.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Ig(t,o.triggerRef),onPointerDown:Ng(e.onPointerDown,(e=>{r||0!==e.button||!1!==e.ctrlKey||(o.onOpenToggle(),o.open||e.preventDefault())})),onKeyDown:Ng(e.onKeyDown,(e=>{r||(["Enter"," "].includes(e.key)&&o.onOpenToggle(),"ArrowDown"===e.key&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));VO.displayName=zO;var GO="DropdownMenuContent",WO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$O(GO,n),o=HO(n),s=le(!1);return bt(yO,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Ng(e.onCloseAutoFocus,(e=>{s.current||i.triggerRef.current?.focus(),s.current=!1,e.preventDefault()})),onInteractOutside:Ng(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;i.modal&&!r||(s.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));WO.displayName=GO;var XO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(CO,{...i,...r,ref:t})}));XO.displayName="DropdownMenuGroup";var KO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(NO,{...i,...r,ref:t})}));KO.displayName="DropdownMenuLabel";var qO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(bO,{...i,...r,ref:t})}));qO.displayName="DropdownMenuItem";var JO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(IO,{...i,...r,ref:t})}));JO.displayName="DropdownMenuCheckboxItem";var ZO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(RO,{...i,...r,ref:t})}));ZO.displayName="DropdownMenuRadioGroup";var QO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(wO,{...i,...r,ref:t})}));QO.displayName="DropdownMenuRadioItem";var eT=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(kO,{...i,...r,ref:t})}));eT.displayName="DropdownMenuItemIndicator";var tT=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(LO,{...i,...r,ref:t})}));tT.displayName="DropdownMenuSeparator";var nT=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(xO,{...i,...r,ref:t})}));nT.displayName="DropdownMenuArrow";var rT=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(MO,{...i,...r,ref:t})}));rT.displayName="DropdownMenuSubTrigger";var iT=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(FO,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));iT.displayName="DropdownMenuSubContent";var oT=YO,sT=VO,aT=WO,uT=qO;function lT(e){const{menuComponent:t,menuProps:n,children:r,...i}=e,[o,s]=oe(void 0);return bt(oT,{modal:!1,children:[bt(sT,{asChild:!0,children:bt("button",{...i,ref:e=>(e=>{const t=e?.closest("[t-menu-boundary]")??void 0;s(t)})(e),children:r})}),bt(aT,{hideWhenDetached:!0,collisionBoundary:o,style:{zIndex:1e3},children:bt(t,{...n})})]})}function cT(e){return bt(uT,{...e})}function dT(e){return go(e)}function hT(e){return e.photoUrl??function(e,t){const n=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">\n <rect x="0" y="0" width="100" height="100" fill="${go(e)}"/>\n <text x="50%" y="54%" dominant-baseline="middle" font-size="34" font-family="San Francisco, Segoe UI, Helvetica Neue, Arial, Helvetica, sans-serif" fill="#fff" text-anchor="middle">${t}</text> \n </svg>`.replace(/\s+/g," ");return"data:image/svg+xml;base64,"+fo(n)}(e.id,(e=>e.split(Eo).filter((e=>e)).map((e=>e[0])).join("")||e[Symbol.iterator]().next().value||"")(e.name))}function pT(e){const t=1048576,n=1024*t,r=1024*n;return e<1024?e+" B":e<t?Math.floor(e/1024)+" KB":e<n?Math.floor(e/t)+" MB":e<r?Math.floor(e/n)+" GB":Math.floor(e/r)+" TB"}function fT({latitude:e,longitude:t}){const n=e+","+t;return{imageUrl:`https://maps.googleapis.com/maps/api/staticmap?center=${n}&zoom=15&size=300x200&scale=2&maptype=roadmap&markers=${n}&key=${wo}`,linkUrl:`https://maps.google.com/maps?q=${n}&z=15`}}function mT(e,...t){const n=Ro.bind(yt.createElement)(e,...t);return Array.isArray(n)?yt.createElement(yt.Fragment,{},...n):n}function ET({children:e,className:t,...n}){return bt("div",{className:"t-attach-overlay "+t,...n,children:e})}function gT({uploadState:e}){si();const t=e.error,n=e.uploaded;Sg((()=>e.closePreview("cancel")));const r=le(null);ae((()=>{n&&r.current.focus()}),[n]);const i=Yr(ci().t$);return bt(ET,{className:"t-upload-preview",children:bt("div",{className:"t-preview",children:[bt(_T,{upload:e.upload,uploaded:n}),void 0!==t&&bt("div",{className:"t-error-row",children:t}),bt("div",{className:"t-send-row",children:[bt("button",{className:"t-cancel",onClick:()=>e.closePreview("cancel"),children:i.CANCEL}),void 0===t&&n&&bt("button",{className:"t-confirm-send test__confirm-upload-button",onClick:()=>e.closePreview("send"),ref:r,children:i.SEND_BUTTON_TEXT})]})]})})}function _T({upload:e,uploaded:t}){const n=Yr(ci().t$);return"location"!==e.type?bt(O,{children:[bt(DT,{upload:e}),bt(vT,{upload:e,uploaded:t,t:n})]}):t?bt(AT,{location:e.location}):bt("div",{className:"t-loading",children:bt(io,{})})}function AT({location:e}){const{imageUrl:t,linkUrl:n}=fT(e);return bt("a",{href:n,target:"_blank",rel:"noreferrer",className:"t-location-upload-preview",style:{background:`url(${JSON.stringify(t)}) center center / cover no-repeat`}})}const DT=yt.memo((function({upload:e}){let t=null;const n=e.file;if("video"===e.type){const r=/[.]ts/i.test(n.name)?"mpegts":"native";t=bt("div",{className:"video-container",children:bt(OT,{src:e.temporaryBlobUrl,videoType:r,playsInline:!0,controls:!0,preload:"auto"})})}else"image"===e.type?t=bt("div",{className:"t-img-container",children:bt("img",{src:URL.createObjectURL(n)})}):"audio"===e.type&&(t=bt(uu,{src:URL.createObjectURL(n),filename:n.name}));return t})),vT=yt.memo((function({uploaded:e,upload:t,t:n}){let r;r=e?t.metadata.filename:n.UPLOAD_IN_PROGRESS;let i="",o="";return"file"===t.type&&(i="is-file",e&&(o="file-block")),bt("div",{className:`t-filename-row ${i}`,children:bt("div",{className:o,children:r})})}));function OT(e){const{videoType:t,...n}=e;return bt("video",{...n})}function TT({controller:e,appId:t,chatHeaderVisible:n,messageFieldVisible:r,session:i,sendMessage:o}){const s=si(),a=ci(),u=ui(),l=function(e){const t=ei((()=>{const t=e.state$.extUserId.get(),n=e.state$.errors.get(),r=e.state$.authTokenState.get(),i=t&&e.state$.currentUser.get(),o=e.state$.currentConversation.get(),s=e.state$.extCurrentConversationId.get(),a=s&&e.state$.participants.child(s).get(),u=e.state$.app.get(),l=e.state$.device.get();return n.serverError?"server-error":n.wrongAppId?"wrong-app-id":"loading"===r||"idle"===r?"loading-token":"invalid"===r?"invalid-token":"expired"===r?"expired-token":"valid"===r?n.unknownUser?"unknown-user":n.unknownConversation?"loading-conv-failed":Boolean(i&&o&&a&&u&&l)?"loaded":"loading-data":void ii.unreachable()})),n=ei({type:"loading"});ti((r=>{const i=t.get(),o=e.state$.extCurrentConversationId.peek(),s=e.state$.extUserId.peek(),a=e.state$.appId.peek();function u(e){n.set({type:"loading"});const t=setTimeout((()=>{n.set(e)}),5e3);return()=>clearTimeout(t)}switch(i){case"invalid-token":n.set({type:"auth-failed"});break;case"expired-token":n.set({type:"expired-token"});break;case"wrong-app-id":n.set({type:"wrong-app-id",appId:a});break;case"server-error":n.set({type:"server-error"});break;case"loading-data":case"loading-token":n.set({type:"loading"});break;case"loaded":n.set({type:"loaded",conversationId:o,userId:s});break;case"loading-conv-failed":r.onCleanup=u({type:"inaccessible-conversation",userId:s,conversationId:o});break;case"unknown-user":r.onCleanup=u({type:"unknown-user",userId:s});break;default:ii.never(i)}}));const r=ei({type:"loading"});return ti((e=>{if("loading"===n.type.get()){r.set({type:"invisible-loading"});const t=setTimeout((()=>{r.set({type:"loading"})}),1e3);e.onCleanup=()=>{clearTimeout(t)}}else r.set(n.get())})),r}(a),c=Yr(l),{attachFile:d,shareLocation:h,uploadState:p}=function(e,t,n){const[r,i]=oe(null),o=he((async r=>{try{if(r||(r=(await new Promise((e=>{const t=document.createElement("input");t.type="file",t.multiple=!1,t.addEventListener("change",(()=>{e([...t.files])})),t.addEventListener("cancel",(()=>{e([])})),t.click()})))[0]),!r)return;const{uploadPromise:o,upload:s}=await async function(e,t){const n=e.name;if(function(e){return/\.(mp4|ts|mov|webm|ogv)$/i.test(e)}(e.name)){const r=await No("video",e,(e=>({width:e.videoWidth,height:e.videoHeight,duration:e.duration,filename:n}))),i=t.uploadVideo(e,r),o=function(e){switch(e.name.split(".").pop()){case"ts":return"video/MP2T";case"mov":return"video/quicktime";case"webm":return"video/webm";case"ogv":return"video/ogg";default:return"video/mp4"}}(e);return{uploadPromise:i,upload:{type:"video",file:e,metadata:r,temporaryBlobUrl:URL.createObjectURL(new Blob([e],{type:o}))}}}if(function(e){return/\.(mp3|m4a|ogg|oga|opus|flac|wav)$/i.test(e)}(e.name)){const r=await No("audio",e,(e=>({duration:e.duration,filename:n})));return{uploadPromise:t.uploadAudio(e,r),upload:{type:"audio",file:e,metadata:r,temporaryBlobUrl:URL.createObjectURL(new Blob([e]))}}}if(function(e){return/(gif|png|jpg|jpeg|svg|bmp|webp)$/i.test(e)}(e.name)){const r=await No("img",e,(e=>({width:e.naturalWidth,height:e.naturalHeight,filename:n})));return{uploadPromise:t.uploadImage(e,r),upload:{type:"image",file:e,metadata:r,temporaryBlobUrl:URL.createObjectURL(new Blob([e]))}}}const r={filename:n};return{uploadPromise:t.uploadFile(e,r),upload:{type:"file",file:e,metadata:r,temporaryBlobUrl:URL.createObjectURL(new Blob([e]))}}}(r,e),a=s.file.size+","+s.file.name;n.state$.localFileBlobUrls.child(n.state$.extCurrentConversationId.peek()).child(a).set({url:s.temporaryBlobUrl,fetching:!1}),n.latestFileUpload=s;const u=yo(),l={upload:s,closePreview:u.resolve,uploaded:!1};let c;i(l);try{c=await o,i({...l,uploaded:!0})}catch(e){i((n=>({...n,error:e.toString()})))}if("cancel"===await u.promise)return;ii.defined(c),t.sendFileMessage({fileToken:c})}finally{i(null)}}),[t,e,i,n]);return{attachFile:o,shareLocation:Co("geolocation",(async e=>{try{const n=yo(),r={upload:{type:"location",location:void 0},uploaded:!1,closePreview:n.resolve};i(r);const{permissionResult:o,location:s}=await new Promise((e=>{navigator.geolocation.getCurrentPosition((t=>{const n={latitude:t.coords.latitude,longitude:t.coords.longitude};e({permissionResult:"granted",location:n})}),(t=>{1===t.code?e({permissionResult:"denied"}):e({permissionResult:"granted"})}))}));if(e(o),!s)return;if(i({...r,upload:{type:"location",location:s},uploaded:!0}),"cancel"===await n.promise)return;t.sendLocationMessage({location:s})}finally{i(null)}}),[t,i]),uploadState:r}}(i,e,a);ae((()=>{u.uploadFile=d}),[u,d]);const[f,m]=oe(!1),E=he((e=>{d(e.dataTransfer.files[0]),e.preventDefault(),m(!1)}),[d]),g=he((e=>{e.preventDefault(),m(!0)}),[]),_=he((e=>{e.preventDefault(),m(!1)}),[]);return"invisible-loading"===c.type?bt(O,{}):"loading"===c.type?bt(uo,{}):"inaccessible-conversation"===c.type?bt(ao,{t:a.t$.peek()}):"unknown-user"===c.type||"auth-failed"===c.type||"wrong-app-id"===c.type||"server-error"===c.type||"unexpected-error"===c.type?bt(so,{appId:t,chatboxState:c}):"expired-token"==c.type?bt(lo,{t:a.t$.peek()}):"loaded"===c.type?bt("div",{className:"t-chatbox-content",onDragOver:g,onDragLeave:_,onDrop:E,children:bt(zr,{children:()=>bt(O,{children:[n&&bt(s.ChatHeader,{conversation:a.state$.currentConversation.get(),currentUser:a.state$.currentUser.get(),participants:a.state$.participants.child(c.conversationId).get(),t:a.t$.get(),chatbox:e,isUserConnected:a.state$.isUserConnected.get(),permissions:a.userPermissions$().get(),themeCustom:a.state$.themeCustom.get().value,device:a.state$.device.get()}),bt(no,{extConversationId:c.conversationId,controller:e}),r&&bt(s.MessageField,{conversation:a.state$.currentConversation.get(),currentUser:a.state$.currentUser.get(),participants:a.state$.participants.child(c.conversationId).get(),referencedMessage:a.referencedMessage$.get(),permissions:a.userPermissions$().get(),t:a.t$.get(),chatbox:e,editor:new co(u.state$.get(),o,d,h,u.toggleEmojiPicker),themeCustom:a.state$.themeCustom.get().value,device:a.state$.device.get()}),p&&bt(gT,{uploadState:p}),f&&bt(ET,{className:"t-drop-overlay",children:bt(s.Icon,{type:"attach",themeCustom:a.state$.themeCustom.get().value})})]})})}):bt(O,{})}class ST extends Error{constructor(e,t){const n=function(e){if("string"==typeof e)return e;if(Array.isArray(e))return e.join("\n");try{return JSON.stringify(e)}catch(t){return String(e)}}(e);super(n),this.userMessage=t??n,Object.setPrototypeOf&&Object.setPrototypeOf(this,new.target.prototype)}}const yT=console;class CT{constructor(e,t,n,r){this.apiUrls=e,this.appId=t,this.sessionId=n,this.authProvider=r,this._lastPutPromise=Promise.resolve()}async get(e,t={}){const n=this.endpointUrl(e,t),r=await bT((()=>this.fetchWithReauth(n)),{retries:11});return await this.handleResponse(r,n)}async queuedPut(e,t){await this._lastPutPromise;const n=bT((()=>this._doPut(e,t)));return this._lastPutPromise=n,n}put(e,t,n){const r=()=>this._doPut(e,t);return n?IT(r,n):bT(r,{retries:5})}post(e,t,n){const r=()=>this._doPost(e,t);return n?IT(r,n):bT(r,{retries:5})}delete(e,t={}){return bT((()=>this._doDelete(e,t)),{retries:11})}endpointUrl(e,t={}){const n=new URL(this.apiUrls.internalHttpApiUrl);n.pathname+=`/${this.appId}/${e}`,n.searchParams.set("sessionId",this.sessionId);for(const[r,i]of Object.entries(t))n.searchParams.set(r,i);return n}async _doPut(e,t){const n=this.endpointUrl(e),r=await this.fetchWithReauth(n,{method:"PUT",body:JSON.stringify(t)});return await this.handleResponse(r,n)}async _doPost(e,t){const n=this.endpointUrl(e),r=await this.fetchWithReauth(n,{method:"POST",body:JSON.stringify(t)});return await this.handleResponse(r,n)}async _doDelete(e,t){const n=this.endpointUrl(e,t),r=await this.fetchWithReauth(n,{method:"DELETE"});return await this.handleResponse(r,n)}async handleResponse(e,t){if(e.status>=300){if(404===e.status)throw fi.error(`[${this.appId}][BackendRestClient] Couldn't find resource.`),new ST("Could not find app.",`Could not find given appId: "${this.appId}". You can find your appId on https://talkjs.com/dashboard.`);if(401===e.status){const e=await this.authProvider.getToken();throw fi.error(`[${this.appId}][BackendRestClient] Couldn't authenticate ${t} with token ${e}.`),new ST("User not authenticated.","Could not authenticate user. Check if your signature is calculated correctly.")}if(e.status>=300&&e.status<500){const{error:t}=await e.json();throw new ST(t)}{const n=await e.text();throw new Error(`Got non-success response (${n}) from the server for url: ${t}.`)}}return await e.json()}async fetchWithReauth(e,t){function n(n){const r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`};return fetch(e,{...t,headers:r})}const r=await this.authProvider.getToken(),i=await n(r);return 401!==i.status?i:(yT.error(`401 error from ${t?.method} ${e}, ${r}`),this.authProvider.refreshToken(),n(await this.authProvider.getToken()))}}function NT(e){return!e.userMessage}function bT(e,{retries:t=30}={}){return So(t,e,{shouldRetry:NT,log:yT.warn.bind(yT),maxDelay:30,initialDelay:.2})}async function IT(e,t){try{return await e()}catch(e){if(!NT(e))throw e}let n=!1;return t.then((()=>{n=!0})),So(1e3,e,{initialDelay:.2,maxDelay:30,shouldRetry:()=>!n,log:yT.warn.bind(yT)})}var RT={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",o="[object Function]",s="[object Object]",a=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[i]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[o]=l["[object Map]"]=l["[object Number]"]=l[s]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var c,d="object"==typeof br&&br&&br.Object===Object&&br,h="object"==typeof self&&self&&self.Object===Object&&self,p=d||h||Function("return this")(),f=t&&!t.nodeType&&t,m=f&&e&&!e.nodeType&&e,E=m&&m.exports===f,g=E&&d.process,_=function(){try{return m&&m.require&&m.require("util").types||g&&g.binding&&g.binding("util")}catch(e){}}(),A=_&&_.isTypedArray,D=Array.prototype,v=Function.prototype,O=Object.prototype,T=p["__core-js_shared__"],S=v.toString,y=O.hasOwnProperty,C=(c=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+c:"",N=O.toString,b=S.call(Object),I=RegExp("^"+S.call(y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=E?p.Buffer:void 0,w=p.Symbol,k=p.Uint8Array;R&&R.allocUnsafe;var L,x,M=(L=Object.getPrototypeOf,x=Object,function(e){return L(x(e))}),F=Object.create,B=O.propertyIsEnumerable,P=D.splice,U=w?w.toStringTag:void 0,H=function(){try{var e=se(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),j=R?R.isBuffer:void 0,$=Math.max,Y=Date.now,z=se(p,"Map"),V=se(Object,"create"),G=function(){function e(){}return function(t){if(!_e(t))return{};if(F)return F(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function W(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function K(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function q(e){var t=this.__data__=new X(e);this.size=t.size}function J(e,t,n){(void 0!==n&&!de(e[t],n)||void 0===n&&!(t in e))&&ee(e,t,n)}function Z(e,t,n){var r=e[t];y.call(e,t)&&de(r,n)&&(void 0!==n||t in e)||ee(e,t,n)}function Q(e,t){for(var n=e.length;n--;)if(de(e[n][0],t))return n;return-1}function ee(e,t,n){"__proto__"==t&&H?H(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}W.prototype.clear=function(){this.__data__=V?V(null):{},this.size=0},W.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},W.prototype.get=function(e){var t=this.__data__;if(V){var r=t[e];return r===n?void 0:r}return y.call(t,e)?t[e]:void 0},W.prototype.has=function(e){var t=this.__data__;return V?void 0!==t[e]:y.call(t,e)},W.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=V&&void 0===t?n:t,this},X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,n=Q(t,e);return!(n<0||(n==t.length-1?t.pop():P.call(t,n,1),--this.size,0))},X.prototype.get=function(e){var t=this.__data__,n=Q(t,e);return n<0?void 0:t[n][1]},X.prototype.has=function(e){return Q(this.__data__,e)>-1},X.prototype.set=function(e,t){var n=this.__data__,r=Q(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},K.prototype.clear=function(){this.size=0,this.__data__={hash:new W,map:new(z||X),string:new W}},K.prototype.delete=function(e){var t=oe(this,e).delete(e);return this.size-=t?1:0,t},K.prototype.get=function(e){return oe(this,e).get(e)},K.prototype.has=function(e){return oe(this,e).has(e)},K.prototype.set=function(e,t){var n=oe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},q.prototype.clear=function(){this.__data__=new X,this.size=0},q.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},q.prototype.get=function(e){return this.__data__.get(e)},q.prototype.has=function(e){return this.__data__.has(e)},q.prototype.set=function(e,t){var n=this.__data__;if(n instanceof X){var r=n.__data__;if(!z||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new K(r)}return n.set(e,t),this.size=n.size,this};function te(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":U&&U in Object(e)?function(e){var t=y.call(e,U),n=e[U];try{e[U]=void 0;var r=!0}catch(e){}var i=N.call(e);return r&&(t?e[U]=n:delete e[U]),i}(e):function(e){return N.call(e)}(e)}function ne(e){return Ae(e)&&te(e)==i}function re(e,t,n,r,i){e!==t&&function(e,t,n){for(var r=-1,i=Object(e),o=n(e),s=o.length;s--;){var a=o[++r];if(!1===t(i[a],a,i))break}}(t,(function(o,a){if(i||(i=new q),_e(o))!function(e,t,n,r,i,o,a){var u=le(e,n),l=le(t,n),c=a.get(l);if(c)J(e,n,c);else{var d,h=o?o(u,l,n+"",e,t,a):void 0,p=void 0===h;if(p){var f=pe(l),m=!f&&me(l),E=!f&&!m&&De(l);h=l,f||m||E?pe(u)?h=u:Ae(d=u)&&fe(d)?h=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(u):m?(p=!1,h=l.slice()):E?(p=!1,h=function(e){var t,n,r=(n=new(t=e.buffer).constructor(t.byteLength),new k(n).set(new k(t)),n);return new e.constructor(r,e.byteOffset,e.length)}(l)):h=[]:function(e){if(!Ae(e)||te(e)!=s)return!1;var t=M(e);if(null===t)return!0;var n=y.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&S.call(n)==b}(l)||he(l)?(h=u,he(u)?h=function(e){return function(e,t,n){var r=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var s=t[i],a=void 0;void 0===a&&(a=e[s]),r?ee(n,s,a):Z(n,s,a)}return n}(e,ve(e))}(u):_e(u)&&!Ee(u)||(h=function(e){return"function"!=typeof e.constructor||ue(e)?{}:G(M(e))}(l))):p=!1}p&&(a.set(l,h),i(h,l,r,o,a),a.delete(l)),J(e,n,h)}}(e,t,a,n,re,r,i);else{var u=r?r(le(e,a),o,a+"",e,t,i):void 0;void 0===u&&(u=o),J(e,a,u)}}),ve)}var ie=H?function(e,t){return H(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Se;function oe(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function se(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!_e(e)||function(e){return!!C&&C in e}(e))&&(Ee(e)?I:a).test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}function ae(e,t){var n=typeof e;return!!(t=null==t?r:t)&&("number"==n||"symbol"!=n&&u.test(e))&&e>-1&&e%1==0&&e<t}function ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||O)}function le(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ce=function(e){var t=0,n=0;return function(){var r=Y(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ie);function de(e,t){return e===t||e!=e&&t!=t}var he=ne(function(){return arguments}())?ne:function(e){return Ae(e)&&y.call(e,"callee")&&!B.call(e,"callee")},pe=Array.isArray;function fe(e){return null!=e&&ge(e.length)&&!Ee(e)}var me=j||function(){return!1};function Ee(e){if(!_e(e))return!1;var t=te(e);return t==o||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ge(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function _e(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ae(e){return null!=e&&"object"==typeof e}var De=A?function(e){return function(t){return e(t)}}(A):function(e){return Ae(e)&&ge(e.length)&&!!l[te(e)]};function ve(e){return fe(e)?function(e){var t=pe(e),n=!t&&he(e),r=!t&&!n&&me(e),i=!t&&!n&&!r&&De(e),o=t||n||r||i,s=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],a=s.length;for(var u in e)o&&("length"==u||r&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ae(u,a))||s.push(u);return s}(e):function(e){if(!_e(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ue(e),n=[];for(var r in e)("constructor"!=r||!t&&y.call(e,r))&&n.push(r);return n}(e)}var Oe,Te=(Oe=function(e,t,n){re(e,t,n)},function(e,t){return ce(function(e,t,n){return t=$(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=$(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,a)}}(e,t,Se),e+"")}((function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=Oe.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(e,t,n){if(!_e(n))return!1;var r=typeof t;return!!("number"==r?fe(n)&&ae(t,n.length):"string"==r&&t in n)&&de(n[t],e)}(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var s=t[n];s&&Oe(e,s,n)}return e})));function Se(e){return e}e.exports=Te}(RT,RT.exports);const wT=Ir(RT.exports);class kT{constructor(e,t,n,r){this.backendRestClient=new CT(e,t,n,r)}async getApp(e){return function(e){return{appMetadata:{...e.appMetadata,id:e.appMetadata.id},features:e.features,role:LT(e.configuration,e.features)}}(await this.backendRestClient.get("/app",{role_name:e}))}async checkIfAppExists(){return this.backendRestClient.get("/app").then((()=>!0)).catch((e=>{if("Could not find app."===e.message)return!1;throw e}))}}function LT(e,t){const n={general:{enableFileTransfers:t.includes("file_sharing"),enableLocation:t.includes("location_sharing"),enableMentions:!1,showTypingIndicators:!0,enablePresence:!1,enableVoiceRecording:!1},theme:{version:"v2",name:"default"},permissions:{messages:{delete:"own",edit:"own",reply:"all",emojiReactions:"all"},messagesCustom:{},conversations:{leave:"none",markAsUnread:"none"},conversationsCustom:{}},generalNotificationSettings:{timeout:"15"},emailSettings:{enabled:!0,subject:"{{sender.name}} wants to chat with you on {{app.name}}",replySeparator:"--- Write ABOVE THIS LINE to post a reply via email ---",unsubscribeText:"Unsubscribe from all chat emails",senderName:"{{sender.name}} (via {{app.name}})",header:"Hi {{recipient.name}},\n {{sender.name}} wants to chat with you on {{app.name}}:",includeMessages:!0,inboxUrl:"{{app.custom.websiteUrl}}",inboxLinkText:"Join the chat",footer:"On behalf of {{sender.name}},\n The {{app.name}} team",enableReplyToEmail:t.includes("reply_via_email"),emailThemeType:t.includes("email_templates")?"custom":"standard",emailTheme:"default_email",emailAttachmentMode:"enabledExcludingImages",htmlTemplate:'<div>\n Hi {{recipient.name}}, <br/>\n <br/>\n {{sender.name}} wants to chat with you on {{app.name}}:<br/>\n <br/>\n {{messages.all}}\n <br/>\n <a href="{{app.custom.websiteUrl}}">Join the chat</a>\n <br/>\n <br/>\n On behalf of {{sender.name}},<br/>\n The {{app.name}} team<br/>\n <br/>\n</div>',textTemplate:"Hi {{recipient.name}},\n\n{{sender.name}} wants to chat with you on {{app.name}}:\n\n{{messages.all}}\n\n{{app.custom.websiteUrl}} Join the chat\n\nOn behalf of {{sender.name}},\nThe {{app.name}} team"},smsSettings:{enabled:t.includes("sms_notifications"),smsTemplate:'({{app.name}}) {{sender.name}}: "{{messages}}". Reply here: {{app.custom.websiteUrl}}',maximumSegments:"1",enableAutoOptOutText:!1,optOutText:"To stop receiving these messages, reply STOP."},suppressContactInfo:{mode:"off",suppressLinks:!0,suppressEmailAddresses:!0,suppressPhoneNumbers:!0},sameTabLinkRules:[]};return wT(n,e)}function xT(e,t){const n=e.map((e=>function(e,t){if("text"===e.type)return function(e,t){return MT(e,sg(t))}(e.children,t);if("file"===e.type&&"video"===e.subtype)return`🎥 ${vo(e.url)}`;if("file"===e.type&&"image"===e.subtype)return`📷 ${vo(e.url)}`;if("file"===e.type&&"audio"===e.subtype)return`🎧 ${vo(e.url)}`;if("file"===e.type&&"voice"===e.subtype){const t=e.duration;return void 0===t?"🎙️":`🎙️ (${Math.floor(t/60)}:${Math.floor(t%60).toString().padStart(2,"0")})`}return"file"===e.type?(e.subtype,`📎 ${vo(e.url)}`):"location"===e.type?"📍":""}(e,t)));return n.join("\n\n")}function MT(e,t){return e.flatMap((e=>{if("string"==typeof e)return e;switch(e.type){case"blockquote":case"bold":case"italic":case"strikethrough":case"link":case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return MT(e.children,t);case"bulletlist":case"bulletList":return"\n"+MT(e.children,t);case"bulletpoint":case"bulletPoint":return"- "+MT(e.children,t)+"\n";case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"emoji":case"customemoji":case"customEmoji":return e.text;case"suppressed":return t.contactInfoHiddenText;case"mention":return`@${e.text}`}})).join("")}function FT(){const e="undefined"!=typeof window?window.crypto:void 0,t=e?()=>e.getRandomValues(new Uint8Array(1))[0]:()=>Math.floor(255*Math.random());return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(e^t()&15>>e/4).toString(16)))}class BT{constructor(e,t,n,r,i){this.store=e,this.talkSession=t,this.editorInternals=n,this.onSendMessage=r,this.onDeleteMessage=i}async deleteMessage(e){const t=this.store.state$.extCurrentConversationId.peek(),n=this.store.state$.messages.child(t).lookup.child(e).peek(),r=this.talkSession.conversation(t).message(e),[i]=await Promise.all([n??r.get(),r.delete()]);if(i){const e={currentUser:this.store.state$.currentUser.peek(),conversation:this.store.state$.currentConversation.peek(),message:n};this.onDeleteMessage(e)}}async editMessage(e,t){const n=this.store.state$.extCurrentConversationId.peek();await this.talkSession.conversation(n).message(e).edit(t)}setReferencedMessage(e){this.store.state$.referencedMessageId.set(e)}sendMessage(e){return this._send({text:e.text,custom:e.custom,referencedMessage:e.referencedMessageId})}sendFileMessage(e){const t={type:"file",fileToken:e.fileToken};return this._send({content:[t],custom:e.custom})}sendLocationMessage(e){const t={type:"location",latitude:e.location.latitude,longitude:e.location.longitude};return this._send({content:[t],custom:e.custom})}async _send(e){const t=this.store.state$.extCurrentConversationId.peek(),n=await async function(e,t){const n=e.state$.extCurrentConversationId.peek(),r=e.state$.messages.child(n),i="string"==typeof t.referencedMessage?r.lookup.child(t.referencedMessage).peek():await(t.referencedMessage?.get()??null),o=i&&{...i,type:"UserMessage",sender:i.sender,referencedMessageId:i.referencedMessage?.id??null};o&&delete o.referencedMessage;const s=e.latestFileUpload,a="content"in t?[PT(s,t.content[0])]:[{type:"text",children:[t.text]}],u="text"in t?t.text:xT(t.content.map((e=>PT(s,e))),{});return{id:"ephemeral-"+FT(),type:"UserMessage",sender:e.state$.currentUser.peek(),createdAt:Date.now(),editedAt:null,custom:t.custom??{},origin:"web",referencedMessage:o,reactions:[],content:a,plaintext:u}}(this.store,e);this.store.state$.ephemeralMessages.child(t).child(n.id).set(n);const r=yo();this.store.readyForNewMessagesPromise=r.promise;const i=await this.talkSession.conversation(t).send(e);this.store.state$.ephemeralMessageIdMapping.child(t).child(i.id).set(n.id),r.resolve(),this.onSendMessage({message:await i.get(),currentUser:this.store.state$.currentUser.peek(),conversation:this.store.state$.currentConversation.peek()})}getMessageFieldText(){return this.editorInternals.getText()}setMessageFieldText(e){this.editorInternals.setText(e)}markAsTyping(){const e=this.store.state$.extCurrentConversationId.peek();this.talkSession.conversation(e).markAsTyping()}}function PT(e,t){switch(t.type){case"text":case"location":return t;case"file":return function(e,t){return{type:"file",subtype:"file"===e.type?void 0:e.type,...e.metadata,size:e.file.size,filename:e.file.name,fileToken:t.fileToken,url:e.temporaryBlobUrl}}(e,t)}}class UT{constructor(e,t,n){this.realtimeWsApiUrl=e,this.internalHttpApiUrl=t,this.restApiHttpUrl=n}getBokensUrl(e,t,n){return this.internalHttpApiUrl+`/${e}/bokens/${encodeURIComponent(t)}?signature=${encodeURIComponent(n??"")}`}getRealtimeWsUrl(e,t,n,r,i){const o=encodeURIComponent(t);return this.realtimeWsApiUrl+`/${e}/realtime/${o}?talkjs-client-build=${i??"standalone"}&talkjs-core=${n}&talkjs-client-id=${r}`}static fromHost(e){const t=new UT("wss://realtime.talkjs.com/v1","https://app.talkjs.com/api/v0","https://api.talkjs.com/v1");if(!e)return t;if(e.endsWith("talkjs.com")){const n=e.match(/\w+-(\w+)\.talkjs\.com/);if(n){const e=n[1];return new UT(`wss://realtime-${e}.talkjs.com/v1`,`https://app-${e}.talkjs.com/api/v0`,`https://api-${e}.talkjs.com/v1`)}return t}return e.includes("localhost")||e.includes("localtest.me")||/^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e)?new UT(`ws://${e}/public_api/v1`,`http://${e}/api/v0`,`http://${e}/public_api/v1`):new UT(`wss://${e}/public_api/v1`,`https://${e}/api/v0`,`https://${e}/public_api/v1`)}}var HT,jT=Object.defineProperty,$T=Object.defineProperties,YT=Object.getOwnPropertyDescriptors,zT=Object.getOwnPropertySymbols,VT=Object.prototype.hasOwnProperty,GT=Object.prototype.propertyIsEnumerable,WT=(e,t,n)=>t in e?jT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XT=(e,t)=>{for(var n in t||(t={}))VT.call(t,n)&&WT(e,n,t[n]);if(zT)for(var n of zT(t))GT.call(t,n)&&WT(e,n,t[n]);return e},KT=(e,t)=>$T(e,YT(t)),qT=(e,t)=>{var n={};for(var r in e)VT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&zT)for(var r of zT(e))t.indexOf(r)<0&>.call(e,r)&&(n[r]=e[r]);return n},JT=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function ZT(e,t){if(t.ok)return t.value.data;if("SESSION_DESTROYED"===t.value)throw new Error(`${e} failed because the session was destroyed`);if("server"===t.where)throw new Error(QT(e,t.value));throw"unreachable"}function QT(e,t){let n;return n=Array.isArray(t.reasons)?t.reasons.join():JSON.stringify(t.reasons),`${e} failed, got status ${t.status} ${t.errorCode}, reasons: ${n}`}function eS(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if("*"!==t[n]&&e[n]!==t[n])return!1;return!0}function tS(e){return e<=0?Promise.resolve():new Promise((t=>setTimeout(t,e)))}function nS(e,t){return e*(1-t+2*Math.random()*t)}const rS=()=>!0;function iS(e,t,n){return JT(this,arguments,(function*(e,t,{initialDelay:n,maxDelay:r,log:i,shouldRetry:o=rS}){return t().catch((s=>JT(this,null,(function*(){if(0===e)throw s;if(!(yield o(s)))throw s;const a=1e3*n*1.2,u=nS(r?Math.min(1e3*r,a):a,.05);return tS(u).then((()=>iS(e-1,t,{initialDelay:u/1e3,maxDelay:r,log:i,shouldRetry:o})))}))))}))}function oS(){const e={},t=new Promise((function(t,n){e.resolve=t,e.reject=n}));return e.promise=t,e}class sS{constructor(e,t,n){this.layer=e,this.states=t,this.transitions=n,this._state=t[0]}get state(){return this._state}transition(e){const t=this.transitions[e];if(!t)return;if(!this.canTransition(e))return;const n=this.state;this._state=t.to,t.afterTransition({from:n,to:this.state})}canTransition(e){const t=this.transitions[e];return!!t&&("ANY"===t.from||t.from.includes(this.state))}}function aS(e){return{ok:!0,value:e}}function uS(e){return{ok:!1,where:"client",value:e}}function lS(e){return{ok:!1,where:"server",value:e}}function cS(){const e={},t=new Promise((t=>{e.ok=e=>JT(this,null,(function*(){return t(aS(e))})),e.clientErr=e=>t(uS(e)),e.serverErr=e=>t(lS(e)),e.resolve=e=>t(e)}));return e.promise=t,e}class dS{constructor(e,t){this.realtimeUrl=e,this.handlers=t,this.socket=null,this.stateMachine=new sS("ReconnectingSocket",["STOPPED","CONNECTING","READY","DISCONNECTED","TERMINATED"],{startWs:{from:["STOPPED","DISCONNECTED"],to:"CONNECTING",afterTransition:()=>{const e=new(function(){if(globalThis.WebSocket)return globalThis.WebSocket;throw new Error("Missing WebSocket implementation")}())(this.realtimeUrl+"&talkjs-time="+Date.now());this.socket=e,e.addEventListener("open",(()=>{this.socket===e&&this.stateMachine.transition("onOpen")})),e.addEventListener("close",(()=>{this.socket===e&&this.stateMachine.transition("onClose")})),e.addEventListener("message",(t=>{this.socket===e&&this.handlers.onMessage(t)}))}},onOpen:{from:["CONNECTING"],to:"READY",afterTransition:()=>{this.handlers.onOpen()}},onClose:{from:["CONNECTING","READY"],to:"DISCONNECTED",afterTransition:e=>JT(this,[e],(function*({from:e}){"READY"===e&&this.handlers.onClose(),this.socket=null;const t=nS(1e4,.5);setTimeout((()=>{"DISCONNECTED"===this.stateMachine.state&&this.stateMachine.transition("startWs")}),t)}))},stopWs:{from:["CONNECTING","DISCONNECTED","READY"],to:"STOPPED",afterTransition:({from:e})=>{"READY"===e&&this.handlers.onClose();const t=this.socket;this.socket=null,null==t||t.close(1e3)}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{const e=this.socket;this.socket=null,null==e||e.close(1e3)}}})}stopWs(){this.stateMachine.transition("stopWs")}startWs(){this.stateMachine.transition("startWs")}send(e){return"READY"===this.stateMachine.state?(this.socket.send(e),aS(void 0)):uS("SOCKET_NOT_READY")}terminate(){const e=this.socket;this.stateMachine.canTransition("onClose")&&this.stateMachine.transition("onClose"),e&&("terminate"in e?e.terminate():e.close(1e3))}destroy(){this.stateMachine.transition("destroy")}}class hS{constructor(e,t){this.handlers=t,this.socket=new dS(e,{onOpen:()=>this.handlers.onOpen(),onClose:()=>this.handlers.onClose(),onMessage:e=>this.onWebSocketMessage(e)})}call(e,t,n,r){const i=`/${n.map((e=>encodeURIComponent(e))).join("/")}`,o=JSON.stringify([e,t,i,r]);return this.socket.send(o)}stopWs(){this.socket.stopWs()}startWs(){this.socket.startWs()}destroy(){this.socket.destroy()}terminate(){this.socket.terminate()}onWebSocketMessage(e){if("Auth token expired"!==e.data)try{const t=JSON.parse(e.data);if("PUBLISH"===t[1]){const e=t[0],n=JSON.stringify([e,"ACK"]);this.socket.send(n);const r=t.slice(2),i=[];r.forEach((e=>{"session.expired"===e.type?this.handlers.onAuthExpired():"upstream.restarting"===e.type?this.handlers.onUpstreamRestarting():i.push(e)})),i.length>0&&this.handlers.onPublish(e,i)}else{const e=t[0],n=t[1],r=t[2];this.handlers.onResponse(e,n,r)}}catch(e){}else this.handlers.onAuthExpired()}}class pS{constructor(e){this.delayMs=e,this.timeout=void 0}schedule(e){this.stop(),this.timeout=setTimeout((()=>{void 0!==this.timeout&&(this.stop(),e())}),this.delayMs)}stop(){void 0!==this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)}}class fS{constructor(){this.i=-1}next(){return this.i++,this.i}reset(){this.i=-1}}class mS{constructor(e,t){this.handlers=t,this.seqCounter=new fS,this.responseHandlers={},this.heartbeats=new ES(this),this.socket=new hS(e,{onUpstreamRestarting:()=>{this.heartbeats.serverActive(),this.handlers.onUpstreamRestarting()},onOpen:()=>{this.heartbeats.clientActive(),this.heartbeats.serverActive(),this.handlers.onReady()},onClose:()=>{this.heartbeats.stop(),Object.values(this.responseHandlers).forEach((e=>{e.clientErr("WEBSOCKET_DISCONNECTED")})),this.responseHandlers={},this.seqCounter.reset(),this.handlers.onNotReady()},onResponse:(e,t,n)=>{this.heartbeats.serverActive(),this.onResponse(e,t,n)},onPublish:(e,t)=>{this.heartbeats.serverActive(),this.handlers.onPublish(e,t),this.heartbeats.clientActive()},onAuthExpired:()=>{this.heartbeats.serverActive(),this.handlers.onAuthExpired()}})}call(e,t,n){const r=this.seqCounter.next(),i=cS();this.responseHandlers[r]=i;const o=this.socket.call(r,e,t,n);return o.ok||i.resolve(o),this.heartbeats.clientActive(),i.promise}onResponse(e,t,n){return JT(this,null,(function*(){const r=this.responseHandlers[e];r&&(200===t?r.ok({status:t,data:n}):r.serverErr({status:t,errorCode:n.errorCode,reasons:n.reasons}),delete this.responseHandlers[e])}))}stopWs(){this.socket.stopWs()}startWs(){this.socket.startWs()}destroy(){this.heartbeats.stop(),Object.values(this.responseHandlers).forEach((e=>{e.clientErr("WEBSOCKET_DISCONNECTED")})),this.responseHandlers={},this.socket.destroy()}terminate(){this.socket.terminate()}}class ES{constructor(e){this.connection=e,this.clientInactivityTimer=new pS(25e3),this.serverInactivityTimer=new pS(1e4),this.serverTimeoutTimer=new pS(5e3)}clientActive(){this.clientInactivityTimer.schedule((()=>{this.sendHeartbeat()}))}serverActive(){this.serverTimeoutTimer.stop(),this.serverInactivityTimer.schedule((()=>{this.sendHeartbeat(),this.serverTimeoutTimer.schedule((()=>{this.connection.terminate()}))}))}stop(){this.clientInactivityTimer.stop(),this.serverInactivityTimer.stop(),this.serverTimeoutTimer.stop()}sendHeartbeat(){this.connection.call("GET",["ping"],{}).catch((()=>{}))}}class gS{constructor(e,t,n){this.authProvider=t,this.handlers=n,this.stateMachine=new sS("AuthenticatedConnection",["WAITING_FOR_WS","LOGGING_IN","RENEWING_SESSION","READY","TERMINATED"],{logIn:{from:["WAITING_FOR_WS"],to:"LOGGING_IN",afterTransition:()=>JT(this,null,(function*(){yield this.renewSession()}))},logInFailed:{from:["LOGGING_IN"],to:"LOGGING_IN",afterTransition:()=>JT(this,null,(function*(){this.authProvider.refreshToken(),yield this.renewSession()}))},scheduledReauth:{from:["READY"],to:"RENEWING_SESSION",afterTransition:()=>JT(this,null,(function*(){yield this.renewSession()}))},scheduledReauthFailed:{from:["RENEWING_SESSION"],to:"RENEWING_SESSION",afterTransition:()=>JT(this,null,(function*(){this.authProvider.refreshToken(),yield this.renewSession()}))},authenticated:{from:["LOGGING_IN","RENEWING_SESSION"],to:"READY",afterTransition:({from:e})=>{"LOGGING_IN"===e&&this.handlers.onReady()}},authExpired:{from:["READY","RENEWING_SESSION"],to:"LOGGING_IN",afterTransition:()=>JT(this,null,(function*(){this.handlers.onNotReady(),this.authProvider.refreshToken(),yield this.renewSession()}))},wsDisconnected:{from:["READY","LOGGING_IN","RENEWING_SESSION"],to:"WAITING_FOR_WS",afterTransition:({from:e})=>{"READY"!==e&&"RENEWING_SESSION"!==e||this.handlers.onNotReady(),this.authProvider.clearScheduledRefresh()}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{this.authProvider.clearScheduledRefresh(),this.connection.destroy()}}}),this.connection=new mS(e,{onUpstreamRestarting:()=>this.handlers.onUpstreamRestarting(),onReady:()=>this.stateMachine.transition("logIn"),onNotReady:()=>{this.stateMachine.transition("wsDisconnected")},onAuthExpired:()=>{this.stateMachine.transition("authExpired")},onPublish:(e,t)=>{this.handlers.onPublish(e,t)}}),t.onTokenChanged((()=>{"READY"===this.stateMachine.state&&this.stateMachine.transition("scheduledReauth")}))}call(e,t,n){const r=this.connection.call(e,t,n);return r.then((e=>{e.ok||"server"!==e.where||401!==e.value.status||"READY"!==this.stateMachine.state&&"RENEWING_SESSION"!==this.stateMachine.state||this.stateMachine.transition("authExpired")})),r}stopWs(){this.connection.stopWs()}startWs(){this.connection.startWs()}destroy(){this.stateMachine.transition("destroy")}renewSession(){return JT(this,null,(function*(){const e=yield this.authProvider.getToken(),t=yield this.connection.call("POST",["session","renew"],{token:e});if(!t.ok&&"client"===t.where)return;const n=t.value;if(n.status,200===n.status){const t=n.data.expiresInSeconds;return void(null!==t&&t<120?(console.warn(`[TalkJS] Authenticated with a token that expires in ${t}s. Treating it as already expired and refreshing. Newly generated tokens should last at least 10 minutes.`),"LOGGING_IN"===this.stateMachine.state?this.stateMachine.transition("logInFailed"):"RENEWING_SESSION"===this.stateMachine.state&&this.stateMachine.transition("scheduledReauthFailed")):(this.authProvider.scheduleRefresh(t),this.authProvider.emitTokenAccepted(e),this.stateMachine.canTransition("authenticated")&&this.stateMachine.transition("authenticated")))}if(401===n.status)return void("LOGGING_IN"===this.stateMachine.state?this.stateMachine.transition("logInFailed"):"RENEWING_SESSION"===this.stateMachine.state&&this.stateMachine.transition("scheduledReauthFailed"));if(400===n.status)return void this.authProvider.emitTokenRefreshFailed(QT("Authentication",n));if(402===n.status)return void this.authProvider.emitTokenRefreshFailed(QT("Authentication",n));const r=5e3*Math.random()+5e3;setTimeout((()=>{this.call("POST",["session","renew"],{token:e}).catch((()=>{}))}),r)}))}}class _S{constructor(e,t,n){this.handlers=n,this.stateMachine=new sS("StopStartConnection",["STOPPED","WAITING_FOR_WS","READY","TERMINATED"],{unexpectedDisconnect:{from:["READY"],to:"WAITING_FOR_WS",afterTransition:()=>{this.inactivityTimer.stop(),this.handlers.onNotReady()}},stop:{from:["WAITING_FOR_WS","READY"],to:"STOPPED",afterTransition:()=>{this.connection.stopWs(),this.inactivityTimer.stop(),this.handlers.onNotReady()}},start:{from:["STOPPED"],to:"WAITING_FOR_WS",afterTransition:()=>{this.connection.startWs()}},ready:{from:["WAITING_FOR_WS"],to:"READY",afterTransition:()=>{this.pendingCalls=0,this.activeSubscriptions=0,this.inactivityTimer.schedule((()=>{this.stateMachine.transition("stop")})),this.handlers.onReady()}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{this.inactivityTimer.stop(),this.connection.destroy()}}}),this.pendingCalls=0,this.activeSubscriptions=0,this.inactivityTimer=new pS(3e3),this.connection=new gS(e,t,{onUpstreamRestarting:()=>{this.handlers.onUpstreamRestarting()},onReady:()=>{this.stateMachine.transition("ready")},onNotReady:()=>{"READY"===this.stateMachine.state&&this.stateMachine.transition("unexpectedDisconnect")},onPublish:(e,t)=>{this.handlers.onPublish(e,t)}})}get inactive(){return 0===this.pendingCalls&&0===this.activeSubscriptions}ensureStarted(){this.stateMachine.canTransition("start")&&this.stateMachine.transition("start")}call(e,t,n){return JT(this,null,(function*(){this.inactivityTimer.stop(),this.pendingCalls++;const r=yield this.connection.call(e,t,n);return this.pendingCalls--,"SUBSCRIBE"===e&&r.ok?this.activeSubscriptions++:"UNSUBSCRIBE"===e&&r.ok&&this.activeSubscriptions--,this.inactive&&this.inactivityTimer.schedule((()=>{this.stateMachine.transition("stop")})),r}))}destroy(){this.stateMachine.transition("destroy")}isConnected(){return"READY"===this.stateMachine.state}}class AS{constructor(e,t,n){this.handlers=n,this.stateMachine=new sS("QueuedConnection",["NOT_READY","PROCESSING_QUEUE","READY","TERMINATED"],{processQueue:{from:["NOT_READY"],to:"PROCESSING_QUEUE",afterTransition:()=>{this.sendQueuedCalls()}},ready:{from:["PROCESSING_QUEUE"],to:"READY",afterTransition:()=>{this.handlers.onReady()}},notReady:{from:["PROCESSING_QUEUE","READY"],to:"NOT_READY",afterTransition:()=>{Object.values(this.subscribeQueue).forEach((e=>e.deferred.ok({status:200,data:{}}))),this.subscribeQueue={},this.handlers.onSubscriptionsLost()}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{for(var e;this.callQueue.length;){const t=null==(e=this.callQueue.shift())?void 0:e.deferred;null==t||t.clientErr("SESSION_DESTROYED")}this.connection.destroy()}}}),this.subscribeQueue={},this.callQueue=[],this.connection=new _S(e,t,{onUpstreamRestarting:()=>{this.handlers.onUpstreamRestarting()},onReady:()=>{this.stateMachine.transition("processQueue")},onNotReady:()=>{this.stateMachine.transition("notReady")},onPublish:(e,t)=>{this.handlers.onPublish(e,t)}})}call(e,t,n){return"READY"===this.stateMachine.state?this.connection.call(e,t,n):("NOT_READY"===this.stateMachine.state&&this.connection.ensureStarted(),"SUBSCRIBE"===e||"UNSUBSCRIBE"===e?this._subscribe(e,t,n):this._call(e,t,n))}_subscribe(e,t,n){const r=t.join("/"),i=this.subscribeQueue[r];if(i&&i.method===e)return i.deferred.promise;i&&i.method!==e&&(i.deferred.ok({status:200,data:{}}),delete this.subscribeQueue[r]);const o={deferred:cS(),method:e,path:t,data:n};return this.subscribeQueue[r]=o,o.deferred.promise}_call(e,t,n){const r={deferred:cS(),method:e,path:t,data:n};return this.callQueue.push(r),r.deferred.promise}dequeue(){for(const e in this.subscribeQueue){const t=this.subscribeQueue[e];return delete this.subscribeQueue[e],t}return this.callQueue.shift()}destroy(){this.stateMachine.transition("destroy")}sendQueuedCalls(){return JT(this,null,(function*(){let e=0;for(;"PROCESSING_QUEUE"===this.stateMachine.state;){e++;const t=this.dequeue();if(!t)return void this.stateMachine.transition("ready");this.connection.call(t.method,t.path,t.data).then((e=>{t.deferred.resolve(e)})),e>50&&(yield new Promise((e=>setTimeout(e,100))))}}))}isConnected(){return"READY"===this.stateMachine.state||"PROCESSING_QUEUE"===this.stateMachine.state}}const DS="undefined"!=typeof window&&null!=(HT=window.queueMicrotask)?HT:setTimeout;class vS{constructor(e,t){this.clearPendingBatch=e,this.sendCalls=t,this.sent=!1,DS((()=>this.send()))}send(){this.sent||(this.sent=!0,this.clearPendingBatch(),this.sendCalls())}destroy(){this.sent=!0}}class OS extends vS{constructor(e,t){super(t,(()=>{this.sendSubscribe(),this.sendGet()})),this.connection=e,this.getCalls=[],this.subscribeCalls=[]}canPush(e,t){return OS.isCorrectBatchTypeFor(e,t)}static isCorrectBatchTypeFor(e,t){return eS(t,["users","*"])&&("GET"===e||"SUBSCRIBE"===e)}push(e,t,n){const r=t[1],i=cS();return"GET"===e?this.getCalls.push({userId:r,deferred:i}):this.subscribeCalls.push({userId:r,deferred:i}),1e3!==this.getCalls.length&&1e3!==this.subscribeCalls.length||this.send(),i.promise}sendGet(){return JT(this,null,(function*(){if(0===this.getCalls.length)return;const e=[...new Set(this.getCalls.map((e=>e.userId)))],t=yield this.connection.call("GET",["users"],{ids:e,includePrivateFields:!1});if(t.ok)for(const n of this.getCalls){const e=t.value.data[n.userId];e?n.deferred.ok({status:200,data:e}):n.deferred.serverErr({status:404,errorCode:"NOT_FOUND",reasons:["No user with that ID exists"]})}else this.getCalls.forEach((e=>e.deferred.resolve(t)))}))}sendSubscribe(){if(0===this.subscribeCalls.length)return;const e=[...new Set(this.subscribeCalls.map((e=>e.userId)))];this.connection.call("SUBSCRIBE",["users"],{ids:e}).then((e=>this.subscribeCalls.forEach((t=>t.deferred.resolve(e)))))}}class TS extends vS{constructor(e,t,n){super(n,(()=>this.sendMutate())),this.conversationId=e,this.connection=t,this.calls=[]}canPush(e,t){return!!TS.isCorrectBatchTypeFor(e,t)&&t[1]===this.conversationId}static isCorrectBatchTypeFor(e,t){return eS(t,["conversations","*","participants","*"])&&("PUT"===e||"POST"===e||"PATCH"===e)}push(e,t,n){const r=t[3],i=cS();return this.calls.push({action:{id:r,method:e,params:n},deferred:i}),100===this.calls.length&&this.send(),i.promise}sendMutate(){return JT(this,null,(function*(){const e=this.calls.map((e=>e.action)),t=yield this.connection.call("POST",["conversations",this.conversationId,"participants"],{actions:e});if(!t.ok)return void this.calls.forEach((e=>e.deferred.resolve(t)));const n=t.value.data.responses;for(let r=0;r<n.length;r++){const e=this.calls[r].deferred,t=n[r];200===t.status?e.ok(KT(XT({},t),{data:{}})):e.serverErr(t)}}))}}class SS{constructor(e,t,n){this.pendingBatch=null,this.connection=new AS(e,t,n)}call(e,t,n){return JT(this,null,(function*(){var r;if(null==(r=this.pendingBatch)?void 0:r.canPush(e,t))return this.pendingBatch.push(e,t,n);this.pendingBatch&&this.pendingBatch.send();const i=this.createEmptyBatchFor(e,t);return i?(this.pendingBatch=i,i.push(e,t,n)):this.connection.call(e,t,n)}))}destroy(){var e;this.connection.destroy(),null==(e=this.pendingBatch)||e.destroy()}isConnected(){return this.connection.isConnected()}createEmptyBatchFor(e,t){if(OS.isCorrectBatchTypeFor(e,t))return new OS(this.connection,(()=>this.pendingBatch=null));if(TS.isCorrectBatchTypeFor(e,t)){const e=t[1];return new TS(e,this.connection,(()=>this.pendingBatch=null))}return null}}const yS={200:"RESOLVE",400:"RESOLVE",401:"RETRY",402:"RESOLVE",403:"RESOLVE",404:"RESOLVE",405:"RESOLVE",409:"RESOLVE",429:"DELAY",500:"DELAY"};class CS{constructor(e,t,n){this.throttler=new NS,this.alive=!0,this.connection=new SS(e,t,n)}call(e,t,n){return JT(this,null,(function*(){let r=0;for(;this.alive;){const i=yield this.connection.call(e,t,n);if((i.ok||"client"!==i.where||"SOCKET_NOT_READY"!==i.value)&&(i.ok||"server"!==i.where||500!==i.value.status)||r++,10===r)return i;if(i.ok||"client"!==i.where){const e=i.value,t=e.status,n=yS[t];if("RESOLVE"===n)return this.throttler.resetDelay(),i;if("RETRY"===n)continue;if("DELAY"===n){yield this.throttler.wait();continue}return console.warn("[TalkJS] Unexpected status code",t),e}if("SESSION_DESTROYED"===i.value)return uS("SESSION_DESTROYED");"WEBSOCKET_DISCONNECTED"!==i.value&&("SOCKET_NOT_READY"!==i.value?i.value:yield this.throttler.wait())}return uS("SESSION_DESTROYED")}))}destroy(){this.alive=!1,this.connection.destroy()}isConnected(){return this.connection.isConnected()}}class NS{constructor(){this.initialDelayMs=200,this.exponentialFactor=1.2,this.maxDelayMs=3e4,this.currentDelayMs=this.initialDelayMs,this.lastCall=0}getCurrentDelay(){return this.currentDelayMs}wait(){const e=(new Date).getTime(),t=nS(this.currentDelayMs,.05),n=this.lastCall+t,r=Math.max(0,n-e);return this.lastCall=e+r,this.currentDelayMs=Math.min(t*this.exponentialFactor,this.maxDelayMs),tS(r)}resetDelay(){this.currentDelayMs=this.initialDelayMs}}function bS(e){return e.map((e=>encodeURIComponent(e))).join()}class IS{constructor(){this.paths={}}add(e){this.paths[bS(e)]=e}delete(e){delete this.paths[bS(e)]}has(e){return Object.hasOwnProperty.call(this.paths,bS(e))}clear(){this.paths={}}forEach(e){Object.values(this.paths).forEach((t=>e(t)))}}class RS{constructor(e,t,n){this.handlers=n,this.targetSubscriptions=new IS,this.connection=new CS(e,t,{onUpstreamRestarting:()=>this.handlers.onUpstreamRestarting(),onSubscriptionsLost:()=>{this.targetSubscriptions.forEach((e=>{this.resubscribe(e)})),this.handlers.onResubscribeSent()},onReady:()=>this.handlers.onReady(),onPublish:(e,t)=>{this.handlers.onPublish(e,t)}})}call(e,t,n){return this.connection.call(e,t,n)}subscribe(e){return JT(this,null,(function*(){return this.targetSubscriptions.add(e),this.connection.call("SUBSCRIBE",e,{})}))}unsubscribe(e){return JT(this,null,(function*(){return this.targetSubscriptions.delete(e),this.connection.call("UNSUBSCRIBE",e,{})}))}resubscribe(e){return JT(this,null,(function*(){const t=yield this.connection.call("SUBSCRIBE",e,{});t.ok||this.handlers.onResubscribeError(e,t)}))}destroy(){this.targetSubscriptions.clear(),this.connection.destroy()}isConnected(){return this.connection.isConnected()}}function wS(e,t){return void 0===t?e:t}function kS(e,t){if(void 0===t)return e;if(null===t)return{};const n=XT({},e);for(const r in t){const e=t[r];null===e?delete n[r]:n[r]=e}return n}function LS(e,t){if(e===t)return!0;if(!e||!t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!LS(e[n],t[n]))return!1}else{const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n){if(!Object.hasOwnProperty.call(t,r))return!1;if(!LS(e[r],t[r]))return!1}}return!0}class xS{constructor(){this.prev=Promise.resolve()}runExclusive(e){return JT(this,null,(function*(){const t=this.prev.then((()=>e()));return this.prev=t,t}))}}class MS{constructor(e){this.initialised=!1,this.getPointer=void 0,this.pendingStates=[e],e.resultPromise.then((()=>this.initialised=!0))}get pendingPointer(){if(0!==this.pendingStates.length)return this.pendingStates[this.pendingStates.length-1]}get mostRecentState(){var e;return null!=(e=this.pendingPointer)?e:this.getPointer}canAppendState(e){var t,n;const r=null==(t=this.getPointer)?void 0:t.seq;if(void 0!==r&&e<=r)return!1;const i=null==(n=this.pendingPointer)?void 0:n.seq;return!(void 0!==i&&e<i)}set(e){if(!this.canAppendState(e.seq))throw"Appending in the past";this.pendingStates.push(e)}mutate(e,t){if(!this.initialised)return;if(!this.canAppendState(e))throw"Mutating in the past";const n=this.mostRecentState.resultPromise.then((e=>e.ok?t(e):e));this.pendingStates.push({seq:e,resultPromise:n})}get(e){for(;this.pendingStates.length>0&&(void 0===this.getPointer||this.pendingStates[0].seq<=e);)this.getPointer=this.pendingStates.shift();return this.getPointer}}class FS extends MS{constructor(e,t){super(e),this.onTeardown=t,this._error=null,this._lastGoodState=Promise.resolve(void 0)}get error(){return this._error}get lastGoodState(){return this._lastGoodState}mutate(e,t){super.mutate(e,t),this.registerNewState(this.mostRecentState.resultPromise)}set(e){super.set(e),this.registerNewState(this.mostRecentState.resultPromise)}registerNewState(e){const t=this.lastGoodState;this._lastGoodState=e.then((e=>e.ok?e.value:t)),e.then((e=>{e.ok||this.setError(e)}))}setError(e){var t;this._error||(this._error=e,null==(t=this.onTeardown)||t.call(this,e),this.lastGoodState.then((e=>{void 0!==e&&this.teardownNested(e)})))}}class BS extends FS{constructor(e,t){const n=new Promise((e=>setTimeout(e))).then((()=>this.fetchInitial(e)));super({seq:e,resultPromise:n},t),this.initialSeq=e,this.getDeepMutex=new xS,this.lastDeep=void 0}refetchInitial(e){return JT(this,null,(function*(){const t=this.mostRecentState.resultPromise,n=this.fetchInitial(e),[r,i]=yield Promise.all([t,n]);return void 0!==r&&r.ok&&i.ok&&this.equal(r.value,i.value)?r:i}))}refetch(e){if(null!==this.error)return;const t={seq:e,resultPromise:this.refetchInitial(e)};this.set(t)}changedBetween(e,t){return JT(this,null,(function*(){if(e>=t)return!1;const n=this.get(t),r=yield n.resultPromise;return!!r.ok&&(r.value.lastChanged>Math.max(this.initialSeq,e)&&r.value.lastChanged<=t||(yield this.anyChildChanged(e,t,r.value)))}))}getDeep(e){return JT(this,null,(function*(){return this.getDeepMutex.runExclusive((()=>JT(this,null,(function*(){var t;if(null!==this.error)return this.error;const n=null==(t=this.lastDeep)?void 0:t.seq;if(e===n)return this.lastDeep.deep;if(void 0!==n){if(e<n)throw`Trying to load seq ${e} when we have previously loaded seq ${n}`;if(!(yield this.changedBetween(n,e)))return this.lastDeep.seq=e,this.lastDeep.deep}const r=this.get(e).resultPromise,i=r.then((t=>t.ok?this.loadNested(e,t.value):t));this.lastDeep={seq:e,shallow:r,deep:i};const o=yield i;return o.ok||this.setError(o),o}))))}))}}class PS extends BS{constructor(e,t,n){super(e,n),this.emitMutex=t,this.unsubscribeTimer=new US,this.referencedByOtherStores=0,this.listeners=[],this.lastEmitSeq=void 0,this.lastEmitResult=void 0,t.runExclusive((()=>JT(this,null,(function*(){yield this.emit(e)}))))}registerInternalSubscription(){this.referencedByOtherStores++;let e=!0;return()=>{e&&(e=!1,this.referencedByOtherStores--,this.startUnsubscribeTimerIfOrphan())}}get onlyUsedInternally(){return 0===this.listeners.length}listen(e){return this.unsubscribeTimer.stop(),this.listeners.push(e),void 0!==this.lastEmitResult&&e(this.lastEmitResult),()=>{this.listeners=this.listeners.filter((t=>t!==e)),this.startUnsubscribeTimerIfOrphan()}}startUnsubscribeTimerIfOrphan(){0===this.referencedByOtherStores&&0===this.listeners.length&&this.unsubscribeTimer.restart((()=>{this.setError(uS("UNSUBSCRIBED"))}),this.unsubscribeDebounceMs)}getLoadMoreSeq(){var e;const t=null!=(e=this.lastEmitSeq)?e:0,n=this.mostRecentState.seq;return Math.max(t,n)+1e-6}emit(e){return JT(this,null,(function*(){var t;if(this.onlyUsedInternally)return;if(this.lastEmitSeq&&this.lastEmitSeq>=e)return;if(!1===(null==(t=this.lastEmitResult)?void 0:t.ok))return;this.lastEmitSeq=e;const n=yield this.getDeep(e);n!==this.lastEmitResult&&(this.lastEmitResult=n,this.listeners.forEach((e=>e(n))))}))}}class US{constructor(){this.timerId=void 0}restart(e,t){void 0!==this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout((()=>e()),t)}stop(){clearTimeout(this.timerId)}}class HS extends PS{constructor(e,t,n,r,i){super(e,r,i),this.userId=t,this.realtimeClient=n,this.unsubscribeDebounceMs=1e4}fetchInitial(e){return JT(this,null,(function*(){const t=yield this.realtimeClient.call("GET",["users",this.userId],{includePrivateFields:!1},{bypassCache:!0});return t.ok?aS({snapshot:this.realtimeClient.createUserSnapshot(t.value.data),lastChanged:e}):"server"===t.where&&404===t.value.status?aS({snapshot:null,lastChanged:e}):t}))}equal(e,t){return LS(e.snapshot,t.snapshot)}loadNested(e,t){return JT(this,null,(function*(){return aS(t)}))}userCreated(e,t){this.mutate(e,(n=>null!==n.value.snapshot?n:aS({snapshot:this.realtimeClient.createUserSnapshot(t.state),lastChanged:e})))}userEdited(e,t){this.mutate(e,(n=>{const r=n.value.snapshot;return null===r?(console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."),n):aS({snapshot:{id:r.id,name:wS(r.name,t.diff.name),custom:kS(r.custom,t.diff.custom),locale:wS(r.locale,t.diff.locale),photoUrl:wS(r.photoUrl,t.diff.photoUrl),role:wS(r.role,t.diff.role),welcomeMessage:wS(r.welcomeMessage,t.diff.welcomeMessage)},lastChanged:e})}))}getFromCache(){return JT(this,null,(function*(){const e=yield this.mostRecentState.resultPromise;return e.ok?null===e.value.snapshot?lS({status:404,errorCode:"USER_NOT_FOUND",reasons:["That user does not exist yet"]}):aS({status:200,data:{id:e.value.snapshot.id,name:e.value.snapshot.name,custom:e.value.snapshot.custom,locale:e.value.snapshot.locale,photoUrl:e.value.snapshot.photoUrl,role:e.value.snapshot.role,welcomeMessage:e.value.snapshot.welcomeMessage}}):uS("NOT_IN_CACHE")}))}teardownNested(e){}anyChildChanged(e,t,n){return JT(this,null,(function*(){return!1}))}}var jS,$S={};function YS(e,t){const n=t.lastIndex;let r;const i=[];for(;null!==(r=t.exec(e));)i.push(r);return t.lastIndex=n,i}function zS(e){const t=e.replace(/%2F/g,"/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/,"$1");return decodeURIComponent(t)}function VS(e,t){e()||t||(t=e.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/,"`$1`")+" was not true")}!function(){if(jS)return $S;function e(e){return String.fromCharCode(parseInt(e.slice(1),16))}function t(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}jS=1,Object.defineProperty($S,"__esModule",{value:!0}),$S.encode=function(t){return btoa(encodeURIComponent(t).replace(/%[0-9A-F]{2}/g,e))},$S.decode=function(e){return decodeURIComponent(Array.from(atob(e),t).join(""))}}(),(e=>{function t(e,t){(function(e,t){switch(t){case"undefined":return void 0===e;case String:return"string"==typeof e||e instanceof String;case Boolean:return"boolean"==typeof e||e instanceof Boolean;case Number:return"number"==typeof e||e instanceof Number;default:return e instanceof t}})(e,t)||(t.name,String(e))}e.defined=function(e){},e.has=function(e,t){e[t]},e.is=t,e.equals=function(e,t){},e.oneOf=function(e,t){t.includes(e)||JSON.stringify(t)},e.isArray=function(e,n){t(e,Array),e&&e.length>0&&t(e[0],n)},e.optional=function(e,n){void 0!==e&&t(e,n)},e.falsy=function(e){},e.never=function(e){}})(VS||(VS={}));const GS=VS,WS=/^\/.*[^\\]\/[im]*$/;function XS(e){return!!WS.test(e)&&!KS(e).test("")}function KS(e){const t=e.match(/^\/(.*[^\\])\/(.*)$/);if(!t)throw new Error(`Expected ${e} to be a (non-empty) regex`);let n=t[2]||"";return n=n.replace(/[^im]/g,"")+"g",new RegExp(t[1],n)}class qS{constructor({mode:e,allowedHostnames:t,allowedPhoneNrs:n,allowedMatches:r,forbiddenMatches:i,suppressLinks:o,suppressEmailAddresses:s,suppressPhoneNumbers:a,replacement:u}){GS.oneOf(e,["all","otherOnly","off"]),this.mode=e,this.suppressLinks=!1!==o,this.suppressEmailAddresses=!1!==s,this.suppressPhoneNumbers=!1!==a,this.allowedHostnames=t||[],this.allowedPhoneNrs=(n||[]).filter((e=>e)).map((e=>e.replace(/[^0-9]/g,""))),this.allowedMatches=(r||[]).filter(XS).map((e=>KS(e))),this.forbiddenMatches=(i||[]).filter(XS).map((e=>KS(e))),GS((()=>this.allowedMatches.every((e=>e.flags.includes("g")))),"All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"),GS((()=>this.forbiddenMatches.every((e=>e.flags.includes("g")))),"All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"),u=null==u?void 0:u.trim(),this.replacement=u&&u.length>0?u:void 0}shouldSuppress({isContentBySender:e}){return"all"===this.mode||"otherOnly"===this.mode&&!e}}function JS(e,t){return e.map((e=>function(e,t){if("text"===e.type)return ZS(e.children,function(e){var t,n,r,i,o,s,a,u,l,c,d,h;let p="";return e.t&&(p=`(${e.t("CONTACT_INFORMATION_HIDDEN")})`),{formattedLinks:null!=(t=e.formattedLinks)?t:"plaintext",markup:null!=(n=e.markup)&&n,useFallbackMentions:null!=(r=e.useFallbackMentions)&&r,sameTabLinkRules:null!=(i=e.sameTabLinkRules)?i:[],enableEmojiImageFallback:null!=(o=e.enableEmojiImageFallback)&&o,highlight:null!=(s=e.highlight)?s:[],contactInfo:null!=(a=e.contactInfo)&&a,suppression:null!=(u=e.suppression)?u:new qS({mode:"off"}),contactInfoHiddenText:null!=(d=null!=(c=e.contactInfoHiddenText)?c:null==(l=e.suppression)?void 0:l.replacement)?d:p,customEmojiUrls:null!=(h=e.customEmojiUrls)?h:{}}}(t));if("file"===e.type&&"video"===e.subtype)return`🎥 ${zS(e.url)}`;if("file"===e.type&&"image"===e.subtype)return`📷 ${zS(e.url)}`;if("file"===e.type&&"audio"===e.subtype)return`🎧 ${zS(e.url)}`;if("file"===e.type&&"voice"===e.subtype){const t=e.duration;return void 0===t?"🎙️":`🎙️ (${Math.floor(t/60)}:${Math.floor(t%60).toString().padStart(2,"0")})`}return"file"===e.type?(e.subtype,`📎 ${zS(e.url)}`):"location"===e.type?"📍":""}(e,t))).join("\n\n")}function ZS(e,t){return e.flatMap((e=>{if("string"==typeof e)return e;switch(e.type){case"blockquote":case"bold":case"italic":case"strikethrough":case"link":case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return ZS(e.children,t);case"bulletlist":case"bulletList":return"\n"+ZS(e.children,t);case"bulletpoint":case"bulletPoint":return"- "+ZS(e.children,t)+"\n";case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"emoji":case"customemoji":case"customEmoji":return e.text;case"suppressed":return t.contactInfoHiddenText;case"mention":return`@${e.text}`}})).join("")}class QS extends BS{constructor(e,t,n,r){super(e),this.conversationId=t,this.message=n,this.realtimeClient=r}get messageId(){return"string"==typeof this.message?this.message:this.message.id}fetchInitial(e){return JT(this,null,(function*(){let t;if("object"==typeof this.message)t=this.message;else{const e=yield this.realtimeClient.call("GET",["me","conversations",this.conversationId,"messages",this.message],{},{bypassCache:!0});if(!e.ok)return e;t=e.value.data}return aS({lastChanged:e,sender:null===t.senderId?null:this.realtimeClient.internalSubscribe(["users",t.senderId]),data:{id:t.id,type:t.type,custom:t.custom,createdAt:t.createdAt,editedAt:t.editedAt,referencedMessageId:t.referencedMessageId,origin:t.origin,plaintext:JS(t.content,{}),content:t.content,reactions:ty(t.reactions)}})}))}refetch(e){throw"Do not call refetch on message data stores, it can return outdated data. Destroy and remake them instead"}equal(e,t){return LS(e.data,t.data)}teardownNested(e){var t;null==(t=e.sender)||t.unsubscribe()}anyChildChanged(e,t,n){return JT(this,null,(function*(){var r;const i=null==(r=n.sender)?void 0:r.store;return!0===(yield null==i?void 0:i.changedBetween(e,t))}))}loadNested(e,t){return JT(this,null,(function*(){var n,r,i;const o=yield null==(r=null==(n=t.sender)?void 0:n.store)?void 0:r.getDeep(e);if(!1===(null==o?void 0:o.ok))return o;if(null===t.data)return aS({snapshot:null});const s=null==o?void 0:o.value;return aS({snapshot:{sender:null!=(i=null==s?void 0:s.snapshot)?i:null,id:t.data.id,type:t.data.type,custom:t.data.custom,createdAt:t.data.createdAt,editedAt:t.data.editedAt,origin:t.data.origin,plaintext:JS(t.data.content,{}),content:t.data.content,referencedMessageId:t.data.referencedMessageId,reactions:t.data.reactions}})}))}messageEdited(e,t){this.mutate(e,(n=>null===n.value.data?n:aS({lastChanged:e,sender:n.value.sender,data:{id:n.value.data.id,type:n.value.data.type,createdAt:n.value.data.createdAt,origin:n.value.data.origin,referencedMessageId:n.value.data.referencedMessageId,editedAt:wS(n.value.data.editedAt,t.diff.editedAt),custom:kS(n.value.data.custom,t.diff.custom),content:wS(n.value.data.content,t.diff.content),reactions:ey(n.value.data.reactions,t.diff.reactions)}})))}messageDeleted(e,t){this.mutate(e,(n=>null===n.value.data?n:this.messageId===t.messageId?(this.teardownNested(n.value),aS({lastChanged:e,sender:null,data:null})):n.value.data.referencedMessageId===t.messageId?aS({lastChanged:e,sender:n.value.sender,data:{id:n.value.data.id,type:n.value.data.type,createdAt:n.value.data.createdAt,origin:n.value.data.origin,referencedMessageId:null,editedAt:n.value.data.editedAt,custom:n.value.data.custom,content:n.value.data.content,reactions:n.value.data.reactions}}):n))}getFromCache(){return JT(this,null,(function*(){var e;const t=yield this.mostRecentState.resultPromise;if(!t.ok)return uS("NOT_IN_CACHE");if(null===t.value.data)return lS({status:404,errorCode:"MESSAGE_NOT_FOUND",reasons:["No message with that ID exists"]});const n=t.value,{sender:r}=n,i=qT(n,["sender"]),o={};return i.data.reactions.forEach((e=>{o[e.emoji]={count:e.count,currentUserReacted:e.currentUserReacted}})),aS({status:200,data:KT(XT({},i.data),{senderId:null!=(e=null==r?void 0:r.store.userId)?e:null,reactions:o})})}))}}function ey(e,t){if(void 0===t)return e;const n=e.map((e=>{const n=t[e.emoji];return void 0===n?e:null===n?KT(XT({},e),{count:0}):{emoji:e.emoji,count:wS(e.count,n.count),currentUserReacted:wS(e.currentUserReacted,n.currentUserReacted)}})).filter((e=>e.count>0)),r=new Set(n.map((e=>e.emoji)));for(const i in t){const e=t[i];e&&!r.has(i)&&n.push({emoji:i,count:e.count,currentUserReacted:e.currentUserReacted})}return n.sort(((e,t)=>e.emoji.localeCompare(t.emoji))),n}function ty(e){const t=Object.entries(e).map((([e,t])=>({emoji:e,count:t.count,currentUserReacted:t.currentUserReacted})));return t.sort(((e,t)=>e.emoji.localeCompare(t.emoji))),t}class ny extends BS{constructor(e,t,n,r){super(e),this.createdAt=t,this.dataStore=n,this.referencedDataStore=r}get messageId(){return this.dataStore.messageId}fetchInitial(e){return JT(this,null,(function*(){return aS({lastChanged:e,dataStore:this.dataStore,referencedDataStore:this.referencedDataStore})}))}refetch(e){throw"Do not call refetch on message stores, it can return outdated data. Destroy and remake them instead"}equal(e,t){return!0}teardownNested(e){}anyChildChanged(e,t,n){return JT(this,arguments,(function*(e,t,{dataStore:n,referencedDataStore:r}){return!0===(yield n.changedBetween(e,t))||!0===(yield null==r?void 0:r.changedBetween(e,t))}))}loadNested(e,t){return JT(this,null,(function*(){var n,r,i;const o=yield t.dataStore.getDeep(e);if(!o.ok)return o;const s=o.value;if(null===s.snapshot)return aS({snapshot:null});const a=yield null==(n=t.referencedDataStore)?void 0:n.getDeep(e);if(a&&!a.ok)return a;const u=null!=(r=null==a?void 0:a.value)?r:null,l=null!=(i=null==u?void 0:u.snapshot)?i:null;return aS({snapshot:{id:s.snapshot.id,type:s.snapshot.type,sender:s.snapshot.sender,custom:s.snapshot.custom,createdAt:s.snapshot.createdAt,editedAt:s.snapshot.editedAt,referencedMessage:l,origin:s.snapshot.origin,plaintext:s.snapshot.plaintext,content:s.snapshot.content,reactions:s.snapshot.reactions}})}))}}class ry extends PS{constructor(e,t,n,r,i){super(e,r,i),this.conversationId=t,this.realtimeClient=n,this.unsubscribeDebounceMs=1e3,this.pendingLoadMore=void 0}listen(e){return this.onlyUsedInternally&&this.mostRecentState.resultPromise.then((e=>{if(e.ok&&null!==e.value.inWindow){const t=30-e.value.inWindow.length;t>0&&this._loadMoreMessages(t)}})),super.listen(e)}fetchInitial(e){return JT(this,null,(function*(){const t=this.onlyUsedInternally?1:30,n=yield iy({realtimeClient:this.realtimeClient,conversationId:this.conversationId,count:t});return n.ok?null===n.value.messages?aS({lastChanged:e,lastMessageChanged:e,stores:null,inWindow:null,windowEnd:null}):oy({seq:e,messages:n.value.messages,cursor:n.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):n}))}teardownNested(e){if(e.stores){const t=uS("TERMINATED");Object.values(e.stores).forEach((e=>e.setError(t))),e.inWindow.forEach((e=>e.setError(t)))}}anyChildChanged(e,t,n){return JT(this,null,(function*(){for(const r in n.stores){const i=n.stores[r];if(!0===(yield null==i?void 0:i.changedBetween(e,t)))return!0}return!1}))}lastMessageChangedBetween(e,t){return JT(this,null,(function*(){if(e>=t)return!1;const n=yield this.get(t).resultPromise;if(!n.ok)return!1;if(n.value.lastMessageChanged>e)return!0;if(null===n.value.stores)return!1;const r=n.value.inWindow[0];return void 0!==r&&!0===(yield r.changedBetween(e,t))}))}equal(e,t){return null===e.stores&&null===t.stores||null!==e.stores&&null!==t.stores&&!!LS(Object.keys(e.stores),Object.keys(t.stores))&&!!LS(e.inWindow.map((e=>e.messageId)),t.inWindow.map((e=>e.messageId)))&&LS(e.windowEnd,t.windowEnd)}loadNested(e,t){return JT(this,null,(function*(){if(null===t.stores)return aS({snapshot:null,loadedAll:!0});const n=yield Promise.all(t.inWindow.map((t=>t.getDeep(e)))),r=n.find((e=>!e.ok));return r||aS({snapshot:n.filter((e=>null!==e.value.snapshot)).map((e=>e.value.snapshot)),loadedAll:null===t.windowEnd})}))}loadMore(e){return JT(this,null,(function*(){if(this.pendingLoadMore)return this.pendingLoadMore;const t=oS();this.pendingLoadMore=t.promise,yield this._loadMoreMessages(e),t.resolve(),this.pendingLoadMore=void 0}))}_loadMoreMessages(e=30){return JT(this,null,(function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return;if(null===t.value.windowEnd)return;const n=t.value.windowEnd.cursor,r=yield iy({count:e,cursor:n,conversationId:this.conversationId,realtimeClient:this.realtimeClient}),i=this.getLoadMoreSeq();this.mutate(i,(e=>null===e.value.windowEnd||n!==e.value.windowEnd.cursor?e:r.ok?null===r.value.messages?(console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."),e):oy({seq:i,prevState:e.value,messages:r.value.messages,cursor:r.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):r)),yield this.emitMutex.runExclusive((()=>this.emit(i)))}))}messageCreated(e,t){this.mutate(e,(n=>{if(null===n.value.stores)return console.warn("[TalkJS] Received a 'message.created' event for a nonexistent conversation."),n;if(n.value.windowEnd&&t.state.createdAt<n.value.windowEnd.oldestMessageTs)return n;if(Object.hasOwnProperty.call(n.value.stores,t.state.id))return n;const r=XT({},n.value.stores),i=new QS(e,this.conversationId,t.state,this.realtimeClient);r[t.state.id]=i;const o=t.state.referencedMessageId;let s;null===o?s=null:o in r?s=r[o]:(s=new QS(e,this.conversationId,o,this.realtimeClient),r[o]=s);const a=new ny(e,t.state.createdAt,i,s),u=[...n.value.inWindow,a];u.sort(((e,t)=>t.createdAt-e.createdAt));const l=u[0].messageId===t.messageId?e:n.value.lastMessageChanged;return aS({lastChanged:e,lastMessageChanged:l,stores:r,inWindow:u,windowEnd:n.value.windowEnd})}))}messageEdited(e,t){this.mutate(e,(n=>{var r;return null===n.value.stores?(console.warn("[TalkJS] Received a 'message.edited' event for a nonexistent conversation."),n):(null==(r=n.value.stores[t.messageId])||r.messageEdited(e,t),n)}))}messageDeleted(e,t){this.mutate(e,(n=>{if(null===n.value.stores)return console.warn("[TalkJS] Received a 'message.deleted' event for a conversation that we thought didn't exist."),n;if(Object.values(n.value.stores).forEach((n=>n.messageDeleted(e,t))),void 0===n.value.stores[t.messageId])return n;const r=XT({},n.value.stores);delete r[t.messageId];const i=n.value.inWindow.filter((e=>e.messageId!==t.messageId));if(t.newLastMessage&&0===i.length){const n=new QS(e,this.conversationId,t.newLastMessage,this.realtimeClient);r[n.messageId]=n;const o=t.newLastMessage.referencedMessageId;let s;null===o?s=null:o in r?s=r[o]:(s=new QS(e,this.conversationId,o,this.realtimeClient),r[o]=s);const a=new ny(e,t.newLastMessage.createdAt,n,s);i.push(a)}const o=void 0!==t.newLastMessage?e:n.value.lastMessageChanged;return aS({lastChanged:e,lastMessageChanged:o,stores:r,inWindow:i,windowEnd:n.value.windowEnd})}))}conversationCleared(e,t){this.mutate(e,(t=>{var n;return 0===(null==(n=t.value.inWindow)?void 0:n.length)&&null===t.value.windowEnd?t:(this.teardownNested(t.value),aS({lastChanged:e,lastMessageChanged:e,stores:{},inWindow:[],windowEnd:null}))}))}sideCreated(e,t){const n=this.fetchInitial(e);this.mutate(e,(e=>null!==e.value.stores?(n.then((e=>{e.ok&&this.teardownNested(e.value)})),e):n))}sideDeleted(e,t){this.mutate(e,(t=>null===t.value.stores?t:(this.teardownNested(t.value),aS({lastChanged:e,lastMessageChanged:e,stores:null,inWindow:null,windowEnd:null}))))}getMessageFromCache(e){return JT(this,null,(function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return uS("NOT_IN_CACHE");if(null===t.value.stores)return uS("NOT_IN_CACHE");const n=t.value.stores[e];return void 0===n?uS("NOT_IN_CACHE"):n.getFromCache()}))}}function iy(e){return JT(this,arguments,(function*({cursor:e,realtimeClient:t,conversationId:n,count:r}){const i={limit:r,cursor:e},o=yield t.call("GET",["me","conversations",n,"messages"],i,{bypassCache:!0});if(o.ok){const{data:e,cursor:t}=o.value.data;return aS({messages:e,nextCursor:t})}return!o.ok&&"server"===o.where&&404===o.value.status||!o.ok&&"server"===o.where&&403===o.value.status&&"NOT_A_PARTICIPANT"===o.value.errorCode?aS({messages:null,nextCursor:null}):o}))}function oy({seq:e,prevState:t,messages:n,cursor:r,conversationId:i,realtimeClient:o}){var s,a,u,l;const c=t?XT({},t.stores):{};for(const p of n)if(void 0===c[p.id]){const t=new QS(e,i,p,o);c[t.messageId]=t}for(const p of n){const t=p.referencedMessageId;if(t&&void 0===c[t]){const n=new QS(e,i,t,o);c[n.messageId]=n}}const d=t?[...t.inWindow]:[];for(const p of n)d.push(new ny(e,p.createdAt,c[p.id],p.referencedMessageId?c[p.referencedMessageId]:null));d.sort(((e,t)=>t.createdAt-e.createdAt));const h=(null==(a=null==(s=null==t?void 0:t.inWindow)?void 0:s[0])?void 0:a.messageId)===(null==(u=null==d?void 0:d[0])?void 0:u.messageId)&&null!=(l=null==t?void 0:t.lastMessageChanged)?l:e;return aS(null===r?{lastChanged:e,lastMessageChanged:h,stores:c,inWindow:d,windowEnd:null}:{lastChanged:e,lastMessageChanged:h,stores:c,inWindow:d,windowEnd:{cursor:r,oldestMessageTs:n[n.length-1].createdAt}})}class sy extends PS{constructor(e,t,n,r,i){super(e,r,i),this.convDataStore=t,this.realtimeClient=n,this.unsubscribeDebounceMs=0}fetchInitial(e){return JT(this,null,(function*(){return aS({lastChanged:e,store:this.convDataStore})}))}teardownNested(e){e.store.unsubscribe()}anyChildChanged(e,t,n){return JT(this,null,(function*(){return n.store.store.changedBetween(e,t)}))}equal(e,t){return!0}loadNested(e,t){return JT(this,null,(function*(){return t.store.store.getDeep(e)}))}getFromCache(){return JT(this,null,(function*(){return this.convDataStore.store.getFromCache()}))}}function ay(e,t){for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(e[n],n)}function uy(e,t){return function(e){let n={};return ay(e,((e,r)=>{const[i,o]=(([e,n])=>[e,t(n,e)])([r,e]);n[i]=o})),n}(e)}class ly extends PS{constructor(e,t,n,r,i){super(e,r,i),this.conversationId=t,this.realtimeClient=n,this.unsubscribeDebounceMs=1e4}fetchInitial(e){return JT(this,null,(function*(){const t=yield this.realtimeClient.call("GET",["me","conversations",this.conversationId,"typing"],{},{bypassCache:!0});if(!t.ok&&"server"===t.where&&404===t.value.status)return aS({data:null,lastChanged:e});if(!t.ok&&"server"===t.where&&403===t.value.status&&"NOT_A_PARTICIPANT"===t.value.errorCode)return aS({data:null,lastChanged:e});if(!t.ok)return t;const n=t.value.data;return n.many?aS({data:{usersTyping:null,many:!0},userSubscriptions:{},lastChanged:e}):aS({data:n,userSubscriptions:uy(n.usersTyping,((e,t)=>this.realtimeClient.internalSubscribe(["users",t]))),lastChanged:e})}))}equal(e,t){return LS(e.data,t.data)}loadNested(e,t){return JT(this,null,(function*(){if(null===t.data)return aS({snapshot:null,lastChanged:t.lastChanged});if(t.data.many)return aS({snapshot:{many:!0},lastChanged:t.lastChanged});const n=Object.entries(t.data.usersTyping).sort((([e,t],[n,r])=>t-r)).map((([e,t])=>e)).map((n=>t.userSubscriptions[n].store.getDeep(e))),r=yield Promise.all(n),i=r.find((e=>!e.ok));if(i)return i;const o=r.map((e=>e.value)),s=o.map((e=>e.snapshot)),a=o.map((e=>e.lastChanged));return aS({snapshot:{users:s,many:!1},lastChanged:Math.max(t.lastChanged,...a)})}))}typingAvailable(e,t){this.mutate(e,(()=>aS({data:t.state,userSubscriptions:t.state.many?{}:uy(t.state.usersTyping,((e,t)=>this.realtimeClient.internalSubscribe(["users",t]))),lastChanged:e})))}typingChanged(e,t){this.mutate(e,(n=>{if(null===n.value.data)return n;if(void 0===t.diff.many){if(!0===n.value.data.many)return n;const r=XT({},n.value.data.usersTyping),i=XT({},n.value.userSubscriptions);return ay(t.diff.usersTyping,((e,t)=>{var n;"number"==typeof e?(r[t]=e,i[t]=this.realtimeClient.internalSubscribe(["users",t])):null===e&&(delete r[t],null==(n=i[t])||n.unsubscribe(),delete i[t])})),aS({data:{usersTyping:r,many:!1},userSubscriptions:i,lastChanged:e})}if(!0===t.diff.many)return n.value.data.many?n:aS({data:{usersTyping:null,many:!0},userSubscriptions:{},lastChanged:e});if(!1===t.diff.many){if(!1===n.value.data.many)return n;const r=uy(t.diff.usersTyping,((e,t)=>this.realtimeClient.internalSubscribe(["users",t])));return aS({data:t.diff,userSubscriptions:r,lastChanged:e})}throw t.diff,"Unreachable"}))}sideDeleted(e,t){this.mutate(e,(t=>null===t.value.data?t:aS({data:null,lastChanged:e})))}teardownNested(e){e.data&&ay(e.userSubscriptions,(e=>e.unsubscribe()))}anyChildChanged(e,t,n){return JT(this,null,(function*(){var r;if(null===n.data)return!1;for(const i in n.userSubscriptions){const o=n.userSubscriptions[i];if(!0===(yield null==(r=null==o?void 0:o.store)?void 0:r.changedBetween(e,t)))return!0}return!1}))}}class cy extends BS{constructor(e,t,n,r){super(e),this.conversationId=t,this.participantData=n,this.realtimeClient=r}fetchInitial(e){return JT(this,null,(function*(){return aS({lastChanged:e,user:this.realtimeClient.internalSubscribe(["users",this.participantData.id]),data:this.participantData})}))}refetch(e){throw"Do not call refetch on participant data stores, it can return outdated data. Destroy and remake them instead"}equal(e,t){var n,r,i,o;return(null==(r=null==(n=e.user)?void 0:n.store)?void 0:r.userId)===(null==(o=null==(i=t.user)?void 0:i.store)?void 0:o.userId)&&LS(e.data,t.data)}teardownNested(e){var t;null==(t=e.user)||t.unsubscribe()}anyChildChanged(e,t,n){return JT(this,null,(function*(){var r;const i=null==(r=n.user)?void 0:r.store;return!0===(yield null==i?void 0:i.changedBetween(e,t))}))}loadNested(e,t){return JT(this,null,(function*(){if(null===t.data)return aS({snapshot:null});const n=yield t.user.store.getDeep(e);if(!1===n.ok)return n;const r=n.value.snapshot;return aS({snapshot:this.realtimeClient.createParticipantSnapshotPreloaded(t.data,r)})}))}participantEdited(e,t){this.mutate(e,(n=>null===n.value.data?n:aS({lastChanged:e,user:n.value.user,data:{id:n.value.data.id,access:wS(n.value.data.access,t.diff.access),notify:wS(n.value.data.notify,t.diff.notify),joinedAt:n.value.data.joinedAt}})))}participantDeleted(e,t){this.mutate(e,(t=>null===t.value.data?t:(this.teardownNested(t.value),aS({lastChanged:e,user:null,data:null}))))}getFromCache(){return JT(this,null,(function*(){const e=yield this.mostRecentState.resultPromise;return e.ok?null===e.value.data?lS({status:404,errorCode:"PARTICIPANT_NOT_FOUND",reasons:["No participant with that ID exists"]}):aS({status:200,data:e.value.data}):uS("NOT_IN_CACHE")}))}}class dy extends PS{constructor(e,t,n,r,i){super(e,r,i),this.conversationId=t,this.realtimeClient=n,this.unsubscribeDebounceMs=1e3,this.pendingLoadMore=void 0}fetchInitial(e){return JT(this,null,(function*(){const t=yield hy({realtimeClient:this.realtimeClient,conversationId:this.conversationId,count:10});return t.ok?null===t.value.participants?aS({lastChanged:e,stores:null,inWindow:null,windowEnd:null}):py({seq:e,participants:t.value.participants,cursor:t.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):t}))}teardownNested(e){if(e.stores){const t=uS("TERMINATED");Object.values(e.stores).forEach((e=>e.setError(t)))}}anyChildChanged(e,t,n){return JT(this,null,(function*(){for(const r in n.stores){const i=n.stores[r];if(!0===(yield null==i?void 0:i.changedBetween(e,t)))return!0}return!1}))}equal(e,t){return null===e.stores&&null===t.stores||null!==e.stores&&null!==t.stores&&!!LS(Object.keys(e.stores),Object.keys(t.stores))&&LS(e.windowEnd,t.windowEnd)}loadNested(e,t){return JT(this,null,(function*(){if(null===t.stores)return aS({snapshot:null,loadedAll:!0});const n=yield Promise.all(Object.values(t.stores).map((t=>t.getDeep(e)))),r=n.find((e=>!e.ok));if(r)return r;const i=n.filter((e=>null!==e.value.snapshot)).map((e=>e.value.snapshot));return i.sort(((e,t)=>t.joinedAt-e.joinedAt)),aS({snapshot:i,loadedAll:null===t.windowEnd})}))}loadMore(e){return JT(this,null,(function*(){if(this.pendingLoadMore)return this.pendingLoadMore;const t=oS();this.pendingLoadMore=t.promise,yield this._loadMoreParticipants(e),t.resolve(),this.pendingLoadMore=void 0}))}_loadMoreParticipants(e=10){return JT(this,null,(function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return;if(null===t.value.windowEnd)return;const n=t.value.windowEnd.cursor,r=yield hy({count:e,cursor:n,conversationId:this.conversationId,realtimeClient:this.realtimeClient}),i=this.getLoadMoreSeq();this.mutate(i,(e=>null===e.value.windowEnd||n!==e.value.windowEnd.cursor?e:r.ok?null===r.value.participants?(console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."),e):py({seq:i,prevStores:e.value.stores,participants:r.value.participants,cursor:r.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):r)),yield this.emitMutex.runExclusive((()=>this.emit(i)))}))}participantCreated(e,t){this.mutate(e,(n=>{if(null===n.value.stores)return console.warn("[TalkJS] Received a 'participant.created' event for a nonexistent conversation."),n;if(n.value.windowEnd&&t.state.joinedAt<n.value.windowEnd.oldestParticipantTs)return n;if(Object.hasOwnProperty.call(n.value.stores,t.state.id))return n;const r=XT({},n.value.stores),i=new cy(e,this.conversationId,t.state,this.realtimeClient);return r[t.state.id]=i,aS({lastChanged:e,stores:r,windowEnd:n.value.windowEnd})}))}participantEdited(e,t){this.mutate(e,(n=>{var r;return null===n.value.stores?(console.warn("[TalkJS] Received a 'participant.edited' event for a nonexistent conversation."),n):(null==(r=n.value.stores[t.userId])||r.participantEdited(e,t),n)}))}participantDeleted(e,t){this.mutate(e,(n=>{if(null===n.value.stores)return console.warn("[TalkJS] Received a 'participant.deleted' event for a conversation that we thought didn't exist."),n;const r=n.value.stores[t.userId];if(void 0===r)return n;r.participantDeleted(e,t);const i=XT({},n.value.stores);return delete i[t.userId],aS({lastChanged:e,stores:i,windowEnd:n.value.windowEnd})}))}sideCreated(e,t){const n=this.fetchInitial(e);this.mutate(e,(e=>null!==e.value.stores?(n.then((e=>{e.ok&&this.teardownNested(e.value)})),e):n))}sideDeleted(e,t){this.mutate(e,(t=>null===t.value.stores?t:(this.teardownNested(t.value),aS({lastChanged:e,stores:null,inWindow:null,windowEnd:null}))))}getParticipantFromCache(e){return JT(this,null,(function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return uS("NOT_IN_CACHE");if(null===t.value.stores)return uS("NOT_IN_CACHE");const n=t.value.stores[e];return void 0===n?uS("NOT_IN_CACHE"):n.getFromCache()}))}}function hy(e){return JT(this,arguments,(function*({cursor:e,realtimeClient:t,conversationId:n,count:r}){const i={limit:r,cursor:e},o=yield t.call("GET",["me","conversations",n,"participants"],i,{bypassCache:!0});if(o.ok){const{data:e,cursor:t}=o.value.data;return aS({participants:e,nextCursor:t})}return!o.ok&&"server"===o.where&&404===o.value.status||!o.ok&&"server"===o.where&&403===o.value.status&&"NOT_A_PARTICIPANT"===o.value.errorCode?aS({participants:null,nextCursor:null}):o}))}function py({seq:e,prevStores:t,participants:n,cursor:r,conversationId:i,realtimeClient:o}){const s=t?XT({},t):{};for(const a of n)if(void 0===s[a.id]){const t=new cy(e,i,a,o);s[a.id]=t}return aS(null===r?{lastChanged:e,stores:s,windowEnd:null}:{lastChanged:e,stores:s,windowEnd:{cursor:r,oldestParticipantTs:n[n.length-1].joinedAt}})}class fy extends PS{constructor(e,t,n,r,i){super(e,r,i),this.getConvDataStore=t,this.realtimeClient=n,this.unsubscribeDebounceMs=1e3,this.pendingLoadMore=void 0}fetchInitial(e){return JT(this,null,(function*(){const t=yield my({realtimeClient:this.realtimeClient,count:20});return t.ok?null===t.value.conversations?aS({lastChanged:e,stores:null,windowEnd:null}):Ey({seq:e,conversations:t.value.conversations,cursor:t.value.nextCursor,getConvDataStore:this.getConvDataStore}):t}))}teardownNested(e){null!==e.stores&&Object.values(e.stores).forEach((e=>e.unsubscribe()))}anyChildChanged(e,t,n){return JT(this,null,(function*(){var r;for(const i in n.stores){const o=n.stores[i];if(!0===(yield null==(r=null==o?void 0:o.store)?void 0:r.changedBetween(e,t)))return!0}return!1}))}equal(e,t){return null===e.stores&&null===t.stores||null!==e.stores&&null!==t.stores&&!!LS(Object.keys(e.stores),Object.keys(t.stores))&&LS(e.windowEnd,t.windowEnd)}loadNested(e,t){return JT(this,null,(function*(){if(null===t.stores)return aS({snapshot:[],loadedAll:!0});const n=yield Promise.all(Object.values(t.stores).map((t=>t.store.getDeep(e)))),r=n.find((e=>!e.ok));if(r)return r;const i=n.filter((e=>null!==e.value.snapshot)).map((e=>e.value.snapshot));return i.sort(((e,t)=>{var n,r,i,o;const s=null!=(r=null==(n=e.lastMessage)?void 0:n.createdAt)?r:e.joinedAt;return(null!=(o=null==(i=t.lastMessage)?void 0:i.createdAt)?o:t.joinedAt)-s})),aS({snapshot:i,loadedAll:null===t.windowEnd})}))}loadMore(e){return JT(this,null,(function*(){if(this.pendingLoadMore)return this.pendingLoadMore;const t=oS();this.pendingLoadMore=t.promise,yield this._loadMoreConversations(e),t.resolve(),this.pendingLoadMore=void 0}))}_loadMoreConversations(e=20){return JT(this,null,(function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return;if(null===t.value.windowEnd)return;const n=t.value.windowEnd.cursor,r=yield my({count:e,cursor:n,realtimeClient:this.realtimeClient}),i=this.getLoadMoreSeq();this.mutate(i,(e=>null===e.value.windowEnd||n!==e.value.windowEnd.cursor?e:r.ok?null===r.value.conversations?(console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."),e):Ey({seq:i,prevStores:e.value.stores,conversations:r.value.conversations,cursor:r.value.nextCursor,getConvDataStore:this.getConvDataStore}):r)),yield this.emitMutex.runExclusive((()=>this.emit(i)))}))}getConvFromCache(e){return JT(this,null,(function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return uS("NOT_IN_CACHE");if(null===t.value.stores)return lS({status:404,errorCode:"USER_NOT_FOUND",reasons:["No user with that ID exists"]});const n=t.value.stores[e];return void 0===n?uS("NOT_IN_CACHE"):n.store.getFromCache()}))}userCreated(e,t){this.mutate(e,(e=>null!==e.value.stores?e:aS({lastChanged:e.value.lastChanged,stores:{},windowEnd:null})))}sideCreated(e,t){const n=this.getConvDataStore(t.state);this.mutate(e,(r=>Object.hasOwnProperty.call(r.value.stores,t.conversationId)?(n.unsubscribe(),r):aS({lastChanged:e,stores:KT(XT({},r.value.stores),{[t.conversationId]:n}),windowEnd:r.value.windowEnd})))}sideDeleted(e,t){this.mutate(e,(n=>{var r;if(!Object.hasOwnProperty.call(n.value.stores,t.conversationId))return n;const i=XT({},n.value.stores);return null==(r=i[t.conversationId])||r.unsubscribe(),delete i[t.conversationId],aS({lastChanged:e,stores:i,windowEnd:n.value.windowEnd})}))}sideEdited(e,t){const n=t.diff.lastMessageAt;void 0!==n&&this.mutate(e,(r=>{var i;if(null===r.value.stores)return console.warn("[TalkJS] Received a 'side.edited' event when we thought your user didn't exist."),r;if(null===r.value.windowEnd)return r;const o=Object.hasOwnProperty.call(r.value.stores,t.conversationId);if(o&&n<r.value.windowEnd.oldestMessageTs){const n=XT({},r.value.stores);return null==(i=n[t.conversationId])||i.unsubscribe(),delete n[t.conversationId],aS({lastChanged:e,stores:n,windowEnd:r.value.windowEnd})}if(!o&&n>=r.value.windowEnd.oldestMessageTs){const n=this.getConvDataStore(t.conversationId);return aS({lastChanged:e,stores:KT(XT({},r.value.stores),{[t.conversationId]:n}),windowEnd:r.value.windowEnd})}return r}))}}function my(e){return JT(this,arguments,(function*({cursor:e,realtimeClient:t,count:n}){const r={limit:n,cursor:e},i=yield t.call("GET",["me","conversations"],r,{bypassCache:!0});if(i.ok){const{data:e,cursor:t}=i.value.data;return aS({conversations:e,nextCursor:t})}return i.ok||"server"!==i.where||404!==i.value.status||"USER_NOT_FOUND"!==i.value.errorCode?i:aS({conversations:null,nextCursor:null})}))}function Ey({seq:e,prevStores:t,conversations:n,cursor:r,getConvDataStore:i}){const o=t?XT({},t):{};for(const s of n)void 0===o[s.id]&&(o[s.id]=i(s));return aS(null===r?{lastChanged:e,stores:o,windowEnd:null}:{lastChanged:e,stores:o,windowEnd:{cursor:r,oldestMessageTs:Math.min(...n.map((e=>e.lastMessageAt)))}})}class gy extends PS{constructor(e,t,n,r,i){super(e,r,i),this.conversation=t,this.realtimeClient=n,this.unsubscribeDebounceMs=5e3}get conversationId(){return"string"==typeof this.conversation?this.conversation:this.conversation.id}fetchInitial(e){return JT(this,null,(function*(){const t=this.realtimeClient.internalSubscribe(["me","conversations",this.conversationId,"messages"]);if("object"==typeof this.conversation)return aS({lastChanged:e,snapshot:this.conversation,messageWindowStore:t});const n=yield this.realtimeClient.call("GET",["me","conversations",this.conversationId],{},{bypassCache:!0});let r;if(n.ok)r=n.value.data;else if("server"===n.where&&404===n.value.status)r=null;else{if("server"!==n.where||403!==n.value.status||"NOT_A_PARTICIPANT"!==n.value.errorCode)return t.unsubscribe(),n;r=null}return aS({lastChanged:e,snapshot:r,messageWindowStore:t})}))}teardownNested(e){var t;null==(t=e.messageWindowStore)||t.unsubscribe()}anyChildChanged(e,t,n){return JT(this,null,(function*(){return!0===(yield n.messageWindowStore.store.lastMessageChangedBetween(e,t))}))}equal(e,t){return LS(e.snapshot,t.snapshot)}loadNested(e,t){return JT(this,null,(function*(){var n;if(!t.snapshot)return aS({snapshot:null,loadedAll:!0});const r=yield t.messageWindowStore.store.getDeep(e);if(!r.ok)return r;const i=r.value.snapshot,o=null!=(n=null==i?void 0:i[0])?n:null;return aS({snapshot:KT(XT({},t.snapshot),{lastMessage:o})})}))}participantEdited(e,t){this.mutate(e,(n=>null===n.value.snapshot?(console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."),n):aS({lastChanged:e,snapshot:_y(n.value.snapshot,t.diff),messageWindowStore:n.value.messageWindowStore})))}conversationEdited(e,t){this.mutate(e,(n=>null===n.value.snapshot?(console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."),n):aS({lastChanged:e,snapshot:_y(n.value.snapshot,t.diff),messageWindowStore:n.value.messageWindowStore})))}sideEdited(e,t){this.mutate(e,(n=>null===n.value.snapshot?(console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."),n):aS({lastChanged:e,snapshot:_y(n.value.snapshot,t.diff),messageWindowStore:n.value.messageWindowStore})))}sideCreated(e,t){this.mutate(e,(n=>n.value.snapshot?n:aS({lastChanged:e,snapshot:t.state,messageWindowStore:n.value.messageWindowStore})))}sideDeleted(e,t){this.mutate(e,(t=>null===t.value.snapshot?t:aS({lastChanged:e,snapshot:null,messageWindowStore:t.value.messageWindowStore})))}getFromCache(){return JT(this,null,(function*(){const e=yield this.mostRecentState.resultPromise;return e.ok&&e.value.snapshot?aS({status:200,data:e.value.snapshot}):uS("NOT_IN_CACHE")}))}}function _y(e,t){const n=t;return{id:e.id,createdAt:e.createdAt,subject:wS(e.subject,n.subject),photoUrl:wS(e.photoUrl,n.photoUrl),welcomeMessages:wS(e.welcomeMessages,n.welcomeMessages),custom:kS(e.custom,n.custom),lastMessageAt:wS(e.lastMessageAt,n.lastMessageAt),unreadMessageCount:wS(e.unreadMessageCount,n.unreadMessageCount),isUnread:wS(e.isUnread,n.isUnread),access:wS(e.access,n.access),notify:wS(e.notify,n.notify),readUntil:wS(e.readUntil,n.readUntil),everyoneReadUntil:wS(e.everyoneReadUntil,n.everyoneReadUntil),joinedAt:e.joinedAt}}class Ay extends PS{constructor(e,t,n,r,i){super(e,r,i),this.userId=t,this.realtimeClient=n,this.unsubscribeDebounceMs=1e3}fetchInitial(e){return JT(this,null,(function*(){const t=this.realtimeClient.internalSubscribe(["users",this.userId]),n=yield this.realtimeClient.call("GET",["users",this.userId,"online"],{},{bypassCache:!0});return n.ok||"server"!==n.where||404!==n.value.status||"USER_NOT_FOUND"!==n.value.errorCode?n.ok?aS({lastChanged:e,user:t,data:n.value.data}):n:aS({lastChanged:e,user:t,data:null})}))}equal(e,t){return LS(e.data,t.data)}teardownNested(e){e.user.unsubscribe()}anyChildChanged(e,t,n){return JT(this,null,(function*(){return n.user.store.changedBetween(e,t)}))}loadNested(e,t){return JT(this,null,(function*(){const n=yield t.user.store.getDeep(e);if(!n.ok)return n;const r=n.value.snapshot;return null===t.data||null===r?aS({snapshot:null}):aS({snapshot:XT({user:r},t.data)})}))}userCreated(e,t){const n=this.fetchInitial(e);this.mutate(e,(e=>null!==e.value.data?(n.then((e=>{e.ok&&this.teardownNested(e.value)})),e):n))}userOnlineChanged(e,t){this.mutate(e,(n=>null===n.value.data?n:aS({lastChanged:e,user:n.value.user,data:t.diff})))}getFromCache(){return JT(this,null,(function*(){const e=yield this.mostRecentState.resultPromise;if(!e.ok)return uS("NOT_IN_CACHE");if(null===e.value.data)return lS({status:404,errorCode:"USER_NOT_FOUND",reasons:["No user with that ID exists"]});const t=e.value,n=qT(t,["user"]);return aS({status:200,data:XT({},n.data)})}))}}class Dy{constructor(e,t,n){this.realtimeClient=n,this.convDataStores={},this.storeMap={},this.emitMutex=new xS,this.seqOffset=0,this.seqInThisConnection=0,this.refetchOnNextNetworkLoss=!0,this.connection=new RS(e,t,{onUpstreamRestarting:()=>{this.refetchOnNextNetworkLoss=!1},onReady:()=>{this.refetchOnNextNetworkLoss=!0},onResubscribeSent:()=>{if(this.seqOffset+=this.seq,this.seqInThisConnection=0,this.refetchOnNextNetworkLoss){this.seqOffset++;const e=this.seq;this.refetchAll(e),this.emitAll(e)}},onResubscribeError:(e,t)=>{var n;null==(n=this.storeMap[vy(e)])||n.setError(t)},onPublish:(e,t)=>{this.seqInThisConnection=e;const n=this.seq;for(const r of t)this.handlePublish(n,r);this.emitAll(n)}})}get seq(){return this.seqOffset+this.seqInThisConnection}refetchAll(e){Object.values(this.storeMap).forEach((t=>null==t?void 0:t.refetch(e)))}emitAll(e){return this.emitMutex.runExclusive((()=>JT(this,null,(function*(){const t=Object.values(this.storeMap).map((t=>null==t?void 0:t.emit(e)));yield Promise.all(t)}))))}handlePublish(e,t){var n,r,i,o,s,a,u,l,c,d,h,p,f,m,E,g,_,A,D,v,O,T,S,y,C,N,b;switch(t.type){case"user.created":return null==(n=this.storeMap[`/users/${t.userId}`])||n.userCreated(e,t),null==(r=this.storeMap["/me/conversations"])||r.userCreated(e,t),void(null==(i=this.storeMap[`/users/${t.userId}/online`])||i.userCreated(e,t));case"user.edited":return void(null==(o=this.storeMap[`/users/${t.userId}`])||o.userEdited(e,t));case"side.created":return null==(s=this.convDataStores[t.conversationId])||s.sideCreated(e,t),null==(a=this.storeMap[`/me/conversations/${t.conversationId}/messages`])||a.sideCreated(e,t),null==(u=this.storeMap[`/me/conversations/${t.conversationId}/participants`])||u.sideCreated(e,t),void(null==(l=this.storeMap["/me/conversations"])||l.sideCreated(e,t));case"side.edited":return null==(c=this.convDataStores[t.conversationId])||c.sideEdited(e,t),void(null==(d=this.storeMap["/me/conversations"])||d.sideEdited(e,t));case"side.deleted":return null==(h=this.convDataStores[t.conversationId])||h.sideDeleted(e,t),null==(p=this.storeMap[`/me/conversations/${t.conversationId}/messages`])||p.sideDeleted(e,t),null==(f=this.storeMap[`/me/conversations/${t.conversationId}/participants`])||f.sideDeleted(e,t),null==(m=this.storeMap[`/me/conversations/${t.conversationId}/typing`])||m.sideDeleted(e,t),void(null==(E=this.storeMap["/me/conversations"])||E.sideDeleted(e,t));case"conversation.edited":return void(null==(g=this.convDataStores[t.conversationId])||g.conversationEdited(e,t));case"message.created":return void(null==(_=this.storeMap[`/me/conversations/${t.conversationId}/messages`])||_.messageCreated(e,t));case"message.edited":return void(null==(A=this.storeMap[`/me/conversations/${t.conversationId}/messages`])||A.messageEdited(e,t));case"message.deleted":return void(null==(D=this.storeMap[`/me/conversations/${t.conversationId}/messages`])||D.messageDeleted(e,t));case"typing.available":return void(null==(v=this.storeMap[`/me/conversations/${t.conversationId}/typing`])||v.typingAvailable(e,t));case"typing.changed":return void(null==(O=this.storeMap[`/me/conversations/${t.conversationId}/typing`])||O.typingChanged(e,t));case"conversation.cleared":return void(null==(T=this.storeMap[`/me/conversations/${t.conversationId}/messages`])||T.conversationCleared(e,t));case"participant.edited":return null==(S=this.convDataStores[t.conversationId])||S.participantEdited(e,t),void(null==(y=this.storeMap[`/me/conversations/${t.conversationId}/participants`])||y.participantEdited(e,t));case"participant.created":return void(null==(C=this.storeMap[`/me/conversations/${t.conversationId}/participants`])||C.participantCreated(e,t));case"participant.deleted":return void(null==(N=this.storeMap[`/me/conversations/${t.conversationId}/participants`])||N.participantDeleted(e,t));case"user.online.changed":return void(null==(b=this.storeMap[`/users/${t.userId}/online`])||b.userOnlineChanged(e,t))}}call(e,t,n,r){return JT(this,null,(function*(){if(!r.bypassCache&&"GET"===e){const e=vy(t);if(e in this.storeMap){const t=e,n=this.storeMap[t];if(n&&"getFromCache"in n){const e=yield n.getFromCache();if("NOT_IN_CACHE"!==e.value)return e}}else if(eS(t,["me","conversations","*","messages","*"])){const e=this.storeMap[`/me/conversations/${t[2]}/messages`];if(e){const n=yield e.getMessageFromCache(t[4]);if("NOT_IN_CACHE"!==n.value)return n}}else if(eS(t,["me","conversations","*","participants","*"])){const e=this.storeMap[`/me/conversations/${t[2]}/participants`];if(e){const n=yield e.getParticipantFromCache(t[4]);if("NOT_IN_CACHE"!==n.value)return n}}else if(eS(t,["me","conversations","*"])){const e=this.storeMap["/me/conversations"];if(e){const n=yield e.getConvFromCache(t[2]);if("NOT_IN_CACHE"!==n.value)return n}}}return this.connection.call(e,t,n)}))}subscribe(e,t){const n=this.getOrCreateStore(e),r=oS(),i=oS();r.promise.catch((()=>{})),i.promise.catch((()=>{}));const o={state:{type:"pending",latestSnapshot:void 0},connected:r.promise,terminated:i.promise,loadMore:e=>JT(this,null,(function*(){"loadMore"in n&&(yield n.loadMore(e))})),unsubscribe:()=>{}},s=n.listen((n=>{if(n.ok){const e=!("loadedAll"in n.value)||n.value.loadedAll,i={type:"active",latestSnapshot:n.value.snapshot,loadedAll:e};o.state=i,null==t||t(n.value.snapshot,e),r.resolve(i)}else if("pending"===o.state.type||"active"===o.state.type){if("server"===n.where){const t={type:"error",error:new Error(QT(`Subscribe to ${e.join("/")}`,n.value))};return o.state=t,i.resolve(t),void r.reject("Subscription encountered an error during initial connection")}if("SESSION_DESTROYED"===n.value){const e={type:"error",error:new Error("Session was destroyed causing all subscriptions to be terminated")};return o.state=e,i.resolve(e),void r.reject("Subscription encountered an error during initial connection")}if("UNSUBSCRIBED"===n.value)return;if("TERMINATED"===n.value)return;n.value}}));return o.unsubscribe=()=>{if("pending"===o.state.type||"active"===o.state.type){s();const e={type:"unsubscribed"};o.state=e,i.resolve(e),r.reject("Subscription was unsubscribed before connecting")}},o}getOrCreateStore(e){const t=vy(e);if(t in this.storeMap)return this.storeMap[t];this.connection.subscribe(e).then((e=>{e.ok||n.setError(e)}));const n=this.instantiateStore(e,(()=>{delete this.storeMap[t],this.connection.unsubscribe(e)}));return this.storeMap[t]=n,n}destroy(){this.storeMap={},this.convDataStores={},this.connection.destroy()}isConnected(){return this.connection.isConnected()}instantiateStore(e,t){if(eS(e,["users","*"]))return new HS(this.seq,e[1],this.realtimeClient,this.emitMutex,t);if(eS(e,["me","conversations","*"]))return new sy(this.seq,this.subscribeConvData(e[2]),this.realtimeClient,this.emitMutex,t);if(eS(e,["me","conversations","*","messages"]))return new ry(this.seq,e[2],this.realtimeClient,this.emitMutex,t);if(eS(e,["me","conversations","*","participants"]))return new dy(this.seq,e[2],this.realtimeClient,this.emitMutex,t);if(eS(e,["me","conversations","*","typing"]))return new ly(this.seq,e[2],this.realtimeClient,this.emitMutex,t);if(eS(e,["me","conversations"]))return new fy(this.seq,(e=>this.subscribeConvData(e)),this.realtimeClient,this.emitMutex,t);if(eS(e,["users","*","online"]))return new Ay(this.seq,e[1],this.realtimeClient,this.emitMutex,t);throw"Unreachable"}subscribeConvData(e){const t="string"==typeof e?e:e.id;if(Object.hasOwnProperty.call(this.convDataStores,t)){const e=this.convDataStores[t];return{store:e,unsubscribe:e.registerInternalSubscription()}}const n=new gy(this.seq,e,this.realtimeClient,this.emitMutex,(()=>{delete this.convDataStores[t]}));return this.convDataStores[t]=n,{store:n,unsubscribe:n.registerInternalSubscription()}}}function vy(e){return`/${e.join("/")}`}class Oy{constructor(e,t,n){this.userId=t,this.alive=!0,this.connection=new Dy(e,n,this),n.onTokenRefreshFailed((()=>{this.destroy()}))}call(e,t,n){return JT(this,arguments,(function*(e,t,n,r={}){return this.alive?this.connection.call(e,t,n,r):uS("SESSION_DESTROYED")}))}subscribe(e,t){return this.connection.subscribe(e,t)}internalSubscribe(e){const t=this.connection.getOrCreateStore(e);return{store:t,unsubscribe:t.registerInternalSubscription()}}destroy(){this.alive=!1,this.connection.destroy()}isConnected(){return this.connection.isConnected()}listMessages(e,t){return JT(this,null,(function*(){const n=yield this.call("GET",["me","conversations",e,"messages"],t);if(!n.ok)return Ty(n,"Listing messages in "+e);const r=n.value.data.data,i=yield Promise.all(r.map((t=>this.createMessageSnapshot(t,e)))),o=i.find((e=>!e.ok));return void 0===o||o.ok?aS(i.map((({value:e})=>e))):o}))}createConversationSnapshotPreloaded(e,t){return{id:e.id,subject:e.subject,photoUrl:e.photoUrl,welcomeMessages:e.welcomeMessages,custom:e.custom,createdAt:e.createdAt,joinedAt:e.joinedAt,lastMessageAt:e.lastMessageAt,unreadMessageCount:e.unreadMessageCount,isUnread:e.isUnread,access:e.access,notify:e.notify,lastMessage:t,readUntil:e.readUntil,everyoneReadUntil:e.everyoneReadUntil}}createUserSnapshot(e){return{id:e.id,name:e.name,custom:e.custom,locale:e.locale,photoUrl:e.photoUrl,role:e.role,welcomeMessage:e.welcomeMessage}}createParticipantSnapshotPreloaded(e,t){return{user:t,access:e.access,notify:e.notify,joinedAt:e.joinedAt}}createMessageSnapshot(e,t){return JT(this,null,(function*(){const n=null===e.senderId?Promise.resolve(aS(null)):this.getUser(e.senderId),r=null===e.referencedMessageId?Promise.resolve(aS(null)):this.getReferencedMessage(t,e.referencedMessageId),i=yield n;if(!i.ok)return i;const o=yield r;return o.ok?aS(this.createMessageSnapshotPreloaded(e,i.value,o.value)):o}))}getReferencedMessage(e,t){return JT(this,null,(function*(){const n=yield this.call("GET",["me","conversations",e,"messages",t],{});if(!n.ok&&"server"===n.where&&404===n.value.status)return aS(null);if(!n.ok&&"server"===n.where&&403===n.value.status&&"NOT_A_PARTICIPANT"===n.value.errorCode)return aS(null);if(!n.ok)return Ty(n,`Fetching referenced message ${t} in conversation ${e}`);const r=n.value.data,i=yield this.getUser(r.senderId);if(!i.ok)return i;const o=i.value;return aS(this.createReferencedMessageSnapshotPreloaded(r,o))}))}getUser(e){return JT(this,null,(function*(){const t=yield this.call("GET",["users",e],{includePrivateFields:!1});return t.ok||"server"!==t.where||404!==t.value.status?t.ok?aS(this.createUserSnapshot(t.value.data)):Ty(t,"Get user "+e):aS(null)}))}createMessageSnapshotPreloaded(e,t,n){return{id:e.id,type:e.type,sender:t,referencedMessage:n,custom:e.custom,createdAt:e.createdAt,editedAt:e.editedAt,origin:e.origin,content:e.content,reactions:ty(e.reactions),plaintext:JS(e.content,{})}}createReferencedMessageSnapshotPreloaded(e,t){return{id:e.id,type:e.type,sender:t,referencedMessageId:e.referencedMessageId,custom:e.custom,createdAt:e.createdAt,editedAt:e.editedAt,origin:e.origin,content:e.content,reactions:ty(e.reactions),plaintext:JS(e.content,{})}}}function Ty(e,t){return"server"===e.where?lS(KT(XT({},e.value),{operation:t})):e}function Sy(e,t){var n;if(t.ok)return t.value;throw"SESSION_DESTROYED"===t.value?new Error(`${e} failed because the session was destroyed`):new Error(QT(null!=(n=t.value.operation)?n:e,t.value))}class yy{constructor(e,t){this.id=e,this._realtimeClient=t}get brandedId(){return this.id}get(){return JT(this,null,(function*(){const e=yield this._realtimeClient.getUser(this.brandedId);return Sy("Get user "+this.id,e)}))}set(e){return JT(this,null,(function*(){null===e.role&&(e.role="default");const t="string"==typeof e.email?[e.email]:e.email,n="string"==typeof e.phone?[e.phone]:e.phone,r=yield this._realtimeClient.call("PUT",["users",this.brandedId],KT(XT({},e),{email:t,phone:n}));ZT("Set user "+this.id,r)}))}createIfNotExists(e){return JT(this,null,(function*(){void 0===e.role&&(e.role="default");const t="string"==typeof e.email?[e.email]:e.email,n="string"==typeof e.phone?[e.phone]:e.phone,r=yield this._realtimeClient.call("POST",["users",this.brandedId],KT(XT({},e),{email:t,phone:n}));(r.ok||"server"!==r.where||409!=r.value.status)&&ZT(`Create user ${this.id} if not exists`,r)}))}subscribe(e){return this._realtimeClient.subscribe(["users",this.brandedId],e)}subscribeOnline(e){return this._realtimeClient.subscribe(["users",this.brandedId,"online"],e)}}class Cy{constructor(e,t,n){this.userId=e,this.conversationId=t,this._realtimeClient=n}get brandedUserId(){return this.userId}get brandedConversationId(){return this.conversationId}get(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("GET",["me","conversations",this.brandedConversationId,"participants",this.brandedUserId],{}),t=yield this._realtimeClient.call("GET",["users",this.brandedUserId],{includePrivateFields:!1}),[n,r]=yield Promise.all([e,t]);if(!n.ok&&"server"===n.where&&404===n.value.status)return null;if(!r.ok&&"server"===r.where&&404===r.value.status)return null;const i=ZT(`Get participant ${this.userId} in conversation ${this.conversationId}`,n),o=ZT(`Get user ${this.userId}`,r),s=this._realtimeClient.createUserSnapshot(o);return this._realtimeClient.createParticipantSnapshotPreloaded(i,s)}))}set(){return JT(this,arguments,(function*(e={}){const t=yield this._realtimeClient.call("PUT",["conversations",this.brandedConversationId,"participants",this.brandedUserId],e);ZT(`Set participant ${this.userId} in conversation ${this.conversationId}`,t)}))}edit(){return JT(this,arguments,(function*(e={}){const t=yield this._realtimeClient.call("PATCH",["conversations",this.brandedConversationId,"participants",this.brandedUserId],e);ZT(`Edit participant ${this.userId} in conversation ${this.conversationId}`,t)}))}createIfNotExists(){return JT(this,arguments,(function*(e={}){const t=yield this._realtimeClient.call("POST",["conversations",this.brandedConversationId,"participants",this.brandedUserId],e);(t.ok||"server"!==t.where||409!==t.value.status)&&ZT(`Add participant ${this.userId} to conversation ${this.conversationId}`,t)}))}delete(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("DELETE",["conversations",this.brandedConversationId,"participants",this.brandedUserId],{});(e.ok||"server"!==e.where||404!==e.value.status)&&ZT(`Remove participant ${this.userId} from conversation ${this.conversationId}`,e)}))}}function Ny(e){const t="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";let n=0;const r=[],i=e===n;n=e;const o=new Array(8);for(let a=7;a>=0;a--)o[a]=t.charAt(e%64),e=Math.floor(e/64);if(0!==e)throw new Error("We should have converted the entire timestamp.");let s=o.join("");if(i){let e;for(e=11;e>=0&&63===r[e];e--)r[e]=0;r[e]++}else for(let a=0;a<12;a++)r[a]=Math.floor(64*Math.random());for(let a=0;a<12;a++)s+=t.charAt(r[a]);if(20!=s.length)throw new Error("Length should be 20.");return s}const by=(e,t,n=void 0)=>e.reduce(((e,r,i)=>e.concat((e=>{if("string"==typeof e)return t(e,n);switch(e.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return[{type:e.type,children:by(e.children,t,e.type)}];case"link":return[{type:e.type,url:e.url,children:by(e.children,t,e.type)}];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return[{type:e.type,action:e.action,params:e.params,children:by(e.children,t,e.type)}];case"mention":case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return[e]}})(r))),[]);function Iy(e,t){return n=>{const r=n;let i=0;const o=[];for(const s of YS(n,e)){s.index-i>0&&o.push(r.substring(i,s.index));const e=t(s);Array.isArray(e)?o.push(...e):o.push(e),i=s.index+s[0].length}return i<n.length&&o.push(n.substring(i)),o}}const Ry="’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var wy,ky=((wy=ky||{})[wy.italic=1]="italic",wy[wy.strikethrough=2]="strikethrough",wy[wy.bold=4]="bold",wy);const Ly=[0,1,2,3,4,5,6].map((e=>{const t=[];return 1&e||t.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/),2&e||t.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/),4&e||t.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/),new RegExp(t.map((e=>e.source)).join("|"),"g")})),xy={_:1,"*":4,"~":2};function My(e){return Fy(e,0)}function Fy(e,t=0){const n=Ly[t],r=n?function(e){const t=Iy(By.getOrCompute(e,(()=>new RegExp(`(?:^|[\\s${Ry}])(?:${e.source})(?=[\\s${Ry}]|$)`,"g"))),(e=>{const t=e[0][1],n=e[1]||e[2]||e[3]||e[4]||e[5]||e[6];return[" ",{type:ky[xy[t]],children:[n]}]}));return e=>{const[n,...r]=t(" "+e);return n.length>1&&r.unshift(n.substring(1)),r}}(n):()=>[e];return by(r(e),((e,n)=>"bold"===n||"italic"===n||"strikethrough"===n?Fy(e,t|ky[n]):[e]))}const By=function(){const e=function(){try{return new WeakMap}catch(e){const n={has:()=>!1,get:()=>{},set:()=>n};return n}}();return{getOrCompute(t,n){if(e.has(t))return e.get(t);const r=n();return e.set(t,r),r}}}();function Py(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function Uy(e,t){for(var n=e.length-1;n>=0;n--)!0===t(e[n])&&e.splice(n,1)}function Hy(e){throw new Error("Unhandled case for value: '"+e+"'")}var jy=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=n?n.split(r):[],o=e.split(r);t=o.shift();)-1===Py(i,t)&&i.push(t);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=n?n.split(r):[],o=e.split(r);i.length&&(t=o.shift());){var s=Py(i,t);-1!==s&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")},e}(),$y=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new jy({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},n=this.createCssClass(e);return n&&(t.class=n),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var n=[t],r=e.getCssClassSuffixes(),i=0,o=r.length;i<o;i++)n.push(t+"-"+r[i]);return n.join(" ")}return""},e.prototype.processAnchorText=function(e){return this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var n,r,i,o,s=t.length,a=t.location;return"smart"===a?function(e,t,n){var r,i;null==n?(n="…",i=3,r=8):(i=n.length,r=n.length);var o=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},s=function(e,t){var r=t/2,i=Math.ceil(r),o=-1*Math.floor(r),s="";return o<0&&(s=e.substr(o)),e.substr(0,i)+n+s};if(e.length<=t)return e;var a,u,l,c=t-i,d=(a={},(l=(u=e).match(/^([a-z]+):\/\//i))&&(a.scheme=l[1],u=u.substr(l[0].length)),(l=u.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(a.host=l[1],u=u.substr(l[0].length)),(l=u.match(/^\/(.*?)(?=(\?|#|$))/i))&&(a.path=l[1],u=u.substr(l[0].length)),(l=u.match(/^\?(.*?)(?=(#|$))/i))&&(a.query=l[1],u=u.substr(l[0].length)),(l=u.match(/^#(.*?)$/i))&&(a.fragment=l[1]),a);if(d.query){var h=d.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);h&&(d.query=d.query.substr(0,h[1].length),e=o(d))}if(e.length<=t)return e;if(d.host&&(d.host=d.host.replace(/^www\./,""),e=o(d)),e.length<=t)return e;var p="";if(d.host&&(p+=d.host),p.length>=c)return d.host.length==t?(d.host.substr(0,t-i)+n).substr(0,c+r):s(p,c).substr(0,c+r);var f="";if(d.path&&(f+="/"+d.path),d.query&&(f+="?"+d.query),f){if((p+f).length>=c)return(p+f).length==t?(p+f).substr(0,t):(p+s(f,c-p.length)).substr(0,c+r);p+=f}if(d.fragment){var m="#"+d.fragment;if((p+m).length>=c)return(p+m).length==t?(p+m).substr(0,t):(p+s(m,c-p.length)).substr(0,c+r);p+=m}if(d.scheme&&d.host){var E=d.scheme+"://";if((p+E).length<c)return(E+p).substr(0,t)}if(p.length<=t)return p;var g="";return c>0&&(g=p.substr(-1*Math.floor(c/2))),(p.substr(0,Math.ceil(c/2))+n+g).substr(0,c+r)}(e,s):"middle"===a?function(e,t,n){if(e.length<=t)return e;var r,i;null==n?(n="…",r=8,i=3):(r=n.length,i=n.length);var o=t-i,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+r)}(e,s):(r=s,i=void 0,(n=e).length>r&&(null==i?(i="…",o=3):o=i.length,n=n.substring(0,r-o)+i),n)},e}(),Yy=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),zy=function(e,t){return(zy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function Vy(e,t){function n(){this.constructor=e}zy(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Gy,Wy=function(){return Wy=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Wy.apply(this,arguments)},Xy=function(e){function t(t){var n=e.call(this,t)||this;return n.email="",n.email=t.email,n}return Vy(t,e),t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Yy),Ky=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="",n.hashtag="",n.serviceName=t.serviceName,n.hashtag=t.hashtag,n}return Vy(t,e),t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t}(Yy),qy=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.mention="",n.mention=t.mention,n.serviceName=t.serviceName,n}return Vy(t,e),t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var t=e.prototype.getCssClassSuffixes.call(this),n=this.getServiceName();return n&&t.push(n),t},t}(Yy),Jy=function(e){function t(t){var n=e.call(this,t)||this;return n.number="",n.plusSign=!1,n.number=t.number,n.plusSign=t.plusSign,n}return Vy(t,e),t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Yy),Zy=function(e){function t(t){var n=e.call(this,t)||this;return n.url="",n.urlMatchType="scheme",n.protocolUrlMatch=!1,n.protocolRelativeMatch=!1,n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.schemePrefixRegex=/^(https?:\/\/)?/i,n.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,n.protocolRelativeRegex=/^\/\//,n.protocolPrepended=!1,n.urlMatchType=t.urlMatchType,n.url=t.url,n.protocolUrlMatch=t.protocolUrlMatch,n.protocolRelativeMatch=t.protocolRelativeMatch,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return Vy(t,e),t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},t.prototype.getAnchorHref=function(){return this.getUrl().replace(/&/g,"&")},t.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),this.decodePercentEncoding&&(e=this.removePercentEncoding(e)),e},t.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},t.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},t.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},t.prototype.removeTrailingSlash=function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e},t.prototype.removePercentEncoding=function(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch(e){return t}},t}(Yy),Qy=function(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder},eC=/[A-Za-z]/,tC=/[\d]/,nC=/[\D]/,rC=/\s/,iC=/['"]/,oC=/[\x00-\x1F\x7F]/,sC=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,aC=sC+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,uC=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,lC=aC+uC,cC=aC+uC,dC="(?:["+uC+"]{1,3}\\.){3}["+uC+"]{1,3}",hC="["+cC+"](?:["+cC+"\\-]{0,61}["+cC+"])?",pC=function(e){return"(?=("+hC+"))\\"+e},fC=function(e){return"(?:"+pC(e)+"(?:\\."+pC(e+1)+"){0,126}|"+dC+")"},mC=new RegExp("["+cC+"]"),EC=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|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|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|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|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,gC=new RegExp("["+cC+"!#$%&'*+/=?^_`{|}~-]"),_C=new RegExp("^"+EC.source+"$"),AC=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.localPartCharRegex=gC,t.strictTldRegex=_C,t}return Vy(t,e),t.prototype.parseMatches=function(e){for(var t=this.tagBuilder,n=this.localPartCharRegex,r=this.strictTldRegex,i=[],o=e.length,s=new DC,a={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},u=0,l=0,c=s;u<o;){var d=e.charAt(u);switch(l){case 0:"m"===(h=d)?D(1):n.test(h)&&D();break;case 1:p(e.charAt(u-1),d);break;case 2:f(d);break;case 3:m(d);break;case 4:E(d);break;case 5:g(d);break;case 6:_(d);break;case 7:A(d);break;default:Hy(l)}u++}var h;return O(),i;function p(e,t){":"===e?n.test(t)?(l=2,c=new DC(Wy(Wy({},c),{hasMailtoPrefix:!0}))):v():a[e]===t||(n.test(t)?l=2:"."===t?l=3:"@"===t?l=4:v())}function f(e){"."===e?l=3:"@"===e?l=4:n.test(e)||v()}function m(e){"."===e||"@"===e?v():n.test(e)?l=2:v()}function E(e){mC.test(e)?l=5:v()}function g(e){"."===e?l=7:"-"===e?l=6:mC.test(e)||O()}function _(e){"-"===e||"."===e?O():mC.test(e)?l=5:O()}function A(e){"."===e||"-"===e?O():mC.test(e)?(l=5,c=new DC(Wy(Wy({},c),{hasDomainDot:!0}))):O()}function D(e){void 0===e&&(e=2),l=e,c=new DC({idx:u})}function v(){l=0,c=s}function O(){if(c.hasDomainDot){var n=e.slice(c.idx,u);/[-.]$/.test(n)&&(n=n.slice(0,-1));var o=c.hasMailtoPrefix?n.slice(7):n;(function(e){var t=(e.split(".").pop()||"").toLowerCase();return r.test(t)})(o)&&i.push(new Xy({tagBuilder:t,matchedText:n,offset:c.idx,email:o}))}v()}},t}(Qy),DC=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot},vC=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},e.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},e.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),n=t&&t[0].toLowerCase();return"javascript:"!==n&&"vbscript:"!==n},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t||this.hasFullProtocolRegex.test(t)||this.hasWordCharAfterProtocolRegex.test(e))},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+sC+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),OC=(Gy=new RegExp("[/?#](?:["+cC+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+cC+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,fC(2),")","|","(","(//)?",/(?:www\.)/.source,fC(6),")","|","(","(//)?",fC(10)+"\\.",EC.source,"(?![-"+lC+"])",")",")","(?::[0-9]+)?","(?:"+Gy.source+")?"].join(""),"gi")),TC=new RegExp("["+cC+"]"),SC=function(e){function t(t){var n=e.call(this,t)||this;return n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.matcherRegex=OC,n.wordCharRegExp=TC,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return Vy(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.stripPrefix,i=this.stripTrailingSlash,o=this.decodePercentEncoding,s=this.tagBuilder,a=[],u=function(){var n=t[0],u=t[1],c=t[4],d=t[5],h=t[9],p=t.index,f=d||h,m=e.charAt(p-1);if(!vC.isValid(n,u))return"continue";if(p>0&&"@"===m)return"continue";if(p>0&&f&&l.wordCharRegExp.test(m))return"continue";if(/\?$/.test(n)&&(n=n.substr(0,n.length-1)),l.matchHasUnbalancedClosingParen(n))n=n.substr(0,n.length-1);else{var E=l.matchHasInvalidCharAfterTld(n,u);E>-1&&(n=n.substr(0,E))}var g=["http://","https://"].find((function(e){return!!u&&-1!==u.indexOf(e)}));if(g){var _=n.indexOf(g);n=n.substr(_),u=u.substr(_),p+=_}var A=u?"scheme":c?"www":"tld",D=!!u;a.push(new Zy({tagBuilder:s,matchedText:n,offset:p,urlMatchType:A,url:n,protocolUrlMatch:D,protocolRelativeMatch:!!f,stripPrefix:r,stripTrailingSlash:i,decodePercentEncoding:o}))},l=this;null!==(t=n.exec(e));)u();return a},t.prototype.matchHasUnbalancedClosingParen=function(e){var t,n=e.charAt(e.length-1);if(")"===n)t="(";else if("]"===n)t="[";else{if("}"!==n)return!1;t="{"}for(var r=0,i=0,o=e.length-1;i<o;i++){var s=e.charAt(i);s===t?r++:s===n&&(r=Math.max(r-1,0))}return 0===r},t.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var n=0;t&&(n=e.indexOf(":"),e=e.slice(n));var r=new RegExp("^((.?//)?[-."+cC+"]*[-"+cC+"]\\.[-"+cC+"]+)").exec(e);return null===r?-1:(n+=r[1].length,e=e.slice(r[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?n:-1)},t}(Qy),yC=new RegExp("#[_"+cC+"]{1,139}(?![_"+cC+"])","g"),CC=new RegExp("[^"+cC+"]"),NC=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegex=yC,n.nonWordCharRegex=CC,n.serviceName=t.serviceName,n}return Vy(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,i=this.serviceName,o=this.tagBuilder,s=[];null!==(t=n.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||r.test(u)){var l=t[0],c=t[0].slice(1);s.push(new Ky({tagBuilder:o,matchedText:l,offset:a,serviceName:i,hashtag:c}))}}return s},t}(Qy),bC=new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source+"|"+/(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source,"g"),IC=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.matcherRegex=bC,t}return Vy(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,i=[];null!==(t=n.exec(e));){var o=t[0],s=o.replace(/[^0-9,;#]/g,""),a=!(!t[1]&&!t[2]),u=0==t.index?"":e.substr(t.index-1,1),l=e.substr(t.index+o.length,1),c=!u.match(/\d/)&&!l.match(/\d/);this.testMatch(t[3])&&this.testMatch(o)&&c&&i.push(new Jy({tagBuilder:r,matchedText:o,offset:t.index,number:s,plusSign:a}))}return i},t.prototype.testMatch=function(e){return nC.test(e)},t}(Qy),RC=new RegExp("@[_"+cC+"]{1,50}(?![_"+cC+"])","g"),wC=new RegExp("@[_."+cC+"]{1,30}(?![_"+cC+"])","g"),kC=new RegExp("@[-_."+cC+"]{1,50}(?![-_"+cC+"])","g"),LC=new RegExp("[^"+cC+"]"),xC=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegexes={twitter:RC,instagram:wC,soundcloud:kC},n.nonWordCharRegex=LC,n.serviceName=t.serviceName,n}return Vy(t,e),t.prototype.parseMatches=function(e){var t,n=this.serviceName,r=this.matcherRegexes[this.serviceName],i=this.nonWordCharRegex,o=this.tagBuilder,s=[];if(!r)return s;for(;null!==(t=r.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||i.test(u)){var l=t[0].replace(/\.+$/g,""),c=l.slice(1);s.push(new qy({tagBuilder:o,matchedText:l,offset:a,serviceName:n,mention:c}))}}return s},t}(Qy),MC=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing},FC=function(){function e(t){void 0===t&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(t.urls),this.email="boolean"==typeof t.email?t.email:this.email,this.phone="boolean"==typeof t.phone?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow="boolean"==typeof t.newWindow?t.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(t.stripPrefix),this.stripTrailingSlash="boolean"==typeof t.stripTrailingSlash?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding="boolean"==typeof t.decodePercentEncoding?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(!1!==n&&"twitter"!==n&&"instagram"!==n&&"soundcloud"!==n)throw new Error("invalid `mention` cfg - see docs");var r=this.hashtag;if(!1!==r&&"twitter"!==r&&"facebook"!==r&&"instagram"!==r)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){return new e(n).link(t)},e.parse=function(t,n){return new e(n).parse(t)},e.prototype.normalizeUrlsCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},e.prototype.normalizeStripPrefixCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},e.prototype.normalizeTruncateCfg=function(e){return"number"==typeof e?{length:e,location:"end"}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=t[n]);return e}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},e.prototype.parse=function(e){var t=this,n=["a","style","script"],r=0,i=[];return function(e,t){for(var n,r=t.onOpenTag,i=t.onCloseTag,o=t.onText,s=t.onComment,a=t.onDoctype,u=new MC,l=0,c=e.length,d=0,h=0,p=u;l<c;){var f=e.charAt(l);switch(d){case 0:"<"===f&&M();break;case 1:m(f);break;case 2:g(f);break;case 3:E(f);break;case 4:_(f);break;case 5:A(f);break;case 6:D(f);break;case 7:v(f);break;case 8:O(f);break;case 9:T(f);break;case 10:S(f);break;case 11:y(f);break;case 12:C(f);break;case 13:"--"===e.substr(l,2)?(l+=2,p=new MC(Wy(Wy({},p),{type:"comment"})),d=14):"DOCTYPE"===e.substr(l,7).toUpperCase()?(l+=7,p=new MC(Wy(Wy({},p),{type:"doctype"})),d=20):x();break;case 14:N(f);break;case 15:b(f);break;case 16:I(f);break;case 17:R(f);break;case 18:w(f);break;case 19:k(f);break;case 20:L(f);break;default:Hy(d)}l++}function m(e){"!"===e?d=13:"/"===e?(d=2,p=new MC(Wy(Wy({},p),{isClosing:!0}))):"<"===e?M():eC.test(e)?(d=3,p=new MC(Wy(Wy({},p),{isOpening:!0}))):(d=0,p=u)}function E(e){rC.test(e)?(p=new MC(Wy(Wy({},p),{name:B()})),d=4):"<"===e?M():"/"===e?(p=new MC(Wy(Wy({},p),{name:B()})),d=12):">"===e?(p=new MC(Wy(Wy({},p),{name:B()})),F()):eC.test(e)||tC.test(e)||":"===e||x()}function g(e){">"===e?x():eC.test(e)?d=3:x()}function _(e){rC.test(e)||("/"===e?d=12:">"===e?F():"<"===e?M():"="===e||iC.test(e)||oC.test(e)?x():d=5)}function A(e){rC.test(e)?d=6:"/"===e?d=12:"="===e?d=7:">"===e?F():"<"===e?M():iC.test(e)&&x()}function D(e){rC.test(e)||("/"===e?d=12:"="===e?d=7:">"===e?F():"<"===e?M():iC.test(e)?x():d=5)}function v(e){rC.test(e)||('"'===e?d=8:"'"===e?d=9:/[>=`]/.test(e)?x():"<"===e?M():d=10)}function O(e){'"'===e&&(d=11)}function T(e){"'"===e&&(d=11)}function S(e){rC.test(e)?d=4:">"===e?F():"<"===e&&M()}function y(e){rC.test(e)?d=4:"/"===e?d=12:">"===e?F():"<"===e?M():(d=4,l--)}function C(e){">"===e?(p=new MC(Wy(Wy({},p),{isClosing:!0})),F()):d=4}function N(e){"-"===e?d=15:">"===e?x():d=16}function b(e){"-"===e?d=18:">"===e?x():d=16}function I(e){"-"===e&&(d=17)}function R(e){d="-"===e?18:16}function w(e){">"===e?F():"!"===e?d=19:"-"===e||(d=16)}function k(e){"-"===e?d=17:">"===e?F():d=16}function L(e){">"===e?F():"<"===e&&M()}function x(){d=0,p=u}function M(){d=1,p=new MC({idx:l})}function F(){var t=e.slice(h,p.idx);t&&o(t,h),"comment"===p.type?s(p.idx):"doctype"===p.type?a(p.idx):(p.isOpening&&r(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),x(),h=l+1}function B(){var t=p.idx+(p.isClosing?2:1);return e.slice(t,l).toLowerCase()}h<l&&(n=e.slice(h,l),o(n,h),h=l+1)}(e,{onOpenTag:function(e){n.indexOf(e)>=0&&r++},onText:function(e,n){if(0===r){var o=function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],i=0;n=t.exec(e);)r.push(e.substring(i,n.index)),r.push(n[0]),i=n.index+n[0].length;return r.push(e.substring(i)),r}(e,/( | |<|<|>|>|"|"|')/gi),s=n;o.forEach((function(e,n){if(n%2==0){var r=t.parseText(e,s);i.push.apply(i,r)}s+=e.length}))}},onCloseTag:function(e){n.indexOf(e)>=0&&(r=Math.max(r-1,0))},onComment:function(e){},onDoctype:function(e){}}),i=this.compactMatches(i),i=this.removeUnwantedMatches(i)},e.prototype.compactMatches=function(e){e.sort((function(e,t){return e.getOffset()-t.getOffset()}));for(var t=0;t<e.length-1;t++){var n=e[t],r=n.getOffset(),i=n.getMatchedText().length,o=r+i;if(t+1<e.length){if(e[t+1].getOffset()===r){var s=e[t+1].getMatchedText().length>i?t:t+1;e.splice(s,1);continue}e[t+1].getOffset()<o&&e.splice(t+1,1)}}return e},e.prototype.removeUnwantedMatches=function(e){return this.hashtag||Uy(e,(function(e){return"hashtag"===e.getType()})),this.email||Uy(e,(function(e){return"email"===e.getType()})),this.phone||Uy(e,(function(e){return"phone"===e.getType()})),this.mention||Uy(e,(function(e){return"mention"===e.getType()})),this.urls.schemeMatches||Uy(e,(function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()})),this.urls.wwwMatches||Uy(e,(function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()})),this.urls.tldMatches||Uy(e,(function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()})),e},e.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var n=this.getMatchers(),r=[],i=0,o=n.length;i<o;i++){for(var s=n[i].parseMatches(e),a=0,u=s.length;a<u;a++)s[a].setOffset(t+s[a].getOffset());r.push.apply(r,s)}return r},e.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"<").replace(/>/g,">"));for(var t=this.parse(e),n=[],r=0,i=0,o=t.length;i<o;i++){var s=t[i];n.push(e.substring(r,s.getOffset())),n.push(this.createMatchReturnVal(s)),r=s.getOffset()+s.getMatchedText().length}return n.push(e.substring(r)),n.join("")},e.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof jy?t.toAnchorString():e.buildTag().toAnchorString()},e.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new NC({tagBuilder:e,serviceName:this.hashtag}),new AC({tagBuilder:e}),new IC({tagBuilder:e}),new xC({tagBuilder:e,serviceName:this.mention}),new SC({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},e.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new $y({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},e.version="3.14.3",e.AnchorTagBuilder=$y,e.HtmlTag=jy,e.matcher={Email:AC,Hashtag:NC,Matcher:Qy,Mention:xC,Phone:IC,Url:SC},e.match={Email:Xy,Hashtag:Ky,Match:Yy,Mention:qy,Phone:Jy,Url:Zy},e}();function BC(e,t=e){return{type:"autolink",url:e,text:t}}const PC=Iy(/<!!mention:([^>\s]*?)\|(.*?)>/gm,(([e,t,n])=>function(e,t){return{type:"mention",id:e,text:t}}(decodeURIComponent(t),n))),UC=Iy(/<!!customemoji:(.*?)>/gm,(([e,t])=>function(e){return{type:"customemoji",text:e}}(t))),HC=Iy(/<((?:https?|mailto):.*?)\|(.*?)>/gi,(([e,t,n])=>function(e,t=[]){return{type:"link",url:e,children:t}}(t,[n]))),jC=Iy(/<actionlink:([^|]+)[|]([^>]*)>/gi,(([e,t,n])=>{const{action:r,params:i}=YC(t);return function(e,t,n=[]){return{type:"actionlink",action:e,params:t,children:n}}(r,i,[n])})),$C=Iy(/<actionbutton:([^|]+)[|]([^>]*)>/gi,(([e,t,n])=>{const{action:r,params:i}=YC(t);return function(e,t,n=[]){return{type:"actionbutton",action:e,params:t,children:n}}(r,i,[n])}));function YC(e){const t=e.indexOf("?");return-1===t?{action:e,params:{}}:{action:e.slice(0,t),params:Object.fromEntries(new URLSearchParams(e.slice(t)))}}const zC=Iy(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g,(([e])=>function(e=[]){return{type:"bulletlist",children:e}}([e.startsWith("\n")?e.slice(1):e]))),VC=Iy(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm,(([e,t])=>({type:"bulletpoint",children:[t]}))),GC=e=>{const t=/(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;let n=0;const r=[];for(const i of YS(e,t)){const t=i[0],o=i[1],s=t.startsWith(o)?i.index:i.index+1;s-n>0&&r.push(e.substring(n,s));const a=BC("tel:"+o.replace(/[^0-9+]/g,""),o);r.push(a),n=s+o.length}return n<e.length&&r.push(e.substring(n)),r},WC=e=>HC(e).flatMap((e=>"string"==typeof e?XC(e):["<",...XC(e.url),...XC("|"+e.children[0]+">")])),XC=e=>{const t=FC.parse(e,{urls:!0,email:!0,phone:!1,hashtag:!1,mention:!1}),n=[];let r=0;for(const i of t){const t=i.getOffset(),o=i.getMatchedText(),s=o.length;let a=o;i instanceof Xy?a="mailto:"+i.getEmail():i instanceof Zy&&(a=i.getUrl()),t>r&&n.push(e.substring(r,t)),n.push(BC(a,o)),r=t+s}return r<e.length&&n.push(e.substring(r)),n},KC=["Codeblock","Codespan","FormattedLink","Wikitext","Autolink","Actions","Mention","Mention","BulletPoint","CustomEmoji"],qC=function(){const e=RegExp("[^\n]+\n?|\n","g");return t=>Array.from(t.match(e)||[])}();function JC(e,t={except:[]}){let n=function(e,t){let n=[e];return n=ZC(n,t.multilineSteps),n=ZC(n,[qC]),n=ZC(n,t.singlelineSteps),n=QC(n),n}(e,function(e={except:[]}){var t;const n={multilineSteps:[],singlelineSteps:[]},r=null!=(t=e.except)?t:KC.filter((t=>!e.only.includes(t)));return r.includes("BulletPoint")||n.multilineSteps.push(zC,VC),r.includes("Mention")||n.singlelineSteps.push(PC),r.includes("CustomEmoji")||n.singlelineSteps.push(UC),r.includes("Codespan")||n.multilineSteps.push(Iy(/```([^]+?)```/g,(([e,t])=>({type:"codespan",text:t})))),r.includes("FormattedLink")||n.singlelineSteps.push(HC),r.includes("Actions")||(n.singlelineSteps.push(jC),n.singlelineSteps.push($C)),r.includes("Wikitext")||n.singlelineSteps.push(My),r.includes("Autolink")||n.singlelineSteps.push(WC,GC),n}(t));return n=eN(n,!1),n}function ZC(e,t){return t.reduce(((e,t)=>by(e,t)),e)}function QC(e){const t=[];let n=-1;for(const r of e)"string"==typeof r?"string"==typeof t[n]?t[n]+=r:t[++n]=r:t[++n]="children"in r?KT(XT({},r),{children:QC(r.children)}):r;return t}function eN(e,t){const n=[];let r=[];for(let i=0;i<e.length;i++){const o=e[i];"string"==typeof o?r.push(o):"children"in o?(r.length>0&&(n.push(r.join("")),r=[]),o.children=eN(o.children,t||"link"===o.type||"actionbutton"===o.type||"actionlink"===o.type),n.push(o)):"autolink"===o.type&&t?r.push(o.text):(r.length>0&&(n.push(r.join("")),r=[]),n.push(o))}return r.length>0&&(n.push(r.join("")),r=[]),n}class tN{constructor(e,t,n,r){this.emoji=e,this.messageId=t,this.conversationId=n,this._realtimeClient=r}get brandedMessageId(){return this.messageId}get brandedConversationId(){return this.conversationId}add(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("PUT",["conversations",this.brandedConversationId,"messages",this.brandedMessageId,"reactions",this.emoji,this._realtimeClient.userId],{});ZT(`Add ${this.emoji} reaction on message ${this.messageId} in conversation ${this.conversationId}`,e)}))}remove(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("DELETE",["conversations",this.brandedConversationId,"messages",this.brandedMessageId,"reactions",this.emoji,this._realtimeClient.userId],{});(e.ok||"server"!==e.where||404!==e.value.status)&&ZT(`Remove ${this.emoji} reaction from message ${this.messageId} in conversation ${this.conversationId}`,e)}))}}let nN=class{constructor(e,t,n){this.id=e,this.conversationId=t,this._realtimeClient=n}get brandedId(){return this.id}get brandedConversationId(){return this.conversationId}reaction(e){return new tN(e,this.brandedId,this.brandedConversationId,this._realtimeClient)}get(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("GET",["me","conversations",this.brandedConversationId,"messages",this.brandedId],{});if(!e.ok&&"server"===e.where&&404===e.value.status)return null;if(!e.ok&&"server"===e.where&&403===e.value.status&&"NOT_A_PARTICIPANT"===e.value.errorCode)return null;const t=ZT("Get message "+this.id,e),n=yield this._realtimeClient.createMessageSnapshot(t,this.brandedConversationId);return Sy("Get message "+this.id,n)}))}edit(e){return JT(this,null,(function*(){const t={content:rN(e),custom:"string"==typeof e?void 0:e.custom},n=yield this._realtimeClient.call("PATCH",["conversations",this.brandedConversationId,"messages",this.brandedId],t);ZT(`Edit message ${this.id} in conversation ${this.conversationId}`,n)}))}delete(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("DELETE",["conversations",this.brandedConversationId,"messages",this.brandedId],{});(e.ok||"server"!==e.where||404!==e.value.status)&&ZT(`Delete message ${this.id} in conversation ${this.conversationId}`,e)}))}};function rN(e){return"string"==typeof e?[{type:"text",children:JC(e)}]:"text"in e&&e.text?[{type:"text",children:JC(e.text)}]:"content"in e&&e.content?e.content:void 0}class iN{constructor(e,t){this.id=e,this._realtimeClient=t,this.uselessObjForTypeCheck={subject:null,photoUrl:null,welcomeMessages:null,custom:null,access:null,notify:null}}get brandedId(){return this.id}get brandedUserId(){return this._realtimeClient.userId}participant(e){return new Cy("string"==typeof e?e:e.id,this.id,this._realtimeClient)}message(e){return new nN(e,this.brandedId,this._realtimeClient)}get(){return JT(this,null,(function*(){const e=this._realtimeClient.listMessages(this.brandedId,{limit:1}),t=yield this._realtimeClient.call("GET",["me","conversations",this.brandedId],{});if(!t.ok&&"server"===t.where&&404===t.value.status)return null;const n=ZT("Get conversation "+this.id,t),r=Sy("Get last message in conversation "+this.id,yield e),i=0===r.length?null:r[0];return this._realtimeClient.createConversationSnapshotPreloaded(n,i)}))}set(e){return JT(this,null,(function*(){const t=this._realtimeClient.call("PUT",["conversations",this.brandedId],e),n=this._realtimeClient.call("PUT",["conversations",this.brandedId,"participants",this.brandedUserId],e),r=yield t;!r.ok&&"server"===r.where&&403===r.value.status&&"UNAUTHORIZED_TO_EDIT"===r.value.errorCode&&function(e){return void 0===e.subject&&void 0===e.photoUrl&&void 0===e.welcomeMessages&&null!==e.custom&&(void 0===e.custom||!Object.values(e.custom).some((e=>void 0!==e)))}(e)||ZT("Set conversation "+this.id,r);const i=yield n;!i.ok&&"server"===i.where&&403===i.value.status&&"UNAUTHORIZED_TO_EDIT_PARTICIPANT"===i.value.errorCode&&function(e){return void 0===e.access&&void 0===e.notify}(e)||ZT("Set your participation in conversation "+this.id,i)}))}createIfNotExists(){return JT(this,arguments,(function*(e={}){const t=this._realtimeClient.call("POST",["conversations",this.brandedId],e),n=this._realtimeClient.call("POST",["conversations",this.brandedId,"participants",this.brandedUserId],e),r=yield t;(r.ok||"server"!==r.where||409!==r.value.status)&&ZT("Create conversation "+this.id,yield t);const i=yield n;(i.ok||"server"!==i.where||409!==i.value.status)&&ZT("Join conversation "+this.id,yield n)}))}markAsRead(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("POST",["me","conversations",this.brandedId,"read"],{});ZT(`Mark ${this.id} as read`,e)}))}markAsUnread(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("POST",["me","conversations",this.brandedId,"unread"],{});ZT(`Mark ${this.id} as unread`,e)}))}send(e){return JT(this,null,(function*(){const t={content:oN(e),referencedMessageId:sN(e),custom:"string"==typeof e?void 0:e.custom,idempotencyKey:Ny((new Date).getTime())},n=yield this._realtimeClient.call("POST",["conversations",this.brandedId,"messages"],t),r=ZT("Send message to conversation "+this.id,n);return new nN(r.id,this.brandedId,this._realtimeClient)}))}subscribeMessages(e){return this._realtimeClient.subscribe(["me","conversations",this.brandedId,"messages"],e)}subscribeParticipants(e){return this._realtimeClient.subscribe(["me","conversations",this.brandedId,"participants"],e)}subscribe(e){return this._realtimeClient.subscribe(["me","conversations",this.brandedId],e)}subscribeTyping(e){return this._realtimeClient.subscribe(["me","conversations",this.brandedId,"typing"],e)}markAsTyping(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("POST",["me","conversations",this.brandedId,"typing"],{});ZT(`Set user as typing in ${this.id}`,e)}))}}function oN(e){return"string"==typeof e?[{type:"text",children:JC(e)}]:"text"in e?[{type:"text",children:JC(e.text)}]:e.content}function sN(e){if("string"==typeof e)return;const t=e.referencedMessage;return void 0!==t?"string"==typeof t?t:t.id:void 0}class aN{constructor(e,t,n){this.realtimeWsApiUrl=e,this.internalHttpApiUrl=t,this.restApiHttpUrl=n}getBokensUrl(e,t,n){return this.internalHttpApiUrl+`/${e}/bokens/${encodeURIComponent(t)}?signature=${encodeURIComponent(null!=n?n:"")}`}getRealtimeWsUrl(e,t,n,r,i){const o=encodeURIComponent(t);return this.realtimeWsApiUrl+`/${e}/realtime/${o}?talkjs-client-build=${null!=i?i:"standalone"}&talkjs-core=${n}&talkjs-client-id=${r}`}static fromHost(e){const t=new aN("wss://realtime.talkjs.com/v1","https://app.talkjs.com/api/v0","https://api.talkjs.com/v1");if(!e)return t;if(e.endsWith("talkjs.com")){const n=e.match(/\w+-(\w+)\.talkjs\.com/);if(n){const e=n[1];return new aN(`wss://realtime-${e}.talkjs.com/v1`,`https://app-${e}.talkjs.com/api/v0`,`https://api-${e}.talkjs.com/v1`)}return t}return e.includes("localhost")||e.includes("localtest.me")||/^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e)?new aN(`ws://${e}/public_api/v1`,`http://${e}/api/v0`,`http://${e}/public_api/v1`):new aN(`wss://${e}/public_api/v1`,`https://${e}/api/v0`,`https://${e}/public_api/v1`)}}function uN({method:e,url:t,data:n,options:r,attempts:i,shouldRetry:o,authProvider:s}){var a;(!i||i<=0)&&(i=1);const u={"x-talkjs-client-build":"jssdk-dev","x-talkjs-client-date":"2025-08-13T01:24:32.679Z"};return n instanceof FormData||(u["Content-Type"]=null!=(a=null==r?void 0:r.contentType)?a:"application/json"),iS(i,(()=>JT(this,null,(function*(){if(s){const e=yield s.getToken();u.Authorization=`Bearer ${e}`}return fetch(t,{method:e,headers:u,body:n}).then((e=>{if(e.ok)return e;throw e}))}))),{initialDelay:.2,log:void 0,shouldRetry:n=>JT(this,null,(function*(){return s&&401===n.status?(EN.log(`401 error from ${e} ${t}, ${yield s.getToken()}`),s.refreshToken(),!0):o?o(n):!("status"in n&&n.status>=400&&n.status<500)}))}).catch((n=>{if(Math.random()<.1&&!t.toString().startsWith("https://capture.trackjs.com")){const r=`Network Error for ${e} ${t}`;"undefined"!=typeof window&&(n instanceof Response?n.clone().text().then((e=>EN.log(`${r} ${n.status} ${e} (10% logged)`))):EN.log(`${r} ${n} (10% logged)`)),console.error("[TalkJS]",r)}throw n}))}const{cdnHost:lN,appHost:cN,restHost:dN,realtimeHost:hN,appProtocol:pN,appWsProtocol:fN}=function(){if("undefined"==typeof window)return{cdnHost:"test-hostname",appHost:"test-hostname",appProtocol:"http:",appWsProtocol:"ws:"};const e=function(){if(document.currentScript)return document.currentScript.src;try{throw new Error}catch(e){const n=e.stack.match(/https?:\/\/.*\.(js|jsx|ts|tsx)/);return n?n[0]:""}}(),t=document.createElement("a");t.href=e;const n=t.host,r=(a=n).match(/^cdn[.-]/)?a.replace(/^cdn/,"app"):"talkjs.com"===a?"app.talkjs.com":a,i=function(e){return e.match(/^app[.-]/)?e.replace(/^app/,"api"):e+"/public_api"}(r),o=function(e){return e.match(/^app[.-]/)?e.replace(/^app/,"realtime"):e+"/public_api"}(r),s=t.protocol;var a;return{cdnHost:n,appHost:r,restHost:i,realtimeHost:o,appProtocol:s,appWsProtocol:"https:"===s?"wss:":"ws:"}}(),mN=cN.startsWith("app.talkjs.com"),EN="undefined"==typeof window?{log:e=>Promise.resolve(),setData:e=>{}}:new class{constructor(e){this._timeCreated=Date.now(),this._enabled=mN,this._trackJSData={customer:{application:"",correlationId:"",sessionId:"",token:"",userId:"",version:"dev-2025-08-13T01:24:32.679Z"},entry:"direct",environment:{age:Date.now()-this._timeCreated,dependencies:{},originalUrl:window.location.href,referrer:document.referrer,userAgent:window.navigator.userAgent},metadata:[],nav:[],network:[],url:window.location.href,stack:"",timestamp:(new Date).toISOString(),version:"dev-2025-08-13T01:24:32.679Z",throttled:0},this._url=`https://capture.trackjs.com/capture?token=${e}`,this._trackJSData.customer.token=e}setData({appId:e,meId:t,sessionId:n}){this._trackJSData.customer.userId=e,this._trackJSData.customer.sessionId=`${e}/${t}`,this._trackJSData.customer.correlationId=n}log(e){return JT(this,null,(function*(){try{if(!this._enabled)return Promise.resolve();const t=KT(XT({},this._trackJSData),{message:e});yield uN({method:"POST",url:this._url,data:JSON.stringify(t),options:{contentType:"text/plain"}})}catch(e){console.error("[TalkJS] Failed when sending an error report. Error: ",e)}}))}}("970cd0be0fb74630b75c8451051299dc");class gN{constructor(e,t={}){this._onSubscription=t,this._handlers={};for(const n in e)Object.hasOwnProperty.call(e,n)&&(this._handlers[n]=[])}emit(e,t){for(const n of this._handlers[e])try{n(t)}catch(t){console.error(`[TalkJS] '${String(e)}' handler threw an error:`,t)}}emitAsync(e,t){return JT(this,null,(function*(){try{const n=this._handlers[e].map((e=>e(t)));yield Promise.all(n)}catch(t){console.error(`[TalkJS] '${String(e)}' handler threw an error:`,t)}}))}supports(e){return e in this._handlers}on(e,t){var n,r;if(!this.supports(e))throw new Error(`Unknown event type '${String(e)}'`);null==(r=(n=this._onSubscription)[e])||r.call(n),this._handlers[e].push(t)}off(e,t){if(!Object.hasOwnProperty.call(this._handlers,e))throw new Error(`Unknown event type '${String(e)}'`);const n=this._handlers[e].indexOf(t);-1!==n&&this._handlers[e].splice(n,1)}removeAllListeners(){for(const e in this._handlers)this._handlers[e]=[]}handles(e){return this._handlers[e].length>0}subscribe(e,t){return this.on(e,t),{unsubscribe:()=>this.off(e,t)}}}class _N{constructor(e,t,n,r,i,o){if(this.appId=t,this.userId=n,this.tokenFetcher=i,this.usingBokens=!1,this.requestInProgress=!1,this.eventEmitter=new gN({tokenChanged(e){},tokenRefreshFailed(e){},tokenAccepted(e){}}),this.sessionExpiryWarningTimeoutId=void 0,o&&(r||i))throw new Error("[TalkJS] If providing a signature for authentication, you must not provide a token or tokenFetcher.");r?this.fetchToken((()=>r)):(i||(this.usingBokens=!0,this.tokenFetcher=()=>this.sendBokenRequest(e,o)),this.refreshToken())}get canRefreshToken(){return this.usingBokens||!!this.tokenFetcher}getToken(){return this.token}refreshToken(){if(!this.requestInProgress){if(!this.tokenFetcher)throw this.emitTokenRefreshFailed("no `tokenFetcher` provided"),new Error("[TalkJS] Cannot refresh token, no `tokenFetcher` provided.");this.fetchToken(this.tokenFetcher)}}onTokenChanged(e){return this.eventEmitter.on("tokenChanged",e),()=>{this.eventEmitter.off("tokenChanged",e)}}emitTokenChanged(e){this.eventEmitter.emit("tokenChanged",e)}onTokenRefreshFailed(e){return this.eventEmitter.on("tokenRefreshFailed",e),()=>{this.eventEmitter.off("tokenRefreshFailed",e)}}emitTokenRefreshFailed(e){this.eventEmitter.emit("tokenRefreshFailed",e),console.error(`[TalkJS] Could not authenticate, cannot recover automatically: ${e}`)}onTokenAccepted(e){return this.eventEmitter.on("tokenAccepted",e),()=>{this.eventEmitter.off("tokenAccepted",e)}}emitTokenAccepted(e){this.eventEmitter.emit("tokenAccepted",e)}clearScheduledRefresh(){this.sessionExpiryWarningTimeoutId&&clearTimeout(this.sessionExpiryWarningTimeoutId)}scheduleRefresh(e){if(this.clearScheduledRefresh(),null===e)return;const t=void 0!==this.tokenFetcher;if(e<120&&!t?console.warn(`[TalkJS] TalkJS will stop working in ${e} seconds due to auth token expiry. Token expires in ${e} seconds, and cannot be refreshed because no \`tokenFetcher\` was provided when creating the session. Non-refreshable tokens are recommended to expire at least 24 hours in the future.`):e<120&&t?console.warn(`[TalkJS] TalkJS auth token will expire and need to be refreshed in ${e} seconds. Refreshable JWTs are recommended to expire at least 30 minutes in the future, to improve performance and reduce unnecessary refreshes.`):e<3300&&!t&&console.warn(`[TalkJS debug] TalkJS will stop working in ${Math.round(e/60)} minutes due to auth token expiry. Non-refreshable tokens are recommended to expire at least 24 hours in the future. Alternatively, provide a \`tokenFetcher\` when creating the session, so that tokens can be refreshed when they expire.`),void 0!==this.tokenFetcher){const t=e>600?e-300:e/2,n=Math.min(1728e6,1e3*t);this.sessionExpiryWarningTimeoutId=setTimeout((()=>{this.refreshToken()}),n)}else e<2e6&&(this.sessionExpiryWarningTimeoutId=setTimeout((()=>{this.emitTokenRefreshFailed("Token has expired and no `tokenFetcher` was provided when creating the session, so it cannot be refreshed.")}),1e3*e))}fetchToken(e){return JT(this,null,(function*(){if(this.requestInProgress)return;this.requestInProgress=!0;const t=()=>JT(this,null,(function*(){const t=yield e();return this.checkJwt(t),t}));try{const e=void 0!==this.token;this.token=t(),yield this.token.then((t=>{e&&this.emitTokenChanged(t)})).catch((e=>{this.emitTokenRefreshFailed(e)}))}catch(e){this.emitTokenRefreshFailed(e)}finally{this.requestInProgress=!1}}))}checkJwt(e){!function(e){if(!("string"==typeof e||e instanceof String)){if(void 0===e)throw"Token was undefined";throw"Token must be a string, got: "+e}}(e);const t=[];let n,r,i;if("string"==typeof e?n=e:t.push(`Token type is ${typeof e} instead of a string.`),n)try{const e=function(e){const t=e.split(".");if(3!==t.length)throw"Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";return{header:AN(t[0]),payload:AN(t[1])}}(n);r=e.header,i=e.payload}catch(e){t.push(e)}if(r){const e=this.checkJwtHeader(r);t.push(...e)}if(i){const e=this.checkJwtPayload(i);t.push(...e)}if(t.length)if(this.usingBokens)EN.log(`JWT Errors detected by AuthProvider when using bokens: ${t.join("\n")}`);else{console.warn("[TalkJS] Authentication token appears to be generated incorrectly. Will still attempt to authenticate, but TalkJS may not work as expected. See below for a description of any problems and how to fix them.");const n=t.length>1;t.forEach(((e,t)=>{const r=n?`Reason ${t+1}:`:"Reason:";console.warn(`[TalkJS] ${r} ${e}`)})),console.warn(`[TalkJS]: Authentication token: "${e}"`)}}checkJwtHeader(e){const t=[],n=e.alg;return void 0===n?t.push('Token header must contain `"alg": "HS256"`, but no `alg` was specified.'):"string"!=typeof n?t.push(`Token header must contain \`"alg": "HS256"\`, but \`alg\` was ${typeof n} instead of a string. Make sure you wrap the value in "".`):"HS256"!==n&&t.push(`Token header must contain \`"alg": "HS256"\`, but \`alg\` was set to "${n}" instead. HS256 is the only supported algorithm.`),t}checkJwtPayload(e){const t=[],n=e.iss;void 0===n?t.push(`Token payload must contain an \`iss\` claim set to your app ID (${this.appId}), but \`iss\` was missing.`):"string"!=typeof n?t.push(`Token payload must contain an \`iss\` claim set to your app ID (${this.appId}), but \`iss\` was ${typeof n} instead of a string. Make sure you wrap the value in "".`):n!==this.appId&&t.push(`Token payload must contain an \`iss\` claim set to your app ID (${this.appId}), but \`iss\` was set to "${n}" instead.`);const r=e.sub;void 0===r?t.push(`Token payload must contain a \`sub\` claim set to your user ID (${this.userId}), but \`sub\` was missing.`):"string"!=typeof r?t.push(`Token payload must contain a \`sub\` claim set to your user ID (${this.userId}), but \`sub\` was ${typeof r} instead of a string. Make sure you wrap the value in "".`):r!==this.userId&&t.push(`Token payload must contain a \`sub\` claim set to your userId ID (${this.userId}), but \`sub\` was set to "${r}" instead.`);const i=e.tokenType;void 0===i?t.push('Token payload must contain a `"tokenType": "user"` claim, but no `tokenType` was specified.'):"string"!=typeof i?t.push(`Token payload must contain a \`"tokenType": "user"\` claim, but \`tokenType\` was ${typeof i} instead of a string. Make sure you wrap the value in "".`):"user"!==i&&t.push(`Token payload must contain a \`"tokenType": "user"\` claim, but \`tokenType\` was set to "${i}" instead.`);const o=e.exp;void 0===o||("number"!=typeof o?t.push(`Token payload contains an \`exp\` claim, but \`exp\` was ${typeof i} instead of a number. If set, \`exp\` should be the expiry date as a number of seconds since 1970-01-01. Don't wrap the value in "".`):o<1e9?t.push(`Token payload contains an \`exp\` claim, but \`exp\` is very small (${o}, representing ${new Date(1e3*o).toLocaleDateString()}). If set, \`exp\` should be the expiry date as a number of seconds since 1970-01-01.`):o>1e11?t.push(`Token payload contains an \`exp\` claim, but \`exp\` is very small (${o}, representing ${new Date(1e3*o).toLocaleDateString()}). If set, \`exp\` should be the expiry date as a number of seconds since 1970-01-01. Double-check that you are using seconds and not milliseconds or nanoseconds.`):o<(new Date).getTime()/1e3&&t.push(`Token payload contains an \`exp\` claim, but \`exp\` (${o}, representing ${new Date(1e3*o).toLocaleDateString()}) appears to be in the past, meaning the token will be rejected. This error can also happen if your device's clock is set incorrectly, in which case the token will still work.`));const s=e.nbf;return void 0===s||("number"!=typeof s?t.push(`Token payload contains a \`nbf\` (not-before) claim, but \`nbf\` was ${typeof i} instead of a number. If set, \`nbf\` should be the date when the JWT becomes valid, as a number of seconds since 1970-01-01.`):s>1e11&&t.push(`Token payload contains a \`nbf\` (not-before) claim, but \`nbf\` is very large (${s}, representing ${new Date(1e3*s).toLocaleDateString()}). If set, \`nbf\` should be the date when the JWT becomes valid, as a number of seconds since 1970-01-01. Double-check that you are using seconds and not milliseconds or nanoseconds.`)),t}sendBokenRequest(e,t){return JT(this,null,(function*(){let n=0;const r=e.getBokensUrl(this.appId,this.userId,t),i=yield uN({method:"GET",url:r,attempts:1e4,shouldRetry:e=>{if(e instanceof Error)return!0;if(401===e.status)throw"Check that you provided a valid signature.";if(404===e.status)throw"Check that you specified the correct App ID.";if(429===e.status||502===e.status)return!0;if(e.status>=400&&e.status<500)throw`Unexpected HTTP ${e.status} response when fetching auth token. Check that you configured the session correctly.`;if(n++,n>=5)throw`Unexpected HTTP ${e.status} response when fetching auth token, retrying did not help.`;return!0}});return(yield i.json()).boken}))}}function AN(e){try{const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join(""));return JSON.parse(n)}catch(t){throw`Could not base64-decode and JSON-parse token section: ${e}. Check that you base-64 encoded the section correctly.`}}class DN{constructor(e){this.target=e}deref(){return this.target}}const vN=new class{constructor(){this.registry={}}getOrCreate(e){var t;const n=this.key(e),r=null==(t=this.registry[n])?void 0:t.deref();if(r)return r;const i=new ON(e),o=globalThis.WeakRef?new WeakRef(i):new DN(i);return this.registry[n]=o,i}deregister(e,t){const n=this.key({appId:e,userId:t});delete this.registry[n]}key({appId:e,userId:t}){return`${e}:${t}`}};class ON{constructor(e){!function(e){function t(e,t){if(!e)throw new Error("[TalkJS] TalkSession: "+t)}t(e&&"object"==typeof e,"Expected an object argument in TalkSession#constructor."),t(e.appId&&"string"==typeof e.appId,"The `appId` property of TalkSession#constructor is required and it must be a non-empty string."),t("string"==typeof e.userId,"The `userId` property of TalkSession#constructor is required and it must be a string."),void 0!==e.token&&t(e.token&&"string"==typeof e.token,"The `token` property of TalkSession#constructor must be a non-empty string."),void 0!==e.tokenFetcher&&t("function"==typeof e.tokenFetcher,"The `tokenFetcher` property of TalkSession#constructor must be a function.")}(e);const{appId:t,userId:n,token:r,tokenFetcher:i,signature:o}=e;this._appId=t,this._apiUrls=e.apiUrls?new aN(e.apiUrls.realtimeWsApiUrl,e.apiUrls.internalHttpApiUrl,e.apiUrls.restApiHttpUrl):aN.fromHost(e.host),this._authProvider=new _N(this._apiUrls,t,n,r,i,o);const s=Math.random().toString().split(".")[1];this._realtimeClient=new Oy(this._apiUrls.getRealtimeWsUrl(t,n,"1.4.2",s,e.clientBuild),n,this._authProvider),this.currentUser=new yy(this._realtimeClient.userId,this._realtimeClient),this._terminationReason=oS(),this._terminationReason.promise.then((e=>{console.error(`[TalkSession] ${e}`)})),function(e,t,n){return JT(this,null,(function*(){return uN({method:"GET",url:`${t}/${e}/app`,authProvider:n}).then((e=>200===e.status||404!==e.status&&(console.warn(`[TalkJS] Received unexpected ${e.status} status code when validating app ID. Assuming that the app ID is valid.`),!0))).catch((e=>{if("string"!=typeof e&&"status"in e){const t=e;return 200===t.status||404!==t.status&&(console.warn(`[TalkJS] Received unexpected ${t.status} status code when validating app ID. Assuming that the app ID is valid.`),!0)}return console.warn("[TalkJS] Encountered network issues when validating app ID. Assuming that the app ID is valid."),!0}))}))}(this._appId,this._apiUrls.internalHttpApiUrl,this._authProvider).then((e=>{e||this.terminate(new Error(`The app ID ${this._appId} does not exist. Make sure you are using the correct app ID as found on the TalkJS dashboard. App IDs are case-sensitive.`))})),this._authProvider.onTokenRefreshFailed((e=>{this.terminate(new Error(`Could not authenticate, cannot recover automatically: ${e}`))}))}onError(e){const t=oS();return Promise.race([t.promise,this._terminationReason.promise]).then((t=>{"UNSUBSCRIBED"!==t&&e(t)})),{unsubscribe:()=>t.resolve("UNSUBSCRIBED")}}user(e){return new yy(e,this._realtimeClient)}conversation(e){return new iN(e,this._realtimeClient)}subscribeConversations(e){return this._realtimeClient.subscribe(["me","conversations"],e)}terminate(e){vN.deregister(this._appId,this.currentUser.id),this._terminationReason.resolve(e),this._realtimeClient.destroy()}_isConnected(){return this._realtimeClient.isConnected()}uploadFile(e,t){return TN(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,t)}uploadImage(e,t){return TN(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,XT({subtype:"image"},t))}uploadVideo(e,t){return TN(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,XT({subtype:"video"},t))}uploadAudio(e,t){return TN(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,XT({subtype:"audio"},t))}uploadVoice(e,t){return TN(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,XT({subtype:"voice"},t))}}function TN(e,t,n,r){return JT(this,arguments,(function*(e,t,n,{subtype:r,filename:i,width:o,height:s,duration:a}){const u=new FormData;return u.set("file",n,i),void 0!==r&&u.set("subtype",r),void 0!==o&&u.set("width",o.toString()),void 0!==s&&u.set("height",s.toString()),void 0!==a&&u.set("duration",a.toString()),uN({method:"POST",url:e,data:u,authProvider:t}).then((e=>e.json())).then((e=>e.attachmentToken)).catch((e=>JT(this,null,(function*(){if(e instanceof Response){const t=yield e.json(),n=`Unexpected response when uploading file, status code ${e.status} ${t.errorCode}, ${t.reasons}`;throw new Error(n)}throw e}))))}))}class SN{constructor(e){this.state$=e,this.currentDoc=zE.EMPTY,this.maxLength=1e3,this.markAsTyping=function(e){let t=!1;return(...n)=>{if(!t)return t=!0,setTimeout((()=>{t=!1}),5e3),e(...n)}}((()=>{this.controller?.markAsTyping()})),this.toggleEmojiPicker=e=>{const t=this.state$.showEmojiPicker;void 0===e?t.toggle():t.set(e)},this.spellcheck$=Cr(),this.placeholder$=Cr()}onPasteImage(e){ii.defined(this.uploadFile),this.uploadFile(e)}onChange(e){this.currentDoc=e;const t=e.asText(),n=e.size>this.maxLength&&t.length>this.maxLength;e.hasContent&&this.markAsTyping(),this.state$.assign({isTyping:e.hasContent,atTextLimit:n,isEmpty:!e.hasContent||0===t.trim().length,characterCount:0===e.size?0:e.size-2})}setMaxLength(e){this.maxLength=e}focus(){this.editorView?.dom.focus()}setText(e){this.editorView&&function(e,t){const n=e.state.doc.content.size,r=t.split(/(<!!(?:mention|customemoji):.*?>)/g).filter((e=>e||e.length)).map((e=>vp.text(e))),i=e.state.tr.replaceWith(0,n,r);e.dispatch(i)}(this.editorView,e)}typeText(e){this.editorView&&function(e,t,n="replace"){const r=e.state.doc.content.size,i="insert"==n?e.state.tr.insertText(t):e.state.tr.insertText(t,0,r);e.dispatch(i)}(this.editorView,e,"insert")}getText(){return this.currentDoc.asText().trim()}clearText(){this.editorView&&function(e){const t=e.state.doc.content.size,n=e.state.tr.insertText("",0,t);e.dispatch(n)}(this.editorView)}insertEmoji(e){this.editorView&&function(e,t){const n=function(e,t){if(t.startsWith(":"))throw new Error("Not implemented");{const n=e.marks.emoji.create({emoji:t});return e.text(t,[n])}}(e.state.schema,t);let r;r=e.state.tr.replaceSelectionWith(n,!1),e.dispatch(r)}(this.editorView,e)}}function yN(e){return Object.keys(e)}let CN;function NN(e,t,n){const r=e.appId,i=e.userId,o=e.conversationId,s=de((()=>UT.fromHost(e.host)),[e.host]),a=de((()=>new Qi),[e.appId]);ue((()=>{a.state$.themeCustom.set(gn({value:e.themeCustom}))}),[a,e.themeCustom]);const u=de((()=>FT()),[e.appId,e.userId,e.token,e.tokenFetcher]),l=function(e){return e.forceCreateNew?new ON(e):vN.getOrCreate(e)}({apiUrls:s,appId:r,userId:i,token:e.token,tokenFetcher:e.tokenFetcher});ae((()=>{const e=l.onError((e=>{mi.error(e.message),a.state$.errors.serverError.set(!0)}));return()=>e.unsubscribe()}),[l,a]);const c=de((()=>new kT(s,r,u,l._authProvider)),[r,u,l,s]),d=de((()=>new SN(a.state$.editor)),[a]),h=de((()=>new BT(a,l,d,t,n)),[l,a,d,t,n]);return d.controller=h,ae((()=>{"loading"!==a.state$.authTokenState.peek()&&a.state$.authTokenState.set("loading"),l._authProvider.getToken().then((()=>{a.state$.authTokenState.set("valid")}));const t=l._authProvider.onTokenRefreshFailed((()=>{a.state$.authTokenState.set(e.tokenFetcher?"invalid":"expired")}));return()=>{t()}}),[l,a,e.tokenFetcher]),ae((()=>{(async function(){return{supportsEmojiPicker:await async function(){return void 0===CN&&(CN=await async function(){if("undefined"==typeof indexedDB)return!1;const e="testdb"+Math.random();try{await new Promise(((t,n)=>{const r=indexedDB.open(e);r.onerror=n,r.onsuccess=()=>{try{r.result.close()}finally{indexedDB.deleteDatabase(e)}t()}}))}catch(e){return!1}return!0}()),CN}(),isMobile:/Mobi/i.test(window.navigator.userAgent)}})().then((e=>a.state$.device.set(e)))}),[a]),ae((()=>{let e=!0;a.resetState(r,i,o);let t=null;const n=l.currentUser.subscribe((async n=>{if(e&&(a.state$.errors.unknownUser.set(!n),n&&(a.state$.currentUser.set(n),n.role!==t))){t=n.role;const r=await c.getApp(n.role);if(!e)return;a.state$.app.set(r)}})),s=l.conversation(o).subscribeMessages((async(t,n)=>{e&&(a.state$.errors.unknownConversation.set(!t),t&&(await a.readyForNewMessagesPromise,a.storeMessages(o,t,n)))}));a.messageSubscription=s;const u=l.conversation(o).subscribeParticipants((t=>{e&&(a.state$.errors.unknownConversation.set(!t),t&&a.state$.participants.child(o).set(t))}));a.participantSubscription=u;const d=l.conversation(o).subscribe((async t=>{e&&(a.state$.errors.unknownConversation.set(!t),t&&a.state$.currentConversation.set(t))})),h=l.conversation(o).subscribeTyping((t=>{e&&(a.state$.errors.unknownConversation.set(!t),t&&a.storeTyping(o,t))}));return()=>{e=!1,n.unsubscribe(),u.unsubscribe(),d.unsubscribe(),s.unsubscribe(),h.unsubscribe(),a.messageSubscription=null}}),[o,i,r,c,l,a,h]),ae((()=>{const e=a.state$.participants.child(o).onChange((({value:e})=>{if(!e)return;const t=new Set;for(const n of e)t.add(n.user.id);Mn((()=>{for(const e of yN(a.onlineSubscriptions))t.has(e)||(a.onlineSubscriptions[e]?.unsubscribe(),delete a.onlineSubscriptions[e],a.state$.isUserConnected.child(e).set(!1))}));for(const n of t)a.onlineSubscriptions[n]||(a.onlineSubscriptions[n]=l.user(n).subscribeOnline((e=>{e?a.state$.isUserConnected.child(n).set(e.isConnected):a.state$.errors.unknownUser.set(!e)})))}),{initial:!0});return()=>{e();for(const e of yN(a.onlineSubscriptions))a.onlineSubscriptions[e].unsubscribe();a.onlineSubscriptions={},a.state$.isUserConnected.set({})}}),[a,o,l]),{store:a,controller:h,editorInternals:d,session:l}}function bN(e,t,n){return he((r=>{e&&e(r);const i=t.current?.parentElement;"T-CHATBOX"===i?.tagName&&function(e,t,n){for(const r of n){const n=new Event(r);Object.assign(n,t),e.dispatchEvent(n)}}(i,r,n)}),[e,t,n])}function IN(e,t,n){return e.clearRect(0,0,100,100),e.fillStyle=n,e.fillText(t,0,0),e.getImageData(0,0,1,1).data.join(",")}function RN(e){const t=function(){const e=document.createElement("canvas");e.width=e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});return t.textBaseline="top",t.font='100px "Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',t.scale(.01,.01),t}(),n=IN(t,e,"#fff"),r=IN(t,e,"#000");return r===n&&!r.startsWith("0,0,0,")}!function(e="Twemoji Country Flags",t="https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2"){if(typeof window<"u"&&RN("😊")&&!RN("🇨🇭")){const n=document.createElement("style");n.textContent=`@font-face {\n font-family: "${e}";\n unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067,\n U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;\n src: url('${t}') format('woff2');\n font-display: swap;\n }`,document.head.appendChild(n)}}(),yg(),function({observableFunctions:e,observableProperties:t,jsonReplacer:n,jsonReviver:r}){if(e)for(const i in e){const t=e[i];nr.set(i,t),Sr.prototype[i]=function(...e){return t.call(this,this._node,...e)}}if(t)for(const i in t){const e=t[i];tr.set(i,e),Object.defineProperty(Sr.prototype,i,{configurable:!0,get(){return e.get.call(this,this._node)},set(t){return e.set.call(this,this._node,t)}})}n&&(Jt.replacer=n),r&&(Jt.reviver=r)}({observableFunctions:{child:(e,t)=>(ii("string"==typeof t||"number"==typeof t,"Key should be a string or a number"),Nr.getProxy(e,t.toString()))}}),mi.registerHandler((({level:e,data:t})=>{console[e]("[TalkJS]",...t)}));const wN=Me((function(e,t){const{onSendMessage:n,onDeleteMessage:r,beforeBrowserPermissionPrompt:i,onMissingBrowserPermission:o,messageFieldPlaceholder:s,messageFieldSpellcheck:a}=e;ae((()=>{e.__internalOnLoaded?.()}),[]);const[u,l]=oe(!0);ae((()=>{l(!1)}),[]);const c=le(null);!function(e){ae((()=>{if(window.cordova){const t=e.current;ii.defined(t);const n=e=>{e.target instanceof HTMLAnchorElement&&(e.preventDefault(),function(e){const t=window;t.cordova.InAppBrowser?t.cordova.InAppBrowser.open(e,"_system"):window.open(e,"_system","location=yes")}(e.target.href))};return t.addEventListener("click",n),()=>t.removeEventListener("click",n)}}),[e])}(c);const d=bN(r,c,["deleteMessage","delete-message","deletemessage","DeleteMessage"]),h=bN(n,c,["sendMessage","send-message","sendmessage","SendMessage"]),p={beforeBrowserPermissionPrompt:i,onMissingBrowserPermissionCallback:bN(o,c,["browserPermissionDenied","browser-permission-denied","browserpermissiondenied","BrowserPermissionDenied"])},{store:f,controller:m,editorInternals:E,session:g}=NN(e,h,d),_=he((async()=>{const e=E.state$;if(e.isEmpty.peek()||e.atTextLimit.peek())return;const t=E.getText(),n=f.state$.referencedMessageId.peek();n&&m.setReferencedMessage(null),E.clearText(),f.state$.editor.showEmojiPicker.set(!1),await m.sendMessage({text:t,referencedMessageId:n??void 0})}),[m,E,f]);ae((()=>{const t=e.enterSendsMessage??!0;E.onEnter=t?_:void 0}),[E,e.enterSendsMessage,_]),ae((()=>{E.spellcheck$.set(a)}),[E,a]),ae((()=>{E.placeholder$.set(s)}),[E,s]),ce(t,(()=>({deleteMessage:e=>m.deleteMessage(e),editMessage:(e,t)=>m.editMessage(e,t),sendMessage:e=>m.sendMessage(e),sendFileMessage:e=>m.sendFileMessage(e),sendLocationMessage:e=>m.sendLocationMessage(e),setReferencedMessage:e=>m.setReferencedMessage(e),getMessageFieldText:()=>E.getText(),setMessageFieldText:e=>E.setText(e)})));const A=he((({error:t})=>bt(so,{appId:e.appId,chatboxState:{type:"unexpected-error",error:t}})),[e.appId]);return bt("div",u?{className:"t-chatbox",ref:c}:{className:"t-chatbox",ref:c,children:bt(wt,{fallbackRender:A,children:bt(ai.Provider,{value:E,children:bt(li.Provider,{value:f,children:bt(oi.Provider,{value:e.theme,children:bt(di.Provider,{value:p,children:bt(TT,{controller:m,appId:e.appId,chatHeaderVisible:e.chatHeaderVisible??!0,messageFieldVisible:e.messageFieldVisible??!0,session:g,sendMessage:_})})})})})})})}));function kN({photoUrl:e}){return mT`
|
|
1
|
+
var TalkChatbox=function(e){"use strict";var t,n,r,i,o,s,a,u,l,c,d,h,p={},f=[],m=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,E=Array.isArray;function g(e,t){for(var n in t)e[n]=t[n];return e}function _(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function A(e,n,r){var i,o,s,a={};for(s in n)"key"==s?i=n[s]:"ref"==s?o=n[s]:a[s]=n[s];if(arguments.length>2&&(a.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)null==a[s]&&(a[s]=e.defaultProps[s]);return D(e,a,i,o,null)}function D(e,t,i,o,s){var a={type:e,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++r:s,__i:-1,__u:0};return null==s&&null!=n.vnode&&n.vnode(a),a}function v(){return{current:null}}function O(e){return e.children}function T(e,t){this.props=e,this.context=t}function S(e,t){if(null==t)return e.__?S(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?S(e):null}function y(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return y(e)}}function C(e){(!e.__d&&(e.__d=!0)&&i.push(e)&&!N.__r++||o!=n.debounceRendering)&&((o=n.debounceRendering)||s)(N)}function N(){for(var e,t,r,o,s,u,l,c=1;i.length;)i.length>c&&i.sort(a),e=i.shift(),c=i.length,e.__d&&(r=void 0,s=(o=(t=e).__v).__e,u=[],l=[],t.__P&&((r=g({},o)).__v=o.__v+1,n.vnode&&n.vnode(r),M(t.__P,r,o,t.__n,t.__P.namespaceURI,32&o.__u?[s]:null,u,null==s?S(o):s,!!(32&o.__u),l),r.__v=o.__v,r.__.__k[r.__i]=r,F(u,r,l),r.__e!=s&&y(r)));N.__r=0}function b(e,t,n,r,i,o,s,a,u,l,c){var d,h,m,g,_,A,v=r&&r.__k||f,T=t.length;for(u=function(e,t,n,r,i){var o,s,a,u,l,c=n.length,d=c,h=0;for(e.__k=new Array(i),o=0;o<i;o++)null!=(s=t[o])&&"boolean"!=typeof s&&"function"!=typeof s?(u=o+h,(s=e.__k[o]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?D(null,s,null,null,null):E(s)?D(O,{children:s},null,null,null):null==s.constructor&&s.__b>0?D(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,-1!=(l=s.__i=w(s,n,u,d))&&(d--,(a=n[l])&&(a.__u|=2)),null==a||null==a.__v?(-1==l&&(i>c?h--:i<c&&h++),"function"!=typeof s.type&&(s.__u|=4)):l!=u&&(l==u-1?h--:l==u+1?h++:(l>u?h--:h++,s.__u|=4))):e.__k[o]=null;if(d)for(o=0;o<c;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==r&&(r=S(a)),U(a,a));return r}(n,t,v,u,T),d=0;d<T;d++)null!=(m=n.__k[d])&&(h=-1==m.__i?p:v[m.__i]||p,m.__i=d,A=M(e,m,h,i,o,s,a,u,l,c),g=m.__e,m.ref&&h.ref!=m.ref&&(h.ref&&P(h.ref,null,m),c.push(m.ref,m.__c||g,m)),null==_&&null!=g&&(_=g),4&m.__u||h.__k===m.__k?u=I(m,u,e):"function"==typeof m.type&&void 0!==A?u=A:g&&(u=g.nextSibling),m.__u&=-7);return n.__e=_,u}function I(e,t,n){var r,i;if("function"==typeof e.type){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=I(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=S(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function R(e,t){return t=t||[],null==e||"boolean"==typeof e||(E(e)?e.some((function(e){R(e,t)})):t.push(e)),t}function w(e,t,n,r){var i,o,s=e.key,a=e.type,u=t[n];if(null===u&&null==e.key||u&&s==u.key&&a==u.type&&!(2&u.__u))return n;if(r>(null==u||2&u.__u?0:1))for(i=n-1,o=n+1;i>=0||o<t.length;){if(i>=0){if((u=t[i])&&!(2&u.__u)&&s==u.key&&a==u.type)return i;i--}if(o<t.length){if((u=t[o])&&!(2&u.__u)&&s==u.key&&a==u.type)return o;o++}}return-1}function k(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||m.test(t)?n:n+"px"}function L(e,t,n,r,i){var o,s;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||k(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||k(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(u,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=l,e.addEventListener(t,o?d:c,o)):e.removeEventListener(t,o?d:c,o);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function x(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=l++;else if(t.t<r.u)return;return r(n.event?n.event(t):t)}}}function M(e,r,i,o,s,a,u,l,c,d){var h,f,m,A,D,v,y,C,N,I,R,w,k,x,M,F,P,U=r.type;if(null!=r.constructor)return null;128&i.__u&&(c=!!(32&i.__u),a=[l=r.__e=i.__e]),(h=n.__b)&&h(r);e:if("function"==typeof U)try{if(C=r.props,N="prototype"in U&&U.prototype.render,I=(h=U.contextType)&&o[h.__c],R=h?I?I.props.value:h.__:o,i.__c?y=(f=r.__c=i.__c).__=f.__E:(N?r.__c=f=new U(C,R):(r.__c=f=new T(C,R),f.constructor=U,f.render=H),I&&I.sub(f),f.props=C,f.state||(f.state={}),f.context=R,f.__n=o,m=f.__d=!0,f.__h=[],f._sb=[]),N&&null==f.__s&&(f.__s=f.state),N&&null!=U.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=g({},f.__s)),g(f.__s,U.getDerivedStateFromProps(C,f.__s))),A=f.props,D=f.state,f.__v=r,m)N&&null==U.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),N&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(N&&null==U.getDerivedStateFromProps&&C!==A&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(C,R),!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(C,f.__s,R)||r.__v==i.__v){for(r.__v!=i.__v&&(f.props=C,f.state=f.__s,f.__d=!1),r.__e=i.__e,r.__k=i.__k,r.__k.some((function(e){e&&(e.__=r)})),w=0;w<f._sb.length;w++)f.__h.push(f._sb[w]);f._sb=[],f.__h.length&&u.push(f);break e}null!=f.componentWillUpdate&&f.componentWillUpdate(C,f.__s,R),N&&null!=f.componentDidUpdate&&f.__h.push((function(){f.componentDidUpdate(A,D,v)}))}if(f.context=R,f.props=C,f.__P=e,f.__e=!1,k=n.__r,x=0,N){for(f.state=f.__s,f.__d=!1,k&&k(r),h=f.render(f.props,f.state,f.context),M=0;M<f._sb.length;M++)f.__h.push(f._sb[M]);f._sb=[]}else do{f.__d=!1,k&&k(r),h=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&++x<25);f.state=f.__s,null!=f.getChildContext&&(o=g(g({},o),f.getChildContext())),N&&!m&&null!=f.getSnapshotBeforeUpdate&&(v=f.getSnapshotBeforeUpdate(A,D)),F=h,null!=h&&h.type===O&&null==h.key&&(F=B(h.props.children)),l=b(e,E(F)?F:[F],r,i,o,s,a,u,l,c,d),f.base=r.__e,r.__u&=-161,f.__h.length&&u.push(f),y&&(f.__E=f.__=null)}catch(e){if(r.__v=null,c||null!=a)if(e.then){for(r.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,r.__e=l}else for(P=a.length;P--;)_(a[P]);else r.__e=i.__e,r.__k=i.__k;n.__e(e,r,i)}else null==a&&r.__v==i.__v?(r.__k=i.__k,r.__e=i.__e):l=r.__e=function(e,r,i,o,s,a,u,l,c){var d,h,f,m,g,A,D,v=i.props,O=r.props,T=r.type;if("svg"==T?s="http://www.w3.org/2000/svg":"math"==T?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=a)for(d=0;d<a.length;d++)if((g=a[d])&&"setAttribute"in g==!!T&&(T?g.localName==T:3==g.nodeType)){e=g,a[d]=null;break}if(null==e){if(null==T)return document.createTextNode(O);e=document.createElementNS(s,T,O.is&&O),l&&(n.__m&&n.__m(r,a),l=!1),a=null}if(null==T)v===O||l&&e.data==O||(e.data=O);else{if(a=a&&t.call(e.childNodes),v=i.props||p,!l&&null!=a)for(v={},d=0;d<e.attributes.length;d++)v[(g=e.attributes[d]).name]=g.value;for(d in v)if(g=v[d],"children"==d);else if("dangerouslySetInnerHTML"==d)f=g;else if(!(d in O)){if("value"==d&&"defaultValue"in O||"checked"==d&&"defaultChecked"in O)continue;L(e,d,null,g,s)}for(d in O)g=O[d],"children"==d?m=g:"dangerouslySetInnerHTML"==d?h=g:"value"==d?A=g:"checked"==d?D=g:l&&"function"!=typeof g||v[d]===g||L(e,d,g,v[d],s);if(h)l||f&&(h.__html==f.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),r.__k=[];else if(f&&(e.innerHTML=""),b("template"==r.type?e.content:e,E(m)?m:[m],r,i,o,"foreignObject"==T?"http://www.w3.org/1999/xhtml":s,a,u,a?a[0]:i.__k&&S(i,0),l,c),null!=a)for(d=a.length;d--;)_(a[d]);l||(d="value","progress"==T&&null==A?e.removeAttribute("value"):null!=A&&(A!==e[d]||"progress"==T&&!A||"option"==T&&A!=v[d])&&L(e,d,A,v[d],s),d="checked",null!=D&&D!=e[d]&&L(e,d,D,v[d],s))}return e}(i.__e,r,i,o,s,a,u,c,d);return(h=n.diffed)&&h(r),128&r.__u?void 0:l}function F(e,t,r){for(var i=0;i<r.length;i++)P(r[i],r[++i],r[++i]);n.__c&&n.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){n.__e(e,t.__v)}}))}function B(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:E(e)?e.map(B):g({},e)}function P(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){n.__e(e,r)}}function U(e,t,r){var i,o;if(n.unmount&&n.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||P(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){n.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&U(i[o],t,r||"function"!=typeof e.type);r||_(e.__e),e.__c=e.__=e.__e=void 0}function H(e,t,n){return this.constructor(e,n)}function j(e,r,i){var o,s,a,u;r==document&&(r=document.documentElement),n.__&&n.__(e,r),s=(o="function"==typeof i)?null:i&&i.__k||r.__k,a=[],u=[],M(r,e=(!o&&i||r).__k=A(O,null,[e]),s||p,p,r.namespaceURI,!o&&i?[i]:s?null:r.firstChild?t.call(r.childNodes):null,a,!o&&i?i:s?s.__e:r.firstChild,o,u),F(a,e,u)}function $(e,t){j(e,t,$)}function Y(e,n,r){var i,o,s,a,u=g({},e.props);for(s in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),n)"key"==s?i=n[s]:"ref"==s?o=n[s]:u[s]=null==n[s]&&null!=a?a[s]:n[s];return arguments.length>2&&(u.children=arguments.length>3?t.call(arguments,2):r),D(e.type,u,i||e.key,o||e.ref,null)}function z(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach((function(e){e.__e=!0,C(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+h++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}t=f.slice,n={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},r=0,T.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=g({},this.state),"function"==typeof e&&(e=e(g({},n),this.props)),e&&g(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),C(this))},T.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),C(this))},T.prototype.render=O,i=[],s="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,a=function(e,t){return e.__v.__b-t.__v.__b},N.__r=0,u=/(PointerCapture)$|Capture$/i,l=0,c=x(!1),d=x(!0),h=0;var V,G,W,X,K=0,q=[],J=n,Z=J.__b,Q=J.__r,ee=J.diffed,te=J.__c,ne=J.unmount,re=J.__;function ie(e,t){J.__h&&J.__h(G,e,K||t),K=0;var n=G.__H||(G.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function oe(e){return K=1,se(Oe,e)}function se(e,t,n){var r=ie(V++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Oe(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=G,!G.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(e){return!!e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var s=r.__c.props!==e;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),o&&o.call(this,e,t,n)||s};G.__f=!0;var o=G.shouldComponentUpdate,s=G.componentWillUpdate;G.componentWillUpdate=function(e,t,n){if(this.__e){var r=o;o=void 0,i(e,t,n),o=r}s&&s.call(this,e,t,n)},G.shouldComponentUpdate=i}return r.__N||r.__}function ae(e,t){var n=ie(V++,3);!J.__s&&ve(n.__H,t)&&(n.__=e,n.u=t,G.__H.__h.push(n))}function ue(e,t){var n=ie(V++,4);!J.__s&&ve(n.__H,t)&&(n.__=e,n.u=t,G.__h.push(n))}function le(e){return K=5,de((function(){return{current:e}}),[])}function ce(e,t,n){K=6,ue((function(){if("function"==typeof e){var n=e(t());return function(){e(null),n&&"function"==typeof n&&n()}}if(e)return e.current=t(),function(){return e.current=null}}),null==n?n:n.concat(e))}function de(e,t){var n=ie(V++,7);return ve(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function he(e,t){return K=8,de((function(){return e}),t)}function pe(e){var t=G.context[e.__c],n=ie(V++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(G)),t.props.value):e.__}function fe(e,t){J.useDebugValue&&J.useDebugValue(t?t(e):e)}function me(){var e=ie(V++,11);if(!e.__){for(var t=G.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function Ee(){for(var e;e=q.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ae),e.__H.__h.forEach(De),e.__H.__h=[]}catch(t){e.__H.__h=[],J.__e(t,e.__v)}}J.__b=function(e){G=null,Z&&Z(e)},J.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),re&&re(e,t)},J.__r=function(e){Q&&Q(e),V=0;var t=(G=e.__c).__H;t&&(W===G?(t.__h=[],G.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(Ae),t.__h.forEach(De),t.__h=[],V=0)),W=G},J.diffed=function(e){ee&&ee(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==q.push(t)&&X===J.requestAnimationFrame||((X=J.requestAnimationFrame)||_e)(Ee)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),W=G=null},J.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Ae),e.__h=e.__h.filter((function(e){return!e.__||De(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],J.__e(n,e.__v)}})),te&&te(e,t)},J.unmount=function(e){ne&&ne(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Ae(e)}catch(e){t=e}})),n.__H=void 0,t&&J.__e(t,n.__v))};var ge="function"==typeof requestAnimationFrame;function _e(e){var t,n=function(){clearTimeout(r),ge&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);ge&&(t=requestAnimationFrame(n))}function Ae(e){var t=G,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),G=t}function De(e){var t=G;e.__c=e.__(),G=t}function ve(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Oe(e,t){return"function"==typeof t?t(e):t}function Te(e,t){for(var n in t)e[n]=t[n];return e}function Se(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function ye(e,t){var n=t(),r=oe({t:{__:n,u:t}}),i=r[0].t,o=r[1];return ue((function(){i.__=n,i.u=t,Ce(i)&&o({t:i})}),[e,n,t]),ae((function(){return Ce(i)&&o({t:i}),e((function(){Ce(i)&&o({t:i})}))}),[e]),n}function Ce(e){var t,n,r=e.u,i=e.__;try{var o=r();return!((t=i)===(n=o)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}function Ne(e){e()}function be(e){return e}function Ie(){return[!1,Ne]}var Re=ue;function we(e,t){this.props=e,this.context=t}function ke(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:Se(this.props,e)}function r(t){return this.shouldComponentUpdate=n,A(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(we.prototype=new T).isPureReactComponent=!0,we.prototype.shouldComponentUpdate=function(e,t){return Se(this.props,e)||Se(this.state,t)};var Le=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Le&&Le(e)};var xe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Me(e){function t(t){var n=Te({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=xe,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Fe=function(e,t){return null==e?null:R(R(e).map(t))},Be={map:Fe,forEach:Fe,count:function(e){return e?R(e).length:0},only:function(e){var t=R(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:R},Pe=n.__e;n.__e=function(e,t,n,r){if(e.then)for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t);Pe(e,t,n,r)};var Ue=n.unmount;function He(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=Te({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return He(e,t,n)}))),e}function je(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return je(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function $e(){this.__u=0,this.o=null,this.__b=null}function Ye(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ze(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return A(n,i)}return i.displayName="Lazy",i.__f=!0,i}function Ve(){this.i=null,this.l=null}n.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ue&&Ue(e)},($e.prototype=new T).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var i=Ye(r.__v),o=!1,s=function(){o||(o=!0,n.__R=null,i?i(a):a())};n.__R=s;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=je(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},$e.prototype.componentWillUnmount=function(){this.o=[]},$e.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=He(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&A(O,null,e.fallback);return i&&(i.__u&=-33),[A(O,null,t.__a?null:e.children),i]};var Ge=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function We(e){return this.getChildContext=function(){return e.context},e.children}function Xe(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){j(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;null!==r&&!r.__m&&null!==r.__;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}j(A(We,{context:t.context},e.__v),t.v)}function Ke(e,t){var n=A(Xe,{__v:e,h:t});return n.containerInfo=t,n}(Ve.prototype=new T).__a=function(e){var t=this,n=Ye(t.__v),r=t.l.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),Ge(t,e,r)):i()};n?n(o):o()}},Ve.prototype.render=function(e){this.i=null,this.l=new Map;var t=R(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ve.prototype.componentDidUpdate=Ve.prototype.componentDidMount=function(){var e=this;this.l.forEach((function(t,n){Ge(e,n,t)}))};var qe="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Je=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ze=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Qe=/[A-Z0-9]/g,et="undefined"!=typeof document,tt=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function nt(e,t,n){return null==t.__k&&(t.textContent=""),j(e,t),"function"==typeof n&&n(),e?e.__c:null}function rt(e,t,n){return $(e,t),"function"==typeof n&&n(),e?e.__c:null}T.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(T.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var it=n.event;function ot(){}function st(){return this.cancelBubble}function at(){return this.defaultPrevented}n.event=function(e){return it&&(e=it(e)),e.persist=ot,e.isPropagationStopped=st,e.isDefaultPrevented=at,e.nativeEvent=e};var ut,lt={enumerable:!1,configurable:!0,get:function(){return this.class}},ct=n.vnode;n.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},i=-1===n.indexOf("-");for(var o in t){var s=t[o];if(!("value"===o&&"defaultValue"in t&&null==s||et&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===s?s="":"translate"===a&&"no"===s?s=!1:"o"===a[0]&&"n"===a[1]?"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||tt(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":Ze.test(o)&&(o=a):a=o="oninput":i&&Je.test(o)?o=o.replace(Qe,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=s}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=R(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=R(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",lt)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=qe,ct&&ct(e)};var dt=n.__r;n.__r=function(e){dt&&dt(e),ut=e.__c};var ht=n.diffed;n.diffed=function(e){ht&&ht(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),ut=null};var pt={ReactCurrentDispatcher:{current:{readContext:function(e){return ut.__n[e.__c].props.value},useCallback:he,useContext:pe,useDebugValue:fe,useDeferredValue:be,useEffect:ae,useId:me,useImperativeHandle:ce,useInsertionEffect:Re,useLayoutEffect:ue,useMemo:de,useReducer:se,useRef:le,useState:oe,useSyncExternalStore:ye,useTransition:Ie}}};function ft(e){return A.bind(null,e)}function mt(e){return!!e&&e.$$typeof===qe}function Et(e){return mt(e)&&e.type===O}function gt(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function _t(e){return mt(e)?Y.apply(null,arguments):e}function At(e){return!!e.__k&&(j(null,e),!0)}function Dt(e){return e&&(e.base||1===e.nodeType&&e)||null}var vt=function(e,t){return e(t)},Ot=function(e,t){return e(t)},Tt=O,St=mt,yt={useState:oe,useId:me,useReducer:se,useEffect:ae,useLayoutEffect:ue,useInsertionEffect:Re,useTransition:Ie,useDeferredValue:be,useSyncExternalStore:ye,startTransition:Ne,useRef:le,useImperativeHandle:ce,useMemo:de,useCallback:he,useContext:pe,useDebugValue:fe,version:"18.3.1",Children:Be,render:nt,hydrate:rt,unmountComponentAtNode:At,createPortal:Ke,createElement:A,createContext:z,createFactory:ft,cloneElement:_t,createRef:v,Fragment:O,isValidElement:mt,isElement:St,isFragment:Et,isMemo:gt,findDOMNode:Dt,Component:T,PureComponent:we,memo:ke,forwardRef:Me,flushSync:Ot,unstable_batchedUpdates:vt,StrictMode:Tt,Suspense:$e,SuspenseList:Ve,lazy:ze,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:pt};const Ct=Object.freeze(Object.defineProperty({__proto__:null,Children:Be,Component:T,Fragment:O,PureComponent:we,StrictMode:Tt,Suspense:$e,SuspenseList:Ve,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:pt,cloneElement:_t,createContext:z,createElement:A,createFactory:ft,createPortal:Ke,createRef:v,default:yt,findDOMNode:Dt,flushSync:Ot,forwardRef:Me,hydrate:rt,isElement:St,isFragment:Et,isMemo:gt,isValidElement:mt,lazy:ze,memo:ke,render:nt,startTransition:Ne,unmountComponentAtNode:At,unstable_batchedUpdates:vt,useCallback:he,useContext:pe,useDebugValue:fe,useDeferredValue:be,useEffect:ae,useErrorBoundary:function(e){var t=ie(V++,10),n=oe();return t.__=e,G.componentDidCatch||(G.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]},useId:me,useImperativeHandle:ce,useInsertionEffect:Re,useLayoutEffect:ue,useMemo:de,useReducer:se,useRef:le,useState:oe,useSyncExternalStore:ye,useTransition:Ie,version:"18.3.1"},Symbol.toStringTag,{value:"Module"}));var Nt=0;function bt(e,t,r,i,o,s){t||(t={});var a,u,l=t;if("ref"in l)for(u in l={},t)"ref"==u?a=t[u]:l[u]=t[u];var c={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Nt,__i:-1,__u:0,__source:o,__self:s};if("function"==typeof e&&(a=e.defaultProps))for(u in a)void 0===l[u]&&(l[u]=a[u]);return n.vnode&&n.vnode(c),c}const It=z(null),Rt={didCatch:!1,error:null};class wt extends T{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Rt}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,r=arguments.length,i=new Array(r),o=0;o<r;o++)i[o]=arguments[o];null===(t=(n=this.props).onReset)||void 0===t||t.call(n,{args:i,reason:"imperative-api"}),this.setState(Rt)}}componentDidCatch(e,t){var n,r;null===(n=(r=this.props).onError)||void 0===n||n.call(r,e,t)}componentDidUpdate(e,t){const{didCatch:n}=this.state,{resetKeys:r}=this.props;var i,o;n&&null!==t.error&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some(((e,n)=>!Object.is(e,t[n])))}(e.resetKeys,r)&&(null===(i=(o=this.props).onReset)||void 0===i||i.call(o,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(Rt))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:r}=this.props,{didCatch:i,error:o}=this.state;let s=e;if(i){const e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)s=t(e);else if(n)s=A(n,e);else{if(void 0===r)throw o;s=r}}return A(It.Provider,{value:{didCatch:i,error:o,resetErrorBoundary:this.resetErrorBoundary}},s)}}var kt=Object.prototype.hasOwnProperty;function Lt(e){return Array.isArray(e)}function xt(e){return!(!e||"object"!=typeof e||e instanceof Date||Lt(e))}function Mt(e){return"function"==typeof e}function Ft(e){const t=typeof e;return void 0!==e&&(Bt(e)||"object"!==t&&"function"!==t)}function Bt(e){return e instanceof Date}function Pt(e){return"boolean"==typeof e}function Ut(e){return e instanceof Promise}function Ht(e){return e instanceof Map}function jt(e){if(!e)return!1;if(Lt(e))return 0===e.length;for(const t in e)if(kt.call(e,t))return!1;return!0}function $t(e){return null==e}var Yt=new Set(["boolean","string","number"]);function zt(e){return!!e.parent}var Vt=Symbol.toPrimitive,Gt=Symbol("getNode"),Wt=Symbol("delete"),Xt=Symbol("opaque"),Kt=Symbol("optimized"),qt=Symbol("linked"),Jt={isLoadingLocal:!1,isMerging:!1,isLoadingRemote:!1,activateSyncedNode:void 0,pendingNodes:new Map,dirtyNodes:new Set,replacer:void 0,reviver:void 0};function Zt(e){return Lt(e)?"array":Ht(e)?"map":e instanceof Set?"set":"object"}function Qt(e,t){return Ht(t)?{__LSType:"Map",value:Array.from(t.entries())}:t instanceof Set?{__LSType:"Set",value:Array.from(t)}:(Jt.replacer&&(t=Jt.replacer(e,t)),t)}var en=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/;function tn(e,t){if(t){if("string"==typeof t&&en.test(t))return new Date(t);if("object"==typeof t){if("Map"===t.__LSType)return new Map(t.value);if("Set"===t.__LSType)return new Set(t.value)}Jt.reviver&&(t=Jt.reviver(e,t))}return t}function nn(e){return e?JSON.stringify(e,Qt):e}function rn(e){return e?JSON.parse(e,tn):e}function on(e){return rn(nn(e))}function sn(e){return!!e&&!!e[Gt]}function an(e){return e&&e[Gt]}function un(e,t){var n,r,i;const o=null!=(n=e.parent)?n:e,s=e.parent?e.key:"_",a=t===Wt;a&&(t=void 0);const u=e.parent?hn(o):o.root,l=u[s],c=Mt(t);if(t=o.isAssigning||!c||Mt(l)?t:t(l),!Jt.isMerging||$t(l)||Mt(l)||!(null==(i=null==(r=e.parent)?void 0:r.functions)?void 0:i.get(s)))try{o.isSetting=(o.isSetting||0)+1;const e=Ht(u);a?e?u.delete(s):delete u[s]:Ht(u)?u.set(s,t):u[s]=t}finally{o.isSetting--}return{prevValue:l,newValue:t}}var ln=[];function cn(e){let t=0,n=e;for(;zt(n);)ln[t++]=n.key,n=n.parent;let r=e.root._;for(let i=t-1;r&&i>=0;i--){const e=ln[i];r="size"!==e&&(Ht(r)||r instanceof WeakMap)?r.get(e):r[e]}return r}function dn(e,t,n){var r,i;let o=null==(r=e.children)?void 0:r.get(t);return o||(o={root:e.root,parent:e,key:t,lazy:!0,numListenersRecursive:0},1===(null==(i=e.lazyFn)?void 0:i.length)&&(n=e.lazyFn.bind(e,t)),Mt(n)&&(o=Object.assign((()=>{}),o),o.lazyFn=n),e.children||(e.children=new Map),e.children.set(t,o)),o}function hn(e){let t=cn(e);return t&&!Mt(t)||(t=zt(e)?hn(e.parent)[e.key]={}:e.root._={}),t}function pn(e,t){var n,r;let i=sn(e)?void 0:xt(e)?"id"in e?"id":"key"in e?"key":"_id"in e?"_id":"__id"in e?"__id":void 0:void 0;if(!i&&t.parent){const e=t.key+"_keyExtractor",o=null!=(r=null==(n=t.functions)?void 0:n.get(e))?r:cn(t.parent)[t.key+"_keyExtractor"];o&&Mt(o)&&(i=o)}return i}function fn(e,t,n){e.functions||(e.functions=new Map),e.functions.set(t,n)}function mn(e,t){return e===t||Bt(e)&&Bt(t)&&+e==+t}function En(e,t,n){let r=e;return!sn(r)&&Mt(r)&&(r=t?r(t):r()),sn(r)&&!n?r.get():r}function gn(e){return e&&(e[Xt]=!0),e}var _n,An=(e,t)=>e&&e[t];function Dn(e,t,n,r,i,o,s){let a,u=e;if(t.length>0){let i=o;for(let o=0;o<t.length;o++){if(a=t[o],u[a]===Wt)return i&&(u[a]=i[a],null==s||s(t.slice(0,o+1),u[a])),e;if(void 0===u[a]&&void 0===r&&o===t.length-1)return e;void 0!==u[a]&&null!==u[a]||(u[a]=On(n[o])),o<t.length-1&&(u=u[a],i&&(i=i[a]))}}return void 0===a?e="merge"===i?vn(e,r):r:"merge"===i?u[a]=vn(u[a],r):Ht(u)?u.set(a,r):u[a]=r,e}function vn(e,t,n){var r;sn(t)&&(t=t.peek());const i=sn(e),o=i?e.peek():e,s=Lt(o);if(!s&&xt(o)&&xt(t)&&!jt(o)||s&&o.length>0){const n=Object.keys(t);for(let o=0;o<n.length;o++){const s=n[o],a=t[s];if(a===Wt)i&&(null==(r=e[s])?void 0:r.delete)?e[s].delete():delete e[s];else{const t=xt(a),n=!t&&Lt(a),r=e[s];if(!t&&!n||!r||!i&&jt(r))if(i)r.set(a);else{const t=xt(a)?{...a}:Lt(a)?[...a]:a;e[s]=t}else i||r&&(t?xt(r):Lt(r))?vn(r,a):e[s]=a}}}else void 0!==t&&(i?e.set(t):e=t);return e}function On(e){switch(e){case"array":return[];case"object":return{};case"map":return new Map;case"set":return new Set}}function Tn(e,t,n){const{path:r,valueAtPath:i,prevAtPath:o,pathTypes:s}=t;return Dn(e,r,s,o)}var Sn=0,yn=!1,Cn=!1,Nn=new Map;function bn(){Nn.size>0&&Bn(!0)}function In(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Rn(e,t){return function(){return function(e,t){try{return function(e,t){for(let n=0;n<t.length;n++)e=Tn(e,t[n]);return e}(e?on(e):{},t)}catch(e){return}}(e,t)}}function wn(e,t,n,r,i){const o=new Map;kn(o,e,Jt.isLoadingLocal,Jt.isLoadingRemote,t,[],[],t,n,!0,r,i),o.size&&Ln(o,!0);const s=Nn.get(e);s?s.value=t:Nn.set(e,{value:t,prev:n,level:r,whenOptimizedOnlyIf:i,remote:Jt.isLoadingRemote,loading:Jt.isLoadingLocal}),Sn<=0&&xn()}function kn(e,t,n,r,i,o,s,a,u,l,c,d){if(function(e,t,n,r,i,o,s,a,u,l,c,d){if(l?t.listenersImmediate:t.listeners){const l={path:o,pathTypes:s,valueAtPath:a,prevAtPath:u},h=e.get(t);if(h&&o.length>0){const{changes:e}=h;In(e[0].path,l.path)||e.push(l)}else e.set(t,{level:c,value:i,remote:r,loading:n,whenOptimizedOnlyIf:d,changes:[l]})}}(e,t,n,r,i,o,s,a,u,l,c,d),t.linkedFromNodes)for(const h of t.linkedFromNodes)kn(e,Pn(h,o),n,r,a,[],[],a,u,l,0,d);if(t.parent){const h=t.parent;h&&kn(e,h,n,r,cn(h),[t.key].concat(o),[Zt(i)].concat(s),a,u,l,c+1,d)}}function Ln(e,t){const n=new Set;e.forEach((({changes:e,level:r,value:i,loading:o,remote:s,whenOptimizedOnlyIf:a},u)=>{const l=t?u.listenersImmediate:u.listeners;if(l){let t;const u=Array.from(l);for(let l=0;l<u.length;l++){const c=u[l],{track:d,noArgs:h,listener:p}=c;n.has(p)||(!0===d?r<=0:d!==Kt||a&&r<=0)&&(h||t||(t={value:i,loading:o,remote:s,getPrevious:Rn(i,e),changes:e}),d||n.add(p),p(t))}}}))}function xn(){const e=Array.from(Jt.dirtyNodes);Jt.dirtyNodes.clear(),e.forEach((e=>{const t=e.dirtyFn;t&&(e.dirtyFn=void 0,t())}));const t=Nn;Nn=new Map;const n=new Map;t.forEach((({value:e,prev:t,level:r,loading:i,remote:o,whenOptimizedOnlyIf:s},a)=>{kn(n,a,i,o,e,[],[],e,t,!1,r,s)})),n.size&&Ln(n,!1)}function Mn(e){Fn();try{e()}finally{Bn()}}function Fn(){Sn++,_n||(_n=setTimeout(bn,0))}function Bn(e){(--Sn<=0||e)&&(yn?Cn=!0:(_n&&(clearTimeout(_n),_n=void 0),Sn=0,yn=!0,xn(),yn=!1,Cn&&(Cn=!1,Bn(!0))))}function Pn(e,t){let n=e;for(let r=0;r<t.length;r++)n=dn(n,t[r]);return n}function Un(e,t,n,r,i){if(sn(e))return e;const o=Ut(e);let s={root:{_:e},lazy:!0,numListenersRecursive:0};var a;Mt(e)&&(s=Object.assign((()=>{}),s),s.lazyFn=e);const u=(a=e,Yt.has(typeof a)?new i(s):r(s));return o&&(un(s,void 0),n(s,e)),u}function Hn(e,t,n={},r){var i;const{initial:o,immediate:s,noArgs:a}=n,{trackingType:u}=n;let l=s?e.listenersImmediate:e.listeners;l||(l=new Set,s?e.listenersImmediate=l:e.listeners=l);const c={listener:t,track:u,noArgs:a};if(l.add(c),o){const n=cn(e);t({value:n,loading:!0,remote:!1,changes:[{path:[],pathTypes:[],prevAtPath:n,valueAtPath:n}],getPrevious:()=>{}})}let d;function h(i,o=t,s){if(!(null==r?void 0:r.has(i))){r||(r=new Set),r.add(s||e),o||(o=t);const a={trackingType:!0,...n};d=[...d||[],Hn(i,o,a,r)]}}e.linkedToNode&&h(e.linkedToNode),null==(i=e.linkedFromNodes)||i.forEach((e=>h(e))),e.numListenersRecursive++;let p=e.parent,f=[e.key];for(;p;){if(p.linkedFromNodes)for(const e of p.linkedFromNodes)(null==r?void 0:r.has(e))||h(e,jn(e,f,t),p);p.numListenersRecursive++,f=[p.key,...f],p=p.parent}return()=>{l.delete(c),null==d||d.forEach((e=>e()));let t=e;for(;t;)t.numListenersRecursive--,t=t.parent}}function jn(e,t,n){let{valueAtPath:r}=$n(cn(e),t);return function({value:e,loading:i,remote:o}){const{valueAtPath:s}=$n(e,t);s!==r&&n({value:s,loading:i,remote:o,changes:[{path:[],pathTypes:[],prevAtPath:r,valueAtPath:s}],getPrevious:()=>r}),r=s}}function $n(e,t){let n=e;const r=[];for(let i=0;n&&i<t.length;i++)r.push(Lt(n)?"array":"object"),n=n[t[i]];return{valueAtPath:n,pathTypes:r}}var Yn=0,zn=[],Vn={current:void 0};function Gn(e,t){if(Yn){const n=Vn.current;if(n){n.nodes||(n.nodes=new Map);const r=n.nodes.get(e);r?(r.track=r.track||t,r.num++):n.nodes.set(e,{node:e,track:t,num:1})}}}function Wn(e,t,n,r,i){let o,s=t;zn.push(Vn.current),Yn++,Vn.current={};const a=e?En(e,n,null==r?void 0:r.fromComputed):e,u=Vn.current.nodes;return--Yn<0&&(Yn=0),Vn.current=zn.pop(),(null==n?void 0:n.cancel)||(o=function(e,t,n,r){let i=[];return null==e||e.forEach((e=>{const{node:n,track:o}=e;i.push(Hn(n,t,{trackingType:o,immediate:r,noArgs:false}))})),()=>{if(i){for(let e=0;e<i.length;e++)i[e]();i=void 0}}}(u,s,0,null==r?void 0:r.immediate)),{nodes:u,value:a,dispose:o,resubscribe:void 0}}function Xn(e,t,n){let r,i;Mt(t)?r=t:n=t;const o={num:0},s=function(){o.onCleanup&&(o.onCleanup(),o.onCleanup=void 0),Fn(),delete o.value,null==i||i();const{dispose:t,value:a,nodes:u}=Wn(e,s,o,n);i=t,o.value=a,o.nodes=u,o.refresh=s,o.onCleanupReaction&&(o.onCleanupReaction(),o.onCleanupReaction=void 0),Bn(),r&&((null==n?void 0:n.fromComputed)||(o.num>0||!function(e){var t;return e&&(null==(t=e[Gt])?void 0:t.isEvent)}(e))&&(o.previous!==o.value||"object"==typeof o.value))&&r(o),o.previous=o.value,o.num++};return s(),()=>{var e,t;null==(e=o.onCleanup)||e.call(o),o.onCleanup=void 0,null==(t=o.onCleanupReaction)||t.call(o),o.onCleanupReaction=void 0,null==i||i()}}function Kn(e,t,n){if(Ut(e))return t?e.then(t):e;let r,i;return Xn((function(t){const i=En(e);if(!Ut(i))return!Ut(i)&&(n?function(e){return!(!e||(xt(e)||Lt(e))&&jt(e))}(i):i)&&(r=i,t.cancel=!0),r;r=i}),(function(){i=null==t?void 0:t(r)})),Ut(r)?t?r.then(t):r:void 0!==r?t?i:Promise.resolve(r):new Promise((e=>{if(t){const n=t;t=t=>{const r=n(t);e(Ut(r)?r.then((e=>e)):r)}}else t=e}))}function qn(e,t){return Kn(e,t,!1)}function Jn(e,t){return Kn(e,t,!0)}var Zn=new Set(["copyWithin","fill","from","pop","push","reverse","shift","sort","splice","unshift"]),Qn=new Set(["every","filter","find","findIndex","forEach","join","map","reduce","some"]),er=new Set(["filter","find"]),tr=new Map,nr=new Map([["get",mr],["set",cr],["peek",Er],["onChange",Hn],["assign",function(e,t){const n=ar(e);if(Fn(),Ft(e.root._)&&(e.root._={}),Ht(t)){const n=cn(e);Ht(n)&&t.forEach(((e,t)=>n.set(t,e)))}else{e.isAssigning=(e.isAssigning||0)+1;try{Object.assign(n,t)}finally{e.isAssigning--}}return Bn(),n}],["delete",function(e,t){void 0===t&&zt(e)&&(t=e.key,e=e.parent);const n=cn(e);Lt(n)?rr(e,n,"splice",t,1):dr(e,null!=t?t:"_",Wt,-1)}],["toggle",function(e){const t=cn(e);(null==t||Pt(t))&&cr(e,!t)}]]);function rr(e,t,n,...r){var i;if("push"!==n||1!==r.length){const o=t.slice(),s=t[n].apply(t,r);if(e){const n=zt(e),r=n?e.key:"_";(n?cn(e.parent):e.root)[r]=o,dr(null!=(i=e.parent)?i:e,r,t)}return s}dr(e,t.length+"",r[0])}function ir(e,t,n){return t?void 0:e?n?Array.from(e.keys()):Object.keys(e):[]}function or(e,t,n){var r,i,o;if(xt(t)&&t[Xt]||xt(n)&&n[Xt]){const r=t!==n;return r&&(e.listeners||e.listenersImmediate)&&wn(e,t,n,0),r}const s=Lt(t);let a,u;const l=Ht(t),c=Ht(n),d=ir(t,s,l),h=ir(n,s,c),p=(null==(r=d||t)?void 0:r.length)||0,f=(null==(i=h||n)?void 0:i.length)||0;let m,E,g,_=!1;if(s&&Lt(n)){if(n.length>0){const r=n[0];if(void 0!==r&&(m=pn(r,e),m&&(E=Mt(m),a=new Map,u=[]),e.children))for(let i=0;i<n.length;i++){const r=n[i];if(r){const n=e.children.get(i+"");if(n&&(t[i]||sr(n,r),m)){const e=E?m(r):r[m];a.set(e,n)}}}}}else if(n&&(!t||xt(t))){const t=h.length;for(let r=0;r<t;r++){const t=h[r];if(!d.includes(t)){_=!0;const r=dn(e,t),i=c?n.get(t):n[t];void 0!==i&&sr(r,i)}}}if(t&&!Ft(t)){_=_||p!==f;const r=_;let i=!1;for(let h=0;h<p;h++){const p=s?h+"":d[h];let f=l?t.get(p):t[p];const g=c?null==n?void 0:n.get(p):null==n?void 0:n[p];let A=!mn(f,g);if(A){const c=m&&f?E?m(f):f[m]:void 0,d=null==(o=e.children)?void 0:o.get(p);if(sn(f)){const e=an(f);if((null==d?void 0:d.linkedToNode)===e){const n=cn(e);l?t.set(p,n):t[p]=n;continue}const n=f;f=()=>n}let h=dn(e,p,f);if(h.lazy||!Mt(f)&&!sn(f)||(Ar(h,f),_r(h)),s&&void 0!==c){const t=void 0!==c?null==a?void 0:a.get(c):void 0;if(t){if(void 0!==t&&t.key!==p){const o=n[t.key];r&&(h=t,e.children.delete(h.key),h.key=p,u.push([p,h])),i=!0,A=o!==f}}else _=!0}if(A)if(Mt(f)||sn(f))fr(e,p,f);else if(Ft(f))_=!0;else{const e=or(h,f,g);_=_||e,A=e}(A||s&&!r)&&(h.listeners||h.listenersImmediate)&&wn(h,f,g,0,!r)}}if(u)for(let t=0;t<u.length;t++){const[n,r]=u[t];e.children.set(n,r)}g=_||i}else void 0!==n&&(g=!0);return null!=g&&g}function sr(e,t){var n,r;null==(n=e.linkedToNodeDispose)||n.call(e),null==(r=e.activatedObserveDispose)||r.call(e),Ft(t)||or(e,void 0,t),(e.listeners||e.listenersImmediate)&&wn(e,void 0,t,0)}function ar(e,t,n){return void 0!==t&&(e=dn(e,t,n)),e.proxy||(e.proxy=new Proxy(e,lr))}function ur(){if(Jt.pendingNodes.size>0){const e=Array.from(Jt.pendingNodes.values());Jt.pendingNodes.clear(),e.forEach((e=>e()))}}var lr={get(e,t,n){var r,i;if(t===Vt)throw new Error("[legend-state] observable is not a primitive.");if(t===Gt)return e;if("apply"===t){const t=cn(e);if(Mt(t))return t.apply}let o=_r(e,"get"===t||"peek"===t);const s=e.linkedToNode||(null==o?void 0:o[Gt]);if(s&&"onChange"!==t)return lr.get(s,t,n);if(Ht(o)||o instanceof WeakMap||o instanceof Set||o instanceof WeakSet){const n=function(e,t,n){const r=null==n?void 0:n[t];return"size"===t?ar(e,t):Mt(r)?function(r,i,o){const s=arguments.length,a=n;if("get"===t){if(s>0&&"boolean"!=typeof r&&r!==Kt)return ar(e,r)}else if("set"===t){if(2===s){const t=a.get(r),n=a.set(r,i);return t!==i&&hr(dn(e,r),i,t),n}1===s&&Ht(n)&&cr(e,r)}else if("delete"===t){if(s>0){const t=n.get?a.get(r):r,i=n.delete(r);return i&&hr(dn(e,r),void 0,t),i}}else{if("clear"===t){const t=new Map(a),r=a.size;return a.clear(),void(r&&hr(e,n,t))}if("add"===t){const i=new Set(n),o=n.add(r);return n.has(t)||wn(e,o,i,0),o}}const u=nr.get(t);if(!u)return n[t](r,i);switch(s){case 0:return u(e);case 1:return u(e,r);case 2:return u(e,r,i);default:return u(e,r,i,o)}}:void 0}(e,t,o);if(void 0!==n)return n}const a=nr.get(t);if(a)return"get"!==t&&"peek"!==t||ur(),function(t,n,r){switch(arguments.length){case 0:return a(e);case 1:return a(e,t);case 2:return a(e,t,n);default:return a(e,t,n,r)}};const u=tr.get(t);if(u)return u.get(e);let l=null==o?void 0:o[t];if(xt(o)&&o[Xt])return l;const c=null==(r=e.functions)?void 0:r.get(t);if(c)return sn(c)?c:ar(e,t,c);if(l=function(e,t){if(e){const n=Object.getOwnPropertyDescriptor(e,t);return(null==n?void 0:n.get)&&(delete e[t],e[t]=n.set?function(e){Mt(e)&&(e={get:e});const t=function(){return{[qt]:e}};return t.prototype[qt]=e,t}({get:n.get,set:({value:e})=>n.set(e)}):n.get),e[t]}}(o,t),$t(o)&&void 0===l&&(Zn.has(t)||Qn.has(t))&&(o=[],un(e,o),l=o[t]),Mt(l)){if(Lt(o)){if(Zn.has(t))return(...n)=>rr(e,o,t,...n);if(Qn.has(t))return Gn(e,!0),function(n,r){const i="reduce"===t,s=i?(t,r,i,o)=>n(t,ar(e,i+"",r),i,o):(t,r,i)=>n(ar(e,r+"",t),r,i);if(i||!er.has(t))return o[t](s,r);const a="find"===t,u=[];for(let t=0;t<o.length;t++)if(s(o[t],t,o)){const n=ar(e,t+"");if(a)return n;u.push(n)}return a?void 0:u}}fr(e,t,l);const n=null==(i=e.functions)?void 0:i.get(t);return n?ar(e,t,n):l.bind(o)}return Ft(l)&&Lt(o)&&"length"===t?(Gn(e,!0),l):ar(e,t)},getPrototypeOf(e){const t=cn(e);return null!==t&&"object"==typeof t?Reflect.getPrototypeOf(t):null},ownKeys(e){_r(e);const t=mr(e,!0);if(Ft(t))return[];const n=t?Reflect.ownKeys(t):[];if(Lt(t)&&"length"===n[n.length-1]&&n.splice(n.length-1,1),Mt(e)){const t=Reflect.ownKeys(e);["caller","arguments","prototype"].forEach((e=>t.includes(e)&&n.push(e)))}return n},getOwnPropertyDescriptor(e,t){if("caller"===t||"arguments"===t||"prototype"===t)return{configurable:!1,enumerable:!1};const n=cn(e);return Ft(n)?void 0:Reflect.getOwnPropertyDescriptor(n,t)},set(e,t,n){if(e.isSetting)return Reflect.set(e,t,n);if(e.isAssigning)return dr(e,t,n),!0;const r=tr.get(t);return!!r&&(r.set(e,n),!0)},deleteProperty:(e,t)=>!!e.isSetting&&Reflect.deleteProperty(e,t),has(e,t){const n=cn(e);return Reflect.has(n,t)},apply:(e,t,n)=>(sn(t)&&(t=t.peek()),Reflect.apply(e.lazyFn||e,t,n))};function cr(e,t){e.parent?dr(e.parent,e.key,t):dr(e,"_",t)}function dr(e,t,n,r){const i=!e.parent&&"_"===t;!e.parent||cn(e)||Mt(n)||cr(e,{[t]:n});const o=i?e:dn(e,t,n);if(sn(n))vr(o,n);else{const{newValue:s,prevValue:a}=un(o,n),u=Ft(s)||s instanceof Date;mn(s,a)||hr(e,s,a,o,u,i,r),u||(o.needsExtract=!0),fr(e,t,s)}}function hr(e,t,n,r,i,o,s){r||(r=e),Fn(),void 0===i&&(i=Ft(t));let a=i,u=!1;(!i||n&&!Ft(n))&&(a=or(r,t,n),Lt(t)&&(u=(null==t?void 0:t.length)!==(null==n?void 0:n.length))),(i||!t||jt(t)&&!jt(n)?t!==n:a)&&wn(i&&o?e:r,t,n,(null!=s?s:void 0===n)?-1:a?0:1,u),Bn()}function pr(e,t,n){e.state||(e.state=Un({isLoaded:!1},0,pr,ar)),t.then((t=>{n?n({value:t}):cr(e,t),e.state.assign({isLoaded:!0,error:void 0})})).catch((t=>{e.state.error.set(t)}))}function fr(e,t,n){if(Ut(n)){const r=dn(e,t);return pr(r,n),void un(r,void 0)}if(sn(n)){const r=()=>n;fn(e,t,r);const i=dn(e,t,r);return un(i,Er(an(n))),cn(i)}if("function"==typeof n)return fn(e,t,n),t}function mr(e,t){return Gn(e,t?xt(t)?t.shallow:t:void 0),Er(e)}function Er(e){return _r(e,!0)}var gr=!1;function _r(e,t){var n;if(gr=!0,t&&(null==(n=e.dirtyChildren)?void 0:n.size)){const t=Array.from(e.dirtyChildren);e.dirtyChildren.clear(),t.forEach((e=>e.dirtyFn&&_r(e)))}if(e.dirtyFn){const t=e.dirtyFn;e.dirtyFn=void 0,Jt.dirtyNodes.delete(e),t()}gr=!1;let r=cn(e);return r=function(e,t,n){const r=t,i=e.lazy;if(i){const n=e.lazyFn;if(delete e.lazy,Mt(n))if(1===n.length)t={};else{if(e.parent){const t=cn(e.parent);t?delete t[e.key]:e.root._=void 0}t=function(e,t){let n,r,i,o=!0;const s=t;let a,u,l=[];function c(){e.dirtyFn=u,Jt.dirtyNodes.add(e)}return e.activatedObserveDispose=Xn((()=>{var t,a,l,c;if(o)o=!1,un(e,void 0);else if(!gr&&u&&function(e,t){if(!gr){const n=function(e){var t,n;let r=e,i=e.numListenersRecursive>0;for(;r&&!i;)((null==(t=r.listeners)?void 0:t.size)||(null==(n=r.listenersImmediate)?void 0:n.size))&&(i=!0),r=r.parent;return i}(e);if(!n){t&&(e.dirtyFn=t);let n=e;for(;n;)n.dirtyChildren||(n.dirtyChildren=new Set),n.dirtyChildren.add(e),n=n.parent;return!0}}}(e,u))return void(i=!0);let d=s(),h=!1;sn(d)&&(h=!0,d=vr(e,d)),Mt(d)&&(d=d());const p=sn(d)||null==d?void 0:d[qt];if(p&&(e.activationState=p,d=void 0),i=!1,r=Ut(d),e.activated){if(e.activationState){const n=e.activationState;(null==(a=null==(t=e.state)?void 0:t.peek())?void 0:a.sync)?(e.state.sync(),i=!0):d=null!=(c=null==(l=n.get)?void 0:l.call(n))?c:n.initial}}else{e.activated=!0;let t=Dr;(null==p?void 0:p.synced)&&(t=Jt.activateSyncedNode,i=!0);const r=t(e,d);n=r.update;let o=r.value;!h&&sn(o)&&(o=vr(e,o)),d=null!=o?o:null==p?void 0:p.initial}return r=r||Ut(d),d}),(t=>{const{value:o,nodes:s,refresh:d}=t;if(u=d,!i){if(!r||!Jt.isLoadingRemote)if(r)if(e.activationState){const{initial:t}=e.activationState;o&&Ut(o)&&pr(e,o,n),Mt(cn(e))&&un(e,null!=t?t:void 0)}else e.activated&&(pr(e,o,n),Mt(cn(e))&&un(e,void 0));else a=o,e.state.isLoaded.peek()?(e.isComputing=!0,cr(e,o),e.isComputing=!1):(un(e,o),e.state.assign({isLoaded:!0,error:void 0}));l.forEach((e=>e())),l=[],null==s||s.forEach((({node:e,track:t})=>{l.push(Hn(e,c,{immediate:!0,trackingType:t}))}))}t.cancel=!0}),{fromComputed:!0}),a}(e,n)}else sn(t)&&(t=fr(e.parent,e.key,t))}return!i&&!e.needsExtract||sn(t)||Ft(t)||(n&&function(e,t){if((xt(e)||Lt(e))&&!e[Xt]){const n=[],r=()=>{var e;let r=t;for(let t=0;t<n.length;t++){const{key:i}=n[t],o=null==(e=cn(r))?void 0:e[i];r=dn(r,i,Mt(o)?o:void 0),_r(r)}return r};Or(e,n,r)}}(t,e),e.parent&&fr(e.parent,e.key,r)),t}(e,r,!!t),r}function Ar(e,t){var n,r;null==(n=e.activatedObserveDispose)||n.call(e),null==(r=e.linkedToNodeDispose)||r.call(e),e.activatedObserveDispose=e.linkedToNodeDispose=e.linkedToNode=void 0,e.lazyFn=t,e.lazy=!0}function Dr(e,t){if(e.state||(e.state=Un({isLoaded:!1},0,pr,ar)),e.activationState){const{set:n,get:r,initial:i}=e.activationState;if(null!=(t=null==r?void 0:r())&&null!==t||(t=i),n){let t,r=[],i=0;const o=o=>{if(r.length>0){let s,a,u,l=!1,c=!1;o?(s=o.changes,a=o.value,l=o.loading,c=o.remote,u=o.getPrevious):(s=r,a=t,u=Rn(a,s)),r=[],t=void 0,Jt.pendingNodes.delete(e),i++;const d=i,h=()=>{d===i&&(e.isComputing=!0,n({value:a,changes:s,loading:l,remote:c,getPrevious:u}),e.isComputing=!1)};Jn(e.state.isLoaded,h)}};Hn(e,(({value:n,changes:i})=>{e.isComputing||(i.length>1||!Mt(i[0].prevAtPath))&&(t=n,r.length>0&&(i=i.filter((e=>!In(r[0].path,e.path)))),r.push(...i),Jt.pendingNodes.set(e,o))}),{immediate:!0}),Hn(e,o)}}return{update:({value:t})=>{e.isComputing||(e.isComputing=!0,cr(e,t),e.isComputing=!1)},value:t}}function vr(e,t){var n;const r=an(t);return r!==e&&(null==r?void 0:r.linkedToNode)!==e&&(e.linkedToNode=r,r.linkedFromNodes||(r.linkedFromNodes=new Set),r.linkedFromNodes.add(e),null==(n=e.linkedToNodeDispose)||n.call(e),e.linkedToNodeDispose=Hn(r,(()=>{t=_r(r),cr(e,t)}),{initial:!0},new Set([e]))),t}function Or(e,t,n){var r;if((xt(e)||Lt(e))&&!e[Xt])for(const i in e)if(kt.call(e,i)){const o=e[i];if(sn(o)){const e=n();fr(e,i,o),delete e.lazy}else{const e=Mt(o)&&(null==(r=o.prototype)?void 0:r[qt]);if(e){const t=e.activate;t&&"auto"!==t||Er(dn(n(),i,o))}}"object"==typeof o&&(t.push({key:i,value:o}),Or(o,t,n),t.pop())}}var Tr=["get","set","peek","onChange","toggle"];function Sr(e){this._node=e;for(let t=0;t<Tr.length;t++){const e=Tr[t];this[e]=this[e].bind(this)}}function yr(e,t){Sr.prototype[e]=function(...e){return t.call(this,this._node,...e)}}function Cr(e){return Un(e,0,pr,ar,Sr)}yr("peek",(e=>(ur(),Er(e)))),yr("get",((e,t)=>(ur(),mr(e,t)))),yr("set",cr),yr("onChange",Hn),Object.defineProperty(Sr.prototype,Gt,{configurable:!0,get(){return this._node}}),Sr.prototype.toggle=function(){const e=this.peek();(null==e||Pt(e))&&this.set(!e)},Sr.prototype.delete=function(){return this.set(void 0),this};var Nr={createPreviousHandler:Rn,clone:on,ensureNodeValue:hn,findIDKey:pn,get:mr,getNode:an,getNodeValue:cn,getPathType:Zt,getProxy:ar,getValueAtPath:function(e,t){return t.reduce(An,e)},globalState:Jt,initializePathType:On,observableFns:nr,optimized:Kt,peek:Er,runWithRetry:function(e,t,n){const{waitFor:r}=e.activationState,{retry:i}=t,o={cancel:!1};let s;if(s=r?Jn(r,(()=>(e.activationState.waitFor=void 0,n(o)))):n(o),Ut(s)&&i){let r;return new Promise((a=>{const u=()=>{s.then((t=>{e.activationState.persistedRetry=!1,a(t)})).catch((()=>{t.attemptNum++,r&&clearTimeout(r),o.cancel||(r=function(e,t,n){const r=function(e,t){const{backoff:n,delay:r=1e3,infinite:i,times:o=3,maxDelay:s=3e4}=e;return i||t<o?Math.min(r*("constant"===n?1:2**t),s):null}(e,t);if(r)return setTimeout(n,r)}(i,t.attemptNum,(()=>{s=n(o),u()})))})).finally((()=>{e.activationState.persistedRetry=!1}))};u()}))}return s},safeParse:rn,safeStringify:nn,set:cr,setAtPath:Dn,setNodeValue:un,symbolLinked:qt,symbolDelete:Wt,tracking:Vn},br="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Ir(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Rr={exports:{}},wr={},kr=function(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}(Ct),Lr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},xr=kr.useState,Mr=kr.useEffect,Fr=kr.useLayoutEffect,Br=kr.useDebugValue;function Pr(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch(e){return!0}}var Ur="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=xr({inst:{value:n,getSnapshot:t}}),i=r[0].inst,o=r[1];return Fr((function(){i.value=n,i.getSnapshot=t,Pr(i)&&o({inst:i})}),[e,n,t]),Mr((function(){return Pr(i)&&o({inst:i}),e((function(){Pr(i)&&o({inst:i})}))}),[e]),Br(n),n};wr.useSyncExternalStore=void 0!==kr.useSyncExternalStore?kr.useSyncExternalStore:Ur,Rr.exports=wr;var Hr=Rr.exports,jr={inObserver:!1},$r=void 0;function Yr(e,t){if(jr.inObserver&&sn(e)&&!(null==t?void 0:t.suspense))return En(e);let n;try{const r=pe($r||($r=z(null))),i=de((()=>function(e,t){let n,r,i,o,s,a=0;const u=()=>{null==r||r();const{value:e,dispose:t,resubscribe:n}=Wn(i,l,void 0,void 0);return r=t,e},l=({value:r})=>{if(null==t?void 0:t.peek()){const e=s;s=r,void 0===e&&qn((()=>!t.get()),(()=>{const e=s;s=void 0,l({value:e})}))}else{let t=null==e?void 0:e.skipCheck;if(!t){const e=u();(e!==o||!Ft(e)&&e===r)&&(t=!0)}t&&(a++,null==n||n())}};return{subscribe:e=>(n=e,()=>{null==r||r(),r=void 0}),getVersion:()=>a,run:e=>(i=e,o=u())}}(t,r)),[]),{subscribe:o,getVersion:s,run:a}=i;n=a(e),Hr.useSyncExternalStore(o,s,s)}catch(e){throw e}if(null==t?void 0:t.suspense){const t=Ut(n);if(Ut(n)||!n&&sn(e)){const r=t?n:qn(e);if(!yt.use)throw r;yt.use(r)}}return n}function zr({children:e}){return Yr((()=>En(En(e))),{skipCheck:!0})}var Vr="function"==typeof Symbol&&Symbol.for;function Gr(e,t,n,r){const i=Vr?Symbol.for("react.forward_ref"):Me((e=>null)).$$typeof,o=Vr?Symbol.for("react.memo"):ke((e=>null)).$$typeof;if(e.__legend_proxied)return e;let s=!1,a=!1,u=e;o&&u.$$typeof===o&&u.type&&(a=!0,u=u.type),i&&u.$$typeof===i&&(s=!0,u=u.render);const l={apply(e,i,o){if(n){const e=o[0],t={},n=Object.keys(e);for(let i=0;i<n.length;i++){const o=n[i],s=e[o];if("children"===o&&(Mt(s)||sn(s)))e[o]=Yr(s,{skipCheck:!0});else if(o.startsWith("$")||o.endsWith("$")){const n=o.endsWith("$")?o.slice(0,-1):o.slice(1),i=null==r?void 0:r[n],a=i&&sn(s);if(t[n]=a&&(null==i?void 0:i.selector)?i.selector(t,s):Yr(s),a&&(void 0!==i.defaultValue&&void 0===t[n]&&(t[n]=i.defaultValue),i.handler&&i.getValue)){const n=t=>{var n;s.set(i.getValue(t)),null==(n=e[i.handler])||n.call(e,t)};t[i.handler]=he(n,[e[i.handler],r])}delete t[o]}else void 0===t[o]&&(t[o]=s)}o[0]=t}return t?Yr((()=>{jr.inObserver=!0;try{return Reflect.apply(e,i,o)}finally{jr.inObserver=!1}}),{skipCheck:!0}):Reflect.apply(e,i,o)}},c=new Proxy(u,l);let d;return s?(d=Me(c),d.__legend_proxied=!0):d=c,t||a?ke(d):d}var{findIDKey:Wr,getNode:Xr,optimized:Kr}=Nr,qr=new Map;function Jr({each:e,optimized:t,item:n,itemProps:r,sortValues:i,children:o}){var s;if(!e)return null;const a=Yr((()=>e.get(!t||Kr)));if(!n&&o){const e=le();e.current=o,n=de((()=>{return t=({item$:t,id:n})=>e.current(t,n),Gr(t,!0);var t}),[])}else if(n.$$typeof!==Symbol.for("react.memo")){let e=qr.get(n);e||(e=ke(n),qr.set(n,e)),n=e}if(!a)return null;const u=[];if(Lt(a)){const t=a[0],i=Xr(e),o=a.length,l=o>0?i&&Wr(t,i)||(void 0!==t.id?"id":void 0!==t.key?"key":void 0):void 0,c=Mt(l);for(let d=0;d<o;d++)if(a[d]){const t=a[d],i=null!=(s=c?l(t):t[l])?s:d,o=e[d],h={key:i,id:i,item$:o,item:o};u.push(A(n,r?Object.assign(h,r):h))}}else{const t=Ht(a),o=t?Array.from(a.keys()):Object.keys(a);i&&o.sort(((e,n)=>i(t?a.get(e):a[e],t?a.get(n):a[n],e,n)));for(let i=0;i<o.length;i++){const s=o[i];if(t?a.get(s):a[s]){const i=t?e.get(s):e[s],o={key:s,id:s,item$:i,item:i};u.push(A(n,r?Object.assign(o,r):o))}}}return u}ke(zr,(()=>!0));var Zr=new Map,Qr=new Map;function ei(e,t){var n;const r=le({});if(r.current.value=e,!(null==(n=r.current)?void 0:n.obs$)){const t=e;r.current.obs$=Cr(t)}return r.current.obs$}new Proxy({},{get(e,t){if(!e[t]){const n=Zr.get(t)||t,r=Me(((e,t)=>{const r={...e};return!t||!Mt(t)&&jt(t)||(r.ref=t),A(n,r)}));e[t]=Gr(r,!1,!0,Qr.get(t))}return e[t]}});function ti(e,t,n){let r;Mt(t)?r=t:n=t;const i=le({selector:e});i.current={selector:e,reaction:r},function(e){ae((()=>{const t=e();if(!Ut(t))return t}),[])}((()=>Xn((e=>{const{selector:t}=i.current;return Mt(t)?t(e):t}),(e=>{var t,n;return null==(n=(t=i.current).reaction)?void 0:n.call(t,e)}),n)))}class ni extends Error{}function ri(e,t){if(!e)throw new ni(t??"Assertion failed")}const ii=Object.assign(ri,{is:function(e,t,n){return ri(t,n)},unreachable:function(){throw new Error("Unreachable code")},keyNonNullable:function(e,t){if(!(t in e))throw new ni(`Missing key "${t}"`);if(null==e[t])throw new ni(`Key "${t}" is null or undefined`)},insideObservingContext:function(){if(!Vn.current)throw new Error("You aren't inside an observing context")},never:function(e){throw new Error("Unreachable")},defined:function(e){if(null==e)throw new ni("Value is not defined")}}),oi=z(void 0),si=hi(oi),ai=z(void 0),ui=hi(ai),li=z(void 0),ci=hi(li),di=z(void 0);function hi(e){return()=>{const t=pe(e);return ii(void 0!==t),t}}z(di);class pi{constructor(e={}){this._handlers=new Set,this._meta=e}meta(e){return new pi(e)}_emit(e,t){for(const n of this._handlers)n({level:e,data:t,timestamp:Date.now(),meta:this._meta})}error(...e){return this._emit("error",e)}warn(...e){return this._emit("warn",e)}info(...e){return this._emit("info",e)}log(...e){return this._emit("log",e)}trace(...e){return this._emit("trace",e)}registerHandler(e){return this._handlers.add(e),()=>this._handlers.delete(e)}}const fi=new pi,mi=new pi,Ei={code:"en-US",name:"English (US)",translation:{YESTERDAY:"Yesterday",TODAY:"Today",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"just now",LOCATION:"Location",CANCEL:"Cancel",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Browser notifications",DESKTOP_NOTIFICATIONS_ERROR:"Can't enable browser notifications because your browser actively blocks them. Try looking in the settings or using a different browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notification`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"If you keep your browser tab open, you'll see this pop up when someone talks to you.",SEND_BUTTON_TEXT:"Send",ENTRYBOX_TEXT_LIMIT:"Only 10,000 characters are allowed.",ENTRYBOX_PLACEHOLDER:"Say something...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"This conversation is no longer active.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"You can read, but not send messages.",MESSAGELIST_LOADING_OLDER:"Loading older messages...",MESSAGELIST_SHOW_OLDER:"Show older messages",MESSAGELIST_NEW_MARKER:"New",MESSAGE_SENT_VIA_EMAIL:"This message was sent via email",YOU_MARKER:"you",UPLOAD_IN_PROGRESS:"Uploading...",UPLOAD_SEND_FILE:"Send file",UPLOAD_SHARE_LOCATION:"Share location",UPLOAD_ERROR:"Unfortunately, something went wrong uploading. The file might be unsupported or too large.",SHARE_LOCATION_ERROR:"Cannot share location: ",LOADING:"Loading...",HUB_EMPTY:"Your chat history will show up here",HUB_SHOW_EARLIER:"Show earlier chats",INBOX_NO_CHATS_TITLE:"No chats yet!",INBOX_NO_CHATS_BODY:"Once you've had one or more conversations, they will show up here.",ENABLE_TRANSLATION:"Translate this conversation to English",DISABLE_TRANSLATION:"Show original",SEARCH_PLACEHOLDER_TEXT:"Search...",SEARCH_SEARCHING:"Searching...",SEARCH_NO_RESULTS:"No results found",SEARCH_NO_MORE_RESULTS:"No more results",CHAT_NOT_FOUND:"Chat not found",DELETE_MESSAGE:"Delete message",DELETION_EXPLANATION:"If you delete this message, it will disappear for everybody.",EDIT_MESSAGE:"Edit message",SAVE:"Save",EDITED_INDICATOR:"edited",REPLY_TO_MESSAGE:"Reply",REPLY_TO_ARIA_LABEL:(e,t)=>`Replying to ${e}: ${t}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Exit reply mode",ADD_REACTION:"Add reaction",AUTH_EXPIRED_OVERLAY_TITLE:"Your chat session has expired",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Refresh the page to continue",VOICE_MESSAGE:"Voice message",LEAVE_CONVERSATION:"Leave conversation",MARK_CONVERSATION_AS_UNREAD:"Mark as unread",STATUS_INDICATOR_ONLINE:"Active",STATUS_INDICATOR_OFFLINE:"Away",CONTACT_INFORMATION_HIDDEN:"hidden information"}},gi={code:"ar",name:"Arabic",translation:{YESTERDAY:"الأمس",TODAY:"اليوم",DAYS:"يوم",HOURS:"ساعة",MINUTES:"دقيقة",JUST_NOW:"فقط الآن",LOCATION:"الموقع",CANCEL:"إلغاء",INBOX:"علبة الوارد",DESKTOP_NOTIFICATIONS:"إشعارات المتصفح",DESKTOP_NOTIFICATIONS_ERROR:"لا يمكن تمكين إشعارات المتصفح لأن متصفحك يمنعها بشكل نشط. جرّب البحث في الإعدادات أو استخدام متصفح آخر.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`إعلام ${e} التجريبي`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"إذا أبقيت علامة تبويب المتصفح مفتوحة ، فسترى هذا ينبثق عندما يتحدث شخص معك.",SEND_BUTTON_TEXT:"إرسال",ENTRYBOX_TEXT_LIMIT:"يُسمح فقط بـ 10.000 حرف.",ENTRYBOX_PLACEHOLDER:"قل شيئًا ...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"هذه المحادثة لم تعد نشطة.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"يمكنك القراءة ، لكن لا يمكنك إرسال الرسائل.",MESSAGELIST_LOADING_OLDER:"جارٍ تحميل الرسائل القديمة ...",MESSAGELIST_SHOW_OLDER:"عرض الرسائل الأقدم",MESSAGELIST_NEW_MARKER:"جديد",MESSAGE_SENT_VIA_EMAIL:"تم إرسال هذه الرسالة عبر البريد الإلكتروني",YOU_MARKER:"أنت",UPLOAD_IN_PROGRESS:"جارٍ التحميل ...",UPLOAD_SEND_FILE:"إرسال ملف",UPLOAD_SHARE_LOCATION:"مشاركة الموقع",UPLOAD_ERROR:"حدث خطأ ما في تحميل شيء. ربما يكون الملف غير متوافق أو كبير جدًا.",SHARE_LOCATION_ERROR:"لا يمكن مشاركة الموقع:",LOADING:"جارٍ التحميل ...",HUB_EMPTY:"سوف يظهر سجل الدردشات هنا",HUB_SHOW_EARLIER:"إظهار الدردشات السابقة",INBOX_NO_CHATS_TITLE:"لا توجد دردشات بعد!",INBOX_NO_CHATS_BODY:"بمجرد أن يكون لديك واحد أو أكثر من المحادثات ، سوف تظهر هنا.",ENABLE_TRANSLATION:"ترجم هذه المحادثة إلى العربية",DISABLE_TRANSLATION:"إظهار الأصلي",SEARCH_PLACEHOLDER_TEXT:"...بحث",SEARCH_SEARCHING:"...يتم الآن البحث",SEARCH_NO_RESULTS:"لم يتم العثور على نتائج",SEARCH_NO_MORE_RESULTS:"لا يوجد المزيد من النتائج",CHAT_NOT_FOUND:"لم يتم العثور على الدردشة",DELETE_MESSAGE:"احذف الرسالة",DELETION_EXPLANATION:"إذا قمت بحذف هذه الرسالة، فهي ستختفي للجميع.",EDIT_MESSAGE:"تعديل الرسالة",SAVE:"حفظ",EDITED_INDICATOR:"معدّلة",REPLY_TO_MESSAGE:"رد",ADD_REACTION:"أضف تفاعلاً",AUTH_EXPIRED_OVERLAY_TITLE:"انتهت جلسة الدردشة المخصصة لك",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"يُرجى إعادة تحميل الصفحة للمتابعة",VOICE_MESSAGE:"رسالة صوتية",CONTACT_INFORMATION_HIDDEN:"المعلومات المخفية",LEAVE_CONVERSATION:"الخروج من المحادثة",MARK_CONVERSATION_AS_UNREAD:"وضع علامة غير مقروءة",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},_i={code:"bg-BG",name:"Bulgarian",translation:{YESTERDAY:"Вчера",TODAY:"Днес",DAYS:"Ден",HOURS:"Час",MINUTES:"m",JUST_NOW:"Току-що",LOCATION:"местоположението",CANCEL:"Откажи",INBOX:"Кутия",DESKTOP_NOTIFICATIONS:"Известия на браузъра",DESKTOP_NOTIFICATIONS_ERROR:"Не можете да активирате известията на браузъра, защото браузърът ви ги блокира активно. Опитайте да погледнете в настройките или да използвате друг браузър.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} демо известие`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ако държите раздела на браузъра си отворен, ще видите този изскачащ прозорец, когато някой говори с вас.",SEND_BUTTON_TEXT:"Изпрати",ENTRYBOX_TEXT_LIMIT:"Разрешени са само до 10.000 знака.",ENTRYBOX_PLACEHOLDER:"Кажете нещо...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Този разговор вече не е активен.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Можете да четете, но не и да изпращате съобщения.",MESSAGELIST_LOADING_OLDER:"Зареждане на по-стари съобщения...",MESSAGELIST_SHOW_OLDER:"Показване на по-стари съобщения",MESSAGELIST_NEW_MARKER:"Нови",MESSAGE_SENT_VIA_EMAIL:"Това съобщение беше изпратено по имейл",YOU_MARKER:"Вие",UPLOAD_IN_PROGRESS:"Качване...",UPLOAD_SEND_FILE:"Изпращане на файл",UPLOAD_SHARE_LOCATION:"Споделяне на местоположението",UPLOAD_ERROR:"За съжаление нещо се обърка при качването. Файлът може да не се поддържа или е твърде голям.",SHARE_LOCATION_ERROR:"Не може да се сподели местоположението: ",LOADING:"Зареждане...",HUB_EMPTY:"Историята на вашите разговори ще се покаже тук",HUB_SHOW_EARLIER:"Показване на по-ранни чатове",INBOX_NO_CHATS_TITLE:"Все още нямате разговори!",INBOX_NO_CHATS_BODY:"След като проведете един или повече разговори, те ще се покажат тук.",ENABLE_TRANSLATION:"Преведете този разговор на български",DISABLE_TRANSLATION:"Показване на оригинал",SEARCH_PLACEHOLDER_TEXT:"Търсене...",SEARCH_SEARCHING:"Търсене...",SEARCH_NO_RESULTS:"Няма намерени резултати",SEARCH_NO_MORE_RESULTS:"Няма повече резултати",CHAT_NOT_FOUND:"Чатът не е намерен",DELETE_MESSAGE:"Изтриване на съобщение",DELETION_EXPLANATION:"Ако изтриете това съобщение, то ще изчезне за всички.",EDIT_MESSAGE:"Редактиране на съобщението",SAVE:"Запиши",EDITED_INDICATOR:"редактирано",REPLY_TO_MESSAGE:"Отговори",ADD_REACTION:"Добави реакция",AUTH_EXPIRED_OVERLAY_TITLE:"Вашата чат сесия е изтекла",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Обновете страницата, за да продължите",VOICE_MESSAGE:"Гласово съобщение",CONTACT_INFORMATION_HIDDEN:"Скрита информация",LEAVE_CONVERSATION:"Напускане на разговора",MARK_CONVERSATION_AS_UNREAD:"Маркирай като непрочетено",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ai={code:"bs-BA",name:"Bosnian",translation:{YESTERDAY:"Jučer",TODAY:"Danas",DAYS:"d",HOURS:"s",MINUTES:"m",JUST_NOW:"Upravo sad",LOCATION:"Lokacija",CANCEL:"Otkaži",INBOX:"Pretinac",DESKTOP_NOTIFICATIONS:"Obavijesti preglednika",DESKTOP_NOTIFICATIONS_ERROR:"Notifikacije preglednika se ne mogu omogućiti jer ih vaš preglednik aktivno blokira. Pokušajte pregledati postavke ili koristiti drugi preglednik.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notifikacija`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ako karticu preglednika ostavite otvorenu, pojavit će se ovaj pop-up kada netko razgovara s vama.",SEND_BUTTON_TEXT:"Pošalji",ENTRYBOX_TEXT_LIMIT:"Dozvoljeno je samo 10.000 znakova.",ENTRYBOX_PLACEHOLDER:"Reci nešto...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ovaj razgovor više nije aktivan.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Možeš čitati, ali ne i slati poruke.",MESSAGELIST_LOADING_OLDER:"Učitavam starije poruke...",MESSAGELIST_SHOW_OLDER:"Prikaži starije poruke",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Ova poruka je poslana e-poštom",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Učitavam...",UPLOAD_SEND_FILE:"Pošalji datoteku",UPLOAD_SHARE_LOCATION:"Podijeli lokaciju",UPLOAD_ERROR:"Nažalost, nešto je pošlo krivo. Datoteka možda nije podržana ili je prevelika.",SHARE_LOCATION_ERROR:"Nije moguće podijeliti lokaciju: ",LOADING:"Učitavam...",HUB_EMPTY:"Ovdje će se prikazati vaša povijest razgovora",HUB_SHOW_EARLIER:"Prikaži ranije razgovore",INBOX_NO_CHATS_TITLE:"Nema razgovora!",INBOX_NO_CHATS_BODY:"Nakon što vodite jedan ili više razgovora, oni će se pojaviti ovdje.",ENABLE_TRANSLATION:"Prevedi ovaj razgovor na bosanski jezik",DISABLE_TRANSLATION:"Prikaži original",SEARCH_PLACEHOLDER_TEXT:"Pretraži...",SEARCH_SEARCHING:"Pretraživanje...",SEARCH_NO_RESULTS:"Nema rezultata",SEARCH_NO_MORE_RESULTS:"Nema više rezultata",CHAT_NOT_FOUND:"Ćaskanje nije pronađeno",DELETE_MESSAGE:"Obriši poruku",DELETION_EXPLANATION:"Ako izbrišete ovu poruku, ona će nestati za sve.",EDIT_MESSAGE:"Uredi poruku",SAVE:"Sačuvati",EDITED_INDICATOR:"uređeno",REPLY_TO_MESSAGE:"Odgovorite",ADD_REACTION:"Dodajte reakciju",AUTH_EXPIRED_OVERLAY_TITLE:"Vaša chat sesija je istekla",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Osvježite stranicu da nastavite",VOICE_MESSAGE:"Glasovna poruka",CONTACT_INFORMATION_HIDDEN:"Skrivene informacije",LEAVE_CONVERSATION:"Napusti razgovor",MARK_CONVERSATION_AS_UNREAD:"Označi kao nepročitano",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Di={code:"cs-CZ",name:"Czech",translation:{YESTERDAY:"Včera",TODAY:"Dnes",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"právě teď",LOCATION:"Lokace",CANCEL:"Zrušit",INBOX:"Doručené",DESKTOP_NOTIFICATIONS:"Oznámení v prohlížeči",DESKTOP_NOTIFICATIONS_ERROR:"Nelze povolit notifikace prohlížeče, protože váš prohlížeč je aktivně blokuje. Zkuste se podívat na nastavení nebo zkuste použít jiný prohlížeč.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notifikace`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Pokud necháte kartu prohlížeče otevřenou, uvidíte tento popup jakmile s vámi bude někdo mluvit.",SEND_BUTTON_TEXT:"Odeslat",ENTRYBOX_TEXT_LIMIT:"Je povoleno Maximálně 10.000 znaků.",ENTRYBOX_PLACEHOLDER:"Napište něco...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Tato konverzace již není aktivní.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Můžete číst, ale nemůžete posílat zprávy.",MESSAGELIST_LOADING_OLDER:"Nahrávám starší zprávy...",MESSAGELIST_SHOW_OLDER:"Zobrazit starší zprávy",MESSAGELIST_NEW_MARKER:"Nové",MESSAGE_SENT_VIA_EMAIL:"Tato zpráva byla odeslána přes mail.",YOU_MARKER:"vy",UPLOAD_IN_PROGRESS:"Nahrávám...",UPLOAD_SEND_FILE:"Poslat soubor",UPLOAD_SHARE_LOCATION:"Sdílet pozici",UPLOAD_ERROR:"Nepodařilo se nahrát soubor. Ten je buď nepodporován a/nebo příliš velký.",SHARE_LOCATION_ERROR:"Není možné sdílet pozici: ",LOADING:"Nahrávám...",HUB_EMPTY:"Vaše historie se zde zobrazí",HUB_SHOW_EARLIER:"Zobrazit dřívější konverzace",INBOX_NO_CHATS_TITLE:"Zatím zde nejsou žádné konverzace!",INBOX_NO_CHATS_BODY:"Jakmile budete mít jednu nebo více konverzací, objeví se zde.",ENABLE_TRANSLATION:"Přeložit tuto konverzaci do češtiny",DISABLE_TRANSLATION:"Zobrazit původní",SEARCH_PLACEHOLDER_TEXT:"Hledat...",SEARCH_SEARCHING:"Hledání...",SEARCH_NO_RESULTS:"Nenašly se žádné výsledky",SEARCH_NO_MORE_RESULTS:"Žádné další výsledky",CHAT_NOT_FOUND:"Chat nenalezen",DELETE_MESSAGE:"Smazat zprávu",DELETION_EXPLANATION:"Pokud tuto zprávu smažete, zmizí pro všechny.",EDIT_MESSAGE:"Upravit zprávu",SAVE:"Uložit",EDITED_INDICATOR:"upraveno",REPLY_TO_MESSAGE:"Odpovědět",ADD_REACTION:"Reagovat",AUTH_EXPIRED_OVERLAY_TITLE:"Váš chat byl kvůli nečinnosti odpojen",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Pro pokračování obnovte stránku",VOICE_MESSAGE:"Hlasová zpráva",CONTACT_INFORMATION_HIDDEN:"Skrytá informace",LEAVE_CONVERSATION:"Opustit konverzaci",MARK_CONVERSATION_AS_UNREAD:"Označit jako nepřečtené",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},vi={code:"da-DK",name:"Danish",translation:{YESTERDAY:"I går",TODAY:"I dag",DAYS:"d",HOURS:"t",MINUTES:"m",JUST_NOW:"lige nu",LOCATION:"Placering",CANCEL:"Annuller",INBOX:"Indbakke",DESKTOP_NOTIFICATIONS:"Browsermeddelelser",DESKTOP_NOTIFICATIONS_ERROR:"Kan ikke aktivere Browsermeddelelser, fordi din browser aktivt blokerer dem. Prøv at kigge i indstillingerne eller benyt en anden browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demomeddelelse`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Hvis du holder dit browser-faneblad åben, vil du se det her komme op, når nogen taler til dig.",SEND_BUTTON_TEXT:"Send",ENTRYBOX_TEXT_LIMIT:"Kun 10.000 tegn er tilladt.",ENTRYBOX_PLACEHOLDER:"Sig noget...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Denne samtale er ikke længere aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Du kan læse, men ikke sende beskeder.",MESSAGELIST_LOADING_OLDER:"Indlæser ældre beskeder...",MESSAGELIST_SHOW_OLDER:"Vis ældre beskeder",MESSAGELIST_NEW_MARKER:"Ny",MESSAGE_SENT_VIA_EMAIL:"Denne besked blev sendt via e-mail",YOU_MARKER:"dig",UPLOAD_IN_PROGRESS:"Overfører...",UPLOAD_SEND_FILE:"Send fil",UPLOAD_SHARE_LOCATION:"Del placering",UPLOAD_ERROR:"Der er sket noget forkert ved upload. Filen kan ikke understøttes eller filen er for stor.",SHARE_LOCATION_ERROR:"Kan ikke dele placering: ",LOADING:"Indlæser...",HUB_EMPTY:"Dine samtaler vises her",HUB_SHOW_EARLIER:"Vis tidligere chats",INBOX_NO_CHATS_TITLE:"Ingen chats endnu!",INBOX_NO_CHATS_BODY:"Når du har haft en eller flere samtaler, vises de her.",ENABLE_TRANSLATION:"Oversæt denne konversation til dansk",DISABLE_TRANSLATION:"Vis den oprindelige",SEARCH_PLACEHOLDER_TEXT:"Søg...",SEARCH_SEARCHING:"Søger...",SEARCH_NO_RESULTS:"Ingen resultater fundet",SEARCH_NO_MORE_RESULTS:"Ikke flere resultater",CHAT_NOT_FOUND:"Chat ikke fundet",DELETE_MESSAGE:"Slet besked",DELETION_EXPLANATION:"Hvis du sletter denne besked, vil ingen kunne se den.",EDIT_MESSAGE:"Rediger besked",SAVE:"Gem",EDITED_INDICATOR:"redigeret",REPLY_TO_MESSAGE:"Svar",ADD_REACTION:"Tilføj reaktion",AUTH_EXPIRED_OVERLAY_TITLE:"Din chatsession er udløbet",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Opdater siden for at fortsætte",VOICE_MESSAGE:"Talebesked",CONTACT_INFORMATION_HIDDEN:"Skjulte oplysninger",LEAVE_CONVERSATION:"Forlad samtale",MARK_CONVERSATION_AS_UNREAD:"Marker som ulæst",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Oi={code:"de-DE",name:"German",translation:{YESTERDAY:"Gestern",TODAY:"Heute",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"gerade jetzt",LOCATION:"Standort",CANCEL:"Abbrechen",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Browser-Benachrichtigungen",DESKTOP_NOTIFICATIONS_ERROR:"Browser-Benachrichtigungen können nicht aktiviert werden, da Ihr Browser sie aktiv blockiert. Versuchen Sie, in den Einstellungen nachzuschlagen oder einen anderen Browser zu verwenden.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} Demo-Benachrichtigung`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Wenn Sie Ihre Browser-Registerkarte geöffnet lassen, wird dies angezeigt, wenn jemand mit Ihnen spricht.",SEND_BUTTON_TEXT:"Senden",ENTRYBOX_TEXT_LIMIT:"Nur 10.000 Zeichen sind erlaubt.",ENTRYBOX_PLACEHOLDER:"Sag etwas...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Diese Konversation ist nicht mehr aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Sie können Nachrichten lesen, aber nicht senden.",MESSAGELIST_LOADING_OLDER:"Ältere Nachrichten werden geladen...",MESSAGELIST_SHOW_OLDER:"Zeige ältere Nachrichten",MESSAGELIST_NEW_MARKER:"Neu",MESSAGE_SENT_VIA_EMAIL:"Diese Nachricht wurde per E-Mail gesendet",YOU_MARKER:"du",UPLOAD_IN_PROGRESS:"Hochladen...",UPLOAD_SEND_FILE:"Datei senden",UPLOAD_SHARE_LOCATION:"Standort teilen",UPLOAD_ERROR:"Beim Hochladen ist ein Fehler aufgetreten. Die Datei ist möglicherweise nicht unterstützt oder zu groß.",SHARE_LOCATION_ERROR:"Standort kann nicht freigegeben werden: ",LOADING:"Laden...",HUB_EMPTY:"Ihr Chat-Verlauf wird hier angezeigt",HUB_SHOW_EARLIER:"Zeige frühere Chats",INBOX_NO_CHATS_TITLE:"Noch keine Chats!",INBOX_NO_CHATS_BODY:"Sobald Sie eine oder mehrere Unterhaltungen geführt haben, werden sie hier angezeigt.",ENABLE_TRANSLATION:"Dieses Gespräch auf Deutsch übersetzen",DISABLE_TRANSLATION:"Originaltext anzeigen",SEARCH_PLACEHOLDER_TEXT:"Suche...",SEARCH_SEARCHING:"Suchen...",SEARCH_NO_RESULTS:"Keine Suchergebnisse gefunden",SEARCH_NO_MORE_RESULTS:"Keine weiteren Suchergebnisse",CHAT_NOT_FOUND:"Chat nicht gefunden",DELETE_MESSAGE:"Nachricht löschen",DELETION_EXPLANATION:"Wenn Sie diese Nachricht löschen, wird sie für alle verschwinden.",EDIT_MESSAGE:"Nachricht bearbeiten",SAVE:"Speichern",EDITED_INDICATOR:"bearbeitet",REPLY_TO_MESSAGE:"Antworten",ADD_REACTION:"Reaktion hinzufügen",AUTH_EXPIRED_OVERLAY_TITLE:"Ihre Chatsitzung ist abgelaufen",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Laden Sie zum Fortfahren die Seite neu",VOICE_MESSAGE:"Sprachnachricht",CONTACT_INFORMATION_HIDDEN:"Geschützte Angaben",LEAVE_CONVERSATION:"Unterhaltung verlassen",MARK_CONVERSATION_AS_UNREAD:"als ungelesen markieren",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ti={code:"el-GR",name:"Greek (Greece)",translation:{YESTERDAY:"Χθές",TODAY:"Σήμερα",DAYS:"Ημέρες",HOURS:"'Ωρες",MINUTES:"Λεπτά",JUST_NOW:"Μόλις τώρα",LOCATION:"Τοποθεσία",CANCEL:"Ακύρωση",INBOX:"Εισερχόμενα",DESKTOP_NOTIFICATIONS:"Ειδοποιήσεις περιηγητή",DESKTOP_NOTIFICATIONS_ERROR:"Δεν είναι δυνατή η ενεργοποίηση των ειδοποιήσεων του προγράμματος περιήγησης, επειδή το πρόγραμμα περιήγησης τις αποκλείει ενεργά. Δοκιμάστε να τσεκάρετε τις ρυθμίσεις ή να χρησιμοποιήσετε διαφορετικό πρόγραμμα περιήγησης.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} Δοκιμαστική επίδειξη`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Αν διατηρήσετε ανοιχτή τη σελίδα του προγράμματος περιήγησης, θα δείτε αυτό το pop up (παράθυρο) όταν κάποιος σας μιλάει.",SEND_BUTTON_TEXT:"Αποστολή",ENTRYBOX_TEXT_LIMIT:"Επιτρέπονται μόνο 10.000 χαρακτήρες.",ENTRYBOX_PLACEHOLDER:"Πείτε κάτι...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Αυτή η συζήτηση δεν είναι πλέον ενεργή.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Μπορείτε να διαβάσετε αλλά δεν μπορείτε να στείλετε μηνύματα.",MESSAGELIST_LOADING_OLDER:"Φόρτωση παλαιοτέρων μηνυμάτων...",MESSAGELIST_SHOW_OLDER:"Εμφάνιση παλαιότερων μηνυμάτων",MESSAGELIST_NEW_MARKER:"Νέο",MESSAGE_SENT_VIA_EMAIL:"Αυτό το μήνυμα εστάλη μέσω ηλεκτρονικού ταχυδρομείου",YOU_MARKER:"Εσείς",UPLOAD_IN_PROGRESS:"Ανέβασμα...",UPLOAD_SEND_FILE:"Αποστολή αρχείου",UPLOAD_SHARE_LOCATION:"Κοινή χρήση τοποθεσίας",UPLOAD_ERROR:"Κάτι πήγε στραβά κατά τη φόρτωση. Το αρχείο ενδέχεται να μην υποστηρίζεται ή να είναι υπερβολικά μεγάλο.",SHARE_LOCATION_ERROR:"Δεν είναι δυνατή η χρήση κοινής τοποθεσίας: ",LOADING:"Φόρτωση...",HUB_EMPTY:"Το ιστορικό των συνομιλιών σας θα εμφανιστεί εδώ",HUB_SHOW_EARLIER:"Εμφάνιση προηγούμενων συνομιλιών",INBOX_NO_CHATS_TITLE:"Δεν υπάρχουν ακόμα συζητήσεις!",INBOX_NO_CHATS_BODY:"Μόλις έχετε μία ή περισσότερες συνομιλίες, θα εμφανιστούν εδώ.",ENABLE_TRANSLATION:"Μετάφραση αυτής της συνομιλίας στα ελληνικά",DISABLE_TRANSLATION:"Προβολή πρωτοτύπου",SEARCH_PLACEHOLDER_TEXT:"Αναζήτηση...",SEARCH_SEARCHING:"Αναζήτηση...",SEARCH_NO_RESULTS:"Δεν βρέθηκαν αποτελέσματα",SEARCH_NO_MORE_RESULTS:"Δεν υπάρχουν περισσότερα αποτελέσματα",CHAT_NOT_FOUND:"Η συνομιλία δεν βρέθηκε",DELETE_MESSAGE:"Διαγραφή μηνύματος",DELETION_EXPLANATION:"Εάν διαγράψετε αυτό το μήνυμα, θα εξαφανιστεί για όλους.",EDIT_MESSAGE:"Επεξεργασία μηνύματος",SAVE:"Αποθήκευση",EDITED_INDICATOR:"επεξεργασμένο",REPLY_TO_MESSAGE:"Απάντηση",ADD_REACTION:"Προσθήκη αντίδρασης",AUTH_EXPIRED_OVERLAY_TITLE:"Η συνεδρία της συνομιλίας σας έχει λήξει",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Ανανεώστε τη σελίδα για να συνεχίσετε",VOICE_MESSAGE:"Ηχητικό μήνυμα",CONTACT_INFORMATION_HIDDEN:"Κρυμμένες πληροφορίες",LEAVE_CONVERSATION:"Αποσυρθείτε από τη συζήτηση",MARK_CONVERSATION_AS_UNREAD:"Επισήμανση ως μη αναγνωσμένα",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Si={code:"es-ES",name:"Spanish",translation:{YESTERDAY:"Ayer",TODAY:"Hoy",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"justo ahora",LOCATION:"Ubicación",CANCEL:"Cancelar",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Notificaciones del navigator",DESKTOP_NOTIFICATIONS_ERROR:"No se logró habilitar las notificaciones del navigador, comprueba que tu navegador no las esté bloqueando o intenta con otro navegador.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} notificación de prueba`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Si dejas esta pestaña abierta, verás este pop up cuando alguien te hable.",SEND_BUTTON_TEXT:"Enviar",ENTRYBOX_TEXT_LIMIT:"Sólo 10.000 caracteres permitidos.",ENTRYBOX_PLACEHOLDER:"Escribe algo...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Esta conversación ya no está activa.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Puedes leer pero no enviar mensajes.",MESSAGELIST_LOADING_OLDER:"Cargando mensajes pasados...",MESSAGELIST_SHOW_OLDER:"Ver mensajes pasados",MESSAGELIST_NEW_MARKER:"Nuevo",MESSAGE_SENT_VIA_EMAIL:"Este mensaje ha sido enviado vía email",YOU_MARKER:"tú",UPLOAD_IN_PROGRESS:"Subir...",UPLOAD_SEND_FILE:"Enviar archivo",UPLOAD_SHARE_LOCATION:"Compartir ubicación",UPLOAD_ERROR:"Ocurrió un problema subiendo el archivo. Puede que el archivo esté en un formato no soportado o que sea demasiado grande.",SHARE_LOCATION_ERROR:"No se logró compartir la ubicación: ",LOADING:"Cargando...",HUB_EMPTY:"Tu historial de conversaciones se mostrará aquí",HUB_SHOW_EARLIER:"Ver conversaciones pasadas",INBOX_NO_CHATS_TITLE:"¡Aún sin conversaciones!",INBOX_NO_CHATS_BODY:"Una vez que tengas una o más conversaciones, se mostrarán aquí.",ENABLE_TRANSLATION:"Traducir esta conversación al español",DISABLE_TRANSLATION:"Mostrar la conversación original",SEARCH_PLACEHOLDER_TEXT:"Buscar...",SEARCH_SEARCHING:"Buscando...",SEARCH_NO_RESULTS:"No se encontraron resultados",SEARCH_NO_MORE_RESULTS:"No hay más resultados",CHAT_NOT_FOUND:"Chat no encontrado",DELETE_MESSAGE:"Eliminar mensaje",DELETION_EXPLANATION:"Este mensaje desaparecerá para todos si lo borras.",EDIT_MESSAGE:"Editar mensaje",SAVE:"Guardar",EDITED_INDICATOR:"editado",REPLY_TO_MESSAGE:"Responder",ADD_REACTION:"Añadir reacción",AUTH_EXPIRED_OVERLAY_TITLE:"Su sesión de chat ha expirado",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Actualice la página para continuar",VOICE_MESSAGE:"Mensaje de voz",CONTACT_INFORMATION_HIDDEN:"Información oculta",LEAVE_CONVERSATION:"Abandonar conversación",MARK_CONVERSATION_AS_UNREAD:"Marcar como no leída",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},yi={code:"et-EE",name:"Estonian",translation:{YESTERDAY:"Eile",TODAY:"Täna",DAYS:"p",HOURS:"t",MINUTES:"m",JUST_NOW:"Just nüüd",LOCATION:"Asukoht",CANCEL:"Katkesta",INBOX:"Postkast",DESKTOP_NOTIFICATIONS:"Veebibrauseri teated",DESKTOP_NOTIFICATIONS_ERROR:"Töölaua teatisi ei saa lubada, kuna Teie brauser blokeerib need aktiivselt. Proovige muuta seadeid või kasutada mõnda muud brauserit.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo teavitus`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Kui hoiate oma brauseri vahekaardi lahti ja näete seda hüpikakent, siis keegi soovib Teiega rääkida.",SEND_BUTTON_TEXT:"Saada",ENTRYBOX_TEXT_LIMIT:"Ainult kuni 10.000 tähemärki on lubatud.",ENTRYBOX_PLACEHOLDER:"Kirjuta midagi...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"See vestlus ei ole enam aktiivne.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Sa saad lugeda teateid, aga mitte kirjutada.",MESSAGELIST_LOADING_OLDER:"Laen vanemaid teateid...",MESSAGELIST_SHOW_OLDER:"Näita vanemaid teateid",MESSAGELIST_NEW_MARKER:"Uus",MESSAGE_SENT_VIA_EMAIL:"See teade on saadetud e-postiga",YOU_MARKER:"Sina",UPLOAD_IN_PROGRESS:"Laen...",UPLOAD_SEND_FILE:"Saada fail",UPLOAD_SHARE_LOCATION:"Jaga faili asukohta",UPLOAD_ERROR:"Nüüd läks midagi nihu, seoses faili ülesse laadimisega. Tundmatu fail või liiga suur.",SHARE_LOCATION_ERROR:"Ei suuda jagada faili asukohta: ",LOADING:"Laen...",HUB_EMPTY:"Siin on Sinu vestluste ajalugu",HUB_SHOW_EARLIER:"Näita vanemaid vestlusi",INBOX_NO_CHATS_TITLE:"Pole ühtegi vestlust!",INBOX_NO_CHATS_BODY:"Kui Sul tekib üks või rohkem vestlust, siis on need kuvatakse siin.",ENABLE_TRANSLATION:"Tõlgi see vestlus eesti keelde",DISABLE_TRANSLATION:"Näita algteksti",SEARCH_PLACEHOLDER_TEXT:"Otsi...",SEARCH_SEARCHING:"Otsin...",SEARCH_NO_RESULTS:"Otsingu tulemused puuduvad",SEARCH_NO_MORE_RESULTS:"Rohkem tulemusi ei ole ",CHAT_NOT_FOUND:"Vestlust ei leitud",DELETE_MESSAGE:"Kustuta sõnum",DELETION_EXPLANATION:"Kui kustutate selle sõnumi, kaob see kõigi jaoks.",EDIT_MESSAGE:"Redigeeri sõnumit",SAVE:"Salvesta",EDITED_INDICATOR:"muudetud",REPLY_TO_MESSAGE:"Vasta",ADD_REACTION:"Lisa reaktsioon",AUTH_EXPIRED_OVERLAY_TITLE:"Teie vestlussessioon on lõppenud",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Jätkamiseks värskendage lehte",VOICE_MESSAGE:"Häälsõnum",CONTACT_INFORMATION_HIDDEN:"Varjatud informatsioon",LEAVE_CONVERSATION:"Lahku vestlusest",MARK_CONVERSATION_AS_UNREAD:"Märgi mitteloetuks",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ci={code:"fa",name:"Persian (Farsi)",translation:{YESTERDAY:"دیروز",TODAY:"امروز",DAYS:"روز",HOURS:"ساعت",MINUTES:"دقیقه",JUST_NOW:"هم اکنون",LOCATION:"مکان",CANCEL:"لغو",INBOX:"صندوق",DESKTOP_NOTIFICATIONS:"اطلاعیههای مرورگر",DESKTOP_NOTIFICATIONS_ERROR:"خطا در فعال سازی اعلان های مرورگر، مرورگر شما آنها را مسدود می کند سعی کنید تنظیمات مرورگر را تغییر دهید یا از یک مرورگر دیگر استفاده کنید.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`نوتیفیکیشن دمو ${e}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"اگر صفحه ی مرورگر را باز نگهدارید این را موقعه ای که کسی با شما صحبت کند خواهید دید",SEND_BUTTON_TEXT:"بفرست",ENTRYBOX_TEXT_LIMIT:"فقط ۱۰،۰۰۰ حروف مجاز می باشد.",ENTRYBOX_PLACEHOLDER:"...چیزی بنویسید",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:".این مکالمه دیگر فعال نمی باشد",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"شما می توانید بخوانید اما نمی توانید پیام بفرستید",MESSAGELIST_LOADING_OLDER:"...در حال بارگذاری پیام های قدیمی تر",MESSAGELIST_SHOW_OLDER:"نشان دادن پیام های قدیمی",MESSAGELIST_NEW_MARKER:"جدید",MESSAGE_SENT_VIA_EMAIL:"پیام توسط ایمل ارسال شد",YOU_MARKER:"شما",UPLOAD_IN_PROGRESS:"...در حال بارگذاری",UPLOAD_SEND_FILE:"فرستادن پوشه",UPLOAD_SHARE_LOCATION:"اشتراک گذاری مکان",UPLOAD_ERROR:"متاسفانه بارگذاری با مشکل روبه رو شد. ممکن است فایل حجیم باشد یا ساپورت نشده باشد.",SHARE_LOCATION_ERROR:"خطا در اشتراک گذاری مکان: ",LOADING:"...بارگذاری",HUB_EMPTY:"تاریخچه گفتگو اینجا نمایان می شود",HUB_SHOW_EARLIER:"دیدن گفتگو های قبلی",INBOX_NO_CHATS_TITLE:"هنوز گفتگویی وجود ندارد",INBOX_NO_CHATS_BODY:"بعد از داشتن یک مکالمه یا بیشتر، آنها اینجا نمایان می شوند.",ENABLE_TRANSLATION:"این مکالمه را به فارسی ترجمه کن",DISABLE_TRANSLATION:"زبان اصلی را نشان بده",SEARCH_PLACEHOLDER_TEXT:"...جستجو",SEARCH_SEARCHING:"...در حال جستجو",SEARCH_NO_RESULTS:"نتیجه ای یافت نشد",SEARCH_NO_MORE_RESULTS:"نتیجه بیشتری وجود ندارد",CHAT_NOT_FOUND:"مکالمه پیدا نشد",DELETE_MESSAGE:"حذف پیام ",DELETION_EXPLANATION:"اگر این پیام را حذف کنید، برای همه ناپدید می شود.",EDIT_MESSAGE:"ویرایش پیام",SAVE:"ذخیره",EDITED_INDICATOR:"ویرایششده",REPLY_TO_MESSAGE:"پاسخ دادن",ADD_REACTION:"واکنش را اضافه کنید",AUTH_EXPIRED_OVERLAY_TITLE:"جلسه چت شما منقضی شده است",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"برای ادامه صفحه را بازخوانی کنید",VOICE_MESSAGE:"پیام صوتی",CONTACT_INFORMATION_HIDDEN:"اطلاعات پنهان",LEAVE_CONVERSATION:"خروج از گفتگو",MARK_CONVERSATION_AS_UNREAD:"به عنوان خوانده نشده علامت گذاری کن",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ni={code:"fi-FI",name:"Finnish",translation:{YESTERDAY:"Eilen",TODAY:"Tänään",DAYS:"p",HOURS:"t",MINUTES:"m",JUST_NOW:"juuri nyt",LOCATION:"Sijainti",CANCEL:"Peruuta",INBOX:"Saapuneet",DESKTOP_NOTIFICATIONS:"Selaimen ilmoitukset",DESKTOP_NOTIFICATIONS_ERROR:"Työpöydän ilmoituksia ei voitu kytkeä päälle, koska selaimesi estää ne aktiivisesti. Koeta tutkia sen asetuksia tai vaihda selainta.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo ilmoitus`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Jos pidät tämän sivun auki, näet vastaavan ilmoituksen kun joku puhuu sinulle.",SEND_BUTTON_TEXT:"Lähetä",ENTRYBOX_TEXT_LIMIT:"Maksimissaan 10000 merkkiä.",ENTRYBOX_PLACEHOLDER:"Sano jotain...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Tämä keskustelu ei ole enää aktiivinen.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Voit lukea, mutta et lähettää viestejä.",MESSAGELIST_LOADING_OLDER:"Ladataan vanhoja viestejä..",MESSAGELIST_SHOW_OLDER:"Näytä vanhat viestit",MESSAGELIST_NEW_MARKER:"Uusi",MESSAGE_SENT_VIA_EMAIL:"Tämä viesti on lähetetty sähköpostin välityksellä",YOU_MARKER:"sinä",UPLOAD_IN_PROGRESS:"Ladataan...",UPLOAD_SEND_FILE:"Lähetä tiedosto",UPLOAD_SHARE_LOCATION:"Jaa sijainti",UPLOAD_ERROR:"Valitettavasti jokin meni vikaan. Tiedostotyyppiä ei ehkä tueta tai se saattaa olla liian suuri.",SHARE_LOCATION_ERROR:"Sijaintia ei pystytty jakamaan: ",LOADING:"Ladataan...",HUB_EMPTY:"Keskusteluhistoriasi näkyy tässä",HUB_SHOW_EARLIER:"Näytä aiemmat keskustelut",INBOX_NO_CHATS_TITLE:"Ei keskusteluja, vielä!",INBOX_NO_CHATS_BODY:"Kun olet käynyt yhden tai useamman keskustelun, ne näkyvät täällä.",ENABLE_TRANSLATION:"Käännä keskustelu kielelle suomi",DISABLE_TRANSLATION:"Näytä alkuperäinen",SEARCH_PLACEHOLDER_TEXT:"Etsi...",SEARCH_SEARCHING:"Etsiminen...",SEARCH_NO_RESULTS:"Tuloksia ei löytynyt",SEARCH_NO_MORE_RESULTS:"Ei enempää tuloksia",CHAT_NOT_FOUND:"Keskustelua ei löytynyt",DELETE_MESSAGE:"Poista viesti",DELETION_EXPLANATION:"Jos poistat tämän viestin, se häviää kaikilta.",EDIT_MESSAGE:"Muokkaa viestiä",SAVE:"Tallenna",EDITED_INDICATOR:"muokattu",REPLY_TO_MESSAGE:"Vastaa",ADD_REACTION:"Lisää reaktio",AUTH_EXPIRED_OVERLAY_TITLE:"Istuntosi on vanhentunut",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Päivitä sivu jatkaaksesi",VOICE_MESSAGE:"Ääniviesti",CONTACT_INFORMATION_HIDDEN:"Piilotetut tiedot",LEAVE_CONVERSATION:"Poistu keskustelusta",MARK_CONVERSATION_AS_UNREAD:"Merkitse lukemattomaksi",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},bi={code:"fr-FR",name:"French",translation:{YESTERDAY:"Hier",TODAY:"Aujourd'hui",DAYS:"j",HOURS:"h",MINUTES:"m",JUST_NOW:"maintenant",LOCATION:"Emplacement",CANCEL:"Annuler",INBOX:"Boîte de réception",DESKTOP_NOTIFICATIONS:"Notifications du navigateur",DESKTOP_NOTIFICATIONS_ERROR:"Impossible d'activer les notifications du navigateur car votre navigateur les bloque. Essayez de changer ses paramètres ou de changer de navigateur.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`Notification de démonstration ${e}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Si vous maintenez l'onglet ouvert dans votre navigateur vous verrez apparaître une alerte lorsque quelqu'un vous parlera.",SEND_BUTTON_TEXT:"Envoyer",ENTRYBOX_TEXT_LIMIT:"Seuls 10.000 caractères sont autorisés.",ENTRYBOX_PLACEHOLDER:"Ecrivez quelque chose...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Cette conversation n'est plus active.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Vous pouvez lire, mais pas envoyer de messages.",MESSAGELIST_LOADING_OLDER:"Chargement des anciens messages ...",MESSAGELIST_SHOW_OLDER:"Afficher les anciens messages",MESSAGELIST_NEW_MARKER:"Nouveau",MESSAGE_SENT_VIA_EMAIL:"Ce message a été envoyé par e-mail",YOU_MARKER:"vous",UPLOAD_IN_PROGRESS:"Envoi en cours...",UPLOAD_SEND_FILE:"Envoyer un fichier",UPLOAD_SHARE_LOCATION:"Partager mon emplacement",UPLOAD_ERROR:"Un problème est survenu lors de l'envoi: le fichier est peut-être non pris en charge ou trop volumineux.",SHARE_LOCATION_ERROR:"Impossible de partager votre emplacement: ",LOADING:"Chargement en cours...",HUB_EMPTY:"Votre historique de discussion apparaîtra ici",HUB_SHOW_EARLIER:"Afficher les conversations précédentes",INBOX_NO_CHATS_TITLE:"Aucune conversation pour l'instant!",INBOX_NO_CHATS_BODY:"Une fois que vous aurez eu une ou plusieurs conversations, elles apparaîtront ici.",ENABLE_TRANSLATION:"Traduire cette conversation en français",DISABLE_TRANSLATION:"Remontrer la conversation originale",SEARCH_PLACEHOLDER_TEXT:"Rechercher...",SEARCH_SEARCHING:"Recherche...",SEARCH_NO_RESULTS:"Aucun résultat trouvé",SEARCH_NO_MORE_RESULTS:"Il n’y a plus de résultats",CHAT_NOT_FOUND:"Conversation introuvable",DELETE_MESSAGE:"Supprimer le message",DELETION_EXPLANATION:"Si vous supprimez ce message, il disparaîtra pour tout le monde.",EDIT_MESSAGE:"Modifier le message",SAVE:"Enregistrer",EDITED_INDICATOR:"modifié",REPLY_TO_MESSAGE:"Répondre",ADD_REACTION:"Ajouter une réaction",AUTH_EXPIRED_OVERLAY_TITLE:"Votre session de chat a expiré",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Actualisez la page pour continuer",VOICE_MESSAGE:"Message vocal",CONTACT_INFORMATION_HIDDEN:"Informations masquées",LEAVE_CONVERSATION:"Quitter la conversation",MARK_CONVERSATION_AS_UNREAD:"Marquer comme non lu",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ii={code:"he-IL",name:"Hebrew",translation:{YESTERDAY:"אתמול",TODAY:"היום",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"עכשיו",LOCATION:"מיקום",CANCEL:"בטל",INBOX:"דואר נכנס",DESKTOP_NOTIFICATIONS:"התראות דפדפן",DESKTOP_NOTIFICATIONS_ERROR:"לא ניתן להפעיל התראות במרועה דפדפן מכיוון שהדפדפן שלך חוסם אותן באופן פעיל. נסה להסתכל בהגדרות או להשתמש בדפדפן אחר.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} הודעה על הדגמה`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"אם אתה שומר על כרטיסיית הדפדפן שלך פתוחה, תראה את זה צץ כשמישהו ידבר איתך.",SEND_BUTTON_TEXT:"שלח",ENTRYBOX_TEXT_LIMIT:"רק 10.000 תווים",ENTRYBOX_PLACEHOLDER:"תגיד משהו...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"שיחה זו אינה פעילה עוד.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"אתה יכול לקרוא, אך לא לשלוח הודעות.",MESSAGELIST_LOADING_OLDER:"טוען הודעות ישנות...",MESSAGELIST_SHOW_OLDER:"הצג הודעות ישנות",MESSAGELIST_NEW_MARKER:"חדש",MESSAGE_SENT_VIA_EMAIL:"הודעה זאת נשלחה דרך אימייל",YOU_MARKER:"אתה",UPLOAD_IN_PROGRESS:"מעלה ...",UPLOAD_SEND_FILE:"שלח קובץ",UPLOAD_SHARE_LOCATION:"שתף מיקום",UPLOAD_ERROR:"לרוע המזל משהו השתבש בהעלאה. ייתכן שהקובץ אינו נתמך או גדול מדי.",SHARE_LOCATION_ERROR:"לא ניתן לשתף מיקום: ",LOADING:"טוען...",HUB_EMPTY:"היסטוריית הצ'אט שלך תופיע כאן",HUB_SHOW_EARLIER:"הצג צ'אטים קודמים",INBOX_NO_CHATS_TITLE:"אין עדיין צ'אטים!",INBOX_NO_CHATS_BODY:"לאחר שניהלת שיחה אחת או יותר, הם יופיעו כאן.",ENABLE_TRANSLATION:"תרגם שיחה זו לעברית",DISABLE_TRANSLATION:"הצג מקור",SEARCH_PLACEHOLDER_TEXT:"...חפש",SEARCH_SEARCHING:"...מחפש",SEARCH_NO_RESULTS:"לא נמצאו תוצאות",SEARCH_NO_MORE_RESULTS:"אין תוצאות נוספות",CHAT_NOT_FOUND:"הצ'אט לא נמצא",DELETE_MESSAGE:"מחיקת הודעה",DELETION_EXPLANATION:"אם תמחק הודעה זו, היא תיעלם עבור כולם.",EDIT_MESSAGE:"עריכת הודעה",SAVE:"שמור",EDITED_INDICATOR:"ערוך",REPLY_TO_MESSAGE:"השב",ADD_REACTION:"הוספת תגובה",AUTH_EXPIRED_OVERLAY_TITLE:"הפעלת הצ׳אט שלכם פגה",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"רעננו את העמוד כדי להמשיך",VOICE_MESSAGE:"הודעה קולית",CONTACT_INFORMATION_HIDDEN:"מידע מוסתר",LEAVE_CONVERSATION:"צא מהשיחה",MARK_CONVERSATION_AS_UNREAD:"סמן כלא נקרא",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ri={code:"hi-IN",name:"Hindi (IN)",translation:{YESTERDAY:"कल",TODAY:"आज",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"अभी",LOCATION:"जगह",CANCEL:"रद्द करें",INBOX:"इनबॉक्स",DESKTOP_NOTIFICATIONS:"ब्राउज़र सूचनाएं",DESKTOP_NOTIFICATIONS_ERROR:"ब्राउज़र सूचनाएं सक्षम नहीं कर सकता क्योंकि आपका ब्राउज़र सक्रिय रूप से उन्हें ब्लॉक करता है। सेटिंग्स में देखने या एक अलग ब्राउज़र का उपयोग करने का प्रयास करें।",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} डेमो अधिसूचना`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"यदि आप अपना ब्राउज़र टैब खुला रखते हैं, तो यह पॉप अप आपको तब दिखाई देगा जब कोई आपसे बात करेगा।",SEND_BUTTON_TEXT:"भेजें",ENTRYBOX_TEXT_LIMIT:"केवल 10,000 वर्णों की अनुमति है।",ENTRYBOX_PLACEHOLDER:"कुछ कहिए...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"यह चैट अब सक्रिय नहीं है।",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"आप पढ़ सकते हैं, लेकिन संदेश नहीं भेज सकते।",MESSAGELIST_LOADING_OLDER:"पुराने संदेश लोड हो रहे हैं ...",MESSAGELIST_SHOW_OLDER:"पुराने संदेश दिखाएं",MESSAGELIST_NEW_MARKER:"नया",MESSAGE_SENT_VIA_EMAIL:"यह संदेश ईमेल के माध्यम से भेजा गया था",YOU_MARKER:"आप",UPLOAD_IN_PROGRESS:"अपलोड हो रहा है...",UPLOAD_SEND_FILE:"फाइल भेजें",UPLOAD_SHARE_LOCATION:"जगह शेयर करें",UPLOAD_ERROR:"दुर्भाग्य से, अपलोड करते समय कुछ गलत हो गया। फ़ाइल असमर्थित या बहुत बड़ी हो सकती है।",SHARE_LOCATION_ERROR:"जगह शेयर नहीं हो पाया: ",LOADING:"लोड हो रहा है...",HUB_EMPTY:"आपका चैट इतिहास यहां दिखाई देगा",HUB_SHOW_EARLIER:"पहले की चैट दिखाओ",INBOX_NO_CHATS_TITLE:"अभी तक कोई चैट नहीं!",INBOX_NO_CHATS_BODY:"एक बार जब आप एक या अधिक चैट कर लेते हैं, तो वे यहां दिखाई देंगे।",ENABLE_TRANSLATION:"इस बातचीत का हिंदी में अनुवाद कीजिए",DISABLE_TRANSLATION:"मूल दिखाएँ",SEARCH_PLACEHOLDER_TEXT:"खोजें...",SEARCH_SEARCHING:"खोज जारी है...",SEARCH_NO_RESULTS:"कोई परिणाम नहीं मिला",SEARCH_NO_MORE_RESULTS:"और कोई परिणाम नहीं",CHAT_NOT_FOUND:"चैट नहीं मिली",DELETE_MESSAGE:"संदेश डिलीट करें",DELETION_EXPLANATION:"यदि आप इस संदेश को हटाते हैं, तो यह सभी के लिए गायब हो जाएगा.",EDIT_MESSAGE:"संदेश में बदलाव करें",SAVE:"सहेजें",EDITED_INDICATOR:"संपादित किया गया",REPLY_TO_MESSAGE:"जवाब दीजिए ।",ADD_REACTION:"प्रतिक्रिया जोड़ें",AUTH_EXPIRED_OVERLAY_TITLE:"आपका चैट सेशन समाप्त हो चुका है",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"आगे बढ़ने के लिए रिफ्रेश करें",VOICE_MESSAGE:"वॉयस मैसेज",CONTACT_INFORMATION_HIDDEN:"छुपी हुई जानकारी",LEAVE_CONVERSATION:"बातचीत को ख़त्म करें",MARK_CONVERSATION_AS_UNREAD:"अपठित के रूप में चिह्नित करें",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},wi={code:"hr-HR",name:"Croatian",translation:{YESTERDAY:"Jučer",TODAY:"Danas",DAYS:"d",HOURS:"s",MINUTES:"m",JUST_NOW:"Upravo sad",LOCATION:"Lokacija",CANCEL:"Otkaži",INBOX:"Pretinac",DESKTOP_NOTIFICATIONS:"Obavijesti preglednika",DESKTOP_NOTIFICATIONS_ERROR:"Notifikacije preglednika nisu omogućene jer ih vaš preglednik aktivno blokira. Pokušajte pogledati postavke ili koristiti neki drugi preglednik.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notifikacija`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ako karticu preglednika ostavite otvorenu, pojavit će se ovaj pop-up kada netko razgovara s vama.",SEND_BUTTON_TEXT:"Pošalji",ENTRYBOX_TEXT_LIMIT:"Dozvoljeno je samo 10.000 znakova.",ENTRYBOX_PLACEHOLDER:"Reci nešto...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ovaj razgovor više nije aktivan.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Možeš čitati, ali ne i slati poruke.",MESSAGELIST_LOADING_OLDER:"Učitavam starije poruke...",MESSAGELIST_SHOW_OLDER:"Prikaži starije poruke",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Ova poruka je poslana e-poštom",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Učitavam...",UPLOAD_SEND_FILE:"Pošalji datoteku",UPLOAD_SHARE_LOCATION:"Podijeli lokaciju",UPLOAD_ERROR:"Nažalost, nešto je pošlo krivo. Datoteka možda nije podržana ili je prevelika.",SHARE_LOCATION_ERROR:"Nije moguće podijeliti lokaciju: ",LOADING:"Učitavam...",HUB_EMPTY:"Ovdje će se prikazati vaša povijest razgovora",HUB_SHOW_EARLIER:"Prikaži ranije razgovore",INBOX_NO_CHATS_TITLE:"Nema razgovora!",INBOX_NO_CHATS_BODY:"Nakon što vodite jedan ili više razgovora, oni će se pojaviti ovdje.",ENABLE_TRANSLATION:"Prevedi ovaj razgovor na hrvatski jezik",DISABLE_TRANSLATION:"Prikaži original",SEARCH_PLACEHOLDER_TEXT:"Pretraži...",SEARCH_SEARCHING:"Pretraživanje...",SEARCH_NO_RESULTS:"Nema rezultata",SEARCH_NO_MORE_RESULTS:"Nema više rezultata",CHAT_NOT_FOUND:"Razgovor nije pronađen",DELETE_MESSAGE:"Obriši poruku",DELETION_EXPLANATION:"Ako izbrišete ovu poruku, nestat će za sve.",EDIT_MESSAGE:"Uredi poruku",SAVE:"Spremi",EDITED_INDICATOR:"uređivao",REPLY_TO_MESSAGE:"Odgovorite",ADD_REACTION:"Dodajte reakciju",AUTH_EXPIRED_OVERLAY_TITLE:"Vaša sesija razgovora je istekla",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Osvježite stranicu za nastavak",VOICE_MESSAGE:"Glasovna poruka",CONTACT_INFORMATION_HIDDEN:"Skrivene informacije",LEAVE_CONVERSATION:"Napustiti razgovor",MARK_CONVERSATION_AS_UNREAD:"Označi kao nepročitano",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},ki={code:"hu-HU",name:"Hungarian",translation:{YESTERDAY:"Tegnap",TODAY:"Ma",DAYS:"n",HOURS:"ó",MINUTES:"p",JUST_NOW:"éppen most",LOCATION:"Helyszín",CANCEL:"Visszavonás",INBOX:"Postaláda",DESKTOP_NOTIFICATIONS:"Böngésző értesítések",DESKTOP_NOTIFICATIONS_ERROR:"Azért nem tudja bekapcsolni a böngésző értesítések funkciót, mert böngészője aktívan blokkolja azt. Tekintse meg a beállításokat vagy használjon másik böngészőt.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo értesítés`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ha nyitva hagyja böngészőjét, felugró ablak fog megjelenni, ha valaki beszélni szeretne Önnel.",SEND_BUTTON_TEXT:"Küldés",ENTRYBOX_TEXT_LIMIT:"Mindőssze 10.000 karakter megengedett.",ENTRYBOX_PLACEHOLDER:"Mondjon valamit...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ez a beszélgetés már nem aktív.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Elolvashatja az üzeneteket, de nem küldhet újat.",MESSAGELIST_LOADING_OLDER:"Korábbi üzenetek betöltése...",MESSAGELIST_SHOW_OLDER:"Korábbi üzenetek megjelenítése",MESSAGELIST_NEW_MARKER:"Új",MESSAGE_SENT_VIA_EMAIL:"Ez az üzenet e-mailben került elküldésre",YOU_MARKER:"Ön",UPLOAD_IN_PROGRESS:"Feltöltés...",UPLOAD_SEND_FILE:"Fájl küldése",UPLOAD_SHARE_LOCATION:"Helyszín megosztása",UPLOAD_ERROR:"Sajnos hiba történt a feltöltés során. A fájl nem támogatott vagy túl nagy.",SHARE_LOCATION_ERROR:"Helyszín megosztása nem lehetséges: ",LOADING:"Betöltés...",HUB_EMPTY:"A beszélgetések előzményei itt láthatók",HUB_SHOW_EARLIER:"Korábbi beszélgetések megjelenítése",INBOX_NO_CHATS_TITLE:"Még nincs megjeleníthető beszélgetés!",INBOX_NO_CHATS_BODY:"Amint egy vagy több beszélgetéssel rendelkezik, azok itt fognak megjelenni.",ENABLE_TRANSLATION:"A beszélgetés lefordítása erre a nyelvre: magyar",DISABLE_TRANSLATION:"Eredeti megjelenítése",SEARCH_PLACEHOLDER_TEXT:"Keresés...",SEARCH_SEARCHING:"Keresés...",SEARCH_NO_RESULTS:"Nincs találat",SEARCH_NO_MORE_RESULTS:"Nincs több találat",CHAT_NOT_FOUND:"A csevegés nem található",DELETE_MESSAGE:"Üzenet törlése",DELETION_EXPLANATION:"Ha törlöd ezt az üzenetet, az mindenki számára eltűnik.",EDIT_MESSAGE:"Üzenet szerkesztése",SAVE:"Mentés",EDITED_INDICATOR:"szerkesztve",REPLY_TO_MESSAGE:"Válaszadás",ADD_REACTION:"Reagálás erre",AUTH_EXPIRED_OVERLAY_TITLE:"Chat munkamenete lejárt",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Folytatáshoz frissítse az oldalt",VOICE_MESSAGE:"Hangüzenet",CONTACT_INFORMATION_HIDDEN:"Rejtett információ",LEAVE_CONVERSATION:"Kilépés a beszélgetésből",MARK_CONVERSATION_AS_UNREAD:"Megjelölés olvasatlanként",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Li={code:"id-ID",name:"Bahasa Indonesia",translation:{YESTERDAY:"Kemarin",TODAY:"Hari ini",DAYS:"h",HOURS:"j",MINUTES:"m",JUST_NOW:"sekarang",LOCATION:"Lokasi",CANCEL:"Batal",INBOX:"Kotak Masuk",DESKTOP_NOTIFICATIONS:"Notifikasi peramban",DESKTOP_NOTIFICATIONS_ERROR:"Tidak dapat mengaktifkan pemberitahuan browser karena browser Anda secara aktif memblokir mereka. Coba cari di pengaturan atau menggunakan browser yang berbeda.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`pemberitahuan demo ${e}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Jika Anda membiarkan tab browser tetap terbuka, Anda akan melihat ini muncul ketika seseorang berbicara kepada Anda.",SEND_BUTTON_TEXT:"Kirim",ENTRYBOX_TEXT_LIMIT:"Hanya 10.000 karakter yang diizinkan.",ENTRYBOX_PLACEHOLDER:"Katakan sesuatu...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Percakapan ini tidak lagi aktif.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Anda dapat membaca, tetapi tidak mengirim pesan.",MESSAGELIST_LOADING_OLDER:"Memuat pesan lama...",MESSAGELIST_SHOW_OLDER:"Tampilkan pesan yang lebih lama",MESSAGELIST_NEW_MARKER:"Baru",MESSAGE_SENT_VIA_EMAIL:"Pesan ini dikirim melalui email",YOU_MARKER:"Anda",UPLOAD_IN_PROGRESS:"Mengunggah...",UPLOAD_SEND_FILE:"Kirim mengajukan",UPLOAD_SHARE_LOCATION:"Bagikan lokasi",UPLOAD_ERROR:"Ada yang salah diunggah. File mungkin tidak didukung atau terlalu besar.",SHARE_LOCATION_ERROR:"Tidak dapat membagikan lokasi: ",LOADING:"Memuat...",HUB_EMPTY:"Riwayat obrolan Anda akan muncul di sini",HUB_SHOW_EARLIER:"Tampilkan obrolan sebelumnya",INBOX_NO_CHATS_TITLE:"Belum ada obrolan!",INBOX_NO_CHATS_BODY:"Setelah Anda melakukan satu atau lebih percakapan, mereka akan muncul di sini.",ENABLE_TRANSLATION:"Terjemahkan percakapan ini ke Indonesia",DISABLE_TRANSLATION:"Perlihatkan asli",SEARCH_PLACEHOLDER_TEXT:"Cari...",SEARCH_SEARCHING:"Mencari...",SEARCH_NO_RESULTS:"Tidak ditemukan hasil",SEARCH_NO_MORE_RESULTS:"Tidak ada hasil lainnya",CHAT_NOT_FOUND:"Obrolan tidak ditemukan",DELETE_MESSAGE:"Hapus pesan",DELETION_EXPLANATION:"Jika pesan ini Anda hapus, pesan ini akan tidak terlihat bagi siapa pun.",EDIT_MESSAGE:"Sunting pesan",SAVE:"Mentés",EDITED_INDICATOR:"diedit",REPLY_TO_MESSAGE:"Balas",ADD_REACTION:"Tambah reaksi",AUTH_EXPIRED_OVERLAY_TITLE:"Sesi obrolan Anda sudah lewat batas waktu",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Muat ulang halaman untuk melanjutkan",VOICE_MESSAGE:"Pesan suara",CONTACT_INFORMATION_HIDDEN:"Informasi tersembunyi",LEAVE_CONVERSATION:"Tinggalkan percakapan",MARK_CONVERSATION_AS_UNREAD:"Tandai sebagai Belum dibaca",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},xi={code:"it-IT",name:"Italian",translation:{YESTERDAY:"Ieri",TODAY:"Oggi",DAYS:"g",HOURS:"o",MINUTES:"m",JUST_NOW:"adesso",LOCATION:"Posizione",CANCEL:"Annulla",INBOX:"Posta in arrivo",DESKTOP_NOTIFICATIONS:"Notifiche browser",DESKTOP_NOTIFICATIONS_ERROR:"Impossibile abilitare le notifiche browser perché il browser le blocca attivamente. Prova a cercare le impostazioni o utilizzare un browser diverso.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notification`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Se si mantiene aperta la scheda del browser, questo verrà visualizzato quando qualcuno ti parla.",SEND_BUTTON_TEXT:"Invia",ENTRYBOX_TEXT_LIMIT:"Sono consentiti solo 10.000 caratteri.",ENTRYBOX_PLACEHOLDER:"Dì qualcosa...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Questa conversazione non è più attiva.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Puoi leggere, ma non inviare messaggi.",MESSAGELIST_LOADING_OLDER:"Caricamento dei messaggi precedenti...",MESSAGELIST_SHOW_OLDER:"Mostra messaggi precedenti",MESSAGELIST_NEW_MARKER:"Nuovo",MESSAGE_SENT_VIA_EMAIL:"Questo messaggio è stato inviato via email",YOU_MARKER:"tu",UPLOAD_IN_PROGRESS:"Caricamento in corso...",UPLOAD_SEND_FILE:"Invia file",UPLOAD_SHARE_LOCATION:"Condividi posizione",UPLOAD_ERROR:"Qualcosa è andato storto durante il caricamento. Il file potrebbe non essere supportato o troppo grande.",SHARE_LOCATION_ERROR:"Impossibile condividere la posizione: ",LOADING:"Caricamento in corso...",HUB_EMPTY:"La cronologia della tua chat verrà mostrata qui",HUB_SHOW_EARLIER:"Mostra chat precedenti",INBOX_NO_CHATS_TITLE:"Non ci sono ancora chat!",INBOX_NO_CHATS_BODY:"Una volta che hai avuto una o più conversazioni, verranno visualizzate qui.",ENABLE_TRANSLATION:"Traduci questa conversazione in italiano",DISABLE_TRANSLATION:"Mostra l'originale",SEARCH_PLACEHOLDER_TEXT:"Cerca...",SEARCH_SEARCHING:"Cercando...",SEARCH_NO_RESULTS:"Nessun risultato trovato",SEARCH_NO_MORE_RESULTS:"Non ci sono più risultati",CHAT_NOT_FOUND:"Chat non trovata",DELETE_MESSAGE:"Elimina messaggio",DELETION_EXPLANATION:"Se elimini il messaggio, questo scomparirà per tutti.",EDIT_MESSAGE:"Modifica messaggio",SAVE:"Salva",EDITED_INDICATOR:"modificato",REPLY_TO_MESSAGE:"Rispondi",ADD_REACTION:"Aggiungi reazione",AUTH_EXPIRED_OVERLAY_TITLE:"La sessione di chat è scaduta",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Aggiorna la pagina per continuare",VOICE_MESSAGE:"Messaggio vocale",CONTACT_INFORMATION_HIDDEN:"Informazioni nascoste",LEAVE_CONVERSATION:"Abbandona la conversazione",MARK_CONVERSATION_AS_UNREAD:"Segna come non letto",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Mi={code:"ja-JP",name:"Japanese",translation:{YESTERDAY:"昨日",TODAY:"今日",DAYS:"日前",HOURS:"時間前",MINUTES:"分前",JUST_NOW:"たった今",LOCATION:"場所",CANCEL:"キャンセル",INBOX:"受信箱",DESKTOP_NOTIFICATIONS:"ブラウザの通知",DESKTOP_NOTIFICATIONS_ERROR:"ブラウザの通知はブロックされているため、ブラウザの通知を有効にできません。設定を確認するか、別のブラウザを使用してください。",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} デモ通知`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"ブラウザのタブを開いたままにしておくと、誰かがあなたに話しかけたときにこのポップアップが表示されます。",SEND_BUTTON_TEXT:"送信",ENTRYBOX_TEXT_LIMIT:"許可されているのは10.000文字までです。",ENTRYBOX_PLACEHOLDER:"メッセージを入力してください",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"この会話はもうアクティブではありません。",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"あなたは読むことはできますが、メッセージを送ることはできません。",MESSAGELIST_LOADING_OLDER:"古いメッセージを読み込んでいます...",MESSAGELIST_SHOW_OLDER:"古いメッセージを表示",MESSAGELIST_NEW_MARKER:"新着",MESSAGE_SENT_VIA_EMAIL:"このメッセージはメールで送信されました",YOU_MARKER:"あなたは",UPLOAD_IN_PROGRESS:"アップロード中...",UPLOAD_SEND_FILE:"ファイル送信",UPLOAD_SHARE_LOCATION:"共有場所",UPLOAD_ERROR:"アップロード中に問題が発生しました。ファイルがサポートされていないか、大きすぎる可能性があります。",SHARE_LOCATION_ERROR:"場所を共有できません: ",LOADING:"読み込み中...",HUB_EMPTY:"あなたのチャット履歴がここに表示されます",HUB_SHOW_EARLIER:"以前のチャットを表示",INBOX_NO_CHATS_TITLE:"まだチャットがありません!",INBOX_NO_CHATS_BODY:"会話が1つ以上あると、ここに表示されます",ENABLE_TRANSLATION:"この会話を日本語に翻訳する",DISABLE_TRANSLATION:"オリジナルを表示",SEARCH_PLACEHOLDER_TEXT:"検索...",SEARCH_SEARCHING:"検索中...",SEARCH_NO_RESULTS:"結果が見つかりません",SEARCH_NO_MORE_RESULTS:"これ以上結果はありません",CHAT_NOT_FOUND:"チャットが見つかりませんでした",DELETE_MESSAGE:"メッセージを削除する",DELETION_EXPLANATION:"このメッセージを削除すると、全ての人に表示されなくなります。",EDIT_MESSAGE:"メッセージを編集する",SAVE:"上書き保存",EDITED_INDICATOR:"編集",REPLY_TO_MESSAGE:"返信する",ADD_REACTION:"リアクションを追加",AUTH_EXPIRED_OVERLAY_TITLE:"チャットセッションの有効期限が切れました",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"続けるにはページを更新してください",VOICE_MESSAGE:"ボイスメッセージ",CONTACT_INFORMATION_HIDDEN:"機密情報",LEAVE_CONVERSATION:"会話をやめる",MARK_CONVERSATION_AS_UNREAD:"未読としてマーク",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Fi={code:"ka-GE",name:"Georgian",translation:{YESTERDAY:"გუშინ",TODAY:"დღეს",DAYS:"დღ",HOURS:"სთ",MINUTES:"წთ",JUST_NOW:"ახლა",LOCATION:"ადგილმდებარეობა",CANCEL:"გაუქმება",INBOX:"მიღებული შეტყობინება",DESKTOP_NOTIFICATIONS:"ბრაუზერის შეტყობინებები",DESKTOP_NOTIFICATIONS_ERROR:"შეუძლებელია ბრაუზერის შეტკობინებების ჩართვა. ეს ბრაუზერი ბლოკავს მათ. სცადე ცვლილება ოპციებიდან ან გამოიყენე სხვა ბრაუზერი.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} შეტყობინებების დემო ვერსია`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"თუ დატოვებ ბრაუზერის ფანჯარას გახსნილს, როცა ვიღაც მოგწერს საუბარი ამოვარდება დესკტოპზე.",SEND_BUTTON_TEXT:"გაგზავნა",ENTRYBOX_TEXT_LIMIT:"დაშვებულია მხოლოდ 10.000 სიმბოლო.",ENTRYBOX_PLACEHOLDER:"დაწერე რაღაც...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"ეს დიალოგი აღარ არის ხელმისაწვდომი.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"შეგიძლია წაიკითხო, მაგრამ ვერ გააგზავნი შეტყობინებას.",MESSAGELIST_LOADING_OLDER:"იტვირთება ძველი შეტყობინებები...",MESSAGELIST_SHOW_OLDER:"ძველი შეტყობინებების ჩვენება",MESSAGELIST_NEW_MARKER:"ახალი",MESSAGE_SENT_VIA_EMAIL:"ეს შეტყობინება გამოგზავნილია იმეილით",YOU_MARKER:"you",UPLOAD_IN_PROGRESS:"იტვირთება...",UPLOAD_SEND_FILE:"ფაილის გაგზავნა",UPLOAD_SHARE_LOCATION:"ადგილმდებარეობის გაზიარება",UPLOAD_ERROR:"პრობლემაა ატვირთვისას. ფაილის შესაძლოა არის არათავსებადი ან ძალიან დიდი.",SHARE_LOCATION_ERROR:"შეუძლებელია ადგილმდებარეობის გაზიარება: ",LOADING:"იტვირთება...",HUB_EMPTY:"საუბრების ისტორია გამოჩნდება აქ",HUB_SHOW_EARLIER:"წინა საუბრების ნახვა",INBOX_NO_CHATS_TITLE:"ჯერ-ჯერობით არ არის საუბრები!",INBOX_NO_CHATS_BODY:"უკვე დასრულებული საუბარები გამოჩნდება აქ",ENABLE_TRANSLATION:"თარგმნეთ ეს საუბარი ინგლისურად",DISABLE_TRANSLATION:"ორიგინალის ჩვენება",SEARCH_PLACEHOLDER_TEXT:"ძიება...",SEARCH_SEARCHING:"მიმდინარეობს ძიება...",SEARCH_NO_RESULTS:"შედეგები ვერ ქართველი",SEARCH_NO_MORE_RESULTS:"სხვა შედეგი ვერ მოიძებნა",CHAT_NOT_FOUND:"ჩატი ვერ მოიძებნა",DELETE_MESSAGE:"შეტყობინების წაშლა ",DELETION_EXPLANATION:"თუ ამ შეტყობინებას წაშლით, ის ყველასთვის გაქრება.",EDIT_MESSAGE:"შეტყობინების რედაქტირება",SAVE:"შენახვა",EDITED_INDICATOR:"რედაქტირებულია",REPLY_TO_MESSAGE:"პასუხის გაცემა",ADD_REACTION:"დაამატეთ რეაქცია",AUTH_EXPIRED_OVERLAY_TITLE:"თქვენი ჩეთის სესიის ვადა ამოიწურა",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"განაახლეთ გვერდი გასაგრძელებლად",VOICE_MESSAGE:"ხმოვანი შეტყობინება",CONTACT_INFORMATION_HIDDEN:"ფარული ინფორმაცია",LEAVE_CONVERSATION:"საუბრის დატოვება",MARK_CONVERSATION_AS_UNREAD:"წაუკითხავად მონიშვნა",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Bi={code:"ko-KR",name:"Korean (South Korea)",translation:{YESTERDAY:"어제",TODAY:"오늘",DAYS:"일 전",HOURS:"시간 전",MINUTES:"분 전",JUST_NOW:"방금",LOCATION:"위치",CANCEL:"취소",INBOX:"대화 목록",DESKTOP_NOTIFICATIONS:"브라우저 알림",DESKTOP_NOTIFICATIONS_ERROR:"브라우저 알림을 표시할 수 없습니다. 브라우저 설정을 확인하거나 다른 브라우저를 사용해주세요.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} 데모 알림`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"브라우저 탭을 열어 둔 상태에서 누군가 대화 할 때 이 팝업이 표시됩니다.",SEND_BUTTON_TEXT:"전송",ENTRYBOX_TEXT_LIMIT:"최대 10,000자까지 입력할 수 있습니다.",ENTRYBOX_PLACEHOLDER:"메세지를 입력하세요...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"채팅이 종료되었습니다.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"읽기만 가능하며 메시지를 보낼 수 없습니다.",MESSAGELIST_LOADING_OLDER:"이전 메시지 로드 중...",MESSAGELIST_SHOW_OLDER:"이전 메시지 표시",MESSAGELIST_NEW_MARKER:"새 메시지",MESSAGE_SENT_VIA_EMAIL:"이 메시지는 이메일을 통해 전송되었습니다.",YOU_MARKER:"나",UPLOAD_IN_PROGRESS:"업로드 중...",UPLOAD_SEND_FILE:"파일 전송",UPLOAD_SHARE_LOCATION:"위치 공유",UPLOAD_ERROR:"업로드가 실패했습니다. 파일이 지원되지 않거나 너무 클 수 있습니다.",SHARE_LOCATION_ERROR:"위치를 공유 할 수 없습니다: ",LOADING:"로드 중...",HUB_EMPTY:"채팅 기록이 여기에 표시됩니다",HUB_SHOW_EARLIER:"이전 채팅보기",INBOX_NO_CHATS_TITLE:"아직 채팅이 없습니다!",INBOX_NO_CHATS_BODY:"대화가 하나 이상 있으면 여기에 표시됩니다.",ENABLE_TRANSLATION:"이 대화를 한국어로 번역",DISABLE_TRANSLATION:"원본 표시",SEARCH_PLACEHOLDER_TEXT:"검색...",SEARCH_SEARCHING:"검색 중...",SEARCH_NO_RESULTS:"검색 결과 없음",SEARCH_NO_MORE_RESULTS:"추가 검색 결과 없음",CHAT_NOT_FOUND:"대화를 찾지 못했습니다",DELETE_MESSAGE:"메시지 삭제",DELETION_EXPLANATION:"이 메시지를 삭제하면 모든 사람이 볼 수 없게 됩니다.",EDIT_MESSAGE:"메시지 편집하기",SAVE:"저장",EDITED_INDICATOR:"편집",REPLY_TO_MESSAGE:"회신",ADD_REACTION:"반응 추가",AUTH_EXPIRED_OVERLAY_TITLE:"채팅 세션이 만료되었습니다",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"계속하려면 페이지를 새로고침하세요",VOICE_MESSAGE:"음성 메시지",CONTACT_INFORMATION_HIDDEN:"숨겨진 정보",LEAVE_CONVERSATION:"대화 떠나기",MARK_CONVERSATION_AS_UNREAD:"읽지 않은 상태로 표시",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Pi={code:"nb-NO",name:"Norwegian (Bokmål)",translation:{YESTERDAY:"I går",TODAY:"I dag",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"Nå",LOCATION:"Plassering",CANCEL:"Avbryt",INBOX:"Innboks",DESKTOP_NOTIFICATIONS:"Nettleservarsler",DESKTOP_NOTIFICATIONS_ERROR:"Kan ikke aktivere Nettleservarsler fordi nettleseren din aktivt blokkerer dem. Prøv å se i innstillingene eller bruke en annen nettleser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo varslinger`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Hvis du holder nettleservinduet åpent, vil du se dette varsel når noen snakker til deg.",SEND_BUTTON_TEXT:"Send",ENTRYBOX_TEXT_LIMIT:"Kun 10.000 tegn er tillatt.",ENTRYBOX_PLACEHOLDER:"Si noe...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Denne samtale er ikke lengre aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Du kan lese, men ikke sende meldinger.",MESSAGELIST_LOADING_OLDER:"Laster eldre meldinger...",MESSAGELIST_SHOW_OLDER:"Vis eldre meldinger",MESSAGELIST_NEW_MARKER:"Ny",MESSAGE_SENT_VIA_EMAIL:"Denne meldingen er sendt via e-post",YOU_MARKER:"deg",UPLOAD_IN_PROGRESS:"Laster opp...",UPLOAD_SEND_FILE:"Send fil",UPLOAD_SHARE_LOCATION:"Del din plassering",UPLOAD_ERROR:"Noe gikk galt i uplastingen. Det kan være filen ikke støttes eller for stor.",SHARE_LOCATION_ERROR:"Kan ikke dele plasseringen: ",LOADING:"Laster...",HUB_EMPTY:"Din chats historikk vil vises her",HUB_SHOW_EARLIER:"Vis tidligere chats",INBOX_NO_CHATS_TITLE:"Ingen chats enda!",INBOX_NO_CHATS_BODY:"Så snart du får en eller flere samtaler, vil de vises her.",ENABLE_TRANSLATION:"Oversett denne samtalen til norsk",DISABLE_TRANSLATION:"Vis original",SEARCH_PLACEHOLDER_TEXT:"Søk...",SEARCH_SEARCHING:"Søker...",SEARCH_NO_RESULTS:"Finner ingen resultater",SEARCH_NO_MORE_RESULTS:"Ingen flere resultater",CHAT_NOT_FOUND:"Chat ikke funnet",DELETE_MESSAGE:"Slett melding",DELETION_EXPLANATION:"Hvis du sletter denne meldingen, forsvinner den for alle.",EDIT_MESSAGE:"Rediger melding",SAVE:"Lagre",EDITED_INDICATOR:"redigert",REPLY_TO_MESSAGE:"Svar",ADD_REACTION:"Legg til reaksjon",AUTH_EXPIRED_OVERLAY_TITLE:"Chatøkten er utløpt",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Oppdater siden for å fortsette",VOICE_MESSAGE:"Lydmelding",CONTACT_INFORMATION_HIDDEN:"Skjult informasjon",LEAVE_CONVERSATION:"Forlat samtalen",MARK_CONVERSATION_AS_UNREAD:"Merk som ulest",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ui={code:"nl-NL",name:"Dutch",translation:{YESTERDAY:"Gisteren",TODAY:"Vandaag",DAYS:"d",HOURS:"u",MINUTES:"m",JUST_NOW:"zojuist",LOCATION:"Locatie",CANCEL:"Annuleren",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Browsermeldingen",DESKTOP_NOTIFICATIONS_ERROR:"Browsermeldingen kunnen niet geactiveerd worden omdat de browser het blokkeert. Check de instellingen van je browser of probeer een andere browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notificatie`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Als je je browser open houdt, zie je deze popup als iemand tegen je praat.",SEND_BUTTON_TEXT:"Verzenden",ENTRYBOX_TEXT_LIMIT:"Maximaal 10.000 tekens toegestaan.",ENTRYBOX_PLACEHOLDER:"Typ een bericht...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Dit gesprek is niet actief meer.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Je kunt geen berichten sturen.",MESSAGELIST_LOADING_OLDER:"Eerdere berichten laden...",MESSAGELIST_SHOW_OLDER:"Laad eerdere berichten",MESSAGELIST_NEW_MARKER:"Nieuw",MESSAGE_SENT_VIA_EMAIL:"Dit bericht is verstuurd via e-mail",YOU_MARKER:"jij",UPLOAD_IN_PROGRESS:"Uploaden...",UPLOAD_SEND_FILE:"Verzend bestand",UPLOAD_SHARE_LOCATION:"Deel locatie",UPLOAD_ERROR:"Er ging iets mis. Het bestand wordt niet ondersteund of is te groot.",SHARE_LOCATION_ERROR:"Locatie delen mislukt: ",LOADING:"Bezig met laden...",HUB_EMPTY:"Berichtengeschiedenis wordt hier weergegeven",HUB_SHOW_EARLIER:"Laat eerdere berichten zien",INBOX_NO_CHATS_TITLE:"Nog geen chats!",INBOX_NO_CHATS_BODY:"Zodra je een of meerdere conversaties hebt gehad, worden deze hier weergegeven.",ENABLE_TRANSLATION:"Vertaal dit gesprek naar het Nederlands",DISABLE_TRANSLATION:"Toon oorspronkelijk gesprek",SEARCH_PLACEHOLDER_TEXT:"Zoek...",SEARCH_SEARCHING:"Zoeken...",SEARCH_NO_RESULTS:"Geen resultaten gevonden",SEARCH_NO_MORE_RESULTS:"Niet meer resultaten",CHAT_NOT_FOUND:"Chat niet gevonden",DELETE_MESSAGE:"Bericht verwijderen",DELETION_EXPLANATION:"Als je dit bericht verwijdert, zal het voor iedereen verdwijnen.",EDIT_MESSAGE:"Bericht bewerken",SAVE:"Opslaan",EDITED_INDICATOR:"bewerkt",REPLY_TO_MESSAGE:"Beantwoorden",ADD_REACTION:"Reactie toevoegen",AUTH_EXPIRED_OVERLAY_TITLE:"Je chatsessie is verlopen",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Ververs de pagina om door te gaan",VOICE_MESSAGE:"Spraakbericht",CONTACT_INFORMATION_HIDDEN:"verborgen informatie",LEAVE_CONVERSATION:"Gesprek verlaten",MARK_CONVERSATION_AS_UNREAD:"Markeren als ongelezen",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Hi={code:"pl-PL",name:"Polish",translation:{YESTERDAY:"Wczoraj",TODAY:"Dzisiaj",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"teraz",LOCATION:"Lokalizacja",CANCEL:"Anuluj",INBOX:"Skrzynka odbiorcza",DESKTOP_NOTIFICATIONS:"Powiadomienia",DESKTOP_NOTIFICATIONS_ERROR:"Nie można aktywować powiadomień, ponieważ twoja przeglądarka je blokuje. Proszę zmienić ustawienie lub spróbować innej przeglądarki.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} przykładowe powiadomienie`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Jeśli zostawisz tę kartę otwartą, zobaczysz takie powiadomienie, gdy ktoś napisze do Ciebie.",SEND_BUTTON_TEXT:"Wyślij",ENTRYBOX_TEXT_LIMIT:"Nie można wysyłać więcej niż 10000 znaków.",ENTRYBOX_PLACEHOLDER:"Napisz coś...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ten czat nie jest aktywny.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Możesz czytać wiadomości, ale nie możesz ich wysyłać.",MESSAGELIST_LOADING_OLDER:"Wczytuję starsze wiadomości...",MESSAGELIST_SHOW_OLDER:"Zobacz starsze wiadomości",MESSAGELIST_NEW_MARKER:"Nowe",MESSAGE_SENT_VIA_EMAIL:"Ta wiadomość została wysłana przez email.",YOU_MARKER:"ty",UPLOAD_IN_PROGRESS:"Przesyłanie...",UPLOAD_SEND_FILE:"Prześlij plik",UPLOAD_SHARE_LOCATION:"Udostępnij lokalizację",UPLOAD_ERROR:"Coś poszło nie tak. Plik może być zbyt duży lub jest nieobsługiwany.",SHARE_LOCATION_ERROR:"Nie da się udostępnić lokalizacji: ",LOADING:"Ładowanie...",HUB_EMPTY:"Twoje czaty pojawią się tutaj",HUB_SHOW_EARLIER:"Zobacz starsze czaty",INBOX_NO_CHATS_TITLE:"Brak czatów!",INBOX_NO_CHATS_BODY:"Rozpoczęte konwersacje pojawią się tutaj.",ENABLE_TRANSLATION:"Przetłumacz tę konwersację na język polski",DISABLE_TRANSLATION:"Pokaż oryginał",SEARCH_PLACEHOLDER_TEXT:"Wyszukaj...",SEARCH_SEARCHING:"Wyszukiwanie...",SEARCH_NO_RESULTS:"Nie znaleziono wyników",SEARCH_NO_MORE_RESULTS:"Nie ma innych wyników",CHAT_NOT_FOUND:"Nie znaleziono konwersacji",DELETE_MESSAGE:"Usuń wiadomość",DELETION_EXPLANATION:"Jeśli usuniesz tę wiadomość, przestanie być widoczna dla wszystkich.",EDIT_MESSAGE:"Edytuj wiadomość",SAVE:"Zapisz",EDITED_INDICATOR:"edytowano",REPLY_TO_MESSAGE:"Odpowiedz",ADD_REACTION:"Dodaj reakcję",AUTH_EXPIRED_OVERLAY_TITLE:"Twoja sesja wygasła",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Odśwież stronę, aby kontynuować",VOICE_MESSAGE:"Wiadomość głosowa",CONTACT_INFORMATION_HIDDEN:"Ukryte informacje",LEAVE_CONVERSATION:"Opuść konwersację",MARK_CONVERSATION_AS_UNREAD:"Oznacz jako nieprzeczytane",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},ji={code:"pt-BR",name:"Portuguese (Brazil)",translation:{YESTERDAY:"Ontem",TODAY:"Hoje",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"agora mesmo",LOCATION:"Localização",CANCEL:"Cancelar",INBOX:"Caixa de entrada",DESKTOP_NOTIFICATIONS:"Notificações do navegador",DESKTOP_NOTIFICATIONS_ERROR:"Não é possível ativar as notificações da navegador porque seu navegador as bloqueia. Tente procurar nas configurações ou usar um navegador diferente.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} notificação de demonstração`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Se você mantiver a guia do navegador aberta, verá essa mensagem quando alguém falar com você.",SEND_BUTTON_TEXT:"Enviar",ENTRYBOX_TEXT_LIMIT:"Apenas 10.000 caracteres são permitidos.",ENTRYBOX_PLACEHOLDER:"Diga algo...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Esta conversa não está mais ativa.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Você pode ler, mas não enviar mensagens.",MESSAGELIST_LOADING_OLDER:"Carregando mensagens antigas...",MESSAGELIST_SHOW_OLDER:"Mostrar mensagens mais antigas",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Esta mensagem foi enviada via email.",YOU_MARKER:"Você",UPLOAD_IN_PROGRESS:"Carregando...",UPLOAD_SEND_FILE:"Enviar arquivo",UPLOAD_SHARE_LOCATION:"Compartilhar localização",UPLOAD_ERROR:"Algo deu errado ao fazer o upload. O arquivo pode não ter suporte ou ser muito grande.",SHARE_LOCATION_ERROR:"Não é possível compartilhar o local: ",LOADING:"Carregando...",HUB_EMPTY:"Seu histórico de conversas será exibido aqui",HUB_SHOW_EARLIER:"Mostrar conversas anteriores",INBOX_NO_CHATS_TITLE:"Ainda não há chats!",INBOX_NO_CHATS_BODY:"Depois de ter uma ou mais conversas, elas serão exibidas aqui.",ENABLE_TRANSLATION:"Traduzir esta conversa para português",DISABLE_TRANSLATION:"Ver a conversa não traduzida",SEARCH_PLACEHOLDER_TEXT:"Busca...",SEARCH_SEARCHING:"Consultando...",SEARCH_NO_RESULTS:"Resultados nao encontrados",SEARCH_NO_MORE_RESULTS:"Não há mais resultados",CHAT_NOT_FOUND:"Conversa não encontrada",DELETE_MESSAGE:"Excluir mensagem",DELETION_EXPLANATION:"Se você excluir esta mensagem, ela desaparecerá para todos.",EDIT_MESSAGE:"Editar mensagem",SAVE:"Salvar",EDITED_INDICATOR:"editada",REPLY_TO_MESSAGE:"Responder",ADD_REACTION:"Adicionar reação",AUTH_EXPIRED_OVERLAY_TITLE:"Sua sessão de chat expirou",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Atualize a página para continuar",VOICE_MESSAGE:"Mensagem de voz",LEAVE_CONVERSATION:"Sair da conversa",MARK_CONVERSATION_AS_UNREAD:"Marcar como não lida",CONTACT_INFORMATION_HIDDEN:"Informação oculta",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},$i={code:"ro-RO",name:"Romanian (Romania)",translation:{YESTERDAY:"Ieri",TODAY:"Astăzi",DAYS:"z",HOURS:"o",MINUTES:"m",JUST_NOW:"chiar acum",LOCATION:"Locație",CANCEL:"Anulare",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Notificări browser",DESKTOP_NOTIFICATIONS_ERROR:"Nu se pot activa notificări browser deoarece browserul dvs. le blochează în mod activ. Încercați să căutați în setări sau utilizând un alt browser.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`Notificare de debit ${e}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Dacă țineți fișa browserului deschis, veți vedea acest pop-up atunci când cineva vorbește cu dvs.",SEND_BUTTON_TEXT:"Trimiteți",ENTRYBOX_TEXT_LIMIT:"Sunt permise numai 10.000 de caractere.",ENTRYBOX_PLACEHOLDER:"Spune ceva...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Această conversație nu mai este activă.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Puteți citi, dar nu puteți trimite mesaje.",MESSAGELIST_LOADING_OLDER:"Încărcarea mesajelor mai vechi...",MESSAGELIST_SHOW_OLDER:"Afișați mesaje mai vechi",MESSAGELIST_NEW_MARKER:"Nou",MESSAGE_SENT_VIA_EMAIL:"Acest mesaj a fost trimis prin e-mail",YOU_MARKER:"voi",UPLOAD_IN_PROGRESS:"Încărcarea...",UPLOAD_SEND_FILE:"Trimiteți fișierul",UPLOAD_SHARE_LOCATION:"Distribuiți locația",UPLOAD_ERROR:"Sa încărcat ceva în mod greșit. Fișierul ar putea fi neacceptat sau prea mare.",SHARE_LOCATION_ERROR:"Nu se poate partaja locația: ",LOADING:"Încărcare...",HUB_EMPTY:"Istoricul chat-ului dvs. va apărea aici",HUB_SHOW_EARLIER:"Afișați discuțiile anterioare",INBOX_NO_CHATS_TITLE:"Încă nu vorbești!",INBOX_NO_CHATS_BODY:"După ce ați avut una sau mai multe conversații, acestea vor apărea aici.",ENABLE_TRANSLATION:"Traduceți această conversație în română",DISABLE_TRANSLATION:"Arată originalul",SEARCH_PLACEHOLDER_TEXT:"Căutare...",SEARCH_SEARCHING:"Se caută...",SEARCH_NO_RESULTS:"Nu s-au găsit rezultate",SEARCH_NO_MORE_RESULTS:"Nu mai există rezultate",CHAT_NOT_FOUND:"Conversația nu a fost găsită",DELETE_MESSAGE:"Șterge mesajul",DELETION_EXPLANATION:"Dacă ștergi acest mesaj, acesta va dispărea pentru toată lumea.",EDIT_MESSAGE:"Redactează mesajul",SAVE:"Salvare",EDITED_INDICATOR:"editat",REPLY_TO_MESSAGE:"Răspundeți",ADD_REACTION:"Adaugă o reacție",AUTH_EXPIRED_OVERLAY_TITLE:"Sesiunea dumneavoastră de chat a expirat",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Reîmprospătați pagina pentru a continua",VOICE_MESSAGE:"Mesaj vocal",CONTACT_INFORMATION_HIDDEN:"Informații ascunse",LEAVE_CONVERSATION:"Părăsește conversația",MARK_CONVERSATION_AS_UNREAD:"Marcheaza ca necitit",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Yi={code:"ru-RU",name:"Russian",translation:{YESTERDAY:"Вчера",TODAY:"Сегодня",DAYS:"д",HOURS:"ч",MINUTES:"м",JUST_NOW:"только что",LOCATION:"Местоположение",CANCEL:"Отмена",INBOX:"Входящие",DESKTOP_NOTIFICATIONS:"Оповещения",DESKTOP_NOTIFICATIONS_ERROR:"Невозможно включить оповещения, потому что ваш браузер активно блокирует их. Проверьте ваши настройки или попробуйте другой браузер.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} демо-оповещение`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Если вкладка вашего браузера открыта, вы увидите всплывающее окошко оповещения когда кто-то отправит вам сообщение.",SEND_BUTTON_TEXT:"Отправить",ENTRYBOX_TEXT_LIMIT:"Разрешено использовать только 10 тысяч символов.",ENTRYBOX_PLACEHOLDER:"Напишите что-нибудь...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Этот разговор больше неактивен.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Вы можете читать, но не отправлять сообщения.",MESSAGELIST_LOADING_OLDER:"Загрузка старых сообщения...",MESSAGELIST_SHOW_OLDER:"Показать старые сообщения",MESSAGELIST_NEW_MARKER:"Новые",MESSAGE_SENT_VIA_EMAIL:"Это сообщение было отправлено по электронной почте",YOU_MARKER:"вы",UPLOAD_IN_PROGRESS:"Загрузка...",UPLOAD_SEND_FILE:"Отправить файл",UPLOAD_SHARE_LOCATION:"Поделиться местоположением",UPLOAD_ERROR:"Что-то пошло не так: такой файл не поддерживается или он слишком большой.",SHARE_LOCATION_ERROR:"Не удается поделиться местоположением: ",LOADING:"Загрузка...",HUB_EMPTY:"Здесь появится ваша история чата",HUB_SHOW_EARLIER:"Показать предыдущие чаты",INBOX_NO_CHATS_TITLE:"Пока нет чатов!",INBOX_NO_CHATS_BODY:"Как только у вас будет один или несколько разговоров, они появятся здесь.",ENABLE_TRANSLATION:"Переведите этот разговор на русский",DISABLE_TRANSLATION:"Show source",SEARCH_PLACEHOLDER_TEXT:"поиск...",SEARCH_SEARCHING:"Поиск...",SEARCH_NO_RESULTS:"Результаты не найдены",SEARCH_NO_MORE_RESULTS:"Больше результатов нет",CHAT_NOT_FOUND:"Чат не найден",DELETE_MESSAGE:"Удалить сообщение",DELETION_EXPLANATION:"Если вы удалите это сообщение, оно исчезнет для всех.",EDIT_MESSAGE:"Изменить сообщение",SAVE:"сохранить",EDITED_INDICATOR:"изменено",REPLY_TO_MESSAGE:"Ответить",ADD_REACTION:"Добавить реакцию",AUTH_EXPIRED_OVERLAY_TITLE:"Срок действия вашего сеанса чата истек",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Обновите страницу, чтобы продолжить",VOICE_MESSAGE:"Голосовое сообщение",CONTACT_INFORMATION_HIDDEN:"Информация скрыта",LEAVE_CONVERSATION:"Выйти из беседы",MARK_CONVERSATION_AS_UNREAD:"Отметить как непрочитанное",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},zi={code:"sq-AL",name:"Albanian",translation:{YESTERDAY:"Dje",TODAY:"Sot",DAYS:"d",HOURS:"o",MINUTES:"m",JUST_NOW:"Tani",LOCATION:"Pozicion",CANCEL:"Anulo",INBOX:"Inbox",DESKTOP_NOTIFICATIONS:"Njoftimet e shfletuesit",DESKTOP_NOTIFICATIONS_ERROR:"Nuk mund të aktivizohen njoftimet në shfletues sepse shfletuesi juaj i bllokon ato në mënyrë aktive. Provoni të shikoni cilësimet ose përdorni një shfletues të ndryshëm.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} njoftime në desktop`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Lënia e skedës së shfletuesit tuaj të hapur do të pop-up kur dikush flet me ju.",SEND_BUTTON_TEXT:"Dërgo",ENTRYBOX_TEXT_LIMIT:"Lejohen vetëm 10,000 karaktere",ENTRYBOX_PLACEHOLDER:"Thuaj diçka...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Kjo bisedë nuk është më aktive.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Mund të lexoni por jo të dërgoni mesazhe.",MESSAGELIST_LOADING_OLDER:"Duke ngarkuar mesazhe më të vjetra...",MESSAGELIST_SHOW_OLDER:"Trego mesazhe më të vjetra",MESSAGELIST_NEW_MARKER:"E ri",MESSAGE_SENT_VIA_EMAIL:"Ky mesazh u dërgua si email",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Ngarkim...",UPLOAD_SEND_FILE:"Dërgo datotekën",UPLOAD_SHARE_LOCATION:"Ndani lokacionin",UPLOAD_ERROR:"Na vjen keq, diçka nuk shkoi si duhet. Dosja mund të mos ket mbështetje ose mund të jetë shumë e madhe.",SHARE_LOCATION_ERROR:"Nuk mund të ndahet lokacioni: ",LOADING:"Ngarkim...",HUB_EMPTY:"Këtu do të paraqitet/ shfaqet historia e bisedës tuaj",HUB_SHOW_EARLIER:"Shfaqi bisedat e mëparshme",INBOX_NO_CHATS_TITLE:"Nuk ka biseda!",INBOX_NO_CHATS_BODY:"Pasi të keni një ose më shumë biseda, ato do të paraqiten/shfaqen këtu.",ENABLE_TRANSLATION:"Përkthejeni këtë bisedë në shqiptare",DISABLE_TRANSLATION:"Shikoni origjinalin",SEARCH_PLACEHOLDER_TEXT:"Kërko...",SEARCH_SEARCHING:"Kërko...",SEARCH_NO_RESULTS:"Nuk ka rezultate",SEARCH_NO_MORE_RESULTS:"Nuk ka më rezultate",CHAT_NOT_FOUND:"Biseda nuk u gjet",DELETE_MESSAGE:"Fshi mesazhin",DELETION_EXPLANATION:"Nëse e fshini këtë mesazh, ai do të zhduket për të gjithë.",EDIT_MESSAGE:"Redakto mesazhin",SAVE:"Ruaj",EDITED_INDICATOR:"redaktuar",REPLY_TO_MESSAGE:"Përgjigj",ADD_REACTION:"Shtoni reagimin",AUTH_EXPIRED_OVERLAY_TITLE:"Sesioni juaj i bisedës ka skaduar",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Rifresko faqen për të vazhduar",VOICE_MESSAGE:"Mesazh zanor",CONTACT_INFORMATION_HIDDEN:"informacione të fshehura",LEAVE_CONVERSATION:"Largohu nga bashkëbisedimi",MARK_CONVERSATION_AS_UNREAD:"Shëno si të palexuar",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Vi={code:"sv-SE",name:"Swedish (Sweden)",translation:{YESTERDAY:"Igår",TODAY:"Idag",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"just nu",LOCATION:"Plats",CANCEL:"Avbryt",INBOX:"Inkorg",DESKTOP_NOTIFICATIONS:"Webbläsarnotiser",DESKTOP_NOTIFICATIONS_ERROR:"Kan inte aktivera webbläsarnotiser eftersom din webbläsare aktivt blockerar dem. Se över inställningarna eller använd en annan webbläsare.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demonotis`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Om du har fliken i webbläsaren öppen så kommer den här notisen visas när någon pratar med dig.",SEND_BUTTON_TEXT:"Skicka",ENTRYBOX_TEXT_LIMIT:"Max 10 000 tecken är tillåtet.",ENTRYBOX_PLACEHOLDER:"Skriv ett meddelande...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Den här konversationen är inte längre aktiv.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Du kan läsa men inte skicka meddelanden.",MESSAGELIST_LOADING_OLDER:"Läser in tidigare meddelanden...",MESSAGELIST_SHOW_OLDER:"Visa tidigare meddelanden",MESSAGELIST_NEW_MARKER:"Nytt",MESSAGE_SENT_VIA_EMAIL:"Detta meddelande skickades via e-post",YOU_MARKER:"du",UPLOAD_IN_PROGRESS:"Laddar upp...",UPLOAD_SEND_FILE:"Skicka fil",UPLOAD_SHARE_LOCATION:"Dela plats",UPLOAD_ERROR:"Något gick fel vid uppladdningen. Filen kan vara av en typ som inte stöds eller är för stor.",SHARE_LOCATION_ERROR:"Kan inte dela plats: ",LOADING:"Laddar...",HUB_EMPTY:"Din chatthistorik kommer att visas här",HUB_SHOW_EARLIER:"Visa tidigare chattar",INBOX_NO_CHATS_TITLE:"Inga chattar ännu!",INBOX_NO_CHATS_BODY:"När du har haft en eller flera konversationer kommer de att visas här.",ENABLE_TRANSLATION:"Översätt den här konversationen till svenska",DISABLE_TRANSLATION:"Visa original",SEARCH_PLACEHOLDER_TEXT:"Sök...",SEARCH_SEARCHING:"Söker...",SEARCH_NO_RESULTS:"Inga resultat hittades",SEARCH_NO_MORE_RESULTS:"Inga fler resultat",CHAT_NOT_FOUND:"Chatten hittades inte",DELETE_MESSAGE:"Radera meddelandet",DELETION_EXPLANATION:"Om du raderar det här meddelandet försvinner det för alla.",EDIT_MESSAGE:"Redigera meddelandet",SAVE:"Spara",EDITED_INDICATOR:"redigerad",REPLY_TO_MESSAGE:"Svara",ADD_REACTION:"Lägg till reaktion",AUTH_EXPIRED_OVERLAY_TITLE:"Din chatsession har gått ut",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Uppdatera sidan för att fortsätta",VOICE_MESSAGE:"Röstmeddelande",CONTACT_INFORMATION_HIDDEN:"Dold information",LEAVE_CONVERSATION:"Lämna konversationen",MARK_CONVERSATION_AS_UNREAD:"Markera som oläst",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Gi={code:"tr-TR",name:"Turkish",translation:{YESTERDAY:"Dün",TODAY:"Bugün",DAYS:"g",HOURS:"s",MINUTES:"d",JUST_NOW:"az önce",LOCATION:"Konum",CANCEL:"İptal",INBOX:"Gelen Kutusu",SEND_BUTTON_TEXT:"Gönder",ENTRYBOX_TEXT_LIMIT:"En fazla 10.000 karaktere izin veriliyor.",ENTRYBOX_PLACEHOLDER:"Bir şeyler söyle...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Bu konuşma artık aktif değil.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Mesajları okuyabilirsiniz ancak mesaj gönderemezsiniz.",MESSAGELIST_LOADING_OLDER:"Eski mesajlar yükleniyor...",MESSAGELIST_SHOW_OLDER:"Eski mesajları göster",MESSAGELIST_NEW_MARKER:"Yeni",DESKTOP_NOTIFICATIONS:"Tarayıcı bildirimleri",DESKTOP_NOTIFICATIONS_ERROR:"Tarayıcınız aktif olarak engellediğinden tarayıcı bildirimlerini etkinleştiremiyoruz. Ayarları kontrol etmeyi veya farklı bir tarayıcı kullanmayı deneyebilirsiniz.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} test bildirimi`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Eğer tarayıcınızın penceresini açık tutarsanız biri mesaj yazdığında bu bildirimi göreceksiniz.",MESSAGE_SENT_VIA_EMAIL:"Bu mesaj e-posta ile gönderilmiştir.",YOU_MARKER:"siz",UPLOAD_IN_PROGRESS:"Yükleniyor...",UPLOAD_SEND_FILE:"Dosya gönder",UPLOAD_SHARE_LOCATION:"Konum paylaş",UPLOAD_ERROR:"Yükleme sırasında bir şeyler yanlış gitti. Dosya desteklenmiyor veya izin verilenden büyük olabilir.",SHARE_LOCATION_ERROR:"Konum paylaşılamadı: ",LOADING:"Yükleniyor...",HUB_EMPTY:"Konuşma geçmişiniz burada görünecek",HUB_SHOW_EARLIER:"Önceki konuşmaları göster",INBOX_NO_CHATS_TITLE:"Henüz konuşma yok!",INBOX_NO_CHATS_BODY:"Bir veya daha fazla konuşma başlattığınız konuşmalar burada belirecek.",ENABLE_TRANSLATION:"Bu konuşmayı Türkçe'ye çevir",DISABLE_TRANSLATION:"Orijinali göster",SEARCH_PLACEHOLDER_TEXT:"Ara...",SEARCH_SEARCHING:"Arıyor...",SEARCH_NO_RESULTS:"Sonuç bulunamadı",SEARCH_NO_MORE_RESULTS:"Başka sonuç bulunamadı.",CHAT_NOT_FOUND:"Sohbet bulunamadı",DELETE_MESSAGE:"Mesajı sil",DELETION_EXPLANATION:"Bu mesajı silerseniz herkes için görünmez olacaktır.",EDIT_MESSAGE:"Mesajı düzenle",SAVE:"Kaydet",EDITED_INDICATOR:"düzenlenmiş",REPLY_TO_MESSAGE:"Yanıtla",ADD_REACTION:"Tepki ekle",AUTH_EXPIRED_OVERLAY_TITLE:"Sohbet oturumunuz sona erdi",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Devam etmek için sayfayı yenileyin",VOICE_MESSAGE:"Sesli mesaj",CONTACT_INFORMATION_HIDDEN:"Gizli bilgi",LEAVE_CONVERSATION:"Konuşmadan ayrıl",MARK_CONVERSATION_AS_UNREAD:"Okunmamış olarak işaretle",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Wi={code:"uk-UA",name:"Ukrainian (Ukraine)",translation:{YESTERDAY:"Вчора",TODAY:"Сьогодні",DAYS:"d",HOURS:"h",MINUTES:"м",JUST_NOW:"просто зараз",LOCATION:"Місцезнаходження",CANCEL:"Скасувати",INBOX:"Вхідні",DESKTOP_NOTIFICATIONS:"Сповіщення в браузері",DESKTOP_NOTIFICATIONS_ERROR:"Неможливо ввімкнути сповіщення в браузері, оскільки ваш веб-переглядач активно їх блокує. Спробуйте переглянути налаштування або використовувати інший браузер.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`Демо-повідомлення про ${e}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Якщо ви відкриєте вкладку веб-переглядача відкритою, ви побачите це спливаюче вікно, коли хтось спілкується з вами.",SEND_BUTTON_TEXT:"Надіслати",ENTRYBOX_TEXT_LIMIT:"Дозволено лише 10 000 символів.",ENTRYBOX_PLACEHOLDER:"Скажи щось...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ця розмова більше не активна.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Ви можете читати, але не надсилати повідомлення.",MESSAGELIST_LOADING_OLDER:"Завантаження старих повідомлень...",MESSAGELIST_SHOW_OLDER:"Показати старіші повідомлення",MESSAGELIST_NEW_MARKER:"Нові",MESSAGE_SENT_VIA_EMAIL:"Це повідомлення надіслано електронною поштою",YOU_MARKER:"ти",UPLOAD_IN_PROGRESS:"Завантаження...",UPLOAD_SEND_FILE:"Надіслати файл",UPLOAD_SHARE_LOCATION:"Поділитися місцезнаходженням",UPLOAD_ERROR:"На жаль, під час завантаження щось не вдалось. Файл може бути непідтримуваним або занадто великим.",SHARE_LOCATION_ERROR:"Неможливо поділити місцезнаходження: ",LOADING:"Завантаження...",HUB_EMPTY:"Тут відобразиться ваша історія чатів",HUB_SHOW_EARLIER:"Показати попередні чати",INBOX_NO_CHATS_TITLE:"Чатів ще немає!",INBOX_NO_CHATS_BODY:"Після того, як ви проведете одну чи кілька бесід, вони з’являться тут.",ENABLE_TRANSLATION:"Перекласти цю розмову англійською",DISABLE_TRANSLATION:"Показати оригінал",SEARCH_PLACEHOLDER_TEXT:"Пошук...",SEARCH_SEARCHING:"Пошук...",SEARCH_NO_RESULTS:"Не знайдено результатів",SEARCH_NO_MORE_RESULTS:"Більше немає результатів",CHAT_NOT_FOUND:"Чат не знайдено",DELETE_MESSAGE:"Видалити повідомлення",DELETION_EXPLANATION:"Якщо ви видалите це повідомлення, воно зникне для всіх.",EDIT_MESSAGE:"Редагувати повідомлення",SAVE:"Зберегти",EDITED_INDICATOR:"відредаговано",REPLY_TO_MESSAGE:"Відповісти",ADD_REACTION:"Додати реакцію",AUTH_EXPIRED_OVERLAY_TITLE:"Ваша сесія в чаті закінчилась",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Оновіть сторінку, щоб продовжити",VOICE_MESSAGE:"Голосове повідомлення",CONTACT_INFORMATION_HIDDEN:"Прихована інформація",LEAVE_CONVERSATION:"Залишити розмову",MARK_CONVERSATION_AS_UNREAD:"Відзначити як непрочитане",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Xi={code:"vi-VN",name:"Vietnamese",translation:{YESTERDAY:"Hôm qua",TODAY:"Hôm nay",DAYS:"ngày",HOURS:"giờ",MINUTES:"phút",JUST_NOW:"vừa xong",LOCATION:"Địa điểm",CANCEL:"Hủy",INBOX:"Hộp thư đến",DESKTOP_NOTIFICATIONS:"Thông báo trình duyệt",DESKTOP_NOTIFICATIONS_ERROR:"Không thể bật thông báo trên trình duyệt vì trình duyệt của bạn đang tắt chức năng này. Hãy thử tìm trong cài đặt trình duyệt hoặc sử dụng một trình duyệt khác.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} thông báo thử nghiệm`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Nếu bạn giữ tab trình duyệt của bạn mở, bạn sẽ thấy cửa sổ bật lên khi ai đó nói chuyện với bạn.",SEND_BUTTON_TEXT:"Gửi",ENTRYBOX_TEXT_LIMIT:"Tối đa 10.000 ký tự.",ENTRYBOX_PLACEHOLDER:"Nói gì đó...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Cuộc hội thoại này không còn hoạt động.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Bạn có thể đọc, nhưng không thể gửi tin nhắn.",MESSAGELIST_LOADING_OLDER:"Đang tải tin nhắn cũ...",MESSAGELIST_SHOW_OLDER:"Hiển thị tin nhắn trước đó",MESSAGELIST_NEW_MARKER:"Mới",MESSAGE_SENT_VIA_EMAIL:"Tin nhắn này đã được gửi qua email",YOU_MARKER:"bạn",UPLOAD_IN_PROGRESS:"Đang tải lên...",UPLOAD_SEND_FILE:"Gửi tệp",UPLOAD_SHARE_LOCATION:"Chia sẻ vị trí",UPLOAD_ERROR:"Thật không may, quá trình tải lên không thành công. Tệp không được hỗ trợ hoặc quá lớn.",SHARE_LOCATION_ERROR:"Không thể chia sẻ vị trí: ",LOADING:"Đang tải...",HUB_EMPTY:"Lịch sử trò chuyện của bạn sẽ hiển thị ở đây",HUB_SHOW_EARLIER:"Hiển thị các cuộc trò chuyện trước đó",INBOX_NO_CHATS_TITLE:"Chưa có cuộc trò chuyện nào!",INBOX_NO_CHATS_BODY:"Khi bạn đã có một hoặc nhiều cuộc trò chuyện, chúng sẽ hiển thị ở đây.",ENABLE_TRANSLATION:"Dịch cuộc hội thoại sang Tiếng Việt",DISABLE_TRANSLATION:"Hiển thị nội dung gốc",SEARCH_PLACEHOLDER_TEXT:"TÌm kiếm...",SEARCH_SEARCHING:"Đang tìm kiếm...",SEARCH_NO_RESULTS:"Không tìm thấy kết quả nào",SEARCH_NO_MORE_RESULTS:"Không có kết quả nào khác",CHAT_NOT_FOUND:"Không tìm thấy cuộc trò chuyện",DELETE_MESSAGE:"Xóa tin nhắn",DELETION_EXPLANATION:"Nếu bạn xóa tin nhắn này, tất cả mọi người sẽ không còn thấy nó.",EDIT_MESSAGE:"Chỉnh sửa tin nhắn",SAVE:"lưu",EDITED_INDICATOR:"đã chỉnh sửa",REPLY_TO_MESSAGE:"đáp lại",ADD_REACTION:"Thêm biểu tượng cảm xúc",AUTH_EXPIRED_OVERLAY_TITLE:"Phiên trò chuyện của bạn đã hết hạn",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Hãy làm mới trang để tiếp tục",VOICE_MESSAGE:"Tin nhắn thoại",CONTACT_INFORMATION_HIDDEN:"Thông tin ẩn",LEAVE_CONVERSATION:"Thoát khỏi cuộc trò chuyện",MARK_CONVERSATION_AS_UNREAD:"Đánh dấu là chưa đọc",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ki={code:"zh-CN",name:"Chinese (Simplified)",translation:{YESTERDAY:"昨天",TODAY:"今天",DAYS:"天",HOURS:"小时",MINUTES:"分钟",JUST_NOW:"刚才",LOCATION:"地点",CANCEL:"取消",INBOX:"收件箱",DESKTOP_NOTIFICATIONS:"浏览器通知",DESKTOP_NOTIFICATIONS_ERROR:"因浏览器设置为阻止,所以无法激活浏览器提醒。请去设置里查看或者尝试其他的浏览器。",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} 演示提醒`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"只要保持浏览器开着,如果有人和你对话,将会自动弹出对话窗口。",SEND_BUTTON_TEXT:"发送",ENTRYBOX_TEXT_LIMIT:"不超过10,000个字符。",ENTRYBOX_PLACEHOLDER:"写点什么吧……",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"该对话已结束。",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"你只能阅读信息,不能发送信息。",MESSAGELIST_LOADING_OLDER:"载入之前的信息……",MESSAGELIST_SHOW_OLDER:"显示之前的信息",MESSAGELIST_NEW_MARKER:"新消息",MESSAGE_SENT_VIA_EMAIL:"该信息已通过邮件发送。",YOU_MARKER:"你",UPLOAD_IN_PROGRESS:"上传中……",UPLOAD_SEND_FILE:"发送文件",UPLOAD_SHARE_LOCATION:"分享地址",UPLOAD_ERROR:"上传出错。文件格式不支持或者太大。",SHARE_LOCATION_ERROR:"无法分享地址: ",LOADING:"正在载入……",HUB_EMPTY:"你的聊天记录将在此显示。",HUB_SHOW_EARLIER:"显示之前的聊天记录。",INBOX_NO_CHATS_TITLE:"暂无任何聊天记录!",INBOX_NO_CHATS_BODY:"如果你有一个或多个对话窗口进行中,将显示在这里。",ENABLE_TRANSLATION:"翻译至简体中文",DISABLE_TRANSLATION:"查看原文",SEARCH_PLACEHOLDER_TEXT:"搜索...",SEARCH_SEARCHING:"正在搜索...",SEARCH_NO_RESULTS:"未找到结果",SEARCH_NO_MORE_RESULTS:"无更多结果",CHAT_NOT_FOUND:"未找到“聊天”",DELETE_MESSAGE:"删除消息",DELETION_EXPLANATION:"如果您删除此消息,那么所有人都将无法再看到它。",EDIT_MESSAGE:"编辑消息",SAVE:"保存",EDITED_INDICATOR:"本消息有改动",REPLY_TO_MESSAGE:"回复",ADD_REACTION:"添加反应",AUTH_EXPIRED_OVERLAY_TITLE:"您的聊天会话已过期",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"刷新页面以继续",VOICE_MESSAGE:"语音消息",CONTACT_INFORMATION_HIDDEN:"隐藏信息",LEAVE_CONVERSATION:"离开对话",MARK_CONVERSATION_AS_UNREAD:"标记为未读",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},qi={code:"zh-TW",name:"Chinese (Traditional)",translation:{YESTERDAY:"昨天",TODAY:"昨天",DAYS:"天",HOURS:"小時",MINUTES:"分",JUST_NOW:"現在",LOCATION:"地點",CANCEL:"取消",INBOX:"收件箱",DESKTOP_NOTIFICATIONS:"瀏覽器通知",DESKTOP_NOTIFICATIONS_ERROR:"無法啟用瀏覽器通知,因為您的瀏覽器主動阻止它們。 嘗試查看設置或使用其他瀏覽器。",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} 演示通知`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"如果您持續打開瀏覽器標籤頁,當有人與您通話時,您會看到此彈出窗口。",SEND_BUTTON_TEXT:"發送",ENTRYBOX_TEXT_LIMIT:"只允許10.000個字符。",ENTRYBOX_PLACEHOLDER:"說些什麼...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"此對話不再有效。",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"您可以閱讀,但不能發送消息。",MESSAGELIST_LOADING_OLDER:"加載舊訊息...",MESSAGELIST_SHOW_OLDER:"顯示較舊的訊息",MESSAGELIST_NEW_MARKER:"新的",MESSAGE_SENT_VIA_EMAIL:"此訊息是通過電郵發送的",YOU_MARKER:"您",UPLOAD_IN_PROGRESS:"上傳中...",UPLOAD_SEND_FILE:"發送文件",UPLOAD_SHARE_LOCATION:"共享位置",UPLOAD_ERROR:"不幸的是,上傳出了問題。 該文件可能不受支持或太大。",SHARE_LOCATION_ERROR:"無法分享位置:",LOADING:"載入中...",HUB_EMPTY:"您的聊天記錄將顯示在此處",HUB_SHOW_EARLIER:"顯示早先的聊天記錄",INBOX_NO_CHATS_TITLE:"還沒聊天!",INBOX_NO_CHATS_BODY:"一旦您進行了一次或多次對話,他們就會顯示在此處。",ENABLE_TRANSLATION:"翻譯此對話至繁體中文",DISABLE_TRANSLATION:"顯示原文",SEARCH_PLACEHOLDER_TEXT:"搜尋...",SEARCH_SEARCHING:"正在搜尋...",SEARCH_NO_RESULTS:"找不到任何結果",SEARCH_NO_MORE_RESULTS:"沒有其他結果",CHAT_NOT_FOUND:"查無對話",DELETE_MESSAGE:"刪除訊息",DELETION_EXPLANATION:"您如果刪除這條訊息,所有人都將看不到它。",EDIT_MESSAGE:"編輯訊息",SAVE:"儲存",EDITED_INDICATOR:"已編輯",REPLY_TO_MESSAGE:"回覆",ADD_REACTION:"加入表情回應",AUTH_EXPIRED_OVERLAY_TITLE:"您的會話過程已過期",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"請刷新頁面以繼續",VOICE_MESSAGE:"語音訊息",CONTACT_INFORMATION_HIDDEN:"隱藏訊息",LEAVE_CONVERSATION:"離開對話",MARK_CONVERSATION_AS_UNREAD:"標記為未讀",REPLY_TO_ARIA_LABEL:Ei.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:Ei.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:Ei.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:Ei.translation.STATUS_INDICATOR_OFFLINE}},Ji={ar:gi,bg:_i,bs:Ai,ca:{code:"ca-ES",name:"Catalan (ES)",translation:{YESTERDAY:"Ahir",TODAY:"Avui",DAYS:"d",HOURS:"h",MINUTES:"m",JUST_NOW:"ara mateix",LOCATION:"Ubicació",CANCEL:"Cancel·lar",INBOX:"Safata d'entrada",DESKTOP_NOTIFICATIONS:"Notificacions d'escriptori",DESKTOP_NOTIFICATIONS_ERROR:"No es poden habilitar les notificacions del navegador perquè el teu navegador les bloqueja activament. Prova de buscar a la configuració o utilitza un altre navegador.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`Notificació de demostració de ${e}`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Si mantens la pestanya del navegador oberta, veuràs aquesta notificació quan algú et parli.",SEND_BUTTON_TEXT:"Enviar",ENTRYBOX_TEXT_LIMIT:"Només es permeten 10.000 caràcters.",ENTRYBOX_PLACEHOLDER:"Digues alguna cosa...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Aquesta conversa ja no està activa.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Pots llegir, però no enviar missatges.",MESSAGELIST_LOADING_OLDER:"Carregant missatges antics...",MESSAGELIST_SHOW_OLDER:"Mostrar missatges més antics",MESSAGELIST_NEW_MARKER:"Nou",MESSAGE_SENT_VIA_EMAIL:"Aquest missatge s'ha enviat per correu electrònic",YOU_MARKER:"tu",UPLOAD_IN_PROGRESS:"S'està pujant...",UPLOAD_SEND_FILE:"Enviar arxiu",UPLOAD_SHARE_LOCATION:"Compartir ubicació",UPLOAD_ERROR:"Desafortunadament, alguna cosa ha anat malament en pujar. L'arxiu pot ser no compatible o massa gran.",SHARE_LOCATION_ERROR:"No es pot compartir la ubicació: ",LOADING:"Carregant...",HUB_EMPTY:"El teu historial de xat apareixerà aquí",HUB_SHOW_EARLIER:"Mostra xats anteriors",INBOX_NO_CHATS_TITLE:"Encara no hi ha xats!",INBOX_NO_CHATS_BODY:"Un cop hagis tingut una o més converses, apareixeran aquí.",ENABLE_TRANSLATION:"Traduir aquesta conversa al català",DISABLE_TRANSLATION:"Mostrar original",SEARCH_PLACEHOLDER_TEXT:"Cerca...",SEARCH_SEARCHING:"Buscant...",SEARCH_NO_RESULTS:"No s'han trobat resultats",SEARCH_NO_MORE_RESULTS:"No hi ha més resultats",CHAT_NOT_FOUND:"Xat no trobat",DELETE_MESSAGE:"Esborrar missatge",DELETION_EXPLANATION:"Si esborres aquest missatge, desapareixerà per a tothom.",EDIT_MESSAGE:"Editar missatge",SAVE:"Desar",EDITED_INDICATOR:"editat",REPLY_TO_MESSAGE:"Respondre",REPLY_TO_ARIA_LABEL:(e,t)=>`Responent a ${e}: ${t}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Sortir del mode de resposta",ADD_REACTION:"Afegir reacció",VOICE_MESSAGE:"Missatge de veu",LEAVE_CONVERSATION:"Abandonar la conversa",MARK_CONVERSATION_AS_UNREAD:"marcar com no llegit",STATUS_INDICATOR_ONLINE:"Actiu",STATUS_INDICATOR_OFFLINE:"Absent",CONTACT_INFORMATION_HIDDEN:"informació oculta",AUTH_EXPIRED_OVERLAY_TITLE:"La teva sessió de xat ha caducat",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Actualitza la pàgina per continuar"}},cs:Di,da:vi,de:Oi,el:Ti,en:Ei,es:Si,et:yi,fa:Ci,fi:Ni,fr:bi,he:Ii,hi:Ri,hr:wi,hu:ki,id:Li,is:{code:"is-IS",name:"Íslenska",translation:{YESTERDAY:"Í gær",TODAY:"Í dag",DAYS:"dagar",HOURS:"klst.",MINUTES:"mín.",JUST_NOW:"núna",LOCATION:"Staðsetning",CANCEL:"Hætta við",INBOX:"Pósthólf",DESKTOP_NOTIFICATIONS:"Tilkynningar í vafra",DESKTOP_NOTIFICATIONS_ERROR:"Ekki er hægt að birta tilkynningar í vafra vegna þess að vafrinn sem þú notar hindrar það. Reyndu að leita að stillingum eða að nota annan vafra.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} prufutilkynning`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ef flipinn í vafranum er opinn muntu sjá þessa tilkynningu birtast þegar einhver sendir þér skilaboð.",SEND_BUTTON_TEXT:"Senda",ENTRYBOX_TEXT_LIMIT:"Aðeins 10.000 stafir komast fyrir.",ENTRYBOX_PLACEHOLDER:"Segðu eitthvað...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Þessar samræður eru ekki lengar virkar.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Þú getur lesið, en ekki sent skilaboð.",MESSAGELIST_LOADING_OLDER:"Sæki eldri skilaboð...",MESSAGELIST_SHOW_OLDER:"Sýna eldri skilaboð",MESSAGELIST_NEW_MARKER:"Ný",MESSAGE_SENT_VIA_EMAIL:"Þessi skilaboð voru send með tölvupósti",YOU_MARKER:"þú",UPLOAD_IN_PROGRESS:"Hleð upp...",UPLOAD_SEND_FILE:"Senda skrá",UPLOAD_SHARE_LOCATION:"Deila staðsetningu",UPLOAD_ERROR:"Því miður fór eitthvað úrskeiðis við að hlaða upp. Skráin gæti verið af rangri tegund eð of stór.",SHARE_LOCATION_ERROR:"Ekki er hægt að deila staðsetningu: ",LOADING:"Hleð...",HUB_EMPTY:"Fyrri samtöl munu birtast hér",HUB_SHOW_EARLIER:"Sýna fyrri samtöl",INBOX_NO_CHATS_TITLE:"Engin samtöl enn!",INBOX_NO_CHATS_BODY:"Þegar þú hefur átt eitt eða fleiri samtöl, munu þau birtast hér.",ENABLE_TRANSLATION:"Þýða þetta samtal á ensku",DISABLE_TRANSLATION:"Sýna upprunalegt",SEARCH_PLACEHOLDER_TEXT:"Leita...",SEARCH_SEARCHING:"Leita...",SEARCH_NO_RESULTS:"Ekkert fannst",SEARCH_NO_MORE_RESULTS:"Engar fleiri niðurstöður",CHAT_NOT_FOUND:"Samtal fannst ekki",DELETE_MESSAGE:"Eyða skilaboðum",DELETION_EXPLANATION:"Ef þú eyðir þessum skilaboðum munu þau hverfa hjá öllum.",EDIT_MESSAGE:"Breyta skilaboðum",SAVE:"Vista",EDITED_INDICATOR:"breytt",REPLY_TO_MESSAGE:"Svara",REPLY_TO_ARIA_LABEL:(e,t)=>`Svara ${e}: ${t}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Fara úr svari",ADD_REACTION:"Setja inn viðbrögð",AUTH_EXPIRED_OVERLAY_TITLE:"Spjallið hefur runnið út",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Endurnýjaðu síðuna til að halda áfram",VOICE_MESSAGE:"Raddskilaboð",LEAVE_CONVERSATION:"Skilja eftir skilaboð",MARK_CONVERSATION_AS_UNREAD:"Merkja sem ólesið",STATUS_INDICATOR_ONLINE:"Virk",STATUS_INDICATOR_OFFLINE:"Ekki við",CONTACT_INFORMATION_HIDDEN:"faldar upplýsingar"}},it:xi,ja:Mi,ka:Fi,ko:Bi,nb:Pi,nl:Ui,pl:Hi,pt:ji,ro:$i,ru:Yi,sq:zi,sr:{code:"sr-SP",name:"Serbian",translation:{YESTERDAY:"Juče",TODAY:"Danas",DAYS:"d",HOURS:"s",MINUTES:"m",JUST_NOW:"Upravo sad",LOCATION:"Lokacija",CANCEL:"Otkaži",INBOX:"Pretinac",DESKTOP_NOTIFICATIONS:"Browser Notifikacija",DESKTOP_NOTIFICATIONS_ERROR:"Browser notifikacije nisu omogućene jer ih vaš pregledač aktivno blokira. Pokušajte pogledati postavke ili koristiti neki drugi pregledač.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:e=>`${e} demo notifikacija`,DESKTOP_NOTIFICATIONS_DEMO_BODY:"Ako karticu pregledača ostavite otvorenu, pojaviće se ovaj pop-up kada neko razgovara s vama.",SEND_BUTTON_TEXT:"Pošalji",ENTRYBOX_TEXT_LIMIT:"Dozvoljeno je samo 10.000 znakova.",ENTRYBOX_PLACEHOLDER:"Kaži nešto...",ENTRYBOX_PLACEHOLDER_CHAT_CLOSED:"Ovaj razgovor više nije aktivan.",ENTRYBOX_PLACEHOLDER_CHAT_READONLY:"Možete da čitate, ali ne i da šaljete poruke.",MESSAGELIST_LOADING_OLDER:"Učitavam starije poruke...",MESSAGELIST_SHOW_OLDER:"Prikaži starije poruke",MESSAGELIST_NEW_MARKER:"Novo",MESSAGE_SENT_VIA_EMAIL:"Ova poruka je poslana imejlom",YOU_MARKER:"ti",UPLOAD_IN_PROGRESS:"Učitavam...",UPLOAD_SEND_FILE:"Pošalji datoteku",UPLOAD_SHARE_LOCATION:"Podeli lokaciju",UPLOAD_ERROR:"Nažalost, nešto je pošlo krivo. Datoteka možda nije podržana ili je prevelika.",SHARE_LOCATION_ERROR:"Nije moguće podeliti lokaciju: ",LOADING:"Učitavam...",HUB_EMPTY:"Ovde će biti prikazana istorija razgovora",HUB_SHOW_EARLIER:"Prikaži ranije razgovore",INBOX_NO_CHATS_TITLE:"Nema razgovora!",INBOX_NO_CHATS_BODY:"Nakon što vodite jedan ili više razgovora, oni će se pojaviti ovde.",ENABLE_TRANSLATION:"Prevedi ovaj razgovor na srpski jezik",DISABLE_TRANSLATION:"Prikaži original",SEARCH_PLACEHOLDER_TEXT:"Pretraži...",SEARCH_SEARCHING:"Pretraživanje...",SEARCH_NO_RESULTS:"Nema rezultata",SEARCH_NO_MORE_RESULTS:"Nema više rezultata",CHAT_NOT_FOUND:"Ćaskanje nije pronađeno",DELETE_MESSAGE:"Izbriši poruku",DELETION_EXPLANATION:"Ako obrišete ovu poruku, ona neće biti vidljiva ni za koga.",EDIT_MESSAGE:"Ispravi poruku",SAVE:"Sačuvaj",EDITED_INDICATOR:"ispravljeno",REPLY_TO_MESSAGE:"Odgovorite",ADD_REACTION:"Dodaj reakciju",AUTH_EXPIRED_OVERLAY_TITLE:"Vaša sesija ćaskanja je istekla",AUTH_EXPIRED_OVERLAY_DESCRIPTION:"Osvežite stranicu da biste nastavili",VOICE_MESSAGE:"Glasovna poruka",CONTACT_INFORMATION_HIDDEN:"Sakrivene informacije",LEAVE_CONVERSATION:"Napusti razgovor",MARK_CONVERSATION_AS_UNREAD:"Označi kao nepročitanu",REPLY_TO_ARIA_LABEL:(e,t)=>`Odgovarate korisniku ${e}: ${t}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Izađi iz moda pisanja odgovora",STATUS_INDICATOR_ONLINE:"Aktivan",STATUS_INDICATOR_OFFLINE:"Neaktivan"}},sv:Vi,tr:Gi,uk:Wi,vi:Xi,zh:Ki,zhTw:qi},Zi={canReplyToMessage:!1,canDeleteMessage:!1};class Qi{constructor(){this.messageSubscription=null,this.readyForNewMessagesPromise=Promise.resolve(),this.participantSubscription=null,this.onlineSubscriptions={},this.state$=Cr({extUserId:null,extCurrentConversationId:null,appId:null,editor:{isEmpty:!0,isTyping:!1,atTextLimit:!1,characterCount:0,showEmojiPicker:!1},referencedMessageId:null,currentUser:null,currentConversation:null,app:null,device:null,errors:{unknownConversation:!1,unknownUser:!1,wrongAppId:!1,serverError:!1},messages:{},participants:{},typing:{},isUserConnected:{},ephemeralMessages:{},ephemeralMessageIdMapping:{},localFileBlobUrls:{},authTokenState:"idle",userPermissions:()=>{const e=this.state$.app.role.general.get(),t=this.state$.app.role.permissions.get();return ii.defined(e),ii.defined(t),{showTypingIndicator:e.showTypingIndicators,canShareFile:e.enableFileTransfers,canShareLocation:e.enableLocation,canMention:e.enableMentions,showOnlineStatus:!1!==e.enablePresence,canSendVoiceMessage:e.enableVoiceRecording,canLeaveConversation:"all"===t.conversations.leave,canMarkConversationAsUnread:"all"===t.conversations.markAsUnread}},messagePermissions:()=>{const e=this.state$.app.role.permissions.get();ii.defined(e);const t=this.state$.userPermissions.get();return{system:{...Zi,...t},own:{canReplyToMessage:eo(e.messages.reply,!0),canDeleteMessage:eo(e.messages.delete,!0),...t},other:{canReplyToMessage:eo(e.messages.reply,!1),canDeleteMessage:eo(e.messages.delete,!1),...t}}},themeCustom:gn({value:void 0})}),this.locale$=Cr((()=>{const e=this.state$.extUserId.get(),t=this.state$.app.appMetadata.defaultLocale.get(),n=this.state$.currentUser.locale.get();return(e&&n)??t??"en-US"})),this.t$=Cr((()=>function(e){const t=e.replace(/_/g,"-").toLowerCase(),n=Ji[t];if(n)return{...n.translation,locale:t};const r=t.slice(0,2),i=Ji[r];return i?{...i.translation,locale:r}:(mi.warn(`User locale '${e}' not supported; falling back to English.`),{...Ei.translation,locale:"en-US"})}(this.locale$.get()))),this.referencedMessage$=Cr((()=>{const e=this.state$.extCurrentConversationId.get(),t=this.state$.referencedMessageId.get();return e&&t?this.state$.messages.child(e).lookup.child(t).get():null})),this.chatItems$=Cr((()=>{const e=this.state$.extCurrentConversationId.get();if(!e)return[];const t=this.state$.currentConversation.readUntil.get(),n=this.state$.messages.child(e).state.get()??[],r=Object.values(this.state$.ephemeralMessages.child(e).get()??{}),i=0===r.length?n:r.concat(n).sort(((e,t)=>t.createdAt-e.createdAt)),o=i.map((t=>{const n=t.content[0],r=n?.type;if(!n||"file"!==r)return t;const i=n.size+","+n.filename,o=this.state$.localFileBlobUrls.child(e).child(i).url.get();return o?{...t,content:[{...n,url:o}]}:t}));let s=null,a=0,u=!1;const l=[];for(const c of o){const e=new Date(c.createdAt),n=new Date(e).setHours(0,0,0,0),r=a&&n!==a,i=e.getTime()>t,o=!(!u||i||s?.id.startsWith("ephemeral"));(o||r)&&l.push(new to({id:"border-before-"+c.id,isDayMarker:!!r,isReadMarker:!!o,timestamp:r?a:void 0})),l.push(c),u=i,a=n,s=c}return function(e,t){const n=[];let r=[];const i=Symbol("NO_KEY");let o=i;for(const s of e){const e=t(s);o===i||o===e?r.push(s):(n.push(r),r=[s]),o=e}return 0!==r.length&&n.push(r),n}(l,(e=>e instanceof to?e.id:e.sender?.id)).map((e=>(e.id=e.map((e=>e.id)).join(","),e)))}))}resetState(e,t,n){this.state$.assign({referencedMessageId:null,errors:{unknownConversation:!1,unknownUser:!1,wrongAppId:!1,serverError:!1},extUserId:t,extCurrentConversationId:n,appId:e,currentUser:null,currentConversation:null})}storeTyping(e,t){this.state$.typing.child(e).set(t)}userPermissions$(){return this.state$.userPermissions}messagePermissions$(e){const t=this.state$.currentUser.get();if(!t)throw new Error("Unreachable");return e.sender?t.id===e.sender.id?this.state$.messagePermissions.own:this.state$.messagePermissions.other:this.state$.messagePermissions.system}storeMessages(e,t,n){Mn((()=>{const r=t.reduce(((e,t)=>(e[t.id]=t,e)),{}),i=this.state$.extCurrentConversationId.peek(),o=this.state$.extUserId.peek();ii(o&&i),this.state$.messages.child(e).set({state:t,lookup:r,loadedAll:n});const s=this.state$.ephemeralMessages.child(e);for(const n of t){const t=this.state$.ephemeralMessageIdMapping.child(e).child(n.id).peek();t&&s.child(t).delete();const r=n.content[0];if(n.sender?.id!==o||"file"!==r.type)continue;const a=r.size+","+r.filename,u=this.state$.localFileBlobUrls.child(i).child(a);if(!1!==u.fetching.peek())continue;const l=()=>u.delete();if("image"===r.subtype){u.fetching.set(!0);const e=document.createElement("img");e.addEventListener("load",l,{once:!0}),e.src=r.url}else if("video"===r.subtype){u.fetching.set(!0);const e=document.createElement("video");e.addEventListener("loaddata",l,{once:!0}),e.src=r.url}else if("audio"===r.subtype){u.fetching.set(!0);const e=document.createElement("audio");e.addEventListener("loaddata",l,{once:!0}),e.src=r.url}}}))}messageStatus(e){const t=this.state$.extCurrentConversationId.get(),n=this.state$.messages.child(t).lookup.child(e).get(),r=this.state$.ephemeralMessages.child(t).child(e).get();if(ii(n||r,"Message ID should be present in the store"),n){const e=this.state$.currentConversation.everyoneReadUntil.peek();return n.createdAt<=e?"everyoneRead":"sent"}return"sending"}}function eo(e,t){return"all"===e||"own"===e&&t||"other"===e&&!t}class to{constructor({id:e,isDayMarker:t,isReadMarker:n,timestamp:r}){this.id=e,this.isDayMarker=t,this.isReadMarker=n,this.timestamp=t?r:void 0}}function no({extConversationId:e,controller:t}){const n=ci(),r=si(),i=le(!0),o=le(null);ue((()=>{i.current=o.current.scrollTop>-30})),ae((()=>{i.current&&(o.current.scrollTop=0)}));const s=he((e=>{const t=e.currentTarget;t.scrollHeight-t.clientHeight+t.scrollTop<90&&n.messageSubscription&&n.messageSubscription.loadMore(10)}),[n.messageSubscription]),a=Yr(n.state$.typing.child(e));return bt("div",{className:"t-message-list",ref:o,"t-menu-boundary":"",onScroll:s,children:[a&&bt(r.MessageListFooter,{typing:a,t:n.t$.get(),conversation:n.state$.currentConversation.get(),currentUser:n.state$.currentUser.get(),participants:n.state$.participants.child(e).get(),chatbox:t,themeCustom:n.state$.themeCustom.get().value}),bt(Jr,{each:n.chatItems$,children:n=>bt("div",{className:"t-message-group",children:bt(Jr,{each:n,item:ro,itemProps:{controller:t,extConversationId:e}})})})]})}function ro({item$:e,controller:t,extConversationId:n}){const r=si(),i=ci(),o=Yr(e);return bt(zr,o instanceof to?{children:()=>bt(r.MessageDivider,{timestamp:o.timestamp,isReadMarker:o.isReadMarker,isDayMarker:o.isDayMarker,app:i.state$.app.appMetadata.get(),currentUser:i.state$.currentUser.get(),conversation:i.state$.currentConversation.get(),t:i.t$.get(),themeCustom:i.state$.themeCustom.get().value})}:{children:()=>bt(r.Message,{app:i.state$.app.appMetadata.get(),currentUser:i.state$.currentUser.get(),message:o,messageStatus:i.messageStatus(o.id),conversation:i.state$.currentConversation.get(),participants:i.state$.participants.child(n).get(),t:i.t$.get(),permissions:i.messagePermissions$(o).get(),chatbox:t,themeCustom:i.state$.themeCustom.get().value,device:i.state$.device.get()})})}function io(){const e=ci(),t=si(),n=Yr(e.t$),r=Yr(e.state$.themeCustom).value;return bt(t.Icon,{type:"spinner","aria-label":n.LOADING,className:"t-loading-icon",themeCustom:r})}const oo=new Set(["ByV39eoc","B1FxElnd","aW4c49tW","qGfuGtx","SbERe5ee","ilaVEa15","FOlWOSaH","dao5gGmT","DLUgAhzL","fqXFumr6","FtiWHMYT","66iWOyWt","1375amYi","mWbJgzpt","jO7GqAvL","SkFIKxo5","2z4ILc3y","aDr8oPL1","Hku1c4Pt"]);function so({appId:e,chatboxState:t}){const n="t"===e.charAt(0)||oo.has(e);return ae((()=>{switch(t.type){case"auth-failed":mi.error("Could not authenticate user. Check if you are authenticating correctly.");break;case"unknown-user":mi.error(`User \`${t.userId}\` not found. Please verify that you synchronized this user's data with TalkJS, either using the JS SDK or through the REST API.`);break;case"unexpected-error":mi.error(t.error);break;case"wrong-app-id":mi.error(`Could not find given appId: "${t.appId}". You can find your appId on https://talkjs.com/dashboard.`);break;case"server-error":break;default:ii.never(t)}}),[t]),bt("div",{className:"t-panel t-error-panel",children:[bt("span",{className:"t-heading",children:"Something went wrong."}),bt("p",{children:"Please reload the page and try again."}),bt("p",n?{style:{fontStyle:"italic"},children:["Developer note: check your browser's developer tools console for messages that may help solve the problem.",bt("br",{}),bt("small",{children:"This message only shows up in test mode."})]}:{children:"If things keep not working, do not hesitate to get in touch with us."})]})}function ao({t:e}){return bt("div",{className:"t-panel t-error-panel",children:bt("span",{className:"t-heading",style:{fontStyle:"italic"},children:e.CHAT_NOT_FOUND})})}function uo(){return bt("div",{className:"t-panel t-loading-panel",children:bt(io,{})})}function lo({t:e}){return bt("div",{className:"t-panel t-error-panel",children:[bt("span",{className:"t-heading",style:{fontStyle:"italic"},children:e.AUTH_EXPIRED_OVERLAY_TITLE}),bt("p",{children:e.AUTH_EXPIRED_OVERLAY_DESCRIPTION})]})}class co{constructor(e,t,n,r,i){this.send=t,this.attachFile=n,this.shareLocation=r,this.toggleEmojiPicker=i,this.isEmpty=e.isEmpty,this.isTyping=e.isTyping,this.atTextLimit=e.atTextLimit,this.characterCount=e.characterCount,this.showEmojiPicker=e.showEmojiPicker}}var ho={};function po(e){return String.fromCharCode(parseInt(e.slice(1),16))}Object.defineProperty(ho,"__esModule",{value:!0});var fo=ho.encode=function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,po))};function mo(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}ho.decode=function(e){return decodeURIComponent(Array.from(atob(e),mo).join(""))};const Eo=/[^a-zA-Z\u00C0-\u024F\u1E00-\u1EFF\u0400-\u044f\u0300-\u036e]+/;function go(e){const t=function(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}(e)%Oo.length;return Oo[t]}function _o(e,t){const n=t.lastIndex;let r;const i=[];for(;null!==(r=t.exec(e));)i.push(r);return t.lastIndex=n,i}function Ao(e,t,n){let r=0;const i=[];for(const o of t)o.offset<r||(o.offset>r&&i.push(e.substring(r,o.offset)),i.push(...n(o)),r=o.offset+o.matchedText.length);return r<e.length&&i.push(e.substring(r)),i}function Do(e){{const t=document.createElement("a");return t.href=e,t.hostname}}function vo(e){const t=e.replace(/%2F/g,"/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/,"$1");return decodeURIComponent(t)}const Oo=["#996666","#9A6E61","#8D7662","#8E775E","#948771","#8A8360","#888D65","#6F8E63","#749378","#678975","#779E86","#639A8F","#6D92A1","#65869F","#697E9A","#736C9F","#8C6495","#956387","#B05D54","#B16D52","#AF8751","#AC8A56","#B7A458","#B5B35C","#83AA5D","#4F9D5D","#5FA777","#66B58F","#5FB3AC","#589AAF","#4E7F9E","#456CAC","#6456B7","#714AB2","#9771B5","#C154C1","#B05E81","#B04C6A","#B94E48","#AF593E","#C5994B","#B8C25D","#87AB39","#4FA83D","#40A860","#41AA78","#3AB09E","#3FC1AA","#56B4BE","#3EABBF","#4682B4","#7A58C1","#9966CC","#C54B8C","#B44668","#AE4560","#A3807B","#AB917A","#ACA586","#A8AF8E","#9EA587","#8BA690","#7DA98D","#7CB0A1","#8BA9A5","#7CA1A6","#859FAF","#8D90A1","#A397B4","#AE809E","#C08081","#BB8983","#B19461","#B5A27F","#B8B56A","#9AB973","#7AC488","#7CB7BB","#80B3C4","#788BBA","#7A89B8","#9678B6","#CB8FA9","#B57281","#C6726B","#C88A65","#C2955D","#C8B568","#B9C46A","#74C365","#6FD0C5","#6093D1","#7666C6","#D06DA1"],To=()=>!0;async function So(e,t,{initialDelay:n,maxDelay:r,log:i,shouldRetry:o=To}){return t().catch((async s=>{if(i&&i(`[TalkJS] Retries left: ${e}. Error: ${JSON.stringify(s)}.`),0===e)throw s;if(!(await o(s)))throw s;const a=1e3*n*1.2,u=(r?Math.min(1e3*r,a):a)*(1-.05+2*Math.random()*.05);return function(e){return e<=0?Promise.resolve():new Promise((t=>setTimeout(t,e)))}(u).then((()=>So(e-1,t,{initialDelay:u/1e3,maxDelay:r,log:i,shouldRetry:o})))}))}function yo(){const e={},t=new Promise((function(t,n){e.resolve=t,e.reject=n}));return e.promise=t,e}function Co(e,t,n){const{beforeBrowserPermissionPrompt:r,onMissingBrowserPermissionCallback:i}=pe(di);return he((async()=>{function n(t){"denied"===t&&i({type:e})}if(!r||!(await async function(e){if(!("permissions"in navigator))return!1;const t=e;try{return"prompt"===(await navigator.permissions.query({name:t})).state}catch(e){return!1}}(e)))return t((e=>{n(e)}));const o=yo(),s=yo(),a={type:e,showPrompt:async()=>(s.resolve({cancelled:!1}),await o.promise),cancel:()=>{s.resolve({cancelled:!0})}};try{r(a)}catch(e){mi.error("Your beforeBrowserPermissionPrompt callback threw an error: ",e),s.resolve({cancelled:!0})}const{cancelled:u}=await s.promise;return u?void 0:t((e=>{o.resolve(e),n(e)}))}),[r,i,e,t,...n])}async function No(e,t,n){const r=document.createElement(e);try{return r.src=URL.createObjectURL(t),await new Promise(((t,i)=>{const o="img"===e?"load":"loadedmetadata";r.addEventListener(o,(()=>{try{t(n(r))}catch(e){i(e)}}),{once:!0})}))}finally{URL.revokeObjectURL(r.src)}}var bo=function(e,t,n,r){var i;t[0]=0;for(var o=1;o<t.length;o++){var s=t[o++],a=t[o]?(t[0]|=s?1:2,n[t[o++]]):t[++o];3===s?r[0]=a:4===s?r[1]=Object.assign(r[1]||{},a):5===s?(r[1]=r[1]||{})[t[++o]]=a:6===s?r[1][t[++o]]+=a+"":s?(i=e.apply(a,bo(e,a,n,["",null])),r.push(i),a[0]?t[0]|=2:(t[o-2]=0,t[o]=i)):r.push(a)}return r},Io=new Map;function Ro(e){var t=Io.get(this);return t||(t=new Map,Io.set(this,t)),(t=bo(this,t.get(e)||(t.set(e,t=function(e){for(var t,n,r=1,i="",o="",s=[0],a=function(e){1===r&&(e||(i=i.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?s.push(0,e,i):3===r&&(e||i)?(s.push(3,e,i),r=2):2===r&&"..."===i&&e?s.push(4,e,0):2===r&&i&&!e?s.push(5,0,!0,i):r>=5&&((i||!e&&5===r)&&(s.push(r,0,i,n),r=6),e&&(s.push(r,e,0,n),r=6)),i=""},u=0;u<e.length;u++){u&&(1===r&&a(),a(u));for(var l=0;l<e[u].length;l++)t=e[u][l],1===r?"<"===t?(a(),s=[s],r=3):i+=t:4===r?"--"===i&&">"===t?(r=1,i=""):i=t+i[0]:o?t===o?o="":i+=t:'"'===t||"'"===t?o=t:">"===t?(a(),r=1):r&&("="===t?(r=5,n=i,i=""):"/"===t&&(r<5||">"===e[u][l+1])?(a(),3===r&&(s=s[0]),r=s,(s=s[0]).push(2,0,r),r=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),r=2):i+=t),3===r&&"!--"===i&&(r=4,s=s[0])}return a(),s}(e)),t),arguments,[])).length>1?t:t[0]}const wo={TALK_GMK:"AIzaSyAs_WXNLlj31EHJI_Lw8siO2B3ZJLUzBH0",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1}.TALK_GMK;function ko(e){e=Math.floor(e);const t=Math.floor(e/3600);e%=3600;const n=Math.floor(e/60);e%=60;const r=e=>e.toString().padStart(2,"0");let i=`${r(n)}:${r(e)}`;return t>0&&(i=`${r(t)}:${i}`),i}const Lo=36e5,xo=864e5;function Mo(e,t,n){return new Intl.RelativeTimeFormat(n).format(-e,t)}function Fo(){}function Bo(){}function Po(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}Bo.resetWarningCache=Fo,function(){function e(e,t,n,r,i,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Bo,resetWarningCache:Fo};n.PropTypes=n}();var Uo=Po()?ue:ae;function Ho(){var e=oe(Object.create(null))[1];return he((function(){e(Object.create(null))}),[])}var jo,$o=function(e){var t=e.children,n=e.type,r=void 0===n?"reach-portal":n,i=le(null),o=le(null),s=Ho();return Uo((function(){if(i.current){var e=i.current.ownerDocument;return o.current=null==e?void 0:e.createElement(r),e.body.appendChild(o.current),s(),function(){o.current&&o.current.ownerDocument&&o.current.ownerDocument.body.removeChild(o.current)}}}),[r,s]),o.current?Ke(t,o.current):A("span",{ref:i})},Yo=["bottom","height","left","right","top","width"],zo=new Map,Vo=function e(){var t=[];zo.forEach((function(e,n){var r=n.getBoundingClientRect();(function(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),Yo.some((function(n){return e[n]!==t[n]}))})(r,e.rect)&&(e.rect=r,t.push(e))})),t.forEach((function(e){e.callbacks.forEach((function(t){return t(e.rect)}))})),jo=window.requestAnimationFrame(e)};function Go(e){return!(!e||"[object Function]"!={}.toString.call(e))}function Wo(e,t,n){var r,i,o;"boolean"==typeof t?r=t:(r=null==(o=null==t?void 0:t.observe)||o,i=null==t?void 0:t.onChange),Go(n)&&(i=n);var s=oe(e.current),a=s[0],u=s[1],l=le(!1),c=le(!1),d=oe(null),h=d[0],p=d[1],f=le(i);return Uo((function(){f.current=i,e.current!==a&&u(e.current)})),Uo((function(){a&&!l.current&&(l.current=!0,p(a.getBoundingClientRect()))}),[a]),Uo((function(){if(r){var t=a;if(c.current||(c.current=!0,t=e.current),t){var n,i,o=(n=t,i=function(e){null==f.current||f.current(e),p(e)},{observe:function(){var e=0===zo.size;zo.has(n)?zo.get(n).callbacks.push(i):zo.set(n,{rect:void 0,hasRectChanged:!1,callbacks:[i]}),e&&Vo()},unobserve:function(){var e=zo.get(n);if(e){var t=e.callbacks.indexOf(i);t>=0&&e.callbacks.splice(t,1),e.callbacks.length||zo.delete(n),zo.size||cancelAnimationFrame(jo)}}});return o.observe(),function(){o.unobserve()}}}}),[r,a,e]),h}function Xo(e){return Po()?e?e.ownerDocument:document:null}function Ko(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qo(e,t){if(null!=e)if(Go(e))e(t);else try{e.current=t}catch(n){throw new Error('Cannot assign value "'+t+'" to ref "'+e+'"')}}function Jo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return he((function(e){for(var n,r=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ko(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ko(e,t):void 0}}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(t);!(n=r()).done;)qo(n.value,e)}),t)}var Zo=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],Qo=Zo.join(","),es="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function ts(e,t){t=t||{};var n,r,i,o=[],s=[],a=e.querySelectorAll(Qo);for(t.includeContainer&&es.call(e,Qo)&&(a=Array.prototype.slice.apply(a)).unshift(e),n=0;n<a.length;n++)ns(r=a[n])&&(0===(i=ss(r))?o.push(r):s.push({documentOrder:n,tabIndex:i,node:r}));var u=s.sort(as).map((function(e){return e.node})).concat(o);return u}function ns(e){return!(!rs(e)||function(e){return function(e){return us(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t=function(e){for(var t=0;t<e.length;t++)if(e[t].checked)return e[t]}(e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]'));return!t||t===e}(e)}(e)||ss(e)<0)}function rs(e){return!(e.disabled||function(e){return us(e)&&"hidden"===e.type}(e)||function(e){return null===e.offsetParent||"hidden"===getComputedStyle(e).visibility}(e))}ts.isTabbable=function(e){if(!e)throw new Error("No node provided");return!1!==es.call(e,Qo)&&ns(e)},ts.isFocusable=function(e){if(!e)throw new Error("No node provided");return!1!==es.call(e,is)&&rs(e)};var is=Zo.concat("iframe").join(",");function ss(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:e.tabIndex:t}function as(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function us(e){return"INPUT"===e.tagName}const ls=Ir(ts);function cs(){return cs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cs.apply(this,arguments)}var ds=["as","targetRef","position","unstable_observableRefs"],hs=Me((function(e,t){return A($o,null,A(ps,cs({ref:t},e)))})),ps=Me((function(e,t){var n=e.as,r=void 0===n?"div":n,i=e.targetRef,o=e.position,s=void 0===o?ms:o,a=e.unstable_observableRefs,u=void 0===a?[]:a,l=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,ds),c=le(null),d=Wo(c,{observe:!l.hidden}),h=Wo(i,{observe:!l.hidden}),p=Jo(c,t);return function(e,t){var n=Xo(e.current);function r(e){"Tab"===e.key&&t.current&&0===ls(t.current).length||("Tab"===e.key&&e.shiftKey?function(e){if(e.shiftKey){var t=i();return e.target===t}}(e)?function(e){var n=t.current&&ls(t.current),r=n&&n[n.length-1];r&&(e.preventDefault(),r.focus())}(e):function(e){var n=t.current&&ls(t.current);return!!n&&0!==n.length&&e.target===n[0]}(e)?s(e):function(e){return e.target===ls(n)[0]}(e)&&u():"Tab"===e.key&&(o()?function(e){var n=t.current&&ls(t.current);n&&n[0]&&(e.preventDefault(),n[0].focus())}(e):function(){if(t.current&&t.current.contains(n.activeElement||null)){var e=t.current&&ls(t.current);return Boolean(e&&e[e.length-1]===n.activeElement)}return!1}()?function(e){var t=i();t&&(e.preventDefault(),t.focus())}(e):function(e){var r=t.current?ls(n).filter((function(e){return!t.current.contains(e)})):null;return!!r&&e.target===r[r.length-1]}(e)&&u()))}function i(){var r=ls(n),i=r&&e.current?r.indexOf(e.current):-1,o=r&&r[i+1];return(!t.current||!t.current.contains(o||null))&&o}function o(){return!!e.current&&e.current===n.activeElement}function s(t){var n;t.preventDefault(),null==(n=e.current)||n.focus()}ae((function(){return n.addEventListener("keydown",r),function(){n.removeEventListener("keydown",r)}}),[]);var a=[];function u(){var e=t.current&&ls(t.current);e&&(e.forEach((function(e){a.push([e,e.tabIndex]),e.tabIndex=-1})),n.addEventListener("focusin",l))}function l(){n.removeEventListener("focusin",l),a.forEach((function(e){var t=e[0],n=e[1];t.tabIndex=n}))}}(i,c),A(r,cs({"data-reach-popover":"",ref:p},l,{style:cs({position:"absolute"},fs.apply(void 0,[s,h,d].concat(u)),l.style)}))}));function fs(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];return n?e.apply(void 0,[t,n].concat(i.map((function(e){return e.current})))):{visibility:"hidden"}}var ms=function(e,t){if(!e||!t)return{};var n=function(e,t,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var i={top:e.top-t.height<0,right:window.innerWidth<e.left+t.width-n,bottom:window.innerHeight<e.bottom+t.height-r,left:e.left+e.width-t.width<0};return{directionRight:i.right&&!i.left,directionLeft:i.left&&!i.right,directionUp:i.bottom&&!i.top,directionDown:i.top&&!i.bottom}}(e,t),r=n.directionRight,i=n.directionUp;return cs({left:r?e.right-t.width+window.pageXOffset+"px":e.left+window.pageXOffset+"px"},function(e,t,n){return{top:n?e.top-t.height+window.pageYOffset+"px":e.top+e.height+window.pageYOffset+"px"}}(e,t,i))},Es=!1,gs=0,_s=function(){return++gs};function As(e,t){return z(t)}function Ds(){}function vs(){return vs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vs.apply(this,arguments)}var Os=["element","index"];function Ts(e){var t=e.context,n=e.children,r=e.items,i=e.set,o=he((function(e){var t=e.element,n=e.index,r=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,Os);t&&i((function(e){var i;if(null!=n)return[].concat(e,[vs({},r,{element:t,index:n})]).sort((function(e,t){return e.index-t.index}));if(0===e.length)i=[vs({},r,{element:t,index:0})];else if(e.find((function(e){return e.element===t})))i=e;else{var o=e.findIndex((function(e){return!(!e.element||!t)&&Boolean(e.element.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)})),s=vs({},r,{element:t,index:o});i=-1===o?[].concat(e,[s]):[].concat(e.slice(0,o),[s],e.slice(o))}return i.map((function(e,t){return vs({},e,{index:t})}))}))}),[]),s=he((function(e){e&&i((function(t){return t.filter((function(t){return e!==t.element}))}))}),[]);return A(t.Provider,{value:de((function(){return{descendants:r,registerDescendant:o,unregisterDescendant:s}}),[r,o,s])},n)}function Ss(e){return"which"in e?3===e.which:"button"in e&&2===e.button}function ys(e){var t=le(null);return ae((function(){t.current=e}),[e]),t.current}function Cs(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((function(e){return null!=e})).join("--")}function Ns(e,t){return function(n){if(e&&e(n),!n.defaultPrevented)return t(n)}}function bs(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function Is(){return Is=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Is.apply(this,arguments)}var Rs=["onKeyDown","onMouseDown","id","ref"],ws=["index","isLink","onClick","onDragStart","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseUp","onSelect","disabled","onFocus","valueText","ref"],ks=["id","onKeyDown","ref"],Ls=["onBlur","portal","position","ref"],xs="CLEAR_SELECTION_INDEX",Ms="CLICK_MENU_ITEM",Fs="CLOSE_MENU",Bs="OPEN_MENU_AT_INDEX",Ps="OPEN_MENU_CLEARED",Us="SEARCH_FOR_ITEM",Hs="SELECT_ITEM_AT_INDEX",js="SET_BUTTON_ID",$s=function(e,t){return void 0===t&&(t={}),As(0,vs({descendants:[],registerDescendant:Ds,unregisterDescendant:Ds},t))}(),Ys=As(0,{}),zs={triggerId:null,isExpanded:!1,typeaheadQuery:"",selectionIndex:-1},Vs=function(e){var t=e.id,n=e.children,r=le(null),i=le(null),o=le(null),s=oe([]),a=s[0],u=s[1],l=function(e){var t=oe(e||(Es?_s():null)),n=t[0],r=t[1];return Uo((function(){null===n&&r(_s())}),[]),ae((function(){!1===Es&&(Es=!0)}),[]),null!=n?String(n):void 0}(t),c=t||Cs("menu",l),d=Cs("menu-button",c),h=se(Xs,Is({},zs,{triggerId:d})),p=h[0],f=h[1],m=le(!1),E=le([]),g=le(!1),_=le({x:0,y:0}),D={dispatch:f,dropdownId:c,dropdownRef:i,mouseDownStartPosRef:_,popoverRef:o,readyToSelect:g,selectCallbacks:E,state:p,triggerClickedRef:m,triggerRef:r};return ae((function(){p.isExpanded?(window.__REACH_DISABLE_TOOLTIPS=!0,window.requestAnimationFrame((function(){Ws(i.current)}))):window.__REACH_DISABLE_TOOLTIPS=!1}),[p.isExpanded]),A(Ts,{context:$s,items:a,set:u},A(Ys.Provider,{value:D},Go(n)?n({isExpanded:p.isExpanded,isOpen:p.isExpanded}):n))};function Gs(e){var t=pe(Ys).dropdownId;return null!=e&&e>-1?Cs("option-"+e,t):void 0}function Ws(e){e&&e.focus()}function Xs(e,t){switch(void 0===t&&(t={}),t.type){case Ms:case Fs:return Is({},e,{isExpanded:!1,selectionIndex:-1});case"OPEN_MENU_AT_FIRST_ITEM":return Is({},e,{isExpanded:!0,selectionIndex:0});case Bs:return Is({},e,{isExpanded:!0,selectionIndex:t.payload.index});case Ps:return Is({},e,{isExpanded:!0,selectionIndex:-1});case Hs:var n=t.payload.dropdownRef,r=void 0===n?{current:null}:n;if(t.payload.index>=0&&t.payload.index!==e.selectionIndex){if(r.current){var i=Xo(r.current);r.current!==(null==i?void 0:i.activeElement)&&r.current.focus()}return Is({},e,{selectionIndex:null!=t.payload.max?Math.min(Math.max(t.payload.index,0),t.payload.max):Math.max(t.payload.index,0)})}return e;case xs:return Is({},e,{selectionIndex:-1});case js:return Is({},e,{triggerId:t.payload});case Us:return void 0!==t.payload?Is({},e,{typeaheadQuery:t.payload}):e;default:return e}}function Ks(){return pe(Ys)}function qs(){return pe($s).descendants}var Js={exports:{}},Zs={},Qs="function"==typeof Symbol&&Symbol.for,ea=Qs?Symbol.for("react.element"):60103,ta=Qs?Symbol.for("react.portal"):60106,na=Qs?Symbol.for("react.fragment"):60107,ra=Qs?Symbol.for("react.strict_mode"):60108,ia=Qs?Symbol.for("react.profiler"):60114,oa=Qs?Symbol.for("react.provider"):60109,sa=Qs?Symbol.for("react.context"):60110,aa=Qs?Symbol.for("react.async_mode"):60111,ua=Qs?Symbol.for("react.concurrent_mode"):60111,la=Qs?Symbol.for("react.forward_ref"):60112,ca=Qs?Symbol.for("react.suspense"):60113,da=Qs?Symbol.for("react.suspense_list"):60120,ha=Qs?Symbol.for("react.memo"):60115,pa=Qs?Symbol.for("react.lazy"):60116,fa=Qs?Symbol.for("react.block"):60121,ma=Qs?Symbol.for("react.fundamental"):60117,Ea=Qs?Symbol.for("react.responder"):60118,ga=Qs?Symbol.for("react.scope"):60119;function _a(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case ea:switch(e=e.type){case aa:case ua:case na:case ia:case ra:case ca:return e;default:switch(e=e&&e.$$typeof){case sa:case la:case pa:case ha:case oa:return e;default:return t}}case ta:return t}}}function Aa(e){return _a(e)===ua}Zs.AsyncMode=aa,Zs.ConcurrentMode=ua,Zs.ContextConsumer=sa,Zs.ContextProvider=oa,Zs.Element=ea,Zs.ForwardRef=la,Zs.Fragment=na,Zs.Lazy=pa,Zs.Memo=ha,Zs.Portal=ta,Zs.Profiler=ia,Zs.StrictMode=ra,Zs.Suspense=ca,Zs.isAsyncMode=function(e){return Aa(e)||_a(e)===aa},Zs.isConcurrentMode=Aa,Zs.isContextConsumer=function(e){return _a(e)===sa},Zs.isContextProvider=function(e){return _a(e)===oa},Zs.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===ea},Zs.isForwardRef=function(e){return _a(e)===la},Zs.isFragment=function(e){return _a(e)===na},Zs.isLazy=function(e){return _a(e)===pa},Zs.isMemo=function(e){return _a(e)===ha},Zs.isPortal=function(e){return _a(e)===ta},Zs.isProfiler=function(e){return _a(e)===ia},Zs.isStrictMode=function(e){return _a(e)===ra},Zs.isSuspense=function(e){return _a(e)===ca},Zs.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===na||e===ua||e===ia||e===ra||e===ca||e===da||"object"==typeof e&&null!==e&&(e.$$typeof===pa||e.$$typeof===ha||e.$$typeof===oa||e.$$typeof===sa||e.$$typeof===la||e.$$typeof===ma||e.$$typeof===Ea||e.$$typeof===ga||e.$$typeof===fa)},Zs.typeOf=_a,Js.exports=Zs;var Da=Js.exports;function va(){return va=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},va.apply(this,arguments)}function Oa(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}var Ta=["as","id","children"],Sa=["as"],ya=["as"],Ca=["as"],Na=["as"],ba=["as"],Ia=Me((function(e,t){var n=e.as,r=void 0===n?O:n,i=e.id,o=e.children,s=Oa(e,Ta),a=de((function(){try{return Da.isFragment(A(r,null))}catch(e){return!1}}),[r])?{}:va({ref:t,id:i,"data-reach-menu":""},s);return A(r,a,A(Vs,{id:i,children:o}))})),Ra=Me((function(e,t){var n=e.as,r=void 0===n?"button":n,i=function(e){var t=e.onKeyDown,n=e.onMouseDown,r=e.id,i=e.ref,o=bs(e,Rs),s=Ks(),a=s.dispatch,u=s.dropdownId,l=s.mouseDownStartPosRef,c=s.triggerClickedRef,d=s.triggerRef,h=s.state,p=h.triggerId,f=h.isExpanded,m=Jo(d,i),E=qs(),g=de((function(){return E.findIndex((function(e){return!e.disabled}))}),[E]);return ae((function(){null!=r&&r!==p&&a({type:js,payload:r})}),[p,a,r]),{data:{isExpanded:f,controls:u},props:Is({},o,{ref:m,id:p||void 0,onKeyDown:Ns(t,(function(e){switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),a({type:Bs,payload:{index:g}});break;case"Enter":case" ":a({type:Bs,payload:{index:g}})}})),onMouseDown:Ns(n,(function(e){Ss(e.nativeEvent)||(l.current={x:e.clientX,y:e.clientY},f||(c.current=!0),a(f?{type:Fs}:{type:Ps}))})),type:"button"})}}(va({},Oa(e,Sa),{ref:t})),o=i.data;return A(r,va({"aria-expanded":!!o.isExpanded||void 0,"aria-haspopup":!0,"aria-controls":o.controls},i.props,{"data-reach-menu-button":""}))})),wa=Me((function(e,t){var n=e.as,r=void 0===n?"div":n,i=function(e){var t=e.index,n=e.isLink,r=void 0!==n&&n,i=e.onClick,o=e.onDragStart,s=e.onMouseDown,a=e.onMouseEnter,u=e.onMouseLeave,l=e.onMouseMove,c=e.onMouseUp,d=e.onSelect,h=e.disabled,p=e.onFocus,f=e.valueText,m=e.ref,E=bs(e,ws),g=Ks(),_=g.dispatch,A=g.dropdownRef,D=g.mouseDownStartPosRef,v=g.readyToSelect,O=g.selectCallbacks,T=g.triggerRef,S=g.state,y=S.selectionIndex,C=S.isExpanded,N=le(null),b=oe(f||""),I=b[0],R=b[1],w=he((function(e){!f&&null!=e&&e.textContent&&R(e.textContent)}),[f]),k=le(!1),L=function(e){var t=oe(null),n=t[0],r=t[1];return[n,he((function(t){e.current=t,r(t)}),[])]}(N),x=L[0],M=L[1],F=function(e,t,n){var r=Ho(),i=pe(t),o=i.registerDescendant,s=i.unregisterDescendant,a=i.descendants,u=null!=n?n:a.findIndex((function(t){return t.element===e.element}));return Uo((function(){return e.element||r(),o(vs({},e,{index:u})),function(){s(e.element)}}),[e,r,u,o,s].concat(Object.values(e))),u}(de((function(){return{element:x,key:I,disabled:h,isLink:r}}),[h,x,r,I]),$s,t),B=F===y&&!h,P=Jo(m,M,w);function U(){Ws(T.current),d&&d(),_({type:Ms})}return O.current[F]=d,ae((function(){if(C){var e=window.setTimeout((function(){v.current=!0}),400);return function(){window.clearTimeout(e)}}v.current=!1}),[C,v]),ae((function(){var e=Xo(N.current);return e.addEventListener("mouseup",t),function(){e.removeEventListener("mouseup",t)};function t(){k.current=!1}}),[]),{data:{disabled:h},props:Is({id:Gs(F),tabIndex:-1},E,{ref:P,"data-disabled":h?"":void 0,"data-selected":B?"":void 0,"data-valuetext":I,onClick:Ns(i,(function(e){Ss(e.nativeEvent)||r&&(h?e.preventDefault():U())})),onDragStart:Ns(o,(function(e){r&&e.preventDefault()})),onMouseDown:Ns(s,(function(e){Ss(e.nativeEvent)||(r?k.current=!0:e.preventDefault())})),onMouseEnter:Ns(a,(function(e){var t=Xo(A.current);B||null==F||h||(null!=A&&A.current&&A.current!==t.activeElement&&N.current!==t.activeElement&&A.current.focus(),_({type:Hs,payload:{index:F}}))})),onMouseLeave:Ns(u,(function(e){_({type:xs})})),onMouseMove:Ns(l,(function(e){if(!v.current){var t=Math.abs(e.clientX-D.current.x),n=Math.abs(e.clientY-D.current.y);(t>8||n>8)&&(v.current=!0)}B||null==F||h||_({type:Hs,payload:{index:F,dropdownRef:A}})})),onFocus:Ns(p,(function(){v.current=!0,B||null==F||h||_({type:Hs,payload:{index:F}})})),onMouseUp:Ns(c,(function(e){Ss(e.nativeEvent)||(v.current?r?k.current?k.current=!1:N.current&&N.current.click():h||U():v.current=!0)}))})}}(va({},Oa(e,ya),{ref:t})),o=i.data.disabled;return A(r,va({role:"menuitem"},i.props,{"aria-disabled":o||void 0,"data-reach-menu-item":""}))})),ka=Me((function(e,t){var n=e.as,r=void 0===n?"div":n,i=Oa(e,Ca);return A(wa,va({},i,{ref:t,as:r}))})),La=Me((function(e,t){var n=e.as,r=void 0===n?"div":n,i=function(e){e.id;var t=e.onKeyDown,n=e.ref,r=bs(e,ks),i=Ks(),o=i.dispatch,s=i.triggerRef,a=i.dropdownRef,u=i.selectCallbacks,l=i.dropdownId,c=i.state,d=c.isExpanded,h=c.triggerId,p=c.selectionIndex,f=c.typeaheadQuery,m=qs(),E=Jo(a,n);ae((function(){var e=function(e,t){if(void 0===t&&(t=""),!t)return null;var n=e.find((function(e){var n,r,i;return!e.disabled&&(null==(n=e.element)||null==(r=n.dataset)||null==(i=r.valuetext)?void 0:i.toLowerCase().startsWith(t))}));return n?e.indexOf(n):null}(m,f);f&&null!=e&&o({type:Hs,payload:{index:e,dropdownRef:a}});var t=window.setTimeout((function(){return f&&o({type:Us,payload:""})}),1e3);return function(){return window.clearTimeout(t)}}),[o,m,f,a]);var g=ys(m.length),_=ys(m[p]),A=ys(p);ae((function(){p>m.length-1?o({type:Hs,payload:{index:m.length-1,dropdownRef:a}}):g!==m.length&&p>-1&&_&&A===p&&m[p]!==_&&o({type:Hs,payload:{index:m.findIndex((function(e){return e.key===(null==_?void 0:_.key)})),dropdownRef:a}})}),[a,o,m,g,_,A,p]);var D=Ns((function(e){var t=e.key;if(d)switch(t){case"Enter":case" ":var n=m.find((function(e){return e.index===p}));n&&!n.disabled&&(e.preventDefault(),n.isLink&&n.element?n.element.click():(Ws(s.current),u.current[n.index]&&u.current[n.index](),o({type:Ms})));break;case"Escape":Ws(s.current),o({type:Fs});break;case"Tab":e.preventDefault();break;default:if("string"==typeof t&&1===t.length){var r=f+t.toLowerCase();o({type:Us,payload:r})}}}),function(e,t){var n=pe(e).descendants,r=t.callback,i=t.currentIndex,o=t.filter,s=t.key,a=void 0===s?"index":s,u=t.orientation,l=void 0===u?"vertical":u,c=t.rotate,d=void 0===c||c,h=t.rtl,p=void 0!==h&&h;return function(e){if(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(e.key)){var t=null!=i?i:-1,s=o?n.filter(o):n;if(s.length){var u=s.findIndex((function(e){return e.index===i}));switch(e.key){case"ArrowDown":if("vertical"===l||"both"===l){e.preventDefault();var c=D();r("option"===a?c:c[a])}break;case"ArrowUp":if("vertical"===l||"both"===l){e.preventDefault();var h=v();r("option"===a?h:h[a])}break;case"ArrowLeft":if("horizontal"===l||"both"===l){e.preventDefault();var f=(p?D:v)();r("option"===a?f:f[a])}break;case"ArrowRight":if("horizontal"===l||"both"===l){e.preventDefault();var m=(p?v:D)();r("option"===a?m:m[a])}break;case"PageUp":e.preventDefault();var E=(e.ctrlKey?v:O)();r("option"===a?E:E[a]);break;case"Home":e.preventDefault();var g=O();r("option"===a?g:g[a]);break;case"PageDown":e.preventDefault();var _=(e.ctrlKey?D:T)();r("option"===a?_:_[a]);break;case"End":e.preventDefault();var A=T();r("option"===a?A:A[a])}}}function D(){return t===T().index?d?O():s[u]:s[(u+1)%s.length]}function v(){return t===O().index?d?T():s[u]:s[(u-1+s.length)%s.length]}function O(){return s[0]}function T(){return s[s.length-1]}}}($s,{currentIndex:p,orientation:"vertical",rotate:!1,filter:function(e){return!e.disabled},callback:function(e){o({type:Hs,payload:{index:e,dropdownRef:a}})},key:"index"}));return{data:{activeDescendant:Gs(p)||void 0,triggerId:h},props:Is({tabIndex:-1},r,{ref:E,id:l,onKeyDown:Ns(t,D)})}}(va({},Oa(e,Na),{ref:t})),o=i.data;return A(r,va({"aria-activedescendant":o.activeDescendant,"aria-labelledby":o.triggerId||void 0,role:"menu"},i.props,{"data-reach-menu-items":""}))})),xa=Me((function(e,t){var n=e.as,r=void 0===n?"div":n,i=function(e){var t=e.onBlur,n=e.portal,r=void 0===n||n,i=e.position,o=e.ref,s=bs(e,Ls),a=Ks(),u=a.triggerRef,l=a.triggerClickedRef,c=a.dispatch,d=a.dropdownRef,h=a.popoverRef,p=a.state.isExpanded,f=Jo(h,o);return ae((function(){if(p){var e=Xo(h.current);return e.addEventListener("mousedown",t),function(){e.removeEventListener("mousedown",t)}}function t(e){var t,n;l.current?l.current=!1:(t=h.current,n=e.target,t&&t.contains(n)||c({type:Fs}))}}),[l,u,c,d,h,p]),{data:{portal:r,position:i,targetRef:u,isExpanded:p},props:Is({ref:f,hidden:!p,onBlur:Ns(t,(function(e){e.currentTarget.contains(e.relatedTarget)||c({type:Fs})}))},s)}}(va({},Oa(e,ba),{ref:t})),o=i.data,s=o.portal,a=o.targetRef,u=o.position,l=i.props,c={"data-reach-menu-popover":""};return s?A(hs,va({},l,c,{as:r,targetRef:a,position:u})):A(r,va({},l,c))})),Ma=[],Fa=function(e){return void 0===e},Ba=/\s*(\.\d+|\d+(?:\.\d+)?)(%|deg)?\s*/,Pa=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,Ua=new RegExp("^(rgb|hsl|hsv)a?\\("+Ba.source+"[, ]"+Ba.source+"[, ]"+Ba.source+"(?:[,/]"+Ba.source+")?\\)$","i");function Ha(e,t,n){return"%"===e?100:"deg"===e||n&&0===t?360:e?void 0:255}function ja(e){if(Array.isArray(e)){if("string"==typeof e[0]&&"function"==typeof ja[e[0]])return new ja[e[0]](e.slice(1,e.length));if(4===e.length)return new ja.RGB(e[0]/255,e[1]/255,e[2]/255,e[3]/255)}else if("string"==typeof e){var t=e.toLowerCase();ja.namedColors[t]&&(e="#"+ja.namedColors[t]),"transparent"===t&&(e="rgba(0,0,0,0)");var n=e.match(Ua);if(n){var r=n[1].toUpperCase(),i="H"===r[0];if(Fa(ja[r]))throw new Error("color."+r+" is not installed.");let e=Fa(n[8])?1:void 0;return void 0===e&&(e="%"===n[9]?parseFloat(n[8])/100:parseFloat(n[8])),new ja[r](parseFloat(n[2])/Ha(n[3],0,i),parseFloat(n[4])/Ha(n[5],1,i),parseFloat(n[6])/Ha(n[7],2,i),e)}e.length<6&&(e=e.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,"$1$1$2$2$3$3$4$4"));var o=e.match(/^#?([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])?$/i);if(o)return new ja.RGB(parseInt(o[1],16)/255,parseInt(o[2],16)/255,parseInt(o[3],16)/255,o[4]?parseInt(o[4],16)/255:1);if(ja.CMYK){var s=e.match(new RegExp("^cmyk\\("+Pa.source+","+Pa.source+","+Pa.source+","+Pa.source+"\\)$","i"));if(s)return new ja.CMYK(parseFloat(s[1])/100,parseFloat(s[2])/100,parseFloat(s[3])/100,parseFloat(s[4])/100)}}else if("object"==typeof e&&e.isColor)return e;return!1}ja.namedColors={},ja.installColorSpace=function(e,t,n){ja[e]=function(n){var r=Array.isArray(n)?n:arguments;t.forEach((function(n,i){var o=r[i];if("alpha"===n)this._alpha=isNaN(o)||o>1?1:o<0?0:o;else{if(isNaN(o))throw new Error("["+e+"]: Invalid color: ("+t.join(",")+")");"hue"===n?this._hue=o<0?o-Math.floor(o):o%1:this["_"+n]=o<0?0:o>1?1:o}}),this)},ja[e].propertyNames=t;var r=ja[e].prototype;for(var i in["valueOf","hex","hexa","css","cssa"].forEach((function(t){r[t]=r[t]||("RGB"===e?r.hex:function(){return this.rgb()[t]()})})),r.isColor=!0,r.equals=function(n,r){Fa(r)&&(r=1e-10),n=n[e.toLowerCase()]();for(var i=0;i<t.length;i+=1)if(Math.abs(this["_"+t[i]]-n["_"+t[i]])>r)return!1;return!0},r.toJSON=function(){return[e].concat(t.map((function(e){return this["_"+e]}),this))},n)if(Object.prototype.hasOwnProperty.call(n,i)){var o=i.match(/^from(.*)$/);o?ja[o[1].toUpperCase()].prototype[e.toLowerCase()]=n[i]:r[i]=n[i]}function s(e,t){var n={};for(var r in n[t.toLowerCase()]=function(){return this.rgb()[t.toLowerCase()]()},ja[t].propertyNames.forEach((function(e){var r="black"===e?"k":e.charAt(0);n[e]=n[r]=function(n,r){return this[t.toLowerCase()]()[e](n,r)}})),n)Object.prototype.hasOwnProperty.call(n,r)&&void 0===ja[e].prototype[r]&&(ja[e].prototype[r]=n[r])}return r[e.toLowerCase()]=function(){return this},r.toString=function(){return"["+e+" "+t.map((function(e){return this["_"+e]}),this).join(", ")+"]"},t.forEach((function(e){var n="black"===e?"k":e.charAt(0);r[e]=r[n]=function(n,r){return void 0===n?this["_"+e]:r?new this.constructor(t.map((function(t){return this["_"+t]+(e===t?n:0)}),this)):new this.constructor(t.map((function(t){return e===t?n:this["_"+t]}),this))}})),Ma.forEach((function(t){s(e,t),s(t,e)})),Ma.push(e),ja},ja.pluginList=[],ja.use=function(e){return-1===ja.pluginList.indexOf(e)&&(this.pluginList.push(e),e(ja)),ja},ja.installMethod=function(e,t){return Ma.forEach((function(n){ja[n].prototype[e]=t})),this},ja.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var e=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-e.length)+e},hexa:function(){var e=Math.round(255*this._alpha).toString(16);return this.hex()+"00".substr(0,2-e.length)+e},css:function(){return"rgb("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+")"},cssa:function(){return"rgba("+Math.round(255*this._red)+","+Math.round(255*this._green)+","+Math.round(255*this._blue)+","+this._alpha+")"}});var $a=function(e){e.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var t=function(e){return e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92},n=t(this._red),r=t(this._green),i=t(this._blue);return new e.XYZ(.4124564*n+.3575761*r+.1804375*i,.2126729*n+.7151522*r+.072175*i,.0193339*n+.119192*r+.9503041*i,this._alpha)},rgb:function(){var t=this._x,n=this._y,r=this._z,i=function(e){return e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e};return new e.RGB(i(3.2404542*t+-1.5371385*n+-.4985314*r),i(-.969266*t+1.8760108*n+.041556*r),i(.0556434*t+-.2040259*n+1.0572252*r),this._alpha)},lab:function(){var t=function(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29},n=t(this._x/95.047),r=t(this._y/100),i=t(this._z/108.883);return new e.LAB(116*r-16,500*(n-r),200*(r-i),this._alpha)}})},Ya=function(e){e.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var t,n,r,i=this._hue,o=this._saturation,s=this._value,a=Math.min(5,Math.floor(6*i)),u=6*i-a,l=s*(1-o),c=s*(1-u*o),d=s*(1-(1-u)*o);switch(a){case 0:t=s,n=d,r=l;break;case 1:t=c,n=s,r=l;break;case 2:t=l,n=s,r=d;break;case 3:t=l,n=c,r=s;break;case 4:t=d,n=l,r=s;break;case 5:t=s,n=l,r=c}return new e.RGB(t,n,r,this._alpha)},hsl:function(){var t,n=(2-this._saturation)*this._value,r=this._saturation*this._value,i=n<=1?n:2-n;return t=i<1e-9?0:r/i,new e.HSL(this._hue,t,n/2,this._alpha)},fromRgb:function(){var t,n=this._red,r=this._green,i=this._blue,o=Math.max(n,r,i),s=o-Math.min(n,r,i),a=0===o?0:s/o,u=o;if(0===s)t=0;else switch(o){case n:t=(r-i)/s/6+(r<i?1:0);break;case r:t=(i-n)/s/6+1/3;break;case i:t=(n-r)/s/6+2/3}return new e.HSV(t,a,u,this._alpha)}})},za=function(e){e.use(Ya),e.installColorSpace("HSL",["hue","saturation","lightness","alpha"],{hsv:function(){var t,n=2*this._lightness,r=this._saturation*(n<=1?n:2-n);return t=n+r<1e-9?0:2*r/(n+r),new e.HSV(this._hue,t,(n+r)/2,this._alpha)},rgb:function(){return this.hsv().rgb()},fromRgb:function(){return this.hsv().hsl()}})},Va=function(e){function t(e){return e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4)}e.installMethod("luminance",(function(){var e=this.rgb();return.2126*t(e._red)+.7152*t(e._green)+.0722*t(e._blue)}))},Ga=function(e){e.installMethod("isDark",(function(){var e=this.rgb();return(255*e._red*299+255*e._green*587+255*e._blue*114)/1e3<128}))},Wa=ja.use($a).use((function(e){e.use($a),e.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var t=function(e){var t=Math.pow(e,3);return t>.008856?t:(e-16/116)/7.87},n=(this._l+16)/116,r=this._a/500+n,i=n-this._b/200;return new e.XYZ(95.047*t(r),100*t(n),108.883*t(i),this._alpha)}})})).use(Ya).use(za).use((function(e){e.installColorSpace("CMYK",["cyan","magenta","yellow","black","alpha"],{rgb:function(){return new e.RGB(1-this._cyan*(1-this._black)-this._black,1-this._magenta*(1-this._black)-this._black,1-this._yellow*(1-this._black)-this._black,this._alpha)},fromRgb:function(){var t=this._red,n=this._green,r=this._blue,i=1-t,o=1-n,s=1-r,a=1;return t||n||r?(i=(i-(a=Math.min(i,Math.min(o,s))))/(1-a),o=(o-a)/(1-a),s=(s-a)/(1-a)):a=1,new e.CMYK(i,o,s,a,this._alpha)}})})).use((function(e){e.namedColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgrey:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",grey:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"}})).use((function(e){e.installMethod("clearer",(function(e){return this.alpha(isNaN(e)?-.1:-e,!0)}))})).use((function(e){e.use(Va),e.installMethod("contrast",(function(e){var t=this.luminance(),n=e.luminance();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)}))})).use((function(e){e.use(za),e.installMethod("darken",(function(e){return this.lightness(isNaN(e)?-.1:-e,!0)}))})).use((function(e){e.use(za),e.installMethod("desaturate",(function(e){return this.saturation(isNaN(e)?-.1:-e,!0)}))})).use((function(e){function t(){var t=this.rgb(),n=.3*t._red+.59*t._green+.11*t._blue;return new e.RGB(n,n,n,t._alpha)}e.installMethod("greyscale",t).installMethod("grayscale",t)})).use(Ga).use((function(e){e.use(Ga),e.installMethod("isLight",(function(){return!this.isDark()}))})).use((function(e){e.use(za),e.installMethod("lighten",(function(e){return this.lightness(isNaN(e)?.1:e,!0)}))})).use(Va).use((function(e){e.installMethod("mix",(function(t,n){t=e(t).rgb();var r=2*(n=1-(isNaN(n)?.5:n))-1,i=this._alpha-t._alpha,o=((r*i==-1?r:(r+i)/(1+r*i))+1)/2,s=1-o,a=this.rgb();return new e.RGB(a._red*o+t._red*s,a._green*o+t._green*s,a._blue*o+t._blue*s,a._alpha*n+t._alpha*(1-n))}))})).use((function(e){e.installMethod("negate",(function(){var t=this.rgb();return new e.RGB(1-t._red,1-t._green,1-t._blue,this._alpha)}))})).use((function(e){e.installMethod("opaquer",(function(e){return this.alpha(isNaN(e)?.1:e,!0)}))})).use((function(e){e.use(za),e.installMethod("rotate",(function(e){return this.hue((e||0)/360,!0)}))})).use((function(e){e.use(za),e.installMethod("saturate",(function(e){return this.saturation(isNaN(e)?.1:e,!0)}))})).use((function(e){e.installMethod("toAlpha",(function(e){var t=this.rgb(),n=e(e).rgb(),r=new e.RGB(0,0,0,t._alpha),i=["_red","_green","_blue"];return i.forEach((function(e){t[e]<1e-10?r[e]=t[e]:t[e]>n[e]?r[e]=(t[e]-n[e])/(1-n[e]):t[e]>n[e]?r[e]=(n[e]-t[e])/n[e]:r[e]=0})),r._red>r._green?r._red>r._blue?t._alpha=r._red:t._alpha=r._blue:r._green>r._blue?t._alpha=r._green:t._alpha=r._blue,t._alpha<1e-10||(i.forEach((function(e){t[e]=(t[e]-n[e])/t._alpha+n[e]})),t._alpha*=r._alpha),t}))}));const Xa=Ir(Wa);function Ka(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{u(r.next(e))}catch(e){o(e)}}function a(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((r=r.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;let qa=class{constructor(){this.listeners={}}on(e,t,n){if(this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(t),null==n?void 0:n.once){const n=()=>{this.un(e,n),this.un(e,t)};return this.on(e,n),n}return()=>this.un(e,t)}un(e,t){var n;null===(n=this.listeners[e])||void 0===n||n.delete(t)}once(e,t){return this.on(e,t,{once:!0})}unAll(){this.listeners={}}emit(e,...t){this.listeners[e]&&this.listeners[e].forEach((e=>e(...t)))}};const Ja={decode:function(e,t){return Ka(this,void 0,void 0,(function*(){const n=new AudioContext({sampleRate:t});return n.decodeAudioData(e).finally((()=>n.close()))}))},createBuffer:function(e,t){return"number"==typeof e[0]&&(e=[e]),function(e){const t=e[0];if(t.some((e=>e>1||e<-1))){const n=t.length;let r=0;for(let e=0;e<n;e++){const n=Math.abs(t[e]);n>r&&(r=n)}for(const t of e)for(let e=0;e<n;e++)t[e]/=r}}(e),{duration:t,length:e[0].length,sampleRate:e[0].length/t,numberOfChannels:e.length,getChannelData:t=>null==e?void 0:e[t],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function Za(e,t){const n=t.xmlns?document.createElementNS(t.xmlns,e):document.createElement(e);for(const[r,i]of Object.entries(t))if("children"===r)for(const[e,o]of Object.entries(t))"string"==typeof o?n.appendChild(document.createTextNode(o)):n.appendChild(Za(e,o));else"style"===r?Object.assign(n.style,i):"textContent"===r?n.textContent=i:n.setAttribute(r,i.toString());return n}function Qa(e,t,n){const r=Za(e,t||{});return null==n||n.appendChild(r),r}var eu=Object.freeze({__proto__:null,createElement:Qa,default:Qa});const tu={fetchBlob:function(e,t,n){return Ka(this,void 0,void 0,(function*(){const r=yield fetch(e,n);if(r.status>=400)throw new Error(`Failed to fetch ${e}: ${r.status} (${r.statusText})`);return function(e,t){Ka(this,void 0,void 0,(function*(){if(!e.body||!e.headers)return;const n=e.body.getReader(),r=Number(e.headers.get("Content-Length"))||0;let i=0;const o=e=>Ka(this,void 0,void 0,(function*(){i+=(null==e?void 0:e.length)||0;const n=Math.round(i/r*100);t(n)})),s=()=>Ka(this,void 0,void 0,(function*(){let e;try{e=yield n.read()}catch(e){return}e.done||(o(e.value),yield s())}));s()}))}(r.clone(),t),r.blob()}))}};let nu=class extends qa{constructor(e){super(),this.isExternalMedia=!1,e.media?(this.media=e.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),e.mediaControls&&(this.media.controls=!0),e.autoplay&&(this.media.autoplay=!0),null!=e.playbackRate&&this.onMediaEvent("canplay",(()=>{null!=e.playbackRate&&(this.media.playbackRate=e.playbackRate)}),{once:!0})}onMediaEvent(e,t,n){return this.media.addEventListener(e,t,n),()=>this.media.removeEventListener(e,t,n)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const e=this.getSrc();e.startsWith("blob:")&&URL.revokeObjectURL(e)}canPlayType(e){return""!==this.media.canPlayType(e)}setSrc(e,t){const n=this.getSrc();if(e&&n===e)return;this.revokeSrc();const r=t instanceof Blob&&(this.canPlayType(t.type)||!e)?URL.createObjectURL(t):e;try{this.media.src=r}catch(t){this.media.src=e}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(e){this.media=e}play(){return Ka(this,void 0,void 0,(function*(){return this.media.play()}))}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(e){this.media.currentTime=e}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(e){this.media.volume=e}getMuted(){return this.media.muted}setMuted(e){this.media.muted=e}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(e,t){null!=t&&(this.media.preservesPitch=t),this.media.playbackRate=e}getMediaElement(){return this.media}setSinkId(e){return this.media.setSinkId(e)}},ru=class e extends qa{constructor(e,t){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.subscriptions=[],this.options=e;const n=this.parentFromOptionsContainer(e.container);this.parent=n;const[r,i]=this.initHtml();n.appendChild(r),this.container=r,this.scrollContainer=i.querySelector(".scroll"),this.wrapper=i.querySelector(".wrapper"),this.canvasWrapper=i.querySelector(".canvases"),this.progressWrapper=i.querySelector(".progress"),this.cursor=i.querySelector(".cursor"),t&&i.appendChild(t),this.initEvents()}parentFromOptionsContainer(e){let t;if("string"==typeof e?t=document.querySelector(e):e instanceof HTMLElement&&(t=e),!t)throw new Error("Container not found");return t}initEvents(){const e=e=>{const t=this.wrapper.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;return[n/t.width,r/t.height]};if(this.wrapper.addEventListener("click",(t=>{const[n,r]=e(t);this.emit("click",n,r)})),this.wrapper.addEventListener("dblclick",(t=>{const[n,r]=e(t);this.emit("dblclick",n,r)})),!0!==this.options.dragToSeek&&"object"!=typeof this.options.dragToSeek||this.initDrag(),this.scrollContainer.addEventListener("scroll",(()=>{const{scrollLeft:e,scrollWidth:t,clientWidth:n}=this.scrollContainer,r=e/t,i=(e+n)/t;this.emit("scroll",r,i,e,e+n)})),"function"==typeof ResizeObserver){const e=this.createDelay(100);this.resizeObserver=new ResizeObserver((()=>{e().then((()=>this.onContainerResize())).catch((()=>{}))})),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const e=this.parent.clientWidth;e===this.lastContainerWidth&&"auto"!==this.options.height||(this.lastContainerWidth=e,this.reRender())}initDrag(){this.subscriptions.push(function(e,t,n,r,i=3,o=0,s=100){if(!e)return()=>{};const a=matchMedia("(pointer: coarse)").matches;let u=()=>{};const l=l=>{if(l.button!==o)return;l.preventDefault(),l.stopPropagation();let c=l.clientX,d=l.clientY,h=!1;const p=Date.now(),f=r=>{if(r.preventDefault(),r.stopPropagation(),a&&Date.now()-p<s)return;const o=r.clientX,u=r.clientY,l=o-c,f=u-d;if(h||Math.abs(l)>i||Math.abs(f)>i){const r=e.getBoundingClientRect(),{left:i,top:s}=r;h||(null==n||n(c-i,d-s),h=!0),t(l,f,o-i,u-s),c=o,d=u}},m=t=>{if(h){const n=t.clientX,i=t.clientY,o=e.getBoundingClientRect(),{left:s,top:a}=o;null==r||r(n-s,i-a)}u()},E=e=>{e.relatedTarget&&e.relatedTarget!==document.documentElement||m(e)},g=e=>{h&&(e.stopPropagation(),e.preventDefault())},_=e=>{h&&e.preventDefault()};document.addEventListener("pointermove",f),document.addEventListener("pointerup",m),document.addEventListener("pointerout",E),document.addEventListener("pointercancel",E),document.addEventListener("touchmove",_,{passive:!1}),document.addEventListener("click",g,{capture:!0}),u=()=>{document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",m),document.removeEventListener("pointerout",E),document.removeEventListener("pointercancel",E),document.removeEventListener("touchmove",_),setTimeout((()=>{document.removeEventListener("click",g,{capture:!0})}),10)}};return e.addEventListener("pointerdown",l),()=>{u(),e.removeEventListener("pointerdown",l)}}(this.wrapper,((e,t,n)=>{this.emit("drag",Math.max(0,Math.min(1,n/this.wrapper.getBoundingClientRect().width)))}),(e=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))}),(e=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,e/this.wrapper.getBoundingClientRect().width)))})))}getHeight(e,t){var n;const r=(null===(n=this.audioData)||void 0===n?void 0:n.numberOfChannels)||1;if(null==e)return 128;if(!isNaN(Number(e)))return Number(e);if("auto"===e){const e=this.parent.clientHeight||128;return(null==t?void 0:t.every((e=>!e.overlay)))?e/r:e}return 128}initHtml(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"});return t.innerHTML=`\n <style>\n :host {\n user-select: none;\n min-width: 1px;\n }\n :host audio {\n display: block;\n width: 100%;\n }\n :host .scroll {\n overflow-x: auto;\n overflow-y: hidden;\n width: 100%;\n position: relative;\n }\n :host .noScrollbar {\n scrollbar-color: transparent;\n scrollbar-width: none;\n }\n :host .noScrollbar::-webkit-scrollbar {\n display: none;\n -webkit-appearance: none;\n }\n :host .wrapper {\n position: relative;\n overflow: visible;\n z-index: 2;\n }\n :host .canvases {\n min-height: ${this.getHeight(this.options.height,this.options.splitChannels)}px;\n }\n :host .canvases > div {\n position: relative;\n }\n :host canvas {\n display: block;\n position: absolute;\n top: 0;\n image-rendering: pixelated;\n }\n :host .progress {\n pointer-events: none;\n position: absolute;\n z-index: 2;\n top: 0;\n left: 0;\n width: 0;\n height: 100%;\n overflow: hidden;\n }\n :host .progress > div {\n position: relative;\n }\n :host .cursor {\n pointer-events: none;\n position: absolute;\n z-index: 5;\n top: 0;\n left: 0;\n height: 100%;\n border-radius: 2px;\n }\n </style>\n\n <div class="scroll" part="scroll">\n <div class="wrapper" part="wrapper">\n <div class="canvases" part="canvases"></div>\n <div class="progress" part="progress"></div>\n <div class="cursor" part="cursor"></div>\n </div>\n </div>\n `,[e,t]}setOptions(e){if(this.options.container!==e.container){const t=this.parentFromOptionsContainer(e.container);t.appendChild(this.container),this.parent=t}!0!==e.dragToSeek&&"object"!=typeof this.options.dragToSeek||this.initDrag(),this.options=e,this.reRender()}getWrapper(){return this.wrapper}getWidth(){return this.scrollContainer.clientWidth}getScroll(){return this.scrollContainer.scrollLeft}setScroll(e){this.scrollContainer.scrollLeft=e}setScrollPercentage(e){const{scrollWidth:t}=this.scrollContainer,n=t*e;this.setScroll(n)}destroy(){var e,t;this.subscriptions.forEach((e=>e())),this.container.remove(),null===(e=this.resizeObserver)||void 0===e||e.disconnect(),null===(t=this.unsubscribeOnScroll)||void 0===t||t.call(this)}createDelay(e=10){let t,n;const r=()=>{t&&clearTimeout(t),n&&n()};return this.timeouts.push(r),()=>new Promise(((i,o)=>{r(),n=o,t=setTimeout((()=>{t=void 0,n=void 0,i()}),e)}))}convertColorValues(e){if(!Array.isArray(e))return e||"";if(e.length<2)return e[0]||"";const t=document.createElement("canvas"),n=t.getContext("2d"),r=t.height*(window.devicePixelRatio||1),i=n.createLinearGradient(0,0,0,r),o=1/(e.length-1);return e.forEach(((e,t)=>{const n=t*o;i.addColorStop(n,e)})),i}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(e,t,n,r){const i=e[0],o=e[1]||e[0],s=i.length,{width:a,height:u}=n.canvas,l=u/2,c=this.getPixelRatio(),d=t.barWidth?t.barWidth*c:1,h=t.barGap?t.barGap*c:t.barWidth?d/2:0,p=t.barRadius||0,f=a/(d+h)/s,m=p&&"roundRect"in n?"roundRect":"rect";n.beginPath();let E=0,g=0,_=0;for(let A=0;A<=s;A++){const e=Math.round(A*f);if(e>E){const i=Math.round(g*l*r),o=i+Math.round(_*l*r)||1;let s=l-i;"top"===t.barAlign?s=0:"bottom"===t.barAlign&&(s=u-o),n[m](E*(d+h),s,d,o,p),E=e,g=0,_=0}const s=Math.abs(i[A]||0),a=Math.abs(o[A]||0);s>g&&(g=s),a>_&&(_=a)}n.fill(),n.closePath()}renderLineWaveform(e,t,n,r){const i=t=>{const i=e[t]||e[0],o=i.length,{height:s}=n.canvas,a=s/2,u=n.canvas.width/o;n.moveTo(0,a);let l=0,c=0;for(let e=0;e<=o;e++){const o=Math.round(e*u);if(o>l){const e=a+(Math.round(c*a*r)||1)*(0===t?-1:1);n.lineTo(l,e),l=o,c=0}const s=Math.abs(i[e]||0);s>c&&(c=s)}n.lineTo(l,a)};n.beginPath(),i(0),i(1),n.fill(),n.closePath()}renderWaveform(e,t,n){if(n.fillStyle=this.convertColorValues(t.waveColor),t.renderFunction)return void t.renderFunction(e,n);let r=t.barHeight||1;if(t.normalize){const t=Array.from(e[0]).reduce(((e,t)=>Math.max(e,Math.abs(t))),0);r=t?1/t:1}t.barWidth||t.barGap||t.barAlign?this.renderBarWaveform(e,t,n,r):this.renderLineWaveform(e,t,n,r)}renderSingleCanvas(e,t,n,r,i,o,s){const a=this.getPixelRatio(),u=document.createElement("canvas");u.width=Math.round(n*a),u.height=Math.round(r*a),u.style.width=`${n}px`,u.style.height=`${r}px`,u.style.left=`${Math.round(i)}px`,o.appendChild(u);const l=u.getContext("2d");if(this.renderWaveform(e,t,l),u.width>0&&u.height>0){const e=u.cloneNode(),n=e.getContext("2d");n.drawImage(u,0,0),n.globalCompositeOperation="source-in",n.fillStyle=this.convertColorValues(t.progressColor),n.fillRect(0,0,u.width,u.height),s.appendChild(e)}}renderMultiCanvas(t,n,r,i,o,s){const a=this.getPixelRatio(),{clientWidth:u}=this.scrollContainer;if(u*a>=r)return void this.renderSingleCanvas(t,n,u,i,0,o,s);const l=r/a;let c=Math.min(e.MAX_CANVAS_WIDTH,u,l),d={};if(n.barWidth||n.barGap){const e=n.barWidth||.5,t=e+(n.barGap||e/2);c%t!=0&&(c=Math.floor(c/t)*t)}const h=e=>{if(e<0||e>=p)return;if(d[e])return;d[e]=!0;const r=e*c,a=Math.min(l-r,c);if(a<=0)return;const u=t.map((e=>{const t=Math.floor(r/l*e.length),n=Math.floor((r+a)/l*e.length);return e.slice(t,n)}));this.renderSingleCanvas(u,n,a,i,r,o,s)},p=Math.ceil(l/c),f=this.scrollContainer.scrollLeft/l,m=Math.floor(f*p);h(m-1),h(m),h(m+1),p>1&&(this.unsubscribeOnScroll=this.on("scroll",(()=>{const{scrollLeft:t}=this.scrollContainer,n=Math.floor(t/l*p);Object.keys(d).length>e.MAX_NODES&&(o.innerHTML="",s.innerHTML="",d={}),h(n-1),h(n),h(n+1)})))}renderChannel(e,t,n,r){var{overlay:i}=t,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(t,["overlay"]);const s=document.createElement("div"),a=this.getHeight(o.height,o.splitChannels);s.style.height=`${a}px`,i&&r>0&&(s.style.marginTop=`-${a}px`),this.canvasWrapper.style.minHeight=`${a}px`,this.canvasWrapper.appendChild(s);const u=s.cloneNode();this.progressWrapper.appendChild(u),this.renderMultiCanvas(e,o,n,a,s,u)}render(e){return Ka(this,void 0,void 0,(function*(){var t;this.timeouts.forEach((e=>e())),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",null!=this.options.width&&(this.scrollContainer.style.width="number"==typeof this.options.width?`${this.options.width}px`:this.options.width);const n=this.getPixelRatio(),r=this.scrollContainer.clientWidth,i=Math.ceil(e.duration*(this.options.minPxPerSec||0));this.isScrollable=i>r;const o=this.options.fillParent&&!this.isScrollable,s=(o?r:i)*n;if(this.wrapper.style.width=o?"100%":`${i}px`,this.scrollContainer.style.overflowX=this.isScrollable?"auto":"hidden",this.scrollContainer.classList.toggle("noScrollbar",!!this.options.hideScrollbar),this.cursor.style.backgroundColor=`${this.options.cursorColor||this.options.progressColor}`,this.cursor.style.width=`${this.options.cursorWidth}px`,this.audioData=e,this.emit("render"),this.options.splitChannels)for(let a=0;a<e.numberOfChannels;a++){const n=Object.assign(Object.assign({},this.options),null===(t=this.options.splitChannels)||void 0===t?void 0:t[a]);this.renderChannel([e.getChannelData(a)],n,s,a)}else{const t=[e.getChannelData(0)];e.numberOfChannels>1&&t.push(e.getChannelData(1)),this.renderChannel(t,this.options,s,0)}Promise.resolve().then((()=>this.emit("rendered")))}))}reRender(){var e;if(null===(e=this.unsubscribeOnScroll)||void 0===e||e.call(this),delete this.unsubscribeOnScroll,!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:n}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:e}=this.progressWrapper.getBoundingClientRect();let t=e-n;t*=2,t=t<0?Math.floor(t):Math.ceil(t),t/=2,this.scrollContainer.scrollLeft+=t}}zoom(e){this.options.minPxPerSec=e,this.reRender()}scrollIntoView(e,t=!1){const{scrollLeft:n,scrollWidth:r,clientWidth:i}=this.scrollContainer,o=e*r,s=n,a=n+i,u=i/2;if(this.isDragging){const e=30;o+e>a?this.scrollContainer.scrollLeft+=e:o-e<s&&(this.scrollContainer.scrollLeft-=e)}else{(o<s||o>a)&&(this.scrollContainer.scrollLeft=o-(this.options.autoCenter?u:0));const e=o-n-u;t&&this.options.autoCenter&&e>0&&(this.scrollContainer.scrollLeft+=Math.min(e,10))}{const e=this.scrollContainer.scrollLeft,t=e/r,n=(e+i)/r;this.emit("scroll",t,n,e,e+i)}}renderProgress(e,t){if(isNaN(e))return;const n=100*e;this.canvasWrapper.style.clipPath=`polygon(${n}% 0, 100% 0, 100% 100%, ${n}% 100%)`,this.progressWrapper.style.width=`${n}%`,this.cursor.style.left=`${n}%`,this.cursor.style.transform=`translateX(-${100===Math.round(n)?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(e,t)}exportImage(e,t,n){return Ka(this,void 0,void 0,(function*(){const r=this.canvasWrapper.querySelectorAll("canvas");if(!r.length)throw new Error("No waveform data");if("dataURL"===n){const n=Array.from(r).map((n=>n.toDataURL(e,t)));return Promise.resolve(n)}return Promise.all(Array.from(r).map((n=>new Promise(((r,i)=>{n.toBlob((e=>{e?r(e):i(new Error("Could not export image"))}),e,t)})))))}))}};ru.MAX_CANVAS_WIDTH=8e3,ru.MAX_NODES=10;let iu=class extends qa{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",(()=>{requestAnimationFrame((()=>{this.emit("tick")}))})),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}},ou=class extends qa{constructor(e=new AudioContext){super(),this.bufferNode=null,this.playStartTime=0,this.playedDuration=0,this._muted=!1,this._playbackRate=1,this._duration=void 0,this.buffer=null,this.currentSrc="",this.paused=!0,this.crossOrigin=null,this.seeking=!1,this.autoplay=!1,this.addEventListener=this.on,this.removeEventListener=this.un,this.audioContext=e,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return Ka(this,void 0,void 0,(function*(){}))}get src(){return this.currentSrc}set src(e){if(this.currentSrc=e,this._duration=void 0,!e)return this.buffer=null,void this.emit("emptied");fetch(e).then((t=>{if(t.status>=400)throw new Error(`Failed to fetch ${e}: ${t.status} (${t.statusText})`);return t.arrayBuffer()})).then((t=>this.currentSrc!==e?null:this.audioContext.decodeAudioData(t))).then((t=>{this.currentSrc===e&&(this.buffer=t,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())}))}_play(){var e;if(!this.paused)return;this.paused=!1,null===(e=this.bufferNode)||void 0===e||e.disconnect(),this.bufferNode=this.audioContext.createBufferSource(),this.buffer&&(this.bufferNode.buffer=this.buffer),this.bufferNode.playbackRate.value=this._playbackRate,this.bufferNode.connect(this.gainNode);let t=this.playedDuration*this._playbackRate;t>=this.duration&&(t=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,t),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var e;this.paused=!0,null===(e=this.bufferNode)||void 0===e||e.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return Ka(this,void 0,void 0,(function*(){this.paused&&(this._play(),this.emit("play"))}))}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(e){var t,n;const r=e-this.currentTime;null===(t=this.bufferNode)||void 0===t||t.stop(this.audioContext.currentTime+r),null===(n=this.bufferNode)||void 0===n||n.addEventListener("ended",(()=>{this.bufferNode=null,this.pause()}),{once:!0})}setSinkId(e){return Ka(this,void 0,void 0,(function*(){return this.audioContext.setSinkId(e)}))}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this.bufferNode&&(this.bufferNode.playbackRate.value=e)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(e){const t=!this.paused;t&&this._pause(),this.playedDuration=e/this._playbackRate,t&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var e,t;return null!==(e=this._duration)&&void 0!==e?e:(null===(t=this.buffer)||void 0===t?void 0:t.duration)||0}set duration(e){this._duration=e}get volume(){return this.gainNode.gain.value}set volume(e){this.gainNode.gain.value=e,this.emit("volumechange")}get muted(){return this._muted}set muted(e){this._muted!==e&&(this._muted=e,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(e){return/^(audio|video)\//.test(e)}getGainNode(){return this.gainNode}getChannelData(){const e=[];if(!this.buffer)return e;const t=this.buffer.numberOfChannels;for(let n=0;n<t;n++)e.push(this.buffer.getChannelData(n));return e}};const su={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};let au=class e extends nu{static create(t){return new e(t)}constructor(e){const t=e.media||("WebAudio"===e.backend?new ou:void 0);super({media:t,mediaControls:e.mediaControls,autoplay:e.autoplay,playbackRate:e.audioRate}),this.plugins=[],this.decodedData=null,this.subscriptions=[],this.mediaSubscriptions=[],this.abortController=null,this.options=Object.assign({},su,e),this.timer=new iu;const n=t?void 0:this.getMediaElement();this.renderer=new ru(this.options,n),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const r=this.options.url||this.getSrc()||"";Promise.resolve().then((()=>{this.emit("init");const{peaks:e,duration:t}=this.options;(r||e&&t)&&this.load(r,e,t).catch((()=>null))}))}updateProgress(e=this.getCurrentTime()){return this.renderer.renderProgress(e/this.getDuration(),this.isPlaying()),e}initTimerEvents(){this.subscriptions.push(this.timer.on("tick",(()=>{if(!this.isSeeking()){const e=this.updateProgress();this.emit("timeupdate",e),this.emit("audioprocess",e)}})))}initPlayerEvents(){this.isPlaying()&&(this.emit("play"),this.timer.start()),this.mediaSubscriptions.push(this.onMediaEvent("timeupdate",(()=>{const e=this.updateProgress();this.emit("timeupdate",e)})),this.onMediaEvent("play",(()=>{this.emit("play"),this.timer.start()})),this.onMediaEvent("pause",(()=>{this.emit("pause"),this.timer.stop()})),this.onMediaEvent("emptied",(()=>{this.timer.stop()})),this.onMediaEvent("ended",(()=>{this.emit("finish")})),this.onMediaEvent("seeking",(()=>{this.emit("seeking",this.getCurrentTime())})),this.onMediaEvent("error",(e=>{this.emit("error",e.error)})))}initRendererEvents(){this.subscriptions.push(this.renderer.on("click",((e,t)=>{this.options.interact&&(this.seekTo(e),this.emit("interaction",e*this.getDuration()),this.emit("click",e,t))})),this.renderer.on("dblclick",((e,t)=>{this.emit("dblclick",e,t)})),this.renderer.on("scroll",((e,t,n,r)=>{const i=this.getDuration();this.emit("scroll",e*i,t*i,n,r)})),this.renderer.on("render",(()=>{this.emit("redraw")})),this.renderer.on("rendered",(()=>{this.emit("redrawcomplete")})),this.renderer.on("dragstart",(e=>{this.emit("dragstart",e)})),this.renderer.on("dragend",(e=>{this.emit("dragend",e)})));{let e;this.subscriptions.push(this.renderer.on("drag",(t=>{if(!this.options.interact)return;let n;this.renderer.renderProgress(t),clearTimeout(e),this.isPlaying()?n=0:!0===this.options.dragToSeek?n=200:"object"==typeof this.options.dragToSeek&&void 0!==this.options.dragToSeek&&(n=this.options.dragToSeek.debounceTime),e=setTimeout((()=>{this.seekTo(t)}),n),this.emit("interaction",t*this.getDuration()),this.emit("drag",t)})))}}initPlugins(){var e;(null===(e=this.options.plugins)||void 0===e?void 0:e.length)&&this.options.plugins.forEach((e=>{this.registerPlugin(e)}))}unsubscribePlayerEvents(){this.mediaSubscriptions.forEach((e=>e())),this.mediaSubscriptions=[]}setOptions(e){this.options=Object.assign({},this.options,e),this.renderer.setOptions(this.options),e.audioRate&&this.setPlaybackRate(e.audioRate),null!=e.mediaControls&&(this.getMediaElement().controls=e.mediaControls)}registerPlugin(e){return e._init(this),this.plugins.push(e),this.subscriptions.push(e.once("destroy",(()=>{this.plugins=this.plugins.filter((t=>t!==e))}))),e}getWrapper(){return this.renderer.getWrapper()}getWidth(){return this.renderer.getWidth()}getScroll(){return this.renderer.getScroll()}setScroll(e){return this.renderer.setScroll(e)}setScrollTime(e){const t=e/this.getDuration();this.renderer.setScrollPercentage(t)}getActivePlugins(){return this.plugins}loadAudio(e,t,n,r){return Ka(this,void 0,void 0,(function*(){var i;if(this.emit("load",e),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,!t&&!n){const n=this.options.fetchParams||{};window.AbortController&&!n.signal&&(this.abortController=new AbortController,n.signal=null===(i=this.abortController)||void 0===i?void 0:i.signal);const r=e=>this.emit("loading",e);t=yield tu.fetchBlob(e,r,n)}this.setSrc(e,t);const o=yield new Promise((e=>{const t=r||this.getDuration();t?e(t):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",(()=>e(this.getDuration())),{once:!0}))}));if(!e&&!t){const e=this.getMediaElement();e instanceof ou&&(e.duration=o)}if(n)this.decodedData=Ja.createBuffer(n,o||0);else if(t){const e=yield t.arrayBuffer();this.decodedData=yield Ja.decode(e,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())}))}load(e,t,n){return Ka(this,void 0,void 0,(function*(){try{return yield this.loadAudio(e,void 0,t,n)}catch(e){throw this.emit("error",e),e}}))}loadBlob(e,t,n){return Ka(this,void 0,void 0,(function*(){try{return yield this.loadAudio("",e,t,n)}catch(e){throw this.emit("error",e),e}}))}zoom(e){if(!this.decodedData)throw new Error("No audio loaded");this.renderer.zoom(e),this.emit("zoom",e)}getDecodedData(){return this.decodedData}exportPeaks({channels:e=2,maxLength:t=8e3,precision:n=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const r=Math.min(e,this.decodedData.numberOfChannels),i=[];for(let o=0;o<r;o++){const e=this.decodedData.getChannelData(o),r=[],s=e.length/t;for(let i=0;i<t;i++){const t=e.slice(Math.floor(i*s),Math.ceil((i+1)*s));let o=0;for(let e=0;e<t.length;e++){const n=t[e];Math.abs(n)>Math.abs(o)&&(o=n)}r.push(Math.round(o*n)/n)}i.push(r)}return i}getDuration(){let e=super.getDuration()||0;return 0!==e&&e!==1/0||!this.decodedData||(e=this.decodedData.duration),e}toggleInteraction(e){this.options.interact=e}setTime(e){super.setTime(e),this.updateProgress(e),this.emit("timeupdate",e)}seekTo(e){const t=this.getDuration()*e;this.setTime(t)}playPause(){return Ka(this,void 0,void 0,(function*(){return this.isPlaying()?this.pause():this.play()}))}stop(){this.pause(),this.setTime(0)}skip(e){this.setTime(this.getCurrentTime()+e)}empty(){this.load("",[[0]],.001)}setMediaElement(e){this.unsubscribePlayerEvents(),super.setMediaElement(e),this.initPlayerEvents()}exportImage(){return Ka(this,arguments,void 0,(function*(e="image/png",t=1,n="dataURL"){return this.renderer.exportImage(e,t,n)}))}destroy(){var e;this.emit("destroy"),null===(e=this.abortController)||void 0===e||e.abort(),this.plugins.forEach((e=>e.destroy())),this.subscriptions.forEach((e=>e())),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}};function uu({src:e,onError:t,filename:n,className:r=""}){const i=si(),o=ci(),s=le(null),a=le(),u=le(),[l,c]=oe(!1),[d,h]=oe(0),[p,f]=oe(1),m=le(),[E,g]=oe(!1);ae((()=>{a.current=new Audio;const r={normalize:!0,height:50,container:s.current};function i(){const e=a.current;e&&("PIPELINE_ERROR_READ: FFmpegDemuxer: demuxer seek failed"===e.error.message?(e.load(),c(!1)):(g(!0),c(!1),t?.()))}const o=n.slice(n.lastIndexOf(".")+1);if(function(e){return/(?:^|\/)talkjs_audio_message_[0-9]+_([0-9]+)[.](?:mp3|webm)$/.test(e)}(n)&&"webm"===o&&!a.current.canPlayType("audio/webm;codecs=opus"))r.backend="WebAudio",u.current=new Audio("data:audio/mp3;base64,//MkxAAHiAICWABElBeKPL/RANb2w+yiT1g/gTok//lP/W/l3h8QO/OCdCqCW2Cw//MkxAQHkAIWUAhEmAQXWUOFW2dxPu//9mr60ElY5sseQ+xxesmHKtZr7bsqqX2L//MkxAgFwAYiQAhEAC2hq22d3///9FTV6tA36JdgBJoOGgc+7qvqej5Zu7/7uI9l//MkxBQHAAYi8AhEAO193vt9KGOq+6qcT7hhfN5FTInmwk8RkqKImTM55pRQHQSq//MkxBsGkgoIAABHhTACIJLf99nVI///yuW1uBqWfEu7CgNPWGpUadBmZ////4sL//MkxCMHMAH9iABEmAsKioqKigsLCwtVTEFNRTMuOTkuNVVVVVVVVVVVVVVVVVVV//MkxCkECAUYCAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"),u.current.controls=!1;else{const t=a.current;t.addEventListener("error",i),t.src=e,t.preload="auto",t.preservesPitch=!0,r.media=t}m.current=function(e){if(!e.container)return;const t=getComputedStyle(e.container);let n=Xa(t.color);return n||(n=Xa("rgb(255,255,255)")),au.create({...e,barGap:e.barGap??2,barRadius:e.barRadius??0,barWidth:e.barWidth??2,barHeight:e.barHeight,hideScrollbar:!0,cursorWidth:e.cursorWidth??0,cursorColor:e.cursorColor,height:e.height??24,progressColor:e.progressColor??n.cssa(),waveColor:e.waveColor??n.alpha(n.alpha()/2).cssa()})}(r);const l=m.current;return l.on("finish",(()=>{a.current.loop=!0,c(!1)})),l.on("ready",(e=>h(Math.trunc(e)))),l.on("timeupdate",(e=>h(Math.trunc(e)))),"WebAudio"===r.backend&&l.load(e).catch((()=>{g(!0),c(!1),t?.()})),()=>{a.current?.removeEventListener("error",i),a.current=void 0,l.destroy(),m.current=void 0}}),[e,n,t]);const _=he((()=>{if("WebAudio"===m.current.options.backend)m.current.isPlaying()||u.current.play(),m.current.playPause(),c(m.current.isPlaying()??!1);else{const e=a.current;e.paused?e.play():e.pause(),e.loop=!1,!e.paused&&e.ended&&(e.load(),e.play()),c(!e.paused)}}),[]),A=he((e=>{m.current.setPlaybackRate(e),f(e)}),[]);return bt("div",E?{}:{className:`t-audio-player ${r}`,children:[bt("button",{onClick:_,children:bt(i.Icon,{className:"t-play-pause-icon",type:l?"pause":"play","aria-label":l?"pause audio":"play audio",themeCustom:o.state$.themeCustom.peek().value})}),bt("div",{className:"t-waveform",ref:s}),bt("div",{className:"t-duration",children:ko(d)}),bt(Ia,{as:"div",children:({isExpanded:e})=>bt(O,{children:[bt(Ra,{className:"t-playback-speed","aria-label":"set playback speed",children:[p,"x",bt(i.Icon,{type:"updown","aria-hidden":!0,className:"t-up-down-icon",themeCustom:o.state$.themeCustom.peek().value})]}),e&&bt(xa,{children:bt(La,{className:"t-action-menu",children:[bt("div",{className:"t-playback-heading",children:"Playback Speed"}),[.25,.5,.75,1,1.25,1.5,2].map(((e,t)=>bt(ka,{onSelect:()=>A(e),children:[bt("span",{className:"t-playback-checkmark",children:p==e?"✓":""}),e,"x"]},t)))]})})]})})]})}function lu(e){this.content=e}function cu(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i!=o){if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let e=0;i.text[e]==o.text[e];e++)n++;return n}if(i.content.size||o.content.size){let e=cu(i.content,o.content,n+1);if(null!=e)return e}n+=i.nodeSize}else n+=i.nodeSize}}function du(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(0==i||0==o)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),u=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let e=0,t=Math.min(s.text.length,a.text.length);for(;e<t&&s.text[s.text.length-e-1]==a.text[a.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let e=du(s.content,a.content,n-1,r-1);if(e)return e}n-=u,r-=u}else n-=u,r-=u}}au.BasePlugin=class extends qa{constructor(e){super(),this.subscriptions=[],this.options=e}onInit(){}_init(e){this.wavesurfer=e,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach((e=>e()))}},au.dom=eu,lu.prototype={constructor:lu,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return-1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return-1==i?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new lu(o)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new lu(n)},addToStart:function(e,t){return new lu([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new lu(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(-1==o?i.length:o,0,t,n),new lu(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return(e=lu.from(e)).size?new lu(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=lu.from(e)).size?new lu(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=lu.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach((function(t,n){e[t]=n})),e},get size(){return this.content.length>>1}},lu.from=function(e){if(e instanceof lu)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new lu(t)};class hu{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,t,n,r=0,i){for(let o=0,s=0;s<t;o++){let a=this.content[o],u=s+a.nodeSize;if(u>e&&!1!==n(a,r+s,i||null,o)&&a.content.size){let i=s+1;a.nodesBetween(Math.max(0,e-i),Math.min(a.content.size,t-i),n,r+i)}s=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i="",o=!0;return this.nodesBetween(e,t,((s,a)=>{let u=s.isText?s.text.slice(Math.max(e,a)-a,t-a):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&u||s.isTextblock)&&n&&(o?o=!1:i+=n),i+=u}),0),i}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),i=1);i<e.content.length;i++)r.push(e.content[i]);return new hu(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let i=0,o=0;o<t;i++){let s=this.content[i],a=o+s.nodeSize;a>e&&((o<e||a>t)&&(s=s.isText?s.cut(Math.max(0,e-o),Math.min(s.text.length,t-o)):s.cut(Math.max(0,e-o-1),Math.min(s.content.size,t-o-1))),n.push(s),r+=s.nodeSize),o=a}return new hu(n,r)}cutByIndex(e,t){return e==t?hu.empty:0==e&&t==this.content.length?this:new hu(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),i=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new hu(r,i)}addToStart(e){return new hu([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new hu(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return cu(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return du(this,e,t,n)}findIndex(e,t=-1){if(0==e)return fu(0,e);if(e==this.size)return fu(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=r+this.child(n).nodeSize;if(i>=e)return i==e||t>0?fu(n+1,i):fu(n,r);r=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return hu.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new hu(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return hu.empty;let t,n=0;for(let r=0;r<e.length;r++){let i=e[r];n+=i.nodeSize,r&&i.isText&&e[r-1].sameMarkup(i)?(t||(t=e.slice(0,r)),t[t.length-1]=i.withText(t[t.length-1].text+i.text)):t&&t.push(i)}return new hu(t||e,n)}static from(e){if(!e)return hu.empty;if(e instanceof hu)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new hu([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}hu.empty=new hu([],0);const pu={index:0,offset:0};function fu(e,t){return pu.index=e,pu.offset=t,pu}function mu(e,t){if(e===t)return!0;if(!e||"object"!=typeof e||!t||"object"!=typeof t)return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!mu(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!mu(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class Eu{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||(t=e.slice(0,r));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(i)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&mu(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw new RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return Eu.none;if(e instanceof Eu)return[e];let t=e.slice();return t.sort(((e,t)=>e.type.rank-t.type.rank)),t}}Eu.none=[];class gu extends Error{}class _u{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=Du(this.content,e+this.openStart,t);return n&&new _u(n,this.openStart,this.openEnd)}removeBetween(e,t){return new _u(Au(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return _u.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new _u(hu.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let i=e.firstChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(t||!i.type.spec.isolating);i=i.lastChild)r++;return new _u(e,n,r)}}function Au(e,t,n){let{index:r,offset:i}=e.findIndex(t),o=e.maybeChild(r),{index:s,offset:a}=e.findIndex(n);if(i==t||o.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(r,o.copy(Au(o.content,t-i-1,n-i-1)))}function Du(e,t,n,r){let{index:i,offset:o}=e.findIndex(t),s=e.maybeChild(i);if(o==t||s.isText)return e.cut(0,t).append(n).append(e.cut(t));let a=Du(s.content,t-o-1,n);return a&&e.replaceChild(i,s.copy(a))}function vu(e,t,n){if(n.openStart>e.depth)throw new gu("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new gu("Inconsistent open depths");return Ou(e,t,n,0)}function Ou(e,t,n,r){let i=e.index(r),o=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let s=Ou(e,t,n,r+1);return o.copy(o.content.replaceChild(i,s))}if(n.content.size){if(n.openStart||n.openEnd||e.depth!=r||t.depth!=r){let{start:i,end:s}=function(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)r=t.node(i).copy(hu.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return Nu(o,bu(e,i,s,t,r))}{let r=e.parent,i=r.content;return Nu(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}}return Nu(o,Iu(e,t,r))}function Tu(e,t){if(!t.type.compatibleContent(e.type))throw new gu("Cannot join "+t.type.name+" onto "+e.type.name)}function Su(e,t,n){let r=e.node(n);return Tu(r,t.node(n)),r}function yu(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Cu(e,t,n,r){let i=(t||e).node(n),o=0,s=t?t.index(n):i.childCount;e&&(o=e.index(n),e.depth>n?o++:e.textOffset&&(yu(e.nodeAfter,r),o++));for(let a=o;a<s;a++)yu(i.child(a),r);t&&t.depth==n&&t.textOffset&&yu(t.nodeBefore,r)}function Nu(e,t){return e.type.checkContent(t),e.copy(t)}function bu(e,t,n,r,i){let o=e.depth>i&&Su(e,t,i+1),s=r.depth>i&&Su(n,r,i+1),a=[];return Cu(null,e,i,a),o&&s&&t.index(i)==n.index(i)?(Tu(o,s),yu(Nu(o,bu(e,t,n,r,i+1)),a)):(o&&yu(Nu(o,Iu(e,t,i+1)),a),Cu(t,n,i,a),s&&yu(Nu(s,Iu(n,r,i+1)),a)),Cu(r,null,i,a),new hu(a)}function Iu(e,t,n){let r=[];return Cu(null,e,n,r),e.depth>n&&yu(Nu(Su(e,t,n+1),Iu(e,t,n+1)),r),Cu(t,null,n,r),new hu(r)}_u.empty=new _u(hu.empty,0,0);class Ru{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let i=0;i<e;i++)r+=n.child(i).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(0==e.content.size)return Eu.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var o=0;o<i.length;o++)!1!==i[o].type.spec.inclusive||r&&i[o].isInSet(r.marks)||(i=i[o--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)!1!==n[i].type.spec.inclusive||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new xu(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let n=[],r=0,i=t;for(let o=e;;){let{index:e,offset:t}=o.content.findIndex(i),s=i-t;if(n.push(o,e,r+t),!s)break;if(o=o.child(e),o.isText)break;i=s-1,r+=t+1}return new Ru(t,n,i)}static resolveCached(e,t){for(let r=0;r<wu.length;r++){let n=wu[r];if(n.pos==t&&n.doc==e)return n}let n=wu[ku]=Ru.resolve(e,t);return ku=(ku+1)%Lu,n}}let wu=[],ku=0,Lu=12;class xu{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Mu=Object.create(null);let Fu=class e{constructor(e,t,n,r=Eu.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||hu.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&mu(this.attrs,t||e.defaultAttrs||Mu)&&Eu.sameSet(this.marks,n||Eu.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return _u.empty;let r=this.resolve(e),i=this.resolve(t),o=n?0:r.sharedDepth(t),s=r.start(o),a=r.node(o).content.cut(r.pos-s,i.pos-s);return new _u(a,r.depth-o,i.depth-o)}replace(e,t,n){return vu(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(0==e)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return Ru.resolveCached(this,e)}resolveNoCache(e){return Ru.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Pu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=hu.empty,r=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,r,i),s=o&&o.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let a=r;a<i;a++)if(!this.type.allowsMarks(n.child(a).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,t);return!!o&&o.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=Eu.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Eu.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((e=>e.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=hu.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};Fu.prototype.text=void 0;class Bu extends Fu{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Pu(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Bu(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Bu(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Pu(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class Uu{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new Hu(e,t);if(null==n.next)return Uu.empty;let r=ju(n);n.next&&n.err("Unexpected trailing text");let i=function(e){let t=Object.create(null);return function n(r){let i=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Wu(e,n).forEach((e=>{r||i.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let o=t[r.join(",")]=new Uu(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Gu);o.next.push({type:i[e][0],next:t[r.join(",")]||n(r)})}return o}(Wu(e,0))}(function(e){let t=[[]];return i(function e(t,o){if("choice"==t.type)return t.exprs.reduce(((t,n)=>t.concat(e(n,o))),[]);if("seq"!=t.type){if("star"==t.type){let s=n();return r(o,s),i(e(t.expr,s),s),[r(s)]}if("plus"==t.type){let s=n();return i(e(t.expr,o),s),i(e(t.expr,s),s),[r(s)]}if("opt"==t.type)return[r(o)].concat(e(t.expr,o));if("range"==t.type){let s=o;for(let r=0;r<t.min;r++){let r=n();i(e(t.expr,s),r),s=r}if(-1==t.max)i(e(t.expr,s),s);else for(let o=t.min;o<t.max;o++){let o=n();r(s,o),i(e(t.expr,s),o),s=o}return[r(s)]}if("name"==t.type)return[r(o,void 0,t.value)];throw new Error("Unknown expr type")}for(let r=0;;r++){let s=e(t.exprs[r],o);if(r==t.exprs.length-1)return s;i(s,o=n())}}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach((e=>e.to=t))}}(r));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,o=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];o.push(n.name),!i||n.isText||n.hasRequiredAttrs()||(i=!1),-1==r.indexOf(s)&&r.push(s)}i&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(i,n),i}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return 0!=this.next.length&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!t.isText&&!t.hasRequiredAttrs())return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];return function i(o,s){let a=o.matchFragment(e,n);if(a&&(!t||a.validEnd))return hu.from(s.map((e=>e.createAndFill())));for(let e=0;e<o.next.length;e++){let{type:t,next:n}=o.next[e];if(!t.isText&&!t.hasRequiredAttrs()&&-1==r.indexOf(n)){r.push(n);let e=i(n,s.concat(t));if(e)return e}}return null}(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:o,next:s}=i.next[e];o.isLeaf||o.hasRequiredAttrs()||o.name in t||r.type&&!s.validEnd||(n.push({match:o.contentMatch,type:o,via:r}),t[o.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(this),e.map(((t,n)=>{let r=n+(t.validEnd?"*":" ")+" ";for(let i=0;i<t.next.length;i++)r+=(i?", ":"")+t.next[i].type.name+"->"+e.indexOf(t.next[i].next);return r})).join("\n")}}Uu.empty=new Uu(!0);class Hu{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function ju(e){let t=[];do{t.push($u(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function $u(e){let t=[];do{t.push(Yu(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function Yu(e){let t=function(e){if(e.eat("(")){let t=ju(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let e=n[o];e.groups.indexOf(t)>-1&&i.push(e)}return 0==i.length&&e.err("No node type or group '"+t+"' found"),i}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=Vu(e,t)}return t}function zu(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Vu(e,t){let n=zu(e),r=n;return e.eat(",")&&(r="}"!=e.next?zu(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Gu(e,t){return t-e}function Wu(e,t){let n=[];return function t(r){let i=e[r];if(1==i.length&&!i[0].term)return t(i[0].to);n.push(r);for(let e=0;e<i.length;e++){let{term:r,to:o}=i[e];r||-1!=n.indexOf(o)||t(o)}}(t),n.sort(Gu)}function Xu(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Ku(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(void 0===i){let t=e[r];if(!t.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=t.default}n[r]=i}return n}function qu(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new Zu(e[n]);return t}let Ju=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=qu(n.attrs),this.defaultAttrs=Xu(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Uu.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Ku(this.attrs,e)}create(e=null,t,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Fu(this,this.computeAttrs(e),hu.from(t),Eu.setFrom(n))}createChecked(e=null,t,n){return t=hu.from(t),this.checkContent(t),new Fu(this,this.computeAttrs(e),t,Eu.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=hu.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(hu.empty,!0);return i?new Fu(this,e,t.append(i),Eu.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(null==this.markSet)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:Eu.none:e}static compile(t,n){let r=Object.create(null);t.forEach(((t,i)=>r[t]=new e(t,n,i)));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let e in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Zu{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Qu{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=qu(r.attrs),this.excluded=null;let i=Xu(this.attrs);this.instance=i?new Eu(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Eu(this,Ku(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,i)=>n[e]=new Qu(e,r++,t,i))),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}function el(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],o=e.marks[i],s=o;if(o)n.push(o);else for(let t in e.marks){let r=e.marks[t];("_"==i||r.spec.group&&r.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=r)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class tl{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new al(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new al(this,t,!0);return n.addAll(e,t.from,t.to),_u.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(ul(e,n.tag)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],o=r.style;if(!(0!=o.indexOf(e)||r.context&&!n.matchesContext(r.context)||o.length>e.length&&(61!=o.charCodeAt(e.length)||o.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?50:e.priority)<n)break}t.splice(r,0,e)}for(let r in e.marks){let t=e.marks[r].spec.parseDOM;t&&t.forEach((e=>{n(e=ll(e)),e.mark||e.ignore||e.clearMark||(e.mark=r)}))}for(let r in e.nodes){let t=e.nodes[r].spec.parseDOM;t&&t.forEach((e=>{n(e=ll(e)),e.node||e.ignore||e.mark||(e.node=r)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new tl(e,tl.schemaRules(e)))}}const nl={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},rl={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},il={ol:!0,ul:!0};function ol(e,t,n){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&n}class sl{constructor(e,t,n,r,i,o,s){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=Eu.none,this.stashMarks=[],this.match=o||(4&s?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(hu.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let n=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-e[0].length))}}let t=hu.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(hu.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,n=this.pendingMarks;t<n.length;t++){let r=n[t];(this.type?this.type.allowsMarkType(r.type):cl(r.type,e))&&!r.isInSet(this.activeMarks)&&(this.activeMarks=r.addToSet(this.activeMarks),this.pendingMarks=r.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!nl.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class al{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0;let r,i=t.topNode,o=ol(null,t.preserveWhitespace,0)|(n?4:0);r=i?new sl(i.type,i.attrs,Eu.none,Eu.none,!0,t.topMatch||i.type.contentMatch,o):new sl(n?null:e.schema.topNodeType,null,Eu.none,Eu.none,!0,null,o),this.nodes=[r],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){3==e.nodeType?this.addTextNode(e):1==e.nodeType&&this.addElement(e)}withStyleRules(e,t){let n=e.getAttribute("style");if(!n)return t();let r=this.readStyles(function(e){let t,n=/\s*([\w-]+)\s*:\s*([^;]+)/g,r=[];for(;t=n.exec(e);)r.push(t[1],t[2].trim());return r}(n));if(!r)return;let[i,o]=r,s=this.top;for(let a=0;a<o.length;a++)this.removePendingMark(o[a],s);for(let a=0;a<i.length;a++)this.addPendingMark(i[a]);t();for(let a=0;a<i.length;a++)this.removePendingMark(i[a],s);for(let a=0;a<o.length;a++)this.addPendingMark(o[a])}addTextNode(e){let t=e.nodeValue,n=this.top;if(2&n.options||n.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&n.options)t=2&n.options?t.replace(/\r\n?/g,"\n"):t.replace(/\r?\n|\r/g," ");else if(t=t.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(t)&&this.open==this.nodes.length-1){let r=n.content[n.content.length-1],i=e.previousSibling;(!r||i&&"BR"==i.nodeName||r.isText&&/[ \t\r\n\u000c]$/.test(r.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let n,r=e.nodeName.toLowerCase();il.hasOwnProperty(r)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&il.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let i=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(n=this.parser.matchTag(e,this,t));if(i?i.ignore:rl.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!i||i.skip||i.closeParent){i&&i.closeParent?this.open=Math.max(0,this.open-1):i&&i.skip.nodeType&&(e=i.skip);let t,n=this.top,o=this.needsBlock;if(nl.hasOwnProperty(r))n.content.length&&n.content[0].isInline&&this.open&&(this.open--,n=this.top),t=!0,n.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);i&&i.skip?this.addAll(e):this.withStyleRules(e,(()=>this.addAll(e))),t&&this.sync(n),this.needsBlock=o}else this.withStyleRules(e,(()=>{this.addElementByRule(e,i,!1===i.consuming?n:void 0)}))}leafFallback(e){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"))}ignoreFallback(e){"BR"!=e.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Eu.none,n=Eu.none;for(let r=0;r<e.length;r+=2)for(let i;;){let o=this.parser.matchStyle(e[r],e[r+1],this,i);if(!o)break;if(o.ignore)return null;if(o.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach((e=>{o.clearMark(e)&&(n=e.addToSet(n))})):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;i=o}return[t,n]}addElementByRule(e,t,n){let r,i,o;t.node?(i=this.parser.schema.nodes[t.node],i.isLeaf?this.insertNode(i.create(t.attrs))||this.leafFallback(e):r=this.enter(i,t.attrs||null,t.preserveWhitespace)):(o=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(o));let s=this.top;if(i&&i.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(s)&&this.open--,o&&this.removePendingMark(o,s)}addAll(e,t,n){let r=t||0;for(let i=t?e.childNodes[t]:e.firstChild,o=null==n?null:e.childNodes[n];i!=o;i=i.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(i);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let i=this.nodes[r],o=i.findWrapping(e);if(o&&(!t||t.length>o.length)&&(t=o,n=i,!o.length))break;if(i.solid)break}if(!t)return!1;this.sync(n);for(let r=0;r<t.length;r++)this.enterInner(t[r],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&this.enterInner(e)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let n=t.activeMarks;for(let r=0;r<e.marks.length;r++)t.type&&!t.type.allowsMarkType(e.marks[r].type)||(n=e.marks[r].addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n){let r=this.findPlace(e.create(t));return r&&this.enterInner(e,t,!0,n),r}enterInner(e,t=null,n=!1,r){this.closeExtra();let i=this.top;i.applyPending(e),i.match=i.match&&i.match.matchType(e);let o=ol(e,r,i.options);4&i.options&&0==i.content.length&&(o|=4),this.nodes.push(new sl(e,t,i.activeMarks,i.pendingMarks,n,null,o)),this.open++}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)null==this.find[t].pos&&1==e.nodeType&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)null==this.find[r].pos&&1==e.nodeType&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),n=this.options.context,r=!(this.isOpen||n&&n.parent.type!=this.nodes[0].type),i=-(n?n.depth+1:0)+(r?0:1),o=(e,s)=>{for(;e>=0;e--){let a=t[e];if(""==a){if(e==t.length-1||0==e)continue;for(;s>=i;s--)if(o(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=i?n.node(s-i).type:null;if(!e||e.name!=a&&-1==e.groups.indexOf(a))return!1;s--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes[t];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(e){let t=function(e,t){for(let n=0;n<t.length;n++)if(e.eq(t[n]))return t[n]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let n=this.open;n>=0;n--){let r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);let t=r.popFromStashMark(e);t&&r.type&&r.type.allowsMarkType(t.type)&&(r.activeMarks=t.addToSet(r.activeMarks))}if(r==t)break}}}function ul(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function ll(e){let t={};for(let n in e)t[n]=e[n];return t}function cl(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let o=[],s=e=>{o.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t)return!0;if(o.indexOf(i)<0&&s(i))return!0}};if(s(i.contentMatch))return!0}}class dl{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=pl(t).createDocumentFragment());let r=n,i=[];return e.forEach((e=>{if(i.length||e.marks.length){let n=0,o=0;for(;n<i.length&&o<e.marks.length;){let t=e.marks[o];if(this.marks[t.type.name]){if(!t.eq(i[n][0])||!1===t.type.spec.spanning)break;n++,o++}else o++}for(;n<i.length;)r=i.pop()[1];for(;o<e.marks.length;){let n=e.marks[o++],s=this.serializeMark(n,e.isInline,t);s&&(i.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))})),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=dl.renderSpec(pl(t),this.nodes[e.type.name](e));if(r){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&dl.renderSpec(pl(n),r(e,t))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,i=t[0],o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s=n?e.createElementNS(n,i):e.createElement(i),a=t[1],u=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){u=2;for(let e in a)if(null!=a[e]){let t=e.indexOf(" ");t>0?s.setAttributeNS(e.slice(0,t),e.slice(t+1),a[e]):s.setAttribute(e,a[e])}}for(let l=u;l<t.length;l++){let i=t[l];if(0===i){if(l<t.length-1||l>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:t,contentDOM:o}=dl.renderSpec(e,i,n);if(s.appendChild(t),o){if(r)throw new RangeError("Multiple content holes");r=o}}}return{dom:s,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new dl(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=hl(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return hl(e.marks)}}function hl(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function pl(e){return e.document||window.document}const fl=Math.pow(2,16);function ml(e,t){return e+t*fl}function El(e){return 65535&e}let gl=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}},_l=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=El(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/fl}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let u=this.ranges[s+i],l=this.ranges[s+o],c=a+u;if(e<=c){let i=a+r+((u?e==a?-1:e==c?1:t:t)<0?0:l);if(n)return i;let o=e==(t<0?a:c)?null:ml(s/3,e-a),d=e==a?2:e==c?1:4;return(t<0?e!=a:e!=c)&&(d|=8),new gl(i,d,o)}r+=l-u}return n?e+r:new gl(e+r,0,null)}touches(e,t){let n=0,r=El(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let t=this.ranges[s]-(this.inverted?n:0);if(t>e)break;let a=this.ranges[s+i];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),u=this.ranges[r+t],l=this.ranges[r+n];e(s,s+u,a,a+l),i+=l-u}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};_l.empty=new _l([]);let Al=class e{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(t=0,n=this.maps.length){return new e(this.maps,this.mirror,t,n)}copy(){return new e(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let i=this.from;i<this.to;i++){let n=this.maps[i].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(i);if(null!=t&&t>i&&t<this.to){i=t,e=this.maps[t].recover(n.recover);continue}}r|=n.delInfo,e=n.pos}return n?e:new gl(e,r,null)}};const Dl=Object.create(null);let vl=class{getMap(){return _l.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Dl[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Dl)throw new RangeError("Duplicate use of step JSON ID "+e);return Dl[e]=t,t.prototype.jsonID=e,t}},Ol=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof gu)return e.fail(t.message);throw t}}};function Tl(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(Tl(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return hu.fromArray(r)}let Sl=class e extends vl{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new _u(Tl(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Ol.fromReplace(e,this.from,this.to,i)}invert(){return new yl(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};vl.jsonID("addMark",Sl);let yl=class e extends vl{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new _u(Tl(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Ol.fromReplace(e,this.from,this.to,n)}invert(){return new Sl(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};vl.jsonID("removeMark",yl);let Cl=class e extends vl{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ol.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ol.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Nl(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};vl.jsonID("addNodeMark",Cl);let Nl=class e extends vl{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ol.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Ol.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Cl(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};vl.jsonID("removeNodeMark",Nl);let bl=class e extends vl{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Rl(e,this.from,this.to)?Ol.fail("Structure replace would overwrite content"):Ol.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new _l([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?_u.empty:new _u(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}}{let n=this.slice.size+t.slice.size==0?_u.empty:new _u(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,_u.fromJSON(t,n.slice),!!n.structure)}};vl.jsonID("replace",bl);let Il=class e extends vl{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Rl(e,this.from,this.gapFrom)||Rl(e,this.gapTo,this.to)))return Ol.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Ol.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Ol.fromReplace(e,this.from,this.to,n):Ol.fail("Content does not fit in gap")}getMap(){return new _l([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new e(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,_u.fromJSON(t,n.slice),n.insert,!!n.structure)}};function Rl(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function wl(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}vl.jsonID("replaceAround",Il);let kl=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=hu.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=hu.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new _u(i,o,s);return e>-1?new Il(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new bl(n.pos,r.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Ml(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let o=this.depth;o>=0;o--){let e,{type:s,match:a}=this.frontier[o],u=null;if(1==t&&(i?a.matchType(i.type)||(u=a.fillBefore(hu.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:o,parent:r,inject:u};if(2==t&&i&&(e=a.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:r,wrap:e};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ml(e,t);return!(!r.childCount||r.firstChild.isLeaf||(this.unplaced=new _u(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ml(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new _u(Ll(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new _u(Ll(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let f=0;f<i.length;f++)this.openFrontierNode(i[f]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,u=0,l=[],{match:c,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));c=c.matchFragment(r)}let h=s.size+e-(o.content.size-o.openEnd);for(;u<s.childCount;){let e=s.child(u),t=c.matchType(e.type);if(!t)break;u++,(u>1||0==a||e.content.size)&&(c=t,l.push(Fl(e.mark(d.allowedMarks(e.marks)),1==u?a:0,u==s.childCount?h:-1)))}let p=u==s.childCount;p||(h=-1),this.placed=xl(this.placed,t,hu.from(l)),this.frontier[t].match=c,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=s;f<h;f++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=p?0==e?_u.empty:new _u(Ll(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new _u(Ll(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Bl(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Bl(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Bl(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=xl(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=xl(this.placed,this.depth,hu.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(hu.empty,!0);e.childCount&&(this.placed=xl(this.placed,this.frontier.length,e))}};function Ll(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Ll(e.firstChild.content,t-1,n)))}function xl(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(xl(e.lastChild.content,t-1,n)))}function Ml(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Fl(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Fl(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(hu.empty,!0)))),e.copy(r)}function Bl(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}function Pl(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Pl(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(hu.empty,!0))}return e}function Ul(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}let Hl=class e extends vl{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ol.fail("No node at attribute step's position");let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Ol.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(r),0,t.isLeaf?0:1))}getMap(){return _l.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new e(n.pos,n.attr,n.value)}};vl.jsonID("attr",Hl);let jl=class e extends vl{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Ol.ok(n)}getMap(){return _l.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if("string"!=typeof n.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new e(n.attr,n.value)}};vl.jsonID("docAttr",jl);let $l=class extends Error{};$l=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},($l.prototype=Object.create(Error.prototype)).constructor=$l,$l.prototype.name="TransformError";class Yl{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Al}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new $l(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=_u.empty){let r=function(e,t,n=t,r=_u.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return wl(i,o,r)?new bl(t,n,r):new kl(i,o,r).fit()}(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new _u(hu.from(n),0,0))}delete(e,t){return this.replace(e,t,_u.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),o=e.doc.resolve(n);if(wl(i,o,r))return e.step(new bl(t,n,r));let s=Ul(i,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let p=i.depth,f=i.pos-1;p>0;p--,f--){let e=i.node(p).type.spec;if(e.defining||e.definingAsContext||e.isolating)break;s.indexOf(p)>-1?a=p:i.before(p)==f&&s.splice(1,0,-p)}let u=s.indexOf(a),l=[],c=r.openStart;for(let p=r.content,f=0;;f++){let e=p.firstChild;if(l.push(e),f==r.openStart)break;p=e.content}for(let p=c-1;p>=0;p--){let e=l[p],t=(d=e.type).spec.defining||d.spec.definingForContent;if(t&&!e.sameMarkup(i.node(Math.abs(a)-1)))c=p;else if(t||!e.type.isTextblock)break}var d;for(let p=r.openStart;p>=0;p--){let t=(p+c+1)%(r.openStart+1),a=l[t];if(a)for(let l=0;l<s.length;l++){let c=s[(l+u)%s.length],d=!0;c<0&&(d=!1,c=-c);let h=i.node(c-1),p=i.index(c-1);if(h.canReplaceWith(p,p,a.type,a.marks))return e.replace(i.before(c),d?o.after(c):n,new _u(Pl(r.content,0,r.openStart,t),t,r.openEnd))}}let h=e.steps.length;for(let p=s.length-1;p>=0&&(e.replace(t,n,r),!(e.steps.length>h));p--){let e=s[p];e<0||(t=i.before(e),n=o.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let i=r.depth-1;i>=0;i--){let e=r.index(i);if(r.node(i).canReplaceWith(e,e,n))return r.before(i+1);if(e>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let e=r.indexAfter(i);if(r.node(i).canReplaceWith(e,e,n))return r.after(i+1);if(e<r.node(i).childCount)return null}return null}(e.doc,t,r.type);null!=i&&(t=n=i)}e.replaceRange(t,n,new _u(hu.from(r),0,0))}(this,e,t,n),this}deleteRange(e,t){return function(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),o=Ul(r,i);for(let s=0;s<o.length;s++){let t=o[s],n=s==o.length-1;if(n&&0==t||r.node(t).type.contentMatch.validEnd)return e.delete(r.start(t),i.end(t));if(t>0&&(n||r.node(t-1).canReplace(r.index(t-1),i.indexAfter(t-1))))return e.delete(r.before(t),i.after(t))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(t-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return e.delete(r.before(s),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return function(e,t,n){let{$from:r,$to:i,depth:o}=t,s=r.before(o+1),a=i.after(o+1),u=s,l=a,c=hu.empty,d=0;for(let f=o,m=!1;f>n;f--)m||r.index(f)>0?(m=!0,c=hu.from(r.node(f).copy(c)),d++):u--;let h=hu.empty,p=0;for(let f=o,m=!1;f>n;f--)m||i.after(f+1)<i.end(f)?(m=!0,h=hu.from(i.node(f).copy(h)),p++):l++;e.step(new Il(u,l,s,a,new _u(c.append(h),d,p),c.size-d,!0))}(this,e,t),this}join(e,t=1){return function(e,t,n){let r=new bl(t-n,t+n,_u.empty,!0);e.step(r)}(this,e,t),this}wrap(e,t){return function(e,t,n){let r=hu.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let e=n[s].type.contentMatch.matchFragment(r);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=hu.from(n[s].type.create(n[s].attrs,r))}let i=t.start,o=t.end;e.step(new Il(i,o,i,o,new _u(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){return function(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=e.steps.length;e.doc.nodesBetween(t,n,((t,n)=>{if(t.isTextblock&&!t.hasMarkup(r,i)&&function(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}(e.doc,e.mapping.slice(o).map(n),r)){e.clearIncompatible(e.mapping.slice(o).map(n,1),r);let s=e.mapping.slice(o),a=s.map(n,1),u=s.map(n+t.nodeSize,1);return e.step(new Il(a,u,a+1,u-1,new _u(hu.from(r.create(i,null,t.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return function(e,t,n,r,i){let o=e.doc.nodeAt(t);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return e.replaceWith(t,t+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Il(t,t+o.nodeSize,t+1,t+o.nodeSize-1,new _u(hu.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Hl(e,t,n)),this}setDocAttribute(e,t){return this.step(new jl(e,t)),this}addNodeMark(e,t){return this.step(new Cl(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Eu)){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(n.marks)))return this}return this.step(new Nl(e,t)),this}split(e,t=1,n){return function(e,t,n=1,r){let i=e.doc.resolve(t),o=hu.empty,s=hu.empty;for(let a=i.depth,u=i.depth-n,l=n-1;a>u;a--,l--){o=hu.from(i.node(a).copy(o));let e=r&&r[l];s=hu.from(e?e.type.create(e.attrs,s):i.node(a).copy(s))}e.step(new bl(t,t,new _u(o.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){return function(e,t,n,r){let i,o,s=[],a=[];e.doc.nodesBetween(t,n,((e,u,l)=>{if(!e.isInline)return;let c=e.marks;if(!r.isInSet(c)&&l.type.allowsMarkType(r.type)){let l=Math.max(u,t),d=Math.min(u+e.nodeSize,n),h=r.addToSet(c);for(let e=0;e<c.length;e++)c[e].isInSet(h)||(i&&i.to==l&&i.mark.eq(c[e])?i.to=d:s.push(i=new yl(l,d,c[e])));o&&o.to==l?o.to=d:a.push(o=new Sl(l,d,r))}})),s.forEach((t=>e.step(t))),a.forEach((t=>e.step(t)))}(this,e,t,n),this}removeMark(e,t,n){return function(e,t,n,r){let i=[],o=0;e.doc.nodesBetween(t,n,((e,s)=>{if(!e.isInline)return;o++;let a=null;if(r instanceof Qu){let t,n=e.marks;for(;t=r.isInSet(n);)(a||(a=[])).push(t),n=t.removeFromSet(n)}else r?r.isInSet(e.marks)&&(a=[r]):a=e.marks;if(a&&a.length){let r=Math.min(s+e.nodeSize,n);for(let e=0;e<a.length;e++){let n,u=a[e];for(let e=0;e<i.length;e++){let t=i[e];t.step==o-1&&u.eq(i[e].style)&&(n=t)}n?(n.to=r,n.step=o):i.push({style:u,from:Math.max(s,t),to:r,step:o})}}})),i.forEach((t=>e.step(new yl(t.from,t.to,t.style))))}(this,e,t,n),this}clearIncompatible(e,t,n){return function(e,t,n,r=n.contentMatch){let i=e.doc.nodeAt(t),o=[],s=t+1;for(let a=0;a<i.childCount;a++){let t=i.child(a),u=s+t.nodeSize,l=r.matchType(t.type);if(l){r=l;for(let r=0;r<t.marks.length;r++)n.allowsMarkType(t.marks[r].type)||e.step(new yl(s,u,t.marks[r]));if(t.isText&&!n.spec.code){let e,r,i=/\r?\n|\r/g;for(;e=i.exec(t.text);)r||(r=new _u(hu.from(n.schema.text(" ",n.allowedMarks(t.marks))),0,0)),o.push(new bl(s+e.index,s+e.index+e[0].length,r))}}else o.push(new bl(s,u,_u.empty));s=u}if(!r.validEnd){let t=r.fillBefore(hu.empty,!0);e.replace(s,s,new _u(t,0,0))}for(let a=o.length-1;a>=0;a--)e.step(o[a])}(this,e,t,n),this}}const zl=Object.create(null);class Vl{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Gl(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=_u.empty){let n=t.content.lastChild,r=null;for(let s=0;s<t.openEnd;s++)r=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let s=0;s<o.length;s++){let{$from:a,$to:u}=o[s],l=e.mapping.slice(i);e.replaceRange(l.map(a.pos),l.map(u.pos),s?_u.empty:t),0==s&&nc(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=e.mapping.slice(n),u=a.map(o.pos),l=a.map(s.pos);i?e.deleteRange(u,l):(e.replaceRangeWith(u,l,t),nc(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new Kl(e):tc(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let i=e.depth-1;i>=0;i--){let r=t<0?tc(e.node(0),e.node(i),e.before(i+1),e.index(i),t,n):tc(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,t,n);if(r)return r}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Ql(e.node(0))}static atStart(e){return tc(e,e,0,0,1)||new Ql(e)}static atEnd(e){return tc(e,e,e.content.size,e.childCount,-1)||new Ql(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=zl[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in zl)throw new RangeError("Duplicate use of selection JSON ID "+e);return zl[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Kl.between(this.$anchor,this.$head).getBookmark()}}Vl.prototype.visible=!0;class Gl{constructor(e,t){this.$from=e,this.$to=t}}let Wl=!1;function Xl(e){Wl||e.parent.inlineContent||(Wl=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class Kl extends Vl{constructor(e,t=e){Xl(e),Xl(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return Vl.near(n);let r=e.resolve(t.map(this.anchor));return new Kl(r.parent.inlineContent?r:n,n)}replace(e,t=_u.empty){if(super.replace(e,t),t==_u.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof Kl&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ql(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new Kl(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=Vl.findFrom(t,n,!0)||Vl.findFrom(t,-n,!0);if(!e)return Vl.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(Vl.findFrom(e,-n,!0)||Vl.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0)&&(e=t),new Kl(e,t)}}Vl.jsonID("text",Kl);class ql{constructor(e,t){this.anchor=e,this.head=t}map(e){return new ql(e.map(this.anchor),e.map(this.head))}resolve(e){return Kl.between(e.resolve(this.anchor),e.resolve(this.head))}}class Jl extends Vl{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),i=e.resolve(r);return n?Vl.near(i):new Jl(i)}content(){return new _u(hu.from(this.node),0,0)}eq(e){return e instanceof Jl&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Zl(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Jl(e.resolve(t.anchor))}static create(e,t){return new Jl(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}Jl.prototype.visible=!1,Vl.jsonID("node",Jl);class Zl{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new ql(n,n):new Zl(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Jl.isSelectable(n)?new Jl(t):Vl.near(t)}}class Ql extends Vl{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=_u.empty){if(t==_u.empty){e.delete(0,e.doc.content.size);let t=Vl.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ql(e)}map(e){return new Ql(e)}eq(e){return e instanceof Ql}getBookmark(){return ec}}Vl.jsonID("all",Ql);const ec={map(){return this},resolve:e=>new Ql(e)};function tc(e,t,n,r,i,o=!1){if(t.inlineContent)return Kl.create(e,n);for(let s=r-(i>0?0:1);i>0?s<t.childCount:s>=0;s+=i){let r=t.child(s);if(r.isAtom){if(!o&&Jl.isSelectable(r))return Jl.create(e,n-(i<0?r.nodeSize:0))}else{let t=tc(e,r,n+i,i<0?r.childCount:0,i,o);if(t)return t}n+=r.nodeSize*i}return null}function nc(e,t,n){let r=e.steps.length-1;if(r<t)return;let i,o=e.steps[r];(o instanceof bl||o instanceof Il)&&(e.mapping.maps[r].forEach(((e,t,n,r)=>{null==i&&(i=r)})),e.setSelection(Vl.near(e.doc.resolve(i),n)))}class rc extends Yl{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=-3&this.updated|1,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return Eu.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Eu.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),this.selection.empty||this.setSelection(Vl.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function ic(e,t){return t&&e?e.bind(t):e}class oc{constructor(e,t,n){this.name=e,this.init=ic(t.init,n),this.apply=ic(t.apply,n)}}const sc=[new oc("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new oc("selection",{init:(e,t)=>e.selection||Vl.atStart(t.doc),apply:e=>e.selection}),new oc("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new oc("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class ac{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=sc.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new oc(e.key,e.spec.state,e))}))}}class uc{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let s=this.config.plugins[o];if(s.spec.appendTransaction){let a=r?r[o].n:0,u=r?r[o].state:this,l=a<t.length&&s.spec.appendTransaction.call(s,a?t.slice(a):t,u,n);if(l&&n.filterTransaction(l,o)){if(l.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<o?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[o]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new uc(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let i=n[r];t[i.name]=i.apply(e,this[i.name],this,t)}return t}get tr(){return new rc(this)}static create(e){let t=new ac(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new uc(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new ac(this.schema,e.plugins),n=t.fields,r=new uc(t);for(let i=0;i<n.length;i++){let t=n[i].name;r[t]=this.hasOwnProperty(t)?this[t]:n[i].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map((e=>e.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let r=new ac(e.schema,e.plugins),i=new uc(r);return r.fields.forEach((r=>{if("doc"==r.name)i.doc=Fu.fromJSON(e.schema,t.doc);else if("selection"==r.name)i.selection=Vl.fromJSON(i.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(i.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let o in n){let s=n[o],a=s.spec.state;if(s.key==r.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(t,o))return void(i[r.name]=a.fromJSON.call(s,e,t[o],i))}i[r.name]=r.init(e,i)}})),i}}function lc(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):"handleDOMEvents"==r&&(i=lc(i,t,{})),n[r]=i}return n}class cc{constructor(e){this.spec=e,this.props={},e.props&&lc(e.props,this,this.props),this.key=e.key?e.key.key:hc("plugin")}getState(e){return e[this.key]}}const dc=Object.create(null);function hc(e){return e in dc?e+"$"+ ++dc[e]:(dc[e]=0,e+"$")}class pc{constructor(e="key"){this.key=hc(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const fc=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},mc=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let Ec=null;const gc=function(e,t,n){let r=Ec||(Ec=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},_c=function(e,t,n,r){return n&&(Dc(e,t,n,r,-1)||Dc(e,t,n,r,1))},Ac=/^(img|br|input|textarea|hr)$/i;function Dc(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:vc(e))){let n=e.parentNode;if(!n||1!=n.nodeType||Oc(e)||Ac.test(e.nodeName)||"false"==e.contentEditable)return!1;t=fc(e)+(i<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(i<0?-1:0)]).contentEditable)return!1;t=i<0?vc(e):0}}}function vc(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Oc(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const Tc=function(e){return e.focusNode&&_c(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Sc(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const yc="undefined"!=typeof navigator?navigator:null,Cc="undefined"!=typeof document?document:null,Nc=yc&&yc.userAgent||"",bc=/Edge\/(\d+)/.exec(Nc),Ic=/MSIE \d/.exec(Nc),Rc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Nc),wc=!!(Ic||Rc||bc),kc=Ic?document.documentMode:Rc?+Rc[1]:bc?+bc[1]:0,Lc=!wc&&/gecko\/(\d+)/i.test(Nc);Lc&&(/Firefox\/(\d+)/.exec(Nc)||[0,0])[1];const xc=!wc&&/Chrome\/(\d+)/.exec(Nc),Mc=!!xc,Fc=xc?+xc[1]:0,Bc=!wc&&!!yc&&/Apple Computer/.test(yc.vendor),Pc=Bc&&(/Mobile\/\w+/.test(Nc)||!!yc&&yc.maxTouchPoints>2),Uc=Pc||!!yc&&/Mac/.test(yc.platform),Hc=!!yc&&/Win/.test(yc.platform),jc=/Android \d/.test(Nc),$c=!!Cc&&"webkitFontSmoothing"in Cc.documentElement.style,Yc=$c?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function zc(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Vc(e,t){return"number"==typeof e?e:e[t]}function Gc(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Wc(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,o=e.dom.ownerDocument;for(let s=n||e.dom;s;s=mc(s)){if(1!=s.nodeType)continue;let e=s,n=e==o.body,a=n?zc(o):Gc(e),u=0,l=0;if(t.top<a.top+Vc(r,"top")?l=-(a.top-t.top+Vc(i,"top")):t.bottom>a.bottom-Vc(r,"bottom")&&(l=t.bottom-t.top>a.bottom-a.top?t.top+Vc(i,"top")-a.top:t.bottom-a.bottom+Vc(i,"bottom")),t.left<a.left+Vc(r,"left")?u=-(a.left-t.left+Vc(i,"left")):t.right>a.right-Vc(r,"right")&&(u=t.right-a.right+Vc(i,"right")),u||l)if(n)o.defaultView.scrollBy(u,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),u&&(e.scrollLeft+=u);let i=e.scrollLeft-n,o=e.scrollTop-r;t={left:t.left-i,top:t.top-o,right:t.right-i,bottom:t.bottom-o}}if(n||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Xc(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=mc(r));return t}function Kc(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:o}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=o&&(r.scrollLeft=o)}}let qc=null;function Jc(e,t){let n,r,i,o,s=2e8,a=0,u=t.top,l=t.top;for(let c=e.firstChild,d=0;c;c=c.nextSibling,d++){let e;if(1==c.nodeType)e=c.getClientRects();else{if(3!=c.nodeType)continue;e=gc(c).getClientRects()}for(let h=0;h<e.length;h++){let p=e[h];if(p.top<=u&&p.bottom>=l){u=Math.max(p.bottom,u),l=Math.min(p.top,l);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<s){n=c,s=e,r=e&&3==n.nodeType?{left:p.right<t.left?p.right:p.left,top:t.top}:t,1==c.nodeType&&e&&(a=d+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!i&&p.left<=t.left&&p.right>=t.left&&(i=c,o={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&i&&(n=i,r=o,s=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(e,i+1),r.setStart(e,i);let n=nd(r,1);if(n.top!=n.bottom&&Zc(t,n))return{node:e,offset:i+(t.left>=(n.left+n.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||s&&1==n.nodeType?{node:e,offset:a}:Jc(n,r)}function Zc(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Qc(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let n=e.childNodes[o];if(1==n.nodeType){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Zc(t,i))return Qc(n,t,i)}}if((o=(o+1)%r)==i)break}return e}function ed(e,t){let n,r=e.dom.ownerDocument,i=0,o=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}(r,t.left,t.top);o&&({node:n,offset:i}=o);let s,a=(e.root.elementFromPoint?e.root:r).elementFromPoint(t.left,t.top);if(!a||!e.dom.contains(1!=a.nodeType?a.parentNode:a)){let n=e.dom.getBoundingClientRect();if(!Zc(t,n))return null;if(a=Qc(e.dom,t,n),!a)return null}if(Bc)for(let l=a;n&&l;l=mc(l))l.draggable&&(n=void 0);if(a=function(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}(a,t),n){if(Lc&&1==n.nodeType&&(i=Math.min(i,n.childNodes.length),i<n.childNodes.length)){let e,r=n.childNodes[i];"IMG"==r.nodeName&&(e=r.getBoundingClientRect()).right<=t.left&&e.bottom>t.top&&i++}let r;$c&&i&&1==n.nodeType&&1==(r=n.childNodes[i-1]).nodeType&&"false"==r.contentEditable&&r.getBoundingClientRect().top>=t.top&&i--,n==e.dom&&i==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=i&&1==n.nodeType&&"BR"==n.childNodes[i-1].nodeName||(s=function(e,t,n,r){let i=-1;for(let o=t,s=!1;o!=e.dom;){let t=e.docView.nearestDesc(o,!0);if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent&&!s||!t.contentDOM)){let e=t.dom.getBoundingClientRect();if(t.node.isBlock&&t.parent&&!s&&(s=!0,e.left>r.left||e.top>r.top?i=t.posBefore:(e.right<r.left||e.bottom<r.top)&&(i=t.posAfter)),!t.contentDOM&&i<0&&!t.node.isText)return(t.node.isBlock?r.top<(e.top+e.bottom)/2:r.left<(e.left+e.right)/2)?t.posBefore:t.posAfter}o=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}(e,n,i,t))}null==s&&(s=function(e,t,n){let{node:r,offset:i}=Jc(t,n),o=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();o=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,o)}(e,a,t));let u=e.docView.nearestDesc(a,!0);return{pos:s,inside:u?u.posAtStart-u.border:-1}}function td(e){return e.top<e.bottom||e.left<e.right}function nd(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(td(e))return e}return Array.prototype.find.call(n,td)||e.getBoundingClientRect()}const rd=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function id(e,t,n){let{node:r,offset:i,atom:o}=e.docView.domFromPos(t,n<0?-1:1),s=$c||Lc;if(3==r.nodeType){if(!s||!rd.test(r.nodeValue)&&(n<0?i:i!=r.nodeValue.length)){let e=i,t=i,o=n<0?1:-1;return n<0&&!i?(t++,o=-1):n>=0&&i==r.nodeValue.length?(e--,o=1):n<0?e--:t++,od(nd(gc(r,e,t),o),o<0)}{let e=nd(gc(r,i,i),n);if(Lc&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=nd(gc(r,i-1,i-1),-1);if(t.top==e.top){let n=nd(gc(r,i,i+1),-1);if(n.top!=e.top)return od(n,n.left<t.left)}}return e}}if(!e.state.doc.resolve(t-(o||0)).parent.inlineContent){if(null==o&&i&&(n<0||i==vc(r))){let e=r.childNodes[i-1];if(1==e.nodeType)return sd(e.getBoundingClientRect(),!1)}if(null==o&&i<vc(r)){let e=r.childNodes[i];if(1==e.nodeType)return sd(e.getBoundingClientRect(),!0)}return sd(r.getBoundingClientRect(),n>=0)}if(null==o&&i&&(n<0||i==vc(r))){let e=r.childNodes[i-1],t=3==e.nodeType?gc(e,vc(e)-(s?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return od(nd(t,1),!1)}if(null==o&&i<vc(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?gc(e,0,s?0:1):1==e.nodeType?e:null:null;if(t)return od(nd(t,-1),!0)}return od(nd(3==r.nodeType?gc(r):r,-n),n>=0)}function od(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function sd(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function ad(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}const ud=/[\u0590-\u08ac]/;let ld=null,cd=null,dd=!1;class hd{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode)){if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&(!(r=n.pmViewDesc)||r.parent!=this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}}let r;if(e==this.dom&&this.contentDOM)r=t>fc(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i,o=this.getDesc(r);if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}getDesc(e){let t=e.pmViewDesc;for(let n=t;n;n=n.parent)if(n==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)r=r.children[0];return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let i=0;n<this.children.length;n++){let t=this.children[n],o=i+t.size;if(o>e||t instanceof Ad){r=e-i;break}i=o}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof pd&&i.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,e&&e.dom.parentNode!=this.contentDOM;n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?fc(e.dom)+1:0}}{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,e&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?fc(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let o=n,s=0;;s++){let n=this.children[s],a=o+n.size;if(-1==r&&e<=a){let i=o+n.border;if(e>=i&&t<=a-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=o;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=fc(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(a>t||s==this.children.length-1)){t=a;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=fc(n.dom);break}t+=n.size}-1==i&&(i=this.contentDOM.childNodes.length);break}o=a}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),o=Math.max(e,t);for(let d=0,h=0;d<this.children.length;d++){let s=this.children[d],a=h+s.size;if(i>h&&o<a)return s.setSelection(e-h-s.border,t-h-s.border,n,r);h=a}let s=this.domFromPos(e,e?-1:1),a=t==e?s:this.domFromPos(t,t?-1:1),u=n.getSelection(),l=!1;if((Lc||Bc)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if(l=!(!t||"\n"!=e.nodeValue[t-1]),l&&t==e.nodeValue.length)for(let n,r=e;r;r=r.parentNode){if(n=r.nextSibling){"BR"==n.nodeName&&(s=a={node:n.parentNode,offset:fc(n)+1});break}let e=r.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];l=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(Lc&&u.focusNode&&u.focusNode!=a.node&&1==u.focusNode.nodeType){let e=u.focusNode.childNodes[u.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||l&&Bc)&&_c(s.node,s.offset,u.anchorNode,u.anchorOffset)&&_c(a.node,a.offset,u.focusNode,u.focusOffset))return;let c=!1;if((u.extend||e==t)&&!l){u.collapse(s.node,s.offset);try{e!=t&&u.extend(a.node,a.offset),c=!0}catch(e){}}if(!c){if(e>t){let e=s;s=a,a=e}let n=document.createRange();n.setEnd(a.node,a.offset),n.setStart(s.node,s.offset),u.removeAllRanges(),u.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],o=n+i.size;if(n==o?e<=o&&t>=n:e<o&&t>n){let r=n+i.border,s=o-i.border;if(e>=r&&t<=s)return this.dirty=e==n||t==o?2:1,void(e!=r||t!=s||!i.contentLost&&i.dom.parentNode==this.contentDOM?i.markDirty(e-r,t-r):i.dirty=3);i.dirty=i.dom!=i.contentDOM||i.dom.parentNode!=this.contentDOM||i.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class pd extends hd{constructor(e,t,n,r){let i,o=t.type.toDOM;if("function"==typeof o&&(o=o(n,(()=>i?i.parent?i.parent.posBeforeChild(i):void 0:r))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class fd extends hd{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class md extends hd{constructor(e,t,n,r){super(e,[],n,r),this.mark=t}static create(e,t,n,r){let i=r.nodeViews[t.type.name],o=i&&i(t,r,n);return o&&o.dom||(o=dl.renderSpec(document,t.type.spec.toDOM(t,n))),new md(e,t,o.dom,o.contentDOM||o.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=md.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;t<o&&(i=kd(i,t,o,n)),e>0&&(i=kd(i,0,e,n));for(let s=0;s<i.length;s++)i[s].parent=r;return r.children=i,r}}class Ed extends hd{constructor(e,t,n,r,i,o,s,a,u){super(e,[],i,o),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,i,o){let s,a=i.nodeViews[t.type.name],u=a&&a(t,i,(()=>s?s.parent?s.parent.posBeforeChild(s):void 0:o),n,r),l=u&&u.dom,c=u&&u.contentDOM;if(t.isText)if(l){if(3!=l.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else l=document.createTextNode(t.text);else l||({dom:l,contentDOM:c}=dl.renderSpec(document,t.type.spec.toDOM(t)));c||t.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),t.type.spec.draggable&&(l.draggable=!0));let d=l;return l=Nd(l,n,t),u?s=new Dd(e,t,n,r,l,c||null,d,u,i,o+1):t.isText?new _d(e,t,n,r,l,d,i):new Ed(e,t,n,r,l,c||null,d,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>hu.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&bd(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,o=i&&i.pos>-1?i:null,s=i&&i.pos<0,a=new Rd(this,o&&o.node,e);!function(e,t,n,r){let i=t.locals(e),o=0;if(0==i.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,i,t.forChild(o,s),n),o+=s.nodeSize}return}let s=0,a=[],u=null;for(let l=0;;){let c,d,h,p;for(;s<i.length&&i[s].to==o;){let e=i[s++];e.widget&&(c?(d||(d=[c])).push(e):c=e)}if(c)if(d){d.sort(wd);for(let e=0;e<d.length;e++)n(d[e],l,!!u)}else n(c,l,!!u);if(u)p=-1,h=u,u=null;else{if(!(l<e.childCount))break;p=l,h=e.child(l++)}for(let e=0;e<a.length;e++)a[e].to<=o&&a.splice(e--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let f=o+h.nodeSize;if(h.isText){let e=f;s<i.length&&i[s].from<e&&(e=i[s].from);for(let t=0;t<a.length;t++)a[t].to<e&&(e=a[t].to);e<f&&(u=h.cut(e-o),h=h.cut(0,e-o),f=e,p=-1)}else for(;s<i.length&&i[s].to<=f;)s++;let m=h.isInline&&!h.isLeaf?a.filter((e=>!e.inline)):a.slice();r(h,m,t.forChild(o,h),p),o=f}}(this.node,this.innerDeco,((t,i,o)=>{t.spec.marks?a.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!o&&a.syncToMarks(i==this.node.childCount?Eu.none:this.node.child(i).marks,n,e),a.placeWidget(t,e,r)}),((t,o,u,l)=>{let c;a.syncToMarks(t.marks,n,e),a.findNodeMatch(t,o,u,l)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(c=a.findIndexWithChild(i.node))>-1&&a.updateNodeAt(t,o,u,c,e)||a.updateNextNode(t,o,u,e,l,r)||a.addNode(t,o,u,e,r),r+=t.nodeSize})),a.syncToMarks([],n,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(o&&this.protectLocalComposition(e,o),vd(this.contentDOM,this.children,e),Pc&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof Kl)||n<t||r>t+this.node.content.size)return null;let i=e.domSelectionRange(),o=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=vc(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t<e.childNodes.length))return null;e=e.childNodes[t],t=0}}}(i.focusNode,i.focusOffset);if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let e=o.nodeValue,i=function(e,t,n,r){for(let i=0,o=0;i<e.childCount&&o<=r;){let s=e.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let u=s.text;for(;i<e.childCount;){let t=e.child(i++);if(o+=t.nodeSize,!t.isText)break;u+=t.text}if(o>=n){if(o>=r&&u.slice(r-t.length-a,r-a)==t)return r-t.length;let e=a<r?u.lastIndexOf(t,r-a-1):-1;if(e>=0&&e+t.length+a>=n)return a+e;if(n==r&&u.length>=r+t.length-a&&u.slice(r-a,r-a+t.length)==t)return r}}return-1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new fd(this,i,t,r);e.input.compositionNodes.push(o),this.children=kd(this.children,n,n+r.length,e,o)}update(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node)||(this.updateInner(e,t,n,r),0))}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(bd(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=yd(this.dom,this.nodeDOM,Sd(this.outerDeco,this.node,t),Sd(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function gd(e,t,n,r,i){Nd(r,t,e);let o=new Ed(void 0,e,t,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class _d extends Ed{constructor(e,t,n,r,i,o,s){super(e,t,n,r,i,null,o,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node)||(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,0))}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),i=document.createTextNode(r.text);return new _d(this.parent,r,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Ad extends hd{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Dd extends Ed{constructor(e,t,n,r,i,o,s,a,u,l){super(e,t,n,r,i,o,s,u,l),this.spec=a}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function vd(e,t,n){let r=e.firstChild,i=!1;for(let o=0;o<t.length;o++){let s=t[o],a=s.dom;if(a.parentNode==e){for(;a!=r;)r=Id(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(a,r);if(s instanceof md){let t=r?r.previousSibling:e.lastChild;vd(s.contentDOM,s.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Id(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Od=function(e){e&&(this.nodeName=e)};Od.prototype=Object.create(null);const Td=[new Od];function Sd(e,t,n){if(0==e.length)return Td;let r=n?Td[0]:new Od,i=[r];for(let o=0;o<e.length;o++){let s=e[o].type.attrs;if(s){s.nodeName&&i.push(r=new Od(s.nodeName));for(let e in s){let o=s[e];null!=o&&(n&&1==i.length&&i.push(r=new Od(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+o:"style"==e?r.style=(r.style?r.style+";":"")+o:"nodeName"!=e&&(r[e]=o))}}}return i}function yd(e,t,n,r){if(n==Td&&r==Td)return t;let i=t;for(let o=0;o<r.length;o++){let t=r[o],s=n[o];if(o){let n;s&&s.nodeName==t.nodeName&&i!=e&&(n=i.parentNode)&&n.nodeName.toLowerCase()==t.nodeName||(n=document.createElement(t.nodeName),n.pmIsDeco=!0,n.appendChild(i),s=Td[0]),i=n}Cd(i,s||Td[0],t)}return i}function Cd(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==i.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)-1==r.indexOf(i[t])&&e.classList.add(i[t]);0==e.classList.length&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let n,r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;n=r.exec(t.style);)e.style.removeProperty(n[1])}n.style&&(e.style.cssText+=n.style)}}function Nd(e,t,n){return yd(e,e,Td,Sd(t,n,1!=e.nodeType))}function bd(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function Id(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class Rd{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,i=e.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof md)){a=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let u=a.node;if(u){if(u!=e.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n){let r=0,i=this.stack.length>>1,o=Math.min(i,e.length);for(;r<o&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++){let n=this.top.children[t];if(n.matchesMark(e[i])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=md.create(this.top,e[i],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,i++}}findNodeMatch(e,t,n,r){let i,o=-1;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let s=this.index,a=Math.min(this.top.children.length,s+5);s<a;s++){let r=this.top.children[s];if(r.matchesNode(e,t,n)&&!this.preMatch.matched.has(r)){o=s;break}}return!(o<0||(this.destroyBetween(this.index,o),this.index++,0))}updateNodeAt(e,t,n,r,i){let o=this.top.children[r];return 3==o.dirty&&o.dom==o.contentDOM&&(o.dirty=2),!!o.update(e,t,n,i)&&(this.destroyBetween(this.index,r),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t)for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e;return-1}e=t}}updateNextNode(e,t,n,r,i,o){for(let s=this.index;s<this.top.children.length;s++){let a=this.top.children[s];if(a instanceof Ed){let u=this.preMatch.matched.get(a);if(null!=u&&u!=i)return!1;let l,c=a.dom,d=this.isLocked(c)&&!(e.isText&&a.node&&a.node.isText&&a.nodeDOM.nodeValue==e.text&&3!=a.dirty&&bd(t,a.outerDeco));if(!d&&a.update(e,t,n,r))return this.destroyBetween(this.index,s),a.dom!=c&&(this.changed=!0),this.index++,!0;if(!d&&(l=this.recreateWrapper(a,e,t,n,r,o)))return this.top.children[this.index]=l,l.contentDOM&&(l.dirty=2,l.updateChildren(r,o+1),l.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,o){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let s=Ed.create(this.top,t,n,r,i,o);if(s.contentDOM){s.children=e.children,e.children=[];for(let e of s.children)e.parent=s}return e.destroy(),s}addNode(e,t,n,r,i){let o=Ed.create(this.top,e,t,n,r,i);o.contentDOM&&o.updateChildren(r,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(!r||!r.matchesWidget(e)||e!=r.widget&&r.widget.type.toDOM.parentNode){let r=new pd(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof md;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof _d)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Bc||Mc)&&e&&"false"==e.dom.contentEditable&&this.addHackNode("IMG",t),this.addHackNode("BR",this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new Ad(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function wd(e,t){return e.type.side-t.type.side}function kd(e,t,n,r,i){let o=[];for(let s=0,a=0;s<e.length;s++){let u=e[s],l=a,c=a+=u.size;l>=n||c<=t?o.push(u):(l<t&&o.push(u.slice(0,t-l,r)),i&&(o.push(i),i=void 0),c>n&&o.push(u.slice(n-l,u.size,r)))}return o}function Ld(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),o=i&&0==i.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a,u,l=r.resolve(s);if(Tc(n)){for(a=l;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&Jl.isSelectable(e)&&i.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,i=t==vc(e);r||i;){if(e==n)return!0;let t=fc(e);if(!(e=e.parentNode))return!1;r=r&&0==t,i=i&&t==vc(e)}}(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;u=new Jl(s==e?l:r.resolve(e))}}else{let t=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(t<0)return null;a=r.resolve(t)}return u||(u=$d(e,a,l,"pointer"==t||e.state.selection.head<l.pos&&!o?1:-1)),u}function xd(e){return e.editable?e.hasFocus():zd(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Md(e,t=!1){let n=e.state.selection;if(Hd(e,n),xd(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Mc){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&_c(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange(),r=e.cursorWrapper.dom,i="IMG"==r.nodeName;i?n.setEnd(r.parentNode,fc(r)+1):n.setEnd(r,0),n.collapse(!1),t.removeAllRanges(),t.addRange(n),!i&&!e.state.selection.visible&&wc&&kc<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{let r,i,{anchor:o,head:s}=n;!Fd||n instanceof Kl||(n.$from.parent.inlineContent||(r=Bd(e,n.from)),n.empty||n.$from.parent.inlineContent||(i=Bd(e,n.to))),e.docView.setSelection(o,s,e.root,t),Fd&&(r&&Ud(r),i&&Ud(i)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{n.anchorNode==r&&n.anchorOffset==i||(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout((()=>{xd(e)&&!e.state.selection.visible||e.dom.classList.remove("ProseMirror-hideselection")}),20))})}(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const Fd=Bc||Mc&&Fc<63;function Bd(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Bc&&i&&"false"==i.contentEditable)return Pd(i);if(!(i&&"false"!=i.contentEditable||o&&"false"!=o.contentEditable)){if(i)return Pd(i);if(o)return Pd(o)}}function Pd(e){return e.contentEditable="true",Bc&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ud(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function Hd(e,t){if(t instanceof Jl){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(jd(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else jd(e)}function jd(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function $d(e,t,n,r){return e.someProp("createSelectionBetween",(r=>r(e,t,n)))||Kl.between(t,n,r)}function Yd(e){return!(e.editable&&!e.hasFocus())&&zd(e)}function zd(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function Vd(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return o&&Vl.findFrom(o,t)}function Gd(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Wd(e,t,n){let r=e.state.selection;if(!(r instanceof Kl)){if(r instanceof Jl&&r.node.isInline)return Gd(e,new Kl(t>0?r.$to:r.$from));{let n=Vd(e.state,t);return!!n&&Gd(e,n)}}if(n.indexOf("s")>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return Gd(e,new Kl(r.$anchor,o))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?"forward":"backward")){let n=Vd(e.state,t);return!!(n&&n instanceof Jl)&&Gd(e,n)}if(!(Uc&&n.indexOf("m")>-1)){let n,i=r.$head,o=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText)return!1;let s=t<0?i.pos-o.nodeSize:i.pos;return!!(o.isAtom||(n=e.docView.descAt(s))&&!n.contentDOM)&&(Jl.isSelectable(o)?Gd(e,new Jl(t<0?e.state.doc.resolve(i.pos-o.nodeSize):i)):!!$c&&Gd(e,new Kl(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}function Xd(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Kd(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function qd(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=!1;for(Lc&&1==n.nodeType&&r<Xd(n)&&Kd(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(1!=n.nodeType)break;{let e=n.childNodes[r-1];if(Kd(e,-1))i=n,o=--r;else{if(3!=e.nodeType)break;n=e,r=n.nodeValue.length}}}else{if(Jd(n))break;{let t=n.previousSibling;for(;t&&Kd(t,-1);)i=n.parentNode,o=fc(t),t=t.previousSibling;if(t)n=t,r=Xd(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}s?Zd(e,n,r):i&&Zd(e,i,o)}(e):function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,o,s=Xd(n);for(;;)if(r<s){if(1!=n.nodeType)break;if(!Kd(n.childNodes[r],1))break;i=n,o=++r}else{if(Jd(n))break;{let t=n.nextSibling;for(;t&&Kd(t,1);)i=t.parentNode,o=fc(t)+1,t=t.nextSibling;if(t)n=t,r=0,s=Xd(n);else{if(n=n.parentNode,n==e.dom)break;r=s=0}}}i&&Zd(e,i,o)}(e)}function Jd(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Zd(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!Oc(e);)t=fc(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!Oc(e);)t=fc(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(Tc(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout((()=>{e.state==i&&Md(e)}),50)}function Qd(e,t){let n=e.state.doc.resolve(t);if(!Mc&&!Hc&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?"ltr":"rtl"}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function eh(e,t,n){let r=e.state.selection;if(r instanceof Kl&&!r.empty||n.indexOf("s")>-1)return!1;if(Uc&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=Vd(e.state,t);if(n&&n instanceof Jl)return Gd(e,n)}if(!i.parent.inlineContent){let n=t<0?i:o,s=r instanceof Ql?Vl.near(n,t):Vl.findFrom(n,t);return!!s&&Gd(e,s)}return!1}function th(e,t){if(!(e.state.selection instanceof Kl))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let o=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let r=e.state.tr;return t<0?r.delete(n.pos-o.nodeSize,n.pos):r.delete(n.pos,n.pos+o.nodeSize),e.dispatch(r),!0}return!1}function nh(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function rh(e,t){e.someProp("transformCopied",(n=>{t=n(t,e)}));let n=[],{content:r,openStart:i,openEnd:o}=t;for(;i>1&&o>1&&1==r.childCount&&1==r.firstChild.childCount;){i--,o--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||dl.fromSchema(e.state.schema),a=ph(),u=a.createElement("div");u.appendChild(s.serializeFragment(r,{document:a}));let l,c=u.firstChild,d=0;for(;c&&1==c.nodeType&&(l=dh[c.nodeName.toLowerCase()]);){for(let e=l.length-1;e>=0;e--){let t=a.createElement(l[e]);for(;u.firstChild;)t.appendChild(u.firstChild);u.appendChild(t),d++}c=u.firstChild}c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(n)}`);let h=e.someProp("clipboardTextSerializer",(n=>n(t,e)))||t.content.textBetween(0,t.content.size,"\n\n");return{dom:u,text:h}}function ih(e,t,n,r,i){let o,s,a=i.parent.type.spec.code;if(!n&&!t)return null;let u=t&&(r||a||!n);if(u){if(e.someProp("transformPastedText",(n=>{t=n(t,a||r,e)})),a)return t?new _u(hu.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):_u.empty;let n=e.someProp("clipboardTextParser",(n=>n(t,i,r,e)));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,s=dl.fromSchema(r);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((e=>{let t=o.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))}))}}else e.someProp("transformPastedHTML",(t=>{n=t(n,e)})),o=function(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n,r=ph().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e);if((n=i&&dh[i[1].toLowerCase()])&&(e=n.map((e=>"<"+e+">")).join("")+e+n.map((e=>"</"+e+">")).reverse().join("")),r.innerHTML=e,n)for(let o=0;o<n.length;o++)r=r.querySelector(n[o])||r;return r}(n),$c&&function(e){let t=e.querySelectorAll(Mc?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&" "==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(o);let l=o&&o.querySelector("[data-pm-slice]"),c=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let e=o.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;o=e}if(!s){let t=e.someProp("clipboardParser")||e.someProp("domParser")||tl.fromSchema(e.state.schema);s=t.parseSlice(o,{preserveWhitespace:!(!u&&!c),context:i,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||oh.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(c)s=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=n.length-2;a>=0;a-=2){let e=r.nodes[n[a]];if(!e||e.hasRequiredAttrs())break;i=hu.from(e.create(n[a+1],i)),o++,s++}return new _u(i,o,s)}(ch(s,+c[1],+c[2]),c[4]);else if(s=_u.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,i=t.node(n).contentMatchAt(t.index(n)),o=[];if(e.forEach((e=>{if(!o)return;let t,n=i.findWrapping(e.type);if(!n)return o=null;if(t=o.length&&r.length&&ah(n,r,e,o[o.length-1],0))o[o.length-1]=t;else{o.length&&(o[o.length-1]=uh(o[o.length-1],r.length));let t=sh(e,n);o.push(t),i=i.matchType(t.type),r=n}})),o)return hu.from(o)}return e}(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let n=s.content.firstChild;e<s.openStart&&!n.type.spec.isolating;e++,n=n.firstChild);for(let n=s.content.lastChild;t<s.openEnd&&!n.type.spec.isolating;t++,n=n.lastChild);s=ch(s,e,t)}return e.someProp("transformPasted",(t=>{s=t(s,e)})),s}const oh=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function sh(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,hu.from(e));return e}function ah(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=ah(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(hu.from(sh(n,e,i+1))))}}function uh(e,t){if(0==t)return e;let n=e.content.replaceChild(e.childCount-1,uh(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(hu.empty,!0);return e.copy(n.append(r))}function lh(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(o=0),i<r-1&&(a=lh(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(hu.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function ch(e,t,n){return t<e.openStart&&(e=new _u(lh(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new _u(lh(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const dh={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let hh=null;function ph(){return hh||(hh=document.implementation.createHTMLDocument("title"))}const fh={},mh={},Eh={touchstart:!0,touchmove:!0};class gh{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function _h(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Ah(e){e.someProp("handleDOMEvents",(t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>Dh(e,t))}))}function Dh(e,t){return e.someProp("handleDOMEvents",(n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)}))}function vh(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Oh(e){return{left:e.clientX,top:e.clientY}}function Th(e,t,n,r,i){if(-1==r)return!1;let o=e.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(e.someProp(t,(t=>s>o.depth?t(e,n,o.nodeAfter,o.before(s),i,!0):t(e,n,o.node(s),o.before(s),i,!1))))return!0;return!1}function Sh(e,t,n){e.focused||e.focus();let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function yh(e,t,n,r){return Th(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(n=>n(e,t,r)))}function Ch(e,t,n,r){return Th(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(n=>n(e,t,r)))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Sh(e,Kl.create(r,0,r.content.size)),!0);let i=r.resolve(t);for(let o=i.depth+1;o>0;o--){let t=o>i.depth?i.nodeAfter:i.node(o),n=i.before(o);if(t.inlineContent)Sh(e,Kl.create(r,n+1,n+1+t.content.size));else{if(!Jl.isSelectable(t))continue;Sh(e,Jl.create(r,n))}return!0}}(e,n,r)}function Nh(e){return xh(e)}mh.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Rh(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!jc||!Mc||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!Pc||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(t=>t(e,n)))||function(e,t){let n=t.keyCode,r=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);if(8==n||Uc&&72==n&&"c"==r)return th(e,-1)||qd(e,-1);if(46==n&&!t.shiftKey||Uc&&68==n&&"c"==r)return th(e,1)||qd(e,1);if(13==n||27==n)return!0;if(37==n||Uc&&66==n&&"c"==r){let t=37==n?"ltr"==Qd(e,e.state.selection.from)?-1:1:-1;return Wd(e,t,r)||qd(e,t)}if(39==n||Uc&&70==n&&"c"==r){let t=39==n?"ltr"==Qd(e,e.state.selection.from)?1:-1:1;return Wd(e,t,r)||qd(e,t)}return 38==n||Uc&&80==n&&"c"==r?eh(e,-1,r)||qd(e,-1):40==n||Uc&&78==n&&"c"==r?function(e){if(!Bc||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;nh(e,n,"true"),setTimeout((()=>nh(e,n,"false")),20)}return!1}(e)||eh(e,1,r)||qd(e,1):r==(Uc?"m":"c")&&(66==n||73==n||89==n||90==n)}(e,n)?n.preventDefault():_h(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",(t=>t(e,Sc(13,"Enter")))),e.input.lastIOSEnter=0)}),200)}},mh.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},mh.keypress=(e,t)=>{let n=t;if(Rh(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||Uc&&n.metaKey)return;if(e.someProp("handleKeyPress",(t=>t(e,n))))return void n.preventDefault();let r=e.state.selection;if(!(r instanceof Kl&&r.$from.sameParent(r.$to))){let t=String.fromCharCode(n.charCode);/[\r\n]/.test(t)||e.someProp("handleTextInput",(n=>n(e,r.$from.pos,r.$to.pos,t)))||e.dispatch(e.state.tr.insertText(t).scrollIntoView()),n.preventDefault()}};const bh=Uc?"metaKey":"ctrlKey";fh.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Nh(e),i=Date.now(),o="singleClick";i-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[bh]&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=e.posAtCoords(Oh(n));s&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Ih(e,s,n,!!r)):("doubleClick"==o?yh:Ch)(e,s.pos,s.inside,n)?n.preventDefault():_h(e,"pointer"))};class Ih{constructor(e,t,n,r){let i,o;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[bh],this.allowDefault=n.shiftKey,t.inside>-1)i=e.state.doc.nodeAt(t.inside),o=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,o=n.depth?n.before():0}const s=r?null:n.target,a=s?e.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:u}=e.state;(0==n.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||u instanceof Jl&&u.from<=o&&u.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Lc||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),_h(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((()=>Md(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Oh(e))),this.updateAllowDefault(e),this.allowDefault||!t?_h(this.view,"pointer"):function(e,t,n,r,i){return Th(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(n=>n(e,t,r)))||(i?function(e,t){if(-1==t)return!1;let n,r,i=e.state.selection;i instanceof Jl&&(n=i.node);let o=e.state.doc.resolve(t);for(let s=o.depth+1;s>0;s--){let e=s>o.depth?o.nodeAfter:o.node(s);if(Jl.isSelectable(e)){r=n&&i.$from.depth>0&&s>=i.$from.depth&&o.before(i.$from.depth+1)==i.$from.pos?o.before(i.$from.depth):o.before(s);break}}return null!=r&&(Sh(e,Jl.create(e.state.doc,r)),!0)}(e,n):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&Jl.isSelectable(r))&&(Sh(e,new Jl(n)),!0)}(e,n))}(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||Bc&&this.mightDrag&&!this.mightDrag.node.isAtom||Mc&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Sh(this.view,Vl.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):_h(this.view,"pointer")}move(e){this.updateAllowDefault(e),_h(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function Rh(e,t){return!!e.composing||!!(Bc&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}fh.touchstart=e=>{e.input.lastTouch=Date.now(),Nh(e),_h(e,"pointer")},fh.touchmove=e=>{e.input.lastTouch=Date.now(),_h(e,"pointer")},fh.contextmenu=e=>Nh(e);const wh=jc?5e3:-1;function kh(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((()=>xh(e)),t))}function Lh(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function xh(e,t=!1){if(!(jc&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Lh(e),t||e.docView&&e.docView.dirty){let t=Ld(e);return t&&!t.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(t)):e.updateState(e.state),!0}return!1}}mh.compositionstart=mh.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))e.markCursor=e.state.storedMarks||n.marks(),xh(e,!0),e.markCursor=null;else if(xh(e),Lc&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){e.domSelection().collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}kh(e,wh)},mh.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionPendingChanges&&Promise.resolve().then((()=>e.domObserver.flush())),e.input.compositionID++,kh(e,20))};const Mh=wc&&kc<15||Pc&&Yc<604;function Fh(e,t,n,r,i){let o=ih(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",(t=>t(e,i,o||_u.empty))))return!0;if(!o)return!1;let s=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Bh(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}fh.copy=mh.cut=(e,t)=>{let n=t,r=e.state.selection,i="cut"==n.type;if(r.empty)return;let o=Mh?null:n.clipboardData,s=r.content(),{dom:a,text:u}=rh(e,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",u)):function(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout((()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}(e,a),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},mh.paste=(e,t)=>{let n=t;if(e.composing&&!jc)return;let r=Mh?null:n.clipboardData,i=e.input.shiftKey&&45!=e.input.lastKeyCode;r&&Fh(e,Bh(r),r.getData("text/html"),i,n)?n.preventDefault():function(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout((()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Fh(e,r.value,null,i,t):Fh(e,r.textContent,r.innerHTML,i,t)}),50)}(e,n)};class Ph{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}const Uh=Uc?"altKey":"ctrlKey";fh.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i,o=e.state.selection,s=o.empty?null:e.posAtCoords(Oh(n));if(s&&s.pos>=o.from&&s.pos<=(o instanceof Jl?o.to-1:o.to));else if(r&&r.mightDrag)i=Jl.create(e.state.doc,r.mightDrag.pos);else if(n.target&&1==n.target.nodeType){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(i=Jl.create(e.state.doc,t.posBefore))}let a=(i||e.state.selection).content(),{dom:u,text:l}=rh(e,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Mh?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Mh||n.dataTransfer.setData("text/plain",l),e.dragging=new Ph(a,!n[Uh],i)},fh.dragend=e=>{let t=e.dragging;window.setTimeout((()=>{e.dragging==t&&(e.dragging=null)}),50)},mh.dragover=mh.dragenter=(e,t)=>t.preventDefault(),mh.drop=(e,t)=>{let n=t,r=e.dragging;if(e.dragging=null,!n.dataTransfer)return;let i=e.posAtCoords(Oh(n));if(!i)return;let o=e.state.doc.resolve(i.pos),s=r&&r.slice;s?e.someProp("transformPasted",(t=>{s=t(s,e)})):s=ih(e,Bh(n.dataTransfer),Mh?null:n.dataTransfer.getData("text/html"),!1,o);let a=!(!r||n[Uh]);if(e.someProp("handleDrop",(t=>t(e,n,s||_u.empty,a))))return void n.preventDefault();if(!s)return;n.preventDefault();let u=s?function(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(0==n.openStart&&n.size?2:1);o++)for(let e=r.depth;e>=0;e--){let t=e==r.depth?0:r.pos<=(r.start(e+1)+r.end(e+1))/2?-1:1,n=r.index(e)+(t>0?1:0),s=r.node(e),a=!1;if(1==o)a=s.canReplace(n,n,i);else{let e=s.contentMatchAt(n).findWrapping(i.firstChild.type);a=e&&s.canReplaceWith(n,n,e[0])}if(a)return 0==t?r.pos:t<0?r.before(e+1):r.after(e+1)}return null}(e.state.doc,o.pos,s):o.pos;null==u&&(u=o.pos);let l=e.state.tr;if(a){let{node:e}=r;e?e.replace(l):l.deleteSelection()}let c=l.mapping.map(u),d=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,h=l.doc;if(d?l.replaceRangeWith(c,c,s.content.firstChild):l.replaceRange(c,c,s),l.doc.eq(h))return;let p=l.doc.resolve(c);if(d&&Jl.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new Jl(p));else{let t=l.mapping.map(u);l.mapping.maps[l.mapping.maps.length-1].forEach(((e,n,r,i)=>t=i)),l.setSelection($d(e,p,l.doc.resolve(t)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))},fh.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Md(e)}),20))},fh.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},fh.beforeinput=(e,t)=>{if(Mc&&jc&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout((()=>{if(e.input.domChangeCount!=t)return;if(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",(t=>t(e,Sc(8,"Backspace")))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())}),50)}};for(let os in mh)fh[os]=mh[os];function Hh(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class jh{constructor(e,t){this.toDOM=e,this.spec=t||Gh,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:o}=e.mapResult(t.from+r,this.side<0?-1:1);return o?null:new zh(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof jh&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Hh(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class $h{constructor(e,t){this.attrs=e,this.spec=t||Gh}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,o=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new zh(i,o,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof $h&&Hh(this.attrs,e.attrs)&&Hh(this.spec,e.spec)}static is(e){return e.type instanceof $h}destroy(){}}class Yh{constructor(e,t){this.attrs=e,this.spec=t||Gh}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let o=e.mapResult(t.to+r,-1);return o.deleted||o.pos<=i.pos?null:new zh(i.pos-n,o.pos-n,this)}valid(e,t){let n,{index:r,offset:i}=e.content.findIndex(t.from);return i==t.from&&!(n=e.child(r)).isText&&i+n.nodeSize==t.to}eq(e){return this==e||e instanceof Yh&&Hh(this.attrs,e.attrs)&&Hh(this.spec,e.spec)}destroy(){}}class zh{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new zh(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(e,t,n){return new zh(e,e,new jh(t,n))}static inline(e,t,n,r){return new zh(e,t,new $h(n,r))}static node(e,t,n,r){return new zh(e,t,new Yh(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof $h}get widget(){return this.type instanceof jh}}const Vh=[],Gh={};class Wh{constructor(e,t){this.local=e.length?e:Vh,this.children=t.length?t:Vh}static create(e,t){return t.length?Qh(t,e,0,Gh):Xh}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,i){for(let o=0;o<this.local.length;o++){let s=this.local[o];s.from<=t&&s.to>=e&&(!i||i(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<t&&this.children[o+1]>e){let s=this.children[o]+1;this.children[o+2].findInner(e-s,t-s,n,r+s,i)}}map(e,t,n){return this==Xh||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Gh)}mapInner(e,t,n,r,i){let o;for(let s=0;s<this.local.length;s++){let a=this.local[s].map(e,n,r);a&&a.type.valid(t,a)?(o||(o=[])).push(a):i.onRemove&&i.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,i,o,s){let a=e.slice();for(let l=0,c=o;l<n.maps.length;l++){let e=0;n.maps[l].forEach(((t,n,r,i)=>{let o=i-r-(n-t);for(let s=0;s<a.length;s+=3){let r=a[s+1];if(r<0||t>r+c-e)continue;let i=a[s]+c-e;n>=i?a[s+1]=t<=i?-2:-1:t>=c&&o&&(a[s]+=o,a[s+1]+=o)}e+=o})),c=n.maps[l].map(c,-1)}let u=!1;for(let l=0;l<a.length;l+=3)if(a[l+1]<0){if(-2==a[l+1]){u=!0,a[l+1]=-1;continue}let t=n.map(e[l]+o),c=t-i;if(c<0||c>=r.content.size){u=!0;continue}let d=n.map(e[l+1]+o,-1)-i,{index:h,offset:p}=r.content.findIndex(c),f=r.maybeChild(h);if(f&&p==c&&p+f.nodeSize==d){let r=a[l+2].mapInner(n,f,t+1,e[l]+o+1,s);r!=Xh?(a[l]=c,a[l+1]=d,a[l+2]=r):(a[l+1]=-2,u=!0)}else u=!0}if(u){let u=function(e,t,n,r,i,o,s){function a(e,t){for(let o=0;o<e.local.length;o++){let a=e.local[o].map(r,i,t);a?n.push(a):s.onRemove&&s.onRemove(e.local[o].spec)}for(let n=0;n<e.children.length;n+=3)a(e.children[n+2],e.children[n]+t+1)}for(let u=0;u<e.length;u+=3)-1==e[u+1]&&a(e[u+2],t[u]+o+1);return n}(a,e,t,n,i,o,s),l=Qh(u,r,0,s);t=l.local;for(let e=0;e<a.length;e+=3)a[e+1]<0&&(a.splice(e,3),e-=3);for(let e=0,t=0;e<l.children.length;e+=3){let n=l.children[e];for(;t<a.length&&a[t]<n;)t+=3;a.splice(t,0,l.children[e],l.children[e+1],l.children[e+2])}}return new Wh(t.sort(ep),a)}(this.children,o||[],e,t,n,r,i):o?new Wh(o.sort(ep),Vh):Xh}add(e,t){return t.length?this==Xh?Wh.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,i=0;e.forEach(((e,o)=>{let s,a=o+n;if(s=Jh(t,e,a)){for(r||(r=this.children.slice());i<r.length&&r[i]<o;)i+=3;r[i]==o?r[i+2]=r[i+2].addInner(e,s,a+1):r.splice(i,0,o,o+e.nodeSize,Qh(s,e,a+1,Gh)),i+=3}}));let o=qh(i?Zh(t):t,-n);for(let s=0;s<o.length;s++)o[s].type.valid(e,o[s])||o.splice(s--,1);return new Wh(o.length?this.local.concat(o).sort(ep):this.local,r||this.children)}remove(e){return 0==e.length||this==Xh?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let i=0;i<n.length;i+=3){let r,o=n[i]+t,s=n[i+1]+t;for(let t,n=0;n<e.length;n++)(t=e[n])&&t.from>o&&t.to<s&&(e[n]=null,(r||(r=[])).push(t));if(!r)continue;n==this.children&&(n=this.children.slice());let a=n[i+2].removeInner(r,o+1);a!=Xh?n[i+2]=a:(n.splice(i,3),i-=3)}if(r.length)for(let i,o=0;o<e.length;o++)if(i=e[o])for(let e=0;e<r.length;e++)r[e].eq(i,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1));return n==this.children&&r==this.local?this:r.length||n.length?new Wh(r,n):Xh}forChild(e,t){if(this==Xh)return this;if(t.isLeaf)return Wh.empty;let n,r;for(let s=0;s<this.children.length;s+=3)if(this.children[s]>=e){this.children[s]==e&&(n=this.children[s+2]);break}let i=e+1,o=i+t.content.size;for(let s=0;s<this.local.length;s++){let e=this.local[s];if(e.from<o&&e.to>i&&e.type instanceof $h){let t=Math.max(i,e.from)-i,n=Math.min(o,e.to)-i;t<n&&(r||(r=[])).push(e.copy(t,n))}}if(r){let e=new Wh(r.sort(ep),Vh);return n?new Kh([e,n]):e}return n||Xh}eq(e){if(this==e)return!0;if(!(e instanceof Wh)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return tp(this.localsInner(e))}localsInner(e){if(this==Xh)return Vh;if(e.inlineContent||!this.local.some($h.is))return this.local;let t=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof $h||t.push(this.local[n]);return t}}Wh.empty=new Wh([],[]),Wh.removeOverlap=tp;const Xh=Wh.empty;class Kh{constructor(e){this.members=e}map(e,t){const n=this.members.map((n=>n.map(e,t,Gh)));return Kh.from(n)}forChild(e,t){if(t.isLeaf)return Wh.empty;let n=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(e,t);i!=Xh&&(i instanceof Kh?n=n.concat(i.members):n.push(i))}return Kh.from(n)}eq(e){if(!(e instanceof Kh)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<i.length;e++)t.push(i[e])}else t=i}return t?tp(n?t:t.sort(ep)):Vh}static from(e){switch(e.length){case 0:return Xh;case 1:return e[0];default:return new Kh(e.every((e=>e instanceof Wh))?e:e.reduce(((e,t)=>e.concat(t instanceof Wh?t:t.members)),[]))}}}function qh(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new zh(i.from+t,i.to+t,i.type))}return n}function Jh(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let o,s=0;s<e.length;s++)(o=e[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[s]=null);return i}function Zh(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function Qh(e,t,n,r){let i=[],o=!1;t.forEach(((t,s)=>{let a=Jh(e,t,s+n);if(a){o=!0;let e=Qh(a,t,n+s+1,r);e!=Xh&&i.push(s,s+t.nodeSize,e)}}));let s=qh(o?Zh(e):e,-n).sort(ep);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Wh(s,i):Xh}function ep(e,t){return e.from-t.from||e.to-t.to}function tp(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let o=t[i];if(o.from!=r.from){o.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,o.from),np(t,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(t==e&&(t=e.slice()),t[i]=o.copy(o.from,r.to),np(t,i+1,o.copy(r.to,o.to)))}}return t}function np(e,t,n){for(;t<e.length&&ep(n,e[t])>0;)t++;e.splice(t,0,n)}function rp(e){let t=[];return e.someProp("decorations",(n=>{let r=n(e.state);r&&r!=Xh&&t.push(r)})),e.cursorWrapper&&t.push(Wh.create(e.state.doc,[e.cursorWrapper.deco])),Kh.from(t)}const ip={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},op=wc&&kc<=11;class sp{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class ap{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new sp,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);wc&&kc<=11&&e.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),op&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,ip)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);window.setTimeout((()=>this.flush()),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout((()=>this.suppressingSelectionUpdates=!1),50)}onSelectionChange(){if(Yd(this.view)){if(this.suppressingSelectionUpdates)return Md(this.view);if(wc&&kc<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&_c(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let i=e.focusNode;i;i=mc(i))n.add(i);for(let i=e.anchorNode;i;i=mc(i))if(n.has(i)){t=i;break}let r=t&&this.view.docView.nearestDesc(t);return r&&r.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Yd(e)&&!this.ignoreSelectionChange(n),i=-1,o=-1,s=!1,a=[];if(e.editable)for(let l=0;l<t.length;l++){let e=this.registerMutation(t[l],a);e&&(i=i<0?e.from:Math.min(e.from,i),o=o<0?e.to:Math.max(e.to,o),e.typeOver&&(s=!0))}if(Lc&&a.length>1){let e=a.filter((e=>"BR"==e.nodeName));if(2==e.length){let t=e[0],n=e[1];t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}}let u=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Tc(n)&&(u=Ld(e))&&u.eq(Vl.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Md(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,o),function(e){if(!up.has(e)&&(up.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))){if(e.requiresGeckoHackNode=Lc,lp)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),lp=!0}}(e)),this.handleDOMChange(i,o,s,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Md(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++)t.push(e.addedNodes[n]);if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(wc&&kc<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:o}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!o||Array.prototype.indexOf.call(e.addedNodes,o)<0)&&(i=o)}let o=r&&r.parentNode==e.target?fc(r)+1:0,s=n.localPosFromDOM(e.target,o,-1),a=i&&i.parentNode==e.target?fc(i):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,a,1)}}return"attributes"==e.type?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let up=new WeakMap,lp=!1;function cp(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(Bc&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}if(e.parentNode.lastChild==e||Bc&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const dp=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function hp(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:$d(e,t.resolve(n.anchor),t.resolve(n.head))}function pp(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function fp(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class mp{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new gh,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Dp),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=_p(this),gp(this),this.nodeViews=Ap(this),this.docView=gd(this.state.doc,Ep(this),rp(this),this.dom,this),this.domObserver=new ap(this,((e,t,n,r)=>function(e,t,n,r,i){let o=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Ld(e,t);if(n&&!e.state.selection.eq(n)){if(Mc&&jc&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",(t=>t(e,Sc(13,"Enter")))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),o&&r.setMeta("composition",o),e.dispatch(r)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let u,l,c=e.state.selection,d=function(e,t,n){let r,{node:i,fromOffset:o,toOffset:s,from:a,to:u}=e.docView.parseRange(t,n),l=e.domSelectionRange(),c=l.anchorNode;if(c&&e.dom.contains(1==c.nodeType?c:c.parentNode)&&(r=[{node:c,offset:l.anchorOffset}],Tc(l)||r.push({node:l.focusNode,offset:l.focusOffset})),Mc&&8===e.input.lastKeyCode)for(let E=s;E>o;E--){let e=i.childNodes[E-1],t=e.pmViewDesc;if("BR"==e.nodeName&&!t){s=E;break}if(!t||t.size)break}let d=e.state.doc,h=e.someProp("domParser")||tl.fromSchema(e.state.schema),p=d.resolve(a),f=null,m=h.parse(i,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:o,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:cp,context:p});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+a,head:t+a}}return{doc:m,sel:f,from:a,to:u}}(e,t,n),h=e.state.doc,p=h.slice(d.from,d.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(u=e.state.selection.to,l="end"):(u=e.state.selection.from,l="start"),e.input.lastKeyCode=null;let f=function(e,t,n,r,i){let o=e.findDiffStart(t,n);if(null==o)return null;let{a:s,b:a}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==i&&(r-=s+Math.max(0,o-Math.min(s,a))-o),s<o&&e.size<t.size){let e=r<=o&&r>=s?o-r:0;o-=e,o&&o<t.size&&fp(t.textBetween(o-1,o+1))&&(o+=e?1:-1),a=o+(a-s),s=o}else if(a<o){let t=r<=o&&r>=a?o-r:0;o-=t,o&&o<e.size&&fp(e.textBetween(o-1,o+1))&&(o+=t?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}(p.content,d.doc.content,d.from,u,l);if((Pc&&e.input.lastIOSEnter>Date.now()-225||jc)&&i.some((e=>1==e.nodeType&&!dp.test(e.nodeName)))&&(!f||f.endA>=f.endB)&&e.someProp("handleKeyDown",(t=>t(e,Sc(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(!f){if(!(r&&c instanceof Kl&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){let t=hp(e,e.state.doc,d.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);o&&n.setMeta("composition",o),e.dispatch(n)}}return}f={start:c.from,endA:c.to,endB:c.to}}if(Mc&&e.cursorWrapper&&d.sel&&d.sel.anchor==e.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let e=f.endB-f.start;d.sel={anchor:d.sel.anchor+e,head:d.sel.anchor+e}}e.input.domChangeCount++,e.state.selection.from<e.state.selection.to&&f.start==f.endB&&e.state.selection instanceof Kl&&(f.start>e.state.selection.from&&f.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?f.start=e.state.selection.from:f.endA<e.state.selection.to&&f.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(f.endB+=e.state.selection.to-f.endA,f.endA=e.state.selection.to)),wc&&kc<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>d.from&&" "==d.doc.textBetween(f.start-d.from-1,f.start-d.from+1)&&(f.start--,f.endA--,f.endB--);let m,E=d.doc.resolveNoCache(f.start-d.from),g=d.doc.resolveNoCache(f.endB-d.from),_=h.resolve(f.start),A=E.sameParent(g)&&E.parent.inlineContent&&_.end()>=f.endA;if((Pc&&e.input.lastIOSEnter>Date.now()-225&&(!A||i.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!A&&E.pos<d.doc.content.size&&!E.sameParent(g)&&(m=Vl.findFrom(d.doc.resolve(E.pos+1),1,!0))&&m.head==g.pos)&&e.someProp("handleKeyDown",(t=>t(e,Sc(13,"Enter")))))return void(e.input.lastIOSEnter=0);if(e.state.selection.anchor>f.start&&function(e,t,n,r,i){if(!r.parent.isTextblock||n-t<=i.pos-r.pos||pp(r,!0,!1)<i.pos)return!1;let o=e.resolve(t);if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=e.resolve(pp(o,!0,!0));return!(!s.parent.isTextblock||s.pos>n||pp(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(h,f.start,f.endA,E,g)&&e.someProp("handleKeyDown",(t=>t(e,Sc(8,"Backspace")))))return void(jc&&Mc&&e.domObserver.suppressSelectionUpdates());Mc&&jc&&f.endB==f.start&&(e.input.lastAndroidDelete=Date.now()),jc&&!A&&E.start()!=g.start()&&0==g.parentOffset&&E.depth==g.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==f.endA&&(f.endB-=2,g=d.doc.resolveNoCache(f.endB-d.from),setTimeout((()=>{e.someProp("handleKeyDown",(function(t){return t(e,Sc(13,"Enter"))}))}),20));let D,v,O,T=f.start,S=f.endA;if(A)if(E.pos==g.pos)wc&&kc<=11&&0==E.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout((()=>Md(e)),20)),D=e.state.tr.delete(T,S),v=h.resolve(f.start).marksAcross(h.resolve(f.endA));else if(f.endA==f.endB&&(O=function(e,t){let n,r,i,o=e.firstChild.marks,s=t.firstChild.marks,a=o,u=s;for(let c=0;c<s.length;c++)a=s[c].removeFromSet(a);for(let c=0;c<o.length;c++)u=o[c].removeFromSet(u);if(1==a.length&&0==u.length)r=a[0],n="add",i=e=>e.mark(r.addToSet(e.marks));else{if(0!=a.length||1!=u.length)return null;r=u[0],n="remove",i=e=>e.mark(r.removeFromSet(e.marks))}let l=[];for(let c=0;c<t.childCount;c++)l.push(i(t.child(c)));if(hu.from(l).eq(e))return{mark:r,type:n}}(E.parent.content.cut(E.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,f.endA-_.start()))))D=e.state.tr,"add"==O.type?D.addMark(T,S,O.mark):D.removeMark(T,S,O.mark);else if(E.parent.child(E.index()).isText&&E.index()==g.index()-(g.textOffset?0:1)){let t=E.parent.textBetween(E.parentOffset,g.parentOffset);if(e.someProp("handleTextInput",(n=>n(e,T,S,t))))return;D=e.state.tr.insertText(t,T,S)}if(D||(D=e.state.tr.replace(T,S,d.doc.slice(f.start-d.from,f.endB-d.from))),d.sel){let t=hp(e,D.doc,d.sel);t&&!(Mc&&jc&&e.composing&&t.empty&&(f.start!=f.endB||e.input.lastAndroidDelete<Date.now()-100)&&(t.head==T||t.head==D.mapping.map(S)-1)||wc&&t.empty&&t.head==T)&&D.setSelection(t)}v&&D.ensureMarks(v),o&&D.setMeta("composition",o),e.dispatch(D.scrollIntoView())}(this,e,t,n,r))),this.domObserver.start(),function(e){for(let t in fh){let n=fh[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!vh(e,t)||Dh(e,t)||!e.editable&&t.type in mh||n(e,t)},Eh[t]?{passive:!0}:void 0)}Bc&&e.dom.addEventListener("input",(()=>null)),Ah(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ah(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Dp),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let n in this._props)t[n]=this._props[n];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n;let r=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Lh(this),o=!0),this.state=e;let s=r.plugins!=e.plugins||this._props.plugins!=t.plugins;if(s||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Ap(this);(function(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r})(e,this.nodeViews)&&(this.nodeViews=e,i=!0)}(s||t.handleDOMEvents!=this._props.handleDOMEvents)&&Ah(this),this.editable=_p(this),gp(this);let a=rp(this),u=Ep(this),l=r.plugins==e.plugins||r.doc.eq(e.doc)?e.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",c=i||!this.docView.matchesNode(e.doc,u,a);!c&&e.selection.eq(r.selection)||(o=!0);let d="preserve"==l&&o&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),i=Math.max(0,r.top);for(let o=(r.left+r.right)/2,s=i+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(o,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let a=r.getBoundingClientRect();if(a.top>=i-20){t=r,n=a.top;break}}return{refDOM:t,refTop:n,stack:Xc(e.dom)}}(this);if(o){this.domObserver.stop();let t=c&&(wc||Mc)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(c){let n=Mc?this.trackWrites=this.domSelectionRange().focusNode:null;!i&&this.docView.update(e.doc,u,a,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=gd(e.doc,u,a,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return _c(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?Md(this,t):(Hd(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),(null===(n=this.dragging)||void 0===n?void 0:n.node)&&!r.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,r),"reset"==l?this.dom.scrollTop=0:"to selection"==l?this.scrollToSelection():d&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Kc(n,0==r?0:r-t)}(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof Jl){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&Wc(this,t.getBoundingClientRect(),e)}else Wc(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Ph(e.slice,e.move,r<0?void 0:Jl.create(this.state.doc,r))}someProp(e,t){let n,r=this._props&&this._props[e];if(null!=r&&(n=t?t(r):r))return n;for(let o=0;o<this.directPlugins.length;o++){let r=this.directPlugins[o].props[e];if(null!=r&&(n=t?t(r):r))return n}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let r=i[o].props[e];if(null!=r&&(n=t?t(r):r))return n}}hasFocus(){if(wc){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(qc)return e.focus(qc);let t=Xc(e);e.focus(null==qc?{get preventScroll(){return qc={preventScroll:!0},!0}}:void 0),qc||(qc=!1,Kc(t,0))}(this.dom),Md(this),this.domObserver.start()}get root(){let e=this._root;if(null==e)for(let t=this.dom.parentNode;t;t=t.parentNode)if(9==t.nodeType||11==t.nodeType&&t.host)return t.getSelection||(Object.getPrototypeOf(t).getSelection=()=>t.ownerDocument.getSelection()),this._root=t;return e||document}updateRoot(){this._root=null}posAtCoords(e){return ed(this,e)}coordsAtPos(e,t=1){return id(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){return ld==t&&cd==n?dd:(ld=t,cd=n,dd="up"==n||"down"==n?function(e,t,n){let r=t.selection,i="up"==n?r.$from:r.$to;return ad(e,t,(()=>{let{node:t}=e.docView.domFromPos(i.pos,"up"==n?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=id(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=gc(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&("up"==n?r.top-i.top>2*(i.bottom-r.top):i.bottom-r.bottom>2*(r.bottom-i.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=e.domSelection();return ud.test(r.parent.textContent)&&a.modify?ad(e,t,(()=>{let{focusNode:t,focusOffset:i,anchorNode:o,anchorOffset:s}=e.domSelectionRange(),u=a.caretBidiLevel;a.modify("move",n,"character");let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:c,focusOffset:d}=e.domSelectionRange(),h=c&&!l.contains(1==c.nodeType?c:c.parentNode)||t==c&&i==d;try{a.collapse(o,s),t&&(t!=o||i!=s)&&a.extend&&a.extend(t,i)}catch(e){}return null!=u&&(a.caretBidiLevel=u),h})):"left"==n||"backward"==n?o:s}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return Fh(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Fh(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rp(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(e){return function(e,t){Dh(e,t)||!fh[t.type]||!e.editable&&t.type in mh||fh[t.type](e,t)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Bc&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom?function(e){let t;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",n,!0);let r=t.startContainer,i=t.startOffset,o=t.endContainer,s=t.endOffset,a=e.domAtPos(e.state.selection.anchor);return _c(a.node,a.offset,o,s)&&([r,i,o,s]=[o,s,r,i]),{anchorNode:r,anchorOffset:i,focusNode:o,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Ep(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",(n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))})),t.translate||(t.translate="no"),[zh.node(0,e.state.doc.content.size,t)]}function gp(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:zh.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function _p(e){return!e.someProp("editable",(t=>!1===t(e.state)))}function Ap(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function Dp(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const vp=new class{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let r in e)t[r]=e[r];t.nodes=lu.from(e.nodes),t.marks=lu.from(e.marks||{}),this.nodes=Ju.compile(this.spec.nodes,this),this.marks=Qu.compile(this.spec.marks,this);let n=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let e=this.nodes[r],t=e.spec.content||"",i=e.spec.marks;e.contentMatch=n[t]||(n[t]=Uu.parse(t,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==i?null:i?el(this,i.split(" ")):""!=i&&e.inlineContent?null:[]}for(let r in this.marks){let e=this.marks[r],t=e.spec.excludes;e.excluded=null==t?[e]:""==t?[]:el(this,t.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Ju))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Bu(n,n.defaultAttrs,e,Eu.setFrom(t))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Fu.fromJSON(this,e)}markFromJSON(e){return Eu.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}({nodes:{doc:{content:"paragraph+"},paragraph:{code:!0,content:"inline*",parseDOM:[{tag:"p"}],toDOM:()=>["p",0]},text:{group:"inline"},mention:{group:"inline",inline:!0,attrs:{id:{},name:{}},content:"text*",toDOM:e=>["span",{"data-mention-id":e.attrs.id},`@${e.attrs.name}`],parseDOM:[{tag:"span[data-mention-id]",getAttrs:e=>({id:e.dataset["mention-id"]})}]}},marks:{literal:{toDOM:()=>["span",{"data-literal":""}],parseDOM:[{tag:"span[data-literal]"}]},bold:{toDOM:()=>["b"],parseDOM:[{tag:"b"}]},italic:{toDOM:()=>["i"],parseDOM:[{tag:"i"}]},strikethrough:{toDOM:()=>["del"],parseDOM:[{tag:"del"}]},emoji:{attrs:{emoji:{}},toDOM:e=>["span",{"data-emoji":e.attrs.emoji},e.attrs.emoji],parseDOM:[{tag:"span[data-emoji]",getAttrs:e=>({emoji:e.dataset.emoji})}]}}}),Op=new pc("placeholder"),Tp=new cc({key:Op,props:{decorations(e){if(Sp(e.doc))return;const t=e.doc.firstChild,n=zh.node(0,t.nodeSize,{class:"empty-node","data-placeholder":Op.getState(e)});return Wh.create(e.doc,[n])}},state:{init:()=>"",apply:(e,t)=>e.getMeta(Op)??t}});function Sp(e){return 1!==e.childCount||0!==e.firstChild.childCount}for(var yp={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},Cp={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Np="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),bp="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Ip="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Rp="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),wp="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),kp=Np&&(Rp||+Np[1]<57)||Ip&&Rp,Lp=0;Lp<10;Lp++)yp[48+Lp]=yp[96+Lp]=String(Lp);for(Lp=1;Lp<=24;Lp++)yp[Lp+111]="F"+Lp;for(Lp=65;Lp<=90;Lp++)yp[Lp]=String.fromCharCode(Lp+32),Cp[Lp]=String.fromCharCode(Lp);for(var xp in yp)Cp.hasOwnProperty(xp)||(Cp[xp]=yp[xp]);const Mp="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Fp(e){let t,n,r,i,o=e.split(/-(?!$)/),s=o[o.length-1];"Space"==s&&(s=" ");for(let a=0;a<o.length-1;a++){let e=o[a];if(/^(cmd|meta|m)$/i.test(e))i=!0;else if(/^a(lt)?$/i.test(e))t=!0;else if(/^(c|ctrl|control)$/i.test(e))n=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);Mp?i=!0:n=!0}}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Bp(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function Pp(e){return new cc({props:{handleKeyDown:Up(e)}})}function Up(e){let t=function(e){let t=Object.create(null);for(let n in e)t[Fp(n)]=e[n];return t}(e);return function(e,n){let r,i=function(e){var t=!(kp&&(e.ctrlKey||e.altKey||e.metaKey)||(bp||wp)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?Cp:yp)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(n),o=t[Bp(i,n)];if(o&&o(e.state,e.dispatch,e))return!0;if(1==i.length&&" "!=i){if(n.shiftKey){let r=t[Bp(i,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.shiftKey||n.altKey||n.metaKey||i.charCodeAt(0)>127)&&(r=yp[n.keyCode])&&r!=i){let i=t[Bp(r,n)];if(i&&i(e.state,e.dispatch,e))return!0}}return!1}}var Hp=200,jp=function(){};jp.prototype.append=function(e){return e.length?(e=jp.from(e),!this.length&&e||e.length<Hp&&this.leafAppend(e)||this.length<Hp&&e.leafPrepend(this)||this.appendInner(e)):this},jp.prototype.prepend=function(e){return e.length?jp.from(e).append(this):this},jp.prototype.appendInner=function(e){return new Yp(this,e)},jp.prototype.slice=function(e,t){return void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t?jp.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},jp.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},jp.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},jp.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},jp.from=function(e){return e instanceof jp?e:e&&e.length?new $p(e):jp.empty};var $p=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(!1===e(this.values[i],r+i))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Hp)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Hp)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(jp);jp.empty=new $p([]);var Yp=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;return!(t<i&&!1===this.left.forEachInner(e,t,Math.min(n,i),r))&&!(n>i&&!1===this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i))&&void 0},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;return!(t>i&&!1===this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i))&&!(n<i&&!1===this.left.forEachInvertedInner(e,Math.min(t,i),n,r))&&void 0},t.prototype.sliceInner=function(e,t){if(0==e&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(jp),zp=jp;const Vp=Math.pow(2,16);function Gp(e,t){return e+t*Vp}function Wp(e){return 65535&e}let Xp=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}},Kp=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Wp(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Vp}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let u=this.ranges[s+i],l=this.ranges[s+o],c=a+u;if(e<=c){let i=a+r+((u?e==a?-1:e==c?1:t:t)<0?0:l);if(n)return i;let o=e==(t<0?a:c)?null:Gp(s/3,e-a),d=e==a?2:e==c?1:4;return(t<0?e!=a:e!=c)&&(d|=8),new Xp(i,d,o)}r+=l-u}return n?e+r:new Xp(e+r,0,null)}touches(e,t){let n=0,r=Wp(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let t=this.ranges[s]-(this.inverted?n:0);if(t>e)break;let a=this.ranges[s+i];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),u=this.ranges[r+t],l=this.ranges[r+n];e(s,s+u,a,a+l),i+=l-u}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return 0==t?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Kp.empty=new Kp([]);class qp{constructor(e=[],t,n=0,r=e.length){this.maps=e,this.mirror=t,this.from=n,this.to=r}slice(e=0,t=this.maps.length){return new qp(this.maps,this.mirror,e,t)}copy(){return new qp(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,n=this.maps.length;t<e.maps.length;t++){let r=e.getMirror(t);this.appendMap(e.maps[t],null!=r&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror)for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this.maps.length+e.maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new qp;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this.maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let i=this.from;i<this.to;i++){let n=this.maps[i].mapResult(e,t);if(null!=n.recover){let t=this.getMirror(i);if(null!=t&&t>i&&t<this.to){i=t,e=this.maps[t].recover(n.recover);continue}}r|=n.delInfo,e=n.pos}return n?e:new Xp(e,r,null)}}const Jp=Object.create(null);let Zp=class{getMap(){return Kp.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=Jp[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Jp)throw new RangeError("Duplicate use of step JSON ID "+e);return Jp[e]=t,t.prototype.jsonID=e,t}},Qp=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof gu)return e.fail(t.message);throw t}}};function ef(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(ef(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return hu.fromArray(r)}let tf=class e extends Zp{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new _u(ef(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Qp.fromReplace(e,this.from,this.to,i)}invert(){return new nf(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};Zp.jsonID("addMark",tf);let nf=class e extends Zp{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new _u(ef(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Qp.fromReplace(e,this.from,this.to,n)}invert(){return new tf(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};Zp.jsonID("removeMark",nf);let rf=class e extends Zp{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Qp.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Qp.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(n),0,t.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new of(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};Zp.jsonID("addNodeMark",rf);let of=class e extends Zp{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Qp.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Qp.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new rf(this.pos,this.mark):this}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if("number"!=typeof n.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};function sf(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}Zp.jsonID("removeNodeMark",of),Zp.jsonID("replace",class e extends Zp{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&sf(e,this.from,this.to)?Qp.fail("Structure replace would overwrite content"):Qp.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Kp([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new e(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size!=t.from||this.slice.openEnd||t.slice.openStart){if(t.to!=this.from||this.slice.openStart||t.slice.openEnd)return null;{let n=this.slice.size+t.slice.size==0?_u.empty:new _u(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}}{let n=this.slice.size+t.slice.size==0?_u.empty:new _u(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,_u.fromJSON(t,n.slice),!!n.structure)}}),Zp.jsonID("replaceAround",class e extends Zp{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(sf(e,this.from,this.gapFrom)||sf(e,this.gapTo,this.to)))return Qp.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Qp.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Qp.fromReplace(e,this.from,this.to,n):Qp.fail("Content does not fit in gap")}getMap(){return new Kp([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=t.map(this.gapFrom,-1),o=t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new e(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if("number"!=typeof n.from||"number"!=typeof n.to||"number"!=typeof n.gapFrom||"number"!=typeof n.gapTo||"number"!=typeof n.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,_u.fromJSON(t,n.slice),n.insert,!!n.structure)}}),Zp.jsonID("attr",class e extends Zp{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Qp.fail("No node at attribute step's position");let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Qp.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(r),0,t.isLeaf?0:1))}getMap(){return Kp.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if("number"!=typeof n.pos||"string"!=typeof n.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new e(n.pos,n.attr,n.value)}}),Zp.jsonID("docAttr",class e extends Zp{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Qp.ok(n)}getMap(){return Kp.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if("string"!=typeof n.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new e(n.attr,n.value)}});let af=class extends Error{};af=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(af.prototype=Object.create(Error.prototype)).constructor=af,af.prototype.name="TransformError";class uf{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,i=this.items.length;for(;;i--)if(this.items.get(i-1).selection){--i;break}t&&(n=this.remapping(i,this.items.length),r=n.maps.length);let o,s,a=e.tr,u=[],l=[];return this.items.forEach(((e,t)=>{if(!e.step)return n||(n=this.remapping(i,t+1),r=n.maps.length),r--,void l.push(e);if(n){l.push(new lf(e.map));let t,i=e.step.map(n.slice(r));i&&a.maybeStep(i).doc&&(t=a.mapping.maps[a.mapping.maps.length-1],u.push(new lf(t,void 0,void 0,u.length+l.length))),r--,t&&n.appendMap(t,r)}else a.maybeStep(e.step);return e.selection?(o=n?e.selection.map(n.slice(r)):e.selection,s=new uf(this.items.slice(0,i).append(l.reverse().concat(u)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:o}}addTransform(e,t,n,r){let i=[],o=this.eventCount,s=this.items,a=!r&&s.length?s.get(s.length-1):null;for(let l=0;l<e.steps.length;l++){let n,u=e.steps[l].invert(e.docs[l]),c=new lf(e.mapping.maps[l],u,t);(n=a&&a.merge(c))&&(c=n,l?i.pop():s=s.slice(0,s.length-1)),i.push(c),t&&(o++,t=void 0),r||(a=c)}let u=o-n.depth;return u>df&&(s=function(e,t){let n;return e.forEach(((e,r)=>{if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,u),o-=u),new uf(s.append(i),o)}remapping(e,t){let n=new qp;return this.items.forEach(((t,r)=>{let i=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new uf(this.items.append(e.map((e=>new lf(e)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),i=e.mapping,o=e.steps.length,s=this.eventCount;this.items.forEach((e=>{e.selection&&s--}),r);let a=t;this.items.forEach((t=>{let r=i.getMirror(--a);if(null==r)return;o=Math.min(o,r);let u=i.maps[r];if(t.step){let o=e.steps[r].invert(e.docs[r]),l=t.selection&&t.selection.map(i.slice(a+1,r));l&&s++,n.push(new lf(u,o,l))}else n.push(new lf(u))}),r);let u=[];for(let d=t;d<o;d++)u.push(new lf(i.maps[d]));let l=this.items.slice(0,r).append(u).append(n),c=new uf(l,s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],i=0;return this.items.forEach(((o,s)=>{if(s>=e)r.push(o),o.selection&&i++;else if(o.step){let e=o.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let a=o.selection&&o.selection.map(t.slice(n));a&&i++;let u,l=new lf(s.invert(),e,a),c=r.length-1;(u=r.length&&r[c].merge(l))?r[c]=u:r.push(l)}}else o.map&&n--}),this.items.length,0),new uf(zp.from(r.reverse()),i)}}uf.empty=new uf(zp.empty,0);let lf=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}};class cf{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}}const df=20;function hf(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach(((e,n,r,i)=>t.push(r,i)));return t}function pf(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),o=t.map(e[r+1],-1);i<=o&&n.push(i,o)}return n}let ff=!1,mf=null;function Ef(e){let t=e.plugins;if(mf!=t){ff=!1,mf=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){ff=!0;break}}return ff}const gf=new pc("history"),_f=new pc("closeHistory");function Af(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new cc({key:gf,state:{init:()=>new cf(uf.empty,uf.empty,null,0,-1),apply:(t,n,r)=>function(e,t,n,r){let i,o=n.getMeta(gf);if(o)return o.historyState;n.getMeta(_f)&&(e=new cf(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(gf))return s.getMeta(gf).redo?new cf(e.done.addTransform(n,void 0,r,Ef(t)),e.undone,hf(n.mapping.maps),e.prevTime,e.prevComposition):new cf(e.done,e.undone.addTransform(n,void 0,r,Ef(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(i=n.getMeta("rebased"))?new cf(e.done.rebased(n,i),e.undone.rebased(n,i),pf(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new cf(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),pf(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let i=n.getMeta("composition"),o=0==e.prevTime||!s&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)})),n}(n,e.prevRanges)),a=s?pf(e.prevRanges,n.mapping):hf(n.mapping.maps);return new cf(e.done.addTransform(n,o?t.selection.getBookmark():void 0,r,Ef(t)),uf.empty,a,n.time,null==i?e.prevComposition:i)}}(n,r,t,e)},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?vf:"historyRedo"==n?Of:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}function Df(e,t){return(n,r)=>{let i=gf.getState(n);if(!i||0==(e?i.undone:i.done).eventCount)return!1;if(r){let o=function(e,t,n){let r=Ef(t),i=gf.get(t).spec.config,o=(n?e.undone:e.done).popEvent(t,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?e.done:e.undone).addTransform(o.transform,t.selection.getBookmark(),i,r),u=new cf(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(gf,{redo:n,historyState:u})}(i,n,e);o&&r(t?o.scrollIntoView():o)}return!0}}const vf=Df(!1,!0),Of=Df(!0,!0),Tf=Math.pow(2,16);function Sf(e,t){return e+t*Tf}function yf(e){return 65535&e}class Cf{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class Nf{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Nf.empty)return Nf.empty}recover(e){let t=0,n=yf(e);if(!this.inverted)for(let r=0;r<n;r++)t+=this.ranges[3*r+2]-this.ranges[3*r+1];return this.ranges[3*n]+t+function(e){return(e-(65535&e))/Tf}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let a=this.ranges[s]-(this.inverted?r:0);if(a>e)break;let u=this.ranges[s+i],l=this.ranges[s+o],c=a+u;if(e<=c){let i=a+r+((u?e==a?-1:e==c?1:t:t)<0?0:l);if(n)return i;let o=e==(t<0?a:c)?null:Sf(s/3,e-a),d=e==a?2:e==c?1:4;return(t<0?e!=a:e!=c)&&(d|=8),new Cf(i,d,o)}r+=l-u}return n?e+r:new Cf(e+r,0,null)}touches(e,t){let n=0,r=yf(t),i=this.inverted?2:1,o=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let t=this.ranges[s]-(this.inverted?n:0);if(t>e)break;let a=this.ranges[s+i];if(e<=t+a&&s==3*r)return!0;n+=this.ranges[s+o]-a}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let o=this.ranges[r],s=o-(this.inverted?i:0),a=o+(this.inverted?0:i),u=this.ranges[r+t],l=this.ranges[r+n];e(s,s+u,a,a+l),i+=l-u}}invert(){return new Nf(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?Nf.empty:new Nf(e<0?[0,-e,0]:[0,0,e])}}Nf.empty=new Nf([]);const bf=Object.create(null);class If{getMap(){return Nf.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=bf[t.stepType];if(!n)throw new RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in bf)throw new RangeError("Duplicate use of step JSON ID "+e);return bf[e]=t,t.prototype.jsonID=e,t}}class Rf{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Rf(e,null)}static fail(e){return new Rf(null,e)}static fromReplace(e,t,n,r){try{return Rf.ok(e.replace(t,n,r))}catch(e){if(e instanceof gu)return Rf.fail(e.message);throw e}}}function wf(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let o=e.child(i);o.content.size&&(o=o.copy(wf(o.content,t,o))),o.isInline&&(o=t(o,n,i)),r.push(o)}return hu.fromArray(r)}class kf extends If{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new _u(wf(t.content,((e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),r),t.openStart,t.openEnd);return Rf.fromReplace(e,this.from,this.to,i)}invert(){return new Lf(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new kf(t.pos,n.pos,this.mark)}merge(e){return e instanceof kf&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new kf(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new kf(t.from,t.to,e.markFromJSON(t.mark))}}If.jsonID("addMark",kf);class Lf extends If{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new _u(wf(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return Rf.fromReplace(e,this.from,this.to,n)}invert(){return new kf(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new Lf(t.pos,n.pos,this.mark)}merge(e){return e instanceof Lf&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Lf(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Lf(t.from,t.to,e.markFromJSON(t.mark))}}If.jsonID("removeMark",Lf);class xf extends If{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Rf.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Rf.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new xf(this.pos,t.marks[n]);return new xf(this.pos,this.mark)}}return new Mf(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new xf(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new xf(t.pos,e.markFromJSON(t.mark))}}If.jsonID("addNodeMark",xf);class Mf extends If{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Rf.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Rf.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new xf(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Mf(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Mf(t.pos,e.markFromJSON(t.mark))}}If.jsonID("removeNodeMark",Mf);class Ff extends If{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Pf(e,this.from,this.to)?Rf.fail("Structure replace would overwrite content"):Rf.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Nf([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ff(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new Ff(t.pos,Math.max(t.pos,n.pos),this.slice)}merge(e){if(!(e instanceof Ff)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;{let t=this.slice.size+e.slice.size==0?_u.empty:new _u(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ff(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?_u.empty:new _u(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ff(this.from,this.to+(e.to-e.from),t,this.structure)}}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ff(t.from,t.to,_u.fromJSON(e,t.slice),!!t.structure)}}If.jsonID("replace",Ff);class Bf extends If{constructor(e,t,n,r,i,o,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=o,this.structure=s}apply(e){if(this.structure&&(Pf(e,this.from,this.gapFrom)||Pf(e,this.gapTo,this.to)))return Rf.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Rf.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?Rf.fromReplace(e,this.from,this.to,n):Rf.fail("Content does not fit in gap")}getMap(){return new Nf([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Bf(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||i>n.pos?null:new Bf(t.pos,n.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Bf(t.from,t.to,t.gapFrom,t.gapTo,_u.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Pf(e,t,n){let r=e.resolve(t),i=n-t,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let e=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function Uf(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Hf(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),i=e.$from.index(n),o=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(i,o,t))return n;if(0==n||r.type.spec.isolating||!Uf(r,i,o))break}return null}function jf(e,t,n=1,r){let i=e.resolve(t),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let l=i.depth-1,c=n-2;l>o;l--,c--){let e=i.node(l),t=i.index(l);if(e.type.spec.isolating)return!1;let n=e.content.cutByIndex(t,e.childCount),o=r&&r[c+1];o&&(n=n.replaceChild(0,o.type.create(o.attrs)));let s=r&&r[c]||e;if(!e.canReplace(t+1,e.childCount)||!s.type.validContent(n))return!1}let a=i.indexAfter(o),u=r&&r[0];return i.node(o).canReplaceWith(a,a,u?u.type:i.node(o+1).type)}function $f(e,t){let n=e.resolve(t),r=n.index();return function(e,t){return!(!e||!t||e.isLeaf||!function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let o=t.child(i),s=o.type==r?e.type.schema.nodes.text:o.type;if(n=n.matchType(s),!n)return!1;if(!e.type.allowsMarks(o.marks))return!1}return n.validEnd}(e,t))}(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Yf(e,t,n=t,r=_u.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),o=e.resolve(n);return function(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}(i,o,r)?new Ff(t,n,r):new zf(i,o,r).fit()}If.jsonID("replaceAround",Bf);class zf{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=hu.empty;for(let r=0;r<=e.depth;r++){let t=e.node(r);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(r))})}for(let r=e.depth;r>0;r--)this.placed=hu.from(e.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,o=n.depth,s=r.depth;for(;o&&s&&1==i.childCount;)i=i.firstChild.content,o--,s--;let a=new _u(i,o,s);return e>-1?new Bf(n.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||n.pos!=this.$to.pos?new Ff(n.pos,r.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Wf(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let o=this.depth;o>=0;o--){let e,{type:s,match:a}=this.frontier[o],u=null;if(1==t&&(i?a.matchType(i.type)||(u=a.fillBefore(hu.from(i),!1)):r&&s.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:o,parent:r,inject:u};if(2==t&&i&&(e=a.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:o,parent:r,wrap:e};if(r&&a.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Wf(e,t);return!(!r.childCount||r.firstChild.isLeaf||(this.unplaced=new _u(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),0))}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Wf(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new _u(Vf(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new _u(Vf(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let f=0;f<i.length;f++)this.openFrontierNode(i[f]);let o=this.unplaced,s=n?n.content:o.content,a=o.openStart-e,u=0,l=[],{match:c,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));c=c.matchFragment(r)}let h=s.size+e-(o.content.size-o.openEnd);for(;u<s.childCount;){let e=s.child(u),t=c.matchType(e.type);if(!t)break;u++,(u>1||0==a||e.content.size)&&(c=t,l.push(Xf(e.mark(d.allowedMarks(e.marks)),1==u?a:0,u==s.childCount?h:-1)))}let p=u==s.childCount;p||(h=-1),this.placed=Gf(this.placed,t,hu.from(l)),this.frontier[t].match=c,p&&h<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=s;f<h;f++){let e=m.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),m=e.content}this.unplaced=p?0==e?_u.empty:new _u(Vf(o.content,e-1,1),e-1,h<0?o.openEnd:e-1):new _u(Vf(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!Kf(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),o=Kf(e,t,r,n,i);if(o){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Kf(e,n,r,t,!0);if(!i||i.childCount)continue e}return{depth:t,fit:o,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Gf(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=Gf(this.placed,this.depth,hu.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(hu.empty,!0);e.childCount&&(this.placed=Gf(this.placed,this.frontier.length,e))}}function Vf(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Vf(e.firstChild.content,t-1,n)))}function Gf(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Gf(e.lastChild.content,t-1,n)))}function Wf(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Xf(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Xf(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(hu.empty,!0)))),e.copy(r)}function Kf(e,t,n,r,i){let o=e.node(t),s=i?e.indexAfter(t):e.index(t);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,o.content,s)?a:null}class qf extends If{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Rf.fail("No node at attribute step's position");let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Rf.fromReplace(e,this.pos,this.pos+1,new _u(hu.from(r),0,t.isLeaf?0:1))}getMap(){return Nf.empty}invert(e){return new qf(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new qf(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new qf(t.pos,t.attr,t.value)}}If.jsonID("attr",qf);class Jf extends If{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let r in e.attrs)t[r]=e.attrs[r];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Rf.ok(n)}getMap(){return Nf.empty}invert(e){return new Jf(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Jf(t.attr,t.value)}}If.jsonID("docAttr",Jf);let Zf=class extends Error{};Zf=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(Zf.prototype=Object.create(Error.prototype)).constructor=Zf,Zf.prototype.name="TransformError";const Qf=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function em(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}function tm(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function nm(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}function rm(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function im(e,t,n,r){let i,o,s=t.nodeBefore,a=t.nodeAfter,u=s.type.spec.isolating||a.type.spec.isolating;if(!u&&function(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!(!(r&&i&&r.type.compatibleContent(i.type))||(!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(o,o+1)||!i.isTextblock&&!$f(e.doc,t.pos)||(n&&n(e.tr.join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let l=!u&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(i=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(i[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,o=hu.empty;for(let e=i.length-1;e>=0;e--)o=hu.from(i[e].create(null,o));o=hu.from(s.copy(o));let u=e.tr.step(new Bf(t.pos-1,r,t.pos,r,new _u(o,1,0),i.length,!0)),l=u.doc.resolve(r+2*i.length);l.nodeAfter&&l.nodeAfter.type==s.type&&$f(u.doc,l.pos)&&u.join(l.pos),n(u.scrollIntoView())}return!0}let c=a.type.spec.isolating||r>0&&u?null:Vl.findFrom(t,1),d=c&&c.$from.blockRange(c.$to),h=d&&Hf(d);if(null!=h&&h>=t.depth)return n&&n(e.tr.lift(d,h).scrollIntoView()),!0;if(l&&em(a,"start",!0)&&em(s,"end")){let r=s,i=[];for(;i.push(r),!r.isTextblock;)r=r.lastChild;let o=a,u=1;for(;!o.isTextblock;o=o.firstChild)u++;if(r.canReplace(r.childCount,r.childCount,o.content)){if(n){let r=hu.empty;for(let e=i.length-1;e>=0;e--)r=hu.from(i[e].copy(r));n(e.tr.step(new Bf(t.pos-i.length,t.pos+a.nodeSize,t.pos+u,t.pos+a.nodeSize-u,new _u(r,i.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function om(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(n&&n(t.tr.setSelection(Kl.create(t.doc,e<0?i.start(o):i.end(o)))),!0)}}const sm=om(-1),am=om(1);function um(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}let lm=um(Qf,((e,t,n)=>{let r=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}(e,n);if(!r)return!1;let i=tm(r);if(!i){let n=r.blockRange(),i=n&&Hf(n);return null!=i&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let o=i.nodeBefore;if(im(e,i,t,-1))return!0;if(0==r.parent.content.size&&(em(o,"end")||Jl.isSelectable(o)))for(let s=r.depth;;s--){let n=Yf(e.doc,r.before(s),r.after(s),_u.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(em(o,"end")?Vl.findFrom(r.doc.resolve(r.mapping.map(i.pos,-1)),-1):Jl.create(r.doc,i.pos-o.nodeSize)),t(r.scrollIntoView())}return!0}if(1==s||r.node(s-1).childCount>1)break}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),0))}),((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;o=tm(r)}let s=o&&o.nodeBefore;return!(!s||!Jl.isSelectable(s)||(t&&t(e.tr.setSelection(Jl.create(e.doc,o.pos-s.nodeSize)).scrollIntoView()),0))})),cm=um(Qf,((e,t,n)=>{let r=function(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}(e,n);if(!r)return!1;let i=nm(r);if(!i)return!1;let o=i.nodeAfter;if(im(e,i,t,1))return!0;if(0==r.parent.content.size&&(em(o,"start")||Jl.isSelectable(o))){let n=Yf(e.doc,r.before(),r.after(),_u.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(em(o,"start")?Vl.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):Jl.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1||(t&&t(e.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),0))}),((e,t,n)=>{let{$head:r,empty:i}=e.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;o=nm(r)}let s=o&&o.nodeAfter;return!(!s||!Jl.isSelectable(s)||(t&&t(e.tr.setSelection(Jl.create(e.doc,o.pos)).scrollIntoView()),0))}));const dm={Enter:um(((e,t)=>{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r)||(t&&t(e.tr.insertText("\n").scrollIntoView()),0))}),((e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Ql||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=rm(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,s=e.tr.insert(n,o.createAndFill());s.setSelection(Kl.create(s.doc,n+1)),t(s.scrollIntoView())}return!0}),((e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(jf(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Hf(r);return null!=i&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)}),((e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof Jl&&e.selection.node.isBlock)return!(!n.parentOffset||!jf(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.depth)return!1;let i,o,s=[],a=!1,u=!1;for(let h=n.depth;;h--){if(n.node(h).isBlock){a=n.end(h)==n.pos+(n.depth-h),u=n.start(h)==n.pos-(n.depth-h),o=rm(n.node(h-1).contentMatchAt(n.indexAfter(h-1))),s.unshift(a&&o?{type:o}:null),i=h;break}if(1==h)return!1;s.unshift(null)}let l=e.tr;(e.selection instanceof Kl||e.selection instanceof Ql)&&l.deleteSelection();let c=l.mapping.map(n.pos),d=jf(l.doc,c,s.length,s);if(d||(s[0]=o?{type:o}:null,d=jf(l.doc,c,s.length,s)),l.split(c,s.length,s),!a&&u&&n.node(i).type!=o){let e=l.mapping.map(n.before(i)),t=l.doc.resolve(e);o&&n.node(i-1).canReplaceWith(t.index(),t.index()+1,o)&&l.setNodeMarkup(l.mapping.map(n.before(i)),o)}return t&&t(l.scrollIntoView()),!0})),"Mod-Enter":(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=rm(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,s.createAndFill());i.setSelection(Vl.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Backspace:lm,"Mod-Backspace":lm,"Shift-Backspace":lm,Delete:cm,"Mod-Delete":cm,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new Ql(e.doc))),!0)},hm={"Ctrl-h":dm.Backspace,"Alt-Backspace":dm["Mod-Backspace"],"Ctrl-d":dm.Delete,"Ctrl-Alt-Backspace":dm["Mod-Delete"],"Alt-Delete":dm["Mod-Delete"],"Alt-d":dm["Mod-Delete"],"Ctrl-a":sm,"Ctrl-e":am};for(let os in dm)hm[os]=dm[os];const pm=("undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&"darwin"==os.platform())?hm:dm;function fm(e,t){return e.reduce(((e,n,r)=>e.concat(t(n,r))),[])}const mm=(e,t,n=void 0)=>fm(e,(e=>{if("string"==typeof e)return t(e,n);switch(e.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return[{type:e.type,children:mm(e.children,t,e.type)}];case"link":return[{type:e.type,url:e.url,children:mm(e.children,t,e.type)}];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return[{type:e.type,action:e.action,params:e.params,children:mm(e.children,t,e.type)}];case"mention":case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return[e]}}));function Em(e,t){return n=>{const r=n;let i=0;const o=[];for(const s of _o(n,e)){s.index-i>0&&o.push(r.substring(i,s.index));const e=t(s);Array.isArray(e)?o.push(...e):o.push(e),i=s.index+s[0].length}return i<n.length&&o.push(n.substring(i)),o}}const gm="’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var _m=(e=>(e[e.italic=1]="italic",e[e.strikethrough=2]="strikethrough",e[e.bold=4]="bold",e))(_m||{});const Am=[0,1,2,3,4,5,6].map((e=>{const t=[];return 1&e||t.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/),2&e||t.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/),4&e||t.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/),new RegExp(t.map((e=>e.source)).join("|"),"g")})),Dm={_:1,"*":4,"~":2};function vm(e){return Om(e,0)}function Om(e,t=0){const n=Am[t],r=n?function(e){const t=Em(Tm.getOrCompute(e,(()=>new RegExp(`(?:^|[\\s${gm}])(?:${e.source})(?=[\\s${gm}]|$)`,"g"))),(e=>{const t=e[0][1],n=e[1]||e[2]||e[3]||e[4]||e[5]||e[6];return[" ",{type:_m[Dm[t]],children:[n]}]}));return e=>{const[n,...r]=t(" "+e);return n.length>1&&r.unshift(n.substring(1)),r}}(n):()=>[e];return mm(r(e),((e,n)=>"bold"===n||"italic"===n||"strikethrough"===n?Om(e,t|_m[n]):[e]))}const Tm=function(){const e=function(){try{return new WeakMap}catch(e){const n={has:()=>!1,get:()=>{},set:()=>n};return n}}();return{getOrCompute(t,n){if(e.has(t))return e.get(t);const r=n();return e.set(t,r),r}}}();function Sm(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function ym(e,t){for(var n=e.length-1;n>=0;n--)!0===t(e[n])&&e.splice(n,1)}function Cm(e){throw new Error("Unhandled case for value: '"+e+"'")}var Nm=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=n?n.split(r):[],o=e.split(r);t=o.shift();)-1===Sm(i,t)&&i.push(t);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=n?n.split(r):[],o=e.split(r);i.length&&(t=o.shift());){var s=Sm(i,t);-1!==s&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")},e}(),bm=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new Nm({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},n=this.createCssClass(e);return n&&(t.class=n),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var n=[t],r=e.getCssClassSuffixes(),i=0,o=r.length;i<o;i++)n.push(t+"-"+r[i]);return n.join(" ")}return""},e.prototype.processAnchorText=function(e){return this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var n=t.length,r=t.location;return"smart"===r?function(e,t,n){var r,i;null==n?(n="…",i=3,r=8):(i=n.length,r=n.length);var o=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},s=function(e,t){var r=t/2,i=Math.ceil(r),o=-1*Math.floor(r),s="";return o<0&&(s=e.substr(o)),e.substr(0,i)+n+s};if(e.length<=t)return e;var a=t-i,u=function(e){var t={},n=e,r=n.match(/^([a-z]+):\/\//i);return r&&(t.scheme=r[1],n=n.substr(r[0].length)),(r=n.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(t.host=r[1],n=n.substr(r[0].length)),(r=n.match(/^\/(.*?)(?=(\?|#|$))/i))&&(t.path=r[1],n=n.substr(r[0].length)),(r=n.match(/^\?(.*?)(?=(#|$))/i))&&(t.query=r[1],n=n.substr(r[0].length)),(r=n.match(/^#(.*?)$/i))&&(t.fragment=r[1]),t}(e);if(u.query){var l=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);l&&(u.query=u.query.substr(0,l[1].length),e=o(u))}if(e.length<=t)return e;if(u.host&&(u.host=u.host.replace(/^www\./,""),e=o(u)),e.length<=t)return e;var c="";if(u.host&&(c+=u.host),c.length>=a)return u.host.length==t?(u.host.substr(0,t-i)+n).substr(0,a+r):s(c,a).substr(0,a+r);var d="";if(u.path&&(d+="/"+u.path),u.query&&(d+="?"+u.query),d){if((c+d).length>=a)return(c+d).length==t?(c+d).substr(0,t):(c+s(d,a-c.length)).substr(0,a+r);c+=d}if(u.fragment){var h="#"+u.fragment;if((c+h).length>=a)return(c+h).length==t?(c+h).substr(0,t):(c+s(h,a-c.length)).substr(0,a+r);c+=h}if(u.scheme&&u.host){var p=u.scheme+"://";if((c+p).length<a)return(p+c).substr(0,t)}if(c.length<=t)return c;var f="";return a>0&&(f=c.substr(-1*Math.floor(a/2))),(c.substr(0,Math.ceil(a/2))+n+f).substr(0,a+r)}(e,n):"middle"===r?function(e,t,n){if(e.length<=t)return e;var r,i;null==n?(n="…",r=8,i=3):(r=n.length,i=n.length);var o=t-i,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+r)}(e,n):function(e,t){return function(e,t,n){var r;return e.length>t&&(null==n?(n="…",r=3):r=n.length,e=e.substring(0,t-r)+n),e}(e,t,void 0)}(e,n)},e}(),Im=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),Rm=function(e,t){return Rm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Rm(e,t)};function wm(e,t){function n(){this.constructor=e}Rm(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var km,Lm=function(){return Lm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Lm.apply(this,arguments)},xm=function(e){function t(t){var n=e.call(this,t)||this;return n.email="",n.email=t.email,n}return wm(t,e),t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Im),Mm=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="",n.hashtag="",n.serviceName=t.serviceName,n.hashtag=t.hashtag,n}return wm(t,e),t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t}(Im),Fm=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.mention="",n.mention=t.mention,n.serviceName=t.serviceName,n}return wm(t,e),t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var t=e.prototype.getCssClassSuffixes.call(this),n=this.getServiceName();return n&&t.push(n),t},t}(Im),Bm=function(e){function t(t){var n=e.call(this,t)||this;return n.number="",n.plusSign=!1,n.number=t.number,n.plusSign=t.plusSign,n}return wm(t,e),t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Im),Pm=function(e){function t(t){var n=e.call(this,t)||this;return n.url="",n.urlMatchType="scheme",n.protocolUrlMatch=!1,n.protocolRelativeMatch=!1,n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.schemePrefixRegex=/^(https?:\/\/)?/i,n.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,n.protocolRelativeRegex=/^\/\//,n.protocolPrepended=!1,n.urlMatchType=t.urlMatchType,n.url=t.url,n.protocolUrlMatch=t.protocolUrlMatch,n.protocolRelativeMatch=t.protocolRelativeMatch,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return wm(t,e),t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},t.prototype.getAnchorHref=function(){return this.getUrl().replace(/&/g,"&")},t.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),this.decodePercentEncoding&&(e=this.removePercentEncoding(e)),e},t.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},t.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},t.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},t.prototype.removeTrailingSlash=function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e},t.prototype.removePercentEncoding=function(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch(e){return t}},t}(Im),Um=function(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder},Hm=/[A-Za-z]/,jm=/[\d]/,$m=/[\D]/,Ym=/\s/,zm=/['"]/,Vm=/[\x00-\x1F\x7F]/,Gm=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,Wm=Gm+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,Xm=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,Km=Wm+Xm,qm=Wm+Xm,Jm="(?:["+Xm+"]{1,3}\\.){3}["+Xm+"]{1,3}",Zm="["+qm+"](?:["+qm+"\\-]{0,61}["+qm+"])?",Qm=function(e){return"(?=("+Zm+"))\\"+e},eE=function(e){return"(?:"+Qm(e)+"(?:\\."+Qm(e+1)+"){0,126}|"+Jm+")"},tE=new RegExp("["+qm+"]"),nE=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|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|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|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|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,rE=new RegExp("["+qm+"!#$%&'*+/=?^_`{|}~-]"),iE=new RegExp("^"+nE.source+"$"),oE=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.localPartCharRegex=rE,t.strictTldRegex=iE,t}return wm(t,e),t.prototype.parseMatches=function(e){for(var t=this.tagBuilder,n=this.localPartCharRegex,r=this.strictTldRegex,i=[],o=e.length,s=new sE,a={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},u=0,l=0,c=s;u<o;){var d=e.charAt(u);switch(l){case 0:h(d);break;case 1:p(e.charAt(u-1),d);break;case 2:f(d);break;case 3:m(d);break;case 4:E(d);break;case 5:g(d);break;case 6:_(d);break;case 7:A(d);break;default:Cm(l)}u++}return O(),i;function h(e){"m"===e?D(1):n.test(e)&&D()}function p(e,t){":"===e?n.test(t)?(l=2,c=new sE(Lm(Lm({},c),{hasMailtoPrefix:!0}))):v():a[e]===t||(n.test(t)?l=2:"."===t?l=3:"@"===t?l=4:v())}function f(e){"."===e?l=3:"@"===e?l=4:n.test(e)||v()}function m(e){"."===e||"@"===e?v():n.test(e)?l=2:v()}function E(e){tE.test(e)?l=5:v()}function g(e){"."===e?l=7:"-"===e?l=6:tE.test(e)||O()}function _(e){"-"===e||"."===e?O():tE.test(e)?l=5:O()}function A(e){"."===e||"-"===e?O():tE.test(e)?(l=5,c=new sE(Lm(Lm({},c),{hasDomainDot:!0}))):O()}function D(e){void 0===e&&(e=2),l=e,c=new sE({idx:u})}function v(){l=0,c=s}function O(){if(c.hasDomainDot){var n=e.slice(c.idx,u);/[-.]$/.test(n)&&(n=n.slice(0,-1));var o=c.hasMailtoPrefix?n.slice(7):n;(function(e){var t=(e.split(".").pop()||"").toLowerCase();return r.test(t)})(o)&&i.push(new xm({tagBuilder:t,matchedText:n,offset:c.idx,email:o}))}v()}},t}(Um),sE=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot},aE=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},e.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},e.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),n=t&&t[0].toLowerCase();return"javascript:"!==n&&"vbscript:"!==n},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t||this.hasFullProtocolRegex.test(t)||this.hasWordCharAfterProtocolRegex.test(e))},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+Gm+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),uE=(km=new RegExp("[/?#](?:["+qm+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+qm+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,eE(2),")","|","(","(//)?",/(?:www\.)/.source,eE(6),")","|","(","(//)?",eE(10)+"\\.",nE.source,"(?![-"+Km+"])",")",")","(?::[0-9]+)?","(?:"+km.source+")?"].join(""),"gi")),lE=new RegExp("["+qm+"]"),cE=function(e){function t(t){var n=e.call(this,t)||this;return n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.matcherRegex=uE,n.wordCharRegExp=lE,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return wm(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.stripPrefix,i=this.stripTrailingSlash,o=this.decodePercentEncoding,s=this.tagBuilder,a=[],u=function(){var n=t[0],u=t[1],c=t[4],d=t[5],h=t[9],p=t.index,f=d||h,m=e.charAt(p-1);if(!aE.isValid(n,u))return"continue";if(p>0&&"@"===m)return"continue";if(p>0&&f&&l.wordCharRegExp.test(m))return"continue";if(/\?$/.test(n)&&(n=n.substr(0,n.length-1)),l.matchHasUnbalancedClosingParen(n))n=n.substr(0,n.length-1);else{var E=l.matchHasInvalidCharAfterTld(n,u);E>-1&&(n=n.substr(0,E))}var g=["http://","https://"].find((function(e){return!!u&&-1!==u.indexOf(e)}));if(g){var _=n.indexOf(g);n=n.substr(_),u=u.substr(_),p+=_}var A=u?"scheme":c?"www":"tld",D=!!u;a.push(new Pm({tagBuilder:s,matchedText:n,offset:p,urlMatchType:A,url:n,protocolUrlMatch:D,protocolRelativeMatch:!!f,stripPrefix:r,stripTrailingSlash:i,decodePercentEncoding:o}))},l=this;null!==(t=n.exec(e));)u();return a},t.prototype.matchHasUnbalancedClosingParen=function(e){var t,n=e.charAt(e.length-1);if(")"===n)t="(";else if("]"===n)t="[";else{if("}"!==n)return!1;t="{"}for(var r=0,i=0,o=e.length-1;i<o;i++){var s=e.charAt(i);s===t?r++:s===n&&(r=Math.max(r-1,0))}return 0===r},t.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var n=0;t&&(n=e.indexOf(":"),e=e.slice(n));var r=new RegExp("^((.?//)?[-."+qm+"]*[-"+qm+"]\\.[-"+qm+"]+)").exec(e);return null===r?-1:(n+=r[1].length,e=e.slice(r[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?n:-1)},t}(Um),dE=new RegExp("#[_"+qm+"]{1,139}(?![_"+qm+"])","g"),hE=new RegExp("[^"+qm+"]"),pE=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegex=dE,n.nonWordCharRegex=hE,n.serviceName=t.serviceName,n}return wm(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,i=this.serviceName,o=this.tagBuilder,s=[];null!==(t=n.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||r.test(u)){var l=t[0],c=t[0].slice(1);s.push(new Mm({tagBuilder:o,matchedText:l,offset:a,serviceName:i,hashtag:c}))}}return s},t}(Um),fE=new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source+"|"+/(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source,"g"),mE=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.matcherRegex=fE,t}return wm(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,i=[];null!==(t=n.exec(e));){var o=t[0],s=o.replace(/[^0-9,;#]/g,""),a=!(!t[1]&&!t[2]),u=0==t.index?"":e.substr(t.index-1,1),l=e.substr(t.index+o.length,1),c=!u.match(/\d/)&&!l.match(/\d/);this.testMatch(t[3])&&this.testMatch(o)&&c&&i.push(new Bm({tagBuilder:r,matchedText:o,offset:t.index,number:s,plusSign:a}))}return i},t.prototype.testMatch=function(e){return $m.test(e)},t}(Um),EE=new RegExp("@[_"+qm+"]{1,50}(?![_"+qm+"])","g"),gE=new RegExp("@[_."+qm+"]{1,30}(?![_"+qm+"])","g"),_E=new RegExp("@[-_."+qm+"]{1,50}(?![-_"+qm+"])","g"),AE=new RegExp("[^"+qm+"]"),DE=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegexes={twitter:EE,instagram:gE,soundcloud:_E},n.nonWordCharRegex=AE,n.serviceName=t.serviceName,n}return wm(t,e),t.prototype.parseMatches=function(e){var t,n=this.serviceName,r=this.matcherRegexes[this.serviceName],i=this.nonWordCharRegex,o=this.tagBuilder,s=[];if(!r)return s;for(;null!==(t=r.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||i.test(u)){var l=t[0].replace(/\.+$/g,""),c=l.slice(1);s.push(new Fm({tagBuilder:o,matchedText:l,offset:a,serviceName:n,mention:c}))}}return s},t}(Um);var vE=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing},OE=function(){function e(t){void 0===t&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(t.urls),this.email="boolean"==typeof t.email?t.email:this.email,this.phone="boolean"==typeof t.phone?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow="boolean"==typeof t.newWindow?t.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(t.stripPrefix),this.stripTrailingSlash="boolean"==typeof t.stripTrailingSlash?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding="boolean"==typeof t.decodePercentEncoding?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(!1!==n&&"twitter"!==n&&"instagram"!==n&&"soundcloud"!==n)throw new Error("invalid `mention` cfg - see docs");var r=this.hashtag;if(!1!==r&&"twitter"!==r&&"facebook"!==r&&"instagram"!==r)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){return new e(n).link(t)},e.parse=function(t,n){return new e(n).parse(t)},e.prototype.normalizeUrlsCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},e.prototype.normalizeStripPrefixCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},e.prototype.normalizeTruncateCfg=function(e){return"number"==typeof e?{length:e,location:"end"}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=t[n]);return e}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},e.prototype.parse=function(e){var t=this,n=["a","style","script"],r=0,i=[];return function(e,t){for(var n,r=t.onOpenTag,i=t.onCloseTag,o=t.onText,s=t.onComment,a=t.onDoctype,u=new vE,l=0,c=e.length,d=0,h=0,p=u;l<c;){var f=e.charAt(l);switch(d){case 0:m(f);break;case 1:E(f);break;case 2:_(f);break;case 3:g(f);break;case 4:A(f);break;case 5:D(f);break;case 6:v(f);break;case 7:O(f);break;case 8:T(f);break;case 9:S(f);break;case 10:y(f);break;case 11:C(f);break;case 12:N(f);break;case 13:b();break;case 14:I(f);break;case 15:R(f);break;case 16:w(f);break;case 17:k(f);break;case 18:L(f);break;case 19:x(f);break;case 20:M(f);break;default:Cm(d)}l++}function m(e){"<"===e&&B()}function E(e){"!"===e?d=13:"/"===e?(d=2,p=new vE(Lm(Lm({},p),{isClosing:!0}))):"<"===e?B():Hm.test(e)?(d=3,p=new vE(Lm(Lm({},p),{isOpening:!0}))):(d=0,p=u)}function g(e){Ym.test(e)?(p=new vE(Lm(Lm({},p),{name:U()})),d=4):"<"===e?B():"/"===e?(p=new vE(Lm(Lm({},p),{name:U()})),d=12):">"===e?(p=new vE(Lm(Lm({},p),{name:U()})),P()):Hm.test(e)||jm.test(e)||":"===e||F()}function _(e){">"===e?F():Hm.test(e)?d=3:F()}function A(e){Ym.test(e)||("/"===e?d=12:">"===e?P():"<"===e?B():"="===e||zm.test(e)||Vm.test(e)?F():d=5)}function D(e){Ym.test(e)?d=6:"/"===e?d=12:"="===e?d=7:">"===e?P():"<"===e?B():zm.test(e)&&F()}function v(e){Ym.test(e)||("/"===e?d=12:"="===e?d=7:">"===e?P():"<"===e?B():zm.test(e)?F():d=5)}function O(e){Ym.test(e)||('"'===e?d=8:"'"===e?d=9:/[>=`]/.test(e)?F():"<"===e?B():d=10)}function T(e){'"'===e&&(d=11)}function S(e){"'"===e&&(d=11)}function y(e){Ym.test(e)?d=4:">"===e?P():"<"===e&&B()}function C(e){Ym.test(e)?d=4:"/"===e?d=12:">"===e?P():"<"===e?B():(d=4,l--)}function N(e){">"===e?(p=new vE(Lm(Lm({},p),{isClosing:!0})),P()):d=4}function b(t){"--"===e.substr(l,2)?(l+=2,p=new vE(Lm(Lm({},p),{type:"comment"})),d=14):"DOCTYPE"===e.substr(l,7).toUpperCase()?(l+=7,p=new vE(Lm(Lm({},p),{type:"doctype"})),d=20):F()}function I(e){"-"===e?d=15:">"===e?F():d=16}function R(e){"-"===e?d=18:">"===e?F():d=16}function w(e){"-"===e&&(d=17)}function k(e){d="-"===e?18:16}function L(e){">"===e?P():"!"===e?d=19:"-"===e||(d=16)}function x(e){"-"===e?d=17:">"===e?P():d=16}function M(e){">"===e?P():"<"===e&&B()}function F(){d=0,p=u}function B(){d=1,p=new vE({idx:l})}function P(){var t=e.slice(h,p.idx);t&&o(t,h),"comment"===p.type?s(p.idx):"doctype"===p.type?a(p.idx):(p.isOpening&&r(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),F(),h=l+1}function U(){var t=p.idx+(p.isClosing?2:1);return e.slice(t,l).toLowerCase()}h<l&&(n=e.slice(h,l),o(n,h),h=l+1)}(e,{onOpenTag:function(e){n.indexOf(e)>=0&&r++},onText:function(e,n){if(0===r){var o=function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],i=0;n=t.exec(e);)r.push(e.substring(i,n.index)),r.push(n[0]),i=n.index+n[0].length;return r.push(e.substring(i)),r}(e,/( | |<|<|>|>|"|"|')/gi),s=n;o.forEach((function(e,n){if(n%2==0){var r=t.parseText(e,s);i.push.apply(i,r)}s+=e.length}))}},onCloseTag:function(e){n.indexOf(e)>=0&&(r=Math.max(r-1,0))},onComment:function(e){},onDoctype:function(e){}}),i=this.compactMatches(i),i=this.removeUnwantedMatches(i)},e.prototype.compactMatches=function(e){e.sort((function(e,t){return e.getOffset()-t.getOffset()}));for(var t=0;t<e.length-1;t++){var n=e[t],r=n.getOffset(),i=n.getMatchedText().length,o=r+i;if(t+1<e.length){if(e[t+1].getOffset()===r){var s=e[t+1].getMatchedText().length>i?t:t+1;e.splice(s,1);continue}e[t+1].getOffset()<o&&e.splice(t+1,1)}}return e},e.prototype.removeUnwantedMatches=function(e){return this.hashtag||ym(e,(function(e){return"hashtag"===e.getType()})),this.email||ym(e,(function(e){return"email"===e.getType()})),this.phone||ym(e,(function(e){return"phone"===e.getType()})),this.mention||ym(e,(function(e){return"mention"===e.getType()})),this.urls.schemeMatches||ym(e,(function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()})),this.urls.wwwMatches||ym(e,(function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()})),this.urls.tldMatches||ym(e,(function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()})),e},e.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var n=this.getMatchers(),r=[],i=0,o=n.length;i<o;i++){for(var s=n[i].parseMatches(e),a=0,u=s.length;a<u;a++)s[a].setOffset(t+s[a].getOffset());r.push.apply(r,s)}return r},e.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"<").replace(/>/g,">"));for(var t=this.parse(e),n=[],r=0,i=0,o=t.length;i<o;i++){var s=t[i];n.push(e.substring(r,s.getOffset())),n.push(this.createMatchReturnVal(s)),r=s.getOffset()+s.getMatchedText().length}return n.push(e.substring(r)),n.join("")},e.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof Nm?t.toAnchorString():e.buildTag().toAnchorString()},e.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new pE({tagBuilder:e,serviceName:this.hashtag}),new oE({tagBuilder:e}),new mE({tagBuilder:e}),new DE({tagBuilder:e,serviceName:this.mention}),new cE({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},e.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new bm({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},e.version="3.14.3",e.AnchorTagBuilder=bm,e.HtmlTag=Nm,e.matcher={Email:oE,Hashtag:pE,Matcher:Um,Mention:DE,Phone:mE,Url:cE},e.match={Email:xm,Hashtag:Mm,Match:Im,Mention:Fm,Phone:Bm,Url:Pm},e}();function TE(e,t=e){return{type:"autolink",url:e,text:t}}const SE=Em(/<!!mention:([^>\s]*?)\|(.*?)>/gm,(([e,t,n])=>function(e,t){return{type:"mention",id:e,text:t}}(decodeURIComponent(t),n))),yE=Em(/<!!customemoji:(.*?)>/gm,(([e,t])=>function(e){return{type:"customemoji",text:e}}(t))),CE=Em(/<((?:https?|mailto):.*?)\|(.*?)>/gi,(([e,t,n])=>function(e,t=[]){return{type:"link",url:e,children:t}}(t,[n]))),NE=Em(/<actionlink:([^|]+)[|]([^>]*)>/gi,(([e,t,n])=>{const{action:r,params:i}=IE(t);return function(e,t,n=[]){return{type:"actionlink",action:e,params:t,children:n}}(r,i,[n])})),bE=Em(/<actionbutton:([^|]+)[|]([^>]*)>/gi,(([e,t,n])=>{const{action:r,params:i}=IE(t);return function(e,t,n=[]){return{type:"actionbutton",action:e,params:t,children:n}}(r,i,[n])}));function IE(e){const t=e.indexOf("?");return-1===t?{action:e,params:{}}:{action:e.slice(0,t),params:Object.fromEntries(new URLSearchParams(e.slice(t)))}}const RE=Em(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g,(([e])=>function(e=[]){return{type:"bulletlist",children:e}}([e.startsWith("\n")?e.slice(1):e]))),wE=Em(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm,(([e,t])=>({type:"bulletpoint",children:[t]}))),kE=e=>{const t=/(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;let n=0;const r=[];for(const i of _o(e,t)){const t=i[0],o=i[1],s=t.startsWith(o)?i.index:i.index+1;s-n>0&&r.push(e.substring(n,s));const a=TE("tel:"+o.replace(/[^0-9+]/g,""),o);r.push(a),n=s+o.length}return n<e.length&&r.push(e.substring(n)),r},LE=e=>CE(e).flatMap((e=>"string"==typeof e?xE(e):["<",...xE(e.url),...xE("|"+e.children[0]+">")])),xE=e=>{const t=OE.parse(e,{urls:!0,email:!0,phone:!1,hashtag:!1,mention:!1}),n=[];let r=0;for(const i of t){const t=i.getOffset(),o=i.getMatchedText(),s=o.length;let a=o;i instanceof xm?a="mailto:"+i.getEmail():i instanceof Pm&&(a=i.getUrl()),t>r&&n.push(e.substring(r,t)),n.push(TE(a,o)),r=t+s}return r<e.length&&n.push(e.substring(r)),n},ME=["Codeblock","Codespan","FormattedLink","Wikitext","Autolink","Actions","Mention","Mention","BulletPoint","CustomEmoji"];const FE=function(){const e=RegExp("[^\n]+\n?|\n","g");return t=>Array.from(t.match(e)||[])}();function BE(e,t={except:[]}){let n=function(e,t){let n=[e];return n=PE(n,t.multilineSteps),n=PE(n,[FE]),n=PE(n,t.singlelineSteps),n=UE(n),n}(e,function(e={except:[]}){const t={multilineSteps:[],singlelineSteps:[]},n=e.except??ME.filter((t=>!e.only.includes(t)));return n.includes("BulletPoint")||t.multilineSteps.push(RE,wE),n.includes("Mention")||t.singlelineSteps.push(SE),n.includes("CustomEmoji")||t.singlelineSteps.push(yE),n.includes("Codespan")||t.multilineSteps.push(Em(/```([^]+?)```/g,(([e,t])=>({type:"codespan",text:t})))),n.includes("FormattedLink")||t.singlelineSteps.push(CE),n.includes("Actions")||(t.singlelineSteps.push(NE),t.singlelineSteps.push(bE)),n.includes("Wikitext")||t.singlelineSteps.push(vm),n.includes("Autolink")||t.singlelineSteps.push(LE,kE),t}(t));return n=HE(n,!1),n}function PE(e,t){return t.reduce(((e,t)=>mm(e,t)),e)}function UE(e){const t=[];let n=-1;for(const r of e)"string"==typeof r?"string"==typeof t[n]?t[n]+=r:t[++n]=r:t[++n]="children"in r?{...r,children:UE(r.children)}:r;return t}function HE(e,t){const n=[];let r=[];for(let i=0;i<e.length;i++){const o=e[i];"string"==typeof o?r.push(o):"children"in o?(r.length>0&&(n.push(r.join("")),r=[]),o.children=HE(o.children,t||"link"===o.type||"actionbutton"===o.type||"actionlink"===o.type),n.push(o)):"autolink"===o.type&&t?r.push(o.text):(r.length>0&&(n.push(r.join("")),r=[]),n.push(o))}return r.length>0&&(n.push(r.join("")),r=[]),n}function jE(e,t,n,r=0,i=[]){for(const o of n)if("string"==typeof o){for(const n of i)e.addMark(t+r,t+r+o.length,n.create());r+=o.length}else if("bold"===o.type||"italic"===o.type||"strikethrough"===o.type){r+=1;const n=vp.marks[o.type],s=[...i,n];[e,r]=jE(e,t,o.children,r,s),r+=1}else ii.unreachable();return[e,r]}function $E(e){return(t,n)=>{if(!n)return!0;let r=t.tr;const i=Kl.between(t.selection.$from,t.selection.$to);return r=r.replaceRangeWith(i.from,i.from,vp.text(e,r.storedMarks)),r=r.replaceRangeWith(i.to+1,i.to+1,vp.text(e,r.storedMarks)),r=r.setSelection(Kl.near(r.doc.resolve(i.to+1))),n(r),!0}}function YE({placeholder:e,disabled:t,className:n="",characterLimit:r,spellcheck:i}){const o=ui(),s=le(),a=le(null);return ae((()=>(s.current=function(e,t,n,r){const i=uc.create({schema:vp,plugins:[...[].filter(VE),Af(),Pp({...pm,"Mod-z":vf,"Mod-y":Of,"Mod-b":$E("*"),"Mod-i":$E("_"),"Mod-Enter":pm.Enter,"Shift-Enter":pm.Enter,Enter:n}),Pp({Enter:pm.Enter}),Tp]}),o=function(){let e,t=0;return n=>{const r=(r=Date.now())=>{window.clearTimeout(e),e=void 0,t=r;const i=function(e){(e=(e=(e=e.removeMark(0,e.doc.content.size,vp.marks.bold)).removeMark(0,e.doc.content.size,vp.marks.italic)).removeMark(0,e.doc.content.size,vp.marks.strikethrough)).doc.firstChild;const t=function(e){const t=[];let n,r="";return e.descendants(((e,i)=>(e.isText?(r+=e.text,n??=i):r&&void 0!==n&&(t.push({text:r,pos:n}),r="",n=void 0),e.type!==vp.nodes.mention))),r&&void 0!==n&&t.push({text:r,pos:n}),t}(e.doc);for(const{text:n,pos:r}of t){const t=BE(n,{only:["Wikitext"]});[e]=jE(e,r,t)}return e}(n.state.tr);n.dispatch(i)},i=Date.now();i-t<300?e||(e=window.setTimeout(r,300)):r(i)}}(),s=new mp(e,{handlePaste:(e,t,n)=>function(e,t,n){const r=t.clipboardData;if(!r)return!1;const i=function(e){const t=e.items||[],n={"image/gif":"gif","image/png":"png","image/jpeg":"jpg","image/svg+xml":"svg"},r=Array.from(t).filter((e=>"file"===e.kind&&n[e.type]));if(0===r.length)return;if(e.types.includes("text/rtf"))return;const i=r[0];let o=i.getAsFile();if(!o.name){const e="image."+n[i.type];o=new File([o],e,{type:i.type,lastModified:Date.now()})}return o}(r);return i?n(i):function(e,t){const n=e.state.tr.insertText(t).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");e.dispatch(n)}(e,r.getData("text/plain")),!0}(e,t,r),clipboardTextSerializer(e){const t=[];return e.content.forEach((e=>{e&&t.push(e.textContent.replace(/<!!mention:.*?\|([^>]*)>/gim,"@$1"))})),t.join()},state:i,dispatchTransaction(e){e=(e=e.removeStoredMark(vp.marks.literal)).removeStoredMark(vp.marks.emoji);const n=s.state.apply(e);s.state.doc.eq(n.doc)||t(new zE(n.doc)),s.updateState(n),e.steps.some((e=>e instanceof Ff))&&setTimeout((()=>o(s)),0)}});return s}(a.current,(e=>o.onChange(e)),(()=>!!o.onEnter&&(o.onEnter(),!0)),(e=>o.onPasteImage(e))),o.editorView=s.current,()=>{o.editorView=void 0,s.current?.destroy()})),[o]),ae((()=>{s.current?.setProps({editable:()=>!t})}),[t]),ae((()=>Xn((()=>s.current?.setProps({attributes:{spellcheck:String(o.spellcheck$.get()??i??!1),class:"t-text-input","aria-label":"Message Field",role:"textbox"}})))),[o,i]),ae((()=>Xn((()=>{const t=s.current;t?.dispatch(t.state.tr.setMeta(Tp,o.placeholder$.get()??e))}))),[o,e]),ae((()=>{r&&Number.isInteger(r)&&o.setMaxLength(r)}),[r,o]),bt("div",{className:`t-editor ${n}`,ref:a})}class zE{constructor(e){this.doc=e,this.size=this.doc.content.size,this.hasContent=Sp(this.doc)}static{this.EMPTY=new zE(vp.topNodeType.create())}asText(){return this.doc.textContent.replace(/\xa0/g," ")}}function VE(e){return null!=e}function GE(e,t){e()||t||(t=e.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/,"`$1`")+" was not true")}(e=>{function t(e,t){(function(e,t){switch(t){case"undefined":return void 0===e;case String:return"string"==typeof e||e instanceof String;case Boolean:return"boolean"==typeof e||e instanceof Boolean;case Number:return"number"==typeof e||e instanceof Number;default:return e instanceof t}})(e,t)||(t.name,String(e))}e.defined=function(e){},e.has=function(e,t){e[t]},e.is=t,e.equals=function(e,t){},e.oneOf=function(e,t){t.includes(e)||JSON.stringify(t)},e.isArray=function(e,n){t(e,Array),e&&e.length>0&&t(e[0],n)},e.optional=function(e,n){void 0!==e&&t(e,n)},e.falsy=function(e){},e.never=function(e){}})(GE||(GE={}));const WE=GE,XE=/^\/.*[^\\]\/[im]*$/;function KE(e){return!!XE.test(e)&&!qE(e).test("")}function qE(e){const t=e.match(/^\/(.*[^\\])\/(.*)$/);if(!t)throw new Error(`Expected ${e} to be a (non-empty) regex`);let n=t[2]||"";return n=n.replace(/[^im]/g,"")+"g",new RegExp(t[1],n)}function JE(e){const t=e.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp("^"+t+"$","i")}function ZE(e,t){const n=Do(t),r=JE(e);return void 0!==n&&r.test(n)}const QE=/^[]/g;function eg(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}class tg{constructor({mode:e,allowedHostnames:t,allowedPhoneNrs:n,allowedMatches:r,forbiddenMatches:i,suppressLinks:o,suppressEmailAddresses:s,suppressPhoneNumbers:a,replacement:u}){WE.oneOf(e,["all","otherOnly","off"]),this.mode=e,this.suppressLinks=!1!==o,this.suppressEmailAddresses=!1!==s,this.suppressPhoneNumbers=!1!==a,this.allowedHostnames=t||[],this.allowedPhoneNrs=(n||[]).filter((e=>e)).map((e=>e.replace(/[^0-9]/g,""))),this.allowedMatches=(r||[]).filter(KE).map((e=>qE(e))),this.forbiddenMatches=(i||[]).filter(KE).map((e=>qE(e))),WE((()=>this.allowedMatches.every((e=>e.flags.includes("g")))),"All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"),WE((()=>this.forbiddenMatches.every((e=>e.flags.includes("g")))),"All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"),u=u?.trim(),this.replacement=u&&u.length>0?u:void 0}shouldSuppress({isContentBySender:e}){return"all"===this.mode||"otherOnly"===this.mode&&!e}}const ng=new RegExp(":arslan:|"+/[#*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\uDC70\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-\uDED7\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\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\uDD3D\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-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\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]|\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\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]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\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.source,"g"),rg=/\uFE0F/g,ig=String.fromCharCode(8205);function og(e){if(":arslan:"===e)return"https://cdn.talkjs.com/__assets/5461191341cea882b3f227c085d5772c.gif";const t=function(e){const t=[];let n=0,r=0,i=0;for(;i<e.length;)n=e.charCodeAt(i++),r?(t.push((65536+(r-55296<<10)+(n-56320)).toString(16)),r=0):55296<=n&&n<=56319?r=n:t.push(n.toString(16));return t.join("-")}((n=e).indexOf(ig)<0?n.replace(rg,""):n);var n;return`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/${t}.svg`}function sg(e){let t="";return e.t&&(t=`(${e.t("CONTACT_INFORMATION_HIDDEN")})`),{formattedLinks:e.formattedLinks??"plaintext",markup:e.markup??!1,useFallbackMentions:e.useFallbackMentions??!1,sameTabLinkRules:e.sameTabLinkRules??[],enableEmojiImageFallback:e.enableEmojiImageFallback??!1,highlight:e.highlight??[],contactInfo:e.contactInfo??!1,suppression:e.suppression??new tg({mode:"off"}),contactInfoHiddenText:e.contactInfoHiddenText??e.suppression?.replacement??t,customEmojiUrls:e.customEmojiUrls??{}}}function ag(e,t){return ug(e,sg(t))}function ug(e,t){return e.flatMap((e=>{if("string"==typeof e){let n=[e];return n=lg(n,(e=>function(e,t){const{suppression:{forbiddenMatches:n,allowedMatches:r}}=t,i=fm(n,(t=>_o(e,t))).filter((([e])=>!r.some((t=>null!==e.match(t))))).map((e=>({offset:e.index,matchedText:e[0]})));return Ao(e,i,(()=>[{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"}]))}(e,t))),n=lg(n,(e=>function(e){return Ao(e,function(e){const t=[];let n;for(;n=ng.exec(e);){const e=n[0],r=n.index;t.push({offset:r,matchedText:e})}return t}(e),(e=>[{type:"emoji",text:e.matchedText}]))}(e))),n}switch(e.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return{type:e.type,children:ug(e.children,t)};case"codespan":case"codeSpan":case"codeblock":case"codeBlock":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return e;case"mention":return{type:"mention",id:e.id,text:e.text};case"autolink":case"autoLink":return function(e,t){return"link"===t.contactInfo?e:"suppress"===t.contactInfo?function(e,t){if(t.allowedMatches.some((t=>null!==e.match(t))))return!0;if(t.forbiddenMatches.some((t=>null!==e.match(t))))return!1;if(e.startsWith("mailto:")){const n=e.substring(7).replace(/^.*@/,"");return!t.suppressEmailAddresses||cg(t.allowedHostnames,n)}if(e.startsWith("tel:")){const n=e.substring(4).replace(/[^0-9]/g,"");return!t.suppressPhoneNumbers||t.allowedPhoneNrs.some((e=>n.endsWith(e)))}return!t.suppressLinks||cg(t.allowedHostnames,Do(e))}(e.url,t.suppression)?e:{type:"suppressed",text:"CONTACT_INFORMATION_HIDDEN"}:e.text}(e,t);case"link":return{type:"link",url:e.url,children:ug(e.children,t)};case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return{type:e.type,action:e.action,params:e.params,children:ug(e.children,t)}}}))}function lg(e,t){return fm(e,(e=>"string"==typeof e?t(e):[e]))}function cg(e,t){for(const n of e)if(JE(n).test(t))return!0;return!1}const dg=()=>{const e=document.createElement("canvas");e.width=e.height=1;const t=e.getContext("2d");return t.textBaseline="top",t.font='100px "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Twemoji Mozilla","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',t.scale(.01,.01),t},hg=(e,t)=>{const n=dg();return n.fillStyle=t,n.fillText(e,0,0),n.getImageData(0,0,1,1).data};function pg(e,t){return e.flatMap((e=>{if("string"==typeof e)return fg(e,t.highlight);switch(e.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletpoint":case"bulletPoint":return mg(e,t);case"bulletlist":case"bulletList":return[yt.createElement("ul",null,...pg(e.children,t))];case"autolink":case"autoLink":return Eg(e,t);case"link":return _g(e,t);case"codeblock":case"codeBlock":return[bt("code",{"data-language":e.language,children:fg(e.text,t.highlight)})];case"codespan":case"codeSpan":return bt("code",{children:fg((n=e.text,n.replace(/^\s*\n/m,"").replace(/\n\s*$/m,"")),t.highlight)});case"mention":return t.useFallbackMentions?bt("span",{className:"mention",children:["@",e.text]}):bt("div",{"data-name":"mention","data-text":e.text});case"suppressed":return[bt("i",{children:t.contactInfoHiddenText})];case"emoji":return t.enableEmojiImageFallback?[bt(gg,{unicode:e.text})]:[e.text];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return Ag(e,t);case"customemoji":case"customEmoji":return e.text;default:WE.never(e)}var n}))}function fg(e,t){if(0===t.length)return[e];const n=function(e){const t=e.map((e=>e.trim())).filter((e=>e));if(0===t.length)return QE;const n=t.map(eg).join("|");return new RegExp(n,"gi")}(t);return Ao(e,_o(e,n).map((e=>({offset:e.index,matchedText:e[0]}))),(({matchedText:e})=>[bt("span",{className:"highlighted-text",children:e})]))}const mg=(e,t)=>{const n={bold:"strong",italic:"em",strikethrough:"del",blockquote:"blockquote",bulletpoint:"li",bulletPoint:"li"}[e.type];return[yt.createElement(n,null,...pg(e.children,t))]},Eg=(e,t)=>[bt("a",{target:Dg(t.sameTabLinkRules,e.url),href:e.url,rel:"noreferrer",children:e.text})];function gg({unicode:e}){const[t,n]=oe((()=>":arslan:"!==e));return ae((()=>{t&&!function(e){try{return function(e){const t=hg(e,"#000"),n=hg(e,"#fff"),r=(e=>!e.includes("")||dg().measureText(e).width<160)(e);return t&&n&&r&&((e,t)=>{const n=[...e].join(",");return n===[...t].join(",")&&!n.startsWith("0,0,0,")})(t,n)}(e)}catch(e){return!0}}(e)&&n(!1)}),[]),t?bt("span",{className:"t-emoji",children:e}):bt("img",{className:"t-emoji",src:og(e),alt:e})}const _g=(e,t)=>{switch(t.formattedLinks){case"link":return[A("a",{target:Dg(t.sameTabLinkRules,e.url),href:e.url},...pg(e.children,t))];case"plaintext":case!1:return[yt.createElement("span",null,...pg(e.children,t))];default:WE.never(t.formattedLinks)}},Ag=(e,t)=>[A("button",{"data-type":e.type,"data-action":e.action,"data-params":JSON.stringify(e.params),disabled:!0},...pg(e.children,t))];function Dg(e,t){for(const n of e)if(XE.test(n)){if(qE(n).test(t))return"_top"}else if(ZE(n,t))return"_top";return"_blank"}function vg({block:e,className:t=""}){const n=function(e,t={}){return pg(e,sg(t))}(ag(e.children,{contactInfo:"link"}),{enableEmojiImageFallback:!0,formattedLinks:"link"});return A("span",{className:`t-text ${t}`},...n)}function Og(e){const t=si(),n=ci(),{className:r="",...i}=e,o=Yr((()=>n.state$.messages.child(n.state$.extCurrentConversationId.get()).lookup.child(e.message.id).content.child(0).url.get()));return bt("div",{className:`t-message-content ${r}`,children:e.message.content.map((n=>bt(Tg,{block:n,theme:t,downloadUrl:o,...i},e.message.createdAt+(e.message.editedAt??0))))})}function Tg({block:e,currentUser:t,message:n,t:r,theme:i,themeCustom:o,downloadUrl:s}){const a=function(e,t){switch(t.type){case"text":return e.TextBlock;case"location":return e.LocationBlock;case"file":switch(t.subtype){case"image":return e.ImageBlock;case"video":return e.VideoBlock;case"voice":return e.VoiceBlock;case"audio":return e.AudioBlock;default:return e.FileBlock}default:ii.never(t)}}(i,e);return bt(a,{block:e,t:r,currentUser:t,message:n,themeCustom:o,downloadUrl:s})}function Sg(e,t=!0){const n=he((t=>{27===t.keyCode&&e()}),[e]);ae((()=>{if(t)return window.addEventListener("keydown",n,!0),()=>window.removeEventListener("keydown",n,!0)}),[t,n])}const yg=function(e){let t;return()=>(void 0===t&&(t={value:e()}),t.value)}((async function(){if("undefined"==typeof window||void 0===window.document)return new Promise((()=>{}));try{const e=new((await import("https://cdn.jsdelivr.net/npm/emoji-picker-element@1.26.3/+esm")).Database);await e.ready()}catch(e){fi.error("Failed to load emoji picker:",e)}}));function Cg(e){const t=ui(),n=yt.useRef(null),r=function(e){const[t,n]=oe();return ae((()=>{let t=!0;return e().then((e=>{t&&n({value:e})})),()=>{t=!1}}),[e]),t}(yg);return yt.useEffect((()=>{if(!r)return;ii.defined(n.current);const e=n.current,i=e.shadowRoot;!function(e){const t=document.createElement("style");t.textContent=".search-row{margin-right:var(--emoji-padding)}.emoji-menu{grid-template-columns:repeat(auto-fill,var(--total-emoji-size));padding:var(--emoji-padding)}.emoji,button.emoji{border-radius:8px}.favorites{border-top-width:1px}input.search:focus{border-color:var(--input-focused-border-color);outline:0}.picker{container-type:size}@container (height < 300px){.favorites{display:none}}#skintone-button{margin:0 -3px 0 4px}.custom-emoji{padding:0}#emo-🏻,#emo-🏼,#emo-🏽,#emo-🏾,#emo-🏿{display:none}[data-has-mouse] .emoji:hover{background-color:var(--button-hover-background)}",e.appendChild(t)}(i);const o=e=>{const n=e.detail.unicode??e.detail.name;t.insertEmoji(n)};function s(e){"mouse"===e.pointerType&&(i.querySelector("section").dataset.hasMouse="true")}return e.addEventListener("emoji-click",o),e.addEventListener("pointermove",s,{once:!0}),()=>{e.removeEventListener("emoji-click",o),e.removeEventListener("pointermove",s)}}),[r,t]),yt.useEffect((()=>{r&&n.current&&n.current.shadowRoot.getElementById("search")?.focus()}),[r]),Sg((()=>t.toggleEmojiPicker(!1))),bt("div",r?{className:"t-emoji-picker",children:bt("emoji-picker",{ref:n,class:e.colorScheme})}:{className:"t-emoji-picker","t-loading":"",children:bt(io,{})})}function Ng(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function bg(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Ig(...e){return t=>{let n=!1;const r=e.map((e=>{const r=bg(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():bg(e[t],null)}}}}function Rg(...e){return he(Ig(...e),e)}function wg(e,t=[]){let n=[];const r=()=>{const t=n.map((e=>z(e)));return function(n){const r=n?.[e]||t;return de((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return r.scopeName=e,[function(t,r){const i=z(r),o=n.length;n=[...n,r];const s=t=>{const{scope:n,children:r,...s}=t,a=n?.[e]?.[o]||i,u=de((()=>s),Object.values(s));return bt(a.Provider,{value:u,children:r})};return s.displayName=t+"Provider",[s,function(n,s){const a=pe(s?.[e]?.[o]||i);if(a)return a;if(void 0!==r)return r;throw new Error(`\`${n}\` must be used within \`${t}\``)}]},kg(r,...t)]}function kg(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return de((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}var Lg=globalThis?.document?ue:()=>{},xg=Ct[" useInsertionEffect ".trim().toString()]||Lg;function Mg({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=function({defaultProp:e,onChange:t}){const[n,r]=oe(e),i=le(n),o=le(t);return xg((()=>{o.current=t}),[t]),ae((()=>{i.current!==n&&(o.current?.(n),i.current=n)}),[n,i]),[n,r,o]}({defaultProp:t,onChange:n}),a=void 0!==e,u=a?e:i;{const t=le(void 0!==e);ae((()=>{const e=t.current;if(e!==a){const t=e?"controlled":"uncontrolled",n=a?"controlled":"uncontrolled";console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=a}),[a,r])}const l=he((t=>{if(a){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&s.current?.(n)}else o(t)}),[a,e,o,s]);return[u,l]}function Fg(e){const t=function(e){const t=Me(((e,t)=>{const{children:n,...r}=e;if(mt(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(n),i=function(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{const t=o(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==O&&(i.ref=t?Ig(t,e):e),_t(n,i)}return Be.count(n)>1?Be.only(null):null}));return t.displayName=`${e}.SlotClone`,t}(e),n=Me(((e,n)=>{const{children:r,...i}=e,o=Be.toArray(r),s=o.find(Pg);if(s){const e=s.props.children,r=o.map((t=>t===s?Be.count(e)>1?Be.only(null):mt(e)?e.props.children:null:t));return bt(t,{...i,ref:n,children:mt(e)?_t(e,void 0,r):null})}return bt(t,{...i,ref:n,children:r})}));return n.displayName=`${e}.Slot`,n}var Bg=Symbol("radix.slottable");function Pg(e){return mt(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Bg}var Ug=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce(((e,t)=>{const n=Fg(`Primitive.${t}`),r=Me(((e,r)=>{const{asChild:i,...o}=e,s=i?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),bt(s,{...o,ref:r})}));return r.displayName=`Primitive.${t}`,{...e,[t]:r}}),{});function Hg(e,t){e&&Ot((()=>e.dispatchEvent(t)))}function jg(e){const t=e+"CollectionProvider",[n,r]=wg(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:t,children:n}=e,r=yt.useRef(null),o=yt.useRef(new Map).current;return bt(i,{scope:t,itemMap:o,collectionRef:r,children:n})};s.displayName=t;const a=e+"CollectionSlot",u=Fg(a),l=yt.forwardRef(((e,t)=>{const{scope:n,children:r}=e,i=Rg(t,o(a,n).collectionRef);return bt(u,{ref:i,children:r})}));l.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",h=Fg(c),p=yt.forwardRef(((e,t)=>{const{scope:n,children:r,...i}=e,s=yt.useRef(null),a=Rg(t,s),u=o(c,n);return yt.useEffect((()=>(u.itemMap.set(s,{ref:s,...i}),()=>{u.itemMap.delete(s)}))),bt(h,{[d]:"",ref:a,children:r})}));return p.displayName=c,[{Provider:s,Slot:l,ItemSlot:p},function(t){const n=o(e+"CollectionConsumer",t),r=yt.useCallback((()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${d}]`)),r=Array.from(n.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)));return r}),[n.collectionRef,n.itemMap]);return r},r]}var $g=z(void 0);function Yg(e){const t=pe($g);return e||t||"ltr"}function zg(e){const t=le(e);return ae((()=>{t.current=e})),de((()=>(...e)=>t.current?.(...e)),[])}var Vg,Gg="dismissableLayer.update",Wg=z({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xg=Me(((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...u}=e,l=pe(Wg),[c,d]=oe(null),h=c?.ownerDocument??globalThis?.document,[,p]=oe({}),f=Rg(t,(e=>d(e))),m=Array.from(l.layers),[E]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(E),_=c?m.indexOf(c):-1,A=l.layersWithOutsidePointerEventsDisabled.size>0,D=_>=g,v=function(e,t=globalThis?.document){const n=zg(e),r=le(!1),i=le((()=>{}));return ae((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){Jg("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",i.current),i.current=r,t.addEventListener("click",i.current,{once:!0})):r()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",e),t.removeEventListener("click",i.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...l.branches].some((e=>e.contains(t)));D&&!n&&(i?.(e),s?.(e),e.defaultPrevented||a?.())}),h),O=function(e,t=globalThis?.document){const n=zg(e),r=le(!1);return ae((()=>{const e=e=>{e.target&&!r.current&&Jg("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...l.branches].some((e=>e.contains(t)))||(o?.(e),s?.(e),e.defaultPrevented||a?.())}),h);return function(e,t=globalThis?.document){const n=zg(e);ae((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{_===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&a&&(e.preventDefault(),a()))}),h),ae((()=>{if(c)return n&&(0===l.layersWithOutsidePointerEventsDisabled.size&&(Vg=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(c)),l.layers.add(c),qg(),()=>{n&&1===l.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Vg)}}),[c,h,n,l]),ae((()=>()=>{c&&(l.layers.delete(c),l.layersWithOutsidePointerEventsDisabled.delete(c),qg())}),[c,l]),ae((()=>{const e=()=>p({});return document.addEventListener(Gg,e),()=>document.removeEventListener(Gg,e)}),[]),bt(Ug.div,{...u,ref:f,style:{pointerEvents:A?D?"auto":"none":void 0,...e.style},onFocusCapture:Ng(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ng(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ng(e.onPointerDownCapture,v.onPointerDownCapture)})}));Xg.displayName="DismissableLayer";var Kg=Me(((e,t)=>{const n=pe(Wg),r=le(null),i=Rg(t,r);return ae((()=>{const e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}}),[n.branches]),bt(Ug.div,{...e,ref:i})}));function qg(){const e=new CustomEvent(Gg);document.dispatchEvent(e)}function Jg(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Hg(i,o):i.dispatchEvent(o)}Kg.displayName="DismissableLayerBranch";var Zg=0;function Qg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var e_="focusScope.autoFocusOnMount",t_="focusScope.autoFocusOnUnmount",n_={bubbles:!1,cancelable:!0},r_=Me(((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,u]=oe(null),l=zg(i),c=zg(o),d=le(null),h=Rg(t,(e=>u(e))),p=le({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;ae((()=>{if(r){let e=function(e){if(p.paused||!a)return;const t=e.target;a.contains(t)?d.current=t:a_(d.current,{select:!0})},t=function(e){if(p.paused||!a)return;const t=e.relatedTarget;null!==t&&(a.contains(t)||a_(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&a_(a)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return a&&r.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[r,a,p.paused]),ae((()=>{if(a){u_.add(p);const e=document.activeElement;if(!a.contains(e)){const t=new CustomEvent(e_,n_);a.addEventListener(e_,l),a.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(a_(r,{select:t}),document.activeElement!==n)return}(i_(a).filter((e=>"A"!==e.tagName)),{select:!0}),document.activeElement===e&&a_(a))}return()=>{a.removeEventListener(e_,l),setTimeout((()=>{const t=new CustomEvent(t_,n_);a.addEventListener(t_,c),a.dispatchEvent(t),t.defaultPrevented||a_(e??document.body,{select:!0}),a.removeEventListener(t_,c),u_.remove(p)}),0)}}}),[a,l,c,p]);const f=he((e=>{if(!n&&!r)return;if(p.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){const t=e.currentTarget,[r,o]=function(e){const t=i_(e);return[o_(t,e),o_(t.reverse(),e)]}(t);r&&o?e.shiftKey||i!==o?e.shiftKey&&i===r&&(e.preventDefault(),n&&a_(o,{select:!0})):(e.preventDefault(),n&&a_(r,{select:!0})):i===t&&e.preventDefault()}}),[n,r,p.paused]);return bt(Ug.div,{tabIndex:-1,...s,ref:h,onKeyDown:f})}));function i_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function o_(e,t){for(const n of e)if(!s_(n,{upTo:t}))return n}function s_(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function a_(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}r_.displayName="FocusScope";var u_=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=l_(e,t),e.unshift(t)},remove(t){e=l_(e,t),e[0]?.resume()}}}();function l_(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var c_=Ct[" useId ".trim().toString()]||(()=>{}),d_=0;function h_(e){const[t,n]=oe(c_());return Lg((()=>{e||n((e=>e??String(d_++)))}),[e]),e||(t?`radix-${t}`:"")}const p_=["top","right","bottom","left"],f_=Math.min,m_=Math.max,E_=Math.round,g_=Math.floor,__=e=>({x:e,y:e}),A_={left:"right",right:"left",bottom:"top",top:"bottom"},D_={start:"end",end:"start"};function v_(e,t,n){return m_(e,f_(t,n))}function O_(e,t){return"function"==typeof e?e(t):e}function T_(e){return e.split("-")[0]}function S_(e){return e.split("-")[1]}function y_(e){return"x"===e?"y":"x"}function C_(e){return"y"===e?"height":"width"}function N_(e){return["top","bottom"].includes(T_(e))?"y":"x"}function b_(e){return y_(N_(e))}function I_(e){return e.replace(/start|end/g,(e=>D_[e]))}function R_(e){return e.replace(/left|right|bottom|top/g,(e=>A_[e]))}function w_(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function k_(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function L_(e,t,n){let{reference:r,floating:i}=e;const o=N_(t),s=b_(t),a=C_(s),u=T_(t),l="y"===o,c=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(u){case"top":p={x:c,y:r.y-i.height};break;case"bottom":p={x:c,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(S_(t)){case"start":p[s]-=h*(n&&l?-1:1);break;case"end":p[s]+=h*(n&&l?-1:1)}return p}async function x_(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=O_(t,e),f=w_(p),m=a[h?"floating"===d?"reference":"floating":d],E=k_(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:c,strategy:u})),g="floating"===d?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,_=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),A=await(null==o.isElement?void 0:o.isElement(_))&&await(null==o.getScale?void 0:o.getScale(_))||{x:1,y:1},D=k_(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:_,strategy:u}):g);return{top:(E.top-D.top+f.top)/A.y,bottom:(D.bottom-E.bottom+f.bottom)/A.y,left:(E.left-D.left+f.left)/A.x,right:(D.right-E.right+f.right)/A.x}}function M_(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function F_(e){return p_.some((t=>e[t]>=0))}function B_(){return"undefined"!=typeof window}function P_(e){return j_(e)?(e.nodeName||"").toLowerCase():"#document"}function U_(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function H_(e){var t;return null==(t=(j_(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function j_(e){return!!B_()&&(e instanceof Node||e instanceof U_(e).Node)}function $_(e){return!!B_()&&(e instanceof Element||e instanceof U_(e).Element)}function Y_(e){return!!B_()&&(e instanceof HTMLElement||e instanceof U_(e).HTMLElement)}function z_(e){return!(!B_()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof U_(e).ShadowRoot)}function V_(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=J_(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function G_(e){return["table","td","th"].includes(P_(e))}function W_(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function X_(e){const t=K_(),n=$_(e)?J_(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function K_(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function q_(e){return["html","body","#document"].includes(P_(e))}function J_(e){return U_(e).getComputedStyle(e)}function Z_(e){return $_(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Q_(e){if("html"===P_(e))return e;const t=e.assignedSlot||e.parentNode||z_(e)&&e.host||H_(e);return z_(t)?t.host:t}function eA(e){const t=Q_(e);return q_(t)?e.ownerDocument?e.ownerDocument.body:e.body:Y_(t)&&V_(t)?t:eA(t)}function tA(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const i=eA(e),o=i===(null==(r=e.ownerDocument)?void 0:r.body),s=U_(i);if(o){const e=nA(s);return t.concat(s,s.visualViewport||[],V_(i)?i:[],e&&n?tA(e):[])}return t.concat(i,tA(i,[],n))}function nA(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function rA(e){const t=J_(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Y_(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=E_(n)!==o||E_(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function iA(e){return $_(e)?e:e.contextElement}function oA(e){const t=iA(e);if(!Y_(t))return __(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=rA(t);let s=(o?E_(n.width):n.width)/r,a=(o?E_(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const sA=__(0);function aA(e){const t=U_(e);return K_()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:sA}function uA(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),o=iA(e);let s=__(1);t&&(r?$_(r)&&(s=oA(r)):s=oA(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==U_(e))&&t}(o,n,r)?aA(o):__(0);let u=(i.left+a.x)/s.x,l=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const e=U_(o),t=r&&$_(r)?U_(r):r;let n=e,i=nA(n);for(;i&&r&&t!==n;){const e=oA(i),t=i.getBoundingClientRect(),r=J_(i),o=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,l*=e.y,c*=e.x,d*=e.y,u+=o,l+=s,n=U_(i),i=nA(n)}}return k_({width:c,height:d,x:u,y:l})}function lA(e,t){const n=Z_(e).scrollLeft;return t?t.left+n:uA(H_(e)).left+n}function cA(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:lA(e,r)),y:r.top+t.scrollTop}}function dA(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=U_(e),r=H_(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,u=0;if(i){o=i.width,s=i.height;const e=K_();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,u=i.offsetTop)}return{width:o,height:s,x:a,y:u}}(e,n);else if("document"===t)r=function(e){const t=H_(e),n=Z_(e),r=e.ownerDocument.body,i=m_(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=m_(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+lA(e);const a=-n.scrollTop;return"rtl"===J_(r).direction&&(s+=m_(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}(H_(e));else if($_(t))r=function(e,t){const n=uA(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Y_(e)?oA(e):__(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n=aA(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return k_(r)}function hA(e,t){const n=Q_(e);return!(n===t||!$_(n)||q_(n))&&("fixed"===J_(n).position||hA(n,t))}function pA(e,t,n){const r=Y_(t),i=H_(t),o="fixed"===n,s=uA(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const u=__(0);function l(){u.x=lA(i)}if(r||!r&&!o)if(("body"!==P_(t)||V_(i))&&(a=Z_(t)),r){const e=uA(t,!0,o,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else i&&l();o&&!r&&i&&l();const c=!i||r||o?__(0):cA(i,a);return{x:s.left+a.scrollLeft-u.x-c.x,y:s.top+a.scrollTop-u.y-c.y,width:s.width,height:s.height}}function fA(e){return"static"===J_(e).position}function mA(e,t){if(!Y_(e)||"fixed"===J_(e).position)return null;if(t)return t(e);let n=e.offsetParent;return H_(e)===n&&(n=n.ownerDocument.body),n}function EA(e,t){const n=U_(e);if(W_(e))return n;if(!Y_(e)){let t=Q_(e);for(;t&&!q_(t);){if($_(t)&&!fA(t))return t;t=Q_(t)}return n}let r=mA(e,t);for(;r&&G_(r)&&fA(r);)r=mA(r,t);return r&&q_(r)&&fA(r)&&!X_(r)?n:r||function(e){let t=Q_(e);for(;Y_(t)&&!q_(t);){if(X_(t))return t;if(W_(t))return null;t=Q_(t)}return null}(e)||n}const gA={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o="fixed"===i,s=H_(r),a=!!t&&W_(t.floating);if(r===s||a&&o)return n;let u={scrollLeft:0,scrollTop:0},l=__(1);const c=__(0),d=Y_(r);if((d||!d&&!o)&&(("body"!==P_(r)||V_(s))&&(u=Z_(r)),Y_(r))){const e=uA(r);l=oA(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}const h=!s||d||o?__(0):cA(s,u,!0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+c.x+h.x,y:n.y*l.y-u.scrollTop*l.y+c.y+h.y}},getDocumentElement:H_,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o="clippingAncestors"===n?W_(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=tA(e,[],!1).filter((e=>$_(e)&&"body"!==P_(e))),i=null;const o="fixed"===J_(e).position;let s=o?Q_(e):e;for(;$_(s)&&!q_(s);){const t=J_(s),n=X_(s);n||"fixed"!==t.position||(i=null),(o?!n&&!i:!n&&"static"===t.position&&i&&["absolute","fixed"].includes(i.position)||V_(s)&&!n&&hA(e,s))?r=r.filter((e=>e!==s)):i=t,s=Q_(s)}return t.set(e,r),r}(t,this._c):[].concat(n),s=[...o,r],a=s[0],u=s.reduce(((e,n)=>{const r=dA(t,n,i);return e.top=m_(r.top,e.top),e.right=f_(r.right,e.right),e.bottom=f_(r.bottom,e.bottom),e.left=m_(r.left,e.left),e}),dA(t,a,i));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:EA,getElementRects:async function(e){const t=this.getOffsetParent||EA,n=this.getDimensions,r=await n(e.floating);return{reference:pA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=rA(e);return{width:t,height:n}},getScale:oA,isElement:$_,isRTL:function(e){return"rtl"===J_(e).direction}};function _A(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const AA=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,u=await async function(e,t){const{placement:n,platform:r,elements:i}=e,o=await(null==r.isRTL?void 0:r.isRTL(i.floating)),s=T_(n),a=S_(n),u="y"===N_(n),l=["left","top"].includes(s)?-1:1,c=o&&u?-1:1,d=O_(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&"number"==typeof f&&(p="end"===a?-1*f:f),u?{x:p*c,y:h*l}:{x:h*l,y:p*c}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:s}}}}},DA=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=O_(e,t),l={x:n,y:r},c=await x_(t,u),d=N_(T_(i)),h=y_(d);let p=l[h],f=l[d];if(o){const e="y"===h?"bottom":"right";p=v_(p+c["y"===h?"top":"left"],p,p-c[e])}if(s){const e="y"===d?"bottom":"right";f=v_(f+c["y"===d?"top":"left"],f,f-c[e])}const m=a.fn({...t,[h]:p,[d]:f});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[h]:o,[d]:s}}}}}},vA=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:u,elements:l}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...E}=O_(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const g=T_(i),_=N_(a),A=T_(a)===a,D=await(null==u.isRTL?void 0:u.isRTL(l.floating)),v=h||(A||!m?[R_(a)]:function(e){const t=R_(e);return[I_(e),t,I_(t)]}(a)),O="none"!==f;!h&&O&&v.push(...function(e,t,n,r){const i=S_(e);let o=function(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}(T_(e),"start"===n,r);return i&&(o=o.map((e=>e+"-"+i)),t&&(o=o.concat(o.map(I_)))),o}(a,m,f,D));const T=[a,...v],S=await x_(t,E),y=[];let C=(null==(r=o.flip)?void 0:r.overflows)||[];if(c&&y.push(S[g]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=S_(e),i=b_(e),o=C_(i);let s="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=R_(s)),[s,R_(s)]}(i,s,D);y.push(S[e[0]],S[e[1]])}if(C=[...C,{placement:i,overflows:y}],!y.every((e=>e<=0))){var N,b;const e=((null==(N=o.flip)?void 0:N.index)||0)+1,t=T[e];if(t&&("alignment"!==d||_===N_(t)||C.every((e=>e.overflows[0]>0&&N_(e.placement)===_))))return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(b=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:b.placement;if(!n)switch(p){case"bestFit":{var I;const e=null==(I=C.filter((e=>{if(O){const t=N_(e.placement);return t===_||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:I[0];e&&(n=e);break}case"initialPlacement":n=a}if(i!==n)return{reset:{placement:n}}}return{}}}},OA=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:u=()=>{},...l}=O_(e,t),c=await x_(t,l),d=T_(i),h=S_(i),p="y"===N_(i),{width:f,height:m}=o.floating;let E,g;"top"===d||"bottom"===d?(E=d,g=h===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,E="end"===h?"top":"bottom");const _=m-c.top-c.bottom,A=f-c.left-c.right,D=f_(m-c[E],_),v=f_(f-c[g],A),O=!t.middlewareData.shift;let T=D,S=v;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=A),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(T=_),O&&!h){const e=m_(c.left,0),t=m_(c.right,0),n=m_(c.top,0),r=m_(c.bottom,0);p?S=f-2*(0!==e||0!==t?e+t:m_(c.left,c.right)):T=m-2*(0!==n||0!==r?n+r:m_(c.top,c.bottom))}await u({...t,availableWidth:S,availableHeight:T});const y=await s.getDimensions(a.floating);return f!==y.width||m!==y.height?{reset:{rects:!0}}:{}}}},TA=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=O_(e,t);switch(r){case"referenceHidden":{const e=M_(await x_(t,{...i,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:F_(e)}}}case"escaped":{const e=M_(await x_(t,{...i,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:F_(e)}}}default:return{}}}}},SA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:u}=t,{element:l,padding:c=0}=O_(e,t)||{};if(null==l)return{};const d=w_(c),h={x:n,y:r},p=b_(i),f=C_(p),m=await s.getDimensions(l),E="y"===p,g=E?"top":"left",_=E?"bottom":"right",A=E?"clientHeight":"clientWidth",D=o.reference[f]+o.reference[p]-h[p]-o.floating[f],v=h[p]-o.reference[p],O=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l));let T=O?O[A]:0;T&&await(null==s.isElement?void 0:s.isElement(O))||(T=a.floating[A]||o.floating[f]);const S=D/2-v/2,y=T/2-m[f]/2-1,C=f_(d[g],y),N=f_(d[_],y),b=C,I=T-m[f]-N,R=T/2-m[f]/2+S,w=v_(b,R,I),k=!u.arrow&&null!=S_(i)&&R!==w&&o.reference[f]/2-(R<b?C:N)-m[f]/2<0,L=k?R<b?R-b:R-I:0;return{[p]:h[p]+L,data:{[p]:w,centerOffset:R-w-L,...k&&{alignmentOffset:L}},reset:k}}}),yA=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:u=!0,crossAxis:l=!0}=O_(e,t),c={x:n,y:r},d=N_(i),h=y_(d);let p=c[h],f=c[d];const m=O_(a,t),E="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const e="y"===h?"height":"width",t=o.reference[h]-o.floating[e]+E.mainAxis,n=o.reference[h]+o.reference[e]-E.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){var g,_;const e="y"===h?"width":"height",t=["top","left"].includes(T_(i)),n=o.reference[d]-o.floating[e]+(t&&(null==(g=s.offset)?void 0:g[d])||0)+(t?0:E.crossAxis),r=o.reference[d]+o.reference[e]+(t?0:(null==(_=s.offset)?void 0:_[d])||0)-(t?E.crossAxis:0);f<n?f=n:f>r&&(f=r)}return{[h]:p,[d]:f}}}};var CA="undefined"!=typeof document?ue:function(){};function NA(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!NA(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;0!=r--;){const n=i[r];if(!("_owner"===n&&e.$$typeof||NA(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function bA(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function IA(e,t){const n=bA(e);return Math.round(t*n)/n}function RA(e){const t=le(e);return CA((()=>{t.current=e})),t}const wA=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(i=n,{}.hasOwnProperty.call(i,"current"))?null!=n.current?SA({element:n.current,padding:r}).fn(t):{}:n?SA({element:n,padding:r}).fn(t):{};var i}}),kA=(e,t)=>({...AA(e),options:[e,t]}),LA=(e,t)=>({...DA(e),options:[e,t]}),xA=(e,t)=>({...yA(e),options:[e,t]}),MA=(e,t)=>({...vA(e),options:[e,t]}),FA=(e,t)=>({...OA(e),options:[e,t]}),BA=(e,t)=>({...TA(e),options:[e,t]}),PA=(e,t)=>({...wA(e),options:[e,t]});var UA=Me(((e,t)=>{const{children:n,width:r=10,height:i=5,...o}=e;return bt(Ug.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:bt("polygon",{points:"0,0 30,0 15,10"})})}));UA.displayName="Arrow";var HA=UA,jA="Popper",[$A,YA]=wg(jA),[zA,VA]=$A(jA),GA=e=>{const{__scopePopper:t,children:n}=e,[r,i]=oe(null);return bt(zA,{scope:t,anchor:r,onAnchorChange:i,children:n})};GA.displayName=jA;var WA="PopperAnchor",XA=Me(((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,o=VA(WA,n),s=le(null),a=Rg(t,s);return ae((()=>{o.onAnchorChange(r?.current||s.current)})),r?null:bt(Ug.div,{...i,ref:a})}));XA.displayName=WA;var KA="PopperContent",[qA,JA]=$A(KA),ZA=Me(((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:f,...m}=e,E=VA(KA,n),[g,_]=oe(null),A=Rg(t,(e=>_(e))),[D,v]=oe(null),O=function(e){const[t,n]=oe(void 0);return Lg((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let i,o;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,o=t.blockSize}else i=e.offsetWidth,o=e.offsetHeight;n({width:i,height:o})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(D),T=O?.width??0,S=O?.height??0,y=r+("center"!==o?"-"+o:""),C="number"==typeof c?c:{top:0,right:0,bottom:0,left:0,...c},N=Array.isArray(l)?l:[l],b=N.length>0,I={padding:C,boundary:N.filter(nD),altBoundary:b},{refs:R,floatingStyles:w,placement:k,isPositioned:L,middlewareData:x}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:u,open:l}=e,[c,d]=oe({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=oe(r);NA(h,r)||p(r);const[f,m]=oe(null),[E,g]=oe(null),_=he((e=>{e!==O.current&&(O.current=e,m(e))}),[]),A=he((e=>{e!==T.current&&(T.current=e,g(e))}),[]),D=o||f,v=s||E,O=le(null),T=le(null),S=le(c),y=null!=u,C=RA(u),N=RA(i),b=RA(l),I=he((()=>{if(!O.current||!T.current)return;const e={placement:t,strategy:n,middleware:h};N.current&&(e.platform=N.current),((e,t,n)=>{const r=new Map,i={platform:gA,...n},o={...i.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),u=await(null==s.isRTL?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:d}=L_(l,r,u),h=r,p={},f=0;for(let m=0;m<a.length;m++){const{name:n,fn:o}=a[m],{x:E,y:g,data:_,reset:A}=await o({x:c,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:l,platform:s,elements:{reference:e,floating:t}});c=null!=E?E:c,d=null!=g?g:d,p={...p,[n]:{...p[n],..._}},A&&f<=50&&(f++,"object"==typeof A&&(A.placement&&(h=A.placement),A.rects&&(l=!0===A.rects?await s.getElementRects({reference:e,floating:t,strategy:i}):A.rects),({x:c,y:d}=L_(l,h,u))),m=-1)}return{x:c,y:d,placement:h,strategy:i,middlewareData:p}})(e,t,{...i,platform:o})})(O.current,T.current,e).then((e=>{const t={...e,isPositioned:!1!==b.current};R.current&&!NA(S.current,t)&&(S.current=t,Ot((()=>{d(t)})))}))}),[h,t,n,N,b]);CA((()=>{!1===l&&S.current.isPositioned&&(S.current.isPositioned=!1,d((e=>({...e,isPositioned:!1}))))}),[l]);const R=le(!1);CA((()=>(R.current=!0,()=>{R.current=!1})),[]),CA((()=>{if(D&&(O.current=D),v&&(T.current=v),D&&v){if(C.current)return C.current(D,v,I);I()}}),[D,v,I,C,y]);const w=de((()=>({reference:O,floating:T,setReference:_,setFloating:A})),[_,A]),k=de((()=>({reference:D,floating:v})),[D,v]),L=de((()=>{const e={position:n,left:0,top:0};if(!k.floating)return e;const t=IA(k.floating,c.x),r=IA(k.floating,c.y);return a?{...e,transform:"translate("+t+"px, "+r+"px)",...bA(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,a,k.floating,c.x,c.y]);return de((()=>({...c,update:I,refs:w,elements:k,floatingStyles:L})),[c,I,w,k,L])}({strategy:"fixed",placement:y,whileElementsMounted:(...e)=>function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,l=iA(e),c=i||o?[...l?tA(l):[],...tA(t)]:[];c.forEach((e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));const d=l&&a?function(e,t){let n,r=null;const i=H_(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,u){void 0===a&&(a=!1),void 0===u&&(u=1),o();const l=e.getBoundingClientRect(),{left:c,top:d,width:h,height:p}=l;if(a||t(),!h||!p)return;const f={rootMargin:-g_(d)+"px "+-g_(i.clientWidth-(c+h))+"px "+-g_(i.clientHeight-(d+p))+"px "+-g_(c)+"px",threshold:m_(0,f_(1,u))||1};let m=!0;function E(t){const r=t[0].intersectionRatio;if(r!==u){if(!m)return s();r?s(!1,r):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}1!==r||_A(l,e.getBoundingClientRect())||s(),m=!1}try{r=new IntersectionObserver(E,{...f,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(E,f)}r.observe(e)}(!0),o}(l,n):null;let h,p=-1,f=null;s&&(f=new ResizeObserver((e=>{let[r]=e;r&&r.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=f)||e.observe(t)}))),n()})),l&&!u&&f.observe(l),f.observe(t));let m=u?uA(e):null;return u&&function t(){const r=uA(e);m&&!_A(m,r)&&n(),m=r,h=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=f)||e.disconnect(),f=null,u&&cancelAnimationFrame(h)}}(...e,{animationFrame:"always"===p}),elements:{reference:E.anchor},middleware:[kA({mainAxis:i+S,alignmentAxis:s}),u&&LA({mainAxis:!0,crossAxis:!1,limiter:"partial"===d?xA():void 0,...I}),u&&MA({...I}),FA({...I,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:i,height:o}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${i}px`),s.setProperty("--radix-popper-anchor-height",`${o}px`)}}),D&&PA({element:D,padding:a}),rD({arrowWidth:T,arrowHeight:S}),h&&BA({strategy:"referenceHidden",...I})]}),[M,F]=iD(k),B=zg(f);Lg((()=>{L&&B?.()}),[L,B]);const P=x.arrow?.x,U=x.arrow?.y,H=0!==x.arrow?.centerOffset,[j,$]=oe();return Lg((()=>{g&&$(window.getComputedStyle(g).zIndex)}),[g]),bt("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...w,transform:L?w.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:j,"--radix-popper-transform-origin":[x.transformOrigin?.x,x.transformOrigin?.y].join(" "),...x.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:bt(qA,{scope:n,placedSide:M,onArrowChange:v,arrowX:P,arrowY:U,shouldHideArrow:H,children:bt(Ug.div,{"data-side":M,"data-align":F,...m,ref:A,style:{...m.style,animation:L?void 0:"none"}})})})}));ZA.displayName=KA;var QA="PopperArrow",eD={top:"bottom",right:"left",bottom:"top",left:"right"},tD=Me((function(e,t){const{__scopePopper:n,...r}=e,i=JA(QA,n),o=eD[i.placedSide];return bt("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:bt(HA,{...r,ref:t,style:{...r.style,display:"block"}})})}));function nD(e){return null!==e}tD.displayName=QA;var rD=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,o=0!==i.arrow?.centerOffset,s=o?0:e.arrowWidth,a=o?0:e.arrowHeight,[u,l]=iD(n),c={start:"0%",center:"50%",end:"100%"}[l],d=(i.arrow?.x??0)+s/2,h=(i.arrow?.y??0)+a/2;let p="",f="";return"bottom"===u?(p=o?c:`${d}px`,f=-a+"px"):"top"===u?(p=o?c:`${d}px`,f=`${r.floating.height+a}px`):"right"===u?(p=-a+"px",f=o?c:`${h}px`):"left"===u&&(p=`${r.floating.width+a}px`,f=o?c:`${h}px`),{data:{x:p,y:f}}}});function iD(e){const[t,n="center"]=e.split("-");return[t,n]}var oD=GA,sD=XA,aD=ZA,uD=tD,lD=e=>{const{present:t,children:n}=e,r=function(e){const[t,n]=oe(),r=le(null),i=le(e),o=le("none"),s=e?"mounted":"unmounted",[a,u]=function(e,t){return se(((e,n)=>t[e][n]??e),e)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return ae((()=>{const e=cD(r.current);o.current="mounted"===a?e:"none"}),[a]),Lg((()=>{const t=r.current,n=i.current;if(n!==e){const r=o.current,s=cD(t);u(e?"MOUNT":"none"===s||"none"===t?.display?"UNMOUNT":n&&r!==s?"ANIMATION_OUT":"UNMOUNT"),i.current=e}}),[e,u]),Lg((()=>{if(t){let e;const n=t.ownerDocument.defaultView??window,s=o=>{const s=cD(r.current).includes(o.animationName);if(o.target===t&&s&&(u("ANIMATION_END"),!i.current)){const r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)}))}},a=e=>{e.target===t&&(o.current=cD(r.current))};return t.addEventListener("animationstart",a),t.addEventListener("animationcancel",s),t.addEventListener("animationend",s),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",a),t.removeEventListener("animationcancel",s),t.removeEventListener("animationend",s)}}u("ANIMATION_END")}),[t,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:he((e=>{r.current=e?getComputedStyle(e):null,n(e)}),[])}}(t),i="function"==typeof n?n({present:r.isPresent}):Be.only(n),o=Rg(r.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}(i));return"function"==typeof n||r.isPresent?_t(i,{ref:o}):null};function cD(e){return e?.animationName||"none"}lD.displayName="Presence";var dD="rovingFocusGroup.onEntryFocus",hD={bubbles:!1,cancelable:!0},pD="RovingFocusGroup",[fD,mD,ED]=jg(pD),[gD,_D]=wg(pD,[ED]),[AD,DD]=gD(pD),vD=Me(((e,t)=>bt(fD.Provider,{scope:e.__scopeRovingFocusGroup,children:bt(fD.Slot,{scope:e.__scopeRovingFocusGroup,children:bt(OD,{...e,ref:t})})})));vD.displayName=pD;var OD=Me(((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:u,onEntryFocus:l,preventScrollOnEntryFocus:c=!1,...d}=e,h=le(null),p=Rg(t,h),f=Yg(o),[m,E]=Mg({prop:s,defaultProp:a??null,onChange:u,caller:pD}),[g,_]=oe(!1),A=zg(l),D=mD(n),v=le(!1),[O,T]=oe(0);return ae((()=>{const e=h.current;if(e)return e.addEventListener(dD,A),()=>e.removeEventListener(dD,A)}),[A]),bt(AD,{scope:n,orientation:r,dir:f,loop:i,currentTabStopId:m,onItemFocus:he((e=>E(e)),[E]),onItemShiftTab:he((()=>_(!0)),[]),onFocusableItemAdd:he((()=>T((e=>e+1))),[]),onFocusableItemRemove:he((()=>T((e=>e-1))),[]),children:bt(Ug.div,{tabIndex:g||0===O?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Ng(e.onMouseDown,(()=>{v.current=!0})),onFocus:Ng(e.onFocus,(e=>{const t=!v.current;if(e.target===e.currentTarget&&t&&!g){const t=new CustomEvent(dD,hD);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=D().filter((e=>e.focusable));CD([e.find((e=>e.active)),e.find((e=>e.id===m)),...e].filter(Boolean).map((e=>e.ref.current)),c)}}v.current=!1})),onBlur:Ng(e.onBlur,(()=>_(!1)))})})})),TD="RovingFocusGroupItem",SD=Me(((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:o,children:s,...a}=e,u=h_(),l=o||u,c=DD(TD,n),d=c.currentTabStopId===l,h=mD(n),{onFocusableItemAdd:p,onFocusableItemRemove:f,currentTabStopId:m}=c;return ae((()=>{if(r)return p(),()=>f()}),[r,p,f]),bt(fD.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:bt(Ug.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:Ng(e.onMouseDown,(e=>{r?c.onItemFocus(l):e.preventDefault()})),onFocus:Ng(e.onFocus,(()=>c.onItemFocus(l))),onKeyDown:Ng(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void c.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:yD[r]}(e,c.orientation,c.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let i=h().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)i.reverse();else if("prev"===t||"next"===t){"prev"===t&&i.reverse();const o=i.indexOf(e.currentTarget);i=c.loop?(r=o+1,(n=i).map(((e,t)=>n[(r+t)%n.length]))):i.slice(o+1)}setTimeout((()=>CD(i)))}var n,r})),children:"function"==typeof s?s({isCurrentTabStop:d,hasTabStop:null!=m}):s})})}));SD.displayName=TD;var yD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function CD(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var ND=vD,bD=SD,ID=new WeakMap,RD=new WeakMap,wD={},kD=0,LD=function(e){return e&&(e.host||LD(e.parentNode))},xD=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),function(e,t,n,r){var i=function(e,t){return t.map((function(t){if(e.contains(t))return t;var n=LD(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)})).filter((function(e){return Boolean(e)}))}(t,Array.isArray(e)?e:[e]);wD[n]||(wD[n]=new WeakMap);var o=wD[n],s=[],a=new Set,u=new Set(i),l=function(e){e&&!a.has(e)&&(a.add(e),l(e.parentNode))};i.forEach(l);var c=function(e){e&&!u.has(e)&&Array.prototype.forEach.call(e.children,(function(e){if(a.has(e))c(e);else try{var t=e.getAttribute(r),i=null!==t&&"false"!==t,u=(ID.get(e)||0)+1,l=(o.get(e)||0)+1;ID.set(e,u),o.set(e,l),s.push(e),1===u&&i&&RD.set(e,!0),1===l&&e.setAttribute(n,"true"),i||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}}))};return c(t),a.clear(),kD++,function(){s.forEach((function(e){var t=ID.get(e)-1,i=o.get(e)-1;ID.set(e,t),o.set(e,i),t||(RD.has(e)||e.removeAttribute(r),RD.delete(e)),i||e.removeAttribute(n)})),--kD||(ID=new WeakMap,ID=new WeakMap,RD=new WeakMap,wD={})}}(r,i,n,"aria-hidden")):function(){return null}},MD=function(){return MD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},MD.apply(this,arguments)},FD="right-scroll-bar-position",BD="width-before-scroll-bar";function PD(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var UD="undefined"!=typeof window?ue:ae,HD=new WeakMap;var jD=function(){return jD=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},jD.apply(this,arguments)};function $D(e){return e}"function"==typeof SuppressedError&&SuppressedError;var YD=function(e){var t=e.sideCar,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return A(r,jD({},n))};YD.isSideCarExport=!0;var zD=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=$D);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:null},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter((function(e){return e!==i}))}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var o=function(){var n=t;t=[],n.forEach(e)},s=function(){return Promise.resolve().then(o)};s(),n={push:function(e){t.push(e),s()},filter:function(e){return t=t.filter(e),n}}}};return i}();return t.options=jD({async:!0,ssr:!1},e),t}(),VD=function(){},GD=Me((function(e,t){var n=le(null),r=oe({onScrollCapture:VD,onWheelCapture:VD,onTouchMoveCapture:VD}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,u=e.className,l=e.removeScrollBar,c=e.enabled,d=e.shards,h=e.sideCar,p=e.noRelative,f=e.noIsolation,m=e.inert,E=e.allowPinchZoom,g=e.as,_=void 0===g?"div":g,D=e.gapMode,v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=h,S=function(e){var t,n,r=(t=function(t){return e.forEach((function(e){return PD(e,t)}))},(n=oe((function(){return{value:null,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}}))[0]).callback=t,n.facade);return UD((function(){var t=HD.get(r);if(t){var n=new Set(t),i=new Set(e),o=r.current;n.forEach((function(e){i.has(e)||PD(e,null)})),i.forEach((function(e){n.has(e)||PD(e,o)}))}HD.set(r,e)}),[e]),r}([n,t]),y=MD(MD({},v),i);return A(O,null,c&&A(T,{sideCar:zD,removeScrollBar:l,shards:d,noRelative:p,noIsolation:f,inert:m,setCallbacks:o,allowPinchZoom:!!E,lockRef:n,gapMode:D}),s?_t(Be.only(a),MD(MD({},y),{ref:S})):A(_,MD({},y,{className:u,ref:S}),a))}));GD.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},GD.classNames={fullWidth:BD,zeroRight:FD};var WD=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},XD=function(){var e,t=(e=WD(),function(t,n){ae((function(){return e.add(t),function(){e.remove()}}),[t&&n])});return function(e){var n=e.styles,r=e.dynamic;return t(n,r),null}},KD={left:0,top:0,right:0,gap:0},qD=function(e){return parseInt(e||"",10)||0},JD=XD(),ZD="data-scroll-locked",QD=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(a,"px ").concat(r,";\n }\n body[").concat(ZD,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(i,"px;\n padding-top: ").concat(o,"px;\n padding-right: ").concat(s,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(FD," {\n right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(BD," {\n margin-right: ").concat(a,"px ").concat(r,";\n }\n \n .").concat(FD," .").concat(FD," {\n right: 0 ").concat(r,";\n }\n \n .").concat(BD," .").concat(BD," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(ZD,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},ev=function(){var e=parseInt(document.body.getAttribute(ZD)||"0",10);return isFinite(e)?e:0},tv=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=void 0===r?"margin":r;ae((function(){return document.body.setAttribute(ZD,(ev()+1).toString()),function(){var e=ev()-1;e<=0?document.body.removeAttribute(ZD):document.body.setAttribute(ZD,e.toString())}}),[]);var o=de((function(){return function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return KD;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],i=t["padding"===e?"paddingRight":"marginRight"];return[qD(n),qD(r),qD(i)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}}(i)}),[i]);return A(JD,{styles:QD(o,!t,i,n?"":"!important")})},nv=!1;if("undefined"!=typeof window)try{var rv=Object.defineProperty({},"passive",{get:function(){return nv=!0,!0}});window.addEventListener("test",rv,rv),window.removeEventListener("test",rv,rv)}catch(e){nv=!1}var iv=!!nv&&{passive:!1},ov=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},sv=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),av(e,r)){var i=uv(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},av=function(e,t){return"v"===e?function(e){return ov(e,"overflowY")}(t):function(e){return ov(e,"overflowX")}(t)},uv=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},lv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},cv=function(e){return[e.deltaX,e.deltaY]},dv=function(e){return e&&"current"in e?e.current:e},hv=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},pv=0,fv=[];function mv(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ev=(gv=function(e){var t=le([]),n=le([0,0]),r=le(),i=oe(pv++)[0],o=oe(XD)[0],s=le(e);ae((function(){s.current=e}),[e]),ae((function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var t=function(e,t){for(var n,r=0,i=t.length;r<i;r++)!n&&r in t||(n||(n=Array.prototype.slice.call(t,0,r)),n[r]=t[r]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(dv)).filter(Boolean);return t.forEach((function(e){return e.classList.add("allow-interactivity-".concat(i))})),function(){document.body.classList.remove("block-interactivity-".concat(i)),t.forEach((function(e){return e.classList.remove("allow-interactivity-".concat(i))}))}}}),[e.inert,e.lockRef.current,e.shards]);var a=he((function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var i,o=lv(e),a=n.current,u="deltaX"in e?e.deltaX:a[0]-o[0],l="deltaY"in e?e.deltaY:a[1]-o[1],c=e.target,d=Math.abs(u)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var h=sv(d,c);if(!h)return!0;if(h?i=d:(i="v"===d?"h":"v",h=sv(d,c)),!h)return!1;if(!r.current&&"changedTouches"in e&&(u||l)&&(r.current=i),!i)return!0;var p=r.current||i;return function(e,t,n,r,i){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,u=t.contains(a),l=!1,c=s>0,d=0,h=0;do{if(!a)break;var p=uv(e,a),f=p[0],m=p[1]-p[2]-o*f;(f||m)&&av(e,a)&&(d+=m,h+=f);var E=a.parentNode;a=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!u&&a!==document.body||u&&(t.contains(a)||t===a));return c&&Math.abs(d)<1?l=!0:c||!(Math.abs(h)<1)&&i||(l=!0),l}(p,t,e,"h"===p?u:l,!0)}),[]),u=he((function(e){var n=e;if(fv.length&&fv[fv.length-1]===o){var r="deltaY"in n?cv(n):lv(n),i=t.current.filter((function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,r)}))[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var u=(s.current.shards||[]).map(dv).filter(Boolean).filter((function(e){return e.contains(n.target)}));(u.length>0?a(n,u[0]):!s.current.noIsolation)&&n.cancelable&&n.preventDefault()}}}),[]),l=he((function(e,n,r,i){var o={name:e,delta:n,target:r,should:i,shadowParent:mv(r)};t.current.push(o),setTimeout((function(){t.current=t.current.filter((function(e){return e!==o}))}),1)}),[]),c=he((function(e){n.current=lv(e),r.current=void 0}),[]),d=he((function(t){l(t.type,cv(t),t.target,a(t,e.lockRef.current))}),[]),h=he((function(t){l(t.type,lv(t),t.target,a(t,e.lockRef.current))}),[]);ae((function(){return fv.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",u,iv),document.addEventListener("touchmove",u,iv),document.addEventListener("touchstart",c,iv),function(){fv=fv.filter((function(e){return e!==o})),document.removeEventListener("wheel",u,iv),document.removeEventListener("touchmove",u,iv),document.removeEventListener("touchstart",c,iv)}}),[]);var p=e.removeScrollBar;return A(O,null,e.inert?A(o,{styles:hv(i)}):null,p?A(tv,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},zD.useMedium(gv),YD);var gv,_v=Me((function(e,t){return A(GD,MD({},e,{ref:t,sideCar:Ev}))}));_v.classNames=GD.classNames;var Av=["Enter"," "],Dv=["ArrowUp","PageDown","End"],vv=["ArrowDown","PageUp","Home",...Dv],Ov={ltr:[...Av,"ArrowRight"],rtl:[...Av,"ArrowLeft"]},Tv={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Sv="Menu",[yv,Cv,Nv]=jg(Sv),[bv,Iv]=wg(Sv,[Nv,YA,_D]),Rv=YA(),wv=_D(),[kv,Lv]=bv(Sv),[xv,Mv]=bv(Sv),Fv=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=e,a=Rv(t),[u,l]=oe(null),c=le(!1),d=zg(o),h=Yg(i);return ae((()=>{const e=()=>{c.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>c.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),bt(oD,{...a,children:bt(kv,{scope:t,open:n,onOpenChange:d,content:u,onContentChange:l,children:bt(xv,{scope:t,onClose:he((()=>d(!1)),[d]),isUsingKeyboardRef:c,dir:h,modal:s,children:r})})})};Fv.displayName=Sv;var Bv=Me(((e,t)=>{const{__scopeMenu:n,...r}=e,i=Rv(n);return bt(sD,{...i,...r,ref:t})}));Bv.displayName="MenuAnchor";var[Pv,Uv]=bv("MenuPortal",{forceMount:void 0}),Hv="MenuContent",[jv,$v]=bv(Hv),Yv=Me(((e,t)=>{const n=Uv(Hv,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Lv(Hv,e.__scopeMenu),s=Mv(Hv,e.__scopeMenu);return bt(yv.Provider,{scope:e.__scopeMenu,children:bt(lD,{present:r||o.open,children:bt(yv.Slot,{scope:e.__scopeMenu,children:s.modal?bt(zv,{...i,ref:t}):bt(Vv,{...i,ref:t})})})})})),zv=Me(((e,t)=>{const n=Lv(Hv,e.__scopeMenu),r=le(null),i=Rg(t,r);return ae((()=>{const e=r.current;if(e)return xD(e)}),[]),bt(Wv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ng(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})})),Vv=Me(((e,t)=>{const n=Lv(Hv,e.__scopeMenu);return bt(Wv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})})),Gv=Fg("MenuContent.ScrollLock"),Wv=Me(((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:u,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,disableOutsideScroll:f,...m}=e,E=Lv(Hv,n),g=Mv(Hv,n),_=Rv(n),A=wv(n),D=Cv(n),[v,T]=oe(null),S=le(null),y=Rg(t,S,E.onContentChange),C=le(0),N=le(""),b=le(0),I=le(null),R=le("right"),w=le(0),k=f?_v:O,L=f?{as:Gv,allowPinchZoom:!0}:void 0;ae((()=>()=>window.clearTimeout(C.current)),[]),ae((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Qg()),document.body.insertAdjacentElement("beforeend",e[1]??Qg()),Zg++,()=>{1===Zg&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),Zg--}}),[]);const x=he((e=>R.current===I.current?.side&&function(e,t){if(!t)return!1;return function(e,t){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const e=t[o],a=t[s],u=e.x,l=e.y,c=a.x,d=a.y;l>r!=d>r&&n<(c-u)*(r-l)/(d-l)+u&&(i=!i)}return i}({x:e.clientX,y:e.clientY},t)}(e,I.current?.area)),[]);return bt(jv,{scope:n,searchRef:N,onItemEnter:he((e=>{x(e)&&e.preventDefault()}),[x]),onItemLeave:he((e=>{x(e)||(S.current?.focus(),T(null))}),[x]),onTriggerLeave:he((e=>{x(e)&&e.preventDefault()}),[x]),pointerGraceTimerRef:b,onPointerGraceIntentChange:he((e=>{I.current=e}),[]),children:bt(k,{...L,children:bt(r_,{asChild:!0,trapped:i,onMountAutoFocus:Ng(o,(e=>{e.preventDefault(),S.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:s,children:bt(Xg,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,children:bt(ND,{asChild:!0,...A,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:v,onCurrentTabStopIdChange:T,onEntryFocus:Ng(u,(e=>{g.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:bt(aD,{role:"menu","aria-orientation":"vertical","data-state":AO(E.open),"data-radix-menu-content":"",dir:g.dir,..._,...m,ref:y,style:{outline:"none",...m.style},onKeyDown:Ng(m.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&(e=>{const t=N.current+e,n=D().filter((e=>!e.disabled)),r=document.activeElement,i=n.find((e=>e.ref.current===r))?.textValue,o=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),i=r?t[0]:t,o=n?e.indexOf(n):-1;let s=(a=e,u=Math.max(o,0),a.map(((e,t)=>a[(u+t)%a.length])));var a,u;1===i.length&&(s=s.filter((e=>e!==n)));const l=s.find((e=>e.toLowerCase().startsWith(i.toLowerCase())));return l!==n?l:void 0}(n.map((e=>e.textValue)),t,i),s=n.find((e=>e.textValue===o))?.ref.current;!function e(t){N.current=t,window.clearTimeout(C.current),""!==t&&(C.current=window.setTimeout((()=>e("")),1e3))}(t),s&&setTimeout((()=>s.focus()))})(e.key));const i=S.current;if(e.target!==i)return;if(!vv.includes(e.key))return;e.preventDefault();const o=D().filter((e=>!e.disabled)).map((e=>e.ref.current));Dv.includes(e.key)&&o.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(o)})),onBlur:Ng(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(C.current),N.current="")})),onPointerMove:Ng(e.onPointerMove,OO((e=>{const t=e.target,n=w.current!==e.clientX;if(e.currentTarget.contains(t)&&n){const t=e.clientX>w.current?"right":"left";R.current=t,w.current=e.clientX}})))})})})})})})}));Yv.displayName=Hv;var Xv=Me(((e,t)=>{const{__scopeMenu:n,...r}=e;return bt(Ug.div,{role:"group",...r,ref:t})}));Xv.displayName="MenuGroup";var Kv=Me(((e,t)=>{const{__scopeMenu:n,...r}=e;return bt(Ug.div,{...r,ref:t})}));Kv.displayName="MenuLabel";var qv="MenuItem",Jv="menu.itemSelect",Zv=Me(((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,o=le(null),s=Mv(qv,e.__scopeMenu),a=$v(qv,e.__scopeMenu),u=Rg(t,o),l=le(!1);return bt(Qv,{...i,ref:u,disabled:n,onClick:Ng(e.onClick,(()=>{const e=o.current;if(!n&&e){const t=new CustomEvent(Jv,{bubbles:!0,cancelable:!0});e.addEventListener(Jv,(e=>r?.(e)),{once:!0}),Hg(e,t),t.defaultPrevented?l.current=!1:s.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Ng(e.onPointerUp,(e=>{l.current||e.currentTarget?.click()})),onKeyDown:Ng(e.onKeyDown,(e=>{const t=""!==a.searchRef.current;n||t&&" "===e.key||Av.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));Zv.displayName=qv;var Qv=Me(((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...o}=e,s=$v(qv,n),a=wv(n),u=le(null),l=Rg(t,u),[c,d]=oe(!1),[h,p]=oe("");return ae((()=>{const e=u.current;e&&p((e.textContent??"").trim())}),[o.children]),bt(yv.ItemSlot,{scope:n,disabled:r,textValue:i??h,children:bt(bD,{asChild:!0,...a,focusable:!r,children:bt(Ug.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:l,onPointerMove:Ng(e.onPointerMove,OO((e=>{r?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))}))),onPointerLeave:Ng(e.onPointerLeave,OO((e=>s.onItemLeave(e)))),onFocus:Ng(e.onFocus,(()=>d(!0))),onBlur:Ng(e.onBlur,(()=>d(!1)))})})})})),eO=Me(((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return bt(uO,{scope:e.__scopeMenu,checked:n,children:bt(Zv,{role:"menuitemcheckbox","aria-checked":DO(n)?"mixed":n,...i,ref:t,"data-state":vO(n),onSelect:Ng(i.onSelect,(()=>r?.(!!DO(n)||!n)),{checkForDefaultPrevented:!1})})})}));eO.displayName="MenuCheckboxItem";var tO="MenuRadioGroup",[nO,rO]=bv(tO,{value:void 0,onValueChange:()=>{}}),iO=Me(((e,t)=>{const{value:n,onValueChange:r,...i}=e,o=zg(r);return bt(nO,{scope:e.__scopeMenu,value:n,onValueChange:o,children:bt(Xv,{...i,ref:t})})}));iO.displayName=tO;var oO="MenuRadioItem",sO=Me(((e,t)=>{const{value:n,...r}=e,i=rO(oO,e.__scopeMenu),o=n===i.value;return bt(uO,{scope:e.__scopeMenu,checked:o,children:bt(Zv,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":vO(o),onSelect:Ng(r.onSelect,(()=>i.onValueChange?.(n)),{checkForDefaultPrevented:!1})})})}));sO.displayName=oO;var aO="MenuItemIndicator",[uO,lO]=bv(aO,{checked:!1}),cO=Me(((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,o=lO(aO,n);return bt(lD,{present:r||DO(o.checked)||!0===o.checked,children:bt(Ug.span,{...i,ref:t,"data-state":vO(o.checked)})})}));cO.displayName=aO;var dO=Me(((e,t)=>{const{__scopeMenu:n,...r}=e;return bt(Ug.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})}));dO.displayName="MenuSeparator";var hO=Me(((e,t)=>{const{__scopeMenu:n,...r}=e,i=Rv(n);return bt(uD,{...i,...r,ref:t})}));hO.displayName="MenuArrow";var[pO,fO]=bv("MenuSub"),mO="MenuSubTrigger",EO=Me(((e,t)=>{const n=Lv(mO,e.__scopeMenu),r=Mv(mO,e.__scopeMenu),i=fO(mO,e.__scopeMenu),o=$v(mO,e.__scopeMenu),s=le(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:u}=o,l={__scopeMenu:e.__scopeMenu},c=he((()=>{s.current&&window.clearTimeout(s.current),s.current=null}),[]);return ae((()=>c),[c]),ae((()=>{const e=a.current;return()=>{window.clearTimeout(e),u(null)}}),[a,u]),bt(Bv,{asChild:!0,...l,children:bt(Qv,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":AO(n.open),...e,ref:Ig(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ng(e.onPointerMove,OO((t=>{o.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||s.current||(o.onPointerGraceIntentChange(null),s.current=window.setTimeout((()=>{n.onOpenChange(!0),c()}),100))}))),onPointerLeave:Ng(e.onPointerLeave,OO((e=>{c();const t=n.content?.getBoundingClientRect();if(t){const r=n.content?.dataset.side,i="right"===r,s=i?-5:5,u=t[i?"left":"right"],l=t[i?"right":"left"];o.onPointerGraceIntentChange({area:[{x:e.clientX+s,y:e.clientY},{x:u,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:u,y:t.bottom}],side:r}),window.clearTimeout(a.current),a.current=window.setTimeout((()=>o.onPointerGraceIntentChange(null)),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}}))),onKeyDown:Ng(e.onKeyDown,(t=>{const i=""!==o.searchRef.current;e.disabled||i&&" "===t.key||Ov[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())}))})})}));EO.displayName=mO;var gO="MenuSubContent",_O=Me(((e,t)=>{const n=Uv(Hv,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,o=Lv(Hv,e.__scopeMenu),s=Mv(Hv,e.__scopeMenu),a=fO(gO,e.__scopeMenu),u=le(null),l=Rg(t,u);return bt(yv.Provider,{scope:e.__scopeMenu,children:bt(lD,{present:r||o.open,children:bt(yv.Slot,{scope:e.__scopeMenu,children:bt(Wv,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:l,align:"start",side:"rtl"===s.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Ng(e.onFocusOutside,(e=>{e.target!==a.trigger&&o.onOpenChange(!1)})),onEscapeKeyDown:Ng(e.onEscapeKeyDown,(e=>{s.onClose(),e.preventDefault()})),onKeyDown:Ng(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=Tv[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),a.trigger?.focus(),e.preventDefault())}))})})})})}));function AO(e){return e?"open":"closed"}function DO(e){return"indeterminate"===e}function vO(e){return DO(e)?"indeterminate":e?"checked":"unchecked"}function OO(e){return t=>"mouse"===t.pointerType?e(t):void 0}_O.displayName=gO;var TO=Fv,SO=Bv,yO=Yv,CO=Xv,NO=Kv,bO=Zv,IO=eO,RO=iO,wO=sO,kO=cO,LO=dO,xO=hO,MO=EO,FO=_O,BO="DropdownMenu",[PO,UO]=wg(BO,[Iv]),HO=Iv(),[jO,$O]=PO(BO),YO=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=e,u=HO(t),l=le(null),[c,d]=Mg({prop:i,defaultProp:o??!1,onChange:s,caller:BO});return bt(jO,{scope:t,triggerId:h_(),triggerRef:l,contentId:h_(),open:c,onOpenChange:d,onOpenToggle:he((()=>d((e=>!e))),[d]),modal:a,children:bt(TO,{...u,open:c,onOpenChange:d,dir:r,modal:a,children:n})})};YO.displayName=BO;var zO="DropdownMenuTrigger",VO=Me(((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,o=$O(zO,n),s=HO(n);return bt(SO,{asChild:!0,...s,children:bt(Ug.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:Ig(t,o.triggerRef),onPointerDown:Ng(e.onPointerDown,(e=>{r||0!==e.button||!1!==e.ctrlKey||(o.onOpenToggle(),o.open||e.preventDefault())})),onKeyDown:Ng(e.onKeyDown,(e=>{r||(["Enter"," "].includes(e.key)&&o.onOpenToggle(),"ArrowDown"===e.key&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));VO.displayName=zO;var GO="DropdownMenuContent",WO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=$O(GO,n),o=HO(n),s=le(!1);return bt(yO,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:t,onCloseAutoFocus:Ng(e.onCloseAutoFocus,(e=>{s.current||i.triggerRef.current?.focus(),s.current=!1,e.preventDefault()})),onInteractOutside:Ng(e.onInteractOutside,(e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey,r=2===t.button||n;i.modal&&!r||(s.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));WO.displayName=GO;var XO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(CO,{...i,...r,ref:t})}));XO.displayName="DropdownMenuGroup";var KO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(NO,{...i,...r,ref:t})}));KO.displayName="DropdownMenuLabel";var qO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(bO,{...i,...r,ref:t})}));qO.displayName="DropdownMenuItem";var JO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(IO,{...i,...r,ref:t})}));JO.displayName="DropdownMenuCheckboxItem";var ZO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(RO,{...i,...r,ref:t})}));ZO.displayName="DropdownMenuRadioGroup";var QO=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(wO,{...i,...r,ref:t})}));QO.displayName="DropdownMenuRadioItem";var eT=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(kO,{...i,...r,ref:t})}));eT.displayName="DropdownMenuItemIndicator";var tT=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(LO,{...i,...r,ref:t})}));tT.displayName="DropdownMenuSeparator";var nT=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(xO,{...i,...r,ref:t})}));nT.displayName="DropdownMenuArrow";var rT=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(MO,{...i,...r,ref:t})}));rT.displayName="DropdownMenuSubTrigger";var iT=Me(((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=HO(n);return bt(FO,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));iT.displayName="DropdownMenuSubContent";var oT=YO,sT=VO,aT=WO,uT=qO;function lT(e){const{menuComponent:t,menuProps:n,children:r,...i}=e,[o,s]=oe(void 0);return bt(oT,{modal:!1,children:[bt(sT,{asChild:!0,children:bt("button",{...i,ref:e=>(e=>{const t=e?.closest("[t-menu-boundary]")??void 0;s(t)})(e),children:r})}),bt(aT,{hideWhenDetached:!0,collisionBoundary:o,style:{zIndex:1e3},children:bt(t,{...n})})]})}function cT(e){return bt(uT,{...e})}function dT(e){return go(e)}function hT(e){return e.photoUrl??function(e,t){const n=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">\n <rect x="0" y="0" width="100" height="100" fill="${go(e)}"/>\n <text x="50%" y="54%" dominant-baseline="middle" font-size="34" font-family="San Francisco, Segoe UI, Helvetica Neue, Arial, Helvetica, sans-serif" fill="#fff" text-anchor="middle">${t}</text> \n </svg>`.replace(/\s+/g," ");return"data:image/svg+xml;base64,"+fo(n)}(e.id,(e=>e.split(Eo).filter((e=>e)).map((e=>e[0])).join("")||e[Symbol.iterator]().next().value||"")(e.name))}function pT(e){const t=1048576,n=1024*t,r=1024*n;return e<1024?e+" B":e<t?Math.floor(e/1024)+" KB":e<n?Math.floor(e/t)+" MB":e<r?Math.floor(e/n)+" GB":Math.floor(e/r)+" TB"}function fT({latitude:e,longitude:t}){const n=e+","+t;return{imageUrl:`https://maps.googleapis.com/maps/api/staticmap?center=${n}&zoom=15&size=300x200&scale=2&maptype=roadmap&markers=${n}&key=${wo}`,linkUrl:`https://maps.google.com/maps?q=${n}&z=15`}}function mT(e,...t){const n=Ro.bind(yt.createElement)(e,...t);return Array.isArray(n)?yt.createElement(yt.Fragment,{},...n):n}function ET({children:e,className:t,...n}){return bt("div",{className:"t-attach-overlay "+t,...n,children:e})}function gT({uploadState:e}){si();const t=e.error,n=e.uploaded;Sg((()=>e.closePreview("cancel")));const r=le(null);ae((()=>{n&&r.current.focus()}),[n]);const i=Yr(ci().t$);return bt(ET,{className:"t-upload-preview",children:bt("div",{className:"t-preview",children:[bt(_T,{upload:e.upload,uploaded:n}),void 0!==t&&bt("div",{className:"t-error-row",children:t}),bt("div",{className:"t-send-row",children:[bt("button",{className:"t-cancel",onClick:()=>e.closePreview("cancel"),children:i.CANCEL}),void 0===t&&n&&bt("button",{className:"t-confirm-send test__confirm-upload-button",onClick:()=>e.closePreview("send"),ref:r,children:i.SEND_BUTTON_TEXT})]})]})})}function _T({upload:e,uploaded:t}){const n=Yr(ci().t$);return"location"!==e.type?bt(O,{children:[bt(DT,{upload:e}),bt(vT,{upload:e,uploaded:t,t:n})]}):t?bt(AT,{location:e.location}):bt("div",{className:"t-loading",children:bt(io,{})})}function AT({location:e}){const{imageUrl:t,linkUrl:n}=fT(e);return bt("a",{href:n,target:"_blank",rel:"noreferrer",className:"t-location-upload-preview",style:{background:`url(${JSON.stringify(t)}) center center / cover no-repeat`}})}const DT=yt.memo((function({upload:e}){let t=null;const n=e.file;if("video"===e.type){const r=/[.]ts/i.test(n.name)?"mpegts":"native";t=bt("div",{className:"video-container",children:bt(OT,{src:e.temporaryBlobUrl,videoType:r,playsInline:!0,controls:!0,preload:"auto"})})}else"image"===e.type?t=bt("div",{className:"t-img-container",children:bt("img",{src:URL.createObjectURL(n)})}):"audio"===e.type&&(t=bt(uu,{src:URL.createObjectURL(n),filename:n.name}));return t})),vT=yt.memo((function({uploaded:e,upload:t,t:n}){let r;r=e?t.metadata.filename:n.UPLOAD_IN_PROGRESS;let i="",o="";return"file"===t.type&&(i="is-file",e&&(o="file-block")),bt("div",{className:`t-filename-row ${i}`,children:bt("div",{className:o,children:r})})}));function OT(e){const{videoType:t,...n}=e;return bt("video",{...n})}function TT({controller:e,appId:t,chatHeaderVisible:n,messageFieldVisible:r,session:i,sendMessage:o}){const s=si(),a=ci(),u=ui(),l=function(e){const t=ei((()=>{const t=e.state$.extUserId.get(),n=e.state$.errors.get(),r=e.state$.authTokenState.get(),i=t&&e.state$.currentUser.get(),o=e.state$.currentConversation.get(),s=e.state$.extCurrentConversationId.get(),a=s&&e.state$.participants.child(s).get(),u=e.state$.app.get(),l=e.state$.device.get();return n.serverError?"server-error":n.wrongAppId?"wrong-app-id":"loading"===r||"idle"===r?"loading-token":"invalid"===r?"invalid-token":"expired"===r?"expired-token":"valid"===r?n.unknownUser?"unknown-user":n.unknownConversation?"loading-conv-failed":Boolean(i&&o&&a&&u&&l)?"loaded":"loading-data":void ii.unreachable()})),n=ei({type:"loading"});ti((r=>{const i=t.get(),o=e.state$.extCurrentConversationId.peek(),s=e.state$.extUserId.peek(),a=e.state$.appId.peek();function u(e){n.set({type:"loading"});const t=setTimeout((()=>{n.set(e)}),5e3);return()=>clearTimeout(t)}switch(i){case"invalid-token":n.set({type:"auth-failed"});break;case"expired-token":n.set({type:"expired-token"});break;case"wrong-app-id":n.set({type:"wrong-app-id",appId:a});break;case"server-error":n.set({type:"server-error"});break;case"loading-data":case"loading-token":n.set({type:"loading"});break;case"loaded":n.set({type:"loaded",conversationId:o,userId:s});break;case"loading-conv-failed":r.onCleanup=u({type:"inaccessible-conversation",userId:s,conversationId:o});break;case"unknown-user":r.onCleanup=u({type:"unknown-user",userId:s});break;default:ii.never(i)}}));const r=ei({type:"loading"});return ti((e=>{if("loading"===n.type.get()){r.set({type:"invisible-loading"});const t=setTimeout((()=>{r.set({type:"loading"})}),1e3);e.onCleanup=()=>{clearTimeout(t)}}else r.set(n.get())})),r}(a),c=Yr(l),{attachFile:d,shareLocation:h,uploadState:p}=function(e,t,n){const[r,i]=oe(null),o=he((async r=>{try{if(r||(r=(await new Promise((e=>{const t=document.createElement("input");t.type="file",t.multiple=!1,t.addEventListener("change",(()=>{e([...t.files])})),t.addEventListener("cancel",(()=>{e([])})),t.click()})))[0]),!r)return;const{uploadPromise:o,upload:s}=await async function(e,t){const n=e.name;if(function(e){return/\.(mp4|ts|mov|webm|ogv)$/i.test(e)}(e.name)){const r=await No("video",e,(e=>({width:e.videoWidth,height:e.videoHeight,duration:e.duration,filename:n}))),i=t.uploadVideo(e,r),o=function(e){switch(e.name.split(".").pop()){case"ts":return"video/MP2T";case"mov":return"video/quicktime";case"webm":return"video/webm";case"ogv":return"video/ogg";default:return"video/mp4"}}(e);return{uploadPromise:i,upload:{type:"video",file:e,metadata:r,temporaryBlobUrl:URL.createObjectURL(new Blob([e],{type:o}))}}}if(function(e){return/\.(mp3|m4a|ogg|oga|opus|flac|wav)$/i.test(e)}(e.name)){const r=await No("audio",e,(e=>({duration:e.duration,filename:n})));return{uploadPromise:t.uploadAudio(e,r),upload:{type:"audio",file:e,metadata:r,temporaryBlobUrl:URL.createObjectURL(new Blob([e]))}}}if(function(e){return/(gif|png|jpg|jpeg|svg|bmp|webp)$/i.test(e)}(e.name)){const r=await No("img",e,(e=>({width:e.naturalWidth,height:e.naturalHeight,filename:n})));return{uploadPromise:t.uploadImage(e,r),upload:{type:"image",file:e,metadata:r,temporaryBlobUrl:URL.createObjectURL(new Blob([e]))}}}const r={filename:n};return{uploadPromise:t.uploadFile(e,r),upload:{type:"file",file:e,metadata:r,temporaryBlobUrl:URL.createObjectURL(new Blob([e]))}}}(r,e),a=s.file.size+","+s.file.name;n.state$.localFileBlobUrls.child(n.state$.extCurrentConversationId.peek()).child(a).set({url:s.temporaryBlobUrl,fetching:!1}),n.latestFileUpload=s;const u=yo(),l={upload:s,closePreview:u.resolve,uploaded:!1};let c;i(l);try{c=await o,i({...l,uploaded:!0})}catch(e){i((n=>({...n,error:e.toString()})))}if("cancel"===await u.promise)return;ii.defined(c),t.sendFileMessage({fileToken:c})}finally{i(null)}}),[t,e,i,n]);return{attachFile:o,shareLocation:Co("geolocation",(async e=>{try{const n=yo(),r={upload:{type:"location",location:void 0},uploaded:!1,closePreview:n.resolve};i(r);const{permissionResult:o,location:s}=await new Promise((e=>{navigator.geolocation.getCurrentPosition((t=>{const n={latitude:t.coords.latitude,longitude:t.coords.longitude};e({permissionResult:"granted",location:n})}),(t=>{1===t.code?e({permissionResult:"denied"}):e({permissionResult:"granted"})}))}));if(e(o),!s)return;if(i({...r,upload:{type:"location",location:s},uploaded:!0}),"cancel"===await n.promise)return;t.sendLocationMessage({location:s})}finally{i(null)}}),[t,i]),uploadState:r}}(i,e,a);ae((()=>{u.uploadFile=d}),[u,d]);const[f,m]=oe(!1),E=he((e=>{d(e.dataTransfer.files[0]),e.preventDefault(),m(!1)}),[d]),g=he((e=>{e.preventDefault(),m(!0)}),[]),_=he((e=>{e.preventDefault(),m(!1)}),[]);return"invisible-loading"===c.type?bt(O,{}):"loading"===c.type?bt(uo,{}):"inaccessible-conversation"===c.type?bt(ao,{t:a.t$.peek()}):"unknown-user"===c.type||"auth-failed"===c.type||"wrong-app-id"===c.type||"server-error"===c.type||"unexpected-error"===c.type?bt(so,{appId:t,chatboxState:c}):"expired-token"==c.type?bt(lo,{t:a.t$.peek()}):"loaded"===c.type?bt("div",{className:"t-chatbox-content",onDragOver:g,onDragLeave:_,onDrop:E,children:bt(zr,{children:()=>bt(O,{children:[n&&bt(s.ChatHeader,{conversation:a.state$.currentConversation.get(),currentUser:a.state$.currentUser.get(),participants:a.state$.participants.child(c.conversationId).get(),t:a.t$.get(),chatbox:e,isUserConnected:a.state$.isUserConnected.get(),permissions:a.userPermissions$().get(),themeCustom:a.state$.themeCustom.get().value,device:a.state$.device.get()}),bt(no,{extConversationId:c.conversationId,controller:e}),r&&bt(s.MessageField,{conversation:a.state$.currentConversation.get(),currentUser:a.state$.currentUser.get(),participants:a.state$.participants.child(c.conversationId).get(),referencedMessage:a.referencedMessage$.get(),permissions:a.userPermissions$().get(),t:a.t$.get(),chatbox:e,editor:new co(u.state$.get(),o,d,h,u.toggleEmojiPicker),themeCustom:a.state$.themeCustom.get().value,device:a.state$.device.get()}),p&&bt(gT,{uploadState:p}),f&&bt(ET,{className:"t-drop-overlay",children:bt(s.Icon,{type:"attach",themeCustom:a.state$.themeCustom.get().value})})]})})}):bt(O,{})}class ST extends Error{constructor(e,t){const n=function(e){if("string"==typeof e)return e;if(Array.isArray(e))return e.join("\n");try{return JSON.stringify(e)}catch(t){return String(e)}}(e);super(n),this.userMessage=t??n,Object.setPrototypeOf&&Object.setPrototypeOf(this,new.target.prototype)}}const yT=console;class CT{constructor(e,t,n,r){this.apiUrls=e,this.appId=t,this.sessionId=n,this.authProvider=r,this._lastPutPromise=Promise.resolve()}async get(e,t={}){const n=this.endpointUrl(e,t),r=await bT((()=>this.fetchWithReauth(n)),{retries:11});return await this.handleResponse(r,n)}async queuedPut(e,t){await this._lastPutPromise;const n=bT((()=>this._doPut(e,t)));return this._lastPutPromise=n,n}put(e,t,n){const r=()=>this._doPut(e,t);return n?IT(r,n):bT(r,{retries:5})}post(e,t,n){const r=()=>this._doPost(e,t);return n?IT(r,n):bT(r,{retries:5})}delete(e,t={}){return bT((()=>this._doDelete(e,t)),{retries:11})}endpointUrl(e,t={}){const n=new URL(this.apiUrls.internalHttpApiUrl);n.pathname+=`/${this.appId}/${e}`,n.searchParams.set("sessionId",this.sessionId);for(const[r,i]of Object.entries(t))n.searchParams.set(r,i);return n}async _doPut(e,t){const n=this.endpointUrl(e),r=await this.fetchWithReauth(n,{method:"PUT",body:JSON.stringify(t)});return await this.handleResponse(r,n)}async _doPost(e,t){const n=this.endpointUrl(e),r=await this.fetchWithReauth(n,{method:"POST",body:JSON.stringify(t)});return await this.handleResponse(r,n)}async _doDelete(e,t){const n=this.endpointUrl(e,t),r=await this.fetchWithReauth(n,{method:"DELETE"});return await this.handleResponse(r,n)}async handleResponse(e,t){if(e.status>=300){if(404===e.status)throw fi.error(`[${this.appId}][BackendRestClient] Couldn't find resource.`),new ST("Could not find app.",`Could not find given appId: "${this.appId}". You can find your appId on https://talkjs.com/dashboard.`);if(401===e.status){const e=await this.authProvider.getToken();throw fi.error(`[${this.appId}][BackendRestClient] Couldn't authenticate ${t} with token ${e}.`),new ST("User not authenticated.","Could not authenticate user. Check if your signature is calculated correctly.")}if(e.status>=300&&e.status<500){const{error:t}=await e.json();throw new ST(t)}{const n=await e.text();throw new Error(`Got non-success response (${n}) from the server for url: ${t}.`)}}return await e.json()}async fetchWithReauth(e,t){function n(n){const r={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${n}`};return fetch(e,{...t,headers:r})}const r=await this.authProvider.getToken(),i=await n(r);return 401!==i.status?i:(yT.error(`401 error from ${t?.method} ${e}, ${r}`),this.authProvider.refreshToken(),n(await this.authProvider.getToken()))}}function NT(e){return!e.userMessage}function bT(e,{retries:t=30}={}){return So(t,e,{shouldRetry:NT,log:yT.warn.bind(yT),maxDelay:30,initialDelay:.2})}async function IT(e,t){try{return await e()}catch(e){if(!NT(e))throw e}let n=!1;return t.then((()=>{n=!0})),So(1e3,e,{initialDelay:.2,maxDelay:30,shouldRetry:()=>!n,log:yT.warn.bind(yT)})}var RT={exports:{}};!function(e,t){var n="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",o="[object Function]",s="[object Object]",a=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,l={};l["[object Float32Array]"]=l["[object Float64Array]"]=l["[object Int8Array]"]=l["[object Int16Array]"]=l["[object Int32Array]"]=l["[object Uint8Array]"]=l["[object Uint8ClampedArray]"]=l["[object Uint16Array]"]=l["[object Uint32Array]"]=!0,l[i]=l["[object Array]"]=l["[object ArrayBuffer]"]=l["[object Boolean]"]=l["[object DataView]"]=l["[object Date]"]=l["[object Error]"]=l[o]=l["[object Map]"]=l["[object Number]"]=l[s]=l["[object RegExp]"]=l["[object Set]"]=l["[object String]"]=l["[object WeakMap]"]=!1;var c,d="object"==typeof br&&br&&br.Object===Object&&br,h="object"==typeof self&&self&&self.Object===Object&&self,p=d||h||Function("return this")(),f=t&&!t.nodeType&&t,m=f&&e&&!e.nodeType&&e,E=m&&m.exports===f,g=E&&d.process,_=function(){try{return m&&m.require&&m.require("util").types||g&&g.binding&&g.binding("util")}catch(e){}}(),A=_&&_.isTypedArray,D=Array.prototype,v=Function.prototype,O=Object.prototype,T=p["__core-js_shared__"],S=v.toString,y=O.hasOwnProperty,C=(c=/[^.]+$/.exec(T&&T.keys&&T.keys.IE_PROTO||""))?"Symbol(src)_1."+c:"",N=O.toString,b=S.call(Object),I=RegExp("^"+S.call(y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),R=E?p.Buffer:void 0,w=p.Symbol,k=p.Uint8Array;R&&R.allocUnsafe;var L,x,M=(L=Object.getPrototypeOf,x=Object,function(e){return L(x(e))}),F=Object.create,B=O.propertyIsEnumerable,P=D.splice,U=w?w.toStringTag:void 0,H=function(){try{var e=se(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),j=R?R.isBuffer:void 0,$=Math.max,Y=Date.now,z=se(p,"Map"),V=se(Object,"create"),G=function(){function e(){}return function(t){if(!_e(t))return{};if(F)return F(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function W(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function K(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function q(e){var t=this.__data__=new X(e);this.size=t.size}function J(e,t,n){(void 0!==n&&!de(e[t],n)||void 0===n&&!(t in e))&&ee(e,t,n)}function Z(e,t,n){var r=e[t];y.call(e,t)&&de(r,n)&&(void 0!==n||t in e)||ee(e,t,n)}function Q(e,t){for(var n=e.length;n--;)if(de(e[n][0],t))return n;return-1}function ee(e,t,n){"__proto__"==t&&H?H(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}W.prototype.clear=function(){this.__data__=V?V(null):{},this.size=0},W.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},W.prototype.get=function(e){var t=this.__data__;if(V){var r=t[e];return r===n?void 0:r}return y.call(t,e)?t[e]:void 0},W.prototype.has=function(e){var t=this.__data__;return V?void 0!==t[e]:y.call(t,e)},W.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=V&&void 0===t?n:t,this},X.prototype.clear=function(){this.__data__=[],this.size=0},X.prototype.delete=function(e){var t=this.__data__,n=Q(t,e);return!(n<0||(n==t.length-1?t.pop():P.call(t,n,1),--this.size,0))},X.prototype.get=function(e){var t=this.__data__,n=Q(t,e);return n<0?void 0:t[n][1]},X.prototype.has=function(e){return Q(this.__data__,e)>-1},X.prototype.set=function(e,t){var n=this.__data__,r=Q(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},K.prototype.clear=function(){this.size=0,this.__data__={hash:new W,map:new(z||X),string:new W}},K.prototype.delete=function(e){var t=oe(this,e).delete(e);return this.size-=t?1:0,t},K.prototype.get=function(e){return oe(this,e).get(e)},K.prototype.has=function(e){return oe(this,e).has(e)},K.prototype.set=function(e,t){var n=oe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},q.prototype.clear=function(){this.__data__=new X,this.size=0},q.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},q.prototype.get=function(e){return this.__data__.get(e)},q.prototype.has=function(e){return this.__data__.has(e)},q.prototype.set=function(e,t){var n=this.__data__;if(n instanceof X){var r=n.__data__;if(!z||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new K(r)}return n.set(e,t),this.size=n.size,this};function te(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":U&&U in Object(e)?function(e){var t=y.call(e,U),n=e[U];try{e[U]=void 0;var r=!0}catch(e){}var i=N.call(e);return r&&(t?e[U]=n:delete e[U]),i}(e):function(e){return N.call(e)}(e)}function ne(e){return Ae(e)&&te(e)==i}function re(e,t,n,r,i){e!==t&&function(e,t,n){for(var r=-1,i=Object(e),o=n(e),s=o.length;s--;){var a=o[++r];if(!1===t(i[a],a,i))break}}(t,(function(o,a){if(i||(i=new q),_e(o))!function(e,t,n,r,i,o,a){var u=le(e,n),l=le(t,n),c=a.get(l);if(c)J(e,n,c);else{var d,h=o?o(u,l,n+"",e,t,a):void 0,p=void 0===h;if(p){var f=pe(l),m=!f&&me(l),E=!f&&!m&&De(l);h=l,f||m||E?pe(u)?h=u:Ae(d=u)&&fe(d)?h=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(u):m?(p=!1,h=l.slice()):E?(p=!1,h=function(e){var t,n,r=(n=new(t=e.buffer).constructor(t.byteLength),new k(n).set(new k(t)),n);return new e.constructor(r,e.byteOffset,e.length)}(l)):h=[]:function(e){if(!Ae(e)||te(e)!=s)return!1;var t=M(e);if(null===t)return!0;var n=y.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&S.call(n)==b}(l)||he(l)?(h=u,he(u)?h=function(e){return function(e,t,n){var r=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var s=t[i],a=void 0;void 0===a&&(a=e[s]),r?ee(n,s,a):Z(n,s,a)}return n}(e,ve(e))}(u):_e(u)&&!Ee(u)||(h=function(e){return"function"!=typeof e.constructor||ue(e)?{}:G(M(e))}(l))):p=!1}p&&(a.set(l,h),i(h,l,r,o,a),a.delete(l)),J(e,n,h)}}(e,t,a,n,re,r,i);else{var u=r?r(le(e,a),o,a+"",e,t,i):void 0;void 0===u&&(u=o),J(e,a,u)}}),ve)}var ie=H?function(e,t){return H(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Se;function oe(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function se(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!_e(e)||function(e){return!!C&&C in e}(e))&&(Ee(e)?I:a).test(function(e){if(null!=e){try{return S.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}function ae(e,t){var n=typeof e;return!!(t=null==t?r:t)&&("number"==n||"symbol"!=n&&u.test(e))&&e>-1&&e%1==0&&e<t}function ue(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||O)}function le(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var ce=function(e){var t=0,n=0;return function(){var r=Y(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ie);function de(e,t){return e===t||e!=e&&t!=t}var he=ne(function(){return arguments}())?ne:function(e){return Ae(e)&&y.call(e,"callee")&&!B.call(e,"callee")},pe=Array.isArray;function fe(e){return null!=e&&ge(e.length)&&!Ee(e)}var me=j||function(){return!1};function Ee(e){if(!_e(e))return!1;var t=te(e);return t==o||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ge(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function _e(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ae(e){return null!=e&&"object"==typeof e}var De=A?function(e){return function(t){return e(t)}}(A):function(e){return Ae(e)&&ge(e.length)&&!!l[te(e)]};function ve(e){return fe(e)?function(e){var t=pe(e),n=!t&&he(e),r=!t&&!n&&me(e),i=!t&&!n&&!r&&De(e),o=t||n||r||i,s=o?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],a=s.length;for(var u in e)o&&("length"==u||r&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ae(u,a))||s.push(u);return s}(e):function(e){if(!_e(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=ue(e),n=[];for(var r in e)("constructor"!=r||!t&&y.call(e,r))&&n.push(r);return n}(e)}var Oe,Te=(Oe=function(e,t,n){re(e,t,n)},function(e,t){return ce(function(e,t,n){return t=$(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=$(r.length-t,0),s=Array(o);++i<o;)s[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(s),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,a)}}(e,t,Se),e+"")}((function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=Oe.length>3&&"function"==typeof i?(r--,i):void 0,o&&function(e,t,n){if(!_e(n))return!1;var r=typeof t;return!!("number"==r?fe(n)&&ae(t,n.length):"string"==r&&t in n)&&de(n[t],e)}(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var s=t[n];s&&Oe(e,s,n)}return e})));function Se(e){return e}e.exports=Te}(RT,RT.exports);const wT=Ir(RT.exports);class kT{constructor(e,t,n,r){this.backendRestClient=new CT(e,t,n,r)}async getApp(e){return function(e){return{appMetadata:{...e.appMetadata,id:e.appMetadata.id},features:e.features,role:LT(e.configuration,e.features)}}(await this.backendRestClient.get("/app",{role_name:e}))}async checkIfAppExists(){return this.backendRestClient.get("/app").then((()=>!0)).catch((e=>{if("Could not find app."===e.message)return!1;throw e}))}}function LT(e,t){const n={general:{enableFileTransfers:t.includes("file_sharing"),enableLocation:t.includes("location_sharing"),enableMentions:!1,showTypingIndicators:!0,enablePresence:!1,enableVoiceRecording:!1},theme:{version:"v2",name:"default"},permissions:{messages:{delete:"own",edit:"own",reply:"all",emojiReactions:"all"},messagesCustom:{},conversations:{leave:"none",markAsUnread:"none"},conversationsCustom:{}},generalNotificationSettings:{timeout:"15"},emailSettings:{enabled:!0,subject:"{{sender.name}} wants to chat with you on {{app.name}}",replySeparator:"--- Write ABOVE THIS LINE to post a reply via email ---",unsubscribeText:"Unsubscribe from all chat emails",senderName:"{{sender.name}} (via {{app.name}})",header:"Hi {{recipient.name}},\n {{sender.name}} wants to chat with you on {{app.name}}:",includeMessages:!0,inboxUrl:"{{app.custom.websiteUrl}}",inboxLinkText:"Join the chat",footer:"On behalf of {{sender.name}},\n The {{app.name}} team",enableReplyToEmail:t.includes("reply_via_email"),emailThemeType:t.includes("email_templates")?"custom":"standard",emailTheme:"default_email",emailAttachmentMode:"enabledExcludingImages",htmlTemplate:'<div>\n Hi {{recipient.name}}, <br/>\n <br/>\n {{sender.name}} wants to chat with you on {{app.name}}:<br/>\n <br/>\n {{messages.all}}\n <br/>\n <a href="{{app.custom.websiteUrl}}">Join the chat</a>\n <br/>\n <br/>\n On behalf of {{sender.name}},<br/>\n The {{app.name}} team<br/>\n <br/>\n</div>',textTemplate:"Hi {{recipient.name}},\n\n{{sender.name}} wants to chat with you on {{app.name}}:\n\n{{messages.all}}\n\n{{app.custom.websiteUrl}} Join the chat\n\nOn behalf of {{sender.name}},\nThe {{app.name}} team"},smsSettings:{enabled:t.includes("sms_notifications"),smsTemplate:'({{app.name}}) {{sender.name}}: "{{messages}}". Reply here: {{app.custom.websiteUrl}}',maximumSegments:"1",enableAutoOptOutText:!1,optOutText:"To stop receiving these messages, reply STOP."},suppressContactInfo:{mode:"off",suppressLinks:!0,suppressEmailAddresses:!0,suppressPhoneNumbers:!0},sameTabLinkRules:[]};return wT(n,e)}function xT(e,t){const n=e.map((e=>function(e,t){if("text"===e.type)return function(e,t){return MT(e,sg(t))}(e.children,t);if("file"===e.type&&"video"===e.subtype)return`🎥 ${vo(e.url)}`;if("file"===e.type&&"image"===e.subtype)return`📷 ${vo(e.url)}`;if("file"===e.type&&"audio"===e.subtype)return`🎧 ${vo(e.url)}`;if("file"===e.type&&"voice"===e.subtype){const t=e.duration;return void 0===t?"🎙️":`🎙️ (${Math.floor(t/60)}:${Math.floor(t%60).toString().padStart(2,"0")})`}return"file"===e.type?(e.subtype,`📎 ${vo(e.url)}`):"location"===e.type?"📍":""}(e,t)));return n.join("\n\n")}function MT(e,t){return e.flatMap((e=>{if("string"==typeof e)return e;switch(e.type){case"blockquote":case"bold":case"italic":case"strikethrough":case"link":case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return MT(e.children,t);case"bulletlist":case"bulletList":return"\n"+MT(e.children,t);case"bulletpoint":case"bulletPoint":return"- "+MT(e.children,t)+"\n";case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"emoji":case"customemoji":case"customEmoji":return e.text;case"suppressed":return t.contactInfoHiddenText;case"mention":return`@${e.text}`}})).join("")}function FT(){const e="undefined"!=typeof window?window.crypto:void 0,t=e?()=>e.getRandomValues(new Uint8Array(1))[0]:()=>Math.floor(255*Math.random());return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(e^t()&15>>e/4).toString(16)))}class BT{constructor(e,t,n,r,i){this.store=e,this.talkSession=t,this.editorInternals=n,this.onSendMessage=r,this.onDeleteMessage=i}async deleteMessage(e){const t=this.store.state$.extCurrentConversationId.peek(),n=this.store.state$.messages.child(t).lookup.child(e).peek(),r=this.talkSession.conversation(t).message(e),[i]=await Promise.all([n??r.get(),r.delete()]);if(i){const e={currentUser:this.store.state$.currentUser.peek(),conversation:this.store.state$.currentConversation.peek(),message:n};this.onDeleteMessage(e)}}async editMessage(e,t){const n=this.store.state$.extCurrentConversationId.peek();await this.talkSession.conversation(n).message(e).edit(t)}setReferencedMessage(e){this.store.state$.referencedMessageId.set(e)}sendMessage(e){return this._send({text:e.text,custom:e.custom,referencedMessage:e.referencedMessageId})}sendFileMessage(e){const t={type:"file",fileToken:e.fileToken};return this._send({content:[t],custom:e.custom})}sendLocationMessage(e){const t={type:"location",latitude:e.location.latitude,longitude:e.location.longitude};return this._send({content:[t],custom:e.custom})}async _send(e){const t=this.store.state$.extCurrentConversationId.peek(),n=await async function(e,t){const n=e.state$.extCurrentConversationId.peek(),r=e.state$.messages.child(n),i="string"==typeof t.referencedMessage?r.lookup.child(t.referencedMessage).peek():await(t.referencedMessage?.get()??null),o=i&&{...i,type:"UserMessage",sender:i.sender,referencedMessageId:i.referencedMessage?.id??null};o&&delete o.referencedMessage;const s=e.latestFileUpload,a="content"in t?[PT(s,t.content[0])]:[{type:"text",children:[t.text]}],u="text"in t?t.text:xT(t.content.map((e=>PT(s,e))),{});return{id:"ephemeral-"+FT(),type:"UserMessage",sender:e.state$.currentUser.peek(),createdAt:Date.now(),editedAt:null,custom:t.custom??{},origin:"web",referencedMessage:o,reactions:[],content:a,plaintext:u}}(this.store,e);this.store.state$.ephemeralMessages.child(t).child(n.id).set(n);const r=yo();this.store.readyForNewMessagesPromise=r.promise;const i=await this.talkSession.conversation(t).send(e);this.store.state$.ephemeralMessageIdMapping.child(t).child(i.id).set(n.id),r.resolve(),this.onSendMessage({message:await i.get(),currentUser:this.store.state$.currentUser.peek(),conversation:this.store.state$.currentConversation.peek()})}getMessageFieldText(){return this.editorInternals.getText()}setMessageFieldText(e){this.editorInternals.setText(e)}markAsTyping(){const e=this.store.state$.extCurrentConversationId.peek();this.talkSession.conversation(e).markAsTyping()}}function PT(e,t){switch(t.type){case"text":case"location":return t;case"file":return function(e,t){return{type:"file",subtype:"file"===e.type?void 0:e.type,...e.metadata,size:e.file.size,filename:e.file.name,fileToken:t.fileToken,url:e.temporaryBlobUrl}}(e,t)}}class UT{constructor(e,t,n){this.realtimeWsApiUrl=e,this.internalHttpApiUrl=t,this.restApiHttpUrl=n}getBokensUrl(e,t,n){return this.internalHttpApiUrl+`/${e}/bokens/${encodeURIComponent(t)}?signature=${encodeURIComponent(n??"")}`}getRealtimeWsUrl(e,t,n,r,i){const o=encodeURIComponent(t);return this.realtimeWsApiUrl+`/${e}/realtime/${o}?talkjs-client-build=${i??"standalone"}&talkjs-core=${n}&talkjs-client-id=${r}`}static fromHost(e){const t=new UT("wss://realtime.talkjs.com/v1","https://app.talkjs.com/api/v0","https://api.talkjs.com/v1");if(!e)return t;if(e.endsWith("talkjs.com")){const n=e.match(/\w+-(\w+)\.talkjs\.com/);if(n){const e=n[1];return new UT(`wss://realtime-${e}.talkjs.com/v1`,`https://app-${e}.talkjs.com/api/v0`,`https://api-${e}.talkjs.com/v1`)}return t}return e.includes("localhost")||e.includes("localtest.me")||/^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e)?new UT(`ws://${e}/public_api/v1`,`http://${e}/api/v0`,`http://${e}/public_api/v1`):new UT(`wss://${e}/public_api/v1`,`https://${e}/api/v0`,`https://${e}/public_api/v1`)}}var HT,jT=Object.defineProperty,$T=Object.defineProperties,YT=Object.getOwnPropertyDescriptors,zT=Object.getOwnPropertySymbols,VT=Object.prototype.hasOwnProperty,GT=Object.prototype.propertyIsEnumerable,WT=(e,t,n)=>t in e?jT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XT=(e,t)=>{for(var n in t||(t={}))VT.call(t,n)&&WT(e,n,t[n]);if(zT)for(var n of zT(t))GT.call(t,n)&&WT(e,n,t[n]);return e},KT=(e,t)=>$T(e,YT(t)),qT=(e,t)=>{var n={};for(var r in e)VT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&zT)for(var r of zT(e))t.indexOf(r)<0&>.call(e,r)&&(n[r]=e[r]);return n},JT=(e,t,n)=>new Promise(((r,i)=>{var o=e=>{try{a(n.next(e))}catch(e){i(e)}},s=e=>{try{a(n.throw(e))}catch(e){i(e)}},a=e=>e.done?r(e.value):Promise.resolve(e.value).then(o,s);a((n=n.apply(e,t)).next())}));function ZT(e,t){if(t.ok)return t.value.data;if("SESSION_DESTROYED"===t.value)throw new Error(`${e} failed because the session was destroyed`);if("server"===t.where)throw new Error(QT(e,t.value));throw"unreachable"}function QT(e,t){let n;return n=Array.isArray(t.reasons)?t.reasons.join():JSON.stringify(t.reasons),`${e} failed, got status ${t.status} ${t.errorCode}, reasons: ${n}`}function eS(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if("*"!==t[n]&&e[n]!==t[n])return!1;return!0}function tS(e){return e<=0?Promise.resolve():new Promise((t=>setTimeout(t,e)))}function nS(e,t){return e*(1-t+2*Math.random()*t)}const rS=()=>!0;function iS(e,t,n){return JT(this,arguments,(function*(e,t,{initialDelay:n,maxDelay:r,log:i,shouldRetry:o=rS}){return t().catch((s=>JT(this,null,(function*(){if(0===e)throw s;if(!(yield o(s)))throw s;const a=1e3*n*1.2,u=nS(r?Math.min(1e3*r,a):a,.05);return tS(u).then((()=>iS(e-1,t,{initialDelay:u/1e3,maxDelay:r,log:i,shouldRetry:o})))}))))}))}function oS(){const e={},t=new Promise((function(t,n){e.resolve=t,e.reject=n}));return e.promise=t,e}class sS{constructor(e,t,n){this.layer=e,this.states=t,this.transitions=n,this._state=t[0]}get state(){return this._state}transition(e){const t=this.transitions[e];if(!t)return;if(!this.canTransition(e))return;const n=this.state;this._state=t.to,t.afterTransition({from:n,to:this.state})}canTransition(e){const t=this.transitions[e];return!!t&&("ANY"===t.from||t.from.includes(this.state))}}function aS(e){return{ok:!0,value:e}}function uS(e){return{ok:!1,where:"client",value:e}}function lS(e){return{ok:!1,where:"server",value:e}}function cS(){const e={},t=new Promise((t=>{e.ok=e=>JT(this,null,(function*(){return t(aS(e))})),e.clientErr=e=>t(uS(e)),e.serverErr=e=>t(lS(e)),e.resolve=e=>t(e)}));return e.promise=t,e}class dS{constructor(e,t){this.realtimeUrl=e,this.handlers=t,this.socket=null,this.stateMachine=new sS("ReconnectingSocket",["STOPPED","CONNECTING","READY","DISCONNECTED","TERMINATED"],{startWs:{from:["STOPPED","DISCONNECTED"],to:"CONNECTING",afterTransition:()=>{const e=new(function(){if(globalThis.WebSocket)return globalThis.WebSocket;throw new Error("Missing WebSocket implementation")}())(this.realtimeUrl+"&talkjs-time="+Date.now());this.socket=e,e.addEventListener("open",(()=>{this.socket===e&&this.stateMachine.transition("onOpen")})),e.addEventListener("close",(()=>{this.socket===e&&this.stateMachine.transition("onClose")})),e.addEventListener("message",(t=>{this.socket===e&&this.handlers.onMessage(t)}))}},onOpen:{from:["CONNECTING"],to:"READY",afterTransition:()=>{this.handlers.onOpen()}},onClose:{from:["CONNECTING","READY"],to:"DISCONNECTED",afterTransition:e=>JT(this,[e],(function*({from:e}){"READY"===e&&this.handlers.onClose(),this.socket=null;const t=nS(1e4,.5);setTimeout((()=>{"DISCONNECTED"===this.stateMachine.state&&this.stateMachine.transition("startWs")}),t)}))},stopWs:{from:["CONNECTING","DISCONNECTED","READY"],to:"STOPPED",afterTransition:({from:e})=>{"READY"===e&&this.handlers.onClose();const t=this.socket;this.socket=null,null==t||t.close(1e3)}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{const e=this.socket;this.socket=null,null==e||e.close(1e3)}}})}stopWs(){this.stateMachine.transition("stopWs")}startWs(){this.stateMachine.transition("startWs")}send(e){return"READY"===this.stateMachine.state?(this.socket.send(e),aS(void 0)):uS("SOCKET_NOT_READY")}terminate(){const e=this.socket;this.stateMachine.canTransition("onClose")&&this.stateMachine.transition("onClose"),e&&("terminate"in e?e.terminate():e.close(1e3))}destroy(){this.stateMachine.transition("destroy")}}class hS{constructor(e,t){this.handlers=t,this.socket=new dS(e,{onOpen:()=>this.handlers.onOpen(),onClose:()=>this.handlers.onClose(),onMessage:e=>this.onWebSocketMessage(e)})}call(e,t,n,r){const i=`/${n.map((e=>encodeURIComponent(e))).join("/")}`,o=JSON.stringify([e,t,i,r]);return this.socket.send(o)}stopWs(){this.socket.stopWs()}startWs(){this.socket.startWs()}destroy(){this.socket.destroy()}terminate(){this.socket.terminate()}onWebSocketMessage(e){if("Auth token expired"!==e.data)try{const t=JSON.parse(e.data);if("PUBLISH"===t[1]){const e=t[0],n=JSON.stringify([e,"ACK"]);this.socket.send(n);const r=t.slice(2),i=[];r.forEach((e=>{"session.expired"===e.type?this.handlers.onAuthExpired():"upstream.restarting"===e.type?this.handlers.onUpstreamRestarting():i.push(e)})),i.length>0&&this.handlers.onPublish(e,i)}else{const e=t[0],n=t[1],r=t[2];this.handlers.onResponse(e,n,r)}}catch(e){}else this.handlers.onAuthExpired()}}class pS{constructor(e){this.delayMs=e,this.timeout=void 0}schedule(e){this.stop(),this.timeout=setTimeout((()=>{void 0!==this.timeout&&(this.stop(),e())}),this.delayMs)}stop(){void 0!==this.timeout&&(clearTimeout(this.timeout),this.timeout=void 0)}}class fS{constructor(){this.i=-1}next(){return this.i++,this.i}reset(){this.i=-1}}class mS{constructor(e,t){this.handlers=t,this.seqCounter=new fS,this.responseHandlers={},this.heartbeats=new ES(this),this.socket=new hS(e,{onUpstreamRestarting:()=>{this.heartbeats.serverActive(),this.handlers.onUpstreamRestarting()},onOpen:()=>{this.heartbeats.clientActive(),this.heartbeats.serverActive(),this.handlers.onReady()},onClose:()=>{this.heartbeats.stop(),Object.values(this.responseHandlers).forEach((e=>{e.clientErr("WEBSOCKET_DISCONNECTED")})),this.responseHandlers={},this.seqCounter.reset(),this.handlers.onNotReady()},onResponse:(e,t,n)=>{this.heartbeats.serverActive(),this.onResponse(e,t,n)},onPublish:(e,t)=>{this.heartbeats.serverActive(),this.handlers.onPublish(e,t),this.heartbeats.clientActive()},onAuthExpired:()=>{this.heartbeats.serverActive(),this.handlers.onAuthExpired()}})}call(e,t,n){const r=this.seqCounter.next(),i=cS();this.responseHandlers[r]=i;const o=this.socket.call(r,e,t,n);return o.ok||i.resolve(o),this.heartbeats.clientActive(),i.promise}onResponse(e,t,n){return JT(this,null,(function*(){const r=this.responseHandlers[e];r&&(200===t?r.ok({status:t,data:n}):r.serverErr({status:t,errorCode:n.errorCode,reasons:n.reasons}),delete this.responseHandlers[e])}))}stopWs(){this.socket.stopWs()}startWs(){this.socket.startWs()}destroy(){this.heartbeats.stop(),Object.values(this.responseHandlers).forEach((e=>{e.clientErr("WEBSOCKET_DISCONNECTED")})),this.responseHandlers={},this.socket.destroy()}terminate(){this.socket.terminate()}}class ES{constructor(e){this.connection=e,this.clientInactivityTimer=new pS(25e3),this.serverInactivityTimer=new pS(1e4),this.serverTimeoutTimer=new pS(5e3)}clientActive(){this.clientInactivityTimer.schedule((()=>{this.sendHeartbeat()}))}serverActive(){this.serverTimeoutTimer.stop(),this.serverInactivityTimer.schedule((()=>{this.sendHeartbeat(),this.serverTimeoutTimer.schedule((()=>{this.connection.terminate()}))}))}stop(){this.clientInactivityTimer.stop(),this.serverInactivityTimer.stop(),this.serverTimeoutTimer.stop()}sendHeartbeat(){this.connection.call("GET",["ping"],{}).catch((()=>{}))}}class gS{constructor(e,t,n){this.authProvider=t,this.handlers=n,this.stateMachine=new sS("AuthenticatedConnection",["WAITING_FOR_WS","LOGGING_IN","RENEWING_SESSION","READY","TERMINATED"],{logIn:{from:["WAITING_FOR_WS"],to:"LOGGING_IN",afterTransition:()=>JT(this,null,(function*(){yield this.renewSession()}))},logInFailed:{from:["LOGGING_IN"],to:"LOGGING_IN",afterTransition:()=>JT(this,null,(function*(){this.authProvider.refreshToken(),yield this.renewSession()}))},scheduledReauth:{from:["READY"],to:"RENEWING_SESSION",afterTransition:()=>JT(this,null,(function*(){yield this.renewSession()}))},scheduledReauthFailed:{from:["RENEWING_SESSION"],to:"RENEWING_SESSION",afterTransition:()=>JT(this,null,(function*(){this.authProvider.refreshToken(),yield this.renewSession()}))},authenticated:{from:["LOGGING_IN","RENEWING_SESSION"],to:"READY",afterTransition:({from:e})=>{"LOGGING_IN"===e&&this.handlers.onReady()}},authExpired:{from:["READY","RENEWING_SESSION"],to:"LOGGING_IN",afterTransition:()=>JT(this,null,(function*(){this.handlers.onNotReady(),this.authProvider.refreshToken(),yield this.renewSession()}))},wsDisconnected:{from:["READY","LOGGING_IN","RENEWING_SESSION"],to:"WAITING_FOR_WS",afterTransition:({from:e})=>{"READY"!==e&&"RENEWING_SESSION"!==e||this.handlers.onNotReady(),this.authProvider.clearScheduledRefresh()}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{this.authProvider.clearScheduledRefresh(),this.connection.destroy()}}}),this.connection=new mS(e,{onUpstreamRestarting:()=>this.handlers.onUpstreamRestarting(),onReady:()=>this.stateMachine.transition("logIn"),onNotReady:()=>{this.stateMachine.transition("wsDisconnected")},onAuthExpired:()=>{this.stateMachine.transition("authExpired")},onPublish:(e,t)=>{this.handlers.onPublish(e,t)}}),t.onTokenChanged((()=>{"READY"===this.stateMachine.state&&this.stateMachine.transition("scheduledReauth")}))}call(e,t,n){const r=this.connection.call(e,t,n);return r.then((e=>{e.ok||"server"!==e.where||401!==e.value.status||"READY"!==this.stateMachine.state&&"RENEWING_SESSION"!==this.stateMachine.state||this.stateMachine.transition("authExpired")})),r}stopWs(){this.connection.stopWs()}startWs(){this.connection.startWs()}destroy(){this.stateMachine.transition("destroy")}renewSession(){return JT(this,null,(function*(){const e=yield this.authProvider.getToken(),t=yield this.connection.call("POST",["session","renew"],{token:e});if(!t.ok&&"client"===t.where)return;const n=t.value;if(n.status,200===n.status){const t=n.data.expiresInSeconds;return void(null!==t&&t<120?(console.warn(`[TalkJS] Authenticated with a token that expires in ${t}s. Treating it as already expired and refreshing. Newly generated tokens should last at least 10 minutes.`),"LOGGING_IN"===this.stateMachine.state?this.stateMachine.transition("logInFailed"):"RENEWING_SESSION"===this.stateMachine.state&&this.stateMachine.transition("scheduledReauthFailed")):(this.authProvider.scheduleRefresh(t),this.authProvider.emitTokenAccepted(e),this.stateMachine.canTransition("authenticated")&&this.stateMachine.transition("authenticated")))}if(401===n.status)return void("LOGGING_IN"===this.stateMachine.state?this.stateMachine.transition("logInFailed"):"RENEWING_SESSION"===this.stateMachine.state&&this.stateMachine.transition("scheduledReauthFailed"));if(400===n.status)return void this.authProvider.emitTokenRefreshFailed(QT("Authentication",n));if(402===n.status)return void this.authProvider.emitTokenRefreshFailed(QT("Authentication",n));const r=5e3*Math.random()+5e3;setTimeout((()=>{this.call("POST",["session","renew"],{token:e}).catch((()=>{}))}),r)}))}}class _S{constructor(e,t,n){this.handlers=n,this.stateMachine=new sS("StopStartConnection",["STOPPED","WAITING_FOR_WS","READY","TERMINATED"],{unexpectedDisconnect:{from:["READY"],to:"WAITING_FOR_WS",afterTransition:()=>{this.inactivityTimer.stop(),this.handlers.onNotReady()}},stop:{from:["WAITING_FOR_WS","READY"],to:"STOPPED",afterTransition:()=>{this.connection.stopWs(),this.inactivityTimer.stop(),this.handlers.onNotReady()}},start:{from:["STOPPED"],to:"WAITING_FOR_WS",afterTransition:()=>{this.connection.startWs()}},ready:{from:["WAITING_FOR_WS"],to:"READY",afterTransition:()=>{this.pendingCalls=0,this.activeSubscriptions=0,this.inactivityTimer.schedule((()=>{this.stateMachine.transition("stop")})),this.handlers.onReady()}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{this.inactivityTimer.stop(),this.connection.destroy()}}}),this.pendingCalls=0,this.activeSubscriptions=0,this.inactivityTimer=new pS(3e3),this.connection=new gS(e,t,{onUpstreamRestarting:()=>{this.handlers.onUpstreamRestarting()},onReady:()=>{this.stateMachine.transition("ready")},onNotReady:()=>{"READY"===this.stateMachine.state&&this.stateMachine.transition("unexpectedDisconnect")},onPublish:(e,t)=>{this.handlers.onPublish(e,t)}})}get inactive(){return 0===this.pendingCalls&&0===this.activeSubscriptions}ensureStarted(){this.stateMachine.canTransition("start")&&this.stateMachine.transition("start")}call(e,t,n){return JT(this,null,(function*(){this.inactivityTimer.stop(),this.pendingCalls++;const r=yield this.connection.call(e,t,n);return this.pendingCalls--,"SUBSCRIBE"===e&&r.ok?this.activeSubscriptions++:"UNSUBSCRIBE"===e&&r.ok&&this.activeSubscriptions--,this.inactive&&this.inactivityTimer.schedule((()=>{this.stateMachine.transition("stop")})),r}))}destroy(){this.stateMachine.transition("destroy")}isConnected(){return"READY"===this.stateMachine.state}}class AS{constructor(e,t,n){this.handlers=n,this.stateMachine=new sS("QueuedConnection",["NOT_READY","PROCESSING_QUEUE","READY","TERMINATED"],{processQueue:{from:["NOT_READY"],to:"PROCESSING_QUEUE",afterTransition:()=>{this.sendQueuedCalls()}},ready:{from:["PROCESSING_QUEUE"],to:"READY",afterTransition:()=>{this.handlers.onReady()}},notReady:{from:["PROCESSING_QUEUE","READY"],to:"NOT_READY",afterTransition:()=>{Object.values(this.subscribeQueue).forEach((e=>e.deferred.ok({status:200,data:{}}))),this.subscribeQueue={},this.handlers.onSubscriptionsLost()}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{for(var e;this.callQueue.length;){const t=null==(e=this.callQueue.shift())?void 0:e.deferred;null==t||t.clientErr("SESSION_DESTROYED")}this.connection.destroy()}}}),this.subscribeQueue={},this.callQueue=[],this.connection=new _S(e,t,{onUpstreamRestarting:()=>{this.handlers.onUpstreamRestarting()},onReady:()=>{this.stateMachine.transition("processQueue")},onNotReady:()=>{this.stateMachine.transition("notReady")},onPublish:(e,t)=>{this.handlers.onPublish(e,t)}})}call(e,t,n){return"READY"===this.stateMachine.state?this.connection.call(e,t,n):("NOT_READY"===this.stateMachine.state&&this.connection.ensureStarted(),"SUBSCRIBE"===e||"UNSUBSCRIBE"===e?this._subscribe(e,t,n):this._call(e,t,n))}_subscribe(e,t,n){const r=t.join("/"),i=this.subscribeQueue[r];if(i&&i.method===e)return i.deferred.promise;i&&i.method!==e&&(i.deferred.ok({status:200,data:{}}),delete this.subscribeQueue[r]);const o={deferred:cS(),method:e,path:t,data:n};return this.subscribeQueue[r]=o,o.deferred.promise}_call(e,t,n){const r={deferred:cS(),method:e,path:t,data:n};return this.callQueue.push(r),r.deferred.promise}dequeue(){for(const e in this.subscribeQueue){const t=this.subscribeQueue[e];return delete this.subscribeQueue[e],t}return this.callQueue.shift()}destroy(){this.stateMachine.transition("destroy")}sendQueuedCalls(){return JT(this,null,(function*(){let e=0;for(;"PROCESSING_QUEUE"===this.stateMachine.state;){e++;const t=this.dequeue();if(!t)return void this.stateMachine.transition("ready");this.connection.call(t.method,t.path,t.data).then((e=>{t.deferred.resolve(e)})),e>50&&(yield new Promise((e=>setTimeout(e,100))))}}))}isConnected(){return"READY"===this.stateMachine.state||"PROCESSING_QUEUE"===this.stateMachine.state}}const DS="undefined"!=typeof window&&null!=(HT=window.queueMicrotask)?HT:setTimeout;class vS{constructor(e,t){this.clearPendingBatch=e,this.sendCalls=t,this.sent=!1,DS((()=>this.send()))}send(){this.sent||(this.sent=!0,this.clearPendingBatch(),this.sendCalls())}destroy(){this.sent=!0}}class OS extends vS{constructor(e,t){super(t,(()=>{this.sendSubscribe(),this.sendGet()})),this.connection=e,this.getCalls=[],this.subscribeCalls=[]}canPush(e,t){return OS.isCorrectBatchTypeFor(e,t)}static isCorrectBatchTypeFor(e,t){return eS(t,["users","*"])&&("GET"===e||"SUBSCRIBE"===e)}push(e,t,n){const r=t[1],i=cS();return"GET"===e?this.getCalls.push({userId:r,deferred:i}):this.subscribeCalls.push({userId:r,deferred:i}),1e3!==this.getCalls.length&&1e3!==this.subscribeCalls.length||this.send(),i.promise}sendGet(){return JT(this,null,(function*(){if(0===this.getCalls.length)return;const e=[...new Set(this.getCalls.map((e=>e.userId)))],t=yield this.connection.call("GET",["users"],{ids:e,includePrivateFields:!1});if(t.ok)for(const n of this.getCalls){const e=t.value.data[n.userId];e?n.deferred.ok({status:200,data:e}):n.deferred.serverErr({status:404,errorCode:"NOT_FOUND",reasons:["No user with that ID exists"]})}else this.getCalls.forEach((e=>e.deferred.resolve(t)))}))}sendSubscribe(){if(0===this.subscribeCalls.length)return;const e=[...new Set(this.subscribeCalls.map((e=>e.userId)))];this.connection.call("SUBSCRIBE",["users"],{ids:e}).then((e=>this.subscribeCalls.forEach((t=>t.deferred.resolve(e)))))}}class TS extends vS{constructor(e,t,n){super(n,(()=>this.sendMutate())),this.conversationId=e,this.connection=t,this.calls=[]}canPush(e,t){return!!TS.isCorrectBatchTypeFor(e,t)&&t[1]===this.conversationId}static isCorrectBatchTypeFor(e,t){return eS(t,["conversations","*","participants","*"])&&("PUT"===e||"POST"===e||"PATCH"===e)}push(e,t,n){const r=t[3],i=cS();return this.calls.push({action:{id:r,method:e,params:n},deferred:i}),100===this.calls.length&&this.send(),i.promise}sendMutate(){return JT(this,null,(function*(){const e=this.calls.map((e=>e.action)),t=yield this.connection.call("POST",["conversations",this.conversationId,"participants"],{actions:e});if(!t.ok)return void this.calls.forEach((e=>e.deferred.resolve(t)));const n=t.value.data.responses;for(let r=0;r<n.length;r++){const e=this.calls[r].deferred,t=n[r];200===t.status?e.ok(KT(XT({},t),{data:{}})):e.serverErr(t)}}))}}class SS{constructor(e,t,n){this.pendingBatch=null,this.connection=new AS(e,t,n)}call(e,t,n){return JT(this,null,(function*(){var r;if(null==(r=this.pendingBatch)?void 0:r.canPush(e,t))return this.pendingBatch.push(e,t,n);this.pendingBatch&&this.pendingBatch.send();const i=this.createEmptyBatchFor(e,t);return i?(this.pendingBatch=i,i.push(e,t,n)):this.connection.call(e,t,n)}))}destroy(){var e;this.connection.destroy(),null==(e=this.pendingBatch)||e.destroy()}isConnected(){return this.connection.isConnected()}createEmptyBatchFor(e,t){if(OS.isCorrectBatchTypeFor(e,t))return new OS(this.connection,(()=>this.pendingBatch=null));if(TS.isCorrectBatchTypeFor(e,t)){const e=t[1];return new TS(e,this.connection,(()=>this.pendingBatch=null))}return null}}const yS={200:"RESOLVE",400:"RESOLVE",401:"RETRY",402:"RESOLVE",403:"RESOLVE",404:"RESOLVE",405:"RESOLVE",409:"RESOLVE",429:"DELAY",500:"DELAY"};class CS{constructor(e,t,n){this.throttler=new NS,this.alive=!0,this.connection=new SS(e,t,n)}call(e,t,n){return JT(this,null,(function*(){let r=0;for(;this.alive;){const i=yield this.connection.call(e,t,n);if((i.ok||"client"!==i.where||"SOCKET_NOT_READY"!==i.value)&&(i.ok||"server"!==i.where||500!==i.value.status)||r++,10===r)return i;if(i.ok||"client"!==i.where){const e=i.value,t=e.status,n=yS[t];if("RESOLVE"===n)return this.throttler.resetDelay(),i;if("RETRY"===n)continue;if("DELAY"===n){yield this.throttler.wait();continue}return console.warn("[TalkJS] Unexpected status code",t),e}if("SESSION_DESTROYED"===i.value)return uS("SESSION_DESTROYED");"WEBSOCKET_DISCONNECTED"!==i.value&&("SOCKET_NOT_READY"!==i.value?i.value:yield this.throttler.wait())}return uS("SESSION_DESTROYED")}))}destroy(){this.alive=!1,this.connection.destroy()}isConnected(){return this.connection.isConnected()}}class NS{constructor(){this.initialDelayMs=200,this.exponentialFactor=1.2,this.maxDelayMs=3e4,this.currentDelayMs=this.initialDelayMs,this.lastCall=0}getCurrentDelay(){return this.currentDelayMs}wait(){const e=(new Date).getTime(),t=nS(this.currentDelayMs,.05),n=this.lastCall+t,r=Math.max(0,n-e);return this.lastCall=e+r,this.currentDelayMs=Math.min(t*this.exponentialFactor,this.maxDelayMs),tS(r)}resetDelay(){this.currentDelayMs=this.initialDelayMs}}function bS(e){return e.map((e=>encodeURIComponent(e))).join()}class IS{constructor(){this.paths={}}add(e){this.paths[bS(e)]=e}delete(e){delete this.paths[bS(e)]}has(e){return Object.hasOwnProperty.call(this.paths,bS(e))}clear(){this.paths={}}forEach(e){Object.values(this.paths).forEach((t=>e(t)))}}class RS{constructor(e,t,n){this.handlers=n,this.targetSubscriptions=new IS,this.connection=new CS(e,t,{onUpstreamRestarting:()=>this.handlers.onUpstreamRestarting(),onSubscriptionsLost:()=>{this.targetSubscriptions.forEach((e=>{this.resubscribe(e)})),this.handlers.onResubscribeSent()},onReady:()=>this.handlers.onReady(),onPublish:(e,t)=>{this.handlers.onPublish(e,t)}})}call(e,t,n){return this.connection.call(e,t,n)}subscribe(e){return JT(this,null,(function*(){return this.targetSubscriptions.add(e),this.connection.call("SUBSCRIBE",e,{})}))}unsubscribe(e){return JT(this,null,(function*(){return this.targetSubscriptions.delete(e),this.connection.call("UNSUBSCRIBE",e,{})}))}resubscribe(e){return JT(this,null,(function*(){const t=yield this.connection.call("SUBSCRIBE",e,{});t.ok||this.handlers.onResubscribeError(e,t)}))}destroy(){this.targetSubscriptions.clear(),this.connection.destroy()}isConnected(){return this.connection.isConnected()}}function wS(e,t){return void 0===t?e:t}function kS(e,t){if(void 0===t)return e;if(null===t)return{};const n=XT({},e);for(const r in t){const e=t[r];null===e?delete n[r]:n[r]=e}return n}function LS(e,t){if(e===t)return!0;if(!e||!t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!LS(e[n],t[n]))return!1}else{const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n){if(!Object.hasOwnProperty.call(t,r))return!1;if(!LS(e[r],t[r]))return!1}}return!0}class xS{constructor(){this.prev=Promise.resolve()}runExclusive(e){return JT(this,null,(function*(){const t=this.prev.then((()=>e()));return this.prev=t,t}))}}class MS{constructor(e){this.initialised=!1,this.getPointer=void 0,this.pendingStates=[e],e.resultPromise.then((()=>this.initialised=!0))}get pendingPointer(){if(0!==this.pendingStates.length)return this.pendingStates[this.pendingStates.length-1]}get mostRecentState(){var e;return null!=(e=this.pendingPointer)?e:this.getPointer}canAppendState(e){var t,n;const r=null==(t=this.getPointer)?void 0:t.seq;if(void 0!==r&&e<=r)return!1;const i=null==(n=this.pendingPointer)?void 0:n.seq;return!(void 0!==i&&e<i)}set(e){if(!this.canAppendState(e.seq))throw"Appending in the past";this.pendingStates.push(e)}mutate(e,t){if(!this.initialised)return;if(!this.canAppendState(e))throw"Mutating in the past";const n=this.mostRecentState.resultPromise.then((e=>e.ok?t(e):e));this.pendingStates.push({seq:e,resultPromise:n})}get(e){for(;this.pendingStates.length>0&&(void 0===this.getPointer||this.pendingStates[0].seq<=e);)this.getPointer=this.pendingStates.shift();return this.getPointer}}class FS extends MS{constructor(e,t){super(e),this.onTeardown=t,this._error=null,this._lastGoodState=Promise.resolve(void 0)}get error(){return this._error}get lastGoodState(){return this._lastGoodState}mutate(e,t){super.mutate(e,t),this.registerNewState(this.mostRecentState.resultPromise)}set(e){super.set(e),this.registerNewState(this.mostRecentState.resultPromise)}registerNewState(e){const t=this.lastGoodState;this._lastGoodState=e.then((e=>e.ok?e.value:t)),e.then((e=>{e.ok||this.setError(e)}))}setError(e){var t;this._error||(this._error=e,null==(t=this.onTeardown)||t.call(this,e),this.lastGoodState.then((e=>{void 0!==e&&this.teardownNested(e)})))}}class BS extends FS{constructor(e,t){const n=new Promise((e=>setTimeout(e))).then((()=>this.fetchInitial(e)));super({seq:e,resultPromise:n},t),this.initialSeq=e,this.getDeepMutex=new xS,this.lastDeep=void 0}refetchInitial(e){return JT(this,null,(function*(){const t=this.mostRecentState.resultPromise,n=this.fetchInitial(e),[r,i]=yield Promise.all([t,n]);return void 0!==r&&r.ok&&i.ok&&this.equal(r.value,i.value)?r:i}))}refetch(e){if(null!==this.error)return;const t={seq:e,resultPromise:this.refetchInitial(e)};this.set(t)}changedBetween(e,t){return JT(this,null,(function*(){if(e>=t)return!1;const n=this.get(t),r=yield n.resultPromise;return!!r.ok&&(r.value.lastChanged>Math.max(this.initialSeq,e)&&r.value.lastChanged<=t||(yield this.anyChildChanged(e,t,r.value)))}))}getDeep(e){return JT(this,null,(function*(){return this.getDeepMutex.runExclusive((()=>JT(this,null,(function*(){var t;if(null!==this.error)return this.error;const n=null==(t=this.lastDeep)?void 0:t.seq;if(e===n)return this.lastDeep.deep;if(void 0!==n){if(e<n)throw`Trying to load seq ${e} when we have previously loaded seq ${n}`;if(!(yield this.changedBetween(n,e)))return this.lastDeep.seq=e,this.lastDeep.deep}const r=this.get(e).resultPromise,i=r.then((t=>t.ok?this.loadNested(e,t.value):t));this.lastDeep={seq:e,shallow:r,deep:i};const o=yield i;return o.ok||this.setError(o),o}))))}))}}class PS extends BS{constructor(e,t,n){super(e,n),this.emitMutex=t,this.unsubscribeTimer=new US,this.referencedByOtherStores=0,this.listeners=[],this.lastEmitSeq=void 0,this.lastEmitResult=void 0,t.runExclusive((()=>JT(this,null,(function*(){yield this.emit(e)}))))}registerInternalSubscription(){this.referencedByOtherStores++;let e=!0;return()=>{e&&(e=!1,this.referencedByOtherStores--,this.startUnsubscribeTimerIfOrphan())}}get onlyUsedInternally(){return 0===this.listeners.length}listen(e){return this.unsubscribeTimer.stop(),this.listeners.push(e),void 0!==this.lastEmitResult&&e(this.lastEmitResult),()=>{this.listeners=this.listeners.filter((t=>t!==e)),this.startUnsubscribeTimerIfOrphan()}}startUnsubscribeTimerIfOrphan(){0===this.referencedByOtherStores&&0===this.listeners.length&&this.unsubscribeTimer.restart((()=>{this.setError(uS("UNSUBSCRIBED"))}),this.unsubscribeDebounceMs)}getLoadMoreSeq(){var e;const t=null!=(e=this.lastEmitSeq)?e:0,n=this.mostRecentState.seq;return Math.max(t,n)+1e-6}emit(e){return JT(this,null,(function*(){var t;if(this.onlyUsedInternally)return;if(this.lastEmitSeq&&this.lastEmitSeq>=e)return;if(!1===(null==(t=this.lastEmitResult)?void 0:t.ok))return;this.lastEmitSeq=e;const n=yield this.getDeep(e);n!==this.lastEmitResult&&(this.lastEmitResult=n,this.listeners.forEach((e=>e(n))))}))}}class US{constructor(){this.timerId=void 0}restart(e,t){void 0!==this.timerId&&clearTimeout(this.timerId),this.timerId=setTimeout((()=>e()),t)}stop(){clearTimeout(this.timerId)}}class HS extends PS{constructor(e,t,n,r,i){super(e,r,i),this.userId=t,this.realtimeClient=n,this.unsubscribeDebounceMs=1e4}fetchInitial(e){return JT(this,null,(function*(){const t=yield this.realtimeClient.call("GET",["users",this.userId],{includePrivateFields:!1},{bypassCache:!0});return t.ok?aS({snapshot:this.realtimeClient.createUserSnapshot(t.value.data),lastChanged:e}):"server"===t.where&&404===t.value.status?aS({snapshot:null,lastChanged:e}):t}))}equal(e,t){return LS(e.snapshot,t.snapshot)}loadNested(e,t){return JT(this,null,(function*(){return aS(t)}))}userCreated(e,t){this.mutate(e,(n=>null!==n.value.snapshot?n:aS({snapshot:this.realtimeClient.createUserSnapshot(t.state),lastChanged:e})))}userEdited(e,t){this.mutate(e,(n=>{const r=n.value.snapshot;return null===r?(console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."),n):aS({snapshot:{id:r.id,name:wS(r.name,t.diff.name),custom:kS(r.custom,t.diff.custom),locale:wS(r.locale,t.diff.locale),photoUrl:wS(r.photoUrl,t.diff.photoUrl),role:wS(r.role,t.diff.role),welcomeMessage:wS(r.welcomeMessage,t.diff.welcomeMessage)},lastChanged:e})}))}getFromCache(){return JT(this,null,(function*(){const e=yield this.mostRecentState.resultPromise;return e.ok?null===e.value.snapshot?lS({status:404,errorCode:"USER_NOT_FOUND",reasons:["That user does not exist yet"]}):aS({status:200,data:{id:e.value.snapshot.id,name:e.value.snapshot.name,custom:e.value.snapshot.custom,locale:e.value.snapshot.locale,photoUrl:e.value.snapshot.photoUrl,role:e.value.snapshot.role,welcomeMessage:e.value.snapshot.welcomeMessage}}):uS("NOT_IN_CACHE")}))}teardownNested(e){}anyChildChanged(e,t,n){return JT(this,null,(function*(){return!1}))}}var jS,$S={};function YS(e,t){const n=t.lastIndex;let r;const i=[];for(;null!==(r=t.exec(e));)i.push(r);return t.lastIndex=n,i}function zS(e){const t=e.replace(/%2F/g,"/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/,"$1");return decodeURIComponent(t)}function VS(e,t){e()||t||(t=e.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/,"`$1`")+" was not true")}!function(){if(jS)return $S;function e(e){return String.fromCharCode(parseInt(e.slice(1),16))}function t(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}jS=1,Object.defineProperty($S,"__esModule",{value:!0}),$S.encode=function(t){return btoa(encodeURIComponent(t).replace(/%[0-9A-F]{2}/g,e))},$S.decode=function(e){return decodeURIComponent(Array.from(atob(e),t).join(""))}}(),(e=>{function t(e,t){(function(e,t){switch(t){case"undefined":return void 0===e;case String:return"string"==typeof e||e instanceof String;case Boolean:return"boolean"==typeof e||e instanceof Boolean;case Number:return"number"==typeof e||e instanceof Number;default:return e instanceof t}})(e,t)||(t.name,String(e))}e.defined=function(e){},e.has=function(e,t){e[t]},e.is=t,e.equals=function(e,t){},e.oneOf=function(e,t){t.includes(e)||JSON.stringify(t)},e.isArray=function(e,n){t(e,Array),e&&e.length>0&&t(e[0],n)},e.optional=function(e,n){void 0!==e&&t(e,n)},e.falsy=function(e){},e.never=function(e){}})(VS||(VS={}));const GS=VS,WS=/^\/.*[^\\]\/[im]*$/;function XS(e){return!!WS.test(e)&&!KS(e).test("")}function KS(e){const t=e.match(/^\/(.*[^\\])\/(.*)$/);if(!t)throw new Error(`Expected ${e} to be a (non-empty) regex`);let n=t[2]||"";return n=n.replace(/[^im]/g,"")+"g",new RegExp(t[1],n)}class qS{constructor({mode:e,allowedHostnames:t,allowedPhoneNrs:n,allowedMatches:r,forbiddenMatches:i,suppressLinks:o,suppressEmailAddresses:s,suppressPhoneNumbers:a,replacement:u}){GS.oneOf(e,["all","otherOnly","off"]),this.mode=e,this.suppressLinks=!1!==o,this.suppressEmailAddresses=!1!==s,this.suppressPhoneNumbers=!1!==a,this.allowedHostnames=t||[],this.allowedPhoneNrs=(n||[]).filter((e=>e)).map((e=>e.replace(/[^0-9]/g,""))),this.allowedMatches=(r||[]).filter(XS).map((e=>KS(e))),this.forbiddenMatches=(i||[]).filter(XS).map((e=>KS(e))),GS((()=>this.allowedMatches.every((e=>e.flags.includes("g")))),"All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"),GS((()=>this.forbiddenMatches.every((e=>e.flags.includes("g")))),"All regexes in `suppressContactInfo.forbiddenMatches` must be global. Check `forbiddenMatches`!"),u=null==u?void 0:u.trim(),this.replacement=u&&u.length>0?u:void 0}shouldSuppress({isContentBySender:e}){return"all"===this.mode||"otherOnly"===this.mode&&!e}}function JS(e,t){return e.map((e=>function(e,t){if("text"===e.type)return ZS(e.children,function(e){var t,n,r,i,o,s,a,u,l,c,d,h;let p="";return e.t&&(p=`(${e.t("CONTACT_INFORMATION_HIDDEN")})`),{formattedLinks:null!=(t=e.formattedLinks)?t:"plaintext",markup:null!=(n=e.markup)&&n,useFallbackMentions:null!=(r=e.useFallbackMentions)&&r,sameTabLinkRules:null!=(i=e.sameTabLinkRules)?i:[],enableEmojiImageFallback:null!=(o=e.enableEmojiImageFallback)&&o,highlight:null!=(s=e.highlight)?s:[],contactInfo:null!=(a=e.contactInfo)&&a,suppression:null!=(u=e.suppression)?u:new qS({mode:"off"}),contactInfoHiddenText:null!=(d=null!=(c=e.contactInfoHiddenText)?c:null==(l=e.suppression)?void 0:l.replacement)?d:p,customEmojiUrls:null!=(h=e.customEmojiUrls)?h:{}}}(t));if("file"===e.type&&"video"===e.subtype)return`🎥 ${zS(e.url)}`;if("file"===e.type&&"image"===e.subtype)return`📷 ${zS(e.url)}`;if("file"===e.type&&"audio"===e.subtype)return`🎧 ${zS(e.url)}`;if("file"===e.type&&"voice"===e.subtype){const t=e.duration;return void 0===t?"🎙️":`🎙️ (${Math.floor(t/60)}:${Math.floor(t%60).toString().padStart(2,"0")})`}return"file"===e.type?(e.subtype,`📎 ${zS(e.url)}`):"location"===e.type?"📍":""}(e,t))).join("\n\n")}function ZS(e,t){return e.flatMap((e=>{if("string"==typeof e)return e;switch(e.type){case"blockquote":case"bold":case"italic":case"strikethrough":case"link":case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return ZS(e.children,t);case"bulletlist":case"bulletList":return"\n"+ZS(e.children,t);case"bulletpoint":case"bulletPoint":return"- "+ZS(e.children,t)+"\n";case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"emoji":case"customemoji":case"customEmoji":return e.text;case"suppressed":return t.contactInfoHiddenText;case"mention":return`@${e.text}`}})).join("")}class QS extends BS{constructor(e,t,n,r){super(e),this.conversationId=t,this.message=n,this.realtimeClient=r}get messageId(){return"string"==typeof this.message?this.message:this.message.id}fetchInitial(e){return JT(this,null,(function*(){let t;if("object"==typeof this.message)t=this.message;else{const e=yield this.realtimeClient.call("GET",["me","conversations",this.conversationId,"messages",this.message],{},{bypassCache:!0});if(!e.ok)return e;t=e.value.data}return aS({lastChanged:e,sender:null===t.senderId?null:this.realtimeClient.internalSubscribe(["users",t.senderId]),data:{id:t.id,type:t.type,custom:t.custom,createdAt:t.createdAt,editedAt:t.editedAt,referencedMessageId:t.referencedMessageId,origin:t.origin,plaintext:JS(t.content,{}),content:t.content,reactions:ty(t.reactions)}})}))}refetch(e){throw"Do not call refetch on message data stores, it can return outdated data. Destroy and remake them instead"}equal(e,t){return LS(e.data,t.data)}teardownNested(e){var t;null==(t=e.sender)||t.unsubscribe()}anyChildChanged(e,t,n){return JT(this,null,(function*(){var r;const i=null==(r=n.sender)?void 0:r.store;return!0===(yield null==i?void 0:i.changedBetween(e,t))}))}loadNested(e,t){return JT(this,null,(function*(){var n,r,i;const o=yield null==(r=null==(n=t.sender)?void 0:n.store)?void 0:r.getDeep(e);if(!1===(null==o?void 0:o.ok))return o;if(null===t.data)return aS({snapshot:null});const s=null==o?void 0:o.value;return aS({snapshot:{sender:null!=(i=null==s?void 0:s.snapshot)?i:null,id:t.data.id,type:t.data.type,custom:t.data.custom,createdAt:t.data.createdAt,editedAt:t.data.editedAt,origin:t.data.origin,plaintext:JS(t.data.content,{}),content:t.data.content,referencedMessageId:t.data.referencedMessageId,reactions:t.data.reactions}})}))}messageEdited(e,t){this.mutate(e,(n=>null===n.value.data?n:aS({lastChanged:e,sender:n.value.sender,data:{id:n.value.data.id,type:n.value.data.type,createdAt:n.value.data.createdAt,origin:n.value.data.origin,referencedMessageId:n.value.data.referencedMessageId,editedAt:wS(n.value.data.editedAt,t.diff.editedAt),custom:kS(n.value.data.custom,t.diff.custom),content:wS(n.value.data.content,t.diff.content),reactions:ey(n.value.data.reactions,t.diff.reactions)}})))}messageDeleted(e,t){this.mutate(e,(n=>null===n.value.data?n:this.messageId===t.messageId?(this.teardownNested(n.value),aS({lastChanged:e,sender:null,data:null})):n.value.data.referencedMessageId===t.messageId?aS({lastChanged:e,sender:n.value.sender,data:{id:n.value.data.id,type:n.value.data.type,createdAt:n.value.data.createdAt,origin:n.value.data.origin,referencedMessageId:null,editedAt:n.value.data.editedAt,custom:n.value.data.custom,content:n.value.data.content,reactions:n.value.data.reactions}}):n))}getFromCache(){return JT(this,null,(function*(){var e;const t=yield this.mostRecentState.resultPromise;if(!t.ok)return uS("NOT_IN_CACHE");if(null===t.value.data)return lS({status:404,errorCode:"MESSAGE_NOT_FOUND",reasons:["No message with that ID exists"]});const n=t.value,{sender:r}=n,i=qT(n,["sender"]),o={};return i.data.reactions.forEach((e=>{o[e.emoji]={count:e.count,currentUserReacted:e.currentUserReacted}})),aS({status:200,data:KT(XT({},i.data),{senderId:null!=(e=null==r?void 0:r.store.userId)?e:null,reactions:o})})}))}}function ey(e,t){if(void 0===t)return e;const n=e.map((e=>{const n=t[e.emoji];return void 0===n?e:null===n?KT(XT({},e),{count:0}):{emoji:e.emoji,count:wS(e.count,n.count),currentUserReacted:wS(e.currentUserReacted,n.currentUserReacted)}})).filter((e=>e.count>0)),r=new Set(n.map((e=>e.emoji)));for(const i in t){const e=t[i];e&&!r.has(i)&&n.push({emoji:i,count:e.count,currentUserReacted:e.currentUserReacted})}return n.sort(((e,t)=>e.emoji.localeCompare(t.emoji))),n}function ty(e){const t=Object.entries(e).map((([e,t])=>({emoji:e,count:t.count,currentUserReacted:t.currentUserReacted})));return t.sort(((e,t)=>e.emoji.localeCompare(t.emoji))),t}class ny extends BS{constructor(e,t,n,r){super(e),this.createdAt=t,this.dataStore=n,this.referencedDataStore=r}get messageId(){return this.dataStore.messageId}fetchInitial(e){return JT(this,null,(function*(){return aS({lastChanged:e,dataStore:this.dataStore,referencedDataStore:this.referencedDataStore})}))}refetch(e){throw"Do not call refetch on message stores, it can return outdated data. Destroy and remake them instead"}equal(e,t){return!0}teardownNested(e){}anyChildChanged(e,t,n){return JT(this,arguments,(function*(e,t,{dataStore:n,referencedDataStore:r}){return!0===(yield n.changedBetween(e,t))||!0===(yield null==r?void 0:r.changedBetween(e,t))}))}loadNested(e,t){return JT(this,null,(function*(){var n,r,i;const o=yield t.dataStore.getDeep(e);if(!o.ok)return o;const s=o.value;if(null===s.snapshot)return aS({snapshot:null});const a=yield null==(n=t.referencedDataStore)?void 0:n.getDeep(e);if(a&&!a.ok)return a;const u=null!=(r=null==a?void 0:a.value)?r:null,l=null!=(i=null==u?void 0:u.snapshot)?i:null;return aS({snapshot:{id:s.snapshot.id,type:s.snapshot.type,sender:s.snapshot.sender,custom:s.snapshot.custom,createdAt:s.snapshot.createdAt,editedAt:s.snapshot.editedAt,referencedMessage:l,origin:s.snapshot.origin,plaintext:s.snapshot.plaintext,content:s.snapshot.content,reactions:s.snapshot.reactions}})}))}}class ry extends PS{constructor(e,t,n,r,i){super(e,r,i),this.conversationId=t,this.realtimeClient=n,this.unsubscribeDebounceMs=1e3,this.pendingLoadMore=void 0}listen(e){return this.onlyUsedInternally&&this.mostRecentState.resultPromise.then((e=>{if(e.ok&&null!==e.value.inWindow){const t=30-e.value.inWindow.length;t>0&&this._loadMoreMessages(t)}})),super.listen(e)}fetchInitial(e){return JT(this,null,(function*(){const t=this.onlyUsedInternally?1:30,n=yield iy({realtimeClient:this.realtimeClient,conversationId:this.conversationId,count:t});return n.ok?null===n.value.messages?aS({lastChanged:e,lastMessageChanged:e,stores:null,inWindow:null,windowEnd:null}):oy({seq:e,messages:n.value.messages,cursor:n.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):n}))}teardownNested(e){if(e.stores){const t=uS("TERMINATED");Object.values(e.stores).forEach((e=>e.setError(t))),e.inWindow.forEach((e=>e.setError(t)))}}anyChildChanged(e,t,n){return JT(this,null,(function*(){for(const r in n.stores){const i=n.stores[r];if(!0===(yield null==i?void 0:i.changedBetween(e,t)))return!0}return!1}))}lastMessageChangedBetween(e,t){return JT(this,null,(function*(){if(e>=t)return!1;const n=yield this.get(t).resultPromise;if(!n.ok)return!1;if(n.value.lastMessageChanged>e)return!0;if(null===n.value.stores)return!1;const r=n.value.inWindow[0];return void 0!==r&&!0===(yield r.changedBetween(e,t))}))}equal(e,t){return null===e.stores&&null===t.stores||null!==e.stores&&null!==t.stores&&!!LS(Object.keys(e.stores),Object.keys(t.stores))&&!!LS(e.inWindow.map((e=>e.messageId)),t.inWindow.map((e=>e.messageId)))&&LS(e.windowEnd,t.windowEnd)}loadNested(e,t){return JT(this,null,(function*(){if(null===t.stores)return aS({snapshot:null,loadedAll:!0});const n=yield Promise.all(t.inWindow.map((t=>t.getDeep(e)))),r=n.find((e=>!e.ok));return r||aS({snapshot:n.filter((e=>null!==e.value.snapshot)).map((e=>e.value.snapshot)),loadedAll:null===t.windowEnd})}))}loadMore(e){return JT(this,null,(function*(){if(this.pendingLoadMore)return this.pendingLoadMore;const t=oS();this.pendingLoadMore=t.promise,yield this._loadMoreMessages(e),t.resolve(),this.pendingLoadMore=void 0}))}_loadMoreMessages(e=30){return JT(this,null,(function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return;if(null===t.value.windowEnd)return;const n=t.value.windowEnd.cursor,r=yield iy({count:e,cursor:n,conversationId:this.conversationId,realtimeClient:this.realtimeClient}),i=this.getLoadMoreSeq();this.mutate(i,(e=>null===e.value.windowEnd||n!==e.value.windowEnd.cursor?e:r.ok?null===r.value.messages?(console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."),e):oy({seq:i,prevState:e.value,messages:r.value.messages,cursor:r.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):r)),yield this.emitMutex.runExclusive((()=>this.emit(i)))}))}messageCreated(e,t){this.mutate(e,(n=>{if(null===n.value.stores)return console.warn("[TalkJS] Received a 'message.created' event for a nonexistent conversation."),n;if(n.value.windowEnd&&t.state.createdAt<n.value.windowEnd.oldestMessageTs)return n;if(Object.hasOwnProperty.call(n.value.stores,t.state.id))return n;const r=XT({},n.value.stores),i=new QS(e,this.conversationId,t.state,this.realtimeClient);r[t.state.id]=i;const o=t.state.referencedMessageId;let s;null===o?s=null:o in r?s=r[o]:(s=new QS(e,this.conversationId,o,this.realtimeClient),r[o]=s);const a=new ny(e,t.state.createdAt,i,s),u=[...n.value.inWindow,a];u.sort(((e,t)=>t.createdAt-e.createdAt));const l=u[0].messageId===t.messageId?e:n.value.lastMessageChanged;return aS({lastChanged:e,lastMessageChanged:l,stores:r,inWindow:u,windowEnd:n.value.windowEnd})}))}messageEdited(e,t){this.mutate(e,(n=>{var r;return null===n.value.stores?(console.warn("[TalkJS] Received a 'message.edited' event for a nonexistent conversation."),n):(null==(r=n.value.stores[t.messageId])||r.messageEdited(e,t),n)}))}messageDeleted(e,t){this.mutate(e,(n=>{if(null===n.value.stores)return console.warn("[TalkJS] Received a 'message.deleted' event for a conversation that we thought didn't exist."),n;if(Object.values(n.value.stores).forEach((n=>n.messageDeleted(e,t))),void 0===n.value.stores[t.messageId])return n;const r=XT({},n.value.stores);delete r[t.messageId];const i=n.value.inWindow.filter((e=>e.messageId!==t.messageId));if(t.newLastMessage&&0===i.length){const n=new QS(e,this.conversationId,t.newLastMessage,this.realtimeClient);r[n.messageId]=n;const o=t.newLastMessage.referencedMessageId;let s;null===o?s=null:o in r?s=r[o]:(s=new QS(e,this.conversationId,o,this.realtimeClient),r[o]=s);const a=new ny(e,t.newLastMessage.createdAt,n,s);i.push(a)}const o=void 0!==t.newLastMessage?e:n.value.lastMessageChanged;return aS({lastChanged:e,lastMessageChanged:o,stores:r,inWindow:i,windowEnd:n.value.windowEnd})}))}conversationCleared(e,t){this.mutate(e,(t=>{var n;return 0===(null==(n=t.value.inWindow)?void 0:n.length)&&null===t.value.windowEnd?t:(this.teardownNested(t.value),aS({lastChanged:e,lastMessageChanged:e,stores:{},inWindow:[],windowEnd:null}))}))}sideCreated(e,t){const n=this.fetchInitial(e);this.mutate(e,(e=>null!==e.value.stores?(n.then((e=>{e.ok&&this.teardownNested(e.value)})),e):n))}sideDeleted(e,t){this.mutate(e,(t=>null===t.value.stores?t:(this.teardownNested(t.value),aS({lastChanged:e,lastMessageChanged:e,stores:null,inWindow:null,windowEnd:null}))))}getMessageFromCache(e){return JT(this,null,(function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return uS("NOT_IN_CACHE");if(null===t.value.stores)return uS("NOT_IN_CACHE");const n=t.value.stores[e];return void 0===n?uS("NOT_IN_CACHE"):n.getFromCache()}))}}function iy(e){return JT(this,arguments,(function*({cursor:e,realtimeClient:t,conversationId:n,count:r}){const i={limit:r,cursor:e},o=yield t.call("GET",["me","conversations",n,"messages"],i,{bypassCache:!0});if(o.ok){const{data:e,cursor:t}=o.value.data;return aS({messages:e,nextCursor:t})}return!o.ok&&"server"===o.where&&404===o.value.status||!o.ok&&"server"===o.where&&403===o.value.status&&"NOT_A_PARTICIPANT"===o.value.errorCode?aS({messages:null,nextCursor:null}):o}))}function oy({seq:e,prevState:t,messages:n,cursor:r,conversationId:i,realtimeClient:o}){var s,a,u,l;const c=t?XT({},t.stores):{};for(const p of n)if(void 0===c[p.id]){const t=new QS(e,i,p,o);c[t.messageId]=t}for(const p of n){const t=p.referencedMessageId;if(t&&void 0===c[t]){const n=new QS(e,i,t,o);c[n.messageId]=n}}const d=t?[...t.inWindow]:[];for(const p of n)d.push(new ny(e,p.createdAt,c[p.id],p.referencedMessageId?c[p.referencedMessageId]:null));d.sort(((e,t)=>t.createdAt-e.createdAt));const h=(null==(a=null==(s=null==t?void 0:t.inWindow)?void 0:s[0])?void 0:a.messageId)===(null==(u=null==d?void 0:d[0])?void 0:u.messageId)&&null!=(l=null==t?void 0:t.lastMessageChanged)?l:e;return aS(null===r?{lastChanged:e,lastMessageChanged:h,stores:c,inWindow:d,windowEnd:null}:{lastChanged:e,lastMessageChanged:h,stores:c,inWindow:d,windowEnd:{cursor:r,oldestMessageTs:n[n.length-1].createdAt}})}class sy extends PS{constructor(e,t,n,r,i){super(e,r,i),this.convDataStore=t,this.realtimeClient=n,this.unsubscribeDebounceMs=0}fetchInitial(e){return JT(this,null,(function*(){return aS({lastChanged:e,store:this.convDataStore})}))}teardownNested(e){e.store.unsubscribe()}anyChildChanged(e,t,n){return JT(this,null,(function*(){return n.store.store.changedBetween(e,t)}))}equal(e,t){return!0}loadNested(e,t){return JT(this,null,(function*(){return t.store.store.getDeep(e)}))}getFromCache(){return JT(this,null,(function*(){return this.convDataStore.store.getFromCache()}))}}function ay(e,t){for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(e[n],n)}function uy(e,t){return function(e){let n={};return ay(e,((e,r)=>{const[i,o]=(([e,n])=>[e,t(n,e)])([r,e]);n[i]=o})),n}(e)}class ly extends PS{constructor(e,t,n,r,i){super(e,r,i),this.conversationId=t,this.realtimeClient=n,this.unsubscribeDebounceMs=1e4}fetchInitial(e){return JT(this,null,(function*(){const t=yield this.realtimeClient.call("GET",["me","conversations",this.conversationId,"typing"],{},{bypassCache:!0});if(!t.ok&&"server"===t.where&&404===t.value.status)return aS({data:null,lastChanged:e});if(!t.ok&&"server"===t.where&&403===t.value.status&&"NOT_A_PARTICIPANT"===t.value.errorCode)return aS({data:null,lastChanged:e});if(!t.ok)return t;const n=t.value.data;return n.many?aS({data:{usersTyping:null,many:!0},userSubscriptions:{},lastChanged:e}):aS({data:n,userSubscriptions:uy(n.usersTyping,((e,t)=>this.realtimeClient.internalSubscribe(["users",t]))),lastChanged:e})}))}equal(e,t){return LS(e.data,t.data)}loadNested(e,t){return JT(this,null,(function*(){if(null===t.data)return aS({snapshot:null,lastChanged:t.lastChanged});if(t.data.many)return aS({snapshot:{many:!0},lastChanged:t.lastChanged});const n=Object.entries(t.data.usersTyping).sort((([e,t],[n,r])=>t-r)).map((([e,t])=>e)).map((n=>t.userSubscriptions[n].store.getDeep(e))),r=yield Promise.all(n),i=r.find((e=>!e.ok));if(i)return i;const o=r.map((e=>e.value)),s=o.map((e=>e.snapshot)),a=o.map((e=>e.lastChanged));return aS({snapshot:{users:s,many:!1},lastChanged:Math.max(t.lastChanged,...a)})}))}typingAvailable(e,t){this.mutate(e,(()=>aS({data:t.state,userSubscriptions:t.state.many?{}:uy(t.state.usersTyping,((e,t)=>this.realtimeClient.internalSubscribe(["users",t]))),lastChanged:e})))}typingChanged(e,t){this.mutate(e,(n=>{if(null===n.value.data)return n;if(void 0===t.diff.many){if(!0===n.value.data.many)return n;const r=XT({},n.value.data.usersTyping),i=XT({},n.value.userSubscriptions);return ay(t.diff.usersTyping,((e,t)=>{var n;"number"==typeof e?(r[t]=e,i[t]=this.realtimeClient.internalSubscribe(["users",t])):null===e&&(delete r[t],null==(n=i[t])||n.unsubscribe(),delete i[t])})),aS({data:{usersTyping:r,many:!1},userSubscriptions:i,lastChanged:e})}if(!0===t.diff.many)return n.value.data.many?n:aS({data:{usersTyping:null,many:!0},userSubscriptions:{},lastChanged:e});if(!1===t.diff.many){if(!1===n.value.data.many)return n;const r=uy(t.diff.usersTyping,((e,t)=>this.realtimeClient.internalSubscribe(["users",t])));return aS({data:t.diff,userSubscriptions:r,lastChanged:e})}throw t.diff,"Unreachable"}))}sideDeleted(e,t){this.mutate(e,(t=>null===t.value.data?t:aS({data:null,lastChanged:e})))}teardownNested(e){e.data&&ay(e.userSubscriptions,(e=>e.unsubscribe()))}anyChildChanged(e,t,n){return JT(this,null,(function*(){var r;if(null===n.data)return!1;for(const i in n.userSubscriptions){const o=n.userSubscriptions[i];if(!0===(yield null==(r=null==o?void 0:o.store)?void 0:r.changedBetween(e,t)))return!0}return!1}))}}class cy extends BS{constructor(e,t,n,r){super(e),this.conversationId=t,this.participantData=n,this.realtimeClient=r}fetchInitial(e){return JT(this,null,(function*(){return aS({lastChanged:e,user:this.realtimeClient.internalSubscribe(["users",this.participantData.id]),data:this.participantData})}))}refetch(e){throw"Do not call refetch on participant data stores, it can return outdated data. Destroy and remake them instead"}equal(e,t){var n,r,i,o;return(null==(r=null==(n=e.user)?void 0:n.store)?void 0:r.userId)===(null==(o=null==(i=t.user)?void 0:i.store)?void 0:o.userId)&&LS(e.data,t.data)}teardownNested(e){var t;null==(t=e.user)||t.unsubscribe()}anyChildChanged(e,t,n){return JT(this,null,(function*(){var r;const i=null==(r=n.user)?void 0:r.store;return!0===(yield null==i?void 0:i.changedBetween(e,t))}))}loadNested(e,t){return JT(this,null,(function*(){if(null===t.data)return aS({snapshot:null});const n=yield t.user.store.getDeep(e);if(!1===n.ok)return n;const r=n.value.snapshot;return aS({snapshot:this.realtimeClient.createParticipantSnapshotPreloaded(t.data,r)})}))}participantEdited(e,t){this.mutate(e,(n=>null===n.value.data?n:aS({lastChanged:e,user:n.value.user,data:{id:n.value.data.id,access:wS(n.value.data.access,t.diff.access),notify:wS(n.value.data.notify,t.diff.notify),joinedAt:n.value.data.joinedAt}})))}participantDeleted(e,t){this.mutate(e,(t=>null===t.value.data?t:(this.teardownNested(t.value),aS({lastChanged:e,user:null,data:null}))))}getFromCache(){return JT(this,null,(function*(){const e=yield this.mostRecentState.resultPromise;return e.ok?null===e.value.data?lS({status:404,errorCode:"PARTICIPANT_NOT_FOUND",reasons:["No participant with that ID exists"]}):aS({status:200,data:e.value.data}):uS("NOT_IN_CACHE")}))}}class dy extends PS{constructor(e,t,n,r,i){super(e,r,i),this.conversationId=t,this.realtimeClient=n,this.unsubscribeDebounceMs=1e3,this.pendingLoadMore=void 0}fetchInitial(e){return JT(this,null,(function*(){const t=yield hy({realtimeClient:this.realtimeClient,conversationId:this.conversationId,count:10});return t.ok?null===t.value.participants?aS({lastChanged:e,stores:null,inWindow:null,windowEnd:null}):py({seq:e,participants:t.value.participants,cursor:t.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):t}))}teardownNested(e){if(e.stores){const t=uS("TERMINATED");Object.values(e.stores).forEach((e=>e.setError(t)))}}anyChildChanged(e,t,n){return JT(this,null,(function*(){for(const r in n.stores){const i=n.stores[r];if(!0===(yield null==i?void 0:i.changedBetween(e,t)))return!0}return!1}))}equal(e,t){return null===e.stores&&null===t.stores||null!==e.stores&&null!==t.stores&&!!LS(Object.keys(e.stores),Object.keys(t.stores))&&LS(e.windowEnd,t.windowEnd)}loadNested(e,t){return JT(this,null,(function*(){if(null===t.stores)return aS({snapshot:null,loadedAll:!0});const n=yield Promise.all(Object.values(t.stores).map((t=>t.getDeep(e)))),r=n.find((e=>!e.ok));if(r)return r;const i=n.filter((e=>null!==e.value.snapshot)).map((e=>e.value.snapshot));return i.sort(((e,t)=>t.joinedAt-e.joinedAt)),aS({snapshot:i,loadedAll:null===t.windowEnd})}))}loadMore(e){return JT(this,null,(function*(){if(this.pendingLoadMore)return this.pendingLoadMore;const t=oS();this.pendingLoadMore=t.promise,yield this._loadMoreParticipants(e),t.resolve(),this.pendingLoadMore=void 0}))}_loadMoreParticipants(e=10){return JT(this,null,(function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return;if(null===t.value.windowEnd)return;const n=t.value.windowEnd.cursor,r=yield hy({count:e,cursor:n,conversationId:this.conversationId,realtimeClient:this.realtimeClient}),i=this.getLoadMoreSeq();this.mutate(i,(e=>null===e.value.windowEnd||n!==e.value.windowEnd.cursor?e:r.ok?null===r.value.participants?(console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."),e):py({seq:i,prevStores:e.value.stores,participants:r.value.participants,cursor:r.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):r)),yield this.emitMutex.runExclusive((()=>this.emit(i)))}))}participantCreated(e,t){this.mutate(e,(n=>{if(null===n.value.stores)return console.warn("[TalkJS] Received a 'participant.created' event for a nonexistent conversation."),n;if(n.value.windowEnd&&t.state.joinedAt<n.value.windowEnd.oldestParticipantTs)return n;if(Object.hasOwnProperty.call(n.value.stores,t.state.id))return n;const r=XT({},n.value.stores),i=new cy(e,this.conversationId,t.state,this.realtimeClient);return r[t.state.id]=i,aS({lastChanged:e,stores:r,windowEnd:n.value.windowEnd})}))}participantEdited(e,t){this.mutate(e,(n=>{var r;return null===n.value.stores?(console.warn("[TalkJS] Received a 'participant.edited' event for a nonexistent conversation."),n):(null==(r=n.value.stores[t.userId])||r.participantEdited(e,t),n)}))}participantDeleted(e,t){this.mutate(e,(n=>{if(null===n.value.stores)return console.warn("[TalkJS] Received a 'participant.deleted' event for a conversation that we thought didn't exist."),n;const r=n.value.stores[t.userId];if(void 0===r)return n;r.participantDeleted(e,t);const i=XT({},n.value.stores);return delete i[t.userId],aS({lastChanged:e,stores:i,windowEnd:n.value.windowEnd})}))}sideCreated(e,t){const n=this.fetchInitial(e);this.mutate(e,(e=>null!==e.value.stores?(n.then((e=>{e.ok&&this.teardownNested(e.value)})),e):n))}sideDeleted(e,t){this.mutate(e,(t=>null===t.value.stores?t:(this.teardownNested(t.value),aS({lastChanged:e,stores:null,inWindow:null,windowEnd:null}))))}getParticipantFromCache(e){return JT(this,null,(function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return uS("NOT_IN_CACHE");if(null===t.value.stores)return uS("NOT_IN_CACHE");const n=t.value.stores[e];return void 0===n?uS("NOT_IN_CACHE"):n.getFromCache()}))}}function hy(e){return JT(this,arguments,(function*({cursor:e,realtimeClient:t,conversationId:n,count:r}){const i={limit:r,cursor:e},o=yield t.call("GET",["me","conversations",n,"participants"],i,{bypassCache:!0});if(o.ok){const{data:e,cursor:t}=o.value.data;return aS({participants:e,nextCursor:t})}return!o.ok&&"server"===o.where&&404===o.value.status||!o.ok&&"server"===o.where&&403===o.value.status&&"NOT_A_PARTICIPANT"===o.value.errorCode?aS({participants:null,nextCursor:null}):o}))}function py({seq:e,prevStores:t,participants:n,cursor:r,conversationId:i,realtimeClient:o}){const s=t?XT({},t):{};for(const a of n)if(void 0===s[a.id]){const t=new cy(e,i,a,o);s[a.id]=t}return aS(null===r?{lastChanged:e,stores:s,windowEnd:null}:{lastChanged:e,stores:s,windowEnd:{cursor:r,oldestParticipantTs:n[n.length-1].joinedAt}})}class fy extends PS{constructor(e,t,n,r,i){super(e,r,i),this.getConvDataStore=t,this.realtimeClient=n,this.unsubscribeDebounceMs=1e3,this.pendingLoadMore=void 0}fetchInitial(e){return JT(this,null,(function*(){const t=yield my({realtimeClient:this.realtimeClient,count:20});return t.ok?null===t.value.conversations?aS({lastChanged:e,stores:null,windowEnd:null}):Ey({seq:e,conversations:t.value.conversations,cursor:t.value.nextCursor,getConvDataStore:this.getConvDataStore}):t}))}teardownNested(e){null!==e.stores&&Object.values(e.stores).forEach((e=>e.unsubscribe()))}anyChildChanged(e,t,n){return JT(this,null,(function*(){var r;for(const i in n.stores){const o=n.stores[i];if(!0===(yield null==(r=null==o?void 0:o.store)?void 0:r.changedBetween(e,t)))return!0}return!1}))}equal(e,t){return null===e.stores&&null===t.stores||null!==e.stores&&null!==t.stores&&!!LS(Object.keys(e.stores),Object.keys(t.stores))&&LS(e.windowEnd,t.windowEnd)}loadNested(e,t){return JT(this,null,(function*(){if(null===t.stores)return aS({snapshot:[],loadedAll:!0});const n=yield Promise.all(Object.values(t.stores).map((t=>t.store.getDeep(e)))),r=n.find((e=>!e.ok));if(r)return r;const i=n.filter((e=>null!==e.value.snapshot)).map((e=>e.value.snapshot));return i.sort(((e,t)=>{var n,r,i,o;const s=null!=(r=null==(n=e.lastMessage)?void 0:n.createdAt)?r:e.joinedAt;return(null!=(o=null==(i=t.lastMessage)?void 0:i.createdAt)?o:t.joinedAt)-s})),aS({snapshot:i,loadedAll:null===t.windowEnd})}))}loadMore(e){return JT(this,null,(function*(){if(this.pendingLoadMore)return this.pendingLoadMore;const t=oS();this.pendingLoadMore=t.promise,yield this._loadMoreConversations(e),t.resolve(),this.pendingLoadMore=void 0}))}_loadMoreConversations(e=20){return JT(this,null,(function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return;if(null===t.value.windowEnd)return;const n=t.value.windowEnd.cursor,r=yield my({count:e,cursor:n,realtimeClient:this.realtimeClient}),i=this.getLoadMoreSeq();this.mutate(i,(e=>null===e.value.windowEnd||n!==e.value.windowEnd.cursor?e:r.ok?null===r.value.conversations?(console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."),e):Ey({seq:i,prevStores:e.value.stores,conversations:r.value.conversations,cursor:r.value.nextCursor,getConvDataStore:this.getConvDataStore}):r)),yield this.emitMutex.runExclusive((()=>this.emit(i)))}))}getConvFromCache(e){return JT(this,null,(function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return uS("NOT_IN_CACHE");if(null===t.value.stores)return lS({status:404,errorCode:"USER_NOT_FOUND",reasons:["No user with that ID exists"]});const n=t.value.stores[e];return void 0===n?uS("NOT_IN_CACHE"):n.store.getFromCache()}))}userCreated(e,t){this.mutate(e,(e=>null!==e.value.stores?e:aS({lastChanged:e.value.lastChanged,stores:{},windowEnd:null})))}sideCreated(e,t){const n=this.getConvDataStore(t.state);this.mutate(e,(r=>Object.hasOwnProperty.call(r.value.stores,t.conversationId)?(n.unsubscribe(),r):aS({lastChanged:e,stores:KT(XT({},r.value.stores),{[t.conversationId]:n}),windowEnd:r.value.windowEnd})))}sideDeleted(e,t){this.mutate(e,(n=>{var r;if(!Object.hasOwnProperty.call(n.value.stores,t.conversationId))return n;const i=XT({},n.value.stores);return null==(r=i[t.conversationId])||r.unsubscribe(),delete i[t.conversationId],aS({lastChanged:e,stores:i,windowEnd:n.value.windowEnd})}))}sideEdited(e,t){const n=t.diff.lastMessageAt;void 0!==n&&this.mutate(e,(r=>{var i;if(null===r.value.stores)return console.warn("[TalkJS] Received a 'side.edited' event when we thought your user didn't exist."),r;if(null===r.value.windowEnd)return r;const o=Object.hasOwnProperty.call(r.value.stores,t.conversationId);if(o&&n<r.value.windowEnd.oldestMessageTs){const n=XT({},r.value.stores);return null==(i=n[t.conversationId])||i.unsubscribe(),delete n[t.conversationId],aS({lastChanged:e,stores:n,windowEnd:r.value.windowEnd})}if(!o&&n>=r.value.windowEnd.oldestMessageTs){const n=this.getConvDataStore(t.conversationId);return aS({lastChanged:e,stores:KT(XT({},r.value.stores),{[t.conversationId]:n}),windowEnd:r.value.windowEnd})}return r}))}}function my(e){return JT(this,arguments,(function*({cursor:e,realtimeClient:t,count:n}){const r={limit:n,cursor:e},i=yield t.call("GET",["me","conversations"],r,{bypassCache:!0});if(i.ok){const{data:e,cursor:t}=i.value.data;return aS({conversations:e,nextCursor:t})}return i.ok||"server"!==i.where||404!==i.value.status||"USER_NOT_FOUND"!==i.value.errorCode?i:aS({conversations:null,nextCursor:null})}))}function Ey({seq:e,prevStores:t,conversations:n,cursor:r,getConvDataStore:i}){const o=t?XT({},t):{};for(const s of n)void 0===o[s.id]&&(o[s.id]=i(s));return aS(null===r?{lastChanged:e,stores:o,windowEnd:null}:{lastChanged:e,stores:o,windowEnd:{cursor:r,oldestMessageTs:Math.min(...n.map((e=>e.lastMessageAt)))}})}class gy extends PS{constructor(e,t,n,r,i){super(e,r,i),this.conversation=t,this.realtimeClient=n,this.unsubscribeDebounceMs=5e3}get conversationId(){return"string"==typeof this.conversation?this.conversation:this.conversation.id}fetchInitial(e){return JT(this,null,(function*(){const t=this.realtimeClient.internalSubscribe(["me","conversations",this.conversationId,"messages"]);if("object"==typeof this.conversation)return aS({lastChanged:e,snapshot:this.conversation,messageWindowStore:t});const n=yield this.realtimeClient.call("GET",["me","conversations",this.conversationId],{},{bypassCache:!0});let r;if(n.ok)r=n.value.data;else if("server"===n.where&&404===n.value.status)r=null;else{if("server"!==n.where||403!==n.value.status||"NOT_A_PARTICIPANT"!==n.value.errorCode)return t.unsubscribe(),n;r=null}return aS({lastChanged:e,snapshot:r,messageWindowStore:t})}))}teardownNested(e){var t;null==(t=e.messageWindowStore)||t.unsubscribe()}anyChildChanged(e,t,n){return JT(this,null,(function*(){return!0===(yield n.messageWindowStore.store.lastMessageChangedBetween(e,t))}))}equal(e,t){return LS(e.snapshot,t.snapshot)}loadNested(e,t){return JT(this,null,(function*(){var n;if(!t.snapshot)return aS({snapshot:null,loadedAll:!0});const r=yield t.messageWindowStore.store.getDeep(e);if(!r.ok)return r;const i=r.value.snapshot,o=null!=(n=null==i?void 0:i[0])?n:null;return aS({snapshot:KT(XT({},t.snapshot),{lastMessage:o})})}))}participantEdited(e,t){this.mutate(e,(n=>null===n.value.snapshot?(console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."),n):aS({lastChanged:e,snapshot:_y(n.value.snapshot,t.diff),messageWindowStore:n.value.messageWindowStore})))}conversationEdited(e,t){this.mutate(e,(n=>null===n.value.snapshot?(console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."),n):aS({lastChanged:e,snapshot:_y(n.value.snapshot,t.diff),messageWindowStore:n.value.messageWindowStore})))}sideEdited(e,t){this.mutate(e,(n=>null===n.value.snapshot?(console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."),n):aS({lastChanged:e,snapshot:_y(n.value.snapshot,t.diff),messageWindowStore:n.value.messageWindowStore})))}sideCreated(e,t){this.mutate(e,(n=>n.value.snapshot?n:aS({lastChanged:e,snapshot:t.state,messageWindowStore:n.value.messageWindowStore})))}sideDeleted(e,t){this.mutate(e,(t=>null===t.value.snapshot?t:aS({lastChanged:e,snapshot:null,messageWindowStore:t.value.messageWindowStore})))}getFromCache(){return JT(this,null,(function*(){const e=yield this.mostRecentState.resultPromise;return e.ok&&e.value.snapshot?aS({status:200,data:e.value.snapshot}):uS("NOT_IN_CACHE")}))}}function _y(e,t){const n=t;return{id:e.id,createdAt:e.createdAt,subject:wS(e.subject,n.subject),photoUrl:wS(e.photoUrl,n.photoUrl),welcomeMessages:wS(e.welcomeMessages,n.welcomeMessages),custom:kS(e.custom,n.custom),lastMessageAt:wS(e.lastMessageAt,n.lastMessageAt),unreadMessageCount:wS(e.unreadMessageCount,n.unreadMessageCount),isUnread:wS(e.isUnread,n.isUnread),access:wS(e.access,n.access),notify:wS(e.notify,n.notify),readUntil:wS(e.readUntil,n.readUntil),everyoneReadUntil:wS(e.everyoneReadUntil,n.everyoneReadUntil),joinedAt:e.joinedAt}}class Ay extends PS{constructor(e,t,n,r,i){super(e,r,i),this.userId=t,this.realtimeClient=n,this.unsubscribeDebounceMs=1e3}fetchInitial(e){return JT(this,null,(function*(){const t=this.realtimeClient.internalSubscribe(["users",this.userId]),n=yield this.realtimeClient.call("GET",["users",this.userId,"online"],{},{bypassCache:!0});return n.ok||"server"!==n.where||404!==n.value.status||"USER_NOT_FOUND"!==n.value.errorCode?n.ok?aS({lastChanged:e,user:t,data:n.value.data}):n:aS({lastChanged:e,user:t,data:null})}))}equal(e,t){return LS(e.data,t.data)}teardownNested(e){e.user.unsubscribe()}anyChildChanged(e,t,n){return JT(this,null,(function*(){return n.user.store.changedBetween(e,t)}))}loadNested(e,t){return JT(this,null,(function*(){const n=yield t.user.store.getDeep(e);if(!n.ok)return n;const r=n.value.snapshot;return null===t.data||null===r?aS({snapshot:null}):aS({snapshot:XT({user:r},t.data)})}))}userCreated(e,t){const n=this.fetchInitial(e);this.mutate(e,(e=>null!==e.value.data?(n.then((e=>{e.ok&&this.teardownNested(e.value)})),e):n))}userOnlineChanged(e,t){this.mutate(e,(n=>null===n.value.data?n:aS({lastChanged:e,user:n.value.user,data:t.diff})))}getFromCache(){return JT(this,null,(function*(){const e=yield this.mostRecentState.resultPromise;if(!e.ok)return uS("NOT_IN_CACHE");if(null===e.value.data)return lS({status:404,errorCode:"USER_NOT_FOUND",reasons:["No user with that ID exists"]});const t=e.value,n=qT(t,["user"]);return aS({status:200,data:XT({},n.data)})}))}}class Dy{constructor(e,t,n){this.realtimeClient=n,this.convDataStores={},this.storeMap={},this.emitMutex=new xS,this.seqOffset=0,this.seqInThisConnection=0,this.refetchOnNextNetworkLoss=!0,this.connection=new RS(e,t,{onUpstreamRestarting:()=>{this.refetchOnNextNetworkLoss=!1},onReady:()=>{this.refetchOnNextNetworkLoss=!0},onResubscribeSent:()=>{if(this.seqOffset+=this.seq,this.seqInThisConnection=0,this.refetchOnNextNetworkLoss){this.seqOffset++;const e=this.seq;this.refetchAll(e),this.emitAll(e)}},onResubscribeError:(e,t)=>{var n;null==(n=this.storeMap[vy(e)])||n.setError(t)},onPublish:(e,t)=>{this.seqInThisConnection=e;const n=this.seq;for(const r of t)this.handlePublish(n,r);this.emitAll(n)}})}get seq(){return this.seqOffset+this.seqInThisConnection}refetchAll(e){Object.values(this.storeMap).forEach((t=>null==t?void 0:t.refetch(e)))}emitAll(e){return this.emitMutex.runExclusive((()=>JT(this,null,(function*(){const t=Object.values(this.storeMap).map((t=>null==t?void 0:t.emit(e)));yield Promise.all(t)}))))}handlePublish(e,t){var n,r,i,o,s,a,u,l,c,d,h,p,f,m,E,g,_,A,D,v,O,T,S,y,C,N,b;switch(t.type){case"user.created":return null==(n=this.storeMap[`/users/${t.userId}`])||n.userCreated(e,t),null==(r=this.storeMap["/me/conversations"])||r.userCreated(e,t),void(null==(i=this.storeMap[`/users/${t.userId}/online`])||i.userCreated(e,t));case"user.edited":return void(null==(o=this.storeMap[`/users/${t.userId}`])||o.userEdited(e,t));case"side.created":return null==(s=this.convDataStores[t.conversationId])||s.sideCreated(e,t),null==(a=this.storeMap[`/me/conversations/${t.conversationId}/messages`])||a.sideCreated(e,t),null==(u=this.storeMap[`/me/conversations/${t.conversationId}/participants`])||u.sideCreated(e,t),void(null==(l=this.storeMap["/me/conversations"])||l.sideCreated(e,t));case"side.edited":return null==(c=this.convDataStores[t.conversationId])||c.sideEdited(e,t),void(null==(d=this.storeMap["/me/conversations"])||d.sideEdited(e,t));case"side.deleted":return null==(h=this.convDataStores[t.conversationId])||h.sideDeleted(e,t),null==(p=this.storeMap[`/me/conversations/${t.conversationId}/messages`])||p.sideDeleted(e,t),null==(f=this.storeMap[`/me/conversations/${t.conversationId}/participants`])||f.sideDeleted(e,t),null==(m=this.storeMap[`/me/conversations/${t.conversationId}/typing`])||m.sideDeleted(e,t),void(null==(E=this.storeMap["/me/conversations"])||E.sideDeleted(e,t));case"conversation.edited":return void(null==(g=this.convDataStores[t.conversationId])||g.conversationEdited(e,t));case"message.created":return void(null==(_=this.storeMap[`/me/conversations/${t.conversationId}/messages`])||_.messageCreated(e,t));case"message.edited":return void(null==(A=this.storeMap[`/me/conversations/${t.conversationId}/messages`])||A.messageEdited(e,t));case"message.deleted":return void(null==(D=this.storeMap[`/me/conversations/${t.conversationId}/messages`])||D.messageDeleted(e,t));case"typing.available":return void(null==(v=this.storeMap[`/me/conversations/${t.conversationId}/typing`])||v.typingAvailable(e,t));case"typing.changed":return void(null==(O=this.storeMap[`/me/conversations/${t.conversationId}/typing`])||O.typingChanged(e,t));case"conversation.cleared":return void(null==(T=this.storeMap[`/me/conversations/${t.conversationId}/messages`])||T.conversationCleared(e,t));case"participant.edited":return null==(S=this.convDataStores[t.conversationId])||S.participantEdited(e,t),void(null==(y=this.storeMap[`/me/conversations/${t.conversationId}/participants`])||y.participantEdited(e,t));case"participant.created":return void(null==(C=this.storeMap[`/me/conversations/${t.conversationId}/participants`])||C.participantCreated(e,t));case"participant.deleted":return void(null==(N=this.storeMap[`/me/conversations/${t.conversationId}/participants`])||N.participantDeleted(e,t));case"user.online.changed":return void(null==(b=this.storeMap[`/users/${t.userId}/online`])||b.userOnlineChanged(e,t))}}call(e,t,n,r){return JT(this,null,(function*(){if(!r.bypassCache&&"GET"===e){const e=vy(t);if(e in this.storeMap){const t=e,n=this.storeMap[t];if(n&&"getFromCache"in n){const e=yield n.getFromCache();if("NOT_IN_CACHE"!==e.value)return e}}else if(eS(t,["me","conversations","*","messages","*"])){const e=this.storeMap[`/me/conversations/${t[2]}/messages`];if(e){const n=yield e.getMessageFromCache(t[4]);if("NOT_IN_CACHE"!==n.value)return n}}else if(eS(t,["me","conversations","*","participants","*"])){const e=this.storeMap[`/me/conversations/${t[2]}/participants`];if(e){const n=yield e.getParticipantFromCache(t[4]);if("NOT_IN_CACHE"!==n.value)return n}}else if(eS(t,["me","conversations","*"])){const e=this.storeMap["/me/conversations"];if(e){const n=yield e.getConvFromCache(t[2]);if("NOT_IN_CACHE"!==n.value)return n}}}return this.connection.call(e,t,n)}))}subscribe(e,t){const n=this.getOrCreateStore(e),r=oS(),i=oS();r.promise.catch((()=>{})),i.promise.catch((()=>{}));const o={state:{type:"pending",latestSnapshot:void 0},connected:r.promise,terminated:i.promise,loadMore:e=>JT(this,null,(function*(){"loadMore"in n&&(yield n.loadMore(e))})),unsubscribe:()=>{}},s=n.listen((n=>{if(n.ok){const e=!("loadedAll"in n.value)||n.value.loadedAll,i={type:"active",latestSnapshot:n.value.snapshot,loadedAll:e};o.state=i,null==t||t(n.value.snapshot,e),r.resolve(i)}else if("pending"===o.state.type||"active"===o.state.type){if("server"===n.where){const t={type:"error",error:new Error(QT(`Subscribe to ${e.join("/")}`,n.value))};return o.state=t,i.resolve(t),void r.reject("Subscription encountered an error during initial connection")}if("SESSION_DESTROYED"===n.value){const e={type:"error",error:new Error("Session was destroyed causing all subscriptions to be terminated")};return o.state=e,i.resolve(e),void r.reject("Subscription encountered an error during initial connection")}if("UNSUBSCRIBED"===n.value)return;if("TERMINATED"===n.value)return;n.value}}));return o.unsubscribe=()=>{if("pending"===o.state.type||"active"===o.state.type){s();const e={type:"unsubscribed"};o.state=e,i.resolve(e),r.reject("Subscription was unsubscribed before connecting")}},o}getOrCreateStore(e){const t=vy(e);if(t in this.storeMap)return this.storeMap[t];this.connection.subscribe(e).then((e=>{e.ok||n.setError(e)}));const n=this.instantiateStore(e,(()=>{delete this.storeMap[t],this.connection.unsubscribe(e)}));return this.storeMap[t]=n,n}destroy(){this.storeMap={},this.convDataStores={},this.connection.destroy()}isConnected(){return this.connection.isConnected()}instantiateStore(e,t){if(eS(e,["users","*"]))return new HS(this.seq,e[1],this.realtimeClient,this.emitMutex,t);if(eS(e,["me","conversations","*"]))return new sy(this.seq,this.subscribeConvData(e[2]),this.realtimeClient,this.emitMutex,t);if(eS(e,["me","conversations","*","messages"]))return new ry(this.seq,e[2],this.realtimeClient,this.emitMutex,t);if(eS(e,["me","conversations","*","participants"]))return new dy(this.seq,e[2],this.realtimeClient,this.emitMutex,t);if(eS(e,["me","conversations","*","typing"]))return new ly(this.seq,e[2],this.realtimeClient,this.emitMutex,t);if(eS(e,["me","conversations"]))return new fy(this.seq,(e=>this.subscribeConvData(e)),this.realtimeClient,this.emitMutex,t);if(eS(e,["users","*","online"]))return new Ay(this.seq,e[1],this.realtimeClient,this.emitMutex,t);throw"Unreachable"}subscribeConvData(e){const t="string"==typeof e?e:e.id;if(Object.hasOwnProperty.call(this.convDataStores,t)){const e=this.convDataStores[t];return{store:e,unsubscribe:e.registerInternalSubscription()}}const n=new gy(this.seq,e,this.realtimeClient,this.emitMutex,(()=>{delete this.convDataStores[t]}));return this.convDataStores[t]=n,{store:n,unsubscribe:n.registerInternalSubscription()}}}function vy(e){return`/${e.join("/")}`}class Oy{constructor(e,t,n){this.userId=t,this.alive=!0,this.connection=new Dy(e,n,this),n.onTokenRefreshFailed((()=>{this.destroy()}))}call(e,t,n){return JT(this,arguments,(function*(e,t,n,r={}){return this.alive?this.connection.call(e,t,n,r):uS("SESSION_DESTROYED")}))}subscribe(e,t){return this.connection.subscribe(e,t)}internalSubscribe(e){const t=this.connection.getOrCreateStore(e);return{store:t,unsubscribe:t.registerInternalSubscription()}}destroy(){this.alive=!1,this.connection.destroy()}isConnected(){return this.connection.isConnected()}listMessages(e,t){return JT(this,null,(function*(){const n=yield this.call("GET",["me","conversations",e,"messages"],t);if(!n.ok)return Ty(n,"Listing messages in "+e);const r=n.value.data.data,i=yield Promise.all(r.map((t=>this.createMessageSnapshot(t,e)))),o=i.find((e=>!e.ok));return void 0===o||o.ok?aS(i.map((({value:e})=>e))):o}))}createConversationSnapshotPreloaded(e,t){return{id:e.id,subject:e.subject,photoUrl:e.photoUrl,welcomeMessages:e.welcomeMessages,custom:e.custom,createdAt:e.createdAt,joinedAt:e.joinedAt,lastMessageAt:e.lastMessageAt,unreadMessageCount:e.unreadMessageCount,isUnread:e.isUnread,access:e.access,notify:e.notify,lastMessage:t,readUntil:e.readUntil,everyoneReadUntil:e.everyoneReadUntil}}createUserSnapshot(e){return{id:e.id,name:e.name,custom:e.custom,locale:e.locale,photoUrl:e.photoUrl,role:e.role,welcomeMessage:e.welcomeMessage}}createParticipantSnapshotPreloaded(e,t){return{user:t,access:e.access,notify:e.notify,joinedAt:e.joinedAt}}createMessageSnapshot(e,t){return JT(this,null,(function*(){const n=null===e.senderId?Promise.resolve(aS(null)):this.getUser(e.senderId),r=null===e.referencedMessageId?Promise.resolve(aS(null)):this.getReferencedMessage(t,e.referencedMessageId),i=yield n;if(!i.ok)return i;const o=yield r;return o.ok?aS(this.createMessageSnapshotPreloaded(e,i.value,o.value)):o}))}getReferencedMessage(e,t){return JT(this,null,(function*(){const n=yield this.call("GET",["me","conversations",e,"messages",t],{});if(!n.ok&&"server"===n.where&&404===n.value.status)return aS(null);if(!n.ok&&"server"===n.where&&403===n.value.status&&"NOT_A_PARTICIPANT"===n.value.errorCode)return aS(null);if(!n.ok)return Ty(n,`Fetching referenced message ${t} in conversation ${e}`);const r=n.value.data,i=yield this.getUser(r.senderId);if(!i.ok)return i;const o=i.value;return aS(this.createReferencedMessageSnapshotPreloaded(r,o))}))}getUser(e){return JT(this,null,(function*(){const t=yield this.call("GET",["users",e],{includePrivateFields:!1});return t.ok||"server"!==t.where||404!==t.value.status?t.ok?aS(this.createUserSnapshot(t.value.data)):Ty(t,"Get user "+e):aS(null)}))}createMessageSnapshotPreloaded(e,t,n){return{id:e.id,type:e.type,sender:t,referencedMessage:n,custom:e.custom,createdAt:e.createdAt,editedAt:e.editedAt,origin:e.origin,content:e.content,reactions:ty(e.reactions),plaintext:JS(e.content,{})}}createReferencedMessageSnapshotPreloaded(e,t){return{id:e.id,type:e.type,sender:t,referencedMessageId:e.referencedMessageId,custom:e.custom,createdAt:e.createdAt,editedAt:e.editedAt,origin:e.origin,content:e.content,reactions:ty(e.reactions),plaintext:JS(e.content,{})}}}function Ty(e,t){return"server"===e.where?lS(KT(XT({},e.value),{operation:t})):e}function Sy(e,t){var n;if(t.ok)return t.value;throw"SESSION_DESTROYED"===t.value?new Error(`${e} failed because the session was destroyed`):new Error(QT(null!=(n=t.value.operation)?n:e,t.value))}class yy{constructor(e,t){this.id=e,this._realtimeClient=t}get brandedId(){return this.id}get(){return JT(this,null,(function*(){const e=yield this._realtimeClient.getUser(this.brandedId);return Sy("Get user "+this.id,e)}))}set(e){return JT(this,null,(function*(){null===e.role&&(e.role="default");const t="string"==typeof e.email?[e.email]:e.email,n="string"==typeof e.phone?[e.phone]:e.phone,r=yield this._realtimeClient.call("PUT",["users",this.brandedId],KT(XT({},e),{email:t,phone:n}));ZT("Set user "+this.id,r)}))}createIfNotExists(e){return JT(this,null,(function*(){void 0===e.role&&(e.role="default");const t="string"==typeof e.email?[e.email]:e.email,n="string"==typeof e.phone?[e.phone]:e.phone,r=yield this._realtimeClient.call("POST",["users",this.brandedId],KT(XT({},e),{email:t,phone:n}));(r.ok||"server"!==r.where||409!=r.value.status)&&ZT(`Create user ${this.id} if not exists`,r)}))}subscribe(e){return this._realtimeClient.subscribe(["users",this.brandedId],e)}subscribeOnline(e){return this._realtimeClient.subscribe(["users",this.brandedId,"online"],e)}}class Cy{constructor(e,t,n){this.userId=e,this.conversationId=t,this._realtimeClient=n}get brandedUserId(){return this.userId}get brandedConversationId(){return this.conversationId}get(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("GET",["me","conversations",this.brandedConversationId,"participants",this.brandedUserId],{}),t=yield this._realtimeClient.call("GET",["users",this.brandedUserId],{includePrivateFields:!1}),[n,r]=yield Promise.all([e,t]);if(!n.ok&&"server"===n.where&&404===n.value.status)return null;if(!r.ok&&"server"===r.where&&404===r.value.status)return null;const i=ZT(`Get participant ${this.userId} in conversation ${this.conversationId}`,n),o=ZT(`Get user ${this.userId}`,r),s=this._realtimeClient.createUserSnapshot(o);return this._realtimeClient.createParticipantSnapshotPreloaded(i,s)}))}set(){return JT(this,arguments,(function*(e={}){const t=yield this._realtimeClient.call("PUT",["conversations",this.brandedConversationId,"participants",this.brandedUserId],e);ZT(`Set participant ${this.userId} in conversation ${this.conversationId}`,t)}))}edit(){return JT(this,arguments,(function*(e={}){const t=yield this._realtimeClient.call("PATCH",["conversations",this.brandedConversationId,"participants",this.brandedUserId],e);ZT(`Edit participant ${this.userId} in conversation ${this.conversationId}`,t)}))}createIfNotExists(){return JT(this,arguments,(function*(e={}){const t=yield this._realtimeClient.call("POST",["conversations",this.brandedConversationId,"participants",this.brandedUserId],e);(t.ok||"server"!==t.where||409!==t.value.status)&&ZT(`Add participant ${this.userId} to conversation ${this.conversationId}`,t)}))}delete(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("DELETE",["conversations",this.brandedConversationId,"participants",this.brandedUserId],{});(e.ok||"server"!==e.where||404!==e.value.status)&&ZT(`Remove participant ${this.userId} from conversation ${this.conversationId}`,e)}))}}function Ny(e){const t="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";let n=0;const r=[],i=e===n;n=e;const o=new Array(8);for(let a=7;a>=0;a--)o[a]=t.charAt(e%64),e=Math.floor(e/64);if(0!==e)throw new Error("We should have converted the entire timestamp.");let s=o.join("");if(i){let e;for(e=11;e>=0&&63===r[e];e--)r[e]=0;r[e]++}else for(let a=0;a<12;a++)r[a]=Math.floor(64*Math.random());for(let a=0;a<12;a++)s+=t.charAt(r[a]);if(20!=s.length)throw new Error("Length should be 20.");return s}const by=(e,t,n=void 0)=>e.reduce(((e,r,i)=>e.concat((e=>{if("string"==typeof e)return t(e,n);switch(e.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return[{type:e.type,children:by(e.children,t,e.type)}];case"link":return[{type:e.type,url:e.url,children:by(e.children,t,e.type)}];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return[{type:e.type,action:e.action,params:e.params,children:by(e.children,t,e.type)}];case"mention":case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return[e]}})(r))),[]);function Iy(e,t){return n=>{const r=n;let i=0;const o=[];for(const s of YS(n,e)){s.index-i>0&&o.push(r.substring(i,s.index));const e=t(s);Array.isArray(e)?o.push(...e):o.push(e),i=s.index+s[0].length}return i<n.length&&o.push(n.substring(i)),o}}const Ry="’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var wy,ky=((wy=ky||{})[wy.italic=1]="italic",wy[wy.strikethrough=2]="strikethrough",wy[wy.bold=4]="bold",wy);const Ly=[0,1,2,3,4,5,6].map((e=>{const t=[];return 1&e||t.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/),2&e||t.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/),4&e||t.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/),new RegExp(t.map((e=>e.source)).join("|"),"g")})),xy={_:1,"*":4,"~":2};function My(e){return Fy(e,0)}function Fy(e,t=0){const n=Ly[t],r=n?function(e){const t=Iy(By.getOrCompute(e,(()=>new RegExp(`(?:^|[\\s${Ry}])(?:${e.source})(?=[\\s${Ry}]|$)`,"g"))),(e=>{const t=e[0][1],n=e[1]||e[2]||e[3]||e[4]||e[5]||e[6];return[" ",{type:ky[xy[t]],children:[n]}]}));return e=>{const[n,...r]=t(" "+e);return n.length>1&&r.unshift(n.substring(1)),r}}(n):()=>[e];return by(r(e),((e,n)=>"bold"===n||"italic"===n||"strikethrough"===n?Fy(e,t|ky[n]):[e]))}const By=function(){const e=function(){try{return new WeakMap}catch(e){const n={has:()=>!1,get:()=>{},set:()=>n};return n}}();return{getOrCompute(t,n){if(e.has(t))return e.get(t);const r=n();return e.set(t,r),r}}}();function Py(e,t){if(Array.prototype.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function Uy(e,t){for(var n=e.length-1;n>=0;n--)!0===t(e[n])&&e.splice(n,1)}function Hy(e){throw new Error("Unhandled case for value: '"+e+"'")}var jy=function(){function e(e){void 0===e&&(e={}),this.tagName="",this.attrs={},this.innerHTML="",this.whitespaceRegex=/\s+/,this.tagName=e.tagName||"",this.attrs=e.attrs||{},this.innerHTML=e.innerHtml||e.innerHTML||""}return e.prototype.setTagName=function(e){return this.tagName=e,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},e.prototype.getAttr=function(e){return this.getAttrs()[e]},e.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(e){return this.setAttr("class",e)},e.prototype.addClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=n?n.split(r):[],o=e.split(r);t=o.shift();)-1===Py(i,t)&&i.push(t);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(e){for(var t,n=this.getClass(),r=this.whitespaceRegex,i=n?n.split(r):[],o=e.split(r);i.length&&(t=o.shift());){var s=Py(i,t);-1!==s&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(e){return-1!==(" "+this.getClass()+" ").indexOf(" "+e+" ")},e.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},e.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+'="'+e[n]+'"');return t.join(" ")},e}(),$y=function(){function e(e){void 0===e&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return e.prototype.build=function(e){return new jy({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},e.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},n=this.createCssClass(e);return n&&(t.class=n),this.newWindow&&(t.target="_blank",t.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<e.getAnchorText().length&&(t.title=e.getAnchorHref()),t},e.prototype.createCssClass=function(e){var t=this.className;if(t){for(var n=[t],r=e.getCssClassSuffixes(),i=0,o=r.length;i<o;i++)n.push(t+"-"+r[i]);return n.join(" ")}return""},e.prototype.processAnchorText=function(e){return this.doTruncate(e)},e.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var n,r,i,o,s=t.length,a=t.location;return"smart"===a?function(e,t,n){var r,i;null==n?(n="…",i=3,r=8):(i=n.length,r=n.length);var o=function(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t},s=function(e,t){var r=t/2,i=Math.ceil(r),o=-1*Math.floor(r),s="";return o<0&&(s=e.substr(o)),e.substr(0,i)+n+s};if(e.length<=t)return e;var a,u,l,c=t-i,d=(a={},(l=(u=e).match(/^([a-z]+):\/\//i))&&(a.scheme=l[1],u=u.substr(l[0].length)),(l=u.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(a.host=l[1],u=u.substr(l[0].length)),(l=u.match(/^\/(.*?)(?=(\?|#|$))/i))&&(a.path=l[1],u=u.substr(l[0].length)),(l=u.match(/^\?(.*?)(?=(#|$))/i))&&(a.query=l[1],u=u.substr(l[0].length)),(l=u.match(/^#(.*?)$/i))&&(a.fragment=l[1]),a);if(d.query){var h=d.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);h&&(d.query=d.query.substr(0,h[1].length),e=o(d))}if(e.length<=t)return e;if(d.host&&(d.host=d.host.replace(/^www\./,""),e=o(d)),e.length<=t)return e;var p="";if(d.host&&(p+=d.host),p.length>=c)return d.host.length==t?(d.host.substr(0,t-i)+n).substr(0,c+r):s(p,c).substr(0,c+r);var f="";if(d.path&&(f+="/"+d.path),d.query&&(f+="?"+d.query),f){if((p+f).length>=c)return(p+f).length==t?(p+f).substr(0,t):(p+s(f,c-p.length)).substr(0,c+r);p+=f}if(d.fragment){var m="#"+d.fragment;if((p+m).length>=c)return(p+m).length==t?(p+m).substr(0,t):(p+s(m,c-p.length)).substr(0,c+r);p+=m}if(d.scheme&&d.host){var E=d.scheme+"://";if((p+E).length<c)return(E+p).substr(0,t)}if(p.length<=t)return p;var g="";return c>0&&(g=p.substr(-1*Math.floor(c/2))),(p.substr(0,Math.ceil(c/2))+n+g).substr(0,c+r)}(e,s):"middle"===a?function(e,t,n){if(e.length<=t)return e;var r,i;null==n?(n="…",r=8,i=3):(r=n.length,i=n.length);var o=t-i,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+r)}(e,s):(r=s,i=void 0,(n=e).length>r&&(null==i?(i="…",o=3):o=i.length,n=n.substring(0,r-o)+i),n)},e}(),Yy=function(){function e(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(e){this.offset=e},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.getType()]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}(),zy=function(e,t){return(zy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function Vy(e,t){function n(){this.constructor=e}zy(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Gy,Wy=function(){return Wy=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Wy.apply(this,arguments)},Xy=function(e){function t(t){var n=e.call(this,t)||this;return n.email="",n.email=t.email,n}return Vy(t,e),t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Yy),Ky=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="",n.hashtag="",n.serviceName=t.serviceName,n.hashtag=t.hashtag,n}return Vy(t,e),t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var e=this.serviceName,t=this.hashtag;switch(e){case"twitter":return"https://twitter.com/hashtag/"+t;case"facebook":return"https://www.facebook.com/hashtag/"+t;case"instagram":return"https://instagram.com/explore/tags/"+t;default:throw new Error("Unknown service name to point hashtag to: "+e)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t}(Yy),qy=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.mention="",n.mention=t.mention,n.serviceName=t.serviceName,n}return Vy(t,e),t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var t=e.prototype.getCssClassSuffixes.call(this),n=this.getServiceName();return n&&t.push(n),t},t}(Yy),Jy=function(e){function t(t){var n=e.call(this,t)||this;return n.number="",n.plusSign=!1,n.number=t.number,n.plusSign=t.plusSign,n}return Vy(t,e),t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Yy),Zy=function(e){function t(t){var n=e.call(this,t)||this;return n.url="",n.urlMatchType="scheme",n.protocolUrlMatch=!1,n.protocolRelativeMatch=!1,n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.schemePrefixRegex=/^(https?:\/\/)?/i,n.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,n.protocolRelativeRegex=/^\/\//,n.protocolPrepended=!1,n.urlMatchType=t.urlMatchType,n.url=t.url,n.protocolUrlMatch=t.protocolUrlMatch,n.protocolRelativeMatch=t.protocolRelativeMatch,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return Vy(t,e),t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var e=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(e=this.url="http://"+e,this.protocolPrepended=!0),e},t.prototype.getAnchorHref=function(){return this.getUrl().replace(/&/g,"&")},t.prototype.getAnchorText=function(){var e=this.getMatchedText();return this.protocolRelativeMatch&&(e=this.stripProtocolRelativePrefix(e)),this.stripPrefix.scheme&&(e=this.stripSchemePrefix(e)),this.stripPrefix.www&&(e=this.stripWwwPrefix(e)),this.stripTrailingSlash&&(e=this.removeTrailingSlash(e)),this.decodePercentEncoding&&(e=this.removePercentEncoding(e)),e},t.prototype.stripSchemePrefix=function(e){return e.replace(this.schemePrefixRegex,"")},t.prototype.stripWwwPrefix=function(e){return e.replace(this.wwwPrefixRegex,"$1")},t.prototype.stripProtocolRelativePrefix=function(e){return e.replace(this.protocolRelativeRegex,"")},t.prototype.removeTrailingSlash=function(e){return"/"===e.charAt(e.length-1)&&(e=e.slice(0,-1)),e},t.prototype.removePercentEncoding=function(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch(e){return t}},t}(Yy),Qy=function(e){this.__jsduckDummyDocProp=null,this.tagBuilder=e.tagBuilder},eC=/[A-Za-z]/,tC=/[\d]/,nC=/[\D]/,rC=/\s/,iC=/['"]/,oC=/[\x00-\x1F\x7F]/,sC=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,aC=sC+/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source+/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,uC=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,lC=aC+uC,cC=aC+uC,dC="(?:["+uC+"]{1,3}\\.){3}["+uC+"]{1,3}",hC="["+cC+"](?:["+cC+"\\-]{0,61}["+cC+"])?",pC=function(e){return"(?=("+hC+"))\\"+e},fC=function(e){return"(?:"+pC(e)+"(?:\\."+pC(e+1)+"){0,126}|"+dC+")"},mC=new RegExp("["+cC+"]"),EC=/(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|travelersinsurance|vermögensberatung|xn--3oq18vl8pn36a|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|afamilycompany|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbb9fbpob|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|spreadbetting|travelchannel|wolterskluwer|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|foodnetwork|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|rightathome|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--estv75g|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--kpu716f|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pbt977c|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nationwide|newholland|nextdirect|onyourside|properties|protection|prudential|realestate|republican|restaurant|schaeffler|swiftcover|tatamotors|technology|telefonica|university|vistaprint|vlaanderen|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|fujixerox|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|honeywell|institute|insurance|kuokgroup|ladbrokes|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|pramerica|richardli|scjohnson|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--tckwe|xn--vhquv|yodobashi|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|budapest|builders|business|capetown|catering|catholic|chrysler|cipriani|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|esurance|etisalat|everbank|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|movistar|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|softbank|software|stcgroup|supplies|symantec|training|uconnect|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|cartier|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|iselect|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lancome|lanxess|lasalle|latrobe|leclerc|liaison|limited|lincoln|markets|metlife|monster|netbank|netflix|network|neustar|okinawa|oldnavy|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|shriram|singles|staples|starhub|storage|support|surgery|systems|temasek|theater|theatre|tickets|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|католик|اتصالات|الجزائر|العليان|پاکستان|كاثوليك|موبايلي|இந்தியா|abarth|abbott|abbvie|active|africa|agency|airbus|airtel|alipay|alsace|alstom|anquan|aramco|author|bayern|beauty|berlin|bharti|blanco|bostik|boston|broker|camera|career|caseih|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|mobily|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|piaget|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|warman|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dabur|dance|deals|delta|dodge|drive|dubai|earth|edeka|email|epost|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glade|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|intel|irish|iveco|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|linde|lipsy|lixil|loans|locus|lotte|lotto|lupin|macys|mango|media|miami|money|mopar|movie|nadex|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|zippo|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|adac|aero|aigo|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|doha|duck|duns|dvag|erni|fage|fail|fans|farm|fast|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|raid|read|reit|rent|rest|rich|rmit|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scor|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|グーグル|クラウド|ポイント|大众汽车|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bnl|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|cbs|ceb|ceo|cfa|cfd|com|crs|csc|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jcp|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|off|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|qvc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|sca|scb|ses|sew|sex|sfr|ski|sky|soy|srl|srt|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ストア|セール|みんな|中文网|天主教|我爱你|新加坡|淡马锡|诺基亚|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|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|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|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|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,gC=new RegExp("["+cC+"!#$%&'*+/=?^_`{|}~-]"),_C=new RegExp("^"+EC.source+"$"),AC=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.localPartCharRegex=gC,t.strictTldRegex=_C,t}return Vy(t,e),t.prototype.parseMatches=function(e){for(var t=this.tagBuilder,n=this.localPartCharRegex,r=this.strictTldRegex,i=[],o=e.length,s=new DC,a={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},u=0,l=0,c=s;u<o;){var d=e.charAt(u);switch(l){case 0:"m"===(h=d)?D(1):n.test(h)&&D();break;case 1:p(e.charAt(u-1),d);break;case 2:f(d);break;case 3:m(d);break;case 4:E(d);break;case 5:g(d);break;case 6:_(d);break;case 7:A(d);break;default:Hy(l)}u++}var h;return O(),i;function p(e,t){":"===e?n.test(t)?(l=2,c=new DC(Wy(Wy({},c),{hasMailtoPrefix:!0}))):v():a[e]===t||(n.test(t)?l=2:"."===t?l=3:"@"===t?l=4:v())}function f(e){"."===e?l=3:"@"===e?l=4:n.test(e)||v()}function m(e){"."===e||"@"===e?v():n.test(e)?l=2:v()}function E(e){mC.test(e)?l=5:v()}function g(e){"."===e?l=7:"-"===e?l=6:mC.test(e)||O()}function _(e){"-"===e||"."===e?O():mC.test(e)?l=5:O()}function A(e){"."===e||"-"===e?O():mC.test(e)?(l=5,c=new DC(Wy(Wy({},c),{hasDomainDot:!0}))):O()}function D(e){void 0===e&&(e=2),l=e,c=new DC({idx:u})}function v(){l=0,c=s}function O(){if(c.hasDomainDot){var n=e.slice(c.idx,u);/[-.]$/.test(n)&&(n=n.slice(0,-1));var o=c.hasMailtoPrefix?n.slice(7):n;(function(e){var t=(e.split(".").pop()||"").toLowerCase();return r.test(t)})(o)&&i.push(new Xy({tagBuilder:t,matchedText:n,offset:c.idx,email:o}))}v()}},t}(Qy),DC=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.hasMailtoPrefix=!!e.hasMailtoPrefix,this.hasDomainDot=!!e.hasDomainDot},vC=function(){function e(){}return e.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},e.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return null!==e.match(t)},e.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},e.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),n=t&&t[0].toLowerCase();return"javascript:"!==n&&"vbscript:"!==n},e.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||-1!==e.indexOf("."))},e.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t||this.hasFullProtocolRegex.test(t)||this.hasWordCharAfterProtocolRegex.test(e))},e.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,e.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,e.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+sC+"]"),e.ipRegex=/[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?\.[0-9][0-9]?[0-9]?(:[0-9]*)?\/?$/,e}(),OC=(Gy=new RegExp("[/?#](?:["+cC+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+cC+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,fC(2),")","|","(","(//)?",/(?:www\.)/.source,fC(6),")","|","(","(//)?",fC(10)+"\\.",EC.source,"(?![-"+lC+"])",")",")","(?::[0-9]+)?","(?:"+Gy.source+")?"].join(""),"gi")),TC=new RegExp("["+cC+"]"),SC=function(e){function t(t){var n=e.call(this,t)||this;return n.stripPrefix={scheme:!0,www:!0},n.stripTrailingSlash=!0,n.decodePercentEncoding=!0,n.matcherRegex=OC,n.wordCharRegExp=TC,n.stripPrefix=t.stripPrefix,n.stripTrailingSlash=t.stripTrailingSlash,n.decodePercentEncoding=t.decodePercentEncoding,n}return Vy(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.stripPrefix,i=this.stripTrailingSlash,o=this.decodePercentEncoding,s=this.tagBuilder,a=[],u=function(){var n=t[0],u=t[1],c=t[4],d=t[5],h=t[9],p=t.index,f=d||h,m=e.charAt(p-1);if(!vC.isValid(n,u))return"continue";if(p>0&&"@"===m)return"continue";if(p>0&&f&&l.wordCharRegExp.test(m))return"continue";if(/\?$/.test(n)&&(n=n.substr(0,n.length-1)),l.matchHasUnbalancedClosingParen(n))n=n.substr(0,n.length-1);else{var E=l.matchHasInvalidCharAfterTld(n,u);E>-1&&(n=n.substr(0,E))}var g=["http://","https://"].find((function(e){return!!u&&-1!==u.indexOf(e)}));if(g){var _=n.indexOf(g);n=n.substr(_),u=u.substr(_),p+=_}var A=u?"scheme":c?"www":"tld",D=!!u;a.push(new Zy({tagBuilder:s,matchedText:n,offset:p,urlMatchType:A,url:n,protocolUrlMatch:D,protocolRelativeMatch:!!f,stripPrefix:r,stripTrailingSlash:i,decodePercentEncoding:o}))},l=this;null!==(t=n.exec(e));)u();return a},t.prototype.matchHasUnbalancedClosingParen=function(e){var t,n=e.charAt(e.length-1);if(")"===n)t="(";else if("]"===n)t="[";else{if("}"!==n)return!1;t="{"}for(var r=0,i=0,o=e.length-1;i<o;i++){var s=e.charAt(i);s===t?r++:s===n&&(r=Math.max(r-1,0))}return 0===r},t.prototype.matchHasInvalidCharAfterTld=function(e,t){if(!e)return-1;var n=0;t&&(n=e.indexOf(":"),e=e.slice(n));var r=new RegExp("^((.?//)?[-."+cC+"]*[-"+cC+"]\\.[-"+cC+"]+)").exec(e);return null===r?-1:(n+=r[1].length,e=e.slice(r[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(e)?n:-1)},t}(Qy),yC=new RegExp("#[_"+cC+"]{1,139}(?![_"+cC+"])","g"),CC=new RegExp("[^"+cC+"]"),NC=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegex=yC,n.nonWordCharRegex=CC,n.serviceName=t.serviceName,n}return Vy(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.nonWordCharRegex,i=this.serviceName,o=this.tagBuilder,s=[];null!==(t=n.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||r.test(u)){var l=t[0],c=t[0].slice(1);s.push(new Ky({tagBuilder:o,matchedText:l,offset:a,serviceName:i,hashtag:c}))}}return s},t}(Qy),bC=new RegExp(/(?:(?:(?:(\+)?\d{1,3}[-\040.]?)?\(?\d{3}\)?[-\040.]?\d{3}[-\040.]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-\040.]?(?:\d[-\040.]?){6,12}\d+))([,;]+[0-9]+#?)*/.source+"|"+/(0([1-9]{1}-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/.source,"g"),IC=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.matcherRegex=bC,t}return Vy(t,e),t.prototype.parseMatches=function(e){for(var t,n=this.matcherRegex,r=this.tagBuilder,i=[];null!==(t=n.exec(e));){var o=t[0],s=o.replace(/[^0-9,;#]/g,""),a=!(!t[1]&&!t[2]),u=0==t.index?"":e.substr(t.index-1,1),l=e.substr(t.index+o.length,1),c=!u.match(/\d/)&&!l.match(/\d/);this.testMatch(t[3])&&this.testMatch(o)&&c&&i.push(new Jy({tagBuilder:r,matchedText:o,offset:t.index,number:s,plusSign:a}))}return i},t.prototype.testMatch=function(e){return nC.test(e)},t}(Qy),RC=new RegExp("@[_"+cC+"]{1,50}(?![_"+cC+"])","g"),wC=new RegExp("@[_."+cC+"]{1,30}(?![_"+cC+"])","g"),kC=new RegExp("@[-_."+cC+"]{1,50}(?![-_"+cC+"])","g"),LC=new RegExp("[^"+cC+"]"),xC=function(e){function t(t){var n=e.call(this,t)||this;return n.serviceName="twitter",n.matcherRegexes={twitter:RC,instagram:wC,soundcloud:kC},n.nonWordCharRegex=LC,n.serviceName=t.serviceName,n}return Vy(t,e),t.prototype.parseMatches=function(e){var t,n=this.serviceName,r=this.matcherRegexes[this.serviceName],i=this.nonWordCharRegex,o=this.tagBuilder,s=[];if(!r)return s;for(;null!==(t=r.exec(e));){var a=t.index,u=e.charAt(a-1);if(0===a||i.test(u)){var l=t[0].replace(/\.+$/g,""),c=l.slice(1);s.push(new qy({tagBuilder:o,matchedText:l,offset:a,serviceName:n,mention:c}))}}return s},t}(Qy),MC=function(e){void 0===e&&(e={}),this.idx=void 0!==e.idx?e.idx:-1,this.type=e.type||"tag",this.name=e.name||"",this.isOpening=!!e.isOpening,this.isClosing=!!e.isClosing},FC=function(){function e(t){void 0===t&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.matchers=null,this.tagBuilder=null,this.urls=this.normalizeUrlsCfg(t.urls),this.email="boolean"==typeof t.email?t.email:this.email,this.phone="boolean"==typeof t.phone?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow="boolean"==typeof t.newWindow?t.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(t.stripPrefix),this.stripTrailingSlash="boolean"==typeof t.stripTrailingSlash?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding="boolean"==typeof t.decodePercentEncoding?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(!1!==n&&"twitter"!==n&&"instagram"!==n&&"soundcloud"!==n)throw new Error("invalid `mention` cfg - see docs");var r=this.hashtag;if(!1!==r&&"twitter"!==r&&"facebook"!==r&&"instagram"!==r)throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){return new e(n).link(t)},e.parse=function(t,n){return new e(n).parse(t)},e.prototype.normalizeUrlsCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:"boolean"!=typeof e.schemeMatches||e.schemeMatches,wwwMatches:"boolean"!=typeof e.wwwMatches||e.wwwMatches,tldMatches:"boolean"!=typeof e.tldMatches||e.tldMatches}},e.prototype.normalizeStripPrefixCfg=function(e){return null==e&&(e=!0),"boolean"==typeof e?{scheme:e,www:e}:{scheme:"boolean"!=typeof e.scheme||e.scheme,www:"boolean"!=typeof e.www||e.www}},e.prototype.normalizeTruncateCfg=function(e){return"number"==typeof e?{length:e,location:"end"}:function(e,t){for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=t[n]);return e}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},e.prototype.parse=function(e){var t=this,n=["a","style","script"],r=0,i=[];return function(e,t){for(var n,r=t.onOpenTag,i=t.onCloseTag,o=t.onText,s=t.onComment,a=t.onDoctype,u=new MC,l=0,c=e.length,d=0,h=0,p=u;l<c;){var f=e.charAt(l);switch(d){case 0:"<"===f&&M();break;case 1:m(f);break;case 2:g(f);break;case 3:E(f);break;case 4:_(f);break;case 5:A(f);break;case 6:D(f);break;case 7:v(f);break;case 8:O(f);break;case 9:T(f);break;case 10:S(f);break;case 11:y(f);break;case 12:C(f);break;case 13:"--"===e.substr(l,2)?(l+=2,p=new MC(Wy(Wy({},p),{type:"comment"})),d=14):"DOCTYPE"===e.substr(l,7).toUpperCase()?(l+=7,p=new MC(Wy(Wy({},p),{type:"doctype"})),d=20):x();break;case 14:N(f);break;case 15:b(f);break;case 16:I(f);break;case 17:R(f);break;case 18:w(f);break;case 19:k(f);break;case 20:L(f);break;default:Hy(d)}l++}function m(e){"!"===e?d=13:"/"===e?(d=2,p=new MC(Wy(Wy({},p),{isClosing:!0}))):"<"===e?M():eC.test(e)?(d=3,p=new MC(Wy(Wy({},p),{isOpening:!0}))):(d=0,p=u)}function E(e){rC.test(e)?(p=new MC(Wy(Wy({},p),{name:B()})),d=4):"<"===e?M():"/"===e?(p=new MC(Wy(Wy({},p),{name:B()})),d=12):">"===e?(p=new MC(Wy(Wy({},p),{name:B()})),F()):eC.test(e)||tC.test(e)||":"===e||x()}function g(e){">"===e?x():eC.test(e)?d=3:x()}function _(e){rC.test(e)||("/"===e?d=12:">"===e?F():"<"===e?M():"="===e||iC.test(e)||oC.test(e)?x():d=5)}function A(e){rC.test(e)?d=6:"/"===e?d=12:"="===e?d=7:">"===e?F():"<"===e?M():iC.test(e)&&x()}function D(e){rC.test(e)||("/"===e?d=12:"="===e?d=7:">"===e?F():"<"===e?M():iC.test(e)?x():d=5)}function v(e){rC.test(e)||('"'===e?d=8:"'"===e?d=9:/[>=`]/.test(e)?x():"<"===e?M():d=10)}function O(e){'"'===e&&(d=11)}function T(e){"'"===e&&(d=11)}function S(e){rC.test(e)?d=4:">"===e?F():"<"===e&&M()}function y(e){rC.test(e)?d=4:"/"===e?d=12:">"===e?F():"<"===e?M():(d=4,l--)}function C(e){">"===e?(p=new MC(Wy(Wy({},p),{isClosing:!0})),F()):d=4}function N(e){"-"===e?d=15:">"===e?x():d=16}function b(e){"-"===e?d=18:">"===e?x():d=16}function I(e){"-"===e&&(d=17)}function R(e){d="-"===e?18:16}function w(e){">"===e?F():"!"===e?d=19:"-"===e||(d=16)}function k(e){"-"===e?d=17:">"===e?F():d=16}function L(e){">"===e?F():"<"===e&&M()}function x(){d=0,p=u}function M(){d=1,p=new MC({idx:l})}function F(){var t=e.slice(h,p.idx);t&&o(t,h),"comment"===p.type?s(p.idx):"doctype"===p.type?a(p.idx):(p.isOpening&&r(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),x(),h=l+1}function B(){var t=p.idx+(p.isClosing?2:1);return e.slice(t,l).toLowerCase()}h<l&&(n=e.slice(h,l),o(n,h),h=l+1)}(e,{onOpenTag:function(e){n.indexOf(e)>=0&&r++},onText:function(e,n){if(0===r){var o=function(e,t){if(!t.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var n,r=[],i=0;n=t.exec(e);)r.push(e.substring(i,n.index)),r.push(n[0]),i=n.index+n[0].length;return r.push(e.substring(i)),r}(e,/( | |<|<|>|>|"|"|')/gi),s=n;o.forEach((function(e,n){if(n%2==0){var r=t.parseText(e,s);i.push.apply(i,r)}s+=e.length}))}},onCloseTag:function(e){n.indexOf(e)>=0&&(r=Math.max(r-1,0))},onComment:function(e){},onDoctype:function(e){}}),i=this.compactMatches(i),i=this.removeUnwantedMatches(i)},e.prototype.compactMatches=function(e){e.sort((function(e,t){return e.getOffset()-t.getOffset()}));for(var t=0;t<e.length-1;t++){var n=e[t],r=n.getOffset(),i=n.getMatchedText().length,o=r+i;if(t+1<e.length){if(e[t+1].getOffset()===r){var s=e[t+1].getMatchedText().length>i?t:t+1;e.splice(s,1);continue}e[t+1].getOffset()<o&&e.splice(t+1,1)}}return e},e.prototype.removeUnwantedMatches=function(e){return this.hashtag||Uy(e,(function(e){return"hashtag"===e.getType()})),this.email||Uy(e,(function(e){return"email"===e.getType()})),this.phone||Uy(e,(function(e){return"phone"===e.getType()})),this.mention||Uy(e,(function(e){return"mention"===e.getType()})),this.urls.schemeMatches||Uy(e,(function(e){return"url"===e.getType()&&"scheme"===e.getUrlMatchType()})),this.urls.wwwMatches||Uy(e,(function(e){return"url"===e.getType()&&"www"===e.getUrlMatchType()})),this.urls.tldMatches||Uy(e,(function(e){return"url"===e.getType()&&"tld"===e.getUrlMatchType()})),e},e.prototype.parseText=function(e,t){void 0===t&&(t=0),t=t||0;for(var n=this.getMatchers(),r=[],i=0,o=n.length;i<o;i++){for(var s=n[i].parseMatches(e),a=0,u=s.length;a<u;a++)s[a].setOffset(t+s[a].getOffset());r.push.apply(r,s)}return r},e.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"<").replace(/>/g,">"));for(var t=this.parse(e),n=[],r=0,i=0,o=t.length;i<o;i++){var s=t[i];n.push(e.substring(r,s.getOffset())),n.push(this.createMatchReturnVal(s)),r=s.getOffset()+s.getMatchedText().length}return n.push(e.substring(r)),n.join("")},e.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),"string"==typeof t?t:!1===t?e.getMatchedText():t instanceof jy?t.toAnchorString():e.buildTag().toAnchorString()},e.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new NC({tagBuilder:e,serviceName:this.hashtag}),new AC({tagBuilder:e}),new IC({tagBuilder:e}),new xC({tagBuilder:e,serviceName:this.mention}),new SC({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},e.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new $y({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},e.version="3.14.3",e.AnchorTagBuilder=$y,e.HtmlTag=jy,e.matcher={Email:AC,Hashtag:NC,Matcher:Qy,Mention:xC,Phone:IC,Url:SC},e.match={Email:Xy,Hashtag:Ky,Match:Yy,Mention:qy,Phone:Jy,Url:Zy},e}();function BC(e,t=e){return{type:"autolink",url:e,text:t}}const PC=Iy(/<!!mention:([^>\s]*?)\|(.*?)>/gm,(([e,t,n])=>function(e,t){return{type:"mention",id:e,text:t}}(decodeURIComponent(t),n))),UC=Iy(/<!!customemoji:(.*?)>/gm,(([e,t])=>function(e){return{type:"customemoji",text:e}}(t))),HC=Iy(/<((?:https?|mailto):.*?)\|(.*?)>/gi,(([e,t,n])=>function(e,t=[]){return{type:"link",url:e,children:t}}(t,[n]))),jC=Iy(/<actionlink:([^|]+)[|]([^>]*)>/gi,(([e,t,n])=>{const{action:r,params:i}=YC(t);return function(e,t,n=[]){return{type:"actionlink",action:e,params:t,children:n}}(r,i,[n])})),$C=Iy(/<actionbutton:([^|]+)[|]([^>]*)>/gi,(([e,t,n])=>{const{action:r,params:i}=YC(t);return function(e,t,n=[]){return{type:"actionbutton",action:e,params:t,children:n}}(r,i,[n])}));function YC(e){const t=e.indexOf("?");return-1===t?{action:e,params:{}}:{action:e.slice(0,t),params:Object.fromEntries(new URLSearchParams(e.slice(t)))}}const zC=Iy(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g,(([e])=>function(e=[]){return{type:"bulletlist",children:e}}([e.startsWith("\n")?e.slice(1):e]))),VC=Iy(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm,(([e,t])=>({type:"bulletpoint",children:[t]}))),GC=e=>{const t=/(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;let n=0;const r=[];for(const i of YS(e,t)){const t=i[0],o=i[1],s=t.startsWith(o)?i.index:i.index+1;s-n>0&&r.push(e.substring(n,s));const a=BC("tel:"+o.replace(/[^0-9+]/g,""),o);r.push(a),n=s+o.length}return n<e.length&&r.push(e.substring(n)),r},WC=e=>HC(e).flatMap((e=>"string"==typeof e?XC(e):["<",...XC(e.url),...XC("|"+e.children[0]+">")])),XC=e=>{const t=FC.parse(e,{urls:!0,email:!0,phone:!1,hashtag:!1,mention:!1}),n=[];let r=0;for(const i of t){const t=i.getOffset(),o=i.getMatchedText(),s=o.length;let a=o;i instanceof Xy?a="mailto:"+i.getEmail():i instanceof Zy&&(a=i.getUrl()),t>r&&n.push(e.substring(r,t)),n.push(BC(a,o)),r=t+s}return r<e.length&&n.push(e.substring(r)),n},KC=["Codeblock","Codespan","FormattedLink","Wikitext","Autolink","Actions","Mention","Mention","BulletPoint","CustomEmoji"],qC=function(){const e=RegExp("[^\n]+\n?|\n","g");return t=>Array.from(t.match(e)||[])}();function JC(e,t={except:[]}){let n=function(e,t){let n=[e];return n=ZC(n,t.multilineSteps),n=ZC(n,[qC]),n=ZC(n,t.singlelineSteps),n=QC(n),n}(e,function(e={except:[]}){var t;const n={multilineSteps:[],singlelineSteps:[]},r=null!=(t=e.except)?t:KC.filter((t=>!e.only.includes(t)));return r.includes("BulletPoint")||n.multilineSteps.push(zC,VC),r.includes("Mention")||n.singlelineSteps.push(PC),r.includes("CustomEmoji")||n.singlelineSteps.push(UC),r.includes("Codespan")||n.multilineSteps.push(Iy(/```([^]+?)```/g,(([e,t])=>({type:"codespan",text:t})))),r.includes("FormattedLink")||n.singlelineSteps.push(HC),r.includes("Actions")||(n.singlelineSteps.push(jC),n.singlelineSteps.push($C)),r.includes("Wikitext")||n.singlelineSteps.push(My),r.includes("Autolink")||n.singlelineSteps.push(WC,GC),n}(t));return n=eN(n,!1),n}function ZC(e,t){return t.reduce(((e,t)=>by(e,t)),e)}function QC(e){const t=[];let n=-1;for(const r of e)"string"==typeof r?"string"==typeof t[n]?t[n]+=r:t[++n]=r:t[++n]="children"in r?KT(XT({},r),{children:QC(r.children)}):r;return t}function eN(e,t){const n=[];let r=[];for(let i=0;i<e.length;i++){const o=e[i];"string"==typeof o?r.push(o):"children"in o?(r.length>0&&(n.push(r.join("")),r=[]),o.children=eN(o.children,t||"link"===o.type||"actionbutton"===o.type||"actionlink"===o.type),n.push(o)):"autolink"===o.type&&t?r.push(o.text):(r.length>0&&(n.push(r.join("")),r=[]),n.push(o))}return r.length>0&&(n.push(r.join("")),r=[]),n}class tN{constructor(e,t,n,r){this.emoji=e,this.messageId=t,this.conversationId=n,this._realtimeClient=r}get brandedMessageId(){return this.messageId}get brandedConversationId(){return this.conversationId}add(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("PUT",["conversations",this.brandedConversationId,"messages",this.brandedMessageId,"reactions",this.emoji,this._realtimeClient.userId],{});ZT(`Add ${this.emoji} reaction on message ${this.messageId} in conversation ${this.conversationId}`,e)}))}remove(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("DELETE",["conversations",this.brandedConversationId,"messages",this.brandedMessageId,"reactions",this.emoji,this._realtimeClient.userId],{});(e.ok||"server"!==e.where||404!==e.value.status)&&ZT(`Remove ${this.emoji} reaction from message ${this.messageId} in conversation ${this.conversationId}`,e)}))}}let nN=class{constructor(e,t,n){this.id=e,this.conversationId=t,this._realtimeClient=n}get brandedId(){return this.id}get brandedConversationId(){return this.conversationId}reaction(e){return new tN(e,this.brandedId,this.brandedConversationId,this._realtimeClient)}get(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("GET",["me","conversations",this.brandedConversationId,"messages",this.brandedId],{});if(!e.ok&&"server"===e.where&&404===e.value.status)return null;if(!e.ok&&"server"===e.where&&403===e.value.status&&"NOT_A_PARTICIPANT"===e.value.errorCode)return null;const t=ZT("Get message "+this.id,e),n=yield this._realtimeClient.createMessageSnapshot(t,this.brandedConversationId);return Sy("Get message "+this.id,n)}))}edit(e){return JT(this,null,(function*(){const t={content:rN(e),custom:"string"==typeof e?void 0:e.custom},n=yield this._realtimeClient.call("PATCH",["conversations",this.brandedConversationId,"messages",this.brandedId],t);ZT(`Edit message ${this.id} in conversation ${this.conversationId}`,n)}))}delete(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("DELETE",["conversations",this.brandedConversationId,"messages",this.brandedId],{});(e.ok||"server"!==e.where||404!==e.value.status)&&ZT(`Delete message ${this.id} in conversation ${this.conversationId}`,e)}))}};function rN(e){return"string"==typeof e?[{type:"text",children:JC(e)}]:"text"in e&&e.text?[{type:"text",children:JC(e.text)}]:"content"in e&&e.content?e.content:void 0}class iN{constructor(e,t){this.id=e,this._realtimeClient=t,this.uselessObjForTypeCheck={subject:null,photoUrl:null,welcomeMessages:null,custom:null,access:null,notify:null}}get brandedId(){return this.id}get brandedUserId(){return this._realtimeClient.userId}participant(e){return new Cy("string"==typeof e?e:e.id,this.id,this._realtimeClient)}message(e){return new nN(e,this.brandedId,this._realtimeClient)}get(){return JT(this,null,(function*(){const e=this._realtimeClient.listMessages(this.brandedId,{limit:1}),t=yield this._realtimeClient.call("GET",["me","conversations",this.brandedId],{});if(!t.ok&&"server"===t.where&&404===t.value.status)return null;const n=ZT("Get conversation "+this.id,t),r=Sy("Get last message in conversation "+this.id,yield e),i=0===r.length?null:r[0];return this._realtimeClient.createConversationSnapshotPreloaded(n,i)}))}set(e){return JT(this,null,(function*(){const t=this._realtimeClient.call("PUT",["conversations",this.brandedId],e),n=this._realtimeClient.call("PUT",["conversations",this.brandedId,"participants",this.brandedUserId],e),r=yield t;!r.ok&&"server"===r.where&&403===r.value.status&&"UNAUTHORIZED_TO_EDIT"===r.value.errorCode&&function(e){return void 0===e.subject&&void 0===e.photoUrl&&void 0===e.welcomeMessages&&null!==e.custom&&(void 0===e.custom||!Object.values(e.custom).some((e=>void 0!==e)))}(e)||ZT("Set conversation "+this.id,r);const i=yield n;!i.ok&&"server"===i.where&&403===i.value.status&&"UNAUTHORIZED_TO_EDIT_PARTICIPANT"===i.value.errorCode&&function(e){return void 0===e.access&&void 0===e.notify}(e)||ZT("Set your participation in conversation "+this.id,i)}))}createIfNotExists(){return JT(this,arguments,(function*(e={}){const t=this._realtimeClient.call("POST",["conversations",this.brandedId],e),n=this._realtimeClient.call("POST",["conversations",this.brandedId,"participants",this.brandedUserId],e),r=yield t;(r.ok||"server"!==r.where||409!==r.value.status)&&ZT("Create conversation "+this.id,yield t);const i=yield n;(i.ok||"server"!==i.where||409!==i.value.status)&&ZT("Join conversation "+this.id,yield n)}))}markAsRead(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("POST",["me","conversations",this.brandedId,"read"],{});ZT(`Mark ${this.id} as read`,e)}))}markAsUnread(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("POST",["me","conversations",this.brandedId,"unread"],{});ZT(`Mark ${this.id} as unread`,e)}))}send(e){return JT(this,null,(function*(){const t={content:oN(e),referencedMessageId:sN(e),custom:"string"==typeof e?void 0:e.custom,idempotencyKey:Ny((new Date).getTime())},n=yield this._realtimeClient.call("POST",["conversations",this.brandedId,"messages"],t),r=ZT("Send message to conversation "+this.id,n);return new nN(r.id,this.brandedId,this._realtimeClient)}))}subscribeMessages(e){return this._realtimeClient.subscribe(["me","conversations",this.brandedId,"messages"],e)}subscribeParticipants(e){return this._realtimeClient.subscribe(["me","conversations",this.brandedId,"participants"],e)}subscribe(e){return this._realtimeClient.subscribe(["me","conversations",this.brandedId],e)}subscribeTyping(e){return this._realtimeClient.subscribe(["me","conversations",this.brandedId,"typing"],e)}markAsTyping(){return JT(this,null,(function*(){const e=yield this._realtimeClient.call("POST",["me","conversations",this.brandedId,"typing"],{});ZT(`Set user as typing in ${this.id}`,e)}))}}function oN(e){return"string"==typeof e?[{type:"text",children:JC(e)}]:"text"in e?[{type:"text",children:JC(e.text)}]:e.content}function sN(e){if("string"==typeof e)return;const t=e.referencedMessage;return void 0!==t?"string"==typeof t?t:t.id:void 0}class aN{constructor(e,t,n){this.realtimeWsApiUrl=e,this.internalHttpApiUrl=t,this.restApiHttpUrl=n}getBokensUrl(e,t,n){return this.internalHttpApiUrl+`/${e}/bokens/${encodeURIComponent(t)}?signature=${encodeURIComponent(null!=n?n:"")}`}getRealtimeWsUrl(e,t,n,r,i){const o=encodeURIComponent(t);return this.realtimeWsApiUrl+`/${e}/realtime/${o}?talkjs-client-build=${null!=i?i:"standalone"}&talkjs-core=${n}&talkjs-client-id=${r}`}static fromHost(e){const t=new aN("wss://realtime.talkjs.com/v1","https://app.talkjs.com/api/v0","https://api.talkjs.com/v1");if(!e)return t;if(e.endsWith("talkjs.com")){const n=e.match(/\w+-(\w+)\.talkjs\.com/);if(n){const e=n[1];return new aN(`wss://realtime-${e}.talkjs.com/v1`,`https://app-${e}.talkjs.com/api/v0`,`https://api-${e}.talkjs.com/v1`)}return t}return e.includes("localhost")||e.includes("localtest.me")||/^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e)?new aN(`ws://${e}/public_api/v1`,`http://${e}/api/v0`,`http://${e}/public_api/v1`):new aN(`wss://${e}/public_api/v1`,`https://${e}/api/v0`,`https://${e}/public_api/v1`)}}function uN({method:e,url:t,data:n,options:r,attempts:i,shouldRetry:o,authProvider:s}){var a;(!i||i<=0)&&(i=1);const u={"x-talkjs-client-build":"jssdk-dev","x-talkjs-client-date":"2025-08-13T01:24:32.679Z"};return n instanceof FormData||(u["Content-Type"]=null!=(a=null==r?void 0:r.contentType)?a:"application/json"),iS(i,(()=>JT(this,null,(function*(){if(s){const e=yield s.getToken();u.Authorization=`Bearer ${e}`}return fetch(t,{method:e,headers:u,body:n}).then((e=>{if(e.ok)return e;throw e}))}))),{initialDelay:.2,log:void 0,shouldRetry:n=>JT(this,null,(function*(){return s&&401===n.status?(EN.log(`401 error from ${e} ${t}, ${yield s.getToken()}`),s.refreshToken(),!0):o?o(n):!("status"in n&&n.status>=400&&n.status<500)}))}).catch((n=>{if(Math.random()<.1&&!t.toString().startsWith("https://capture.trackjs.com")){const r=`Network Error for ${e} ${t}`;"undefined"!=typeof window&&(n instanceof Response?n.clone().text().then((e=>EN.log(`${r} ${n.status} ${e} (10% logged)`))):EN.log(`${r} ${n} (10% logged)`)),console.error("[TalkJS]",r)}throw n}))}const{cdnHost:lN,appHost:cN,restHost:dN,realtimeHost:hN,appProtocol:pN,appWsProtocol:fN}=function(){if("undefined"==typeof window)return{cdnHost:"test-hostname",appHost:"test-hostname",appProtocol:"http:",appWsProtocol:"ws:"};const e=function(){if(document.currentScript)return document.currentScript.src;try{throw new Error}catch(e){const n=e.stack.match(/https?:\/\/.*\.(js|jsx|ts|tsx)/);return n?n[0]:""}}(),t=document.createElement("a");t.href=e;const n=t.host,r=(a=n).match(/^cdn[.-]/)?a.replace(/^cdn/,"app"):"talkjs.com"===a?"app.talkjs.com":a,i=function(e){return e.match(/^app[.-]/)?e.replace(/^app/,"api"):e+"/public_api"}(r),o=function(e){return e.match(/^app[.-]/)?e.replace(/^app/,"realtime"):e+"/public_api"}(r),s=t.protocol;var a;return{cdnHost:n,appHost:r,restHost:i,realtimeHost:o,appProtocol:s,appWsProtocol:"https:"===s?"wss:":"ws:"}}(),mN=cN.startsWith("app.talkjs.com"),EN="undefined"==typeof window?{log:e=>Promise.resolve(),setData:e=>{}}:new class{constructor(e){this._timeCreated=Date.now(),this._enabled=mN,this._trackJSData={customer:{application:"",correlationId:"",sessionId:"",token:"",userId:"",version:"dev-2025-08-13T01:24:32.679Z"},entry:"direct",environment:{age:Date.now()-this._timeCreated,dependencies:{},originalUrl:window.location.href,referrer:document.referrer,userAgent:window.navigator.userAgent},metadata:[],nav:[],network:[],url:window.location.href,stack:"",timestamp:(new Date).toISOString(),version:"dev-2025-08-13T01:24:32.679Z",throttled:0},this._url=`https://capture.trackjs.com/capture?token=${e}`,this._trackJSData.customer.token=e}setData({appId:e,meId:t,sessionId:n}){this._trackJSData.customer.userId=e,this._trackJSData.customer.sessionId=`${e}/${t}`,this._trackJSData.customer.correlationId=n}log(e){return JT(this,null,(function*(){try{if(!this._enabled)return Promise.resolve();const t=KT(XT({},this._trackJSData),{message:e});yield uN({method:"POST",url:this._url,data:JSON.stringify(t),options:{contentType:"text/plain"}})}catch(e){console.error("[TalkJS] Failed when sending an error report. Error: ",e)}}))}}("970cd0be0fb74630b75c8451051299dc");class gN{constructor(e,t={}){this._onSubscription=t,this._handlers={};for(const n in e)Object.hasOwnProperty.call(e,n)&&(this._handlers[n]=[])}emit(e,t){for(const n of this._handlers[e])try{n(t)}catch(t){console.error(`[TalkJS] '${String(e)}' handler threw an error:`,t)}}emitAsync(e,t){return JT(this,null,(function*(){try{const n=this._handlers[e].map((e=>e(t)));yield Promise.all(n)}catch(t){console.error(`[TalkJS] '${String(e)}' handler threw an error:`,t)}}))}supports(e){return e in this._handlers}on(e,t){var n,r;if(!this.supports(e))throw new Error(`Unknown event type '${String(e)}'`);null==(r=(n=this._onSubscription)[e])||r.call(n),this._handlers[e].push(t)}off(e,t){if(!Object.hasOwnProperty.call(this._handlers,e))throw new Error(`Unknown event type '${String(e)}'`);const n=this._handlers[e].indexOf(t);-1!==n&&this._handlers[e].splice(n,1)}removeAllListeners(){for(const e in this._handlers)this._handlers[e]=[]}handles(e){return this._handlers[e].length>0}subscribe(e,t){return this.on(e,t),{unsubscribe:()=>this.off(e,t)}}}class _N{constructor(e,t,n,r,i,o){if(this.appId=t,this.userId=n,this.tokenFetcher=i,this.usingBokens=!1,this.requestInProgress=!1,this.eventEmitter=new gN({tokenChanged(e){},tokenRefreshFailed(e){},tokenAccepted(e){}}),this.sessionExpiryWarningTimeoutId=void 0,o&&(r||i))throw new Error("[TalkJS] If providing a signature for authentication, you must not provide a token or tokenFetcher.");r?this.fetchToken((()=>r)):(i||(this.usingBokens=!0,this.tokenFetcher=()=>this.sendBokenRequest(e,o)),this.refreshToken())}get canRefreshToken(){return this.usingBokens||!!this.tokenFetcher}getToken(){return this.token}refreshToken(){if(!this.requestInProgress){if(!this.tokenFetcher)throw this.emitTokenRefreshFailed("no `tokenFetcher` provided"),new Error("[TalkJS] Cannot refresh token, no `tokenFetcher` provided.");this.fetchToken(this.tokenFetcher)}}onTokenChanged(e){return this.eventEmitter.on("tokenChanged",e),()=>{this.eventEmitter.off("tokenChanged",e)}}emitTokenChanged(e){this.eventEmitter.emit("tokenChanged",e)}onTokenRefreshFailed(e){return this.eventEmitter.on("tokenRefreshFailed",e),()=>{this.eventEmitter.off("tokenRefreshFailed",e)}}emitTokenRefreshFailed(e){this.eventEmitter.emit("tokenRefreshFailed",e),console.error(`[TalkJS] Could not authenticate, cannot recover automatically: ${e}`)}onTokenAccepted(e){return this.eventEmitter.on("tokenAccepted",e),()=>{this.eventEmitter.off("tokenAccepted",e)}}emitTokenAccepted(e){this.eventEmitter.emit("tokenAccepted",e)}clearScheduledRefresh(){this.sessionExpiryWarningTimeoutId&&clearTimeout(this.sessionExpiryWarningTimeoutId)}scheduleRefresh(e){if(this.clearScheduledRefresh(),null===e)return;const t=void 0!==this.tokenFetcher;if(e<120&&!t?console.warn(`[TalkJS] TalkJS will stop working in ${e} seconds due to auth token expiry. Token expires in ${e} seconds, and cannot be refreshed because no \`tokenFetcher\` was provided when creating the session. Non-refreshable tokens are recommended to expire at least 24 hours in the future.`):e<120&&t?console.warn(`[TalkJS] TalkJS auth token will expire and need to be refreshed in ${e} seconds. Refreshable JWTs are recommended to expire at least 30 minutes in the future, to improve performance and reduce unnecessary refreshes.`):e<3300&&!t&&console.warn(`[TalkJS debug] TalkJS will stop working in ${Math.round(e/60)} minutes due to auth token expiry. Non-refreshable tokens are recommended to expire at least 24 hours in the future. Alternatively, provide a \`tokenFetcher\` when creating the session, so that tokens can be refreshed when they expire.`),void 0!==this.tokenFetcher){const t=e>600?e-300:e/2,n=Math.min(1728e6,1e3*t);this.sessionExpiryWarningTimeoutId=setTimeout((()=>{this.refreshToken()}),n)}else e<2e6&&(this.sessionExpiryWarningTimeoutId=setTimeout((()=>{this.emitTokenRefreshFailed("Token has expired and no `tokenFetcher` was provided when creating the session, so it cannot be refreshed.")}),1e3*e))}fetchToken(e){return JT(this,null,(function*(){if(this.requestInProgress)return;this.requestInProgress=!0;const t=()=>JT(this,null,(function*(){const t=yield e();return this.checkJwt(t),t}));try{const e=void 0!==this.token;this.token=t(),yield this.token.then((t=>{e&&this.emitTokenChanged(t)})).catch((e=>{this.emitTokenRefreshFailed(e)}))}catch(e){this.emitTokenRefreshFailed(e)}finally{this.requestInProgress=!1}}))}checkJwt(e){!function(e){if(!("string"==typeof e||e instanceof String)){if(void 0===e)throw"Token was undefined";throw"Token must be a string, got: "+e}}(e);const t=[];let n,r,i;if("string"==typeof e?n=e:t.push(`Token type is ${typeof e} instead of a string.`),n)try{const e=function(e){const t=e.split(".");if(3!==t.length)throw"Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";return{header:AN(t[0]),payload:AN(t[1])}}(n);r=e.header,i=e.payload}catch(e){t.push(e)}if(r){const e=this.checkJwtHeader(r);t.push(...e)}if(i){const e=this.checkJwtPayload(i);t.push(...e)}if(t.length)if(this.usingBokens)EN.log(`JWT Errors detected by AuthProvider when using bokens: ${t.join("\n")}`);else{console.warn("[TalkJS] Authentication token appears to be generated incorrectly. Will still attempt to authenticate, but TalkJS may not work as expected. See below for a description of any problems and how to fix them.");const n=t.length>1;t.forEach(((e,t)=>{const r=n?`Reason ${t+1}:`:"Reason:";console.warn(`[TalkJS] ${r} ${e}`)})),console.warn(`[TalkJS]: Authentication token: "${e}"`)}}checkJwtHeader(e){const t=[],n=e.alg;return void 0===n?t.push('Token header must contain `"alg": "HS256"`, but no `alg` was specified.'):"string"!=typeof n?t.push(`Token header must contain \`"alg": "HS256"\`, but \`alg\` was ${typeof n} instead of a string. Make sure you wrap the value in "".`):"HS256"!==n&&t.push(`Token header must contain \`"alg": "HS256"\`, but \`alg\` was set to "${n}" instead. HS256 is the only supported algorithm.`),t}checkJwtPayload(e){const t=[],n=e.iss;void 0===n?t.push(`Token payload must contain an \`iss\` claim set to your app ID (${this.appId}), but \`iss\` was missing.`):"string"!=typeof n?t.push(`Token payload must contain an \`iss\` claim set to your app ID (${this.appId}), but \`iss\` was ${typeof n} instead of a string. Make sure you wrap the value in "".`):n!==this.appId&&t.push(`Token payload must contain an \`iss\` claim set to your app ID (${this.appId}), but \`iss\` was set to "${n}" instead.`);const r=e.sub;void 0===r?t.push(`Token payload must contain a \`sub\` claim set to your user ID (${this.userId}), but \`sub\` was missing.`):"string"!=typeof r?t.push(`Token payload must contain a \`sub\` claim set to your user ID (${this.userId}), but \`sub\` was ${typeof r} instead of a string. Make sure you wrap the value in "".`):r!==this.userId&&t.push(`Token payload must contain a \`sub\` claim set to your userId ID (${this.userId}), but \`sub\` was set to "${r}" instead.`);const i=e.tokenType;void 0===i?t.push('Token payload must contain a `"tokenType": "user"` claim, but no `tokenType` was specified.'):"string"!=typeof i?t.push(`Token payload must contain a \`"tokenType": "user"\` claim, but \`tokenType\` was ${typeof i} instead of a string. Make sure you wrap the value in "".`):"user"!==i&&t.push(`Token payload must contain a \`"tokenType": "user"\` claim, but \`tokenType\` was set to "${i}" instead.`);const o=e.exp;void 0===o||("number"!=typeof o?t.push(`Token payload contains an \`exp\` claim, but \`exp\` was ${typeof i} instead of a number. If set, \`exp\` should be the expiry date as a number of seconds since 1970-01-01. Don't wrap the value in "".`):o<1e9?t.push(`Token payload contains an \`exp\` claim, but \`exp\` is very small (${o}, representing ${new Date(1e3*o).toLocaleDateString()}). If set, \`exp\` should be the expiry date as a number of seconds since 1970-01-01.`):o>1e11?t.push(`Token payload contains an \`exp\` claim, but \`exp\` is very small (${o}, representing ${new Date(1e3*o).toLocaleDateString()}). If set, \`exp\` should be the expiry date as a number of seconds since 1970-01-01. Double-check that you are using seconds and not milliseconds or nanoseconds.`):o<(new Date).getTime()/1e3&&t.push(`Token payload contains an \`exp\` claim, but \`exp\` (${o}, representing ${new Date(1e3*o).toLocaleDateString()}) appears to be in the past, meaning the token will be rejected. This error can also happen if your device's clock is set incorrectly, in which case the token will still work.`));const s=e.nbf;return void 0===s||("number"!=typeof s?t.push(`Token payload contains a \`nbf\` (not-before) claim, but \`nbf\` was ${typeof i} instead of a number. If set, \`nbf\` should be the date when the JWT becomes valid, as a number of seconds since 1970-01-01.`):s>1e11&&t.push(`Token payload contains a \`nbf\` (not-before) claim, but \`nbf\` is very large (${s}, representing ${new Date(1e3*s).toLocaleDateString()}). If set, \`nbf\` should be the date when the JWT becomes valid, as a number of seconds since 1970-01-01. Double-check that you are using seconds and not milliseconds or nanoseconds.`)),t}sendBokenRequest(e,t){return JT(this,null,(function*(){let n=0;const r=e.getBokensUrl(this.appId,this.userId,t),i=yield uN({method:"GET",url:r,attempts:1e4,shouldRetry:e=>{if(e instanceof Error)return!0;if(401===e.status)throw"Check that you provided a valid signature.";if(404===e.status)throw"Check that you specified the correct App ID.";if(429===e.status||502===e.status)return!0;if(e.status>=400&&e.status<500)throw`Unexpected HTTP ${e.status} response when fetching auth token. Check that you configured the session correctly.`;if(n++,n>=5)throw`Unexpected HTTP ${e.status} response when fetching auth token, retrying did not help.`;return!0}});return(yield i.json()).boken}))}}function AN(e){try{const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(atob(t).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join(""));return JSON.parse(n)}catch(t){throw`Could not base64-decode and JSON-parse token section: ${e}. Check that you base-64 encoded the section correctly.`}}class DN{constructor(e){this.target=e}deref(){return this.target}}const vN=new class{constructor(){this.registry={}}getOrCreate(e){var t;const n=this.key(e),r=null==(t=this.registry[n])?void 0:t.deref();if(r)return r;const i=new ON(e),o=globalThis.WeakRef?new WeakRef(i):new DN(i);return this.registry[n]=o,i}deregister(e,t){const n=this.key({appId:e,userId:t});delete this.registry[n]}key({appId:e,userId:t}){return`${e}:${t}`}};class ON{constructor(e){!function(e){function t(e,t){if(!e)throw new Error("[TalkJS] TalkSession: "+t)}t(e&&"object"==typeof e,"Expected an object argument in TalkSession#constructor."),t(e.appId&&"string"==typeof e.appId,"The `appId` property of TalkSession#constructor is required and it must be a non-empty string."),t("string"==typeof e.userId,"The `userId` property of TalkSession#constructor is required and it must be a string."),void 0!==e.token&&t(e.token&&"string"==typeof e.token,"The `token` property of TalkSession#constructor must be a non-empty string."),void 0!==e.tokenFetcher&&t("function"==typeof e.tokenFetcher,"The `tokenFetcher` property of TalkSession#constructor must be a function.")}(e);const{appId:t,userId:n,token:r,tokenFetcher:i,signature:o}=e;this._appId=t,this._apiUrls=e.apiUrls?new aN(e.apiUrls.realtimeWsApiUrl,e.apiUrls.internalHttpApiUrl,e.apiUrls.restApiHttpUrl):aN.fromHost(e.host),this._authProvider=new _N(this._apiUrls,t,n,r,i,o);const s=Math.random().toString().split(".")[1];this._realtimeClient=new Oy(this._apiUrls.getRealtimeWsUrl(t,n,"1.4.2",s,e.clientBuild),n,this._authProvider),this.currentUser=new yy(this._realtimeClient.userId,this._realtimeClient),this._terminationReason=oS(),this._terminationReason.promise.then((e=>{console.error(`[TalkSession] ${e}`)})),function(e,t,n){return JT(this,null,(function*(){return uN({method:"GET",url:`${t}/${e}/app`,authProvider:n}).then((e=>200===e.status||404!==e.status&&(console.warn(`[TalkJS] Received unexpected ${e.status} status code when validating app ID. Assuming that the app ID is valid.`),!0))).catch((e=>{if("string"!=typeof e&&"status"in e){const t=e;return 200===t.status||404!==t.status&&(console.warn(`[TalkJS] Received unexpected ${t.status} status code when validating app ID. Assuming that the app ID is valid.`),!0)}return console.warn("[TalkJS] Encountered network issues when validating app ID. Assuming that the app ID is valid."),!0}))}))}(this._appId,this._apiUrls.internalHttpApiUrl,this._authProvider).then((e=>{e||this.terminate(new Error(`The app ID ${this._appId} does not exist. Make sure you are using the correct app ID as found on the TalkJS dashboard. App IDs are case-sensitive.`))})),this._authProvider.onTokenRefreshFailed((e=>{this.terminate(new Error(`Could not authenticate, cannot recover automatically: ${e}`))}))}onError(e){const t=oS();return Promise.race([t.promise,this._terminationReason.promise]).then((t=>{"UNSUBSCRIBED"!==t&&e(t)})),{unsubscribe:()=>t.resolve("UNSUBSCRIBED")}}user(e){return new yy(e,this._realtimeClient)}conversation(e){return new iN(e,this._realtimeClient)}subscribeConversations(e){return this._realtimeClient.subscribe(["me","conversations"],e)}terminate(e){vN.deregister(this._appId,this.currentUser.id),this._terminationReason.resolve(e),this._realtimeClient.destroy()}_isConnected(){return this._realtimeClient.isConnected()}uploadFile(e,t){return TN(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,t)}uploadImage(e,t){return TN(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,XT({subtype:"image"},t))}uploadVideo(e,t){return TN(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,XT({subtype:"video"},t))}uploadAudio(e,t){return TN(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,XT({subtype:"audio"},t))}uploadVoice(e,t){return TN(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,XT({subtype:"voice"},t))}}function TN(e,t,n,r){return JT(this,arguments,(function*(e,t,n,{subtype:r,filename:i,width:o,height:s,duration:a}){const u=new FormData;return u.set("file",n,i),void 0!==r&&u.set("subtype",r),void 0!==o&&u.set("width",o.toString()),void 0!==s&&u.set("height",s.toString()),void 0!==a&&u.set("duration",a.toString()),uN({method:"POST",url:e,data:u,authProvider:t}).then((e=>e.json())).then((e=>e.attachmentToken)).catch((e=>JT(this,null,(function*(){if(e instanceof Response){const t=yield e.json(),n=`Unexpected response when uploading file, status code ${e.status} ${t.errorCode}, ${t.reasons}`;throw new Error(n)}throw e}))))}))}class SN{constructor(e){this.state$=e,this.currentDoc=zE.EMPTY,this.maxLength=1e3,this.markAsTyping=function(e){let t=!1;return(...n)=>{if(!t)return t=!0,setTimeout((()=>{t=!1}),5e3),e(...n)}}((()=>{this.controller?.markAsTyping()})),this.toggleEmojiPicker=e=>{const t=this.state$.showEmojiPicker;void 0===e?t.toggle():t.set(e)},this.spellcheck$=Cr(),this.placeholder$=Cr()}onPasteImage(e){ii.defined(this.uploadFile),this.uploadFile(e)}onChange(e){this.currentDoc=e;const t=e.asText(),n=e.size>this.maxLength&&t.length>this.maxLength;e.hasContent&&this.markAsTyping(),this.state$.assign({isTyping:e.hasContent,atTextLimit:n,isEmpty:!e.hasContent||0===t.trim().length,characterCount:0===e.size?0:e.size-2})}setMaxLength(e){this.maxLength=e}focus(){this.editorView?.dom.focus()}setText(e){this.editorView&&function(e,t){const n=e.state.doc.content.size,r=t.split(/(<!!(?:mention|customemoji):.*?>)/g).filter((e=>e||e.length)).map((e=>vp.text(e))),i=e.state.tr.replaceWith(0,n,r);e.dispatch(i)}(this.editorView,e)}typeText(e){this.editorView&&function(e,t,n="replace"){const r=e.state.doc.content.size,i="insert"==n?e.state.tr.insertText(t):e.state.tr.insertText(t,0,r);e.dispatch(i)}(this.editorView,e,"insert")}getText(){return this.currentDoc.asText().trim()}clearText(){this.editorView&&function(e){const t=e.state.doc.content.size,n=e.state.tr.insertText("",0,t);e.dispatch(n)}(this.editorView)}insertEmoji(e){this.editorView&&function(e,t){const n=function(e,t){if(t.startsWith(":"))throw new Error("Not implemented");{const n=e.marks.emoji.create({emoji:t});return e.text(t,[n])}}(e.state.schema,t);let r;r=e.state.tr.replaceSelectionWith(n,!1),e.dispatch(r)}(this.editorView,e)}}function yN(e){return Object.keys(e)}let CN;function NN(e,t,n){const r=e.appId,i=e.userId,o=e.conversationId,s=de((()=>UT.fromHost(e.host)),[e.host]),a=de((()=>new Qi),[e.appId]);ue((()=>{a.state$.themeCustom.set(gn({value:e.themeCustom}))}),[a,e.themeCustom]);const u=de((()=>FT()),[e.appId,e.userId,e.token,e.tokenFetcher]),l=function(e){return e.forceCreateNew?new ON(e):vN.getOrCreate(e)}({apiUrls:s,appId:r,userId:i,token:e.token,tokenFetcher:e.tokenFetcher});ae((()=>{const e=l.onError((e=>{mi.error(e.message),a.state$.errors.serverError.set(!0)}));return()=>e.unsubscribe()}),[l,a]);const c=de((()=>new kT(s,r,u,l._authProvider)),[r,u,l,s]),d=de((()=>new SN(a.state$.editor)),[a]),h=de((()=>new BT(a,l,d,t,n)),[l,a,d,t,n]);return d.controller=h,ae((()=>{"loading"!==a.state$.authTokenState.peek()&&a.state$.authTokenState.set("loading"),l._authProvider.getToken().then((()=>{a.state$.authTokenState.set("valid")}));const t=l._authProvider.onTokenRefreshFailed((()=>{a.state$.authTokenState.set(e.tokenFetcher?"invalid":"expired")}));return()=>{t()}}),[l,a,e.tokenFetcher]),ae((()=>{(async function(){return{supportsEmojiPicker:await async function(){return void 0===CN&&(CN=await async function(){if("undefined"==typeof indexedDB)return!1;const e="testdb"+Math.random();try{await new Promise(((t,n)=>{const r=indexedDB.open(e);r.onerror=n,r.onsuccess=()=>{try{r.result.close()}finally{indexedDB.deleteDatabase(e)}t()}}))}catch(e){return!1}return!0}()),CN}(),isMobile:/Mobi/i.test(window.navigator.userAgent)}})().then((e=>a.state$.device.set(e)))}),[a]),ae((()=>{let e=!0;a.resetState(r,i,o);let t=null;const n=l.currentUser.subscribe((async n=>{if(e&&(a.state$.errors.unknownUser.set(!n),n&&(a.state$.currentUser.set(n),n.role!==t))){t=n.role;const r=await c.getApp(n.role);if(!e)return;a.state$.app.set(r)}})),s=l.conversation(o).subscribeMessages((async(t,n)=>{e&&(a.state$.errors.unknownConversation.set(!t),t&&(await a.readyForNewMessagesPromise,a.storeMessages(o,t,n)))}));a.messageSubscription=s;const u=l.conversation(o).subscribeParticipants((t=>{e&&(a.state$.errors.unknownConversation.set(!t),t&&a.state$.participants.child(o).set(t))}));a.participantSubscription=u;const d=l.conversation(o).subscribe((async t=>{e&&(a.state$.errors.unknownConversation.set(!t),t&&a.state$.currentConversation.set(t))})),h=l.conversation(o).subscribeTyping((t=>{e&&(a.state$.errors.unknownConversation.set(!t),t&&a.storeTyping(o,t))}));return()=>{e=!1,n.unsubscribe(),u.unsubscribe(),d.unsubscribe(),s.unsubscribe(),h.unsubscribe(),a.messageSubscription=null}}),[o,i,r,c,l,a,h]),ae((()=>{const e=a.state$.participants.child(o).onChange((({value:e})=>{if(!e)return;const t=new Set;for(const n of e)t.add(n.user.id);Mn((()=>{for(const e of yN(a.onlineSubscriptions))t.has(e)||(a.onlineSubscriptions[e]?.unsubscribe(),delete a.onlineSubscriptions[e],a.state$.isUserConnected.child(e).set(!1))}));for(const n of t)a.onlineSubscriptions[n]||(a.onlineSubscriptions[n]=l.user(n).subscribeOnline((e=>{e?a.state$.isUserConnected.child(n).set(e.isConnected):a.state$.errors.unknownUser.set(!e)})))}),{initial:!0});return()=>{e();for(const e of yN(a.onlineSubscriptions))a.onlineSubscriptions[e].unsubscribe();a.onlineSubscriptions={},a.state$.isUserConnected.set({})}}),[a,o,l]),{store:a,controller:h,editorInternals:d,session:l}}function bN(e,t,n){return he((r=>{e&&e(r);const i=t.current?.parentElement;"T-CHATBOX"===i?.tagName&&function(e,t,n){for(const r of n){const n=new Event(r);Object.assign(n,t),e.dispatchEvent(n)}}(i,r,n)}),[e,t,n])}function IN(e,t,n){return e.clearRect(0,0,100,100),e.fillStyle=n,e.fillText(t,0,0),e.getImageData(0,0,1,1).data.join(",")}function RN(e){const t=function(){const e=document.createElement("canvas");e.width=e.height=1;const t=e.getContext("2d",{willReadFrequently:!0});return t.textBaseline="top",t.font='100px "Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',t.scale(.01,.01),t}(),n=IN(t,e,"#fff"),r=IN(t,e,"#000");return r===n&&!r.startsWith("0,0,0,")}!function(e="Twemoji Country Flags",t="https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2"){if(typeof window<"u"&&RN("😊")&&!RN("🇨🇭")){const n=document.createElement("style");n.textContent=`@font-face {\n font-family: "${e}";\n unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067,\n U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;\n src: url('${t}') format('woff2');\n font-display: swap;\n }`,document.head.appendChild(n)}}(),yg(),function({observableFunctions:e,observableProperties:t,jsonReplacer:n,jsonReviver:r}){if(e)for(const i in e){const t=e[i];nr.set(i,t),Sr.prototype[i]=function(...e){return t.call(this,this._node,...e)}}if(t)for(const i in t){const e=t[i];tr.set(i,e),Object.defineProperty(Sr.prototype,i,{configurable:!0,get(){return e.get.call(this,this._node)},set(t){return e.set.call(this,this._node,t)}})}n&&(Jt.replacer=n),r&&(Jt.reviver=r)}({observableFunctions:{child:(e,t)=>(ii("string"==typeof t||"number"==typeof t,"Key should be a string or a number"),Nr.getProxy(e,t.toString()))}}),mi.registerHandler((({level:e,data:t})=>{console[e]("[TalkJS]",...t)}));const wN=Me((function(e,t){const{onSendMessage:n,onDeleteMessage:r,beforeBrowserPermissionPrompt:i,onMissingBrowserPermission:o,messageFieldPlaceholder:s,messageFieldSpellcheck:a}=e;ae((()=>{e.__internalOnLoaded?.()}),[]);const[u,l]=oe(!0);ae((()=>{l(!1)}),[]);const c=le(null);!function(e){ae((()=>{if(window.cordova){const t=e.current;ii.defined(t);const n=e=>{e.target instanceof HTMLAnchorElement&&(e.preventDefault(),function(e){const t=window;t.cordova.InAppBrowser?t.cordova.InAppBrowser.open(e,"_system"):window.open(e,"_system","location=yes")}(e.target.href))};return t.addEventListener("click",n),()=>t.removeEventListener("click",n)}}),[e])}(c);const d=bN(r,c,["deleteMessage","delete-message","deletemessage","DeleteMessage"]),h=bN(n,c,["sendMessage","send-message","sendmessage","SendMessage"]),p={beforeBrowserPermissionPrompt:i,onMissingBrowserPermissionCallback:bN(o,c,["browserPermissionDenied","browser-permission-denied","browserpermissiondenied","BrowserPermissionDenied"])},{store:f,controller:m,editorInternals:E,session:g}=NN(e,h,d),_=he((async()=>{const e=E.state$;if(e.isEmpty.peek()||e.atTextLimit.peek())return;const t=E.getText(),n=f.state$.referencedMessageId.peek();n&&m.setReferencedMessage(null),E.clearText(),f.state$.editor.showEmojiPicker.set(!1),await m.sendMessage({text:t,referencedMessageId:n??void 0})}),[m,E,f]);ae((()=>{const t=e.enterSendsMessage??!0;E.onEnter=t?_:void 0}),[E,e.enterSendsMessage,_]),ae((()=>{E.spellcheck$.set(a)}),[E,a]),ae((()=>{E.placeholder$.set(s)}),[E,s]),ce(t,(()=>({deleteMessage:e=>m.deleteMessage(e),editMessage:(e,t)=>m.editMessage(e,t),sendMessage:e=>m.sendMessage(e),sendFileMessage:e=>m.sendFileMessage(e),sendLocationMessage:e=>m.sendLocationMessage(e),setReferencedMessage:e=>m.setReferencedMessage(e),getMessageFieldText:()=>E.getText(),setMessageFieldText:e=>E.setText(e)})));const A=he((({error:t})=>bt(so,{appId:e.appId,chatboxState:{type:"unexpected-error",error:t}})),[e.appId]);return bt("div",u?{className:"t-chatbox",ref:c}:{className:"t-chatbox",ref:c,children:bt(wt,{fallbackRender:A,children:bt(ai.Provider,{value:E,children:bt(li.Provider,{value:f,children:bt(oi.Provider,{value:e.theme,children:bt(di.Provider,{value:p,children:bt(TT,{controller:m,appId:e.appId,chatHeaderVisible:e.chatHeaderVisible??!0,messageFieldVisible:e.messageFieldVisible??!0,session:g,sendMessage:_})})})})})})})}));function kN({photoUrl:e}){return mT`
|
|
2
2
|
<div
|
|
3
3
|
className="t-theme-avatar"
|
|
4
4
|
style=${{backgroundImage:`url(${e})`}}
|