@talkjs/web-components 0.0.21 → 0.0.22

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.
@@ -1,6 +1,6 @@
1
1
  var TalkChatbox=function(To){"use strict";"use client";var Qp=function(n,e,t,r){var i;e[0]=0;for(var o=1;o<e.length;o++){var s=e[o++],a=e[o]?(e[0]|=s?1:2,t[e[o++]]):e[++o];s===3?r[0]=a:s===4?r[1]=Object.assign(r[1]||{},a):s===5?(r[1]=r[1]||{})[e[++o]]=a:s===6?r[1][e[++o]]+=a+"":s?(i=n.apply(a,Qp(n,a,t,["",null])),r.push(i),a[0]?e[0]|=2:(e[o-2]=0,e[o]=i)):r.push(a)}return r},ef=new Map;function NT(n){var e=ef.get(this);return e||(e=new Map,ef.set(this,e)),(e=Qp(this,e.get(n)||(e.set(n,e=function(t){for(var r,i,o=1,s="",a="",l=[0],u=function(h){o===1&&(h||(s=s.replace(/^\s*\n\s*|\s*\n\s*$/g,"")))?l.push(0,h,s):o===3&&(h||s)?(l.push(3,h,s),o=2):o===2&&s==="..."&&h?l.push(4,h,0):o===2&&s&&!h?l.push(5,0,!0,s):o>=5&&((s||!h&&o===5)&&(l.push(o,0,s,i),o=6),h&&(l.push(o,h,0,i),o=6)),s=""},c=0;c<t.length;c++){c&&(o===1&&u(),u(c));for(var d=0;d<t[c].length;d++)r=t[c][d],o===1?r==="<"?(u(),l=[l],o=3):s+=r:o===4?s==="--"&&r===">"?(o=1,s=""):s=r+s[0]:a?r===a?a="":s+=r:r==='"'||r==="'"?a=r:r===">"?(u(),o=1):o&&(r==="="?(o=5,i=s,s=""):r==="/"&&(o<5||t[c][d+1]===">")?(u(),o===3&&(l=l[0]),o=l,(l=l[0]).push(2,0,o),o=0):r===" "||r===" "||r===`
2
- `||r==="\r"?(u(),o=2):s+=r),o===3&&s==="!--"&&(o=4,l=l[0])}return u(),l}(n)),e),arguments,[])).length>1?e:e[0]}var So,ue,tf,Tr,nf,rf,of,sf,Iu,wu,Ru,af,bo={},lf=[],CT=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,No=Array.isArray;function En(n,e){for(var t in e)n[t]=e[t];return n}function Du(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function ae(n,e,t){var r,i,o,s={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?So.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(o in n.defaultProps)s[o]==null&&(s[o]=n.defaultProps[o]);return Co(n,s,r,i,null)}function Co(n,e,t,r,i){var o={type:n,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++tf,__i:-1,__u:0};return i==null&&ue.vnode!=null&&ue.vnode(o),o}function uf(){return{current:null}}function xe(n){return n.children}function Xt(n,e){this.props=n,this.context=e}function pi(n,e){if(e==null)return n.__?pi(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?pi(n):null}function cf(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return cf(n)}}function ku(n){(!n.__d&&(n.__d=!0)&&Tr.push(n)&&!aa.__r++||nf!=ue.debounceRendering)&&((nf=ue.debounceRendering)||rf)(aa)}function aa(){for(var n,e,t,r,i,o,s,a=1;Tr.length;)Tr.length>a&&Tr.sort(of),n=Tr.shift(),a=Tr.length,n.__d&&(t=void 0,i=(r=(e=n).__v).__e,o=[],s=[],e.__P&&((t=En({},r)).__v=r.__v+1,ue.vnode&&ue.vnode(t),Lu(e.__P,t,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,o,i??pi(r),!!(32&r.__u),s),t.__v=r.__v,t.__.__k[t.__i]=t,mf(o,t,s),t.__e!=i&&cf(t)));aa.__r=0}function df(n,e,t,r,i,o,s,a,l,u,c){var d,h,p,f,m,g,E=r&&r.__k||lf,v=e.length;for(l=function(A,_,O,T,S){var b,y,C,w,I,F=O.length,L=F,j=0;for(A.__k=new Array(S),b=0;b<S;b++)(y=_[b])!=null&&typeof y!="boolean"&&typeof y!="function"?(w=b+j,(y=A.__k[b]=typeof y=="string"||typeof y=="number"||typeof y=="bigint"||y.constructor==String?Co(null,y,null,null,null):No(y)?Co(xe,{children:y},null,null,null):y.constructor==null&&y.__b>0?Co(y.type,y.props,y.key,y.ref?y.ref:null,y.__v):y).__=A,y.__b=A.__b+1,C=null,(I=y.__i=IT(y,O,w,L))!=-1&&(L--,(C=O[I])&&(C.__u|=2)),C==null||C.__v==null?(I==-1&&(S>F?j--:S<F&&j++),typeof y.type!="function"&&(y.__u|=4)):I!=w&&(I==w-1?j--:I==w+1?j++:(I>w?j--:j++,y.__u|=4))):A.__k[b]=null;if(L)for(b=0;b<F;b++)(C=O[b])!=null&&!(2&C.__u)&&(C.__e==T&&(T=pi(C)),Ef(C,C));return T}(t,e,E,l,v),d=0;d<v;d++)(p=t.__k[d])!=null&&(h=p.__i==-1?bo:E[p.__i]||bo,p.__i=d,g=Lu(n,p,h,i,o,s,a,l,u,c),f=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&xu(h.ref,null,p),c.push(p.ref,p.__c||f,p)),m==null&&f!=null&&(m=f),4&p.__u||h.__k===p.__k?l=hf(p,l,n):typeof p.type=="function"&&g!==void 0?l=g:f&&(l=f.nextSibling),p.__u&=-7);return t.__e=m,l}function hf(n,e,t){var r,i;if(typeof n.type=="function"){for(r=n.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=n,e=hf(r[i],e,t));return e}n.__e!=e&&(e&&n.type&&!t.contains(e)&&(e=pi(n)),t.insertBefore(n.__e,e||null),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Mn(n,e){return e=e||[],n==null||typeof n=="boolean"||(No(n)?n.some(function(t){Mn(t,e)}):e.push(n)),e}function IT(n,e,t,r){var i,o,s=n.key,a=n.type,l=e[t];if(l===null&&n.key==null||l&&s==l.key&&a==l.type&&!(2&l.__u))return t;if(r>(l==null||2&l.__u?0:1))for(i=t-1,o=t+1;i>=0||o<e.length;){if(i>=0){if((l=e[i])&&!(2&l.__u)&&s==l.key&&a==l.type)return i;i--}if(o<e.length){if((l=e[o])&&!(2&l.__u)&&s==l.key&&a==l.type)return o;o++}}return-1}function pf(n,e,t){e[0]=="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||CT.test(e)?t:t+"px"}function la(n,e,t,r,i){var o,s;e:if(e=="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof r=="string"&&(n.style.cssText=r=""),r)for(e in r)t&&e in t||pf(n.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||pf(n.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(sf,"$1")),s=e.toLowerCase(),e=s in n||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),n.l||(n.l={}),n.l[e+o]=t,t?r?t.u=r.u:(t.u=Iu,n.addEventListener(e,o?Ru:wu,o)):n.removeEventListener(e,o?Ru:wu,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?n.removeAttribute(e):n.setAttribute(e,e=="popover"&&t==1?"":t))}}function ff(n){return function(e){if(this.l){var t=this.l[e.type+n];if(e.t==null)e.t=Iu++;else if(e.t<t.u)return;return t(ue.event?ue.event(e):e)}}}function Lu(n,e,t,r,i,o,s,a,l,u){var c,d,h,p,f,m,g,E,v,A,_,O,T,S,b,y,C,w=e.type;if(e.constructor!=null)return null;128&t.__u&&(l=!!(32&t.__u),o=[a=e.__e=t.__e]),(c=ue.__b)&&c(e);e:if(typeof w=="function")try{if(E=e.props,v="prototype"in w&&w.prototype.render,A=(c=w.contextType)&&r[c.__c],_=c?A?A.props.value:c.__:r,t.__c?g=(d=e.__c=t.__c).__=d.__E:(v?e.__c=d=new w(E,_):(e.__c=d=new Xt(E,_),d.constructor=w,d.render=wT),A&&A.sub(d),d.props=E,d.state||(d.state={}),d.context=_,d.__n=r,h=d.__d=!0,d.__h=[],d._sb=[]),v&&d.__s==null&&(d.__s=d.state),v&&w.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=En({},d.__s)),En(d.__s,w.getDerivedStateFromProps(E,d.__s))),p=d.props,f=d.state,d.__v=e,h)v&&w.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),v&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(v&&w.getDerivedStateFromProps==null&&E!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(E,_),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(E,d.__s,_)===!1||e.__v==t.__v){for(e.__v!=t.__v&&(d.props=E,d.state=d.__s,d.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(I){I&&(I.__=e)}),O=0;O<d._sb.length;O++)d.__h.push(d._sb[O]);d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(E,d.__s,_),v&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,f,m)})}if(d.context=_,d.props=E,d.__P=n,d.__e=!1,T=ue.__r,S=0,v){for(d.state=d.__s,d.__d=!1,T&&T(e),c=d.render(d.props,d.state,d.context),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[]}else do d.__d=!1,T&&T(e),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=En(En({},r),d.getChildContext())),v&&!h&&d.getSnapshotBeforeUpdate!=null&&(m=d.getSnapshotBeforeUpdate(p,f)),y=c,c!=null&&c.type===xe&&c.key==null&&(y=gf(c.props.children)),a=df(n,No(y)?y:[y],e,t,r,i,o,s,a,l,u),d.base=e.__e,e.__u&=-161,d.__h.length&&s.push(d),g&&(d.__E=d.__=null)}catch(I){if(e.__v=null,l||o!=null)if(I.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else for(C=o.length;C--;)Du(o[C]);else e.__e=t.__e,e.__k=t.__k;ue.__e(I,e,t)}else o==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):a=e.__e=function(I,F,L,j,D,B,H,x,Q){var Y,J,se,k,Z,te,oe,U=L.props,de=F.props,fe=F.type;if(fe=="svg"?D="http://www.w3.org/2000/svg":fe=="math"?D="http://www.w3.org/1998/Math/MathML":D||(D="http://www.w3.org/1999/xhtml"),B!=null){for(Y=0;Y<B.length;Y++)if((Z=B[Y])&&"setAttribute"in Z==!!fe&&(fe?Z.localName==fe:Z.nodeType==3)){I=Z,B[Y]=null;break}}if(I==null){if(fe==null)return document.createTextNode(de);I=document.createElementNS(D,fe,de.is&&de),x&&(ue.__m&&ue.__m(F,B),x=!1),B=null}if(fe==null)U===de||x&&I.data==de||(I.data=de);else{if(B=B&&So.call(I.childNodes),U=L.props||bo,!x&&B!=null)for(U={},Y=0;Y<I.attributes.length;Y++)U[(Z=I.attributes[Y]).name]=Z.value;for(Y in U)if(Z=U[Y],Y!="children"){if(Y=="dangerouslySetInnerHTML")se=Z;else if(!(Y in de)){if(Y=="value"&&"defaultValue"in de||Y=="checked"&&"defaultChecked"in de)continue;la(I,Y,null,Z,D)}}for(Y in de)Z=de[Y],Y=="children"?k=Z:Y=="dangerouslySetInnerHTML"?J=Z:Y=="value"?te=Z:Y=="checked"?oe=Z:x&&typeof Z!="function"||U[Y]===Z||la(I,Y,Z,U[Y],D);if(J)x||se&&(J.__html==se.__html||J.__html==I.innerHTML)||(I.innerHTML=J.__html),F.__k=[];else if(se&&(I.innerHTML=""),df(F.type=="template"?I.content:I,No(k)?k:[k],F,L,j,fe=="foreignObject"?"http://www.w3.org/1999/xhtml":D,B,H,B?B[0]:L.__k&&pi(L,0),x,Q),B!=null)for(Y=B.length;Y--;)Du(B[Y]);x||(Y="value",fe=="progress"&&te==null?I.removeAttribute("value"):te!=null&&(te!==I[Y]||fe=="progress"&&!te||fe=="option"&&te!=U[Y])&&la(I,Y,te,U[Y],D),Y="checked",oe!=null&&oe!=I[Y]&&la(I,Y,oe,U[Y],D))}return I}(t.__e,e,t,r,i,o,s,l,u);return(c=ue.diffed)&&c(e),128&e.__u?void 0:a}function mf(n,e,t){for(var r=0;r<t.length;r++)xu(t[r],t[++r],t[++r]);ue.__c&&ue.__c(e,n),n.some(function(i){try{n=i.__h,i.__h=[],n.some(function(o){o.call(i)})}catch(o){ue.__e(o,i.__v)}})}function gf(n){return typeof n!="object"||n==null||n.__b&&n.__b>0?n:No(n)?n.map(gf):En({},n)}function xu(n,e,t){try{if(typeof n=="function"){var r=typeof n.__u=="function";r&&n.__u(),r&&e==null||(n.__u=n(e))}else n.current=e}catch(i){ue.__e(i,t)}}function Ef(n,e,t){var r,i;if(ue.unmount&&ue.unmount(n),(r=n.ref)&&(r.current&&r.current!=n.__e||xu(r,null,e)),(r=n.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){ue.__e(o,e)}r.base=r.__P=null}if(r=n.__k)for(i=0;i<r.length;i++)r[i]&&Ef(r[i],e,t||typeof n.type!="function");t||Du(n.__e),n.__c=n.__=n.__e=void 0}function wT(n,e,t){return this.constructor(n,t)}function Io(n,e,t){var r,i,o,s;e==document&&(e=document.documentElement),ue.__&&ue.__(n,e),i=(r=typeof t=="function")?null:t&&t.__k||e.__k,o=[],s=[],Lu(e,n=(!r&&t||e).__k=ae(xe,null,[n]),i||bo,bo,e.namespaceURI,!r&&t?[t]:i?null:e.firstChild?So.call(e.childNodes):null,o,!r&&t?t:i?i.__e:e.firstChild,r,s),mf(o,n,s)}function vf(n,e){Io(n,e,vf)}function RT(n,e,t){var r,i,o,s,a=En({},n.props);for(o in n.type&&n.type.defaultProps&&(s=n.type.defaultProps),e)o=="key"?r=e[o]:o=="ref"?i=e[o]:a[o]=e[o]==null&&s!=null?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?So.call(arguments,2):t),Co(n.type,a,r||n.key,i||n.ref,null)}function kt(n){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(o){this.props.value!=o.value&&r.forEach(function(s){s.__e=!0,ku(s)})},this.sub=function(o){r.add(o);var s=o.componentWillUnmount;o.componentWillUnmount=function(){r&&r.delete(o),s&&s.call(o)}}),t.children}return e.__c="__cC"+af++,e.__=n,e.Provider=e.__l=(e.Consumer=function(t,r){return t.children(r)}).contextType=e,e}So=lf.slice,ue={__e:function(n,e,t,r){for(var i,o,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(n)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,r||{}),s=i.__d),s)return i.__E=i}catch(a){n=a}throw n}},tf=0,Xt.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=En({},this.state),typeof n=="function"&&(n=n(En({},t),this.props)),n&&En(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),ku(this))},Xt.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),ku(this))},Xt.prototype.render=xe,Tr=[],rf=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,of=function(n,e){return n.__v.__b-e.__v.__b},aa.__r=0,sf=/(PointerCapture)$|Capture$/i,Iu=0,wu=ff(!1),Ru=ff(!0),af=0;var Pn,be,Mu,Af,fi=0,_f=[],we=ue,yf=we.__b,Of=we.__r,Tf=we.diffed,Sf=we.__c,bf=we.unmount,Nf=we.__;function Sr(n,e){we.__h&&we.__h(be,n,fi||e),fi=0;var t=be.__H||(be.__H={__:[],__h:[]});return n>=t.__.length&&t.__.push({}),t.__[n]}function ne(n){return fi=1,br(If,n)}function br(n,e,t){var r=Sr(Pn++,2);if(r.t=n,!r.__c&&(r.__=[t?t(e):If(void 0,e),function(a){var l=r.__N?r.__N[0]:r.__[0],u=r.t(l,a);l!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=be,!be.__f)){var i=function(a,l,u){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(h){return!!h.__c});if(c.every(function(h){return!h.__N}))return!o||o.call(this,a,l,u);var d=r.__c.props!==a;return c.forEach(function(h){if(h.__N){var p=h.__[0];h.__=h.__N,h.__N=void 0,p!==h.__[0]&&(d=!0)}}),o&&o.call(this,a,l,u)||d};be.__f=!0;var o=be.shouldComponentUpdate,s=be.componentWillUpdate;be.componentWillUpdate=function(a,l,u){if(this.__e){var c=o;o=void 0,i(a,l,u),o=c}s&&s.call(this,a,l,u)},be.shouldComponentUpdate=i}return r.__N||r.__}function V(n,e){var t=Sr(Pn++,3);!we.__s&&Uu(t.__H,e)&&(t.__=n,t.u=e,be.__H.__h.push(t))}function pt(n,e){var t=Sr(Pn++,4);!we.__s&&Uu(t.__H,e)&&(t.__=n,t.u=e,be.__h.push(t))}function W(n){return fi=5,ce(function(){return{current:n}},[])}function wo(n,e,t){fi=6,pt(function(){if(typeof n=="function"){var r=n(e());return function(){n(null),r&&typeof r=="function"&&r()}}if(n)return n.current=e(),function(){return n.current=null}},t==null?t:t.concat(n))}function ce(n,e){var t=Sr(Pn++,7);return Uu(t.__H,e)&&(t.__=n(),t.__H=e,t.__h=n),t.__}function ie(n,e){return fi=8,ce(function(){return n},e)}function qe(n){var e=be.context[n.__c],t=Sr(Pn++,9);return t.c=n,e?(t.__==null&&(t.__=!0,e.sub(be)),e.props.value):n.__}function Pu(n,e){we.useDebugValue&&we.useDebugValue(e?e(n):n)}function Bu(){var n=Sr(Pn++,11);if(!n.__){for(var e=be.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var t=e.__m||(e.__m=[0,0]);n.__="P"+t[0]+"-"+t[1]++}return n.__}function DT(){for(var n;n=_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(ua),n.__H.__h.forEach(Fu),n.__H.__h=[]}catch(e){n.__H.__h=[],we.__e(e,n.__v)}}we.__b=function(n){be=null,yf&&yf(n)},we.__=function(n,e){n&&e.__k&&e.__k.__m&&(n.__m=e.__k.__m),Nf&&Nf(n,e)},we.__r=function(n){Of&&Of(n),Pn=0;var e=(be=n.__c).__H;e&&(Mu===be?(e.__h=[],be.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(ua),e.__h.forEach(Fu),e.__h=[],Pn=0)),Mu=be},we.diffed=function(n){Tf&&Tf(n);var e=n.__c;e&&e.__H&&(e.__H.__h.length&&(_f.push(e)!==1&&Af===we.requestAnimationFrame||((Af=we.requestAnimationFrame)||kT)(DT)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),Mu=be=null},we.__c=function(n,e){e.some(function(t){try{t.__h.forEach(ua),t.__h=t.__h.filter(function(r){return!r.__||Fu(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],we.__e(r,t.__v)}}),Sf&&Sf(n,e)},we.unmount=function(n){bf&&bf(n);var e,t=n.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{ua(r)}catch(i){e=i}}),t.__H=void 0,e&&we.__e(e,t.__v))};var Cf=typeof requestAnimationFrame=="function";function kT(n){var e,t=function(){clearTimeout(r),Cf&&cancelAnimationFrame(e),setTimeout(n)},r=setTimeout(t,35);Cf&&(e=requestAnimationFrame(t))}function ua(n){var e=be,t=n.__c;typeof t=="function"&&(n.__c=void 0,t()),be=e}function Fu(n){var e=be;n.__c=n.__(),be=e}function Uu(n,e){return!n||n.length!==e.length||e.some(function(t,r){return t!==n[r]})}function If(n,e){return typeof e=="function"?e(n):e}function wf(n,e){for(var t in e)n[t]=e[t];return n}function Hu(n,e){for(var t in n)if(t!=="__source"&&!(t in e))return!0;for(var r in e)if(r!=="__source"&&n[r]!==e[r])return!0;return!1}function $u(n,e){var t=e(),r=ne({t:{__:t,u:e}}),i=r[0].t,o=r[1];return pt(function(){i.__=t,i.u=e,ju(i)&&o({t:i})},[n,t,e]),V(function(){return ju(i)&&o({t:i}),n(function(){ju(i)&&o({t:i})})},[n]),t}function ju(n){var e,t,r=n.u,i=n.__;try{var o=r();return!((e=i)===(t=o)&&(e!==0||1/e==1/t)||e!=e&&t!=t)}catch{return!0}}function Yu(n){n()}function zu(n){return n}function Vu(){return[!1,Yu]}var Wu=pt;function ca(n,e){this.props=n,this.context=e}function mi(n,e){function t(i){var o=this.props.ref,s=o==i.ref;return!s&&o&&(o.call?o(null):o.current=null),e?!e(this.props,i)||!s:Hu(this.props,i)}function r(i){return this.shouldComponentUpdate=t,ae(n,i)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(ca.prototype=new Xt).isPureReactComponent=!0,ca.prototype.shouldComponentUpdate=function(n,e){return Hu(this.props,n)||Hu(this.state,e)};var Rf=ue.__b;ue.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),Rf&&Rf(n)};var LT=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function ee(n){function e(t){var r=wf({},t);return delete r.ref,n(r,t.ref||null)}return e.$$typeof=LT,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(n.displayName||n.name)+")",e}var Df=function(n,e){return n==null?null:Mn(Mn(n).map(e))},vn={map:Df,forEach:Df,count:function(n){return n?Mn(n).length:0},only:function(n){var e=Mn(n);if(e.length!==1)throw"Children.only";return e[0]},toArray:Mn},xT=ue.__e;ue.__e=function(n,e,t,r){if(n.then){for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(n,e)}xT(n,e,t,r)};var kf=ue.unmount;function Lf(n,e,t){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),n.__c.__H=null),(n=wf({},n)).__c!=null&&(n.__c.__P===t&&(n.__c.__P=e),n.__c.__e=!0,n.__c=null),n.__k=n.__k&&n.__k.map(function(r){return Lf(r,e,t)})),n}function xf(n,e,t){return n&&t&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(r){return xf(r,e,t)}),n.__c&&n.__c.__P===e&&(n.__e&&t.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=t)),n}function Ro(){this.__u=0,this.o=null,this.__b=null}function Mf(n){var e=n.__.__c;return e&&e.__a&&e.__a(n)}function Pf(n){var e,t,r;function i(o){if(e||(e=n()).then(function(s){t=s.default||s},function(s){r=s}),r)throw r;if(!t)throw e;return ae(t,o)}return i.displayName="Lazy",i.__f=!0,i}function gi(){this.i=null,this.l=null}ue.unmount=function(n){var e=n.__c;e&&e.__R&&e.__R(),e&&32&n.__u&&(n.type=null),kf&&kf(n)},(Ro.prototype=new Xt).__c=function(n,e){var t=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(t);var i=Mf(r.__v),o=!1,s=function(){o||(o=!0,t.__R=null,i?i(a):a())};t.__R=s;var a=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=xf(l,l.__c.__P,l.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(s,s)},Ro.prototype.componentWillUnmount=function(){this.o=[]},Ro.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Lf(this.__b,t,r.__O=r.__P)}this.__b=null}var i=e.__a&&ae(xe,null,n.fallback);return i&&(i.__u&=-33),[ae(xe,null,e.__a?null:n.children),i]};var Bf=function(n,e,t){if(++t[1]===t[0]&&n.l.delete(e),n.props.revealOrder&&(n.props.revealOrder[0]!=="t"||!n.l.size))for(t=n.i;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;n.i=t=t[2]}};function MT(n){return this.getChildContext=function(){return n.context},n.children}function PT(n){var e=this,t=n.h;if(e.componentWillUnmount=function(){Io(null,e.v),e.v=null,e.h=null},e.h&&e.h!==t&&e.componentWillUnmount(),!e.v){for(var r=e.__v;r!==null&&!r.__m&&r.__!==null;)r=r.__;e.h=t,e.v={nodeType:1,parentNode:t,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},insertBefore:function(i,o){this.childNodes.push(i),e.h.insertBefore(i,o)},removeChild:function(i){this.childNodes.splice(this.childNodes.indexOf(i)>>>1,1),e.h.removeChild(i)}}}Io(ae(MT,{context:e.context},n.__v),e.v)}function Gu(n,e){var t=ae(PT,{__v:n,h:e});return t.containerInfo=e,t}(gi.prototype=new Xt).__a=function(n){var e=this,t=Mf(e.__v),r=e.l.get(n);return r[0]++,function(i){var o=function(){e.props.revealOrder?(r.push(i),Bf(e,n,r)):i()};t?t(o):o()}},gi.prototype.render=function(n){this.i=null,this.l=new Map;var e=Mn(n.children);n.revealOrder&&n.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.l.set(e[t],this.i=[1,0,this.i]);return n.children},gi.prototype.componentDidUpdate=gi.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(e,t){Bf(n,t,e)})};var Ff=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,BT=/^(?: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]/,FT=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,UT=/[A-Z0-9]/g,HT=typeof document<"u",$T=function(n){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(n)};function Xu(n,e,t){return e.__k==null&&(e.textContent=""),Io(n,e),typeof t=="function"&&t(),n?n.__c:null}function Uf(n,e,t){return vf(n,e),typeof t=="function"&&t(),n?n.__c:null}Xt.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(Xt.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})});var Hf=ue.event;function jT(){}function YT(){return this.cancelBubble}function zT(){return this.defaultPrevented}ue.event=function(n){return Hf&&(n=Hf(n)),n.persist=jT,n.isPropagationStopped=YT,n.isDefaultPrevented=zT,n.nativeEvent=n};var Ku,VT={enumerable:!1,configurable:!0,get:function(){return this.class}},$f=ue.vnode;ue.vnode=function(n){typeof n.type=="string"&&function(e){var t=e.props,r=e.type,i={},o=r.indexOf("-")===-1;for(var s in t){var a=t[s];if(!(s==="value"&&"defaultValue"in t&&a==null||HT&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var l=s.toLowerCase();s==="defaultValue"&&"value"in t&&t.value==null?s="value":s==="download"&&a===!0?a="":l==="translate"&&a==="no"?a=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?s="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||$T(t.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":FT.test(s)&&(s=l):l=s="oninput":o&&BT.test(s)?s=s.replace(UT,"-$&").toLowerCase():a===null&&(a=void 0),l==="oninput"&&i[s=l]&&(s="oninputCapture"),i[s]=a}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Mn(t.children).forEach(function(u){u.props.selected=i.value.indexOf(u.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=Mn(t.children).forEach(function(u){u.props.selected=i.multiple?i.defaultValue.indexOf(u.props.value)!=-1:i.defaultValue==u.props.value})),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",VT)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(n),n.$$typeof=Ff,$f&&$f(n)};var jf=ue.__r;ue.__r=function(n){jf&&jf(n),Ku=n.__c};var Yf=ue.diffed;ue.diffed=function(n){Yf&&Yf(n);var e=n.props,t=n.__e;t!=null&&n.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value),Ku=null};var zf={ReactCurrentDispatcher:{current:{readContext:function(n){return Ku.__n[n.__c].props.value},useCallback:ie,useContext:qe,useDebugValue:Pu,useDeferredValue:zu,useEffect:V,useId:Bu,useImperativeHandle:wo,useInsertionEffect:Wu,useLayoutEffect:pt,useMemo:ce,useReducer:br,useRef:W,useState:ne,useSyncExternalStore:$u,useTransition:Vu}}};function Vf(n){return ae.bind(null,n)}function Bn(n){return!!n&&n.$$typeof===Ff}function Wf(n){return Bn(n)&&n.type===xe}function Gf(n){return!!n&&!!n.displayName&&(typeof n.displayName=="string"||n.displayName instanceof String)&&n.displayName.startsWith("Memo(")}function Nr(n){return Bn(n)?RT.apply(null,arguments):n}function qu(n){return!!n.__k&&(Io(null,n),!0)}function Xf(n){return n&&(n.base||n.nodeType===1&&n)||null}var Kf=function(n,e){return n(e)},Do=function(n,e){return n(e)},qf=xe,Jf=Bn,Ce={useState:ne,useId:Bu,useReducer:br,useEffect:V,useLayoutEffect:pt,useInsertionEffect:Wu,useTransition:Vu,useDeferredValue:zu,useSyncExternalStore:$u,startTransition:Yu,useRef:W,useImperativeHandle:wo,useMemo:ce,useCallback:ie,useContext:qe,useDebugValue:Pu,version:"18.3.1",Children:vn,render:Xu,hydrate:Uf,unmountComponentAtNode:qu,createPortal:Gu,createElement:ae,createContext:kt,createFactory:Vf,cloneElement:Nr,createRef:uf,Fragment:xe,isValidElement:Bn,isElement:Jf,isFragment:Wf,isMemo:Gf,findDOMNode:Xf,Component:Xt,PureComponent:ca,memo:mi,forwardRef:ee,flushSync:Do,unstable_batchedUpdates:Kf,StrictMode:qf,Suspense:Ro,SuspenseList:gi,lazy:Pf,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:zf};const Ju=Object.freeze(Object.defineProperty({__proto__:null,Children:vn,Component:Xt,Fragment:xe,PureComponent:ca,StrictMode:qf,Suspense:Ro,SuspenseList:gi,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:zf,cloneElement:Nr,createContext:kt,createElement:ae,createFactory:Vf,createPortal:Gu,createRef:uf,default:Ce,findDOMNode:Xf,flushSync:Do,forwardRef:ee,hydrate:Uf,isElement:Jf,isFragment:Wf,isMemo:Gf,isValidElement:Bn,lazy:Pf,memo:mi,render:Xu,startTransition:Yu,unmountComponentAtNode:qu,unstable_batchedUpdates:Kf,useCallback:ie,useContext:qe,useDebugValue:Pu,useDeferredValue:zu,useEffect:V,useErrorBoundary:function(n){var e=Sr(Pn++,10),t=ne();return e.__=n,be.componentDidCatch||(be.componentDidCatch=function(r,i){e.__&&e.__(r,i),t[1](r)}),[t[0],function(){t[1](void 0)}]},useId:Bu,useImperativeHandle:wo,useInsertionEffect:Wu,useLayoutEffect:pt,useMemo:ce,useReducer:br,useRef:W,useState:ne,useSyncExternalStore:$u,useTransition:Vu,version:"18.3.1"},Symbol.toStringTag,{value:"Module"}));var WT={TALK_GMK:"AIzaSyAs_WXNLlj31EHJI_Lw8siO2B3ZJLUzBH0",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const GT=function(n){return WT[n]}("TALK_GMK");var da=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ha(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function XT(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var Zu={};function KT(n){return String.fromCharCode(parseInt(n.slice(1),16))}Object.defineProperty(Zu,"__esModule",{value:!0});var qT=Zu.encode=function(n){return btoa(encodeURIComponent(n).replace(/%[0-9A-F]{2}/g,KT))};function JT(n){return`%${`00${n.charCodeAt(0).toString(16)}`.slice(-2)}`}Zu.decode=function(n){return decodeURIComponent(Array.from(atob(n),JT).join(""))};const ZT=/[^a-zA-Z\u00C0-\u024F\u1E00-\u1EFF\u0400-\u044f\u0300-\u036e]+/,QT=n=>n.split(ZT).filter(e=>e).map(e=>e[0]).join("")||n[Symbol.iterator]().next().value||"";function Zf(n){const e=function(t){let r=0;for(let i=0;i<t.length;i++)r=(r<<5)-r+t.charCodeAt(i),r|=0;return Math.abs(r)}(n)%em.length;return em[e]}function Qu(n,e){const t=e.lastIndex;let r;const i=[];for(;(r=e.exec(n))!==null;)i.push(r);return e.lastIndex=t,i}function pa(n){const e=n.replace(/%2F/g,"/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/,"$1");return decodeURIComponent(e)}function Qf(n,e){return n.localeCompare(e,void 0,{usage:"search",sensitivity:"base"})===0}function eS(n){return[...n.matchAll(/^|\s+/g)].map(t=>t.index+t[0].length).map(t=>n.substring(t))}const em=["#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"];var tS=0;function N(n,e,t,r,i,o){e||(e={});var s,a,l=e;if("ref"in l)for(a in l={},e)a=="ref"?s=e[a]:l[a]=e[a];var u={type:n,props:l,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--tS,__i:-1,__u:0,__source:i,__self:o};if(typeof n=="function"&&(s=n.defaultProps))for(a in s)l[a]===void 0&&(l[a]=s[a]);return ue.vnode&&ue.vnode(u),u}function tm(){}function nm(){}nm.resetWarningCache=tm;function rm(){return!(typeof window>"u"||!window.document||!window.document.createElement)}(function(){function n(r,i,o,s,a,l){if(l!=="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"){var u=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 u.name="Invariant Violation",u}}function e(){return n}n.isRequired=n;var t={array:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:nm,resetWarningCache:tm};t.PropTypes=t})();var Ei=rm()?pt:V;function im(){var n=ne(Object.create(null))[1];return ie(function(){n(Object.create(null))},[])}var om,nS=function(n){var e=n.children,t=n.type,r=t===void 0?"reach-portal":t,i=W(null),o=W(null),s=im();return Ei(function(){if(i.current){var a=i.current.ownerDocument;return o.current=a?.createElement(r),a.body.appendChild(o.current),s(),function(){o.current&&o.current.ownerDocument&&o.current.ownerDocument.body.removeChild(o.current)}}},[r,s]),o.current?Gu(e,o.current):ae("span",{ref:i})},rS=["bottom","height","left","right","top","width"],Qn=new Map,iS=function n(){var e=[];Qn.forEach(function(t,r){var i=r.getBoundingClientRect();(function(o,s){return o===void 0&&(o={}),s===void 0&&(s={}),rS.some(function(a){return o[a]!==s[a]})})(i,t.rect)&&(t.rect=i,e.push(t))}),e.forEach(function(t){t.callbacks.forEach(function(r){return r(t.rect)})}),om=window.requestAnimationFrame(n)};function ec(n){return!(!n||{}.toString.call(n)!="[object Function]")}function sm(n,e,t){var r,i,o;typeof e=="boolean"?r=e:(r=(o=e?.observe)==null||o,i=e?.onChange),ec(t)&&(i=t);var s=ne(n.current),a=s[0],l=s[1],u=W(!1),c=W(!1),d=ne(null),h=d[0],p=d[1],f=W(i);return Ei(function(){f.current=i,n.current!==a&&l(n.current)}),Ei(function(){a&&!u.current&&(u.current=!0,p(a.getBoundingClientRect()))},[a]),Ei(function(){if(r){var m=a;if(c.current||(c.current=!0,m=n.current),m){var g,E,v=(g=m,E=function(A){f.current==null||f.current(A),p(A)},{observe:function(){var A=Qn.size===0;Qn.has(g)?Qn.get(g).callbacks.push(E):Qn.set(g,{rect:void 0,hasRectChanged:!1,callbacks:[E]}),A&&iS()},unobserve:function(){var A=Qn.get(g);if(A){var _=A.callbacks.indexOf(E);_>=0&&A.callbacks.splice(_,1),A.callbacks.length||Qn.delete(g),Qn.size||cancelAnimationFrame(om)}}});return v.observe(),function(){v.unobserve()}}}},[r,a,n]),h}function ko(n){return rm()?n?n.ownerDocument:document:null}function am(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function oS(n,e){var t;if(typeof Symbol>"u"||n[Symbol.iterator]==null){if(Array.isArray(n)||(t=function(i,o){if(i){if(typeof i=="string")return am(i,o);var s=Object.prototype.toString.call(i).slice(8,-1);return s==="Object"&&i.constructor&&(s=i.constructor.name),s==="Map"||s==="Set"?Array.from(i):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?am(i,o):void 0}}(n))||e){t&&(n=t);var r=0;return function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return(t=n[Symbol.iterator]()).next.bind(t)}function sS(n,e){if(n!=null)if(ec(n))n(e);else try{n.current=e}catch{throw new Error('Cannot assign value "'+e+'" to ref "'+n+'"')}}function Lo(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return ie(function(r){for(var i,o=oS(e);!(i=o()).done;)sS(i.value,r)},e)}var lm=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],tc=lm.join(","),nc=typeof Element>"u"?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function rc(n,e){e=e||{};var t,r,i,o=[],s=[],a=n.querySelectorAll(tc);for(e.includeContainer&&nc.call(n,tc)&&(a=Array.prototype.slice.apply(a)).unshift(n),t=0;t<a.length;t++)um(r=a[t])&&((i=dm(r))===0?o.push(r):s.push({documentOrder:t,tabIndex:i,node:r}));var l=s.sort(lS).map(function(u){return u.node}).concat(o);return l}function um(n){return!(!cm(n)||function(e){return function(t){return hm(t)&&t.type==="radio"}(e)&&!function(t){if(!t.name)return!0;var r=t.ownerDocument.querySelectorAll('input[type="radio"][name="'+t.name+'"]'),i=function(o){for(var s=0;s<o.length;s++)if(o[s].checked)return o[s]}(r);return!i||i===t}(e)}(n)||dm(n)<0)}function cm(n){return!(n.disabled||function(e){return hm(e)&&e.type==="hidden"}(n)||function(e){return e.offsetParent===null||getComputedStyle(e).visibility==="hidden"}(n))}rc.isTabbable=function(n){if(!n)throw new Error("No node provided");return nc.call(n,tc)!==!1&&um(n)},rc.isFocusable=function(n){if(!n)throw new Error("No node provided");return nc.call(n,aS)!==!1&&cm(n)};var aS=lm.concat("iframe").join(",");function dm(n){var e=parseInt(n.getAttribute("tabindex"),10);return isNaN(e)?function(t){return t.contentEditable==="true"}(n)?0:n.tabIndex:e}function lS(n,e){return n.tabIndex===e.tabIndex?n.documentOrder-e.documentOrder:n.tabIndex-e.tabIndex}function hm(n){return n.tagName==="INPUT"}const Fn=ha(rc);function vi(){return vi=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},vi.apply(this,arguments)}var uS=["as","targetRef","position","unstable_observableRefs"],cS=ee(function(n,e){return ae(nS,null,ae(dS,vi({ref:e},n)))}),dS=ee(function(n,e){var t=n.as,r=t===void 0?"div":t,i=n.targetRef,o=n.position,s=o===void 0?pS:o,a=n.unstable_observableRefs,l=a===void 0?[]:a,u=function(f,m){if(f==null)return{};var g,E,v={},A=Object.keys(f);for(E=0;E<A.length;E++)g=A[E],m.indexOf(g)>=0||(v[g]=f[g]);return v}(n,uS),c=W(null),d=sm(c,{observe:!u.hidden}),h=sm(i,{observe:!u.hidden}),p=Lo(c,e);return function(f,m){var g=ko(f.current);function E(D){D.key==="Tab"&&m.current&&Fn(m.current).length===0||(D.key==="Tab"&&D.shiftKey?S(D)?b(D):y(D)?C(D):I(D)&&L():D.key==="Tab"&&(A()?_(D):O()?T(D):w(D)&&L()))}function v(){var D=Fn(g),B=D&&f.current?D.indexOf(f.current):-1,H=D&&D[B+1];return(!m.current||!m.current.contains(H||null))&&H}function A(){return!!f.current&&f.current===g.activeElement}function _(D){var B=m.current&&Fn(m.current);B&&B[0]&&(D.preventDefault(),B[0].focus())}function O(){if(m.current&&m.current.contains(g.activeElement||null)){var D=m.current&&Fn(m.current);return!!(D&&D[D.length-1]===g.activeElement)}return!1}function T(D){var B=v();B&&(D.preventDefault(),B.focus())}function S(D){if(D.shiftKey){var B=v();return D.target===B}}function b(D){var B=m.current&&Fn(m.current),H=B&&B[B.length-1];H&&(D.preventDefault(),H.focus())}function y(D){var B=m.current&&Fn(m.current);return!!B&&B.length!==0&&D.target===B[0]}function C(D){var B;D.preventDefault(),(B=f.current)==null||B.focus()}function w(D){var B=m.current?Fn(g).filter(function(H){return!m.current.contains(H)}):null;return!!B&&D.target===B[B.length-1]}function I(D){return D.target===Fn(g)[0]}V(function(){return g.addEventListener("keydown",E),function(){g.removeEventListener("keydown",E)}},[]);var F=[];function L(){var D=m.current&&Fn(m.current);D&&(D.forEach(function(B){F.push([B,B.tabIndex]),B.tabIndex=-1}),g.addEventListener("focusin",j))}function j(){g.removeEventListener("focusin",j),F.forEach(function(D){var B=D[0],H=D[1];B.tabIndex=H})}}(i,c),ae(r,vi({"data-reach-popover":"",ref:p},u,{style:vi({position:"absolute"},hS.apply(void 0,[s,h,d].concat(l)),u.style)}))});function hS(n,e,t){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];return t?n.apply(void 0,[e,t].concat(i.map(function(s){return s.current}))):{visibility:"hidden"}}var pS=function(n,e){if(!n||!e)return{};var t=function(o,s,a,l){a===void 0&&(a=0),l===void 0&&(l=0);var u={top:o.top-s.height<0,right:window.innerWidth<o.left+s.width-a,bottom:window.innerHeight<o.bottom+s.height-l,left:o.left+o.width-s.width<0},c=u.right&&!u.left,d=u.left&&!u.right,h=u.bottom&&!u.top,p=u.top&&!u.bottom;return{directionRight:c,directionLeft:d,directionUp:h,directionDown:p}}(n,e),r=t.directionRight,i=t.directionUp;return vi({left:r?n.right-e.width+window.pageXOffset+"px":n.left+window.pageXOffset+"px"},function(o,s,a){return{top:a?o.top-s.height+window.pageYOffset+"px":o.top+o.height+window.pageYOffset+"px"}}(n,e,i))},ic=!1,fS=0,pm=function(){return++fS};function fm(n,e){return kt(e)}function mm(){}function er(){return er=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},er.apply(this,arguments)}var mS=["element","index"];function gS(n,e){return e===void 0&&(e={}),fm(0,er({descendants:[],registerDescendant:mm,unregisterDescendant:mm},e))}function ES(n){var e=n.context,t=n.children,r=n.items,i=n.set,o=ie(function(a){var l=a.element,u=a.index,c=function(d,h){if(d==null)return{};var p,f,m={},g=Object.keys(d);for(f=0;f<g.length;f++)p=g[f],h.indexOf(p)>=0||(m[p]=d[p]);return m}(a,mS);l&&i(function(d){var h;if(u!=null)return[].concat(d,[er({},c,{element:l,index:u})]).sort(function(m,g){return m.index-g.index});if(d.length===0)h=[er({},c,{element:l,index:0})];else if(d.find(function(m){return m.element===l}))h=d;else{var p=d.findIndex(function(m){return!(!m.element||!l)&&!!(m.element.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_PRECEDING)}),f=er({},c,{element:l,index:p});h=p===-1?[].concat(d,[f]):[].concat(d.slice(0,p),[f],d.slice(p))}return h.map(function(m,g){return er({},m,{index:g})})})},[]),s=ie(function(a){a&&i(function(l){return l.filter(function(u){return a!==u.element})})},[]);return ae(e.Provider,{value:ce(function(){return{descendants:r,registerDescendant:o,unregisterDescendant:s}},[r,o,s])},t)}function fa(n){return"which"in n?n.which===3:"button"in n&&n.button===2}function oc(n){var e=W(null);return V(function(){e.current=n},[n]),e.current}function sc(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(function(r){return r!=null}).join("--")}function Lt(n,e){return function(t){if(n&&n(t),!t.defaultPrevented)return e(t)}}function ma(n,e){if(n==null)return{};var t,r,i={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(i[t]=n[t]);return i}function ft(){return ft=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ft.apply(this,arguments)}var vS=["onKeyDown","onMouseDown","id","ref"],AS=["index","isLink","onClick","onDragStart","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseUp","onSelect","disabled","onFocus","valueText","ref"],_S=["id","onKeyDown","ref"],yS=["onBlur","portal","position","ref"],gm="CLEAR_SELECTION_INDEX",ac="CLICK_MENU_ITEM",xo="CLOSE_MENU",lc="OPEN_MENU_AT_INDEX",Em="OPEN_MENU_CLEARED",uc="SEARCH_FOR_ITEM",tr="SELECT_ITEM_AT_INDEX",vm="SET_BUTTON_ID",ga=gS(),cc=fm(0,{}),OS={triggerId:null,isExpanded:!1,typeaheadQuery:"",selectionIndex:-1},TS=function(n){var e=n.id,t=n.children,r=W(null),i=W(null),o=W(null),s=ne([]),a=s[0],l=s[1],u=function(_){var O=ne(_||(ic?pm():null)),T=O[0],S=O[1];return Ei(function(){T===null&&S(pm())},[]),V(function(){ic===!1&&(ic=!0)},[]),T!=null?String(T):void 0}(e),c=e||sc("menu",u),d=sc("menu-button",c),h=br(NS,ft({},OS,{triggerId:d})),p=h[0],f=h[1],m=W(!1),g=W([]),E=W(!1),v=W({x:0,y:0}),A={dispatch:f,dropdownId:c,dropdownRef:i,mouseDownStartPosRef:v,popoverRef:o,readyToSelect:E,selectCallbacks:g,state:p,triggerClickedRef:m,triggerRef:r};return V(function(){p.isExpanded?(window.__REACH_DISABLE_TOOLTIPS=!0,window.requestAnimationFrame(function(){Ea(i.current)})):window.__REACH_DISABLE_TOOLTIPS=!1},[p.isExpanded]),ae(ES,{context:ga,items:a,set:l},ae(cc.Provider,{value:A},ec(t)?t({isExpanded:p.isExpanded,isOpen:p.isExpanded}):t))};function SS(n){var e=n.index,t=n.isLink,r=t!==void 0&&t,i=n.onClick,o=n.onDragStart,s=n.onMouseDown,a=n.onMouseEnter,l=n.onMouseLeave,u=n.onMouseMove,c=n.onMouseUp,d=n.onSelect,h=n.disabled,p=n.onFocus,f=n.valueText,m=n.ref,g=ma(n,AS),E=va(),v=E.dispatch,A=E.dropdownRef,_=E.mouseDownStartPosRef,O=E.readyToSelect,T=E.selectCallbacks,S=E.triggerRef,b=E.state,y=b.selectionIndex,C=b.isExpanded,w=W(null),I=ne(f||""),F=I[0],L=I[1],j=ie(function(k){!f&&k!=null&&k.textContent&&L(k.textContent)},[f]),D=W(!1),B=function(k,Z){var te=ne(Z),oe=te[0],U=te[1];return[oe,ie(function(de){k.current=de,U(de)},[])]}(w,null),H=B[0],x=B[1],Q=function(k,Z,te){var oe=im(),U=qe(Z),de=U.registerDescendant,fe=U.unregisterDescendant,Ne=U.descendants,ge=te??Ne.findIndex(function(he){return he.element===k.element});return Ei(function(){return k.element||oe(),de(er({},k,{index:ge})),function(){fe(k.element)}},[k,oe,ge,de,fe].concat(Object.values(k))),ge}(ce(function(){return{element:H,key:F,disabled:h,isLink:r}},[h,H,r,F]),ga,e),Y=Q===y&&!h,J=Lo(m,x,j);function se(){Ea(S.current),d&&d(),v({type:ac})}return T.current[Q]=d,V(function(){if(C){var k=window.setTimeout(function(){O.current=!0},400);return function(){window.clearTimeout(k)}}O.current=!1},[C,O]),V(function(){var k=ko(w.current);return k.addEventListener("mouseup",Z),function(){k.removeEventListener("mouseup",Z)};function Z(){D.current=!1}},[]),{data:{disabled:h},props:ft({id:Am(Q),tabIndex:-1},g,{ref:J,"data-disabled":h?"":void 0,"data-selected":Y?"":void 0,"data-valuetext":F,onClick:Lt(i,function(k){fa(k.nativeEvent)||r&&(h?k.preventDefault():se())}),onDragStart:Lt(o,function(k){r&&k.preventDefault()}),onMouseDown:Lt(s,function(k){fa(k.nativeEvent)||(r?D.current=!0:k.preventDefault())}),onMouseEnter:Lt(a,function(k){var Z=ko(A.current);Y||Q==null||h||(A!=null&&A.current&&A.current!==Z.activeElement&&w.current!==Z.activeElement&&A.current.focus(),v({type:tr,payload:{index:Q}}))}),onMouseLeave:Lt(l,function(k){v({type:gm})}),onMouseMove:Lt(u,function(k){if(!O.current){var Z=Math.abs(k.clientX-_.current.x),te=Math.abs(k.clientY-_.current.y);(Z>8||te>8)&&(O.current=!0)}Y||Q==null||h||v({type:tr,payload:{index:Q,dropdownRef:A}})}),onFocus:Lt(p,function(){O.current=!0,Y||Q==null||h||v({type:tr,payload:{index:Q}})}),onMouseUp:Lt(c,function(k){fa(k.nativeEvent)||(O.current?r?D.current?D.current=!1:w.current&&w.current.click():h||se():O.current=!0)})})}}function bS(n){n.id;var e=n.onKeyDown,t=n.ref,r=ma(n,_S),i=va(),o=i.dispatch,s=i.triggerRef,a=i.dropdownRef,l=i.selectCallbacks,u=i.dropdownId,c=i.state,d=c.isExpanded,h=c.triggerId,p=c.selectionIndex,f=c.typeaheadQuery,m=_m(),g=Lo(a,t);V(function(){var O=function(S,b){if(b===void 0&&(b=""),!b)return null;var y=S.find(function(C){var w,I,F;return!C.disabled&&((w=C.element)==null||(I=w.dataset)==null||(F=I.valuetext)==null?void 0:F.toLowerCase().startsWith(b))});return y?S.indexOf(y):null}(m,f);f&&O!=null&&o({type:tr,payload:{index:O,dropdownRef:a}});var T=window.setTimeout(function(){return f&&o({type:uc,payload:""})},1e3);return function(){return window.clearTimeout(T)}},[o,m,f,a]);var E=oc(m.length),v=oc(m[p]),A=oc(p);V(function(){p>m.length-1?o({type:tr,payload:{index:m.length-1,dropdownRef:a}}):E!==m.length&&p>-1&&v&&A===p&&m[p]!==v&&o({type:tr,payload:{index:m.findIndex(function(O){return O.key===v?.key}),dropdownRef:a}})},[a,o,m,E,v,A,p]);var _=Lt(function(O){var T=O.key;if(d)switch(T){case"Enter":case" ":var S=m.find(function(y){return y.index===p});S&&!S.disabled&&(O.preventDefault(),S.isLink&&S.element?S.element.click():(Ea(s.current),l.current[S.index]&&l.current[S.index](),o({type:ac})));break;case"Escape":Ea(s.current),o({type:xo});break;case"Tab":O.preventDefault();break;default:if(typeof T=="string"&&T.length===1){var b=f+T.toLowerCase();o({type:uc,payload:b})}}},function(O,T){var S=qe(O).descendants,b=T.callback,y=T.currentIndex,C=T.filter,w=T.key,I=w===void 0?"index":w,F=T.orientation,L=F===void 0?"vertical":F,j=T.rotate,D=j===void 0||j,B=T.rtl,H=B!==void 0&&B;return function(x){if(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(x.key)){var Q=y??-1,Y=C?S.filter(C):S;if(Y.length){var J=Y.findIndex(function(rn){return rn.index===y});switch(x.key){case"ArrowDown":if(L==="vertical"||L==="both"){x.preventDefault();var se=Ne();b(I==="option"?se:se[I])}break;case"ArrowUp":if(L==="vertical"||L==="both"){x.preventDefault();var k=ge();b(I==="option"?k:k[I])}break;case"ArrowLeft":if(L==="horizontal"||L==="both"){x.preventDefault();var Z=(H?Ne:ge)();b(I==="option"?Z:Z[I])}break;case"ArrowRight":if(L==="horizontal"||L==="both"){x.preventDefault();var te=(H?ge:Ne)();b(I==="option"?te:te[I])}break;case"PageUp":x.preventDefault();var oe=(x.ctrlKey?ge:he)();b(I==="option"?oe:oe[I]);break;case"Home":x.preventDefault();var U=he();b(I==="option"?U:U[I]);break;case"PageDown":x.preventDefault();var de=(x.ctrlKey?Ne:et)();b(I==="option"?de:de[I]);break;case"End":x.preventDefault();var fe=et();b(I==="option"?fe:fe[I])}}}function Ne(){return Q===et().index?D?he():Y[J]:Y[(J+1)%Y.length]}function ge(){return Q===he().index?D?et():Y[J]:Y[(J-1+Y.length)%Y.length]}function he(){return Y[0]}function et(){return Y[Y.length-1]}}}(ga,{currentIndex:p,orientation:"vertical",rotate:!1,filter:function(O){return!O.disabled},callback:function(O){o({type:tr,payload:{index:O,dropdownRef:a}})},key:"index"}));return{data:{activeDescendant:Am(p)||void 0,triggerId:h},props:ft({tabIndex:-1},r,{ref:g,id:u,onKeyDown:Lt(e,_)})}}function Am(n){var e=qe(cc).dropdownId;return n!=null&&n>-1?sc("option-"+n,e):void 0}function Ea(n){n&&n.focus()}function NS(n,e){switch(e===void 0&&(e={}),e.type){case ac:case xo:return ft({},n,{isExpanded:!1,selectionIndex:-1});case"OPEN_MENU_AT_FIRST_ITEM":return ft({},n,{isExpanded:!0,selectionIndex:0});case lc:return ft({},n,{isExpanded:!0,selectionIndex:e.payload.index});case Em:return ft({},n,{isExpanded:!0,selectionIndex:-1});case tr:var t=e.payload.dropdownRef,r=t===void 0?{current:null}:t;if(e.payload.index>=0&&e.payload.index!==n.selectionIndex){if(r.current){var i=ko(r.current);r.current!==i?.activeElement&&r.current.focus()}return ft({},n,{selectionIndex:e.payload.max!=null?Math.min(Math.max(e.payload.index,0),e.payload.max):Math.max(e.payload.index,0)})}return n;case gm:return ft({},n,{selectionIndex:-1});case vm:return ft({},n,{triggerId:e.payload});case uc:return e.payload!==void 0?ft({},n,{typeaheadQuery:e.payload}):n;default:return n}}function va(){return qe(cc)}function _m(){return qe(ga).descendants}var ym={exports:{}},Ae={},Qe=typeof Symbol=="function"&&Symbol.for,dc=Qe?Symbol.for("react.element"):60103,hc=Qe?Symbol.for("react.portal"):60106,Aa=Qe?Symbol.for("react.fragment"):60107,_a=Qe?Symbol.for("react.strict_mode"):60108,ya=Qe?Symbol.for("react.profiler"):60114,Oa=Qe?Symbol.for("react.provider"):60109,Ta=Qe?Symbol.for("react.context"):60110,pc=Qe?Symbol.for("react.async_mode"):60111,Sa=Qe?Symbol.for("react.concurrent_mode"):60111,ba=Qe?Symbol.for("react.forward_ref"):60112,Na=Qe?Symbol.for("react.suspense"):60113,CS=Qe?Symbol.for("react.suspense_list"):60120,Ca=Qe?Symbol.for("react.memo"):60115,Ia=Qe?Symbol.for("react.lazy"):60116,IS=Qe?Symbol.for("react.block"):60121,wS=Qe?Symbol.for("react.fundamental"):60117,RS=Qe?Symbol.for("react.responder"):60118,DS=Qe?Symbol.for("react.scope"):60119;function xt(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case dc:switch(n=n.type){case pc:case Sa:case Aa:case ya:case _a:case Na:return n;default:switch(n=n&&n.$$typeof){case Ta:case ba:case Ia:case Ca:case Oa:return n;default:return e}}case hc:return e}}}function Om(n){return xt(n)===Sa}Ae.AsyncMode=pc,Ae.ConcurrentMode=Sa,Ae.ContextConsumer=Ta,Ae.ContextProvider=Oa,Ae.Element=dc,Ae.ForwardRef=ba,Ae.Fragment=Aa,Ae.Lazy=Ia,Ae.Memo=Ca,Ae.Portal=hc,Ae.Profiler=ya,Ae.StrictMode=_a,Ae.Suspense=Na,Ae.isAsyncMode=function(n){return Om(n)||xt(n)===pc},Ae.isConcurrentMode=Om,Ae.isContextConsumer=function(n){return xt(n)===Ta},Ae.isContextProvider=function(n){return xt(n)===Oa},Ae.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===dc},Ae.isForwardRef=function(n){return xt(n)===ba},Ae.isFragment=function(n){return xt(n)===Aa},Ae.isLazy=function(n){return xt(n)===Ia},Ae.isMemo=function(n){return xt(n)===Ca},Ae.isPortal=function(n){return xt(n)===hc},Ae.isProfiler=function(n){return xt(n)===ya},Ae.isStrictMode=function(n){return xt(n)===_a},Ae.isSuspense=function(n){return xt(n)===Na},Ae.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===Aa||n===Sa||n===ya||n===_a||n===Na||n===CS||typeof n=="object"&&n!==null&&(n.$$typeof===Ia||n.$$typeof===Ca||n.$$typeof===Oa||n.$$typeof===Ta||n.$$typeof===ba||n.$$typeof===wS||n.$$typeof===RS||n.$$typeof===DS||n.$$typeof===IS)},Ae.typeOf=xt,ym.exports=Ae;var kS=ym.exports;function Mt(){return Mt=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Mt.apply(this,arguments)}function Ai(n,e){if(n==null)return{};var t,r,i={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(i[t]=n[t]);return i}var LS=["as","id","children"],xS=["as"],MS=["as"],PS=["as"],BS=["as"],FS=["as"],US=ee(function(n,e){var t=n.as,r=t===void 0?xe:t,i=n.id,o=n.children,s=Ai(n,LS),a=ce(function(){try{return kS.isFragment(ae(r,null))}catch{return!1}},[r])?{}:Mt({ref:e,id:i,"data-reach-menu":""},s);return ae(r,a,ae(TS,{id:i,children:o}))}),HS=ee(function(n,e){var t=n.as,r=t===void 0?"button":t,i=function(s){var a=s.onKeyDown,l=s.onMouseDown,u=s.id,c=s.ref,d=ma(s,vS),h=va(),p=h.dispatch,f=h.dropdownId,m=h.mouseDownStartPosRef,g=h.triggerClickedRef,E=h.triggerRef,v=h.state,A=v.triggerId,_=v.isExpanded,O=Lo(E,c),T=_m(),S=ce(function(){return T.findIndex(function(b){return!b.disabled})},[T]);return V(function(){u!=null&&u!==A&&p({type:vm,payload:u})},[A,p,u]),{data:{isExpanded:_,controls:f},props:ft({},d,{ref:O,id:A||void 0,onKeyDown:Lt(a,function(b){switch(b.key){case"ArrowDown":case"ArrowUp":b.preventDefault(),p({type:lc,payload:{index:S}});break;case"Enter":case" ":p({type:lc,payload:{index:S}})}}),onMouseDown:Lt(l,function(b){fa(b.nativeEvent)||(m.current={x:b.clientX,y:b.clientY},_||(g.current=!0),p(_?{type:xo}:{type:Em}))}),type:"button"})}}(Mt({},Ai(n,xS),{ref:e})),o=i.data;return ae(r,Mt({"aria-expanded":!!o.isExpanded||void 0,"aria-haspopup":!0,"aria-controls":o.controls},i.props,{"data-reach-menu-button":""}))}),$S=ee(function(n,e){var t=n.as,r=t===void 0?"div":t,i=SS(Mt({},Ai(n,MS),{ref:e})),o=i.data.disabled;return ae(r,Mt({role:"menuitem"},i.props,{"aria-disabled":o||void 0,"data-reach-menu-item":""}))}),jS=ee(function(n,e){var t=n.as,r=t===void 0?"div":t,i=Ai(n,PS);return ae($S,Mt({},i,{ref:e,as:r}))}),YS=ee(function(n,e){var t=n.as,r=t===void 0?"div":t,i=bS(Mt({},Ai(n,BS),{ref:e})),o=i.data;return ae(r,Mt({"aria-activedescendant":o.activeDescendant,"aria-labelledby":o.triggerId||void 0,role:"menu"},i.props,{"data-reach-menu-items":""}))}),zS=ee(function(n,e){var t=n.as,r=t===void 0?"div":t,i=function(d){var h=d.onBlur,p=d.portal,f=p===void 0||p,m=d.position,g=d.ref,E=ma(d,yS),v=va(),A=v.triggerRef,_=v.triggerClickedRef,O=v.dispatch,T=v.dropdownRef,S=v.popoverRef,b=v.state.isExpanded,y=Lo(S,g);return V(function(){if(b){var C=ko(S.current);return C.addEventListener("mousedown",w),function(){C.removeEventListener("mousedown",w)}}function w(I){var F,L;_.current?_.current=!1:(F=S.current,L=I.target,F&&F.contains(L)||O({type:xo}))}},[_,A,O,T,S,b]),{data:{portal:f,position:m,targetRef:A,isExpanded:b},props:ft({ref:y,hidden:!b,onBlur:Lt(h,function(C){C.currentTarget.contains(C.relatedTarget)||O({type:xo})})},E)}}(Mt({},Ai(n,FS),{ref:e})),o=i.data,s=o.portal,a=o.targetRef,l=o.position,u=i.props,c={"data-reach-menu-popover":""};return s?ae(cS,Mt({},u,c,{as:r,targetRef:a,position:l})):ae(r,Mt({},u,c))}),fc=[],mc=function(n){return n===void 0},wa=/\s*(\.\d+|\d+(?:\.\d+)?)(%|deg)?\s*/,Ra=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,VS=new RegExp("^(rgb|hsl|hsv)a?\\("+wa.source+"[, ]"+wa.source+"[, ]"+wa.source+"(?:[,/]"+wa.source+")?\\)$","i");function gc(n,e,t){return n==="%"?100:n==="deg"||t&&e===0?360:n?void 0:255}function _e(n){if(Array.isArray(n)){if(typeof n[0]=="string"&&typeof _e[n[0]]=="function")return new _e[n[0]](n.slice(1,n.length));if(n.length===4)return new _e.RGB(n[0]/255,n[1]/255,n[2]/255,n[3]/255)}else if(typeof n=="string"){var e=n.toLowerCase();_e.namedColors[e]&&(n="#"+_e.namedColors[e]),e==="transparent"&&(n="rgba(0,0,0,0)");var t=n.match(VS);if(t){var r=t[1].toUpperCase(),i=r[0]==="H";if(mc(_e[r]))throw new Error("color."+r+" is not installed.");let a=mc(t[8])?1:void 0;return a===void 0&&(a=t[9]==="%"?parseFloat(t[8])/100:parseFloat(t[8])),new _e[r](parseFloat(t[2])/gc(t[3],0,i),parseFloat(t[4])/gc(t[5],1,i),parseFloat(t[6])/gc(t[7],2,i),a)}n.length<6&&(n=n.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,"$1$1$2$2$3$3$4$4"));var o=n.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 _e.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(_e.CMYK){var s=n.match(new RegExp("^cmyk\\("+Ra.source+","+Ra.source+","+Ra.source+","+Ra.source+"\\)$","i"));if(s)return new _e.CMYK(parseFloat(s[1])/100,parseFloat(s[2])/100,parseFloat(s[3])/100,parseFloat(s[4])/100)}}else if(typeof n=="object"&&n.isColor)return n;return!1}_e.namedColors={},_e.installColorSpace=function(n,e,t){_e[n]=function(a){var l=Array.isArray(a)?a:arguments;e.forEach(function(u,c){var d=l[c];if(u==="alpha")this._alpha=isNaN(d)||d>1?1:d<0?0:d;else{if(isNaN(d))throw new Error("["+n+"]: Invalid color: ("+e.join(",")+")");u==="hue"?this._hue=d<0?d-Math.floor(d):d%1:this["_"+u]=d<0?0:d>1?1:d}},this)},_e[n].propertyNames=e;var r=_e[n].prototype;for(var i in["valueOf","hex","hexa","css","cssa"].forEach(function(a){r[a]=r[a]||(n==="RGB"?r.hex:function(){return this.rgb()[a]()})}),r.isColor=!0,r.equals=function(a,l){mc(l)&&(l=1e-10),a=a[n.toLowerCase()]();for(var u=0;u<e.length;u+=1)if(Math.abs(this["_"+e[u]]-a["_"+e[u]])>l)return!1;return!0},r.toJSON=function(){return[n].concat(e.map(function(a){return this["_"+a]},this))},t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=i.match(/^from(.*)$/);o?_e[o[1].toUpperCase()].prototype[n.toLowerCase()]=t[i]:r[i]=t[i]}function s(a,l){var u={};for(var c in u[l.toLowerCase()]=function(){return this.rgb()[l.toLowerCase()]()},_e[l].propertyNames.forEach(function(d){var h=d==="black"?"k":d.charAt(0);u[d]=u[h]=function(p,f){return this[l.toLowerCase()]()[d](p,f)}}),u)Object.prototype.hasOwnProperty.call(u,c)&&_e[a].prototype[c]===void 0&&(_e[a].prototype[c]=u[c])}return r[n.toLowerCase()]=function(){return this},r.toString=function(){return"["+n+" "+e.map(function(a){return this["_"+a]},this).join(", ")+"]"},e.forEach(function(a){var l=a==="black"?"k":a.charAt(0);r[a]=r[l]=function(u,c){return u===void 0?this["_"+a]:c?new this.constructor(e.map(function(d){return this["_"+d]+(a===d?u:0)},this)):new this.constructor(e.map(function(d){return a===d?u:this["_"+d]},this))}}),fc.forEach(function(a){s(n,a),s(a,n)}),fc.push(n),_e},_e.pluginList=[],_e.use=function(n){return _e.pluginList.indexOf(n)===-1&&(this.pluginList.push(n),n(_e)),_e},_e.installMethod=function(n,e){return fc.forEach(function(t){_e[t].prototype[n]=e}),this},_e.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var n=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-n.length)+n},hexa:function(){var n=Math.round(255*this._alpha).toString(16);return this.hex()+"00".substr(0,2-n.length)+n},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 Tm=function(n){n.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var e=function(o){return o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92},t=e(this._red),r=e(this._green),i=e(this._blue);return new n.XYZ(.4124564*t+.3575761*r+.1804375*i,.2126729*t+.7151522*r+.072175*i,.0193339*t+.119192*r+.9503041*i,this._alpha)},rgb:function(){var e=this._x,t=this._y,r=this._z,i=function(o){return o>.0031308?1.055*Math.pow(o,1/2.4)-.055:12.92*o};return new n.RGB(i(3.2404542*e+-1.5371385*t+-.4985314*r),i(-.969266*e+1.8760108*t+.041556*r),i(.0556434*e+-.2040259*t+1.0572252*r),this._alpha)},lab:function(){var e=function(o){return o>.008856?Math.pow(o,.3333333333333333):7.787037*o+.13793103448275862},t=e(this._x/95.047),r=e(this._y/100),i=e(this._z/108.883);return new n.LAB(116*r-16,500*(t-r),200*(r-i),this._alpha)}})},Sm=function(n){n.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var e,t,r,i=this._hue,o=this._saturation,s=this._value,a=Math.min(5,Math.floor(6*i)),l=6*i-a,u=s*(1-o),c=s*(1-l*o),d=s*(1-(1-l)*o);switch(a){case 0:e=s,t=d,r=u;break;case 1:e=c,t=s,r=u;break;case 2:e=u,t=s,r=d;break;case 3:e=u,t=c,r=s;break;case 4:e=d,t=u,r=s;break;case 5:e=s,t=u,r=c}return new n.RGB(e,t,r,this._alpha)},hsl:function(){var e,t=(2-this._saturation)*this._value,r=this._saturation*this._value,i=t<=1?t:2-t;return e=i<1e-9?0:r/i,new n.HSL(this._hue,e,t/2,this._alpha)},fromRgb:function(){var e,t=this._red,r=this._green,i=this._blue,o=Math.max(t,r,i),s=o-Math.min(t,r,i),a=o===0?0:s/o,l=o;if(s===0)e=0;else switch(o){case t:e=(r-i)/s/6+(r<i?1:0);break;case r:e=(i-t)/s/6+1/3;break;case i:e=(t-r)/s/6+2/3}return new n.HSV(e,a,l,this._alpha)}})},_i=function(n){n.use(Sm),n.installColorSpace("HSL",["hue","saturation","lightness","alpha"],{hsv:function(){var e,t=2*this._lightness,r=this._saturation*(t<=1?t:2-t);return e=t+r<1e-9?0:2*r/(t+r),new n.HSV(this._hue,e,(t+r)/2,this._alpha)},rgb:function(){return this.hsv().rgb()},fromRgb:function(){return this.hsv().hsl()}})},bm=function(n){function e(t){return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}n.installMethod("luminance",function(){var t=this.rgb();return .2126*e(t._red)+.7152*e(t._green)+.0722*e(t._blue)})},Nm=function(n){n.installMethod("isDark",function(){var e=this.rgb();return(255*e._red*299+255*e._green*587+255*e._blue*114)/1e3<128})},WS=_e.use(Tm).use(function(n){n.use(Tm),n.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var e=function(o){var s=Math.pow(o,3);return s>.008856?s:(o-.13793103448275862)/7.87},t=(this._l+16)/116,r=this._a/500+t,i=t-this._b/200;return new n.XYZ(95.047*e(r),100*e(t),108.883*e(i),this._alpha)}})}).use(Sm).use(_i).use(function(n){n.installColorSpace("CMYK",["cyan","magenta","yellow","black","alpha"],{rgb:function(){return new n.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 e=this._red,t=this._green,r=this._blue,i=1-e,o=1-t,s=1-r,a=1;return e||t||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 n.CMYK(i,o,s,a,this._alpha)}})}).use(function(n){n.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(n){n.installMethod("clearer",function(e){return this.alpha(isNaN(e)?-.1:-e,!0)})}).use(function(n){n.use(bm),n.installMethod("contrast",function(e){var t=this.luminance(),r=e.luminance();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)})}).use(function(n){n.use(_i),n.installMethod("darken",function(e){return this.lightness(isNaN(e)?-.1:-e,!0)})}).use(function(n){n.use(_i),n.installMethod("desaturate",function(e){return this.saturation(isNaN(e)?-.1:-e,!0)})}).use(function(n){function e(){var t=this.rgb(),r=.3*t._red+.59*t._green+.11*t._blue;return new n.RGB(r,r,r,t._alpha)}n.installMethod("greyscale",e).installMethod("grayscale",e)}).use(Nm).use(function(n){n.use(Nm),n.installMethod("isLight",function(){return!this.isDark()})}).use(function(n){n.use(_i),n.installMethod("lighten",function(e){return this.lightness(isNaN(e)?.1:e,!0)})}).use(bm).use(function(n){n.installMethod("mix",function(e,t){e=n(e).rgb();var r=2*(t=1-(isNaN(t)?.5:t))-1,i=this._alpha-e._alpha,o=((r*i==-1?r:(r+i)/(1+r*i))+1)/2,s=1-o,a=this.rgb();return new n.RGB(a._red*o+e._red*s,a._green*o+e._green*s,a._blue*o+e._blue*s,a._alpha*t+e._alpha*(1-t))})}).use(function(n){n.installMethod("negate",function(){var e=this.rgb();return new n.RGB(1-e._red,1-e._green,1-e._blue,this._alpha)})}).use(function(n){n.installMethod("opaquer",function(e){return this.alpha(isNaN(e)?.1:e,!0)})}).use(function(n){n.use(_i),n.installMethod("rotate",function(e){return this.hue((e||0)/360,!0)})}).use(function(n){n.use(_i),n.installMethod("saturate",function(e){return this.saturation(isNaN(e)?.1:e,!0)})}).use(function(n){n.installMethod("toAlpha",function(e){var t=this.rgb(),r=e(e).rgb(),i=new e.RGB(0,0,0,t._alpha),o=["_red","_green","_blue"];return o.forEach(function(s){t[s]<1e-10?i[s]=t[s]:t[s]>r[s]?i[s]=(t[s]-r[s])/(1-r[s]):t[s]>r[s]?i[s]=(r[s]-t[s])/r[s]:i[s]=0}),i._red>i._green?i._red>i._blue?t._alpha=i._red:t._alpha=i._blue:i._green>i._blue?t._alpha=i._green:t._alpha=i._blue,t._alpha<1e-10||(o.forEach(function(s){t[s]=(t[s]-r[s])/t._alpha+r[s]}),t._alpha*=i._alpha),t})});const Cm=ha(WS);function st(n,e,t,r){return new(t||(t=Promise))(function(i,o){function s(u){try{l(r.next(u))}catch(c){o(c)}}function a(u){try{l(r.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((r=r.apply(n,e||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;let Mo=class{constructor(){this.listeners={}}on(n,e,t){if(this.listeners[n]||(this.listeners[n]=new Set),this.listeners[n].add(e),t?.once){const r=()=>{this.un(n,r),this.un(n,e)};return this.on(n,r),r}return()=>this.un(n,e)}un(n,e){var t;(t=this.listeners[n])===null||t===void 0||t.delete(e)}once(n,e){return this.on(n,e,{once:!0})}unAll(){this.listeners={}}emit(n,...e){this.listeners[n]&&this.listeners[n].forEach(t=>t(...e))}};const Im={decode:function(n,e){return st(this,void 0,void 0,function*(){const t=new AudioContext({sampleRate:e});return t.decodeAudioData(n).finally(()=>t.close())})},createBuffer:function(n,e){return typeof n[0]=="number"&&(n=[n]),function(t){const r=t[0];if(r.some(i=>i>1||i<-1)){const i=r.length;let o=0;for(let s=0;s<i;s++){const a=Math.abs(r[s]);a>o&&(o=a)}for(const s of t)for(let a=0;a<i;a++)s[a]/=o}}(n),{duration:e,length:n[0].length,sampleRate:n[0].length/e,numberOfChannels:n.length,getChannelData:t=>n?.[t],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function wm(n,e){const t=e.xmlns?document.createElementNS(e.xmlns,n):document.createElement(n);for(const[r,i]of Object.entries(e))if(r==="children")for(const[o,s]of Object.entries(e))typeof s=="string"?t.appendChild(document.createTextNode(s)):t.appendChild(wm(o,s));else r==="style"?Object.assign(t.style,i):r==="textContent"?t.textContent=i:t.setAttribute(r,i.toString());return t}function Rm(n,e,t){const r=wm(n,e||{});return t?.appendChild(r),r}var GS=Object.freeze({__proto__:null,createElement:Rm,default:Rm});const XS={fetchBlob:function(n,e,t){return st(this,void 0,void 0,function*(){const r=yield fetch(n,t);if(r.status>=400)throw new Error(`Failed to fetch ${n}: ${r.status} (${r.statusText})`);return function(i,o){st(this,void 0,void 0,function*(){if(!i.body||!i.headers)return;const s=i.body.getReader(),a=Number(i.headers.get("Content-Length"))||0;let l=0;const u=d=>st(this,void 0,void 0,function*(){l+=d?.length||0;const h=Math.round(l/a*100);o(h)}),c=()=>st(this,void 0,void 0,function*(){let d;try{d=yield s.read()}catch{return}d.done||(u(d.value),yield c())});c()})}(r.clone(),e),r.blob()})}};let KS=class extends Mo{constructor(n){super(),this.isExternalMedia=!1,n.media?(this.media=n.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),n.mediaControls&&(this.media.controls=!0),n.autoplay&&(this.media.autoplay=!0),n.playbackRate!=null&&this.onMediaEvent("canplay",()=>{n.playbackRate!=null&&(this.media.playbackRate=n.playbackRate)},{once:!0})}onMediaEvent(n,e,t){return this.media.addEventListener(n,e,t),()=>this.media.removeEventListener(n,e,t)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const n=this.getSrc();n.startsWith("blob:")&&URL.revokeObjectURL(n)}canPlayType(n){return this.media.canPlayType(n)!==""}setSrc(n,e){const t=this.getSrc();if(n&&t===n)return;this.revokeSrc();const r=e instanceof Blob&&(this.canPlayType(e.type)||!n)?URL.createObjectURL(e):n;try{this.media.src=r}catch{this.media.src=n}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(n){this.media=n}play(){return st(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(n){this.media.currentTime=n}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(n){this.media.volume=n}getMuted(){return this.media.muted}setMuted(n){this.media.muted=n}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(n,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=n}getMediaElement(){return this.media}setSinkId(n){return this.media.setSinkId(n)}},Ec=class Gp extends Mo{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 r=this.parentFromOptionsContainer(e.container);this.parent=r;const[i,o]=this.initHtml();r.appendChild(i),this.container=i,this.scrollContainer=o.querySelector(".scroll"),this.wrapper=o.querySelector(".wrapper"),this.canvasWrapper=o.querySelector(".canvases"),this.progressWrapper=o.querySelector(".progress"),this.cursor=o.querySelector(".cursor"),t&&o.appendChild(t),this.initEvents()}parentFromOptionsContainer(e){let t;if(typeof e=="string"?t=document.querySelector(e):e instanceof HTMLElement&&(t=e),!t)throw new Error("Container not found");return t}initEvents(){const e=t=>{const r=this.wrapper.getBoundingClientRect(),i=t.clientX-r.left,o=t.clientY-r.top;return[i/r.width,o/r.height]};if(this.wrapper.addEventListener("click",t=>{const[r,i]=e(t);this.emit("click",r,i)}),this.wrapper.addEventListener("dblclick",t=>{const[r,i]=e(t);this.emit("dblclick",r,i)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:t,scrollWidth:r,clientWidth:i}=this.scrollContainer,o=t/r,s=(t+i)/r;this.emit("scroll",o,s,t,t+i)}),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{t().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const e=this.parent.clientWidth;e===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=e,this.reRender())}initDrag(){this.subscriptions.push(function(e,t,r,i,o=3,s=0,a=100){if(!e)return()=>{};const l=matchMedia("(pointer: coarse)").matches;let u=()=>{};const c=d=>{if(d.button!==s)return;d.preventDefault(),d.stopPropagation();let h=d.clientX,p=d.clientY,f=!1;const m=Date.now(),g=O=>{if(O.preventDefault(),O.stopPropagation(),l&&Date.now()-m<a)return;const T=O.clientX,S=O.clientY,b=T-h,y=S-p;if(f||Math.abs(b)>o||Math.abs(y)>o){const C=e.getBoundingClientRect(),{left:w,top:I}=C;f||(r?.(h-w,p-I),f=!0),t(b,y,T-w,S-I),h=T,p=S}},E=O=>{if(f){const T=O.clientX,S=O.clientY,b=e.getBoundingClientRect(),{left:y,top:C}=b;i?.(T-y,S-C)}u()},v=O=>{O.relatedTarget&&O.relatedTarget!==document.documentElement||E(O)},A=O=>{f&&(O.stopPropagation(),O.preventDefault())},_=O=>{f&&O.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",E),document.addEventListener("pointerout",v),document.addEventListener("pointercancel",v),document.addEventListener("touchmove",_,{passive:!1}),document.addEventListener("click",A,{capture:!0}),u=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",E),document.removeEventListener("pointerout",v),document.removeEventListener("pointercancel",v),document.removeEventListener("touchmove",_),setTimeout(()=>{document.removeEventListener("click",A,{capture:!0})},10)}};return e.addEventListener("pointerdown",c),()=>{u(),e.removeEventListener("pointerdown",c)}}(this.wrapper,(e,t,r)=>{this.emit("drag",Math.max(0,Math.min(1,r/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 r;const i=((r=this.audioData)===null||r===void 0?void 0:r.numberOfChannels)||1;if(e==null)return 128;if(!isNaN(Number(e)))return Number(e);if(e==="auto"){const o=this.parent.clientHeight||128;return t?.every(s=>!s.overlay)?o/i:o}return 128}initHtml(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"});return t.innerHTML=`
2
+ `||r==="\r"?(u(),o=2):s+=r),o===3&&s==="!--"&&(o=4,l=l[0])}return u(),l}(n)),e),arguments,[])).length>1?e:e[0]}var So,ue,tf,Tr,nf,rf,of,sf,Iu,wu,Ru,af,bo={},lf=[],CT=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,No=Array.isArray;function En(n,e){for(var t in e)n[t]=e[t];return n}function Du(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function ae(n,e,t){var r,i,o,s={};for(o in e)o=="key"?r=e[o]:o=="ref"?i=e[o]:s[o]=e[o];if(arguments.length>2&&(s.children=arguments.length>3?So.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(o in n.defaultProps)s[o]==null&&(s[o]=n.defaultProps[o]);return Co(n,s,r,i,null)}function Co(n,e,t,r,i){var o={type:n,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++tf,__i:-1,__u:0};return i==null&&ue.vnode!=null&&ue.vnode(o),o}function uf(){return{current:null}}function xe(n){return n.children}function Xt(n,e){this.props=n,this.context=e}function pi(n,e){if(e==null)return n.__?pi(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?pi(n):null}function cf(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return cf(n)}}function ku(n){(!n.__d&&(n.__d=!0)&&Tr.push(n)&&!aa.__r++||nf!=ue.debounceRendering)&&((nf=ue.debounceRendering)||rf)(aa)}function aa(){for(var n,e,t,r,i,o,s,a=1;Tr.length;)Tr.length>a&&Tr.sort(of),n=Tr.shift(),a=Tr.length,n.__d&&(t=void 0,i=(r=(e=n).__v).__e,o=[],s=[],e.__P&&((t=En({},r)).__v=r.__v+1,ue.vnode&&ue.vnode(t),Lu(e.__P,t,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,o,i??pi(r),!!(32&r.__u),s),t.__v=r.__v,t.__.__k[t.__i]=t,mf(o,t,s),t.__e!=i&&cf(t)));aa.__r=0}function df(n,e,t,r,i,o,s,a,l,u,c){var d,h,p,f,m,g,E=r&&r.__k||lf,v=e.length;for(l=function(A,_,y,T,S){var b,O,C,w,I,F=y.length,x=F,$=0;for(A.__k=new Array(S),b=0;b<S;b++)(O=_[b])!=null&&typeof O!="boolean"&&typeof O!="function"?(w=b+$,(O=A.__k[b]=typeof O=="string"||typeof O=="number"||typeof O=="bigint"||O.constructor==String?Co(null,O,null,null,null):No(O)?Co(xe,{children:O},null,null,null):O.constructor==null&&O.__b>0?Co(O.type,O.props,O.key,O.ref?O.ref:null,O.__v):O).__=A,O.__b=A.__b+1,C=null,(I=O.__i=IT(O,y,w,x))!=-1&&(x--,(C=y[I])&&(C.__u|=2)),C==null||C.__v==null?(I==-1&&(S>F?$--:S<F&&$++),typeof O.type!="function"&&(O.__u|=4)):I!=w&&(I==w-1?$--:I==w+1?$++:(I>w?$--:$++,O.__u|=4))):A.__k[b]=null;if(x)for(b=0;b<F;b++)(C=y[b])!=null&&!(2&C.__u)&&(C.__e==T&&(T=pi(C)),Ef(C,C));return T}(t,e,E,l,v),d=0;d<v;d++)(p=t.__k[d])!=null&&(h=p.__i==-1?bo:E[p.__i]||bo,p.__i=d,g=Lu(n,p,h,i,o,s,a,l,u,c),f=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&xu(h.ref,null,p),c.push(p.ref,p.__c||f,p)),m==null&&f!=null&&(m=f),4&p.__u||h.__k===p.__k?l=hf(p,l,n):typeof p.type=="function"&&g!==void 0?l=g:f&&(l=f.nextSibling),p.__u&=-7);return t.__e=m,l}function hf(n,e,t){var r,i;if(typeof n.type=="function"){for(r=n.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=n,e=hf(r[i],e,t));return e}n.__e!=e&&(e&&n.type&&!t.contains(e)&&(e=pi(n)),t.insertBefore(n.__e,e||null),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Mn(n,e){return e=e||[],n==null||typeof n=="boolean"||(No(n)?n.some(function(t){Mn(t,e)}):e.push(n)),e}function IT(n,e,t,r){var i,o,s=n.key,a=n.type,l=e[t];if(l===null&&n.key==null||l&&s==l.key&&a==l.type&&!(2&l.__u))return t;if(r>(l==null||2&l.__u?0:1))for(i=t-1,o=t+1;i>=0||o<e.length;){if(i>=0){if((l=e[i])&&!(2&l.__u)&&s==l.key&&a==l.type)return i;i--}if(o<e.length){if((l=e[o])&&!(2&l.__u)&&s==l.key&&a==l.type)return o;o++}}return-1}function pf(n,e,t){e[0]=="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||CT.test(e)?t:t+"px"}function la(n,e,t,r,i){var o,s;e:if(e=="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof r=="string"&&(n.style.cssText=r=""),r)for(e in r)t&&e in t||pf(n.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||pf(n.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(sf,"$1")),s=e.toLowerCase(),e=s in n||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),n.l||(n.l={}),n.l[e+o]=t,t?r?t.u=r.u:(t.u=Iu,n.addEventListener(e,o?Ru:wu,o)):n.removeEventListener(e,o?Ru:wu,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in n)try{n[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?n.removeAttribute(e):n.setAttribute(e,e=="popover"&&t==1?"":t))}}function ff(n){return function(e){if(this.l){var t=this.l[e.type+n];if(e.t==null)e.t=Iu++;else if(e.t<t.u)return;return t(ue.event?ue.event(e):e)}}}function Lu(n,e,t,r,i,o,s,a,l,u){var c,d,h,p,f,m,g,E,v,A,_,y,T,S,b,O,C,w=e.type;if(e.constructor!=null)return null;128&t.__u&&(l=!!(32&t.__u),o=[a=e.__e=t.__e]),(c=ue.__b)&&c(e);e:if(typeof w=="function")try{if(E=e.props,v="prototype"in w&&w.prototype.render,A=(c=w.contextType)&&r[c.__c],_=c?A?A.props.value:c.__:r,t.__c?g=(d=e.__c=t.__c).__=d.__E:(v?e.__c=d=new w(E,_):(e.__c=d=new Xt(E,_),d.constructor=w,d.render=wT),A&&A.sub(d),d.props=E,d.state||(d.state={}),d.context=_,d.__n=r,h=d.__d=!0,d.__h=[],d._sb=[]),v&&d.__s==null&&(d.__s=d.state),v&&w.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=En({},d.__s)),En(d.__s,w.getDerivedStateFromProps(E,d.__s))),p=d.props,f=d.state,d.__v=e,h)v&&w.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),v&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(v&&w.getDerivedStateFromProps==null&&E!==p&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(E,_),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(E,d.__s,_)===!1||e.__v==t.__v){for(e.__v!=t.__v&&(d.props=E,d.state=d.__s,d.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(I){I&&(I.__=e)}),y=0;y<d._sb.length;y++)d.__h.push(d._sb[y]);d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(E,d.__s,_),v&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(p,f,m)})}if(d.context=_,d.props=E,d.__P=n,d.__e=!1,T=ue.__r,S=0,v){for(d.state=d.__s,d.__d=!1,T&&T(e),c=d.render(d.props,d.state,d.context),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[]}else do d.__d=!1,T&&T(e),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=En(En({},r),d.getChildContext())),v&&!h&&d.getSnapshotBeforeUpdate!=null&&(m=d.getSnapshotBeforeUpdate(p,f)),O=c,c!=null&&c.type===xe&&c.key==null&&(O=gf(c.props.children)),a=df(n,No(O)?O:[O],e,t,r,i,o,s,a,l,u),d.base=e.__e,e.__u&=-161,d.__h.length&&s.push(d),g&&(d.__E=d.__=null)}catch(I){if(e.__v=null,l||o!=null)if(I.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,e.__e=a}else for(C=o.length;C--;)Du(o[C]);else e.__e=t.__e,e.__k=t.__k;ue.__e(I,e,t)}else o==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):a=e.__e=function(I,F,x,$,k,M,Y,L,J){var j,re,te,D,Z,ee,se,U=x.props,de=F.props,fe=F.type;if(fe=="svg"?k="http://www.w3.org/2000/svg":fe=="math"?k="http://www.w3.org/1998/Math/MathML":k||(k="http://www.w3.org/1999/xhtml"),M!=null){for(j=0;j<M.length;j++)if((Z=M[j])&&"setAttribute"in Z==!!fe&&(fe?Z.localName==fe:Z.nodeType==3)){I=Z,M[j]=null;break}}if(I==null){if(fe==null)return document.createTextNode(de);I=document.createElementNS(k,fe,de.is&&de),L&&(ue.__m&&ue.__m(F,M),L=!1),M=null}if(fe==null)U===de||L&&I.data==de||(I.data=de);else{if(M=M&&So.call(I.childNodes),U=x.props||bo,!L&&M!=null)for(U={},j=0;j<I.attributes.length;j++)U[(Z=I.attributes[j]).name]=Z.value;for(j in U)if(Z=U[j],j!="children"){if(j=="dangerouslySetInnerHTML")te=Z;else if(!(j in de)){if(j=="value"&&"defaultValue"in de||j=="checked"&&"defaultChecked"in de)continue;la(I,j,null,Z,k)}}for(j in de)Z=de[j],j=="children"?D=Z:j=="dangerouslySetInnerHTML"?re=Z:j=="value"?ee=Z:j=="checked"?se=Z:L&&typeof Z!="function"||U[j]===Z||la(I,j,Z,U[j],k);if(re)L||te&&(re.__html==te.__html||re.__html==I.innerHTML)||(I.innerHTML=re.__html),F.__k=[];else if(te&&(I.innerHTML=""),df(F.type=="template"?I.content:I,No(D)?D:[D],F,x,$,fe=="foreignObject"?"http://www.w3.org/1999/xhtml":k,M,Y,M?M[0]:x.__k&&pi(x,0),L,J),M!=null)for(j=M.length;j--;)Du(M[j]);L||(j="value",fe=="progress"&&ee==null?I.removeAttribute("value"):ee!=null&&(ee!==I[j]||fe=="progress"&&!ee||fe=="option"&&ee!=U[j])&&la(I,j,ee,U[j],k),j="checked",se!=null&&se!=I[j]&&la(I,j,se,U[j],k))}return I}(t.__e,e,t,r,i,o,s,l,u);return(c=ue.diffed)&&c(e),128&e.__u?void 0:a}function mf(n,e,t){for(var r=0;r<t.length;r++)xu(t[r],t[++r],t[++r]);ue.__c&&ue.__c(e,n),n.some(function(i){try{n=i.__h,i.__h=[],n.some(function(o){o.call(i)})}catch(o){ue.__e(o,i.__v)}})}function gf(n){return typeof n!="object"||n==null||n.__b&&n.__b>0?n:No(n)?n.map(gf):En({},n)}function xu(n,e,t){try{if(typeof n=="function"){var r=typeof n.__u=="function";r&&n.__u(),r&&e==null||(n.__u=n(e))}else n.current=e}catch(i){ue.__e(i,t)}}function Ef(n,e,t){var r,i;if(ue.unmount&&ue.unmount(n),(r=n.ref)&&(r.current&&r.current!=n.__e||xu(r,null,e)),(r=n.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){ue.__e(o,e)}r.base=r.__P=null}if(r=n.__k)for(i=0;i<r.length;i++)r[i]&&Ef(r[i],e,t||typeof n.type!="function");t||Du(n.__e),n.__c=n.__=n.__e=void 0}function wT(n,e,t){return this.constructor(n,t)}function Io(n,e,t){var r,i,o,s;e==document&&(e=document.documentElement),ue.__&&ue.__(n,e),i=(r=typeof t=="function")?null:t&&t.__k||e.__k,o=[],s=[],Lu(e,n=(!r&&t||e).__k=ae(xe,null,[n]),i||bo,bo,e.namespaceURI,!r&&t?[t]:i?null:e.firstChild?So.call(e.childNodes):null,o,!r&&t?t:i?i.__e:e.firstChild,r,s),mf(o,n,s)}function vf(n,e){Io(n,e,vf)}function RT(n,e,t){var r,i,o,s,a=En({},n.props);for(o in n.type&&n.type.defaultProps&&(s=n.type.defaultProps),e)o=="key"?r=e[o]:o=="ref"?i=e[o]:a[o]=e[o]==null&&s!=null?s[o]:e[o];return arguments.length>2&&(a.children=arguments.length>3?So.call(arguments,2):t),Co(n.type,a,r||n.key,i||n.ref,null)}function kt(n){function e(t){var r,i;return this.getChildContext||(r=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(o){this.props.value!=o.value&&r.forEach(function(s){s.__e=!0,ku(s)})},this.sub=function(o){r.add(o);var s=o.componentWillUnmount;o.componentWillUnmount=function(){r&&r.delete(o),s&&s.call(o)}}),t.children}return e.__c="__cC"+af++,e.__=n,e.Provider=e.__l=(e.Consumer=function(t,r){return t.children(r)}).contextType=e,e}So=lf.slice,ue={__e:function(n,e,t,r){for(var i,o,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(n)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,r||{}),s=i.__d),s)return i.__E=i}catch(a){n=a}throw n}},tf=0,Xt.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=En({},this.state),typeof n=="function"&&(n=n(En({},t),this.props)),n&&En(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),ku(this))},Xt.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),ku(this))},Xt.prototype.render=xe,Tr=[],rf=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,of=function(n,e){return n.__v.__b-e.__v.__b},aa.__r=0,sf=/(PointerCapture)$|Capture$/i,Iu=0,wu=ff(!1),Ru=ff(!0),af=0;var Pn,be,Mu,Af,fi=0,_f=[],we=ue,yf=we.__b,Of=we.__r,Tf=we.diffed,Sf=we.__c,bf=we.unmount,Nf=we.__;function Sr(n,e){we.__h&&we.__h(be,n,fi||e),fi=0;var t=be.__H||(be.__H={__:[],__h:[]});return n>=t.__.length&&t.__.push({}),t.__[n]}function ne(n){return fi=1,br(If,n)}function br(n,e,t){var r=Sr(Pn++,2);if(r.t=n,!r.__c&&(r.__=[t?t(e):If(void 0,e),function(a){var l=r.__N?r.__N[0]:r.__[0],u=r.t(l,a);l!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=be,!be.__f)){var i=function(a,l,u){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(h){return!!h.__c});if(c.every(function(h){return!h.__N}))return!o||o.call(this,a,l,u);var d=r.__c.props!==a;return c.forEach(function(h){if(h.__N){var p=h.__[0];h.__=h.__N,h.__N=void 0,p!==h.__[0]&&(d=!0)}}),o&&o.call(this,a,l,u)||d};be.__f=!0;var o=be.shouldComponentUpdate,s=be.componentWillUpdate;be.componentWillUpdate=function(a,l,u){if(this.__e){var c=o;o=void 0,i(a,l,u),o=c}s&&s.call(this,a,l,u)},be.shouldComponentUpdate=i}return r.__N||r.__}function V(n,e){var t=Sr(Pn++,3);!we.__s&&Uu(t.__H,e)&&(t.__=n,t.u=e,be.__H.__h.push(t))}function pt(n,e){var t=Sr(Pn++,4);!we.__s&&Uu(t.__H,e)&&(t.__=n,t.u=e,be.__h.push(t))}function W(n){return fi=5,ce(function(){return{current:n}},[])}function wo(n,e,t){fi=6,pt(function(){if(typeof n=="function"){var r=n(e());return function(){n(null),r&&typeof r=="function"&&r()}}if(n)return n.current=e(),function(){return n.current=null}},t==null?t:t.concat(n))}function ce(n,e){var t=Sr(Pn++,7);return Uu(t.__H,e)&&(t.__=n(),t.__H=e,t.__h=n),t.__}function oe(n,e){return fi=8,ce(function(){return n},e)}function qe(n){var e=be.context[n.__c],t=Sr(Pn++,9);return t.c=n,e?(t.__==null&&(t.__=!0,e.sub(be)),e.props.value):n.__}function Pu(n,e){we.useDebugValue&&we.useDebugValue(e?e(n):n)}function Bu(){var n=Sr(Pn++,11);if(!n.__){for(var e=be.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var t=e.__m||(e.__m=[0,0]);n.__="P"+t[0]+"-"+t[1]++}return n.__}function DT(){for(var n;n=_f.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(ua),n.__H.__h.forEach(Fu),n.__H.__h=[]}catch(e){n.__H.__h=[],we.__e(e,n.__v)}}we.__b=function(n){be=null,yf&&yf(n)},we.__=function(n,e){n&&e.__k&&e.__k.__m&&(n.__m=e.__k.__m),Nf&&Nf(n,e)},we.__r=function(n){Of&&Of(n),Pn=0;var e=(be=n.__c).__H;e&&(Mu===be?(e.__h=[],be.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(ua),e.__h.forEach(Fu),e.__h=[],Pn=0)),Mu=be},we.diffed=function(n){Tf&&Tf(n);var e=n.__c;e&&e.__H&&(e.__H.__h.length&&(_f.push(e)!==1&&Af===we.requestAnimationFrame||((Af=we.requestAnimationFrame)||kT)(DT)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),Mu=be=null},we.__c=function(n,e){e.some(function(t){try{t.__h.forEach(ua),t.__h=t.__h.filter(function(r){return!r.__||Fu(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],we.__e(r,t.__v)}}),Sf&&Sf(n,e)},we.unmount=function(n){bf&&bf(n);var e,t=n.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{ua(r)}catch(i){e=i}}),t.__H=void 0,e&&we.__e(e,t.__v))};var Cf=typeof requestAnimationFrame=="function";function kT(n){var e,t=function(){clearTimeout(r),Cf&&cancelAnimationFrame(e),setTimeout(n)},r=setTimeout(t,35);Cf&&(e=requestAnimationFrame(t))}function ua(n){var e=be,t=n.__c;typeof t=="function"&&(n.__c=void 0,t()),be=e}function Fu(n){var e=be;n.__c=n.__(),be=e}function Uu(n,e){return!n||n.length!==e.length||e.some(function(t,r){return t!==n[r]})}function If(n,e){return typeof e=="function"?e(n):e}function wf(n,e){for(var t in e)n[t]=e[t];return n}function Hu(n,e){for(var t in n)if(t!=="__source"&&!(t in e))return!0;for(var r in e)if(r!=="__source"&&n[r]!==e[r])return!0;return!1}function $u(n,e){var t=e(),r=ne({t:{__:t,u:e}}),i=r[0].t,o=r[1];return pt(function(){i.__=t,i.u=e,ju(i)&&o({t:i})},[n,t,e]),V(function(){return ju(i)&&o({t:i}),n(function(){ju(i)&&o({t:i})})},[n]),t}function ju(n){var e,t,r=n.u,i=n.__;try{var o=r();return!((e=i)===(t=o)&&(e!==0||1/e==1/t)||e!=e&&t!=t)}catch{return!0}}function Yu(n){n()}function zu(n){return n}function Vu(){return[!1,Yu]}var Wu=pt;function ca(n,e){this.props=n,this.context=e}function mi(n,e){function t(i){var o=this.props.ref,s=o==i.ref;return!s&&o&&(o.call?o(null):o.current=null),e?!e(this.props,i)||!s:Hu(this.props,i)}function r(i){return this.shouldComponentUpdate=t,ae(n,i)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(ca.prototype=new Xt).isPureReactComponent=!0,ca.prototype.shouldComponentUpdate=function(n,e){return Hu(this.props,n)||Hu(this.state,e)};var Rf=ue.__b;ue.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),Rf&&Rf(n)};var LT=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Q(n){function e(t){var r=wf({},t);return delete r.ref,n(r,t.ref||null)}return e.$$typeof=LT,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(n.displayName||n.name)+")",e}var Df=function(n,e){return n==null?null:Mn(Mn(n).map(e))},vn={map:Df,forEach:Df,count:function(n){return n?Mn(n).length:0},only:function(n){var e=Mn(n);if(e.length!==1)throw"Children.only";return e[0]},toArray:Mn},xT=ue.__e;ue.__e=function(n,e,t,r){if(n.then){for(var i,o=e;o=o.__;)if((i=o.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(n,e)}xT(n,e,t,r)};var kf=ue.unmount;function Lf(n,e,t){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),n.__c.__H=null),(n=wf({},n)).__c!=null&&(n.__c.__P===t&&(n.__c.__P=e),n.__c.__e=!0,n.__c=null),n.__k=n.__k&&n.__k.map(function(r){return Lf(r,e,t)})),n}function xf(n,e,t){return n&&t&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(r){return xf(r,e,t)}),n.__c&&n.__c.__P===e&&(n.__e&&t.appendChild(n.__e),n.__c.__e=!0,n.__c.__P=t)),n}function Ro(){this.__u=0,this.o=null,this.__b=null}function Mf(n){var e=n.__.__c;return e&&e.__a&&e.__a(n)}function Pf(n){var e,t,r;function i(o){if(e||(e=n()).then(function(s){t=s.default||s},function(s){r=s}),r)throw r;if(!t)throw e;return ae(t,o)}return i.displayName="Lazy",i.__f=!0,i}function gi(){this.i=null,this.l=null}ue.unmount=function(n){var e=n.__c;e&&e.__R&&e.__R(),e&&32&n.__u&&(n.type=null),kf&&kf(n)},(Ro.prototype=new Xt).__c=function(n,e){var t=e.__c,r=this;r.o==null&&(r.o=[]),r.o.push(t);var i=Mf(r.__v),o=!1,s=function(){o||(o=!0,t.__R=null,i?i(a):a())};t.__R=s;var a=function(){if(!--r.__u){if(r.state.__a){var l=r.state.__a;r.__v.__k[0]=xf(l,l.__c.__P,l.__c.__O)}var u;for(r.setState({__a:r.__b=null});u=r.o.pop();)u.forceUpdate()}};r.__u++||32&e.__u||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(s,s)},Ro.prototype.componentWillUnmount=function(){this.o=[]},Ro.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Lf(this.__b,t,r.__O=r.__P)}this.__b=null}var i=e.__a&&ae(xe,null,n.fallback);return i&&(i.__u&=-33),[ae(xe,null,e.__a?null:n.children),i]};var Bf=function(n,e,t){if(++t[1]===t[0]&&n.l.delete(e),n.props.revealOrder&&(n.props.revealOrder[0]!=="t"||!n.l.size))for(t=n.i;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;n.i=t=t[2]}};function MT(n){return this.getChildContext=function(){return n.context},n.children}function PT(n){var e=this,t=n.h;if(e.componentWillUnmount=function(){Io(null,e.v),e.v=null,e.h=null},e.h&&e.h!==t&&e.componentWillUnmount(),!e.v){for(var r=e.__v;r!==null&&!r.__m&&r.__!==null;)r=r.__;e.h=t,e.v={nodeType:1,parentNode:t,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},insertBefore:function(i,o){this.childNodes.push(i),e.h.insertBefore(i,o)},removeChild:function(i){this.childNodes.splice(this.childNodes.indexOf(i)>>>1,1),e.h.removeChild(i)}}}Io(ae(MT,{context:e.context},n.__v),e.v)}function Gu(n,e){var t=ae(PT,{__v:n,h:e});return t.containerInfo=e,t}(gi.prototype=new Xt).__a=function(n){var e=this,t=Mf(e.__v),r=e.l.get(n);return r[0]++,function(i){var o=function(){e.props.revealOrder?(r.push(i),Bf(e,n,r)):i()};t?t(o):o()}},gi.prototype.render=function(n){this.i=null,this.l=new Map;var e=Mn(n.children);n.revealOrder&&n.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.l.set(e[t],this.i=[1,0,this.i]);return n.children},gi.prototype.componentDidUpdate=gi.prototype.componentDidMount=function(){var n=this;this.l.forEach(function(e,t){Bf(n,t,e)})};var Ff=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,BT=/^(?: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]/,FT=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,UT=/[A-Z0-9]/g,HT=typeof document<"u",$T=function(n){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(n)};function Xu(n,e,t){return e.__k==null&&(e.textContent=""),Io(n,e),typeof t=="function"&&t(),n?n.__c:null}function Uf(n,e,t){return vf(n,e),typeof t=="function"&&t(),n?n.__c:null}Xt.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(Xt.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})});var Hf=ue.event;function jT(){}function YT(){return this.cancelBubble}function zT(){return this.defaultPrevented}ue.event=function(n){return Hf&&(n=Hf(n)),n.persist=jT,n.isPropagationStopped=YT,n.isDefaultPrevented=zT,n.nativeEvent=n};var Ku,VT={enumerable:!1,configurable:!0,get:function(){return this.class}},$f=ue.vnode;ue.vnode=function(n){typeof n.type=="string"&&function(e){var t=e.props,r=e.type,i={},o=r.indexOf("-")===-1;for(var s in t){var a=t[s];if(!(s==="value"&&"defaultValue"in t&&a==null||HT&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var l=s.toLowerCase();s==="defaultValue"&&"value"in t&&t.value==null?s="value":s==="download"&&a===!0?a="":l==="translate"&&a==="no"?a=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?s="ondblclick":l!=="onchange"||r!=="input"&&r!=="textarea"||$T(t.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":FT.test(s)&&(s=l):l=s="oninput":o&&BT.test(s)?s=s.replace(UT,"-$&").toLowerCase():a===null&&(a=void 0),l==="oninput"&&i[s=l]&&(s="oninputCapture"),i[s]=a}}r=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Mn(t.children).forEach(function(u){u.props.selected=i.value.indexOf(u.props.value)!=-1})),r=="select"&&i.defaultValue!=null&&(i.value=Mn(t.children).forEach(function(u){u.props.selected=i.multiple?i.defaultValue.indexOf(u.props.value)!=-1:i.defaultValue==u.props.value})),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",VT)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(n),n.$$typeof=Ff,$f&&$f(n)};var jf=ue.__r;ue.__r=function(n){jf&&jf(n),Ku=n.__c};var Yf=ue.diffed;ue.diffed=function(n){Yf&&Yf(n);var e=n.props,t=n.__e;t!=null&&n.type==="textarea"&&"value"in e&&e.value!==t.value&&(t.value=e.value==null?"":e.value),Ku=null};var zf={ReactCurrentDispatcher:{current:{readContext:function(n){return Ku.__n[n.__c].props.value},useCallback:oe,useContext:qe,useDebugValue:Pu,useDeferredValue:zu,useEffect:V,useId:Bu,useImperativeHandle:wo,useInsertionEffect:Wu,useLayoutEffect:pt,useMemo:ce,useReducer:br,useRef:W,useState:ne,useSyncExternalStore:$u,useTransition:Vu}}};function Vf(n){return ae.bind(null,n)}function Bn(n){return!!n&&n.$$typeof===Ff}function Wf(n){return Bn(n)&&n.type===xe}function Gf(n){return!!n&&!!n.displayName&&(typeof n.displayName=="string"||n.displayName instanceof String)&&n.displayName.startsWith("Memo(")}function Nr(n){return Bn(n)?RT.apply(null,arguments):n}function qu(n){return!!n.__k&&(Io(null,n),!0)}function Xf(n){return n&&(n.base||n.nodeType===1&&n)||null}var Kf=function(n,e){return n(e)},Do=function(n,e){return n(e)},qf=xe,Jf=Bn,Ce={useState:ne,useId:Bu,useReducer:br,useEffect:V,useLayoutEffect:pt,useInsertionEffect:Wu,useTransition:Vu,useDeferredValue:zu,useSyncExternalStore:$u,startTransition:Yu,useRef:W,useImperativeHandle:wo,useMemo:ce,useCallback:oe,useContext:qe,useDebugValue:Pu,version:"18.3.1",Children:vn,render:Xu,hydrate:Uf,unmountComponentAtNode:qu,createPortal:Gu,createElement:ae,createContext:kt,createFactory:Vf,cloneElement:Nr,createRef:uf,Fragment:xe,isValidElement:Bn,isElement:Jf,isFragment:Wf,isMemo:Gf,findDOMNode:Xf,Component:Xt,PureComponent:ca,memo:mi,forwardRef:Q,flushSync:Do,unstable_batchedUpdates:Kf,StrictMode:qf,Suspense:Ro,SuspenseList:gi,lazy:Pf,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:zf};const Ju=Object.freeze(Object.defineProperty({__proto__:null,Children:vn,Component:Xt,Fragment:xe,PureComponent:ca,StrictMode:qf,Suspense:Ro,SuspenseList:gi,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:zf,cloneElement:Nr,createContext:kt,createElement:ae,createFactory:Vf,createPortal:Gu,createRef:uf,default:Ce,findDOMNode:Xf,flushSync:Do,forwardRef:Q,hydrate:Uf,isElement:Jf,isFragment:Wf,isMemo:Gf,isValidElement:Bn,lazy:Pf,memo:mi,render:Xu,startTransition:Yu,unmountComponentAtNode:qu,unstable_batchedUpdates:Kf,useCallback:oe,useContext:qe,useDebugValue:Pu,useDeferredValue:zu,useEffect:V,useErrorBoundary:function(n){var e=Sr(Pn++,10),t=ne();return e.__=n,be.componentDidCatch||(be.componentDidCatch=function(r,i){e.__&&e.__(r,i),t[1](r)}),[t[0],function(){t[1](void 0)}]},useId:Bu,useImperativeHandle:wo,useInsertionEffect:Wu,useLayoutEffect:pt,useMemo:ce,useReducer:br,useRef:W,useState:ne,useSyncExternalStore:$u,useTransition:Vu,version:"18.3.1"},Symbol.toStringTag,{value:"Module"}));var WT={TALK_GMK:"AIzaSyAs_WXNLlj31EHJI_Lw8siO2B3ZJLUzBH0",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const GT=function(n){return WT[n]}("TALK_GMK");var da=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ha(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function XT(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var Zu={};function KT(n){return String.fromCharCode(parseInt(n.slice(1),16))}Object.defineProperty(Zu,"__esModule",{value:!0});var qT=Zu.encode=function(n){return btoa(encodeURIComponent(n).replace(/%[0-9A-F]{2}/g,KT))};function JT(n){return`%${`00${n.charCodeAt(0).toString(16)}`.slice(-2)}`}Zu.decode=function(n){return decodeURIComponent(Array.from(atob(n),JT).join(""))};const ZT=/[^a-zA-Z\u00C0-\u024F\u1E00-\u1EFF\u0400-\u044f\u0300-\u036e]+/,QT=n=>n.split(ZT).filter(e=>e).map(e=>e[0]).join("")||n[Symbol.iterator]().next().value||"";function Zf(n){const e=function(t){let r=0;for(let i=0;i<t.length;i++)r=(r<<5)-r+t.charCodeAt(i),r|=0;return Math.abs(r)}(n)%em.length;return em[e]}function Qu(n,e){const t=e.lastIndex;let r;const i=[];for(;(r=e.exec(n))!==null;)i.push(r);return e.lastIndex=t,i}function pa(n){const e=n.replace(/%2F/g,"/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/,"$1");return decodeURIComponent(e)}function Qf(n,e){return n.localeCompare(e,void 0,{usage:"search",sensitivity:"base"})===0}function eS(n){return[...n.matchAll(/^|\s+/g)].map(t=>t.index+t[0].length).map(t=>n.substring(t))}const em=["#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"];var tS=0;function N(n,e,t,r,i,o){e||(e={});var s,a,l=e;if("ref"in l)for(a in l={},e)a=="ref"?s=e[a]:l[a]=e[a];var u={type:n,props:l,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--tS,__i:-1,__u:0,__source:i,__self:o};if(typeof n=="function"&&(s=n.defaultProps))for(a in s)l[a]===void 0&&(l[a]=s[a]);return ue.vnode&&ue.vnode(u),u}function tm(){}function nm(){}nm.resetWarningCache=tm;function rm(){return!(typeof window>"u"||!window.document||!window.document.createElement)}(function(){function n(r,i,o,s,a,l){if(l!=="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"){var u=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 u.name="Invariant Violation",u}}function e(){return n}n.isRequired=n;var t={array:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:e,element:n,elementType:n,instanceOf:e,node:n,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:nm,resetWarningCache:tm};t.PropTypes=t})();var Ei=rm()?pt:V;function im(){var n=ne(Object.create(null))[1];return oe(function(){n(Object.create(null))},[])}var om,nS=function(n){var e=n.children,t=n.type,r=t===void 0?"reach-portal":t,i=W(null),o=W(null),s=im();return Ei(function(){if(i.current){var a=i.current.ownerDocument;return o.current=a?.createElement(r),a.body.appendChild(o.current),s(),function(){o.current&&o.current.ownerDocument&&o.current.ownerDocument.body.removeChild(o.current)}}},[r,s]),o.current?Gu(e,o.current):ae("span",{ref:i})},rS=["bottom","height","left","right","top","width"],Qn=new Map,iS=function n(){var e=[];Qn.forEach(function(t,r){var i=r.getBoundingClientRect();(function(o,s){return o===void 0&&(o={}),s===void 0&&(s={}),rS.some(function(a){return o[a]!==s[a]})})(i,t.rect)&&(t.rect=i,e.push(t))}),e.forEach(function(t){t.callbacks.forEach(function(r){return r(t.rect)})}),om=window.requestAnimationFrame(n)};function ec(n){return!(!n||{}.toString.call(n)!="[object Function]")}function sm(n,e,t){var r,i,o;typeof e=="boolean"?r=e:(r=(o=e?.observe)==null||o,i=e?.onChange),ec(t)&&(i=t);var s=ne(n.current),a=s[0],l=s[1],u=W(!1),c=W(!1),d=ne(null),h=d[0],p=d[1],f=W(i);return Ei(function(){f.current=i,n.current!==a&&l(n.current)}),Ei(function(){a&&!u.current&&(u.current=!0,p(a.getBoundingClientRect()))},[a]),Ei(function(){if(r){var m=a;if(c.current||(c.current=!0,m=n.current),m){var g,E,v=(g=m,E=function(A){f.current==null||f.current(A),p(A)},{observe:function(){var A=Qn.size===0;Qn.has(g)?Qn.get(g).callbacks.push(E):Qn.set(g,{rect:void 0,hasRectChanged:!1,callbacks:[E]}),A&&iS()},unobserve:function(){var A=Qn.get(g);if(A){var _=A.callbacks.indexOf(E);_>=0&&A.callbacks.splice(_,1),A.callbacks.length||Qn.delete(g),Qn.size||cancelAnimationFrame(om)}}});return v.observe(),function(){v.unobserve()}}}},[r,a,n]),h}function ko(n){return rm()?n?n.ownerDocument:document:null}function am(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function oS(n,e){var t;if(typeof Symbol>"u"||n[Symbol.iterator]==null){if(Array.isArray(n)||(t=function(i,o){if(i){if(typeof i=="string")return am(i,o);var s=Object.prototype.toString.call(i).slice(8,-1);return s==="Object"&&i.constructor&&(s=i.constructor.name),s==="Map"||s==="Set"?Array.from(i):s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?am(i,o):void 0}}(n))||e){t&&(n=t);var r=0;return function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return(t=n[Symbol.iterator]()).next.bind(t)}function sS(n,e){if(n!=null)if(ec(n))n(e);else try{n.current=e}catch{throw new Error('Cannot assign value "'+e+'" to ref "'+n+'"')}}function Lo(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return oe(function(r){for(var i,o=oS(e);!(i=o()).done;)sS(i.value,r)},e)}var lm=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],tc=lm.join(","),nc=typeof Element>"u"?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function rc(n,e){e=e||{};var t,r,i,o=[],s=[],a=n.querySelectorAll(tc);for(e.includeContainer&&nc.call(n,tc)&&(a=Array.prototype.slice.apply(a)).unshift(n),t=0;t<a.length;t++)um(r=a[t])&&((i=dm(r))===0?o.push(r):s.push({documentOrder:t,tabIndex:i,node:r}));var l=s.sort(lS).map(function(u){return u.node}).concat(o);return l}function um(n){return!(!cm(n)||function(e){return function(t){return hm(t)&&t.type==="radio"}(e)&&!function(t){if(!t.name)return!0;var r=t.ownerDocument.querySelectorAll('input[type="radio"][name="'+t.name+'"]'),i=function(o){for(var s=0;s<o.length;s++)if(o[s].checked)return o[s]}(r);return!i||i===t}(e)}(n)||dm(n)<0)}function cm(n){return!(n.disabled||function(e){return hm(e)&&e.type==="hidden"}(n)||function(e){return e.offsetParent===null||getComputedStyle(e).visibility==="hidden"}(n))}rc.isTabbable=function(n){if(!n)throw new Error("No node provided");return nc.call(n,tc)!==!1&&um(n)},rc.isFocusable=function(n){if(!n)throw new Error("No node provided");return nc.call(n,aS)!==!1&&cm(n)};var aS=lm.concat("iframe").join(",");function dm(n){var e=parseInt(n.getAttribute("tabindex"),10);return isNaN(e)?function(t){return t.contentEditable==="true"}(n)?0:n.tabIndex:e}function lS(n,e){return n.tabIndex===e.tabIndex?n.documentOrder-e.documentOrder:n.tabIndex-e.tabIndex}function hm(n){return n.tagName==="INPUT"}const Fn=ha(rc);function vi(){return vi=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},vi.apply(this,arguments)}var uS=["as","targetRef","position","unstable_observableRefs"],cS=Q(function(n,e){return ae(nS,null,ae(dS,vi({ref:e},n)))}),dS=Q(function(n,e){var t=n.as,r=t===void 0?"div":t,i=n.targetRef,o=n.position,s=o===void 0?pS:o,a=n.unstable_observableRefs,l=a===void 0?[]:a,u=function(f,m){if(f==null)return{};var g,E,v={},A=Object.keys(f);for(E=0;E<A.length;E++)g=A[E],m.indexOf(g)>=0||(v[g]=f[g]);return v}(n,uS),c=W(null),d=sm(c,{observe:!u.hidden}),h=sm(i,{observe:!u.hidden}),p=Lo(c,e);return function(f,m){var g=ko(f.current);function E(k){k.key==="Tab"&&m.current&&Fn(m.current).length===0||(k.key==="Tab"&&k.shiftKey?S(k)?b(k):O(k)?C(k):I(k)&&x():k.key==="Tab"&&(A()?_(k):y()?T(k):w(k)&&x()))}function v(){var k=Fn(g),M=k&&f.current?k.indexOf(f.current):-1,Y=k&&k[M+1];return(!m.current||!m.current.contains(Y||null))&&Y}function A(){return!!f.current&&f.current===g.activeElement}function _(k){var M=m.current&&Fn(m.current);M&&M[0]&&(k.preventDefault(),M[0].focus())}function y(){if(m.current&&m.current.contains(g.activeElement||null)){var k=m.current&&Fn(m.current);return!!(k&&k[k.length-1]===g.activeElement)}return!1}function T(k){var M=v();M&&(k.preventDefault(),M.focus())}function S(k){if(k.shiftKey){var M=v();return k.target===M}}function b(k){var M=m.current&&Fn(m.current),Y=M&&M[M.length-1];Y&&(k.preventDefault(),Y.focus())}function O(k){var M=m.current&&Fn(m.current);return!!M&&M.length!==0&&k.target===M[0]}function C(k){var M;k.preventDefault(),(M=f.current)==null||M.focus()}function w(k){var M=m.current?Fn(g).filter(function(Y){return!m.current.contains(Y)}):null;return!!M&&k.target===M[M.length-1]}function I(k){return k.target===Fn(g)[0]}V(function(){return g.addEventListener("keydown",E),function(){g.removeEventListener("keydown",E)}},[]);var F=[];function x(){var k=m.current&&Fn(m.current);k&&(k.forEach(function(M){F.push([M,M.tabIndex]),M.tabIndex=-1}),g.addEventListener("focusin",$))}function $(){g.removeEventListener("focusin",$),F.forEach(function(k){var M=k[0],Y=k[1];M.tabIndex=Y})}}(i,c),ae(r,vi({"data-reach-popover":"",ref:p},u,{style:vi({position:"absolute"},hS.apply(void 0,[s,h,d].concat(l)),u.style)}))});function hS(n,e,t){for(var r=arguments.length,i=new Array(r>3?r-3:0),o=3;o<r;o++)i[o-3]=arguments[o];return t?n.apply(void 0,[e,t].concat(i.map(function(s){return s.current}))):{visibility:"hidden"}}var pS=function(n,e){if(!n||!e)return{};var t=function(o,s,a,l){a===void 0&&(a=0),l===void 0&&(l=0);var u={top:o.top-s.height<0,right:window.innerWidth<o.left+s.width-a,bottom:window.innerHeight<o.bottom+s.height-l,left:o.left+o.width-s.width<0},c=u.right&&!u.left,d=u.left&&!u.right,h=u.bottom&&!u.top,p=u.top&&!u.bottom;return{directionRight:c,directionLeft:d,directionUp:h,directionDown:p}}(n,e),r=t.directionRight,i=t.directionUp;return vi({left:r?n.right-e.width+window.pageXOffset+"px":n.left+window.pageXOffset+"px"},function(o,s,a){return{top:a?o.top-s.height+window.pageYOffset+"px":o.top+o.height+window.pageYOffset+"px"}}(n,e,i))},ic=!1,fS=0,pm=function(){return++fS};function fm(n,e){return kt(e)}function mm(){}function er(){return er=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},er.apply(this,arguments)}var mS=["element","index"];function gS(n,e){return e===void 0&&(e={}),fm(0,er({descendants:[],registerDescendant:mm,unregisterDescendant:mm},e))}function ES(n){var e=n.context,t=n.children,r=n.items,i=n.set,o=oe(function(a){var l=a.element,u=a.index,c=function(d,h){if(d==null)return{};var p,f,m={},g=Object.keys(d);for(f=0;f<g.length;f++)p=g[f],h.indexOf(p)>=0||(m[p]=d[p]);return m}(a,mS);l&&i(function(d){var h;if(u!=null)return[].concat(d,[er({},c,{element:l,index:u})]).sort(function(m,g){return m.index-g.index});if(d.length===0)h=[er({},c,{element:l,index:0})];else if(d.find(function(m){return m.element===l}))h=d;else{var p=d.findIndex(function(m){return!(!m.element||!l)&&!!(m.element.compareDocumentPosition(l)&Node.DOCUMENT_POSITION_PRECEDING)}),f=er({},c,{element:l,index:p});h=p===-1?[].concat(d,[f]):[].concat(d.slice(0,p),[f],d.slice(p))}return h.map(function(m,g){return er({},m,{index:g})})})},[]),s=oe(function(a){a&&i(function(l){return l.filter(function(u){return a!==u.element})})},[]);return ae(e.Provider,{value:ce(function(){return{descendants:r,registerDescendant:o,unregisterDescendant:s}},[r,o,s])},t)}function fa(n){return"which"in n?n.which===3:"button"in n&&n.button===2}function oc(n){var e=W(null);return V(function(){e.current=n},[n]),e.current}function sc(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return e.filter(function(r){return r!=null}).join("--")}function Lt(n,e){return function(t){if(n&&n(t),!t.defaultPrevented)return e(t)}}function ma(n,e){if(n==null)return{};var t,r,i={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(i[t]=n[t]);return i}function ft(){return ft=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},ft.apply(this,arguments)}var vS=["onKeyDown","onMouseDown","id","ref"],AS=["index","isLink","onClick","onDragStart","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseUp","onSelect","disabled","onFocus","valueText","ref"],_S=["id","onKeyDown","ref"],yS=["onBlur","portal","position","ref"],gm="CLEAR_SELECTION_INDEX",ac="CLICK_MENU_ITEM",xo="CLOSE_MENU",lc="OPEN_MENU_AT_INDEX",Em="OPEN_MENU_CLEARED",uc="SEARCH_FOR_ITEM",tr="SELECT_ITEM_AT_INDEX",vm="SET_BUTTON_ID",ga=gS(),cc=fm(0,{}),OS={triggerId:null,isExpanded:!1,typeaheadQuery:"",selectionIndex:-1},TS=function(n){var e=n.id,t=n.children,r=W(null),i=W(null),o=W(null),s=ne([]),a=s[0],l=s[1],u=function(_){var y=ne(_||(ic?pm():null)),T=y[0],S=y[1];return Ei(function(){T===null&&S(pm())},[]),V(function(){ic===!1&&(ic=!0)},[]),T!=null?String(T):void 0}(e),c=e||sc("menu",u),d=sc("menu-button",c),h=br(NS,ft({},OS,{triggerId:d})),p=h[0],f=h[1],m=W(!1),g=W([]),E=W(!1),v=W({x:0,y:0}),A={dispatch:f,dropdownId:c,dropdownRef:i,mouseDownStartPosRef:v,popoverRef:o,readyToSelect:E,selectCallbacks:g,state:p,triggerClickedRef:m,triggerRef:r};return V(function(){p.isExpanded?(window.__REACH_DISABLE_TOOLTIPS=!0,window.requestAnimationFrame(function(){Ea(i.current)})):window.__REACH_DISABLE_TOOLTIPS=!1},[p.isExpanded]),ae(ES,{context:ga,items:a,set:l},ae(cc.Provider,{value:A},ec(t)?t({isExpanded:p.isExpanded,isOpen:p.isExpanded}):t))};function SS(n){var e=n.index,t=n.isLink,r=t!==void 0&&t,i=n.onClick,o=n.onDragStart,s=n.onMouseDown,a=n.onMouseEnter,l=n.onMouseLeave,u=n.onMouseMove,c=n.onMouseUp,d=n.onSelect,h=n.disabled,p=n.onFocus,f=n.valueText,m=n.ref,g=ma(n,AS),E=va(),v=E.dispatch,A=E.dropdownRef,_=E.mouseDownStartPosRef,y=E.readyToSelect,T=E.selectCallbacks,S=E.triggerRef,b=E.state,O=b.selectionIndex,C=b.isExpanded,w=W(null),I=ne(f||""),F=I[0],x=I[1],$=oe(function(D){!f&&D!=null&&D.textContent&&x(D.textContent)},[f]),k=W(!1),M=function(D,Z){var ee=ne(Z),se=ee[0],U=ee[1];return[se,oe(function(de){D.current=de,U(de)},[])]}(w,null),Y=M[0],L=M[1],J=function(D,Z,ee){var se=im(),U=qe(Z),de=U.registerDescendant,fe=U.unregisterDescendant,Ne=U.descendants,ge=ee??Ne.findIndex(function(he){return he.element===D.element});return Ei(function(){return D.element||se(),de(er({},D,{index:ge})),function(){fe(D.element)}},[D,se,ge,de,fe].concat(Object.values(D))),ge}(ce(function(){return{element:Y,key:F,disabled:h,isLink:r}},[h,Y,r,F]),ga,e),j=J===O&&!h,re=Lo(m,L,$);function te(){Ea(S.current),d&&d(),v({type:ac})}return T.current[J]=d,V(function(){if(C){var D=window.setTimeout(function(){y.current=!0},400);return function(){window.clearTimeout(D)}}y.current=!1},[C,y]),V(function(){var D=ko(w.current);return D.addEventListener("mouseup",Z),function(){D.removeEventListener("mouseup",Z)};function Z(){k.current=!1}},[]),{data:{disabled:h},props:ft({id:Am(J),tabIndex:-1},g,{ref:re,"data-disabled":h?"":void 0,"data-selected":j?"":void 0,"data-valuetext":F,onClick:Lt(i,function(D){fa(D.nativeEvent)||r&&(h?D.preventDefault():te())}),onDragStart:Lt(o,function(D){r&&D.preventDefault()}),onMouseDown:Lt(s,function(D){fa(D.nativeEvent)||(r?k.current=!0:D.preventDefault())}),onMouseEnter:Lt(a,function(D){var Z=ko(A.current);j||J==null||h||(A!=null&&A.current&&A.current!==Z.activeElement&&w.current!==Z.activeElement&&A.current.focus(),v({type:tr,payload:{index:J}}))}),onMouseLeave:Lt(l,function(D){v({type:gm})}),onMouseMove:Lt(u,function(D){if(!y.current){var Z=Math.abs(D.clientX-_.current.x),ee=Math.abs(D.clientY-_.current.y);(Z>8||ee>8)&&(y.current=!0)}j||J==null||h||v({type:tr,payload:{index:J,dropdownRef:A}})}),onFocus:Lt(p,function(){y.current=!0,j||J==null||h||v({type:tr,payload:{index:J}})}),onMouseUp:Lt(c,function(D){fa(D.nativeEvent)||(y.current?r?k.current?k.current=!1:w.current&&w.current.click():h||te():y.current=!0)})})}}function bS(n){n.id;var e=n.onKeyDown,t=n.ref,r=ma(n,_S),i=va(),o=i.dispatch,s=i.triggerRef,a=i.dropdownRef,l=i.selectCallbacks,u=i.dropdownId,c=i.state,d=c.isExpanded,h=c.triggerId,p=c.selectionIndex,f=c.typeaheadQuery,m=_m(),g=Lo(a,t);V(function(){var y=function(S,b){if(b===void 0&&(b=""),!b)return null;var O=S.find(function(C){var w,I,F;return!C.disabled&&((w=C.element)==null||(I=w.dataset)==null||(F=I.valuetext)==null?void 0:F.toLowerCase().startsWith(b))});return O?S.indexOf(O):null}(m,f);f&&y!=null&&o({type:tr,payload:{index:y,dropdownRef:a}});var T=window.setTimeout(function(){return f&&o({type:uc,payload:""})},1e3);return function(){return window.clearTimeout(T)}},[o,m,f,a]);var E=oc(m.length),v=oc(m[p]),A=oc(p);V(function(){p>m.length-1?o({type:tr,payload:{index:m.length-1,dropdownRef:a}}):E!==m.length&&p>-1&&v&&A===p&&m[p]!==v&&o({type:tr,payload:{index:m.findIndex(function(y){return y.key===v?.key}),dropdownRef:a}})},[a,o,m,E,v,A,p]);var _=Lt(function(y){var T=y.key;if(d)switch(T){case"Enter":case" ":var S=m.find(function(O){return O.index===p});S&&!S.disabled&&(y.preventDefault(),S.isLink&&S.element?S.element.click():(Ea(s.current),l.current[S.index]&&l.current[S.index](),o({type:ac})));break;case"Escape":Ea(s.current),o({type:xo});break;case"Tab":y.preventDefault();break;default:if(typeof T=="string"&&T.length===1){var b=f+T.toLowerCase();o({type:uc,payload:b})}}},function(y,T){var S=qe(y).descendants,b=T.callback,O=T.currentIndex,C=T.filter,w=T.key,I=w===void 0?"index":w,F=T.orientation,x=F===void 0?"vertical":F,$=T.rotate,k=$===void 0||$,M=T.rtl,Y=M!==void 0&&M;return function(L){if(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","PageUp","PageDown","Home","End"].includes(L.key)){var J=O??-1,j=C?S.filter(C):S;if(j.length){var re=j.findIndex(function(rn){return rn.index===O});switch(L.key){case"ArrowDown":if(x==="vertical"||x==="both"){L.preventDefault();var te=Ne();b(I==="option"?te:te[I])}break;case"ArrowUp":if(x==="vertical"||x==="both"){L.preventDefault();var D=ge();b(I==="option"?D:D[I])}break;case"ArrowLeft":if(x==="horizontal"||x==="both"){L.preventDefault();var Z=(Y?Ne:ge)();b(I==="option"?Z:Z[I])}break;case"ArrowRight":if(x==="horizontal"||x==="both"){L.preventDefault();var ee=(Y?ge:Ne)();b(I==="option"?ee:ee[I])}break;case"PageUp":L.preventDefault();var se=(L.ctrlKey?ge:he)();b(I==="option"?se:se[I]);break;case"Home":L.preventDefault();var U=he();b(I==="option"?U:U[I]);break;case"PageDown":L.preventDefault();var de=(L.ctrlKey?Ne:et)();b(I==="option"?de:de[I]);break;case"End":L.preventDefault();var fe=et();b(I==="option"?fe:fe[I])}}}function Ne(){return J===et().index?k?he():j[re]:j[(re+1)%j.length]}function ge(){return J===he().index?k?et():j[re]:j[(re-1+j.length)%j.length]}function he(){return j[0]}function et(){return j[j.length-1]}}}(ga,{currentIndex:p,orientation:"vertical",rotate:!1,filter:function(y){return!y.disabled},callback:function(y){o({type:tr,payload:{index:y,dropdownRef:a}})},key:"index"}));return{data:{activeDescendant:Am(p)||void 0,triggerId:h},props:ft({tabIndex:-1},r,{ref:g,id:u,onKeyDown:Lt(e,_)})}}function Am(n){var e=qe(cc).dropdownId;return n!=null&&n>-1?sc("option-"+n,e):void 0}function Ea(n){n&&n.focus()}function NS(n,e){switch(e===void 0&&(e={}),e.type){case ac:case xo:return ft({},n,{isExpanded:!1,selectionIndex:-1});case"OPEN_MENU_AT_FIRST_ITEM":return ft({},n,{isExpanded:!0,selectionIndex:0});case lc:return ft({},n,{isExpanded:!0,selectionIndex:e.payload.index});case Em:return ft({},n,{isExpanded:!0,selectionIndex:-1});case tr:var t=e.payload.dropdownRef,r=t===void 0?{current:null}:t;if(e.payload.index>=0&&e.payload.index!==n.selectionIndex){if(r.current){var i=ko(r.current);r.current!==i?.activeElement&&r.current.focus()}return ft({},n,{selectionIndex:e.payload.max!=null?Math.min(Math.max(e.payload.index,0),e.payload.max):Math.max(e.payload.index,0)})}return n;case gm:return ft({},n,{selectionIndex:-1});case vm:return ft({},n,{triggerId:e.payload});case uc:return e.payload!==void 0?ft({},n,{typeaheadQuery:e.payload}):n;default:return n}}function va(){return qe(cc)}function _m(){return qe(ga).descendants}var ym={exports:{}},Ae={},Qe=typeof Symbol=="function"&&Symbol.for,dc=Qe?Symbol.for("react.element"):60103,hc=Qe?Symbol.for("react.portal"):60106,Aa=Qe?Symbol.for("react.fragment"):60107,_a=Qe?Symbol.for("react.strict_mode"):60108,ya=Qe?Symbol.for("react.profiler"):60114,Oa=Qe?Symbol.for("react.provider"):60109,Ta=Qe?Symbol.for("react.context"):60110,pc=Qe?Symbol.for("react.async_mode"):60111,Sa=Qe?Symbol.for("react.concurrent_mode"):60111,ba=Qe?Symbol.for("react.forward_ref"):60112,Na=Qe?Symbol.for("react.suspense"):60113,CS=Qe?Symbol.for("react.suspense_list"):60120,Ca=Qe?Symbol.for("react.memo"):60115,Ia=Qe?Symbol.for("react.lazy"):60116,IS=Qe?Symbol.for("react.block"):60121,wS=Qe?Symbol.for("react.fundamental"):60117,RS=Qe?Symbol.for("react.responder"):60118,DS=Qe?Symbol.for("react.scope"):60119;function xt(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case dc:switch(n=n.type){case pc:case Sa:case Aa:case ya:case _a:case Na:return n;default:switch(n=n&&n.$$typeof){case Ta:case ba:case Ia:case Ca:case Oa:return n;default:return e}}case hc:return e}}}function Om(n){return xt(n)===Sa}Ae.AsyncMode=pc,Ae.ConcurrentMode=Sa,Ae.ContextConsumer=Ta,Ae.ContextProvider=Oa,Ae.Element=dc,Ae.ForwardRef=ba,Ae.Fragment=Aa,Ae.Lazy=Ia,Ae.Memo=Ca,Ae.Portal=hc,Ae.Profiler=ya,Ae.StrictMode=_a,Ae.Suspense=Na,Ae.isAsyncMode=function(n){return Om(n)||xt(n)===pc},Ae.isConcurrentMode=Om,Ae.isContextConsumer=function(n){return xt(n)===Ta},Ae.isContextProvider=function(n){return xt(n)===Oa},Ae.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===dc},Ae.isForwardRef=function(n){return xt(n)===ba},Ae.isFragment=function(n){return xt(n)===Aa},Ae.isLazy=function(n){return xt(n)===Ia},Ae.isMemo=function(n){return xt(n)===Ca},Ae.isPortal=function(n){return xt(n)===hc},Ae.isProfiler=function(n){return xt(n)===ya},Ae.isStrictMode=function(n){return xt(n)===_a},Ae.isSuspense=function(n){return xt(n)===Na},Ae.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===Aa||n===Sa||n===ya||n===_a||n===Na||n===CS||typeof n=="object"&&n!==null&&(n.$$typeof===Ia||n.$$typeof===Ca||n.$$typeof===Oa||n.$$typeof===Ta||n.$$typeof===ba||n.$$typeof===wS||n.$$typeof===RS||n.$$typeof===DS||n.$$typeof===IS)},Ae.typeOf=xt,ym.exports=Ae;var kS=ym.exports;function Mt(){return Mt=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Mt.apply(this,arguments)}function Ai(n,e){if(n==null)return{};var t,r,i={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(i[t]=n[t]);return i}var LS=["as","id","children"],xS=["as"],MS=["as"],PS=["as"],BS=["as"],FS=["as"],US=Q(function(n,e){var t=n.as,r=t===void 0?xe:t,i=n.id,o=n.children,s=Ai(n,LS),a=ce(function(){try{return kS.isFragment(ae(r,null))}catch{return!1}},[r])?{}:Mt({ref:e,id:i,"data-reach-menu":""},s);return ae(r,a,ae(TS,{id:i,children:o}))}),HS=Q(function(n,e){var t=n.as,r=t===void 0?"button":t,i=function(s){var a=s.onKeyDown,l=s.onMouseDown,u=s.id,c=s.ref,d=ma(s,vS),h=va(),p=h.dispatch,f=h.dropdownId,m=h.mouseDownStartPosRef,g=h.triggerClickedRef,E=h.triggerRef,v=h.state,A=v.triggerId,_=v.isExpanded,y=Lo(E,c),T=_m(),S=ce(function(){return T.findIndex(function(b){return!b.disabled})},[T]);return V(function(){u!=null&&u!==A&&p({type:vm,payload:u})},[A,p,u]),{data:{isExpanded:_,controls:f},props:ft({},d,{ref:y,id:A||void 0,onKeyDown:Lt(a,function(b){switch(b.key){case"ArrowDown":case"ArrowUp":b.preventDefault(),p({type:lc,payload:{index:S}});break;case"Enter":case" ":p({type:lc,payload:{index:S}})}}),onMouseDown:Lt(l,function(b){fa(b.nativeEvent)||(m.current={x:b.clientX,y:b.clientY},_||(g.current=!0),p(_?{type:xo}:{type:Em}))}),type:"button"})}}(Mt({},Ai(n,xS),{ref:e})),o=i.data;return ae(r,Mt({"aria-expanded":!!o.isExpanded||void 0,"aria-haspopup":!0,"aria-controls":o.controls},i.props,{"data-reach-menu-button":""}))}),$S=Q(function(n,e){var t=n.as,r=t===void 0?"div":t,i=SS(Mt({},Ai(n,MS),{ref:e})),o=i.data.disabled;return ae(r,Mt({role:"menuitem"},i.props,{"aria-disabled":o||void 0,"data-reach-menu-item":""}))}),jS=Q(function(n,e){var t=n.as,r=t===void 0?"div":t,i=Ai(n,PS);return ae($S,Mt({},i,{ref:e,as:r}))}),YS=Q(function(n,e){var t=n.as,r=t===void 0?"div":t,i=bS(Mt({},Ai(n,BS),{ref:e})),o=i.data;return ae(r,Mt({"aria-activedescendant":o.activeDescendant,"aria-labelledby":o.triggerId||void 0,role:"menu"},i.props,{"data-reach-menu-items":""}))}),zS=Q(function(n,e){var t=n.as,r=t===void 0?"div":t,i=function(d){var h=d.onBlur,p=d.portal,f=p===void 0||p,m=d.position,g=d.ref,E=ma(d,yS),v=va(),A=v.triggerRef,_=v.triggerClickedRef,y=v.dispatch,T=v.dropdownRef,S=v.popoverRef,b=v.state.isExpanded,O=Lo(S,g);return V(function(){if(b){var C=ko(S.current);return C.addEventListener("mousedown",w),function(){C.removeEventListener("mousedown",w)}}function w(I){var F,x;_.current?_.current=!1:(F=S.current,x=I.target,F&&F.contains(x)||y({type:xo}))}},[_,A,y,T,S,b]),{data:{portal:f,position:m,targetRef:A,isExpanded:b},props:ft({ref:O,hidden:!b,onBlur:Lt(h,function(C){C.currentTarget.contains(C.relatedTarget)||y({type:xo})})},E)}}(Mt({},Ai(n,FS),{ref:e})),o=i.data,s=o.portal,a=o.targetRef,l=o.position,u=i.props,c={"data-reach-menu-popover":""};return s?ae(cS,Mt({},u,c,{as:r,targetRef:a,position:l})):ae(r,Mt({},u,c))}),fc=[],mc=function(n){return n===void 0},wa=/\s*(\.\d+|\d+(?:\.\d+)?)(%|deg)?\s*/,Ra=/\s*(\.\d+|100|\d?\d(?:\.\d+)?)%\s*/,VS=new RegExp("^(rgb|hsl|hsv)a?\\("+wa.source+"[, ]"+wa.source+"[, ]"+wa.source+"(?:[,/]"+wa.source+")?\\)$","i");function gc(n,e,t){return n==="%"?100:n==="deg"||t&&e===0?360:n?void 0:255}function _e(n){if(Array.isArray(n)){if(typeof n[0]=="string"&&typeof _e[n[0]]=="function")return new _e[n[0]](n.slice(1,n.length));if(n.length===4)return new _e.RGB(n[0]/255,n[1]/255,n[2]/255,n[3]/255)}else if(typeof n=="string"){var e=n.toLowerCase();_e.namedColors[e]&&(n="#"+_e.namedColors[e]),e==="transparent"&&(n="rgba(0,0,0,0)");var t=n.match(VS);if(t){var r=t[1].toUpperCase(),i=r[0]==="H";if(mc(_e[r]))throw new Error("color."+r+" is not installed.");let a=mc(t[8])?1:void 0;return a===void 0&&(a=t[9]==="%"?parseFloat(t[8])/100:parseFloat(t[8])),new _e[r](parseFloat(t[2])/gc(t[3],0,i),parseFloat(t[4])/gc(t[5],1,i),parseFloat(t[6])/gc(t[7],2,i),a)}n.length<6&&(n=n.replace(/^#?([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,"$1$1$2$2$3$3$4$4"));var o=n.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 _e.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(_e.CMYK){var s=n.match(new RegExp("^cmyk\\("+Ra.source+","+Ra.source+","+Ra.source+","+Ra.source+"\\)$","i"));if(s)return new _e.CMYK(parseFloat(s[1])/100,parseFloat(s[2])/100,parseFloat(s[3])/100,parseFloat(s[4])/100)}}else if(typeof n=="object"&&n.isColor)return n;return!1}_e.namedColors={},_e.installColorSpace=function(n,e,t){_e[n]=function(a){var l=Array.isArray(a)?a:arguments;e.forEach(function(u,c){var d=l[c];if(u==="alpha")this._alpha=isNaN(d)||d>1?1:d<0?0:d;else{if(isNaN(d))throw new Error("["+n+"]: Invalid color: ("+e.join(",")+")");u==="hue"?this._hue=d<0?d-Math.floor(d):d%1:this["_"+u]=d<0?0:d>1?1:d}},this)},_e[n].propertyNames=e;var r=_e[n].prototype;for(var i in["valueOf","hex","hexa","css","cssa"].forEach(function(a){r[a]=r[a]||(n==="RGB"?r.hex:function(){return this.rgb()[a]()})}),r.isColor=!0,r.equals=function(a,l){mc(l)&&(l=1e-10),a=a[n.toLowerCase()]();for(var u=0;u<e.length;u+=1)if(Math.abs(this["_"+e[u]]-a["_"+e[u]])>l)return!1;return!0},r.toJSON=function(){return[n].concat(e.map(function(a){return this["_"+a]},this))},t)if(Object.prototype.hasOwnProperty.call(t,i)){var o=i.match(/^from(.*)$/);o?_e[o[1].toUpperCase()].prototype[n.toLowerCase()]=t[i]:r[i]=t[i]}function s(a,l){var u={};for(var c in u[l.toLowerCase()]=function(){return this.rgb()[l.toLowerCase()]()},_e[l].propertyNames.forEach(function(d){var h=d==="black"?"k":d.charAt(0);u[d]=u[h]=function(p,f){return this[l.toLowerCase()]()[d](p,f)}}),u)Object.prototype.hasOwnProperty.call(u,c)&&_e[a].prototype[c]===void 0&&(_e[a].prototype[c]=u[c])}return r[n.toLowerCase()]=function(){return this},r.toString=function(){return"["+n+" "+e.map(function(a){return this["_"+a]},this).join(", ")+"]"},e.forEach(function(a){var l=a==="black"?"k":a.charAt(0);r[a]=r[l]=function(u,c){return u===void 0?this["_"+a]:c?new this.constructor(e.map(function(d){return this["_"+d]+(a===d?u:0)},this)):new this.constructor(e.map(function(d){return a===d?u:this["_"+d]},this))}}),fc.forEach(function(a){s(n,a),s(a,n)}),fc.push(n),_e},_e.pluginList=[],_e.use=function(n){return _e.pluginList.indexOf(n)===-1&&(this.pluginList.push(n),n(_e)),_e},_e.installMethod=function(n,e){return fc.forEach(function(t){_e[t].prototype[n]=e}),this},_e.installColorSpace("RGB",["red","green","blue","alpha"],{hex:function(){var n=(65536*Math.round(255*this._red)+256*Math.round(255*this._green)+Math.round(255*this._blue)).toString(16);return"#"+"00000".substr(0,6-n.length)+n},hexa:function(){var n=Math.round(255*this._alpha).toString(16);return this.hex()+"00".substr(0,2-n.length)+n},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 Tm=function(n){n.installColorSpace("XYZ",["x","y","z","alpha"],{fromRgb:function(){var e=function(o){return o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92},t=e(this._red),r=e(this._green),i=e(this._blue);return new n.XYZ(.4124564*t+.3575761*r+.1804375*i,.2126729*t+.7151522*r+.072175*i,.0193339*t+.119192*r+.9503041*i,this._alpha)},rgb:function(){var e=this._x,t=this._y,r=this._z,i=function(o){return o>.0031308?1.055*Math.pow(o,1/2.4)-.055:12.92*o};return new n.RGB(i(3.2404542*e+-1.5371385*t+-.4985314*r),i(-.969266*e+1.8760108*t+.041556*r),i(.0556434*e+-.2040259*t+1.0572252*r),this._alpha)},lab:function(){var e=function(o){return o>.008856?Math.pow(o,.3333333333333333):7.787037*o+.13793103448275862},t=e(this._x/95.047),r=e(this._y/100),i=e(this._z/108.883);return new n.LAB(116*r-16,500*(t-r),200*(r-i),this._alpha)}})},Sm=function(n){n.installColorSpace("HSV",["hue","saturation","value","alpha"],{rgb:function(){var e,t,r,i=this._hue,o=this._saturation,s=this._value,a=Math.min(5,Math.floor(6*i)),l=6*i-a,u=s*(1-o),c=s*(1-l*o),d=s*(1-(1-l)*o);switch(a){case 0:e=s,t=d,r=u;break;case 1:e=c,t=s,r=u;break;case 2:e=u,t=s,r=d;break;case 3:e=u,t=c,r=s;break;case 4:e=d,t=u,r=s;break;case 5:e=s,t=u,r=c}return new n.RGB(e,t,r,this._alpha)},hsl:function(){var e,t=(2-this._saturation)*this._value,r=this._saturation*this._value,i=t<=1?t:2-t;return e=i<1e-9?0:r/i,new n.HSL(this._hue,e,t/2,this._alpha)},fromRgb:function(){var e,t=this._red,r=this._green,i=this._blue,o=Math.max(t,r,i),s=o-Math.min(t,r,i),a=o===0?0:s/o,l=o;if(s===0)e=0;else switch(o){case t:e=(r-i)/s/6+(r<i?1:0);break;case r:e=(i-t)/s/6+1/3;break;case i:e=(t-r)/s/6+2/3}return new n.HSV(e,a,l,this._alpha)}})},_i=function(n){n.use(Sm),n.installColorSpace("HSL",["hue","saturation","lightness","alpha"],{hsv:function(){var e,t=2*this._lightness,r=this._saturation*(t<=1?t:2-t);return e=t+r<1e-9?0:2*r/(t+r),new n.HSV(this._hue,e,(t+r)/2,this._alpha)},rgb:function(){return this.hsv().rgb()},fromRgb:function(){return this.hsv().hsl()}})},bm=function(n){function e(t){return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}n.installMethod("luminance",function(){var t=this.rgb();return .2126*e(t._red)+.7152*e(t._green)+.0722*e(t._blue)})},Nm=function(n){n.installMethod("isDark",function(){var e=this.rgb();return(255*e._red*299+255*e._green*587+255*e._blue*114)/1e3<128})},WS=_e.use(Tm).use(function(n){n.use(Tm),n.installColorSpace("LAB",["l","a","b","alpha"],{fromRgb:function(){return this.xyz().lab()},rgb:function(){return this.xyz().rgb()},xyz:function(){var e=function(o){var s=Math.pow(o,3);return s>.008856?s:(o-.13793103448275862)/7.87},t=(this._l+16)/116,r=this._a/500+t,i=t-this._b/200;return new n.XYZ(95.047*e(r),100*e(t),108.883*e(i),this._alpha)}})}).use(Sm).use(_i).use(function(n){n.installColorSpace("CMYK",["cyan","magenta","yellow","black","alpha"],{rgb:function(){return new n.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 e=this._red,t=this._green,r=this._blue,i=1-e,o=1-t,s=1-r,a=1;return e||t||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 n.CMYK(i,o,s,a,this._alpha)}})}).use(function(n){n.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(n){n.installMethod("clearer",function(e){return this.alpha(isNaN(e)?-.1:-e,!0)})}).use(function(n){n.use(bm),n.installMethod("contrast",function(e){var t=this.luminance(),r=e.luminance();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)})}).use(function(n){n.use(_i),n.installMethod("darken",function(e){return this.lightness(isNaN(e)?-.1:-e,!0)})}).use(function(n){n.use(_i),n.installMethod("desaturate",function(e){return this.saturation(isNaN(e)?-.1:-e,!0)})}).use(function(n){function e(){var t=this.rgb(),r=.3*t._red+.59*t._green+.11*t._blue;return new n.RGB(r,r,r,t._alpha)}n.installMethod("greyscale",e).installMethod("grayscale",e)}).use(Nm).use(function(n){n.use(Nm),n.installMethod("isLight",function(){return!this.isDark()})}).use(function(n){n.use(_i),n.installMethod("lighten",function(e){return this.lightness(isNaN(e)?.1:e,!0)})}).use(bm).use(function(n){n.installMethod("mix",function(e,t){e=n(e).rgb();var r=2*(t=1-(isNaN(t)?.5:t))-1,i=this._alpha-e._alpha,o=((r*i==-1?r:(r+i)/(1+r*i))+1)/2,s=1-o,a=this.rgb();return new n.RGB(a._red*o+e._red*s,a._green*o+e._green*s,a._blue*o+e._blue*s,a._alpha*t+e._alpha*(1-t))})}).use(function(n){n.installMethod("negate",function(){var e=this.rgb();return new n.RGB(1-e._red,1-e._green,1-e._blue,this._alpha)})}).use(function(n){n.installMethod("opaquer",function(e){return this.alpha(isNaN(e)?.1:e,!0)})}).use(function(n){n.use(_i),n.installMethod("rotate",function(e){return this.hue((e||0)/360,!0)})}).use(function(n){n.use(_i),n.installMethod("saturate",function(e){return this.saturation(isNaN(e)?.1:e,!0)})}).use(function(n){n.installMethod("toAlpha",function(e){var t=this.rgb(),r=e(e).rgb(),i=new e.RGB(0,0,0,t._alpha),o=["_red","_green","_blue"];return o.forEach(function(s){t[s]<1e-10?i[s]=t[s]:t[s]>r[s]?i[s]=(t[s]-r[s])/(1-r[s]):t[s]>r[s]?i[s]=(r[s]-t[s])/r[s]:i[s]=0}),i._red>i._green?i._red>i._blue?t._alpha=i._red:t._alpha=i._blue:i._green>i._blue?t._alpha=i._green:t._alpha=i._blue,t._alpha<1e-10||(o.forEach(function(s){t[s]=(t[s]-r[s])/t._alpha+r[s]}),t._alpha*=i._alpha),t})});const Cm=ha(WS);function st(n,e,t,r){return new(t||(t=Promise))(function(i,o){function s(u){try{l(r.next(u))}catch(c){o(c)}}function a(u){try{l(r.throw(u))}catch(c){o(c)}}function l(u){var c;u.done?i(u.value):(c=u.value,c instanceof t?c:new t(function(d){d(c)})).then(s,a)}l((r=r.apply(n,e||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;let Mo=class{constructor(){this.listeners={}}on(n,e,t){if(this.listeners[n]||(this.listeners[n]=new Set),this.listeners[n].add(e),t?.once){const r=()=>{this.un(n,r),this.un(n,e)};return this.on(n,r),r}return()=>this.un(n,e)}un(n,e){var t;(t=this.listeners[n])===null||t===void 0||t.delete(e)}once(n,e){return this.on(n,e,{once:!0})}unAll(){this.listeners={}}emit(n,...e){this.listeners[n]&&this.listeners[n].forEach(t=>t(...e))}};const Im={decode:function(n,e){return st(this,void 0,void 0,function*(){const t=new AudioContext({sampleRate:e});return t.decodeAudioData(n).finally(()=>t.close())})},createBuffer:function(n,e){return typeof n[0]=="number"&&(n=[n]),function(t){const r=t[0];if(r.some(i=>i>1||i<-1)){const i=r.length;let o=0;for(let s=0;s<i;s++){const a=Math.abs(r[s]);a>o&&(o=a)}for(const s of t)for(let a=0;a<i;a++)s[a]/=o}}(n),{duration:e,length:n[0].length,sampleRate:n[0].length/e,numberOfChannels:n.length,getChannelData:t=>n?.[t],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function wm(n,e){const t=e.xmlns?document.createElementNS(e.xmlns,n):document.createElement(n);for(const[r,i]of Object.entries(e))if(r==="children")for(const[o,s]of Object.entries(e))typeof s=="string"?t.appendChild(document.createTextNode(s)):t.appendChild(wm(o,s));else r==="style"?Object.assign(t.style,i):r==="textContent"?t.textContent=i:t.setAttribute(r,i.toString());return t}function Rm(n,e,t){const r=wm(n,e||{});return t?.appendChild(r),r}var GS=Object.freeze({__proto__:null,createElement:Rm,default:Rm});const XS={fetchBlob:function(n,e,t){return st(this,void 0,void 0,function*(){const r=yield fetch(n,t);if(r.status>=400)throw new Error(`Failed to fetch ${n}: ${r.status} (${r.statusText})`);return function(i,o){st(this,void 0,void 0,function*(){if(!i.body||!i.headers)return;const s=i.body.getReader(),a=Number(i.headers.get("Content-Length"))||0;let l=0;const u=d=>st(this,void 0,void 0,function*(){l+=d?.length||0;const h=Math.round(l/a*100);o(h)}),c=()=>st(this,void 0,void 0,function*(){let d;try{d=yield s.read()}catch{return}d.done||(u(d.value),yield c())});c()})}(r.clone(),e),r.blob()})}};let KS=class extends Mo{constructor(n){super(),this.isExternalMedia=!1,n.media?(this.media=n.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),n.mediaControls&&(this.media.controls=!0),n.autoplay&&(this.media.autoplay=!0),n.playbackRate!=null&&this.onMediaEvent("canplay",()=>{n.playbackRate!=null&&(this.media.playbackRate=n.playbackRate)},{once:!0})}onMediaEvent(n,e,t){return this.media.addEventListener(n,e,t),()=>this.media.removeEventListener(n,e,t)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const n=this.getSrc();n.startsWith("blob:")&&URL.revokeObjectURL(n)}canPlayType(n){return this.media.canPlayType(n)!==""}setSrc(n,e){const t=this.getSrc();if(n&&t===n)return;this.revokeSrc();const r=e instanceof Blob&&(this.canPlayType(e.type)||!n)?URL.createObjectURL(e):n;try{this.media.src=r}catch{this.media.src=n}}destroy(){this.media.pause(),this.isExternalMedia||(this.media.remove(),this.revokeSrc(),this.media.src="",this.media.load())}setMediaElement(n){this.media=n}play(){return st(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(n){this.media.currentTime=n}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(n){this.media.volume=n}getMuted(){return this.media.muted}setMuted(n){this.media.muted=n}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(n,e){e!=null&&(this.media.preservesPitch=e),this.media.playbackRate=n}getMediaElement(){return this.media}setSinkId(n){return this.media.setSinkId(n)}},Ec=class Gp extends Mo{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 r=this.parentFromOptionsContainer(e.container);this.parent=r;const[i,o]=this.initHtml();r.appendChild(i),this.container=i,this.scrollContainer=o.querySelector(".scroll"),this.wrapper=o.querySelector(".wrapper"),this.canvasWrapper=o.querySelector(".canvases"),this.progressWrapper=o.querySelector(".progress"),this.cursor=o.querySelector(".cursor"),t&&o.appendChild(t),this.initEvents()}parentFromOptionsContainer(e){let t;if(typeof e=="string"?t=document.querySelector(e):e instanceof HTMLElement&&(t=e),!t)throw new Error("Container not found");return t}initEvents(){const e=t=>{const r=this.wrapper.getBoundingClientRect(),i=t.clientX-r.left,o=t.clientY-r.top;return[i/r.width,o/r.height]};if(this.wrapper.addEventListener("click",t=>{const[r,i]=e(t);this.emit("click",r,i)}),this.wrapper.addEventListener("dblclick",t=>{const[r,i]=e(t);this.emit("dblclick",r,i)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:t,scrollWidth:r,clientWidth:i}=this.scrollContainer,o=t/r,s=(t+i)/r;this.emit("scroll",o,s,t,t+i)}),typeof ResizeObserver=="function"){const t=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{t().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const e=this.parent.clientWidth;e===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=e,this.reRender())}initDrag(){this.subscriptions.push(function(e,t,r,i,o=3,s=0,a=100){if(!e)return()=>{};const l=matchMedia("(pointer: coarse)").matches;let u=()=>{};const c=d=>{if(d.button!==s)return;d.preventDefault(),d.stopPropagation();let h=d.clientX,p=d.clientY,f=!1;const m=Date.now(),g=y=>{if(y.preventDefault(),y.stopPropagation(),l&&Date.now()-m<a)return;const T=y.clientX,S=y.clientY,b=T-h,O=S-p;if(f||Math.abs(b)>o||Math.abs(O)>o){const C=e.getBoundingClientRect(),{left:w,top:I}=C;f||(r?.(h-w,p-I),f=!0),t(b,O,T-w,S-I),h=T,p=S}},E=y=>{if(f){const T=y.clientX,S=y.clientY,b=e.getBoundingClientRect(),{left:O,top:C}=b;i?.(T-O,S-C)}u()},v=y=>{y.relatedTarget&&y.relatedTarget!==document.documentElement||E(y)},A=y=>{f&&(y.stopPropagation(),y.preventDefault())},_=y=>{f&&y.preventDefault()};document.addEventListener("pointermove",g),document.addEventListener("pointerup",E),document.addEventListener("pointerout",v),document.addEventListener("pointercancel",v),document.addEventListener("touchmove",_,{passive:!1}),document.addEventListener("click",A,{capture:!0}),u=()=>{document.removeEventListener("pointermove",g),document.removeEventListener("pointerup",E),document.removeEventListener("pointerout",v),document.removeEventListener("pointercancel",v),document.removeEventListener("touchmove",_),setTimeout(()=>{document.removeEventListener("click",A,{capture:!0})},10)}};return e.addEventListener("pointerdown",c),()=>{u(),e.removeEventListener("pointerdown",c)}}(this.wrapper,(e,t,r)=>{this.emit("drag",Math.max(0,Math.min(1,r/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 r;const i=((r=this.audioData)===null||r===void 0?void 0:r.numberOfChannels)||1;if(e==null)return 128;if(!isNaN(Number(e)))return Number(e);if(e==="auto"){const o=this.parent.clientHeight||128;return t?.every(s=>!s.overlay)?o/i:o}return 128}initHtml(){const e=document.createElement("div"),t=e.attachShadow({mode:"open"});return t.innerHTML=`
4
4
  <style>
5
5
  :host {
6
6
  user-select: none;
@@ -72,17 +72,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
72
72
  <div class="cursor" part="cursor"></div>
73
73
  </div>
74
74
  </div>
75
- `,[e,t]}setOptions(e){if(this.options.container!==e.container){const t=this.parentFromOptionsContainer(e.container);t.appendChild(this.container),this.parent=t}e.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||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,r=t*e;this.setScroll(r)}destroy(){var e,t;this.subscriptions.forEach(r=>r()),this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.unsubscribeOnScroll)===null||t===void 0||t.call(this)}createDelay(e=10){let t,r;const i=()=>{t&&clearTimeout(t),r&&r()};return this.timeouts.push(i),()=>new Promise((o,s)=>{i(),r=s,t=setTimeout(()=>{t=void 0,r=void 0,o()},e)})}convertColorValues(e){if(!Array.isArray(e))return e||"";if(e.length<2)return e[0]||"";const t=document.createElement("canvas"),r=t.getContext("2d"),i=t.height*(window.devicePixelRatio||1),o=r.createLinearGradient(0,0,0,i),s=1/(e.length-1);return e.forEach((a,l)=>{const u=l*s;o.addColorStop(u,a)}),o}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(e,t,r,i){const o=e[0],s=e[1]||e[0],a=o.length,{width:l,height:u}=r.canvas,c=u/2,d=this.getPixelRatio(),h=t.barWidth?t.barWidth*d:1,p=t.barGap?t.barGap*d:t.barWidth?h/2:0,f=t.barRadius||0,m=l/(h+p)/a,g=f&&"roundRect"in r?"roundRect":"rect";r.beginPath();let E=0,v=0,A=0;for(let _=0;_<=a;_++){const O=Math.round(_*m);if(O>E){const b=Math.round(v*c*i),y=b+Math.round(A*c*i)||1;let C=c-b;t.barAlign==="top"?C=0:t.barAlign==="bottom"&&(C=u-y),r[g](E*(h+p),C,h,y,f),E=O,v=0,A=0}const T=Math.abs(o[_]||0),S=Math.abs(s[_]||0);T>v&&(v=T),S>A&&(A=S)}r.fill(),r.closePath()}renderLineWaveform(e,t,r,i){const o=s=>{const a=e[s]||e[0],l=a.length,{height:u}=r.canvas,c=u/2,d=r.canvas.width/l;r.moveTo(0,c);let h=0,p=0;for(let f=0;f<=l;f++){const m=Math.round(f*d);if(m>h){const E=c+(Math.round(p*c*i)||1)*(s===0?-1:1);r.lineTo(h,E),h=m,p=0}const g=Math.abs(a[f]||0);g>p&&(p=g)}r.lineTo(h,c)};r.beginPath(),o(0),o(1),r.fill(),r.closePath()}renderWaveform(e,t,r){if(r.fillStyle=this.convertColorValues(t.waveColor),t.renderFunction)return void t.renderFunction(e,r);let i=t.barHeight||1;if(t.normalize){const o=Array.from(e[0]).reduce((s,a)=>Math.max(s,Math.abs(a)),0);i=o?1/o:1}t.barWidth||t.barGap||t.barAlign?this.renderBarWaveform(e,t,r,i):this.renderLineWaveform(e,t,r,i)}renderSingleCanvas(e,t,r,i,o,s,a){const l=this.getPixelRatio(),u=document.createElement("canvas");u.width=Math.round(r*l),u.height=Math.round(i*l),u.style.width=`${r}px`,u.style.height=`${i}px`,u.style.left=`${Math.round(o)}px`,s.appendChild(u);const c=u.getContext("2d");if(this.renderWaveform(e,t,c),u.width>0&&u.height>0){const d=u.cloneNode(),h=d.getContext("2d");h.drawImage(u,0,0),h.globalCompositeOperation="source-in",h.fillStyle=this.convertColorValues(t.progressColor),h.fillRect(0,0,u.width,u.height),a.appendChild(d)}}renderMultiCanvas(e,t,r,i,o,s){const a=this.getPixelRatio(),{clientWidth:l}=this.scrollContainer;if(l*a>=r)return void this.renderSingleCanvas(e,t,l,i,0,o,s);const u=r/a;let c=Math.min(Gp.MAX_CANVAS_WIDTH,l,u),d={};if(t.barWidth||t.barGap){const g=t.barWidth||.5,E=g+(t.barGap||g/2);c%E!=0&&(c=Math.floor(c/E)*E)}const h=g=>{if(g<0||g>=p||d[g])return;d[g]=!0;const E=g*c,v=Math.min(u-E,c);if(v<=0)return;const A=e.map(_=>{const O=Math.floor(E/u*_.length),T=Math.floor((E+v)/u*_.length);return _.slice(O,T)});this.renderSingleCanvas(A,t,v,i,E,o,s)},p=Math.ceil(u/c),f=this.scrollContainer.scrollLeft/u,m=Math.floor(f*p);h(m-1),h(m),h(m+1),p>1&&(this.unsubscribeOnScroll=this.on("scroll",()=>{const{scrollLeft:g}=this.scrollContainer,E=Math.floor(g/u*p);Object.keys(d).length>Gp.MAX_NODES&&(o.innerHTML="",s.innerHTML="",d={}),h(E-1),h(E),h(E+1)}))}renderChannel(e,t,r,i){var{overlay:o}=t,s=function(c,d){var h={};for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&d.indexOf(p)<0&&(h[p]=c[p]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function"){var f=0;for(p=Object.getOwnPropertySymbols(c);f<p.length;f++)d.indexOf(p[f])<0&&Object.prototype.propertyIsEnumerable.call(c,p[f])&&(h[p[f]]=c[p[f]])}return h}(t,["overlay"]);const a=document.createElement("div"),l=this.getHeight(s.height,s.splitChannels);a.style.height=`${l}px`,o&&i>0&&(a.style.marginTop=`-${l}px`),this.canvasWrapper.style.minHeight=`${l}px`,this.canvasWrapper.appendChild(a);const u=a.cloneNode();this.progressWrapper.appendChild(u),this.renderMultiCanvas(e,s,r,l,a,u)}render(e){return st(this,void 0,void 0,function*(){var t;this.timeouts.forEach(l=>l()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const r=this.getPixelRatio(),i=this.scrollContainer.clientWidth,o=Math.ceil(e.duration*(this.options.minPxPerSec||0));this.isScrollable=o>i;const s=this.options.fillParent&&!this.isScrollable,a=(s?i:o)*r;if(this.wrapper.style.width=s?"100%":`${o}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 l=0;l<e.numberOfChannels;l++){const u=Object.assign(Object.assign({},this.options),(t=this.options.splitChannels)===null||t===void 0?void 0:t[l]);this.renderChannel([e.getChannelData(l)],u,a,l)}else{const l=[e.getChannelData(0)];e.numberOfChannels>1&&l.push(e.getChannelData(1)),this.renderChannel(l,this.options,a,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){var e;if((e=this.unsubscribeOnScroll)===null||e===void 0||e.call(this),delete this.unsubscribeOnScroll,!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:r}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:i}=this.progressWrapper.getBoundingClientRect();let o=i-r;o*=2,o=o<0?Math.floor(o):Math.ceil(o),o/=2,this.scrollContainer.scrollLeft+=o}}zoom(e){this.options.minPxPerSec=e,this.reRender()}scrollIntoView(e,t=!1){const{scrollLeft:r,scrollWidth:i,clientWidth:o}=this.scrollContainer,s=e*i,a=r,l=r+o,u=o/2;if(this.isDragging)s+30>l?this.scrollContainer.scrollLeft+=30:s-30<a&&(this.scrollContainer.scrollLeft-=30);else{(s<a||s>l)&&(this.scrollContainer.scrollLeft=s-(this.options.autoCenter?u:0));const c=s-r-u;t&&this.options.autoCenter&&c>0&&(this.scrollContainer.scrollLeft+=Math.min(c,10))}{const c=this.scrollContainer.scrollLeft,d=c/i,h=(c+o)/i;this.emit("scroll",d,h,c,c+o)}}renderProgress(e,t){if(isNaN(e))return;const r=100*e;this.canvasWrapper.style.clipPath=`polygon(${r}% 0, 100% 0, 100% 100%, ${r}% 100%)`,this.progressWrapper.style.width=`${r}%`,this.cursor.style.left=`${r}%`,this.cursor.style.transform=`translateX(-${Math.round(r)===100?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(e,t)}exportImage(e,t,r){return st(this,void 0,void 0,function*(){const i=this.canvasWrapper.querySelectorAll("canvas");if(!i.length)throw new Error("No waveform data");if(r==="dataURL"){const o=Array.from(i).map(s=>s.toDataURL(e,t));return Promise.resolve(o)}return Promise.all(Array.from(i).map(o=>new Promise((s,a)=>{o.toBlob(l=>{l?s(l):a(new Error("Could not export image"))},e,t)})))})}};Ec.MAX_CANVAS_WIDTH=8e3,Ec.MAX_NODES=10;let qS=class extends Mo{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}},Dm=class extends Mo{constructor(n=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=n,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return st(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(n){if(this.currentSrc=n,this._duration=void 0,!n)return this.buffer=null,void this.emit("emptied");fetch(n).then(e=>{if(e.status>=400)throw new Error(`Failed to fetch ${n}: ${e.status} (${e.statusText})`);return e.arrayBuffer()}).then(e=>this.currentSrc!==n?null:this.audioContext.decodeAudioData(e)).then(e=>{this.currentSrc===n&&(this.buffer=e,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var n;if(!this.paused)return;this.paused=!1,(n=this.bufferNode)===null||n===void 0||n.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 e=this.playedDuration*this._playbackRate;e>=this.duration&&(e=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,e),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var n;this.paused=!0,(n=this.bufferNode)===null||n===void 0||n.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return st(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(n){var e,t;const r=n-this.currentTime;(e=this.bufferNode)===null||e===void 0||e.stop(this.audioContext.currentTime+r),(t=this.bufferNode)===null||t===void 0||t.addEventListener("ended",()=>{this.bufferNode=null,this.pause()},{once:!0})}setSinkId(n){return st(this,void 0,void 0,function*(){return this.audioContext.setSinkId(n)})}get playbackRate(){return this._playbackRate}set playbackRate(n){this._playbackRate=n,this.bufferNode&&(this.bufferNode.playbackRate.value=n)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(n){const e=!this.paused;e&&this._pause(),this.playedDuration=n/this._playbackRate,e&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var n,e;return(n=this._duration)!==null&&n!==void 0?n:((e=this.buffer)===null||e===void 0?void 0:e.duration)||0}set duration(n){this._duration=n}get volume(){return this.gainNode.gain.value}set volume(n){this.gainNode.gain.value=n,this.emit("volumechange")}get muted(){return this._muted}set muted(n){this._muted!==n&&(this._muted=n,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(n){return/^(audio|video)\//.test(n)}getGainNode(){return this.gainNode}getChannelData(){const n=[];if(!this.buffer)return n;const e=this.buffer.numberOfChannels;for(let t=0;t<e;t++)n.push(this.buffer.getChannelData(t));return n}};const JS={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};let vc=class TT extends KS{static create(e){return new TT(e)}constructor(e){const t=e.media||(e.backend==="WebAudio"?new Dm: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({},JS,e),this.timer=new qS;const r=t?void 0:this.getMediaElement();this.renderer=new Ec(this.options,r),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const i=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:o,duration:s}=this.options;(i||o&&s)&&this.load(i,o,s).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,r,i)=>{const o=this.getDuration();this.emit("scroll",e*o,t*o,r,i)}),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 r;this.renderer.renderProgress(t),clearTimeout(e),this.isPlaying()?r=0:this.options.dragToSeek===!0?r=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(r=this.options.dragToSeek.debounceTime),e=setTimeout(()=>{this.seekTo(t)},r),this.emit("interaction",t*this.getDuration()),this.emit("drag",t)}))}}initPlugins(){var e;!((e=this.options.plugins)===null||e===void 0)&&e.length&&this.options.plugins.forEach(t=>{this.registerPlugin(t)})}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),e.mediaControls!=null&&(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,r,i){return st(this,void 0,void 0,function*(){var o;if(this.emit("load",e),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,!t&&!r){const a=this.options.fetchParams||{};window.AbortController&&!a.signal&&(this.abortController=new AbortController,a.signal=(o=this.abortController)===null||o===void 0?void 0:o.signal);const l=u=>this.emit("loading",u);t=yield XS.fetchBlob(e,l,a)}this.setSrc(e,t);const s=yield new Promise(a=>{const l=i||this.getDuration();l?a(l):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>a(this.getDuration()),{once:!0}))});if(!e&&!t){const a=this.getMediaElement();a instanceof Dm&&(a.duration=s)}if(r)this.decodedData=Im.createBuffer(r,s||0);else if(t){const a=yield t.arrayBuffer();this.decodedData=yield Im.decode(a,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(e,t,r){return st(this,void 0,void 0,function*(){try{return yield this.loadAudio(e,void 0,t,r)}catch(i){throw this.emit("error",i),i}})}loadBlob(e,t,r){return st(this,void 0,void 0,function*(){try{return yield this.loadAudio("",e,t,r)}catch(i){throw this.emit("error",i),i}})}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:r=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const i=Math.min(e,this.decodedData.numberOfChannels),o=[];for(let s=0;s<i;s++){const a=this.decodedData.getChannelData(s),l=[],u=a.length/t;for(let c=0;c<t;c++){const d=a.slice(Math.floor(c*u),Math.ceil((c+1)*u));let h=0;for(let p=0;p<d.length;p++){const f=d[p];Math.abs(f)>Math.abs(h)&&(h=f)}l.push(Math.round(h*r)/r)}o.push(l)}return o}getDuration(){let e=super.getDuration()||0;return e!==0&&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 st(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 st(this,arguments,void 0,function*(e="image/png",t=1,r="dataURL"){return this.renderer.exportImage(e,t,r)})}destroy(){var e;this.emit("destroy"),(e=this.abortController)===null||e===void 0||e.abort(),this.plugins.forEach(t=>t.destroy()),this.subscriptions.forEach(t=>t()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}};vc.BasePlugin=class extends Mo{constructor(n){super(),this.subscriptions=[],this.options=n}onInit(){}_init(n){this.wavesurfer=n,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(n=>n())}},vc.dom=GS;class km extends Error{}function Lm(n,e){if(!n)throw new km(e??"Assertion failed")}const Ie=Object.assign(Lm,{is:function(n,e,t){return Lm(e,t)},unreachable:function(){throw new Error("Unreachable code")},never:function(n){throw new Error("Unreachable")},defined:function(n){if(n==null)throw new km("Value is not defined")}}),[xm,sn]=Cr(),[Mm,Po]=Cr(),[Pm,aL]=Cr(),[Bm,Bo]=Cr(),[ZS,QS]=Cr(),Ac=kt(void 0);function Re(){const n=qe(Ac);return Ie(n!==void 0),n}const _c=kt(void 0);function yi(){const n=qe(_c);return Ie(n!==void 0),n}const[Fm,e1]=Cr(),[t1,n1]=Cr();function Cr(){const n=kt(void 0);return[n,()=>{const e=qe(n);return Ie(e!==void 0),e}]}var Um=Object.prototype.hasOwnProperty;function Je(n){return Array.isArray(n)}function Tt(n){return!(!n||typeof n!="object"||n instanceof Date||Je(n))}function Ee(n){return typeof n=="function"}function Kt(n){const e=typeof n;return n!==void 0&&(yc(n)||e!=="object"&&e!=="function")}function yc(n){return n instanceof Date}function Hm(n){return typeof n=="boolean"}function St(n){return n instanceof Promise}function Pt(n){return n instanceof Map}function Oi(n){if(!n)return!1;if(Je(n))return n.length===0;for(const e in n)if(Um.call(n,e))return!1;return!0}function $m(n){return n==null}var r1=new Set(["boolean","string","number"]);function Da(n){return!!n.parent}var i1=Symbol.toPrimitive,Ti=Symbol("getNode"),Fo=Symbol("delete"),Si=Symbol("opaque"),Oc=Symbol("optimized"),Uo=Symbol("linked"),De={isLoadingLocal:!1,isMerging:!1,isLoadingRemote:!1,activateSyncedNode:void 0,pendingNodes:new Map,dirtyNodes:new Set,replacer:void 0,reviver:void 0};function jm(n){return Je(n)?"array":Pt(n)?"map":n instanceof Set?"set":"object"}function o1(n,e){return Pt(e)?{__LSType:"Map",value:Array.from(e.entries())}:e instanceof Set?{__LSType:"Set",value:Array.from(e)}:(De.replacer&&(e=De.replacer(n,e)),e)}var s1=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/;function a1(n,e){if(e){if(typeof e=="string"&&s1.test(e))return new Date(e);if(typeof e=="object"){if(e.__LSType==="Map")return new Map(e.value);if(e.__LSType==="Set")return new Set(e.value)}De.reviver&&(e=De.reviver(n,e))}return e}function Ym(n){return n&&JSON.stringify(n,o1)}function zm(n){return n&&JSON.parse(n,a1)}function Vm(n){return zm(Ym(n))}function ke(n){return!!n&&!!n[Ti]}function ka(n){return n&&n[Ti]}function An(n,e){var t,r,i;const o=(t=n.parent)!=null?t:n,s=n.parent?n.key:"_",a=e===Fo;a&&(e=void 0);const l=n.parent?Tc(o):o.root,u=l[s],c=Ee(e);if(e=o.isAssigning||!c||Ee(u)?e:e(u),!De.isMerging||$m(u)||Ee(u)||!((i=(r=n.parent)==null?void 0:r.functions)!=null&&i.get(s)))try{o.isSetting=(o.isSetting||0)+1;const d=Pt(l);a?d?l.delete(s):delete l[s]:Pt(l)?l.set(s,e):l[s]=e}finally{o.isSetting--}return{prevValue:u,newValue:e}}var Wm=[];function Me(n){let e=0,t=n;for(;Da(t);)Wm[e++]=t.key,t=t.parent;let r=n.root._;for(let i=e-1;r&&i>=0;i--){const o=Wm[i];r=o!=="size"&&(Pt(r)||r instanceof WeakMap)?r.get(o):r[o]}return r}function an(n,e,t){var r,i;let o=(r=n.children)==null?void 0:r.get(e);return o||(o={root:n.root,parent:n,key:e,lazy:!0,numListenersRecursive:0},((i=n.lazyFn)==null?void 0:i.length)===1&&(t=n.lazyFn.bind(n,e)),Ee(t)&&(o=Object.assign(()=>{},o),o.lazyFn=t),n.children||(n.children=new Map),n.children.set(e,o)),o}function Tc(n){let e=Me(n);return(!e||Ee(e))&&(Da(n)?e=Tc(n.parent)[n.key]={}:e=n.root._={}),e}function Gm(n,e){var t,r;let i=ke(n)?void 0:Tt(n)?"id"in n?"id":"key"in n?"key":"_id"in n?"_id":"__id"in n?"__id":void 0:void 0;if(!i&&e.parent){const o=e.key+"_keyExtractor",s=(r=(t=e.functions)==null?void 0:t.get(o))!=null?r:Me(e.parent)[e.key+"_keyExtractor"];s&&Ee(s)&&(i=s)}return i}function Xm(n,e,t){n.functions||(n.functions=new Map),n.functions.set(e,t)}function Km(n,e){return n===e||yc(n)&&yc(e)&&+n==+e}function Ho(n,e,t){let r=n;return!ke(r)&&Ee(r)&&(r=e?r(e):r()),ke(r)&&!t?r.get():r}function qm(n){return n&&(n[Si]=!0),n}var $o,l1=(n,e)=>n&&n[e];function Jm(n,e,t,r,i,o,s){let a,l=n;if(e.length>0){let u=o;for(let c=0;c<e.length;c++){if(a=e[c],l[a]===Fo)return u&&(l[a]=u[a],s?.(e.slice(0,c+1),l[a])),n;if(l[a]===void 0&&r===void 0&&c===e.length-1)return n;l[a]!==void 0&&l[a]!==null||(l[a]=Zm(t[c])),c<e.length-1&&(l=l[a],u&&(u=u[a]))}}return a===void 0?n=i==="merge"?Sc(n,r):r:i==="merge"?l[a]=Sc(l[a],r):Pt(l)?l.set(a,r):l[a]=r,n}function Sc(n,e,t){var r;ke(e)&&(e=e.peek());const i=ke(n),o=i?n.peek():n,s=Je(o);if(!s&&Tt(o)&&Tt(e)&&!Oi(o)||s&&o.length>0){const a=Object.keys(e);for(let l=0;l<a.length;l++){const u=a[l],c=e[u];if(c===Fo)i&&((r=n[u])!=null&&r.delete)?n[u].delete():delete n[u];else{const d=Tt(c),h=!d&&Je(c),p=n[u];if(!d&&!h||!p||!i&&Oi(p))if(i)p.set(c);else{const f=Tt(c)?{...c}:Je(c)?[...c]:c;n[u]=f}else i||p&&(d?Tt(p):Je(p))?Sc(p,c):n[u]=c}}}else e!==void 0&&(i?n.set(e):n=e);return n}function Zm(n){switch(n){case"array":return[];case"object":return{};case"map":return new Map;case"set":return new Set}}function u1(n,e,t){const{path:r,valueAtPath:i,prevAtPath:o,pathTypes:s}=e;return Jm(n,r,s,o)}var La=0,bc=!1,Nc=!1,jo=new Map;function c1(){jo.size>0&&bi(!0)}function Qm(n,e){for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function d1(n,e){try{return function(t,r){for(let i=0;i<r.length;i++)t=u1(t,r[i]);return t}(n?Vm(n):{},e)}catch{return}}function Cc(n,e){return function(){return d1(n,e)}}function Yo(n,e,t,r,i){const o=new Map;xa(o,n,De.isLoadingLocal,De.isLoadingRemote,e,[],[],e,t,!0,r,i),o.size&&eg(o,!0);const s=jo.get(n);s?s.value=e:jo.set(n,{value:e,prev:t,level:r,whenOptimizedOnlyIf:i,remote:De.isLoadingRemote,loading:De.isLoadingLocal}),La<=0&&tg()}function xa(n,e,t,r,i,o,s,a,l,u,c,d){if(function(h,p,f,m,g,E,v,A,_,O,T,S){if(O?p.listenersImmediate:p.listeners){const b={path:E,pathTypes:v,valueAtPath:A,prevAtPath:_},y=h.get(p);if(y&&E.length>0){const{changes:C}=y;Qm(C[0].path,b.path)||C.push(b)}else h.set(p,{level:T,value:g,remote:m,loading:f,whenOptimizedOnlyIf:S,changes:[b]})}}(n,e,t,r,i,o,s,a,l,u,c,d),e.linkedFromNodes)for(const h of e.linkedFromNodes)xa(n,h1(h,o),t,r,a,[],[],a,l,u,0,d);if(e.parent){const h=e.parent;h&&xa(n,h,t,r,Me(h),[e.key].concat(o),[jm(i)].concat(s),a,l,u,c+1,d)}}function eg(n,e){const t=new Set;n.forEach(({changes:r,level:i,value:o,loading:s,remote:a,whenOptimizedOnlyIf:l},u)=>{const c=e?u.listenersImmediate:u.listeners;if(c){let d;const h=Array.from(c);for(let p=0;p<h.length;p++){const f=h[p],{track:m,noArgs:g,listener:E}=f;t.has(E)||(m===!0?i<=0:m!==Oc||l&&i<=0)&&(g||d||(d={value:o,loading:s,remote:a,getPrevious:Cc(o,r),changes:r}),m||t.add(E),E(d))}}})}function tg(){const n=Array.from(De.dirtyNodes);De.dirtyNodes.clear(),n.forEach(r=>{const i=r.dirtyFn;i&&(r.dirtyFn=void 0,i())});const e=jo;jo=new Map;const t=new Map;e.forEach(({value:r,prev:i,level:o,loading:s,remote:a,whenOptimizedOnlyIf:l},u)=>{xa(t,u,s,a,r,[],[],r,i,!1,o,l)}),t.size&&eg(t,!1)}function zo(n){Ma();try{n()}finally{bi()}}function Ma(){La++,$o||($o=setTimeout(c1,0))}function bi(n){(--La<=0||n)&&(bc?Nc=!0:($o&&(clearTimeout($o),$o=void 0),La=0,bc=!0,tg(),bc=!1,Nc&&(Nc=!1,bi(!0))))}function h1(n,e){let t=n;for(let r=0;r<e.length;r++)t=an(t,e[r]);return t}function Ic(n,e,t,r,i){if(ke(n))return n;const o=St(n);let s={root:{_:n},lazy:!0,numListenersRecursive:0};Ee(n)&&(s=Object.assign(()=>{},s),s.lazyFn=n);var a;const l=(a=n,r1.has(typeof a)?new i(s):r(s));return o&&(An(s,void 0),t(s,n)),l}function nr(n,e,t={},r){var i;const{initial:o,immediate:s,noArgs:a}=t,{trackingType:l}=t;let u=s?n.listenersImmediate:n.listeners;u||(u=new Set,s?n.listenersImmediate=u:n.listeners=u);const c={listener:e,track:l,noArgs:a};if(u.add(c),o){const m=Me(n);e({value:m,loading:!0,remote:!1,changes:[{path:[],pathTypes:[],prevAtPath:m,valueAtPath:m}],getPrevious:()=>{}})}let d;function h(m,g=e,E){if(!r?.has(m)){r||(r=new Set),r.add(E||n),g||(g=e);const v={trackingType:!0,...t};d=[...d||[],nr(m,g,v,r)]}}n.linkedToNode&&h(n.linkedToNode),(i=n.linkedFromNodes)==null||i.forEach(m=>h(m)),n.numListenersRecursive++;let p=n.parent,f=[n.key];for(;p;){if(p.linkedFromNodes)for(const m of p.linkedFromNodes)r?.has(m)||h(m,p1(m,f,e),p);p.numListenersRecursive++,f=[p.key,...f],p=p.parent}return()=>{u.delete(c),d?.forEach(g=>g());let m=n;for(;m;)m.numListenersRecursive--,m=m.parent}}function p1(n,e,t){let{valueAtPath:r}=ng(Me(n),e);return function({value:i,loading:o,remote:s}){const{valueAtPath:a}=ng(i,e);a!==r&&t({value:a,loading:o,remote:s,changes:[{path:[],pathTypes:[],prevAtPath:r,valueAtPath:a}],getPrevious:()=>r}),r=a}}function ng(n,e){let t=n;const r=[];for(let i=0;t&&i<e.length;i++)r.push(Je(t)?"array":"object"),t=t[e[i]];return{valueAtPath:t,pathTypes:r}}var Pa=0,rg=[],Ni={current:void 0};function wc(n,e){if(Pa){const t=Ni.current;if(t){t.nodes||(t.nodes=new Map);const r=t.nodes.get(n);r?(r.track=r.track||e,r.num++):t.nodes.set(n,{node:n,track:e,num:1})}}}function ig(n,e,t,r,i){let o,s=e;rg.push(Ni.current),Pa++,Ni.current={};const a=n&&Ho(n,t,r?.fromComputed),l=Ni.current.nodes;return--Pa<0&&(Pa=0),Ni.current=rg.pop(),t?.cancel||(o=function(u,c,d,h){let p=[];return u?.forEach(f=>{const{node:m,track:g}=f;p.push(nr(m,c,{trackingType:g,immediate:h,noArgs:d}))}),()=>{if(p){for(let f=0;f<p.length;f++)p[f]();p=void 0}}}(l,s,!1,r?.immediate)),{nodes:l,value:a,dispose:o,resubscribe:void 0}}function Vo(n,e,t){let r,i;Ee(e)?r=e:t=e;const o={num:0},s=function(){o.onCleanup&&(o.onCleanup(),o.onCleanup=void 0),Ma(),delete o.value,i?.();const{dispose:a,value:l,nodes:u}=ig(n,s,o,t);i=a,o.value=l,o.nodes=u,o.refresh=s,o.onCleanupReaction&&(o.onCleanupReaction(),o.onCleanupReaction=void 0),bi(),r&&(t?.fromComputed||(o.num>0||!function(c){var d;return c&&((d=c[Ti])==null?void 0:d.isEvent)}(n))&&(o.previous!==o.value||typeof o.value=="object"))&&r(o),o.previous=o.value,o.num++};return s(),()=>{var a,l;(a=o.onCleanup)==null||a.call(o),o.onCleanup=void 0,(l=o.onCleanupReaction)==null||l.call(o),o.onCleanupReaction=void 0,i?.()}}function og(n,e,t){if(St(n))return e?n.then(e):n;let r,i;return Vo(function(o){const s=Ho(n);if(!St(s))return!St(s)&&(t?function(a){return!(!a||(Tt(a)||Je(a))&&Oi(a))}(s):s)&&(r=s,o.cancel=!0),r;r=s},function(){i=e?.(r)}),St(r)?e?r.then(e):r:r!==void 0?e?i:Promise.resolve(r):new Promise(o=>{if(e){const s=e;e=a=>{const l=s(a);o(St(l)?l.then(u=>u):l)}}else e=o})}function sg(n,e){return og(n,e,!1)}function ag(n,e){return og(n,e,!0)}var lg=new Set(["copyWithin","fill","from","pop","push","reverse","shift","sort","splice","unshift"]),ug=new Set(["every","filter","find","findIndex","forEach","join","map","reduce","some"]),f1=new Set(["filter","find"]),Rc=new Map,Ba=new Map([["get",Ua],["set",_n],["peek",Ri],["onChange",nr],["assign",function(n,e){const t=Bt(n);if(Ma(),Kt(n.root._)&&(n.root._={}),Pt(e)){const r=Me(n);Pt(r)&&e.forEach((i,o)=>r.set(o,i))}else{n.isAssigning=(n.isAssigning||0)+1;try{Object.assign(t,e)}finally{n.isAssigning--}}return bi(),t}],["delete",function(n,e){e===void 0&&Da(n)&&(e=n.key,n=n.parent);const t=Me(n);Je(t)?cg(n,t,"splice",e,1):Ci(n,e??"_",Fo,-1)}],["toggle",function(n){const e=Me(n);(e==null||Hm(e))&&_n(n,!e)}]]);function cg(n,e,t,...r){var i;if(t!=="push"||r.length!==1){const o=e.slice(),s=e[t].apply(e,r);if(n){const a=Da(n),l=a?n.key:"_";(a?Me(n.parent):n.root)[l]=o,Ci((i=n.parent)!=null?i:n,l,e)}return s}Ci(n,e.length+"",r[0])}function dg(n,e,t){return e?void 0:n?t?Array.from(n.keys()):Object.keys(n):[]}function Dc(n,e,t){var r,i,o;if(Tt(e)&&e[Si]||Tt(t)&&t[Si]){const A=e!==t;return A&&(n.listeners||n.listenersImmediate)&&Yo(n,e,t,0),A}const s=Je(e);let a,l;const u=Pt(e),c=Pt(t),d=dg(e,s,u),h=dg(t,s,c),p=((r=d||e)==null?void 0:r.length)||0,f=((i=h||t)==null?void 0:i.length)||0;let m,g,E,v=!1;if(s&&Je(t)){if(t.length>0){const A=t[0];if(A!==void 0&&(m=Gm(A,n),m&&(g=Ee(m),a=new Map,l=[]),n.children))for(let _=0;_<t.length;_++){const O=t[_];if(O){const T=n.children.get(_+"");if(T&&(e[_]||hg(T,O),m)){const S=g?m(O):O[m];a.set(S,T)}}}}}else if(t&&(!e||Tt(e))){const A=h.length;for(let _=0;_<A;_++){const O=h[_];if(!d.includes(O)){v=!0;const T=an(n,O),S=c?t.get(O):t[O];S!==void 0&&hg(T,S)}}}if(e&&!Kt(e)){v=v||p!==f;const A=v;let _=!1;for(let O=0;O<p;O++){const T=s?O+"":d[O];let S=u?e.get(T):e[T];const b=c?t?.get(T):t?.[T];let y=!Km(S,b);if(y){const C=m&&S?g?m(S):S[m]:void 0,w=(o=n.children)==null?void 0:o.get(T);if(ke(S)){const F=ka(S);if(w?.linkedToNode===F){const j=Me(F);u?e.set(T,j):e[T]=j;continue}const L=S;S=()=>L}let I=an(n,T,S);if(I.lazy||!Ee(S)&&!ke(S)||(m1(I,S),Ir(I)),s&&C!==void 0){const F=C!==void 0?a?.get(C):void 0;if(F){if(F!==void 0&&F.key!==T){const L=t[F.key];A&&(I=F,n.children.delete(I.key),I.key=T,l.push([T,I])),_=!0,y=L!==S}}else v=!0}if(y)if(Ee(S)||ke(S))wi(n,T,S);else if(Kt(S))v=!0;else{const F=Dc(I,S,b);v=v||F,y=F}(y||s&&!A)&&(I.listeners||I.listenersImmediate)&&Yo(I,S,b,0,!A)}}if(l)for(let O=0;O<l.length;O++){const[T,S]=l[O];n.children.set(T,S)}E=v||_}else t!==void 0&&(E=!0);return E!=null&&E}function hg(n,e){var t,r;(t=n.linkedToNodeDispose)==null||t.call(n),(r=n.activatedObserveDispose)==null||r.call(n),Kt(e)||Dc(n,void 0,e),(n.listeners||n.listenersImmediate)&&Yo(n,void 0,e,0)}function Bt(n,e,t){return e!==void 0&&(n=an(n,e,t)),n.proxy||(n.proxy=new Proxy(n,pg))}function kc(){if(De.pendingNodes.size>0){const n=Array.from(De.pendingNodes.values());De.pendingNodes.clear(),n.forEach(e=>e())}}var pg={get(n,e,t){var r,i;if(e===i1)throw new Error("[legend-state] observable is not a primitive.");if(e===Ti)return n;if(e==="apply"){const d=Me(n);if(Ee(d))return d.apply}let o=Ir(n,e==="get"||e==="peek");const s=n.linkedToNode||o?.[Ti];if(s&&e!=="onChange")return pg.get(s,e,t);if(Pt(o)||o instanceof WeakMap||o instanceof Set||o instanceof WeakSet){const d=function(h,p,f){const m=f?.[p];if(p==="size")return Bt(h,p);if(Ee(m))return function(g,E,v){const A=arguments.length,_=f;if(p==="get"){if(A>0&&typeof g!="boolean"&&g!==Oc)return Bt(h,g)}else if(p==="set"){if(A===2){const T=_.get(g),S=_.set(g,E);return T!==E&&Fa(an(h,g),E,T),S}A===1&&Pt(f)&&_n(h,g)}else if(p==="delete"){if(A>0){const T=f.get?_.get(g):g,S=f.delete(g);return S&&Fa(an(h,g),void 0,T),S}}else{if(p==="clear"){const T=new Map(_),S=_.size;return _.clear(),void(S&&Fa(h,f,T))}if(p==="add"){const T=new Set(f),S=f.add(g);return f.has(p)||Yo(h,S,T,0),S}}const O=Ba.get(p);if(!O)return f[p](g,E);switch(A){case 0:return O(h);case 1:return O(h,g);case 2:return O(h,g,E);default:return O(h,g,E,v)}}}(n,e,o);if(d!==void 0)return d}const a=Ba.get(e);if(a)return e!=="get"&&e!=="peek"||kc(),function(d,h,p){switch(arguments.length){case 0:return a(n);case 1:return a(n,d);case 2:return a(n,d,h);default:return a(n,d,h,p)}};const l=Rc.get(e);if(l)return l.get(n);let u=o?.[e];if(Tt(o)&&o[Si])return u;const c=(r=n.functions)==null?void 0:r.get(e);if(c)return ke(c)?c:Bt(n,e,c);if(u=function(d,h){if(d){const p=Object.getOwnPropertyDescriptor(d,h);return p?.get&&(delete d[h],d[h]=p.set?function(f){Ee(f)&&(f={get:f});const m=function(){return{[Uo]:f}};return m.prototype[Uo]=f,m}({get:p.get,set:({value:f})=>p.set(f)}):p.get),d[h]}}(o,e),$m(o)&&u===void 0&&(lg.has(e)||ug.has(e))&&(o=[],An(n,o),u=o[e]),Ee(u)){if(Je(o)){if(lg.has(e))return(...h)=>cg(n,o,e,...h);if(ug.has(e))return wc(n,!0),function(h,p){const f=e==="reduce",m=f?(v,A,_,O)=>h(v,Bt(n,_+"",A),_,O):(v,A,_)=>h(Bt(n,A+"",v),A,_);if(f||!f1.has(e))return o[e](m,p);const g=e==="find",E=[];for(let v=0;v<o.length;v++)if(m(o[v],v,o)){const A=Bt(n,v+"");if(g)return A;E.push(A)}return g?void 0:E}}wi(n,e,u);const d=(i=n.functions)==null?void 0:i.get(e);return d?Bt(n,e,d):u.bind(o)}return Kt(u)&&Je(o)&&e==="length"?(wc(n,!0),u):Bt(n,e)},getPrototypeOf(n){const e=Me(n);return e!==null&&typeof e=="object"?Reflect.getPrototypeOf(e):null},ownKeys(n){Ir(n);const e=Ua(n,!0);if(Kt(e))return[];const t=e?Reflect.ownKeys(e):[];if(Je(e)&&t[t.length-1]==="length"&&t.splice(t.length-1,1),Ee(n)){const r=Reflect.ownKeys(n);["caller","arguments","prototype"].forEach(i=>r.includes(i)&&t.push(i))}return t},getOwnPropertyDescriptor(n,e){if(e==="caller"||e==="arguments"||e==="prototype")return{configurable:!1,enumerable:!1};const t=Me(n);return Kt(t)?void 0:Reflect.getOwnPropertyDescriptor(t,e)},set(n,e,t){if(n.isSetting)return Reflect.set(n,e,t);if(n.isAssigning)return Ci(n,e,t),!0;const r=Rc.get(e);return!!r&&(r.set(n,t),!0)},deleteProperty:(n,e)=>!!n.isSetting&&Reflect.deleteProperty(n,e),has(n,e){const t=Me(n);return Reflect.has(t,e)},apply:(n,e,t)=>(ke(e)&&(e=e.peek()),Reflect.apply(n.lazyFn||n,e,t))};function _n(n,e){n.parent?Ci(n.parent,n.key,e):Ci(n,"_",e)}function Ci(n,e,t,r){const i=!n.parent&&e==="_";!n.parent||Me(n)||Ee(t)||_n(n,{[e]:t});const o=i?n:an(n,e,t);if(ke(t))Lc(o,t);else{const{newValue:s,prevValue:a}=An(o,t),l=Kt(s)||s instanceof Date;Km(s,a)||Fa(n,s,a,o,l,i,r),l||(o.needsExtract=!0),wi(n,e,s)}}function Fa(n,e,t,r,i,o,s){r||(r=n),Ma(),i===void 0&&(i=Kt(e));let a=i,l=!1;(!i||t&&!Kt(t))&&(a=Dc(r,e,t),Je(e)&&(l=e?.length!==t?.length)),(i||!e||Oi(e)&&!Oi(t)?e!==t:a)&&Yo(i&&o?n:r,e,t,s??t===void 0?-1:a?0:1,l),bi()}function Ii(n,e,t){n.state||(n.state=Ic({isLoaded:!1},0,Ii,Bt)),e.then(r=>{t?t({value:r}):_n(n,r),n.state.assign({isLoaded:!0,error:void 0})}).catch(r=>{n.state.error.set(r)})}function wi(n,e,t){if(St(t)){const r=an(n,e);return Ii(r,t),void An(r,void 0)}if(ke(t)){const r=()=>t;Xm(n,e,r);const i=an(n,e,r);return An(i,Ri(ka(t))),Me(i)}if(typeof t=="function")return Xm(n,e,t),e}function Ua(n,e){return wc(n,e?Tt(e)?e.shallow:e:void 0),Ri(n)}function Ri(n){return Ir(n,!0)}var Ha=!1;function Ir(n,e){var t;if(Ha=!0,e&&((t=n.dirtyChildren)==null?void 0:t.size)){const i=Array.from(n.dirtyChildren);n.dirtyChildren.clear(),i.forEach(o=>o.dirtyFn&&Ir(o))}if(n.dirtyFn){const i=n.dirtyFn;n.dirtyFn=void 0,De.dirtyNodes.delete(n),i()}Ha=!1;let r=Me(n);return r=function(i,o,s){const a=o,l=i.lazy;if(l){const u=i.lazyFn;if(delete i.lazy,Ee(u))if(u.length===1)o={};else{if(i.parent){const c=Me(i.parent);c?delete c[i.key]:i.root._=void 0}o=function(c,d){let h,p,f,m=!0;const g=d;let E,v,A=[];function _(){c.dirtyFn=v,De.dirtyNodes.add(c)}return c.activatedObserveDispose=Vo(()=>{var O,T,S,b;if(m)m=!1,An(c,void 0);else if(!Ha&&v&&function(I,F){if(!Ha&&!function(j){var D,B;let H=j,x=j.numListenersRecursive>0;for(;H&&!x;)((D=H.listeners)!=null&&D.size||(B=H.listenersImmediate)!=null&&B.size)&&(x=!0),H=H.parent;return x}(I)){F&&(I.dirtyFn=F);let j=I;for(;j;)j.dirtyChildren||(j.dirtyChildren=new Set),j.dirtyChildren.add(I),j=j.parent;return!0}}(c,v))return void(f=!0);let y=g(),C=!1;ke(y)&&(C=!0,y=Lc(c,y)),Ee(y)&&(y=y());const w=ke(y)||y==null?void 0:y[Uo];if(w&&(c.activationState=w,y=void 0),f=!1,p=St(y),c.activated){if(c.activationState){const I=c.activationState;(T=(O=c.state)==null?void 0:O.peek())!=null&&T.sync?(c.state.sync(),f=!0):y=(b=(S=I.get)==null?void 0:S.call(I))!=null?b:I.initial}}else{c.activated=!0;let I=g1;w?.synced&&(I=De.activateSyncedNode,f=!0);const F=I(c,y);h=F.update;let L=F.value;!C&&ke(L)&&(L=Lc(c,L)),y=L??w?.initial}return p=p||St(y),y},O=>{const{value:T,nodes:S,refresh:b}=O;if(v=b,!f){if(!p||!De.isLoadingRemote)if(p)if(c.activationState){const{initial:y}=c.activationState;T&&St(T)&&Ii(c,T,h),Ee(Me(c))&&An(c,y??void 0)}else c.activated&&(Ii(c,T,h),Ee(Me(c))&&An(c,void 0));else E=T,c.state.isLoaded.peek()?(c.isComputing=!0,_n(c,T),c.isComputing=!1):(An(c,T),c.state.assign({isLoaded:!0,error:void 0}));A.forEach(y=>y()),A=[],S?.forEach(({node:y,track:C})=>{A.push(nr(y,_,{immediate:!0,trackingType:C}))})}O.cancel=!0},{fromComputed:!0}),E}(i,u)}else ke(o)&&(o=wi(i.parent,i.key,o))}return!l&&!i.needsExtract||ke(o)||Kt(o)||(s&&function(u,c){if((Tt(u)||Je(u))&&!u[Si]){const d=[];fg(u,d,()=>{var p;let f=c;for(let m=0;m<d.length;m++){const{key:g}=d[m],E=(p=Me(f))==null?void 0:p[g];f=an(f,g,Ee(E)?E:void 0),Ir(f)}return f})}}(o,i),i.parent&&wi(i.parent,i.key,a)),o}(n,r,!!e),r}function m1(n,e){var t,r;(t=n.activatedObserveDispose)==null||t.call(n),(r=n.linkedToNodeDispose)==null||r.call(n),n.activatedObserveDispose=n.linkedToNodeDispose=n.linkedToNode=void 0,n.lazyFn=e,n.lazy=!0}function g1(n,e){if(n.state||(n.state=Ic({isLoaded:!1},0,Ii,Bt)),n.activationState){const{set:t,get:r,initial:i}=n.activationState;if((e=r?.())!=null&&e!==null||(e=i),t){let o,s=[],a=0;const l=u=>{if(s.length>0){let c,d,h,p=!1,f=!1;u?(c=u.changes,d=u.value,p=u.loading,f=u.remote,h=u.getPrevious):(c=s,d=o,h=Cc(d,c)),s=[],o=void 0,De.pendingNodes.delete(n),a++;const m=a,g=()=>{m===a&&(n.isComputing=!0,t({value:d,changes:c,loading:p,remote:f,getPrevious:h}),n.isComputing=!1)};ag(n.state.isLoaded,g)}};nr(n,({value:u,changes:c})=>{n.isComputing||(c.length>1||!Ee(c[0].prevAtPath))&&(o=u,s.length>0&&(c=c.filter(d=>!Qm(s[0].path,d.path))),s.push(...c),De.pendingNodes.set(n,l))},{immediate:!0}),nr(n,l)}}return{update:({value:t})=>{n.isComputing||(n.isComputing=!0,_n(n,t),n.isComputing=!1)},value:e}}function Lc(n,e){var t;const r=ka(e);return r!==n&&r?.linkedToNode!==n&&(n.linkedToNode=r,r.linkedFromNodes||(r.linkedFromNodes=new Set),r.linkedFromNodes.add(n),(t=n.linkedToNodeDispose)==null||t.call(n),n.linkedToNodeDispose=nr(r,()=>{e=Ir(r),_n(n,e)},{initial:!0},new Set([n]))),e}function fg(n,e,t){var r;if((Tt(n)||Je(n))&&!n[Si]){for(const i in n)if(Um.call(n,i)){const o=n[i];if(ke(o)){const s=t();wi(s,i,o),delete s.lazy}else{const s=Ee(o)&&((r=o.prototype)==null?void 0:r[Uo]);if(s){const a=s.activate;(!a||a==="auto")&&Ri(an(t(),i,o))}}typeof o=="object"&&(e.push({key:i,value:o}),fg(o,e,t),e.pop())}}}var mg=["get","set","peek","onChange","toggle"];function wr(n){this._node=n;for(let e=0;e<mg.length;e++){const t=mg[e];this[t]=this[t].bind(this)}}function $a(n,e){wr.prototype[n]=function(...t){return e.call(this,this._node,...t)}}function Ue(n){return Ic(n,0,Ii,Bt,wr)}function E1(n,e,t){const r=function(i,o){const{backoff:s,delay:a=1e3,infinite:l,times:u=3,maxDelay:c=3e4}=i;return l||o<u?Math.min(a*(s==="constant"?1:2**o),c):null}(n,e);if(r)return setTimeout(t,r)}$a("peek",n=>(kc(),Ri(n))),$a("get",(n,e)=>(kc(),Ua(n,e))),$a("set",_n),$a("onChange",nr),Object.defineProperty(wr.prototype,Ti,{configurable:!0,get(){return this._node}}),wr.prototype.toggle=function(){const n=this.peek();(n==null||Hm(n))&&this.set(!n)},wr.prototype.delete=function(){return this.set(void 0),this};var gg={createPreviousHandler:Cc,clone:Vm,ensureNodeValue:Tc,findIDKey:Gm,get:Ua,getNode:ka,getNodeValue:Me,getPathType:jm,getProxy:Bt,getValueAtPath:function(n,e){return e.reduce(l1,n)},globalState:De,initializePathType:Zm,observableFns:Ba,optimized:Oc,peek:Ri,runWithRetry:function(n,e,t){const{waitFor:r}=n.activationState,{retry:i}=e,o={cancel:!1};let s;if(s=r?ag(r,()=>(n.activationState.waitFor=void 0,t(o))):t(o),St(s)&&i){let a;return new Promise(l=>{const u=()=>{s.then(c=>{n.activationState.persistedRetry=!1,l(c)}).catch(()=>{e.attemptNum++,a&&clearTimeout(a),o.cancel||(a=E1(i,e.attemptNum,()=>{s=t(o),u()}))}).finally(()=>{n.activationState.persistedRetry=!1})};u()})}return s},safeParse:zm,safeStringify:Ym,set:_n,setAtPath:Jm,setNodeValue:An,symbolLinked:Uo,symbolDelete:Fo,tracking:Ni},Eg={exports:{}},vg={},Di=XT(Ju),v1=typeof Object.is=="function"?Object.is:function(n,e){return n===e&&(n!==0||1/n==1/e)||n!=n&&e!=e},A1=Di.useState,_1=Di.useEffect,y1=Di.useLayoutEffect,O1=Di.useDebugValue;function xc(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!v1(n,t)}catch{return!0}}var T1=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(n,e){return e()}:function(n,e){var t=e(),r=A1({inst:{value:t,getSnapshot:e}}),i=r[0].inst,o=r[1];return y1(function(){i.value=t,i.getSnapshot=e,xc(i)&&o({inst:i})},[n,t,e]),_1(function(){return xc(i)&&o({inst:i}),n(function(){xc(i)&&o({inst:i})})},[n]),O1(t),t};vg.useSyncExternalStore=Di.useSyncExternalStore!==void 0?Di.useSyncExternalStore:T1,Eg.exports=vg;var S1=Eg.exports,Mc={inObserver:!1},Ag=void 0;function ye(n,e){if(Mc.inObserver&&ke(n)&&!e?.suspense)return Ho(n);let t;try{const r=qe(Ag||(Ag=kt(null))),i=ce(()=>function(l,u){let c,d,h,p,f,m=0;const g=()=>{d?.();const{value:v,dispose:A,resubscribe:_}=ig(h,E,void 0,void 0);return d=A,v},E=({value:v})=>{if(u?.peek()){const A=f;f=v,A===void 0&&sg(()=>!u.get(),()=>{const _=f;f=void 0,E({value:_})})}else{let A=l?.skipCheck;if(!A){const _=g();(_!==p||!Kt(_)&&_===v)&&(A=!0)}A&&(m++,c?.())}};return{subscribe:v=>(c=v,()=>{d?.(),d=void 0}),getVersion:()=>m,run:v=>(h=v,p=g())}}(e,r),[]),{subscribe:o,getVersion:s,run:a}=i;t=a(n),S1.useSyncExternalStore(o,s,s)}catch(r){throw r}if(e?.suspense){const r=St(t);if(St(t)||!t&&ke(n)){const i=r?t:sg(n);if(!Ce.use)throw i;Ce.use(i)}}return t}var _g=typeof Symbol=="function"&&Symbol.for;function yg(n,e,t,r){const i=_g?Symbol.for("react.forward_ref"):ee(h=>null).$$typeof,o=_g?Symbol.for("react.memo"):mi(h=>null).$$typeof;if(n.__legend_proxied)return n;let s=!1,a=!1,l=n;o&&l.$$typeof===o&&l.type&&(a=!0,l=l.type),i&&l.$$typeof===i&&(s=!0,l=l.render);const u={apply(h,p,f){if(t){const m=f[0],g={},E=Object.keys(m);for(let v=0;v<E.length;v++){const A=E[v],_=m[A];if(A==="children"&&(Ee(_)||ke(_)))m[A]=ye(_,{skipCheck:!0});else if(A.startsWith("$")||A.endsWith("$")){const O=A.endsWith("$")?A.slice(0,-1):A.slice(1),T=r?.[O],S=T&&ke(_);if(g[O]=S&&T?.selector?T.selector(g,_):ye(_),S&&(T.defaultValue!==void 0&&g[O]===void 0&&(g[O]=T.defaultValue),T.handler&&T.getValue)){const b=y=>{var C;_.set(T.getValue(y)),(C=m[T.handler])==null||C.call(m,y)};g[T.handler]=ie(b,[m[T.handler],r])}delete g[A]}else g[A]===void 0&&(g[A]=_)}f[0]=g}return e?ye(()=>{Mc.inObserver=!0;try{return Reflect.apply(h,p,f)}finally{Mc.inObserver=!1}},{skipCheck:!0}):Reflect.apply(h,p,f)}},c=new Proxy(l,u);let d;return s?(d=ee(c),d.__legend_proxied=!0):d=c,e||a?mi(d):d}var{findIDKey:b1,getNode:N1,optimized:C1}=gg,Og=new Map;function Pc({each:n,optimized:e,item:t,itemProps:r,sortValues:i,children:o}){var s;if(!n)return null;const a=ye(()=>n.get(!e||C1));if(!t&&o){const u=W();u.current=o,t=ce(()=>{return c=({item$:d,id:h})=>u.current(d,h),yg(c,!0);var c},[])}else if(t.$$typeof!==Symbol.for("react.memo")){let u=Og.get(t);u||(u=mi(t),Og.set(t,u)),t=u}if(!a)return null;const l=[];if(Je(a)){const u=a[0],c=N1(n),d=a.length,h=d>0?c&&b1(u,c)||(u.id!==void 0?"id":u.key!==void 0?"key":void 0):void 0,p=Ee(h);for(let f=0;f<d;f++)if(a[f]){const m=a[f],g=(s=p?h(m):m[h])!=null?s:f,E=n[f],v={key:g,id:g,item$:E,item:E};l.push(ae(t,r?Object.assign(v,r):v))}}else{const u=Pt(a),c=u?Array.from(a.keys()):Object.keys(a);i&&c.sort((d,h)=>i(u?a.get(d):a[d],u?a.get(h):a[h],d,h));for(let d=0;d<c.length;d++){const h=c[d];if(u?a.get(h):a[h]){const p=u?n.get(h):n[h],f={key:h,id:h,item$:p,item:p};l.push(ae(t,r?Object.assign(f,r):f))}}}return l}mi(function({children:n}){return ye(()=>Ho(Ho(n)),{skipCheck:!0})},()=>!0);var I1=new Map,w1=new Map;function rr(n,e){var t;const r=W({});if(r.current.value=n,!((t=r.current)!=null&&t.obs$)){const i=n;r.current.obs$=Ue(i)}return r.current.obs$}new Proxy({},{get(n,e){if(!n[e]){const i=I1.get(e)||e,o=ee((s,a)=>{const l={...s};return!a||!Ee(a)&&Oi(a)||(l.ref=a),ae(i,l)});n[e]=(t=o,r=w1.get(e),yg(t,!1,!0,r))}var t,r;return n[e]}});var R1=function(n){return((e,t)=>{V(e,t)})(()=>{const e=n();if(!St(e))return e},[])};function ki(n,e,t){let r;Ee(e)?r=e:t=e;const i=W({selector:n});i.current={selector:n,reaction:r},R1(()=>Vo(o=>{const{selector:s}=i.current;return Ee(s)?s(o):s},o=>{var s,a;return(a=(s=i.current).reaction)==null?void 0:a.call(s,o)},t))}const D1=Symbol("no_render");function Ft(n){const e=rr(!1),t=W({_value:typeof n=="function"?n():n.peek(),get value(){return e.set(!0),t.current._value},set value(r){t.current._value=r}});return ye(()=>{if(!e.get())return D1;const r=typeof n=="function"?n():n.get();return t.current.value=r,r}),t.current}function Li(){const n=Bo(),e=Re(),t=yi(),r=sn(),i=Ft(e.app$.appMetadata),o=Ft(e.currentUser$),s=Ft(e.state$.currentConversation),a=Ft(e.t$),l=Ft(e.device$),u=Ft(e.themeCustom$),c=Ft(()=>e.state$.typing.child(e.state$.extCurrentConversationId.get()).get()),d=Ft(()=>e.state$.participants.child(e.state$.extCurrentConversationId.get()).get());return ce(()=>({session:n,store:e,chatbox:t,theme:r,get app(){return i.value},get currentUser(){return o.value},get conversation(){return s.value},get t(){return a.value},get device(){return l.value},get themeCustom(){return u.value.value},get typing(){return c.value},get participants(){return d.value}}),[i,t,s,o,l,e,a,r,u,c,d,n])}function Tg(){const n=Bo(),e=Re(),t=sn(),r=yi(),i=Ft(e.app$.appMetadata),o=Ft(e.currentUser$),s=Ft(e.t$),a=Ft(e.device$),l=Ft(e.themeCustom$);return ce(()=>({session:n,store:e,theme:t,conversationList:r,get app(){return i.value},get currentUser(){return o.value},get t(){return s.value},get device(){return a.value},get themeCustom(){return l.value.value}}),[i,r,o,a,n,e,s,t,l])}class ja{constructor(e={}){this._handlers=new Set,this._meta=e}meta(e){return new ja(e)}_emit(e,t){for(const r of this._handlers)r({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 Bc=new ja,Un=new ja,P={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:n=>`${n} 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:(n,e)=>`Replying to ${n}: ${e}`,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"}},k1={code:"ar",name:"Arabic",translation:{YESTERDAY:"الأمس",TODAY:"اليوم",DAYS:"يوم",HOURS:"ساعة",MINUTES:"دقيقة",JUST_NOW:"فقط الآن",LOCATION:"الموقع",CANCEL:"إلغاء",INBOX:"علبة الوارد",DESKTOP_NOTIFICATIONS:"إشعارات المتصفح",DESKTOP_NOTIFICATIONS_ERROR:"لا يمكن تمكين إشعارات المتصفح لأن متصفحك يمنعها بشكل نشط. جرّب البحث في الإعدادات أو استخدام متصفح آخر.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`إعلام ${n} التجريبي`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},L1={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:n=>`${n} демо известие`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},x1={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},M1={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:n=>`Notificació de demostració de ${n}`,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:(n,e)=>`Responent a ${n}: ${e}`,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"}},P1={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},B1={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},F1={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},U1={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:n=>`${n} Δοκιμαστική επίδειξη`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},H1={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},$1={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},j1={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:n=>`نوتیفیکیشن دمو ${n}`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},Y1={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},z1={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:n=>`Notification de démonstration ${n}`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},V1={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:n=>`${n} הודעה על הדגמה`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},W1={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:n=>`${n} डेमो अधिसूचना`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},G1={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},X1={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},K1={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:n=>`pemberitahuan demo ${n}`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},q1={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:n=>`${n} 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:(n,e)=>`Svara ${n}: ${e}`,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"}},J1={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},Z1={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:n=>`${n} デモ通知`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},Q1={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:n=>`${n} შეტყობინებების დემო ვერსია`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},eb={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:n=>`${n} 데모 알림`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},tb={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},nb={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},rb={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},ib={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},ob={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:n=>`Notificare de debit ${n}`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},sb={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:n=>`${n} демо-оповещение`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},ab={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},lb={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:n=>`${n} 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:(n,e)=>`Odgovarate korisniku ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Izađi iz moda pisanja odgovora",STATUS_INDICATOR_ONLINE:"Aktivan",STATUS_INDICATOR_OFFLINE:"Neaktivan"}},ub={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},cb={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},db={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:n=>`Демо-повідомлення про ${n}`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},hb={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:n=>`${n} 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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},pb={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:n=>`${n} 演示提醒`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},fb={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:n=>`${n} 演示通知`,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:P.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:P.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:P.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:P.translation.STATUS_INDICATOR_OFFLINE}},Sg={ar:k1,bg:L1,bs:x1,ca:M1,cs:P1,da:B1,de:F1,el:U1,en:P,es:H1,et:$1,fa:j1,fi:Y1,fr:z1,he:V1,hi:W1,hr:G1,hu:X1,id:K1,is:q1,it:J1,ja:Z1,ka:Q1,ko:eb,nb:tb,nl:nb,pl:rb,pt:ib,ro:ob,ru:sb,sq:ab,sr:lb,sv:ub,tr:cb,uk:db,vi:hb,zh:pb,zhTw:fb};function bg(n){const e=n.replace(/_/g,"-").toLowerCase(),t=Sg[e];if(t)return{...t.translation,locale:e};const r=e.slice(0,2),i=Sg[r];return i?{...i.translation,locale:r}:(Un.warn(`User locale '${n}' not supported; falling back to English.`),{...P.translation,locale:"en-US"})}const Ng=()=>{const n=document.createElement("canvas");n.width=n.height=1;const e=n.getContext("2d");return e.textBaseline="top",e.font='100px "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Twemoji Mozilla","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',e.scale(.01,.01),e},Cg=(n,e)=>{const t=Ng();return t.fillStyle=e,t.fillText(n,0,0),t.getImageData(0,0,1,1).data};function mb(n){const e=Cg(n,"#000"),t=Cg(n,"#fff"),r=(i=>!i.includes("‍")||Ng().measureText(i).width<160)(n);return e&&t&&r&&((i,o)=>{const s=[...i].join(",");return s===[...o].join(",")&&!s.startsWith("0,0,0,")})(e,t)}function Ig(n){try{return mb(n)}catch{return!0}}const wg=function(){if(typeof window>"u"||window.E2E)return 16;const n={"🫩":16,"🚶‍➡️":15.1,"🫨":15,"🫠":14,"😵‍💫":13.1,"🥲":13,"🧑‍🦰":12.1,"🥻":12,"🥰":11,"🤩":5,"👱‍♀️":4,"🤣":3,"👁️‍🗨️":2,"😀":1,"😐️":.7,"😃":.6};for(const[e,t]of Object.entries(n))if(Ig(e))return t}();class Rg{constructor(){this.currentUser$=Ue(null),this.app$=Ue(null),this.appId$=Ue(null),this.extUserId$=Ue(null),this.authTokenState$=Ue("idle"),this.themeCustom$=Ue(qm({value:void 0})),this.device$=Ue({supportsEmojiPicker:!!wg,isMobile:typeof window<"u"&&/Mobi/i.test(window.navigator.userAgent)}),this.errors$=Ue({unknownConversation:!1,unknownUser:!1,wrongAppId:!1,serverError:!1}),this.t$=Ue(()=>{const e=this.extUserId$.get(),t=this.app$.appMetadata.defaultLocale.get(),r=this.currentUser$.locale.get();return bg((e&&r)??t??"en-US")})}resetState(e,t){zo(()=>{this.extUserId$.set(t),this.appId$.set(e),this.currentUser$.set(null)})}updateThemeCustom(e){this.themeCustom$.set(qm({value:e}))}listenForErrors(e,t){this.errors$.assign({unknownConversation:!1,unknownUser:!1,wrongAppId:!1,serverError:!1});const r=e.onError(s=>{Un.error(s.message),this.errors$.serverError.set(!0)}),i=e.currentUser.subscribe(s=>{this.errors$.unknownUser.set(s===null)}),o=t&&e.conversation(t).subscribe(s=>{this.errors$.unknownConversation.set(s===null)});return()=>{r.unsubscribe(),i.unsubscribe(),o?.unsubscribe()}}listenForAuthChanges(e,t){let r=!0;this.authTokenState$.peek()!=="loading"&&this.authTokenState$.set("loading"),e._authProvider.getToken().then(()=>{r&&this.authTokenState$.set("valid")});const i=e._authProvider.onTokenRefreshFailed(()=>{r&&this.authTokenState$.set(t?"invalid":"expired")});return()=>{r=!1,i()}}listenForUserAndAppChanges(e,t){let r=!0,i=null;const o=e.currentUser.subscribe(async s=>{if(r&&s&&(this.currentUser$.set(s),s.role!==i)){i=s.role;const a=await t.getApp(s.role);if(!r)return;this.app$.set(a)}});return()=>{r=!1,o.unsubscribe()}}}const gb={canReplyToMessage:!1,canEditMessage:!1,canDeleteMessage:!1,canAddReaction:!1};class Dg extends Rg{constructor(){super(),this.messageSubscription=null,this.readyForNewMessagesPromise=Promise.resolve(),this.participantSubscription=null,this.onlineSubscriptions={},this.state$=Ue({extCurrentConversationId:null,editor:{isEmpty:!0,isTyping:!1,atTextLimit:!1,characterCount:0,showEmojiPicker:!1,suggestEmojiQuery:void 0,suggestMentionQuery:void 0},referencedMessageId:null,editingMessageId:null,currentConversation:null,visibility:{isInView:!1,tabFocused:!0},messages:{},participants:{},typing:{},isUserConnected:{},ephemeralMessages:{},ephemeralMessageIdMapping:{},localFileBlobUrls:{},userPermissions:()=>{const e=this.app$.role.general.get(),t=this.app$.role.permissions.get();return Ie.defined(e),Ie.defined(t),{showTypingIndicator:e.showTypingIndicators,canShareFile:e.enableFileTransfers,canShareLocation:e.enableLocation,canMention:e.enableMentions,showOnlineStatus:e.enablePresence!==!1,canSendVoiceMessage:e.enableVoiceRecording,canLeaveConversation:t.conversations.leave==="all",canMarkConversationAsUnread:t.conversations.markAsUnread==="all"}},messagePermissions:()=>{const e=this.app$.role.permissions.get();Ie.defined(e);const t=this.state$.userPermissions.get(),r={...gb,...t},i={canReplyToMessage:ir(e.messages.reply,!0),canEditMessage:ir(e.messages.edit,!0),canDeleteMessage:ir(e.messages.delete,!0),canAddReaction:ir(e.messages.emojiReactions,!0),...t},o={...i,canEditMessage:!1},s={canReplyToMessage:ir(e.messages.reply,!1),canEditMessage:ir(e.messages.edit,!1),canDeleteMessage:ir(e.messages.delete,!1),canAddReaction:ir(e.messages.emojiReactions,!1),...t};return{system:r,own:i,ownWithoutEditing:o,other:s,otherWithoutEditing:{...s,canEditMessage:!1}}}}),this.locale$=Ue(()=>{const e=this.extUserId$.get(),t=this.app$.appMetadata.defaultLocale.get(),r=this.currentUser$.locale.get();return(e&&r)??t??"en-US"}),this.t$=Ue(()=>bg(this.locale$.get())),this.referencedMessage$=Ue(()=>{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$=Ue(()=>{const e=this.state$.extCurrentConversationId.get();if(!e)return[];const t=this.state$.currentConversation.readUntil.get(),r=this.state$.messages.child(e).state.get()??[],i=Object.values(this.state$.ephemeralMessages.child(e).get()??{}),o=i.length===0?r:i.concat(r).sort((d,h)=>h.createdAt-d.createdAt),s=o.map(d=>{const h=d.content[0],p=h?.type;if(!h||p!=="file")return d;const f=h.size+","+h.filename,m=this.state$.localFileBlobUrls.child(e).child(f).url.get();return m?{...d,content:[{...h,url:m}]}:d});let a=null,l=0,u=!1;const c=[];for(const d of s){const h=new Date(d.createdAt),p=new Date(h).setHours(0,0,0,0),f=l&&p!==l,m=h.getTime()>t,g=!(!u||m||a?.id.startsWith("ephemeral"));(g||f)&&c.push(new Fc({id:"border-before-"+d.id,isDayMarker:!!f,isReadMarker:!!g,timestamp:f?l:void 0})),c.push(d),u=m,l=p,a=d}return function(d,h){const p=[];let f=[];const m=Symbol("NO_KEY");let g=m;for(const E of d){const v=h(E);g===m||g===v?f.push(E):(p.push(f),f=[E]),g=v}return f.length!==0&&p.push(f),p}(c,d=>d instanceof Fc?d.id:d.sender?.id).map(d=>(d.id=d.map(h=>h.id).join(","),d))}),this.mentionableUsers$=Ue(()=>{const e=this.state$.extCurrentConversationId.get(),t=this.extUserId$.get();if(!e||!t)return[];const r=this.state$.participants.child(e).get();if(!r||r.length===0)return[];const i=r.map(o=>o.user);return i.sort((o,s)=>o.name.localeCompare(s.name)),function(o,s){const a=s.findIndex(l=>l.id===o);if(a>-1){const l=s[a];s.splice(a,1),s.push(l)}return s}(t,i)})}resetState(e,t,r){zo(()=>{super.resetState(e,t),this.state$.assign({referencedMessageId:null,extCurrentConversationId:r??null,currentConversation:null})})}storeTyping(e,t){this.state$.typing.child(e).set(t)}messagePermissions$(e){const t=this.currentUser$.get();if(!t)throw new Error("Unreachable");const r=e.content[0];return e.sender?t.id===e.sender.id?r.type==="text"?this.state$.messagePermissions.own:this.state$.messagePermissions.ownWithoutEditing:r.type==="text"?this.state$.messagePermissions.other:this.state$.messagePermissions.otherWithoutEditing:this.state$.messagePermissions.system}storeMessages(e,t,r){zo(()=>{const i=t.reduce((l,u)=>(l[u.id]=u,l),{}),o=this.state$.extCurrentConversationId.peek(),s=this.extUserId$.peek();Ie(s&&o),this.state$.messages.child(e).set({state:t,lookup:i,loadedAll:r});const a=this.state$.ephemeralMessages.child(e);for(const l of t){const u=this.state$.ephemeralMessageIdMapping.child(e).child(l.id).peek();u&&a.child(u).delete();const c=l.content[0];if(l.sender?.id!==s||c.type!=="file")continue;const d=c.size+","+c.filename,h=this.state$.localFileBlobUrls.child(o).child(d);if(h.fetching.peek()!==!1)continue;const p=()=>h.delete();if(c.subtype==="image"){h.fetching.set(!0);const f=document.createElement("img");f.addEventListener("load",p,{once:!0}),f.src=c.url}else if(c.subtype==="video"){h.fetching.set(!0);const f=document.createElement("video");f.addEventListener("loaddata",p,{once:!0}),f.src=c.url}else if(c.subtype==="audio"){h.fetching.set(!0);const f=document.createElement("audio");f.addEventListener("loaddata",p,{once:!0}),f.src=c.url}}})}}function ir(n,e){return n==="all"||n==="own"&&e||n==="other"&&!e}class Fc{constructor({id:e,isDayMarker:t,isReadMarker:r,timestamp:i}){this.id=e,this.isDayMarker=t,this.isReadMarker=r,this.timestamp=t?i:void 0}}function Ya(n){return N(Re()instanceof Dg?Eb:vb,{...n})}function Eb(n){const e=sn(),t=Li();return N(e.Icon,{common:t,...n})}function vb(n){const e=sn(),t=Tg();return N(e.Icon,{common:t,...n})}function Uc({src:n,onError:e,filename:t,className:r=""}){const i=W(null),o=W(),s=W(),[a,l]=ne(!1),[u,c]=ne(0),[d,h]=ne(1),p=W(),[f,m]=ne(!1);V(()=>{o.current=new Audio;const v={normalize:!0,height:50,container:i.current};function A(){const T=o.current;T&&(T.error.message==="PIPELINE_ERROR_READ: FFmpegDemuxer: demuxer seek failed"?(T.load(),l(!1)):(m(!0),l(!1),e?.()))}const _=t.slice(t.lastIndexOf(".")+1);if(function(T){return/(?:^|\/)talkjs_audio_message_[0-9]+_([0-9]+)[.](?:mp3|webm)$/.test(T)}(t)&&_==="webm"&&!o.current.canPlayType("audio/webm;codecs=opus"))v.backend="WebAudio",s.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"),s.current.controls=!1;else{const T=o.current;T.addEventListener("error",A),T.src=n,T.preload="auto",T.preservesPitch=!0,v.media=T}p.current=function(T){if(!T.container)return;const S=getComputedStyle(T.container);let b=Cm(S.color);return b||(b=Cm("rgb(255,255,255)")),vc.create({...T,barGap:T.barGap??2,barRadius:T.barRadius??0,barWidth:T.barWidth??2,barHeight:T.barHeight,hideScrollbar:!0,cursorWidth:T.cursorWidth??0,cursorColor:T.cursorColor,height:T.height??24,progressColor:T.progressColor??b.cssa(),waveColor:T.waveColor??b.alpha(b.alpha()/2).cssa()})}(v);const O=p.current;return O.on("finish",()=>{o.current.loop=!0,l(!1)}),O.on("ready",T=>c(Math.trunc(T))),O.on("timeupdate",T=>c(Math.trunc(T))),v.backend==="WebAudio"&&O.load(n).catch(()=>{m(!0),l(!1),e?.()}),()=>{o.current?.removeEventListener("error",A),o.current=void 0,O.destroy(),p.current=void 0}},[n,t,e]);const g=ie(()=>{if(p.current.options.backend==="WebAudio")p.current.isPlaying()||s.current.play(),p.current.playPause(),l(p.current.isPlaying()??!1);else{const v=o.current;v.paused?v.play():v.pause(),v.loop=!1,!v.paused&&v.ended&&(v.load(),v.play()),l(!v.paused)}},[]),E=ie(v=>{p.current.setPlaybackRate(v),h(v)},[]);return N("div",f?{}:{className:`t-audio-player ${r}`,children:[N("button",{onClick:g,children:N(Ya,{className:"t-play-pause-icon",type:a?"pause":"play","aria-label":a?"pause audio":"play audio"})}),N("div",{className:"t-waveform",ref:i}),N("div",{className:"t-duration",children:Hy(u)}),N(US,{as:"div",children:({isExpanded:v})=>N(xe,{children:[N(HS,{className:"t-playback-speed","aria-label":"set playback speed",children:[d,"x",N(Ya,{type:"updown","aria-hidden":!0,className:"t-up-down-icon"})]}),v&&N(zS,{children:N(YS,{className:"t-action-menu",children:[N("div",{className:"t-playback-heading",children:"Playback Speed"}),[.25,.5,.75,1,1.25,1.5,2].map((A,_)=>N(jS,{onSelect:()=>E(A),children:[N("span",{className:"t-playback-checkmark",children:d==A?"✓":""}),A,"x"]},_))]})})]})})]})}function nt(n){this.content=n}function kg(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i!=o){if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=kg(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}else t+=i.nodeSize}}function Lg(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),a=e.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let u=0,c=Math.min(s.text.length,a.text.length);for(;u<c&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,t--,r--;return{a:t,b:r}}if(s.content.size||a.content.size){let u=Lg(s.content,a.content,t-1,r-1);if(u)return u}t-=l,r-=l}else t-=l,r-=l}}nt.prototype={constructor:nt,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new nt(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new nt(t)},addToStart:function(n,e){return new nt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new nt(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new nt(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return(n=nt.from(n)).size?new nt(n.content.concat(this.subtract(n).content)):this},append:function(n){return(n=nt.from(n)).size?new nt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=nt.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},nt.from=function(n){if(n instanceof nt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new nt(e)};class q{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,a=0;a<t;s++){let l=this.content[s],u=a+l.nodeSize;if(u>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,t-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new q(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>t)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),i+=a.nodeSize),s=l}return new q(r,i)}cutByIndex(e,t){return e==t?q.empty:e==0&&t==this.content.length?this:new q(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new q(i,o)}addToStart(e){return new q([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new q(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,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return kg(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Lg(this,e,t,r)}findIndex(e,t=-1){if(e==0)return za(0,e);if(e==this.size)return za(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=i+this.child(r).nodeSize;if(o>=e)return o==e||t>0?za(r+1,o):za(r,i);i=o}}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 q.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new q(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return q.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new q(t||e,r)}static from(e){if(!e)return q.empty;if(e instanceof q)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new q([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}q.empty=new q([],0);const Hc={index:0,offset:0};function za(n,e){return Hc.index=n,Hc.offset=e,Hc}function Va(n,e){if(n===e)return!0;if(!n||typeof n!="object"||!e||typeof e!="object")return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Va(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Va(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}class Oe{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||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&&Va(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 r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Oe.none;if(e instanceof Oe)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}}Oe.none=[];class xi extends Error{}class G{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Mg(this.content,e+this.openStart,t);return r&&new G(r,this.openStart,this.openEnd)}removeBetween(e,t){return new G(xg(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 G.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new G(q.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new G(e,r,i)}}function xg(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(i==e||o.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(xg(o.content,e-i-1,t-i-1)))}function Mg(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return n.cut(0,e).append(t).append(n.cut(e));let a=Mg(s.content,e-o-1,t);return a&&n.replaceChild(i,s.copy(a))}function Ab(n,e,t){if(t.openStart>n.depth)throw new xi("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new xi("Inconsistent open depths");return Pg(n,e,t,0)}function Pg(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=Pg(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}if(t.content.size){if(t.openStart||t.openEnd||n.depth!=r||e.depth!=r){let{start:s,end:a}=function(l,u){let c=u.depth-l.openStart,d=u.node(c).copy(l.content);for(let h=c-1;h>=0;h--)d=u.node(h).copy(q.from(d));return{start:d.resolveNoCache(l.openStart+c),end:d.resolveNoCache(d.content.size-l.openEnd-c)}}(t,n);return Dr(o,Fg(n,s,a,e,r))}{let s=n.parent,a=s.content;return Dr(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}}return Dr(o,Wa(n,e,r))}function Bg(n,e){if(!e.type.compatibleContent(n.type))throw new xi("Cannot join "+e.type.name+" onto "+n.type.name)}function $c(n,e,t){let r=n.node(t);return Bg(r,e.node(t)),r}function Rr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Wo(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Rr(n.nodeAfter,r),o++));for(let a=o;a<s;a++)Rr(i.child(a),r);e&&e.depth==t&&e.textOffset&&Rr(e.nodeBefore,r)}function Dr(n,e){return n.type.checkContent(e),n.copy(e)}function Fg(n,e,t,r,i){let o=n.depth>i&&$c(n,e,i+1),s=r.depth>i&&$c(t,r,i+1),a=[];return Wo(null,n,i,a),o&&s&&e.index(i)==t.index(i)?(Bg(o,s),Rr(Dr(o,Fg(n,e,t,r,i+1)),a)):(o&&Rr(Dr(o,Wa(n,e,i+1)),a),Wo(e,t,i,a),s&&Rr(Dr(s,Wa(t,r,i+1)),a)),Wo(r,null,i,a),new q(a)}function Wa(n,e,t){let r=[];return Wo(null,n,t,r),n.depth>t&&Rr(Dr($c(n,e,t+1),Wa(n,e,t+1)),r),Wo(e,null,t,r),new q(r)}G.empty=new G(q.empty,0,0);class Go{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?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(e=this.resolveDepth(e))==0?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 r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}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):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[3*t],i=t==0?0:this.path[3*t-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Oe.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive!==!1||i&&o[s].isInSet(i.marks)||(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive!==!1||i&&r[o].isInSet(i.marks)||(r=r[o--].removeFromSet(r));return r}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 r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new yb(this,e,r);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 r=[],i=0,o=t;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new Go(t,r,o)}static resolveCached(e,t){for(let i=0;i<jc.length;i++){let o=jc[i];if(o.pos==t&&o.doc==e)return o}let r=jc[Yc]=Go.resolve(e,t);return Yc=(Yc+1)%_b,r}}let jc=[],Yc=0,_b=12;class yb{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}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 Ob=Object.create(null);let kr=class Xp{constructor(e,t,r,i=Oe.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||q.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,r,i=0){this.content.nodesBetween(e,t,r,i,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,r,i){return this.content.textBetween(e,t,r,i)}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,r){return this.type==e&&Va(this.attrs,t||e.defaultAttrs||Ob)&&Oe.sameSet(this.marks,r||Oe.none)}copy(e=null){return e==this.content?this:new Xp(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Xp(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return G.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),a=i.start(s),l=i.node(s).content.cut(i.pos-a,o.pos-a);return new G(l,i.depth-s,o.depth-s)}replace(e,t,r){return Ab(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Go.resolveCached(this,e)}resolveNoCache(e){return Go.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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()+")"),Ug(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,r=q.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);return!!s&&s.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=Oe.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Oe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=q.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};kr.prototype.text=void 0;class Ga extends kr{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ug(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 Ga(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ga(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&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 Ug(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Lr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Tb(e,t);if(r.next==null)return Lr.empty;let i=Hg(r);r.next&&r.err("Unexpected trailing text");let o=function(s){let a=Object.create(null);return l(Yg(s,0));function l(u){let c=[];u.forEach(h=>{s[h].forEach(({term:p,to:f})=>{if(!p)return;let m;for(let g=0;g<c.length;g++)c[g][0]==p&&(m=c[g][1]);Yg(s,f).forEach(g=>{m||c.push([p,m=[]]),m.indexOf(g)==-1&&m.push(g)})})});let d=a[u.join(",")]=new Lr(u.indexOf(s.length-1)>-1);for(let h=0;h<c.length;h++){let p=c[h][1].sort(jg);d.next.push({type:c[h][0],next:a[p.join(",")]||l(p)})}return d}}(function(s){let a=[[]];return c(d(s,0),l()),a;function l(){return a.push([])-1}function u(h,p,f){let m={term:f,to:p};return a[h].push(m),m}function c(h,p){h.forEach(f=>f.to=p)}function d(h,p){if(h.type=="choice")return h.exprs.reduce((f,m)=>f.concat(d(m,p)),[]);if(h.type!="seq"){if(h.type=="star"){let f=l();return u(p,f),c(d(h.expr,f),f),[u(f)]}if(h.type=="plus"){let f=l();return c(d(h.expr,p),f),c(d(h.expr,f),f),[u(f)]}if(h.type=="opt")return[u(p)].concat(d(h.expr,p));if(h.type=="range"){let f=p;for(let m=0;m<h.min;m++){let g=l();c(d(h.expr,f),g),f=g}if(h.max==-1)c(d(h.expr,f),f);else for(let m=h.min;m<h.max;m++){let g=l();u(f,g),c(d(h.expr,f),g),f=g}return[u(f)]}if(h.type=="name")return[u(p,void 0,h.value)];throw new Error("Unknown expr type")}for(let f=0;;f++){let m=d(h.exprs[f],p);if(f==h.exprs.length-1)return m;c(m,p=l())}}}(i));return function(s,a){for(let l=0,u=[s];l<u.length;l++){let c=u[l],d=!c.validEnd,h=[];for(let p=0;p<c.next.length;p++){let{type:f,next:m}=c.next[p];h.push(f.name),!d||f.isText||f.hasRequiredAttrs()||(d=!1),u.indexOf(m)==-1&&u.push(m)}d&&a.err("Only non-generatable nodes ("+h.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,r),o}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,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&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 r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];return function o(s,a){let l=s.matchFragment(e,r);if(l&&(!t||l.validEnd))return q.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!c.isText&&!c.hasRequiredAttrs()&&i.indexOf(d)==-1){i.push(d);let h=o(d,a.concat(c));if(h)return h}}return null}(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];a.isLeaf||a.hasRequiredAttrs()||a.name in t||i.type&&!l.validEnd||(r.push({match:a.contentMatch,type:a,via:i}),t[a.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(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}(this),e.map((t,r)=>{let i=r+(t.validEnd?"*":" ")+" ";for(let o=0;o<t.next.length;o++)i+=(o?", ":"")+t.next[o].type.name+"->"+e.indexOf(t.next[o].next);return i}).join(`
75
+ `,[e,t]}setOptions(e){if(this.options.container!==e.container){const t=this.parentFromOptionsContainer(e.container);t.appendChild(this.container),this.parent=t}e.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||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,r=t*e;this.setScroll(r)}destroy(){var e,t;this.subscriptions.forEach(r=>r()),this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.unsubscribeOnScroll)===null||t===void 0||t.call(this)}createDelay(e=10){let t,r;const i=()=>{t&&clearTimeout(t),r&&r()};return this.timeouts.push(i),()=>new Promise((o,s)=>{i(),r=s,t=setTimeout(()=>{t=void 0,r=void 0,o()},e)})}convertColorValues(e){if(!Array.isArray(e))return e||"";if(e.length<2)return e[0]||"";const t=document.createElement("canvas"),r=t.getContext("2d"),i=t.height*(window.devicePixelRatio||1),o=r.createLinearGradient(0,0,0,i),s=1/(e.length-1);return e.forEach((a,l)=>{const u=l*s;o.addColorStop(u,a)}),o}getPixelRatio(){return Math.max(1,window.devicePixelRatio||1)}renderBarWaveform(e,t,r,i){const o=e[0],s=e[1]||e[0],a=o.length,{width:l,height:u}=r.canvas,c=u/2,d=this.getPixelRatio(),h=t.barWidth?t.barWidth*d:1,p=t.barGap?t.barGap*d:t.barWidth?h/2:0,f=t.barRadius||0,m=l/(h+p)/a,g=f&&"roundRect"in r?"roundRect":"rect";r.beginPath();let E=0,v=0,A=0;for(let _=0;_<=a;_++){const y=Math.round(_*m);if(y>E){const b=Math.round(v*c*i),O=b+Math.round(A*c*i)||1;let C=c-b;t.barAlign==="top"?C=0:t.barAlign==="bottom"&&(C=u-O),r[g](E*(h+p),C,h,O,f),E=y,v=0,A=0}const T=Math.abs(o[_]||0),S=Math.abs(s[_]||0);T>v&&(v=T),S>A&&(A=S)}r.fill(),r.closePath()}renderLineWaveform(e,t,r,i){const o=s=>{const a=e[s]||e[0],l=a.length,{height:u}=r.canvas,c=u/2,d=r.canvas.width/l;r.moveTo(0,c);let h=0,p=0;for(let f=0;f<=l;f++){const m=Math.round(f*d);if(m>h){const E=c+(Math.round(p*c*i)||1)*(s===0?-1:1);r.lineTo(h,E),h=m,p=0}const g=Math.abs(a[f]||0);g>p&&(p=g)}r.lineTo(h,c)};r.beginPath(),o(0),o(1),r.fill(),r.closePath()}renderWaveform(e,t,r){if(r.fillStyle=this.convertColorValues(t.waveColor),t.renderFunction)return void t.renderFunction(e,r);let i=t.barHeight||1;if(t.normalize){const o=Array.from(e[0]).reduce((s,a)=>Math.max(s,Math.abs(a)),0);i=o?1/o:1}t.barWidth||t.barGap||t.barAlign?this.renderBarWaveform(e,t,r,i):this.renderLineWaveform(e,t,r,i)}renderSingleCanvas(e,t,r,i,o,s,a){const l=this.getPixelRatio(),u=document.createElement("canvas");u.width=Math.round(r*l),u.height=Math.round(i*l),u.style.width=`${r}px`,u.style.height=`${i}px`,u.style.left=`${Math.round(o)}px`,s.appendChild(u);const c=u.getContext("2d");if(this.renderWaveform(e,t,c),u.width>0&&u.height>0){const d=u.cloneNode(),h=d.getContext("2d");h.drawImage(u,0,0),h.globalCompositeOperation="source-in",h.fillStyle=this.convertColorValues(t.progressColor),h.fillRect(0,0,u.width,u.height),a.appendChild(d)}}renderMultiCanvas(e,t,r,i,o,s){const a=this.getPixelRatio(),{clientWidth:l}=this.scrollContainer;if(l*a>=r)return void this.renderSingleCanvas(e,t,l,i,0,o,s);const u=r/a;let c=Math.min(Gp.MAX_CANVAS_WIDTH,l,u),d={};if(t.barWidth||t.barGap){const g=t.barWidth||.5,E=g+(t.barGap||g/2);c%E!=0&&(c=Math.floor(c/E)*E)}const h=g=>{if(g<0||g>=p||d[g])return;d[g]=!0;const E=g*c,v=Math.min(u-E,c);if(v<=0)return;const A=e.map(_=>{const y=Math.floor(E/u*_.length),T=Math.floor((E+v)/u*_.length);return _.slice(y,T)});this.renderSingleCanvas(A,t,v,i,E,o,s)},p=Math.ceil(u/c),f=this.scrollContainer.scrollLeft/u,m=Math.floor(f*p);h(m-1),h(m),h(m+1),p>1&&(this.unsubscribeOnScroll=this.on("scroll",()=>{const{scrollLeft:g}=this.scrollContainer,E=Math.floor(g/u*p);Object.keys(d).length>Gp.MAX_NODES&&(o.innerHTML="",s.innerHTML="",d={}),h(E-1),h(E),h(E+1)}))}renderChannel(e,t,r,i){var{overlay:o}=t,s=function(c,d){var h={};for(var p in c)Object.prototype.hasOwnProperty.call(c,p)&&d.indexOf(p)<0&&(h[p]=c[p]);if(c!=null&&typeof Object.getOwnPropertySymbols=="function"){var f=0;for(p=Object.getOwnPropertySymbols(c);f<p.length;f++)d.indexOf(p[f])<0&&Object.prototype.propertyIsEnumerable.call(c,p[f])&&(h[p[f]]=c[p[f]])}return h}(t,["overlay"]);const a=document.createElement("div"),l=this.getHeight(s.height,s.splitChannels);a.style.height=`${l}px`,o&&i>0&&(a.style.marginTop=`-${l}px`),this.canvasWrapper.style.minHeight=`${l}px`,this.canvasWrapper.appendChild(a);const u=a.cloneNode();this.progressWrapper.appendChild(u),this.renderMultiCanvas(e,s,r,l,a,u)}render(e){return st(this,void 0,void 0,function*(){var t;this.timeouts.forEach(l=>l()),this.timeouts=[],this.canvasWrapper.innerHTML="",this.progressWrapper.innerHTML="",this.options.width!=null&&(this.scrollContainer.style.width=typeof this.options.width=="number"?`${this.options.width}px`:this.options.width);const r=this.getPixelRatio(),i=this.scrollContainer.clientWidth,o=Math.ceil(e.duration*(this.options.minPxPerSec||0));this.isScrollable=o>i;const s=this.options.fillParent&&!this.isScrollable,a=(s?i:o)*r;if(this.wrapper.style.width=s?"100%":`${o}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 l=0;l<e.numberOfChannels;l++){const u=Object.assign(Object.assign({},this.options),(t=this.options.splitChannels)===null||t===void 0?void 0:t[l]);this.renderChannel([e.getChannelData(l)],u,a,l)}else{const l=[e.getChannelData(0)];e.numberOfChannels>1&&l.push(e.getChannelData(1)),this.renderChannel(l,this.options,a,0)}Promise.resolve().then(()=>this.emit("rendered"))})}reRender(){var e;if((e=this.unsubscribeOnScroll)===null||e===void 0||e.call(this),delete this.unsubscribeOnScroll,!this.audioData)return;const{scrollWidth:t}=this.scrollContainer,{right:r}=this.progressWrapper.getBoundingClientRect();if(this.render(this.audioData),this.isScrollable&&t!==this.scrollContainer.scrollWidth){const{right:i}=this.progressWrapper.getBoundingClientRect();let o=i-r;o*=2,o=o<0?Math.floor(o):Math.ceil(o),o/=2,this.scrollContainer.scrollLeft+=o}}zoom(e){this.options.minPxPerSec=e,this.reRender()}scrollIntoView(e,t=!1){const{scrollLeft:r,scrollWidth:i,clientWidth:o}=this.scrollContainer,s=e*i,a=r,l=r+o,u=o/2;if(this.isDragging)s+30>l?this.scrollContainer.scrollLeft+=30:s-30<a&&(this.scrollContainer.scrollLeft-=30);else{(s<a||s>l)&&(this.scrollContainer.scrollLeft=s-(this.options.autoCenter?u:0));const c=s-r-u;t&&this.options.autoCenter&&c>0&&(this.scrollContainer.scrollLeft+=Math.min(c,10))}{const c=this.scrollContainer.scrollLeft,d=c/i,h=(c+o)/i;this.emit("scroll",d,h,c,c+o)}}renderProgress(e,t){if(isNaN(e))return;const r=100*e;this.canvasWrapper.style.clipPath=`polygon(${r}% 0, 100% 0, 100% 100%, ${r}% 100%)`,this.progressWrapper.style.width=`${r}%`,this.cursor.style.left=`${r}%`,this.cursor.style.transform=`translateX(-${Math.round(r)===100?this.options.cursorWidth:0}px)`,this.isScrollable&&this.options.autoScroll&&this.scrollIntoView(e,t)}exportImage(e,t,r){return st(this,void 0,void 0,function*(){const i=this.canvasWrapper.querySelectorAll("canvas");if(!i.length)throw new Error("No waveform data");if(r==="dataURL"){const o=Array.from(i).map(s=>s.toDataURL(e,t));return Promise.resolve(o)}return Promise.all(Array.from(i).map(o=>new Promise((s,a)=>{o.toBlob(l=>{l?s(l):a(new Error("Could not export image"))},e,t)})))})}};Ec.MAX_CANVAS_WIDTH=8e3,Ec.MAX_NODES=10;let qS=class extends Mo{constructor(){super(...arguments),this.unsubscribe=()=>{}}start(){this.unsubscribe=this.on("tick",()=>{requestAnimationFrame(()=>{this.emit("tick")})}),this.emit("tick")}stop(){this.unsubscribe()}destroy(){this.unsubscribe()}},Dm=class extends Mo{constructor(n=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=n,this.gainNode=this.audioContext.createGain(),this.gainNode.connect(this.audioContext.destination)}load(){return st(this,void 0,void 0,function*(){})}get src(){return this.currentSrc}set src(n){if(this.currentSrc=n,this._duration=void 0,!n)return this.buffer=null,void this.emit("emptied");fetch(n).then(e=>{if(e.status>=400)throw new Error(`Failed to fetch ${n}: ${e.status} (${e.statusText})`);return e.arrayBuffer()}).then(e=>this.currentSrc!==n?null:this.audioContext.decodeAudioData(e)).then(e=>{this.currentSrc===n&&(this.buffer=e,this.emit("loadedmetadata"),this.emit("canplay"),this.autoplay&&this.play())})}_play(){var n;if(!this.paused)return;this.paused=!1,(n=this.bufferNode)===null||n===void 0||n.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 e=this.playedDuration*this._playbackRate;e>=this.duration&&(e=0,this.playedDuration=0),this.bufferNode.start(this.audioContext.currentTime,e),this.playStartTime=this.audioContext.currentTime,this.bufferNode.onended=()=>{this.currentTime>=this.duration&&(this.pause(),this.emit("ended"))}}_pause(){var n;this.paused=!0,(n=this.bufferNode)===null||n===void 0||n.stop(),this.playedDuration+=this.audioContext.currentTime-this.playStartTime}play(){return st(this,void 0,void 0,function*(){this.paused&&(this._play(),this.emit("play"))})}pause(){this.paused||(this._pause(),this.emit("pause"))}stopAt(n){var e,t;const r=n-this.currentTime;(e=this.bufferNode)===null||e===void 0||e.stop(this.audioContext.currentTime+r),(t=this.bufferNode)===null||t===void 0||t.addEventListener("ended",()=>{this.bufferNode=null,this.pause()},{once:!0})}setSinkId(n){return st(this,void 0,void 0,function*(){return this.audioContext.setSinkId(n)})}get playbackRate(){return this._playbackRate}set playbackRate(n){this._playbackRate=n,this.bufferNode&&(this.bufferNode.playbackRate.value=n)}get currentTime(){return(this.paused?this.playedDuration:this.playedDuration+(this.audioContext.currentTime-this.playStartTime))*this._playbackRate}set currentTime(n){const e=!this.paused;e&&this._pause(),this.playedDuration=n/this._playbackRate,e&&this._play(),this.emit("seeking"),this.emit("timeupdate")}get duration(){var n,e;return(n=this._duration)!==null&&n!==void 0?n:((e=this.buffer)===null||e===void 0?void 0:e.duration)||0}set duration(n){this._duration=n}get volume(){return this.gainNode.gain.value}set volume(n){this.gainNode.gain.value=n,this.emit("volumechange")}get muted(){return this._muted}set muted(n){this._muted!==n&&(this._muted=n,this._muted?this.gainNode.disconnect():this.gainNode.connect(this.audioContext.destination))}canPlayType(n){return/^(audio|video)\//.test(n)}getGainNode(){return this.gainNode}getChannelData(){const n=[];if(!this.buffer)return n;const e=this.buffer.numberOfChannels;for(let t=0;t<e;t++)n.push(this.buffer.getChannelData(t));return n}};const JS={waveColor:"#999",progressColor:"#555",cursorWidth:1,minPxPerSec:0,fillParent:!0,interact:!0,dragToSeek:!1,autoScroll:!0,autoCenter:!0,sampleRate:8e3};let vc=class TT extends KS{static create(e){return new TT(e)}constructor(e){const t=e.media||(e.backend==="WebAudio"?new Dm: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({},JS,e),this.timer=new qS;const r=t?void 0:this.getMediaElement();this.renderer=new Ec(this.options,r),this.initPlayerEvents(),this.initRendererEvents(),this.initTimerEvents(),this.initPlugins();const i=this.options.url||this.getSrc()||"";Promise.resolve().then(()=>{this.emit("init");const{peaks:o,duration:s}=this.options;(i||o&&s)&&this.load(i,o,s).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,r,i)=>{const o=this.getDuration();this.emit("scroll",e*o,t*o,r,i)}),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 r;this.renderer.renderProgress(t),clearTimeout(e),this.isPlaying()?r=0:this.options.dragToSeek===!0?r=200:typeof this.options.dragToSeek=="object"&&this.options.dragToSeek!==void 0&&(r=this.options.dragToSeek.debounceTime),e=setTimeout(()=>{this.seekTo(t)},r),this.emit("interaction",t*this.getDuration()),this.emit("drag",t)}))}}initPlugins(){var e;!((e=this.options.plugins)===null||e===void 0)&&e.length&&this.options.plugins.forEach(t=>{this.registerPlugin(t)})}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),e.mediaControls!=null&&(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,r,i){return st(this,void 0,void 0,function*(){var o;if(this.emit("load",e),!this.options.media&&this.isPlaying()&&this.pause(),this.decodedData=null,!t&&!r){const a=this.options.fetchParams||{};window.AbortController&&!a.signal&&(this.abortController=new AbortController,a.signal=(o=this.abortController)===null||o===void 0?void 0:o.signal);const l=u=>this.emit("loading",u);t=yield XS.fetchBlob(e,l,a)}this.setSrc(e,t);const s=yield new Promise(a=>{const l=i||this.getDuration();l?a(l):this.mediaSubscriptions.push(this.onMediaEvent("loadedmetadata",()=>a(this.getDuration()),{once:!0}))});if(!e&&!t){const a=this.getMediaElement();a instanceof Dm&&(a.duration=s)}if(r)this.decodedData=Im.createBuffer(r,s||0);else if(t){const a=yield t.arrayBuffer();this.decodedData=yield Im.decode(a,this.options.sampleRate)}this.decodedData&&(this.emit("decode",this.getDuration()),this.renderer.render(this.decodedData)),this.emit("ready",this.getDuration())})}load(e,t,r){return st(this,void 0,void 0,function*(){try{return yield this.loadAudio(e,void 0,t,r)}catch(i){throw this.emit("error",i),i}})}loadBlob(e,t,r){return st(this,void 0,void 0,function*(){try{return yield this.loadAudio("",e,t,r)}catch(i){throw this.emit("error",i),i}})}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:r=1e4}={}){if(!this.decodedData)throw new Error("The audio has not been decoded yet");const i=Math.min(e,this.decodedData.numberOfChannels),o=[];for(let s=0;s<i;s++){const a=this.decodedData.getChannelData(s),l=[],u=a.length/t;for(let c=0;c<t;c++){const d=a.slice(Math.floor(c*u),Math.ceil((c+1)*u));let h=0;for(let p=0;p<d.length;p++){const f=d[p];Math.abs(f)>Math.abs(h)&&(h=f)}l.push(Math.round(h*r)/r)}o.push(l)}return o}getDuration(){let e=super.getDuration()||0;return e!==0&&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 st(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 st(this,arguments,void 0,function*(e="image/png",t=1,r="dataURL"){return this.renderer.exportImage(e,t,r)})}destroy(){var e;this.emit("destroy"),(e=this.abortController)===null||e===void 0||e.abort(),this.plugins.forEach(t=>t.destroy()),this.subscriptions.forEach(t=>t()),this.unsubscribePlayerEvents(),this.timer.destroy(),this.renderer.destroy(),super.destroy()}};vc.BasePlugin=class extends Mo{constructor(n){super(),this.subscriptions=[],this.options=n}onInit(){}_init(n){this.wavesurfer=n,this.onInit()}destroy(){this.emit("destroy"),this.subscriptions.forEach(n=>n())}},vc.dom=GS;class km extends Error{}function Lm(n,e){if(!n)throw new km(e??"Assertion failed")}const Ie=Object.assign(Lm,{is:function(n,e,t){return Lm(e,t)},unreachable:function(){throw new Error("Unreachable code")},never:function(n){throw new Error("Unreachable")},defined:function(n){if(n==null)throw new km("Value is not defined")}}),[xm,sn]=Cr(),[Mm,Po]=Cr(),[Pm,aL]=Cr(),[Bm,Bo]=Cr(),[ZS,QS]=Cr(),Ac=kt(void 0);function Re(){const n=qe(Ac);return Ie(n!==void 0),n}const _c=kt(void 0);function yi(){const n=qe(_c);return Ie(n!==void 0),n}const[Fm,e1]=Cr(),[t1,n1]=Cr();function Cr(){const n=kt(void 0);return[n,()=>{const e=qe(n);return Ie(e!==void 0),e}]}var Um=Object.prototype.hasOwnProperty;function Je(n){return Array.isArray(n)}function Tt(n){return!(!n||typeof n!="object"||n instanceof Date||Je(n))}function Ee(n){return typeof n=="function"}function Kt(n){const e=typeof n;return n!==void 0&&(yc(n)||e!=="object"&&e!=="function")}function yc(n){return n instanceof Date}function Hm(n){return typeof n=="boolean"}function St(n){return n instanceof Promise}function Pt(n){return n instanceof Map}function Oi(n){if(!n)return!1;if(Je(n))return n.length===0;for(const e in n)if(Um.call(n,e))return!1;return!0}function $m(n){return n==null}var r1=new Set(["boolean","string","number"]);function Da(n){return!!n.parent}var i1=Symbol.toPrimitive,Ti=Symbol("getNode"),Fo=Symbol("delete"),Si=Symbol("opaque"),Oc=Symbol("optimized"),Uo=Symbol("linked"),De={isLoadingLocal:!1,isMerging:!1,isLoadingRemote:!1,activateSyncedNode:void 0,pendingNodes:new Map,dirtyNodes:new Set,replacer:void 0,reviver:void 0};function jm(n){return Je(n)?"array":Pt(n)?"map":n instanceof Set?"set":"object"}function o1(n,e){return Pt(e)?{__LSType:"Map",value:Array.from(e.entries())}:e instanceof Set?{__LSType:"Set",value:Array.from(e)}:(De.replacer&&(e=De.replacer(n,e)),e)}var s1=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/;function a1(n,e){if(e){if(typeof e=="string"&&s1.test(e))return new Date(e);if(typeof e=="object"){if(e.__LSType==="Map")return new Map(e.value);if(e.__LSType==="Set")return new Set(e.value)}De.reviver&&(e=De.reviver(n,e))}return e}function Ym(n){return n&&JSON.stringify(n,o1)}function zm(n){return n&&JSON.parse(n,a1)}function Vm(n){return zm(Ym(n))}function ke(n){return!!n&&!!n[Ti]}function ka(n){return n&&n[Ti]}function An(n,e){var t,r,i;const o=(t=n.parent)!=null?t:n,s=n.parent?n.key:"_",a=e===Fo;a&&(e=void 0);const l=n.parent?Tc(o):o.root,u=l[s],c=Ee(e);if(e=o.isAssigning||!c||Ee(u)?e:e(u),!De.isMerging||$m(u)||Ee(u)||!((i=(r=n.parent)==null?void 0:r.functions)!=null&&i.get(s)))try{o.isSetting=(o.isSetting||0)+1;const d=Pt(l);a?d?l.delete(s):delete l[s]:Pt(l)?l.set(s,e):l[s]=e}finally{o.isSetting--}return{prevValue:u,newValue:e}}var Wm=[];function Me(n){let e=0,t=n;for(;Da(t);)Wm[e++]=t.key,t=t.parent;let r=n.root._;for(let i=e-1;r&&i>=0;i--){const o=Wm[i];r=o!=="size"&&(Pt(r)||r instanceof WeakMap)?r.get(o):r[o]}return r}function an(n,e,t){var r,i;let o=(r=n.children)==null?void 0:r.get(e);return o||(o={root:n.root,parent:n,key:e,lazy:!0,numListenersRecursive:0},((i=n.lazyFn)==null?void 0:i.length)===1&&(t=n.lazyFn.bind(n,e)),Ee(t)&&(o=Object.assign(()=>{},o),o.lazyFn=t),n.children||(n.children=new Map),n.children.set(e,o)),o}function Tc(n){let e=Me(n);return(!e||Ee(e))&&(Da(n)?e=Tc(n.parent)[n.key]={}:e=n.root._={}),e}function Gm(n,e){var t,r;let i=ke(n)?void 0:Tt(n)?"id"in n?"id":"key"in n?"key":"_id"in n?"_id":"__id"in n?"__id":void 0:void 0;if(!i&&e.parent){const o=e.key+"_keyExtractor",s=(r=(t=e.functions)==null?void 0:t.get(o))!=null?r:Me(e.parent)[e.key+"_keyExtractor"];s&&Ee(s)&&(i=s)}return i}function Xm(n,e,t){n.functions||(n.functions=new Map),n.functions.set(e,t)}function Km(n,e){return n===e||yc(n)&&yc(e)&&+n==+e}function Ho(n,e,t){let r=n;return!ke(r)&&Ee(r)&&(r=e?r(e):r()),ke(r)&&!t?r.get():r}function qm(n){return n&&(n[Si]=!0),n}var $o,l1=(n,e)=>n&&n[e];function Jm(n,e,t,r,i,o,s){let a,l=n;if(e.length>0){let u=o;for(let c=0;c<e.length;c++){if(a=e[c],l[a]===Fo)return u&&(l[a]=u[a],s?.(e.slice(0,c+1),l[a])),n;if(l[a]===void 0&&r===void 0&&c===e.length-1)return n;l[a]!==void 0&&l[a]!==null||(l[a]=Zm(t[c])),c<e.length-1&&(l=l[a],u&&(u=u[a]))}}return a===void 0?n=i==="merge"?Sc(n,r):r:i==="merge"?l[a]=Sc(l[a],r):Pt(l)?l.set(a,r):l[a]=r,n}function Sc(n,e,t){var r;ke(e)&&(e=e.peek());const i=ke(n),o=i?n.peek():n,s=Je(o);if(!s&&Tt(o)&&Tt(e)&&!Oi(o)||s&&o.length>0){const a=Object.keys(e);for(let l=0;l<a.length;l++){const u=a[l],c=e[u];if(c===Fo)i&&((r=n[u])!=null&&r.delete)?n[u].delete():delete n[u];else{const d=Tt(c),h=!d&&Je(c),p=n[u];if(!d&&!h||!p||!i&&Oi(p))if(i)p.set(c);else{const f=Tt(c)?{...c}:Je(c)?[...c]:c;n[u]=f}else i||p&&(d?Tt(p):Je(p))?Sc(p,c):n[u]=c}}}else e!==void 0&&(i?n.set(e):n=e);return n}function Zm(n){switch(n){case"array":return[];case"object":return{};case"map":return new Map;case"set":return new Set}}function u1(n,e,t){const{path:r,valueAtPath:i,prevAtPath:o,pathTypes:s}=e;return Jm(n,r,s,o)}var La=0,bc=!1,Nc=!1,jo=new Map;function c1(){jo.size>0&&bi(!0)}function Qm(n,e){for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function d1(n,e){try{return function(t,r){for(let i=0;i<r.length;i++)t=u1(t,r[i]);return t}(n?Vm(n):{},e)}catch{return}}function Cc(n,e){return function(){return d1(n,e)}}function Yo(n,e,t,r,i){const o=new Map;xa(o,n,De.isLoadingLocal,De.isLoadingRemote,e,[],[],e,t,!0,r,i),o.size&&eg(o,!0);const s=jo.get(n);s?s.value=e:jo.set(n,{value:e,prev:t,level:r,whenOptimizedOnlyIf:i,remote:De.isLoadingRemote,loading:De.isLoadingLocal}),La<=0&&tg()}function xa(n,e,t,r,i,o,s,a,l,u,c,d){if(function(h,p,f,m,g,E,v,A,_,y,T,S){if(y?p.listenersImmediate:p.listeners){const b={path:E,pathTypes:v,valueAtPath:A,prevAtPath:_},O=h.get(p);if(O&&E.length>0){const{changes:C}=O;Qm(C[0].path,b.path)||C.push(b)}else h.set(p,{level:T,value:g,remote:m,loading:f,whenOptimizedOnlyIf:S,changes:[b]})}}(n,e,t,r,i,o,s,a,l,u,c,d),e.linkedFromNodes)for(const h of e.linkedFromNodes)xa(n,h1(h,o),t,r,a,[],[],a,l,u,0,d);if(e.parent){const h=e.parent;h&&xa(n,h,t,r,Me(h),[e.key].concat(o),[jm(i)].concat(s),a,l,u,c+1,d)}}function eg(n,e){const t=new Set;n.forEach(({changes:r,level:i,value:o,loading:s,remote:a,whenOptimizedOnlyIf:l},u)=>{const c=e?u.listenersImmediate:u.listeners;if(c){let d;const h=Array.from(c);for(let p=0;p<h.length;p++){const f=h[p],{track:m,noArgs:g,listener:E}=f;t.has(E)||(m===!0?i<=0:m!==Oc||l&&i<=0)&&(g||d||(d={value:o,loading:s,remote:a,getPrevious:Cc(o,r),changes:r}),m||t.add(E),E(d))}}})}function tg(){const n=Array.from(De.dirtyNodes);De.dirtyNodes.clear(),n.forEach(r=>{const i=r.dirtyFn;i&&(r.dirtyFn=void 0,i())});const e=jo;jo=new Map;const t=new Map;e.forEach(({value:r,prev:i,level:o,loading:s,remote:a,whenOptimizedOnlyIf:l},u)=>{xa(t,u,s,a,r,[],[],r,i,!1,o,l)}),t.size&&eg(t,!1)}function zo(n){Ma();try{n()}finally{bi()}}function Ma(){La++,$o||($o=setTimeout(c1,0))}function bi(n){(--La<=0||n)&&(bc?Nc=!0:($o&&(clearTimeout($o),$o=void 0),La=0,bc=!0,tg(),bc=!1,Nc&&(Nc=!1,bi(!0))))}function h1(n,e){let t=n;for(let r=0;r<e.length;r++)t=an(t,e[r]);return t}function Ic(n,e,t,r,i){if(ke(n))return n;const o=St(n);let s={root:{_:n},lazy:!0,numListenersRecursive:0};Ee(n)&&(s=Object.assign(()=>{},s),s.lazyFn=n);var a;const l=(a=n,r1.has(typeof a)?new i(s):r(s));return o&&(An(s,void 0),t(s,n)),l}function nr(n,e,t={},r){var i;const{initial:o,immediate:s,noArgs:a}=t,{trackingType:l}=t;let u=s?n.listenersImmediate:n.listeners;u||(u=new Set,s?n.listenersImmediate=u:n.listeners=u);const c={listener:e,track:l,noArgs:a};if(u.add(c),o){const m=Me(n);e({value:m,loading:!0,remote:!1,changes:[{path:[],pathTypes:[],prevAtPath:m,valueAtPath:m}],getPrevious:()=>{}})}let d;function h(m,g=e,E){if(!r?.has(m)){r||(r=new Set),r.add(E||n),g||(g=e);const v={trackingType:!0,...t};d=[...d||[],nr(m,g,v,r)]}}n.linkedToNode&&h(n.linkedToNode),(i=n.linkedFromNodes)==null||i.forEach(m=>h(m)),n.numListenersRecursive++;let p=n.parent,f=[n.key];for(;p;){if(p.linkedFromNodes)for(const m of p.linkedFromNodes)r?.has(m)||h(m,p1(m,f,e),p);p.numListenersRecursive++,f=[p.key,...f],p=p.parent}return()=>{u.delete(c),d?.forEach(g=>g());let m=n;for(;m;)m.numListenersRecursive--,m=m.parent}}function p1(n,e,t){let{valueAtPath:r}=ng(Me(n),e);return function({value:i,loading:o,remote:s}){const{valueAtPath:a}=ng(i,e);a!==r&&t({value:a,loading:o,remote:s,changes:[{path:[],pathTypes:[],prevAtPath:r,valueAtPath:a}],getPrevious:()=>r}),r=a}}function ng(n,e){let t=n;const r=[];for(let i=0;t&&i<e.length;i++)r.push(Je(t)?"array":"object"),t=t[e[i]];return{valueAtPath:t,pathTypes:r}}var Pa=0,rg=[],Ni={current:void 0};function wc(n,e){if(Pa){const t=Ni.current;if(t){t.nodes||(t.nodes=new Map);const r=t.nodes.get(n);r?(r.track=r.track||e,r.num++):t.nodes.set(n,{node:n,track:e,num:1})}}}function ig(n,e,t,r,i){let o,s=e;rg.push(Ni.current),Pa++,Ni.current={};const a=n&&Ho(n,t,r?.fromComputed),l=Ni.current.nodes;return--Pa<0&&(Pa=0),Ni.current=rg.pop(),t?.cancel||(o=function(u,c,d,h){let p=[];return u?.forEach(f=>{const{node:m,track:g}=f;p.push(nr(m,c,{trackingType:g,immediate:h,noArgs:d}))}),()=>{if(p){for(let f=0;f<p.length;f++)p[f]();p=void 0}}}(l,s,!1,r?.immediate)),{nodes:l,value:a,dispose:o,resubscribe:void 0}}function Vo(n,e,t){let r,i;Ee(e)?r=e:t=e;const o={num:0},s=function(){o.onCleanup&&(o.onCleanup(),o.onCleanup=void 0),Ma(),delete o.value,i?.();const{dispose:a,value:l,nodes:u}=ig(n,s,o,t);i=a,o.value=l,o.nodes=u,o.refresh=s,o.onCleanupReaction&&(o.onCleanupReaction(),o.onCleanupReaction=void 0),bi(),r&&(t?.fromComputed||(o.num>0||!function(c){var d;return c&&((d=c[Ti])==null?void 0:d.isEvent)}(n))&&(o.previous!==o.value||typeof o.value=="object"))&&r(o),o.previous=o.value,o.num++};return s(),()=>{var a,l;(a=o.onCleanup)==null||a.call(o),o.onCleanup=void 0,(l=o.onCleanupReaction)==null||l.call(o),o.onCleanupReaction=void 0,i?.()}}function og(n,e,t){if(St(n))return e?n.then(e):n;let r,i;return Vo(function(o){const s=Ho(n);if(!St(s))return!St(s)&&(t?function(a){return!(!a||(Tt(a)||Je(a))&&Oi(a))}(s):s)&&(r=s,o.cancel=!0),r;r=s},function(){i=e?.(r)}),St(r)?e?r.then(e):r:r!==void 0?e?i:Promise.resolve(r):new Promise(o=>{if(e){const s=e;e=a=>{const l=s(a);o(St(l)?l.then(u=>u):l)}}else e=o})}function sg(n,e){return og(n,e,!1)}function ag(n,e){return og(n,e,!0)}var lg=new Set(["copyWithin","fill","from","pop","push","reverse","shift","sort","splice","unshift"]),ug=new Set(["every","filter","find","findIndex","forEach","join","map","reduce","some"]),f1=new Set(["filter","find"]),Rc=new Map,Ba=new Map([["get",Ua],["set",_n],["peek",Ri],["onChange",nr],["assign",function(n,e){const t=Bt(n);if(Ma(),Kt(n.root._)&&(n.root._={}),Pt(e)){const r=Me(n);Pt(r)&&e.forEach((i,o)=>r.set(o,i))}else{n.isAssigning=(n.isAssigning||0)+1;try{Object.assign(t,e)}finally{n.isAssigning--}}return bi(),t}],["delete",function(n,e){e===void 0&&Da(n)&&(e=n.key,n=n.parent);const t=Me(n);Je(t)?cg(n,t,"splice",e,1):Ci(n,e??"_",Fo,-1)}],["toggle",function(n){const e=Me(n);(e==null||Hm(e))&&_n(n,!e)}]]);function cg(n,e,t,...r){var i;if(t!=="push"||r.length!==1){const o=e.slice(),s=e[t].apply(e,r);if(n){const a=Da(n),l=a?n.key:"_";(a?Me(n.parent):n.root)[l]=o,Ci((i=n.parent)!=null?i:n,l,e)}return s}Ci(n,e.length+"",r[0])}function dg(n,e,t){return e?void 0:n?t?Array.from(n.keys()):Object.keys(n):[]}function Dc(n,e,t){var r,i,o;if(Tt(e)&&e[Si]||Tt(t)&&t[Si]){const A=e!==t;return A&&(n.listeners||n.listenersImmediate)&&Yo(n,e,t,0),A}const s=Je(e);let a,l;const u=Pt(e),c=Pt(t),d=dg(e,s,u),h=dg(t,s,c),p=((r=d||e)==null?void 0:r.length)||0,f=((i=h||t)==null?void 0:i.length)||0;let m,g,E,v=!1;if(s&&Je(t)){if(t.length>0){const A=t[0];if(A!==void 0&&(m=Gm(A,n),m&&(g=Ee(m),a=new Map,l=[]),n.children))for(let _=0;_<t.length;_++){const y=t[_];if(y){const T=n.children.get(_+"");if(T&&(e[_]||hg(T,y),m)){const S=g?m(y):y[m];a.set(S,T)}}}}}else if(t&&(!e||Tt(e))){const A=h.length;for(let _=0;_<A;_++){const y=h[_];if(!d.includes(y)){v=!0;const T=an(n,y),S=c?t.get(y):t[y];S!==void 0&&hg(T,S)}}}if(e&&!Kt(e)){v=v||p!==f;const A=v;let _=!1;for(let y=0;y<p;y++){const T=s?y+"":d[y];let S=u?e.get(T):e[T];const b=c?t?.get(T):t?.[T];let O=!Km(S,b);if(O){const C=m&&S?g?m(S):S[m]:void 0,w=(o=n.children)==null?void 0:o.get(T);if(ke(S)){const F=ka(S);if(w?.linkedToNode===F){const $=Me(F);u?e.set(T,$):e[T]=$;continue}const x=S;S=()=>x}let I=an(n,T,S);if(I.lazy||!Ee(S)&&!ke(S)||(m1(I,S),Ir(I)),s&&C!==void 0){const F=C!==void 0?a?.get(C):void 0;if(F){if(F!==void 0&&F.key!==T){const x=t[F.key];A&&(I=F,n.children.delete(I.key),I.key=T,l.push([T,I])),_=!0,O=x!==S}}else v=!0}if(O)if(Ee(S)||ke(S))wi(n,T,S);else if(Kt(S))v=!0;else{const F=Dc(I,S,b);v=v||F,O=F}(O||s&&!A)&&(I.listeners||I.listenersImmediate)&&Yo(I,S,b,0,!A)}}if(l)for(let y=0;y<l.length;y++){const[T,S]=l[y];n.children.set(T,S)}E=v||_}else t!==void 0&&(E=!0);return E!=null&&E}function hg(n,e){var t,r;(t=n.linkedToNodeDispose)==null||t.call(n),(r=n.activatedObserveDispose)==null||r.call(n),Kt(e)||Dc(n,void 0,e),(n.listeners||n.listenersImmediate)&&Yo(n,void 0,e,0)}function Bt(n,e,t){return e!==void 0&&(n=an(n,e,t)),n.proxy||(n.proxy=new Proxy(n,pg))}function kc(){if(De.pendingNodes.size>0){const n=Array.from(De.pendingNodes.values());De.pendingNodes.clear(),n.forEach(e=>e())}}var pg={get(n,e,t){var r,i;if(e===i1)throw new Error("[legend-state] observable is not a primitive.");if(e===Ti)return n;if(e==="apply"){const d=Me(n);if(Ee(d))return d.apply}let o=Ir(n,e==="get"||e==="peek");const s=n.linkedToNode||o?.[Ti];if(s&&e!=="onChange")return pg.get(s,e,t);if(Pt(o)||o instanceof WeakMap||o instanceof Set||o instanceof WeakSet){const d=function(h,p,f){const m=f?.[p];if(p==="size")return Bt(h,p);if(Ee(m))return function(g,E,v){const A=arguments.length,_=f;if(p==="get"){if(A>0&&typeof g!="boolean"&&g!==Oc)return Bt(h,g)}else if(p==="set"){if(A===2){const T=_.get(g),S=_.set(g,E);return T!==E&&Fa(an(h,g),E,T),S}A===1&&Pt(f)&&_n(h,g)}else if(p==="delete"){if(A>0){const T=f.get?_.get(g):g,S=f.delete(g);return S&&Fa(an(h,g),void 0,T),S}}else{if(p==="clear"){const T=new Map(_),S=_.size;return _.clear(),void(S&&Fa(h,f,T))}if(p==="add"){const T=new Set(f),S=f.add(g);return f.has(p)||Yo(h,S,T,0),S}}const y=Ba.get(p);if(!y)return f[p](g,E);switch(A){case 0:return y(h);case 1:return y(h,g);case 2:return y(h,g,E);default:return y(h,g,E,v)}}}(n,e,o);if(d!==void 0)return d}const a=Ba.get(e);if(a)return e!=="get"&&e!=="peek"||kc(),function(d,h,p){switch(arguments.length){case 0:return a(n);case 1:return a(n,d);case 2:return a(n,d,h);default:return a(n,d,h,p)}};const l=Rc.get(e);if(l)return l.get(n);let u=o?.[e];if(Tt(o)&&o[Si])return u;const c=(r=n.functions)==null?void 0:r.get(e);if(c)return ke(c)?c:Bt(n,e,c);if(u=function(d,h){if(d){const p=Object.getOwnPropertyDescriptor(d,h);return p?.get&&(delete d[h],d[h]=p.set?function(f){Ee(f)&&(f={get:f});const m=function(){return{[Uo]:f}};return m.prototype[Uo]=f,m}({get:p.get,set:({value:f})=>p.set(f)}):p.get),d[h]}}(o,e),$m(o)&&u===void 0&&(lg.has(e)||ug.has(e))&&(o=[],An(n,o),u=o[e]),Ee(u)){if(Je(o)){if(lg.has(e))return(...h)=>cg(n,o,e,...h);if(ug.has(e))return wc(n,!0),function(h,p){const f=e==="reduce",m=f?(v,A,_,y)=>h(v,Bt(n,_+"",A),_,y):(v,A,_)=>h(Bt(n,A+"",v),A,_);if(f||!f1.has(e))return o[e](m,p);const g=e==="find",E=[];for(let v=0;v<o.length;v++)if(m(o[v],v,o)){const A=Bt(n,v+"");if(g)return A;E.push(A)}return g?void 0:E}}wi(n,e,u);const d=(i=n.functions)==null?void 0:i.get(e);return d?Bt(n,e,d):u.bind(o)}return Kt(u)&&Je(o)&&e==="length"?(wc(n,!0),u):Bt(n,e)},getPrototypeOf(n){const e=Me(n);return e!==null&&typeof e=="object"?Reflect.getPrototypeOf(e):null},ownKeys(n){Ir(n);const e=Ua(n,!0);if(Kt(e))return[];const t=e?Reflect.ownKeys(e):[];if(Je(e)&&t[t.length-1]==="length"&&t.splice(t.length-1,1),Ee(n)){const r=Reflect.ownKeys(n);["caller","arguments","prototype"].forEach(i=>r.includes(i)&&t.push(i))}return t},getOwnPropertyDescriptor(n,e){if(e==="caller"||e==="arguments"||e==="prototype")return{configurable:!1,enumerable:!1};const t=Me(n);return Kt(t)?void 0:Reflect.getOwnPropertyDescriptor(t,e)},set(n,e,t){if(n.isSetting)return Reflect.set(n,e,t);if(n.isAssigning)return Ci(n,e,t),!0;const r=Rc.get(e);return!!r&&(r.set(n,t),!0)},deleteProperty:(n,e)=>!!n.isSetting&&Reflect.deleteProperty(n,e),has(n,e){const t=Me(n);return Reflect.has(t,e)},apply:(n,e,t)=>(ke(e)&&(e=e.peek()),Reflect.apply(n.lazyFn||n,e,t))};function _n(n,e){n.parent?Ci(n.parent,n.key,e):Ci(n,"_",e)}function Ci(n,e,t,r){const i=!n.parent&&e==="_";!n.parent||Me(n)||Ee(t)||_n(n,{[e]:t});const o=i?n:an(n,e,t);if(ke(t))Lc(o,t);else{const{newValue:s,prevValue:a}=An(o,t),l=Kt(s)||s instanceof Date;Km(s,a)||Fa(n,s,a,o,l,i,r),l||(o.needsExtract=!0),wi(n,e,s)}}function Fa(n,e,t,r,i,o,s){r||(r=n),Ma(),i===void 0&&(i=Kt(e));let a=i,l=!1;(!i||t&&!Kt(t))&&(a=Dc(r,e,t),Je(e)&&(l=e?.length!==t?.length)),(i||!e||Oi(e)&&!Oi(t)?e!==t:a)&&Yo(i&&o?n:r,e,t,s??t===void 0?-1:a?0:1,l),bi()}function Ii(n,e,t){n.state||(n.state=Ic({isLoaded:!1},0,Ii,Bt)),e.then(r=>{t?t({value:r}):_n(n,r),n.state.assign({isLoaded:!0,error:void 0})}).catch(r=>{n.state.error.set(r)})}function wi(n,e,t){if(St(t)){const r=an(n,e);return Ii(r,t),void An(r,void 0)}if(ke(t)){const r=()=>t;Xm(n,e,r);const i=an(n,e,r);return An(i,Ri(ka(t))),Me(i)}if(typeof t=="function")return Xm(n,e,t),e}function Ua(n,e){return wc(n,e?Tt(e)?e.shallow:e:void 0),Ri(n)}function Ri(n){return Ir(n,!0)}var Ha=!1;function Ir(n,e){var t;if(Ha=!0,e&&((t=n.dirtyChildren)==null?void 0:t.size)){const i=Array.from(n.dirtyChildren);n.dirtyChildren.clear(),i.forEach(o=>o.dirtyFn&&Ir(o))}if(n.dirtyFn){const i=n.dirtyFn;n.dirtyFn=void 0,De.dirtyNodes.delete(n),i()}Ha=!1;let r=Me(n);return r=function(i,o,s){const a=o,l=i.lazy;if(l){const u=i.lazyFn;if(delete i.lazy,Ee(u))if(u.length===1)o={};else{if(i.parent){const c=Me(i.parent);c?delete c[i.key]:i.root._=void 0}o=function(c,d){let h,p,f,m=!0;const g=d;let E,v,A=[];function _(){c.dirtyFn=v,De.dirtyNodes.add(c)}return c.activatedObserveDispose=Vo(()=>{var y,T,S,b;if(m)m=!1,An(c,void 0);else if(!Ha&&v&&function(I,F){if(!Ha&&!function($){var k,M;let Y=$,L=$.numListenersRecursive>0;for(;Y&&!L;)((k=Y.listeners)!=null&&k.size||(M=Y.listenersImmediate)!=null&&M.size)&&(L=!0),Y=Y.parent;return L}(I)){F&&(I.dirtyFn=F);let $=I;for(;$;)$.dirtyChildren||($.dirtyChildren=new Set),$.dirtyChildren.add(I),$=$.parent;return!0}}(c,v))return void(f=!0);let O=g(),C=!1;ke(O)&&(C=!0,O=Lc(c,O)),Ee(O)&&(O=O());const w=ke(O)||O==null?void 0:O[Uo];if(w&&(c.activationState=w,O=void 0),f=!1,p=St(O),c.activated){if(c.activationState){const I=c.activationState;(T=(y=c.state)==null?void 0:y.peek())!=null&&T.sync?(c.state.sync(),f=!0):O=(b=(S=I.get)==null?void 0:S.call(I))!=null?b:I.initial}}else{c.activated=!0;let I=g1;w?.synced&&(I=De.activateSyncedNode,f=!0);const F=I(c,O);h=F.update;let x=F.value;!C&&ke(x)&&(x=Lc(c,x)),O=x??w?.initial}return p=p||St(O),O},y=>{const{value:T,nodes:S,refresh:b}=y;if(v=b,!f){if(!p||!De.isLoadingRemote)if(p)if(c.activationState){const{initial:O}=c.activationState;T&&St(T)&&Ii(c,T,h),Ee(Me(c))&&An(c,O??void 0)}else c.activated&&(Ii(c,T,h),Ee(Me(c))&&An(c,void 0));else E=T,c.state.isLoaded.peek()?(c.isComputing=!0,_n(c,T),c.isComputing=!1):(An(c,T),c.state.assign({isLoaded:!0,error:void 0}));A.forEach(O=>O()),A=[],S?.forEach(({node:O,track:C})=>{A.push(nr(O,_,{immediate:!0,trackingType:C}))})}y.cancel=!0},{fromComputed:!0}),E}(i,u)}else ke(o)&&(o=wi(i.parent,i.key,o))}return!l&&!i.needsExtract||ke(o)||Kt(o)||(s&&function(u,c){if((Tt(u)||Je(u))&&!u[Si]){const d=[];fg(u,d,()=>{var p;let f=c;for(let m=0;m<d.length;m++){const{key:g}=d[m],E=(p=Me(f))==null?void 0:p[g];f=an(f,g,Ee(E)?E:void 0),Ir(f)}return f})}}(o,i),i.parent&&wi(i.parent,i.key,a)),o}(n,r,!!e),r}function m1(n,e){var t,r;(t=n.activatedObserveDispose)==null||t.call(n),(r=n.linkedToNodeDispose)==null||r.call(n),n.activatedObserveDispose=n.linkedToNodeDispose=n.linkedToNode=void 0,n.lazyFn=e,n.lazy=!0}function g1(n,e){if(n.state||(n.state=Ic({isLoaded:!1},0,Ii,Bt)),n.activationState){const{set:t,get:r,initial:i}=n.activationState;if((e=r?.())!=null&&e!==null||(e=i),t){let o,s=[],a=0;const l=u=>{if(s.length>0){let c,d,h,p=!1,f=!1;u?(c=u.changes,d=u.value,p=u.loading,f=u.remote,h=u.getPrevious):(c=s,d=o,h=Cc(d,c)),s=[],o=void 0,De.pendingNodes.delete(n),a++;const m=a,g=()=>{m===a&&(n.isComputing=!0,t({value:d,changes:c,loading:p,remote:f,getPrevious:h}),n.isComputing=!1)};ag(n.state.isLoaded,g)}};nr(n,({value:u,changes:c})=>{n.isComputing||(c.length>1||!Ee(c[0].prevAtPath))&&(o=u,s.length>0&&(c=c.filter(d=>!Qm(s[0].path,d.path))),s.push(...c),De.pendingNodes.set(n,l))},{immediate:!0}),nr(n,l)}}return{update:({value:t})=>{n.isComputing||(n.isComputing=!0,_n(n,t),n.isComputing=!1)},value:e}}function Lc(n,e){var t;const r=ka(e);return r!==n&&r?.linkedToNode!==n&&(n.linkedToNode=r,r.linkedFromNodes||(r.linkedFromNodes=new Set),r.linkedFromNodes.add(n),(t=n.linkedToNodeDispose)==null||t.call(n),n.linkedToNodeDispose=nr(r,()=>{e=Ir(r),_n(n,e)},{initial:!0},new Set([n]))),e}function fg(n,e,t){var r;if((Tt(n)||Je(n))&&!n[Si]){for(const i in n)if(Um.call(n,i)){const o=n[i];if(ke(o)){const s=t();wi(s,i,o),delete s.lazy}else{const s=Ee(o)&&((r=o.prototype)==null?void 0:r[Uo]);if(s){const a=s.activate;(!a||a==="auto")&&Ri(an(t(),i,o))}}typeof o=="object"&&(e.push({key:i,value:o}),fg(o,e,t),e.pop())}}}var mg=["get","set","peek","onChange","toggle"];function wr(n){this._node=n;for(let e=0;e<mg.length;e++){const t=mg[e];this[t]=this[t].bind(this)}}function $a(n,e){wr.prototype[n]=function(...t){return e.call(this,this._node,...t)}}function Ue(n){return Ic(n,0,Ii,Bt,wr)}function E1(n,e,t){const r=function(i,o){const{backoff:s,delay:a=1e3,infinite:l,times:u=3,maxDelay:c=3e4}=i;return l||o<u?Math.min(a*(s==="constant"?1:2**o),c):null}(n,e);if(r)return setTimeout(t,r)}$a("peek",n=>(kc(),Ri(n))),$a("get",(n,e)=>(kc(),Ua(n,e))),$a("set",_n),$a("onChange",nr),Object.defineProperty(wr.prototype,Ti,{configurable:!0,get(){return this._node}}),wr.prototype.toggle=function(){const n=this.peek();(n==null||Hm(n))&&this.set(!n)},wr.prototype.delete=function(){return this.set(void 0),this};var gg={createPreviousHandler:Cc,clone:Vm,ensureNodeValue:Tc,findIDKey:Gm,get:Ua,getNode:ka,getNodeValue:Me,getPathType:jm,getProxy:Bt,getValueAtPath:function(n,e){return e.reduce(l1,n)},globalState:De,initializePathType:Zm,observableFns:Ba,optimized:Oc,peek:Ri,runWithRetry:function(n,e,t){const{waitFor:r}=n.activationState,{retry:i}=e,o={cancel:!1};let s;if(s=r?ag(r,()=>(n.activationState.waitFor=void 0,t(o))):t(o),St(s)&&i){let a;return new Promise(l=>{const u=()=>{s.then(c=>{n.activationState.persistedRetry=!1,l(c)}).catch(()=>{e.attemptNum++,a&&clearTimeout(a),o.cancel||(a=E1(i,e.attemptNum,()=>{s=t(o),u()}))}).finally(()=>{n.activationState.persistedRetry=!1})};u()})}return s},safeParse:zm,safeStringify:Ym,set:_n,setAtPath:Jm,setNodeValue:An,symbolLinked:Uo,symbolDelete:Fo,tracking:Ni},Eg={exports:{}},vg={},Di=XT(Ju),v1=typeof Object.is=="function"?Object.is:function(n,e){return n===e&&(n!==0||1/n==1/e)||n!=n&&e!=e},A1=Di.useState,_1=Di.useEffect,y1=Di.useLayoutEffect,O1=Di.useDebugValue;function xc(n){var e=n.getSnapshot;n=n.value;try{var t=e();return!v1(n,t)}catch{return!0}}var T1=typeof window>"u"||window.document===void 0||window.document.createElement===void 0?function(n,e){return e()}:function(n,e){var t=e(),r=A1({inst:{value:t,getSnapshot:e}}),i=r[0].inst,o=r[1];return y1(function(){i.value=t,i.getSnapshot=e,xc(i)&&o({inst:i})},[n,t,e]),_1(function(){return xc(i)&&o({inst:i}),n(function(){xc(i)&&o({inst:i})})},[n]),O1(t),t};vg.useSyncExternalStore=Di.useSyncExternalStore!==void 0?Di.useSyncExternalStore:T1,Eg.exports=vg;var S1=Eg.exports,Mc={inObserver:!1},Ag=void 0;function ye(n,e){if(Mc.inObserver&&ke(n)&&!e?.suspense)return Ho(n);let t;try{const r=qe(Ag||(Ag=kt(null))),i=ce(()=>function(l,u){let c,d,h,p,f,m=0;const g=()=>{d?.();const{value:v,dispose:A,resubscribe:_}=ig(h,E,void 0,void 0);return d=A,v},E=({value:v})=>{if(u?.peek()){const A=f;f=v,A===void 0&&sg(()=>!u.get(),()=>{const _=f;f=void 0,E({value:_})})}else{let A=l?.skipCheck;if(!A){const _=g();(_!==p||!Kt(_)&&_===v)&&(A=!0)}A&&(m++,c?.())}};return{subscribe:v=>(c=v,()=>{d?.(),d=void 0}),getVersion:()=>m,run:v=>(h=v,p=g())}}(e,r),[]),{subscribe:o,getVersion:s,run:a}=i;t=a(n),S1.useSyncExternalStore(o,s,s)}catch(r){throw r}if(e?.suspense){const r=St(t);if(St(t)||!t&&ke(n)){const i=r?t:sg(n);if(!Ce.use)throw i;Ce.use(i)}}return t}var _g=typeof Symbol=="function"&&Symbol.for;function yg(n,e,t,r){const i=_g?Symbol.for("react.forward_ref"):Q(h=>null).$$typeof,o=_g?Symbol.for("react.memo"):mi(h=>null).$$typeof;if(n.__legend_proxied)return n;let s=!1,a=!1,l=n;o&&l.$$typeof===o&&l.type&&(a=!0,l=l.type),i&&l.$$typeof===i&&(s=!0,l=l.render);const u={apply(h,p,f){if(t){const m=f[0],g={},E=Object.keys(m);for(let v=0;v<E.length;v++){const A=E[v],_=m[A];if(A==="children"&&(Ee(_)||ke(_)))m[A]=ye(_,{skipCheck:!0});else if(A.startsWith("$")||A.endsWith("$")){const y=A.endsWith("$")?A.slice(0,-1):A.slice(1),T=r?.[y],S=T&&ke(_);if(g[y]=S&&T?.selector?T.selector(g,_):ye(_),S&&(T.defaultValue!==void 0&&g[y]===void 0&&(g[y]=T.defaultValue),T.handler&&T.getValue)){const b=O=>{var C;_.set(T.getValue(O)),(C=m[T.handler])==null||C.call(m,O)};g[T.handler]=oe(b,[m[T.handler],r])}delete g[A]}else g[A]===void 0&&(g[A]=_)}f[0]=g}return e?ye(()=>{Mc.inObserver=!0;try{return Reflect.apply(h,p,f)}finally{Mc.inObserver=!1}},{skipCheck:!0}):Reflect.apply(h,p,f)}},c=new Proxy(l,u);let d;return s?(d=Q(c),d.__legend_proxied=!0):d=c,e||a?mi(d):d}var{findIDKey:b1,getNode:N1,optimized:C1}=gg,Og=new Map;function Pc({each:n,optimized:e,item:t,itemProps:r,sortValues:i,children:o}){var s;if(!n)return null;const a=ye(()=>n.get(!e||C1));if(!t&&o){const u=W();u.current=o,t=ce(()=>{return c=({item$:d,id:h})=>u.current(d,h),yg(c,!0);var c},[])}else if(t.$$typeof!==Symbol.for("react.memo")){let u=Og.get(t);u||(u=mi(t),Og.set(t,u)),t=u}if(!a)return null;const l=[];if(Je(a)){const u=a[0],c=N1(n),d=a.length,h=d>0?c&&b1(u,c)||(u.id!==void 0?"id":u.key!==void 0?"key":void 0):void 0,p=Ee(h);for(let f=0;f<d;f++)if(a[f]){const m=a[f],g=(s=p?h(m):m[h])!=null?s:f,E=n[f],v={key:g,id:g,item$:E,item:E};l.push(ae(t,r?Object.assign(v,r):v))}}else{const u=Pt(a),c=u?Array.from(a.keys()):Object.keys(a);i&&c.sort((d,h)=>i(u?a.get(d):a[d],u?a.get(h):a[h],d,h));for(let d=0;d<c.length;d++){const h=c[d];if(u?a.get(h):a[h]){const p=u?n.get(h):n[h],f={key:h,id:h,item$:p,item:p};l.push(ae(t,r?Object.assign(f,r):f))}}}return l}mi(function({children:n}){return ye(()=>Ho(Ho(n)),{skipCheck:!0})},()=>!0);var I1=new Map,w1=new Map;function rr(n,e){var t;const r=W({});if(r.current.value=n,!((t=r.current)!=null&&t.obs$)){const i=n;r.current.obs$=Ue(i)}return r.current.obs$}new Proxy({},{get(n,e){if(!n[e]){const i=I1.get(e)||e,o=Q((s,a)=>{const l={...s};return!a||!Ee(a)&&Oi(a)||(l.ref=a),ae(i,l)});n[e]=(t=o,r=w1.get(e),yg(t,!1,!0,r))}var t,r;return n[e]}});var R1=function(n){return((e,t)=>{V(e,t)})(()=>{const e=n();if(!St(e))return e},[])};function ki(n,e,t){let r;Ee(e)?r=e:t=e;const i=W({selector:n});i.current={selector:n,reaction:r},R1(()=>Vo(o=>{const{selector:s}=i.current;return Ee(s)?s(o):s},o=>{var s,a;return(a=(s=i.current).reaction)==null?void 0:a.call(s,o)},t))}const D1=Symbol("no_render");function Ft(n){const e=rr(!1),t=W({_value:typeof n=="function"?n():n.peek(),get value(){return e.set(!0),t.current._value},set value(r){t.current._value=r}});return ye(()=>{if(!e.get())return D1;const r=typeof n=="function"?n():n.get();return t.current.value=r,r}),t.current}function Li(){const n=Bo(),e=Re(),t=yi(),r=sn(),i=Ft(e.app$.appMetadata),o=Ft(e.currentUser$),s=Ft(e.state$.currentConversation),a=Ft(e.t$),l=Ft(e.device$),u=Ft(e.themeCustom$),c=Ft(()=>e.state$.typing.child(e.state$.extCurrentConversationId.get()).get()),d=Ft(()=>e.state$.participants.child(e.state$.extCurrentConversationId.get()).get());return ce(()=>({session:n,store:e,chatbox:t,theme:r,get app(){return i.value},get currentUser(){return o.value},get conversation(){return s.value},get t(){return a.value},get device(){return l.value},get themeCustom(){return u.value.value},get typing(){return c.value},get participants(){return d.value}}),[i,t,s,o,l,e,a,r,u,c,d,n])}function Tg(){const n=Bo(),e=Re(),t=sn(),r=yi(),i=Ft(e.app$.appMetadata),o=Ft(e.currentUser$),s=Ft(e.t$),a=Ft(e.device$),l=Ft(e.themeCustom$);return ce(()=>({session:n,store:e,theme:t,conversationList:r,get app(){return i.value},get currentUser(){return o.value},get t(){return s.value},get device(){return a.value},get themeCustom(){return l.value.value}}),[i,r,o,a,n,e,s,t,l])}class ja{constructor(e={}){this._handlers=new Set,this._meta=e}meta(e){return new ja(e)}_emit(e,t){for(const r of this._handlers)r({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 Bc=new ja,Un=new ja,B={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:n=>`${n} 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:(n,e)=>`Replying to ${n}: ${e}`,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"}},k1={code:"ar",name:"Arabic",translation:{YESTERDAY:"الأمس",TODAY:"اليوم",DAYS:"يوم",HOURS:"ساعة",MINUTES:"دقيقة",JUST_NOW:"فقط الآن",LOCATION:"الموقع",CANCEL:"إلغاء",INBOX:"علبة الوارد",DESKTOP_NOTIFICATIONS:"إشعارات المتصفح",DESKTOP_NOTIFICATIONS_ERROR:"لا يمكن تمكين إشعارات المتصفح لأن متصفحك يمنعها بشكل نشط. جرّب البحث في الإعدادات أو استخدام متصفح آخر.",DESKTOP_NOTIFICATIONS_DEMO_TITLE:n=>`إعلام ${n} التجريبي`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},L1={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:n=>`${n} демо известие`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},x1={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},M1={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:n=>`Notificació de demostració de ${n}`,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:(n,e)=>`Responent a ${n}: ${e}`,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"}},P1={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},B1={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},F1={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},U1={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:n=>`${n} Δοκιμαστική επίδειξη`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},H1={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},$1={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},j1={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:n=>`نوتیفیکیشن دمو ${n}`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},Y1={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},z1={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:n=>`Notification de démonstration ${n}`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},V1={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:n=>`${n} הודעה על הדגמה`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},W1={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:n=>`${n} डेमो अधिसूचना`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},G1={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},X1={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},K1={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:n=>`pemberitahuan demo ${n}`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},q1={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:n=>`${n} 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:(n,e)=>`Svara ${n}: ${e}`,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"}},J1={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},Z1={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:n=>`${n} デモ通知`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},Q1={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:n=>`${n} შეტყობინებების დემო ვერსია`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},eb={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:n=>`${n} 데모 알림`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},tb={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},nb={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},rb={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},ib={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},ob={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:n=>`Notificare de debit ${n}`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},sb={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:n=>`${n} демо-оповещение`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},ab={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},lb={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:n=>`${n} 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:(n,e)=>`Odgovarate korisniku ${n}: ${e}`,REPLY_MODE_LEAVE_ARIA_LABEL:"Izađi iz moda pisanja odgovora",STATUS_INDICATOR_ONLINE:"Aktivan",STATUS_INDICATOR_OFFLINE:"Neaktivan"}},ub={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},cb={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},db={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:n=>`Демо-повідомлення про ${n}`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},hb={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:n=>`${n} 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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},pb={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:n=>`${n} 演示提醒`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},fb={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:n=>`${n} 演示通知`,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:B.translation.REPLY_TO_ARIA_LABEL,REPLY_MODE_LEAVE_ARIA_LABEL:B.translation.REPLY_MODE_LEAVE_ARIA_LABEL,STATUS_INDICATOR_ONLINE:B.translation.STATUS_INDICATOR_ONLINE,STATUS_INDICATOR_OFFLINE:B.translation.STATUS_INDICATOR_OFFLINE}},Sg={ar:k1,bg:L1,bs:x1,ca:M1,cs:P1,da:B1,de:F1,el:U1,en:B,es:H1,et:$1,fa:j1,fi:Y1,fr:z1,he:V1,hi:W1,hr:G1,hu:X1,id:K1,is:q1,it:J1,ja:Z1,ka:Q1,ko:eb,nb:tb,nl:nb,pl:rb,pt:ib,ro:ob,ru:sb,sq:ab,sr:lb,sv:ub,tr:cb,uk:db,vi:hb,zh:pb,zhTw:fb};function bg(n){const e=n.replace(/_/g,"-").toLowerCase(),t=Sg[e];if(t)return{...t.translation,locale:e};const r=e.slice(0,2),i=Sg[r];return i?{...i.translation,locale:r}:(Un.warn(`User locale '${n}' not supported; falling back to English.`),{...B.translation,locale:"en-US"})}const Ng=()=>{const n=document.createElement("canvas");n.width=n.height=1;const e=n.getContext("2d");return e.textBaseline="top",e.font='100px "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Twemoji Mozilla","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',e.scale(.01,.01),e},Cg=(n,e)=>{const t=Ng();return t.fillStyle=e,t.fillText(n,0,0),t.getImageData(0,0,1,1).data};function mb(n){const e=Cg(n,"#000"),t=Cg(n,"#fff"),r=(i=>!i.includes("‍")||Ng().measureText(i).width<160)(n);return e&&t&&r&&((i,o)=>{const s=[...i].join(",");return s===[...o].join(",")&&!s.startsWith("0,0,0,")})(e,t)}function Ig(n){try{return mb(n)}catch{return!0}}const wg=function(){if(typeof window>"u"||window.E2E)return 16;const n={"🫩":16,"🚶‍➡️":15.1,"🫨":15,"🫠":14,"😵‍💫":13.1,"🥲":13,"🧑‍🦰":12.1,"🥻":12,"🥰":11,"🤩":5,"👱‍♀️":4,"🤣":3,"👁️‍🗨️":2,"😀":1,"😐️":.7,"😃":.6};for(const[e,t]of Object.entries(n))if(Ig(e))return t}();class Rg{constructor(){this.currentUser$=Ue(null),this.app$=Ue(null),this.appId$=Ue(null),this.extUserId$=Ue(null),this.authTokenState$=Ue("idle"),this.themeCustom$=Ue(qm({value:void 0})),this.device$=Ue({supportsEmojiPicker:!!wg,isMobile:typeof window<"u"&&/Mobi/i.test(window.navigator.userAgent)}),this.errors$=Ue({unknownConversation:!1,unknownUser:!1,wrongAppId:!1,serverError:!1}),this.t$=Ue(()=>{const e=this.extUserId$.get(),t=this.app$.appMetadata.defaultLocale.get(),r=this.currentUser$.locale.get();return bg((e&&r)??t??"en-US")})}resetState(e,t){zo(()=>{this.extUserId$.set(t),this.appId$.set(e),this.currentUser$.set(null)})}updateThemeCustom(e){this.themeCustom$.set(qm({value:e}))}listenForErrors(e,t){this.errors$.assign({unknownConversation:!1,unknownUser:!1,wrongAppId:!1,serverError:!1});const r=e.onError(s=>{Un.error(s.message),this.errors$.serverError.set(!0)}),i=e.currentUser.subscribe(s=>{this.errors$.unknownUser.set(s===null)}),o=t&&e.conversation(t).subscribe(s=>{this.errors$.unknownConversation.set(s===null)});return()=>{r.unsubscribe(),i.unsubscribe(),o?.unsubscribe()}}listenForAuthChanges(e,t){let r=!0;this.authTokenState$.peek()!=="loading"&&this.authTokenState$.set("loading"),e._authProvider.getToken().then(()=>{r&&this.authTokenState$.set("valid")});const i=e._authProvider.onTokenRefreshFailed(()=>{r&&this.authTokenState$.set(t?"invalid":"expired")});return()=>{r=!1,i()}}listenForUserAndAppChanges(e,t){let r=!0,i=null;const o=e.currentUser.subscribe(async s=>{if(r&&s&&(this.currentUser$.set(s),s.role!==i)){i=s.role;const a=await t.getApp(s.role);if(!r)return;this.app$.set(a)}});return()=>{r=!1,o.unsubscribe()}}}const gb={canReplyToMessage:!1,canEditMessage:!1,canDeleteMessage:!1,canAddReaction:!1};class Dg extends Rg{constructor(){super(),this.messageSubscription=null,this.readyForNewMessagesPromise=Promise.resolve(),this.participantSubscription=null,this.onlineSubscriptions={},this.state$=Ue({extCurrentConversationId:null,editor:{isEmpty:!0,isTyping:!1,atTextLimit:!1,characterCount:0,showEmojiPicker:!1,suggestEmojiQuery:void 0,suggestMentionQuery:void 0},referencedMessageId:null,editingMessageId:null,currentConversation:null,visibility:{isInView:!1,tabFocused:!0},messages:{},participants:{},typing:{},isUserConnected:{},ephemeralMessages:{},ephemeralMessageIdMapping:{},localFileBlobUrls:{},userPermissions:()=>{const e=this.app$.role.general.get(),t=this.app$.role.permissions.get();return Ie.defined(e),Ie.defined(t),{showTypingIndicator:e.showTypingIndicators,canShareFile:e.enableFileTransfers,canShareLocation:e.enableLocation,canMention:e.enableMentions,showOnlineStatus:e.enablePresence!==!1,canSendVoiceMessage:e.enableVoiceRecording,canLeaveConversation:t.conversations.leave==="all",canMarkConversationAsUnread:t.conversations.markAsUnread==="all"}},messagePermissions:()=>{const e=this.app$.role.permissions.get();Ie.defined(e);const t=this.state$.userPermissions.get(),r={...gb,...t},i={canReplyToMessage:ir(e.messages.reply,!0),canEditMessage:ir(e.messages.edit,!0),canDeleteMessage:ir(e.messages.delete,!0),canAddReaction:ir(e.messages.emojiReactions,!0),...t},o={...i,canEditMessage:!1},s={canReplyToMessage:ir(e.messages.reply,!1),canEditMessage:ir(e.messages.edit,!1),canDeleteMessage:ir(e.messages.delete,!1),canAddReaction:ir(e.messages.emojiReactions,!1),...t};return{system:r,own:i,ownWithoutEditing:o,other:s,otherWithoutEditing:{...s,canEditMessage:!1}}}}),this.locale$=Ue(()=>{const e=this.extUserId$.get(),t=this.app$.appMetadata.defaultLocale.get(),r=this.currentUser$.locale.get();return(e&&r)??t??"en-US"}),this.t$=Ue(()=>bg(this.locale$.get())),this.referencedMessage$=Ue(()=>{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$=Ue(()=>{const e=this.state$.extCurrentConversationId.get();if(!e)return[];const t=this.state$.currentConversation.readUntil.get(),r=this.state$.messages.child(e).state.get()??[],i=Object.values(this.state$.ephemeralMessages.child(e).get()??{}),o=i.length===0?r:i.concat(r).sort((d,h)=>h.createdAt-d.createdAt),s=o.map(d=>{const h=d.content[0],p=h?.type;if(!h||p!=="file")return d;const f=h.size+","+h.filename,m=this.state$.localFileBlobUrls.child(e).child(f).url.get();return m?{...d,content:[{...h,url:m}]}:d});let a=null,l=0,u=!1;const c=[];for(const d of s){const h=new Date(d.createdAt),p=new Date(h).setHours(0,0,0,0),f=l&&p!==l,m=h.getTime()>t,g=!(!u||m||a?.id.startsWith("ephemeral"));(g||f)&&c.push(new Fc({id:"border-before-"+d.id,isDayMarker:!!f,isReadMarker:!!g,timestamp:f?l:void 0})),c.push(d),u=m,l=p,a=d}return function(d,h){const p=[];let f=[];const m=Symbol("NO_KEY");let g=m;for(const E of d){const v=h(E);g===m||g===v?f.push(E):(p.push(f),f=[E]),g=v}return f.length!==0&&p.push(f),p}(c,d=>d instanceof Fc?d.id:d.sender?.id).map(d=>(d.id=d.map(h=>h.id).join(","),d))}),this.mentionableUsers$=Ue(()=>{const e=this.state$.extCurrentConversationId.get(),t=this.extUserId$.get();if(!e||!t)return[];const r=this.state$.participants.child(e).get();if(!r||r.length===0)return[];const i=r.map(o=>o.user);return i.sort((o,s)=>o.name.localeCompare(s.name)),function(o,s){const a=s.findIndex(l=>l.id===o);if(a>-1){const l=s[a];s.splice(a,1),s.push(l)}return s}(t,i)})}resetState(e,t,r){zo(()=>{super.resetState(e,t),this.state$.assign({referencedMessageId:null,extCurrentConversationId:r??null,currentConversation:null})})}storeTyping(e,t){this.state$.typing.child(e).set(t)}messagePermissions$(e){const t=this.currentUser$.get();if(!t)throw new Error("Unreachable");const r=e.content[0];return e.sender?t.id===e.sender.id?r.type==="text"?this.state$.messagePermissions.own:this.state$.messagePermissions.ownWithoutEditing:r.type==="text"?this.state$.messagePermissions.other:this.state$.messagePermissions.otherWithoutEditing:this.state$.messagePermissions.system}storeMessages(e,t,r){zo(()=>{const i=t.reduce((l,u)=>(l[u.id]=u,l),{}),o=this.state$.extCurrentConversationId.peek(),s=this.extUserId$.peek();Ie(s&&o),this.state$.messages.child(e).set({state:t,lookup:i,loadedAll:r});const a=this.state$.ephemeralMessages.child(e);for(const l of t){const u=this.state$.ephemeralMessageIdMapping.child(e).child(l.id).peek();u&&a.child(u).delete();const c=l.content[0];if(l.sender?.id!==s||c.type!=="file")continue;const d=c.size+","+c.filename,h=this.state$.localFileBlobUrls.child(o).child(d);if(h.fetching.peek()!==!1)continue;const p=()=>h.delete();if(c.subtype==="image"){h.fetching.set(!0);const f=document.createElement("img");f.addEventListener("load",p,{once:!0}),f.src=c.url}else if(c.subtype==="video"){h.fetching.set(!0);const f=document.createElement("video");f.addEventListener("loaddata",p,{once:!0}),f.src=c.url}else if(c.subtype==="audio"){h.fetching.set(!0);const f=document.createElement("audio");f.addEventListener("loaddata",p,{once:!0}),f.src=c.url}}})}}function ir(n,e){return n==="all"||n==="own"&&e||n==="other"&&!e}class Fc{constructor({id:e,isDayMarker:t,isReadMarker:r,timestamp:i}){this.id=e,this.isDayMarker=t,this.isReadMarker=r,this.timestamp=t?i:void 0}}function Ya(n){return N(Re()instanceof Dg?Eb:vb,{...n})}function Eb(n){const e=sn(),t=Li();return N(e.Icon,{common:t,...n})}function vb(n){const e=sn(),t=Tg();return N(e.Icon,{common:t,...n})}function Uc({src:n,onError:e,filename:t,className:r=""}){const i=W(null),o=W(),s=W(),[a,l]=ne(!1),[u,c]=ne(0),[d,h]=ne(1),p=W(),[f,m]=ne(!1);V(()=>{o.current=new Audio;const v={normalize:!0,height:50,container:i.current};function A(){const T=o.current;T&&(T.error.message==="PIPELINE_ERROR_READ: FFmpegDemuxer: demuxer seek failed"?(T.load(),l(!1)):(m(!0),l(!1),e?.()))}const _=t.slice(t.lastIndexOf(".")+1);if(function(T){return/(?:^|\/)talkjs_audio_message_[0-9]+_([0-9]+)[.](?:mp3|webm)$/.test(T)}(t)&&_==="webm"&&!o.current.canPlayType("audio/webm;codecs=opus"))v.backend="WebAudio",s.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"),s.current.controls=!1;else{const T=o.current;T.addEventListener("error",A),T.src=n,T.preload="auto",T.preservesPitch=!0,v.media=T}p.current=function(T){if(!T.container)return;const S=getComputedStyle(T.container);let b=Cm(S.color);return b||(b=Cm("rgb(255,255,255)")),vc.create({...T,barGap:T.barGap??2,barRadius:T.barRadius??0,barWidth:T.barWidth??2,barHeight:T.barHeight,hideScrollbar:!0,cursorWidth:T.cursorWidth??0,cursorColor:T.cursorColor,height:T.height??24,progressColor:T.progressColor??b.cssa(),waveColor:T.waveColor??b.alpha(b.alpha()/2).cssa()})}(v);const y=p.current;return y.on("finish",()=>{o.current.loop=!0,l(!1)}),y.on("ready",T=>c(Math.trunc(T))),y.on("timeupdate",T=>c(Math.trunc(T))),v.backend==="WebAudio"&&y.load(n).catch(()=>{m(!0),l(!1),e?.()}),()=>{o.current?.removeEventListener("error",A),o.current=void 0,y.destroy(),p.current=void 0}},[n,t,e]);const g=oe(()=>{if(p.current.options.backend==="WebAudio")p.current.isPlaying()||s.current.play(),p.current.playPause(),l(p.current.isPlaying()??!1);else{const v=o.current;v.paused?v.play():v.pause(),v.loop=!1,!v.paused&&v.ended&&(v.load(),v.play()),l(!v.paused)}},[]),E=oe(v=>{p.current.setPlaybackRate(v),h(v)},[]);return N("div",f?{}:{className:`t-audio-player ${r}`,children:[N("button",{onClick:g,children:N(Ya,{className:"t-play-pause-icon",type:a?"pause":"play","aria-label":a?"pause audio":"play audio"})}),N("div",{className:"t-waveform",ref:i}),N("div",{className:"t-duration",children:Hy(u)}),N(US,{as:"div",children:({isExpanded:v})=>N(xe,{children:[N(HS,{className:"t-playback-speed","aria-label":"set playback speed",children:[d,"x",N(Ya,{type:"updown","aria-hidden":!0,className:"t-up-down-icon"})]}),v&&N(zS,{children:N(YS,{className:"t-action-menu",children:[N("div",{className:"t-playback-heading",children:"Playback Speed"}),[.25,.5,.75,1,1.25,1.5,2].map((A,_)=>N(jS,{onSelect:()=>E(A),children:[N("span",{className:"t-playback-checkmark",children:d==A?"✓":""}),A,"x"]},_))]})})]})})]})}function nt(n){this.content=n}function kg(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i!=o){if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=kg(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}else t+=i.nodeSize}}function Lg(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),a=e.child(--o),l=s.nodeSize;if(s!=a){if(!s.sameMarkup(a))return{a:t,b:r};if(s.isText&&s.text!=a.text){let u=0,c=Math.min(s.text.length,a.text.length);for(;u<c&&s.text[s.text.length-u-1]==a.text[a.text.length-u-1];)u++,t--,r--;return{a:t,b:r}}if(s.content.size||a.content.size){let u=Lg(s.content,a.content,t-1,r-1);if(u)return u}t-=l,r-=l}else t-=l,r-=l}}nt.prototype={constructor:nt,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),o=r.content.slice();return i==-1?o.push(t||n,e):(o[i+1]=e,t&&(o[i]=t)),new nt(o)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new nt(t)},addToStart:function(n,e){return new nt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new nt(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),o=r.find(n);return i.splice(o==-1?i.length:o,0,e,t),new nt(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return(n=nt.from(n)).size?new nt(n.content.concat(this.subtract(n).content)):this},append:function(n){return(n=nt.from(n)).size?new nt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=nt.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},nt.from=function(n){if(n instanceof nt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new nt(e)};class q{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,o){for(let s=0,a=0;a<t;s++){let l=this.content[s],u=a+l.nodeSize;if(u>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,e-c),Math.min(l.content.size,t-c),r,i+c)}a=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(a,l)=>{let u=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=u},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);o<e.content.length;o++)i.push(e.content[o]);return new q(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let o=0,s=0;s<t;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>t)&&(a=a.isText?a.cut(Math.max(0,e-s),Math.min(a.text.length,t-s)):a.cut(Math.max(0,e-s-1),Math.min(a.content.size,t-s-1))),r.push(a),i+=a.nodeSize),s=l}return new q(r,i)}cutByIndex(e,t){return e==t?q.empty:e==0&&t==this.content.length?this:new q(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new q(i,o)}addToStart(e){return new q([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new q(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,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return kg(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Lg(this,e,t,r)}findIndex(e,t=-1){if(e==0)return za(0,e);if(e==this.size)return za(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=i+this.child(r).nodeSize;if(o>=e)return o==e||t>0?za(r+1,o):za(r,i);i=o}}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 q.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new q(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return q.empty;let t,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(t||(t=e.slice(0,i)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new q(t||e,r)}static from(e){if(!e)return q.empty;if(e instanceof q)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new q([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}q.empty=new q([],0);const Hc={index:0,offset:0};function za(n,e){return Hc.index=n,Hc.offset=e,Hc}function Va(n,e){if(n===e)return!0;if(!n||typeof n!="object"||!e||typeof e!="object")return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Va(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Va(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}class Oe{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||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&&Va(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 r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return Oe.none;if(e instanceof Oe)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}}Oe.none=[];class xi extends Error{}class G{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Mg(this.content,e+this.openStart,t);return r&&new G(r,this.openStart,this.openEnd)}removeBetween(e,t){return new G(xg(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 G.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new G(q.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new G(e,r,i)}}function xg(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:a}=n.findIndex(t);if(i==e||o.isText){if(a!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(xg(o.content,e-i-1,t-i-1)))}function Mg(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return n.cut(0,e).append(t).append(n.cut(e));let a=Mg(s.content,e-o-1,t);return a&&n.replaceChild(i,s.copy(a))}function Ab(n,e,t){if(t.openStart>n.depth)throw new xi("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new xi("Inconsistent open depths");return Pg(n,e,t,0)}function Pg(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let s=Pg(n,e,t,r+1);return o.copy(o.content.replaceChild(i,s))}if(t.content.size){if(t.openStart||t.openEnd||n.depth!=r||e.depth!=r){let{start:s,end:a}=function(l,u){let c=u.depth-l.openStart,d=u.node(c).copy(l.content);for(let h=c-1;h>=0;h--)d=u.node(h).copy(q.from(d));return{start:d.resolveNoCache(l.openStart+c),end:d.resolveNoCache(d.content.size-l.openEnd-c)}}(t,n);return Dr(o,Fg(n,s,a,e,r))}{let s=n.parent,a=s.content;return Dr(s,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}}return Dr(o,Wa(n,e,r))}function Bg(n,e){if(!e.type.compatibleContent(n.type))throw new xi("Cannot join "+e.type.name+" onto "+n.type.name)}function $c(n,e,t){let r=n.node(t);return Bg(r,e.node(t)),r}function Rr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Wo(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Rr(n.nodeAfter,r),o++));for(let a=o;a<s;a++)Rr(i.child(a),r);e&&e.depth==t&&e.textOffset&&Rr(e.nodeBefore,r)}function Dr(n,e){return n.type.checkContent(e),n.copy(e)}function Fg(n,e,t,r,i){let o=n.depth>i&&$c(n,e,i+1),s=r.depth>i&&$c(t,r,i+1),a=[];return Wo(null,n,i,a),o&&s&&e.index(i)==t.index(i)?(Bg(o,s),Rr(Dr(o,Fg(n,e,t,r,i+1)),a)):(o&&Rr(Dr(o,Wa(n,e,i+1)),a),Wo(e,t,i,a),s&&Rr(Dr(s,Wa(t,r,i+1)),a)),Wo(r,null,i,a),new q(a)}function Wa(n,e,t){let r=[];return Wo(null,n,t,r),n.depth>t&&Rr(Dr($c(n,e,t+1),Wa(n,e,t+1)),r),Wo(e,null,t,r),new q(r)}G.empty=new G(q.empty,0,0);class Go{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?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(e=this.resolveDepth(e))==0?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 r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}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):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[3*t],i=t==0?0:this.path[3*t-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Oe.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive!==!1||i&&o[s].isInSet(i.marks)||(o=o[s--].removeFromSet(o));return o}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive!==!1||i&&r[o].isInSet(i.marks)||(r=r[o--].removeFromSet(r));return r}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 r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new yb(this,e,r);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 r=[],i=0,o=t;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),u=o-l;if(r.push(s,a,i+l),!u||(s=s.child(a),s.isText))break;o=u-1,i+=l+1}return new Go(t,r,o)}static resolveCached(e,t){for(let i=0;i<jc.length;i++){let o=jc[i];if(o.pos==t&&o.doc==e)return o}let r=jc[Yc]=Go.resolve(e,t);return Yc=(Yc+1)%_b,r}}let jc=[],Yc=0,_b=12;class yb{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}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 Ob=Object.create(null);let kr=class Xp{constructor(e,t,r,i=Oe.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||q.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,r,i=0){this.content.nodesBetween(e,t,r,i,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,r,i){return this.content.textBetween(e,t,r,i)}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,r){return this.type==e&&Va(this.attrs,t||e.defaultAttrs||Ob)&&Oe.sameSet(this.marks,r||Oe.none)}copy(e=null){return e==this.content?this:new Xp(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Xp(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return G.empty;let i=this.resolve(e),o=this.resolve(t),s=r?0:i.sharedDepth(t),a=i.start(s),l=i.node(s).content.cut(i.pos-a,o.pos-a);return new G(l,i.depth-s,o.depth-s)}replace(e,t,r){return Ab(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Go.resolveCached(this,e)}resolveNoCache(e){return Go.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}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()+")"),Ug(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,r=q.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,t);return!!s&&s.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=Oe.none;for(let t=0;t<this.marks.length;t++)e=this.marks[t].addToSet(e);if(!Oe.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=q.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};kr.prototype.text=void 0;class Ga extends kr{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ug(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 Ga(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ga(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&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 Ug(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Lr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new Tb(e,t);if(r.next==null)return Lr.empty;let i=Hg(r);r.next&&r.err("Unexpected trailing text");let o=function(s){let a=Object.create(null);return l(Yg(s,0));function l(u){let c=[];u.forEach(h=>{s[h].forEach(({term:p,to:f})=>{if(!p)return;let m;for(let g=0;g<c.length;g++)c[g][0]==p&&(m=c[g][1]);Yg(s,f).forEach(g=>{m||c.push([p,m=[]]),m.indexOf(g)==-1&&m.push(g)})})});let d=a[u.join(",")]=new Lr(u.indexOf(s.length-1)>-1);for(let h=0;h<c.length;h++){let p=c[h][1].sort(jg);d.next.push({type:c[h][0],next:a[p.join(",")]||l(p)})}return d}}(function(s){let a=[[]];return c(d(s,0),l()),a;function l(){return a.push([])-1}function u(h,p,f){let m={term:f,to:p};return a[h].push(m),m}function c(h,p){h.forEach(f=>f.to=p)}function d(h,p){if(h.type=="choice")return h.exprs.reduce((f,m)=>f.concat(d(m,p)),[]);if(h.type!="seq"){if(h.type=="star"){let f=l();return u(p,f),c(d(h.expr,f),f),[u(f)]}if(h.type=="plus"){let f=l();return c(d(h.expr,p),f),c(d(h.expr,f),f),[u(f)]}if(h.type=="opt")return[u(p)].concat(d(h.expr,p));if(h.type=="range"){let f=p;for(let m=0;m<h.min;m++){let g=l();c(d(h.expr,f),g),f=g}if(h.max==-1)c(d(h.expr,f),f);else for(let m=h.min;m<h.max;m++){let g=l();u(f,g),c(d(h.expr,f),g),f=g}return[u(f)]}if(h.type=="name")return[u(p,void 0,h.value)];throw new Error("Unknown expr type")}for(let f=0;;f++){let m=d(h.exprs[f],p);if(f==h.exprs.length-1)return m;c(m,p=l())}}}(i));return function(s,a){for(let l=0,u=[s];l<u.length;l++){let c=u[l],d=!c.validEnd,h=[];for(let p=0;p<c.next.length;p++){let{type:f,next:m}=c.next[p];h.push(f.name),!d||f.isText||f.hasRequiredAttrs()||(d=!1),u.indexOf(m)==-1&&u.push(m)}d&&a.err("Only non-generatable nodes ("+h.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(o,r),o}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,r=e.childCount){let i=this;for(let o=t;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&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 r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];return function o(s,a){let l=s.matchFragment(e,r);if(l&&(!t||l.validEnd))return q.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!c.isText&&!c.hasRequiredAttrs()&&i.indexOf(d)==-1){i.push(d);let h=o(d,a.concat(c));if(h)return h}}return null}(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];a.isLeaf||a.hasRequiredAttrs()||a.name in t||i.type&&!l.validEnd||(r.push({match:a.contentMatch,type:a,via:i}),t[a.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(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}(this),e.map((t,r)=>{let i=r+(t.validEnd?"*":" ")+" ";for(let o=0;o<t.next.length;o++)i+=(o?", ":"")+t.next[o].type.name+"->"+e.indexOf(t.next[o].next);return i}).join(`
76
76
  `)}}Lr.empty=new Lr(!0);class Tb{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 Hg(n){let e=[];do e.push(Sb(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Sb(n){let e=[];do e.push(bb(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function bb(n){let e=function(t){if(t.eat("(")){let r=Hg(t);return t.eat(")")||t.err("Missing closing paren"),r}if(!/\W/.test(t.next)){let r=function(i,o){let s=i.nodeTypes,a=s[o];if(a)return[a];let l=[];for(let u in s){let c=s[u];c.groups.indexOf(o)>-1&&l.push(c)}return l.length==0&&i.err("No node type or group '"+o+"' found"),l}(t,t.next).map(i=>(t.inline==null?t.inline=i.isInline:t.inline!=i.isInline&&t.err("Mixing inline and block content"),{type:"name",value:i}));return t.pos++,r.length==1?r[0]:{type:"choice",exprs:r}}t.err("Unexpected token '"+t.next+"'")}(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else{if(!n.eat("{"))break;e=Nb(n,e)}return e}function $g(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Nb(n,e){let t=$g(n),r=t;return n.eat(",")&&(r=n.next!="}"?$g(n):-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function jg(n,e){return e-n}function Yg(n,e){let t=[];return function r(i){let o=n[i];if(o.length==1&&!o[0].term)return r(o[0].to);t.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];a||t.indexOf(l)!=-1||r(l)}}(e),t.sort(jg)}function zg(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Vg(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let o=n[r];if(!o.hasDefault)throw new RangeError("No value supplied for attribute "+r);i=o.default}t[r]=i}return t}function Wg(n){let e=Object.create(null);if(n)for(let t in n)e[t]=new Cb(n[t]);return e}let Gg=class ST{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Wg(r.attrs),this.defaultAttrs=zg(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Lr.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:Vg(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new kr(this,this.computeAttrs(e),q.from(t),Oe.setFrom(r))}createChecked(e=null,t,r){return t=q.from(t),this.checkContent(t),new kr(this,this.computeAttrs(e),t,Oe.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),(t=q.from(t)).size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(q.empty,!0);return o?new kr(this,e,t.append(o),Oe.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).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 this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Oe.none:e}static compile(e,t){let r=Object.create(null);e.forEach((o,s)=>r[o]=new ST(o,t,s));let i=t.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 o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Cb{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Xa{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Wg(i.attrs),this.excluded=null;let o=zg(this.attrs);this.instance=o?new Oe(this,o):null}create(e=null){return!e&&this.instance?this.instance:new Oe(this,Vg(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Xa(o,i++,t,s)),r}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 Xg(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],o=n.marks[i],s=o;if(o)t.push(o);else for(let a in n.marks){let l=n.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}class Xo{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new Zg(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Zg(this,t,!0);return r.addAll(e,t.from,t.to),G.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(wb(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||t.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,t,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(s.getAttrs){let l=s.getAttrs(t);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<t.length;s++){let a=t[s];if((a.priority==null?50:a.priority)<o)break}t.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Qg(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Qg(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xo(e,Xo.schemaRules(e)))}}const Kg={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},Ib={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},qg={ol:!0,ul:!0};function Jg(n,e,t){return e!=null?(e?1:0)|(e==="full"?2:0):n&&n.whitespace=="pre"?3:-5&t}class zc{constructor(e,t,r,i,o,s,a){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=Oe.none,this.stashMarks=[],this.match=s||(4&a?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(q.from(e));if(!t){let r,i=this.type.contentMatch;return(r=i.findWrapping(e.type))?(this.match=i,r):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let r,i=this.content[this.content.length-1];if(i&&i.isText&&(r=/[ \t\r\n\u000c]+$/.exec(i.text))){let o=i;i.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-r[0].length))}}let t=q.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(q.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,r=this.pendingMarks;t<r.length;t++){let i=r[t];(this.type?this.type.allowsMarkType(i.type):Rb(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Kg.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Zg{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0;let i,o=t.topNode,s=Jg(null,t.preserveWhitespace,0)|(r?4:0);i=o?new zc(o.type,o.attrs,Oe.none,Oe.none,!0,t.topMatch||o.type.contentMatch,s):new zc(r?null:e.schema.topNodeType,null,Oe.none,Oe.none,!0,null,s),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,t){let r=e.getAttribute("style");if(!r)return t();let i=this.readStyles(function(l){let u,c=/\s*([\w-]+)\s*:\s*([^;]+)/g,d=[];for(;u=c.exec(l);)d.push(u[1],u[2].trim());return d}(r));if(!i)return;let[o,s]=i,a=this.top;for(let l=0;l<s.length;l++)this.removePendingMark(s[l],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l]);t();for(let l=0;l<o.length;l++)this.removePendingMark(o[l],a);for(let l=0;l<s.length;l++)this.addPendingMark(s[l])}addTextNode(e){let t=e.nodeValue,r=this.top;if(2&r.options||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(t)){if(1&r.options)t=2&r.options?t.replace(/\r\n?/g,`
77
77
  `):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 i=r.content[r.content.length-1],o=e.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(t=t.slice(1))}t&&this.insertNode(this.parser.schema.text(t)),this.findInText(e)}else this.findInside(e)}addElement(e,t){let r,i=e.nodeName.toLowerCase();qg.hasOwnProperty(i)&&this.parser.normalizeLists&&function(s){for(let a=s.firstChild,l=null;a;a=a.nextSibling){let u=a.nodeType==1?a.nodeName.toLowerCase():null;u&&qg.hasOwnProperty(u)&&l?(l.appendChild(a),a=l):u=="li"?l=a:u&&(l=null)}}(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(r=this.parser.matchTag(e,this,t));if(o?o.ignore:Ib.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let s,a=this.top,l=this.needsBlock;if(Kg.hasOwnProperty(i))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild)return void this.leafFallback(e);o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?r:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
78
- `))}ignoreFallback(e){e.nodeName!="BR"||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Oe.none,r=Oe.none;for(let i=0;i<e.length;i+=2)for(let o;;){let s=this.parser.matchStyle(e[i],e[i+1],this,o);if(!s)break;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(a=>{s.clearMark(a)&&(r=a.addToSet(r))}):t=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(t),s.consuming!==!1)break;o=s}return[t,r]}addElementByRule(e,t,r){let i,o,s;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(s=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!t||t.length>s.length)&&(t=s,r=o,!s.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)t.type&&!t.type.allowsMarkType(e.marks[i].type)||(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let s=Jg(e,i,o.options);4&o.options&&o.content.length==0&&(s|=4),this.nodes.push(new zc(e,t,o.activeMarks,o.pendingMarks,r,null,s)),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 r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].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("/"),r=this.options.context,i=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=t[a];if(u==""){if(a==t.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;l--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=function(r,i){for(let o=0;o<i.length;o++)if(r.eq(i[o]))return i[o]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}}function wb(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Qg(n){let e={};for(let t in n)e[t]=n[t];return e}function Rb(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:c}=a.edge(l);if(u==e||o.indexOf(c)<0&&s(c))return!0}};if(s(i.contentMatch))return!0}}class Hn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Vc(t).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let u=s.marks[l];if(this.marks[u.type.name]){if(!u.eq(o[a][0])||u.type.spec.spanning===!1)break;a++,l++}else l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],c=this.serializeMark(u,s.isInline,t);c&&(o.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Hn.renderSpec(Vc(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Hn.renderSpec(Vc(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i,o=t[0],s=o.indexOf(" ");s>0&&(r=o.slice(0,s),o=o.slice(s+1));let a=r?e.createElementNS(r,o):e.createElement(o),l=t[1],u=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let c in l)if(l[c]!=null){let d=c.indexOf(" ");d>0?a.setAttributeNS(c.slice(0,d),c.slice(d+1),l[c]):a.setAttribute(c,l[c])}}for(let c=u;c<t.length;c++){let d=t[c];if(d===0){if(c<t.length-1||c>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}{let{dom:h,contentDOM:p}=Hn.renderSpec(e,d,r);if(a.appendChild(h),p){if(i)throw new RangeError("Multiple content holes");i=p}}}return{dom:a,contentDOM:i}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Hn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=eE(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return eE(e.marks)}}function eE(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Vc(n){return n.document||window.document}const tE=Math.pow(2,16);function Db(n,e){return n+e*tE}function nE(n){return 65535&n}let Wc=class{constructor(n,e,t){this.pos=n,this.delInfo=e,this.recover=t}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}},xr=class yo{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&yo.empty)return yo.empty}recover(e){let t=0,r=nE(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*r]+t+function(i){return(i-(65535&i))/tE}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=l+i+((u?e==l?-1:e==d?1:t:t)<0?0:c);if(r)return h;let p=e==(t<0?l:d)?null:Db(a/3,e-l),f=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(f|=8),new Wc(h,f,p)}i+=c-u}return r?e+i:new Wc(e+i,0,null)}touches(e,t){let r=0,i=nE(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o];if(e<=l+u&&a==3*i)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new yo(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?yo.empty:new yo(e<0?[0,-e,0]:[0,0,e])}};xr.empty=new xr([]);let kb=class Tu{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Tu(this.maps,this.mirror,e,t)}copy(){return new Tu(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i: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,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Tu;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o].mapResult(e,t);if(s.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this.maps[a].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new Wc(e,i,null)}};const Gc=Object.create(null);let at=class{getMap(){return xr.empty}merge(n){return null}static fromJSON(n,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let t=Gc[e.stepType];if(!t)throw new RangeError(`No step type ${e.stepType} defined`);return t.fromJSON(n,e)}static jsonID(n,e){if(n in Gc)throw new RangeError("Duplicate use of step JSON ID "+n);return Gc[n]=e,e.prototype.jsonID=n,e}},mt=class Qs{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Qs(e,null)}static fail(e){return new Qs(null,e)}static fromReplace(e,t,r,i){try{return Qs.ok(e.replace(t,r,i))}catch(o){if(o instanceof xi)return Qs.fail(o.message);throw o}}};function Xc(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Xc(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return q.fromArray(r)}let Kc=class ea extends at{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new G(Xc(t.content,(s,a)=>s.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return mt.fromReplace(e,this.from,this.to,o)}invert(){return new Ko(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new ea(t.pos,r.pos,this.mark)}merge(e){return e instanceof ea&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ea(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ea(t.from,t.to,e.markFromJSON(t.mark))}};at.jsonID("addMark",Kc);let Ko=class ta extends at{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new G(Xc(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return mt.fromReplace(e,this.from,this.to,r)}invert(){return new Kc(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new ta(t.pos,r.pos,this.mark)}merge(e){return e instanceof ta&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ta(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ta(t.from,t.to,e.markFromJSON(t.mark))}};at.jsonID("removeMark",Ko);let qc=class na extends at{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return mt.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return mt.fromReplace(e,this.pos,this.pos+1,new G(q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new na(this.pos,t.marks[i]);return new na(this.pos,this.mark)}}return new Jc(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new na(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new na(t.pos,e.markFromJSON(t.mark))}};at.jsonID("addNodeMark",qc);let Jc=class Kp extends at{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return mt.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return mt.fromReplace(e,this.pos,this.pos+1,new G(q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new qc(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Kp(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Kp(t.pos,e.markFromJSON(t.mark))}};at.jsonID("removeNodeMark",Jc);let $n=class di extends at{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Zc(e,this.from,this.to)?mt.fail("Structure replace would overwrite content"):mt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new xr([this.from,this.to-this.from,this.slice.size])}invert(e){return new di(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new di(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof di)||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?G.empty:new G(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new di(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?G.empty:new G(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new di(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new di(t.from,t.to,G.fromJSON(e,t.slice),!!t.structure)}};at.jsonID("replace",$n);let Mr=class Su extends at{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Zc(e,this.from,this.gapFrom)||Zc(e,this.gapTo,this.to)))return mt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return mt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?mt.fromReplace(e,this.from,this.to,r):mt.fail("Content does not fit in gap")}getMap(){return new xr([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 Su(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),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new Su(t.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(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Su(t.from,t.to,t.gapFrom,t.gapTo,G.fromJSON(e,t.slice),t.insert,!!t.structure)}};function Zc(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function rE(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}at.jsonID("replaceAround",Mr);let Lb=class{constructor(n,e,t){this.$from=n,this.$to=e,this.unplaced=t,this.frontier=[],this.placed=q.empty;for(let r=0;r<=n.depth;r++){let i=n.node(r);this.frontier.push({type:i.type,match:i.contentMatchAt(n.indexAfter(r))})}for(let r=n.depth;r>0;r--)this.placed=q.from(n.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let l=this.findFittable();l?this.placeNodes(l):this.openMore()||this.dropNode()}let n=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,t=this.$from,r=this.close(n<0?this.$to:t.doc.resolve(n));if(!r)return null;let i=this.placed,o=t.depth,s=r.depth;for(;o&&s&&i.childCount==1;)i=i.firstChild.content,o--,s--;let a=new G(i,o,s);return n>-1?new Mr(t.pos,n,this.$to.pos,this.$to.end(),a,e):a.size||t.pos!=this.$to.pos?new $n(t.pos,r.pos,a):null}findFittable(){let n=this.unplaced.openStart;for(let e=this.unplaced.content,t=0,r=this.unplaced.openEnd;t<n;t++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=t){n=t;break}e=i.content}for(let e=1;e<=2;e++)for(let t=e==1?n:this.unplaced.openStart;t>=0;t--){let r,i=null;t?(i=Qc(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let s=this.depth;s>=0;s--){let a,{type:l,match:u}=this.frontier[s],c=null;if(e==1&&(o?u.matchType(o.type)||(c=u.fillBefore(q.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:s,parent:i,inject:c};if(e==2&&o&&(a=u.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:s,parent:i,wrap:a};if(i&&u.matchType(i.type))break}}}openMore(){let{content:n,openStart:e,openEnd:t}=this.unplaced,r=Qc(n,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new G(n,e+1,Math.max(t,r.size+e>=n.size-t?e+1:0)),!0)}dropNode(){let{content:n,openStart:e,openEnd:t}=this.unplaced,r=Qc(n,e);if(r.childCount<=1&&e>0){let i=n.size-e<=e+r.size;this.unplaced=new G(qo(n,e-1,1),e-1,i?e-1:t)}else this.unplaced=new G(qo(n,e,1),e,t)}placeNodes({sliceDepth:n,frontierDepth:e,parent:t,inject:r,wrap:i}){for(;this.depth>e;)this.closeFrontierNode();if(i)for(let f=0;f<i.length;f++)this.openFrontierNode(i[f]);let o=this.unplaced,s=t?t.content:o.content,a=o.openStart-n,l=0,u=[],{match:c,type:d}=this.frontier[e];if(r){for(let f=0;f<r.childCount;f++)u.push(r.child(f));c=c.matchFragment(r)}let h=s.size+n-(o.content.size-o.openEnd);for(;l<s.childCount;){let f=s.child(l),m=c.matchType(f.type);if(!m)break;l++,(l>1||a==0||f.content.size)&&(c=m,u.push(iE(f.mark(d.allowedMarks(f.marks)),l==1?a:0,l==s.childCount?h:-1)))}let p=l==s.childCount;p||(h=-1),this.placed=Jo(this.placed,e,q.from(u)),this.frontier[e].match=c,p&&h<0&&t&&t.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=s;f<h;f++){let g=m.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),m=g.content}this.unplaced=p?n==0?G.empty:new G(qo(o.content,n-1,1),n-1,h<0?o.openEnd:n-1):new G(qo(o.content,n,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let n,e=this.frontier[this.depth];if(!e.type.isTextblock||!ed(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:t}=this.$to,r=this.$to.after(t);for(;t>1&&r==this.$to.end(--t);)++r;return r}findCloseLevel(n){e:for(let e=Math.min(this.depth,n.depth);e>=0;e--){let{match:t,type:r}=this.frontier[e],i=e<n.depth&&n.end(e+1)==n.pos+(n.depth-(e+1)),o=ed(n,e,r,t,i);if(o){for(let s=e-1;s>=0;s--){let{match:a,type:l}=this.frontier[s],u=ed(n,s,l,a,!0);if(!u||u.childCount)continue e}return{depth:e,fit:o,move:i?n.doc.resolve(n.after(e+1)):n}}}}close(n){let e=this.findCloseLevel(n);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Jo(this.placed,e.depth,e.fit)),n=e.move;for(let t=e.depth+1;t<=n.depth;t++){let r=n.node(t),i=r.type.contentMatch.fillBefore(r.content,!0,n.index(t));this.openFrontierNode(r.type,r.attrs,i)}return n}openFrontierNode(n,e=null,t){let r=this.frontier[this.depth];r.match=r.match.matchType(n),this.placed=Jo(this.placed,this.depth,q.from(n.create(e,t))),this.frontier.push({type:n,match:n.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(q.empty,!0);n.childCount&&(this.placed=Jo(this.placed,this.frontier.length,n))}};function qo(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(qo(n.firstChild.content,e-1,t)))}function Jo(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Jo(n.lastChild.content,e-1,t)))}function Qc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function iE(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,iE(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(q.empty,!0)))),n.copy(r)}function ed(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(l,u,c){for(let d=c;d<u.childCount;d++)if(!l.allowsMarks(u.child(d).marks))return!0;return!1}(t,o.content,s)?a:null}function oE(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(oE(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(q.empty,!0))}return n}function sE(n,e){let t=[];for(let r=Math.min(n.depth,e.depth);r>=0;r--){let i=n.start(r);if(i<n.pos-(n.depth-r)||e.end(r)>e.pos+(e.depth-r)||n.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(i==e.start(r)||r==n.depth&&r==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==i-1)&&t.push(r)}return t}let aE=class bu extends at{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return mt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return mt.fromReplace(e,this.pos,this.pos+1,new G(q.from(i),0,t.isLeaf?0:1))}getMap(){return xr.empty}invert(e){return new bu(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 bu(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new bu(t.pos,t.attr,t.value)}};at.jsonID("attr",aE);let lE=class qp extends at{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return mt.ok(r)}getMap(){return xr.empty}invert(e){return new qp(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(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new qp(t.attr,t.value)}};at.jsonID("docAttr",lE);let Zo=class extends Error{};Zo=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(Zo.prototype=Object.create(Error.prototype)).constructor=Zo,Zo.prototype.name="TransformError";class xb{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new kb}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Zo(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,r=G.empty){let i=function(o,s,a=s,l=G.empty){if(s==a&&!l.size)return null;let u=o.resolve(s),c=o.resolve(a);return rE(u,c,l)?new $n(s,a,l):new Lb(u,c,l).fit()}(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new G(q.from(r),0,0))}delete(e,t){return this.replace(e,t,G.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return function(i,o,s,a){if(!a.size)return i.deleteRange(o,s);let l=i.doc.resolve(o),u=i.doc.resolve(s);if(rE(l,u,a))return i.step(new $n(o,s,a));let c=sE(l,i.doc.resolve(s));c[c.length-1]==0&&c.pop();let d=-(l.depth+1);c.unshift(d);for(let E=l.depth,v=l.pos-1;E>0;E--,v--){let A=l.node(E).type.spec;if(A.defining||A.definingAsContext||A.isolating)break;c.indexOf(E)>-1?d=E:l.before(E)==v&&c.splice(1,0,-E)}let h=c.indexOf(d),p=[],f=a.openStart;for(let E=a.content,v=0;;v++){let A=E.firstChild;if(p.push(A),v==a.openStart)break;E=A.content}for(let E=f-1;E>=0;E--){let v=p[E],A=(m=v.type).spec.defining||m.spec.definingForContent;if(A&&!v.sameMarkup(l.node(Math.abs(d)-1)))f=E;else if(A||!v.type.isTextblock)break}var m;for(let E=a.openStart;E>=0;E--){let v=(E+f+1)%(a.openStart+1),A=p[v];if(A)for(let _=0;_<c.length;_++){let O=c[(_+h)%c.length],T=!0;O<0&&(T=!1,O=-O);let S=l.node(O-1),b=l.index(O-1);if(S.canReplaceWith(b,b,A.type,A.marks))return i.replace(l.before(O),T?u.after(O):s,new G(oE(a.content,0,a.openStart,v),v,a.openEnd))}}let g=i.steps.length;for(let E=c.length-1;E>=0&&(i.replace(o,s,a),!(i.steps.length>g));E--){let v=c[E];v<0||(o=l.before(v),s=u.after(v))}}(this,e,t,r),this}replaceRangeWith(e,t,r){return function(i,o,s,a){if(!a.isInline&&o==s&&i.doc.resolve(o).parent.content.size){let l=function(u,c,d){let h=u.resolve(c);if(h.parent.canReplaceWith(h.index(),h.index(),d))return c;if(h.parentOffset==0)for(let p=h.depth-1;p>=0;p--){let f=h.index(p);if(h.node(p).canReplaceWith(f,f,d))return h.before(p+1);if(f>0)return null}if(h.parentOffset==h.parent.content.size)for(let p=h.depth-1;p>=0;p--){let f=h.indexAfter(p);if(h.node(p).canReplaceWith(f,f,d))return h.after(p+1);if(f<h.node(p).childCount)return null}return null}(i.doc,o,a.type);l!=null&&(o=s=l)}i.replaceRange(o,s,new G(q.from(a),0,0))}(this,e,t,r),this}deleteRange(e,t){return function(r,i,o){let s=r.doc.resolve(i),a=r.doc.resolve(o),l=sE(s,a);for(let u=0;u<l.length;u++){let c=l[u],d=u==l.length-1;if(d&&c==0||s.node(c).type.contentMatch.validEnd)return r.delete(s.start(c),a.end(c));if(c>0&&(d||s.node(c-1).canReplace(s.index(c-1),a.indexAfter(c-1))))return r.delete(s.before(c),a.after(c))}for(let u=1;u<=s.depth&&u<=a.depth;u++)if(i-s.start(u)==s.depth-u&&o>s.end(u)&&a.end(u)-o!=a.depth-u)return r.delete(s.before(u),o);r.delete(i,o)}(this,e,t),this}lift(e,t){return function(r,i,o){let{$from:s,$to:a,depth:l}=i,u=s.before(l+1),c=a.after(l+1),d=u,h=c,p=q.empty,f=0;for(let E=l,v=!1;E>o;E--)v||s.index(E)>0?(v=!0,p=q.from(s.node(E).copy(p)),f++):d--;let m=q.empty,g=0;for(let E=l,v=!1;E>o;E--)v||a.after(E+1)<a.end(E)?(v=!0,m=q.from(a.node(E).copy(m)),g++):h++;r.step(new Mr(d,h,u,c,new G(p.append(m),f,g),p.size-f,!0))}(this,e,t),this}join(e,t=1){return function(r,i,o){let s=new $n(i-o,i+o,G.empty,!0);r.step(s)}(this,e,t),this}wrap(e,t){return function(r,i,o){let s=q.empty;for(let u=o.length-1;u>=0;u--){if(s.size){let c=o[u].type.contentMatch.matchFragment(s);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}s=q.from(o[u].type.create(o[u].attrs,s))}let a=i.start,l=i.end;r.step(new Mr(a,l,a,l,new G(s,0,0),o.length,!0))}(this,e,t),this}setBlockType(e,t=e,r,i=null){return function(o,s,a,l,u){if(!l.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let c=o.steps.length;o.doc.nodesBetween(s,a,(d,h)=>{if(d.isTextblock&&!d.hasMarkup(l,u)&&function(p,f,m){let g=p.resolve(f),E=g.index();return g.parent.canReplaceWith(E,E+1,m)}(o.doc,o.mapping.slice(c).map(h),l)){o.clearIncompatible(o.mapping.slice(c).map(h,1),l);let p=o.mapping.slice(c),f=p.map(h,1),m=p.map(h+d.nodeSize,1);return o.step(new Mr(f,m,f+1,m-1,new G(q.from(l.create(u,null,d.marks)),0,0),1,!0)),!1}})}(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return function(o,s,a,l,u){let c=o.doc.nodeAt(s);if(!c)throw new RangeError("No node at given position");a||(a=c.type);let d=a.create(l,null,u||c.marks);if(c.isLeaf)return o.replaceWith(s,s+c.nodeSize,d);if(!a.validContent(c.content))throw new RangeError("Invalid content for node type "+a.name);o.step(new Mr(s,s+c.nodeSize,s+1,s+c.nodeSize-1,new G(q.from(d),0,0),1,!0))}(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new aE(e,t,r)),this}setDocAttribute(e,t){return this.step(new lE(e,t)),this}addNodeMark(e,t){return this.step(new qc(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Oe)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(r.marks)))return this}return this.step(new Jc(e,t)),this}split(e,t=1,r){return function(i,o,s=1,a){let l=i.doc.resolve(o),u=q.empty,c=q.empty;for(let d=l.depth,h=l.depth-s,p=s-1;d>h;d--,p--){u=q.from(l.node(d).copy(u));let f=a&&a[p];c=q.from(f?f.type.create(f.attrs,c):l.node(d).copy(c))}i.step(new $n(o,o,new G(u.append(c),s,s),!0))}(this,e,t,r),this}addMark(e,t,r){return function(i,o,s,a){let l,u,c=[],d=[];i.doc.nodesBetween(o,s,(h,p,f)=>{if(!h.isInline)return;let m=h.marks;if(!a.isInSet(m)&&f.type.allowsMarkType(a.type)){let g=Math.max(p,o),E=Math.min(p+h.nodeSize,s),v=a.addToSet(m);for(let A=0;A<m.length;A++)m[A].isInSet(v)||(l&&l.to==g&&l.mark.eq(m[A])?l.to=E:c.push(l=new Ko(g,E,m[A])));u&&u.to==g?u.to=E:d.push(u=new Kc(g,E,a))}}),c.forEach(h=>i.step(h)),d.forEach(h=>i.step(h))}(this,e,t,r),this}removeMark(e,t,r){return function(i,o,s,a){let l=[],u=0;i.doc.nodesBetween(o,s,(c,d)=>{if(!c.isInline)return;u++;let h=null;if(a instanceof Xa){let p,f=c.marks;for(;p=a.isInSet(f);)(h||(h=[])).push(p),f=p.removeFromSet(f)}else a?a.isInSet(c.marks)&&(h=[a]):h=c.marks;if(h&&h.length){let p=Math.min(d+c.nodeSize,s);for(let f=0;f<h.length;f++){let m,g=h[f];for(let E=0;E<l.length;E++){let v=l[E];v.step==u-1&&g.eq(l[E].style)&&(m=v)}m?(m.to=p,m.step=u):l.push({style:g,from:Math.max(d,o),to:p,step:u})}}}),l.forEach(c=>i.step(new Ko(c.from,c.to,c.style)))}(this,e,t,r),this}clearIncompatible(e,t,r){return function(i,o,s,a=s.contentMatch){let l=i.doc.nodeAt(o),u=[],c=o+1;for(let d=0;d<l.childCount;d++){let h=l.child(d),p=c+h.nodeSize,f=a.matchType(h.type);if(f){a=f;for(let m=0;m<h.marks.length;m++)s.allowsMarkType(h.marks[m].type)||i.step(new Ko(c,p,h.marks[m]));if(h.isText&&!s.spec.code){let m,g,E=/\r?\n|\r/g;for(;m=E.exec(h.text);)g||(g=new G(q.from(s.schema.text(" ",s.allowedMarks(h.marks))),0,0)),u.push(new $n(c+m.index,c+m.index+m[0].length,g))}}else u.push(new $n(c,p,G.empty));c=p}if(!a.validEnd){let d=a.fillBefore(q.empty,!0);i.replace(c,c,new G(d,0,0))}for(let d=u.length-1;d>=0;d--)i.step(u[d])}(this,e,t,r),this}}const td=Object.create(null);class ve{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new Mb(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=G.empty){let r=t.content.lastChild,i=null;for(let a=0;a<t.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:u}=s[a],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(u.pos),a?G.empty:t),a==0&&dE(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(r),u=l.map(s.pos),c=l.map(a.pos);o?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),dE(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new Te(e):Mi(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=t<0?Mi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Mi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Ut(e.node(0))}static atStart(e){return Mi(e,e,0,0,1)||new Ut(e)}static atEnd(e){return Mi(e,e,e.content.size,e.childCount,-1)||new Ut(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=td[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in td)throw new RangeError("Duplicate use of selection JSON ID "+e);return td[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Te.between(this.$anchor,this.$head).getBookmark()}}ve.prototype.visible=!0;class Mb{constructor(e,t){this.$from=e,this.$to=t}}let uE=!1;function cE(n){uE||n.parent.inlineContent||(uE=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class Te extends ve{constructor(e,t=e){cE(e),cE(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ve.near(r);let i=e.resolve(t.map(this.anchor));return new Te(i.parent.inlineContent?i:r,r)}replace(e,t=G.empty){if(super.replace(e,t),t==G.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Te&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ka(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Te(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if(r&&!i||(r=i>=0?1:-1),!t.parent.inlineContent){let o=ve.findFrom(t,r,!0)||ve.findFrom(t,-r,!0);if(!o)return ve.near(t,r);t=o.$head}return e.parent.inlineContent||(i==0||(e=(ve.findFrom(e,-r,!0)||ve.findFrom(e,r,!0)).$anchor).pos<t.pos!=i<0)&&(e=t),new Te(e,t)}}ve.jsonID("text",Te);class Ka{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Ka(e.map(this.anchor),e.map(this.head))}resolve(e){return Te.between(e.resolve(this.anchor),e.resolve(this.head))}}class le extends ve{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?ve.near(o):new le(o)}content(){return new G(q.from(this.node),0,0)}eq(e){return e instanceof le&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new nd(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new le(e.resolve(t.anchor))}static create(e,t){return new le(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}le.prototype.visible=!1,ve.jsonID("node",le);class nd{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Ka(r,r):new nd(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&le.isSelectable(r)?new le(t):ve.near(t)}}class Ut extends ve{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=G.empty){if(t==G.empty){e.delete(0,e.doc.content.size);let r=ve.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ut(e)}map(e){return new Ut(e)}eq(e){return e instanceof Ut}getBookmark(){return Pb}}ve.jsonID("all",Ut);const Pb={map(){return this},resolve:n=>new Ut(n)};function Mi(n,e,t,r,i,o=!1){if(e.inlineContent)return Te.create(n,t);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&le.isSelectable(a))return le.create(n,t-(i<0?a.nodeSize:0))}else{let l=Mi(n,a,t+i,i<0?a.childCount:0,i,o);if(l)return l}t+=a.nodeSize*i}return null}function dE(n,e,t){let r=n.steps.length-1;if(r<e)return;let i,o=n.steps[r];(o instanceof $n||o instanceof Mr)&&(n.mapping.maps[r].forEach((s,a,l,u)=>{i==null&&(i=u)}),n.setSelection(ve.near(n.doc.resolve(i),t)))}class Bb extends xb{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 Oe.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 r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Oe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(ve.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?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 hE(n,e){return e&&n?n.bind(e):n}class Qo{constructor(e,t,r){this.name=e,this.init=hE(t.init,r),this.apply=hE(t.apply,r)}}const Fb=[new Qo("doc",{init:n=>n.doc||n.schema.topNodeType.createAndFill(),apply:n=>n.doc}),new Qo("selection",{init:(n,e)=>n.selection||ve.atStart(e.doc),apply:n=>n.selection}),new Qo("storedMarks",{init:n=>n.storedMarks||null,apply:(n,e,t,r)=>r.selection.$cursor?n.storedMarks:null}),new Qo("scrollToSelection",{init:()=>0,apply:(n,e)=>n.scrolledIntoView?e+1:e})];class rd{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Fb.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Qo(r.key,r.spec.state,r))})}}class Pi{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 r=0;r<this.config.plugins.length;r++)if(r!=t){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,u=i?i[s].state:this,c=l<t.length&&a.spec.appendTransaction.call(a,l?t.slice(l):t,u,r);if(c&&r.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<s?{state:r,n:t.length}:{state:this,n:0})}t.push(c),r=r.applyInner(c),o=!0}i&&(i[s]={state:r,n:t.length})}}if(!o)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Pi(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new Bb(this)}static create(e){let t=new rd(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Pi(t);for(let i=0;i<t.fields.length;i++)r[t.fields[i].name]=t.fields[i].init(e,r);return r}reconfigure(e){let t=new rd(this.schema,e.plugins),r=t.fields,i=new Pi(t);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new rd(e.schema,e.plugins),o=new Pi(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=kr.fromJSON(e.schema,t.doc);else if(s.name=="selection")o.selection=ve.fromJSON(o.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,a))return void(o[s.name]=u.fromJSON.call(l,e,t[a],o))}o[s.name]=s.init(e,o)}}),o}}function pE(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=pE(i,e,{})),t[r]=i}return t}class qa{constructor(e){this.spec=e,this.props={},e.props&&pE(e.props,this,this.props),this.key=e.key?e.key.key:fE("plugin")}getState(e){return e[this.key]}}const id=Object.create(null);function fE(n){return n in id?n+"$"+ ++id[n]:(id[n]=0,n+"$")}class Ja{constructor(e="key"){this.key=fE(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const gt=function(n){for(var e=0;;e++)if(!(n=n.previousSibling))return e},es=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let mE=null;const jn=function(n,e,t){let r=mE||(mE=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Pr=function(n,e,t,r){return t&&(gE(n,e,t,r,-1)||gE(n,e,t,r,1))},Ub=/^(img|br|input|textarea|hr)$/i;function gE(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:yn(n))){let o=n.parentNode;if(!o||o.nodeType!=1||od(n)||Ub.test(n.nodeName)||n.contentEditable=="false")return!1;e=gt(n)+(i<0?0:1),n=o}else{if(n.nodeType!=1||(n=n.childNodes[e+(i<0?-1:0)]).contentEditable=="false")return!1;e=i<0?yn(n):0}}}function yn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function od(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Za=function(n){return n.focusNode&&Pr(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Br(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const On=typeof navigator<"u"?navigator:null,EE=typeof document<"u"?document:null,or=On&&On.userAgent||"",sd=/Edge\/(\d+)/.exec(or),vE=/MSIE \d/.exec(or),ad=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(or),bt=!!(vE||ad||sd),sr=vE?document.documentMode:ad?+ad[1]:sd?+sd[1]:0,ln=!bt&&/gecko\/(\d+)/i.test(or);ln&&(/Firefox\/(\d+)/.exec(or)||[0,0])[1];const ld=!bt&&/Chrome\/(\d+)/.exec(or),lt=!!ld,Hb=ld?+ld[1]:0,Et=!bt&&!!On&&/Apple Computer/.test(On.vendor),Bi=Et&&(/Mobile\/\w+/.test(or)||!!On&&On.maxTouchPoints>2),qt=Bi||!!On&&/Mac/.test(On.platform),$b=!!On&&/Win/.test(On.platform),un=/Android \d/.test(or),ts=!!EE&&"webkitFontSmoothing"in EE.documentElement.style,jb=ts?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Yb(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Yn(n,e){return typeof n=="number"?n:n[e]}function zb(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function AE(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;s=es(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,u=l?Yb(o):zb(a),c=0,d=0;if(e.top<u.top+Yn(r,"top")?d=-(u.top-e.top+Yn(i,"top")):e.bottom>u.bottom-Yn(r,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Yn(i,"top")-u.top:e.bottom-u.bottom+Yn(i,"bottom")),e.left<u.left+Yn(r,"left")?c=-(u.left-e.left+Yn(i,"left")):e.right>u.right-Yn(r,"right")&&(c=e.right-u.right+Yn(i,"right")),c||d)if(l)o.defaultView.scrollBy(c,d);else{let h=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),c&&(a.scrollLeft+=c);let f=a.scrollLeft-h,m=a.scrollTop-p;e={left:e.left-f,top:e.top-m,right:e.right-f,bottom:e.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function _E(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=es(r));return e}function yE(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:i,left:o}=n[t];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Fi=null;function OE(n,e){let t,r,i,o,s=2e8,a=0,l=e.top,u=e.top;for(let c=n.firstChild,d=0;c;c=c.nextSibling,d++){let h;if(c.nodeType==1)h=c.getClientRects();else{if(c.nodeType!=3)continue;h=jn(c).getClientRects()}for(let p=0;p<h.length;p++){let f=h[p];if(f.top<=l&&f.bottom>=u){l=Math.max(f.bottom,l),u=Math.min(f.top,u);let m=f.left>e.left?f.left-e.left:f.right<e.left?e.left-f.right:0;if(m<s){t=c,s=m,r=m&&t.nodeType==3?{left:f.right<e.left?f.right:f.left,top:e.top}:e,c.nodeType==1&&m&&(a=d+(e.left>=(f.left+f.right)/2?1:0));continue}}else f.top>e.top&&!i&&f.left<=e.left&&f.right>=e.left&&(i=c,o={left:Math.max(f.left,Math.min(f.right,e.left)),top:f.top});!t&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(a=d+1)}}return!t&&i&&(t=i,r=o,s=0),t&&t.nodeType==3?function(c,d){let h=c.nodeValue.length,p=document.createRange();for(let f=0;f<h;f++){p.setEnd(c,f+1),p.setStart(c,f);let m=ar(p,1);if(m.top!=m.bottom&&ud(d,m))return{node:c,offset:f+(d.left>=(m.left+m.right)/2?1:0)}}return{node:c,offset:0}}(t,r):!t||s&&t.nodeType==1?{node:n,offset:a}:OE(t,r)}function ud(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function TE(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),o=i;;){let s=n.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(ud(e,u))return TE(s,e,u)}}if((o=(o+1)%r)==i)break}return n}function Vb(n,e){let t,r=n.dom.ownerDocument,i=0,o=function(u,c,d){if(u.caretPositionFromPoint)try{let h=u.caretPositionFromPoint(c,d);if(h)return{node:h.offsetNode,offset:h.offset}}catch{}if(u.caretRangeFromPoint){let h=u.caretRangeFromPoint(c,d);if(h)return{node:h.startContainer,offset:h.startOffset}}}(r,e.left,e.top);o&&({node:t,offset:i}=o);let s,a=(n.root.elementFromPoint?n.root:r).elementFromPoint(e.left,e.top);if(!a||!n.dom.contains(a.nodeType!=1?a.parentNode:a)){let u=n.dom.getBoundingClientRect();if(!ud(e,u)||(a=TE(n.dom,e,u),!a))return null}if(Et)for(let u=a;t&&u;u=es(u))u.draggable&&(t=void 0);if(a=function(u,c){let d=u.parentNode;return d&&/^li$/i.test(d.nodeName)&&c.left<u.getBoundingClientRect().left?d:u}(a,e),t){if(ln&&t.nodeType==1&&(i=Math.min(i,t.childNodes.length),i<t.childNodes.length)){let c,d=t.childNodes[i];d.nodeName=="IMG"&&(c=d.getBoundingClientRect()).right<=e.left&&c.bottom>e.top&&i++}let u;ts&&i&&t.nodeType==1&&(u=t.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,t==n.dom&&i==t.childNodes.length-1&&t.lastChild.nodeType==1&&e.top>t.lastChild.getBoundingClientRect().bottom?s=n.state.doc.content.size:i!=0&&t.nodeType==1&&t.childNodes[i-1].nodeName=="BR"||(s=function(c,d,h,p){let f=-1;for(let m=d,g=!1;m!=c.dom;){let E=c.docView.nearestDesc(m,!0);if(!E)return null;if(E.dom.nodeType==1&&(E.node.isBlock&&E.parent&&!g||!E.contentDOM)){let v=E.dom.getBoundingClientRect();if(E.node.isBlock&&E.parent&&!g&&(g=!0,v.left>p.left||v.top>p.top?f=E.posBefore:(v.right<p.left||v.bottom<p.top)&&(f=E.posAfter)),!E.contentDOM&&f<0&&!E.node.isText)return(E.node.isBlock?p.top<(v.top+v.bottom)/2:p.left<(v.left+v.right)/2)?E.posBefore:E.posAfter}m=E.dom.parentNode}return f>-1?f:c.docView.posFromDOM(d,h,-1)}(n,t,i,e))}s==null&&(s=function(u,c,d){let{node:h,offset:p}=OE(c,d),f=-1;if(h.nodeType==1&&!h.firstChild){let m=h.getBoundingClientRect();f=m.left!=m.right&&d.left>(m.left+m.right)/2?1:-1}return u.docView.posFromDOM(h,p,f)}(n,a,e));let l=n.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function SE(n){return n.top<n.bottom||n.left<n.right}function ar(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(SE(r))return r}return Array.prototype.find.call(t,SE)||n.getBoundingClientRect()}const Wb=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function bE(n,e,t){let{node:r,offset:i,atom:o}=n.docView.domFromPos(e,t<0?-1:1),s=ts||ln;if(r.nodeType==3){if(!s||!Wb.test(r.nodeValue)&&(t<0?i:i!=r.nodeValue.length)){let a=i,l=i,u=t<0?1:-1;return t<0&&!i?(l++,u=-1):t>=0&&i==r.nodeValue.length?(a--,u=1):t<0?a--:l++,ns(ar(jn(r,a,l),u),u<0)}{let a=ar(jn(r,i,i),t);if(ln&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let l=ar(jn(r,i-1,i-1),-1);if(l.top==a.top){let u=ar(jn(r,i,i+1),-1);if(u.top!=a.top)return ns(u,u.left<l.left)}}return a}}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==yn(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return cd(a.getBoundingClientRect(),!1)}if(o==null&&i<yn(r)){let a=r.childNodes[i];if(a.nodeType==1)return cd(a.getBoundingClientRect(),!0)}return cd(r.getBoundingClientRect(),t>=0)}if(o==null&&i&&(t<0||i==yn(r))){let a=r.childNodes[i-1],l=a.nodeType==3?jn(a,yn(a)-(s?0:1)):a.nodeType!=1||a.nodeName=="BR"&&a.nextSibling?null:a;if(l)return ns(ar(l,1),!1)}if(o==null&&i<yn(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let l=a?a.nodeType==3?jn(a,0,s?0:1):a.nodeType==1?a:null:null;if(l)return ns(ar(l,-1),!0)}return ns(ar(r.nodeType==3?jn(r):r,-t),t>=0)}function ns(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function cd(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function NE(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}const Gb=/[\u0590-\u08ac]/;let CE=null,IE=null,wE=!1;function Xb(n,e,t){return CE==e&&IE==t?wE:(CE=e,IE=t,wE=t=="up"||t=="down"?function(r,i,o){let s=i.selection,a=o=="up"?s.$from:s.$to;return NE(r,i,()=>{let{node:l}=r.docView.domFromPos(a.pos,o=="up"?-1:1);for(;;){let c=r.docView.nearestDesc(l,!0);if(!c)break;if(c.node.isBlock){l=c.contentDOM||c.dom;break}l=c.dom.parentNode}let u=bE(r,a.pos,1);for(let c=l.firstChild;c;c=c.nextSibling){let d;if(c.nodeType==1)d=c.getClientRects();else{if(c.nodeType!=3)continue;d=jn(c,0,c.nodeValue.length).getClientRects()}for(let h=0;h<d.length;h++){let p=d[h];if(p.bottom>p.top+1&&(o=="up"?u.top-p.top>2*(p.bottom-u.top):p.bottom-u.bottom>2*(u.bottom-p.top)))return!1}}return!0})}(n,e,t):function(r,i,o){let{$head:s}=i.selection;if(!s.parent.isTextblock)return!1;let a=s.parentOffset,l=!a,u=a==s.parent.content.size,c=r.domSelection();return Gb.test(s.parent.textContent)&&c.modify?NE(r,i,()=>{let{focusNode:d,focusOffset:h,anchorNode:p,anchorOffset:f}=r.domSelectionRange(),m=c.caretBidiLevel;c.modify("move",o,"character");let g=s.depth?r.docView.domAfterPos(s.before()):r.dom,{focusNode:E,focusOffset:v}=r.domSelectionRange(),A=E&&!g.contains(E.nodeType==1?E:E.parentNode)||d==E&&h==v;try{c.collapse(p,f),d&&(d!=p||h!=f)&&c.extend&&c.extend(d,h)}catch{}return m!=null&&(c.caretBidiLevel=m),A}):o=="left"||o=="backward"?l:u}(n,e,t))}class rs{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){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,r=this.posAtStart;;t++){let i=this.children[t];if(i==e)return r;r+=i.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,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&(!(s=o.pmViewDesc)||s.parent!=this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}{let o,s;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&(!(s=o.pmViewDesc)||s.parent!=this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}}let i;if(e==this.dom&&this.contentDOM)i=t>gt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o,s=this.getDesc(i);if(s&&(!t||s.node)){if(!r||!(o=s.nodeDOM)||(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))return s;r=!1}}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let i=this.children[t],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof kE){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof RE&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,o&&o.dom.parentNode!=this.contentDOM;r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?gt(o.dom)+1:0}}{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,o&&o.dom.parentNode!=this.contentDOM;r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,t):{node:this.contentDOM,offset:o?gt(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],u=s+l.size;if(i==-1&&e<=u){let c=s+l.border;if(e>=c&&t<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,c);e=s;for(let d=a;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=gt(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(u>t||a==this.children.length-1)){t=u;for(let c=a+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){o=gt(d.dom);break}t+=d.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=u}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,i=!1){let o=Math.min(e,t),s=Math.max(e,t);for(let h=0,p=0;h<this.children.length;h++){let f=this.children[h],m=p+f.size;if(o>p&&s<m)return f.setSelection(e-p-f.border,t-p-f.border,r,i);p=m}let a=this.domFromPos(e,e?-1:1),l=t==e?a:this.domFromPos(t,t?-1:1),u=r.getSelection(),c=!1;if((ln||Et)&&e==t){let{node:h,offset:p}=a;if(h.nodeType==3){if(c=!(!p||h.nodeValue[p-1]!=`
79
- `),c&&p==h.nodeValue.length)for(let f,m=h;m;m=m.parentNode){if(f=m.nextSibling){f.nodeName=="BR"&&(a=l={node:f.parentNode,offset:gt(f)+1});break}let g=m.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let f=h.childNodes[p-1];c=f&&(f.nodeName=="BR"||f.contentEditable=="false")}}if(ln&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||c&&Et)&&Pr(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Pr(l.node,l.offset,u.focusNode,u.focusOffset))return;let d=!1;if((u.extend||e==t)&&!c){u.collapse(a.node,a.offset);try{e!=t&&u.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(e>t){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&t>=r:e<s&&t>r){let a=r+o.border,l=s-o.border;if(e>=a&&t<=l)return this.dirty=e==r||t==s?2:1,void(e!=a||t!=l||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=s}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?2:1;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class RE extends rs{constructor(e,t,r,i){let o,s=t.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:i)),!t.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==0&&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 e.type!="selection"||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 Kb extends rs{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}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 e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Fr extends rs{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return s&&s.dom||(s=Hn.renderSpec(document,t.type.spec.toDOM(t,r))),new Fr(e,t,s.dom,s.contentDOM||s.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 this.dirty!=3&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=0){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}slice(e,t,r){let i=Fr.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;t<s&&(o=pd(o,t,s,r)),e>0&&(o=pd(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}}class lr extends rs{constructor(e,t,r,i,o,s,a,l,u){super(e,[],o,s),this.node=t,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,t,r,i,o,s){let a,l=o.nodeViews[t.type.name],u=l&&l(t,o,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s,r,i),c=u&&u.dom,d=u&&u.contentDOM;if(t.isText)if(c){if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:d}=Hn.renderSpec(document,t.type.spec.toDOM(t)));d||t.isText||c.nodeName=="BR"||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let h=c;return c=ME(c,r,t),u?a=new qb(e,t,r,i,c,d||null,h,u,o,s+1):t.isText?new Qa(e,t,r,i,c,h,o):new lr(e,t,r,i,c,d||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>q.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,r){return this.dirty==0&&e.eq(this.node)&&hd(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new Zb(this,s&&s.node,e);(function(u,c,d,h){let p=c.locals(u),f=0;if(p.length==0){for(let v=0;v<u.childCount;v++){let A=u.child(v);h(A,p,c.forChild(f,A),v),f+=A.nodeSize}return}let m=0,g=[],E=null;for(let v=0;;){let A,_,O,T;for(;m<p.length&&p[m].to==f;){let y=p[m++];y.widget&&(A?(_||(_=[A])).push(y):A=y)}if(A)if(_){_.sort(Qb);for(let y=0;y<_.length;y++)d(_[y],v,!!E)}else d(A,v,!!E);if(E)T=-1,O=E,E=null;else{if(!(v<u.childCount))break;T=v,O=u.child(v++)}for(let y=0;y<g.length;y++)g[y].to<=f&&g.splice(y--,1);for(;m<p.length&&p[m].from<=f&&p[m].to>f;)g.push(p[m++]);let S=f+O.nodeSize;if(O.isText){let y=S;m<p.length&&p[m].from<y&&(y=p[m].from);for(let C=0;C<g.length;C++)g[C].to<y&&(y=g[C].to);y<S&&(E=O.cut(y-f),O=O.cut(0,y-f),S=y,T=-1)}else for(;m<p.length&&p[m].to<=S;)m++;let b=O.isInline&&!O.isLeaf?g.filter(y=>!y.inline):g.slice();h(O,b,c.forChild(f,O),T),f=S}})(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!d&&l.syncToMarks(c==this.node.childCount?Oe.none:this.node.child(c).marks,r,e),l.placeWidget(u,e,i)},(u,c,d,h)=>{let p;l.syncToMarks(u.marks,r,e),l.findNodeMatch(u,c,d,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(u,c,d,p,e)||l.updateNextNode(u,c,d,e,h,i)||l.addNode(u,c,d,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==2)&&(s&&this.protectLocalComposition(e,s),LE(this.contentDOM,this.children,e),Bi&&function(u){if(u.nodeName=="UL"||u.nodeName=="OL"){let c=u.style.cssText;u.style.cssText=c+"; list-style: square !important",window.getComputedStyle(u).listStyle,u.style.cssText=c}}(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof Te)||r<t||i>t+this.node.content.size)return null;let o=e.domSelectionRange(),s=function(a,l){for(;;){if(a.nodeType==3)return a;if(a.nodeType==1&&l>0){if(a.childNodes.length>l&&a.childNodes[l].nodeType==3)return a.childNodes[l];l=yn(a=a.childNodes[l-1])}else{if(!(a.nodeType==1&&l<a.childNodes.length))return null;a=a.childNodes[l],l=0}}}(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=function(u,c,d,h){for(let p=0,f=0;p<u.childCount&&f<=h;){let m=u.child(p++),g=f;if(f+=m.nodeSize,!m.isText)continue;let E=m.text;for(;p<u.childCount;){let v=u.child(p++);if(f+=v.nodeSize,!v.isText)break;E+=v.text}if(f>=d){if(f>=h&&E.slice(h-c.length-g,h-g)==c)return h-c.length;let v=g<h?E.lastIndexOf(c,h-g-1):-1;if(v>=0&&v+c.length+g>=d)return g+v;if(d==h&&E.length>=h+c.length-g&&E.slice(h-g,h-g+c.length)==c)return h}}return-1}(this.node.content,a,r-t,i-t);return l<0?null:{node:s,pos:l,text:a}}return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new Kb(this,o,t,i);e.input.compositionNodes.push(s),this.children=pd(this.children,r,r+i.length,e,s)}update(e,t,r,i){return!(this.dirty==3||!e.sameMarkup(this.node))&&(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(hd(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=xE(this.dom,this.nodeDOM,dd(this.outerDeco,this.node,t),dd(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function DE(n,e,t,r,i){ME(r,e,n);let o=new lr(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Qa extends lr{constructor(e,t,r,i,o,s,a){super(e,t,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return!(this.dirty==3||this.dirty!=0&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==0&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.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,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new Qa(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||e!=0&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class kE extends rs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==0&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class qb extends lr{constructor(e,t,r,i,o,s,a,l,u,c){super(e,t,r,i,o,s,a,u,c),this.spec=l}update(e,t,r,i){if(this.dirty==3)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}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 LE(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==n){for(;a!=r;)r=PE(r),i=!0;r=r.nextSibling}else i=!0,n.insertBefore(a,r);if(s instanceof Fr){let l=r?r.previousSibling:n.lastChild;LE(s.contentDOM,s.children,t),r=l?l.nextSibling:n.firstChild}}for(;r;)r=PE(r),i=!0;i&&t.trackWrites==n&&(t.trackWrites=null)}const is=function(n){n&&(this.nodeName=n)};is.prototype=Object.create(null);const Ur=[new is];function dd(n,e,t){if(n.length==0)return Ur;let r=t?Ur[0]:new is,i=[r];for(let o=0;o<n.length;o++){let s=n[o].type.attrs;if(s){s.nodeName&&i.push(r=new is(s.nodeName));for(let a in s){let l=s[a];l!=null&&(t&&i.length==1&&i.push(r=new is(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function xE(n,e,t,r){if(t==Ur&&r==Ur)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=t[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=n&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Ur[0]),i=l}Jb(i,a||Ur[0],s)}return i}function Jb(n,e,t){for(let r in e)r=="class"||r=="style"||r=="nodeName"||r in t||n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&n.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&n.classList.add(i[o]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r,i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;r=i.exec(e.style);)n.style.removeProperty(r[1])}t.style&&(n.style.cssText+=t.style)}}function ME(n,e,t){return xE(n,n,Ur,dd(e,t,n.nodeType!=1))}function hd(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function PE(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class Zb{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(i,o){let s=o,a=s.children.length,l=i.childCount,u=new Map,c=[];e:for(;l>0;){let d;for(;;)if(a){let p=s.children[a-1];if(!(p instanceof Fr)){d=p,a--;break}s=p,a=p.children.length}else{if(s==o)break e;a=s.parent.children.indexOf(s),s=s.parent}let h=d.node;if(h){if(h!=i.child(l-1))break;--l,u.set(d,l),c.push(d)}}return{index:l,matched:u,matches:c.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[o])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Fr.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o,s=-1;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,t,r)&&!this.preMatch.matched.has(u)){s=a;break}}return!(s<0)&&(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,r,i,o){let s=this.top.children[i];return s.dirty==3&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(e,t,r,o)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=t}}updateNextNode(e,t,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof lr){let u=this.preMatch.matched.get(l);if(u!=null&&u!=o)return!1;let c,d=l.dom,h=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=3&&hd(t,l.outerDeco));if(!h&&l.update(e,t,r,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!h&&(c=this.recreateWrapper(l,e,t,r,i,s)))return this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(i,s+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,i,o,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let a=lr.create(this.top,t,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,t,r,i,o){let s=lr.create(this.top,e,t,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,t,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(!i||!i.matchesWidget(e)||e!=i.widget&&i.widget.type.toDOM.parentNode){let o=new RE(this.top,e,t,r);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Fr;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Qa)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Et||lt)&&e&&e.dom.contentEditable=="false"&&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 r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new kE(this.top,[],r,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Qb(n,e){return n.type.side-e.type.side}function pd(n,e,t,r,i){let o=[];for(let s=0,a=0;s<n.length;s++){let l=n[s],u=a,c=a+=l.size;u>=t||c<=e?o.push(l):(u<e&&o.push(l.slice(0,e-u,r)),i&&(o.push(i),i=void 0),c>t&&o.push(l.slice(t-u,l.size,r)))}return o}function fd(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(Za(t)){for(a=u;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&le.isSelectable(c)&&i.parent&&(!c.isInline||!function(d,h,p){for(let f=h==0,m=h==yn(d);f||m;){if(d==p)return!0;let g=gt(d);if(!(d=d.parentNode))return!1;f=f&&g==0,m=m&&g==yn(d)}}(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;l=new le(s==d?u:r.resolve(d))}}else{let c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null;a=r.resolve(c)}return l||(l=gd(n,a,u,e=="pointer"||n.state.selection.head<u.pos&&!o?1:-1)),l}function BE(n){return n.editable?n.hasFocus():zE(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function zn(n,e=!1){let t=n.state.selection;if($E(n,t),BE(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&lt){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Pr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset))return n.input.mouseDown.delayedSelectionSync=!0,void n.domObserver.setCurSelection()}if(n.domObserver.disconnectSelection(),n.cursorWrapper)(function(r){let i=r.domSelection(),o=document.createRange(),s=r.cursorWrapper.dom,a=s.nodeName=="IMG";a?o.setEnd(s.parentNode,gt(s)+1):o.setEnd(s,0),o.collapse(!1),i.removeAllRanges(),i.addRange(o),!a&&!r.state.selection.visible&&bt&&sr<=11&&(s.disabled=!0,s.disabled=!1)})(n);else{let r,i,{anchor:o,head:s}=t;!FE||t instanceof Te||(t.$from.parent.inlineContent||(r=UE(n,t.from)),t.empty||t.$from.parent.inlineContent||(i=UE(n,t.to))),n.docView.setSelection(o,s,n.root,e),FE&&(r&&HE(r),i&&HE(i)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(a){let l=a.dom.ownerDocument;l.removeEventListener("selectionchange",a.input.hideSelectionGuard);let u=a.domSelectionRange(),c=u.anchorNode,d=u.anchorOffset;l.addEventListener("selectionchange",a.input.hideSelectionGuard=()=>{u.anchorNode==c&&u.anchorOffset==d||(l.removeEventListener("selectionchange",a.input.hideSelectionGuard),setTimeout(()=>{BE(a)&&!a.state.selection.visible||a.dom.classList.remove("ProseMirror-hideselection")},20))})}(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const FE=Et||lt&&Hb<63;function UE(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(Et&&i&&i.contentEditable=="false")return md(i);if(!(i&&i.contentEditable!="false"||o&&o.contentEditable!="false")){if(i)return md(i);if(o)return md(o)}}function md(n){return n.contentEditable="true",Et&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function HE(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function $E(n,e){if(e instanceof le){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(jE(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else jE(n)}function jE(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function gd(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||Te.between(e,t,r)}function YE(n){return!(n.editable&&!n.hasFocus())&&zE(n)}function zE(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Ed(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ve.findFrom(o,e)}function ur(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function VE(n,e,t){let r=n.state.selection;if(!(r instanceof Te)){if(r instanceof le&&r.node.isInline)return ur(n,new Te(e>0?r.$to:r.$from));{let i=Ed(n.state,e);return!!i&&ur(n,i)}}if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return ur(n,new Te(r.$anchor,s))}if(!r.empty)return!1;if(n.endOfTextblock(e>0?"forward":"backward")){let i=Ed(n.state,e);return!!(i&&i instanceof le)&&ur(n,i)}if(!(qt&&t.indexOf("m")>-1)){let i,o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText)return!1;let a=e<0?o.pos-s.nodeSize:o.pos;return!!(s.isAtom||(i=n.docView.descAt(a))&&!i.contentDOM)&&(le.isSelectable(s)?ur(n,new le(e<0?n.state.doc.resolve(o.pos-s.nodeSize):o)):!!ts&&ur(n,new Te(n.state.doc.resolve(e<0?a:a+s.nodeSize))))}}function el(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ss(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Ui(n,e){return e<0?function(t){let r=t.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s,a,l=!1;for(ln&&i.nodeType==1&&o<el(i)&&ss(i.childNodes[o],-1)&&(l=!0);;)if(o>0){if(i.nodeType!=1)break;{let u=i.childNodes[o-1];if(ss(u,-1))s=i,a=--o;else{if(u.nodeType!=3)break;i=u,o=i.nodeValue.length}}}else{if(WE(i))break;{let u=i.previousSibling;for(;u&&ss(u,-1);)s=i.parentNode,a=gt(u),u=u.previousSibling;if(u)i=u,o=el(i);else{if(i=i.parentNode,i==t.dom)break;o=0}}}l?vd(t,i,o):s&&vd(t,s,a)}(n):function(t){let r=t.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s,a,l=el(i);for(;;)if(o<l){if(i.nodeType!=1||!ss(i.childNodes[o],1))break;s=i,a=++o}else{if(WE(i))break;{let u=i.nextSibling;for(;u&&ss(u,1);)s=u.parentNode,a=gt(u)+1,u=u.nextSibling;if(u)i=u,o=0,l=el(i);else{if(i=i.parentNode,i==t.dom)break;o=l=0}}}s&&vd(t,s,a)}(n)}function WE(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function vd(n,e,t){if(e.nodeType!=3){let o,s;(s=function(a,l){for(;a&&l==a.childNodes.length&&!od(a);)l=gt(a)+1,a=a.parentNode;for(;a&&l<a.childNodes.length;){let u=a.childNodes[l];if(u.nodeType==3)return u;if(u.nodeType==1&&u.contentEditable=="false")break;a=u,l=0}}(e,t))?(e=s,t=0):(o=function(a,l){for(;a&&!l&&!od(a);)l=gt(a),a=a.parentNode;for(;a&&l;){let u=a.childNodes[l-1];if(u.nodeType==3)return u;if(u.nodeType==1&&u.contentEditable=="false")break;l=(a=u).childNodes.length}}(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(Za(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&zn(n)},50)}function GE(n,e){let t=n.state.doc.resolve(e);if(!lt&&!$b&&t.parent.inlineContent){let r=n.coordsAtPos(e);if(e>t.start()){let i=n.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left<r.left?"ltr":"rtl"}if(e<t.end()){let i=n.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left>r.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function XE(n,e,t){let r=n.state.selection;if(r instanceof Te&&!r.empty||t.indexOf("s")>-1||qt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=Ed(n.state,e);if(s&&s instanceof le)return ur(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Ut?ve.near(s,e):ve.findFrom(s,e);return!!a&&ur(n,a)}return!1}function KE(n,e){if(!(n.state.selection instanceof Te))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function qE(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function eN(n,e){let t=e.keyCode,r=function(i){let o="";return i.ctrlKey&&(o+="c"),i.metaKey&&(o+="m"),i.altKey&&(o+="a"),i.shiftKey&&(o+="s"),o}(e);if(t==8||qt&&t==72&&r=="c")return KE(n,-1)||Ui(n,-1);if(t==46&&!e.shiftKey||qt&&t==68&&r=="c")return KE(n,1)||Ui(n,1);if(t==13||t==27)return!0;if(t==37||qt&&t==66&&r=="c"){let i=t==37?GE(n,n.state.selection.from)=="ltr"?-1:1:-1;return VE(n,i,r)||Ui(n,i)}if(t==39||qt&&t==70&&r=="c"){let i=t==39?GE(n,n.state.selection.from)=="ltr"?1:-1:1;return VE(n,i,r)||Ui(n,i)}return t==38||qt&&t==80&&r=="c"?XE(n,-1,r)||Ui(n,-1):t==40||qt&&t==78&&r=="c"?function(i){if(!Et||i.state.selection.$head.parentOffset>0)return!1;let{focusNode:o,focusOffset:s}=i.domSelectionRange();if(o&&o.nodeType==1&&s==0&&o.firstChild&&o.firstChild.contentEditable=="false"){let a=o.firstChild;qE(i,a,"true"),setTimeout(()=>qE(i,a,"false"),20)}return!1}(n)||XE(n,1,r)||Ui(n,1):r==(qt?"m":"c")&&(t==66||t==73||t==89||t==90)}function JE(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=n.someProp("clipboardSerializer")||Hn.fromSchema(n.state.schema),a=o0(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&c.nodeType==1&&(u=r0[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let f=a.createElement(u[p]);for(;l.firstChild;)f.appendChild(l.firstChild);l.appendChild(f),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(t)}`);let h=n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,`
78
+ `))}ignoreFallback(e){e.nodeName!="BR"||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=Oe.none,r=Oe.none;for(let i=0;i<e.length;i+=2)for(let o;;){let s=this.parser.matchStyle(e[i],e[i+1],this,o);if(!s)break;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(a=>{s.clearMark(a)&&(r=a.addToSet(r))}):t=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(t),s.consuming!==!1)break;o=s}return[t,r]}addElementByRule(e,t,r){let i,o,s;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(s=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!t||t.length>s.length)&&(t=s,r=o,!s.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;i<t.length;i++)this.enterInner(t[i],null,!1);return!0}insertNode(e){if(e.isInline&&this.needsBlock&&!this.top.type){let t=this.textblockFromContext();t&&this.enterInner(t)}if(this.findPlace(e)){this.closeExtra();let t=this.top;t.applyPending(e.type),t.match&&(t.match=t.match.matchType(e.type));let r=t.activeMarks;for(let i=0;i<e.marks.length;i++)t.type&&!t.type.allowsMarkType(e.marks[i].type)||(r=e.marks[i].addToSet(r));return t.content.push(e.mark(r)),!0}return!1}enter(e,t,r){let i=this.findPlace(e.create(t));return i&&this.enterInner(e,t,!0,r),i}enterInner(e,t=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let s=Jg(e,i,o.options);4&o.options&&o.content.length==0&&(s|=4),this.nodes.push(new zc(e,t,o.activeMarks,o.pendingMarks,r,null,s)),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 r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].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("/"),r=this.options.context,i=!(this.isOpen||r&&r.parent.type!=this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let u=t[a];if(u==""){if(a==t.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}{let c=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!c||c.name!=u&&c.groups.indexOf(u)==-1)return!1;l--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=function(r,i){for(let o=0;o<i.length;o++)if(r.eq(i[o]))return i[o]}(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==t)break}}}function wb(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Qg(n){let e={};for(let t in n)e[t]=n[t];return e}function Rb(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:c}=a.edge(l);if(u==e||o.indexOf(c)<0&&s(c))return!0}};if(s(i.contentMatch))return!0}}class Hn{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Vc(t).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let u=s.marks[l];if(this.marks[u.type.name]){if(!u.eq(o[a][0])||u.type.spec.spanning===!1)break;a++,l++}else l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],c=this.serializeMark(u,s.isInline,t);c&&(o.push([u,i]),i.appendChild(c.dom),i=c.contentDOM||c.dom)}}i.appendChild(this.serializeNodeInner(s,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Hn.renderSpec(Vc(t),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Hn.renderSpec(Vc(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i,o=t[0],s=o.indexOf(" ");s>0&&(r=o.slice(0,s),o=o.slice(s+1));let a=r?e.createElementNS(r,o):e.createElement(o),l=t[1],u=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let c in l)if(l[c]!=null){let d=c.indexOf(" ");d>0?a.setAttributeNS(c.slice(0,d),c.slice(d+1),l[c]):a.setAttribute(c,l[c])}}for(let c=u;c<t.length;c++){let d=t[c];if(d===0){if(c<t.length-1||c>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}{let{dom:h,contentDOM:p}=Hn.renderSpec(e,d,r);if(a.appendChild(h),p){if(i)throw new RangeError("Multiple content holes");i=p}}}return{dom:a,contentDOM:i}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Hn(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=eE(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return eE(e.marks)}}function eE(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Vc(n){return n.document||window.document}const tE=Math.pow(2,16);function Db(n,e){return n+e*tE}function nE(n){return 65535&n}let Wc=class{constructor(n,e,t){this.pos=n,this.delInfo=e,this.recover=t}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}},xr=class yo{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&yo.empty)return yo.empty}recover(e){let t=0,r=nE(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*r]+t+function(i){return(i-(65535&i))/tE}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=l+i+((u?e==l?-1:e==d?1:t:t)<0?0:c);if(r)return h;let p=e==(t<0?l:d)?null:Db(a/3,e-l),f=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(f|=8),new Wc(h,f,p)}i+=c-u}return r?e+i:new Wc(e+i,0,null)}touches(e,t){let r=0,i=nE(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o];if(e<=l+u&&a==3*i)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new yo(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?yo.empty:new yo(e<0?[0,-e,0]:[0,0,e])}};xr.empty=new xr([]);let kb=class Tu{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Tu(this.maps,this.mirror,e,t)}copy(){return new Tu(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i: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,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Tu;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o].mapResult(e,t);if(s.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this.maps[a].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new Wc(e,i,null)}};const Gc=Object.create(null);let at=class{getMap(){return xr.empty}merge(n){return null}static fromJSON(n,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let t=Gc[e.stepType];if(!t)throw new RangeError(`No step type ${e.stepType} defined`);return t.fromJSON(n,e)}static jsonID(n,e){if(n in Gc)throw new RangeError("Duplicate use of step JSON ID "+n);return Gc[n]=e,e.prototype.jsonID=n,e}},mt=class Qs{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Qs(e,null)}static fail(e){return new Qs(null,e)}static fromReplace(e,t,r,i){try{return Qs.ok(e.replace(t,r,i))}catch(o){if(o instanceof xi)return Qs.fail(o.message);throw o}}};function Xc(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Xc(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return q.fromArray(r)}let Kc=class ea extends at{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new G(Xc(t.content,(s,a)=>s.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return mt.fromReplace(e,this.from,this.to,o)}invert(){return new Ko(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new ea(t.pos,r.pos,this.mark)}merge(e){return e instanceof ea&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ea(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ea(t.from,t.to,e.markFromJSON(t.mark))}};at.jsonID("addMark",Kc);let Ko=class ta extends at{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new G(Xc(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return mt.fromReplace(e,this.from,this.to,r)}invert(){return new Kc(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new ta(t.pos,r.pos,this.mark)}merge(e){return e instanceof ta&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ta(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ta(t.from,t.to,e.markFromJSON(t.mark))}};at.jsonID("removeMark",Ko);let qc=class na extends at{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return mt.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return mt.fromReplace(e,this.pos,this.pos+1,new G(q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new na(this.pos,t.marks[i]);return new na(this.pos,this.mark)}}return new Jc(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new na(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new na(t.pos,e.markFromJSON(t.mark))}};at.jsonID("addNodeMark",qc);let Jc=class Kp extends at{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return mt.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return mt.fromReplace(e,this.pos,this.pos+1,new G(q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new qc(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Kp(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Kp(t.pos,e.markFromJSON(t.mark))}};at.jsonID("removeNodeMark",Jc);let $n=class di extends at{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Zc(e,this.from,this.to)?mt.fail("Structure replace would overwrite content"):mt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new xr([this.from,this.to-this.from,this.slice.size])}invert(e){return new di(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new di(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof di)||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?G.empty:new G(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new di(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?G.empty:new G(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new di(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new di(t.from,t.to,G.fromJSON(e,t.slice),!!t.structure)}};at.jsonID("replace",$n);let Mr=class Su extends at{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Zc(e,this.from,this.gapFrom)||Zc(e,this.gapTo,this.to)))return mt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return mt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?mt.fromReplace(e,this.from,this.to,r):mt.fail("Content does not fit in gap")}getMap(){return new xr([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 Su(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),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new Su(t.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(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Su(t.from,t.to,t.gapFrom,t.gapTo,G.fromJSON(e,t.slice),t.insert,!!t.structure)}};function Zc(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function rE(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}at.jsonID("replaceAround",Mr);let Lb=class{constructor(n,e,t){this.$from=n,this.$to=e,this.unplaced=t,this.frontier=[],this.placed=q.empty;for(let r=0;r<=n.depth;r++){let i=n.node(r);this.frontier.push({type:i.type,match:i.contentMatchAt(n.indexAfter(r))})}for(let r=n.depth;r>0;r--)this.placed=q.from(n.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let l=this.findFittable();l?this.placeNodes(l):this.openMore()||this.dropNode()}let n=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,t=this.$from,r=this.close(n<0?this.$to:t.doc.resolve(n));if(!r)return null;let i=this.placed,o=t.depth,s=r.depth;for(;o&&s&&i.childCount==1;)i=i.firstChild.content,o--,s--;let a=new G(i,o,s);return n>-1?new Mr(t.pos,n,this.$to.pos,this.$to.end(),a,e):a.size||t.pos!=this.$to.pos?new $n(t.pos,r.pos,a):null}findFittable(){let n=this.unplaced.openStart;for(let e=this.unplaced.content,t=0,r=this.unplaced.openEnd;t<n;t++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=t){n=t;break}e=i.content}for(let e=1;e<=2;e++)for(let t=e==1?n:this.unplaced.openStart;t>=0;t--){let r,i=null;t?(i=Qc(this.unplaced.content,t-1).firstChild,r=i.content):r=this.unplaced.content;let o=r.firstChild;for(let s=this.depth;s>=0;s--){let a,{type:l,match:u}=this.frontier[s],c=null;if(e==1&&(o?u.matchType(o.type)||(c=u.fillBefore(q.from(o),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:t,frontierDepth:s,parent:i,inject:c};if(e==2&&o&&(a=u.findWrapping(o.type)))return{sliceDepth:t,frontierDepth:s,parent:i,wrap:a};if(i&&u.matchType(i.type))break}}}openMore(){let{content:n,openStart:e,openEnd:t}=this.unplaced,r=Qc(n,e);return!(!r.childCount||r.firstChild.isLeaf)&&(this.unplaced=new G(n,e+1,Math.max(t,r.size+e>=n.size-t?e+1:0)),!0)}dropNode(){let{content:n,openStart:e,openEnd:t}=this.unplaced,r=Qc(n,e);if(r.childCount<=1&&e>0){let i=n.size-e<=e+r.size;this.unplaced=new G(qo(n,e-1,1),e-1,i?e-1:t)}else this.unplaced=new G(qo(n,e,1),e,t)}placeNodes({sliceDepth:n,frontierDepth:e,parent:t,inject:r,wrap:i}){for(;this.depth>e;)this.closeFrontierNode();if(i)for(let f=0;f<i.length;f++)this.openFrontierNode(i[f]);let o=this.unplaced,s=t?t.content:o.content,a=o.openStart-n,l=0,u=[],{match:c,type:d}=this.frontier[e];if(r){for(let f=0;f<r.childCount;f++)u.push(r.child(f));c=c.matchFragment(r)}let h=s.size+n-(o.content.size-o.openEnd);for(;l<s.childCount;){let f=s.child(l),m=c.matchType(f.type);if(!m)break;l++,(l>1||a==0||f.content.size)&&(c=m,u.push(iE(f.mark(d.allowedMarks(f.marks)),l==1?a:0,l==s.childCount?h:-1)))}let p=l==s.childCount;p||(h=-1),this.placed=Jo(this.placed,e,q.from(u)),this.frontier[e].match=c,p&&h<0&&t&&t.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let f=0,m=s;f<h;f++){let g=m.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),m=g.content}this.unplaced=p?n==0?G.empty:new G(qo(o.content,n-1,1),n-1,h<0?o.openEnd:n-1):new G(qo(o.content,n,l),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let n,e=this.frontier[this.depth];if(!e.type.isTextblock||!ed(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:t}=this.$to,r=this.$to.after(t);for(;t>1&&r==this.$to.end(--t);)++r;return r}findCloseLevel(n){e:for(let e=Math.min(this.depth,n.depth);e>=0;e--){let{match:t,type:r}=this.frontier[e],i=e<n.depth&&n.end(e+1)==n.pos+(n.depth-(e+1)),o=ed(n,e,r,t,i);if(o){for(let s=e-1;s>=0;s--){let{match:a,type:l}=this.frontier[s],u=ed(n,s,l,a,!0);if(!u||u.childCount)continue e}return{depth:e,fit:o,move:i?n.doc.resolve(n.after(e+1)):n}}}}close(n){let e=this.findCloseLevel(n);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=Jo(this.placed,e.depth,e.fit)),n=e.move;for(let t=e.depth+1;t<=n.depth;t++){let r=n.node(t),i=r.type.contentMatch.fillBefore(r.content,!0,n.index(t));this.openFrontierNode(r.type,r.attrs,i)}return n}openFrontierNode(n,e=null,t){let r=this.frontier[this.depth];r.match=r.match.matchType(n),this.placed=Jo(this.placed,this.depth,q.from(n.create(e,t))),this.frontier.push({type:n,match:n.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(q.empty,!0);n.childCount&&(this.placed=Jo(this.placed,this.frontier.length,n))}};function qo(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(qo(n.firstChild.content,e-1,t)))}function Jo(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Jo(n.lastChild.content,e-1,t)))}function Qc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function iE(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,iE(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(q.empty,!0)))),n.copy(r)}function ed(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(l,u,c){for(let d=c;d<u.childCount;d++)if(!l.allowsMarks(u.child(d).marks))return!0;return!1}(t,o.content,s)?a:null}function oE(n,e,t,r,i){if(e<t){let o=n.firstChild;n=n.replaceChild(0,o.copy(oE(o.content,e+1,t,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(q.empty,!0))}return n}function sE(n,e){let t=[];for(let r=Math.min(n.depth,e.depth);r>=0;r--){let i=n.start(r);if(i<n.pos-(n.depth-r)||e.end(r)>e.pos+(e.depth-r)||n.node(r).type.spec.isolating||e.node(r).type.spec.isolating)break;(i==e.start(r)||r==n.depth&&r==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&r&&e.start(r-1)==i-1)&&t.push(r)}return t}let aE=class bu extends at{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return mt.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return mt.fromReplace(e,this.pos,this.pos+1,new G(q.from(i),0,t.isLeaf?0:1))}getMap(){return xr.empty}invert(e){return new bu(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 bu(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new bu(t.pos,t.attr,t.value)}};at.jsonID("attr",aE);let lE=class qp extends at{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return mt.ok(r)}getMap(){return xr.empty}invert(e){return new qp(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(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new qp(t.attr,t.value)}};at.jsonID("docAttr",lE);let Zo=class extends Error{};Zo=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(Zo.prototype=Object.create(Error.prototype)).constructor=Zo,Zo.prototype.name="TransformError";class xb{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new kb}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Zo(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,r=G.empty){let i=function(o,s,a=s,l=G.empty){if(s==a&&!l.size)return null;let u=o.resolve(s),c=o.resolve(a);return rE(u,c,l)?new $n(s,a,l):new Lb(u,c,l).fit()}(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new G(q.from(r),0,0))}delete(e,t){return this.replace(e,t,G.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return function(i,o,s,a){if(!a.size)return i.deleteRange(o,s);let l=i.doc.resolve(o),u=i.doc.resolve(s);if(rE(l,u,a))return i.step(new $n(o,s,a));let c=sE(l,i.doc.resolve(s));c[c.length-1]==0&&c.pop();let d=-(l.depth+1);c.unshift(d);for(let E=l.depth,v=l.pos-1;E>0;E--,v--){let A=l.node(E).type.spec;if(A.defining||A.definingAsContext||A.isolating)break;c.indexOf(E)>-1?d=E:l.before(E)==v&&c.splice(1,0,-E)}let h=c.indexOf(d),p=[],f=a.openStart;for(let E=a.content,v=0;;v++){let A=E.firstChild;if(p.push(A),v==a.openStart)break;E=A.content}for(let E=f-1;E>=0;E--){let v=p[E],A=(m=v.type).spec.defining||m.spec.definingForContent;if(A&&!v.sameMarkup(l.node(Math.abs(d)-1)))f=E;else if(A||!v.type.isTextblock)break}var m;for(let E=a.openStart;E>=0;E--){let v=(E+f+1)%(a.openStart+1),A=p[v];if(A)for(let _=0;_<c.length;_++){let y=c[(_+h)%c.length],T=!0;y<0&&(T=!1,y=-y);let S=l.node(y-1),b=l.index(y-1);if(S.canReplaceWith(b,b,A.type,A.marks))return i.replace(l.before(y),T?u.after(y):s,new G(oE(a.content,0,a.openStart,v),v,a.openEnd))}}let g=i.steps.length;for(let E=c.length-1;E>=0&&(i.replace(o,s,a),!(i.steps.length>g));E--){let v=c[E];v<0||(o=l.before(v),s=u.after(v))}}(this,e,t,r),this}replaceRangeWith(e,t,r){return function(i,o,s,a){if(!a.isInline&&o==s&&i.doc.resolve(o).parent.content.size){let l=function(u,c,d){let h=u.resolve(c);if(h.parent.canReplaceWith(h.index(),h.index(),d))return c;if(h.parentOffset==0)for(let p=h.depth-1;p>=0;p--){let f=h.index(p);if(h.node(p).canReplaceWith(f,f,d))return h.before(p+1);if(f>0)return null}if(h.parentOffset==h.parent.content.size)for(let p=h.depth-1;p>=0;p--){let f=h.indexAfter(p);if(h.node(p).canReplaceWith(f,f,d))return h.after(p+1);if(f<h.node(p).childCount)return null}return null}(i.doc,o,a.type);l!=null&&(o=s=l)}i.replaceRange(o,s,new G(q.from(a),0,0))}(this,e,t,r),this}deleteRange(e,t){return function(r,i,o){let s=r.doc.resolve(i),a=r.doc.resolve(o),l=sE(s,a);for(let u=0;u<l.length;u++){let c=l[u],d=u==l.length-1;if(d&&c==0||s.node(c).type.contentMatch.validEnd)return r.delete(s.start(c),a.end(c));if(c>0&&(d||s.node(c-1).canReplace(s.index(c-1),a.indexAfter(c-1))))return r.delete(s.before(c),a.after(c))}for(let u=1;u<=s.depth&&u<=a.depth;u++)if(i-s.start(u)==s.depth-u&&o>s.end(u)&&a.end(u)-o!=a.depth-u)return r.delete(s.before(u),o);r.delete(i,o)}(this,e,t),this}lift(e,t){return function(r,i,o){let{$from:s,$to:a,depth:l}=i,u=s.before(l+1),c=a.after(l+1),d=u,h=c,p=q.empty,f=0;for(let E=l,v=!1;E>o;E--)v||s.index(E)>0?(v=!0,p=q.from(s.node(E).copy(p)),f++):d--;let m=q.empty,g=0;for(let E=l,v=!1;E>o;E--)v||a.after(E+1)<a.end(E)?(v=!0,m=q.from(a.node(E).copy(m)),g++):h++;r.step(new Mr(d,h,u,c,new G(p.append(m),f,g),p.size-f,!0))}(this,e,t),this}join(e,t=1){return function(r,i,o){let s=new $n(i-o,i+o,G.empty,!0);r.step(s)}(this,e,t),this}wrap(e,t){return function(r,i,o){let s=q.empty;for(let u=o.length-1;u>=0;u--){if(s.size){let c=o[u].type.contentMatch.matchFragment(s);if(!c||!c.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}s=q.from(o[u].type.create(o[u].attrs,s))}let a=i.start,l=i.end;r.step(new Mr(a,l,a,l,new G(s,0,0),o.length,!0))}(this,e,t),this}setBlockType(e,t=e,r,i=null){return function(o,s,a,l,u){if(!l.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let c=o.steps.length;o.doc.nodesBetween(s,a,(d,h)=>{if(d.isTextblock&&!d.hasMarkup(l,u)&&function(p,f,m){let g=p.resolve(f),E=g.index();return g.parent.canReplaceWith(E,E+1,m)}(o.doc,o.mapping.slice(c).map(h),l)){o.clearIncompatible(o.mapping.slice(c).map(h,1),l);let p=o.mapping.slice(c),f=p.map(h,1),m=p.map(h+d.nodeSize,1);return o.step(new Mr(f,m,f+1,m-1,new G(q.from(l.create(u,null,d.marks)),0,0),1,!0)),!1}})}(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return function(o,s,a,l,u){let c=o.doc.nodeAt(s);if(!c)throw new RangeError("No node at given position");a||(a=c.type);let d=a.create(l,null,u||c.marks);if(c.isLeaf)return o.replaceWith(s,s+c.nodeSize,d);if(!a.validContent(c.content))throw new RangeError("Invalid content for node type "+a.name);o.step(new Mr(s,s+c.nodeSize,s+1,s+c.nodeSize-1,new G(q.from(d),0,0),1,!0))}(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new aE(e,t,r)),this}setDocAttribute(e,t){return this.step(new lE(e,t)),this}addNodeMark(e,t){return this.step(new qc(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Oe)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(!(t=t.isInSet(r.marks)))return this}return this.step(new Jc(e,t)),this}split(e,t=1,r){return function(i,o,s=1,a){let l=i.doc.resolve(o),u=q.empty,c=q.empty;for(let d=l.depth,h=l.depth-s,p=s-1;d>h;d--,p--){u=q.from(l.node(d).copy(u));let f=a&&a[p];c=q.from(f?f.type.create(f.attrs,c):l.node(d).copy(c))}i.step(new $n(o,o,new G(u.append(c),s,s),!0))}(this,e,t,r),this}addMark(e,t,r){return function(i,o,s,a){let l,u,c=[],d=[];i.doc.nodesBetween(o,s,(h,p,f)=>{if(!h.isInline)return;let m=h.marks;if(!a.isInSet(m)&&f.type.allowsMarkType(a.type)){let g=Math.max(p,o),E=Math.min(p+h.nodeSize,s),v=a.addToSet(m);for(let A=0;A<m.length;A++)m[A].isInSet(v)||(l&&l.to==g&&l.mark.eq(m[A])?l.to=E:c.push(l=new Ko(g,E,m[A])));u&&u.to==g?u.to=E:d.push(u=new Kc(g,E,a))}}),c.forEach(h=>i.step(h)),d.forEach(h=>i.step(h))}(this,e,t,r),this}removeMark(e,t,r){return function(i,o,s,a){let l=[],u=0;i.doc.nodesBetween(o,s,(c,d)=>{if(!c.isInline)return;u++;let h=null;if(a instanceof Xa){let p,f=c.marks;for(;p=a.isInSet(f);)(h||(h=[])).push(p),f=p.removeFromSet(f)}else a?a.isInSet(c.marks)&&(h=[a]):h=c.marks;if(h&&h.length){let p=Math.min(d+c.nodeSize,s);for(let f=0;f<h.length;f++){let m,g=h[f];for(let E=0;E<l.length;E++){let v=l[E];v.step==u-1&&g.eq(l[E].style)&&(m=v)}m?(m.to=p,m.step=u):l.push({style:g,from:Math.max(d,o),to:p,step:u})}}}),l.forEach(c=>i.step(new Ko(c.from,c.to,c.style)))}(this,e,t,r),this}clearIncompatible(e,t,r){return function(i,o,s,a=s.contentMatch){let l=i.doc.nodeAt(o),u=[],c=o+1;for(let d=0;d<l.childCount;d++){let h=l.child(d),p=c+h.nodeSize,f=a.matchType(h.type);if(f){a=f;for(let m=0;m<h.marks.length;m++)s.allowsMarkType(h.marks[m].type)||i.step(new Ko(c,p,h.marks[m]));if(h.isText&&!s.spec.code){let m,g,E=/\r?\n|\r/g;for(;m=E.exec(h.text);)g||(g=new G(q.from(s.schema.text(" ",s.allowedMarks(h.marks))),0,0)),u.push(new $n(c+m.index,c+m.index+m[0].length,g))}}else u.push(new $n(c,p,G.empty));c=p}if(!a.validEnd){let d=a.fillBefore(q.empty,!0);i.replace(c,c,new G(d,0,0))}for(let d=u.length-1;d>=0;d--)i.step(u[d])}(this,e,t,r),this}}const td=Object.create(null);class ve{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new Mb(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=G.empty){let r=t.content.lastChild,i=null;for(let a=0;a<t.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:u}=s[a],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(u.pos),a?G.empty:t),a==0&&dE(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(r),u=l.map(s.pos),c=l.map(a.pos);o?e.deleteRange(u,c):(e.replaceRangeWith(u,c,t),dE(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new Te(e):Mi(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=t<0?Mi(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Mi(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Ut(e.node(0))}static atStart(e){return Mi(e,e,0,0,1)||new Ut(e)}static atEnd(e){return Mi(e,e,e.content.size,e.childCount,-1)||new Ut(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=td[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in td)throw new RangeError("Duplicate use of selection JSON ID "+e);return td[e]=t,t.prototype.jsonID=e,t}getBookmark(){return Te.between(this.$anchor,this.$head).getBookmark()}}ve.prototype.visible=!0;class Mb{constructor(e,t){this.$from=e,this.$to=t}}let uE=!1;function cE(n){uE||n.parent.inlineContent||(uE=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class Te extends ve{constructor(e,t=e){cE(e),cE(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ve.near(r);let i=e.resolve(t.map(this.anchor));return new Te(i.parent.inlineContent?i:r,r)}replace(e,t=G.empty){if(super.replace(e,t),t==G.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof Te&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ka(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Te(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if(r&&!i||(r=i>=0?1:-1),!t.parent.inlineContent){let o=ve.findFrom(t,r,!0)||ve.findFrom(t,-r,!0);if(!o)return ve.near(t,r);t=o.$head}return e.parent.inlineContent||(i==0||(e=(ve.findFrom(e,-r,!0)||ve.findFrom(e,r,!0)).$anchor).pos<t.pos!=i<0)&&(e=t),new Te(e,t)}}ve.jsonID("text",Te);class Ka{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Ka(e.map(this.anchor),e.map(this.head))}resolve(e){return Te.between(e.resolve(this.anchor),e.resolve(this.head))}}class le extends ve{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),o=e.resolve(i);return r?ve.near(o):new le(o)}content(){return new G(q.from(this.node),0,0)}eq(e){return e instanceof le&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new nd(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new le(e.resolve(t.anchor))}static create(e,t){return new le(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}le.prototype.visible=!1,ve.jsonID("node",le);class nd{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Ka(r,r):new nd(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&le.isSelectable(r)?new le(t):ve.near(t)}}class Ut extends ve{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=G.empty){if(t==G.empty){e.delete(0,e.doc.content.size);let r=ve.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Ut(e)}map(e){return new Ut(e)}eq(e){return e instanceof Ut}getBookmark(){return Pb}}ve.jsonID("all",Ut);const Pb={map(){return this},resolve:n=>new Ut(n)};function Mi(n,e,t,r,i,o=!1){if(e.inlineContent)return Te.create(n,t);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&le.isSelectable(a))return le.create(n,t-(i<0?a.nodeSize:0))}else{let l=Mi(n,a,t+i,i<0?a.childCount:0,i,o);if(l)return l}t+=a.nodeSize*i}return null}function dE(n,e,t){let r=n.steps.length-1;if(r<e)return;let i,o=n.steps[r];(o instanceof $n||o instanceof Mr)&&(n.mapping.maps[r].forEach((s,a,l,u)=>{i==null&&(i=u)}),n.setSelection(ve.near(n.doc.resolve(i),t)))}class Bb extends xb{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 Oe.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 r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||Oe.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(ve.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?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 hE(n,e){return e&&n?n.bind(e):n}class Qo{constructor(e,t,r){this.name=e,this.init=hE(t.init,r),this.apply=hE(t.apply,r)}}const Fb=[new Qo("doc",{init:n=>n.doc||n.schema.topNodeType.createAndFill(),apply:n=>n.doc}),new Qo("selection",{init:(n,e)=>n.selection||ve.atStart(e.doc),apply:n=>n.selection}),new Qo("storedMarks",{init:n=>n.storedMarks||null,apply:(n,e,t,r)=>r.selection.$cursor?n.storedMarks:null}),new Qo("scrollToSelection",{init:()=>0,apply:(n,e)=>n.scrolledIntoView?e+1:e})];class rd{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Fb.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Qo(r.key,r.spec.state,r))})}}class Pi{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 r=0;r<this.config.plugins.length;r++)if(r!=t){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,u=i?i[s].state:this,c=l<t.length&&a.spec.appendTransaction.call(a,l?t.slice(l):t,u,r);if(c&&r.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",e),!i){i=[];for(let d=0;d<this.config.plugins.length;d++)i.push(d<s?{state:r,n:t.length}:{state:this,n:0})}t.push(c),r=r.applyInner(c),o=!0}i&&(i[s]={state:r,n:t.length})}}if(!o)return{state:r,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let t=new Pi(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new Bb(this)}static create(e){let t=new rd(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new Pi(t);for(let i=0;i<t.fields.length;i++)r[t.fields[i].name]=t.fields[i].init(e,r);return r}reconfigure(e){let t=new rd(this.schema,e.plugins),r=t.fields,i=new Pi(t);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new rd(e.schema,e.plugins),o=new Pi(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=kr.fromJSON(e.schema,t.doc);else if(s.name=="selection")o.selection=ve.fromJSON(o.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(t,a))return void(o[s.name]=u.fromJSON.call(l,e,t[a],o))}o[s.name]=s.init(e,o)}}),o}}function pE(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=pE(i,e,{})),t[r]=i}return t}class qa{constructor(e){this.spec=e,this.props={},e.props&&pE(e.props,this,this.props),this.key=e.key?e.key.key:fE("plugin")}getState(e){return e[this.key]}}const id=Object.create(null);function fE(n){return n in id?n+"$"+ ++id[n]:(id[n]=0,n+"$")}class Ja{constructor(e="key"){this.key=fE(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const gt=function(n){for(var e=0;;e++)if(!(n=n.previousSibling))return e},es=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let mE=null;const jn=function(n,e,t){let r=mE||(mE=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Pr=function(n,e,t,r){return t&&(gE(n,e,t,r,-1)||gE(n,e,t,r,1))},Ub=/^(img|br|input|textarea|hr)$/i;function gE(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:yn(n))){let o=n.parentNode;if(!o||o.nodeType!=1||od(n)||Ub.test(n.nodeName)||n.contentEditable=="false")return!1;e=gt(n)+(i<0?0:1),n=o}else{if(n.nodeType!=1||(n=n.childNodes[e+(i<0?-1:0)]).contentEditable=="false")return!1;e=i<0?yn(n):0}}}function yn(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function od(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const Za=function(n){return n.focusNode&&Pr(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Br(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const On=typeof navigator<"u"?navigator:null,EE=typeof document<"u"?document:null,or=On&&On.userAgent||"",sd=/Edge\/(\d+)/.exec(or),vE=/MSIE \d/.exec(or),ad=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(or),bt=!!(vE||ad||sd),sr=vE?document.documentMode:ad?+ad[1]:sd?+sd[1]:0,ln=!bt&&/gecko\/(\d+)/i.test(or);ln&&(/Firefox\/(\d+)/.exec(or)||[0,0])[1];const ld=!bt&&/Chrome\/(\d+)/.exec(or),lt=!!ld,Hb=ld?+ld[1]:0,Et=!bt&&!!On&&/Apple Computer/.test(On.vendor),Bi=Et&&(/Mobile\/\w+/.test(or)||!!On&&On.maxTouchPoints>2),qt=Bi||!!On&&/Mac/.test(On.platform),$b=!!On&&/Win/.test(On.platform),un=/Android \d/.test(or),ts=!!EE&&"webkitFontSmoothing"in EE.documentElement.style,jb=ts?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Yb(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Yn(n,e){return typeof n=="number"?n:n[e]}function zb(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function AE(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;s=es(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,u=l?Yb(o):zb(a),c=0,d=0;if(e.top<u.top+Yn(r,"top")?d=-(u.top-e.top+Yn(i,"top")):e.bottom>u.bottom-Yn(r,"bottom")&&(d=e.bottom-e.top>u.bottom-u.top?e.top+Yn(i,"top")-u.top:e.bottom-u.bottom+Yn(i,"bottom")),e.left<u.left+Yn(r,"left")?c=-(u.left-e.left+Yn(i,"left")):e.right>u.right-Yn(r,"right")&&(c=e.right-u.right+Yn(i,"right")),c||d)if(l)o.defaultView.scrollBy(c,d);else{let h=a.scrollLeft,p=a.scrollTop;d&&(a.scrollTop+=d),c&&(a.scrollLeft+=c);let f=a.scrollLeft-h,m=a.scrollTop-p;e={left:e.left-f,top:e.top-m,right:e.right-f,bottom:e.bottom-m}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function _E(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=es(r));return e}function yE(n,e){for(let t=0;t<n.length;t++){let{dom:r,top:i,left:o}=n[t];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let Fi=null;function OE(n,e){let t,r,i,o,s=2e8,a=0,l=e.top,u=e.top;for(let c=n.firstChild,d=0;c;c=c.nextSibling,d++){let h;if(c.nodeType==1)h=c.getClientRects();else{if(c.nodeType!=3)continue;h=jn(c).getClientRects()}for(let p=0;p<h.length;p++){let f=h[p];if(f.top<=l&&f.bottom>=u){l=Math.max(f.bottom,l),u=Math.min(f.top,u);let m=f.left>e.left?f.left-e.left:f.right<e.left?e.left-f.right:0;if(m<s){t=c,s=m,r=m&&t.nodeType==3?{left:f.right<e.left?f.right:f.left,top:e.top}:e,c.nodeType==1&&m&&(a=d+(e.left>=(f.left+f.right)/2?1:0));continue}}else f.top>e.top&&!i&&f.left<=e.left&&f.right>=e.left&&(i=c,o={left:Math.max(f.left,Math.min(f.right,e.left)),top:f.top});!t&&(e.left>=f.right&&e.top>=f.top||e.left>=f.left&&e.top>=f.bottom)&&(a=d+1)}}return!t&&i&&(t=i,r=o,s=0),t&&t.nodeType==3?function(c,d){let h=c.nodeValue.length,p=document.createRange();for(let f=0;f<h;f++){p.setEnd(c,f+1),p.setStart(c,f);let m=ar(p,1);if(m.top!=m.bottom&&ud(d,m))return{node:c,offset:f+(d.left>=(m.left+m.right)/2?1:0)}}return{node:c,offset:0}}(t,r):!t||s&&t.nodeType==1?{node:n,offset:a}:OE(t,r)}function ud(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function TE(n,e,t){let r=n.childNodes.length;if(r&&t.top<t.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-t.top)/(t.bottom-t.top))-2)),o=i;;){let s=n.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(ud(e,u))return TE(s,e,u)}}if((o=(o+1)%r)==i)break}return n}function Vb(n,e){let t,r=n.dom.ownerDocument,i=0,o=function(u,c,d){if(u.caretPositionFromPoint)try{let h=u.caretPositionFromPoint(c,d);if(h)return{node:h.offsetNode,offset:h.offset}}catch{}if(u.caretRangeFromPoint){let h=u.caretRangeFromPoint(c,d);if(h)return{node:h.startContainer,offset:h.startOffset}}}(r,e.left,e.top);o&&({node:t,offset:i}=o);let s,a=(n.root.elementFromPoint?n.root:r).elementFromPoint(e.left,e.top);if(!a||!n.dom.contains(a.nodeType!=1?a.parentNode:a)){let u=n.dom.getBoundingClientRect();if(!ud(e,u)||(a=TE(n.dom,e,u),!a))return null}if(Et)for(let u=a;t&&u;u=es(u))u.draggable&&(t=void 0);if(a=function(u,c){let d=u.parentNode;return d&&/^li$/i.test(d.nodeName)&&c.left<u.getBoundingClientRect().left?d:u}(a,e),t){if(ln&&t.nodeType==1&&(i=Math.min(i,t.childNodes.length),i<t.childNodes.length)){let c,d=t.childNodes[i];d.nodeName=="IMG"&&(c=d.getBoundingClientRect()).right<=e.left&&c.bottom>e.top&&i++}let u;ts&&i&&t.nodeType==1&&(u=t.childNodes[i-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&i--,t==n.dom&&i==t.childNodes.length-1&&t.lastChild.nodeType==1&&e.top>t.lastChild.getBoundingClientRect().bottom?s=n.state.doc.content.size:i!=0&&t.nodeType==1&&t.childNodes[i-1].nodeName=="BR"||(s=function(c,d,h,p){let f=-1;for(let m=d,g=!1;m!=c.dom;){let E=c.docView.nearestDesc(m,!0);if(!E)return null;if(E.dom.nodeType==1&&(E.node.isBlock&&E.parent&&!g||!E.contentDOM)){let v=E.dom.getBoundingClientRect();if(E.node.isBlock&&E.parent&&!g&&(g=!0,v.left>p.left||v.top>p.top?f=E.posBefore:(v.right<p.left||v.bottom<p.top)&&(f=E.posAfter)),!E.contentDOM&&f<0&&!E.node.isText)return(E.node.isBlock?p.top<(v.top+v.bottom)/2:p.left<(v.left+v.right)/2)?E.posBefore:E.posAfter}m=E.dom.parentNode}return f>-1?f:c.docView.posFromDOM(d,h,-1)}(n,t,i,e))}s==null&&(s=function(u,c,d){let{node:h,offset:p}=OE(c,d),f=-1;if(h.nodeType==1&&!h.firstChild){let m=h.getBoundingClientRect();f=m.left!=m.right&&d.left>(m.left+m.right)/2?1:-1}return u.docView.posFromDOM(h,p,f)}(n,a,e));let l=n.docView.nearestDesc(a,!0);return{pos:s,inside:l?l.posAtStart-l.border:-1}}function SE(n){return n.top<n.bottom||n.left<n.right}function ar(n,e){let t=n.getClientRects();if(t.length){let r=t[e<0?0:t.length-1];if(SE(r))return r}return Array.prototype.find.call(t,SE)||n.getBoundingClientRect()}const Wb=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function bE(n,e,t){let{node:r,offset:i,atom:o}=n.docView.domFromPos(e,t<0?-1:1),s=ts||ln;if(r.nodeType==3){if(!s||!Wb.test(r.nodeValue)&&(t<0?i:i!=r.nodeValue.length)){let a=i,l=i,u=t<0?1:-1;return t<0&&!i?(l++,u=-1):t>=0&&i==r.nodeValue.length?(a--,u=1):t<0?a--:l++,ns(ar(jn(r,a,l),u),u<0)}{let a=ar(jn(r,i,i),t);if(ln&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let l=ar(jn(r,i-1,i-1),-1);if(l.top==a.top){let u=ar(jn(r,i,i+1),-1);if(u.top!=a.top)return ns(u,u.left<l.left)}}return a}}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==yn(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return cd(a.getBoundingClientRect(),!1)}if(o==null&&i<yn(r)){let a=r.childNodes[i];if(a.nodeType==1)return cd(a.getBoundingClientRect(),!0)}return cd(r.getBoundingClientRect(),t>=0)}if(o==null&&i&&(t<0||i==yn(r))){let a=r.childNodes[i-1],l=a.nodeType==3?jn(a,yn(a)-(s?0:1)):a.nodeType!=1||a.nodeName=="BR"&&a.nextSibling?null:a;if(l)return ns(ar(l,1),!1)}if(o==null&&i<yn(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let l=a?a.nodeType==3?jn(a,0,s?0:1):a.nodeType==1?a:null:null;if(l)return ns(ar(l,-1),!0)}return ns(ar(r.nodeType==3?jn(r):r,-t),t>=0)}function ns(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function cd(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function NE(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}const Gb=/[\u0590-\u08ac]/;let CE=null,IE=null,wE=!1;function Xb(n,e,t){return CE==e&&IE==t?wE:(CE=e,IE=t,wE=t=="up"||t=="down"?function(r,i,o){let s=i.selection,a=o=="up"?s.$from:s.$to;return NE(r,i,()=>{let{node:l}=r.docView.domFromPos(a.pos,o=="up"?-1:1);for(;;){let c=r.docView.nearestDesc(l,!0);if(!c)break;if(c.node.isBlock){l=c.contentDOM||c.dom;break}l=c.dom.parentNode}let u=bE(r,a.pos,1);for(let c=l.firstChild;c;c=c.nextSibling){let d;if(c.nodeType==1)d=c.getClientRects();else{if(c.nodeType!=3)continue;d=jn(c,0,c.nodeValue.length).getClientRects()}for(let h=0;h<d.length;h++){let p=d[h];if(p.bottom>p.top+1&&(o=="up"?u.top-p.top>2*(p.bottom-u.top):p.bottom-u.bottom>2*(u.bottom-p.top)))return!1}}return!0})}(n,e,t):function(r,i,o){let{$head:s}=i.selection;if(!s.parent.isTextblock)return!1;let a=s.parentOffset,l=!a,u=a==s.parent.content.size,c=r.domSelection();return Gb.test(s.parent.textContent)&&c.modify?NE(r,i,()=>{let{focusNode:d,focusOffset:h,anchorNode:p,anchorOffset:f}=r.domSelectionRange(),m=c.caretBidiLevel;c.modify("move",o,"character");let g=s.depth?r.docView.domAfterPos(s.before()):r.dom,{focusNode:E,focusOffset:v}=r.domSelectionRange(),A=E&&!g.contains(E.nodeType==1?E:E.parentNode)||d==E&&h==v;try{c.collapse(p,f),d&&(d!=p||h!=f)&&c.extend&&c.extend(d,h)}catch{}return m!=null&&(c.caretBidiLevel=m),A}):o=="left"||o=="backward"?l:u}(n,e,t))}class rs{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=0,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){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,r=this.posAtStart;;t++){let i=this.children[t];if(i==e)return r;r+=i.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,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode)){if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&(!(s=o.pmViewDesc)||s.parent!=this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}{let o,s;if(e==this.contentDOM)o=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&(!(s=o.pmViewDesc)||s.parent!=this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}}let i;if(e==this.dom&&this.contentDOM)i=t>gt(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o,s=this.getDesc(i);if(s&&(!t||s.node)){if(!r||!(o=s.nodeDOM)||(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))return s;r=!1}}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;t<this.children.length;t++){let i=this.children[t],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof kE){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof RE&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,o&&o.dom.parentNode!=this.contentDOM;r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?gt(o.dom)+1:0}}{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,o&&o.dom.parentNode!=this.contentDOM;r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,t):{node:this.contentDOM,offset:o?gt(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],u=s+l.size;if(i==-1&&e<=u){let c=s+l.border;if(e>=c&&t<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,c);e=s;for(let d=a;d>0;d--){let h=this.children[d-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=gt(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(u>t||a==this.children.length-1)){t=u;for(let c=a+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){o=gt(d.dom);break}t+=d.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=u}return{node:this.contentDOM,from:e,to:t,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:r}=this.domFromPos(e,0);if(t.nodeType!=1||r==t.childNodes.length)throw new RangeError("No node after pos "+e);return t.childNodes[r]}setSelection(e,t,r,i=!1){let o=Math.min(e,t),s=Math.max(e,t);for(let h=0,p=0;h<this.children.length;h++){let f=this.children[h],m=p+f.size;if(o>p&&s<m)return f.setSelection(e-p-f.border,t-p-f.border,r,i);p=m}let a=this.domFromPos(e,e?-1:1),l=t==e?a:this.domFromPos(t,t?-1:1),u=r.getSelection(),c=!1;if((ln||Et)&&e==t){let{node:h,offset:p}=a;if(h.nodeType==3){if(c=!(!p||h.nodeValue[p-1]!=`
79
+ `),c&&p==h.nodeValue.length)for(let f,m=h;m;m=m.parentNode){if(f=m.nextSibling){f.nodeName=="BR"&&(a=l={node:f.parentNode,offset:gt(f)+1});break}let g=m.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let f=h.childNodes[p-1];c=f&&(f.nodeName=="BR"||f.contentEditable=="false")}}if(ln&&u.focusNode&&u.focusNode!=l.node&&u.focusNode.nodeType==1){let h=u.focusNode.childNodes[u.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||c&&Et)&&Pr(a.node,a.offset,u.anchorNode,u.anchorOffset)&&Pr(l.node,l.offset,u.focusNode,u.focusOffset))return;let d=!1;if((u.extend||e==t)&&!c){u.collapse(a.node,a.offset);try{e!=t&&u.extend(l.node,l.offset),d=!0}catch{}}if(!d){if(e>t){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&t>=r:e<s&&t>r){let a=r+o.border,l=s-o.border;if(e>=a&&t<=l)return this.dirty=e==r||t==s?2:1,void(e!=a||t!=l||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=s}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?2:1;t.dirty<r&&(t.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}}class RE extends rs{constructor(e,t,r,i){let o,s=t.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:i)),!t.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==0&&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 e.type!="selection"||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 Kb extends rs{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}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 e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Fr extends rs{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return s&&s.dom||(s=Hn.renderSpec(document,t.type.spec.toDOM(t,r))),new Fr(e,t,s.dom,s.contentDOM||s.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 this.dirty!=3&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=0){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=0}}slice(e,t,r){let i=Fr.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;t<s&&(o=pd(o,t,s,r)),e>0&&(o=pd(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}}class lr extends rs{constructor(e,t,r,i,o,s,a,l,u){super(e,[],o,s),this.node=t,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,t,r,i,o,s){let a,l=o.nodeViews[t.type.name],u=l&&l(t,o,()=>a?a.parent?a.parent.posBeforeChild(a):void 0:s,r,i),c=u&&u.dom,d=u&&u.contentDOM;if(t.isText)if(c){if(c.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else c||({dom:c,contentDOM:d}=Hn.renderSpec(document,t.type.spec.toDOM(t)));d||t.isText||c.nodeName=="BR"||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let h=c;return c=ME(c,r,t),u?a=new qb(e,t,r,i,c,d||null,h,u,o,s+1):t.isText?new Qa(e,t,r,i,c,h,o):new lr(e,t,r,i,c,d||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>q.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,r){return this.dirty==0&&e.eq(this.node)&&hd(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new Zb(this,s&&s.node,e);(function(u,c,d,h){let p=c.locals(u),f=0;if(p.length==0){for(let v=0;v<u.childCount;v++){let A=u.child(v);h(A,p,c.forChild(f,A),v),f+=A.nodeSize}return}let m=0,g=[],E=null;for(let v=0;;){let A,_,y,T;for(;m<p.length&&p[m].to==f;){let O=p[m++];O.widget&&(A?(_||(_=[A])).push(O):A=O)}if(A)if(_){_.sort(Qb);for(let O=0;O<_.length;O++)d(_[O],v,!!E)}else d(A,v,!!E);if(E)T=-1,y=E,E=null;else{if(!(v<u.childCount))break;T=v,y=u.child(v++)}for(let O=0;O<g.length;O++)g[O].to<=f&&g.splice(O--,1);for(;m<p.length&&p[m].from<=f&&p[m].to>f;)g.push(p[m++]);let S=f+y.nodeSize;if(y.isText){let O=S;m<p.length&&p[m].from<O&&(O=p[m].from);for(let C=0;C<g.length;C++)g[C].to<O&&(O=g[C].to);O<S&&(E=y.cut(O-f),y=y.cut(0,O-f),S=O,T=-1)}else for(;m<p.length&&p[m].to<=S;)m++;let b=y.isInline&&!y.isLeaf?g.filter(O=>!O.inline):g.slice();h(y,b,c.forChild(f,y),T),f=S}})(this.node,this.innerDeco,(u,c,d)=>{u.spec.marks?l.syncToMarks(u.spec.marks,r,e):u.type.side>=0&&!d&&l.syncToMarks(c==this.node.childCount?Oe.none:this.node.child(c).marks,r,e),l.placeWidget(u,e,i)},(u,c,d,h)=>{let p;l.syncToMarks(u.marks,r,e),l.findNodeMatch(u,c,d,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+u.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(u,c,d,p,e)||l.updateNextNode(u,c,d,e,h,i)||l.addNode(u,c,d,e,i),i+=u.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==2)&&(s&&this.protectLocalComposition(e,s),LE(this.contentDOM,this.children,e),Bi&&function(u){if(u.nodeName=="UL"||u.nodeName=="OL"){let c=u.style.cssText;u.style.cssText=c+"; list-style: square !important",window.getComputedStyle(u).listStyle,u.style.cssText=c}}(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof Te)||r<t||i>t+this.node.content.size)return null;let o=e.domSelectionRange(),s=function(a,l){for(;;){if(a.nodeType==3)return a;if(a.nodeType==1&&l>0){if(a.childNodes.length>l&&a.childNodes[l].nodeType==3)return a.childNodes[l];l=yn(a=a.childNodes[l-1])}else{if(!(a.nodeType==1&&l<a.childNodes.length))return null;a=a.childNodes[l],l=0}}}(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let a=s.nodeValue,l=function(u,c,d,h){for(let p=0,f=0;p<u.childCount&&f<=h;){let m=u.child(p++),g=f;if(f+=m.nodeSize,!m.isText)continue;let E=m.text;for(;p<u.childCount;){let v=u.child(p++);if(f+=v.nodeSize,!v.isText)break;E+=v.text}if(f>=d){if(f>=h&&E.slice(h-c.length-g,h-g)==c)return h-c.length;let v=g<h?E.lastIndexOf(c,h-g-1):-1;if(v>=0&&v+c.length+g>=d)return g+v;if(d==h&&E.length>=h+c.length-g&&E.slice(h-g,h-g+c.length)==c)return h}}return-1}(this.node.content,a,r-t,i-t);return l<0?null:{node:s,pos:l,text:a}}return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new Kb(this,o,t,i);e.input.compositionNodes.push(s),this.children=pd(this.children,r,r+i.length,e,s)}update(e,t,r,i){return!(this.dirty==3||!e.sameMarkup(this.node))&&(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(hd(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=xE(this.dom,this.nodeDOM,dd(this.outerDeco,this.node,t),dd(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function DE(n,e,t,r,i){ME(r,e,n);let o=new lr(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Qa extends lr{constructor(e,t,r,i,o,s,a){super(e,t,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return!(this.dirty==3||this.dirty!=0&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),this.dirty==0&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.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,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new Qa(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||e!=0&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class kE extends rs{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==0&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class qb extends lr{constructor(e,t,r,i,o,s,a,l,u,c){super(e,t,r,i,o,s,a,u,c),this.spec=l}update(e,t,r,i){if(this.dirty==3)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}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 LE(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==n){for(;a!=r;)r=PE(r),i=!0;r=r.nextSibling}else i=!0,n.insertBefore(a,r);if(s instanceof Fr){let l=r?r.previousSibling:n.lastChild;LE(s.contentDOM,s.children,t),r=l?l.nextSibling:n.firstChild}}for(;r;)r=PE(r),i=!0;i&&t.trackWrites==n&&(t.trackWrites=null)}const is=function(n){n&&(this.nodeName=n)};is.prototype=Object.create(null);const Ur=[new is];function dd(n,e,t){if(n.length==0)return Ur;let r=t?Ur[0]:new is,i=[r];for(let o=0;o<n.length;o++){let s=n[o].type.attrs;if(s){s.nodeName&&i.push(r=new is(s.nodeName));for(let a in s){let l=s[a];l!=null&&(t&&i.length==1&&i.push(r=new is(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function xE(n,e,t,r){if(t==Ur&&r==Ur)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=t[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=n&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=Ur[0]),i=l}Jb(i,a||Ur[0],s)}return i}function Jb(n,e,t){for(let r in e)r=="class"||r=="style"||r=="nodeName"||r in t||n.removeAttribute(r);for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&t[r]!=e[r]&&n.setAttribute(r,t[r]);if(e.class!=t.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=t.class?t.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&n.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&n.classList.add(i[o]);n.classList.length==0&&n.removeAttribute("class")}if(e.style!=t.style){if(e.style){let r,i=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g;for(;r=i.exec(e.style);)n.style.removeProperty(r[1])}t.style&&(n.style.cssText+=t.style)}}function ME(n,e,t){return xE(n,n,Ur,dd(e,t,n.nodeType!=1))}function hd(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].type.eq(e[t].type))return!1;return!0}function PE(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class Zb{constructor(e,t,r){this.lock=t,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(i,o){let s=o,a=s.children.length,l=i.childCount,u=new Map,c=[];e:for(;l>0;){let d;for(;;)if(a){let p=s.children[a-1];if(!(p instanceof Fr)){d=p,a--;break}s=p,a=p.children.length}else{if(s==o)break e;a=s.parent.children.indexOf(s),s=s.parent}let h=d.node;if(h){if(h!=i.child(l-1))break;--l,u.set(d,l),c.push(d)}}return{index:l,matched:u,matches:c.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let r=e;r<t;r++)this.top.children[r].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let u=this.top.children[l];if(u.matchesMark(e[o])&&!this.isLocked(u.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Fr.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o,s=-1;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(e,t,r)&&!this.preMatch.matched.has(u)){s=a;break}}return!(s<0)&&(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,t,r,i,o){let s=this.top.children[i];return s.dirty==3&&s.dom==s.contentDOM&&(s.dirty=2),!!s.update(e,t,r,o)&&(this.destroyBetween(this.index,i),this.index++,!0)}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=t}}updateNextNode(e,t,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof lr){let u=this.preMatch.matched.get(l);if(u!=null&&u!=o)return!1;let c,d=l.dom,h=this.isLocked(d)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=3&&hd(t,l.outerDeco));if(!h&&l.update(e,t,r,i))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!h&&(c=this.recreateWrapper(l,e,t,r,i,s)))return this.top.children[this.index]=c,c.contentDOM&&(c.dirty=2,c.updateChildren(i,s+1),c.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,r,i,o,s){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content))return null;let a=lr.create(this.top,t,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,t,r,i,o){let s=lr.create(this.top,e,t,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,t,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(!i||!i.matchesWidget(e)||e!=i.widget&&i.widget.type.toDOM.parentNode){let o=new RE(this.top,e,t,r);this.top.children.splice(this.index++,0,o),this.changed=!0}else this.index++}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Fr;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Qa)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Et||lt)&&e&&e.dom.contentEditable=="false"&&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 r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new kE(this.top,[],r,null);t!=this.top?t.children.push(i):t.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Qb(n,e){return n.type.side-e.type.side}function pd(n,e,t,r,i){let o=[];for(let s=0,a=0;s<n.length;s++){let l=n[s],u=a,c=a+=l.size;u>=t||c<=e?o.push(l):(u<e&&o.push(l.slice(0,e-u,r)),i&&(o.push(i),i=void 0),c>t&&o.push(l.slice(t-u,l.size,r)))}return o}function fd(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let a,l,u=r.resolve(s);if(Za(t)){for(a=u;i&&!i.node;)i=i.parent;let c=i.node;if(i&&c.isAtom&&le.isSelectable(c)&&i.parent&&(!c.isInline||!function(d,h,p){for(let f=h==0,m=h==yn(d);f||m;){if(d==p)return!0;let g=gt(d);if(!(d=d.parentNode))return!1;f=f&&g==0,m=m&&g==yn(d)}}(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;l=new le(s==d?u:r.resolve(d))}}else{let c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null;a=r.resolve(c)}return l||(l=gd(n,a,u,e=="pointer"||n.state.selection.head<u.pos&&!o?1:-1)),l}function BE(n){return n.editable?n.hasFocus():zE(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function zn(n,e=!1){let t=n.state.selection;if($E(n,t),BE(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&lt){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Pr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset))return n.input.mouseDown.delayedSelectionSync=!0,void n.domObserver.setCurSelection()}if(n.domObserver.disconnectSelection(),n.cursorWrapper)(function(r){let i=r.domSelection(),o=document.createRange(),s=r.cursorWrapper.dom,a=s.nodeName=="IMG";a?o.setEnd(s.parentNode,gt(s)+1):o.setEnd(s,0),o.collapse(!1),i.removeAllRanges(),i.addRange(o),!a&&!r.state.selection.visible&&bt&&sr<=11&&(s.disabled=!0,s.disabled=!1)})(n);else{let r,i,{anchor:o,head:s}=t;!FE||t instanceof Te||(t.$from.parent.inlineContent||(r=UE(n,t.from)),t.empty||t.$from.parent.inlineContent||(i=UE(n,t.to))),n.docView.setSelection(o,s,n.root,e),FE&&(r&&HE(r),i&&HE(i)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&function(a){let l=a.dom.ownerDocument;l.removeEventListener("selectionchange",a.input.hideSelectionGuard);let u=a.domSelectionRange(),c=u.anchorNode,d=u.anchorOffset;l.addEventListener("selectionchange",a.input.hideSelectionGuard=()=>{u.anchorNode==c&&u.anchorOffset==d||(l.removeEventListener("selectionchange",a.input.hideSelectionGuard),setTimeout(()=>{BE(a)&&!a.state.selection.visible||a.dom.classList.remove("ProseMirror-hideselection")},20))})}(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const FE=Et||lt&&Hb<63;function UE(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,o=r?t.childNodes[r-1]:null;if(Et&&i&&i.contentEditable=="false")return md(i);if(!(i&&i.contentEditable!="false"||o&&o.contentEditable!="false")){if(i)return md(i);if(o)return md(o)}}function md(n){return n.contentEditable="true",Et&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function HE(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function $E(n,e){if(e instanceof le){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(jE(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else jE(n)}function jE(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function gd(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||Te.between(e,t,r)}function YE(n){return!(n.editable&&!n.hasFocus())&&zE(n)}function zE(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Ed(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&ve.findFrom(o,e)}function ur(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function VE(n,e,t){let r=n.state.selection;if(!(r instanceof Te)){if(r instanceof le&&r.node.isInline)return ur(n,new Te(e>0?r.$to:r.$from));{let i=Ed(n.state,e);return!!i&&ur(n,i)}}if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return ur(n,new Te(r.$anchor,s))}if(!r.empty)return!1;if(n.endOfTextblock(e>0?"forward":"backward")){let i=Ed(n.state,e);return!!(i&&i instanceof le)&&ur(n,i)}if(!(qt&&t.indexOf("m")>-1)){let i,o=r.$head,s=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!s||s.isText)return!1;let a=e<0?o.pos-s.nodeSize:o.pos;return!!(s.isAtom||(i=n.docView.descAt(a))&&!i.contentDOM)&&(le.isSelectable(s)?ur(n,new le(e<0?n.state.doc.resolve(o.pos-s.nodeSize):o)):!!ts&&ur(n,new Te(n.state.doc.resolve(e<0?a:a+s.nodeSize))))}}function el(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ss(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Ui(n,e){return e<0?function(t){let r=t.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s,a,l=!1;for(ln&&i.nodeType==1&&o<el(i)&&ss(i.childNodes[o],-1)&&(l=!0);;)if(o>0){if(i.nodeType!=1)break;{let u=i.childNodes[o-1];if(ss(u,-1))s=i,a=--o;else{if(u.nodeType!=3)break;i=u,o=i.nodeValue.length}}}else{if(WE(i))break;{let u=i.previousSibling;for(;u&&ss(u,-1);)s=i.parentNode,a=gt(u),u=u.previousSibling;if(u)i=u,o=el(i);else{if(i=i.parentNode,i==t.dom)break;o=0}}}l?vd(t,i,o):s&&vd(t,s,a)}(n):function(t){let r=t.domSelectionRange(),i=r.focusNode,o=r.focusOffset;if(!i)return;let s,a,l=el(i);for(;;)if(o<l){if(i.nodeType!=1||!ss(i.childNodes[o],1))break;s=i,a=++o}else{if(WE(i))break;{let u=i.nextSibling;for(;u&&ss(u,1);)s=u.parentNode,a=gt(u)+1,u=u.nextSibling;if(u)i=u,o=0,l=el(i);else{if(i=i.parentNode,i==t.dom)break;o=l=0}}}s&&vd(t,s,a)}(n)}function WE(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function vd(n,e,t){if(e.nodeType!=3){let o,s;(s=function(a,l){for(;a&&l==a.childNodes.length&&!od(a);)l=gt(a)+1,a=a.parentNode;for(;a&&l<a.childNodes.length;){let u=a.childNodes[l];if(u.nodeType==3)return u;if(u.nodeType==1&&u.contentEditable=="false")break;a=u,l=0}}(e,t))?(e=s,t=0):(o=function(a,l){for(;a&&!l&&!od(a);)l=gt(a),a=a.parentNode;for(;a&&l;){let u=a.childNodes[l-1];if(u.nodeType==3)return u;if(u.nodeType==1&&u.contentEditable=="false")break;l=(a=u).childNodes.length}}(e,t))&&(e=o,t=o.nodeValue.length)}let r=n.domSelection();if(Za(r)){let o=document.createRange();o.setEnd(e,t),o.setStart(e,t),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&zn(n)},50)}function GE(n,e){let t=n.state.doc.resolve(e);if(!lt&&!$b&&t.parent.inlineContent){let r=n.coordsAtPos(e);if(e>t.start()){let i=n.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left<r.left?"ltr":"rtl"}if(e<t.end()){let i=n.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(i.left-r.left)>1)return i.left>r.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function XE(n,e,t){let r=n.state.selection;if(r instanceof Te&&!r.empty||t.indexOf("s")>-1||qt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=Ed(n.state,e);if(s&&s instanceof le)return ur(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Ut?ve.near(s,e):ve.findFrom(s,e);return!!a&&ur(n,a)}return!1}function KE(n,e){if(!(n.state.selection instanceof Te))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function qE(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function eN(n,e){let t=e.keyCode,r=function(i){let o="";return i.ctrlKey&&(o+="c"),i.metaKey&&(o+="m"),i.altKey&&(o+="a"),i.shiftKey&&(o+="s"),o}(e);if(t==8||qt&&t==72&&r=="c")return KE(n,-1)||Ui(n,-1);if(t==46&&!e.shiftKey||qt&&t==68&&r=="c")return KE(n,1)||Ui(n,1);if(t==13||t==27)return!0;if(t==37||qt&&t==66&&r=="c"){let i=t==37?GE(n,n.state.selection.from)=="ltr"?-1:1:-1;return VE(n,i,r)||Ui(n,i)}if(t==39||qt&&t==70&&r=="c"){let i=t==39?GE(n,n.state.selection.from)=="ltr"?1:-1:1;return VE(n,i,r)||Ui(n,i)}return t==38||qt&&t==80&&r=="c"?XE(n,-1,r)||Ui(n,-1):t==40||qt&&t==78&&r=="c"?function(i){if(!Et||i.state.selection.$head.parentOffset>0)return!1;let{focusNode:o,focusOffset:s}=i.domSelectionRange();if(o&&o.nodeType==1&&s==0&&o.firstChild&&o.firstChild.contentEditable=="false"){let a=o.firstChild;qE(i,a,"true"),setTimeout(()=>qE(i,a,"false"),20)}return!1}(n)||XE(n,1,r)||Ui(n,1):r==(qt?"m":"c")&&(t==66||t==73||t==89||t==90)}function JE(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=n.someProp("clipboardSerializer")||Hn.fromSchema(n.state.schema),a=o0(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let u,c=l.firstChild,d=0;for(;c&&c.nodeType==1&&(u=r0[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let f=a.createElement(u[p]);for(;l.firstChild;)f.appendChild(l.firstChild);l.appendChild(f),d++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(t)}`);let h=n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,`
80
80
 
81
81
  `);return{dom:l,text:h}}function ZE(n,e,t,r,i){let o,s,a=i.parent.type.spec.code;if(!t&&!e)return null;let l=e&&(r||a||!t);if(l){if(n.someProp("transformPastedText",h=>{e=h(e,a||r,n)}),a)return e?new G(q.from(n.state.schema.text(e.replace(/\r\n?/g,`
82
- `))),0,0):G.empty;let d=n.someProp("clipboardTextParser",h=>h(e,i,r,n));if(d)s=d;else{let h=i.marks(),{schema:p}=n.state,f=Hn.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=o.appendChild(document.createElement("p"));m&&g.appendChild(f.serializeNode(p.text(m,h)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),o=function(d){let h=/^(\s*<meta [^>]*>)*/.exec(d);h&&(d=d.slice(h[0].length));let p,f=o0().createElement("div"),m=/<([a-z][^>\s]+)/i.exec(d);if((p=m&&r0[m[1].toLowerCase()])&&(d=p.map(g=>"<"+g+">").join("")+d+p.map(g=>"</"+g+">").reverse().join("")),f.innerHTML=d,p)for(let g=0;g<p.length;g++)f=f.querySelector(p[g])||f;return f}(t),ts&&function(d){let h=d.querySelectorAll(lt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let p=0;p<h.length;p++){let f=h[p];f.childNodes.length==1&&f.textContent==" "&&f.parentNode&&f.parentNode.replaceChild(d.ownerDocument.createTextNode(" "),f)}}(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(s||(s=(n.someProp("clipboardParser")||n.someProp("domParser")||Xo.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:h=>h.nodeName!="BR"||h.nextSibling||!h.parentNode||tN.test(h.parentNode.nodeName)?null:{ignore:!0}})),c)s=function(d,h){if(!d.size)return d;let p,f=d.content.firstChild.type.schema;try{p=JSON.parse(h)}catch{return d}let{content:m,openStart:g,openEnd:E}=d;for(let v=p.length-2;v>=0;v-=2){let A=f.nodes[p[v]];if(!A||A.hasRequiredAttrs())break;m=q.from(A.create(p[v+1],m)),g++,E++}return new G(m,g,E)}(n0(s,+c[1],+c[2]),c[4]);else if(s=G.maxOpen(function(d,h){if(d.childCount<2)return d;for(let p=h.depth;p>=0;p--){let f,m=h.node(p).contentMatchAt(h.index(p)),g=[];if(d.forEach(E=>{if(!g)return;let v,A=m.findWrapping(E.type);if(!A)return g=null;if(v=g.length&&f.length&&e0(A,f,E,g[g.length-1],0))g[g.length-1]=v;else{g.length&&(g[g.length-1]=t0(g[g.length-1],f.length));let _=QE(E,A);g.push(_),m=m.matchType(_.type),f=A}}),g)return q.from(g)}return d}(s.content,i),!0),s.openStart||s.openEnd){let d=0,h=0;for(let p=s.content.firstChild;d<s.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=s.content.lastChild;h<s.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);s=n0(s,d,h)}return n.someProp("transformPasted",d=>{s=d(s,n)}),s}const tN=/^(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 QE(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,q.from(n));return n}function e0(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=e0(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(q.from(QE(t,n,i+1))))}}function t0(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,t0(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(q.empty,!0);return n.copy(t.append(r))}function Ad(n,e,t,r,i,o){let s=e<0?n.firstChild:n.lastChild,a=s.content;return n.childCount>1&&(o=0),i<r-1&&(a=Ad(a,e,t,r,i+1,o)),i>=t&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(q.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(a))}function n0(n,e,t){return e<n.openStart&&(n=new G(Ad(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new G(Ad(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const r0={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 i0=null;function o0(){return i0||(i0=document.implementation.createHTMLDocument("title"))}const vt={},At={},nN={touchstart:!0,touchmove:!0};class rN{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 cr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function _d(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>yd(n,r))})}function yd(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return!!r&&(r(n,e)||e.defaultPrevented)})}function iN(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function tl(n){return{left:n.clientX,top:n.clientY}}function Od(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,a=>s>o.depth?a(n,t,o.nodeAfter,o.before(s),i,!0):a(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function Hi(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function oN(n,e,t,r,i){return Od(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?function(o,s){if(s==-1)return!1;let a,l,u=o.state.selection;u instanceof le&&(a=u.node);let c=o.state.doc.resolve(s);for(let d=c.depth+1;d>0;d--){let h=d>c.depth?c.nodeAfter:c.node(d);if(le.isSelectable(h)){l=a&&u.$from.depth>0&&d>=u.$from.depth&&c.before(u.$from.depth+1)==u.$from.pos?c.before(u.$from.depth):c.before(d);break}}return l!=null&&(Hi(o,le.create(o.state.doc,l)),!0)}(n,t):function(o,s){if(s==-1)return!1;let a=o.state.doc.resolve(s),l=a.nodeAfter;return!!(l&&l.isAtom&&le.isSelectable(l))&&(Hi(o,new le(a)),!0)}(n,t))}function sN(n,e,t,r){return Od(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function aN(n,e,t,r){return Od(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||function(i,o,s){if(s.button!=0)return!1;let a=i.state.doc;if(o==-1)return!!a.inlineContent&&(Hi(i,Te.create(a,0,a.content.size)),!0);let l=a.resolve(o);for(let u=l.depth+1;u>0;u--){let c=u>l.depth?l.nodeAfter:l.node(u),d=l.before(u);if(c.inlineContent)Hi(i,Te.create(a,d+1,d+1+c.content.size));else{if(!le.isSelectable(c))continue;Hi(i,le.create(a,d))}return!0}}(n,t,r)}function Td(n){return nl(n)}At.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!a0(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!un||!lt||t.keyCode!=13))if(t.keyCode!=229&&n.domObserver.forceFlush(),!Bi||t.keyCode!=13||t.ctrlKey||t.altKey||t.metaKey)n.someProp("handleKeyDown",r=>r(n,t))||eN(n,t)?t.preventDefault():cr(n,"key");else{let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Br(13,"Enter"))),n.input.lastIOSEnter=0)},200)}},At.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},At.keypress=(n,e)=>{let t=e;if(a0(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||qt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t)))return void t.preventDefault();let r=n.state.selection;if(!(r instanceof Te&&r.$from.sameParent(r.$to))){let i=String.fromCharCode(t.charCode);/[\r\n]/.test(i)||n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))||n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};const s0=qt?"metaKey":"ctrlKey";vt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Td(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&function(a,l){let u=l.x-a.clientX,c=l.y-a.clientY;return u*u+c*c<100}(t,n.input.lastClick)&&!t[s0]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let s=n.posAtCoords(tl(t));s&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new lN(n,s,t,!!r)):(o=="doubleClick"?sN:aN)(n,s.pos,s.inside,t)?t.preventDefault():cr(n,"pointer"))};class lN{constructor(e,t,r,i){let o,s;if(this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[s0],this.allowDefault=r.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let c=e.state.doc.resolve(t.pos);o=c.parent,s=c.depth?c.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:u}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof le&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!ln||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)),cr(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(()=>zn(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(tl(e))),this.updateAllowDefault(e),this.allowDefault||!t?cr(this.view,"pointer"):oN(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Et&&this.mightDrag&&!this.mightDrag.node.isAtom||lt&&!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)?(Hi(this.view,ve.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):cr(this.view,"pointer")}move(e){this.updateAllowDefault(e),cr(this.view,"pointer"),e.buttons==0&&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 a0(n,e){return!!n.composing||!!(Et&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500)&&(n.input.compositionEndedAt=-2e8,!0)}vt.touchstart=n=>{n.input.lastTouch=Date.now(),Td(n),cr(n,"pointer")},vt.touchmove=n=>{n.input.lastTouch=Date.now(),cr(n,"pointer")},vt.contextmenu=n=>Td(n);const uN=un?5e3:-1;function l0(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>nl(n),e))}function u0(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function nl(n,e=!1){if(!(un&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),u0(n),e||n.docView&&n.docView.dirty){let t=fd(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}At.compositionstart=At.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),nl(n,!0),n.markCursor=null;else if(nl(n),ln&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){n.domSelection().collapse(s,s.nodeValue.length);break}i=s,o=-1}}n.input.composing=!0}l0(n,uN)},At.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,l0(n,20))};const as=bt&&sr<15||Bi&&jb<604;function ls(n,e,t,r,i){let o=ZE(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",l=>l(n,i,o||G.empty)))return!0;if(!o)return!1;let s=function(l){return l.openStart==0&&l.openEnd==0&&l.content.childCount==1?l.content.firstChild:null}(o),a=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function c0(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}vt.copy=At.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=as?null:t.clipboardData,s=r.content(),{dom:a,text:l}=JE(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(u,c){if(!u.dom.parentNode)return;let d=u.dom.parentNode.appendChild(document.createElement("div"));d.appendChild(c),d.style.cssText="position: fixed; left: -10000px; top: 10px";let h=getSelection(),p=document.createRange();p.selectNodeContents(c),u.dom.blur(),h.removeAllRanges(),h.addRange(p),setTimeout(()=>{d.parentNode&&d.parentNode.removeChild(d),u.focus()},50)}(n,a),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},At.paste=(n,e)=>{let t=e;if(n.composing&&!un)return;let r=as?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&ls(n,c0(r),r.getData("text/html"),i,t)?t.preventDefault():function(o,s){if(!o.dom.parentNode)return;let a=o.input.shiftKey||o.state.selection.$from.parent.type.spec.code,l=o.dom.parentNode.appendChild(document.createElement(a?"textarea":"div"));a||(l.contentEditable="true"),l.style.cssText="position: fixed; left: -10000px; top: 10px",l.focus();let u=o.input.shiftKey&&o.input.lastKeyCode!=45;setTimeout(()=>{o.focus(),l.parentNode&&l.parentNode.removeChild(l),a?ls(o,l.value,null,u,s):ls(o,l.textContent,l.innerHTML,u,s)},50)}(n,t)};class d0{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const h0=qt?"altKey":"ctrlKey";vt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i,o=n.state.selection,s=o.empty?null:n.posAtCoords(tl(t));if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof le?o.to-1:o.to))){if(r&&r.mightDrag)i=le.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let c=n.docView.nearestDesc(t.target,!0);c&&c.node.type.spec.draggable&&c!=n.docView&&(i=le.create(n.state.doc,c.posBefore))}}let a=(i||n.state.selection).content(),{dom:l,text:u}=JE(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(as?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",as||t.dataTransfer.setData("text/plain",u),n.dragging=new d0(a,!t[h0],i)},vt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},At.dragover=At.dragenter=(n,e)=>e.preventDefault(),At.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(tl(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",f=>{s=f(s,n)}):s=ZE(n,c0(t.dataTransfer),as?null:t.dataTransfer.getData("text/html"),!1,o);let a=!(!r||t[h0]);if(n.someProp("handleDrop",f=>f(n,t,s||G.empty,a)))return void t.preventDefault();if(!s)return;t.preventDefault();let l=s?function(f,m,g){let E=f.resolve(m);if(!g.content.size)return m;let v=g.content;for(let A=0;A<g.openStart;A++)v=v.firstChild.content;for(let A=1;A<=(g.openStart==0&&g.size?2:1);A++)for(let _=E.depth;_>=0;_--){let O=_==E.depth?0:E.pos<=(E.start(_+1)+E.end(_+1))/2?-1:1,T=E.index(_)+(O>0?1:0),S=E.node(_),b=!1;if(A==1)b=S.canReplace(T,T,v);else{let y=S.contentMatchAt(T).findWrapping(v.firstChild.type);b=y&&S.canReplaceWith(T,T,y[0])}if(b)return O==0?E.pos:O<0?E.before(_+1):E.after(_+1)}return null}(n.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let u=n.state.tr;if(a){let{node:f}=r;f?f.replace(u):u.deleteSelection()}let c=u.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(h))return;let p=u.doc.resolve(c);if(d&&le.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new le(p));else{let f=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((m,g,E,v)=>f=v),u.setSelection(gd(n,p,u.doc.resolve(f)))}n.focus(),n.dispatch(u.setMeta("uiEvent","drop"))},vt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&zn(n)},20))},vt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},vt.beforeinput=(n,e)=>{if(lt&&un&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:t}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=t||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,Br(8,"Backspace")))))return;let{$cursor:r}=n.state.selection;r&&r.pos>0&&n.dispatch(n.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let n in At)vt[n]=At[n];function us(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class rl{constructor(e,t){this.toDOM=e,this.spec=t||Hr,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new Ht(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof rl&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&us(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class dr{constructor(e,t){this.attrs=e,this.spec=t||Hr}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Ht(o,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof dr&&us(this.attrs,e.attrs)&&us(this.spec,e.spec)}static is(e){return e.type instanceof dr}destroy(){}}class Sd{constructor(e,t){this.attrs=e,this.spec=t||Hr}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let s=e.mapResult(t.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Ht(o.pos-r,s.pos-r,this)}valid(e,t){let r,{index:i,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(r=e.child(i)).isText&&o+r.nodeSize==t.to}eq(e){return this==e||e instanceof Sd&&us(this.attrs,e.attrs)&&us(this.spec,e.spec)}destroy(){}}class Ht{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Ht(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,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new Ht(e,e,new rl(t,r))}static inline(e,t,r,i){return new Ht(e,t,new dr(r,i))}static node(e,t,r,i){return new Ht(e,t,new Sd(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof dr}get widget(){return this.type instanceof rl}}const $i=[],Hr={};class Ge{constructor(e,t){this.local=e.length?e:$i,this.children=t.length?t:$i}static create(e,t){return t.length?il(t,e,0,Hr):ut}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=t&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,t-a,r,i+a,o)}}map(e,t,r){return this==ut||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Hr)}mapInner(e,t,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(t,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?function(a,l,u,c,d,h,p){let f=a.slice();for(let g=0,E=h;g<u.maps.length;g++){let v=0;u.maps[g].forEach((A,_,O,T)=>{let S=T-O-(_-A);for(let b=0;b<f.length;b+=3){let y=f[b+1];if(y<0||A>y+E-v)continue;let C=f[b]+E-v;_>=C?f[b+1]=A<=C?-2:-1:A>=E&&S&&(f[b]+=S,f[b+1]+=S)}v+=S}),E=u.maps[g].map(E,-1)}let m=!1;for(let g=0;g<f.length;g+=3)if(f[g+1]<0){if(f[g+1]==-2){m=!0,f[g+1]=-1;continue}let E=u.map(a[g]+h),v=E-d;if(v<0||v>=c.content.size){m=!0;continue}let A=u.map(a[g+1]+h,-1)-d,{index:_,offset:O}=c.content.findIndex(v),T=c.maybeChild(_);if(T&&O==v&&O+T.nodeSize==A){let S=f[g+2].mapInner(u,T,E+1,a[g]+h+1,p);S!=ut?(f[g]=v,f[g+1]=A,f[g+2]=S):(f[g+1]=-2,m=!0)}else m=!0}if(m){let g=function(v,A,_,O,T,S,b){function y(C,w){for(let I=0;I<C.local.length;I++){let F=C.local[I].map(O,T,w);F?_.push(F):b.onRemove&&b.onRemove(C.local[I].spec)}for(let I=0;I<C.children.length;I+=3)y(C.children[I+2],C.children[I]+w+1)}for(let C=0;C<v.length;C+=3)v[C+1]==-1&&y(v[C+2],A[C]+S+1);return _}(f,a,l,u,d,h,p),E=il(g,c,0,p);l=E.local;for(let v=0;v<f.length;v+=3)f[v+1]<0&&(f.splice(v,3),v-=3);for(let v=0,A=0;v<E.children.length;v+=3){let _=E.children[v];for(;A<f.length&&f[A]<_;)A+=3;f.splice(A,0,E.children[v],E.children[v+1],E.children[v+2])}}return new Ge(l.sort($r),f)}(this.children,s||[],e,t,r,i,o):s?new Ge(s.sort($r),$i):ut}add(e,t){return t.length?this==ut?Ge.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((a,l)=>{let u,c=l+r;if(u=f0(t,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,u,c+1):i.splice(o,0,l,l+a.nodeSize,il(u,a,c+1,Hr)),o+=3}});let s=p0(o?m0(t):t,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ge(s.length?this.local.concat(s).sort($r):this.local,i||this.children)}remove(e){return e.length==0||this==ut?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+t,l=r[o+1]+t;for(let c,d=0;d<e.length;d++)(c=e[d])&&c.from>a&&c.to<l&&(e[d]=null,(s||(s=[])).push(c));if(!s)continue;r==this.children&&(r=this.children.slice());let u=r[o+2].removeInner(s,a+1);u!=ut?r[o+2]=u:(r.splice(o,3),o-=3)}if(i.length){for(let o,s=0;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ge(i,r):ut}forChild(e,t){if(this==ut)return this;if(t.isLeaf)return Ge.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+t.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof dr){let u=Math.max(o,l.from)-o,c=Math.min(s,l.to)-o;u<c&&(i||(i=[])).push(l.copy(u,c))}}if(i){let a=new Ge(i.sort($r),$i);return r?new hr([a,r]):a}return r||ut}eq(e){if(this==e)return!0;if(!(e instanceof Ge)||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 bd(this.localsInner(e))}localsInner(e){if(this==ut)return $i;if(e.inlineContent||!this.local.some(dr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof dr||t.push(this.local[r]);return t}}Ge.empty=new Ge([],[]),Ge.removeOverlap=bd;const ut=Ge.empty;class hr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Hr));return hr.from(r)}forChild(e,t){if(t.isLeaf)return Ge.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ut&&(o instanceof hr?r=r.concat(o.members):r.push(o))}return hr.from(r)}eq(e){if(!(e instanceof hr)||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,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(t){r&&(t=t.slice(),r=!1);for(let s=0;s<o.length;s++)t.push(o[s])}else t=o}return t?bd(r?t:t.sort($r)):$i}static from(e){switch(e.length){case 0:return ut;case 1:return e[0];default:return new hr(e.every(t=>t instanceof Ge)?e:e.reduce((t,r)=>t.concat(r instanceof Ge?r:r.members),[]))}}}function p0(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new Ht(i.from+e,i.to+e,i.type))}return t}function f0(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o,s=0;s<n.length;s++)(o=n[s])&&o.from>t&&o.to<r&&((i||(i=[])).push(o),n[s]=null);return i}function m0(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function il(n,e,t,r){let i=[],o=!1;e.forEach((a,l)=>{let u=f0(n,a,l+t);if(u){o=!0;let c=il(u,a,t+l+1,r);c!=ut&&i.push(l,l+a.nodeSize,c)}});let s=p0(o?m0(n):n,-t).sort($r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Ge(s,i):ut}function $r(n,e){return n.from-e.from||n.to-e.to}function bd(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from!=r.from){o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),g0(e,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),g0(e,i+1,o.copy(r.to,o.to)))}}return e}function g0(n,e,t){for(;e<n.length&&$r(t,n[e])>0;)e++;n.splice(e,0,t)}function Nd(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=ut&&e.push(r)}),n.cursorWrapper&&e.push(Ge.create(n.state.doc,[n.cursorWrapper.deco])),hr.from(e)}const cN={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dN=bt&&sr<=11;class hN{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 pN{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new hN,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);bt&&sr<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),dN&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,cN)),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(YE(this.view)){if(this.suppressingSelectionUpdates)return zn(this.view);if(bt&&sr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Pr(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,r=new Set;for(let o=e.focusNode;o;o=es(o))r.add(o);for(let o=e.anchorNode;o;o=es(o))if(r.has(o)){t=o;break}let i=t&&this.view.docView.nearestDesc(t);return i&&i.ignoreMutation({type:"selection",target:t.nodeType==3?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 r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&YE(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let c=0;c<t.length;c++){let d=this.registerMutation(t[c],l);d&&(o=o<0?d.from:Math.min(d.from,o),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(ln&&l.length>1){let c=l.filter(d=>d.nodeName=="BR");if(c.length==2){let d=c[0],h=c[1];d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}}let u=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Za(r)&&(u=fd(e))&&u.eq(ve.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,zn(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),function(c){if(!E0.has(c)&&(E0.set(c,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(c.dom).whiteSpace)!==-1)){if(c.requiresGeckoHackNode=ln,v0)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."),v0=!0}}(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||zn(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++)t.push(e.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(bt&&sr<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:c,nextSibling:d}=e.addedNodes[u];(!c||Array.prototype.indexOf.call(e.addedNodes,c)<0)&&(i=c),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d)}let s=i&&i.parentNode==e.target?gt(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?gt(o):e.target.childNodes.length;return{from:a,to:r.localPosFromDOM(e.target,l,1)}}return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let E0=new WeakMap,v0=!1;function fN(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Et&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}if(n.parentNode.lastChild==n||Et&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const mN=/^(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 gN(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let y=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,C=fd(n,y);if(C&&!n.state.selection.eq(C)){if(lt&&un&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",I=>I(n,Br(13,"Enter"))))return;let w=n.state.tr.setSelection(C);y=="pointer"?w.setMeta("pointer",!0):y=="key"&&w.scrollIntoView(),o&&w.setMeta("composition",o),n.dispatch(w)}return}let s=n.state.doc.resolve(e),a=s.sharedDepth(t);e=s.before(a+1),t=n.state.doc.resolve(t).after(a+1);let l,u,c=n.state.selection,d=function(y,C,w){let I,{node:F,fromOffset:L,toOffset:j,from:D,to:B}=y.docView.parseRange(C,w),H=y.domSelectionRange(),x=H.anchorNode;if(x&&y.dom.contains(x.nodeType==1?x:x.parentNode)&&(I=[{node:x,offset:H.anchorOffset}],Za(H)||I.push({node:H.focusNode,offset:H.focusOffset})),lt&&y.input.lastKeyCode===8)for(let Z=j;Z>L;Z--){let te=F.childNodes[Z-1],oe=te.pmViewDesc;if(te.nodeName=="BR"&&!oe){j=Z;break}if(!oe||oe.size)break}let Q=y.state.doc,Y=y.someProp("domParser")||Xo.fromSchema(y.state.schema),J=Q.resolve(D),se=null,k=Y.parse(F,{topNode:J.parent,topMatch:J.parent.contentMatchAt(J.index()),topOpen:!0,from:L,to:j,preserveWhitespace:J.parent.type.whitespace!="pre"||"full",findPositions:I,ruleFromNode:fN,context:J});if(I&&I[0].pos!=null){let Z=I[0].pos,te=I[1]&&I[1].pos;te==null&&(te=Z),se={anchor:Z+D,head:te+D}}return{doc:k,sel:se,from:D,to:B}}(n,e,t),h=n.state.doc,p=h.slice(d.from,d.to);n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(l=n.state.selection.to,u="end"):(l=n.state.selection.from,u="start"),n.input.lastKeyCode=null;let f=function(y,C,w,I,F){let L=y.findDiffStart(C,w);if(L==null)return null;let{a:j,b:D}=y.findDiffEnd(C,w+y.size,w+C.size);if(F=="end"&&(I-=j+Math.max(0,L-Math.min(j,D))-L),j<L&&y.size<C.size){let B=I<=L&&I>=j?L-I:0;L-=B,L&&L<C.size&&_0(C.textBetween(L-1,L+1))&&(L+=B?1:-1),D=L+(D-j),j=L}else if(D<L){let B=I<=L&&I>=D?L-I:0;L-=B,L&&L<y.size&&_0(y.textBetween(L-1,L+1))&&(L+=B?1:-1),j=L+(j-D),D=L}return{start:L,endA:j,endB:D}}(p.content,d.doc.content,d.from,l,u);if((Bi&&n.input.lastIOSEnter>Date.now()-225||un)&&i.some(y=>y.nodeType==1&&!mN.test(y.nodeName))&&(!f||f.endA>=f.endB)&&n.someProp("handleKeyDown",y=>y(n,Br(13,"Enter"))))return void(n.input.lastIOSEnter=0);if(!f){if(!(r&&c instanceof Te&&!c.empty&&c.$head.sameParent(c.$anchor))||n.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){let y=A0(n,n.state.doc,d.sel);if(y&&!y.eq(n.state.selection)){let C=n.state.tr.setSelection(y);o&&C.setMeta("composition",o),n.dispatch(C)}}return}f={start:c.from,endA:c.to,endB:c.to}}if(lt&&n.cursorWrapper&&d.sel&&d.sel.anchor==n.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let y=f.endB-f.start;d.sel={anchor:d.sel.anchor+y,head:d.sel.anchor+y}}n.input.domChangeCount++,n.state.selection.from<n.state.selection.to&&f.start==f.endB&&n.state.selection instanceof Te&&(f.start>n.state.selection.from&&f.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?f.start=n.state.selection.from:f.endA<n.state.selection.to&&f.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(f.endB+=n.state.selection.to-f.endA,f.endA=n.state.selection.to)),bt&&sr<=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,g=d.doc.resolveNoCache(f.start-d.from),E=d.doc.resolveNoCache(f.endB-d.from),v=h.resolve(f.start),A=g.sameParent(E)&&g.parent.inlineContent&&v.end()>=f.endA;if((Bi&&n.input.lastIOSEnter>Date.now()-225&&(!A||i.some(y=>y.nodeName=="DIV"||y.nodeName=="P"))||!A&&g.pos<d.doc.content.size&&!g.sameParent(E)&&(m=ve.findFrom(d.doc.resolve(g.pos+1),1,!0))&&m.head==E.pos)&&n.someProp("handleKeyDown",y=>y(n,Br(13,"Enter"))))return void(n.input.lastIOSEnter=0);if(n.state.selection.anchor>f.start&&function(y,C,w,I,F){if(!I.parent.isTextblock||w-C<=F.pos-I.pos||Cd(I,!0,!1)<F.pos)return!1;let L=y.resolve(C);if(L.parentOffset<L.parent.content.size||!L.parent.isTextblock)return!1;let j=y.resolve(Cd(L,!0,!0));return!(!j.parent.isTextblock||j.pos>w||Cd(j,!0,!1)<w)&&I.parent.content.cut(I.parentOffset).eq(j.parent.content)}(h,f.start,f.endA,g,E)&&n.someProp("handleKeyDown",y=>y(n,Br(8,"Backspace"))))return void(un&&lt&&n.domObserver.suppressSelectionUpdates());lt&&un&&f.endB==f.start&&(n.input.lastAndroidDelete=Date.now()),un&&!A&&g.start()!=E.start()&&E.parentOffset==0&&g.depth==E.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==f.endA&&(f.endB-=2,E=d.doc.resolveNoCache(f.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(y){return y(n,Br(13,"Enter"))})},20));let _,O,T,S=f.start,b=f.endA;if(A){if(g.pos==E.pos)bt&&sr<=11&&g.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>zn(n),20)),_=n.state.tr.delete(S,b),O=h.resolve(f.start).marksAcross(h.resolve(f.endA));else if(f.endA==f.endB&&(T=function(y,C){let w,I,F,L=y.firstChild.marks,j=C.firstChild.marks,D=L,B=j;for(let x=0;x<j.length;x++)D=j[x].removeFromSet(D);for(let x=0;x<L.length;x++)B=L[x].removeFromSet(B);if(D.length==1&&B.length==0)I=D[0],w="add",F=x=>x.mark(I.addToSet(x.marks));else{if(D.length!=0||B.length!=1)return null;I=B[0],w="remove",F=x=>x.mark(I.removeFromSet(x.marks))}let H=[];for(let x=0;x<C.childCount;x++)H.push(F(C.child(x)));if(q.from(H).eq(y))return{mark:I,type:w}}(g.parent.content.cut(g.parentOffset,E.parentOffset),v.parent.content.cut(v.parentOffset,f.endA-v.start()))))_=n.state.tr,T.type=="add"?_.addMark(S,b,T.mark):_.removeMark(S,b,T.mark);else if(g.parent.child(g.index()).isText&&g.index()==E.index()-(E.textOffset?0:1)){let y=g.parent.textBetween(g.parentOffset,E.parentOffset);if(n.someProp("handleTextInput",C=>C(n,S,b,y)))return;_=n.state.tr.insertText(y,S,b)}}if(_||(_=n.state.tr.replace(S,b,d.doc.slice(f.start-d.from,f.endB-d.from))),d.sel){let y=A0(n,_.doc,d.sel);y&&!(lt&&un&&n.composing&&y.empty&&(f.start!=f.endB||n.input.lastAndroidDelete<Date.now()-100)&&(y.head==S||y.head==_.mapping.map(b)-1)||bt&&y.empty&&y.head==S)&&_.setSelection(y)}O&&_.ensureMarks(O),o&&_.setMeta("composition",o),n.dispatch(_.scrollIntoView())}function A0(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:gd(n,e.resolve(t.anchor),e.resolve(t.head))}function Cd(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function _0(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class EN{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 rN,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(b0),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=T0(this),O0(this),this.nodeViews=S0(this),this.docView=DE(this.state.doc,y0(this),Nd(this),this.dom,this),this.domObserver=new pN(this,(r,i,o,s)=>gN(this,r,i,o,s)),this.domObserver.start(),function(r){for(let i in vt){let o=vt[i];r.dom.addEventListener(i,r.input.eventHandlers[i]=s=>{!iN(r,s)||yd(r,s)||!r.editable&&s.type in At||o(r,s)},nN[i]?{passive:!0}:void 0)}Et&&r.dom.addEventListener("input",()=>null),_d(r)}(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&&_d(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(b0),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(u0(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=S0(this);(function(f,m){let g=0,E=0;for(let v in f){if(f[v]!=m[v])return!0;g++}for(let v in m)E++;return g!=E})(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&_d(this),this.editable=T0(this),O0(this);let l=Nd(this),u=y0(this),c=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(e.doc,u,l);!d&&e.selection.eq(i.selection)||(s=!0);let h=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&function(p){let f,m,g=p.dom.getBoundingClientRect(),E=Math.max(0,g.top);for(let v=(g.left+g.right)/2,A=E+1;A<Math.min(innerHeight,g.bottom);A+=5){let _=p.root.elementFromPoint(v,A);if(!_||_==p.dom||!p.dom.contains(_))continue;let O=_.getBoundingClientRect();if(O.top>=E-20){f=_,m=O.top;break}}return{refDOM:f,refTop:m,stack:_E(p.dom)}}(this);if(s){this.domObserver.stop();let p=d&&(bt||lt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&function(f,m){let g=Math.min(f.$anchor.sharedDepth(f.head),m.$anchor.sharedDepth(m.head));return f.$anchor.start(g)!=m.$anchor.start(g)}(i.selection,e.selection);if(d){let f=lt?this.trackWrites=this.domSelectionRange().focusNode:null;!o&&this.docView.update(e.doc,u,l,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=DE(e.doc,u,l,this.dom,this)),f&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(f){let m=f.docView.domFromPos(f.state.selection.anchor,0),g=f.domSelectionRange();return Pr(m.node,m.offset,g.anchorNode,g.anchorOffset)}(this))?zn(this,p):($E(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():h&&function({refDOM:p,refTop:f,stack:m}){let g=p?p.getBoundingClientRect().top:0;yE(m,g==0?0:g-f)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof le){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&AE(this,t.getBoundingClientRect(),e)}else AE(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 r=this.pluginViews[t];r.update&&r.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}}updateDraggedNode(e,t){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-t.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new d0(e.slice,e.move,i<0?void 0:le.create(this.state.doc,i))}someProp(e,t){let r,i=this._props&&this._props[e];if(i!=null&&(r=t?t(i):i))return r;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(r=t?t(a):a))return r}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(bt){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(e.contentEditable=="false")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(Fi)return e.focus(Fi);let t=_E(e);e.focus(Fi==null?{get preventScroll(){return Fi={preventScroll:!0},!0}}:void 0),Fi||(Fi=!1,yE(t,0))}(this.dom),zn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&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 Vb(this,e)}coordsAtPos(e,t=1){return bE(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,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Xb(this,t||this.state,e)}pasteHTML(e,t){return ls(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ls(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,[],Nd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return function(t,r){yd(t,r)||!vt[r.type]||!t.editable&&r.type in At||vt[r.type](t,r)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Et&&this.root.nodeType===11&&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 r(u){u.preventDefault(),u.stopImmediatePropagation(),t=u.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0);let i=t.startContainer,o=t.startOffset,s=t.endContainer,a=t.endOffset,l=e.domAtPos(e.state.selection.anchor);return Pr(l.node,l.offset,s,a)&&([i,o,s,a]=[s,a,i,o]),{anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:a}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function y0(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:e[r]||r=="contenteditable"||r=="nodeName"||(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Ht.node(0,n.state.doc.content.size,e)]}function O0(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Ht.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function T0(n){return!n.someProp("editable",e=>e(n.state)===!1)}function S0(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function b0(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const Ze=new class{constructor(n){this.cached=Object.create(null);let e=this.spec={};for(let r in n)e[r]=n[r];e.nodes=nt.from(n.nodes),e.marks=nt.from(n.marks||{}),this.nodes=Gg.compile(this.spec.nodes,this),this.marks=Xa.compile(this.spec.marks,this);let t=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 i=this.nodes[r],o=i.spec.content||"",s=i.spec.marks;i.contentMatch=t[o]||(t[o]=Lr.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=s=="_"?null:s?Xg(this,s.split(" ")):s!=""&&i.inlineContent?null:[]}for(let r in this.marks){let i=this.marks[r],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Xg(this,o.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(n,e=null,t,r){if(typeof n=="string")n=this.nodeType(n);else{if(!(n instanceof Gg))throw new RangeError("Invalid node type: "+n);if(n.schema!=this)throw new RangeError("Node type from different schema used ("+n.name+")")}return n.createChecked(e,t,r)}text(n,e){let t=this.nodes.text;return new Ga(t,t.defaultAttrs,n,Oe.setFrom(e))}mark(n,e){return typeof n=="string"&&(n=this.marks[n]),n.create(e)}nodeFromJSON(n){return kr.fromJSON(this,n)}markFromJSON(n){return Oe.fromJSON(this,n)}nodeType(n){let e=this.nodes[n];if(!e)throw new RangeError("Unknown node type: "+n);return e}}({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:n=>["span",{"data-mention-id":n.attrs.id,class:"t-mention"},`@${n.attrs.name}`],parseDOM:[{tag:"span[data-mention-id]",getAttrs:n=>({id:n.dataset["mention-id"]})}]},customemoji:{group:"inline",inline:!0,attrs:{name:{},url:{}},content:"text*",selectable:!1,toDOM:n=>["img",{src:n.attrs.url,alt:n.attrs.name,"data-custom-emoji":n.attrs.name}],parseDOM:[{tag:"img[data-custom-emoji]",getAttrs:n=>{const e=n;return{name:e.dataset.customEmoji,url:e.src}}}]}},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:n=>["span",{"data-emoji":n.attrs.emoji},n.attrs.emoji],parseDOM:[{tag:"span[data-emoji]",getAttrs:n=>({emoji:n.dataset.emoji})}]}}}),Id=new Ja("placeholder"),N0=new qa({key:Id,props:{decorations(n){if(C0(n.doc))return;const e=n.doc.firstChild,t=Ht.node(0,e.nodeSize,{class:"empty-node","data-placeholder":Id.getState(n)});return Ge.create(n.doc,[t])}},state:{init:()=>"",apply:(n,e)=>n.getMeta(Id)??e}});function C0(n){return n.childCount!==1||n.firstChild.childCount!==0}for(var pr={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"},ol={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"},I0=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),vN=typeof navigator<"u"&&/Apple Computer/.test(navigator.vendor),AN=typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent),w0=typeof navigator<"u"&&/Mac/.test(navigator.platform),_N=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),yN=I0&&(w0||+I0[1]<57)||AN&&w0,rt=0;rt<10;rt++)pr[48+rt]=pr[96+rt]=String(rt);for(rt=1;rt<=24;rt++)pr[rt+111]="F"+rt;for(rt=65;rt<=90;rt++)pr[rt]=String.fromCharCode(rt+32),ol[rt]=String.fromCharCode(rt);for(var wd in pr)ol.hasOwnProperty(wd)||(ol[wd]=pr[wd]);const ON=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function TN(n){let e,t,r,i,o=n.split(/-(?!$)/),s=o[o.length-1];s=="Space"&&(s=" ");for(let a=0;a<o.length-1;a++){let l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))e=!0;else if(/^(c|ctrl|control)$/i.test(l))t=!0;else if(/^s(hift)?$/i.test(l))r=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);ON?i=!0:t=!0}}return e&&(s="Alt-"+s),t&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Rd(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function R0(n){return new qa({props:{handleKeyDown:SN(n)}})}function SN(n){let e=function(t){let r=Object.create(null);for(let i in t)r[TN(i)]=t[i];return r}(n);return function(t,r){let i,o=function(a){var l=!(yN&&(a.ctrlKey||a.altKey||a.metaKey)||(vN||_N)&&a.shiftKey&&a.key&&a.key.length==1)&&a.key||(a.shiftKey?ol:pr)[a.keyCode]||a.key||"Unidentified";return l=="Esc"&&(l="Escape"),l=="Del"&&(l="Delete"),l=="Left"&&(l="ArrowLeft"),l=="Up"&&(l="ArrowUp"),l=="Right"&&(l="ArrowRight"),l=="Down"&&(l="ArrowDown"),l}(r),s=e[Rd(o,r)];if(s&&s(t.state,t.dispatch,t))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[Rd(o,r,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=pr[r.keyCode])&&i!=o){let a=e[Rd(i,r)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}var sl=200,it=function(){};it.prototype.append=function(n){return n.length?(n=it.from(n),!this.length&&n||n.length<sl&&this.leafAppend(n)||this.length<sl&&n.leafPrepend(this)||this.appendInner(n)):this},it.prototype.prepend=function(n){return n.length?it.from(n).append(this):this},it.prototype.appendInner=function(n){return new bN(this,n)},it.prototype.slice=function(n,e){return n===void 0&&(n=0),e===void 0&&(e=this.length),n>=e?it.empty:this.sliceInner(Math.max(0,n),Math.min(this.length,e))},it.prototype.get=function(n){if(!(n<0||n>=this.length))return this.getInner(n)},it.prototype.forEach=function(n,e,t){e===void 0&&(e=0),t===void 0&&(t=this.length),e<=t?this.forEachInner(n,e,t,0):this.forEachInvertedInner(n,e,t,0)},it.prototype.map=function(n,e,t){e===void 0&&(e=0),t===void 0&&(t=this.length);var r=[];return this.forEach(function(i,o){return r.push(n(i,o))},e,t),r},it.from=function(n){return n instanceof it?n:n&&n.length?new D0(n):it.empty};var D0=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,i){return r==0&&i==this.length?this:new e(this.values.slice(r,i))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,i,o,s){for(var a=i;a<o;a++)if(r(this.values[a],s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){for(var a=i-1;a>=o;a--)if(r(this.values[a],s+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=sl)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=sl)return new e(r.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(it);it.empty=new D0([]);var bN=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,r,i,o){var s=this.left.length;return!(r<s&&this.left.forEachInner(t,r,Math.min(i,s),o)===!1)&&!(i>s&&this.right.forEachInner(t,Math.max(r-s,0),Math.min(this.length,i)-s,o+s)===!1)&&void 0},e.prototype.forEachInvertedInner=function(t,r,i,o){var s=this.left.length;return!(r>s&&this.right.forEachInvertedInner(t,r-s,Math.max(i,s)-s,o+s)===!1)&&!(i<s&&this.left.forEachInvertedInner(t,Math.min(r,s),i,o)===!1)&&void 0},e.prototype.sliceInner=function(t,r){if(t==0&&r==this.length)return this;var i=this.left.length;return r<=i?this.left.slice(t,r):t>=i?this.right.slice(t-i,r-i):this.left.slice(t,i).append(this.right.slice(0,r-i))},e.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new e(r,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(it),k0=it;const L0=Math.pow(2,16);function NN(n,e){return n+e*L0}function x0(n){return 65535&n}let Dd=class{constructor(n,e,t){this.pos=n,this.delInfo=e,this.recover=t}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}},jr=class Oo{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Oo.empty)return Oo.empty}recover(e){let t=0,r=x0(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*r]+t+function(i){return(i-(65535&i))/L0}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=l+i+((u?e==l?-1:e==d?1:t:t)<0?0:c);if(r)return h;let p=e==(t<0?l:d)?null:NN(a/3,e-l),f=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(f|=8),new Dd(h,f,p)}i+=c-u}return r?e+i:new Dd(e+i,0,null)}touches(e,t){let r=0,i=x0(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o];if(e<=l+u&&a==3*i)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new Oo(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Oo.empty:new Oo(e<0?[0,-e,0]:[0,0,e])}};jr.empty=new jr([]);class cs{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new cs(this.maps,this.mirror,e,t)}copy(){return new cs(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i: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,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new cs;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o].mapResult(e,t);if(s.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this.maps[a].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new Dd(e,i,null)}}const kd=Object.create(null);let ct=class{getMap(){return jr.empty}merge(n){return null}static fromJSON(n,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let t=kd[e.stepType];if(!t)throw new RangeError(`No step type ${e.stepType} defined`);return t.fromJSON(n,e)}static jsonID(n,e){if(n in kd)throw new RangeError("Duplicate use of step JSON ID "+n);return kd[n]=e,e.prototype.jsonID=n,e}},_t=class ra{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new ra(e,null)}static fail(e){return new ra(null,e)}static fromReplace(e,t,r,i){try{return ra.ok(e.replace(t,r,i))}catch(o){if(o instanceof xi)return ra.fail(o.message);throw o}}};function Ld(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Ld(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return q.fromArray(r)}let M0=class ia extends ct{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new G(Ld(t.content,(s,a)=>s.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return _t.fromReplace(e,this.from,this.to,o)}invert(){return new P0(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new ia(t.pos,r.pos,this.mark)}merge(e){return e instanceof ia&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ia(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ia(t.from,t.to,e.markFromJSON(t.mark))}};ct.jsonID("addMark",M0);let P0=class oa extends ct{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new G(Ld(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return _t.fromReplace(e,this.from,this.to,r)}invert(){return new M0(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new oa(t.pos,r.pos,this.mark)}merge(e){return e instanceof oa&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new oa(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new oa(t.from,t.to,e.markFromJSON(t.mark))}};ct.jsonID("removeMark",P0);let B0=class sa extends ct{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return _t.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return _t.fromReplace(e,this.pos,this.pos+1,new G(q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new sa(this.pos,t.marks[i]);return new sa(this.pos,this.mark)}}return new F0(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new sa(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new sa(t.pos,e.markFromJSON(t.mark))}};ct.jsonID("addNodeMark",B0);let F0=class Jp extends ct{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return _t.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return _t.fromReplace(e,this.pos,this.pos+1,new G(q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new B0(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Jp(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Jp(t.pos,e.markFromJSON(t.mark))}};ct.jsonID("removeNodeMark",F0),ct.jsonID("replace",class hi extends ct{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&xd(e,this.from,this.to)?_t.fail("Structure replace would overwrite content"):_t.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new jr([this.from,this.to-this.from,this.slice.size])}invert(e){return new hi(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new hi(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof hi)||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?G.empty:new G(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new hi(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?G.empty:new G(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new hi(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new hi(t.from,t.to,G.fromJSON(e,t.slice),!!t.structure)}});function xd(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}ct.jsonID("replaceAround",class Nu extends ct{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(xd(e,this.from,this.gapFrom)||xd(e,this.gapTo,this.to)))return _t.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return _t.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?_t.fromReplace(e,this.from,this.to,r):_t.fail("Content does not fit in gap")}getMap(){return new jr([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 Nu(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),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new Nu(t.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(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Nu(t.from,t.to,t.gapFrom,t.gapTo,G.fromJSON(e,t.slice),t.insert,!!t.structure)}}),ct.jsonID("attr",class Cu extends ct{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return _t.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return _t.fromReplace(e,this.pos,this.pos+1,new G(q.from(i),0,t.isLeaf?0:1))}getMap(){return jr.empty}invert(e){return new Cu(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 Cu(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Cu(t.pos,t.attr,t.value)}}),ct.jsonID("docAttr",class Zp extends ct{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return _t.ok(r)}getMap(){return jr.empty}invert(e){return new Zp(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(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Zp(t.attr,t.value)}});let al=class extends Error{};al=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(al.prototype=Object.create(Error.prototype)).constructor=al,al.prototype.name="TransformError";class cn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r,i,o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}t&&(r=this.remapping(o,this.items.length),i=r.maps.length);let s,a,l=e.tr,u=[],c=[];return this.items.forEach((d,h)=>{if(!d.step)return r||(r=this.remapping(o,h+1),i=r.maps.length),i--,void c.push(d);if(r){c.push(new fr(d.map));let p,f=d.step.map(r.slice(i));f&&l.maybeStep(f).doc&&(p=l.mapping.maps[l.mapping.maps.length-1],u.push(new fr(p,void 0,void 0,u.length+c.length))),i--,p&&r.appendMap(p,i)}else l.maybeStep(d.step);return d.selection?(s=r?d.selection.map(r.slice(i)):d.selection,a=new cn(this.items.slice(0,o).append(c.reverse().concat(u)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:a,transform:l,selection:s}}addTransform(e,t,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let d,h=e.steps[c].invert(e.docs[c]),p=new fr(e.mapping.maps[c],h,t);(d=l&&l.merge(p))&&(p=d,c?o.pop():a=a.slice(0,a.length-1)),o.push(p),t&&(s++,t=void 0),i||(l=p)}let u=s-r.depth;return u>CN&&(a=function(c,d){let h;return c.forEach((p,f)=>{if(p.selection&&d--==0)return h=f,!1}),c.slice(h)}(a,u),s-=u),new cn(a.append(o),s)}remapping(e,t){let r=new cs;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new cn(this.items.append(e.map(t=>new fr(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=t;this.items.forEach(h=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let f=o.maps[p];if(h.step){let m=e.steps[p].invert(e.docs[p]),g=h.selection&&h.selection.map(o.slice(l+1,p));g&&a++,r.push(new fr(f,m,g))}else r.push(new fr(f))},i);let u=[];for(let h=t;h<s;h++)u.push(new fr(o.maps[h]));let c=this.items.slice(0,i).append(u).append(r),d=new cn(c,a);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(t.slice(r)),u=l&&l.getMap();if(r--,u&&t.appendMap(u,r),l){let c=s.selection&&s.selection.map(t.slice(r));c&&o++;let d,h=new fr(u.invert(),l,c),p=i.length-1;(d=i.length&&i[p].merge(h))?i[p]=d:i.push(h)}}else s.map&&r--},this.items.length,0),new cn(k0.from(i.reverse()),o)}}cn.empty=new cn(k0.empty,0);let fr=class bT{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new bT(t.getMap().invert(),t,this.selection)}}};class mr{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const CN=20;function U0(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function Md(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}let Pd=!1,H0=null;function ll(n){let e=n.plugins;if(H0!=e){Pd=!1,H0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Pd=!0;break}}return Pd}const Yr=new Ja("history"),IN=new Ja("closeHistory");function wN(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new qa({key:Yr,state:{init:()=>new mr(cn.empty,cn.empty,null,0,-1),apply:(e,t,r)=>function(i,o,s,a){let l,u=s.getMeta(Yr);if(u)return u.historyState;s.getMeta(IN)&&(i=new mr(i.done,i.undone,null,0,-1));let c=s.getMeta("appendedTransaction");if(s.steps.length==0)return i;if(c&&c.getMeta(Yr))return c.getMeta(Yr).redo?new mr(i.done.addTransform(s,void 0,a,ll(o)),i.undone,U0(s.mapping.maps),i.prevTime,i.prevComposition):new mr(i.done,i.undone.addTransform(s,void 0,a,ll(o)),null,i.prevTime,i.prevComposition);if(s.getMeta("addToHistory")===!1||c&&c.getMeta("addToHistory")===!1)return(l=s.getMeta("rebased"))?new mr(i.done.rebased(s,l),i.undone.rebased(s,l),Md(i.prevRanges,s.mapping),i.prevTime,i.prevComposition):new mr(i.done.addMaps(s.mapping.maps),i.undone.addMaps(s.mapping.maps),Md(i.prevRanges,s.mapping),i.prevTime,i.prevComposition);{let d=s.getMeta("composition"),h=i.prevTime==0||!c&&i.prevComposition!=d&&(i.prevTime<(s.time||0)-a.newGroupDelay||!function(f,m){if(!m)return!1;if(!f.docChanged)return!0;let g=!1;return f.mapping.maps[0].forEach((E,v)=>{for(let A=0;A<m.length;A+=2)E<=m[A+1]&&v>=m[A]&&(g=!0)}),g}(s,i.prevRanges)),p=c?Md(i.prevRanges,s.mapping):U0(s.mapping.maps);return new mr(i.done.addTransform(s,h?o.selection.getBookmark():void 0,a,ll(o)),cn.empty,p,s.time,d??i.prevComposition)}}(t,r,e,n)},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?j0:r=="historyRedo"?Y0:null;return!!i&&(t.preventDefault(),i(e.state,e.dispatch))}}}})}function $0(n,e){return(t,r)=>{let i=Yr.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=function(s,a,l){let u=ll(a),c=Yr.get(a).spec.config,d=(l?s.undone:s.done).popEvent(a,u);if(!d)return null;let h=d.selection.resolve(d.transform.doc),p=(l?s.done:s.undone).addTransform(d.transform,a.selection.getBookmark(),c,u),f=new mr(l?p:d.remaining,l?d.remaining:p,null,0,-1);return d.transform.setSelection(h).setMeta(Yr,{redo:l,historyState:f})}(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const j0=$0(!1,!0),Y0=$0(!0,!0),z0=Math.pow(2,16);function RN(n,e){return n+e*z0}function V0(n){return 65535&n}class W0{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}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 $t{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&$t.empty)return $t.empty}recover(e){let t=0,r=V0(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*r]+t+function(i){return(i-(65535&i))/z0}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=l+i+((u?e==l?-1:e==d?1:t:t)<0?0:c);if(r)return h;let p=e==(t<0?l:d)?null:RN(a/3,e-l),f=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(f|=8),new W0(h,f,p)}i+=c-u}return r?e+i:new W0(e+i,0,null)}touches(e,t){let r=0,i=V0(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o];if(e<=l+u&&a==3*i)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new $t(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?$t.empty:new $t(e<0?[0,-e,0]:[0,0,e])}}$t.empty=new $t([]);const Bd=Object.create(null);class dt{getMap(){return $t.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Bd[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Bd)throw new RangeError("Duplicate use of step JSON ID "+e);return Bd[e]=t,t.prototype.jsonID=e,t}}class Xe{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Xe(e,null)}static fail(e){return new Xe(null,e)}static fromReplace(e,t,r,i){try{return Xe.ok(e.replace(t,r,i))}catch(o){if(o instanceof xi)return Xe.fail(o.message);throw o}}}function Fd(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Fd(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return q.fromArray(r)}class zr extends dt{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new G(Fd(t.content,(s,a)=>s.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return Xe.fromReplace(e,this.from,this.to,o)}invert(){return new Vr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new zr(t.pos,r.pos,this.mark)}merge(e){return e instanceof zr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new zr(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new zr(t.from,t.to,e.markFromJSON(t.mark))}}dt.jsonID("addMark",zr);class Vr extends dt{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new G(Fd(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Xe.fromReplace(e,this.from,this.to,r)}invert(){return new zr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Vr(t.pos,r.pos,this.mark)}merge(e){return e instanceof Vr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vr(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Vr(t.from,t.to,e.markFromJSON(t.mark))}}dt.jsonID("removeMark",Vr);class Wr extends dt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Xe.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Xe.fromReplace(e,this.pos,this.pos+1,new G(q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Wr(this.pos,t.marks[i]);return new Wr(this.pos,this.mark)}}return new ds(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Wr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Wr(t.pos,e.markFromJSON(t.mark))}}dt.jsonID("addNodeMark",Wr);class ds extends dt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Xe.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Xe.fromReplace(e,this.pos,this.pos+1,new G(q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Wr(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ds(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ds(t.pos,e.markFromJSON(t.mark))}}dt.jsonID("removeNodeMark",ds);class dn extends dt{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Ud(e,this.from,this.to)?Xe.fail("Structure replace would overwrite content"):Xe.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new $t([this.from,this.to-this.from,this.slice.size])}invert(e){return new dn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new dn(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof dn)||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?G.empty:new G(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new dn(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?G.empty:new G(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new dn(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new dn(t.from,t.to,G.fromJSON(e,t.slice),!!t.structure)}}dt.jsonID("replace",dn);class gr extends dt{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Ud(e,this.from,this.gapFrom)||Ud(e,this.gapTo,this.to)))return Xe.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Xe.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Xe.fromReplace(e,this.from,this.to,r):Xe.fail("Content does not fit in gap")}getMap(){return new $t([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 gr(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),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new gr(t.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(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new gr(t.from,t.to,t.gapFrom,t.gapTo,G.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Ud(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function DN(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Hd(n){let e=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let t=n.depth;;--t){let r=n.$from.node(t),i=n.$from.index(t),o=n.$to.indexAfter(t);if(t<n.depth&&r.canReplace(i,o,e))return t;if(t==0||r.type.spec.isolating||!DN(r,i,o))break}return null}function ul(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,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 u=i.depth-1,c=t-2;u>o;u--,c--){let d=i.node(u),h=i.index(u);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(h,d.childCount),f=r&&r[c+1];f&&(p=p.replaceChild(0,f.type.create(f.attrs)));let m=r&&r[c]||d;if(!d.canReplace(h+1,d.childCount)||!m.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function G0(n,e){let t=n.resolve(e),r=t.index();return function(i,o){return!(!i||!o||i.isLeaf||!function(s,a){a.content.size||s.type.compatibleContent(a.type);let l=s.contentMatchAt(s.childCount),{linebreakReplacement:u}=s.type.schema;for(let c=0;c<a.childCount;c++){let d=a.child(c),h=d.type==u?s.type.schema.nodes.text:d.type;if(l=l.matchType(h),!l||!s.type.allowsMarks(d.marks))return!1}return l.validEnd}(i,o))}(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function X0(n,e,t=e,r=G.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return function(s,a,l){return!l.openStart&&!l.openEnd&&s.start()==a.start()&&s.parent.canReplace(s.index(),a.index(),l.content)}(i,o,r)?new dn(e,t,r):new kN(i,o,r).fit()}dt.jsonID("replaceAround",gr);class kN{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=q.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=q.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new G(o,s,a);return e>-1?new gr(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new dn(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=$d(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let l,{type:u,match:c}=this.frontier[a],d=null;if(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(q.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:d};if(t==2&&s&&(l=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:l};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=$d(e,t);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new G(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=$d(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new G(hs(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new G(hs(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,u=0,c=[],{match:d,type:h}=this.frontier[t];if(i){for(let m=0;m<i.childCount;m++)c.push(i.child(m));d=d.matchFragment(i)}let p=a.size+e-(s.content.size-s.openEnd);for(;u<a.childCount;){let m=a.child(u),g=d.matchType(m.type);if(!g)break;u++,(u>1||l==0||m.content.size)&&(d=g,c.push(K0(m.mark(h.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?p:-1)))}let f=u==a.childCount;f||(p=-1),this.placed=ps(this.placed,t,q.from(c)),this.frontier[t].match=d,f&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m<p;m++){let E=g.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),g=E.content}this.unplaced=f?e==0?G.empty:new G(hs(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new G(hs(s.content,e,u),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!jd(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:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=jd(e,t,i,r,o);if(s){for(let a=t-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],c=jd(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:t,fit:s,move:o?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=ps(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=ps(this.placed,this.depth,q.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(q.empty,!0);e.childCount&&(this.placed=ps(this.placed,this.frontier.length,e))}}function hs(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(hs(n.firstChild.content,e-1,t)))}function ps(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(ps(n.lastChild.content,e-1,t)))}function $d(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function K0(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,K0(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(q.empty,!0)))),n.copy(r)}function jd(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(l,u,c){for(let d=c;d<u.childCount;d++)if(!l.allowsMarks(u.child(d).marks))return!0;return!1}(t,o.content,s)?a:null}class fs extends dt{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Xe.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Xe.fromReplace(e,this.pos,this.pos+1,new G(q.from(i),0,t.isLeaf?0:1))}getMap(){return $t.empty}invert(e){return new fs(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 fs(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fs(t.pos,t.attr,t.value)}}dt.jsonID("attr",fs);class cl extends dt{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Xe.ok(r)}getMap(){return $t.empty}invert(e){return new cl(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(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new cl(t.attr,t.value)}}dt.jsonID("docAttr",cl);let dl=class extends Error{};dl=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(dl.prototype=Object.create(Error.prototype)).constructor=dl,dl.prototype.name="TransformError";const q0=(n,e)=>!n.selection.empty&&(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function ji(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}function J0(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function Z0(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}function Yd(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const LN=(n,e)=>{let{$from:t,$to:r}=n.selection;if(n.selection instanceof le&&n.selection.node.isBlock)return!(!t.parentOffset||!ul(n.doc,t.pos)||(e&&e(n.tr.split(t.pos).scrollIntoView()),0));if(!t.depth)return!1;let i,o,s=[],a=!1,l=!1;for(let h=t.depth;;h--){if(t.node(h).isBlock){a=t.end(h)==t.pos+(t.depth-h),l=t.start(h)==t.pos-(t.depth-h),o=Yd(t.node(h-1).contentMatchAt(t.indexAfter(h-1))),s.unshift(a&&o?{type:o}:null),i=h;break}if(h==1)return!1;s.unshift(null)}let u=n.tr;(n.selection instanceof Te||n.selection instanceof Ut)&&u.deleteSelection();let c=u.mapping.map(t.pos),d=ul(u.doc,c,s.length,s);if(d||(s[0]=o?{type:o}:null,d=ul(u.doc,c,s.length,s)),u.split(c,s.length,s),!a&&l&&t.node(i).type!=o){let h=u.mapping.map(t.before(i)),p=u.doc.resolve(h);o&&t.node(i-1).canReplaceWith(p.index(),p.index()+1,o)&&u.setNodeMarkup(u.mapping.map(t.before(i)),o)}return e&&e(u.scrollIntoView()),!0};function Q0(n,e,t,r){let i,o,s=e.nodeBefore,a=e.nodeAfter,l=s.type.spec.isolating||a.type.spec.isolating;if(!l&&function(p,f,m){let g=f.nodeBefore,E=f.nodeAfter,v=f.index();return!(!(g&&E&&g.type.compatibleContent(E.type))||(!g.content.size&&f.parent.canReplace(v-1,v)?(m&&m(p.tr.delete(f.pos-g.nodeSize,f.pos).scrollIntoView()),0):!f.parent.canReplace(v,v+1)||!E.isTextblock&&!G0(p.doc,f.pos)||(m&&m(p.tr.join(f.pos).scrollIntoView()),0)))}(n,e,t))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(i=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(i[0]||a.type).validEnd){if(t){let p=e.pos+a.nodeSize,f=q.empty;for(let E=i.length-1;E>=0;E--)f=q.from(i[E].create(null,f));f=q.from(s.copy(f));let m=n.tr.step(new gr(e.pos-1,p,e.pos,p,new G(f,1,0),i.length,!0)),g=m.doc.resolve(p+2*i.length);g.nodeAfter&&g.nodeAfter.type==s.type&&G0(m.doc,g.pos)&&m.join(g.pos),t(m.scrollIntoView())}return!0}let c=a.type.spec.isolating||r>0&&l?null:ve.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),h=d&&Hd(d);if(h!=null&&h>=e.depth)return t&&t(n.tr.lift(d,h).scrollIntoView()),!0;if(u&&ji(a,"start",!0)&&ji(s,"end")){let p=s,f=[];for(;f.push(p),!p.isTextblock;)p=p.lastChild;let m=a,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(t){let E=q.empty;for(let v=f.length-1;v>=0;v--)E=q.from(f[v].copy(E));t(n.tr.step(new gr(e.pos-f.length,e.pos+a.nodeSize,e.pos+g,e.pos+a.nodeSize-g,new G(E,f.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ev(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(t&&t(e.tr.setSelection(Te.create(e.doc,n<0?i.start(o):i.end(o)))),!0)}}const xN=ev(-1),MN=ev(1);function zd(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}let Vd=zd(q0,(n,e,t)=>{let r=function(s,a){let{$cursor:l}=s.selection;return!l||(a?!a.endOfTextblock("backward",s):l.parentOffset>0)?null:l}(n,t);if(!r)return!1;let i=J0(r);if(!i){let s=r.blockRange(),a=s&&Hd(s);return a!=null&&(e&&e(n.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(Q0(n,i,e,-1))return!0;if(r.parent.content.size==0&&(ji(o,"end")||le.isSelectable(o)))for(let s=r.depth;;s--){let a=X0(n.doc,r.before(s),r.after(s),G.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=n.tr.step(a);l.setSelection(ji(o,"end")?ve.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):le.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)},(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=J0(r)}let s=o&&o.nodeBefore;return!(!s||!le.isSelectable(s))&&(e&&e(n.tr.setSelection(le.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)}),tv=zd(q0,(n,e,t)=>{let r=function(s,a){let{$cursor:l}=s.selection;return!l||(a?!a.endOfTextblock("forward",s):l.parentOffset<l.parent.content.size)?null:l}(n,t);if(!r)return!1;let i=Z0(r);if(!i)return!1;let o=i.nodeAfter;if(Q0(n,i,e,1))return!0;if(r.parent.content.size==0&&(ji(o,"start")||le.isSelectable(o))){let s=X0(n.doc,r.before(),r.after(),G.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=n.tr.step(s);a.setSelection(ji(o,"start")?ve.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):le.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=Z0(r)}let s=o&&o.nodeAfter;return!(!s||!le.isSelectable(s))&&(e&&e(n.tr.setSelection(le.create(n.doc,o.pos)).scrollIntoView()),!0)});const Vn={Enter:zd((n,e)=>{let{$head:t,$anchor:r}=n.selection;return!(!t.parent.type.spec.code||!t.sameParent(r))&&(e&&e(n.tr.insertText(`
83
- `).scrollIntoView()),!0)},(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Ut||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Yd(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=n.tr.insert(s,o.createAndFill());a.setSelection(Te.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(ul(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Hd(r);return i!=null&&(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},LN),"Mod-Enter":(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),s=Yd(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=t.after(),l=n.tr.replaceWith(a,a,s.createAndFill());l.setSelection(ve.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Backspace:Vd,"Mod-Backspace":Vd,"Shift-Backspace":Vd,Delete:tv,"Mod-Delete":tv,"Mod-a":(n,e)=>(e&&e(n.tr.setSelection(new Ut(n.doc))),!0)},nv={"Ctrl-h":Vn.Backspace,"Alt-Backspace":Vn["Mod-Backspace"],"Ctrl-d":Vn.Delete,"Ctrl-Alt-Backspace":Vn["Mod-Delete"],"Alt-Delete":Vn["Mod-Delete"],"Alt-d":Vn["Mod-Delete"],"Ctrl-a":xN,"Ctrl-e":MN};for(let n in Vn)nv[n]=Vn[n];const hl=(typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!(typeof os>"u"||!os.platform)&&os.platform()=="darwin")?nv:Vn,ms=(n,e,t=void 0)=>function(r,i){return r.reduce((o,s,a)=>o.concat(i(s,a)),[])}(n,r=>{if(typeof r=="string")return e(r,t);switch(r.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return[{type:r.type,children:ms(r.children,e,r.type)}];case"link":return[{type:r.type,url:r.url,children:ms(r.children,e,r.type)}];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return[{type:r.type,action:r.action,params:r.params,children:ms(r.children,e,r.type)}];case"mention":case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return[r]}});function Wn(n,e){return t=>{const r=t;let i=0;const o=[];for(const s of Qu(t,n)){s.index-i>0&&o.push(r.substring(i,s.index));const a=e(s);Array.isArray(a)?o.push(...a):o.push(a),i=s.index+s[0].length}return i<t.length&&o.push(t.substring(i)),o}}function rv(n){return n.replace(/<!!mention:.*?\|([^>]*)>/gim,"@$1").replace(/<!!customemoji:(.*?)>/gim,"$1")}const iv="’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var Wd=(n=>(n[n.italic=1]="italic",n[n.strikethrough=2]="strikethrough",n[n.bold=4]="bold",n))(Wd||{});const PN=[0,1,2,3,4,5,6].map(n=>{const e=[];return 1&n||e.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/),2&n||e.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/),4&n||e.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/),new RegExp(e.map(t=>t.source).join("|"),"g")}),BN={_:1,"*":4,"~":2};function FN(n){return ov(n,0)}function ov(n,e=0){const t=PN[e],r=t?function(i){const o=UN.getOrCompute(i,()=>new RegExp(`(?:^|[\\s${iv}])(?:${i.source})(?=[\\s${iv}]|$)`,"g")),s=Wn(o,a=>{const l=a[0][1],u=a[1]||a[2]||a[3]||a[4]||a[5]||a[6];return[" ",{type:Wd[BN[l]],children:[u]}]});return a=>{const[l,...u]=s(" "+a);return l.length>1&&u.unshift(l.substring(1)),u}}(t):()=>[n];return ms(r(n),(i,o)=>o==="bold"||o==="italic"||o==="strikethrough"?ov(i,e|Wd[o]):[i])}const UN=function(){const n=function(){try{return new WeakMap}catch{const t={has:()=>!1,get:()=>{},set:()=>t};return t}}();return{getOrCompute(e,t){if(n.has(e))return n.get(e);const r=t();return n.set(e,r),r}}}();function sv(n,e){if(Array.prototype.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function Gr(n,e){for(var t=n.length-1;t>=0;t--)e(n[t])===!0&&n.splice(t,1)}function av(n){throw new Error("Unhandled case for value: '"+n+"'")}var Gd=function(){function n(e){e===void 0&&(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 n.prototype.setTagName=function(e){return this.tagName=e,this},n.prototype.getTagName=function(){return this.tagName||""},n.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},n.prototype.getAttr=function(e){return this.getAttrs()[e]},n.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},n.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},n.prototype.setClass=function(e){return this.setAttr("class",e)},n.prototype.addClass=function(e){for(var t,r=this.getClass(),i=this.whitespaceRegex,o=r?r.split(i):[],s=e.split(i);t=s.shift();)sv(o,t)===-1&&o.push(t);return this.getAttrs().class=o.join(" "),this},n.prototype.removeClass=function(e){for(var t,r=this.getClass(),i=this.whitespaceRegex,o=r?r.split(i):[],s=e.split(i);o.length&&(t=s.shift());){var a=sv(o,t);a!==-1&&o.splice(a,1)}return this.getAttrs().class=o.join(" "),this},n.prototype.getClass=function(){return this.getAttrs().class||""},n.prototype.hasClass=function(e){return(" "+this.getClass()+" ").indexOf(" "+e+" ")!==-1},n.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},n.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},n.prototype.getInnerHTML=function(){return this.innerHTML||""},n.prototype.getInnerHtml=function(){return this.getInnerHTML()},n.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},n.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")},n}(),lv=function(){function n(e){e===void 0&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return n.prototype.build=function(e){return new Gd({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},n.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},r=this.createCssClass(e);return r&&(t.class=r),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},n.prototype.createCssClass=function(e){var t=this.className;if(t){for(var r=[t],i=e.getCssClassSuffixes(),o=0,s=i.length;o<s;o++)r.push(t+"-"+i[o]);return r.join(" ")}return""},n.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},n.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var r=t.length,i=t.location;return i==="smart"?function(o,s,a){var l,u;a==null?(a="&hellip;",u=3,l=8):(u=a.length,l=a.length);var c=function(_){var O="";return _.scheme&&_.host&&(O+=_.scheme+"://"),_.host&&(O+=_.host),_.path&&(O+="/"+_.path),_.query&&(O+="?"+_.query),_.fragment&&(O+="#"+_.fragment),O},d=function(_,O){var T=O/2,S=Math.ceil(T),b=-1*Math.floor(T),y="";return b<0&&(y=_.substr(b)),_.substr(0,S)+a+y};if(o.length<=s)return o;var h=s-u,p=function(_){var O={},T=_,S=T.match(/^([a-z]+):\/\//i);return S&&(O.scheme=S[1],T=T.substr(S[0].length)),(S=T.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(O.host=S[1],T=T.substr(S[0].length)),(S=T.match(/^\/(.*?)(?=(\?|#|$))/i))&&(O.path=S[1],T=T.substr(S[0].length)),(S=T.match(/^\?(.*?)(?=(#|$))/i))&&(O.query=S[1],T=T.substr(S[0].length)),(S=T.match(/^#(.*?)$/i))&&(O.fragment=S[1]),O}(o);if(p.query){var f=p.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(p.query=p.query.substr(0,f[1].length),o=c(p))}if(o.length<=s||(p.host&&(p.host=p.host.replace(/^www\./,""),o=c(p)),o.length<=s))return o;var m="";if(p.host&&(m+=p.host),m.length>=h)return p.host.length==s?(p.host.substr(0,s-u)+a).substr(0,h+l):d(m,h).substr(0,h+l);var g="";if(p.path&&(g+="/"+p.path),p.query&&(g+="?"+p.query),g){if((m+g).length>=h)return(m+g).length==s?(m+g).substr(0,s):(m+d(g,h-m.length)).substr(0,h+l);m+=g}if(p.fragment){var E="#"+p.fragment;if((m+E).length>=h)return(m+E).length==s?(m+E).substr(0,s):(m+d(E,h-m.length)).substr(0,h+l);m+=E}if(p.scheme&&p.host){var v=p.scheme+"://";if((m+v).length<h)return(v+m).substr(0,s)}if(m.length<=s)return m;var A="";return h>0&&(A=m.substr(-1*Math.floor(h/2))),(m.substr(0,Math.ceil(h/2))+a+A).substr(0,h+l)}(e,r):i==="middle"?function(o,s,a){if(o.length<=s)return o;var l,u;a==null?(a="&hellip;",l=8,u=3):(l=a.length,u=a.length);var c=s-u,d="";return c>0&&(d=o.substr(-1*Math.floor(c/2))),(o.substr(0,Math.ceil(c/2))+a+d).substr(0,c+l)}(e,r):function(o,s,a){return function(l,u,c){var d;return l.length>u&&(c==null?(c="&hellip;",d=3):d=c.length,l=l.substring(0,u-d)+c),l}(o,s,a)}(e,r)},n}(),Yi=function(){function n(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return n.prototype.getMatchedText=function(){return this.matchedText},n.prototype.setOffset=function(e){this.offset=e},n.prototype.getOffset=function(){return this.offset},n.prototype.getCssClassSuffixes=function(){return[this.getType()]},n.prototype.buildTag=function(){return this.tagBuilder.build(this)},n}(),Xd=function(n,e){return Xd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},Xd(n,e)};function Tn(n,e){function t(){this.constructor=n}Xd(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var uv,Pe=function(){return Pe=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},Pe.apply(this,arguments)},Kd=function(n){function e(t){var r=n.call(this,t)||this;return r.email="",r.email=t.email,r}return Tn(e,n),e.prototype.getType=function(){return"email"},e.prototype.getEmail=function(){return this.email},e.prototype.getAnchorHref=function(){return"mailto:"+this.email},e.prototype.getAnchorText=function(){return this.email},e}(Yi),cv=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="",r.hashtag="",r.serviceName=t.serviceName,r.hashtag=t.hashtag,r}return Tn(e,n),e.prototype.getType=function(){return"hashtag"},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getHashtag=function(){return this.hashtag},e.prototype.getAnchorHref=function(){var t=this.serviceName,r=this.hashtag;switch(t){case"twitter":return"https://twitter.com/hashtag/"+r;case"facebook":return"https://www.facebook.com/hashtag/"+r;case"instagram":return"https://instagram.com/explore/tags/"+r;default:throw new Error("Unknown service name to point hashtag to: "+t)}},e.prototype.getAnchorText=function(){return"#"+this.hashtag},e}(Yi),dv=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.mention="",r.mention=t.mention,r.serviceName=t.serviceName,r}return Tn(e,n),e.prototype.getType=function(){return"mention"},e.prototype.getMention=function(){return this.mention},e.prototype.getServiceName=function(){return this.serviceName},e.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)}},e.prototype.getAnchorText=function(){return"@"+this.mention},e.prototype.getCssClassSuffixes=function(){var t=n.prototype.getCssClassSuffixes.call(this),r=this.getServiceName();return r&&t.push(r),t},e}(Yi),hv=function(n){function e(t){var r=n.call(this,t)||this;return r.number="",r.plusSign=!1,r.number=t.number,r.plusSign=t.plusSign,r}return Tn(e,n),e.prototype.getType=function(){return"phone"},e.prototype.getPhoneNumber=function(){return this.number},e.prototype.getNumber=function(){return this.getPhoneNumber()},e.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},e.prototype.getAnchorText=function(){return this.matchedText},e}(Yi),qd=function(n){function e(t){var r=n.call(this,t)||this;return r.url="",r.urlMatchType="scheme",r.protocolUrlMatch=!1,r.protocolRelativeMatch=!1,r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.schemePrefixRegex=/^(https?:\/\/)?/i,r.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,r.protocolRelativeRegex=/^\/\//,r.protocolPrepended=!1,r.urlMatchType=t.urlMatchType,r.url=t.url,r.protocolUrlMatch=t.protocolUrlMatch,r.protocolRelativeMatch=t.protocolRelativeMatch,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return Tn(e,n),e.prototype.getType=function(){return"url"},e.prototype.getUrlMatchType=function(){return this.urlMatchType},e.prototype.getUrl=function(){var t=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(t=this.url="http://"+t,this.protocolPrepended=!0),t},e.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,"&")},e.prototype.getAnchorText=function(){var t=this.getMatchedText();return this.protocolRelativeMatch&&(t=this.stripProtocolRelativePrefix(t)),this.stripPrefix.scheme&&(t=this.stripSchemePrefix(t)),this.stripPrefix.www&&(t=this.stripWwwPrefix(t)),this.stripTrailingSlash&&(t=this.removeTrailingSlash(t)),this.decodePercentEncoding&&(t=this.removePercentEncoding(t)),t},e.prototype.stripSchemePrefix=function(t){return t.replace(this.schemePrefixRegex,"")},e.prototype.stripWwwPrefix=function(t){return t.replace(this.wwwPrefixRegex,"$1")},e.prototype.stripProtocolRelativePrefix=function(t){return t.replace(this.protocolRelativeRegex,"")},e.prototype.removeTrailingSlash=function(t){return t.charAt(t.length-1)==="/"&&(t=t.slice(0,-1)),t},e.prototype.removePercentEncoding=function(t){var r=t.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(r)}catch{return r}},e}(Yi),zi=function(n){this.__jsduckDummyDocProp=null,this.tagBuilder=n.tagBuilder},Jd=/[A-Za-z]/,HN=/[\d]/,$N=/[\D]/,Xr=/\s/,Zd=/['"]/,jN=/[\x00-\x1F\x7F]/,pv=/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,fv=pv+/\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,pl=/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,YN=fv+pl,He=fv+pl,zN="(?:["+pl+"]{1,3}\\.){3}["+pl+"]{1,3}",VN="["+He+"](?:["+He+"\\-]{0,61}["+He+"])?",mv=function(n){return"(?=("+VN+"))\\"+n},Qd=function(n){return"(?:"+mv(n)+"(?:\\."+mv(n+1)+"){0,126}|"+zN+")"},fl=new RegExp("["+He+"]"),gv=/(?: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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,WN=new RegExp("["+He+"!#$%&'*+/=?^_`{|}~-]"),GN=new RegExp("^"+gv.source+"$"),Ev=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.localPartCharRegex=WN,t.strictTldRegex=GN,t}return Tn(e,n),e.prototype.parseMatches=function(t){for(var r=this.tagBuilder,i=this.localPartCharRegex,o=this.strictTldRegex,s=[],a=t.length,l=new ml,u={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},c=0,d=0,h=l;c<a;){var p=t.charAt(c);switch(d){case 0:f(p);break;case 1:m(t.charAt(c-1),p);break;case 2:g(p);break;case 3:E(p);break;case 4:v(p);break;case 5:A(p);break;case 6:_(p);break;case 7:O(p);break;default:av(d)}c++}return b(),s;function f(y){y==="m"?T(1):i.test(y)&&T()}function m(y,C){y===":"?i.test(C)?(d=2,h=new ml(Pe(Pe({},h),{hasMailtoPrefix:!0}))):S():u[y]===C||(i.test(C)?d=2:C==="."?d=3:C==="@"?d=4:S())}function g(y){y==="."?d=3:y==="@"?d=4:i.test(y)||S()}function E(y){y==="."||y==="@"?S():i.test(y)?d=2:S()}function v(y){fl.test(y)?d=5:S()}function A(y){y==="."?d=7:y==="-"?d=6:fl.test(y)||b()}function _(y){y==="-"||y==="."?b():fl.test(y)?d=5:b()}function O(y){y==="."||y==="-"?b():fl.test(y)?(d=5,h=new ml(Pe(Pe({},h),{hasDomainDot:!0}))):b()}function T(y){y===void 0&&(y=2),d=y,h=new ml({idx:c})}function S(){d=0,h=l}function b(){if(h.hasDomainDot){var y=t.slice(h.idx,c);/[-.]$/.test(y)&&(y=y.slice(0,-1));var C=h.hasMailtoPrefix?y.slice(7):y;(function(w){var I=w.split(".").pop()||"",F=I.toLowerCase();return o.test(F)})(C)&&s.push(new Kd({tagBuilder:r,matchedText:y,offset:h.idx,email:C}))}S()}},e}(zi),ml=function(n){n===void 0&&(n={}),this.idx=n.idx!==void 0?n.idx:-1,this.hasMailtoPrefix=!!n.hasMailtoPrefix,this.hasDomainDot=!!n.hasDomainDot},XN=function(){function n(){}return n.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},n.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return e.match(t)!==null},n.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},n.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),r=t&&t[0].toLowerCase();return r!=="javascript:"&&r!=="vbscript:"},n.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||e.indexOf(".")!==-1)},n.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&!this.hasFullProtocolRegex.test(t)&&!this.hasWordCharAfterProtocolRegex.test(e)},n.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,n.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,n.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+pv+"]"),n.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]*)?\/?$/,n}(),KN=(uv=new RegExp("[/?#](?:["+He+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+He+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,Qd(2),")","|","(","(//)?",/(?:www\.)/.source,Qd(6),")","|","(","(//)?",Qd(10)+"\\.",gv.source,"(?![-"+YN+"])",")",")","(?::[0-9]+)?","(?:"+uv.source+")?"].join(""),"gi")),qN=new RegExp("["+He+"]"),vv=function(n){function e(t){var r=n.call(this,t)||this;return r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.matcherRegex=KN,r.wordCharRegExp=qN,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return Tn(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.stripPrefix,s=this.stripTrailingSlash,a=this.decodePercentEncoding,l=this.tagBuilder,u=[],c=function(){var h=r[0],p=r[1],f=r[4],m=r[5],g=r[9],E=r.index,v=m||g,A=t.charAt(E-1);if(!XN.isValid(h,p)||E>0&&A==="@"||E>0&&v&&d.wordCharRegExp.test(A))return"continue";if(/\?$/.test(h)&&(h=h.substr(0,h.length-1)),d.matchHasUnbalancedClosingParen(h))h=h.substr(0,h.length-1);else{var _=d.matchHasInvalidCharAfterTld(h,p);_>-1&&(h=h.substr(0,_))}var O=["http://","https://"].find(function(y){return!!p&&p.indexOf(y)!==-1});if(O){var T=h.indexOf(O);h=h.substr(T),p=p.substr(T),E+=T}var S=p?"scheme":f?"www":"tld",b=!!p;u.push(new qd({tagBuilder:l,matchedText:h,offset:E,urlMatchType:S,url:h,protocolUrlMatch:b,protocolRelativeMatch:!!v,stripPrefix:o,stripTrailingSlash:s,decodePercentEncoding:a}))},d=this;(r=i.exec(t))!==null;)c();return u},e.prototype.matchHasUnbalancedClosingParen=function(t){var r,i=t.charAt(t.length-1);if(i===")")r="(";else if(i==="]")r="[";else{if(i!=="}")return!1;r="{"}for(var o=0,s=0,a=t.length-1;s<a;s++){var l=t.charAt(s);l===r?o++:l===i&&(o=Math.max(o-1,0))}return o===0},e.prototype.matchHasInvalidCharAfterTld=function(t,r){if(!t)return-1;var i=0;r&&(i=t.indexOf(":"),t=t.slice(i));var o=new RegExp("^((.?//)?[-."+He+"]*[-"+He+"]\\.[-"+He+"]+)").exec(t);return o===null?-1:(i+=o[1].length,t=t.slice(o[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(t)?i:-1)},e}(zi),JN=new RegExp("#[_"+He+"]{1,139}(?![_"+He+"])","g"),ZN=new RegExp("[^"+He+"]"),Av=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.matcherRegex=JN,r.nonWordCharRegex=ZN,r.serviceName=t.serviceName,r}return Tn(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.nonWordCharRegex,s=this.serviceName,a=this.tagBuilder,l=[];(r=i.exec(t))!==null;){var u=r.index,c=t.charAt(u-1);if(u===0||o.test(c)){var d=r[0],h=r[0].slice(1);l.push(new cv({tagBuilder:a,matchedText:d,offset:u,serviceName:s,hashtag:h}))}}return l},e}(zi),QN=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"),_v=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.matcherRegex=QN,t}return Tn(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.tagBuilder,s=[];(r=i.exec(t))!==null;){var a=r[0],l=a.replace(/[^0-9,;#]/g,""),u=!(!r[1]&&!r[2]),c=r.index==0?"":t.substr(r.index-1,1),d=t.substr(r.index+a.length,1),h=!c.match(/\d/)&&!d.match(/\d/);this.testMatch(r[3])&&this.testMatch(a)&&h&&s.push(new hv({tagBuilder:o,matchedText:a,offset:r.index,number:l,plusSign:u}))}return s},e.prototype.testMatch=function(t){return $N.test(t)},e}(zi),eC=new RegExp("@[_"+He+"]{1,50}(?![_"+He+"])","g"),tC=new RegExp("@[_."+He+"]{1,30}(?![_"+He+"])","g"),nC=new RegExp("@[-_."+He+"]{1,50}(?![-_"+He+"])","g"),rC=new RegExp("[^"+He+"]"),yv=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.matcherRegexes={twitter:eC,instagram:tC,soundcloud:nC},r.nonWordCharRegex=rC,r.serviceName=t.serviceName,r}return Tn(e,n),e.prototype.parseMatches=function(t){var r,i=this.serviceName,o=this.matcherRegexes[this.serviceName],s=this.nonWordCharRegex,a=this.tagBuilder,l=[];if(!o)return l;for(;(r=o.exec(t))!==null;){var u=r.index,c=t.charAt(u-1);if(u===0||s.test(c)){var d=r[0].replace(/\.+$/g,""),h=d.slice(1);l.push(new dv({tagBuilder:a,matchedText:d,offset:u,serviceName:i,mention:h}))}}return l},e}(zi);function iC(n,e){for(var t,r=e.onOpenTag,i=e.onCloseTag,o=e.onText,s=e.onComment,a=e.onDoctype,l=new Sn,u=0,c=n.length,d=0,h=0,p=l;u<c;){var f=n.charAt(u);switch(d){case 0:m(f);break;case 1:g(f);break;case 2:v(f);break;case 3:E(f);break;case 4:A(f);break;case 5:_(f);break;case 6:O(f);break;case 7:T(f);break;case 8:S(f);break;case 9:b(f);break;case 10:y(f);break;case 11:C(f);break;case 12:w(f);break;case 13:I();break;case 14:F(f);break;case 15:L(f);break;case 16:j(f);break;case 17:D(f);break;case 18:B(f);break;case 19:H(f);break;case 20:x(f);break;default:av(d)}u++}function m(k){k==="<"&&Y()}function g(k){k==="!"?d=13:k==="/"?(d=2,p=new Sn(Pe(Pe({},p),{isClosing:!0}))):k==="<"?Y():Jd.test(k)?(d=3,p=new Sn(Pe(Pe({},p),{isOpening:!0}))):(d=0,p=l)}function E(k){Xr.test(k)?(p=new Sn(Pe(Pe({},p),{name:se()})),d=4):k==="<"?Y():k==="/"?(p=new Sn(Pe(Pe({},p),{name:se()})),d=12):k===">"?(p=new Sn(Pe(Pe({},p),{name:se()})),J()):Jd.test(k)||HN.test(k)||k===":"||Q()}function v(k){k===">"?Q():Jd.test(k)?d=3:Q()}function A(k){Xr.test(k)||(k==="/"?d=12:k===">"?J():k==="<"?Y():k==="="||Zd.test(k)||jN.test(k)?Q():d=5)}function _(k){Xr.test(k)?d=6:k==="/"?d=12:k==="="?d=7:k===">"?J():k==="<"?Y():Zd.test(k)&&Q()}function O(k){Xr.test(k)||(k==="/"?d=12:k==="="?d=7:k===">"?J():k==="<"?Y():Zd.test(k)?Q():d=5)}function T(k){Xr.test(k)||(k==='"'?d=8:k==="'"?d=9:/[>=`]/.test(k)?Q():k==="<"?Y():d=10)}function S(k){k==='"'&&(d=11)}function b(k){k==="'"&&(d=11)}function y(k){Xr.test(k)?d=4:k===">"?J():k==="<"&&Y()}function C(k){Xr.test(k)?d=4:k==="/"?d=12:k===">"?J():k==="<"?Y():(d=4,u--)}function w(k){k===">"?(p=new Sn(Pe(Pe({},p),{isClosing:!0})),J()):d=4}function I(k){n.substr(u,2)==="--"?(u+=2,p=new Sn(Pe(Pe({},p),{type:"comment"})),d=14):n.substr(u,7).toUpperCase()==="DOCTYPE"?(u+=7,p=new Sn(Pe(Pe({},p),{type:"doctype"})),d=20):Q()}function F(k){k==="-"?d=15:k===">"?Q():d=16}function L(k){k==="-"?d=18:k===">"?Q():d=16}function j(k){k==="-"&&(d=17)}function D(k){d=k==="-"?18:16}function B(k){k===">"?J():k==="!"?d=19:k==="-"||(d=16)}function H(k){k==="-"?d=17:k===">"?J():d=16}function x(k){k===">"?J():k==="<"&&Y()}function Q(){d=0,p=l}function Y(){d=1,p=new Sn({idx:u})}function J(){var k=n.slice(h,p.idx);k&&o(k,h),p.type==="comment"?s(p.idx):p.type==="doctype"?a(p.idx):(p.isOpening&&r(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),Q(),h=u+1}function se(){var k=p.idx+(p.isClosing?2:1);return n.slice(k,u).toLowerCase()}h<u&&(t=n.slice(h,u),o(t,h),h=u+1)}var Sn=function(n){n===void 0&&(n={}),this.idx=n.idx!==void 0?n.idx:-1,this.type=n.type||"tag",this.name=n.name||"",this.isOpening=!!n.isOpening,this.isClosing=!!n.isClosing},oC=function(){function n(e){e===void 0&&(e={}),this.version=n.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(e.urls),this.email=typeof e.email=="boolean"?e.email:this.email,this.phone=typeof e.phone=="boolean"?e.phone:this.phone,this.hashtag=e.hashtag||this.hashtag,this.mention=e.mention||this.mention,this.newWindow=typeof e.newWindow=="boolean"?e.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(e.stripPrefix),this.stripTrailingSlash=typeof e.stripTrailingSlash=="boolean"?e.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=typeof e.decodePercentEncoding=="boolean"?e.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=e.sanitizeHtml||!1;var t=this.mention;if(t!==!1&&t!=="twitter"&&t!=="instagram"&&t!=="soundcloud")throw new Error("invalid `mention` cfg - see docs");var r=this.hashtag;if(r!==!1&&r!=="twitter"&&r!=="facebook"&&r!=="instagram")throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(e.truncate),this.className=e.className||this.className,this.replaceFn=e.replaceFn||this.replaceFn,this.context=e.context||this}return n.link=function(e,t){return new n(t).link(e)},n.parse=function(e,t){return new n(t).parse(e)},n.prototype.normalizeUrlsCfg=function(e){return e==null&&(e=!0),typeof e=="boolean"?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:typeof e.schemeMatches!="boolean"||e.schemeMatches,wwwMatches:typeof e.wwwMatches!="boolean"||e.wwwMatches,tldMatches:typeof e.tldMatches!="boolean"||e.tldMatches}},n.prototype.normalizeStripPrefixCfg=function(e){return e==null&&(e=!0),typeof e=="boolean"?{scheme:e,www:e}:{scheme:typeof e.scheme!="boolean"||e.scheme,www:typeof e.www!="boolean"||e.www}},n.prototype.normalizeTruncateCfg=function(e){return typeof e=="number"?{length:e,location:"end"}:function(t,r){for(var i in r)r.hasOwnProperty(i)&&t[i]===void 0&&(t[i]=r[i]);return t}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},n.prototype.parse=function(e){var t=this,r=["a","style","script"],i=0,o=[];return iC(e,{onOpenTag:function(s){r.indexOf(s)>=0&&i++},onText:function(s,a){if(i===0){var l=function(c,d){if(!d.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var h,p=[],f=0;h=d.exec(c);)p.push(c.substring(f,h.index)),p.push(h[0]),f=h.index+h[0].length;return p.push(c.substring(f)),p}(s,/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),u=a;l.forEach(function(c,d){if(d%2==0){var h=t.parseText(c,u);o.push.apply(o,h)}u+=c.length})}},onCloseTag:function(s){r.indexOf(s)>=0&&(i=Math.max(i-1,0))},onComment:function(s){},onDoctype:function(s){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o)},n.prototype.compactMatches=function(e){e.sort(function(l,u){return l.getOffset()-u.getOffset()});for(var t=0;t<e.length-1;t++){var r=e[t],i=r.getOffset(),o=r.getMatchedText().length,s=i+o;if(t+1<e.length){if(e[t+1].getOffset()===i){var a=e[t+1].getMatchedText().length>o?t:t+1;e.splice(a,1);continue}e[t+1].getOffset()<s&&e.splice(t+1,1)}}return e},n.prototype.removeUnwantedMatches=function(e){return this.hashtag||Gr(e,function(t){return t.getType()==="hashtag"}),this.email||Gr(e,function(t){return t.getType()==="email"}),this.phone||Gr(e,function(t){return t.getType()==="phone"}),this.mention||Gr(e,function(t){return t.getType()==="mention"}),this.urls.schemeMatches||Gr(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="scheme"}),this.urls.wwwMatches||Gr(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="www"}),this.urls.tldMatches||Gr(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="tld"}),e},n.prototype.parseText=function(e,t){t===void 0&&(t=0),t=t||0;for(var r=this.getMatchers(),i=[],o=0,s=r.length;o<s;o++){for(var a=r[o].parseMatches(e),l=0,u=a.length;l<u;l++)a[l].setOffset(t+a[l].getOffset());i.push.apply(i,a)}return i},n.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var t=this.parse(e),r=[],i=0,o=0,s=t.length;o<s;o++){var a=t[o];r.push(e.substring(i,a.getOffset())),r.push(this.createMatchReturnVal(a)),i=a.getOffset()+a.getMatchedText().length}return r.push(e.substring(i)),r.join("")},n.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),typeof t=="string"?t:t===!1?e.getMatchedText():t instanceof Gd?t.toAnchorString():e.buildTag().toAnchorString()},n.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new Av({tagBuilder:e,serviceName:this.hashtag}),new Ev({tagBuilder:e}),new _v({tagBuilder:e}),new yv({tagBuilder:e,serviceName:this.mention}),new vv({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},n.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new lv({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},n.version="3.14.3",n.AnchorTagBuilder=lv,n.HtmlTag=Gd,n.matcher={Email:Ev,Hashtag:Av,Matcher:zi,Mention:yv,Phone:_v,Url:vv},n.match={Email:Kd,Hashtag:cv,Match:Yi,Mention:dv,Phone:hv,Url:qd},n}();function Ov(n,e=n){return{type:"autolink",url:n,text:e}}const sC=Wn(/<!!mention:([^>\s]*?)\|(.*?)>/gm,([n,e,t])=>function(r,i){return{type:"mention",id:r,text:i}}(decodeURIComponent(e),t)),aC=Wn(/<!!customemoji:(.*?)>/gm,([n,e])=>function(t){return{type:"customemoji",text:t}}(e)),Tv=Wn(/<((?:https?|mailto):.*?)\|(.*?)>/gi,([n,e,t])=>function(r,i=[]){return{type:"link",url:r,children:i}}(e,[t])),lC=Wn(/<actionlink:([^|]+)[|]([^>]*)>/gi,([n,e,t])=>{const{action:r,params:i}=Sv(e);return function(o,s,a=[]){return{type:"actionlink",action:o,params:s,children:a}}(r,i,[t])}),uC=Wn(/<actionbutton:([^|]+)[|]([^>]*)>/gi,([n,e,t])=>{const{action:r,params:i}=Sv(e);return function(o,s,a=[]){return{type:"actionbutton",action:o,params:s,children:a}}(r,i,[t])});function Sv(n){const e=n.indexOf("?");return e===-1?{action:n,params:{}}:{action:n.slice(0,e),params:Object.fromEntries(new URLSearchParams(n.slice(e)))}}const cC=Wn(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g,([n])=>function(e=[]){return{type:"bulletlist",children:e}}([n.startsWith(`
82
+ `))),0,0):G.empty;let d=n.someProp("clipboardTextParser",h=>h(e,i,r,n));if(d)s=d;else{let h=i.marks(),{schema:p}=n.state,f=Hn.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=o.appendChild(document.createElement("p"));m&&g.appendChild(f.serializeNode(p.text(m,h)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),o=function(d){let h=/^(\s*<meta [^>]*>)*/.exec(d);h&&(d=d.slice(h[0].length));let p,f=o0().createElement("div"),m=/<([a-z][^>\s]+)/i.exec(d);if((p=m&&r0[m[1].toLowerCase()])&&(d=p.map(g=>"<"+g+">").join("")+d+p.map(g=>"</"+g+">").reverse().join("")),f.innerHTML=d,p)for(let g=0;g<p.length;g++)f=f.querySelector(p[g])||f;return f}(t),ts&&function(d){let h=d.querySelectorAll(lt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let p=0;p<h.length;p++){let f=h[p];f.childNodes.length==1&&f.textContent==" "&&f.parentNode&&f.parentNode.replaceChild(d.ownerDocument.createTextNode(" "),f)}}(o);let u=o&&o.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let h=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(s||(s=(n.someProp("clipboardParser")||n.someProp("domParser")||Xo.fromSchema(n.state.schema)).parseSlice(o,{preserveWhitespace:!(!l&&!c),context:i,ruleFromNode:h=>h.nodeName!="BR"||h.nextSibling||!h.parentNode||tN.test(h.parentNode.nodeName)?null:{ignore:!0}})),c)s=function(d,h){if(!d.size)return d;let p,f=d.content.firstChild.type.schema;try{p=JSON.parse(h)}catch{return d}let{content:m,openStart:g,openEnd:E}=d;for(let v=p.length-2;v>=0;v-=2){let A=f.nodes[p[v]];if(!A||A.hasRequiredAttrs())break;m=q.from(A.create(p[v+1],m)),g++,E++}return new G(m,g,E)}(n0(s,+c[1],+c[2]),c[4]);else if(s=G.maxOpen(function(d,h){if(d.childCount<2)return d;for(let p=h.depth;p>=0;p--){let f,m=h.node(p).contentMatchAt(h.index(p)),g=[];if(d.forEach(E=>{if(!g)return;let v,A=m.findWrapping(E.type);if(!A)return g=null;if(v=g.length&&f.length&&e0(A,f,E,g[g.length-1],0))g[g.length-1]=v;else{g.length&&(g[g.length-1]=t0(g[g.length-1],f.length));let _=QE(E,A);g.push(_),m=m.matchType(_.type),f=A}}),g)return q.from(g)}return d}(s.content,i),!0),s.openStart||s.openEnd){let d=0,h=0;for(let p=s.content.firstChild;d<s.openStart&&!p.type.spec.isolating;d++,p=p.firstChild);for(let p=s.content.lastChild;h<s.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);s=n0(s,d,h)}return n.someProp("transformPasted",d=>{s=d(s,n)}),s}const tN=/^(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 QE(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,q.from(n));return n}function e0(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let o=e0(n,e,t,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(q.from(QE(t,n,i+1))))}}function t0(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,t0(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(q.empty,!0);return n.copy(t.append(r))}function Ad(n,e,t,r,i,o){let s=e<0?n.firstChild:n.lastChild,a=s.content;return n.childCount>1&&(o=0),i<r-1&&(a=Ad(a,e,t,r,i+1,o)),i>=t&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(q.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(a))}function n0(n,e,t){return e<n.openStart&&(n=new G(Ad(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new G(Ad(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const r0={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 i0=null;function o0(){return i0||(i0=document.implementation.createHTMLDocument("title"))}const vt={},At={},nN={touchstart:!0,touchmove:!0};class rN{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 cr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function _d(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>yd(n,r))})}function yd(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return!!r&&(r(n,e)||e.defaultPrevented)})}function iN(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function tl(n){return{left:n.clientX,top:n.clientY}}function Od(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,a=>s>o.depth?a(n,t,o.nodeAfter,o.before(s),i,!0):a(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function Hi(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function oN(n,e,t,r,i){return Od(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?function(o,s){if(s==-1)return!1;let a,l,u=o.state.selection;u instanceof le&&(a=u.node);let c=o.state.doc.resolve(s);for(let d=c.depth+1;d>0;d--){let h=d>c.depth?c.nodeAfter:c.node(d);if(le.isSelectable(h)){l=a&&u.$from.depth>0&&d>=u.$from.depth&&c.before(u.$from.depth+1)==u.$from.pos?c.before(u.$from.depth):c.before(d);break}}return l!=null&&(Hi(o,le.create(o.state.doc,l)),!0)}(n,t):function(o,s){if(s==-1)return!1;let a=o.state.doc.resolve(s),l=a.nodeAfter;return!!(l&&l.isAtom&&le.isSelectable(l))&&(Hi(o,new le(a)),!0)}(n,t))}function sN(n,e,t,r){return Od(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function aN(n,e,t,r){return Od(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||function(i,o,s){if(s.button!=0)return!1;let a=i.state.doc;if(o==-1)return!!a.inlineContent&&(Hi(i,Te.create(a,0,a.content.size)),!0);let l=a.resolve(o);for(let u=l.depth+1;u>0;u--){let c=u>l.depth?l.nodeAfter:l.node(u),d=l.before(u);if(c.inlineContent)Hi(i,Te.create(a,d+1,d+1+c.content.size));else{if(!le.isSelectable(c))continue;Hi(i,le.create(a,d))}return!0}}(n,t,r)}function Td(n){return nl(n)}At.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!a0(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!un||!lt||t.keyCode!=13))if(t.keyCode!=229&&n.domObserver.forceFlush(),!Bi||t.keyCode!=13||t.ctrlKey||t.altKey||t.metaKey)n.someProp("handleKeyDown",r=>r(n,t))||eN(n,t)?t.preventDefault():cr(n,"key");else{let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Br(13,"Enter"))),n.input.lastIOSEnter=0)},200)}},At.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},At.keypress=(n,e)=>{let t=e;if(a0(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||qt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t)))return void t.preventDefault();let r=n.state.selection;if(!(r instanceof Te&&r.$from.sameParent(r.$to))){let i=String.fromCharCode(t.charCode);/[\r\n]/.test(i)||n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))||n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};const s0=qt?"metaKey":"ctrlKey";vt.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Td(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&function(a,l){let u=l.x-a.clientX,c=l.y-a.clientY;return u*u+c*c<100}(t,n.input.lastClick)&&!t[s0]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let s=n.posAtCoords(tl(t));s&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new lN(n,s,t,!!r)):(o=="doubleClick"?sN:aN)(n,s.pos,s.inside,t)?t.preventDefault():cr(n,"pointer"))};class lN{constructor(e,t,r,i){let o,s;if(this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[s0],this.allowDefault=r.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let c=e.state.doc.resolve(t.pos);o=c.parent,s=c.depth?c.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l?l.dom:null;let{selection:u}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||u instanceof le&&u.from<=s&&u.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!ln||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)),cr(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(()=>zn(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(tl(e))),this.updateAllowDefault(e),this.allowDefault||!t?cr(this.view,"pointer"):oN(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Et&&this.mightDrag&&!this.mightDrag.node.isAtom||lt&&!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)?(Hi(this.view,ve.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):cr(this.view,"pointer")}move(e){this.updateAllowDefault(e),cr(this.view,"pointer"),e.buttons==0&&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 a0(n,e){return!!n.composing||!!(Et&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500)&&(n.input.compositionEndedAt=-2e8,!0)}vt.touchstart=n=>{n.input.lastTouch=Date.now(),Td(n),cr(n,"pointer")},vt.touchmove=n=>{n.input.lastTouch=Date.now(),cr(n,"pointer")},vt.contextmenu=n=>Td(n);const uN=un?5e3:-1;function l0(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>nl(n),e))}function u0(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function nl(n,e=!1){if(!(un&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),u0(n),e||n.docView&&n.docView.dirty){let t=fd(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}At.compositionstart=At.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),nl(n,!0),n.markCursor=null;else if(nl(n),ln&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){n.domSelection().collapse(s,s.nodeValue.length);break}i=s,o=-1}}n.input.composing=!0}l0(n,uN)},At.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,l0(n,20))};const as=bt&&sr<15||Bi&&jb<604;function ls(n,e,t,r,i){let o=ZE(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",l=>l(n,i,o||G.empty)))return!0;if(!o)return!1;let s=function(l){return l.openStart==0&&l.openEnd==0&&l.content.childCount==1?l.content.firstChild:null}(o),a=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function c0(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}vt.copy=At.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=as?null:t.clipboardData,s=r.content(),{dom:a,text:l}=JE(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):function(u,c){if(!u.dom.parentNode)return;let d=u.dom.parentNode.appendChild(document.createElement("div"));d.appendChild(c),d.style.cssText="position: fixed; left: -10000px; top: 10px";let h=getSelection(),p=document.createRange();p.selectNodeContents(c),u.dom.blur(),h.removeAllRanges(),h.addRange(p),setTimeout(()=>{d.parentNode&&d.parentNode.removeChild(d),u.focus()},50)}(n,a),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},At.paste=(n,e)=>{let t=e;if(n.composing&&!un)return;let r=as?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&ls(n,c0(r),r.getData("text/html"),i,t)?t.preventDefault():function(o,s){if(!o.dom.parentNode)return;let a=o.input.shiftKey||o.state.selection.$from.parent.type.spec.code,l=o.dom.parentNode.appendChild(document.createElement(a?"textarea":"div"));a||(l.contentEditable="true"),l.style.cssText="position: fixed; left: -10000px; top: 10px",l.focus();let u=o.input.shiftKey&&o.input.lastKeyCode!=45;setTimeout(()=>{o.focus(),l.parentNode&&l.parentNode.removeChild(l),a?ls(o,l.value,null,u,s):ls(o,l.textContent,l.innerHTML,u,s)},50)}(n,t)};class d0{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const h0=qt?"altKey":"ctrlKey";vt.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i,o=n.state.selection,s=o.empty?null:n.posAtCoords(tl(t));if(!(s&&s.pos>=o.from&&s.pos<=(o instanceof le?o.to-1:o.to))){if(r&&r.mightDrag)i=le.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let c=n.docView.nearestDesc(t.target,!0);c&&c.node.type.spec.draggable&&c!=n.docView&&(i=le.create(n.state.doc,c.posBefore))}}let a=(i||n.state.selection).content(),{dom:l,text:u}=JE(n,a);t.dataTransfer.clearData(),t.dataTransfer.setData(as?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",as||t.dataTransfer.setData("text/plain",u),n.dragging=new d0(a,!t[h0],i)},vt.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},At.dragover=At.dragenter=(n,e)=>e.preventDefault(),At.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(tl(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",f=>{s=f(s,n)}):s=ZE(n,c0(t.dataTransfer),as?null:t.dataTransfer.getData("text/html"),!1,o);let a=!(!r||t[h0]);if(n.someProp("handleDrop",f=>f(n,t,s||G.empty,a)))return void t.preventDefault();if(!s)return;t.preventDefault();let l=s?function(f,m,g){let E=f.resolve(m);if(!g.content.size)return m;let v=g.content;for(let A=0;A<g.openStart;A++)v=v.firstChild.content;for(let A=1;A<=(g.openStart==0&&g.size?2:1);A++)for(let _=E.depth;_>=0;_--){let y=_==E.depth?0:E.pos<=(E.start(_+1)+E.end(_+1))/2?-1:1,T=E.index(_)+(y>0?1:0),S=E.node(_),b=!1;if(A==1)b=S.canReplace(T,T,v);else{let O=S.contentMatchAt(T).findWrapping(v.firstChild.type);b=O&&S.canReplaceWith(T,T,O[0])}if(b)return y==0?E.pos:y<0?E.before(_+1):E.after(_+1)}return null}(n.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let u=n.state.tr;if(a){let{node:f}=r;f?f.replace(u):u.deleteSelection()}let c=u.mapping.map(l),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=u.doc;if(d?u.replaceRangeWith(c,c,s.content.firstChild):u.replaceRange(c,c,s),u.doc.eq(h))return;let p=u.doc.resolve(c);if(d&&le.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))u.setSelection(new le(p));else{let f=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((m,g,E,v)=>f=v),u.setSelection(gd(n,p,u.doc.resolve(f)))}n.focus(),n.dispatch(u.setMeta("uiEvent","drop"))},vt.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&zn(n)},20))},vt.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},vt.beforeinput=(n,e)=>{if(lt&&un&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:t}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=t||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,Br(8,"Backspace")))))return;let{$cursor:r}=n.state.selection;r&&r.pos>0&&n.dispatch(n.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let n in At)vt[n]=At[n];function us(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class rl{constructor(e,t){this.toDOM=e,this.spec=t||Hr,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new Ht(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof rl&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&us(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class dr{constructor(e,t){this.attrs=e,this.spec=t||Hr}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new Ht(o,s,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof dr&&us(this.attrs,e.attrs)&&us(this.spec,e.spec)}static is(e){return e.type instanceof dr}destroy(){}}class Sd{constructor(e,t){this.attrs=e,this.spec=t||Hr}map(e,t,r,i){let o=e.mapResult(t.from+i,1);if(o.deleted)return null;let s=e.mapResult(t.to+i,-1);return s.deleted||s.pos<=o.pos?null:new Ht(o.pos-r,s.pos-r,this)}valid(e,t){let r,{index:i,offset:o}=e.content.findIndex(t.from);return o==t.from&&!(r=e.child(i)).isText&&o+r.nodeSize==t.to}eq(e){return this==e||e instanceof Sd&&us(this.attrs,e.attrs)&&us(this.spec,e.spec)}destroy(){}}class Ht{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new Ht(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,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new Ht(e,e,new rl(t,r))}static inline(e,t,r,i){return new Ht(e,t,new dr(r,i))}static node(e,t,r,i){return new Ht(e,t,new Sd(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof dr}get widget(){return this.type instanceof rl}}const $i=[],Hr={};class Ge{constructor(e,t){this.local=e.length?e:$i,this.children=t.length?t:$i}static create(e,t){return t.length?il(t,e,0,Hr):ut}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=t&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<t&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,t-a,r,i+a,o)}}map(e,t,r){return this==ut||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Hr)}mapInner(e,t,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(t,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?function(a,l,u,c,d,h,p){let f=a.slice();for(let g=0,E=h;g<u.maps.length;g++){let v=0;u.maps[g].forEach((A,_,y,T)=>{let S=T-y-(_-A);for(let b=0;b<f.length;b+=3){let O=f[b+1];if(O<0||A>O+E-v)continue;let C=f[b]+E-v;_>=C?f[b+1]=A<=C?-2:-1:A>=E&&S&&(f[b]+=S,f[b+1]+=S)}v+=S}),E=u.maps[g].map(E,-1)}let m=!1;for(let g=0;g<f.length;g+=3)if(f[g+1]<0){if(f[g+1]==-2){m=!0,f[g+1]=-1;continue}let E=u.map(a[g]+h),v=E-d;if(v<0||v>=c.content.size){m=!0;continue}let A=u.map(a[g+1]+h,-1)-d,{index:_,offset:y}=c.content.findIndex(v),T=c.maybeChild(_);if(T&&y==v&&y+T.nodeSize==A){let S=f[g+2].mapInner(u,T,E+1,a[g]+h+1,p);S!=ut?(f[g]=v,f[g+1]=A,f[g+2]=S):(f[g+1]=-2,m=!0)}else m=!0}if(m){let g=function(v,A,_,y,T,S,b){function O(C,w){for(let I=0;I<C.local.length;I++){let F=C.local[I].map(y,T,w);F?_.push(F):b.onRemove&&b.onRemove(C.local[I].spec)}for(let I=0;I<C.children.length;I+=3)O(C.children[I+2],C.children[I]+w+1)}for(let C=0;C<v.length;C+=3)v[C+1]==-1&&O(v[C+2],A[C]+S+1);return _}(f,a,l,u,d,h,p),E=il(g,c,0,p);l=E.local;for(let v=0;v<f.length;v+=3)f[v+1]<0&&(f.splice(v,3),v-=3);for(let v=0,A=0;v<E.children.length;v+=3){let _=E.children[v];for(;A<f.length&&f[A]<_;)A+=3;f.splice(A,0,E.children[v],E.children[v+1],E.children[v+2])}}return new Ge(l.sort($r),f)}(this.children,s||[],e,t,r,i,o):s?new Ge(s.sort($r),$i):ut}add(e,t){return t.length?this==ut?Ge.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,o=0;e.forEach((a,l)=>{let u,c=l+r;if(u=f0(t,a,c)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,u,c+1):i.splice(o,0,l,l+a.nodeSize,il(u,a,c+1,Hr)),o+=3}});let s=p0(o?m0(t):t,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ge(s.length?this.local.concat(s).sort($r):this.local,i||this.children)}remove(e){return e.length==0||this==ut?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+t,l=r[o+1]+t;for(let c,d=0;d<e.length;d++)(c=e[d])&&c.from>a&&c.to<l&&(e[d]=null,(s||(s=[])).push(c));if(!s)continue;r==this.children&&(r=this.children.slice());let u=r[o+2].removeInner(s,a+1);u!=ut?r[o+2]=u:(r.splice(o,3),o-=3)}if(i.length){for(let o,s=0;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,t)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ge(i,r):ut}forChild(e,t){if(this==ut)return this;if(t.isLeaf)return Ge.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+t.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof dr){let u=Math.max(o,l.from)-o,c=Math.min(s,l.to)-o;u<c&&(i||(i=[])).push(l.copy(u,c))}}if(i){let a=new Ge(i.sort($r),$i);return r?new hr([a,r]):a}return r||ut}eq(e){if(this==e)return!0;if(!(e instanceof Ge)||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 bd(this.localsInner(e))}localsInner(e){if(this==ut)return $i;if(e.inlineContent||!this.local.some(dr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof dr||t.push(this.local[r]);return t}}Ge.empty=new Ge([],[]),Ge.removeOverlap=bd;const ut=Ge.empty;class hr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Hr));return hr.from(r)}forChild(e,t){if(t.isLeaf)return Ge.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,t);o!=ut&&(o instanceof hr?r=r.concat(o.members):r.push(o))}return hr.from(r)}eq(e){if(!(e instanceof hr)||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,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(t){r&&(t=t.slice(),r=!1);for(let s=0;s<o.length;s++)t.push(o[s])}else t=o}return t?bd(r?t:t.sort($r)):$i}static from(e){switch(e.length){case 0:return ut;case 1:return e[0];default:return new hr(e.every(t=>t instanceof Ge)?e:e.reduce((t,r)=>t.concat(r instanceof Ge?r:r.members),[]))}}}function p0(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new Ht(i.from+e,i.to+e,i.type))}return t}function f0(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let o,s=0;s<n.length;s++)(o=n[s])&&o.from>t&&o.to<r&&((i||(i=[])).push(o),n[s]=null);return i}function m0(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function il(n,e,t,r){let i=[],o=!1;e.forEach((a,l)=>{let u=f0(n,a,l+t);if(u){o=!0;let c=il(u,a,t+l+1,r);c!=ut&&i.push(l,l+a.nodeSize,c)}});let s=p0(o?m0(n):n,-t).sort($r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Ge(s,i):ut}function $r(n,e){return n.from-e.from||n.to-e.to}function bd(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let o=e[i];if(o.from!=r.from){o.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,o.from),g0(e,i,r.copy(o.from,r.to)));break}o.to!=r.to&&(e==n&&(e=n.slice()),e[i]=o.copy(o.from,r.to),g0(e,i+1,o.copy(r.to,o.to)))}}return e}function g0(n,e,t){for(;e<n.length&&$r(t,n[e])>0;)e++;n.splice(e,0,t)}function Nd(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=ut&&e.push(r)}),n.cursorWrapper&&e.push(Ge.create(n.state.doc,[n.cursorWrapper.deco])),hr.from(e)}const cN={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dN=bt&&sr<=11;class hN{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 pN{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new hN,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);bt&&sr<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),dN&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.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,cN)),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(YE(this.view)){if(this.suppressingSelectionUpdates)return zn(this.view);if(bt&&sr<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Pr(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,r=new Set;for(let o=e.focusNode;o;o=es(o))r.add(o);for(let o=e.anchorNode;o;o=es(o))if(r.has(o)){t=o;break}let i=t&&this.view.docView.nearestDesc(t);return i&&i.ignoreMutation({type:"selection",target:t.nodeType==3?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 r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&YE(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let c=0;c<t.length;c++){let d=this.registerMutation(t[c],l);d&&(o=o<0?d.from:Math.min(d.from,o),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(ln&&l.length>1){let c=l.filter(d=>d.nodeName=="BR");if(c.length==2){let d=c[0],h=c[1];d.parentNode&&d.parentNode.parentNode==h.parentNode?h.remove():d.remove()}}let u=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Za(r)&&(u=fd(e))&&u.eq(ve.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,zn(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),function(c){if(!E0.has(c)&&(E0.set(c,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(c.dom).whiteSpace)!==-1)){if(c.requiresGeckoHackNode=ln,v0)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."),v0=!0}}(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||zn(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++)t.push(e.addedNodes[u]);if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(bt&&sr<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:c,nextSibling:d}=e.addedNodes[u];(!c||Array.prototype.indexOf.call(e.addedNodes,c)<0)&&(i=c),(!d||Array.prototype.indexOf.call(e.addedNodes,d)<0)&&(o=d)}let s=i&&i.parentNode==e.target?gt(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?gt(o):e.target.childNodes.length;return{from:a,to:r.localPosFromDOM(e.target,l,1)}}return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}}let E0=new WeakMap,v0=!1;function fN(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Et&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}if(n.parentNode.lastChild==n||Et&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const mN=/^(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 gN(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let O=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,C=fd(n,O);if(C&&!n.state.selection.eq(C)){if(lt&&un&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",I=>I(n,Br(13,"Enter"))))return;let w=n.state.tr.setSelection(C);O=="pointer"?w.setMeta("pointer",!0):O=="key"&&w.scrollIntoView(),o&&w.setMeta("composition",o),n.dispatch(w)}return}let s=n.state.doc.resolve(e),a=s.sharedDepth(t);e=s.before(a+1),t=n.state.doc.resolve(t).after(a+1);let l,u,c=n.state.selection,d=function(O,C,w){let I,{node:F,fromOffset:x,toOffset:$,from:k,to:M}=O.docView.parseRange(C,w),Y=O.domSelectionRange(),L=Y.anchorNode;if(L&&O.dom.contains(L.nodeType==1?L:L.parentNode)&&(I=[{node:L,offset:Y.anchorOffset}],Za(Y)||I.push({node:Y.focusNode,offset:Y.focusOffset})),lt&&O.input.lastKeyCode===8)for(let Z=$;Z>x;Z--){let ee=F.childNodes[Z-1],se=ee.pmViewDesc;if(ee.nodeName=="BR"&&!se){$=Z;break}if(!se||se.size)break}let J=O.state.doc,j=O.someProp("domParser")||Xo.fromSchema(O.state.schema),re=J.resolve(k),te=null,D=j.parse(F,{topNode:re.parent,topMatch:re.parent.contentMatchAt(re.index()),topOpen:!0,from:x,to:$,preserveWhitespace:re.parent.type.whitespace!="pre"||"full",findPositions:I,ruleFromNode:fN,context:re});if(I&&I[0].pos!=null){let Z=I[0].pos,ee=I[1]&&I[1].pos;ee==null&&(ee=Z),te={anchor:Z+k,head:ee+k}}return{doc:D,sel:te,from:k,to:M}}(n,e,t),h=n.state.doc,p=h.slice(d.from,d.to);n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(l=n.state.selection.to,u="end"):(l=n.state.selection.from,u="start"),n.input.lastKeyCode=null;let f=function(O,C,w,I,F){let x=O.findDiffStart(C,w);if(x==null)return null;let{a:$,b:k}=O.findDiffEnd(C,w+O.size,w+C.size);if(F=="end"&&(I-=$+Math.max(0,x-Math.min($,k))-x),$<x&&O.size<C.size){let M=I<=x&&I>=$?x-I:0;x-=M,x&&x<C.size&&_0(C.textBetween(x-1,x+1))&&(x+=M?1:-1),k=x+(k-$),$=x}else if(k<x){let M=I<=x&&I>=k?x-I:0;x-=M,x&&x<O.size&&_0(O.textBetween(x-1,x+1))&&(x+=M?1:-1),$=x+($-k),k=x}return{start:x,endA:$,endB:k}}(p.content,d.doc.content,d.from,l,u);if((Bi&&n.input.lastIOSEnter>Date.now()-225||un)&&i.some(O=>O.nodeType==1&&!mN.test(O.nodeName))&&(!f||f.endA>=f.endB)&&n.someProp("handleKeyDown",O=>O(n,Br(13,"Enter"))))return void(n.input.lastIOSEnter=0);if(!f){if(!(r&&c instanceof Te&&!c.empty&&c.$head.sameParent(c.$anchor))||n.composing||d.sel&&d.sel.anchor!=d.sel.head){if(d.sel){let O=A0(n,n.state.doc,d.sel);if(O&&!O.eq(n.state.selection)){let C=n.state.tr.setSelection(O);o&&C.setMeta("composition",o),n.dispatch(C)}}return}f={start:c.from,endA:c.to,endB:c.to}}if(lt&&n.cursorWrapper&&d.sel&&d.sel.anchor==n.cursorWrapper.deco.from&&d.sel.head==d.sel.anchor){let O=f.endB-f.start;d.sel={anchor:d.sel.anchor+O,head:d.sel.anchor+O}}n.input.domChangeCount++,n.state.selection.from<n.state.selection.to&&f.start==f.endB&&n.state.selection instanceof Te&&(f.start>n.state.selection.from&&f.start<=n.state.selection.from+2&&n.state.selection.from>=d.from?f.start=n.state.selection.from:f.endA<n.state.selection.to&&f.endA>=n.state.selection.to-2&&n.state.selection.to<=d.to&&(f.endB+=n.state.selection.to-f.endA,f.endA=n.state.selection.to)),bt&&sr<=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,g=d.doc.resolveNoCache(f.start-d.from),E=d.doc.resolveNoCache(f.endB-d.from),v=h.resolve(f.start),A=g.sameParent(E)&&g.parent.inlineContent&&v.end()>=f.endA;if((Bi&&n.input.lastIOSEnter>Date.now()-225&&(!A||i.some(O=>O.nodeName=="DIV"||O.nodeName=="P"))||!A&&g.pos<d.doc.content.size&&!g.sameParent(E)&&(m=ve.findFrom(d.doc.resolve(g.pos+1),1,!0))&&m.head==E.pos)&&n.someProp("handleKeyDown",O=>O(n,Br(13,"Enter"))))return void(n.input.lastIOSEnter=0);if(n.state.selection.anchor>f.start&&function(O,C,w,I,F){if(!I.parent.isTextblock||w-C<=F.pos-I.pos||Cd(I,!0,!1)<F.pos)return!1;let x=O.resolve(C);if(x.parentOffset<x.parent.content.size||!x.parent.isTextblock)return!1;let $=O.resolve(Cd(x,!0,!0));return!(!$.parent.isTextblock||$.pos>w||Cd($,!0,!1)<w)&&I.parent.content.cut(I.parentOffset).eq($.parent.content)}(h,f.start,f.endA,g,E)&&n.someProp("handleKeyDown",O=>O(n,Br(8,"Backspace"))))return void(un&&lt&&n.domObserver.suppressSelectionUpdates());lt&&un&&f.endB==f.start&&(n.input.lastAndroidDelete=Date.now()),un&&!A&&g.start()!=E.start()&&E.parentOffset==0&&g.depth==E.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==f.endA&&(f.endB-=2,E=d.doc.resolveNoCache(f.endB-d.from),setTimeout(()=>{n.someProp("handleKeyDown",function(O){return O(n,Br(13,"Enter"))})},20));let _,y,T,S=f.start,b=f.endA;if(A){if(g.pos==E.pos)bt&&sr<=11&&g.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>zn(n),20)),_=n.state.tr.delete(S,b),y=h.resolve(f.start).marksAcross(h.resolve(f.endA));else if(f.endA==f.endB&&(T=function(O,C){let w,I,F,x=O.firstChild.marks,$=C.firstChild.marks,k=x,M=$;for(let L=0;L<$.length;L++)k=$[L].removeFromSet(k);for(let L=0;L<x.length;L++)M=x[L].removeFromSet(M);if(k.length==1&&M.length==0)I=k[0],w="add",F=L=>L.mark(I.addToSet(L.marks));else{if(k.length!=0||M.length!=1)return null;I=M[0],w="remove",F=L=>L.mark(I.removeFromSet(L.marks))}let Y=[];for(let L=0;L<C.childCount;L++)Y.push(F(C.child(L)));if(q.from(Y).eq(O))return{mark:I,type:w}}(g.parent.content.cut(g.parentOffset,E.parentOffset),v.parent.content.cut(v.parentOffset,f.endA-v.start()))))_=n.state.tr,T.type=="add"?_.addMark(S,b,T.mark):_.removeMark(S,b,T.mark);else if(g.parent.child(g.index()).isText&&g.index()==E.index()-(E.textOffset?0:1)){let O=g.parent.textBetween(g.parentOffset,E.parentOffset);if(n.someProp("handleTextInput",C=>C(n,S,b,O)))return;_=n.state.tr.insertText(O,S,b)}}if(_||(_=n.state.tr.replace(S,b,d.doc.slice(f.start-d.from,f.endB-d.from))),d.sel){let O=A0(n,_.doc,d.sel);O&&!(lt&&un&&n.composing&&O.empty&&(f.start!=f.endB||n.input.lastAndroidDelete<Date.now()-100)&&(O.head==S||O.head==_.mapping.map(b)-1)||bt&&O.empty&&O.head==S)&&_.setSelection(O)}y&&_.ensureMarks(y),o&&_.setMeta("composition",o),n.dispatch(_.scrollIntoView())}function A0(n,e,t){return Math.max(t.anchor,t.head)>e.content.size?null:gd(n,e.resolve(t.anchor),e.resolve(t.head))}function Cd(n,e,t){let r=n.depth,i=e?n.end():n.pos;for(;r>0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function _0(n){if(n.length!=2)return!1;let e=n.charCodeAt(0),t=n.charCodeAt(1);return e>=56320&&e<=57343&&t>=55296&&t<=56319}class EN{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 rN,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(b0),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=T0(this),O0(this),this.nodeViews=S0(this),this.docView=DE(this.state.doc,y0(this),Nd(this),this.dom,this),this.domObserver=new pN(this,(r,i,o,s)=>gN(this,r,i,o,s)),this.domObserver.start(),function(r){for(let i in vt){let o=vt[i];r.dom.addEventListener(i,r.input.eventHandlers[i]=s=>{!iN(r,s)||yd(r,s)||!r.editable&&s.type in At||o(r,s)},nN[i]?{passive:!0}:void 0)}Et&&r.dom.addEventListener("input",()=>null),_d(r)}(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&&_d(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(b0),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(u0(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=S0(this);(function(f,m){let g=0,E=0;for(let v in f){if(f[v]!=m[v])return!0;g++}for(let v in m)E++;return g!=E})(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&_d(this),this.editable=T0(this),O0(this);let l=Nd(this),u=y0(this),c=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",d=o||!this.docView.matchesNode(e.doc,u,l);!d&&e.selection.eq(i.selection)||(s=!0);let h=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&function(p){let f,m,g=p.dom.getBoundingClientRect(),E=Math.max(0,g.top);for(let v=(g.left+g.right)/2,A=E+1;A<Math.min(innerHeight,g.bottom);A+=5){let _=p.root.elementFromPoint(v,A);if(!_||_==p.dom||!p.dom.contains(_))continue;let y=_.getBoundingClientRect();if(y.top>=E-20){f=_,m=y.top;break}}return{refDOM:f,refTop:m,stack:_E(p.dom)}}(this);if(s){this.domObserver.stop();let p=d&&(bt||lt)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&function(f,m){let g=Math.min(f.$anchor.sharedDepth(f.head),m.$anchor.sharedDepth(m.head));return f.$anchor.start(g)!=m.$anchor.start(g)}(i.selection,e.selection);if(d){let f=lt?this.trackWrites=this.domSelectionRange().focusNode:null;!o&&this.docView.update(e.doc,u,l,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=DE(e.doc,u,l,this.dom,this)),f&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(f){let m=f.docView.domFromPos(f.state.selection.anchor,0),g=f.domSelectionRange();return Pr(m.node,m.offset,g.anchorNode,g.anchorOffset)}(this))?zn(this,p):($E(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():h&&function({refDOM:p,refTop:f,stack:m}){let g=p?p.getBoundingClientRect().top:0;yE(m,g==0?0:g-f)}(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof le){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&AE(this,t.getBoundingClientRect(),e)}else AE(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 r=this.pluginViews[t];r.update&&r.update(this,e)}else{this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t<this.directPlugins.length;t++){let r=this.directPlugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let t=0;t<this.state.plugins.length;t++){let r=this.state.plugins[t];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}}updateDraggedNode(e,t){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-t.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new d0(e.slice,e.move,i<0?void 0:le.create(this.state.doc,i))}someProp(e,t){let r,i=this._props&&this._props[e];if(i!=null&&(r=t?t(i):i))return r;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(r=t?t(a):a))return r}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(bt){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(e.contentEditable=="false")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(Fi)return e.focus(Fi);let t=_E(e);e.focus(Fi==null?{get preventScroll(){return Fi={preventScroll:!0},!0}}:void 0),Fi||(Fi=!1,yE(t,0))}(this.dom),zn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let t=this.dom.parentNode;t;t=t.parentNode)if(t.nodeType==9||t.nodeType==11&&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 Vb(this,e)}coordsAtPos(e,t=1){return bE(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,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Xb(this,t||this.state,e)}pasteHTML(e,t){return ls(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return ls(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,[],Nd(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return function(t,r){yd(t,r)||!vt[r.type]||!t.editable&&r.type in At||vt[r.type](t,r)}(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Et&&this.root.nodeType===11&&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 r(u){u.preventDefault(),u.stopImmediatePropagation(),t=u.getTargetRanges()[0]}e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0);let i=t.startContainer,o=t.startOffset,s=t.endContainer,a=t.endOffset,l=e.domAtPos(e.state.selection.anchor);return Pr(l.node,l.offset,s,a)&&([i,o,s,a]=[s,a,i,o]),{anchorNode:i,anchorOffset:o,focusNode:s,focusOffset:a}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function y0(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:e[r]||r=="contenteditable"||r=="nodeName"||(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[Ht.node(0,n.state.doc.content.size,e)]}function O0(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:Ht.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function T0(n){return!n.someProp("editable",e=>e(n.state)===!1)}function S0(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function b0(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}const Ze=new class{constructor(n){this.cached=Object.create(null);let e=this.spec={};for(let r in n)e[r]=n[r];e.nodes=nt.from(n.nodes),e.marks=nt.from(n.marks||{}),this.nodes=Gg.compile(this.spec.nodes,this),this.marks=Xa.compile(this.spec.marks,this);let t=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 i=this.nodes[r],o=i.spec.content||"",s=i.spec.marks;i.contentMatch=t[o]||(t[o]=Lr.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.markSet=s=="_"?null:s?Xg(this,s.split(" ")):s!=""&&i.inlineContent?null:[]}for(let r in this.marks){let i=this.marks[r],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Xg(this,o.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(n,e=null,t,r){if(typeof n=="string")n=this.nodeType(n);else{if(!(n instanceof Gg))throw new RangeError("Invalid node type: "+n);if(n.schema!=this)throw new RangeError("Node type from different schema used ("+n.name+")")}return n.createChecked(e,t,r)}text(n,e){let t=this.nodes.text;return new Ga(t,t.defaultAttrs,n,Oe.setFrom(e))}mark(n,e){return typeof n=="string"&&(n=this.marks[n]),n.create(e)}nodeFromJSON(n){return kr.fromJSON(this,n)}markFromJSON(n){return Oe.fromJSON(this,n)}nodeType(n){let e=this.nodes[n];if(!e)throw new RangeError("Unknown node type: "+n);return e}}({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:n=>["span",{"data-mention-id":n.attrs.id,class:"t-mention"},`@${n.attrs.name}`],parseDOM:[{tag:"span[data-mention-id]",getAttrs:n=>({id:n.dataset["mention-id"]})}]},customemoji:{group:"inline",inline:!0,attrs:{name:{},url:{}},content:"text*",selectable:!1,toDOM:n=>["img",{src:n.attrs.url,alt:n.attrs.name,"data-custom-emoji":n.attrs.name}],parseDOM:[{tag:"img[data-custom-emoji]",getAttrs:n=>{const e=n;return{name:e.dataset.customEmoji,url:e.src}}}]}},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:n=>["span",{"data-emoji":n.attrs.emoji},n.attrs.emoji],parseDOM:[{tag:"span[data-emoji]",getAttrs:n=>({emoji:n.dataset.emoji})}]}}}),Id=new Ja("placeholder"),N0=new qa({key:Id,props:{decorations(n){if(C0(n.doc))return;const e=n.doc.firstChild,t=Ht.node(0,e.nodeSize,{class:"empty-node","data-placeholder":Id.getState(n)});return Ge.create(n.doc,[t])}},state:{init:()=>"",apply:(n,e)=>n.getMeta(Id)??e}});function C0(n){return n.childCount!==1||n.firstChild.childCount!==0}for(var pr={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"},ol={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"},I0=typeof navigator<"u"&&/Chrome\/(\d+)/.exec(navigator.userAgent),vN=typeof navigator<"u"&&/Apple Computer/.test(navigator.vendor),AN=typeof navigator<"u"&&/Gecko\/\d+/.test(navigator.userAgent),w0=typeof navigator<"u"&&/Mac/.test(navigator.platform),_N=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),yN=I0&&(w0||+I0[1]<57)||AN&&w0,rt=0;rt<10;rt++)pr[48+rt]=pr[96+rt]=String(rt);for(rt=1;rt<=24;rt++)pr[rt+111]="F"+rt;for(rt=65;rt<=90;rt++)pr[rt]=String.fromCharCode(rt+32),ol[rt]=String.fromCharCode(rt);for(var wd in pr)ol.hasOwnProperty(wd)||(ol[wd]=pr[wd]);const ON=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function TN(n){let e,t,r,i,o=n.split(/-(?!$)/),s=o[o.length-1];s=="Space"&&(s=" ");for(let a=0;a<o.length-1;a++){let l=o[a];if(/^(cmd|meta|m)$/i.test(l))i=!0;else if(/^a(lt)?$/i.test(l))e=!0;else if(/^(c|ctrl|control)$/i.test(l))t=!0;else if(/^s(hift)?$/i.test(l))r=!0;else{if(!/^mod$/i.test(l))throw new Error("Unrecognized modifier name: "+l);ON?i=!0:t=!0}}return e&&(s="Alt-"+s),t&&(s="Ctrl-"+s),i&&(s="Meta-"+s),r&&(s="Shift-"+s),s}function Rd(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function R0(n){return new qa({props:{handleKeyDown:SN(n)}})}function SN(n){let e=function(t){let r=Object.create(null);for(let i in t)r[TN(i)]=t[i];return r}(n);return function(t,r){let i,o=function(a){var l=!(yN&&(a.ctrlKey||a.altKey||a.metaKey)||(vN||_N)&&a.shiftKey&&a.key&&a.key.length==1)&&a.key||(a.shiftKey?ol:pr)[a.keyCode]||a.key||"Unidentified";return l=="Esc"&&(l="Escape"),l=="Del"&&(l="Delete"),l=="Left"&&(l="ArrowLeft"),l=="Up"&&(l="ArrowUp"),l=="Right"&&(l="ArrowRight"),l=="Down"&&(l="ArrowDown"),l}(r),s=e[Rd(o,r)];if(s&&s(t.state,t.dispatch,t))return!0;if(o.length==1&&o!=" "){if(r.shiftKey){let a=e[Rd(o,r,!1)];if(a&&a(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||o.charCodeAt(0)>127)&&(i=pr[r.keyCode])&&i!=o){let a=e[Rd(i,r)];if(a&&a(t.state,t.dispatch,t))return!0}}return!1}}var sl=200,it=function(){};it.prototype.append=function(n){return n.length?(n=it.from(n),!this.length&&n||n.length<sl&&this.leafAppend(n)||this.length<sl&&n.leafPrepend(this)||this.appendInner(n)):this},it.prototype.prepend=function(n){return n.length?it.from(n).append(this):this},it.prototype.appendInner=function(n){return new bN(this,n)},it.prototype.slice=function(n,e){return n===void 0&&(n=0),e===void 0&&(e=this.length),n>=e?it.empty:this.sliceInner(Math.max(0,n),Math.min(this.length,e))},it.prototype.get=function(n){if(!(n<0||n>=this.length))return this.getInner(n)},it.prototype.forEach=function(n,e,t){e===void 0&&(e=0),t===void 0&&(t=this.length),e<=t?this.forEachInner(n,e,t,0):this.forEachInvertedInner(n,e,t,0)},it.prototype.map=function(n,e,t){e===void 0&&(e=0),t===void 0&&(t=this.length);var r=[];return this.forEach(function(i,o){return r.push(n(i,o))},e,t),r},it.from=function(n){return n instanceof it?n:n&&n.length?new D0(n):it.empty};var D0=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(r,i){return r==0&&i==this.length?this:new e(this.values.slice(r,i))},e.prototype.getInner=function(r){return this.values[r]},e.prototype.forEachInner=function(r,i,o,s){for(var a=i;a<o;a++)if(r(this.values[a],s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){for(var a=i-1;a>=o;a--)if(r(this.values[a],s+a)===!1)return!1},e.prototype.leafAppend=function(r){if(this.length+r.length<=sl)return new e(this.values.concat(r.flatten()))},e.prototype.leafPrepend=function(r){if(this.length+r.length<=sl)return new e(r.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(it);it.empty=new D0([]);var bN=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return t<this.left.length?this.left.get(t):this.right.get(t-this.left.length)},e.prototype.forEachInner=function(t,r,i,o){var s=this.left.length;return!(r<s&&this.left.forEachInner(t,r,Math.min(i,s),o)===!1)&&!(i>s&&this.right.forEachInner(t,Math.max(r-s,0),Math.min(this.length,i)-s,o+s)===!1)&&void 0},e.prototype.forEachInvertedInner=function(t,r,i,o){var s=this.left.length;return!(r>s&&this.right.forEachInvertedInner(t,r-s,Math.max(i,s)-s,o+s)===!1)&&!(i<s&&this.left.forEachInvertedInner(t,Math.min(r,s),i,o)===!1)&&void 0},e.prototype.sliceInner=function(t,r){if(t==0&&r==this.length)return this;var i=this.left.length;return r<=i?this.left.slice(t,r):t>=i?this.right.slice(t-i,r-i):this.left.slice(t,i).append(this.right.slice(0,r-i))},e.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new e(r,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(it),k0=it;const L0=Math.pow(2,16);function NN(n,e){return n+e*L0}function x0(n){return 65535&n}let Dd=class{constructor(n,e,t){this.pos=n,this.delInfo=e,this.recover=t}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}},jr=class Oo{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Oo.empty)return Oo.empty}recover(e){let t=0,r=x0(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*r]+t+function(i){return(i-(65535&i))/L0}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=l+i+((u?e==l?-1:e==d?1:t:t)<0?0:c);if(r)return h;let p=e==(t<0?l:d)?null:NN(a/3,e-l),f=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(f|=8),new Dd(h,f,p)}i+=c-u}return r?e+i:new Dd(e+i,0,null)}touches(e,t){let r=0,i=x0(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o];if(e<=l+u&&a==3*i)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new Oo(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Oo.empty:new Oo(e<0?[0,-e,0]:[0,0,e])}};jr.empty=new jr([]);class cs{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new cs(this.maps,this.mirror,e,t)}copy(){return new cs(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i: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,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new cs;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o].mapResult(e,t);if(s.recover!=null){let a=this.getMirror(o);if(a!=null&&a>o&&a<this.to){o=a,e=this.maps[a].recover(s.recover);continue}}i|=s.delInfo,e=s.pos}return r?e:new Dd(e,i,null)}}const kd=Object.create(null);let ct=class{getMap(){return jr.empty}merge(n){return null}static fromJSON(n,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let t=kd[e.stepType];if(!t)throw new RangeError(`No step type ${e.stepType} defined`);return t.fromJSON(n,e)}static jsonID(n,e){if(n in kd)throw new RangeError("Duplicate use of step JSON ID "+n);return kd[n]=e,e.prototype.jsonID=n,e}},_t=class ra{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new ra(e,null)}static fail(e){return new ra(null,e)}static fromReplace(e,t,r,i){try{return ra.ok(e.replace(t,r,i))}catch(o){if(o instanceof xi)return ra.fail(o.message);throw o}}};function Ld(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Ld(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return q.fromArray(r)}let M0=class ia extends ct{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new G(Ld(t.content,(s,a)=>s.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return _t.fromReplace(e,this.from,this.to,o)}invert(){return new P0(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new ia(t.pos,r.pos,this.mark)}merge(e){return e instanceof ia&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ia(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new ia(t.from,t.to,e.markFromJSON(t.mark))}};ct.jsonID("addMark",M0);let P0=class oa extends ct{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new G(Ld(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return _t.fromReplace(e,this.from,this.to,r)}invert(){return new M0(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new oa(t.pos,r.pos,this.mark)}merge(e){return e instanceof oa&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new oa(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new oa(t.from,t.to,e.markFromJSON(t.mark))}};ct.jsonID("removeMark",P0);let B0=class sa extends ct{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return _t.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return _t.fromReplace(e,this.pos,this.pos+1,new G(q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new sa(this.pos,t.marks[i]);return new sa(this.pos,this.mark)}}return new F0(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new sa(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new sa(t.pos,e.markFromJSON(t.mark))}};ct.jsonID("addNodeMark",B0);let F0=class Jp extends ct{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return _t.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return _t.fromReplace(e,this.pos,this.pos+1,new G(q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new B0(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Jp(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Jp(t.pos,e.markFromJSON(t.mark))}};ct.jsonID("removeNodeMark",F0),ct.jsonID("replace",class hi extends ct{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&xd(e,this.from,this.to)?_t.fail("Structure replace would overwrite content"):_t.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new jr([this.from,this.to-this.from,this.slice.size])}invert(e){return new hi(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new hi(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof hi)||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?G.empty:new G(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new hi(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?G.empty:new G(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new hi(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new hi(t.from,t.to,G.fromJSON(e,t.slice),!!t.structure)}});function xd(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}ct.jsonID("replaceAround",class Nu extends ct{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(xd(e,this.from,this.gapFrom)||xd(e,this.gapTo,this.to)))return _t.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return _t.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?_t.fromReplace(e,this.from,this.to,r):_t.fail("Content does not fit in gap")}getMap(){return new jr([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 Nu(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),r=e.mapResult(this.to,-1),i=e.map(this.gapFrom,-1),o=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new Nu(t.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(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Nu(t.from,t.to,t.gapFrom,t.gapTo,G.fromJSON(e,t.slice),t.insert,!!t.structure)}}),ct.jsonID("attr",class Cu extends ct{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return _t.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return _t.fromReplace(e,this.pos,this.pos+1,new G(q.from(i),0,t.isLeaf?0:1))}getMap(){return jr.empty}invert(e){return new Cu(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 Cu(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Cu(t.pos,t.attr,t.value)}}),ct.jsonID("docAttr",class Zp extends ct{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return _t.ok(r)}getMap(){return jr.empty}invert(e){return new Zp(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(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Zp(t.attr,t.value)}});let al=class extends Error{};al=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(al.prototype=Object.create(Error.prototype)).constructor=al,al.prototype.name="TransformError";class cn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r,i,o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}t&&(r=this.remapping(o,this.items.length),i=r.maps.length);let s,a,l=e.tr,u=[],c=[];return this.items.forEach((d,h)=>{if(!d.step)return r||(r=this.remapping(o,h+1),i=r.maps.length),i--,void c.push(d);if(r){c.push(new fr(d.map));let p,f=d.step.map(r.slice(i));f&&l.maybeStep(f).doc&&(p=l.mapping.maps[l.mapping.maps.length-1],u.push(new fr(p,void 0,void 0,u.length+c.length))),i--,p&&r.appendMap(p,i)}else l.maybeStep(d.step);return d.selection?(s=r?d.selection.map(r.slice(i)):d.selection,a=new cn(this.items.slice(0,o).append(c.reverse().concat(u)),this.eventCount-1),!1):void 0},this.items.length,0),{remaining:a,transform:l,selection:s}}addTransform(e,t,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let c=0;c<e.steps.length;c++){let d,h=e.steps[c].invert(e.docs[c]),p=new fr(e.mapping.maps[c],h,t);(d=l&&l.merge(p))&&(p=d,c?o.pop():a=a.slice(0,a.length-1)),o.push(p),t&&(s++,t=void 0),i||(l=p)}let u=s-r.depth;return u>CN&&(a=function(c,d){let h;return c.forEach((p,f)=>{if(p.selection&&d--==0)return h=f,!1}),c.slice(h)}(a,u),s-=u),new cn(a.append(o),s)}remapping(e,t){let r=new cs;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new cn(this.items.append(e.map(t=>new fr(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=t;this.items.forEach(h=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let f=o.maps[p];if(h.step){let m=e.steps[p].invert(e.docs[p]),g=h.selection&&h.selection.map(o.slice(l+1,p));g&&a++,r.push(new fr(f,m,g))}else r.push(new fr(f))},i);let u=[];for(let h=t;h<s;h++)u.push(new fr(o.maps[h]));let c=this.items.slice(0,i).append(u).append(r),d=new cn(c,a);return d.emptyItemCount()>500&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(t.slice(r)),u=l&&l.getMap();if(r--,u&&t.appendMap(u,r),l){let c=s.selection&&s.selection.map(t.slice(r));c&&o++;let d,h=new fr(u.invert(),l,c),p=i.length-1;(d=i.length&&i[p].merge(h))?i[p]=d:i.push(h)}}else s.map&&r--},this.items.length,0),new cn(k0.from(i.reverse()),o)}}cn.empty=new cn(k0.empty,0);let fr=class bT{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new bT(t.getMap().invert(),t,this.selection)}}};class mr{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const CN=20;function U0(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function Md(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),o=e.map(n[r+1],-1);i<=o&&t.push(i,o)}return t}let Pd=!1,H0=null;function ll(n){let e=n.plugins;if(H0!=e){Pd=!1,H0=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Pd=!0;break}}return Pd}const Yr=new Ja("history"),IN=new Ja("closeHistory");function wN(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new qa({key:Yr,state:{init:()=>new mr(cn.empty,cn.empty,null,0,-1),apply:(e,t,r)=>function(i,o,s,a){let l,u=s.getMeta(Yr);if(u)return u.historyState;s.getMeta(IN)&&(i=new mr(i.done,i.undone,null,0,-1));let c=s.getMeta("appendedTransaction");if(s.steps.length==0)return i;if(c&&c.getMeta(Yr))return c.getMeta(Yr).redo?new mr(i.done.addTransform(s,void 0,a,ll(o)),i.undone,U0(s.mapping.maps),i.prevTime,i.prevComposition):new mr(i.done,i.undone.addTransform(s,void 0,a,ll(o)),null,i.prevTime,i.prevComposition);if(s.getMeta("addToHistory")===!1||c&&c.getMeta("addToHistory")===!1)return(l=s.getMeta("rebased"))?new mr(i.done.rebased(s,l),i.undone.rebased(s,l),Md(i.prevRanges,s.mapping),i.prevTime,i.prevComposition):new mr(i.done.addMaps(s.mapping.maps),i.undone.addMaps(s.mapping.maps),Md(i.prevRanges,s.mapping),i.prevTime,i.prevComposition);{let d=s.getMeta("composition"),h=i.prevTime==0||!c&&i.prevComposition!=d&&(i.prevTime<(s.time||0)-a.newGroupDelay||!function(f,m){if(!m)return!1;if(!f.docChanged)return!0;let g=!1;return f.mapping.maps[0].forEach((E,v)=>{for(let A=0;A<m.length;A+=2)E<=m[A+1]&&v>=m[A]&&(g=!0)}),g}(s,i.prevRanges)),p=c?Md(i.prevRanges,s.mapping):U0(s.mapping.maps);return new mr(i.done.addTransform(s,h?o.selection.getBookmark():void 0,a,ll(o)),cn.empty,p,s.time,d??i.prevComposition)}}(t,r,e,n)},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?j0:r=="historyRedo"?Y0:null;return!!i&&(t.preventDefault(),i(e.state,e.dispatch))}}}})}function $0(n,e){return(t,r)=>{let i=Yr.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=function(s,a,l){let u=ll(a),c=Yr.get(a).spec.config,d=(l?s.undone:s.done).popEvent(a,u);if(!d)return null;let h=d.selection.resolve(d.transform.doc),p=(l?s.done:s.undone).addTransform(d.transform,a.selection.getBookmark(),c,u),f=new mr(l?p:d.remaining,l?d.remaining:p,null,0,-1);return d.transform.setSelection(h).setMeta(Yr,{redo:l,historyState:f})}(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}const j0=$0(!1,!0),Y0=$0(!0,!0),z0=Math.pow(2,16);function RN(n,e){return n+e*z0}function V0(n){return 65535&n}class W0{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}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 $t{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&$t.empty)return $t.empty}recover(e){let t=0,r=V0(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[3*i+2]-this.ranges[3*i+1];return this.ranges[3*r]+t+function(i){return(i-(65535&i))/z0}(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let u=this.ranges[a+o],c=this.ranges[a+s],d=l+u;if(e<=d){let h=l+i+((u?e==l?-1:e==d?1:t:t)<0?0:c);if(r)return h;let p=e==(t<0?l:d)?null:RN(a/3,e-l),f=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(f|=8),new W0(h,f,p)}i+=c-u}return r?e+i:new W0(e+i,0,null)}touches(e,t){let r=0,i=V0(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let u=this.ranges[a+o];if(e<=l+u&&a==3*i)return!0;r+=this.ranges[a+s]-u}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),u=this.ranges[i+t],c=this.ranges[i+r];e(a,a+u,l,l+c),o+=c-u}}invert(){return new $t(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?$t.empty:new $t(e<0?[0,-e,0]:[0,0,e])}}$t.empty=new $t([]);const Bd=Object.create(null);class dt{getMap(){return $t.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Bd[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Bd)throw new RangeError("Duplicate use of step JSON ID "+e);return Bd[e]=t,t.prototype.jsonID=e,t}}class Xe{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new Xe(e,null)}static fail(e){return new Xe(null,e)}static fromReplace(e,t,r,i){try{return Xe.ok(e.replace(t,r,i))}catch(o){if(o instanceof xi)return Xe.fail(o.message);throw o}}}function Fd(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let o=n.child(i);o.content.size&&(o=o.copy(Fd(o.content,e,o))),o.isInline&&(o=e(o,t,i)),r.push(o)}return q.fromArray(r)}class zr extends dt{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new G(Fd(t.content,(s,a)=>s.isAtom&&a.type.allowsMarkType(this.mark.type)?s.mark(this.mark.addToSet(s.marks)):s,i),t.openStart,t.openEnd);return Xe.fromReplace(e,this.from,this.to,o)}invert(){return new Vr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new zr(t.pos,r.pos,this.mark)}merge(e){return e instanceof zr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new zr(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new zr(t.from,t.to,e.markFromJSON(t.mark))}}dt.jsonID("addMark",zr);class Vr extends dt{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new G(Fd(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Xe.fromReplace(e,this.from,this.to,r)}invert(){return new zr(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Vr(t.pos,r.pos,this.mark)}merge(e){return e instanceof Vr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vr(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Vr(t.from,t.to,e.markFromJSON(t.mark))}}dt.jsonID("removeMark",Vr);class Wr extends dt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Xe.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Xe.fromReplace(e,this.pos,this.pos+1,new G(q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Wr(this.pos,t.marks[i]);return new Wr(this.pos,this.mark)}}return new ds(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Wr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Wr(t.pos,e.markFromJSON(t.mark))}}dt.jsonID("addNodeMark",Wr);class ds extends dt{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Xe.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Xe.fromReplace(e,this.pos,this.pos+1,new G(q.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new Wr(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new ds(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new ds(t.pos,e.markFromJSON(t.mark))}}dt.jsonID("removeNodeMark",ds);class dn extends dt{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Ud(e,this.from,this.to)?Xe.fail("Structure replace would overwrite content"):Xe.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new $t([this.from,this.to-this.from,this.slice.size])}invert(e){return new dn(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new dn(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof dn)||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?G.empty:new G(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new dn(e.from,this.to,t,this.structure)}}{let t=this.slice.size+e.slice.size==0?G.empty:new G(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new dn(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new dn(t.from,t.to,G.fromJSON(e,t.slice),!!t.structure)}}dt.jsonID("replace",dn);class gr extends dt{constructor(e,t,r,i,o,s,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(Ud(e,this.from,this.gapFrom)||Ud(e,this.gapTo,this.to)))return Xe.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Xe.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?Xe.fromReplace(e,this.from,this.to,r):Xe.fail("Content does not fit in gap")}getMap(){return new $t([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 gr(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),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||o>r.pos?null:new gr(t.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(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new gr(t.from,t.to,t.gapFrom,t.gapTo,G.fromJSON(e,t.slice),t.insert,!!t.structure)}}function Ud(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function DN(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Hd(n){let e=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let t=n.depth;;--t){let r=n.$from.node(t),i=n.$from.index(t),o=n.$to.indexAfter(t);if(t<n.depth&&r.canReplace(i,o,e))return t;if(t==0||r.type.spec.isolating||!DN(r,i,o))break}return null}function ul(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,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 u=i.depth-1,c=t-2;u>o;u--,c--){let d=i.node(u),h=i.index(u);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(h,d.childCount),f=r&&r[c+1];f&&(p=p.replaceChild(0,f.type.create(f.attrs)));let m=r&&r[c]||d;if(!d.canReplace(h+1,d.childCount)||!m.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function G0(n,e){let t=n.resolve(e),r=t.index();return function(i,o){return!(!i||!o||i.isLeaf||!function(s,a){a.content.size||s.type.compatibleContent(a.type);let l=s.contentMatchAt(s.childCount),{linebreakReplacement:u}=s.type.schema;for(let c=0;c<a.childCount;c++){let d=a.child(c),h=d.type==u?s.type.schema.nodes.text:d.type;if(l=l.matchType(h),!l||!s.type.allowsMarks(d.marks))return!1}return l.validEnd}(i,o))}(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function X0(n,e,t=e,r=G.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return function(s,a,l){return!l.openStart&&!l.openEnd&&s.start()==a.start()&&s.parent.canReplace(s.index(),a.index(),l.content)}(i,o,r)?new dn(e,t,r):new kN(i,o,r).fit()}dt.jsonID("replaceAround",gr);class kN{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=q.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=q.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new G(o,s,a);return e>-1?new gr(r.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||r.pos!=this.$to.pos?new dn(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=t.firstChild;if(t.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=$d(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let l,{type:u,match:c}=this.frontier[a],d=null;if(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(q.from(s),!1)):o&&u.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:d};if(t==2&&s&&(l=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:l};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=$d(e,t);return!(!i.childCount||i.firstChild.isLeaf)&&(this.unplaced=new G(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=$d(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new G(hs(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new G(hs(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let m=0;m<o.length;m++)this.openFrontierNode(o[m]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,u=0,c=[],{match:d,type:h}=this.frontier[t];if(i){for(let m=0;m<i.childCount;m++)c.push(i.child(m));d=d.matchFragment(i)}let p=a.size+e-(s.content.size-s.openEnd);for(;u<a.childCount;){let m=a.child(u),g=d.matchType(m.type);if(!g)break;u++,(u>1||l==0||m.content.size)&&(d=g,c.push(K0(m.mark(h.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?p:-1)))}let f=u==a.childCount;f||(p=-1),this.placed=ps(this.placed,t,q.from(c)),this.frontier[t].match=d,f&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m<p;m++){let E=g.lastChild;this.frontier.push({type:E.type,match:E.contentMatchAt(E.childCount)}),g=E.content}this.unplaced=f?e==0?G.empty:new G(hs(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new G(hs(s.content,e,u),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e,t=this.frontier[this.depth];if(!t.type.isTextblock||!jd(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:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),s=jd(e,t,i,r,o);if(s){for(let a=t-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],c=jd(e,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:t,fit:s,move:o?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=ps(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=ps(this.placed,this.depth,q.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(q.empty,!0);e.childCount&&(this.placed=ps(this.placed,this.frontier.length,e))}}function hs(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(hs(n.firstChild.content,e-1,t)))}function ps(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(ps(n.lastChild.content,e-1,t)))}function $d(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function K0(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,K0(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(q.empty,!0)))),n.copy(r)}function jd(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!function(l,u,c){for(let d=c;d<u.childCount;d++)if(!l.allowsMarks(u.child(d).marks))return!0;return!1}(t,o.content,s)?a:null}class fs extends dt{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Xe.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Xe.fromReplace(e,this.pos,this.pos+1,new G(q.from(i),0,t.isLeaf?0:1))}getMap(){return $t.empty}invert(e){return new fs(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 fs(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fs(t.pos,t.attr,t.value)}}dt.jsonID("attr",fs);class cl extends dt{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Xe.ok(r)}getMap(){return $t.empty}invert(e){return new cl(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(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new cl(t.attr,t.value)}}dt.jsonID("docAttr",cl);let dl=class extends Error{};dl=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},(dl.prototype=Object.create(Error.prototype)).constructor=dl,dl.prototype.name="TransformError";const q0=(n,e)=>!n.selection.empty&&(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function ji(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}function J0(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function Z0(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}function Yd(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const LN=(n,e)=>{let{$from:t,$to:r}=n.selection;if(n.selection instanceof le&&n.selection.node.isBlock)return!(!t.parentOffset||!ul(n.doc,t.pos)||(e&&e(n.tr.split(t.pos).scrollIntoView()),0));if(!t.depth)return!1;let i,o,s=[],a=!1,l=!1;for(let h=t.depth;;h--){if(t.node(h).isBlock){a=t.end(h)==t.pos+(t.depth-h),l=t.start(h)==t.pos-(t.depth-h),o=Yd(t.node(h-1).contentMatchAt(t.indexAfter(h-1))),s.unshift(a&&o?{type:o}:null),i=h;break}if(h==1)return!1;s.unshift(null)}let u=n.tr;(n.selection instanceof Te||n.selection instanceof Ut)&&u.deleteSelection();let c=u.mapping.map(t.pos),d=ul(u.doc,c,s.length,s);if(d||(s[0]=o?{type:o}:null,d=ul(u.doc,c,s.length,s)),u.split(c,s.length,s),!a&&l&&t.node(i).type!=o){let h=u.mapping.map(t.before(i)),p=u.doc.resolve(h);o&&t.node(i-1).canReplaceWith(p.index(),p.index()+1,o)&&u.setNodeMarkup(u.mapping.map(t.before(i)),o)}return e&&e(u.scrollIntoView()),!0};function Q0(n,e,t,r){let i,o,s=e.nodeBefore,a=e.nodeAfter,l=s.type.spec.isolating||a.type.spec.isolating;if(!l&&function(p,f,m){let g=f.nodeBefore,E=f.nodeAfter,v=f.index();return!(!(g&&E&&g.type.compatibleContent(E.type))||(!g.content.size&&f.parent.canReplace(v-1,v)?(m&&m(p.tr.delete(f.pos-g.nodeSize,f.pos).scrollIntoView()),0):!f.parent.canReplace(v,v+1)||!E.isTextblock&&!G0(p.doc,f.pos)||(m&&m(p.tr.join(f.pos).scrollIntoView()),0)))}(n,e,t))return!0;let u=!l&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(i=(o=s.contentMatchAt(s.childCount)).findWrapping(a.type))&&o.matchType(i[0]||a.type).validEnd){if(t){let p=e.pos+a.nodeSize,f=q.empty;for(let E=i.length-1;E>=0;E--)f=q.from(i[E].create(null,f));f=q.from(s.copy(f));let m=n.tr.step(new gr(e.pos-1,p,e.pos,p,new G(f,1,0),i.length,!0)),g=m.doc.resolve(p+2*i.length);g.nodeAfter&&g.nodeAfter.type==s.type&&G0(m.doc,g.pos)&&m.join(g.pos),t(m.scrollIntoView())}return!0}let c=a.type.spec.isolating||r>0&&l?null:ve.findFrom(e,1),d=c&&c.$from.blockRange(c.$to),h=d&&Hd(d);if(h!=null&&h>=e.depth)return t&&t(n.tr.lift(d,h).scrollIntoView()),!0;if(u&&ji(a,"start",!0)&&ji(s,"end")){let p=s,f=[];for(;f.push(p),!p.isTextblock;)p=p.lastChild;let m=a,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(p.canReplace(p.childCount,p.childCount,m.content)){if(t){let E=q.empty;for(let v=f.length-1;v>=0;v--)E=q.from(f[v].copy(E));t(n.tr.step(new gr(e.pos-f.length,e.pos+a.nodeSize,e.pos+g,e.pos+a.nodeSize-g,new G(E,f.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function ev(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return!!i.node(o).isTextblock&&(t&&t(e.tr.setSelection(Te.create(e.doc,n<0?i.start(o):i.end(o)))),!0)}}const xN=ev(-1),MN=ev(1);function zd(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}let Vd=zd(q0,(n,e,t)=>{let r=function(s,a){let{$cursor:l}=s.selection;return!l||(a?!a.endOfTextblock("backward",s):l.parentOffset>0)?null:l}(n,t);if(!r)return!1;let i=J0(r);if(!i){let s=r.blockRange(),a=s&&Hd(s);return a!=null&&(e&&e(n.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(Q0(n,i,e,-1))return!0;if(r.parent.content.size==0&&(ji(o,"end")||le.isSelectable(o)))for(let s=r.depth;;s--){let a=X0(n.doc,r.before(s),r.after(s),G.empty);if(a&&a.slice.size<a.to-a.from){if(e){let l=n.tr.step(a);l.setSelection(ji(o,"end")?ve.findFrom(l.doc.resolve(l.mapping.map(i.pos,-1)),-1):le.create(l.doc,i.pos-o.nodeSize)),e(l.scrollIntoView())}return!0}if(s==1||r.node(s-1).childCount>1)break}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0)},(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=J0(r)}let s=o&&o.nodeBefore;return!(!s||!le.isSelectable(s))&&(e&&e(n.tr.setSelection(le.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)}),tv=zd(q0,(n,e,t)=>{let r=function(s,a){let{$cursor:l}=s.selection;return!l||(a?!a.endOfTextblock("forward",s):l.parentOffset<l.parent.content.size)?null:l}(n,t);if(!r)return!1;let i=Z0(r);if(!i)return!1;let o=i.nodeAfter;if(Q0(n,i,e,1))return!0;if(r.parent.content.size==0&&(ji(o,"start")||le.isSelectable(o))){let s=X0(n.doc,r.before(),r.after(),G.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=n.tr.step(s);a.setSelection(ji(o,"start")?ve.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):le.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return!(!o.isAtom||i.depth!=r.depth-1)&&(e&&e(n.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0)},(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;o=Z0(r)}let s=o&&o.nodeAfter;return!(!s||!le.isSelectable(s))&&(e&&e(n.tr.setSelection(le.create(n.doc,o.pos)).scrollIntoView()),!0)});const Vn={Enter:zd((n,e)=>{let{$head:t,$anchor:r}=n.selection;return!(!t.parent.type.spec.code||!t.sameParent(r))&&(e&&e(n.tr.insertText(`
83
+ `).scrollIntoView()),!0)},(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Ut||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=Yd(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=n.tr.insert(s,o.createAndFill());a.setSelection(Te.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(ul(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Hd(r);return i!=null&&(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},LN),"Mod-Enter":(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),s=Yd(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=t.after(),l=n.tr.replaceWith(a,a,s.createAndFill());l.setSelection(ve.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},Backspace:Vd,"Mod-Backspace":Vd,"Shift-Backspace":Vd,Delete:tv,"Mod-Delete":tv,"Mod-a":(n,e)=>(e&&e(n.tr.setSelection(new Ut(n.doc))),!0)},nv={"Ctrl-h":Vn.Backspace,"Alt-Backspace":Vn["Mod-Backspace"],"Ctrl-d":Vn.Delete,"Ctrl-Alt-Backspace":Vn["Mod-Delete"],"Alt-Delete":Vn["Mod-Delete"],"Alt-d":Vn["Mod-Delete"],"Ctrl-a":xN,"Ctrl-e":MN};for(let n in Vn)nv[n]=Vn[n];const hl=(typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!(typeof os>"u"||!os.platform)&&os.platform()=="darwin")?nv:Vn,ms=(n,e,t=void 0)=>function(r,i){return r.reduce((o,s,a)=>o.concat(i(s,a)),[])}(n,r=>{if(typeof r=="string")return e(r,t);switch(r.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return[{type:r.type,children:ms(r.children,e,r.type)}];case"link":return[{type:r.type,url:r.url,children:ms(r.children,e,r.type)}];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return[{type:r.type,action:r.action,params:r.params,children:ms(r.children,e,r.type)}];case"mention":case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return[r]}});function Wn(n,e){return t=>{const r=t;let i=0;const o=[];for(const s of Qu(t,n)){s.index-i>0&&o.push(r.substring(i,s.index));const a=e(s);Array.isArray(a)?o.push(...a):o.push(a),i=s.index+s[0].length}return i<t.length&&o.push(t.substring(i)),o}}function rv(n){return n.replace(/<!!mention:.*?\|([^>]*)>/gim,"@$1").replace(/<!!customemoji:(.*?)>/gim,"$1")}const iv="’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var Wd=(n=>(n[n.italic=1]="italic",n[n.strikethrough=2]="strikethrough",n[n.bold=4]="bold",n))(Wd||{});const PN=[0,1,2,3,4,5,6].map(n=>{const e=[];return 1&n||e.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/),2&n||e.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/),4&n||e.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/),new RegExp(e.map(t=>t.source).join("|"),"g")}),BN={_:1,"*":4,"~":2};function FN(n){return ov(n,0)}function ov(n,e=0){const t=PN[e],r=t?function(i){const o=UN.getOrCompute(i,()=>new RegExp(`(?:^|[\\s${iv}])(?:${i.source})(?=[\\s${iv}]|$)`,"g")),s=Wn(o,a=>{const l=a[0][1],u=a[1]||a[2]||a[3]||a[4]||a[5]||a[6];return[" ",{type:Wd[BN[l]],children:[u]}]});return a=>{const[l,...u]=s(" "+a);return l.length>1&&u.unshift(l.substring(1)),u}}(t):()=>[n];return ms(r(n),(i,o)=>o==="bold"||o==="italic"||o==="strikethrough"?ov(i,e|Wd[o]):[i])}const UN=function(){const n=function(){try{return new WeakMap}catch{const t={has:()=>!1,get:()=>{},set:()=>t};return t}}();return{getOrCompute(e,t){if(n.has(e))return n.get(e);const r=t();return n.set(e,r),r}}}();function sv(n,e){if(Array.prototype.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function Gr(n,e){for(var t=n.length-1;t>=0;t--)e(n[t])===!0&&n.splice(t,1)}function av(n){throw new Error("Unhandled case for value: '"+n+"'")}var Gd=function(){function n(e){e===void 0&&(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 n.prototype.setTagName=function(e){return this.tagName=e,this},n.prototype.getTagName=function(){return this.tagName||""},n.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},n.prototype.getAttr=function(e){return this.getAttrs()[e]},n.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},n.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},n.prototype.setClass=function(e){return this.setAttr("class",e)},n.prototype.addClass=function(e){for(var t,r=this.getClass(),i=this.whitespaceRegex,o=r?r.split(i):[],s=e.split(i);t=s.shift();)sv(o,t)===-1&&o.push(t);return this.getAttrs().class=o.join(" "),this},n.prototype.removeClass=function(e){for(var t,r=this.getClass(),i=this.whitespaceRegex,o=r?r.split(i):[],s=e.split(i);o.length&&(t=s.shift());){var a=sv(o,t);a!==-1&&o.splice(a,1)}return this.getAttrs().class=o.join(" "),this},n.prototype.getClass=function(){return this.getAttrs().class||""},n.prototype.hasClass=function(e){return(" "+this.getClass()+" ").indexOf(" "+e+" ")!==-1},n.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},n.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},n.prototype.getInnerHTML=function(){return this.innerHTML||""},n.prototype.getInnerHtml=function(){return this.getInnerHTML()},n.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},n.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")},n}(),lv=function(){function n(e){e===void 0&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return n.prototype.build=function(e){return new Gd({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},n.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},r=this.createCssClass(e);return r&&(t.class=r),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},n.prototype.createCssClass=function(e){var t=this.className;if(t){for(var r=[t],i=e.getCssClassSuffixes(),o=0,s=i.length;o<s;o++)r.push(t+"-"+i[o]);return r.join(" ")}return""},n.prototype.processAnchorText=function(e){return e=this.doTruncate(e)},n.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var r=t.length,i=t.location;return i==="smart"?function(o,s,a){var l,u;a==null?(a="&hellip;",u=3,l=8):(u=a.length,l=a.length);var c=function(_){var y="";return _.scheme&&_.host&&(y+=_.scheme+"://"),_.host&&(y+=_.host),_.path&&(y+="/"+_.path),_.query&&(y+="?"+_.query),_.fragment&&(y+="#"+_.fragment),y},d=function(_,y){var T=y/2,S=Math.ceil(T),b=-1*Math.floor(T),O="";return b<0&&(O=_.substr(b)),_.substr(0,S)+a+O};if(o.length<=s)return o;var h=s-u,p=function(_){var y={},T=_,S=T.match(/^([a-z]+):\/\//i);return S&&(y.scheme=S[1],T=T.substr(S[0].length)),(S=T.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(y.host=S[1],T=T.substr(S[0].length)),(S=T.match(/^\/(.*?)(?=(\?|#|$))/i))&&(y.path=S[1],T=T.substr(S[0].length)),(S=T.match(/^\?(.*?)(?=(#|$))/i))&&(y.query=S[1],T=T.substr(S[0].length)),(S=T.match(/^#(.*?)$/i))&&(y.fragment=S[1]),y}(o);if(p.query){var f=p.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(p.query=p.query.substr(0,f[1].length),o=c(p))}if(o.length<=s||(p.host&&(p.host=p.host.replace(/^www\./,""),o=c(p)),o.length<=s))return o;var m="";if(p.host&&(m+=p.host),m.length>=h)return p.host.length==s?(p.host.substr(0,s-u)+a).substr(0,h+l):d(m,h).substr(0,h+l);var g="";if(p.path&&(g+="/"+p.path),p.query&&(g+="?"+p.query),g){if((m+g).length>=h)return(m+g).length==s?(m+g).substr(0,s):(m+d(g,h-m.length)).substr(0,h+l);m+=g}if(p.fragment){var E="#"+p.fragment;if((m+E).length>=h)return(m+E).length==s?(m+E).substr(0,s):(m+d(E,h-m.length)).substr(0,h+l);m+=E}if(p.scheme&&p.host){var v=p.scheme+"://";if((m+v).length<h)return(v+m).substr(0,s)}if(m.length<=s)return m;var A="";return h>0&&(A=m.substr(-1*Math.floor(h/2))),(m.substr(0,Math.ceil(h/2))+a+A).substr(0,h+l)}(e,r):i==="middle"?function(o,s,a){if(o.length<=s)return o;var l,u;a==null?(a="&hellip;",l=8,u=3):(l=a.length,u=a.length);var c=s-u,d="";return c>0&&(d=o.substr(-1*Math.floor(c/2))),(o.substr(0,Math.ceil(c/2))+a+d).substr(0,c+l)}(e,r):function(o,s,a){return function(l,u,c){var d;return l.length>u&&(c==null?(c="&hellip;",d=3):d=c.length,l=l.substring(0,u-d)+c),l}(o,s,a)}(e,r)},n}(),Yi=function(){function n(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return n.prototype.getMatchedText=function(){return this.matchedText},n.prototype.setOffset=function(e){this.offset=e},n.prototype.getOffset=function(){return this.offset},n.prototype.getCssClassSuffixes=function(){return[this.getType()]},n.prototype.buildTag=function(){return this.tagBuilder.build(this)},n}(),Xd=function(n,e){return Xd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},Xd(n,e)};function Tn(n,e){function t(){this.constructor=n}Xd(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var uv,Pe=function(){return Pe=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},Pe.apply(this,arguments)},Kd=function(n){function e(t){var r=n.call(this,t)||this;return r.email="",r.email=t.email,r}return Tn(e,n),e.prototype.getType=function(){return"email"},e.prototype.getEmail=function(){return this.email},e.prototype.getAnchorHref=function(){return"mailto:"+this.email},e.prototype.getAnchorText=function(){return this.email},e}(Yi),cv=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="",r.hashtag="",r.serviceName=t.serviceName,r.hashtag=t.hashtag,r}return Tn(e,n),e.prototype.getType=function(){return"hashtag"},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getHashtag=function(){return this.hashtag},e.prototype.getAnchorHref=function(){var t=this.serviceName,r=this.hashtag;switch(t){case"twitter":return"https://twitter.com/hashtag/"+r;case"facebook":return"https://www.facebook.com/hashtag/"+r;case"instagram":return"https://instagram.com/explore/tags/"+r;default:throw new Error("Unknown service name to point hashtag to: "+t)}},e.prototype.getAnchorText=function(){return"#"+this.hashtag},e}(Yi),dv=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.mention="",r.mention=t.mention,r.serviceName=t.serviceName,r}return Tn(e,n),e.prototype.getType=function(){return"mention"},e.prototype.getMention=function(){return this.mention},e.prototype.getServiceName=function(){return this.serviceName},e.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)}},e.prototype.getAnchorText=function(){return"@"+this.mention},e.prototype.getCssClassSuffixes=function(){var t=n.prototype.getCssClassSuffixes.call(this),r=this.getServiceName();return r&&t.push(r),t},e}(Yi),hv=function(n){function e(t){var r=n.call(this,t)||this;return r.number="",r.plusSign=!1,r.number=t.number,r.plusSign=t.plusSign,r}return Tn(e,n),e.prototype.getType=function(){return"phone"},e.prototype.getPhoneNumber=function(){return this.number},e.prototype.getNumber=function(){return this.getPhoneNumber()},e.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},e.prototype.getAnchorText=function(){return this.matchedText},e}(Yi),qd=function(n){function e(t){var r=n.call(this,t)||this;return r.url="",r.urlMatchType="scheme",r.protocolUrlMatch=!1,r.protocolRelativeMatch=!1,r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.schemePrefixRegex=/^(https?:\/\/)?/i,r.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,r.protocolRelativeRegex=/^\/\//,r.protocolPrepended=!1,r.urlMatchType=t.urlMatchType,r.url=t.url,r.protocolUrlMatch=t.protocolUrlMatch,r.protocolRelativeMatch=t.protocolRelativeMatch,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return Tn(e,n),e.prototype.getType=function(){return"url"},e.prototype.getUrlMatchType=function(){return this.urlMatchType},e.prototype.getUrl=function(){var t=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(t=this.url="http://"+t,this.protocolPrepended=!0),t},e.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,"&")},e.prototype.getAnchorText=function(){var t=this.getMatchedText();return this.protocolRelativeMatch&&(t=this.stripProtocolRelativePrefix(t)),this.stripPrefix.scheme&&(t=this.stripSchemePrefix(t)),this.stripPrefix.www&&(t=this.stripWwwPrefix(t)),this.stripTrailingSlash&&(t=this.removeTrailingSlash(t)),this.decodePercentEncoding&&(t=this.removePercentEncoding(t)),t},e.prototype.stripSchemePrefix=function(t){return t.replace(this.schemePrefixRegex,"")},e.prototype.stripWwwPrefix=function(t){return t.replace(this.wwwPrefixRegex,"$1")},e.prototype.stripProtocolRelativePrefix=function(t){return t.replace(this.protocolRelativeRegex,"")},e.prototype.removeTrailingSlash=function(t){return t.charAt(t.length-1)==="/"&&(t=t.slice(0,-1)),t},e.prototype.removePercentEncoding=function(t){var r=t.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(r)}catch{return r}},e}(Yi),zi=function(n){this.__jsduckDummyDocProp=null,this.tagBuilder=n.tagBuilder},Jd=/[A-Za-z]/,HN=/[\d]/,$N=/[\D]/,Xr=/\s/,Zd=/['"]/,jN=/[\x00-\x1F\x7F]/,pv=/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,fv=pv+/\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,pl=/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,YN=fv+pl,He=fv+pl,zN="(?:["+pl+"]{1,3}\\.){3}["+pl+"]{1,3}",VN="["+He+"](?:["+He+"\\-]{0,61}["+He+"])?",mv=function(n){return"(?=("+VN+"))\\"+n},Qd=function(n){return"(?:"+mv(n)+"(?:\\."+mv(n+1)+"){0,126}|"+zN+")"},fl=new RegExp("["+He+"]"),gv=/(?: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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,WN=new RegExp("["+He+"!#$%&'*+/=?^_`{|}~-]"),GN=new RegExp("^"+gv.source+"$"),Ev=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.localPartCharRegex=WN,t.strictTldRegex=GN,t}return Tn(e,n),e.prototype.parseMatches=function(t){for(var r=this.tagBuilder,i=this.localPartCharRegex,o=this.strictTldRegex,s=[],a=t.length,l=new ml,u={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},c=0,d=0,h=l;c<a;){var p=t.charAt(c);switch(d){case 0:f(p);break;case 1:m(t.charAt(c-1),p);break;case 2:g(p);break;case 3:E(p);break;case 4:v(p);break;case 5:A(p);break;case 6:_(p);break;case 7:y(p);break;default:av(d)}c++}return b(),s;function f(O){O==="m"?T(1):i.test(O)&&T()}function m(O,C){O===":"?i.test(C)?(d=2,h=new ml(Pe(Pe({},h),{hasMailtoPrefix:!0}))):S():u[O]===C||(i.test(C)?d=2:C==="."?d=3:C==="@"?d=4:S())}function g(O){O==="."?d=3:O==="@"?d=4:i.test(O)||S()}function E(O){O==="."||O==="@"?S():i.test(O)?d=2:S()}function v(O){fl.test(O)?d=5:S()}function A(O){O==="."?d=7:O==="-"?d=6:fl.test(O)||b()}function _(O){O==="-"||O==="."?b():fl.test(O)?d=5:b()}function y(O){O==="."||O==="-"?b():fl.test(O)?(d=5,h=new ml(Pe(Pe({},h),{hasDomainDot:!0}))):b()}function T(O){O===void 0&&(O=2),d=O,h=new ml({idx:c})}function S(){d=0,h=l}function b(){if(h.hasDomainDot){var O=t.slice(h.idx,c);/[-.]$/.test(O)&&(O=O.slice(0,-1));var C=h.hasMailtoPrefix?O.slice(7):O;(function(w){var I=w.split(".").pop()||"",F=I.toLowerCase();return o.test(F)})(C)&&s.push(new Kd({tagBuilder:r,matchedText:O,offset:h.idx,email:C}))}S()}},e}(zi),ml=function(n){n===void 0&&(n={}),this.idx=n.idx!==void 0?n.idx:-1,this.hasMailtoPrefix=!!n.hasMailtoPrefix,this.hasDomainDot=!!n.hasDomainDot},XN=function(){function n(){}return n.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},n.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return e.match(t)!==null},n.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},n.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),r=t&&t[0].toLowerCase();return r!=="javascript:"&&r!=="vbscript:"},n.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||e.indexOf(".")!==-1)},n.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t)&&!this.hasFullProtocolRegex.test(t)&&!this.hasWordCharAfterProtocolRegex.test(e)},n.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,n.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,n.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+pv+"]"),n.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]*)?\/?$/,n}(),KN=(uv=new RegExp("[/?#](?:["+He+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+He+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,Qd(2),")","|","(","(//)?",/(?:www\.)/.source,Qd(6),")","|","(","(//)?",Qd(10)+"\\.",gv.source,"(?![-"+YN+"])",")",")","(?::[0-9]+)?","(?:"+uv.source+")?"].join(""),"gi")),qN=new RegExp("["+He+"]"),vv=function(n){function e(t){var r=n.call(this,t)||this;return r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.matcherRegex=KN,r.wordCharRegExp=qN,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return Tn(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.stripPrefix,s=this.stripTrailingSlash,a=this.decodePercentEncoding,l=this.tagBuilder,u=[],c=function(){var h=r[0],p=r[1],f=r[4],m=r[5],g=r[9],E=r.index,v=m||g,A=t.charAt(E-1);if(!XN.isValid(h,p)||E>0&&A==="@"||E>0&&v&&d.wordCharRegExp.test(A))return"continue";if(/\?$/.test(h)&&(h=h.substr(0,h.length-1)),d.matchHasUnbalancedClosingParen(h))h=h.substr(0,h.length-1);else{var _=d.matchHasInvalidCharAfterTld(h,p);_>-1&&(h=h.substr(0,_))}var y=["http://","https://"].find(function(O){return!!p&&p.indexOf(O)!==-1});if(y){var T=h.indexOf(y);h=h.substr(T),p=p.substr(T),E+=T}var S=p?"scheme":f?"www":"tld",b=!!p;u.push(new qd({tagBuilder:l,matchedText:h,offset:E,urlMatchType:S,url:h,protocolUrlMatch:b,protocolRelativeMatch:!!v,stripPrefix:o,stripTrailingSlash:s,decodePercentEncoding:a}))},d=this;(r=i.exec(t))!==null;)c();return u},e.prototype.matchHasUnbalancedClosingParen=function(t){var r,i=t.charAt(t.length-1);if(i===")")r="(";else if(i==="]")r="[";else{if(i!=="}")return!1;r="{"}for(var o=0,s=0,a=t.length-1;s<a;s++){var l=t.charAt(s);l===r?o++:l===i&&(o=Math.max(o-1,0))}return o===0},e.prototype.matchHasInvalidCharAfterTld=function(t,r){if(!t)return-1;var i=0;r&&(i=t.indexOf(":"),t=t.slice(i));var o=new RegExp("^((.?//)?[-."+He+"]*[-"+He+"]\\.[-"+He+"]+)").exec(t);return o===null?-1:(i+=o[1].length,t=t.slice(o[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(t)?i:-1)},e}(zi),JN=new RegExp("#[_"+He+"]{1,139}(?![_"+He+"])","g"),ZN=new RegExp("[^"+He+"]"),Av=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.matcherRegex=JN,r.nonWordCharRegex=ZN,r.serviceName=t.serviceName,r}return Tn(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.nonWordCharRegex,s=this.serviceName,a=this.tagBuilder,l=[];(r=i.exec(t))!==null;){var u=r.index,c=t.charAt(u-1);if(u===0||o.test(c)){var d=r[0],h=r[0].slice(1);l.push(new cv({tagBuilder:a,matchedText:d,offset:u,serviceName:s,hashtag:h}))}}return l},e}(zi),QN=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"),_v=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.matcherRegex=QN,t}return Tn(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.tagBuilder,s=[];(r=i.exec(t))!==null;){var a=r[0],l=a.replace(/[^0-9,;#]/g,""),u=!(!r[1]&&!r[2]),c=r.index==0?"":t.substr(r.index-1,1),d=t.substr(r.index+a.length,1),h=!c.match(/\d/)&&!d.match(/\d/);this.testMatch(r[3])&&this.testMatch(a)&&h&&s.push(new hv({tagBuilder:o,matchedText:a,offset:r.index,number:l,plusSign:u}))}return s},e.prototype.testMatch=function(t){return $N.test(t)},e}(zi),eC=new RegExp("@[_"+He+"]{1,50}(?![_"+He+"])","g"),tC=new RegExp("@[_."+He+"]{1,30}(?![_"+He+"])","g"),nC=new RegExp("@[-_."+He+"]{1,50}(?![-_"+He+"])","g"),rC=new RegExp("[^"+He+"]"),yv=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.matcherRegexes={twitter:eC,instagram:tC,soundcloud:nC},r.nonWordCharRegex=rC,r.serviceName=t.serviceName,r}return Tn(e,n),e.prototype.parseMatches=function(t){var r,i=this.serviceName,o=this.matcherRegexes[this.serviceName],s=this.nonWordCharRegex,a=this.tagBuilder,l=[];if(!o)return l;for(;(r=o.exec(t))!==null;){var u=r.index,c=t.charAt(u-1);if(u===0||s.test(c)){var d=r[0].replace(/\.+$/g,""),h=d.slice(1);l.push(new dv({tagBuilder:a,matchedText:d,offset:u,serviceName:i,mention:h}))}}return l},e}(zi);function iC(n,e){for(var t,r=e.onOpenTag,i=e.onCloseTag,o=e.onText,s=e.onComment,a=e.onDoctype,l=new Sn,u=0,c=n.length,d=0,h=0,p=l;u<c;){var f=n.charAt(u);switch(d){case 0:m(f);break;case 1:g(f);break;case 2:v(f);break;case 3:E(f);break;case 4:A(f);break;case 5:_(f);break;case 6:y(f);break;case 7:T(f);break;case 8:S(f);break;case 9:b(f);break;case 10:O(f);break;case 11:C(f);break;case 12:w(f);break;case 13:I();break;case 14:F(f);break;case 15:x(f);break;case 16:$(f);break;case 17:k(f);break;case 18:M(f);break;case 19:Y(f);break;case 20:L(f);break;default:av(d)}u++}function m(D){D==="<"&&j()}function g(D){D==="!"?d=13:D==="/"?(d=2,p=new Sn(Pe(Pe({},p),{isClosing:!0}))):D==="<"?j():Jd.test(D)?(d=3,p=new Sn(Pe(Pe({},p),{isOpening:!0}))):(d=0,p=l)}function E(D){Xr.test(D)?(p=new Sn(Pe(Pe({},p),{name:te()})),d=4):D==="<"?j():D==="/"?(p=new Sn(Pe(Pe({},p),{name:te()})),d=12):D===">"?(p=new Sn(Pe(Pe({},p),{name:te()})),re()):Jd.test(D)||HN.test(D)||D===":"||J()}function v(D){D===">"?J():Jd.test(D)?d=3:J()}function A(D){Xr.test(D)||(D==="/"?d=12:D===">"?re():D==="<"?j():D==="="||Zd.test(D)||jN.test(D)?J():d=5)}function _(D){Xr.test(D)?d=6:D==="/"?d=12:D==="="?d=7:D===">"?re():D==="<"?j():Zd.test(D)&&J()}function y(D){Xr.test(D)||(D==="/"?d=12:D==="="?d=7:D===">"?re():D==="<"?j():Zd.test(D)?J():d=5)}function T(D){Xr.test(D)||(D==='"'?d=8:D==="'"?d=9:/[>=`]/.test(D)?J():D==="<"?j():d=10)}function S(D){D==='"'&&(d=11)}function b(D){D==="'"&&(d=11)}function O(D){Xr.test(D)?d=4:D===">"?re():D==="<"&&j()}function C(D){Xr.test(D)?d=4:D==="/"?d=12:D===">"?re():D==="<"?j():(d=4,u--)}function w(D){D===">"?(p=new Sn(Pe(Pe({},p),{isClosing:!0})),re()):d=4}function I(D){n.substr(u,2)==="--"?(u+=2,p=new Sn(Pe(Pe({},p),{type:"comment"})),d=14):n.substr(u,7).toUpperCase()==="DOCTYPE"?(u+=7,p=new Sn(Pe(Pe({},p),{type:"doctype"})),d=20):J()}function F(D){D==="-"?d=15:D===">"?J():d=16}function x(D){D==="-"?d=18:D===">"?J():d=16}function $(D){D==="-"&&(d=17)}function k(D){d=D==="-"?18:16}function M(D){D===">"?re():D==="!"?d=19:D==="-"||(d=16)}function Y(D){D==="-"?d=17:D===">"?re():d=16}function L(D){D===">"?re():D==="<"&&j()}function J(){d=0,p=l}function j(){d=1,p=new Sn({idx:u})}function re(){var D=n.slice(h,p.idx);D&&o(D,h),p.type==="comment"?s(p.idx):p.type==="doctype"?a(p.idx):(p.isOpening&&r(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),J(),h=u+1}function te(){var D=p.idx+(p.isClosing?2:1);return n.slice(D,u).toLowerCase()}h<u&&(t=n.slice(h,u),o(t,h),h=u+1)}var Sn=function(n){n===void 0&&(n={}),this.idx=n.idx!==void 0?n.idx:-1,this.type=n.type||"tag",this.name=n.name||"",this.isOpening=!!n.isOpening,this.isClosing=!!n.isClosing},oC=function(){function n(e){e===void 0&&(e={}),this.version=n.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(e.urls),this.email=typeof e.email=="boolean"?e.email:this.email,this.phone=typeof e.phone=="boolean"?e.phone:this.phone,this.hashtag=e.hashtag||this.hashtag,this.mention=e.mention||this.mention,this.newWindow=typeof e.newWindow=="boolean"?e.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(e.stripPrefix),this.stripTrailingSlash=typeof e.stripTrailingSlash=="boolean"?e.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=typeof e.decodePercentEncoding=="boolean"?e.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=e.sanitizeHtml||!1;var t=this.mention;if(t!==!1&&t!=="twitter"&&t!=="instagram"&&t!=="soundcloud")throw new Error("invalid `mention` cfg - see docs");var r=this.hashtag;if(r!==!1&&r!=="twitter"&&r!=="facebook"&&r!=="instagram")throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(e.truncate),this.className=e.className||this.className,this.replaceFn=e.replaceFn||this.replaceFn,this.context=e.context||this}return n.link=function(e,t){return new n(t).link(e)},n.parse=function(e,t){return new n(t).parse(e)},n.prototype.normalizeUrlsCfg=function(e){return e==null&&(e=!0),typeof e=="boolean"?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:typeof e.schemeMatches!="boolean"||e.schemeMatches,wwwMatches:typeof e.wwwMatches!="boolean"||e.wwwMatches,tldMatches:typeof e.tldMatches!="boolean"||e.tldMatches}},n.prototype.normalizeStripPrefixCfg=function(e){return e==null&&(e=!0),typeof e=="boolean"?{scheme:e,www:e}:{scheme:typeof e.scheme!="boolean"||e.scheme,www:typeof e.www!="boolean"||e.www}},n.prototype.normalizeTruncateCfg=function(e){return typeof e=="number"?{length:e,location:"end"}:function(t,r){for(var i in r)r.hasOwnProperty(i)&&t[i]===void 0&&(t[i]=r[i]);return t}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},n.prototype.parse=function(e){var t=this,r=["a","style","script"],i=0,o=[];return iC(e,{onOpenTag:function(s){r.indexOf(s)>=0&&i++},onText:function(s,a){if(i===0){var l=function(c,d){if(!d.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var h,p=[],f=0;h=d.exec(c);)p.push(c.substring(f,h.index)),p.push(h[0]),f=h.index+h[0].length;return p.push(c.substring(f)),p}(s,/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),u=a;l.forEach(function(c,d){if(d%2==0){var h=t.parseText(c,u);o.push.apply(o,h)}u+=c.length})}},onCloseTag:function(s){r.indexOf(s)>=0&&(i=Math.max(i-1,0))},onComment:function(s){},onDoctype:function(s){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o)},n.prototype.compactMatches=function(e){e.sort(function(l,u){return l.getOffset()-u.getOffset()});for(var t=0;t<e.length-1;t++){var r=e[t],i=r.getOffset(),o=r.getMatchedText().length,s=i+o;if(t+1<e.length){if(e[t+1].getOffset()===i){var a=e[t+1].getMatchedText().length>o?t:t+1;e.splice(a,1);continue}e[t+1].getOffset()<s&&e.splice(t+1,1)}}return e},n.prototype.removeUnwantedMatches=function(e){return this.hashtag||Gr(e,function(t){return t.getType()==="hashtag"}),this.email||Gr(e,function(t){return t.getType()==="email"}),this.phone||Gr(e,function(t){return t.getType()==="phone"}),this.mention||Gr(e,function(t){return t.getType()==="mention"}),this.urls.schemeMatches||Gr(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="scheme"}),this.urls.wwwMatches||Gr(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="www"}),this.urls.tldMatches||Gr(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="tld"}),e},n.prototype.parseText=function(e,t){t===void 0&&(t=0),t=t||0;for(var r=this.getMatchers(),i=[],o=0,s=r.length;o<s;o++){for(var a=r[o].parseMatches(e),l=0,u=a.length;l<u;l++)a[l].setOffset(t+a[l].getOffset());i.push.apply(i,a)}return i},n.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var t=this.parse(e),r=[],i=0,o=0,s=t.length;o<s;o++){var a=t[o];r.push(e.substring(i,a.getOffset())),r.push(this.createMatchReturnVal(a)),i=a.getOffset()+a.getMatchedText().length}return r.push(e.substring(i)),r.join("")},n.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),typeof t=="string"?t:t===!1?e.getMatchedText():t instanceof Gd?t.toAnchorString():e.buildTag().toAnchorString()},n.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new Av({tagBuilder:e,serviceName:this.hashtag}),new Ev({tagBuilder:e}),new _v({tagBuilder:e}),new yv({tagBuilder:e,serviceName:this.mention}),new vv({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},n.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new lv({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},n.version="3.14.3",n.AnchorTagBuilder=lv,n.HtmlTag=Gd,n.matcher={Email:Ev,Hashtag:Av,Matcher:zi,Mention:yv,Phone:_v,Url:vv},n.match={Email:Kd,Hashtag:cv,Match:Yi,Mention:dv,Phone:hv,Url:qd},n}();function Ov(n,e=n){return{type:"autolink",url:n,text:e}}const sC=Wn(/<!!mention:([^>\s]*?)\|(.*?)>/gm,([n,e,t])=>function(r,i){return{type:"mention",id:r,text:i}}(decodeURIComponent(e),t)),aC=Wn(/<!!customemoji:(.*?)>/gm,([n,e])=>function(t){return{type:"customemoji",text:t}}(e)),Tv=Wn(/<((?:https?|mailto):.*?)\|(.*?)>/gi,([n,e,t])=>function(r,i=[]){return{type:"link",url:r,children:i}}(e,[t])),lC=Wn(/<actionlink:([^|]+)[|]([^>]*)>/gi,([n,e,t])=>{const{action:r,params:i}=Sv(e);return function(o,s,a=[]){return{type:"actionlink",action:o,params:s,children:a}}(r,i,[t])}),uC=Wn(/<actionbutton:([^|]+)[|]([^>]*)>/gi,([n,e,t])=>{const{action:r,params:i}=Sv(e);return function(o,s,a=[]){return{type:"actionbutton",action:o,params:s,children:a}}(r,i,[t])});function Sv(n){const e=n.indexOf("?");return e===-1?{action:n,params:{}}:{action:n.slice(0,e),params:Object.fromEntries(new URLSearchParams(n.slice(e)))}}const cC=Wn(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g,([n])=>function(e=[]){return{type:"bulletlist",children:e}}([n.startsWith(`
84
84
  `)?n.slice(1):n])),dC=Wn(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm,([n,e])=>({type:"bulletpoint",children:[e]})),hC=n=>{const e=/(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;let t=0;const r=[];for(const i of Qu(n,e)){const o=i[0],s=i[1],a=o.startsWith(s)?i.index:i.index+1;a-t>0&&r.push(n.substring(t,a));const l=Ov("tel:"+s.replace(/[^0-9+]/g,""),s);r.push(l),t=a+s.length}return t<n.length&&r.push(n.substring(t)),r},pC=n=>Tv(n).flatMap(e=>typeof e=="string"?eh(e):["<",...eh(e.url),...eh("|"+e.children[0]+">")]),eh=n=>{const e=oC.parse(n,{urls:!0,email:!0,phone:!1,hashtag:!1,mention:!1}),t=[];let r=0;for(const i of e){const o=i.getOffset(),s=i.getMatchedText(),a=s.length;let l=s;i instanceof Kd?l="mailto:"+i.getEmail():i instanceof qd&&(l=i.getUrl()),o>r&&t.push(n.substring(r,o)),t.push(Ov(l,s)),r=o+a}return r<n.length&&t.push(n.substring(r)),t},fC=["Codeblock","Codespan","FormattedLink","Wikitext","Autolink","Actions","Mention","Mention","BulletPoint","CustomEmoji"];function mC(n={except:[]}){const e={multilineSteps:[],singlelineSteps:[]},t=n.except??fC.filter(r=>!n.only.includes(r));return t.includes("BulletPoint")||e.multilineSteps.push(cC,dC),t.includes("Mention")||e.singlelineSteps.push(sC),t.includes("CustomEmoji")||e.singlelineSteps.push(aC),t.includes("Codespan")||e.multilineSteps.push(Wn(/```([^]+?)```/g,([r,i])=>({type:"codespan",text:rv(i)}))),t.includes("FormattedLink")||e.singlelineSteps.push(Tv),t.includes("Actions")||(e.singlelineSteps.push(lC),e.singlelineSteps.push(uC)),t.includes("Wikitext")||e.singlelineSteps.push(FN),t.includes("Autolink")||e.singlelineSteps.push(pC,hC),e}const gC=function(n){const e=RegExp(`[^${n}]+${n}?|${n}`,"g");return t=>Array.from(t.match(e)||[])}(`
85
- `);function bv(n,e={except:[]}){let t=function(r,i){let o=[r];return o=th(o,i.multilineSteps),o=th(o,[gC]),o=th(o,i.singlelineSteps),o=Nv(o),o}(n,mC(e));return t=Cv(t,!1),t}function th(n,e){return e.reduce((t,r)=>ms(t,r),n)}function Nv(n){const e=[];let t=-1;for(const r of n)typeof r=="string"?typeof e[t]=="string"?e[t]+=r:e[++t]=r:e[++t]="children"in r?{...r,children:Nv(r.children)}:r;return e}function Cv(n,e){const t=[];let r=[];for(let i=0;i<n.length;i++){const o=n[i];typeof o=="string"?r.push(o):"children"in o?(r.length>0&&(t.push(r.join("")),r=[]),o.children=Cv(o.children,e||o.type==="link"||o.type==="actionbutton"||o.type==="actionlink"),t.push(o)):o.type==="autolink"&&e?r.push(o.text):(r.length>0&&(t.push(r.join("")),r=[]),t.push(o))}return r.length>0&&(t.push(r.join("")),r=[]),t}function EC(){let n,e=0;return t=>{const r=(o=Date.now())=>{window.clearTimeout(n),n=void 0,e=o;const s=function(a){a=a.removeMark(0,a.doc.content.size,Ze.marks.bold),a=a.removeMark(0,a.doc.content.size,Ze.marks.italic),a=a.removeMark(0,a.doc.content.size,Ze.marks.strikethrough),a.doc.firstChild;const l=function(u){const c=[];let d,h="";return u.descendants((p,f)=>(p.isText?(h+=p.text,d??=f):h&&d!==void 0&&(c.push({text:h,pos:d}),h="",d=void 0),p.type!==Ze.nodes.mention)),h&&d!==void 0&&c.push({text:h,pos:d}),c}(a.doc);for(const{text:u,pos:c}of l){const d=bv(u,{only:["Wikitext"]});[a]=Iv(a,c,d)}return a}(t.state.tr);t.dispatch(s)},i=Date.now();i-e<300?n||(n=window.setTimeout(r,300)):r(i)}}function Iv(n,e,t,r=0,i=[]){for(const o of t)if(typeof o=="string"){for(const s of i)n.addMark(e+r,e+r+o.length,s.create());r+=o.length}else if(o.type==="bold"||o.type==="italic"||o.type==="strikethrough"){r+=1;const s=Ze.marks[o.type],a=[...i,s];[n,r]=Iv(n,e,o.children,r,a),r+=1}else Ie.unreachable();return[n,r]}function wv(n){return(e,t)=>{if(!t)return!0;let r=e.tr;const i=Te.between(e.selection.$from,e.selection.$to);return r=r.replaceRangeWith(i.from,i.from,Ze.text(n,r.storedMarks)),r=r.replaceRangeWith(i.to+1,i.to+1,Ze.text(n,r.storedMarks)),r=r.setSelection(Te.near(r.doc.resolve(i.to+1))),t(r),!0}}function vC(n,e,t){const r=e.clipboardData;if(!r)return!1;const i=function(o){const s=o.items||[],a={"image/gif":"gif","image/png":"png","image/jpeg":"jpg","image/svg+xml":"svg"},l=Array.from(s).filter(d=>d.kind==="file"&&a[d.type]);if(l.length===0||o.types.includes("text/rtf"))return;const u=l[0];let c=u.getAsFile();if(!c.name){const d="image."+a[u.type];c=new File([c],d,{type:u.type,lastModified:Date.now()})}return c}(r);return i?t(i):function(o,s){const a=o.state.tr.insertText(s).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");o.dispatch(a)}(n,r.getData("text/plain")),!0}function AC(n,{allowSpaces:e=!1}){return t=>{const r=new RegExp(`\\s${n}$`),i=e?new RegExp(`${n}.*?(?=\\s${n}|$)`,"g"):new RegExp(`(?:^)?${n}[^\\s${n}]*`,"g"),o=t.before(),s=t.end(),a=t.doc.textBetween(o,s,"\0","\0");let l;for(;l=i.exec(a);){const u=l.input.slice(Math.max(0,l.index-1),l.index);if(!/^[\s\0]?$/.test(u))continue;const c=l.index+t.start();let d=c+l[0].length;if(e&&r.test(a.slice(d-1,d+1))&&(l[0]+=" ",d++),c<t.pos&&d>=t.pos)return{range:{from:c,to:d},text:l[0]}}}}function Rv({matcher:n=AC("#"),suggestionClass:e="ProseMirror-suggestion",onEnter:t=()=>!1,onChange:r=()=>!1,onExit:i=()=>!1,onKeyDown:o=()=>!1,debug:s=!1}){return new qa({key:new Ja("suggestions"),view(){return{update:(a,l)=>{const u=this.key.getState(l),c=this.key.getState(a.state),d=u.active&&c.active&&u.range.from!==c.range.from,h=!u.active&&c.active,p=u.active&&!c.active,f=!h&&!p&&u.text!==c.text;(p||d)&&i({view:a,range:u.range,text:u.text}),f&&!d&&r({view:a,range:c.range,text:c.text}),(h||d)&&t({view:a,range:c.range,text:c.text})}}},state:{init:()=>({active:!1,range:{},text:null}),apply(a,l){const{selection:u}=a,c={...l};if(u.from===u.to){(u.from<l.range.from||u.from>l.range.to)&&(c.active=!1);const d=u.$from,h=n(d);h?(c.active=!0,c.range=h.range,c.text=h.text):c.active=!1}else c.active=!1;return c.active||(c.range={},c.text=null),c}},props:{handleKeyDown(a,l){const{active:u}=this.getState(a.state);return!!u&&o({view:a,event:l})},decorations(a){const{active:l,range:u}=this.getState(a);return l?Ge.create(a.doc,[Ht.inline(u.from,u.to,{nodeName:"span",class:e,style:s?"background: rgba(0, 0, 255, 0.05); color: blue; border: 2px solid blue;":null})]):null}}})}function _C({placeholder:n,disabled:e,className:t="",characterLimit:r,spellcheck:i}){const o=Po(),s=W(),a=W(null);return V(()=>(s.current=function(l,u,c,d,h){const p=Pi.create({schema:Ze,plugins:[...h.filter(yC),wN(),R0({...hl,"Mod-z":j0,"Mod-y":Y0,"Mod-b":wv("*"),"Mod-i":wv("_"),"Mod-Enter":hl.Enter,"Shift-Enter":hl.Enter,Enter:c}),R0({Enter:hl.Enter}),N0]}),f=EC(),m=new EN(l,{handlePaste:(g,E,v)=>vC(g,E,d),clipboardTextSerializer(g){const E=[];return g.content.forEach(v=>{v&&E.push(rv(v.textContent))}),E.join()},state:p,dispatchTransaction(g){g=(g=g.removeStoredMark(Ze.marks.literal)).removeStoredMark(Ze.marks.emoji);const E=m.state.apply(g);m.state.doc.eq(E.doc)||u(new gl(E.doc)),m.updateState(E),g.steps.some(v=>v instanceof dn)&&setTimeout(()=>f(m),0)}});return m}(a.current,l=>o.onChange(l),()=>!!o.onEnter&&(o.onEnter(),!0),l=>o.onPasteImage(l),[o.emojiSuggesterPlugin(),o.mentionsPlugin()]),o.setEditorView(s.current),()=>{o.setEditorView(void 0),s.current?.destroy()}),[o]),V(()=>{s.current?.setProps({editable:()=>!e})},[e]),V(()=>Vo(()=>s.current?.setProps({attributes:{spellcheck:String(o.spellcheck$.get()??i??!1),class:"t-text-input","aria-label":"Message Field",role:"textbox"}})),[o,i]),V(()=>Vo(()=>{const l=s.current;l?.dispatch(l.state.tr.setMeta(N0,o.placeholder$.get()??n))}),[o,n]),V(()=>{r&&Number.isInteger(r)&&o.setMaxLength(r)},[r,o]),N("div",{className:`t-editor ${t}`,ref:a})}function Dv(n){if(n.startsWith(":"))throw new Error("Not implemented");{const e=Ze.marks.emoji.create({emoji:n});return Ze.text(n,[e])}}function kv(n,e){const t=encodeURIComponent(n);return Ze.nodes.mention.create({id:n,name:e},Ze.text(`<!!mention:${t}|${e}>`))}class gl{constructor(e){this.doc=e,this.size=this.doc.content.size,this.hasContent=C0(this.doc)}static{this.EMPTY=new gl(Ze.topNodeType.create())}asText(){return this.doc.textContent.replace(/\xa0/g," ")}}function yC(n){return n!=null}const Lv=/^\/.*[^\\]\/[im]*$/;function xv(n){return Lv.test(n)?!El(n).test(""):!1}function El(n){const e=n.match(/^\/(.*[^\\])\/(.*)$/);if(!e)throw new Error(`Expected ${n} to be a (non-empty) regex`);let t=e[2]||"";return t=t.replace(/[^im]/g,"")+"g",new RegExp(e[1],t)}function OC(n,e){const t=function(i){{const o=document.createElement("a");return o.href=i,o.hostname}}(e),r=function(i){const o=i.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp("^"+o+"$","i")}(n);return t!==void 0&&r.test(t)}const TC=/^[]/g;function SC(n){return n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function nh(n,e){!n()&&!e&&(e=n.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/,"`$1`")+" was not true")}(n=>{function e(r){}function t(r,i){(function(o,s){switch(s){case"undefined":return o===void 0;case String:return typeof o=="string"||o instanceof String;case Boolean:return typeof o=="boolean"||o instanceof Boolean;case Number:return typeof o=="number"||o instanceof Number;default:return o instanceof s}})(r,i)||(i.name,String(r))}n.defined=e,n.has=function(r,i){r[i]},n.is=t,n.equals=function(r,i){},n.oneOf=function(r,i){i.includes(r)||JSON.stringify(i)},n.isArray=function(r,i){t(r,Array),r&&r.length>0&&t(r[0],i)},n.optional=function(r,i){r!==void 0&&t(r,i)},n.falsy=function(r){},n.never=function(r){}})(nh||(nh={}));const Vi=nh,bC=/\uFE0F/g,NC="‍";function CC(n){if(n===":arslan:")return"https://cdn.talkjs.com/__assets/5461191341cea882b3f227c085d5772c.gif";const e=function(r){const i=[];let o=0,s=0,a=0;for(;a<r.length;)o=r.charCodeAt(a++),s?(i.push((65536+(s-55296<<10)+(o-56320)).toString(16)),s=0):55296<=o&&o<=56319?s=o:i.push(o.toString(16));return i.join("-")}((t=n).indexOf(NC)<0?t.replace(bC,""):t);var t;return`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/${e}.svg`}class IC{constructor({mode:e,allowedHostnames:t,allowedPhoneNrs:r,allowedMatches:i,forbiddenMatches:o,suppressLinks:s,suppressEmailAddresses:a,suppressPhoneNumbers:l,replacement:u}){Vi.oneOf(e,["all","otherOnly","off"]),this.mode=e,this.suppressLinks=s!==!1,this.suppressEmailAddresses=a!==!1,this.suppressPhoneNumbers=l!==!1,this.allowedHostnames=t||[],this.allowedPhoneNrs=(r||[]).filter(c=>c).map(c=>c.replace(/[^0-9]/g,"")),this.allowedMatches=(i||[]).filter(xv).map(c=>El(c)),this.forbiddenMatches=(o||[]).filter(xv).map(c=>El(c)),Vi(()=>this.allowedMatches.every(c=>c.flags.includes("g")),"All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"),Vi(()=>this.forbiddenMatches.every(c=>c.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 this.mode==="all"||this.mode==="otherOnly"&&!e}}function Mv(n){let e="";return n.t&&(e=`(${n.t("CONTACT_INFORMATION_HIDDEN")})`),{formattedLinks:n.formattedLinks??"plaintext",markup:n.markup??!1,useFallbackMentions:n.useFallbackMentions??!1,sameTabLinkRules:n.sameTabLinkRules??[],enableEmojiImageFallback:n.enableEmojiImageFallback??!1,highlight:n.highlight??[],contactInfo:n.contactInfo??!1,suppression:n.suppression??new IC({mode:"off"}),contactInfoHiddenText:n.contactInfoHiddenText??n.suppression?.replacement??e,customEmojiUrls:n.customEmojiUrls??{},enableActions:n.enableActions??!0}}class Pv extends Rg{constructor(){super(...arguments),this.conversationListSubscription=null,this.extCurrentConversationId$=Ue(null),this.conversationsArray$=Ue([]),this.conversationsMap$=Ue({})}listenForConversations(e){const t=e.subscribeConversations(r=>{zo(()=>{this.conversationsArray$.set(r);const i={};for(const o of r)i[o.id]=o;this.conversationsMap$.set(i)})});return this.conversationListSubscription=t,()=>{t.unsubscribe(),this.conversationListSubscription=null}}}function wC({id:n,text:e}){const t=Re(),r=ye(()=>{if(t instanceof Pv)return;const i=t.state$.extCurrentConversationId.get();return(i&&t.state$.participants.child(i).get())?.find(s=>s.user.id===n)?.user});return N("span",{className:"t-mention","t-is-current-user":ye(t.extUserId$)===n?"":void 0,children:`@${r?.name??e}`})}function Wi(n,e){const t=n.flatMap(r=>{if(typeof r=="string")return rh(r,e.highlight);switch(r.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletpoint":case"bulletPoint":return RC(r,e);case"bulletlist":case"bulletList":return[ae("ul",null,...Wi(r.children,e))];case"autolink":case"autoLink":case"link":return kC(r,e);case"codeblock":case"codeBlock":return[N("code",{"data-language":r.language,children:rh(r.text,e.highlight)})];case"codespan":case"codeSpan":return N("code",{children:rh((i=r.text,i.replace(/^\s*\n/m,"").replace(/\n\s*$/m,"")),e.highlight)});case"mention":return Vi.falsy(e.useFallbackMentions),N(wC,{id:r.id,text:r.text},r.id);case"suppressed":return[N("i",{children:e.contactInfoHiddenText})];case"emoji":return e.enableEmojiImageFallback?[N(DC,{unicode:r.text})]:[r.text];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return LC(r,e);case"customemoji":case"customEmoji":return r.text;default:Vi.never(r)}var i});return t.every(r=>typeof r=="string")?[t.join("")]:t}function rh(n,e){if(e.length===0)return[n];const t=function(i){const o=i.map(a=>a.trim()).filter(a=>a);if(o.length===0)return TC;const s=o.map(SC).join("|");return new RegExp(s,"gi")}(e),r=Qu(n,t).map(i=>({offset:i.index,matchedText:i[0]}));return function(i,o,s){let a=0;const l=[];for(const u of o)u.offset<a||(u.offset>a&&l.push(i.substring(a,u.offset)),l.push(...s(u)),a=u.offset+u.matchedText.length);return a<i.length&&l.push(i.substring(a)),l}(n,r,({matchedText:i})=>[N("span",{className:"highlighted-text",children:i})])}const RC=(n,e)=>[ae({bold:"strong",italic:"em",strikethrough:"del",blockquote:"blockquote",bulletpoint:"li",bulletPoint:"li"}[n.type],null,...Wi(n.children,e))];function DC({unicode:n}){const[e,t]=ne(()=>n!==":arslan:");return V(()=>{e&&!Ig(n)&&t(!1)},[]),e?N("span",{className:"t-emoji",children:n}):N("img",{className:"t-emoji",src:CC(n),alt:n})}const kC=(n,e)=>{const t="children"in n?n.children:[n.text];switch(e.formattedLinks){case"link":return[ae("a",{target:function(r,i){for(const o of r)if(Lv.test(o)){if(El(o).test(i))return"_top"}else if(OC(o,i))return"_top";return"_blank"}(e.sameTabLinkRules,n.url),href:n.url,rel:"noreferrer"},...Wi(t,e))];case"plaintext":case!1:return"children"in n&&n.children.every(r=>typeof r=="string")?[n.children.join("")]:[ae(xe,null,...Wi(t,e))];default:Vi.never(e.formattedLinks)}},LC=(n,e)=>e.enableActions?[ae("button",{"data-type":n.type,"data-action":n.action,"data-params":JSON.stringify(n.params),disabled:!0},...Wi(n.children,e))]:[null];function Bv({block:n,nonInteractive:e,className:t=""}){const r=!e,i=function(o,s={}){return Wi(o,Mv(s))}(n.children,{enableEmojiImageFallback:!0,formattedLinks:r?"link":"plaintext",enableActions:r});return ae("span",{className:`t-text ${t}`},...i)}function xC(n){const e=sn(),t=Re(),{className:r="",...i}=n,o=ye(()=>t.state$.messages.child(t.state$.extCurrentConversationId.get()).lookup.child(n.message.id).content.child(0).url.get());return N("div",{className:`t-message-content ${r}`,children:n.message.content.map(s=>N(MC,{block:s,theme:e,downloadUrl:o,...i},n.message.createdAt+(n.message.editedAt??0)))})}function MC({common:n,block:e,message:t,theme:r,downloadUrl:i}){const o=function(s,a){switch(a.type){case"text":return s.TextBlock;case"location":return s.LocationBlock;case"file":switch(a.subtype){case"image":return s.ImageBlock;case"video":return s.VideoBlock;case"voice":return s.VoiceBlock;case"audio":return s.AudioBlock;default:return s.FileBlock}default:Ie.never(a)}}(r,e);return N(o,{block:e,common:n,message:t,downloadUrl:i})}function vl(n,e,t=!0){const r=ie(o=>{o.keyCode===27&&n()},[n]),i=ie(o=>{o.target instanceof HTMLElement&&o.target.closest(e)===null&&n()},[e,n]);V(()=>{if(t)return window.addEventListener("keydown",r,!0),document.addEventListener("mousedown",i,!0),()=>{window.removeEventListener("keydown",r,!0),document.removeEventListener("mousedown",i,!0)}},[r,i,t])}function Fv(n){const[e,t]=ne();return V(()=>{let r=!0;return n().then(i=>{r&&t({value:i})}),()=>{r=!1}},[n]),e}function ih(){return N(Ya,{type:"spinner","aria-label":ye(Re().t$).LOADING,className:"t-loading-icon"})}const PC="https://cdn.jsdelivr.net/npm/emoji-picker-element@1.26.3/+esm",oh=function(n){let e;return()=>(e===void 0&&(e={value:n()}),e.value)}(async function(){if(typeof window>"u"||window.document===void 0)return new Promise(()=>{});try{const n=await import(PC);return await new n.Database().ready(),n}catch(n){return Bc.error("Failed to load emoji picker:",n),new Promise(()=>{})}});function Uv(n){const{onClose:e,onEmojiSelected:t}=e1(),r=W(null),i=Fv(oh);return V(()=>{if(!i)return;Ie.defined(r.current);const o=r.current,s=o.shadowRoot;(function(u,c){const d=document.createElement("style");d.textContent=c,u.appendChild(d)})(s,".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)}");const a=u=>{const c=u.detail.unicode??u.detail.name;t(c)};function l(u){u.pointerType==="mouse"&&(s.querySelector("section").dataset.hasMouse="true")}return o.addEventListener("emoji-click",a),o.addEventListener("pointermove",l,{once:!0}),()=>{o.removeEventListener("emoji-click",a),o.removeEventListener("pointermove",l)}},[i,t]),V(()=>{i&&r.current&&r.current.shadowRoot.getElementById("search")?.focus()},[i]),vl(()=>e(),".t-emoji-picker"),N("div",i?{className:"t-emoji-picker",children:N("emoji-picker",{ref:r,class:n.colorScheme})}:{className:"t-emoji-picker","t-loading":"",children:N(ih,{})})}function BC(n){const{messageId:e,colorScheme:t,...r}=n,{closePopover:i}=n1(),o=yi();return N("div",{...r,children:N(Fm.Provider,{value:{onClose:i,onEmojiSelected:s=>{o.addReaction(e,s),i()}},children:N(Uv,{colorScheme:t})})})}function sh(){return sh=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},sh.apply(this,arguments)}function Hv(n,e){if(n==null)return{};var t,r,i={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(i[t]=n[t]);return i}function ah(n,e){return ah=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},ah(n,e)}function $v(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,ah(n,e)}function jv(n,e){return n.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const Yv=!1,zv=Ce.createContext(null);var gs="unmounted",Kr="exited",qr="entering",Gi="entered",lh="exiting",Gn=function(n){function e(r,i){var o;o=n.call(this,r,i)||this;var s,a=i&&!i.isMounting?r.enter:r.appear;return o.appearStatus=null,r.in?a?(s=Kr,o.appearStatus=qr):s=Gi:s=r.unmountOnExit||r.mountOnEnter?gs:Kr,o.state={status:s},o.nextCallback=null,o}$v(e,n),e.getDerivedStateFromProps=function(r,i){return r.in&&i.status===gs?{status:Kr}:null};var t=e.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(r){var i=null;if(r!==this.props){var o=this.state.status;this.props.in?o!==qr&&o!==Gi&&(i=qr):o!==qr&&o!==Gi||(i=lh)}this.updateStatus(!1,i)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var r,i,o,s=this.props.timeout;return r=i=o=s,s!=null&&typeof s!="number"&&(r=s.exit,i=s.enter,o=s.appear!==void 0?s.appear:i),{exit:r,enter:i,appear:o}},t.updateStatus=function(r,i){r===void 0&&(r=!1),i!==null?(this.cancelNextCallback(),i===qr?this.performEnter(r):this.performExit()):this.props.unmountOnExit&&this.state.status===Kr&&this.setState({status:gs})},t.performEnter=function(r){var i=this,o=this.props.enter,s=this.context?this.context.isMounting:r,a=this.props.nodeRef?[s]:[Ce.findDOMNode(this),s],l=a[0],u=a[1],c=this.getTimeouts(),d=s?c.appear:c.enter;!r&&!o||Yv?this.safeSetState({status:Gi},function(){i.props.onEntered(l)}):(this.props.onEnter(l,u),this.safeSetState({status:qr},function(){i.props.onEntering(l,u),i.onTransitionEnd(d,function(){i.safeSetState({status:Gi},function(){i.props.onEntered(l,u)})})}))},t.performExit=function(){var r=this,i=this.props.exit,o=this.getTimeouts(),s=this.props.nodeRef?void 0:Ce.findDOMNode(this);i&&!Yv?(this.props.onExit(s),this.safeSetState({status:lh},function(){r.props.onExiting(s),r.onTransitionEnd(o.exit,function(){r.safeSetState({status:Kr},function(){r.props.onExited(s)})})})):this.safeSetState({status:Kr},function(){r.props.onExited(s)})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},t.setNextCallback=function(r){var i=this,o=!0;return this.nextCallback=function(s){o&&(o=!1,i.nextCallback=null,r(s))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(r,i){this.setNextCallback(i);var o=this.props.nodeRef?this.props.nodeRef.current:Ce.findDOMNode(this),s=r==null&&!this.props.addEndListener;if(o&&!s){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],l=a[0],u=a[1];this.props.addEndListener(l,u)}r!=null&&setTimeout(this.nextCallback,r)}else setTimeout(this.nextCallback,0)},t.render=function(){var r=this.state.status;if(r===gs)return null;var i=this.props,o=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var s=Hv(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ce.createElement(zv.Provider,{value:null},typeof o=="function"?o(r,s):Ce.cloneElement(Ce.Children.only(o),s))},e}(Ce.Component);function Xi(){}Gn.contextType=zv,Gn.propTypes={},Gn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Xi,onEntering:Xi,onEntered:Xi,onExit:Xi,onExiting:Xi,onExited:Xi},Gn.UNMOUNTED=gs,Gn.EXITED=Kr,Gn.ENTERING=qr,Gn.ENTERED=Gi,Gn.EXITING=lh;var uh=function(n,e){return n&&e&&e.split(" ").forEach(function(t){return i=t,void((r=n).classList?r.classList.remove(i):typeof r.className=="string"?r.className=jv(r.className,i):r.setAttribute("class",jv(r.className&&r.className.baseVal||"",i)));var r,i})},ch=function(n){function e(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return(r=n.call.apply(n,[this].concat(o))||this).appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1];r.removeClasses(c,"exit"),r.addClass(c,d?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(a,l)},r.onEntering=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1]?"appear":"enter";r.addClass(c,d,"active"),r.props.onEntering&&r.props.onEntering(a,l)},r.onEntered=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1]?"appear":"enter";r.removeClasses(c,d),r.addClass(c,d,"done"),r.props.onEntered&&r.props.onEntered(a,l)},r.onExit=function(a){var l=r.resolveArguments(a)[0];r.removeClasses(l,"appear"),r.removeClasses(l,"enter"),r.addClass(l,"exit","base"),r.props.onExit&&r.props.onExit(a)},r.onExiting=function(a){var l=r.resolveArguments(a)[0];r.addClass(l,"exit","active"),r.props.onExiting&&r.props.onExiting(a)},r.onExited=function(a){var l=r.resolveArguments(a)[0];r.removeClasses(l,"exit"),r.addClass(l,"exit","done"),r.props.onExited&&r.props.onExited(a)},r.resolveArguments=function(a,l){return r.props.nodeRef?[r.props.nodeRef.current,a]:[a,l]},r.getClassNames=function(a){var l=r.props.classNames,u=typeof l=="string",c=u?(u&&l?l+"-":"")+a:l[a];return{baseClassName:c,activeClassName:u?c+"-active":l[a+"Active"],doneClassName:u?c+"-done":l[a+"Done"]}},r}$v(e,n);var t=e.prototype;return t.addClass=function(r,i,o){var s=this.getClassNames(i)[o+"ClassName"],a=this.getClassNames("enter").doneClassName;i==="appear"&&o==="done"&&a&&(s+=" "+a),o==="active"&&r&&r.scrollTop,s&&(this.appliedClasses[i][o]=s,function(l,u){l&&u&&u.split(" ").forEach(function(c){return h=c,void((d=l).classList?d.classList.add(h):function(p,f){return p.classList?!!f&&p.classList.contains(f):(" "+(p.className.baseVal||p.className)+" ").indexOf(" "+f+" ")!==-1}(d,h)||(typeof d.className=="string"?d.className=d.className+" "+h:d.setAttribute("class",(d.className&&d.className.baseVal||"")+" "+h)));var d,h})}(r,s))},t.removeClasses=function(r,i){var o=this.appliedClasses[i],s=o.base,a=o.active,l=o.done;this.appliedClasses[i]={},s&&uh(r,s),a&&uh(r,a),l&&uh(r,l)},t.render=function(){var r=this.props;r.classNames;var i=Hv(r,["classNames"]);return Ce.createElement(Gn,sh({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(Ce.Component);ch.defaultProps={classNames:""},ch.propTypes={};const FC={ltr:["ArrowLeft","ArrowRight"],rtl:["ArrowRight","ArrowLeft"],ttb:["ArrowUp","ArrowDown"]};function Vv(n,{focused:e,setFocused:t,itemCount:r,dir:i,onConfirm:o,onSpace:s}){if(r===0)return!1;const a=c=>{var d,h,p;d=0,h=c,p=r-1,c=Math.max(d,Math.min(h,p)),t(c)},[l,u]=FC[i];switch(n){case l:return a(e-1),!0;case u:return a(e+1),!0;case" ":return!!s&&s();case"Enter":case"Tab":return o(),!0}return!1}function Wv({focused:n,setFocused:e,buttonId:t}){pt(()=>{const s=t(n);s&&document.getElementById(s)?.scrollIntoView({block:"nearest"})},[n,t]);const r=ie(s=>{const a=s.currentTarget.dataset.index;e(+a)},[e]),i=ce(()=>({role:"menu","aria-activedescendant":t(n)}),[n,t]),o=ie(s=>({onMouseMove:r,id:t(s),"data-index":s}),[r,t]);return{containerProps:i,itemProps:o}}function UC({className:n}){const[e,t]=ne([]),[r,i]=ne([]),[o,s]=ne(0),[a,l]=ne(0),u=Fv(oh),c=ce(()=>u&&new u.value.Database({}),[u]),d=Po(),h=ye(d.state$.suggestEmojiQuery);V(()=>{c&&(h?async function(){const v=await c.getPreferredSkinTone();l(v);let A=await c.getEmojiBySearchQuery(h);if(A=A.filter(_=>_.url||function(O){return O.version<=wg&&!$C.includes(O.unicode)}(_)),function(_,O){O.sort((T,S)=>{const b=T.shortcodes?.find(C=>C.startsWith(_)),y=S.shortcodes?.find(C=>C.startsWith(_));return b&&!y?-1:!b&&y?1:b&&y?b.length-y.length:0})}(h.substring(1),A),s(0),t(A),A.length>0&&i(A),h.endsWith(":")){const _=h.slice(1,-1),O=A.find(T=>T.shortcodes?.includes(_));O&&d.selectEmoji(Es(O,v))}}():t([]))},[h,d,c]);const p=ie(v=>{const A=e[v];return A&&"emoji-button-"+Es(A,a)},[e,a]),{containerProps:f,itemProps:m}=Wv({focused:o,setFocused:s,buttonId:p}),g=e.length>0;vl(()=>d.closeSuggester(),"[t-emoji-suggest-bar]",g),V(()=>{if(g)return d.listenKeydown("emoji",v=>Vv(v,{dir:"ltr",focused:o,setFocused:s,itemCount:e.length,onConfirm(){const A=e[o];Ie.defined(A),d.selectEmoji(Es(A,a))}})),()=>{d.listenKeydown("emoji",void 0)};d.listenKeydown("emoji",void 0)},[d,e,o,g,a]);const E=W(null);return N(ch,{in:g,timeout:100,classNames:"slide",mountOnEnter:!0,unmountOnExit:!0,nodeRef:E,children:N("div",{"t-emoji-suggest-bar":"",className:n,ref:E,...f,children:r.map((v,A)=>N(HC,{emoji:v,skinTone:a,focused:A===o,onSelect:_=>d.selectEmoji(_),...m(A)},Es(v,a)))})})}function Es(n,e){return dh(n)?Gv(n,e):n.name}function dh(n){return!!n.unicode}function HC(n){const{emoji:e,focused:t,skinTone:r,onSelect:i,...o}=n,s=(e.shortcodes??[]).join(", "),a=dh(e)?[e.unicode,s].join(", "):s;return N("button",{"t-focused":t?"":void 0,title:s,"aria-label":a,onClick:()=>i(Es(e,r)),...o,children:dh(e)?Gv(e,r):null})}function Gv(n,e){return n.skins?.find(r=>r.tone===e)?.unicode??n.unicode}const $C=["🏻","🏼","🏽","🏾","🏿"];var Xv=function(n){return n.reduce(function(e,t){var r=t[0],i=t[1];return e[r]=i,e},{})},Kv=typeof window<"u"&&window.document&&window.document.createElement?pt:V,Nt="top",Jt="bottom",Zt="right",Ct="left",hh="auto",vs=[Nt,Jt,Zt,Ct],Ki="start",As="end",qv="viewport",_s="popper",Jv=vs.reduce(function(n,e){return n.concat([e+"-"+Ki,e+"-"+As])},[]),Zv=[].concat(vs,[hh]).reduce(function(n,e){return n.concat([e,e+"-"+Ki,e+"-"+As])},[]),jC=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function bn(n){return n?(n.nodeName||"").toLowerCase():null}function jt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Jr(n){return n instanceof jt(n).Element||n instanceof Element}function Qt(n){return n instanceof jt(n).HTMLElement||n instanceof HTMLElement}function ph(n){return typeof ShadowRoot<"u"&&(n instanceof jt(n).ShadowRoot||n instanceof ShadowRoot)}const YC={name:"applyStyles",enabled:!0,phase:"write",fn:function(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];Qt(o)&&bn(o)&&(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})},effect:function(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]).reduce(function(a,l){return a[l]="",a},{});Qt(i)&&bn(i)&&(Object.assign(i.style,s),Object.keys(o).forEach(function(a){i.removeAttribute(a)}))})}},requires:["computeStyles"]};function Nn(n){return n.split("-")[0]}var Zr=Math.max,Al=Math.min,qi=Math.round;function fh(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Qv(){return!/^((?!chrome|android).)*safari/i.test(fh())}function Ji(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),i=1,o=1;e&&Qt(n)&&(i=n.offsetWidth>0&&qi(r.width)/n.offsetWidth||1,o=n.offsetHeight>0&&qi(r.height)/n.offsetHeight||1);var s=(Jr(n)?jt(n):window).visualViewport,a=!Qv()&&t,l=(r.left+(a&&s?s.offsetLeft:0))/i,u=(r.top+(a&&s?s.offsetTop:0))/o,c=r.width/i,d=r.height/o;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l,x:l,y:u}}function mh(n){var e=Ji(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function eA(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&ph(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Xn(n){return jt(n).getComputedStyle(n)}function zC(n){return["table","td","th"].indexOf(bn(n))>=0}function Er(n){return((Jr(n)?n.ownerDocument:n.document)||window.document).documentElement}function _l(n){return bn(n)==="html"?n:n.assignedSlot||n.parentNode||(ph(n)?n.host:null)||Er(n)}function tA(n){return Qt(n)&&Xn(n).position!=="fixed"?n.offsetParent:null}function ys(n){for(var e=jt(n),t=tA(n);t&&zC(t)&&Xn(t).position==="static";)t=tA(t);return t&&(bn(t)==="html"||bn(t)==="body"&&Xn(t).position==="static")?e:t||function(r){var i=/firefox/i.test(fh());if(/Trident/i.test(fh())&&Qt(r)&&Xn(r).position==="fixed")return null;var o=_l(r);for(ph(o)&&(o=o.host);Qt(o)&&["html","body"].indexOf(bn(o))<0;){var s=Xn(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||i&&s.willChange==="filter"||i&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}(n)||e}function gh(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Os(n,e,t){return Zr(n,Al(e,t))}function nA(n){return Object.assign({},{top:0,right:0,bottom:0,left:0},n)}function rA(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}const VC={name:"arrow",enabled:!0,phase:"main",fn:function(n){var e,t=n.state,r=n.name,i=n.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,a=Nn(t.placement),l=gh(a),u=[Ct,Zt].indexOf(a)>=0?"height":"width";if(o&&s){var c=function(b,y){return nA(typeof(b=typeof b=="function"?b(Object.assign({},y.rects,{placement:y.placement})):b)!="number"?b:rA(b,vs))}(i.padding,t),d=mh(o),h=l==="y"?Nt:Ct,p=l==="y"?Jt:Zt,f=t.rects.reference[u]+t.rects.reference[l]-s[l]-t.rects.popper[u],m=s[l]-t.rects.reference[l],g=ys(o),E=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,v=f/2-m/2,A=c[h],_=E-d[u]-c[p],O=E/2-d[u]/2+v,T=Os(A,O,_),S=l;t.modifiersData[r]=((e={})[S]=T,e.centerOffset=T-O,e)}},effect:function(n){var e=n.state,t=n.options.element,r=t===void 0?"[data-popper-arrow]":t;r!=null&&(typeof r!="string"||(r=e.elements.popper.querySelector(r)))&&eA(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Zi(n){return n.split("-")[1]}var WC={top:"auto",right:"auto",bottom:"auto",left:"auto"};function iA(n){var e,t=n.popper,r=n.popperRect,i=n.placement,o=n.variation,s=n.offsets,a=n.position,l=n.gpuAcceleration,u=n.adaptive,c=n.roundOffsets,d=n.isFixed,h=s.x,p=h===void 0?0:h,f=s.y,m=f===void 0?0:f,g=typeof c=="function"?c({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var E=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),A=Ct,_=Nt,O=window;if(u){var T=ys(t),S="clientHeight",b="clientWidth";T===jt(t)&&Xn(T=Er(t)).position!=="static"&&a==="absolute"&&(S="scrollHeight",b="scrollWidth"),(i===Nt||(i===Ct||i===Zt)&&o===As)&&(_=Jt,m-=(d&&T===O&&O.visualViewport?O.visualViewport.height:T[S])-r.height,m*=l?1:-1),(i===Ct||(i===Nt||i===Jt)&&o===As)&&(A=Zt,p-=(d&&T===O&&O.visualViewport?O.visualViewport.width:T[b])-r.width,p*=l?1:-1)}var y,C=Object.assign({position:a},u&&WC),w=c===!0?function(I,F){var L=I.x,j=I.y,D=F.devicePixelRatio||1;return{x:qi(L*D)/D||0,y:qi(j*D)/D||0}}({x:p,y:m},jt(t)):{x:p,y:m};return p=w.x,m=w.y,l?Object.assign({},C,((y={})[_]=v?"0":"",y[A]=E?"0":"",y.transform=(O.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",y)):Object.assign({},C,((e={})[_]=v?m+"px":"",e[A]=E?p+"px":"",e.transform="",e))}const GC={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(n){var e=n.state,t=n.options,r=t.gpuAcceleration,i=r===void 0||r,o=t.adaptive,s=o===void 0||o,a=t.roundOffsets,l=a===void 0||a,u={placement:Nn(e.placement),variation:Zi(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,iA(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,iA(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var yl={passive:!0};const XC={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(n){var e=n.state,t=n.instance,r=n.options,i=r.scroll,o=i===void 0||i,s=r.resize,a=s===void 0||s,l=jt(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",t.update,yl)}),a&&l.addEventListener("resize",t.update,yl),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",t.update,yl)}),a&&l.removeEventListener("resize",t.update,yl)}},data:{}};var KC={left:"right",right:"left",bottom:"top",top:"bottom"};function Ol(n){return n.replace(/left|right|bottom|top/g,function(e){return KC[e]})}var qC={start:"end",end:"start"};function oA(n){return n.replace(/start|end/g,function(e){return qC[e]})}function Eh(n){var e=jt(n);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function vh(n){return Ji(Er(n)).left+Eh(n).scrollLeft}function Ah(n){var e=Xn(n),t=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+r)}function sA(n){return["html","body","#document"].indexOf(bn(n))>=0?n.ownerDocument.body:Qt(n)&&Ah(n)?n:sA(_l(n))}function Ts(n,e){var t;e===void 0&&(e=[]);var r=sA(n),i=r===((t=n.ownerDocument)==null?void 0:t.body),o=jt(r),s=i?[o].concat(o.visualViewport||[],Ah(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(Ts(_l(s)))}function _h(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function aA(n,e,t){return e===qv?_h(function(r,i){var o=jt(r),s=Er(r),a=o.visualViewport,l=s.clientWidth,u=s.clientHeight,c=0,d=0;if(a){l=a.width,u=a.height;var h=Qv();(h||!h&&i==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}return{width:l,height:u,x:c+vh(r),y:d}}(n,t)):Jr(e)?function(r,i){var o=Ji(r,!1,i==="fixed");return o.top=o.top+r.clientTop,o.left=o.left+r.clientLeft,o.bottom=o.top+r.clientHeight,o.right=o.left+r.clientWidth,o.width=r.clientWidth,o.height=r.clientHeight,o.x=o.left,o.y=o.top,o}(e,t):_h(function(r){var i,o=Er(r),s=Eh(r),a=(i=r.ownerDocument)==null?void 0:i.body,l=Zr(o.scrollWidth,o.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),u=Zr(o.scrollHeight,o.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),c=-s.scrollLeft+vh(r),d=-s.scrollTop;return Xn(a||o).direction==="rtl"&&(c+=Zr(o.clientWidth,a?a.clientWidth:0)-l),{width:l,height:u,x:c,y:d}}(Er(n)))}function JC(n,e,t,r){var i=e==="clippingParents"?function(l){var u=Ts(_l(l)),c=["absolute","fixed"].indexOf(Xn(l).position)>=0&&Qt(l)?ys(l):l;return Jr(c)?u.filter(function(d){return Jr(d)&&eA(d,c)&&bn(d)!=="body"}):[]}(n):[].concat(e),o=[].concat(i,[t]),s=o[0],a=o.reduce(function(l,u){var c=aA(n,u,r);return l.top=Zr(c.top,l.top),l.right=Al(c.right,l.right),l.bottom=Al(c.bottom,l.bottom),l.left=Zr(c.left,l.left),l},aA(n,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function lA(n){var e,t=n.reference,r=n.element,i=n.placement,o=i?Nn(i):null,s=i?Zi(i):null,a=t.x+t.width/2-r.width/2,l=t.y+t.height/2-r.height/2;switch(o){case Nt:e={x:a,y:t.y-r.height};break;case Jt:e={x:a,y:t.y+t.height};break;case Zt:e={x:t.x+t.width,y:l};break;case Ct:e={x:t.x-r.width,y:l};break;default:e={x:t.x,y:t.y}}var u=o?gh(o):null;if(u!=null){var c=u==="y"?"height":"width";switch(s){case Ki:e[u]=e[u]-(t[c]/2-r[c]/2);break;case As:e[u]=e[u]+(t[c]/2-r[c]/2)}}return e}function Ss(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=r===void 0?n.placement:r,o=t.strategy,s=o===void 0?n.strategy:o,a=t.boundary,l=a===void 0?"clippingParents":a,u=t.rootBoundary,c=u===void 0?qv:u,d=t.elementContext,h=d===void 0?_s:d,p=t.altBoundary,f=p!==void 0&&p,m=t.padding,g=m===void 0?0:m,E=nA(typeof g!="number"?g:rA(g,vs)),v=h===_s?"reference":_s,A=n.rects.popper,_=n.elements[f?v:h],O=JC(Jr(_)?_:_.contextElement||Er(n.elements.popper),l,c,s),T=Ji(n.elements.reference),S=lA({reference:T,element:A,strategy:"absolute",placement:i}),b=_h(Object.assign({},A,S)),y=h===_s?b:T,C={top:O.top-y.top+E.top,bottom:y.bottom-O.bottom+E.bottom,left:O.left-y.left+E.left,right:y.right-O.right+E.right},w=n.modifiersData.offset;if(h===_s&&w){var I=w[i];Object.keys(C).forEach(function(F){var L=[Zt,Jt].indexOf(F)>=0?1:-1,j=[Nt,Jt].indexOf(F)>=0?"y":"x";C[F]+=I[j]*L})}return C}function ZC(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=t.boundary,o=t.rootBoundary,s=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,u=l===void 0?Zv:l,c=Zi(r),d=c?a?Jv:Jv.filter(function(f){return Zi(f)===c}):vs,h=d.filter(function(f){return u.indexOf(f)>=0});h.length===0&&(h=d);var p=h.reduce(function(f,m){return f[m]=Ss(n,{placement:m,boundary:i,rootBoundary:o,padding:s})[Nn(m)],f},{});return Object.keys(p).sort(function(f,m){return p[f]-p[m]})}const QC={name:"flip",enabled:!0,phase:"main",fn:function(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var i=t.mainAxis,o=i===void 0||i,s=t.altAxis,a=s===void 0||s,l=t.fallbackPlacements,u=t.padding,c=t.boundary,d=t.rootBoundary,h=t.altBoundary,p=t.flipVariations,f=p===void 0||p,m=t.allowedAutoPlacements,g=e.options.placement,E=Nn(g),v=l||(E===g||!f?[Ol(g)]:function(Y){if(Nn(Y)===hh)return[];var J=Ol(Y);return[oA(Y),J,oA(J)]}(g)),A=[g].concat(v).reduce(function(Y,J){return Y.concat(Nn(J)===hh?ZC(e,{placement:J,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:m}):J)},[]),_=e.rects.reference,O=e.rects.popper,T=new Map,S=!0,b=A[0],y=0;y<A.length;y++){var C=A[y],w=Nn(C),I=Zi(C)===Ki,F=[Nt,Jt].indexOf(w)>=0,L=F?"width":"height",j=Ss(e,{placement:C,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),D=F?I?Zt:Ct:I?Jt:Nt;_[L]>O[L]&&(D=Ol(D));var B=Ol(D),H=[];if(o&&H.push(j[w]<=0),a&&H.push(j[D]<=0,j[B]<=0),H.every(function(Y){return Y})){b=C,S=!1;break}T.set(C,H)}if(S)for(var x=function(Y){var J=A.find(function(se){var k=T.get(se);if(k)return k.slice(0,Y).every(function(Z){return Z})});if(J)return b=J,"break"},Q=f?3:1;Q>0&&x(Q)!=="break";Q--);e.placement!==b&&(e.modifiersData[r]._skip=!0,e.placement=b,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function uA(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function cA(n){return[Nt,Zt,Jt,Ct].some(function(e){return n[e]>=0})}const eI={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(n){var e=n.state,t=n.options,r=n.name,i=t.offset,o=i===void 0?[0,0]:i,s=Zv.reduce(function(c,d){return c[d]=function(h,p,f){var m=Nn(h),g=[Ct,Nt].indexOf(m)>=0?-1:1,E=typeof f=="function"?f(Object.assign({},p,{placement:h})):f,v=E[0],A=E[1];return v=v||0,A=(A||0)*g,[Ct,Zt].indexOf(m)>=0?{x:A,y:v}:{x:v,y:A}}(d,e.rects,o),c},{}),a=s[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=s}},tI={name:"preventOverflow",enabled:!0,phase:"main",fn:function(n){var e=n.state,t=n.options,r=n.name,i=t.mainAxis,o=i===void 0||i,s=t.altAxis,a=s!==void 0&&s,l=t.boundary,u=t.rootBoundary,c=t.altBoundary,d=t.padding,h=t.tether,p=h===void 0||h,f=t.tetherOffset,m=f===void 0?0:f,g=Ss(e,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),E=Nn(e.placement),v=Zi(e.placement),A=!v,_=gh(E),O=_==="x"?"y":"x",T=e.modifiersData.popperOffsets,S=e.rects.reference,b=e.rects.popper,y=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,C=typeof y=="number"?{mainAxis:y,altAxis:y}:Object.assign({mainAxis:0,altAxis:0},y),w=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,I={x:0,y:0};if(T){if(o){var F,L=_==="y"?Nt:Ct,j=_==="y"?Jt:Zt,D=_==="y"?"height":"width",B=T[_],H=B+g[L],x=B-g[j],Q=p?-b[D]/2:0,Y=v===Ki?S[D]:b[D],J=v===Ki?-b[D]:-S[D],se=e.elements.arrow,k=p&&se?mh(se):{width:0,height:0},Z=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},te=Z[L],oe=Z[j],U=Os(0,S[D],k[D]),de=A?S[D]/2-Q-U-te-C.mainAxis:Y-U-te-C.mainAxis,fe=A?-S[D]/2+Q+U+oe+C.mainAxis:J+U+oe+C.mainAxis,Ne=e.elements.arrow&&ys(e.elements.arrow),ge=Ne?_==="y"?Ne.clientTop||0:Ne.clientLeft||0:0,he=(F=w?.[_])!=null?F:0,et=B+fe-he,rn=Os(p?Al(H,B+de-he-ge):H,B,p?Zr(x,et):x);T[_]=rn,I[_]=rn-B}if(a){var Vt,zs=_==="x"?Nt:Ct,go=_==="x"?Jt:Zt,gn=T[O],Eo=O==="y"?"height":"width",ui=gn+g[zs],Vs=gn-g[go],Ws=[Nt,Ct].indexOf(E)!==-1,vu=(Vt=w?.[O])!=null?Vt:0,Gs=Ws?ui:gn-S[Eo]-b[Eo]-vu+C.altAxis,Au=Ws?gn+S[Eo]+b[Eo]-vu-C.altAxis:Vs,_u=p&&Ws?function(vo,Xs,Ao){var Ks=Os(vo,Xs,Ao);return Ks>Ao?Ao:Ks}(Gs,gn,Au):Os(p?Gs:ui,gn,p?Au:Vs);T[O]=_u,I[O]=_u-gn}e.modifiersData[r]=I}},requiresIfExists:["offset"]};function nI(n,e,t){t===void 0&&(t=!1);var r,i,o=Qt(e),s=Qt(e)&&function(d){var h=d.getBoundingClientRect(),p=qi(h.width)/d.offsetWidth||1,f=qi(h.height)/d.offsetHeight||1;return p!==1||f!==1}(e),a=Er(e),l=Ji(n,s,t),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!t)&&((bn(e)!=="body"||Ah(a))&&(u=(r=e)!==jt(r)&&Qt(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:Eh(r)),Qt(e)?((c=Ji(e,!0)).x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=vh(a))),{x:l.left+u.scrollLeft-c.x,y:l.top+u.scrollTop-c.y,width:l.width,height:l.height}}function rI(n){var e=new Map,t=new Set,r=[];function i(o){t.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach(function(s){if(!t.has(s)){var a=e.get(s);a&&i(a)}}),r.push(o)}return n.forEach(function(o){e.set(o.name,o)}),n.forEach(function(o){t.has(o.name)||i(o)}),r}function iI(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}var dA={placement:"bottom",modifiers:[],strategy:"absolute"};function hA(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function oI(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,r=t===void 0?[]:t,i=e.defaultOptions,o=i===void 0?dA:i;return function(s,a,l){l===void 0&&(l=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},dA,o),modifiersData:{},elements:{reference:s,popper:a},attributes:{},styles:{}},c=[],d=!1,h={state:u,setOptions:function(f){var m=typeof f=="function"?f(u.options):f;p(),u.options=Object.assign({},o,u.options,m),u.scrollParents={reference:Jr(s)?Ts(s):s.contextElement?Ts(s.contextElement):[],popper:Ts(a)};var g=function(E){var v=rI(E);return jC.reduce(function(A,_){return A.concat(v.filter(function(O){return O.phase===_}))},[])}(function(E){var v=E.reduce(function(A,_){var O=A[_.name];return A[_.name]=O?Object.assign({},O,_,{options:Object.assign({},O.options,_.options),data:Object.assign({},O.data,_.data)}):_,A},{});return Object.keys(v).map(function(A){return v[A]})}([].concat(r,u.options.modifiers)));return u.orderedModifiers=g.filter(function(E){return E.enabled}),u.orderedModifiers.forEach(function(E){var v=E.name,A=E.options,_=A===void 0?{}:A,O=E.effect;if(typeof O=="function"){var T=O({state:u,name:v,instance:h,options:_}),S=function(){};c.push(T||S)}}),h.update()},forceUpdate:function(){if(!d){var f=u.elements,m=f.reference,g=f.popper;if(hA(m,g)){u.rects={reference:nI(m,ys(g),u.options.strategy==="fixed"),popper:mh(g)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(S){return u.modifiersData[S.name]=Object.assign({},S.data)});for(var E=0;E<u.orderedModifiers.length;E++)if(u.reset!==!0){var v=u.orderedModifiers[E],A=v.fn,_=v.options,O=_===void 0?{}:_,T=v.name;typeof A=="function"&&(u=A({state:u,options:O,name:T,instance:h})||u)}else u.reset=!1,E=-1}}},update:iI(function(){return new Promise(function(f){h.forceUpdate(),f(u)})}),destroy:function(){p(),d=!0}};if(!hA(s,a))return h;function p(){c.forEach(function(f){return f()}),c=[]}return h.setOptions(l).then(function(f){!d&&l.onFirstUpdate&&l.onFirstUpdate(f)}),h}}var sI=oI({defaultModifiers:[XC,{name:"popperOffsets",enabled:!0,phase:"read",fn:function(n){var e=n.state,t=n.name;e.modifiersData[t]=lA({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},GC,YC,eI,QC,tI,VC,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(n){var e=n.state,t=n.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=Ss(e,{elementContext:"reference"}),a=Ss(e,{altBoundary:!0}),l=uA(s,r),u=uA(a,i,o),c=cA(l),d=cA(u);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]}),aI=typeof Element<"u",lI=typeof Map=="function",uI=typeof Set=="function",cI=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Tl(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;var t,r,i,o;if(Array.isArray(n)){if((t=n.length)!=e.length)return!1;for(r=t;r--!=0;)if(!Tl(n[r],e[r]))return!1;return!0}if(lI&&n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(o=n.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;for(o=n.entries();!(r=o.next()).done;)if(!Tl(r.value[1],e.get(r.value[0])))return!1;return!0}if(uI&&n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(o=n.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(cI&&ArrayBuffer.isView(n)&&ArrayBuffer.isView(e)){if((t=n.length)!=e.length)return!1;for(r=t;r--!=0;)if(n[r]!==e[r])return!1;return!0}if(n.constructor===RegExp)return n.source===e.source&&n.flags===e.flags;if(n.valueOf!==Object.prototype.valueOf&&typeof n.valueOf=="function"&&typeof e.valueOf=="function")return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString&&typeof n.toString=="function"&&typeof e.toString=="function")return n.toString()===e.toString();if((t=(i=Object.keys(n)).length)!==Object.keys(e).length)return!1;for(r=t;r--!=0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(aI&&n instanceof Element)return!1;for(r=t;r--!=0;)if((i[r]!=="_owner"&&i[r]!=="__v"&&i[r]!=="__o"||!n.$$typeof)&&!Tl(n[i[r]],e[i[r]]))return!1;return!0}return n!=n&&e!=e}var dI=function(n,e){try{return Tl(n,e)}catch(t){if((t.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw t}};const hI=ha(dI);var pI=[];function fI(n){const{anchorSelector:e,children:t,...r}=n,i=ce(()=>document.querySelector(e),[e]),[o,s]=ne(null),{styles:a,attributes:l}=function(u,c,d){d===void 0&&(d={});var h=W(null),p={onFirstUpdate:d.onFirstUpdate,placement:d.placement||"bottom",strategy:d.strategy||"absolute",modifiers:d.modifiers||pI},f=ne({styles:{popper:{position:p.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),m=f[0],g=f[1],E=ce(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(_){var O=_.state,T=Object.keys(O.elements);Do(function(){g({styles:Xv(T.map(function(S){return[S,O.styles[S]||{}]})),attributes:Xv(T.map(function(S){return[S,O.attributes[S]]}))})})},requires:["computeStyles"]}},[]),v=ce(function(){var _={onFirstUpdate:p.onFirstUpdate,placement:p.placement,strategy:p.strategy,modifiers:[].concat(p.modifiers,[E,{name:"applyStyles",enabled:!1}])};return hI(h.current,_)?h.current||_:(h.current=_,_)},[p.onFirstUpdate,p.placement,p.strategy,p.modifiers,E]),A=W();return Kv(function(){A.current&&A.current.setOptions(v)},[v]),Kv(function(){if(u!=null&&c!=null){var _=(d.createPopper||sI)(u,c,v);return A.current=_,function(){_.destroy(),A.current=null}}},[u,c,d.createPopper]),{state:A.current?A.current.state:null,styles:m.styles,attributes:m.attributes,update:A.current?A.current.update:null,forceUpdate:A.current?A.current.forceUpdate:null}}(i,o,{modifiers:[],placement:"top-start"});return N("div",{ref:s,style:{...a.popper,zIndex:1e3},...l.popper,...r,children:n.children})}function mI(n){const{className:e}=n,t=Re(),r=ye(()=>t.mentionableUsers$.get()),[i,o]=ne(0),s=Po(),a=ye(s.state$.suggestMentionQuery),l=ce(()=>Object.fromEntries(r.map(f=>[f.id,eS(f.name)])),[r]),u=ce(()=>{if(!a)return[];const f=pA(a);return f===""?r:r.filter(m=>l[m.id].some(g=>function(E,v){return Qf(E.substring(0,v.length),v)}(g,f)))},[a,r,l]),c=W(void 0);V(()=>{if(c.current){const f=u.findIndex(m=>m.id===c.current);o(f===-1?0:f)}},[u]),V(()=>{c.current=u[i]?.id},[i,u]);const d=ie(f=>{const m=u[f]?.id;return m&&"mention-button-"+m},[u]),{containerProps:h,itemProps:p}=Wv({focused:i,setFocused:o,buttonId:d});return V(()=>{if(u.length!==0)return s.listenKeydown("mention",f=>Vv(f,{dir:"ttb",focused:i,setFocused:o,itemCount:u.length,onSpace(){if(a){const m=u[i];if(Qf(m.name,pA(a)))return s.selectMention(m),!0}return!1},onConfirm(){const m=u[i];s.selectMention(m)}})),()=>{s.listenKeydown("mention",void 0)}},[s,i,u,a]),vl(()=>s.closeSuggester(),"[t-mention-suggest-list]",u.length>0),u.length===0?null:N(fI,{className:e,"t-mention-suggest-list":"",...h,anchorSelector:".ProseMirror-suggestion",children:u.map((f,m)=>N(gI,{user:f,isFocused:m===i,onSelect:()=>s.selectMention(f),...p(m)},f.id))})}const gI=Ce.memo(function(n){const{user:e,isFocused:t,onSelect:r,...i}=n;return N("button",{className:t?"focused":"",onClick:()=>r(e.id),...i,children:e.name})});function pA(n){return Ie(n[0]==="@"),n.substring(1)}function bs(n,e,{checkForDefaultPrevented:t=!0}={}){return function(r){if(n?.(r),t===!1||!r.defaultPrevented)return e?.(r)}}function fA(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function Sl(...n){return e=>{let t=!1;const r=n.map(i=>{const o=fA(i,e);return t||typeof o!="function"||(t=!0),o});if(t)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():fA(n[i],null)}}}}function $e(...n){return ie(Sl(...n),n)}function Qr(n,e=[]){let t=[];const r=()=>{const i=t.map(o=>kt(o));return function(o){const s=o?.[n]||i;return ce(()=>({[`__scope${n}`]:{...o,[n]:s}}),[o,s])}};return r.scopeName=n,[function(i,o){const s=kt(o),a=t.length;t=[...t,o];const l=u=>{const{scope:c,children:d,...h}=u,p=c?.[n]?.[a]||s,f=ce(()=>h,Object.values(h));return N(p.Provider,{value:f,children:d})};return l.displayName=i+"Provider",[l,function(u,c){const d=qe(c?.[n]?.[a]||s);if(d)return d;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}]},EI(r,...e)]}function EI(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(i){const o=r.reduce((s,{useScope:a,scopeName:l})=>({...s,...a(i)[`__scope${l}`]}),{});return ce(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function yh(n,e,{checkForDefaultPrevented:t=!0}={}){return function(r){if(n?.(r),t===!1||!r.defaultPrevented)return e?.(r)}}function Ns(n){const e=vI(n),t=ee((r,i)=>{const{children:o,...s}=r,a=vn.toArray(o),l=a.find(_I);if(l){const u=l.props.children,c=a.map(d=>d===l?vn.count(u)>1?vn.only(null):Bn(u)?u.props.children:null:d);return N(e,{...s,ref:i,children:Bn(u)?Nr(u,void 0,c):null})}return N(e,{...s,ref:i,children:o})});return t.displayName=`${n}.Slot`,t}function vI(n){const e=ee((t,r)=>{const{children:i,...o}=t;if(Bn(i)){const s=function(l){let u=Object.getOwnPropertyDescriptor(l.props,"ref")?.get,c=u&&"isReactWarning"in u&&u.isReactWarning;return c?l.ref:(u=Object.getOwnPropertyDescriptor(l,"ref")?.get,c=u&&"isReactWarning"in u&&u.isReactWarning,c?l.props.ref:l.props.ref||l.ref)}(i),a=function(l,u){const c={...u};for(const d in u){const h=l[d],p=u[d];/^on[A-Z]/.test(d)?h&&p?c[d]=(...f)=>{const m=p(...f);return h(...f),m}:h&&(c[d]=h):d==="style"?c[d]={...h,...p}:d==="className"&&(c[d]=[h,p].filter(Boolean).join(" "))}return{...l,...c}}(o,i.props);return i.type!==xe&&(a.ref=r?Sl(r,s):s),Nr(i,a)}return vn.count(i)>1?vn.only(null):null});return e.displayName=`${n}.SlotClone`,e}var AI=Symbol("radix.slottable");function _I(n){return Bn(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===AI}var Ke=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((n,e)=>{const t=Ns(`Primitive.${e}`),r=ee((i,o)=>{const{asChild:s,...a}=i,l=s?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),N(l,{...a,ref:o})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function Oh(n,e){n&&Do(()=>n.dispatchEvent(e))}function en(n){const e=W(n);return V(()=>{e.current=n}),ce(()=>(...t)=>e.current?.(...t),[])}function mA(n,e=globalThis?.document){const t=en(n);V(()=>{const r=i=>{i.key==="Escape"&&t(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[t,e])}var gA,Th="dismissableLayer.update",yI="dismissableLayer.pointerDownOutside",OI="dismissableLayer.focusOutside",EA=kt({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vA=ee((n,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=n,u=qe(EA),[c,d]=ne(null),h=c?.ownerDocument??globalThis?.document,[,p]=ne({}),f=$e(e,S=>d(S)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),E=m.indexOf(g),v=c?m.indexOf(c):-1,A=u.layersWithOutsidePointerEventsDisabled.size>0,_=v>=E,O=function(S,b=globalThis?.document){const y=en(S),C=W(!1),w=W(()=>{});return V(()=>{const I=L=>{if(L.target&&!C.current){let j=function(){_A(yI,y,D,{discrete:!0})};const D={originalEvent:L};L.pointerType==="touch"?(b.removeEventListener("click",w.current),w.current=j,b.addEventListener("click",w.current,{once:!0})):j()}else b.removeEventListener("click",w.current);C.current=!1},F=window.setTimeout(()=>{b.addEventListener("pointerdown",I)},0);return()=>{window.clearTimeout(F),b.removeEventListener("pointerdown",I),b.removeEventListener("click",w.current)}},[b,y]),{onPointerDownCapture:()=>C.current=!0}}(S=>{const b=S.target,y=[...u.branches].some(C=>C.contains(b));_&&!y&&(i?.(S),s?.(S),S.defaultPrevented||a?.())},h),T=function(S,b=globalThis?.document){const y=en(S),C=W(!1);return V(()=>{const w=I=>{I.target&&!C.current&&_A(OI,y,{originalEvent:I},{discrete:!1})};return b.addEventListener("focusin",w),()=>b.removeEventListener("focusin",w)},[b,y]),{onFocusCapture:()=>C.current=!0,onBlurCapture:()=>C.current=!1}}(S=>{const b=S.target;[...u.branches].some(y=>y.contains(b))||(o?.(S),s?.(S),S.defaultPrevented||a?.())},h);return mA(S=>{v===u.layers.size-1&&(r?.(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},h),V(()=>{if(c)return t&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(gA=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),AA(),()=>{t&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=gA)}},[c,h,t,u]),V(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),AA())},[c,u]),V(()=>{const S=()=>p({});return document.addEventListener(Th,S),()=>document.removeEventListener(Th,S)},[]),N(Ke.div,{...l,ref:f,style:{pointerEvents:A?_?"auto":"none":void 0,...n.style},onFocusCapture:yh(n.onFocusCapture,T.onFocusCapture),onBlurCapture:yh(n.onBlurCapture,T.onBlurCapture),onPointerDownCapture:yh(n.onPointerDownCapture,O.onPointerDownCapture)})});vA.displayName="DismissableLayer";var TI=ee((n,e)=>{const t=qe(EA),r=W(null),i=$e(e,r);return V(()=>{const o=r.current;if(o)return t.branches.add(o),()=>{t.branches.delete(o)}},[t.branches]),N(Ke.div,{...n,ref:i})});function AA(){const n=new CustomEvent(Th);document.dispatchEvent(n)}function _A(n,e,t,{discrete:r}){const i=t.originalEvent.target,o=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?Oh(i,o):i.dispatchEvent(o)}TI.displayName="DismissableLayerBranch";var Sh=0;function yA(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var bh="focusScope.autoFocusOnMount",Nh="focusScope.autoFocusOnUnmount",OA={bubbles:!1,cancelable:!0},Ch=ee((n,e)=>{const{loop:t=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=n,[a,l]=ne(null),u=en(i),c=en(o),d=W(null),h=$e(e,m=>l(m)),p=W({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;V(()=>{if(r){let m=function(A){if(p.paused||!a)return;const _=A.target;a.contains(_)?d.current=_:vr(d.current,{select:!0})},g=function(A){if(p.paused||!a)return;const _=A.relatedTarget;_!==null&&(a.contains(_)||vr(d.current,{select:!0}))},E=function(A){if(document.activeElement===document.body)for(const _ of A)_.removedNodes.length>0&&vr(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const v=new MutationObserver(E);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),v.disconnect()}}},[r,a,p.paused]),V(()=>{if(a){bA.add(p);const g=document.activeElement;if(!a.contains(g)){const E=new CustomEvent(bh,OA);a.addEventListener(bh,u),a.dispatchEvent(E),E.defaultPrevented||(function(v,{select:A=!1}={}){const _=document.activeElement;for(const O of v)if(vr(O,{select:A}),document.activeElement!==_)return}((m=TA(a),m.filter(v=>v.tagName!=="A")),{select:!0}),document.activeElement===g&&vr(a))}return()=>{a.removeEventListener(bh,u),setTimeout(()=>{const E=new CustomEvent(Nh,OA);a.addEventListener(Nh,c),a.dispatchEvent(E),E.defaultPrevented||vr(g??document.body,{select:!0}),a.removeEventListener(Nh,c),bA.remove(p)},0)}}var m},[a,u,c,p]);const f=ie(m=>{if(!t&&!r||p.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,E=document.activeElement;if(g&&E){const v=m.currentTarget,[A,_]=function(O){const T=TA(O),S=SA(T,O),b=SA(T.reverse(),O);return[S,b]}(v);A&&_?m.shiftKey||E!==_?m.shiftKey&&E===A&&(m.preventDefault(),t&&vr(_,{select:!0})):(m.preventDefault(),t&&vr(A,{select:!0})):E===v&&m.preventDefault()}},[t,r,p.paused]);return N(Ke.div,{tabIndex:-1,...s,ref:h,onKeyDown:f})});function TA(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function SA(n,e){for(const t of n)if(!SI(t,{upTo:e}))return t}function SI(n,{upTo:e}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e!==void 0&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function vr(n,{select:e=!1}={}){if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),n!==t&&function(r){return r instanceof HTMLInputElement&&"select"in r}(n)&&e&&n.select()}}Ch.displayName="FocusScope";var bA=function(){let n=[];return{add(e){const t=n[0];e!==t&&t?.pause(),n=NA(n,e),n.unshift(e)},remove(e){n=NA(n,e),n[0]?.resume()}}}();function NA(n,e){const t=[...n],r=t.indexOf(e);return r!==-1&&t.splice(r,1),t}var hn=globalThis?.document?pt:()=>{},bI=Ju[" useId ".trim().toString()]||(()=>{}),NI=0;function bl(n){const[e,t]=ne(bI());return hn(()=>{n||t(r=>r??String(NI++))},[n]),n||(e?`radix-${e}`:"")}const CI=["top","right","bottom","left"],Ar=Math.min,Yt=Math.max,Nl=Math.round,Cl=Math.floor,Cn=n=>({x:n,y:n}),II={left:"right",right:"left",bottom:"top",top:"bottom"},wI={start:"end",end:"start"};function Ih(n,e,t){return Yt(n,Ar(e,t))}function Kn(n,e){return typeof n=="function"?n(e):n}function qn(n){return n.split("-")[0]}function Qi(n){return n.split("-")[1]}function wh(n){return n==="x"?"y":"x"}function Rh(n){return n==="y"?"height":"width"}function In(n){return["top","bottom"].includes(qn(n))?"y":"x"}function Dh(n){return wh(In(n))}function kh(n){return n.replace(/start|end/g,e=>wI[e])}function Il(n){return n.replace(/left|right|bottom|top/g,e=>II[e])}function CA(n){return typeof n!="number"?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(n):{top:n,right:n,bottom:n,left:n}}function wl(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function IA(n,e,t){let{reference:r,floating:i}=n;const o=In(e),s=Dh(e),a=Rh(s),l=qn(e),u=o==="y",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(l){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(Qi(e)){case"start":p[s]-=h*(t&&u?-1:1);break;case"end":p[s]+=h*(t&&u?-1:1)}return p}async function Cs(n,e){var t;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=Kn(e,n),f=CA(p),m=a[h?d==="floating"?"reference":"floating":d],g=wl(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(m)))==null||t?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),E=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(v))&&await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1},_=wl(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:v,strategy:l}):E);return{top:(g.top-_.top+f.top)/A.y,bottom:(_.bottom-g.bottom+f.bottom)/A.y,left:(g.left-_.left+f.left)/A.x,right:(_.right-g.right+f.right)/A.x}}function wA(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function RA(n){return CI.some(e=>n[e]>=0)}function Rl(){return typeof window<"u"}function eo(n){return DA(n)?(n.nodeName||"").toLowerCase():"#document"}function zt(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function wn(n){var e;return(e=(DA(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function DA(n){return!!Rl()&&(n instanceof Node||n instanceof zt(n).Node)}function pn(n){return!!Rl()&&(n instanceof Element||n instanceof zt(n).Element)}function Rn(n){return!!Rl()&&(n instanceof HTMLElement||n instanceof zt(n).HTMLElement)}function kA(n){return!(!Rl()||typeof ShadowRoot>"u")&&(n instanceof ShadowRoot||n instanceof zt(n).ShadowRoot)}function Is(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=fn(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!["inline","contents"].includes(i)}function RI(n){return["table","td","th"].includes(eo(n))}function Dl(n){return[":popover-open",":modal"].some(e=>{try{return n.matches(e)}catch{return!1}})}function Lh(n){const e=xh(),t=pn(n)?fn(n):n;return["transform","translate","scale","rotate","perspective"].some(r=>!!t[r]&&t[r]!=="none")||!!t.containerType&&t.containerType!=="normal"||!e&&!!t.backdropFilter&&t.backdropFilter!=="none"||!e&&!!t.filter&&t.filter!=="none"||["transform","translate","scale","rotate","perspective","filter"].some(r=>(t.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(t.contain||"").includes(r))}function xh(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function to(n){return["html","body","#document"].includes(eo(n))}function fn(n){return zt(n).getComputedStyle(n)}function kl(n){return pn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function _r(n){if(eo(n)==="html")return n;const e=n.assignedSlot||n.parentNode||kA(n)&&n.host||wn(n);return kA(e)?e.host:e}function LA(n){const e=_r(n);return to(e)?n.ownerDocument?n.ownerDocument.body:n.body:Rn(e)&&Is(e)?e:LA(e)}function ws(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=LA(n),o=i===((r=n.ownerDocument)==null?void 0:r.body),s=zt(i);if(o){const a=Mh(s);return e.concat(s,s.visualViewport||[],Is(i)?i:[],a&&t?ws(a):[])}return e.concat(i,ws(i,[],t))}function Mh(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function xA(n){const e=fn(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Rn(n),o=i?n.offsetWidth:t,s=i?n.offsetHeight:r,a=Nl(t)!==o||Nl(r)!==s;return a&&(t=o,r=s),{width:t,height:r,$:a}}function Ph(n){return pn(n)?n:n.contextElement}function no(n){const e=Ph(n);if(!Rn(e))return Cn(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:o}=xA(e);let s=(o?Nl(t.width):t.width)/r,a=(o?Nl(t.height):t.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const DI=Cn(0);function MA(n){const e=zt(n);return xh()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:DI}function ei(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),o=Ph(n);let s=Cn(1);e&&(r?pn(r)&&(s=no(r)):s=no(n));const a=function(h,p,f){return p===void 0&&(p=!1),!(!f||p&&f!==zt(h))&&p}(o,t,r)?MA(o):Cn(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const h=zt(o),p=r&&pn(r)?zt(r):r;let f=h,m=Mh(f);for(;m&&r&&p!==f;){const g=no(m),E=m.getBoundingClientRect(),v=fn(m),A=E.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,_=E.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,d*=g.y,l+=A,u+=_,f=zt(m),m=Mh(f)}}return wl({width:c,height:d,x:l,y:u})}function Bh(n,e){const t=kl(n).scrollLeft;return e?e.left+t:ei(wn(n)).left+t}function PA(n,e,t){t===void 0&&(t=!1);const r=n.getBoundingClientRect();return{x:r.left+e.scrollLeft-(t?0:Bh(n,r)),y:r.top+e.scrollTop}}function BA(n,e,t){let r;if(e==="viewport")r=function(i,o){const s=zt(i),a=wn(i),l=s.visualViewport;let u=a.clientWidth,c=a.clientHeight,d=0,h=0;if(l){u=l.width,c=l.height;const p=xh();(!p||p&&o==="fixed")&&(d=l.offsetLeft,h=l.offsetTop)}return{width:u,height:c,x:d,y:h}}(n,t);else if(e==="document")r=function(i){const o=wn(i),s=kl(i),a=i.ownerDocument.body,l=Yt(o.scrollWidth,o.clientWidth,a.scrollWidth,a.clientWidth),u=Yt(o.scrollHeight,o.clientHeight,a.scrollHeight,a.clientHeight);let c=-s.scrollLeft+Bh(i);const d=-s.scrollTop;return fn(a).direction==="rtl"&&(c+=Yt(o.clientWidth,a.clientWidth)-l),{width:l,height:u,x:c,y:d}}(wn(n));else if(pn(e))r=function(i,o){const s=ei(i,!0,o==="fixed"),a=s.top+i.clientTop,l=s.left+i.clientLeft,u=Rn(i)?no(i):Cn(1);return{width:i.clientWidth*u.x,height:i.clientHeight*u.y,x:l*u.x,y:a*u.y}}(e,t);else{const i=MA(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return wl(r)}function FA(n,e){const t=_r(n);return!(t===e||!pn(t)||to(t))&&(fn(t).position==="fixed"||FA(t,e))}function kI(n,e,t){const r=Rn(e),i=wn(e),o=t==="fixed",s=ei(n,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Cn(0);function u(){l.x=Bh(i)}if(r||!r&&!o)if((eo(e)!=="body"||Is(i))&&(a=kl(e)),r){const d=ei(e,!0,o,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else i&&u();o&&!r&&i&&u();const c=!i||r||o?Cn(0):PA(i,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function Fh(n){return fn(n).position==="static"}function UA(n,e){if(!Rn(n)||fn(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return wn(n)===t&&(t=t.ownerDocument.body),t}function HA(n,e){const t=zt(n);if(Dl(n))return t;if(!Rn(n)){let i=_r(n);for(;i&&!to(i);){if(pn(i)&&!Fh(i))return i;i=_r(i)}return t}let r=UA(n,e);for(;r&&RI(r)&&Fh(r);)r=UA(r,e);return r&&to(r)&&Fh(r)&&!Lh(r)?t:r||function(i){let o=_r(i);for(;Rn(o)&&!to(o);){if(Lh(o))return o;if(Dl(o))return null;o=_r(o)}return null}(n)||t}const LI={convertOffsetParentRelativeRectToViewportRelativeRect:function(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const o=i==="fixed",s=wn(r),a=!!e&&Dl(e.floating);if(r===s||a&&o)return t;let l={scrollLeft:0,scrollTop:0},u=Cn(1);const c=Cn(0),d=Rn(r);if((d||!d&&!o)&&((eo(r)!=="body"||Is(s))&&(l=kl(r)),Rn(r))){const p=ei(r);u=no(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const h=!s||d||o?Cn(0):PA(s,l,!0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:t.y*u.y-l.scrollTop*u.y+c.y+h.y}},getDocumentElement:wn,getClippingRect:function(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const o=t==="clippingAncestors"?Dl(e)?[]:function(u,c){const d=c.get(u);if(d)return d;let h=ws(u,[],!1).filter(g=>pn(g)&&eo(g)!=="body"),p=null;const f=fn(u).position==="fixed";let m=f?_r(u):u;for(;pn(m)&&!to(m);){const g=fn(m),E=Lh(m);E||g.position!=="fixed"||(p=null),(f?!E&&!p:!E&&g.position==="static"&&p&&["absolute","fixed"].includes(p.position)||Is(m)&&!E&&FA(u,m))?h=h.filter(v=>v!==m):p=g,m=_r(m)}return c.set(u,h),h}(e,this._c):[].concat(t),s=[...o,r],a=s[0],l=s.reduce((u,c)=>{const d=BA(e,c,i);return u.top=Yt(d.top,u.top),u.right=Ar(d.right,u.right),u.bottom=Ar(d.bottom,u.bottom),u.left=Yt(d.left,u.left),u},BA(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:HA,getElementRects:async function(n){const e=this.getOffsetParent||HA,t=this.getDimensions,r=await t(n.floating);return{reference:kI(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(n){return Array.from(n.getClientRects())},getDimensions:function(n){const{width:e,height:t}=xA(n);return{width:e,height:t}},getScale:no,isElement:pn,isRTL:function(n){return fn(n).direction==="rtl"}};function $A(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function jA(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Ph(n),c=i||o?[...u?ws(u):[],...ws(e)]:[];c.forEach(g=>{i&&g.addEventListener("scroll",t,{passive:!0}),o&&g.addEventListener("resize",t)});const d=u&&a?function(g,E){let v,A=null;const _=wn(g);function O(){var T;clearTimeout(v),(T=A)==null||T.disconnect(),A=null}return function T(S,b){S===void 0&&(S=!1),b===void 0&&(b=1),O();const y=g.getBoundingClientRect(),{left:C,top:w,width:I,height:F}=y;if(S||E(),!I||!F)return;const L={rootMargin:-Cl(w)+"px "+-Cl(_.clientWidth-(C+I))+"px "+-Cl(_.clientHeight-(w+F))+"px "+-Cl(C)+"px",threshold:Yt(0,Ar(1,b))||1};let j=!0;function D(B){const H=B[0].intersectionRatio;if(H!==b){if(!j)return T();H?T(!1,H):v=setTimeout(()=>{T(!1,1e-7)},1e3)}H!==1||$A(y,g.getBoundingClientRect())||T(),j=!1}try{A=new IntersectionObserver(D,{...L,root:_.ownerDocument})}catch{A=new IntersectionObserver(D,L)}A.observe(g)}(!0),O}(u,t):null;let h,p=-1,f=null;s&&(f=new ResizeObserver(g=>{let[E]=g;E&&E.target===u&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(e)})),t()}),u&&!l&&f.observe(u),f.observe(e));let m=l?ei(n):null;return l&&function g(){const E=ei(n);m&&!$A(m,E)&&t(),m=E,h=requestAnimationFrame(g)}(),t(),()=>{var g;c.forEach(E=>{i&&E.removeEventListener("scroll",t),o&&E.removeEventListener("resize",t)}),d?.(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const xI=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,r;const{x:i,y:o,placement:s,middlewareData:a}=e,l=await async function(u,c){const{placement:d,platform:h,elements:p}=u,f=await(h.isRTL==null?void 0:h.isRTL(p.floating)),m=qn(d),g=Qi(d),E=In(d)==="y",v=["left","top"].includes(m)?-1:1,A=f&&E?-1:1,_=Kn(c,u);let{mainAxis:O,crossAxis:T,alignmentAxis:S}=typeof _=="number"?{mainAxis:_,crossAxis:0,alignmentAxis:null}:{mainAxis:_.mainAxis||0,crossAxis:_.crossAxis||0,alignmentAxis:_.alignmentAxis};return g&&typeof S=="number"&&(T=g==="end"?-1*S:S),E?{x:T*A,y:O*v}:{x:O*v,y:T*A}}(e,n);return s===((t=a.offset)==null?void 0:t.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},MI=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:E,y:v}=g;return{x:E,y:v}}},...l}=Kn(n,e),u={x:t,y:r},c=await Cs(e,l),d=In(qn(i)),h=wh(d);let p=u[h],f=u[d];if(o){const g=h==="y"?"bottom":"right";p=Ih(p+c[h==="y"?"top":"left"],p,p-c[g])}if(s){const g=d==="y"?"bottom":"right";f=Ih(f+c[d==="y"?"top":"left"],f,f-c[g])}const m=a.fn({...e,[h]:p,[d]:f});return{...m,data:{x:m.x-t,y:m.y-r,enabled:{[h]:o,[d]:s}}}}}},PI=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=Kn(n,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const E=qn(i),v=In(a),A=qn(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),O=h||(A||!m?[Il(a)]:function(L){const j=Il(L);return[kh(L),j,kh(j)]}(a)),T=f!=="none";!h&&T&&O.push(...function(L,j,D,B){const H=Qi(L);let x=function(Q,Y,J){const se=["left","right"],k=["right","left"],Z=["top","bottom"],te=["bottom","top"];switch(Q){case"top":case"bottom":return J?Y?k:se:Y?se:k;case"left":case"right":return Y?Z:te;default:return[]}}(qn(L),D==="start",B);return H&&(x=x.map(Q=>Q+"-"+H),j&&(x=x.concat(x.map(kh)))),x}(a,m,f,_));const S=[a,...O],b=await Cs(e,g),y=[];let C=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&y.push(b[E]),d){const L=function(j,D,B){B===void 0&&(B=!1);const H=Qi(j),x=Dh(j),Q=Rh(x);let Y=x==="x"?H===(B?"end":"start")?"right":"left":H==="start"?"bottom":"top";return D.reference[Q]>D.floating[Q]&&(Y=Il(Y)),[Y,Il(Y)]}(i,s,_);y.push(b[L[0]],b[L[1]])}if(C=[...C,{placement:i,overflows:y}],!y.every(L=>L<=0)){var w,I;const L=(((w=o.flip)==null?void 0:w.index)||0)+1,j=S[L];if(j&&(!(d==="alignment"&&v!==In(j))||C.every(B=>B.overflows[0]>0&&In(B.placement)===v)))return{data:{index:L,overflows:C},reset:{placement:j}};let D=(I=C.filter(B=>B.overflows[0]<=0).sort((B,H)=>B.overflows[1]-H.overflows[1])[0])==null?void 0:I.placement;if(!D)switch(p){case"bestFit":{var F;const B=(F=C.filter(H=>{if(T){const x=In(H.placement);return x===v||x==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(x=>x>0).reduce((x,Q)=>x+Q,0)]).sort((H,x)=>H[1]-x[1])[0])==null?void 0:F[0];B&&(D=B);break}case"initialPlacement":D=a}if(i!==D)return{reset:{placement:D}}}return{}}}},BI=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,r;const{placement:i,rects:o,platform:s,elements:a}=e,{apply:l=()=>{},...u}=Kn(n,e),c=await Cs(e,u),d=qn(i),h=Qi(i),p=In(i)==="y",{width:f,height:m}=o.floating;let g,E;d==="top"||d==="bottom"?(g=d,E=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(E=d,g=h==="end"?"top":"bottom");const v=m-c.top-c.bottom,A=f-c.left-c.right,_=Ar(m-c[g],v),O=Ar(f-c[E],A),T=!e.middlewareData.shift;let S=_,b=O;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(b=A),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(S=v),T&&!h){const C=Yt(c.left,0),w=Yt(c.right,0),I=Yt(c.top,0),F=Yt(c.bottom,0);p?b=f-2*(C!==0||w!==0?C+w:Yt(c.left,c.right)):S=m-2*(I!==0||F!==0?I+F:Yt(c.top,c.bottom))}await l({...e,availableWidth:b,availableHeight:S});const y=await s.getDimensions(a.floating);return f!==y.width||m!==y.height?{reset:{rects:!0}}:{}}}},FI=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:r="referenceHidden",...i}=Kn(n,e);switch(r){case"referenceHidden":{const o=wA(await Cs(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:RA(o)}}}case"escaped":{const o=wA(await Cs(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:o,escaped:RA(o)}}}default:return{}}}}},YA=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=Kn(n,e)||{};if(u==null)return{};const d=CA(c),h={x:t,y:r},p=Dh(i),f=Rh(p),m=await s.getDimensions(u),g=p==="y",E=g?"top":"left",v=g?"bottom":"right",A=g?"clientHeight":"clientWidth",_=o.reference[f]+o.reference[p]-h[p]-o.floating[f],O=h[p]-o.reference[p],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let S=T?T[A]:0;S&&await(s.isElement==null?void 0:s.isElement(T))||(S=a.floating[A]||o.floating[f]);const b=_/2-O/2,y=S/2-m[f]/2-1,C=Ar(d[E],y),w=Ar(d[v],y),I=C,F=S-m[f]-w,L=S/2-m[f]/2+b,j=Ih(I,L,F),D=!l.arrow&&Qi(i)!=null&&L!==j&&o.reference[f]/2-(L<I?C:w)-m[f]/2<0,B=D?L<I?L-I:L-F:0;return{[p]:h[p]+B,data:{[p]:j,centerOffset:L-j-B,...D&&{alignmentOffset:B}},reset:D}}}),UI=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:r,placement:i,rects:o,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Kn(n,e),c={x:t,y:r},d=In(i),h=wh(d);let p=c[h],f=c[d];const m=Kn(a,e),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const A=h==="y"?"height":"width",_=o.reference[h]-o.floating[A]+g.mainAxis,O=o.reference[h]+o.reference[A]-g.mainAxis;p<_?p=_:p>O&&(p=O)}if(u){var E,v;const A=h==="y"?"width":"height",_=["top","left"].includes(qn(i)),O=o.reference[d]-o.floating[A]+(_&&((E=s.offset)==null?void 0:E[d])||0)+(_?0:g.crossAxis),T=o.reference[d]+o.reference[A]+(_?0:((v=s.offset)==null?void 0:v[d])||0)-(_?g.crossAxis:0);f<O?f=O:f>T&&(f=T)}return{[h]:p,[d]:f}}}},HI=(n,e,t)=>{const r=new Map,i={platform:LI,...t},o={...i.platform,_c:r};return(async(s,a,l)=>{const{placement:u="bottom",strategy:c="absolute",middleware:d=[],platform:h}=l,p=d.filter(Boolean),f=await(h.isRTL==null?void 0:h.isRTL(a));let m=await h.getElementRects({reference:s,floating:a,strategy:c}),{x:g,y:E}=IA(m,u,f),v=u,A={},_=0;for(let O=0;O<p.length;O++){const{name:T,fn:S}=p[O],{x:b,y,data:C,reset:w}=await S({x:g,y:E,initialPlacement:u,placement:v,strategy:c,middlewareData:A,rects:m,platform:h,elements:{reference:s,floating:a}});g=b??g,E=y??E,A={...A,[T]:{...A[T],...C}},w&&_<=50&&(_++,typeof w=="object"&&(w.placement&&(v=w.placement),w.rects&&(m=w.rects===!0?await h.getElementRects({reference:s,floating:a,strategy:c}):w.rects),{x:g,y:E}=IA(m,v,f)),O=-1)}return{x:g,y:E,placement:v,strategy:c,middlewareData:A}})(n,e,{...i,platform:o})};var Ll=typeof document<"u"?pt:function(){};function xl(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,i;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!=0;)if(!xl(n[r],e[r]))return!1;return!0}if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!=0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=t;r--!=0;){const o=i[r];if((o!=="_owner"||!n.$$typeof)&&!xl(n[o],e[o]))return!1}return!0}return n!=n&&e!=e}function zA(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function VA(n,e){const t=zA(n);return Math.round(e*t)/t}function Uh(n){const e=W(n);return Ll(()=>{e.current=n}),e}function WA(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=n,[c,d]=ne({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[h,p]=ne(r);xl(h,r)||p(r);const[f,m]=ne(null),[g,E]=ne(null),v=ie(H=>{H!==T.current&&(T.current=H,m(H))},[]),A=ie(H=>{H!==S.current&&(S.current=H,E(H))},[]),_=o||f,O=s||g,T=W(null),S=W(null),b=W(c),y=l!=null,C=Uh(l),w=Uh(i),I=Uh(u),F=ie(()=>{if(!T.current||!S.current)return;const H={placement:e,strategy:t,middleware:h};w.current&&(H.platform=w.current),HI(T.current,S.current,H).then(x=>{const Q={...x,isPositioned:I.current!==!1};L.current&&!xl(b.current,Q)&&(b.current=Q,Do(()=>{d(Q)}))})},[h,e,t,w,I]);Ll(()=>{u===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,d(H=>({...H,isPositioned:!1})))},[u]);const L=W(!1);Ll(()=>(L.current=!0,()=>{L.current=!1}),[]),Ll(()=>{if(_&&(T.current=_),O&&(S.current=O),_&&O){if(C.current)return C.current(_,O,F);F()}},[_,O,F,C,y]);const j=ce(()=>({reference:T,floating:S,setReference:v,setFloating:A}),[v,A]),D=ce(()=>({reference:_,floating:O}),[_,O]),B=ce(()=>{const H={position:t,left:0,top:0};if(!D.floating)return H;const x=VA(D.floating,c.x),Q=VA(D.floating,c.y);return a?{...H,transform:"translate("+x+"px, "+Q+"px)",...zA(D.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:x,top:Q}},[t,a,D.floating,c.x,c.y]);return ce(()=>({...c,update:F,refs:j,elements:D,floatingStyles:B}),[c,F,j,D,B])}const $I=n=>({name:"arrow",options:n,fn(e){const{element:t,padding:r}=typeof n=="function"?n(e):n;return t&&(i=t,{}.hasOwnProperty.call(i,"current"))?t.current!=null?YA({element:t.current,padding:r}).fn(e):{}:t?YA({element:t,padding:r}).fn(e):{};var i}}),GA=(n,e)=>({...xI(n),options:[n,e]}),XA=(n,e)=>({...MI(n),options:[n,e]}),KA=(n,e)=>({...UI(n),options:[n,e]}),qA=(n,e)=>({...PI(n),options:[n,e]}),JA=(n,e)=>({...BI(n),options:[n,e]}),ZA=(n,e)=>({...FI(n),options:[n,e]}),QA=(n,e)=>({...$I(n),options:[n,e]});var e_=ee((n,e)=>{const{children:t,width:r=10,height:i=5,...o}=n;return N(Ke.svg,{...o,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?t:N("polygon",{points:"0,0 30,0 15,10"})})});e_.displayName="Arrow";var t_=e_;function n_(n){const[e,t]=ne(void 0);return hn(()=>{if(n){t({width:n.offsetWidth,height:n.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=n.offsetWidth,a=n.offsetHeight;t({width:s,height:a})});return r.observe(n,{box:"border-box"}),()=>r.unobserve(n)}t(void 0)},[n]),e}var Hh="Popper",[r_,i_]=Qr(Hh),[jI,o_]=r_(Hh),s_=n=>{const{__scopePopper:e,children:t}=n,[r,i]=ne(null);return N(jI,{scope:e,anchor:r,onAnchorChange:i,children:t})};s_.displayName=Hh;var a_="PopperAnchor",l_=ee((n,e)=>{const{__scopePopper:t,virtualRef:r,...i}=n,o=o_(a_,t),s=W(null),a=$e(e,s),l=W(null);return V(()=>{const u=l.current;l.current=r?.current||s.current,u!==l.current&&o.onAnchorChange(l.current)}),r?null:N(Ke.div,{...i,ref:a})});l_.displayName=a_;var $h="PopperContent",[YI,zI]=r_($h),u_=ee((n,e)=>{const{__scopePopper:t,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:f,...m}=n,g=o_($h,t),[E,v]=ne(null),A=$e(e,oe=>v(oe)),[_,O]=ne(null),T=n_(_),S=T?.width??0,b=T?.height??0,y=r+(o!=="center"?"-"+o:""),C=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},w=Array.isArray(u)?u:[u],I=w.length>0,F={padding:C,boundary:w.filter(WI),altBoundary:I},{refs:L,floatingStyles:j,placement:D,isPositioned:B,middlewareData:H}=WA({strategy:"fixed",placement:y,whileElementsMounted:(...oe)=>jA(...oe,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[GA({mainAxis:i+b,alignmentAxis:s}),l&&XA({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?KA():void 0,...F}),l&&qA({...F}),JA({...F,apply:({elements:oe,rects:U,availableWidth:de,availableHeight:fe})=>{const{width:Ne,height:ge}=U.reference,he=oe.floating.style;he.setProperty("--radix-popper-available-width",`${de}px`),he.setProperty("--radix-popper-available-height",`${fe}px`),he.setProperty("--radix-popper-anchor-width",`${Ne}px`),he.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),_&&QA({element:_,padding:a}),GI({arrowWidth:S,arrowHeight:b}),h&&ZA({strategy:"referenceHidden",...F})]}),[x,Q]=h_(D),Y=en(f);hn(()=>{B&&Y?.()},[B,Y]);const J=H.arrow?.x,se=H.arrow?.y,k=H.arrow?.centerOffset!==0,[Z,te]=ne();return hn(()=>{E&&te(window.getComputedStyle(E).zIndex)},[E]),N("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:B?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:N(YI,{scope:t,placedSide:x,onArrowChange:O,arrowX:J,arrowY:se,shouldHideArrow:k,children:N(Ke.div,{"data-side":x,"data-align":Q,...m,ref:A,style:{...m.style,animation:B?void 0:"none"}})})})});u_.displayName=$h;var c_="PopperArrow",VI={top:"bottom",right:"left",bottom:"top",left:"right"},d_=ee(function(n,e){const{__scopePopper:t,...r}=n,i=zI(c_,t),o=VI[i.placedSide];return N("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:N(t_,{...r,ref:e,style:{...r.style,display:"block"}})})});function WI(n){return n!==null}d_.displayName=c_;var GI=n=>({name:"transformOrigin",options:n,fn(e){const{placement:t,rects:r,middlewareData:i}=e,o=i.arrow?.centerOffset!==0,s=o?0:n.arrowWidth,a=o?0:n.arrowHeight,[l,u]=h_(t),c={start:"0%",center:"50%",end:"100%"}[u],d=(i.arrow?.x??0)+s/2,h=(i.arrow?.y??0)+a/2;let p="",f="";return l==="bottom"?(p=o?c:`${d}px`,f=-a+"px"):l==="top"?(p=o?c:`${d}px`,f=`${r.floating.height+a}px`):l==="right"?(p=-a+"px",f=o?c:`${h}px`):l==="left"&&(p=`${r.floating.width+a}px`,f=o?c:`${h}px`),{data:{x:p,y:f}}}});function h_(n){const[e,t="center"]=n.split("-");return[e,t]}var XI=s_,p_=l_,KI=u_,qI=d_,f_=n=>{const{present:e,children:t}=n,r=function(s){const[a,l]=ne(),u=W(null),c=W(s),d=W("none"),h=s?"mounted":"unmounted",[p,f]=function(m,g){return br((E,v)=>g[E][v]??E,m)}(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return V(()=>{const m=Ml(u.current);d.current=p==="mounted"?m:"none"},[p]),hn(()=>{const m=u.current,g=c.current;if(g!==s){const E=d.current,v=Ml(m);s?f("MOUNT"):v==="none"||m?.display==="none"?f("UNMOUNT"):f(g&&E!==v?"ANIMATION_OUT":"UNMOUNT"),c.current=s}},[s,f]),hn(()=>{if(a){let m;const g=a.ownerDocument.defaultView??window,E=A=>{const _=Ml(u.current).includes(CSS.escape(A.animationName));if(A.target===a&&_&&(f("ANIMATION_END"),!c.current)){const O=a.style.animationFillMode;a.style.animationFillMode="forwards",m=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=O)})}},v=A=>{A.target===a&&(d.current=Ml(u.current))};return a.addEventListener("animationstart",v),a.addEventListener("animationcancel",E),a.addEventListener("animationend",E),()=>{g.clearTimeout(m),a.removeEventListener("animationstart",v),a.removeEventListener("animationcancel",E),a.removeEventListener("animationend",E)}}f("ANIMATION_END")},[a,f]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:ie(m=>{u.current=m?getComputedStyle(m):null,l(m)},[])}}(e),i=typeof t=="function"?t({present:r.isPresent}):vn.only(t),o=$e(r.ref,function(s){let a=Object.getOwnPropertyDescriptor(s.props,"ref")?.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=Object.getOwnPropertyDescriptor(s,"ref")?.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}(i));return typeof t=="function"||r.isPresent?Nr(i,{ref:o}):null};function Ml(n){return n?.animationName||"none"}f_.displayName="Presence";var JI=Ju[" useInsertionEffect ".trim().toString()]||hn;function jh({prop:n,defaultProp:e,onChange:t=()=>{},caller:r}){const[i,o,s]=function({defaultProp:c,onChange:d}){const[h,p]=ne(c),f=W(h),m=W(d);return JI(()=>{m.current=d},[d]),V(()=>{f.current!==h&&(m.current?.(h),f.current=h)},[h,f]),[h,p,m]}({defaultProp:e,onChange:t}),a=n!==void 0,l=a?n:i;{const c=W(n!==void 0);V(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. 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.`),c.current=a},[a,r])}const u=ie(c=>{if(a){const d=function(h){return typeof h=="function"}(c)?c(n):c;d!==n&&s.current?.(d)}else o(c)},[a,n,o,s]);return[l,u]}var ro=new WeakMap,Pl=new WeakMap,Bl={},m_=0,g_=function(n){return n&&(n.host||g_(n.parentNode))},ZI=function(n,e,t,r){var i=function(d,h){return h.map(function(p){if(d.contains(p))return p;var f=g_(p);return f&&d.contains(f)?f:(console.error("aria-hidden",p,"in not contained inside",d,". Doing nothing"),null)}).filter(function(p){return!!p})}(e,Array.isArray(n)?n:[n]);Bl[t]||(Bl[t]=new WeakMap);var o=Bl[t],s=[],a=new Set,l=new Set(i),u=function(d){d&&!a.has(d)&&(a.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){d&&!l.has(d)&&Array.prototype.forEach.call(d.children,function(h){if(a.has(h))c(h);else try{var p=h.getAttribute(r),f=p!==null&&p!=="false",m=(ro.get(h)||0)+1,g=(o.get(h)||0)+1;ro.set(h,m),o.set(h,g),s.push(h),m===1&&f&&Pl.set(h,!0),g===1&&h.setAttribute(t,"true"),f||h.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",h,E)}})};return c(e),a.clear(),m_++,function(){s.forEach(function(d){var h=ro.get(d)-1,p=o.get(d)-1;ro.set(d,h),o.set(d,p),h||(Pl.has(d)||d.removeAttribute(r),Pl.delete(d)),p||d.removeAttribute(t)}),--m_||(ro=new WeakMap,ro=new WeakMap,Pl=new WeakMap,Bl={})}},E_=function(n,e,t){t===void 0&&(t="data-aria-hidden");var r=Array.from(Array.isArray(n)?n:[n]),i=function(o){return typeof document>"u"?null:(Array.isArray(o)?o[0]:o).ownerDocument.body}(n);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),ZI(r,i,t,"aria-hidden")):function(){return null}},yr=function(){return yr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},yr.apply(this,arguments)},Fl="right-scroll-bar-position",Ul="width-before-scroll-bar";function Yh(n,e){return typeof n=="function"?n(e):n&&(n.current=e),n}var QI=typeof window<"u"?pt:V,v_=new WeakMap;function ew(n,e){var t,r,i,o=(t=null,r=function(s){return n.forEach(function(a){return Yh(a,s)})},(i=ne(function(){return{value:t,callback:r,facade:{get current(){return i.value},set current(s){var a=i.value;a!==s&&(i.value=s,i.callback(s,a))}}}})[0]).callback=r,i.facade);return QI(function(){var s=v_.get(o);if(s){var a=new Set(s),l=new Set(n),u=o.current;a.forEach(function(c){l.has(c)||Yh(c,null)}),l.forEach(function(c){a.has(c)||Yh(c,u)})}v_.set(o,n)},[n]),o}var Hl=function(){return Hl=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},Hl.apply(this,arguments)};function tw(n){return n}typeof SuppressedError=="function"&&SuppressedError;var A_=function(n){var e=n.sideCar,t=function(i,o){var s={};for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.indexOf(a)<0&&(s[a]=i[a]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(a=Object.getOwnPropertySymbols(i);l<a.length;l++)o.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(i,a[l])&&(s[a[l]]=i[a[l]])}return s}(n,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return ae(r,Hl({},t))};A_.isSideCarExport=!0;var __=function(n){n===void 0&&(n={});var e=function(t,r){r===void 0&&(r=tw);var i=[],o=!1,s={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:t},useMedium:function(a){var l=r(a,o);return i.push(l),function(){i=i.filter(function(u){return u!==l})}},assignSyncMedium:function(a){for(o=!0;i.length;){var l=i;i=[],l.forEach(a)}i={push:function(u){return a(u)},filter:function(){return i}}},assignMedium:function(a){o=!0;var l=[];if(i.length){var u=i;i=[],u.forEach(a),l=i}var c=function(){var h=l;l=[],h.forEach(a)},d=function(){return Promise.resolve().then(c)};d(),i={push:function(h){l.push(h),d()},filter:function(h){return l=l.filter(h),i}}}};return s}(null);return e.options=Hl({async:!0,ssr:!1},n),e}(),zh=function(){},$l=ee(function(n,e){var t=W(null),r=ne({onScrollCapture:zh,onWheelCapture:zh,onTouchMoveCapture:zh}),i=r[0],o=r[1],s=n.forwardProps,a=n.children,l=n.className,u=n.removeScrollBar,c=n.enabled,d=n.shards,h=n.sideCar,p=n.noRelative,f=n.noIsolation,m=n.inert,g=n.allowPinchZoom,E=n.as,v=E===void 0?"div":E,A=n.gapMode,_=function(b,y){var C={};for(var w in b)Object.prototype.hasOwnProperty.call(b,w)&&y.indexOf(w)<0&&(C[w]=b[w]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function"){var I=0;for(w=Object.getOwnPropertySymbols(b);I<w.length;I++)y.indexOf(w[I])<0&&Object.prototype.propertyIsEnumerable.call(b,w[I])&&(C[w[I]]=b[w[I]])}return C}(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=h,T=ew([t,e]),S=yr(yr({},_),i);return ae(xe,null,c&&ae(O,{sideCar:__,removeScrollBar:u,shards:d,noRelative:p,noIsolation:f,inert:m,setCallbacks:o,allowPinchZoom:!!g,lockRef:t,gapMode:A}),s?Nr(vn.only(a),yr(yr({},S),{ref:T})):ae(v,yr({},S,{className:l,ref:T}),a))});$l.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$l.classNames={fullWidth:Ul,zeroRight:Fl};function nw(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__}();return e&&n.setAttribute("nonce",e),n}var rw=function(){var n=0,e=null;return{add:function(t){var r;n==0&&(e=nw())&&(function(i,o){i.styleSheet?i.styleSheet.cssText=o:i.appendChild(document.createTextNode(o))}(e,t),r=e,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),n++},remove:function(){!--n&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},y_=function(){var n,e=(n=rw(),function(t,r){V(function(){return n.add(t),function(){n.remove()}},[t&&r])});return function(t){var r=t.styles,i=t.dynamic;return e(r,i),null}},iw={left:0,top:0,right:0,gap:0},Vh=function(n){return parseInt(n||"",10)||0},ow=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return iw;var e=function(i){var o=window.getComputedStyle(document.body),s=o[i==="padding"?"paddingLeft":"marginLeft"],a=o[i==="padding"?"paddingTop":"marginTop"],l=o[i==="padding"?"paddingRight":"marginRight"];return[Vh(s),Vh(a),Vh(l)]}(n),t=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-t+e[2]-e[0])}},sw=y_(),io="data-scroll-locked",aw=function(n,e,t,r){var i=n.left,o=n.top,s=n.right,a=n.gap;return t===void 0&&(t="margin"),`
85
+ `);function bv(n,e={except:[]}){let t=function(r,i){let o=[r];return o=th(o,i.multilineSteps),o=th(o,[gC]),o=th(o,i.singlelineSteps),o=Nv(o),o}(n,mC(e));return t=Cv(t,!1),t}function th(n,e){return e.reduce((t,r)=>ms(t,r),n)}function Nv(n){const e=[];let t=-1;for(const r of n)typeof r=="string"?typeof e[t]=="string"?e[t]+=r:e[++t]=r:e[++t]="children"in r?{...r,children:Nv(r.children)}:r;return e}function Cv(n,e){const t=[];let r=[];for(let i=0;i<n.length;i++){const o=n[i];typeof o=="string"?r.push(o):"children"in o?(r.length>0&&(t.push(r.join("")),r=[]),o.children=Cv(o.children,e||o.type==="link"||o.type==="actionbutton"||o.type==="actionlink"),t.push(o)):o.type==="autolink"&&e?r.push(o.text):(r.length>0&&(t.push(r.join("")),r=[]),t.push(o))}return r.length>0&&(t.push(r.join("")),r=[]),t}function EC(){let n,e=0;return t=>{const r=(o=Date.now())=>{window.clearTimeout(n),n=void 0,e=o;const s=function(a){a=a.removeMark(0,a.doc.content.size,Ze.marks.bold),a=a.removeMark(0,a.doc.content.size,Ze.marks.italic),a=a.removeMark(0,a.doc.content.size,Ze.marks.strikethrough),a.doc.firstChild;const l=function(u){const c=[];let d,h="";return u.descendants((p,f)=>(p.isText?(h+=p.text,d??=f):h&&d!==void 0&&(c.push({text:h,pos:d}),h="",d=void 0),p.type!==Ze.nodes.mention)),h&&d!==void 0&&c.push({text:h,pos:d}),c}(a.doc);for(const{text:u,pos:c}of l){const d=bv(u,{only:["Wikitext"]});[a]=Iv(a,c,d)}return a}(t.state.tr);t.dispatch(s)},i=Date.now();i-e<300?n||(n=window.setTimeout(r,300)):r(i)}}function Iv(n,e,t,r=0,i=[]){for(const o of t)if(typeof o=="string"){for(const s of i)n.addMark(e+r,e+r+o.length,s.create());r+=o.length}else if(o.type==="bold"||o.type==="italic"||o.type==="strikethrough"){r+=1;const s=Ze.marks[o.type],a=[...i,s];[n,r]=Iv(n,e,o.children,r,a),r+=1}else Ie.unreachable();return[n,r]}function wv(n){return(e,t)=>{if(!t)return!0;let r=e.tr;const i=Te.between(e.selection.$from,e.selection.$to);return r=r.replaceRangeWith(i.from,i.from,Ze.text(n,r.storedMarks)),r=r.replaceRangeWith(i.to+1,i.to+1,Ze.text(n,r.storedMarks)),r=r.setSelection(Te.near(r.doc.resolve(i.to+1))),t(r),!0}}function vC(n,e,t){const r=e.clipboardData;if(!r)return!1;const i=function(o){const s=o.items||[],a={"image/gif":"gif","image/png":"png","image/jpeg":"jpg","image/svg+xml":"svg"},l=Array.from(s).filter(d=>d.kind==="file"&&a[d.type]);if(l.length===0||o.types.includes("text/rtf"))return;const u=l[0];let c=u.getAsFile();if(!c.name){const d="image."+a[u.type];c=new File([c],d,{type:u.type,lastModified:Date.now()})}return c}(r);return i?t(i):function(o,s){const a=o.state.tr.insertText(s).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");o.dispatch(a)}(n,r.getData("text/plain")),!0}function AC(n,{allowSpaces:e=!1}){return t=>{const r=new RegExp(`\\s${n}$`),i=e?new RegExp(`${n}.*?(?=\\s${n}|$)`,"g"):new RegExp(`(?:^)?${n}[^\\s${n}]*`,"g"),o=t.before(),s=t.end(),a=t.doc.textBetween(o,s,"\0","\0");let l;for(;l=i.exec(a);){const u=l.input.slice(Math.max(0,l.index-1),l.index);if(!/^[\s\0]?$/.test(u))continue;const c=l.index+t.start();let d=c+l[0].length;if(e&&r.test(a.slice(d-1,d+1))&&(l[0]+=" ",d++),c<t.pos&&d>=t.pos)return{range:{from:c,to:d},text:l[0]}}}}function Rv({matcher:n=AC("#"),suggestionClass:e="ProseMirror-suggestion",onEnter:t=()=>!1,onChange:r=()=>!1,onExit:i=()=>!1,onKeyDown:o=()=>!1,debug:s=!1}){return new qa({key:new Ja("suggestions"),view(){return{update:(a,l)=>{const u=this.key.getState(l),c=this.key.getState(a.state),d=u.active&&c.active&&u.range.from!==c.range.from,h=!u.active&&c.active,p=u.active&&!c.active,f=!h&&!p&&u.text!==c.text;(p||d)&&i({view:a,range:u.range,text:u.text}),f&&!d&&r({view:a,range:c.range,text:c.text}),(h||d)&&t({view:a,range:c.range,text:c.text})}}},state:{init:()=>({active:!1,range:{},text:null}),apply(a,l){const{selection:u}=a,c={...l};if(u.from===u.to){(u.from<l.range.from||u.from>l.range.to)&&(c.active=!1);const d=u.$from,h=n(d);h?(c.active=!0,c.range=h.range,c.text=h.text):c.active=!1}else c.active=!1;return c.active||(c.range={},c.text=null),c}},props:{handleKeyDown(a,l){const{active:u}=this.getState(a.state);return!!u&&o({view:a,event:l})},decorations(a){const{active:l,range:u}=this.getState(a);return l?Ge.create(a.doc,[Ht.inline(u.from,u.to,{nodeName:"span",class:e,style:s?"background: rgba(0, 0, 255, 0.05); color: blue; border: 2px solid blue;":null})]):null}}})}function _C({placeholder:n,disabled:e,className:t="",characterLimit:r,spellcheck:i}){const o=Po(),s=W(),a=W(null);return V(()=>(s.current=function(l,u,c,d,h){const p=Pi.create({schema:Ze,plugins:[...h.filter(yC),wN(),R0({...hl,"Mod-z":j0,"Mod-y":Y0,"Mod-b":wv("*"),"Mod-i":wv("_"),"Mod-Enter":hl.Enter,"Shift-Enter":hl.Enter,Enter:c}),R0({Enter:hl.Enter}),N0]}),f=EC(),m=new EN(l,{handlePaste:(g,E,v)=>vC(g,E,d),clipboardTextSerializer(g){const E=[];return g.content.forEach(v=>{v&&E.push(rv(v.textContent))}),E.join()},state:p,dispatchTransaction(g){g=(g=g.removeStoredMark(Ze.marks.literal)).removeStoredMark(Ze.marks.emoji);const E=m.state.apply(g);m.state.doc.eq(E.doc)||u(new gl(E.doc)),m.updateState(E),g.steps.some(v=>v instanceof dn)&&setTimeout(()=>f(m),0)}});return m}(a.current,l=>o.onChange(l),()=>!!o.onEnter&&(o.onEnter(),!0),l=>o.onPasteImage(l),[o.emojiSuggesterPlugin(),o.mentionsPlugin()]),o.setEditorView(s.current),()=>{o.setEditorView(void 0),s.current?.destroy()}),[o]),V(()=>{s.current?.setProps({editable:()=>!e})},[e]),V(()=>Vo(()=>s.current?.setProps({attributes:{spellcheck:String(o.spellcheck$.get()??i??!1),class:"t-text-input","aria-label":"Message Field",role:"textbox"}})),[o,i]),V(()=>Vo(()=>{const l=s.current;l?.dispatch(l.state.tr.setMeta(N0,o.placeholder$.get()??n))}),[o,n]),V(()=>{r&&Number.isInteger(r)&&o.setMaxLength(r)},[r,o]),N("div",{className:`t-editor ${t}`,ref:a})}function Dv(n){if(n.startsWith(":"))throw new Error("Not implemented");{const e=Ze.marks.emoji.create({emoji:n});return Ze.text(n,[e])}}function kv(n,e){const t=encodeURIComponent(n);return Ze.nodes.mention.create({id:n,name:e},Ze.text(`<!!mention:${t}|${e}>`))}class gl{constructor(e){this.doc=e,this.size=this.doc.content.size,this.hasContent=C0(this.doc)}static{this.EMPTY=new gl(Ze.topNodeType.create())}asText(){return this.doc.textContent.replace(/\xa0/g," ")}}function yC(n){return n!=null}const Lv=/^\/.*[^\\]\/[im]*$/;function xv(n){return Lv.test(n)?!El(n).test(""):!1}function El(n){const e=n.match(/^\/(.*[^\\])\/(.*)$/);if(!e)throw new Error(`Expected ${n} to be a (non-empty) regex`);let t=e[2]||"";return t=t.replace(/[^im]/g,"")+"g",new RegExp(e[1],t)}function OC(n,e){const t=function(i){{const o=document.createElement("a");return o.href=i,o.hostname}}(e),r=function(i){const o=i.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp("^"+o+"$","i")}(n);return t!==void 0&&r.test(t)}const TC=/^[]/g;function SC(n){return n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function nh(n,e){!n()&&!e&&(e=n.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/,"`$1`")+" was not true")}(n=>{function e(r){}function t(r,i){(function(o,s){switch(s){case"undefined":return o===void 0;case String:return typeof o=="string"||o instanceof String;case Boolean:return typeof o=="boolean"||o instanceof Boolean;case Number:return typeof o=="number"||o instanceof Number;default:return o instanceof s}})(r,i)||(i.name,String(r))}n.defined=e,n.has=function(r,i){r[i]},n.is=t,n.equals=function(r,i){},n.oneOf=function(r,i){i.includes(r)||JSON.stringify(i)},n.isArray=function(r,i){t(r,Array),r&&r.length>0&&t(r[0],i)},n.optional=function(r,i){r!==void 0&&t(r,i)},n.falsy=function(r){},n.never=function(r){}})(nh||(nh={}));const Vi=nh,bC=/\uFE0F/g,NC="‍";function CC(n){if(n===":arslan:")return"https://cdn.talkjs.com/__assets/5461191341cea882b3f227c085d5772c.gif";const e=function(r){const i=[];let o=0,s=0,a=0;for(;a<r.length;)o=r.charCodeAt(a++),s?(i.push((65536+(s-55296<<10)+(o-56320)).toString(16)),s=0):55296<=o&&o<=56319?s=o:i.push(o.toString(16));return i.join("-")}((t=n).indexOf(NC)<0?t.replace(bC,""):t);var t;return`https://cdn.jsdelivr.net/gh/twitter/twemoji@14.0.2/assets/svg/${e}.svg`}class IC{constructor({mode:e,allowedHostnames:t,allowedPhoneNrs:r,allowedMatches:i,forbiddenMatches:o,suppressLinks:s,suppressEmailAddresses:a,suppressPhoneNumbers:l,replacement:u}){Vi.oneOf(e,["all","otherOnly","off"]),this.mode=e,this.suppressLinks=s!==!1,this.suppressEmailAddresses=a!==!1,this.suppressPhoneNumbers=l!==!1,this.allowedHostnames=t||[],this.allowedPhoneNrs=(r||[]).filter(c=>c).map(c=>c.replace(/[^0-9]/g,"")),this.allowedMatches=(i||[]).filter(xv).map(c=>El(c)),this.forbiddenMatches=(o||[]).filter(xv).map(c=>El(c)),Vi(()=>this.allowedMatches.every(c=>c.flags.includes("g")),"All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"),Vi(()=>this.forbiddenMatches.every(c=>c.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 this.mode==="all"||this.mode==="otherOnly"&&!e}}function Mv(n){let e="";return n.t&&(e=`(${n.t("CONTACT_INFORMATION_HIDDEN")})`),{formattedLinks:n.formattedLinks??"plaintext",markup:n.markup??!1,useFallbackMentions:n.useFallbackMentions??!1,sameTabLinkRules:n.sameTabLinkRules??[],enableEmojiImageFallback:n.enableEmojiImageFallback??!1,highlight:n.highlight??[],contactInfo:n.contactInfo??!1,suppression:n.suppression??new IC({mode:"off"}),contactInfoHiddenText:n.contactInfoHiddenText??n.suppression?.replacement??e,customEmojiUrls:n.customEmojiUrls??{},enableActions:n.enableActions??!0}}class Pv extends Rg{constructor(){super(...arguments),this.conversationListSubscription=null,this.extCurrentConversationId$=Ue(null),this.conversationsArray$=Ue([]),this.conversationsMap$=Ue({})}listenForConversations(e){const t=e.subscribeConversations(r=>{zo(()=>{this.conversationsArray$.set(r);const i={};for(const o of r)i[o.id]=o;this.conversationsMap$.set(i)})});return this.conversationListSubscription=t,()=>{t.unsubscribe(),this.conversationListSubscription=null}}}function wC({id:n,text:e}){const t=Re(),r=ye(()=>{if(t instanceof Pv)return;const i=t.state$.extCurrentConversationId.get();return(i&&t.state$.participants.child(i).get())?.find(s=>s.user.id===n)?.user});return N("span",{className:"t-mention","t-is-current-user":ye(t.extUserId$)===n?"":void 0,children:`@${r?.name??e}`})}function Wi(n,e){const t=n.flatMap(r=>{if(typeof r=="string")return rh(r,e.highlight);switch(r.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletpoint":case"bulletPoint":return RC(r,e);case"bulletlist":case"bulletList":return[ae("ul",null,...Wi(r.children,e))];case"autolink":case"autoLink":case"link":return kC(r,e);case"codeblock":case"codeBlock":return[N("code",{"data-language":r.language,children:rh(r.text,e.highlight)})];case"codespan":case"codeSpan":return N("code",{children:rh((i=r.text,i.replace(/^\s*\n/m,"").replace(/\n\s*$/m,"")),e.highlight)});case"mention":return Vi.falsy(e.useFallbackMentions),N(wC,{id:r.id,text:r.text},r.id);case"suppressed":return[N("i",{children:e.contactInfoHiddenText})];case"emoji":return e.enableEmojiImageFallback?[N(DC,{unicode:r.text})]:[r.text];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return LC(r,e);case"customemoji":case"customEmoji":return r.text;default:Vi.never(r)}var i});return t.every(r=>typeof r=="string")?[t.join("")]:t}function rh(n,e){if(e.length===0)return[n];const t=function(i){const o=i.map(a=>a.trim()).filter(a=>a);if(o.length===0)return TC;const s=o.map(SC).join("|");return new RegExp(s,"gi")}(e),r=Qu(n,t).map(i=>({offset:i.index,matchedText:i[0]}));return function(i,o,s){let a=0;const l=[];for(const u of o)u.offset<a||(u.offset>a&&l.push(i.substring(a,u.offset)),l.push(...s(u)),a=u.offset+u.matchedText.length);return a<i.length&&l.push(i.substring(a)),l}(n,r,({matchedText:i})=>[N("span",{className:"highlighted-text",children:i})])}const RC=(n,e)=>[ae({bold:"strong",italic:"em",strikethrough:"del",blockquote:"blockquote",bulletpoint:"li",bulletPoint:"li"}[n.type],null,...Wi(n.children,e))];function DC({unicode:n}){const[e,t]=ne(()=>n!==":arslan:");return V(()=>{e&&!Ig(n)&&t(!1)},[]),e?N("span",{className:"t-emoji",children:n}):N("img",{className:"t-emoji",src:CC(n),alt:n})}const kC=(n,e)=>{const t="children"in n?n.children:[n.text];switch(e.formattedLinks){case"link":return[ae("a",{target:function(r,i){for(const o of r)if(Lv.test(o)){if(El(o).test(i))return"_top"}else if(OC(o,i))return"_top";return"_blank"}(e.sameTabLinkRules,n.url),href:n.url,rel:"noreferrer"},...Wi(t,e))];case"plaintext":case!1:return"children"in n&&n.children.every(r=>typeof r=="string")?[n.children.join("")]:[ae(xe,null,...Wi(t,e))];default:Vi.never(e.formattedLinks)}},LC=(n,e)=>e.enableActions?[ae("button",{"data-type":n.type,"data-action":n.action,"data-params":JSON.stringify(n.params),disabled:!0},...Wi(n.children,e))]:[null];function Bv({block:n,nonInteractive:e,className:t=""}){const r=!e,i=function(o,s={}){return Wi(o,Mv(s))}(n.children,{enableEmojiImageFallback:!0,formattedLinks:r?"link":"plaintext",enableActions:r});return ae("span",{className:`t-text ${t}`},...i)}function xC(n){const e=sn(),t=Re(),{className:r="",...i}=n,o=ye(()=>t.state$.messages.child(t.state$.extCurrentConversationId.get()).lookup.child(n.message.id).content.child(0).url.get());return N("div",{className:`t-message-content ${r}`,children:n.message.content.map(s=>N(MC,{block:s,theme:e,downloadUrl:o,...i},n.message.createdAt+(n.message.editedAt??0)))})}function MC({common:n,block:e,message:t,theme:r,downloadUrl:i}){const o=function(s,a){switch(a.type){case"text":return s.TextBlock;case"location":return s.LocationBlock;case"file":switch(a.subtype){case"image":return s.ImageBlock;case"video":return s.VideoBlock;case"voice":return s.VoiceBlock;case"audio":return s.AudioBlock;default:return s.FileBlock}default:Ie.never(a)}}(r,e);return N(o,{block:e,common:n,message:t,downloadUrl:i})}function vl(n,e,t=!0){const r=oe(o=>{o.keyCode===27&&n()},[n]),i=oe(o=>{o.target instanceof HTMLElement&&o.target.closest(e)===null&&n()},[e,n]);V(()=>{if(t)return window.addEventListener("keydown",r,!0),document.addEventListener("mousedown",i,!0),()=>{window.removeEventListener("keydown",r,!0),document.removeEventListener("mousedown",i,!0)}},[r,i,t])}function Fv(n){const[e,t]=ne();return V(()=>{let r=!0;return n().then(i=>{r&&t({value:i})}),()=>{r=!1}},[n]),e}function ih(){return N(Ya,{type:"spinner","aria-label":ye(Re().t$).LOADING,className:"t-loading-icon"})}const PC="https://cdn.jsdelivr.net/npm/emoji-picker-element@1.26.3/+esm",oh=function(n){let e;return()=>(e===void 0&&(e={value:n()}),e.value)}(async function(){if(typeof window>"u"||window.document===void 0)return new Promise(()=>{});try{const n=await import(PC);return await new n.Database().ready(),n}catch(n){return Bc.error("Failed to load emoji picker:",n),new Promise(()=>{})}});function Uv(n){const{onClose:e,onEmojiSelected:t}=e1(),r=W(null),i=Fv(oh);return V(()=>{if(!i)return;Ie.defined(r.current);const o=r.current,s=o.shadowRoot;(function(u,c){const d=document.createElement("style");d.textContent=c,u.appendChild(d)})(s,".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)}");const a=u=>{const c=u.detail.unicode??u.detail.name;t(c)};function l(u){u.pointerType==="mouse"&&(s.querySelector("section").dataset.hasMouse="true")}return o.addEventListener("emoji-click",a),o.addEventListener("pointermove",l,{once:!0}),()=>{o.removeEventListener("emoji-click",a),o.removeEventListener("pointermove",l)}},[i,t]),V(()=>{i&&r.current&&r.current.shadowRoot.getElementById("search")?.focus()},[i]),vl(()=>e(),".t-emoji-picker"),N("div",i?{className:"t-emoji-picker",children:N("emoji-picker",{ref:r,class:n.colorScheme})}:{className:"t-emoji-picker","t-loading":"",children:N(ih,{})})}function BC(n){const{messageId:e,colorScheme:t,...r}=n,{closePopover:i}=n1(),o=yi();return N("div",{...r,children:N(Fm.Provider,{value:{onClose:i,onEmojiSelected:s=>{o.addReaction(e,s),i()}},children:N(Uv,{colorScheme:t})})})}function sh(){return sh=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},sh.apply(this,arguments)}function Hv(n,e){if(n==null)return{};var t,r,i={},o=Object.keys(n);for(r=0;r<o.length;r++)t=o[r],e.indexOf(t)>=0||(i[t]=n[t]);return i}function ah(n,e){return ah=Object.setPrototypeOf||function(t,r){return t.__proto__=r,t},ah(n,e)}function $v(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,ah(n,e)}function jv(n,e){return n.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}const Yv=!1,zv=Ce.createContext(null);var gs="unmounted",Kr="exited",qr="entering",Gi="entered",lh="exiting",Gn=function(n){function e(r,i){var o;o=n.call(this,r,i)||this;var s,a=i&&!i.isMounting?r.enter:r.appear;return o.appearStatus=null,r.in?a?(s=Kr,o.appearStatus=qr):s=Gi:s=r.unmountOnExit||r.mountOnEnter?gs:Kr,o.state={status:s},o.nextCallback=null,o}$v(e,n),e.getDerivedStateFromProps=function(r,i){return r.in&&i.status===gs?{status:Kr}:null};var t=e.prototype;return t.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},t.componentDidUpdate=function(r){var i=null;if(r!==this.props){var o=this.state.status;this.props.in?o!==qr&&o!==Gi&&(i=qr):o!==qr&&o!==Gi||(i=lh)}this.updateStatus(!1,i)},t.componentWillUnmount=function(){this.cancelNextCallback()},t.getTimeouts=function(){var r,i,o,s=this.props.timeout;return r=i=o=s,s!=null&&typeof s!="number"&&(r=s.exit,i=s.enter,o=s.appear!==void 0?s.appear:i),{exit:r,enter:i,appear:o}},t.updateStatus=function(r,i){r===void 0&&(r=!1),i!==null?(this.cancelNextCallback(),i===qr?this.performEnter(r):this.performExit()):this.props.unmountOnExit&&this.state.status===Kr&&this.setState({status:gs})},t.performEnter=function(r){var i=this,o=this.props.enter,s=this.context?this.context.isMounting:r,a=this.props.nodeRef?[s]:[Ce.findDOMNode(this),s],l=a[0],u=a[1],c=this.getTimeouts(),d=s?c.appear:c.enter;!r&&!o||Yv?this.safeSetState({status:Gi},function(){i.props.onEntered(l)}):(this.props.onEnter(l,u),this.safeSetState({status:qr},function(){i.props.onEntering(l,u),i.onTransitionEnd(d,function(){i.safeSetState({status:Gi},function(){i.props.onEntered(l,u)})})}))},t.performExit=function(){var r=this,i=this.props.exit,o=this.getTimeouts(),s=this.props.nodeRef?void 0:Ce.findDOMNode(this);i&&!Yv?(this.props.onExit(s),this.safeSetState({status:lh},function(){r.props.onExiting(s),r.onTransitionEnd(o.exit,function(){r.safeSetState({status:Kr},function(){r.props.onExited(s)})})})):this.safeSetState({status:Kr},function(){r.props.onExited(s)})},t.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},t.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},t.setNextCallback=function(r){var i=this,o=!0;return this.nextCallback=function(s){o&&(o=!1,i.nextCallback=null,r(s))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},t.onTransitionEnd=function(r,i){this.setNextCallback(i);var o=this.props.nodeRef?this.props.nodeRef.current:Ce.findDOMNode(this),s=r==null&&!this.props.addEndListener;if(o&&!s){if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],l=a[0],u=a[1];this.props.addEndListener(l,u)}r!=null&&setTimeout(this.nextCallback,r)}else setTimeout(this.nextCallback,0)},t.render=function(){var r=this.state.status;if(r===gs)return null;var i=this.props,o=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var s=Hv(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ce.createElement(zv.Provider,{value:null},typeof o=="function"?o(r,s):Ce.cloneElement(Ce.Children.only(o),s))},e}(Ce.Component);function Xi(){}Gn.contextType=zv,Gn.propTypes={},Gn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Xi,onEntering:Xi,onEntered:Xi,onExit:Xi,onExiting:Xi,onExited:Xi},Gn.UNMOUNTED=gs,Gn.EXITED=Kr,Gn.ENTERING=qr,Gn.ENTERED=Gi,Gn.EXITING=lh;var uh=function(n,e){return n&&e&&e.split(" ").forEach(function(t){return i=t,void((r=n).classList?r.classList.remove(i):typeof r.className=="string"?r.className=jv(r.className,i):r.setAttribute("class",jv(r.className&&r.className.baseVal||"",i)));var r,i})},ch=function(n){function e(){for(var r,i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];return(r=n.call.apply(n,[this].concat(o))||this).appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1];r.removeClasses(c,"exit"),r.addClass(c,d?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(a,l)},r.onEntering=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1]?"appear":"enter";r.addClass(c,d,"active"),r.props.onEntering&&r.props.onEntering(a,l)},r.onEntered=function(a,l){var u=r.resolveArguments(a,l),c=u[0],d=u[1]?"appear":"enter";r.removeClasses(c,d),r.addClass(c,d,"done"),r.props.onEntered&&r.props.onEntered(a,l)},r.onExit=function(a){var l=r.resolveArguments(a)[0];r.removeClasses(l,"appear"),r.removeClasses(l,"enter"),r.addClass(l,"exit","base"),r.props.onExit&&r.props.onExit(a)},r.onExiting=function(a){var l=r.resolveArguments(a)[0];r.addClass(l,"exit","active"),r.props.onExiting&&r.props.onExiting(a)},r.onExited=function(a){var l=r.resolveArguments(a)[0];r.removeClasses(l,"exit"),r.addClass(l,"exit","done"),r.props.onExited&&r.props.onExited(a)},r.resolveArguments=function(a,l){return r.props.nodeRef?[r.props.nodeRef.current,a]:[a,l]},r.getClassNames=function(a){var l=r.props.classNames,u=typeof l=="string",c=u?(u&&l?l+"-":"")+a:l[a];return{baseClassName:c,activeClassName:u?c+"-active":l[a+"Active"],doneClassName:u?c+"-done":l[a+"Done"]}},r}$v(e,n);var t=e.prototype;return t.addClass=function(r,i,o){var s=this.getClassNames(i)[o+"ClassName"],a=this.getClassNames("enter").doneClassName;i==="appear"&&o==="done"&&a&&(s+=" "+a),o==="active"&&r&&r.scrollTop,s&&(this.appliedClasses[i][o]=s,function(l,u){l&&u&&u.split(" ").forEach(function(c){return h=c,void((d=l).classList?d.classList.add(h):function(p,f){return p.classList?!!f&&p.classList.contains(f):(" "+(p.className.baseVal||p.className)+" ").indexOf(" "+f+" ")!==-1}(d,h)||(typeof d.className=="string"?d.className=d.className+" "+h:d.setAttribute("class",(d.className&&d.className.baseVal||"")+" "+h)));var d,h})}(r,s))},t.removeClasses=function(r,i){var o=this.appliedClasses[i],s=o.base,a=o.active,l=o.done;this.appliedClasses[i]={},s&&uh(r,s),a&&uh(r,a),l&&uh(r,l)},t.render=function(){var r=this.props;r.classNames;var i=Hv(r,["classNames"]);return Ce.createElement(Gn,sh({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(Ce.Component);ch.defaultProps={classNames:""},ch.propTypes={};const FC={ltr:["ArrowLeft","ArrowRight"],rtl:["ArrowRight","ArrowLeft"],ttb:["ArrowUp","ArrowDown"]};function Vv(n,{focused:e,setFocused:t,itemCount:r,dir:i,onConfirm:o,onSpace:s}){if(r===0)return!1;const a=c=>{var d,h,p;d=0,h=c,p=r-1,c=Math.max(d,Math.min(h,p)),t(c)},[l,u]=FC[i];switch(n){case l:return a(e-1),!0;case u:return a(e+1),!0;case" ":return!!s&&s();case"Enter":case"Tab":return o(),!0}return!1}function Wv({focused:n,setFocused:e,buttonId:t}){pt(()=>{const s=t(n);s&&document.getElementById(s)?.scrollIntoView({block:"nearest"})},[n,t]);const r=oe(s=>{const a=s.currentTarget.dataset.index;e(+a)},[e]),i=ce(()=>({role:"menu","aria-activedescendant":t(n)}),[n,t]),o=oe(s=>({onMouseMove:r,id:t(s),"data-index":s}),[r,t]);return{containerProps:i,itemProps:o}}function UC({className:n}){const[e,t]=ne([]),[r,i]=ne([]),[o,s]=ne(0),[a,l]=ne(0),u=Fv(oh),c=ce(()=>u&&new u.value.Database({}),[u]),d=Po(),h=ye(d.state$.suggestEmojiQuery);V(()=>{c&&(h?async function(){const v=await c.getPreferredSkinTone();l(v);let A=await c.getEmojiBySearchQuery(h);if(A=A.filter(_=>_.url||function(y){return y.version<=wg&&!$C.includes(y.unicode)}(_)),function(_,y){y.sort((T,S)=>{const b=T.shortcodes?.find(C=>C.startsWith(_)),O=S.shortcodes?.find(C=>C.startsWith(_));return b&&!O?-1:!b&&O?1:b&&O?b.length-O.length:0})}(h.substring(1),A),s(0),t(A),A.length>0&&i(A),h.endsWith(":")){const _=h.slice(1,-1),y=A.find(T=>T.shortcodes?.includes(_));y&&d.selectEmoji(Es(y,v))}}():t([]))},[h,d,c]);const p=oe(v=>{const A=e[v];return A&&"emoji-button-"+Es(A,a)},[e,a]),{containerProps:f,itemProps:m}=Wv({focused:o,setFocused:s,buttonId:p}),g=e.length>0;vl(()=>d.closeSuggester(),"[t-emoji-suggest-bar]",g),V(()=>{if(g)return d.listenKeydown("emoji",v=>Vv(v,{dir:"ltr",focused:o,setFocused:s,itemCount:e.length,onConfirm(){const A=e[o];Ie.defined(A),d.selectEmoji(Es(A,a))}})),()=>{d.listenKeydown("emoji",void 0)};d.listenKeydown("emoji",void 0)},[d,e,o,g,a]);const E=W(null);return N(ch,{in:g,timeout:100,classNames:"slide",mountOnEnter:!0,unmountOnExit:!0,nodeRef:E,children:N("div",{"t-emoji-suggest-bar":"",className:n,ref:E,...f,children:r.map((v,A)=>N(HC,{emoji:v,skinTone:a,focused:A===o,onSelect:_=>d.selectEmoji(_),...m(A)},Es(v,a)))})})}function Es(n,e){return dh(n)?Gv(n,e):n.name}function dh(n){return!!n.unicode}function HC(n){const{emoji:e,focused:t,skinTone:r,onSelect:i,...o}=n,s=(e.shortcodes??[]).join(", "),a=dh(e)?[e.unicode,s].join(", "):s;return N("button",{"t-focused":t?"":void 0,title:s,"aria-label":a,onClick:()=>i(Es(e,r)),...o,children:dh(e)?Gv(e,r):null})}function Gv(n,e){return n.skins?.find(r=>r.tone===e)?.unicode??n.unicode}const $C=["🏻","🏼","🏽","🏾","🏿"];var Xv=function(n){return n.reduce(function(e,t){var r=t[0],i=t[1];return e[r]=i,e},{})},Kv=typeof window<"u"&&window.document&&window.document.createElement?pt:V,Nt="top",Jt="bottom",Zt="right",Ct="left",hh="auto",vs=[Nt,Jt,Zt,Ct],Ki="start",As="end",qv="viewport",_s="popper",Jv=vs.reduce(function(n,e){return n.concat([e+"-"+Ki,e+"-"+As])},[]),Zv=[].concat(vs,[hh]).reduce(function(n,e){return n.concat([e,e+"-"+Ki,e+"-"+As])},[]),jC=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function bn(n){return n?(n.nodeName||"").toLowerCase():null}function jt(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Jr(n){return n instanceof jt(n).Element||n instanceof Element}function Qt(n){return n instanceof jt(n).HTMLElement||n instanceof HTMLElement}function ph(n){return typeof ShadowRoot<"u"&&(n instanceof jt(n).ShadowRoot||n instanceof ShadowRoot)}const YC={name:"applyStyles",enabled:!0,phase:"write",fn:function(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];Qt(o)&&bn(o)&&(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})},effect:function(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]).reduce(function(a,l){return a[l]="",a},{});Qt(i)&&bn(i)&&(Object.assign(i.style,s),Object.keys(o).forEach(function(a){i.removeAttribute(a)}))})}},requires:["computeStyles"]};function Nn(n){return n.split("-")[0]}var Zr=Math.max,Al=Math.min,qi=Math.round;function fh(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Qv(){return!/^((?!chrome|android).)*safari/i.test(fh())}function Ji(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),i=1,o=1;e&&Qt(n)&&(i=n.offsetWidth>0&&qi(r.width)/n.offsetWidth||1,o=n.offsetHeight>0&&qi(r.height)/n.offsetHeight||1);var s=(Jr(n)?jt(n):window).visualViewport,a=!Qv()&&t,l=(r.left+(a&&s?s.offsetLeft:0))/i,u=(r.top+(a&&s?s.offsetTop:0))/o,c=r.width/i,d=r.height/o;return{width:c,height:d,top:u,right:l+c,bottom:u+d,left:l,x:l,y:u}}function mh(n){var e=Ji(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function eA(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&ph(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Xn(n){return jt(n).getComputedStyle(n)}function zC(n){return["table","td","th"].indexOf(bn(n))>=0}function Er(n){return((Jr(n)?n.ownerDocument:n.document)||window.document).documentElement}function _l(n){return bn(n)==="html"?n:n.assignedSlot||n.parentNode||(ph(n)?n.host:null)||Er(n)}function tA(n){return Qt(n)&&Xn(n).position!=="fixed"?n.offsetParent:null}function ys(n){for(var e=jt(n),t=tA(n);t&&zC(t)&&Xn(t).position==="static";)t=tA(t);return t&&(bn(t)==="html"||bn(t)==="body"&&Xn(t).position==="static")?e:t||function(r){var i=/firefox/i.test(fh());if(/Trident/i.test(fh())&&Qt(r)&&Xn(r).position==="fixed")return null;var o=_l(r);for(ph(o)&&(o=o.host);Qt(o)&&["html","body"].indexOf(bn(o))<0;){var s=Xn(o);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||i&&s.willChange==="filter"||i&&s.filter&&s.filter!=="none")return o;o=o.parentNode}return null}(n)||e}function gh(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function Os(n,e,t){return Zr(n,Al(e,t))}function nA(n){return Object.assign({},{top:0,right:0,bottom:0,left:0},n)}function rA(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}const VC={name:"arrow",enabled:!0,phase:"main",fn:function(n){var e,t=n.state,r=n.name,i=n.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,a=Nn(t.placement),l=gh(a),u=[Ct,Zt].indexOf(a)>=0?"height":"width";if(o&&s){var c=function(b,O){return nA(typeof(b=typeof b=="function"?b(Object.assign({},O.rects,{placement:O.placement})):b)!="number"?b:rA(b,vs))}(i.padding,t),d=mh(o),h=l==="y"?Nt:Ct,p=l==="y"?Jt:Zt,f=t.rects.reference[u]+t.rects.reference[l]-s[l]-t.rects.popper[u],m=s[l]-t.rects.reference[l],g=ys(o),E=g?l==="y"?g.clientHeight||0:g.clientWidth||0:0,v=f/2-m/2,A=c[h],_=E-d[u]-c[p],y=E/2-d[u]/2+v,T=Os(A,y,_),S=l;t.modifiersData[r]=((e={})[S]=T,e.centerOffset=T-y,e)}},effect:function(n){var e=n.state,t=n.options.element,r=t===void 0?"[data-popper-arrow]":t;r!=null&&(typeof r!="string"||(r=e.elements.popper.querySelector(r)))&&eA(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Zi(n){return n.split("-")[1]}var WC={top:"auto",right:"auto",bottom:"auto",left:"auto"};function iA(n){var e,t=n.popper,r=n.popperRect,i=n.placement,o=n.variation,s=n.offsets,a=n.position,l=n.gpuAcceleration,u=n.adaptive,c=n.roundOffsets,d=n.isFixed,h=s.x,p=h===void 0?0:h,f=s.y,m=f===void 0?0:f,g=typeof c=="function"?c({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var E=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),A=Ct,_=Nt,y=window;if(u){var T=ys(t),S="clientHeight",b="clientWidth";T===jt(t)&&Xn(T=Er(t)).position!=="static"&&a==="absolute"&&(S="scrollHeight",b="scrollWidth"),(i===Nt||(i===Ct||i===Zt)&&o===As)&&(_=Jt,m-=(d&&T===y&&y.visualViewport?y.visualViewport.height:T[S])-r.height,m*=l?1:-1),(i===Ct||(i===Nt||i===Jt)&&o===As)&&(A=Zt,p-=(d&&T===y&&y.visualViewport?y.visualViewport.width:T[b])-r.width,p*=l?1:-1)}var O,C=Object.assign({position:a},u&&WC),w=c===!0?function(I,F){var x=I.x,$=I.y,k=F.devicePixelRatio||1;return{x:qi(x*k)/k||0,y:qi($*k)/k||0}}({x:p,y:m},jt(t)):{x:p,y:m};return p=w.x,m=w.y,l?Object.assign({},C,((O={})[_]=v?"0":"",O[A]=E?"0":"",O.transform=(y.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",O)):Object.assign({},C,((e={})[_]=v?m+"px":"",e[A]=E?p+"px":"",e.transform="",e))}const GC={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(n){var e=n.state,t=n.options,r=t.gpuAcceleration,i=r===void 0||r,o=t.adaptive,s=o===void 0||o,a=t.roundOffsets,l=a===void 0||a,u={placement:Nn(e.placement),variation:Zi(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,iA(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,iA(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var yl={passive:!0};const XC={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(n){var e=n.state,t=n.instance,r=n.options,i=r.scroll,o=i===void 0||i,s=r.resize,a=s===void 0||s,l=jt(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",t.update,yl)}),a&&l.addEventListener("resize",t.update,yl),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",t.update,yl)}),a&&l.removeEventListener("resize",t.update,yl)}},data:{}};var KC={left:"right",right:"left",bottom:"top",top:"bottom"};function Ol(n){return n.replace(/left|right|bottom|top/g,function(e){return KC[e]})}var qC={start:"end",end:"start"};function oA(n){return n.replace(/start|end/g,function(e){return qC[e]})}function Eh(n){var e=jt(n);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function vh(n){return Ji(Er(n)).left+Eh(n).scrollLeft}function Ah(n){var e=Xn(n),t=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+r)}function sA(n){return["html","body","#document"].indexOf(bn(n))>=0?n.ownerDocument.body:Qt(n)&&Ah(n)?n:sA(_l(n))}function Ts(n,e){var t;e===void 0&&(e=[]);var r=sA(n),i=r===((t=n.ownerDocument)==null?void 0:t.body),o=jt(r),s=i?[o].concat(o.visualViewport||[],Ah(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(Ts(_l(s)))}function _h(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function aA(n,e,t){return e===qv?_h(function(r,i){var o=jt(r),s=Er(r),a=o.visualViewport,l=s.clientWidth,u=s.clientHeight,c=0,d=0;if(a){l=a.width,u=a.height;var h=Qv();(h||!h&&i==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}return{width:l,height:u,x:c+vh(r),y:d}}(n,t)):Jr(e)?function(r,i){var o=Ji(r,!1,i==="fixed");return o.top=o.top+r.clientTop,o.left=o.left+r.clientLeft,o.bottom=o.top+r.clientHeight,o.right=o.left+r.clientWidth,o.width=r.clientWidth,o.height=r.clientHeight,o.x=o.left,o.y=o.top,o}(e,t):_h(function(r){var i,o=Er(r),s=Eh(r),a=(i=r.ownerDocument)==null?void 0:i.body,l=Zr(o.scrollWidth,o.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),u=Zr(o.scrollHeight,o.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),c=-s.scrollLeft+vh(r),d=-s.scrollTop;return Xn(a||o).direction==="rtl"&&(c+=Zr(o.clientWidth,a?a.clientWidth:0)-l),{width:l,height:u,x:c,y:d}}(Er(n)))}function JC(n,e,t,r){var i=e==="clippingParents"?function(l){var u=Ts(_l(l)),c=["absolute","fixed"].indexOf(Xn(l).position)>=0&&Qt(l)?ys(l):l;return Jr(c)?u.filter(function(d){return Jr(d)&&eA(d,c)&&bn(d)!=="body"}):[]}(n):[].concat(e),o=[].concat(i,[t]),s=o[0],a=o.reduce(function(l,u){var c=aA(n,u,r);return l.top=Zr(c.top,l.top),l.right=Al(c.right,l.right),l.bottom=Al(c.bottom,l.bottom),l.left=Zr(c.left,l.left),l},aA(n,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function lA(n){var e,t=n.reference,r=n.element,i=n.placement,o=i?Nn(i):null,s=i?Zi(i):null,a=t.x+t.width/2-r.width/2,l=t.y+t.height/2-r.height/2;switch(o){case Nt:e={x:a,y:t.y-r.height};break;case Jt:e={x:a,y:t.y+t.height};break;case Zt:e={x:t.x+t.width,y:l};break;case Ct:e={x:t.x-r.width,y:l};break;default:e={x:t.x,y:t.y}}var u=o?gh(o):null;if(u!=null){var c=u==="y"?"height":"width";switch(s){case Ki:e[u]=e[u]-(t[c]/2-r[c]/2);break;case As:e[u]=e[u]+(t[c]/2-r[c]/2)}}return e}function Ss(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=r===void 0?n.placement:r,o=t.strategy,s=o===void 0?n.strategy:o,a=t.boundary,l=a===void 0?"clippingParents":a,u=t.rootBoundary,c=u===void 0?qv:u,d=t.elementContext,h=d===void 0?_s:d,p=t.altBoundary,f=p!==void 0&&p,m=t.padding,g=m===void 0?0:m,E=nA(typeof g!="number"?g:rA(g,vs)),v=h===_s?"reference":_s,A=n.rects.popper,_=n.elements[f?v:h],y=JC(Jr(_)?_:_.contextElement||Er(n.elements.popper),l,c,s),T=Ji(n.elements.reference),S=lA({reference:T,element:A,strategy:"absolute",placement:i}),b=_h(Object.assign({},A,S)),O=h===_s?b:T,C={top:y.top-O.top+E.top,bottom:O.bottom-y.bottom+E.bottom,left:y.left-O.left+E.left,right:O.right-y.right+E.right},w=n.modifiersData.offset;if(h===_s&&w){var I=w[i];Object.keys(C).forEach(function(F){var x=[Zt,Jt].indexOf(F)>=0?1:-1,$=[Nt,Jt].indexOf(F)>=0?"y":"x";C[F]+=I[$]*x})}return C}function ZC(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=t.boundary,o=t.rootBoundary,s=t.padding,a=t.flipVariations,l=t.allowedAutoPlacements,u=l===void 0?Zv:l,c=Zi(r),d=c?a?Jv:Jv.filter(function(f){return Zi(f)===c}):vs,h=d.filter(function(f){return u.indexOf(f)>=0});h.length===0&&(h=d);var p=h.reduce(function(f,m){return f[m]=Ss(n,{placement:m,boundary:i,rootBoundary:o,padding:s})[Nn(m)],f},{});return Object.keys(p).sort(function(f,m){return p[f]-p[m]})}const QC={name:"flip",enabled:!0,phase:"main",fn:function(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var i=t.mainAxis,o=i===void 0||i,s=t.altAxis,a=s===void 0||s,l=t.fallbackPlacements,u=t.padding,c=t.boundary,d=t.rootBoundary,h=t.altBoundary,p=t.flipVariations,f=p===void 0||p,m=t.allowedAutoPlacements,g=e.options.placement,E=Nn(g),v=l||(E===g||!f?[Ol(g)]:function(j){if(Nn(j)===hh)return[];var re=Ol(j);return[oA(j),re,oA(re)]}(g)),A=[g].concat(v).reduce(function(j,re){return j.concat(Nn(re)===hh?ZC(e,{placement:re,boundary:c,rootBoundary:d,padding:u,flipVariations:f,allowedAutoPlacements:m}):re)},[]),_=e.rects.reference,y=e.rects.popper,T=new Map,S=!0,b=A[0],O=0;O<A.length;O++){var C=A[O],w=Nn(C),I=Zi(C)===Ki,F=[Nt,Jt].indexOf(w)>=0,x=F?"width":"height",$=Ss(e,{placement:C,boundary:c,rootBoundary:d,altBoundary:h,padding:u}),k=F?I?Zt:Ct:I?Jt:Nt;_[x]>y[x]&&(k=Ol(k));var M=Ol(k),Y=[];if(o&&Y.push($[w]<=0),a&&Y.push($[k]<=0,$[M]<=0),Y.every(function(j){return j})){b=C,S=!1;break}T.set(C,Y)}if(S)for(var L=function(j){var re=A.find(function(te){var D=T.get(te);if(D)return D.slice(0,j).every(function(Z){return Z})});if(re)return b=re,"break"},J=f?3:1;J>0&&L(J)!=="break";J--);e.placement!==b&&(e.modifiersData[r]._skip=!0,e.placement=b,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function uA(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function cA(n){return[Nt,Zt,Jt,Ct].some(function(e){return n[e]>=0})}const eI={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(n){var e=n.state,t=n.options,r=n.name,i=t.offset,o=i===void 0?[0,0]:i,s=Zv.reduce(function(c,d){return c[d]=function(h,p,f){var m=Nn(h),g=[Ct,Nt].indexOf(m)>=0?-1:1,E=typeof f=="function"?f(Object.assign({},p,{placement:h})):f,v=E[0],A=E[1];return v=v||0,A=(A||0)*g,[Ct,Zt].indexOf(m)>=0?{x:A,y:v}:{x:v,y:A}}(d,e.rects,o),c},{}),a=s[e.placement],l=a.x,u=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=u),e.modifiersData[r]=s}},tI={name:"preventOverflow",enabled:!0,phase:"main",fn:function(n){var e=n.state,t=n.options,r=n.name,i=t.mainAxis,o=i===void 0||i,s=t.altAxis,a=s!==void 0&&s,l=t.boundary,u=t.rootBoundary,c=t.altBoundary,d=t.padding,h=t.tether,p=h===void 0||h,f=t.tetherOffset,m=f===void 0?0:f,g=Ss(e,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),E=Nn(e.placement),v=Zi(e.placement),A=!v,_=gh(E),y=_==="x"?"y":"x",T=e.modifiersData.popperOffsets,S=e.rects.reference,b=e.rects.popper,O=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,C=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),w=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,I={x:0,y:0};if(T){if(o){var F,x=_==="y"?Nt:Ct,$=_==="y"?Jt:Zt,k=_==="y"?"height":"width",M=T[_],Y=M+g[x],L=M-g[$],J=p?-b[k]/2:0,j=v===Ki?S[k]:b[k],re=v===Ki?-b[k]:-S[k],te=e.elements.arrow,D=p&&te?mh(te):{width:0,height:0},Z=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Z[x],se=Z[$],U=Os(0,S[k],D[k]),de=A?S[k]/2-J-U-ee-C.mainAxis:j-U-ee-C.mainAxis,fe=A?-S[k]/2+J+U+se+C.mainAxis:re+U+se+C.mainAxis,Ne=e.elements.arrow&&ys(e.elements.arrow),ge=Ne?_==="y"?Ne.clientTop||0:Ne.clientLeft||0:0,he=(F=w?.[_])!=null?F:0,et=M+fe-he,rn=Os(p?Al(Y,M+de-he-ge):Y,M,p?Zr(L,et):L);T[_]=rn,I[_]=rn-M}if(a){var Vt,zs=_==="x"?Nt:Ct,go=_==="x"?Jt:Zt,gn=T[y],Eo=y==="y"?"height":"width",ui=gn+g[zs],Vs=gn-g[go],Ws=[Nt,Ct].indexOf(E)!==-1,vu=(Vt=w?.[y])!=null?Vt:0,Gs=Ws?ui:gn-S[Eo]-b[Eo]-vu+C.altAxis,Au=Ws?gn+S[Eo]+b[Eo]-vu-C.altAxis:Vs,_u=p&&Ws?function(vo,Xs,Ao){var Ks=Os(vo,Xs,Ao);return Ks>Ao?Ao:Ks}(Gs,gn,Au):Os(p?Gs:ui,gn,p?Au:Vs);T[y]=_u,I[y]=_u-gn}e.modifiersData[r]=I}},requiresIfExists:["offset"]};function nI(n,e,t){t===void 0&&(t=!1);var r,i,o=Qt(e),s=Qt(e)&&function(d){var h=d.getBoundingClientRect(),p=qi(h.width)/d.offsetWidth||1,f=qi(h.height)/d.offsetHeight||1;return p!==1||f!==1}(e),a=Er(e),l=Ji(n,s,t),u={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!t)&&((bn(e)!=="body"||Ah(a))&&(u=(r=e)!==jt(r)&&Qt(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:Eh(r)),Qt(e)?((c=Ji(e,!0)).x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=vh(a))),{x:l.left+u.scrollLeft-c.x,y:l.top+u.scrollTop-c.y,width:l.width,height:l.height}}function rI(n){var e=new Map,t=new Set,r=[];function i(o){t.add(o.name),[].concat(o.requires||[],o.requiresIfExists||[]).forEach(function(s){if(!t.has(s)){var a=e.get(s);a&&i(a)}}),r.push(o)}return n.forEach(function(o){e.set(o.name,o)}),n.forEach(function(o){t.has(o.name)||i(o)}),r}function iI(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}var dA={placement:"bottom",modifiers:[],strategy:"absolute"};function hA(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function oI(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,r=t===void 0?[]:t,i=e.defaultOptions,o=i===void 0?dA:i;return function(s,a,l){l===void 0&&(l=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},dA,o),modifiersData:{},elements:{reference:s,popper:a},attributes:{},styles:{}},c=[],d=!1,h={state:u,setOptions:function(f){var m=typeof f=="function"?f(u.options):f;p(),u.options=Object.assign({},o,u.options,m),u.scrollParents={reference:Jr(s)?Ts(s):s.contextElement?Ts(s.contextElement):[],popper:Ts(a)};var g=function(E){var v=rI(E);return jC.reduce(function(A,_){return A.concat(v.filter(function(y){return y.phase===_}))},[])}(function(E){var v=E.reduce(function(A,_){var y=A[_.name];return A[_.name]=y?Object.assign({},y,_,{options:Object.assign({},y.options,_.options),data:Object.assign({},y.data,_.data)}):_,A},{});return Object.keys(v).map(function(A){return v[A]})}([].concat(r,u.options.modifiers)));return u.orderedModifiers=g.filter(function(E){return E.enabled}),u.orderedModifiers.forEach(function(E){var v=E.name,A=E.options,_=A===void 0?{}:A,y=E.effect;if(typeof y=="function"){var T=y({state:u,name:v,instance:h,options:_}),S=function(){};c.push(T||S)}}),h.update()},forceUpdate:function(){if(!d){var f=u.elements,m=f.reference,g=f.popper;if(hA(m,g)){u.rects={reference:nI(m,ys(g),u.options.strategy==="fixed"),popper:mh(g)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(S){return u.modifiersData[S.name]=Object.assign({},S.data)});for(var E=0;E<u.orderedModifiers.length;E++)if(u.reset!==!0){var v=u.orderedModifiers[E],A=v.fn,_=v.options,y=_===void 0?{}:_,T=v.name;typeof A=="function"&&(u=A({state:u,options:y,name:T,instance:h})||u)}else u.reset=!1,E=-1}}},update:iI(function(){return new Promise(function(f){h.forceUpdate(),f(u)})}),destroy:function(){p(),d=!0}};if(!hA(s,a))return h;function p(){c.forEach(function(f){return f()}),c=[]}return h.setOptions(l).then(function(f){!d&&l.onFirstUpdate&&l.onFirstUpdate(f)}),h}}var sI=oI({defaultModifiers:[XC,{name:"popperOffsets",enabled:!0,phase:"read",fn:function(n){var e=n.state,t=n.name;e.modifiersData[t]=lA({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},GC,YC,eI,QC,tI,VC,{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(n){var e=n.state,t=n.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=Ss(e,{elementContext:"reference"}),a=Ss(e,{altBoundary:!0}),l=uA(s,r),u=uA(a,i,o),c=cA(l),d=cA(u);e.modifiersData[t]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}}]}),aI=typeof Element<"u",lI=typeof Map=="function",uI=typeof Set=="function",cI=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Tl(n,e){if(n===e)return!0;if(n&&e&&typeof n=="object"&&typeof e=="object"){if(n.constructor!==e.constructor)return!1;var t,r,i,o;if(Array.isArray(n)){if((t=n.length)!=e.length)return!1;for(r=t;r--!=0;)if(!Tl(n[r],e[r]))return!1;return!0}if(lI&&n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(o=n.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;for(o=n.entries();!(r=o.next()).done;)if(!Tl(r.value[1],e.get(r.value[0])))return!1;return!0}if(uI&&n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(o=n.entries();!(r=o.next()).done;)if(!e.has(r.value[0]))return!1;return!0}if(cI&&ArrayBuffer.isView(n)&&ArrayBuffer.isView(e)){if((t=n.length)!=e.length)return!1;for(r=t;r--!=0;)if(n[r]!==e[r])return!1;return!0}if(n.constructor===RegExp)return n.source===e.source&&n.flags===e.flags;if(n.valueOf!==Object.prototype.valueOf&&typeof n.valueOf=="function"&&typeof e.valueOf=="function")return n.valueOf()===e.valueOf();if(n.toString!==Object.prototype.toString&&typeof n.toString=="function"&&typeof e.toString=="function")return n.toString()===e.toString();if((t=(i=Object.keys(n)).length)!==Object.keys(e).length)return!1;for(r=t;r--!=0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;if(aI&&n instanceof Element)return!1;for(r=t;r--!=0;)if((i[r]!=="_owner"&&i[r]!=="__v"&&i[r]!=="__o"||!n.$$typeof)&&!Tl(n[i[r]],e[i[r]]))return!1;return!0}return n!=n&&e!=e}var dI=function(n,e){try{return Tl(n,e)}catch(t){if((t.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw t}};const hI=ha(dI);var pI=[];function fI(n){const{anchorSelector:e,children:t,...r}=n,i=ce(()=>document.querySelector(e),[e]),[o,s]=ne(null),{styles:a,attributes:l}=function(u,c,d){d===void 0&&(d={});var h=W(null),p={onFirstUpdate:d.onFirstUpdate,placement:d.placement||"bottom",strategy:d.strategy||"absolute",modifiers:d.modifiers||pI},f=ne({styles:{popper:{position:p.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),m=f[0],g=f[1],E=ce(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(_){var y=_.state,T=Object.keys(y.elements);Do(function(){g({styles:Xv(T.map(function(S){return[S,y.styles[S]||{}]})),attributes:Xv(T.map(function(S){return[S,y.attributes[S]]}))})})},requires:["computeStyles"]}},[]),v=ce(function(){var _={onFirstUpdate:p.onFirstUpdate,placement:p.placement,strategy:p.strategy,modifiers:[].concat(p.modifiers,[E,{name:"applyStyles",enabled:!1}])};return hI(h.current,_)?h.current||_:(h.current=_,_)},[p.onFirstUpdate,p.placement,p.strategy,p.modifiers,E]),A=W();return Kv(function(){A.current&&A.current.setOptions(v)},[v]),Kv(function(){if(u!=null&&c!=null){var _=(d.createPopper||sI)(u,c,v);return A.current=_,function(){_.destroy(),A.current=null}}},[u,c,d.createPopper]),{state:A.current?A.current.state:null,styles:m.styles,attributes:m.attributes,update:A.current?A.current.update:null,forceUpdate:A.current?A.current.forceUpdate:null}}(i,o,{modifiers:[],placement:"top-start"});return N("div",{ref:s,style:{...a.popper,zIndex:1e3},...l.popper,...r,children:n.children})}function mI(n){const{className:e}=n,t=Re(),r=ye(()=>t.mentionableUsers$.get()),[i,o]=ne(0),s=Po(),a=ye(s.state$.suggestMentionQuery),l=ce(()=>Object.fromEntries(r.map(f=>[f.id,eS(f.name)])),[r]),u=ce(()=>{if(!a)return[];const f=pA(a);return f===""?r:r.filter(m=>l[m.id].some(g=>function(E,v){return Qf(E.substring(0,v.length),v)}(g,f)))},[a,r,l]),c=W(void 0);V(()=>{if(c.current){const f=u.findIndex(m=>m.id===c.current);o(f===-1?0:f)}},[u]),V(()=>{c.current=u[i]?.id},[i,u]);const d=oe(f=>{const m=u[f]?.id;return m&&"mention-button-"+m},[u]),{containerProps:h,itemProps:p}=Wv({focused:i,setFocused:o,buttonId:d});return V(()=>{if(u.length!==0)return s.listenKeydown("mention",f=>Vv(f,{dir:"ttb",focused:i,setFocused:o,itemCount:u.length,onSpace(){if(a){const m=u[i];if(Qf(m.name,pA(a)))return s.selectMention(m),!0}return!1},onConfirm(){const m=u[i];s.selectMention(m)}})),()=>{s.listenKeydown("mention",void 0)}},[s,i,u,a]),vl(()=>s.closeSuggester(),"[t-mention-suggest-list]",u.length>0),u.length===0?null:N(fI,{className:e,"t-mention-suggest-list":"",...h,anchorSelector:".ProseMirror-suggestion",children:u.map((f,m)=>N(gI,{user:f,isFocused:m===i,onSelect:()=>s.selectMention(f),...p(m)},f.id))})}const gI=Ce.memo(function(n){const{user:e,isFocused:t,onSelect:r,...i}=n;return N("button",{className:t?"focused":"",onClick:()=>r(e.id),...i,children:e.name})});function pA(n){return Ie(n[0]==="@"),n.substring(1)}function bs(n,e,{checkForDefaultPrevented:t=!0}={}){return function(r){if(n?.(r),t===!1||!r.defaultPrevented)return e?.(r)}}function fA(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function Sl(...n){return e=>{let t=!1;const r=n.map(i=>{const o=fA(i,e);return t||typeof o!="function"||(t=!0),o});if(t)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():fA(n[i],null)}}}}function $e(...n){return oe(Sl(...n),n)}function Qr(n,e=[]){let t=[];const r=()=>{const i=t.map(o=>kt(o));return function(o){const s=o?.[n]||i;return ce(()=>({[`__scope${n}`]:{...o,[n]:s}}),[o,s])}};return r.scopeName=n,[function(i,o){const s=kt(o),a=t.length;t=[...t,o];const l=u=>{const{scope:c,children:d,...h}=u,p=c?.[n]?.[a]||s,f=ce(()=>h,Object.values(h));return N(p.Provider,{value:f,children:d})};return l.displayName=i+"Provider",[l,function(u,c){const d=qe(c?.[n]?.[a]||s);if(d)return d;if(o!==void 0)return o;throw new Error(`\`${u}\` must be used within \`${i}\``)}]},EI(r,...e)]}function EI(...n){const e=n[0];if(n.length===1)return e;const t=()=>{const r=n.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(i){const o=r.reduce((s,{useScope:a,scopeName:l})=>({...s,...a(i)[`__scope${l}`]}),{});return ce(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return t.scopeName=e.scopeName,t}function yh(n,e,{checkForDefaultPrevented:t=!0}={}){return function(r){if(n?.(r),t===!1||!r.defaultPrevented)return e?.(r)}}function Ns(n){const e=vI(n),t=Q((r,i)=>{const{children:o,...s}=r,a=vn.toArray(o),l=a.find(_I);if(l){const u=l.props.children,c=a.map(d=>d===l?vn.count(u)>1?vn.only(null):Bn(u)?u.props.children:null:d);return N(e,{...s,ref:i,children:Bn(u)?Nr(u,void 0,c):null})}return N(e,{...s,ref:i,children:o})});return t.displayName=`${n}.Slot`,t}function vI(n){const e=Q((t,r)=>{const{children:i,...o}=t;if(Bn(i)){const s=function(l){let u=Object.getOwnPropertyDescriptor(l.props,"ref")?.get,c=u&&"isReactWarning"in u&&u.isReactWarning;return c?l.ref:(u=Object.getOwnPropertyDescriptor(l,"ref")?.get,c=u&&"isReactWarning"in u&&u.isReactWarning,c?l.props.ref:l.props.ref||l.ref)}(i),a=function(l,u){const c={...u};for(const d in u){const h=l[d],p=u[d];/^on[A-Z]/.test(d)?h&&p?c[d]=(...f)=>{const m=p(...f);return h(...f),m}:h&&(c[d]=h):d==="style"?c[d]={...h,...p}:d==="className"&&(c[d]=[h,p].filter(Boolean).join(" "))}return{...l,...c}}(o,i.props);return i.type!==xe&&(a.ref=r?Sl(r,s):s),Nr(i,a)}return vn.count(i)>1?vn.only(null):null});return e.displayName=`${n}.SlotClone`,e}var AI=Symbol("radix.slottable");function _I(n){return Bn(n)&&typeof n.type=="function"&&"__radixId"in n.type&&n.type.__radixId===AI}var Ke=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((n,e)=>{const t=Ns(`Primitive.${e}`),r=Q((i,o)=>{const{asChild:s,...a}=i,l=s?t:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),N(l,{...a,ref:o})});return r.displayName=`Primitive.${e}`,{...n,[e]:r}},{});function Oh(n,e){n&&Do(()=>n.dispatchEvent(e))}function en(n){const e=W(n);return V(()=>{e.current=n}),ce(()=>(...t)=>e.current?.(...t),[])}function mA(n,e=globalThis?.document){const t=en(n);V(()=>{const r=i=>{i.key==="Escape"&&t(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[t,e])}var gA,Th="dismissableLayer.update",yI="dismissableLayer.pointerDownOutside",OI="dismissableLayer.focusOutside",EA=kt({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vA=Q((n,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=n,u=qe(EA),[c,d]=ne(null),h=c?.ownerDocument??globalThis?.document,[,p]=ne({}),f=$e(e,S=>d(S)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),E=m.indexOf(g),v=c?m.indexOf(c):-1,A=u.layersWithOutsidePointerEventsDisabled.size>0,_=v>=E,y=function(S,b=globalThis?.document){const O=en(S),C=W(!1),w=W(()=>{});return V(()=>{const I=x=>{if(x.target&&!C.current){let $=function(){_A(yI,O,k,{discrete:!0})};const k={originalEvent:x};x.pointerType==="touch"?(b.removeEventListener("click",w.current),w.current=$,b.addEventListener("click",w.current,{once:!0})):$()}else b.removeEventListener("click",w.current);C.current=!1},F=window.setTimeout(()=>{b.addEventListener("pointerdown",I)},0);return()=>{window.clearTimeout(F),b.removeEventListener("pointerdown",I),b.removeEventListener("click",w.current)}},[b,O]),{onPointerDownCapture:()=>C.current=!0}}(S=>{const b=S.target,O=[...u.branches].some(C=>C.contains(b));_&&!O&&(i?.(S),s?.(S),S.defaultPrevented||a?.())},h),T=function(S,b=globalThis?.document){const O=en(S),C=W(!1);return V(()=>{const w=I=>{I.target&&!C.current&&_A(OI,O,{originalEvent:I},{discrete:!1})};return b.addEventListener("focusin",w),()=>b.removeEventListener("focusin",w)},[b,O]),{onFocusCapture:()=>C.current=!0,onBlurCapture:()=>C.current=!1}}(S=>{const b=S.target;[...u.branches].some(O=>O.contains(b))||(o?.(S),s?.(S),S.defaultPrevented||a?.())},h);return mA(S=>{v===u.layers.size-1&&(r?.(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},h),V(()=>{if(c)return t&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(gA=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),AA(),()=>{t&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=gA)}},[c,h,t,u]),V(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),AA())},[c,u]),V(()=>{const S=()=>p({});return document.addEventListener(Th,S),()=>document.removeEventListener(Th,S)},[]),N(Ke.div,{...l,ref:f,style:{pointerEvents:A?_?"auto":"none":void 0,...n.style},onFocusCapture:yh(n.onFocusCapture,T.onFocusCapture),onBlurCapture:yh(n.onBlurCapture,T.onBlurCapture),onPointerDownCapture:yh(n.onPointerDownCapture,y.onPointerDownCapture)})});vA.displayName="DismissableLayer";var TI=Q((n,e)=>{const t=qe(EA),r=W(null),i=$e(e,r);return V(()=>{const o=r.current;if(o)return t.branches.add(o),()=>{t.branches.delete(o)}},[t.branches]),N(Ke.div,{...n,ref:i})});function AA(){const n=new CustomEvent(Th);document.dispatchEvent(n)}function _A(n,e,t,{discrete:r}){const i=t.originalEvent.target,o=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?Oh(i,o):i.dispatchEvent(o)}TI.displayName="DismissableLayerBranch";var Sh=0;function yA(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var bh="focusScope.autoFocusOnMount",Nh="focusScope.autoFocusOnUnmount",OA={bubbles:!1,cancelable:!0},Ch=Q((n,e)=>{const{loop:t=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=n,[a,l]=ne(null),u=en(i),c=en(o),d=W(null),h=$e(e,m=>l(m)),p=W({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;V(()=>{if(r){let m=function(A){if(p.paused||!a)return;const _=A.target;a.contains(_)?d.current=_:vr(d.current,{select:!0})},g=function(A){if(p.paused||!a)return;const _=A.relatedTarget;_!==null&&(a.contains(_)||vr(d.current,{select:!0}))},E=function(A){if(document.activeElement===document.body)for(const _ of A)_.removedNodes.length>0&&vr(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",g);const v=new MutationObserver(E);return a&&v.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",g),v.disconnect()}}},[r,a,p.paused]),V(()=>{if(a){bA.add(p);const g=document.activeElement;if(!a.contains(g)){const E=new CustomEvent(bh,OA);a.addEventListener(bh,u),a.dispatchEvent(E),E.defaultPrevented||(function(v,{select:A=!1}={}){const _=document.activeElement;for(const y of v)if(vr(y,{select:A}),document.activeElement!==_)return}((m=TA(a),m.filter(v=>v.tagName!=="A")),{select:!0}),document.activeElement===g&&vr(a))}return()=>{a.removeEventListener(bh,u),setTimeout(()=>{const E=new CustomEvent(Nh,OA);a.addEventListener(Nh,c),a.dispatchEvent(E),E.defaultPrevented||vr(g??document.body,{select:!0}),a.removeEventListener(Nh,c),bA.remove(p)},0)}}var m},[a,u,c,p]);const f=oe(m=>{if(!t&&!r||p.paused)return;const g=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,E=document.activeElement;if(g&&E){const v=m.currentTarget,[A,_]=function(y){const T=TA(y),S=SA(T,y),b=SA(T.reverse(),y);return[S,b]}(v);A&&_?m.shiftKey||E!==_?m.shiftKey&&E===A&&(m.preventDefault(),t&&vr(_,{select:!0})):(m.preventDefault(),t&&vr(A,{select:!0})):E===v&&m.preventDefault()}},[t,r,p.paused]);return N(Ke.div,{tabIndex:-1,...s,ref:h,onKeyDown:f})});function TA(n){const e=[],t=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e}function SA(n,e){for(const t of n)if(!SI(t,{upTo:e}))return t}function SI(n,{upTo:e}){if(getComputedStyle(n).visibility==="hidden")return!0;for(;n;){if(e!==void 0&&n===e)return!1;if(getComputedStyle(n).display==="none")return!0;n=n.parentElement}return!1}function vr(n,{select:e=!1}={}){if(n&&n.focus){const t=document.activeElement;n.focus({preventScroll:!0}),n!==t&&function(r){return r instanceof HTMLInputElement&&"select"in r}(n)&&e&&n.select()}}Ch.displayName="FocusScope";var bA=function(){let n=[];return{add(e){const t=n[0];e!==t&&t?.pause(),n=NA(n,e),n.unshift(e)},remove(e){n=NA(n,e),n[0]?.resume()}}}();function NA(n,e){const t=[...n],r=t.indexOf(e);return r!==-1&&t.splice(r,1),t}var hn=globalThis?.document?pt:()=>{},bI=Ju[" useId ".trim().toString()]||(()=>{}),NI=0;function bl(n){const[e,t]=ne(bI());return hn(()=>{n||t(r=>r??String(NI++))},[n]),n||(e?`radix-${e}`:"")}const CI=["top","right","bottom","left"],Ar=Math.min,Yt=Math.max,Nl=Math.round,Cl=Math.floor,Cn=n=>({x:n,y:n}),II={left:"right",right:"left",bottom:"top",top:"bottom"},wI={start:"end",end:"start"};function Ih(n,e,t){return Yt(n,Ar(e,t))}function Kn(n,e){return typeof n=="function"?n(e):n}function qn(n){return n.split("-")[0]}function Qi(n){return n.split("-")[1]}function wh(n){return n==="x"?"y":"x"}function Rh(n){return n==="y"?"height":"width"}function In(n){return["top","bottom"].includes(qn(n))?"y":"x"}function Dh(n){return wh(In(n))}function kh(n){return n.replace(/start|end/g,e=>wI[e])}function Il(n){return n.replace(/left|right|bottom|top/g,e=>II[e])}function CA(n){return typeof n!="number"?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(n):{top:n,right:n,bottom:n,left:n}}function wl(n){const{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function IA(n,e,t){let{reference:r,floating:i}=n;const o=In(e),s=Dh(e),a=Rh(s),l=qn(e),u=o==="y",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(l){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(Qi(e)){case"start":p[s]-=h*(t&&u?-1:1);break;case"end":p[s]+=h*(t&&u?-1:1)}return p}async function Cs(n,e){var t;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=n,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=Kn(e,n),f=CA(p),m=a[h?d==="floating"?"reference":"floating":d],g=wl(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(m)))==null||t?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),E=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,v=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(v))&&await(o.getScale==null?void 0:o.getScale(v))||{x:1,y:1},_=wl(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:E,offsetParent:v,strategy:l}):E);return{top:(g.top-_.top+f.top)/A.y,bottom:(_.bottom-g.bottom+f.bottom)/A.y,left:(g.left-_.left+f.left)/A.x,right:(_.right-g.right+f.right)/A.x}}function wA(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function RA(n){return CI.some(e=>n[e]>=0)}function Rl(){return typeof window<"u"}function eo(n){return DA(n)?(n.nodeName||"").toLowerCase():"#document"}function zt(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function wn(n){var e;return(e=(DA(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function DA(n){return!!Rl()&&(n instanceof Node||n instanceof zt(n).Node)}function pn(n){return!!Rl()&&(n instanceof Element||n instanceof zt(n).Element)}function Rn(n){return!!Rl()&&(n instanceof HTMLElement||n instanceof zt(n).HTMLElement)}function kA(n){return!(!Rl()||typeof ShadowRoot>"u")&&(n instanceof ShadowRoot||n instanceof zt(n).ShadowRoot)}function Is(n){const{overflow:e,overflowX:t,overflowY:r,display:i}=fn(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!["inline","contents"].includes(i)}function RI(n){return["table","td","th"].includes(eo(n))}function Dl(n){return[":popover-open",":modal"].some(e=>{try{return n.matches(e)}catch{return!1}})}function Lh(n){const e=xh(),t=pn(n)?fn(n):n;return["transform","translate","scale","rotate","perspective"].some(r=>!!t[r]&&t[r]!=="none")||!!t.containerType&&t.containerType!=="normal"||!e&&!!t.backdropFilter&&t.backdropFilter!=="none"||!e&&!!t.filter&&t.filter!=="none"||["transform","translate","scale","rotate","perspective","filter"].some(r=>(t.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(t.contain||"").includes(r))}function xh(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function to(n){return["html","body","#document"].includes(eo(n))}function fn(n){return zt(n).getComputedStyle(n)}function kl(n){return pn(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function _r(n){if(eo(n)==="html")return n;const e=n.assignedSlot||n.parentNode||kA(n)&&n.host||wn(n);return kA(e)?e.host:e}function LA(n){const e=_r(n);return to(e)?n.ownerDocument?n.ownerDocument.body:n.body:Rn(e)&&Is(e)?e:LA(e)}function ws(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);const i=LA(n),o=i===((r=n.ownerDocument)==null?void 0:r.body),s=zt(i);if(o){const a=Mh(s);return e.concat(s,s.visualViewport||[],Is(i)?i:[],a&&t?ws(a):[])}return e.concat(i,ws(i,[],t))}function Mh(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function xA(n){const e=fn(n);let t=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Rn(n),o=i?n.offsetWidth:t,s=i?n.offsetHeight:r,a=Nl(t)!==o||Nl(r)!==s;return a&&(t=o,r=s),{width:t,height:r,$:a}}function Ph(n){return pn(n)?n:n.contextElement}function no(n){const e=Ph(n);if(!Rn(e))return Cn(1);const t=e.getBoundingClientRect(),{width:r,height:i,$:o}=xA(e);let s=(o?Nl(t.width):t.width)/r,a=(o?Nl(t.height):t.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const DI=Cn(0);function MA(n){const e=zt(n);return xh()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:DI}function ei(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);const i=n.getBoundingClientRect(),o=Ph(n);let s=Cn(1);e&&(r?pn(r)&&(s=no(r)):s=no(n));const a=function(h,p,f){return p===void 0&&(p=!1),!(!f||p&&f!==zt(h))&&p}(o,t,r)?MA(o):Cn(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,d=i.height/s.y;if(o){const h=zt(o),p=r&&pn(r)?zt(r):r;let f=h,m=Mh(f);for(;m&&r&&p!==f;){const g=no(m),E=m.getBoundingClientRect(),v=fn(m),A=E.left+(m.clientLeft+parseFloat(v.paddingLeft))*g.x,_=E.top+(m.clientTop+parseFloat(v.paddingTop))*g.y;l*=g.x,u*=g.y,c*=g.x,d*=g.y,l+=A,u+=_,f=zt(m),m=Mh(f)}}return wl({width:c,height:d,x:l,y:u})}function Bh(n,e){const t=kl(n).scrollLeft;return e?e.left+t:ei(wn(n)).left+t}function PA(n,e,t){t===void 0&&(t=!1);const r=n.getBoundingClientRect();return{x:r.left+e.scrollLeft-(t?0:Bh(n,r)),y:r.top+e.scrollTop}}function BA(n,e,t){let r;if(e==="viewport")r=function(i,o){const s=zt(i),a=wn(i),l=s.visualViewport;let u=a.clientWidth,c=a.clientHeight,d=0,h=0;if(l){u=l.width,c=l.height;const p=xh();(!p||p&&o==="fixed")&&(d=l.offsetLeft,h=l.offsetTop)}return{width:u,height:c,x:d,y:h}}(n,t);else if(e==="document")r=function(i){const o=wn(i),s=kl(i),a=i.ownerDocument.body,l=Yt(o.scrollWidth,o.clientWidth,a.scrollWidth,a.clientWidth),u=Yt(o.scrollHeight,o.clientHeight,a.scrollHeight,a.clientHeight);let c=-s.scrollLeft+Bh(i);const d=-s.scrollTop;return fn(a).direction==="rtl"&&(c+=Yt(o.clientWidth,a.clientWidth)-l),{width:l,height:u,x:c,y:d}}(wn(n));else if(pn(e))r=function(i,o){const s=ei(i,!0,o==="fixed"),a=s.top+i.clientTop,l=s.left+i.clientLeft,u=Rn(i)?no(i):Cn(1);return{width:i.clientWidth*u.x,height:i.clientHeight*u.y,x:l*u.x,y:a*u.y}}(e,t);else{const i=MA(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return wl(r)}function FA(n,e){const t=_r(n);return!(t===e||!pn(t)||to(t))&&(fn(t).position==="fixed"||FA(t,e))}function kI(n,e,t){const r=Rn(e),i=wn(e),o=t==="fixed",s=ei(n,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=Cn(0);function u(){l.x=Bh(i)}if(r||!r&&!o)if((eo(e)!=="body"||Is(i))&&(a=kl(e)),r){const d=ei(e,!0,o,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else i&&u();o&&!r&&i&&u();const c=!i||r||o?Cn(0):PA(i,a);return{x:s.left+a.scrollLeft-l.x-c.x,y:s.top+a.scrollTop-l.y-c.y,width:s.width,height:s.height}}function Fh(n){return fn(n).position==="static"}function UA(n,e){if(!Rn(n)||fn(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return wn(n)===t&&(t=t.ownerDocument.body),t}function HA(n,e){const t=zt(n);if(Dl(n))return t;if(!Rn(n)){let i=_r(n);for(;i&&!to(i);){if(pn(i)&&!Fh(i))return i;i=_r(i)}return t}let r=UA(n,e);for(;r&&RI(r)&&Fh(r);)r=UA(r,e);return r&&to(r)&&Fh(r)&&!Lh(r)?t:r||function(i){let o=_r(i);for(;Rn(o)&&!to(o);){if(Lh(o))return o;if(Dl(o))return null;o=_r(o)}return null}(n)||t}const LI={convertOffsetParentRelativeRectToViewportRelativeRect:function(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n;const o=i==="fixed",s=wn(r),a=!!e&&Dl(e.floating);if(r===s||a&&o)return t;let l={scrollLeft:0,scrollTop:0},u=Cn(1);const c=Cn(0),d=Rn(r);if((d||!d&&!o)&&((eo(r)!=="body"||Is(s))&&(l=kl(r)),Rn(r))){const p=ei(r);u=no(r),c.x=p.x+r.clientLeft,c.y=p.y+r.clientTop}const h=!s||d||o?Cn(0):PA(s,l,!0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+c.x+h.x,y:t.y*u.y-l.scrollTop*u.y+c.y+h.y}},getDocumentElement:wn,getClippingRect:function(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n;const o=t==="clippingAncestors"?Dl(e)?[]:function(u,c){const d=c.get(u);if(d)return d;let h=ws(u,[],!1).filter(g=>pn(g)&&eo(g)!=="body"),p=null;const f=fn(u).position==="fixed";let m=f?_r(u):u;for(;pn(m)&&!to(m);){const g=fn(m),E=Lh(m);E||g.position!=="fixed"||(p=null),(f?!E&&!p:!E&&g.position==="static"&&p&&["absolute","fixed"].includes(p.position)||Is(m)&&!E&&FA(u,m))?h=h.filter(v=>v!==m):p=g,m=_r(m)}return c.set(u,h),h}(e,this._c):[].concat(t),s=[...o,r],a=s[0],l=s.reduce((u,c)=>{const d=BA(e,c,i);return u.top=Yt(d.top,u.top),u.right=Ar(d.right,u.right),u.bottom=Ar(d.bottom,u.bottom),u.left=Yt(d.left,u.left),u},BA(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:HA,getElementRects:async function(n){const e=this.getOffsetParent||HA,t=this.getDimensions,r=await t(n.floating);return{reference:kI(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(n){return Array.from(n.getClientRects())},getDimensions:function(n){const{width:e,height:t}=xA(n);return{width:e,height:t}},getScale:no,isElement:pn,isRTL:function(n){return fn(n).direction==="rtl"}};function $A(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function jA(n,e,t,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Ph(n),c=i||o?[...u?ws(u):[],...ws(e)]:[];c.forEach(g=>{i&&g.addEventListener("scroll",t,{passive:!0}),o&&g.addEventListener("resize",t)});const d=u&&a?function(g,E){let v,A=null;const _=wn(g);function y(){var T;clearTimeout(v),(T=A)==null||T.disconnect(),A=null}return function T(S,b){S===void 0&&(S=!1),b===void 0&&(b=1),y();const O=g.getBoundingClientRect(),{left:C,top:w,width:I,height:F}=O;if(S||E(),!I||!F)return;const x={rootMargin:-Cl(w)+"px "+-Cl(_.clientWidth-(C+I))+"px "+-Cl(_.clientHeight-(w+F))+"px "+-Cl(C)+"px",threshold:Yt(0,Ar(1,b))||1};let $=!0;function k(M){const Y=M[0].intersectionRatio;if(Y!==b){if(!$)return T();Y?T(!1,Y):v=setTimeout(()=>{T(!1,1e-7)},1e3)}Y!==1||$A(O,g.getBoundingClientRect())||T(),$=!1}try{A=new IntersectionObserver(k,{...x,root:_.ownerDocument})}catch{A=new IntersectionObserver(k,x)}A.observe(g)}(!0),y}(u,t):null;let h,p=-1,f=null;s&&(f=new ResizeObserver(g=>{let[E]=g;E&&E.target===u&&f&&(f.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var v;(v=f)==null||v.observe(e)})),t()}),u&&!l&&f.observe(u),f.observe(e));let m=l?ei(n):null;return l&&function g(){const E=ei(n);m&&!$A(m,E)&&t(),m=E,h=requestAnimationFrame(g)}(),t(),()=>{var g;c.forEach(E=>{i&&E.removeEventListener("scroll",t),o&&E.removeEventListener("resize",t)}),d?.(),(g=f)==null||g.disconnect(),f=null,l&&cancelAnimationFrame(h)}}const xI=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,r;const{x:i,y:o,placement:s,middlewareData:a}=e,l=await async function(u,c){const{placement:d,platform:h,elements:p}=u,f=await(h.isRTL==null?void 0:h.isRTL(p.floating)),m=qn(d),g=Qi(d),E=In(d)==="y",v=["left","top"].includes(m)?-1:1,A=f&&E?-1:1,_=Kn(c,u);let{mainAxis:y,crossAxis:T,alignmentAxis:S}=typeof _=="number"?{mainAxis:_,crossAxis:0,alignmentAxis:null}:{mainAxis:_.mainAxis||0,crossAxis:_.crossAxis||0,alignmentAxis:_.alignmentAxis};return g&&typeof S=="number"&&(T=g==="end"?-1*S:S),E?{x:T*A,y:y*v}:{x:y*v,y:T*A}}(e,n);return s===((t=a.offset)==null?void 0:t.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},MI=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:E,y:v}=g;return{x:E,y:v}}},...l}=Kn(n,e),u={x:t,y:r},c=await Cs(e,l),d=In(qn(i)),h=wh(d);let p=u[h],f=u[d];if(o){const g=h==="y"?"bottom":"right";p=Ih(p+c[h==="y"?"top":"left"],p,p-c[g])}if(s){const g=d==="y"?"bottom":"right";f=Ih(f+c[d==="y"?"top":"left"],f,f-c[g])}const m=a.fn({...e,[h]:p,[d]:f});return{...m,data:{x:m.x-t,y:m.y-r,enabled:{[h]:o,[d]:s}}}}}},PI=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:u}=e,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...g}=Kn(n,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const E=qn(i),v=In(a),A=qn(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(u.floating)),y=h||(A||!m?[Il(a)]:function(x){const $=Il(x);return[kh(x),$,kh($)]}(a)),T=f!=="none";!h&&T&&y.push(...function(x,$,k,M){const Y=Qi(x);let L=function(J,j,re){const te=["left","right"],D=["right","left"],Z=["top","bottom"],ee=["bottom","top"];switch(J){case"top":case"bottom":return re?j?D:te:j?te:D;case"left":case"right":return j?Z:ee;default:return[]}}(qn(x),k==="start",M);return Y&&(L=L.map(J=>J+"-"+Y),$&&(L=L.concat(L.map(kh)))),L}(a,m,f,_));const S=[a,...y],b=await Cs(e,g),O=[];let C=((r=o.flip)==null?void 0:r.overflows)||[];if(c&&O.push(b[E]),d){const x=function($,k,M){M===void 0&&(M=!1);const Y=Qi($),L=Dh($),J=Rh(L);let j=L==="x"?Y===(M?"end":"start")?"right":"left":Y==="start"?"bottom":"top";return k.reference[J]>k.floating[J]&&(j=Il(j)),[j,Il(j)]}(i,s,_);O.push(b[x[0]],b[x[1]])}if(C=[...C,{placement:i,overflows:O}],!O.every(x=>x<=0)){var w,I;const x=(((w=o.flip)==null?void 0:w.index)||0)+1,$=S[x];if($&&(!(d==="alignment"&&v!==In($))||C.every(M=>M.overflows[0]>0&&In(M.placement)===v)))return{data:{index:x,overflows:C},reset:{placement:$}};let k=(I=C.filter(M=>M.overflows[0]<=0).sort((M,Y)=>M.overflows[1]-Y.overflows[1])[0])==null?void 0:I.placement;if(!k)switch(p){case"bestFit":{var F;const M=(F=C.filter(Y=>{if(T){const L=In(Y.placement);return L===v||L==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(L=>L>0).reduce((L,J)=>L+J,0)]).sort((Y,L)=>Y[1]-L[1])[0])==null?void 0:F[0];M&&(k=M);break}case"initialPlacement":k=a}if(i!==k)return{reset:{placement:k}}}return{}}}},BI=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,r;const{placement:i,rects:o,platform:s,elements:a}=e,{apply:l=()=>{},...u}=Kn(n,e),c=await Cs(e,u),d=qn(i),h=Qi(i),p=In(i)==="y",{width:f,height:m}=o.floating;let g,E;d==="top"||d==="bottom"?(g=d,E=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(E=d,g=h==="end"?"top":"bottom");const v=m-c.top-c.bottom,A=f-c.left-c.right,_=Ar(m-c[g],v),y=Ar(f-c[E],A),T=!e.middlewareData.shift;let S=_,b=y;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(b=A),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(S=v),T&&!h){const C=Yt(c.left,0),w=Yt(c.right,0),I=Yt(c.top,0),F=Yt(c.bottom,0);p?b=f-2*(C!==0||w!==0?C+w:Yt(c.left,c.right)):S=m-2*(I!==0||F!==0?I+F:Yt(c.top,c.bottom))}await l({...e,availableWidth:b,availableHeight:S});const O=await s.getDimensions(a.floating);return f!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}},FI=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t}=e,{strategy:r="referenceHidden",...i}=Kn(n,e);switch(r){case"referenceHidden":{const o=wA(await Cs(e,{...i,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:RA(o)}}}case"escaped":{const o=wA(await Cs(e,{...i,altBoundary:!0}),t.floating);return{data:{escapedOffsets:o,escaped:RA(o)}}}default:return{}}}}},YA=n=>({name:"arrow",options:n,async fn(e){const{x:t,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:u,padding:c=0}=Kn(n,e)||{};if(u==null)return{};const d=CA(c),h={x:t,y:r},p=Dh(i),f=Rh(p),m=await s.getDimensions(u),g=p==="y",E=g?"top":"left",v=g?"bottom":"right",A=g?"clientHeight":"clientWidth",_=o.reference[f]+o.reference[p]-h[p]-o.floating[f],y=h[p]-o.reference[p],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let S=T?T[A]:0;S&&await(s.isElement==null?void 0:s.isElement(T))||(S=a.floating[A]||o.floating[f]);const b=_/2-y/2,O=S/2-m[f]/2-1,C=Ar(d[E],O),w=Ar(d[v],O),I=C,F=S-m[f]-w,x=S/2-m[f]/2+b,$=Ih(I,x,F),k=!l.arrow&&Qi(i)!=null&&x!==$&&o.reference[f]/2-(x<I?C:w)-m[f]/2<0,M=k?x<I?x-I:x-F:0;return{[p]:h[p]+M,data:{[p]:$,centerOffset:x-$-M,...k&&{alignmentOffset:M}},reset:k}}}),UI=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:r,placement:i,rects:o,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=Kn(n,e),c={x:t,y:r},d=In(i),h=wh(d);let p=c[h],f=c[d];const m=Kn(a,e),g=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const A=h==="y"?"height":"width",_=o.reference[h]-o.floating[A]+g.mainAxis,y=o.reference[h]+o.reference[A]-g.mainAxis;p<_?p=_:p>y&&(p=y)}if(u){var E,v;const A=h==="y"?"width":"height",_=["top","left"].includes(qn(i)),y=o.reference[d]-o.floating[A]+(_&&((E=s.offset)==null?void 0:E[d])||0)+(_?0:g.crossAxis),T=o.reference[d]+o.reference[A]+(_?0:((v=s.offset)==null?void 0:v[d])||0)-(_?g.crossAxis:0);f<y?f=y:f>T&&(f=T)}return{[h]:p,[d]:f}}}},HI=(n,e,t)=>{const r=new Map,i={platform:LI,...t},o={...i.platform,_c:r};return(async(s,a,l)=>{const{placement:u="bottom",strategy:c="absolute",middleware:d=[],platform:h}=l,p=d.filter(Boolean),f=await(h.isRTL==null?void 0:h.isRTL(a));let m=await h.getElementRects({reference:s,floating:a,strategy:c}),{x:g,y:E}=IA(m,u,f),v=u,A={},_=0;for(let y=0;y<p.length;y++){const{name:T,fn:S}=p[y],{x:b,y:O,data:C,reset:w}=await S({x:g,y:E,initialPlacement:u,placement:v,strategy:c,middlewareData:A,rects:m,platform:h,elements:{reference:s,floating:a}});g=b??g,E=O??E,A={...A,[T]:{...A[T],...C}},w&&_<=50&&(_++,typeof w=="object"&&(w.placement&&(v=w.placement),w.rects&&(m=w.rects===!0?await h.getElementRects({reference:s,floating:a,strategy:c}):w.rects),{x:g,y:E}=IA(m,v,f)),y=-1)}return{x:g,y:E,placement:v,strategy:c,middlewareData:A}})(n,e,{...i,platform:o})};var Ll=typeof document<"u"?pt:function(){};function xl(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,r,i;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(r=t;r--!=0;)if(!xl(n[r],e[r]))return!1;return!0}if(i=Object.keys(n),t=i.length,t!==Object.keys(e).length)return!1;for(r=t;r--!=0;)if(!{}.hasOwnProperty.call(e,i[r]))return!1;for(r=t;r--!=0;){const o=i[r];if((o!=="_owner"||!n.$$typeof)&&!xl(n[o],e[o]))return!1}return!0}return n!=n&&e!=e}function zA(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function VA(n,e){const t=zA(n);return Math.round(e*t)/t}function Uh(n){const e=W(n);return Ll(()=>{e.current=n}),e}function WA(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=n,[c,d]=ne({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[h,p]=ne(r);xl(h,r)||p(r);const[f,m]=ne(null),[g,E]=ne(null),v=oe(Y=>{Y!==T.current&&(T.current=Y,m(Y))},[]),A=oe(Y=>{Y!==S.current&&(S.current=Y,E(Y))},[]),_=o||f,y=s||g,T=W(null),S=W(null),b=W(c),O=l!=null,C=Uh(l),w=Uh(i),I=Uh(u),F=oe(()=>{if(!T.current||!S.current)return;const Y={placement:e,strategy:t,middleware:h};w.current&&(Y.platform=w.current),HI(T.current,S.current,Y).then(L=>{const J={...L,isPositioned:I.current!==!1};x.current&&!xl(b.current,J)&&(b.current=J,Do(()=>{d(J)}))})},[h,e,t,w,I]);Ll(()=>{u===!1&&b.current.isPositioned&&(b.current.isPositioned=!1,d(Y=>({...Y,isPositioned:!1})))},[u]);const x=W(!1);Ll(()=>(x.current=!0,()=>{x.current=!1}),[]),Ll(()=>{if(_&&(T.current=_),y&&(S.current=y),_&&y){if(C.current)return C.current(_,y,F);F()}},[_,y,F,C,O]);const $=ce(()=>({reference:T,floating:S,setReference:v,setFloating:A}),[v,A]),k=ce(()=>({reference:_,floating:y}),[_,y]),M=ce(()=>{const Y={position:t,left:0,top:0};if(!k.floating)return Y;const L=VA(k.floating,c.x),J=VA(k.floating,c.y);return a?{...Y,transform:"translate("+L+"px, "+J+"px)",...zA(k.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:L,top:J}},[t,a,k.floating,c.x,c.y]);return ce(()=>({...c,update:F,refs:$,elements:k,floatingStyles:M}),[c,F,$,k,M])}const $I=n=>({name:"arrow",options:n,fn(e){const{element:t,padding:r}=typeof n=="function"?n(e):n;return t&&(i=t,{}.hasOwnProperty.call(i,"current"))?t.current!=null?YA({element:t.current,padding:r}).fn(e):{}:t?YA({element:t,padding:r}).fn(e):{};var i}}),GA=(n,e)=>({...xI(n),options:[n,e]}),XA=(n,e)=>({...MI(n),options:[n,e]}),KA=(n,e)=>({...UI(n),options:[n,e]}),qA=(n,e)=>({...PI(n),options:[n,e]}),JA=(n,e)=>({...BI(n),options:[n,e]}),ZA=(n,e)=>({...FI(n),options:[n,e]}),QA=(n,e)=>({...$I(n),options:[n,e]});var e_=Q((n,e)=>{const{children:t,width:r=10,height:i=5,...o}=n;return N(Ke.svg,{...o,ref:e,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:n.asChild?t:N("polygon",{points:"0,0 30,0 15,10"})})});e_.displayName="Arrow";var t_=e_;function n_(n){const[e,t]=ne(void 0);return hn(()=>{if(n){t({width:n.offsetWidth,height:n.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,a;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=n.offsetWidth,a=n.offsetHeight;t({width:s,height:a})});return r.observe(n,{box:"border-box"}),()=>r.unobserve(n)}t(void 0)},[n]),e}var Hh="Popper",[r_,i_]=Qr(Hh),[jI,o_]=r_(Hh),s_=n=>{const{__scopePopper:e,children:t}=n,[r,i]=ne(null);return N(jI,{scope:e,anchor:r,onAnchorChange:i,children:t})};s_.displayName=Hh;var a_="PopperAnchor",l_=Q((n,e)=>{const{__scopePopper:t,virtualRef:r,...i}=n,o=o_(a_,t),s=W(null),a=$e(e,s),l=W(null);return V(()=>{const u=l.current;l.current=r?.current||s.current,u!==l.current&&o.onAnchorChange(l.current)}),r?null:N(Ke.div,{...i,ref:a})});l_.displayName=a_;var $h="PopperContent",[YI,zI]=r_($h),u_=Q((n,e)=>{const{__scopePopper:t,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:f,...m}=n,g=o_($h,t),[E,v]=ne(null),A=$e(e,se=>v(se)),[_,y]=ne(null),T=n_(_),S=T?.width??0,b=T?.height??0,O=r+(o!=="center"?"-"+o:""),C=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},w=Array.isArray(u)?u:[u],I=w.length>0,F={padding:C,boundary:w.filter(WI),altBoundary:I},{refs:x,floatingStyles:$,placement:k,isPositioned:M,middlewareData:Y}=WA({strategy:"fixed",placement:O,whileElementsMounted:(...se)=>jA(...se,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[GA({mainAxis:i+b,alignmentAxis:s}),l&&XA({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?KA():void 0,...F}),l&&qA({...F}),JA({...F,apply:({elements:se,rects:U,availableWidth:de,availableHeight:fe})=>{const{width:Ne,height:ge}=U.reference,he=se.floating.style;he.setProperty("--radix-popper-available-width",`${de}px`),he.setProperty("--radix-popper-available-height",`${fe}px`),he.setProperty("--radix-popper-anchor-width",`${Ne}px`),he.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),_&&QA({element:_,padding:a}),GI({arrowWidth:S,arrowHeight:b}),h&&ZA({strategy:"referenceHidden",...F})]}),[L,J]=h_(k),j=en(f);hn(()=>{M&&j?.()},[M,j]);const re=Y.arrow?.x,te=Y.arrow?.y,D=Y.arrow?.centerOffset!==0,[Z,ee]=ne();return hn(()=>{E&&ee(window.getComputedStyle(E).zIndex)},[E]),N("div",{ref:x.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:M?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:N(YI,{scope:t,placedSide:L,onArrowChange:y,arrowX:re,arrowY:te,shouldHideArrow:D,children:N(Ke.div,{"data-side":L,"data-align":J,...m,ref:A,style:{...m.style,animation:M?void 0:"none"}})})})});u_.displayName=$h;var c_="PopperArrow",VI={top:"bottom",right:"left",bottom:"top",left:"right"},d_=Q(function(n,e){const{__scopePopper:t,...r}=n,i=zI(c_,t),o=VI[i.placedSide];return N("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:N(t_,{...r,ref:e,style:{...r.style,display:"block"}})})});function WI(n){return n!==null}d_.displayName=c_;var GI=n=>({name:"transformOrigin",options:n,fn(e){const{placement:t,rects:r,middlewareData:i}=e,o=i.arrow?.centerOffset!==0,s=o?0:n.arrowWidth,a=o?0:n.arrowHeight,[l,u]=h_(t),c={start:"0%",center:"50%",end:"100%"}[u],d=(i.arrow?.x??0)+s/2,h=(i.arrow?.y??0)+a/2;let p="",f="";return l==="bottom"?(p=o?c:`${d}px`,f=-a+"px"):l==="top"?(p=o?c:`${d}px`,f=`${r.floating.height+a}px`):l==="right"?(p=-a+"px",f=o?c:`${h}px`):l==="left"&&(p=`${r.floating.width+a}px`,f=o?c:`${h}px`),{data:{x:p,y:f}}}});function h_(n){const[e,t="center"]=n.split("-");return[e,t]}var XI=s_,p_=l_,KI=u_,qI=d_,f_=n=>{const{present:e,children:t}=n,r=function(s){const[a,l]=ne(),u=W(null),c=W(s),d=W("none"),h=s?"mounted":"unmounted",[p,f]=function(m,g){return br((E,v)=>g[E][v]??E,m)}(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return V(()=>{const m=Ml(u.current);d.current=p==="mounted"?m:"none"},[p]),hn(()=>{const m=u.current,g=c.current;if(g!==s){const E=d.current,v=Ml(m);s?f("MOUNT"):v==="none"||m?.display==="none"?f("UNMOUNT"):f(g&&E!==v?"ANIMATION_OUT":"UNMOUNT"),c.current=s}},[s,f]),hn(()=>{if(a){let m;const g=a.ownerDocument.defaultView??window,E=A=>{const _=Ml(u.current).includes(CSS.escape(A.animationName));if(A.target===a&&_&&(f("ANIMATION_END"),!c.current)){const y=a.style.animationFillMode;a.style.animationFillMode="forwards",m=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=y)})}},v=A=>{A.target===a&&(d.current=Ml(u.current))};return a.addEventListener("animationstart",v),a.addEventListener("animationcancel",E),a.addEventListener("animationend",E),()=>{g.clearTimeout(m),a.removeEventListener("animationstart",v),a.removeEventListener("animationcancel",E),a.removeEventListener("animationend",E)}}f("ANIMATION_END")},[a,f]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:oe(m=>{u.current=m?getComputedStyle(m):null,l(m)},[])}}(e),i=typeof t=="function"?t({present:r.isPresent}):vn.only(t),o=$e(r.ref,function(s){let a=Object.getOwnPropertyDescriptor(s.props,"ref")?.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=Object.getOwnPropertyDescriptor(s,"ref")?.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}(i));return typeof t=="function"||r.isPresent?Nr(i,{ref:o}):null};function Ml(n){return n?.animationName||"none"}f_.displayName="Presence";var JI=Ju[" useInsertionEffect ".trim().toString()]||hn;function jh({prop:n,defaultProp:e,onChange:t=()=>{},caller:r}){const[i,o,s]=function({defaultProp:c,onChange:d}){const[h,p]=ne(c),f=W(h),m=W(d);return JI(()=>{m.current=d},[d]),V(()=>{f.current!==h&&(m.current?.(h),f.current=h)},[h,f]),[h,p,m]}({defaultProp:e,onChange:t}),a=n!==void 0,l=a?n:i;{const c=W(n!==void 0);V(()=>{const d=c.current;d!==a&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. 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.`),c.current=a},[a,r])}const u=oe(c=>{if(a){const d=function(h){return typeof h=="function"}(c)?c(n):c;d!==n&&s.current?.(d)}else o(c)},[a,n,o,s]);return[l,u]}var ro=new WeakMap,Pl=new WeakMap,Bl={},m_=0,g_=function(n){return n&&(n.host||g_(n.parentNode))},ZI=function(n,e,t,r){var i=function(d,h){return h.map(function(p){if(d.contains(p))return p;var f=g_(p);return f&&d.contains(f)?f:(console.error("aria-hidden",p,"in not contained inside",d,". Doing nothing"),null)}).filter(function(p){return!!p})}(e,Array.isArray(n)?n:[n]);Bl[t]||(Bl[t]=new WeakMap);var o=Bl[t],s=[],a=new Set,l=new Set(i),u=function(d){d&&!a.has(d)&&(a.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){d&&!l.has(d)&&Array.prototype.forEach.call(d.children,function(h){if(a.has(h))c(h);else try{var p=h.getAttribute(r),f=p!==null&&p!=="false",m=(ro.get(h)||0)+1,g=(o.get(h)||0)+1;ro.set(h,m),o.set(h,g),s.push(h),m===1&&f&&Pl.set(h,!0),g===1&&h.setAttribute(t,"true"),f||h.setAttribute(r,"true")}catch(E){console.error("aria-hidden: cannot operate on ",h,E)}})};return c(e),a.clear(),m_++,function(){s.forEach(function(d){var h=ro.get(d)-1,p=o.get(d)-1;ro.set(d,h),o.set(d,p),h||(Pl.has(d)||d.removeAttribute(r),Pl.delete(d)),p||d.removeAttribute(t)}),--m_||(ro=new WeakMap,ro=new WeakMap,Pl=new WeakMap,Bl={})}},E_=function(n,e,t){t===void 0&&(t="data-aria-hidden");var r=Array.from(Array.isArray(n)?n:[n]),i=function(o){return typeof document>"u"?null:(Array.isArray(o)?o[0]:o).ownerDocument.body}(n);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),ZI(r,i,t,"aria-hidden")):function(){return null}},yr=function(){return yr=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},yr.apply(this,arguments)},Fl="right-scroll-bar-position",Ul="width-before-scroll-bar";function Yh(n,e){return typeof n=="function"?n(e):n&&(n.current=e),n}var QI=typeof window<"u"?pt:V,v_=new WeakMap;function ew(n,e){var t,r,i,o=(t=null,r=function(s){return n.forEach(function(a){return Yh(a,s)})},(i=ne(function(){return{value:t,callback:r,facade:{get current(){return i.value},set current(s){var a=i.value;a!==s&&(i.value=s,i.callback(s,a))}}}})[0]).callback=r,i.facade);return QI(function(){var s=v_.get(o);if(s){var a=new Set(s),l=new Set(n),u=o.current;a.forEach(function(c){l.has(c)||Yh(c,null)}),l.forEach(function(c){a.has(c)||Yh(c,u)})}v_.set(o,n)},[n]),o}var Hl=function(){return Hl=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},Hl.apply(this,arguments)};function tw(n){return n}typeof SuppressedError=="function"&&SuppressedError;var A_=function(n){var e=n.sideCar,t=function(i,o){var s={};for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.indexOf(a)<0&&(s[a]=i[a]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(a=Object.getOwnPropertySymbols(i);l<a.length;l++)o.indexOf(a[l])<0&&Object.prototype.propertyIsEnumerable.call(i,a[l])&&(s[a[l]]=i[a[l]])}return s}(n,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return ae(r,Hl({},t))};A_.isSideCarExport=!0;var __=function(n){n===void 0&&(n={});var e=function(t,r){r===void 0&&(r=tw);var i=[],o=!1,s={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:t},useMedium:function(a){var l=r(a,o);return i.push(l),function(){i=i.filter(function(u){return u!==l})}},assignSyncMedium:function(a){for(o=!0;i.length;){var l=i;i=[],l.forEach(a)}i={push:function(u){return a(u)},filter:function(){return i}}},assignMedium:function(a){o=!0;var l=[];if(i.length){var u=i;i=[],u.forEach(a),l=i}var c=function(){var h=l;l=[],h.forEach(a)},d=function(){return Promise.resolve().then(c)};d(),i={push:function(h){l.push(h),d()},filter:function(h){return l=l.filter(h),i}}}};return s}(null);return e.options=Hl({async:!0,ssr:!1},n),e}(),zh=function(){},$l=Q(function(n,e){var t=W(null),r=ne({onScrollCapture:zh,onWheelCapture:zh,onTouchMoveCapture:zh}),i=r[0],o=r[1],s=n.forwardProps,a=n.children,l=n.className,u=n.removeScrollBar,c=n.enabled,d=n.shards,h=n.sideCar,p=n.noRelative,f=n.noIsolation,m=n.inert,g=n.allowPinchZoom,E=n.as,v=E===void 0?"div":E,A=n.gapMode,_=function(b,O){var C={};for(var w in b)Object.prototype.hasOwnProperty.call(b,w)&&O.indexOf(w)<0&&(C[w]=b[w]);if(b!=null&&typeof Object.getOwnPropertySymbols=="function"){var I=0;for(w=Object.getOwnPropertySymbols(b);I<w.length;I++)O.indexOf(w[I])<0&&Object.prototype.propertyIsEnumerable.call(b,w[I])&&(C[w[I]]=b[w[I]])}return C}(n,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),y=h,T=ew([t,e]),S=yr(yr({},_),i);return ae(xe,null,c&&ae(y,{sideCar:__,removeScrollBar:u,shards:d,noRelative:p,noIsolation:f,inert:m,setCallbacks:o,allowPinchZoom:!!g,lockRef:t,gapMode:A}),s?Nr(vn.only(a),yr(yr({},S),{ref:T})):ae(v,yr({},S,{className:l,ref:T}),a))});$l.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},$l.classNames={fullWidth:Ul,zeroRight:Fl};function nw(){if(!document)return null;var n=document.createElement("style");n.type="text/css";var e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__}();return e&&n.setAttribute("nonce",e),n}var rw=function(){var n=0,e=null;return{add:function(t){var r;n==0&&(e=nw())&&(function(i,o){i.styleSheet?i.styleSheet.cssText=o:i.appendChild(document.createTextNode(o))}(e,t),r=e,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),n++},remove:function(){!--n&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},y_=function(){var n,e=(n=rw(),function(t,r){V(function(){return n.add(t),function(){n.remove()}},[t&&r])});return function(t){var r=t.styles,i=t.dynamic;return e(r,i),null}},iw={left:0,top:0,right:0,gap:0},Vh=function(n){return parseInt(n||"",10)||0},ow=function(n){if(n===void 0&&(n="margin"),typeof window>"u")return iw;var e=function(i){var o=window.getComputedStyle(document.body),s=o[i==="padding"?"paddingLeft":"marginLeft"],a=o[i==="padding"?"paddingTop":"marginTop"],l=o[i==="padding"?"paddingRight":"marginRight"];return[Vh(s),Vh(a),Vh(l)]}(n),t=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-t+e[2]-e[0])}},sw=y_(),io="data-scroll-locked",aw=function(n,e,t,r){var i=n.left,o=n.top,s=n.right,a=n.gap;return t===void 0&&(t="margin"),`
86
86
  .`.concat("with-scroll-bars-hidden",` {
87
87
  overflow: hidden `).concat(r,`;
88
88
  padding-right: `).concat(a,"px ").concat(r,`;
@@ -122,7 +122,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
122
122
  `)},O_=function(){var n=parseInt(document.body.getAttribute(io)||"0",10);return isFinite(n)?n:0},lw=function(n){var e=n.noRelative,t=n.noImportant,r=n.gapMode,i=r===void 0?"margin":r;V(function(){return document.body.setAttribute(io,(O_()+1).toString()),function(){var s=O_()-1;s<=0?document.body.removeAttribute(io):document.body.setAttribute(io,s.toString())}},[]);var o=ce(function(){return ow(i)},[i]);return ae(sw,{styles:aw(o,!e,i,t?"":"!important")})},Wh=!1;if(typeof window<"u")try{var jl=Object.defineProperty({},"passive",{get:function(){return Wh=!0,!0}});window.addEventListener("test",jl,jl),window.removeEventListener("test",jl,jl)}catch{Wh=!1}var oo=!!Wh&&{passive:!1},T_=function(n,e){if(!(n instanceof Element))return!1;var t=window.getComputedStyle(n);return t[e]!=="hidden"&&!(t.overflowY===t.overflowX&&!function(r){return r.tagName==="TEXTAREA"}(n)&&t[e]==="visible")},S_=function(n,e){var t=e.ownerDocument,r=e;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),b_(n,r)){var i=N_(n,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==t.body);return!1},b_=function(n,e){return n==="v"?function(t){return T_(t,"overflowY")}(e):function(t){return T_(t,"overflowX")}(e)},N_=function(n,e){return n==="v"?function(t){return[t.scrollTop,t.scrollHeight,t.clientHeight]}(e):function(t){return[t.scrollLeft,t.scrollWidth,t.clientWidth]}(e)},Yl=function(n){return"changedTouches"in n?[n.changedTouches[0].clientX,n.changedTouches[0].clientY]:[0,0]},C_=function(n){return[n.deltaX,n.deltaY]},I_=function(n){return n&&"current"in n?n.current:n},uw=function(n){return`
123
123
  .block-interactivity-`.concat(n,` {pointer-events: none;}
124
124
  .allow-interactivity-`).concat(n,` {pointer-events: all;}
125
- `)},cw=0,so=[];function dw(n){for(var e=null;n!==null;)n instanceof ShadowRoot&&(e=n.host,n=n.host),n=n.parentNode;return e}const hw=(w_=function(n){var e=W([]),t=W([0,0]),r=W(),i=ne(cw++)[0],o=ne(y_)[0],s=W(n);V(function(){s.current=n},[n]),V(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(i));var f=function(m,g){for(var E,v=0,A=g.length;v<A;v++)!E&&v in g||(E||(E=Array.prototype.slice.call(g,0,v)),E[v]=g[v]);return m.concat(E||Array.prototype.slice.call(g))}([n.lockRef.current],(n.shards||[]).map(I_)).filter(Boolean);return f.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),f.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[n.inert,n.lockRef.current,n.shards]);var a=ie(function(f,m){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var g,E=Yl(f),v=t.current,A="deltaX"in f?f.deltaX:v[0]-E[0],_="deltaY"in f?f.deltaY:v[1]-E[1],O=f.target,T=Math.abs(A)>Math.abs(_)?"h":"v";if("touches"in f&&T==="h"&&O.type==="range")return!1;var S=S_(T,O);if(!S)return!0;if(S?g=T:(g=T==="v"?"h":"v",S=S_(T,O)),!S)return!1;if(!r.current&&"changedTouches"in f&&(A||_)&&(r.current=g),!g)return!0;var b=r.current||g;return function(y,C,w,I,F){var L=function(te,oe){return te==="h"&&oe==="rtl"?-1:1}(y,window.getComputedStyle(C).direction),j=L*I,D=w.target,B=C.contains(D),H=!1,x=j>0,Q=0,Y=0;do{if(!D)break;var J=N_(y,D),se=J[0],k=J[1]-J[2]-L*se;(se||k)&&b_(y,D)&&(Q+=k,Y+=se);var Z=D.parentNode;D=Z&&Z.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Z.host:Z}while(!B&&D!==document.body||B&&(C.contains(D)||C===D));return x&&(Math.abs(Q)<1||!F)?H=!0:x||!(Math.abs(Y)<1)&&F||(H=!0),H}(b,m,f,b==="h"?A:_,!0)},[]),l=ie(function(f){var m=f;if(so.length&&so[so.length-1]===o){var g="deltaY"in m?C_(m):Yl(m),E=e.current.filter(function(A){return A.name===m.type&&(A.target===m.target||m.target===A.shadowParent)&&function(_,O){return _[0]===O[0]&&_[1]===O[1]}(A.delta,g)})[0];if(E&&E.should)m.cancelable&&m.preventDefault();else if(!E){var v=(s.current.shards||[]).map(I_).filter(Boolean).filter(function(A){return A.contains(m.target)});(v.length>0?a(m,v[0]):!s.current.noIsolation)&&m.cancelable&&m.preventDefault()}}},[]),u=ie(function(f,m,g,E){var v={name:f,delta:m,target:g,should:E,shadowParent:dw(g)};e.current.push(v),setTimeout(function(){e.current=e.current.filter(function(A){return A!==v})},1)},[]),c=ie(function(f){t.current=Yl(f),r.current=void 0},[]),d=ie(function(f){u(f.type,C_(f),f.target,a(f,n.lockRef.current))},[]),h=ie(function(f){u(f.type,Yl(f),f.target,a(f,n.lockRef.current))},[]);V(function(){return so.push(o),n.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,oo),document.addEventListener("touchmove",l,oo),document.addEventListener("touchstart",c,oo),function(){so=so.filter(function(f){return f!==o}),document.removeEventListener("wheel",l,oo),document.removeEventListener("touchmove",l,oo),document.removeEventListener("touchstart",c,oo)}},[]);var p=n.removeScrollBar;return ae(xe,null,n.inert?ae(o,{styles:uw(i)}):null,p?ae(lw,{noRelative:n.noRelative,gapMode:n.gapMode}):null)},__.useMedium(w_),A_);var w_,Gh=ee(function(n,e){return ae($l,yr({},n,{ref:e,sideCar:hw}))});Gh.classNames=$l.classNames;var zl="Popover",[R_,lL]=Qr(zl,[i_]),Rs=i_(),[pw,ti]=R_(zl),D_=n=>{const{__scopePopover:e,children:t,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=n,a=Rs(e),l=W(null),[u,c]=ne(!1),[d,h]=jh({prop:r,defaultProp:i??!1,onChange:o,caller:zl});return N(XI,{...a,children:N(pw,{scope:e,contentId:bl(),triggerRef:l,open:d,onOpenChange:h,onOpenToggle:ie(()=>h(p=>!p),[h]),hasCustomAnchor:u,onCustomAnchorAdd:ie(()=>c(!0),[]),onCustomAnchorRemove:ie(()=>c(!1),[]),modal:s,children:t})})};D_.displayName=zl;var k_="PopoverAnchor",fw=ee((n,e)=>{const{__scopePopover:t,...r}=n,i=ti(k_,t),o=Rs(t),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=i;return V(()=>(s(),()=>a()),[s,a]),N(p_,{...o,...r,ref:e})});fw.displayName=k_;var L_="PopoverTrigger",x_=ee((n,e)=>{const{__scopePopover:t,...r}=n,i=ti(L_,t),o=Rs(t),s=$e(e,i.triggerRef),a=N(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":F_(i.open),...r,ref:s,onClick:bs(n.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:N(p_,{asChild:!0,...o,children:a})});x_.displayName=L_;var[uL,mw]=R_("PopoverPortal",{forceMount:void 0}),ao="PopoverContent",M_=ee((n,e)=>{const t=mw(ao,n.__scopePopover),{forceMount:r=t.forceMount,...i}=n,o=ti(ao,n.__scopePopover);return N(f_,{present:r||o.open,children:o.modal?N(Ew,{...i,ref:e}):N(vw,{...i,ref:e})})});M_.displayName=ao;var gw=Ns("PopoverContent.RemoveScroll"),Ew=ee((n,e)=>{const t=ti(ao,n.__scopePopover),r=W(null),i=$e(e,r),o=W(!1);return V(()=>{const s=r.current;if(s)return E_(s)},[]),N(Gh,{as:gw,allowPinchZoom:!0,children:N(P_,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bs(n.onCloseAutoFocus,s=>{s.preventDefault(),o.current||t.triggerRef.current?.focus()}),onPointerDownOutside:bs(n.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;o.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:bs(n.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),vw=ee((n,e)=>{const t=ti(ao,n.__scopePopover),r=W(!1),i=W(!1);return N(P_,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{n.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||t.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{n.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;t.triggerRef.current?.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),P_=ee((n,e)=>{const{__scopePopover:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:c,...d}=n,h=ti(ao,t),p=Rs(t);return V(()=>{const f=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",f[0]??yA()),document.body.insertAdjacentElement("beforeend",f[1]??yA()),Sh++,()=>{Sh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(m=>m.remove()),Sh--}},[]),N(Ch,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:N(vA,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:c,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:N(KI,{"data-state":F_(h.open),role:"dialog",id:h.contentId,...p,...d,ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),B_="PopoverClose",Aw=ee((n,e)=>{const{__scopePopover:t,...r}=n,i=ti(B_,t);return N(Ke.button,{type:"button",...r,ref:e,onClick:bs(n.onClick,()=>i.onOpenChange(!1))})});Aw.displayName=B_;var _w=ee((n,e)=>{const{__scopePopover:t,...r}=n,i=Rs(t);return N(qI,{...i,...r,ref:e})});function F_(n){return n?"open":"closed"}_w.displayName="PopoverArrow";var yw=D_,Ow=x_,Tw=M_;function pe(n,e,{checkForDefaultPrevented:t=!0}={}){return function(r){if(n?.(r),t===!1||!r.defaultPrevented)return e?.(r)}}function U_(n){const e=n+"CollectionProvider",[t,r]=Qr(e),[i,o]=t(e,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:m,children:g}=f,E=Ce.useRef(null),v=Ce.useRef(new Map).current;return N(i,{scope:m,itemMap:v,collectionRef:E,children:g})};s.displayName=e;const a=n+"CollectionSlot",l=Ns(a),u=Ce.forwardRef((f,m)=>{const{scope:g,children:E}=f,v=$e(m,o(a,g).collectionRef);return N(l,{ref:v,children:E})});u.displayName=a;const c=n+"CollectionItemSlot",d="data-radix-collection-item",h=Ns(c),p=Ce.forwardRef((f,m)=>{const{scope:g,children:E,...v}=f,A=Ce.useRef(null),_=$e(m,A),O=o(c,g);return Ce.useEffect(()=>(O.itemMap.set(A,{ref:A,...v}),()=>{O.itemMap.delete(A)})),N(h,{[d]:"",ref:_,children:E})});return p.displayName=c,[{Provider:s,Slot:u,ItemSlot:p},function(f){const m=o(n+"CollectionConsumer",f);return Ce.useCallback(()=>{const E=m.collectionRef.current;if(!E)return[];const v=Array.from(E.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((_,O)=>v.indexOf(_.ref.current)-v.indexOf(O.ref.current))},[m.collectionRef,m.itemMap])},r]}var Sw=kt(void 0);function H_(n){const e=qe(Sw);return n||e||"ltr"}var $_,Xh="dismissableLayer.update",bw="dismissableLayer.pointerDownOutside",Nw="dismissableLayer.focusOutside",j_=kt({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Y_=ee((n,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=n,u=qe(j_),[c,d]=ne(null),h=c?.ownerDocument??globalThis?.document,[,p]=ne({}),f=$e(e,S=>d(S)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),E=m.indexOf(g),v=c?m.indexOf(c):-1,A=u.layersWithOutsidePointerEventsDisabled.size>0,_=v>=E,O=function(S,b=globalThis?.document){const y=en(S),C=W(!1),w=W(()=>{});return V(()=>{const I=L=>{if(L.target&&!C.current){let j=function(){V_(bw,y,D,{discrete:!0})};const D={originalEvent:L};L.pointerType==="touch"?(b.removeEventListener("click",w.current),w.current=j,b.addEventListener("click",w.current,{once:!0})):j()}else b.removeEventListener("click",w.current);C.current=!1},F=window.setTimeout(()=>{b.addEventListener("pointerdown",I)},0);return()=>{window.clearTimeout(F),b.removeEventListener("pointerdown",I),b.removeEventListener("click",w.current)}},[b,y]),{onPointerDownCapture:()=>C.current=!0}}(S=>{const b=S.target,y=[...u.branches].some(C=>C.contains(b));_&&!y&&(i?.(S),s?.(S),S.defaultPrevented||a?.())},h),T=function(S,b=globalThis?.document){const y=en(S),C=W(!1);return V(()=>{const w=I=>{I.target&&!C.current&&V_(Nw,y,{originalEvent:I},{discrete:!1})};return b.addEventListener("focusin",w),()=>b.removeEventListener("focusin",w)},[b,y]),{onFocusCapture:()=>C.current=!0,onBlurCapture:()=>C.current=!1}}(S=>{const b=S.target;[...u.branches].some(y=>y.contains(b))||(o?.(S),s?.(S),S.defaultPrevented||a?.())},h);return mA(S=>{v===u.layers.size-1&&(r?.(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},h),V(()=>{if(c)return t&&(u.layersWithOutsidePointerEventsDisabled.size===0&&($_=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),z_(),()=>{t&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=$_)}},[c,h,t,u]),V(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),z_())},[c,u]),V(()=>{const S=()=>p({});return document.addEventListener(Xh,S),()=>document.removeEventListener(Xh,S)},[]),N(Ke.div,{...l,ref:f,style:{pointerEvents:A?_?"auto":"none":void 0,...n.style},onFocusCapture:pe(n.onFocusCapture,T.onFocusCapture),onBlurCapture:pe(n.onBlurCapture,T.onBlurCapture),onPointerDownCapture:pe(n.onPointerDownCapture,O.onPointerDownCapture)})});Y_.displayName="DismissableLayer";var Cw=ee((n,e)=>{const t=qe(j_),r=W(null),i=$e(e,r);return V(()=>{const o=r.current;if(o)return t.branches.add(o),()=>{t.branches.delete(o)}},[t.branches]),N(Ke.div,{...n,ref:i})});function z_(){const n=new CustomEvent(Xh);document.dispatchEvent(n)}function V_(n,e,t,{discrete:r}){const i=t.originalEvent.target,o=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?Oh(i,o):i.dispatchEvent(o)}Cw.displayName="DismissableLayerBranch";var Kh=0;function W_(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var qh="Popper",[G_,X_]=Qr(qh),[Iw,K_]=G_(qh),q_=n=>{const{__scopePopper:e,children:t}=n,[r,i]=ne(null);return N(Iw,{scope:e,anchor:r,onAnchorChange:i,children:t})};q_.displayName=qh;var J_="PopperAnchor",Z_=ee((n,e)=>{const{__scopePopper:t,virtualRef:r,...i}=n,o=K_(J_,t),s=W(null),a=$e(e,s);return V(()=>{o.onAnchorChange(r?.current||s.current)}),r?null:N(Ke.div,{...i,ref:a})});Z_.displayName=J_;var Jh="PopperContent",[ww,Rw]=G_(Jh),Q_=ee((n,e)=>{const{__scopePopper:t,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:f,...m}=n,g=K_(Jh,t),[E,v]=ne(null),A=$e(e,oe=>v(oe)),[_,O]=ne(null),T=n_(_),S=T?.width??0,b=T?.height??0,y=r+(o!=="center"?"-"+o:""),C=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},w=Array.isArray(u)?u:[u],I=w.length>0,F={padding:C,boundary:w.filter(kw),altBoundary:I},{refs:L,floatingStyles:j,placement:D,isPositioned:B,middlewareData:H}=WA({strategy:"fixed",placement:y,whileElementsMounted:(...oe)=>jA(...oe,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[GA({mainAxis:i+b,alignmentAxis:s}),l&&XA({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?KA():void 0,...F}),l&&qA({...F}),JA({...F,apply:({elements:oe,rects:U,availableWidth:de,availableHeight:fe})=>{const{width:Ne,height:ge}=U.reference,he=oe.floating.style;he.setProperty("--radix-popper-available-width",`${de}px`),he.setProperty("--radix-popper-available-height",`${fe}px`),he.setProperty("--radix-popper-anchor-width",`${Ne}px`),he.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),_&&QA({element:_,padding:a}),Lw({arrowWidth:S,arrowHeight:b}),h&&ZA({strategy:"referenceHidden",...F})]}),[x,Q]=ny(D),Y=en(f);hn(()=>{B&&Y?.()},[B,Y]);const J=H.arrow?.x,se=H.arrow?.y,k=H.arrow?.centerOffset!==0,[Z,te]=ne();return hn(()=>{E&&te(window.getComputedStyle(E).zIndex)},[E]),N("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:B?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:N(ww,{scope:t,placedSide:x,onArrowChange:O,arrowX:J,arrowY:se,shouldHideArrow:k,children:N(Ke.div,{"data-side":x,"data-align":Q,...m,ref:A,style:{...m.style,animation:B?void 0:"none"}})})})});Q_.displayName=Jh;var ey="PopperArrow",Dw={top:"bottom",right:"left",bottom:"top",left:"right"},ty=ee(function(n,e){const{__scopePopper:t,...r}=n,i=Rw(ey,t),o=Dw[i.placedSide];return N("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:N(t_,{...r,ref:e,style:{...r.style,display:"block"}})})});function kw(n){return n!==null}ty.displayName=ey;var Lw=n=>({name:"transformOrigin",options:n,fn(e){const{placement:t,rects:r,middlewareData:i}=e,o=i.arrow?.centerOffset!==0,s=o?0:n.arrowWidth,a=o?0:n.arrowHeight,[l,u]=ny(t),c={start:"0%",center:"50%",end:"100%"}[u],d=(i.arrow?.x??0)+s/2,h=(i.arrow?.y??0)+a/2;let p="",f="";return l==="bottom"?(p=o?c:`${d}px`,f=-a+"px"):l==="top"?(p=o?c:`${d}px`,f=`${r.floating.height+a}px`):l==="right"?(p=-a+"px",f=o?c:`${h}px`):l==="left"&&(p=`${r.floating.width+a}px`,f=o?c:`${h}px`),{data:{x:p,y:f}}}});function ny(n){const[e,t="center"]=n.split("-");return[e,t]}var xw=q_,Mw=Z_,Pw=Q_,Bw=ty,Vl=n=>{const{present:e,children:t}=n,r=function(s){const[a,l]=ne(),u=W(null),c=W(s),d=W("none"),h=s?"mounted":"unmounted",[p,f]=function(m,g){return br((E,v)=>g[E][v]??E,m)}(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return V(()=>{const m=Wl(u.current);d.current=p==="mounted"?m:"none"},[p]),hn(()=>{const m=u.current,g=c.current;if(g!==s){const E=d.current,v=Wl(m);s?f("MOUNT"):v==="none"||m?.display==="none"?f("UNMOUNT"):f(g&&E!==v?"ANIMATION_OUT":"UNMOUNT"),c.current=s}},[s,f]),hn(()=>{if(a){let m;const g=a.ownerDocument.defaultView??window,E=A=>{const _=Wl(u.current).includes(A.animationName);if(A.target===a&&_&&(f("ANIMATION_END"),!c.current)){const O=a.style.animationFillMode;a.style.animationFillMode="forwards",m=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=O)})}},v=A=>{A.target===a&&(d.current=Wl(u.current))};return a.addEventListener("animationstart",v),a.addEventListener("animationcancel",E),a.addEventListener("animationend",E),()=>{g.clearTimeout(m),a.removeEventListener("animationstart",v),a.removeEventListener("animationcancel",E),a.removeEventListener("animationend",E)}}f("ANIMATION_END")},[a,f]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:ie(m=>{u.current=m?getComputedStyle(m):null,l(m)},[])}}(e),i=typeof t=="function"?t({present:r.isPresent}):vn.only(t),o=$e(r.ref,function(s){let a=Object.getOwnPropertyDescriptor(s.props,"ref")?.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=Object.getOwnPropertyDescriptor(s,"ref")?.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}(i));return typeof t=="function"||r.isPresent?Nr(i,{ref:o}):null};function Wl(n){return n?.animationName||"none"}Vl.displayName="Presence";var Zh="rovingFocusGroup.onEntryFocus",Fw={bubbles:!1,cancelable:!0},Ds="RovingFocusGroup",[Qh,ry,Uw]=U_(Ds),[Hw,iy]=Qr(Ds,[Uw]),[$w,jw]=Hw(Ds),oy=ee((n,e)=>N(Qh.Provider,{scope:n.__scopeRovingFocusGroup,children:N(Qh.Slot,{scope:n.__scopeRovingFocusGroup,children:N(Yw,{...n,ref:e})})}));oy.displayName=Ds;var Yw=ee((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=n,h=W(null),p=$e(e,h),f=H_(o),[m,g]=jh({prop:s,defaultProp:a??null,onChange:l,caller:Ds}),[E,v]=ne(!1),A=en(u),_=ry(t),O=W(!1),[T,S]=ne(0);return V(()=>{const b=h.current;if(b)return b.addEventListener(Zh,A),()=>b.removeEventListener(Zh,A)},[A]),N($w,{scope:t,orientation:r,dir:f,loop:i,currentTabStopId:m,onItemFocus:ie(b=>g(b),[g]),onItemShiftTab:ie(()=>v(!0),[]),onFocusableItemAdd:ie(()=>S(b=>b+1),[]),onFocusableItemRemove:ie(()=>S(b=>b-1),[]),children:N(Ke.div,{tabIndex:E||T===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...n.style},onMouseDown:pe(n.onMouseDown,()=>{O.current=!0}),onFocus:pe(n.onFocus,b=>{const y=!O.current;if(b.target===b.currentTarget&&y&&!E){const C=new CustomEvent(Zh,Fw);if(b.currentTarget.dispatchEvent(C),!C.defaultPrevented){const w=_().filter(I=>I.focusable);ly([w.find(I=>I.active),w.find(I=>I.id===m),...w].filter(Boolean).map(I=>I.ref.current),c)}}O.current=!1}),onBlur:pe(n.onBlur,()=>v(!1))})})}),sy="RovingFocusGroupItem",ay=ee((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:i=!1,tabStopId:o,children:s,...a}=n,l=bl(),u=o||l,c=jw(sy,t),d=c.currentTabStopId===u,h=ry(t),{onFocusableItemAdd:p,onFocusableItemRemove:f,currentTabStopId:m}=c;return V(()=>{if(r)return p(),()=>f()},[r,p,f]),N(Qh.ItemSlot,{scope:t,id:u,focusable:r,active:i,children:N(Ke.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:pe(n.onMouseDown,g=>{r?c.onItemFocus(u):g.preventDefault()}),onFocus:pe(n.onFocus,()=>c.onItemFocus(u)),onKeyDown:pe(n.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey)return void c.onItemShiftTab();if(g.target!==g.currentTarget)return;const E=function(_,O,T){const S=function(b,y){return y!=="rtl"?b:b==="ArrowLeft"?"ArrowRight":b==="ArrowRight"?"ArrowLeft":b}(_.key,T);return O==="vertical"&&["ArrowLeft","ArrowRight"].includes(S)||O==="horizontal"&&["ArrowUp","ArrowDown"].includes(S)?void 0:zw[S]}(g,c.orientation,c.dir);if(E!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let _=h().filter(O=>O.focusable).map(O=>O.ref.current);if(E==="last")_.reverse();else if(E==="prev"||E==="next"){E==="prev"&&_.reverse();const O=_.indexOf(g.currentTarget);_=c.loop?(A=O+1,(v=_).map((T,S)=>v[(A+S)%v.length])):_.slice(O+1)}setTimeout(()=>ly(_))}var v,A}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:m!=null}):s})})});ay.displayName=sy;var zw={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ly(n,e=!1){const t=document.activeElement;for(const r of n)if(r===t||(r.focus({preventScroll:e}),document.activeElement!==t))return}var Vw=oy,Ww=ay,ep=["Enter"," "],uy=["ArrowUp","PageDown","End"],Gw=["ArrowDown","PageUp","Home",...uy],Xw={ltr:[...ep,"ArrowRight"],rtl:[...ep,"ArrowLeft"]},Kw={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ks="Menu",[Ls,qw,Jw]=U_(ks),[ni,cy]=Qr(ks,[Jw,X_,iy]),Gl=X_(),dy=iy(),[Zw,lo]=ni(ks),[Qw,xs]=ni(ks),hy=n=>{const{__scopeMenu:e,open:t=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=n,a=Gl(e),[l,u]=ne(null),c=W(!1),d=en(o),h=H_(i);return V(()=>{const p=()=>{c.current=!0,document.addEventListener("pointerdown",f,{capture:!0,once:!0}),document.addEventListener("pointermove",f,{capture:!0,once:!0})},f=()=>c.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",f,{capture:!0}),document.removeEventListener("pointermove",f,{capture:!0})}},[]),N(xw,{...a,children:N(Zw,{scope:e,open:t,onOpenChange:d,content:l,onContentChange:u,children:N(Qw,{scope:e,onClose:ie(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:h,modal:s,children:r})})})};hy.displayName=ks;var tp=ee((n,e)=>{const{__scopeMenu:t,...r}=n,i=Gl(t);return N(Mw,{...i,...r,ref:e})});tp.displayName="MenuAnchor";var[cL,py]=ni("MenuPortal",{forceMount:void 0}),tn="MenuContent",[eR,np]=ni(tn),fy=ee((n,e)=>{const t=py(tn,n.__scopeMenu),{forceMount:r=t.forceMount,...i}=n,o=lo(tn,n.__scopeMenu),s=xs(tn,n.__scopeMenu);return N(Ls.Provider,{scope:n.__scopeMenu,children:N(Vl,{present:r||o.open,children:N(Ls.Slot,{scope:n.__scopeMenu,children:s.modal?N(tR,{...i,ref:e}):N(nR,{...i,ref:e})})})})}),tR=ee((n,e)=>{const t=lo(tn,n.__scopeMenu),r=W(null),i=$e(e,r);return V(()=>{const o=r.current;if(o)return E_(o)},[]),N(rp,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:pe(n.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),nR=ee((n,e)=>{const t=lo(tn,n.__scopeMenu);return N(rp,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),rR=Ns("MenuContent.ScrollLock"),rp=ee((n,e)=>{const{__scopeMenu:t,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,disableOutsideScroll:f,...m}=n,g=lo(tn,t),E=xs(tn,t),v=Gl(t),A=dy(t),_=qw(t),[O,T]=ne(null),S=W(null),b=$e(e,S,g.onContentChange),y=W(0),C=W(""),w=W(0),I=W(null),F=W("right"),L=W(0),j=f?Gh:xe,D=f?{as:rR,allowPinchZoom:!0}:void 0,B=x=>{const Q=C.current+x,Y=_().filter(te=>!te.disabled),J=document.activeElement,se=Y.find(te=>te.ref.current===J)?.textValue,k=function(te,oe,U){const de=oe.length>1&&Array.from(oe).every(Vt=>Vt===oe[0]),fe=de?oe[0]:oe,Ne=U?te.indexOf(U):-1;let ge=(he=te,et=Math.max(Ne,0),he.map((Vt,zs)=>he[(et+zs)%he.length]));var he,et;fe.length===1&&(ge=ge.filter(Vt=>Vt!==U));const rn=ge.find(Vt=>Vt.toLowerCase().startsWith(fe.toLowerCase()));return rn!==U?rn:void 0}(Y.map(te=>te.textValue),Q,se),Z=Y.find(te=>te.textValue===k)?.ref.current;(function te(oe){C.current=oe,window.clearTimeout(y.current),oe!==""&&(y.current=window.setTimeout(()=>te(""),1e3))})(Q),Z&&setTimeout(()=>Z.focus())};V(()=>()=>window.clearTimeout(y.current),[]),V(()=>{const x=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",x[0]??W_()),document.body.insertAdjacentElement("beforeend",x[1]??W_()),Kh++,()=>{Kh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(Q=>Q.remove()),Kh--}},[]);const H=ie(x=>F.current===I.current?.side&&function(Q,Y){if(!Y)return!1;const J={x:Q.clientX,y:Q.clientY};return function(se,k){const{x:Z,y:te}=se;let oe=!1;for(let U=0,de=k.length-1;U<k.length;de=U++){const fe=k[U],Ne=k[de],ge=fe.x,he=fe.y,et=Ne.x,rn=Ne.y;he>te!=rn>te&&Z<(et-ge)*(te-he)/(rn-he)+ge&&(oe=!oe)}return oe}(J,Y)}(x,I.current?.area),[]);return N(eR,{scope:t,searchRef:C,onItemEnter:ie(x=>{H(x)&&x.preventDefault()},[H]),onItemLeave:ie(x=>{H(x)||(S.current?.focus(),T(null))},[H]),onTriggerLeave:ie(x=>{H(x)&&x.preventDefault()},[H]),pointerGraceTimerRef:w,onPointerGraceIntentChange:ie(x=>{I.current=x},[]),children:N(j,{...D,children:N(Ch,{asChild:!0,trapped:i,onMountAutoFocus:pe(o,x=>{x.preventDefault(),S.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:N(Y_,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,children:N(Vw,{asChild:!0,...A,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:O,onCurrentTabStopIdChange:T,onEntryFocus:pe(l,x=>{E.isUsingKeyboardRef.current||x.preventDefault()}),preventScrollOnEntryFocus:!0,children:N(Pw,{role:"menu","aria-orientation":"vertical","data-state":Dy(g.open),"data-radix-menu-content":"",dir:E.dir,...v,...m,ref:b,style:{outline:"none",...m.style},onKeyDown:pe(m.onKeyDown,x=>{const Q=x.target.closest("[data-radix-menu-content]")===x.currentTarget,Y=x.ctrlKey||x.altKey||x.metaKey,J=x.key.length===1;Q&&(x.key==="Tab"&&x.preventDefault(),!Y&&J&&B(x.key));const se=S.current;if(x.target!==se||!Gw.includes(x.key))return;x.preventDefault();const k=_().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);uy.includes(x.key)&&k.reverse(),function(Z){const te=document.activeElement;for(const oe of Z)if(oe===te||(oe.focus(),document.activeElement!==te))return}(k)}),onBlur:pe(n.onBlur,x=>{x.currentTarget.contains(x.target)||(window.clearTimeout(y.current),C.current="")}),onPointerMove:pe(n.onPointerMove,Ps(x=>{const Q=x.target,Y=L.current!==x.clientX;if(x.currentTarget.contains(Q)&&Y){const J=x.clientX>L.current?"right":"left";F.current=J,L.current=x.clientX}}))})})})})})})});fy.displayName=tn;var ip=ee((n,e)=>{const{__scopeMenu:t,...r}=n;return N(Ke.div,{role:"group",...r,ref:e})});ip.displayName="MenuGroup";var my=ee((n,e)=>{const{__scopeMenu:t,...r}=n;return N(Ke.div,{...r,ref:e})});my.displayName="MenuLabel";var Xl="MenuItem",gy="menu.itemSelect",Kl=ee((n,e)=>{const{disabled:t=!1,onSelect:r,...i}=n,o=W(null),s=xs(Xl,n.__scopeMenu),a=np(Xl,n.__scopeMenu),l=$e(e,o),u=W(!1);return N(Ey,{...i,ref:l,disabled:t,onClick:pe(n.onClick,()=>{const c=o.current;if(!t&&c){const d=new CustomEvent(gy,{bubbles:!0,cancelable:!0});c.addEventListener(gy,h=>r?.(h),{once:!0}),Oh(c,d),d.defaultPrevented?u.current=!1:s.onClose()}}),onPointerDown:c=>{n.onPointerDown?.(c),u.current=!0},onPointerUp:pe(n.onPointerUp,c=>{u.current||c.currentTarget?.click()}),onKeyDown:pe(n.onKeyDown,c=>{const d=a.searchRef.current!=="";t||d&&c.key===" "||ep.includes(c.key)&&(c.currentTarget.click(),c.preventDefault())})})});Kl.displayName=Xl;var Ey=ee((n,e)=>{const{__scopeMenu:t,disabled:r=!1,textValue:i,...o}=n,s=np(Xl,t),a=dy(t),l=W(null),u=$e(e,l),[c,d]=ne(!1),[h,p]=ne("");return V(()=>{const f=l.current;f&&p((f.textContent??"").trim())},[o.children]),N(Ls.ItemSlot,{scope:t,disabled:r,textValue:i??h,children:N(Ww,{asChild:!0,...a,focusable:!r,children:N(Ke.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:u,onPointerMove:pe(n.onPointerMove,Ps(f=>{r?s.onItemLeave(f):(s.onItemEnter(f),!f.defaultPrevented&&f.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:pe(n.onPointerLeave,Ps(f=>s.onItemLeave(f))),onFocus:pe(n.onFocus,()=>d(!0)),onBlur:pe(n.onBlur,()=>d(!1))})})})}),vy=ee((n,e)=>{const{checked:t=!1,onCheckedChange:r,...i}=n;return N(Ty,{scope:n.__scopeMenu,checked:t,children:N(Kl,{role:"menuitemcheckbox","aria-checked":ql(t)?"mixed":t,...i,ref:e,"data-state":sp(t),onSelect:pe(i.onSelect,()=>r?.(!!ql(t)||!t),{checkForDefaultPrevented:!1})})})});vy.displayName="MenuCheckboxItem";var Ay="MenuRadioGroup",[iR,oR]=ni(Ay,{value:void 0,onValueChange:()=>{}}),_y=ee((n,e)=>{const{value:t,onValueChange:r,...i}=n,o=en(r);return N(iR,{scope:n.__scopeMenu,value:t,onValueChange:o,children:N(ip,{...i,ref:e})})});_y.displayName=Ay;var yy="MenuRadioItem",Oy=ee((n,e)=>{const{value:t,...r}=n,i=oR(yy,n.__scopeMenu),o=t===i.value;return N(Ty,{scope:n.__scopeMenu,checked:o,children:N(Kl,{role:"menuitemradio","aria-checked":o,...r,ref:e,"data-state":sp(o),onSelect:pe(r.onSelect,()=>i.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});Oy.displayName=yy;var op="MenuItemIndicator",[Ty,sR]=ni(op,{checked:!1}),Sy=ee((n,e)=>{const{__scopeMenu:t,forceMount:r,...i}=n,o=sR(op,t);return N(Vl,{present:r||ql(o.checked)||o.checked===!0,children:N(Ke.span,{...i,ref:e,"data-state":sp(o.checked)})})});Sy.displayName=op;var by=ee((n,e)=>{const{__scopeMenu:t,...r}=n;return N(Ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});by.displayName="MenuSeparator";var Ny=ee((n,e)=>{const{__scopeMenu:t,...r}=n,i=Gl(t);return N(Bw,{...i,...r,ref:e})});Ny.displayName="MenuArrow";var[dL,Cy]=ni("MenuSub"),Ms="MenuSubTrigger",Iy=ee((n,e)=>{const t=lo(Ms,n.__scopeMenu),r=xs(Ms,n.__scopeMenu),i=Cy(Ms,n.__scopeMenu),o=np(Ms,n.__scopeMenu),s=W(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,u={__scopeMenu:n.__scopeMenu},c=ie(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return V(()=>c,[c]),V(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),N(tp,{asChild:!0,...u,children:N(Ey,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":i.contentId,"data-state":Dy(t.open),...n,ref:Sl(e,i.onTriggerChange),onClick:d=>{n.onClick?.(d),n.disabled||d.defaultPrevented||(d.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:pe(n.onPointerMove,Ps(d=>{o.onItemEnter(d),d.defaultPrevented||n.disabled||t.open||s.current||(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{t.onOpenChange(!0),c()},100))})),onPointerLeave:pe(n.onPointerLeave,Ps(d=>{c();const h=t.content?.getBoundingClientRect();if(h){const p=t.content?.dataset.side,f=p==="right",m=f?-5:5,g=h[f?"left":"right"],E=h[f?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x:g,y:h.top},{x:E,y:h.top},{x:E,y:h.bottom},{x:g,y:h.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:pe(n.onKeyDown,d=>{const h=o.searchRef.current!=="";n.disabled||h&&d.key===" "||Xw[r.dir].includes(d.key)&&(t.onOpenChange(!0),t.content?.focus(),d.preventDefault())})})})});Iy.displayName=Ms;var wy="MenuSubContent",Ry=ee((n,e)=>{const t=py(tn,n.__scopeMenu),{forceMount:r=t.forceMount,...i}=n,o=lo(tn,n.__scopeMenu),s=xs(tn,n.__scopeMenu),a=Cy(wy,n.__scopeMenu),l=W(null),u=$e(e,l);return N(Ls.Provider,{scope:n.__scopeMenu,children:N(Vl,{present:r||o.open,children:N(Ls.Slot,{scope:n.__scopeMenu,children:N(rp,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{s.isUsingKeyboardRef.current&&l.current?.focus(),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:pe(n.onFocusOutside,c=>{c.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:pe(n.onEscapeKeyDown,c=>{s.onClose(),c.preventDefault()}),onKeyDown:pe(n.onKeyDown,c=>{const d=c.currentTarget.contains(c.target),h=Kw[s.dir].includes(c.key);d&&h&&(o.onOpenChange(!1),a.trigger?.focus(),c.preventDefault())})})})})})});function Dy(n){return n?"open":"closed"}function ql(n){return n==="indeterminate"}function sp(n){return ql(n)?"indeterminate":n?"checked":"unchecked"}function Ps(n){return e=>e.pointerType==="mouse"?n(e):void 0}Ry.displayName=wy;var aR=hy,lR=tp,uR=fy,cR=ip,dR=my,hR=Kl,pR=vy,fR=_y,mR=Oy,gR=Sy,ER=by,vR=Ny,AR=Iy,_R=Ry,Jl="DropdownMenu",[yR,hL]=Qr(Jl,[cy]),It=cy(),[OR,ky]=yR(Jl),Ly=n=>{const{__scopeDropdownMenu:e,children:t,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=n,l=It(e),u=W(null),[c,d]=jh({prop:i,defaultProp:o??!1,onChange:s,caller:Jl});return N(OR,{scope:e,triggerId:bl(),triggerRef:u,contentId:bl(),open:c,onOpenChange:d,onOpenToggle:ie(()=>d(h=>!h),[d]),modal:a,children:N(aR,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:t})})};Ly.displayName=Jl;var xy="DropdownMenuTrigger",My=ee((n,e)=>{const{__scopeDropdownMenu:t,disabled:r=!1,...i}=n,o=ky(xy,t),s=It(t);return N(lR,{asChild:!0,...s,children:N(Ke.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:Sl(e,o.triggerRef),onPointerDown:pe(n.onPointerDown,a=>{r||a.button!==0||a.ctrlKey!==!1||(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:pe(n.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});My.displayName=xy;var Py="DropdownMenuContent",By=ee((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=ky(Py,t),o=It(t),s=W(!1);return N(uR,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:e,onCloseAutoFocus:pe(n.onCloseAutoFocus,a=>{s.current||i.triggerRef.current?.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:pe(n.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;i.modal&&!c||(s.current=!0)}),style:{...n.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)"}})});By.displayName=Py;var TR=ee((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(cR,{...i,...r,ref:e})});TR.displayName="DropdownMenuGroup";var SR=ee((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(dR,{...i,...r,ref:e})});SR.displayName="DropdownMenuLabel";var Fy=ee((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(hR,{...i,...r,ref:e})});Fy.displayName="DropdownMenuItem";var bR=ee((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(pR,{...i,...r,ref:e})});bR.displayName="DropdownMenuCheckboxItem";var NR=ee((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(fR,{...i,...r,ref:e})});NR.displayName="DropdownMenuRadioGroup";var CR=ee((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(mR,{...i,...r,ref:e})});CR.displayName="DropdownMenuRadioItem";var IR=ee((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(gR,{...i,...r,ref:e})});IR.displayName="DropdownMenuItemIndicator";var wR=ee((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(ER,{...i,...r,ref:e})});wR.displayName="DropdownMenuSeparator";var RR=ee((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(vR,{...i,...r,ref:e})});RR.displayName="DropdownMenuArrow";var DR=ee((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(AR,{...i,...r,ref:e})});DR.displayName="DropdownMenuSubTrigger";var kR=ee((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(_R,{...i,...r,ref:e,style:{...n.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)"}})});kR.displayName="DropdownMenuSubContent";var LR=Ly,xR=My,MR=By,PR=Fy;function Zl(n){const{popoverComponent:e,popoverProps:t,children:r,type:i="popover",...o}=n,[s,a]=ne(void 0),[l,u]=ne(!1);let c,d,h;return i==="menu"?(c=LR,d=xR,h=MR):(c=yw,d=Ow,h=Tw),N(t1.Provider,{value:{closePopover:()=>u(!1)},children:N(c,{modal:!0,open:l,onOpenChange:u,children:[N(d,{asChild:!0,children:N("button",{...o,ref:p=>(f=>{const m=f?.closest("[t-menu-boundary]")??void 0;a(m)})(p),children:r})}),N(h,{hideWhenDetached:!0,collisionBoundary:s,style:{zIndex:1e3},onWheel:p=>p.stopPropagation(),onTouchMove:p=>p.stopPropagation(),children:N(e,{...t})})]})})}function uo(n){return N(PR,{...n})}function BR(n){return Zf(n)}function co(n){return n.photoUrl??function(e,t){const r=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
125
+ `)},cw=0,so=[];function dw(n){for(var e=null;n!==null;)n instanceof ShadowRoot&&(e=n.host,n=n.host),n=n.parentNode;return e}const hw=(w_=function(n){var e=W([]),t=W([0,0]),r=W(),i=ne(cw++)[0],o=ne(y_)[0],s=W(n);V(function(){s.current=n},[n]),V(function(){if(n.inert){document.body.classList.add("block-interactivity-".concat(i));var f=function(m,g){for(var E,v=0,A=g.length;v<A;v++)!E&&v in g||(E||(E=Array.prototype.slice.call(g,0,v)),E[v]=g[v]);return m.concat(E||Array.prototype.slice.call(g))}([n.lockRef.current],(n.shards||[]).map(I_)).filter(Boolean);return f.forEach(function(m){return m.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),f.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(i))})}}},[n.inert,n.lockRef.current,n.shards]);var a=oe(function(f,m){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!s.current.allowPinchZoom;var g,E=Yl(f),v=t.current,A="deltaX"in f?f.deltaX:v[0]-E[0],_="deltaY"in f?f.deltaY:v[1]-E[1],y=f.target,T=Math.abs(A)>Math.abs(_)?"h":"v";if("touches"in f&&T==="h"&&y.type==="range")return!1;var S=S_(T,y);if(!S)return!0;if(S?g=T:(g=T==="v"?"h":"v",S=S_(T,y)),!S)return!1;if(!r.current&&"changedTouches"in f&&(A||_)&&(r.current=g),!g)return!0;var b=r.current||g;return function(O,C,w,I,F){var x=function(ee,se){return ee==="h"&&se==="rtl"?-1:1}(O,window.getComputedStyle(C).direction),$=x*I,k=w.target,M=C.contains(k),Y=!1,L=$>0,J=0,j=0;do{if(!k)break;var re=N_(O,k),te=re[0],D=re[1]-re[2]-x*te;(te||D)&&b_(O,k)&&(J+=D,j+=te);var Z=k.parentNode;k=Z&&Z.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Z.host:Z}while(!M&&k!==document.body||M&&(C.contains(k)||C===k));return L&&(Math.abs(J)<1||!F)?Y=!0:L||!(Math.abs(j)<1)&&F||(Y=!0),Y}(b,m,f,b==="h"?A:_,!0)},[]),l=oe(function(f){var m=f;if(so.length&&so[so.length-1]===o){var g="deltaY"in m?C_(m):Yl(m),E=e.current.filter(function(A){return A.name===m.type&&(A.target===m.target||m.target===A.shadowParent)&&function(_,y){return _[0]===y[0]&&_[1]===y[1]}(A.delta,g)})[0];if(E&&E.should)m.cancelable&&m.preventDefault();else if(!E){var v=(s.current.shards||[]).map(I_).filter(Boolean).filter(function(A){return A.contains(m.target)});(v.length>0?a(m,v[0]):!s.current.noIsolation)&&m.cancelable&&m.preventDefault()}}},[]),u=oe(function(f,m,g,E){var v={name:f,delta:m,target:g,should:E,shadowParent:dw(g)};e.current.push(v),setTimeout(function(){e.current=e.current.filter(function(A){return A!==v})},1)},[]),c=oe(function(f){t.current=Yl(f),r.current=void 0},[]),d=oe(function(f){u(f.type,C_(f),f.target,a(f,n.lockRef.current))},[]),h=oe(function(f){u(f.type,Yl(f),f.target,a(f,n.lockRef.current))},[]);V(function(){return so.push(o),n.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,oo),document.addEventListener("touchmove",l,oo),document.addEventListener("touchstart",c,oo),function(){so=so.filter(function(f){return f!==o}),document.removeEventListener("wheel",l,oo),document.removeEventListener("touchmove",l,oo),document.removeEventListener("touchstart",c,oo)}},[]);var p=n.removeScrollBar;return ae(xe,null,n.inert?ae(o,{styles:uw(i)}):null,p?ae(lw,{noRelative:n.noRelative,gapMode:n.gapMode}):null)},__.useMedium(w_),A_);var w_,Gh=Q(function(n,e){return ae($l,yr({},n,{ref:e,sideCar:hw}))});Gh.classNames=$l.classNames;var zl="Popover",[R_,lL]=Qr(zl,[i_]),Rs=i_(),[pw,ti]=R_(zl),D_=n=>{const{__scopePopover:e,children:t,open:r,defaultOpen:i,onOpenChange:o,modal:s=!1}=n,a=Rs(e),l=W(null),[u,c]=ne(!1),[d,h]=jh({prop:r,defaultProp:i??!1,onChange:o,caller:zl});return N(XI,{...a,children:N(pw,{scope:e,contentId:bl(),triggerRef:l,open:d,onOpenChange:h,onOpenToggle:oe(()=>h(p=>!p),[h]),hasCustomAnchor:u,onCustomAnchorAdd:oe(()=>c(!0),[]),onCustomAnchorRemove:oe(()=>c(!1),[]),modal:s,children:t})})};D_.displayName=zl;var k_="PopoverAnchor",fw=Q((n,e)=>{const{__scopePopover:t,...r}=n,i=ti(k_,t),o=Rs(t),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=i;return V(()=>(s(),()=>a()),[s,a]),N(p_,{...o,...r,ref:e})});fw.displayName=k_;var L_="PopoverTrigger",x_=Q((n,e)=>{const{__scopePopover:t,...r}=n,i=ti(L_,t),o=Rs(t),s=$e(e,i.triggerRef),a=N(Ke.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":F_(i.open),...r,ref:s,onClick:bs(n.onClick,i.onOpenToggle)});return i.hasCustomAnchor?a:N(p_,{asChild:!0,...o,children:a})});x_.displayName=L_;var[uL,mw]=R_("PopoverPortal",{forceMount:void 0}),ao="PopoverContent",M_=Q((n,e)=>{const t=mw(ao,n.__scopePopover),{forceMount:r=t.forceMount,...i}=n,o=ti(ao,n.__scopePopover);return N(f_,{present:r||o.open,children:o.modal?N(Ew,{...i,ref:e}):N(vw,{...i,ref:e})})});M_.displayName=ao;var gw=Ns("PopoverContent.RemoveScroll"),Ew=Q((n,e)=>{const t=ti(ao,n.__scopePopover),r=W(null),i=$e(e,r),o=W(!1);return V(()=>{const s=r.current;if(s)return E_(s)},[]),N(Gh,{as:gw,allowPinchZoom:!0,children:N(P_,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:bs(n.onCloseAutoFocus,s=>{s.preventDefault(),o.current||t.triggerRef.current?.focus()}),onPointerDownOutside:bs(n.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;o.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:bs(n.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),vw=Q((n,e)=>{const t=ti(ao,n.__scopePopover),r=W(!1),i=W(!1);return N(P_,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{n.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||t.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{n.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;t.triggerRef.current?.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),P_=Q((n,e)=>{const{__scopePopover:t,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:c,...d}=n,h=ti(ao,t),p=Rs(t);return V(()=>{const f=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",f[0]??yA()),document.body.insertAdjacentElement("beforeend",f[1]??yA()),Sh++,()=>{Sh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(m=>m.remove()),Sh--}},[]),N(Ch,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:N(vA,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:c,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:N(KI,{"data-state":F_(h.open),role:"dialog",id:h.contentId,...p,...d,ref:e,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),B_="PopoverClose",Aw=Q((n,e)=>{const{__scopePopover:t,...r}=n,i=ti(B_,t);return N(Ke.button,{type:"button",...r,ref:e,onClick:bs(n.onClick,()=>i.onOpenChange(!1))})});Aw.displayName=B_;var _w=Q((n,e)=>{const{__scopePopover:t,...r}=n,i=Rs(t);return N(qI,{...i,...r,ref:e})});function F_(n){return n?"open":"closed"}_w.displayName="PopoverArrow";var yw=D_,Ow=x_,Tw=M_;function pe(n,e,{checkForDefaultPrevented:t=!0}={}){return function(r){if(n?.(r),t===!1||!r.defaultPrevented)return e?.(r)}}function U_(n){const e=n+"CollectionProvider",[t,r]=Qr(e),[i,o]=t(e,{collectionRef:{current:null},itemMap:new Map}),s=f=>{const{scope:m,children:g}=f,E=Ce.useRef(null),v=Ce.useRef(new Map).current;return N(i,{scope:m,itemMap:v,collectionRef:E,children:g})};s.displayName=e;const a=n+"CollectionSlot",l=Ns(a),u=Ce.forwardRef((f,m)=>{const{scope:g,children:E}=f,v=$e(m,o(a,g).collectionRef);return N(l,{ref:v,children:E})});u.displayName=a;const c=n+"CollectionItemSlot",d="data-radix-collection-item",h=Ns(c),p=Ce.forwardRef((f,m)=>{const{scope:g,children:E,...v}=f,A=Ce.useRef(null),_=$e(m,A),y=o(c,g);return Ce.useEffect(()=>(y.itemMap.set(A,{ref:A,...v}),()=>{y.itemMap.delete(A)})),N(h,{[d]:"",ref:_,children:E})});return p.displayName=c,[{Provider:s,Slot:u,ItemSlot:p},function(f){const m=o(n+"CollectionConsumer",f);return Ce.useCallback(()=>{const E=m.collectionRef.current;if(!E)return[];const v=Array.from(E.querySelectorAll(`[${d}]`));return Array.from(m.itemMap.values()).sort((_,y)=>v.indexOf(_.ref.current)-v.indexOf(y.ref.current))},[m.collectionRef,m.itemMap])},r]}var Sw=kt(void 0);function H_(n){const e=qe(Sw);return n||e||"ltr"}var $_,Xh="dismissableLayer.update",bw="dismissableLayer.pointerDownOutside",Nw="dismissableLayer.focusOutside",j_=kt({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Y_=Q((n,e)=>{const{disableOutsidePointerEvents:t=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=n,u=qe(j_),[c,d]=ne(null),h=c?.ownerDocument??globalThis?.document,[,p]=ne({}),f=$e(e,S=>d(S)),m=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),E=m.indexOf(g),v=c?m.indexOf(c):-1,A=u.layersWithOutsidePointerEventsDisabled.size>0,_=v>=E,y=function(S,b=globalThis?.document){const O=en(S),C=W(!1),w=W(()=>{});return V(()=>{const I=x=>{if(x.target&&!C.current){let $=function(){V_(bw,O,k,{discrete:!0})};const k={originalEvent:x};x.pointerType==="touch"?(b.removeEventListener("click",w.current),w.current=$,b.addEventListener("click",w.current,{once:!0})):$()}else b.removeEventListener("click",w.current);C.current=!1},F=window.setTimeout(()=>{b.addEventListener("pointerdown",I)},0);return()=>{window.clearTimeout(F),b.removeEventListener("pointerdown",I),b.removeEventListener("click",w.current)}},[b,O]),{onPointerDownCapture:()=>C.current=!0}}(S=>{const b=S.target,O=[...u.branches].some(C=>C.contains(b));_&&!O&&(i?.(S),s?.(S),S.defaultPrevented||a?.())},h),T=function(S,b=globalThis?.document){const O=en(S),C=W(!1);return V(()=>{const w=I=>{I.target&&!C.current&&V_(Nw,O,{originalEvent:I},{discrete:!1})};return b.addEventListener("focusin",w),()=>b.removeEventListener("focusin",w)},[b,O]),{onFocusCapture:()=>C.current=!0,onBlurCapture:()=>C.current=!1}}(S=>{const b=S.target;[...u.branches].some(O=>O.contains(b))||(o?.(S),s?.(S),S.defaultPrevented||a?.())},h);return mA(S=>{v===u.layers.size-1&&(r?.(S),!S.defaultPrevented&&a&&(S.preventDefault(),a()))},h),V(()=>{if(c)return t&&(u.layersWithOutsidePointerEventsDisabled.size===0&&($_=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),z_(),()=>{t&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=$_)}},[c,h,t,u]),V(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),z_())},[c,u]),V(()=>{const S=()=>p({});return document.addEventListener(Xh,S),()=>document.removeEventListener(Xh,S)},[]),N(Ke.div,{...l,ref:f,style:{pointerEvents:A?_?"auto":"none":void 0,...n.style},onFocusCapture:pe(n.onFocusCapture,T.onFocusCapture),onBlurCapture:pe(n.onBlurCapture,T.onBlurCapture),onPointerDownCapture:pe(n.onPointerDownCapture,y.onPointerDownCapture)})});Y_.displayName="DismissableLayer";var Cw=Q((n,e)=>{const t=qe(j_),r=W(null),i=$e(e,r);return V(()=>{const o=r.current;if(o)return t.branches.add(o),()=>{t.branches.delete(o)}},[t.branches]),N(Ke.div,{...n,ref:i})});function z_(){const n=new CustomEvent(Xh);document.dispatchEvent(n)}function V_(n,e,t,{discrete:r}){const i=t.originalEvent.target,o=new CustomEvent(n,{bubbles:!1,cancelable:!0,detail:t});e&&i.addEventListener(n,e,{once:!0}),r?Oh(i,o):i.dispatchEvent(o)}Cw.displayName="DismissableLayerBranch";var Kh=0;function W_(){const n=document.createElement("span");return n.setAttribute("data-radix-focus-guard",""),n.tabIndex=0,n.style.outline="none",n.style.opacity="0",n.style.position="fixed",n.style.pointerEvents="none",n}var qh="Popper",[G_,X_]=Qr(qh),[Iw,K_]=G_(qh),q_=n=>{const{__scopePopper:e,children:t}=n,[r,i]=ne(null);return N(Iw,{scope:e,anchor:r,onAnchorChange:i,children:t})};q_.displayName=qh;var J_="PopperAnchor",Z_=Q((n,e)=>{const{__scopePopper:t,virtualRef:r,...i}=n,o=K_(J_,t),s=W(null),a=$e(e,s);return V(()=>{o.onAnchorChange(r?.current||s.current)}),r?null:N(Ke.div,{...i,ref:a})});Z_.displayName=J_;var Jh="PopperContent",[ww,Rw]=G_(Jh),Q_=Q((n,e)=>{const{__scopePopper:t,side:r="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:c=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:f,...m}=n,g=K_(Jh,t),[E,v]=ne(null),A=$e(e,se=>v(se)),[_,y]=ne(null),T=n_(_),S=T?.width??0,b=T?.height??0,O=r+(o!=="center"?"-"+o:""),C=typeof c=="number"?c:{top:0,right:0,bottom:0,left:0,...c},w=Array.isArray(u)?u:[u],I=w.length>0,F={padding:C,boundary:w.filter(kw),altBoundary:I},{refs:x,floatingStyles:$,placement:k,isPositioned:M,middlewareData:Y}=WA({strategy:"fixed",placement:O,whileElementsMounted:(...se)=>jA(...se,{animationFrame:p==="always"}),elements:{reference:g.anchor},middleware:[GA({mainAxis:i+b,alignmentAxis:s}),l&&XA({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?KA():void 0,...F}),l&&qA({...F}),JA({...F,apply:({elements:se,rects:U,availableWidth:de,availableHeight:fe})=>{const{width:Ne,height:ge}=U.reference,he=se.floating.style;he.setProperty("--radix-popper-available-width",`${de}px`),he.setProperty("--radix-popper-available-height",`${fe}px`),he.setProperty("--radix-popper-anchor-width",`${Ne}px`),he.setProperty("--radix-popper-anchor-height",`${ge}px`)}}),_&&QA({element:_,padding:a}),Lw({arrowWidth:S,arrowHeight:b}),h&&ZA({strategy:"referenceHidden",...F})]}),[L,J]=ny(k),j=en(f);hn(()=>{M&&j?.()},[M,j]);const re=Y.arrow?.x,te=Y.arrow?.y,D=Y.arrow?.centerOffset!==0,[Z,ee]=ne();return hn(()=>{E&&ee(window.getComputedStyle(E).zIndex)},[E]),N("div",{ref:x.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:M?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:n.dir,children:N(ww,{scope:t,placedSide:L,onArrowChange:y,arrowX:re,arrowY:te,shouldHideArrow:D,children:N(Ke.div,{"data-side":L,"data-align":J,...m,ref:A,style:{...m.style,animation:M?void 0:"none"}})})})});Q_.displayName=Jh;var ey="PopperArrow",Dw={top:"bottom",right:"left",bottom:"top",left:"right"},ty=Q(function(n,e){const{__scopePopper:t,...r}=n,i=Rw(ey,t),o=Dw[i.placedSide];return N("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:N(t_,{...r,ref:e,style:{...r.style,display:"block"}})})});function kw(n){return n!==null}ty.displayName=ey;var Lw=n=>({name:"transformOrigin",options:n,fn(e){const{placement:t,rects:r,middlewareData:i}=e,o=i.arrow?.centerOffset!==0,s=o?0:n.arrowWidth,a=o?0:n.arrowHeight,[l,u]=ny(t),c={start:"0%",center:"50%",end:"100%"}[u],d=(i.arrow?.x??0)+s/2,h=(i.arrow?.y??0)+a/2;let p="",f="";return l==="bottom"?(p=o?c:`${d}px`,f=-a+"px"):l==="top"?(p=o?c:`${d}px`,f=`${r.floating.height+a}px`):l==="right"?(p=-a+"px",f=o?c:`${h}px`):l==="left"&&(p=`${r.floating.width+a}px`,f=o?c:`${h}px`),{data:{x:p,y:f}}}});function ny(n){const[e,t="center"]=n.split("-");return[e,t]}var xw=q_,Mw=Z_,Pw=Q_,Bw=ty,Vl=n=>{const{present:e,children:t}=n,r=function(s){const[a,l]=ne(),u=W(null),c=W(s),d=W("none"),h=s?"mounted":"unmounted",[p,f]=function(m,g){return br((E,v)=>g[E][v]??E,m)}(h,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return V(()=>{const m=Wl(u.current);d.current=p==="mounted"?m:"none"},[p]),hn(()=>{const m=u.current,g=c.current;if(g!==s){const E=d.current,v=Wl(m);s?f("MOUNT"):v==="none"||m?.display==="none"?f("UNMOUNT"):f(g&&E!==v?"ANIMATION_OUT":"UNMOUNT"),c.current=s}},[s,f]),hn(()=>{if(a){let m;const g=a.ownerDocument.defaultView??window,E=A=>{const _=Wl(u.current).includes(A.animationName);if(A.target===a&&_&&(f("ANIMATION_END"),!c.current)){const y=a.style.animationFillMode;a.style.animationFillMode="forwards",m=g.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=y)})}},v=A=>{A.target===a&&(d.current=Wl(u.current))};return a.addEventListener("animationstart",v),a.addEventListener("animationcancel",E),a.addEventListener("animationend",E),()=>{g.clearTimeout(m),a.removeEventListener("animationstart",v),a.removeEventListener("animationcancel",E),a.removeEventListener("animationend",E)}}f("ANIMATION_END")},[a,f]),{isPresent:["mounted","unmountSuspended"].includes(p),ref:oe(m=>{u.current=m?getComputedStyle(m):null,l(m)},[])}}(e),i=typeof t=="function"?t({present:r.isPresent}):vn.only(t),o=$e(r.ref,function(s){let a=Object.getOwnPropertyDescriptor(s.props,"ref")?.get,l=a&&"isReactWarning"in a&&a.isReactWarning;return l?s.ref:(a=Object.getOwnPropertyDescriptor(s,"ref")?.get,l=a&&"isReactWarning"in a&&a.isReactWarning,l?s.props.ref:s.props.ref||s.ref)}(i));return typeof t=="function"||r.isPresent?Nr(i,{ref:o}):null};function Wl(n){return n?.animationName||"none"}Vl.displayName="Presence";var Zh="rovingFocusGroup.onEntryFocus",Fw={bubbles:!1,cancelable:!0},Ds="RovingFocusGroup",[Qh,ry,Uw]=U_(Ds),[Hw,iy]=Qr(Ds,[Uw]),[$w,jw]=Hw(Ds),oy=Q((n,e)=>N(Qh.Provider,{scope:n.__scopeRovingFocusGroup,children:N(Qh.Slot,{scope:n.__scopeRovingFocusGroup,children:N(Yw,{...n,ref:e})})}));oy.displayName=Ds;var Yw=Q((n,e)=>{const{__scopeRovingFocusGroup:t,orientation:r,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:c=!1,...d}=n,h=W(null),p=$e(e,h),f=H_(o),[m,g]=jh({prop:s,defaultProp:a??null,onChange:l,caller:Ds}),[E,v]=ne(!1),A=en(u),_=ry(t),y=W(!1),[T,S]=ne(0);return V(()=>{const b=h.current;if(b)return b.addEventListener(Zh,A),()=>b.removeEventListener(Zh,A)},[A]),N($w,{scope:t,orientation:r,dir:f,loop:i,currentTabStopId:m,onItemFocus:oe(b=>g(b),[g]),onItemShiftTab:oe(()=>v(!0),[]),onFocusableItemAdd:oe(()=>S(b=>b+1),[]),onFocusableItemRemove:oe(()=>S(b=>b-1),[]),children:N(Ke.div,{tabIndex:E||T===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...n.style},onMouseDown:pe(n.onMouseDown,()=>{y.current=!0}),onFocus:pe(n.onFocus,b=>{const O=!y.current;if(b.target===b.currentTarget&&O&&!E){const C=new CustomEvent(Zh,Fw);if(b.currentTarget.dispatchEvent(C),!C.defaultPrevented){const w=_().filter(I=>I.focusable);ly([w.find(I=>I.active),w.find(I=>I.id===m),...w].filter(Boolean).map(I=>I.ref.current),c)}}y.current=!1}),onBlur:pe(n.onBlur,()=>v(!1))})})}),sy="RovingFocusGroupItem",ay=Q((n,e)=>{const{__scopeRovingFocusGroup:t,focusable:r=!0,active:i=!1,tabStopId:o,children:s,...a}=n,l=bl(),u=o||l,c=jw(sy,t),d=c.currentTabStopId===u,h=ry(t),{onFocusableItemAdd:p,onFocusableItemRemove:f,currentTabStopId:m}=c;return V(()=>{if(r)return p(),()=>f()},[r,p,f]),N(Qh.ItemSlot,{scope:t,id:u,focusable:r,active:i,children:N(Ke.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...a,ref:e,onMouseDown:pe(n.onMouseDown,g=>{r?c.onItemFocus(u):g.preventDefault()}),onFocus:pe(n.onFocus,()=>c.onItemFocus(u)),onKeyDown:pe(n.onKeyDown,g=>{if(g.key==="Tab"&&g.shiftKey)return void c.onItemShiftTab();if(g.target!==g.currentTarget)return;const E=function(_,y,T){const S=function(b,O){return O!=="rtl"?b:b==="ArrowLeft"?"ArrowRight":b==="ArrowRight"?"ArrowLeft":b}(_.key,T);return y==="vertical"&&["ArrowLeft","ArrowRight"].includes(S)||y==="horizontal"&&["ArrowUp","ArrowDown"].includes(S)?void 0:zw[S]}(g,c.orientation,c.dir);if(E!==void 0){if(g.metaKey||g.ctrlKey||g.altKey||g.shiftKey)return;g.preventDefault();let _=h().filter(y=>y.focusable).map(y=>y.ref.current);if(E==="last")_.reverse();else if(E==="prev"||E==="next"){E==="prev"&&_.reverse();const y=_.indexOf(g.currentTarget);_=c.loop?(A=y+1,(v=_).map((T,S)=>v[(A+S)%v.length])):_.slice(y+1)}setTimeout(()=>ly(_))}var v,A}),children:typeof s=="function"?s({isCurrentTabStop:d,hasTabStop:m!=null}):s})})});ay.displayName=sy;var zw={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ly(n,e=!1){const t=document.activeElement;for(const r of n)if(r===t||(r.focus({preventScroll:e}),document.activeElement!==t))return}var Vw=oy,Ww=ay,ep=["Enter"," "],uy=["ArrowUp","PageDown","End"],Gw=["ArrowDown","PageUp","Home",...uy],Xw={ltr:[...ep,"ArrowRight"],rtl:[...ep,"ArrowLeft"]},Kw={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ks="Menu",[Ls,qw,Jw]=U_(ks),[ni,cy]=Qr(ks,[Jw,X_,iy]),Gl=X_(),dy=iy(),[Zw,lo]=ni(ks),[Qw,xs]=ni(ks),hy=n=>{const{__scopeMenu:e,open:t=!1,children:r,dir:i,onOpenChange:o,modal:s=!0}=n,a=Gl(e),[l,u]=ne(null),c=W(!1),d=en(o),h=H_(i);return V(()=>{const p=()=>{c.current=!0,document.addEventListener("pointerdown",f,{capture:!0,once:!0}),document.addEventListener("pointermove",f,{capture:!0,once:!0})},f=()=>c.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",f,{capture:!0}),document.removeEventListener("pointermove",f,{capture:!0})}},[]),N(xw,{...a,children:N(Zw,{scope:e,open:t,onOpenChange:d,content:l,onContentChange:u,children:N(Qw,{scope:e,onClose:oe(()=>d(!1),[d]),isUsingKeyboardRef:c,dir:h,modal:s,children:r})})})};hy.displayName=ks;var tp=Q((n,e)=>{const{__scopeMenu:t,...r}=n,i=Gl(t);return N(Mw,{...i,...r,ref:e})});tp.displayName="MenuAnchor";var[cL,py]=ni("MenuPortal",{forceMount:void 0}),tn="MenuContent",[eR,np]=ni(tn),fy=Q((n,e)=>{const t=py(tn,n.__scopeMenu),{forceMount:r=t.forceMount,...i}=n,o=lo(tn,n.__scopeMenu),s=xs(tn,n.__scopeMenu);return N(Ls.Provider,{scope:n.__scopeMenu,children:N(Vl,{present:r||o.open,children:N(Ls.Slot,{scope:n.__scopeMenu,children:s.modal?N(tR,{...i,ref:e}):N(nR,{...i,ref:e})})})})}),tR=Q((n,e)=>{const t=lo(tn,n.__scopeMenu),r=W(null),i=$e(e,r);return V(()=>{const o=r.current;if(o)return E_(o)},[]),N(rp,{...n,ref:i,trapFocus:t.open,disableOutsidePointerEvents:t.open,disableOutsideScroll:!0,onFocusOutside:pe(n.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>t.onOpenChange(!1)})}),nR=Q((n,e)=>{const t=lo(tn,n.__scopeMenu);return N(rp,{...n,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>t.onOpenChange(!1)})}),rR=Ns("MenuContent.ScrollLock"),rp=Q((n,e)=>{const{__scopeMenu:t,loop:r=!1,trapFocus:i,onOpenAutoFocus:o,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,disableOutsideScroll:f,...m}=n,g=lo(tn,t),E=xs(tn,t),v=Gl(t),A=dy(t),_=qw(t),[y,T]=ne(null),S=W(null),b=$e(e,S,g.onContentChange),O=W(0),C=W(""),w=W(0),I=W(null),F=W("right"),x=W(0),$=f?Gh:xe,k=f?{as:rR,allowPinchZoom:!0}:void 0,M=L=>{const J=C.current+L,j=_().filter(ee=>!ee.disabled),re=document.activeElement,te=j.find(ee=>ee.ref.current===re)?.textValue,D=function(ee,se,U){const de=se.length>1&&Array.from(se).every(Vt=>Vt===se[0]),fe=de?se[0]:se,Ne=U?ee.indexOf(U):-1;let ge=(he=ee,et=Math.max(Ne,0),he.map((Vt,zs)=>he[(et+zs)%he.length]));var he,et;fe.length===1&&(ge=ge.filter(Vt=>Vt!==U));const rn=ge.find(Vt=>Vt.toLowerCase().startsWith(fe.toLowerCase()));return rn!==U?rn:void 0}(j.map(ee=>ee.textValue),J,te),Z=j.find(ee=>ee.textValue===D)?.ref.current;(function ee(se){C.current=se,window.clearTimeout(O.current),se!==""&&(O.current=window.setTimeout(()=>ee(""),1e3))})(J),Z&&setTimeout(()=>Z.focus())};V(()=>()=>window.clearTimeout(O.current),[]),V(()=>{const L=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",L[0]??W_()),document.body.insertAdjacentElement("beforeend",L[1]??W_()),Kh++,()=>{Kh===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(J=>J.remove()),Kh--}},[]);const Y=oe(L=>F.current===I.current?.side&&function(J,j){if(!j)return!1;const re={x:J.clientX,y:J.clientY};return function(te,D){const{x:Z,y:ee}=te;let se=!1;for(let U=0,de=D.length-1;U<D.length;de=U++){const fe=D[U],Ne=D[de],ge=fe.x,he=fe.y,et=Ne.x,rn=Ne.y;he>ee!=rn>ee&&Z<(et-ge)*(ee-he)/(rn-he)+ge&&(se=!se)}return se}(re,j)}(L,I.current?.area),[]);return N(eR,{scope:t,searchRef:C,onItemEnter:oe(L=>{Y(L)&&L.preventDefault()},[Y]),onItemLeave:oe(L=>{Y(L)||(S.current?.focus(),T(null))},[Y]),onTriggerLeave:oe(L=>{Y(L)&&L.preventDefault()},[Y]),pointerGraceTimerRef:w,onPointerGraceIntentChange:oe(L=>{I.current=L},[]),children:N($,{...k,children:N(Ch,{asChild:!0,trapped:i,onMountAutoFocus:pe(o,L=>{L.preventDefault(),S.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:N(Y_,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:c,onFocusOutside:d,onInteractOutside:h,onDismiss:p,children:N(Vw,{asChild:!0,...A,dir:E.dir,orientation:"vertical",loop:r,currentTabStopId:y,onCurrentTabStopIdChange:T,onEntryFocus:pe(l,L=>{E.isUsingKeyboardRef.current||L.preventDefault()}),preventScrollOnEntryFocus:!0,children:N(Pw,{role:"menu","aria-orientation":"vertical","data-state":Dy(g.open),"data-radix-menu-content":"",dir:E.dir,...v,...m,ref:b,style:{outline:"none",...m.style},onKeyDown:pe(m.onKeyDown,L=>{const J=L.target.closest("[data-radix-menu-content]")===L.currentTarget,j=L.ctrlKey||L.altKey||L.metaKey,re=L.key.length===1;J&&(L.key==="Tab"&&L.preventDefault(),!j&&re&&M(L.key));const te=S.current;if(L.target!==te||!Gw.includes(L.key))return;L.preventDefault();const D=_().filter(Z=>!Z.disabled).map(Z=>Z.ref.current);uy.includes(L.key)&&D.reverse(),function(Z){const ee=document.activeElement;for(const se of Z)if(se===ee||(se.focus(),document.activeElement!==ee))return}(D)}),onBlur:pe(n.onBlur,L=>{L.currentTarget.contains(L.target)||(window.clearTimeout(O.current),C.current="")}),onPointerMove:pe(n.onPointerMove,Ps(L=>{const J=L.target,j=x.current!==L.clientX;if(L.currentTarget.contains(J)&&j){const re=L.clientX>x.current?"right":"left";F.current=re,x.current=L.clientX}}))})})})})})})});fy.displayName=tn;var ip=Q((n,e)=>{const{__scopeMenu:t,...r}=n;return N(Ke.div,{role:"group",...r,ref:e})});ip.displayName="MenuGroup";var my=Q((n,e)=>{const{__scopeMenu:t,...r}=n;return N(Ke.div,{...r,ref:e})});my.displayName="MenuLabel";var Xl="MenuItem",gy="menu.itemSelect",Kl=Q((n,e)=>{const{disabled:t=!1,onSelect:r,...i}=n,o=W(null),s=xs(Xl,n.__scopeMenu),a=np(Xl,n.__scopeMenu),l=$e(e,o),u=W(!1);return N(Ey,{...i,ref:l,disabled:t,onClick:pe(n.onClick,()=>{const c=o.current;if(!t&&c){const d=new CustomEvent(gy,{bubbles:!0,cancelable:!0});c.addEventListener(gy,h=>r?.(h),{once:!0}),Oh(c,d),d.defaultPrevented?u.current=!1:s.onClose()}}),onPointerDown:c=>{n.onPointerDown?.(c),u.current=!0},onPointerUp:pe(n.onPointerUp,c=>{u.current||c.currentTarget?.click()}),onKeyDown:pe(n.onKeyDown,c=>{const d=a.searchRef.current!=="";t||d&&c.key===" "||ep.includes(c.key)&&(c.currentTarget.click(),c.preventDefault())})})});Kl.displayName=Xl;var Ey=Q((n,e)=>{const{__scopeMenu:t,disabled:r=!1,textValue:i,...o}=n,s=np(Xl,t),a=dy(t),l=W(null),u=$e(e,l),[c,d]=ne(!1),[h,p]=ne("");return V(()=>{const f=l.current;f&&p((f.textContent??"").trim())},[o.children]),N(Ls.ItemSlot,{scope:t,disabled:r,textValue:i??h,children:N(Ww,{asChild:!0,...a,focusable:!r,children:N(Ke.div,{role:"menuitem","data-highlighted":c?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:u,onPointerMove:pe(n.onPointerMove,Ps(f=>{r?s.onItemLeave(f):(s.onItemEnter(f),!f.defaultPrevented&&f.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:pe(n.onPointerLeave,Ps(f=>s.onItemLeave(f))),onFocus:pe(n.onFocus,()=>d(!0)),onBlur:pe(n.onBlur,()=>d(!1))})})})}),vy=Q((n,e)=>{const{checked:t=!1,onCheckedChange:r,...i}=n;return N(Ty,{scope:n.__scopeMenu,checked:t,children:N(Kl,{role:"menuitemcheckbox","aria-checked":ql(t)?"mixed":t,...i,ref:e,"data-state":sp(t),onSelect:pe(i.onSelect,()=>r?.(!!ql(t)||!t),{checkForDefaultPrevented:!1})})})});vy.displayName="MenuCheckboxItem";var Ay="MenuRadioGroup",[iR,oR]=ni(Ay,{value:void 0,onValueChange:()=>{}}),_y=Q((n,e)=>{const{value:t,onValueChange:r,...i}=n,o=en(r);return N(iR,{scope:n.__scopeMenu,value:t,onValueChange:o,children:N(ip,{...i,ref:e})})});_y.displayName=Ay;var yy="MenuRadioItem",Oy=Q((n,e)=>{const{value:t,...r}=n,i=oR(yy,n.__scopeMenu),o=t===i.value;return N(Ty,{scope:n.__scopeMenu,checked:o,children:N(Kl,{role:"menuitemradio","aria-checked":o,...r,ref:e,"data-state":sp(o),onSelect:pe(r.onSelect,()=>i.onValueChange?.(t),{checkForDefaultPrevented:!1})})})});Oy.displayName=yy;var op="MenuItemIndicator",[Ty,sR]=ni(op,{checked:!1}),Sy=Q((n,e)=>{const{__scopeMenu:t,forceMount:r,...i}=n,o=sR(op,t);return N(Vl,{present:r||ql(o.checked)||o.checked===!0,children:N(Ke.span,{...i,ref:e,"data-state":sp(o.checked)})})});Sy.displayName=op;var by=Q((n,e)=>{const{__scopeMenu:t,...r}=n;return N(Ke.div,{role:"separator","aria-orientation":"horizontal",...r,ref:e})});by.displayName="MenuSeparator";var Ny=Q((n,e)=>{const{__scopeMenu:t,...r}=n,i=Gl(t);return N(Bw,{...i,...r,ref:e})});Ny.displayName="MenuArrow";var[dL,Cy]=ni("MenuSub"),Ms="MenuSubTrigger",Iy=Q((n,e)=>{const t=lo(Ms,n.__scopeMenu),r=xs(Ms,n.__scopeMenu),i=Cy(Ms,n.__scopeMenu),o=np(Ms,n.__scopeMenu),s=W(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,u={__scopeMenu:n.__scopeMenu},c=oe(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return V(()=>c,[c]),V(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),N(tp,{asChild:!0,...u,children:N(Ey,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":t.open,"aria-controls":i.contentId,"data-state":Dy(t.open),...n,ref:Sl(e,i.onTriggerChange),onClick:d=>{n.onClick?.(d),n.disabled||d.defaultPrevented||(d.currentTarget.focus(),t.open||t.onOpenChange(!0))},onPointerMove:pe(n.onPointerMove,Ps(d=>{o.onItemEnter(d),d.defaultPrevented||n.disabled||t.open||s.current||(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{t.onOpenChange(!0),c()},100))})),onPointerLeave:pe(n.onPointerLeave,Ps(d=>{c();const h=t.content?.getBoundingClientRect();if(h){const p=t.content?.dataset.side,f=p==="right",m=f?-5:5,g=h[f?"left":"right"],E=h[f?"right":"left"];o.onPointerGraceIntentChange({area:[{x:d.clientX+m,y:d.clientY},{x:g,y:h.top},{x:E,y:h.top},{x:E,y:h.bottom},{x:g,y:h.bottom}],side:p}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(d),d.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:pe(n.onKeyDown,d=>{const h=o.searchRef.current!=="";n.disabled||h&&d.key===" "||Xw[r.dir].includes(d.key)&&(t.onOpenChange(!0),t.content?.focus(),d.preventDefault())})})})});Iy.displayName=Ms;var wy="MenuSubContent",Ry=Q((n,e)=>{const t=py(tn,n.__scopeMenu),{forceMount:r=t.forceMount,...i}=n,o=lo(tn,n.__scopeMenu),s=xs(tn,n.__scopeMenu),a=Cy(wy,n.__scopeMenu),l=W(null),u=$e(e,l);return N(Ls.Provider,{scope:n.__scopeMenu,children:N(Vl,{present:r||o.open,children:N(Ls.Slot,{scope:n.__scopeMenu,children:N(rp,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:c=>{s.isUsingKeyboardRef.current&&l.current?.focus(),c.preventDefault()},onCloseAutoFocus:c=>c.preventDefault(),onFocusOutside:pe(n.onFocusOutside,c=>{c.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:pe(n.onEscapeKeyDown,c=>{s.onClose(),c.preventDefault()}),onKeyDown:pe(n.onKeyDown,c=>{const d=c.currentTarget.contains(c.target),h=Kw[s.dir].includes(c.key);d&&h&&(o.onOpenChange(!1),a.trigger?.focus(),c.preventDefault())})})})})})});function Dy(n){return n?"open":"closed"}function ql(n){return n==="indeterminate"}function sp(n){return ql(n)?"indeterminate":n?"checked":"unchecked"}function Ps(n){return e=>e.pointerType==="mouse"?n(e):void 0}Ry.displayName=wy;var aR=hy,lR=tp,uR=fy,cR=ip,dR=my,hR=Kl,pR=vy,fR=_y,mR=Oy,gR=Sy,ER=by,vR=Ny,AR=Iy,_R=Ry,Jl="DropdownMenu",[yR,hL]=Qr(Jl,[cy]),It=cy(),[OR,ky]=yR(Jl),Ly=n=>{const{__scopeDropdownMenu:e,children:t,dir:r,open:i,defaultOpen:o,onOpenChange:s,modal:a=!0}=n,l=It(e),u=W(null),[c,d]=jh({prop:i,defaultProp:o??!1,onChange:s,caller:Jl});return N(OR,{scope:e,triggerId:bl(),triggerRef:u,contentId:bl(),open:c,onOpenChange:d,onOpenToggle:oe(()=>d(h=>!h),[d]),modal:a,children:N(aR,{...l,open:c,onOpenChange:d,dir:r,modal:a,children:t})})};Ly.displayName=Jl;var xy="DropdownMenuTrigger",My=Q((n,e)=>{const{__scopeDropdownMenu:t,disabled:r=!1,...i}=n,o=ky(xy,t),s=It(t);return N(lR,{asChild:!0,...s,children:N(Ke.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:Sl(e,o.triggerRef),onPointerDown:pe(n.onPointerDown,a=>{r||a.button!==0||a.ctrlKey!==!1||(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:pe(n.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});My.displayName=xy;var Py="DropdownMenuContent",By=Q((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=ky(Py,t),o=It(t),s=W(!1);return N(uR,{id:i.contentId,"aria-labelledby":i.triggerId,...o,...r,ref:e,onCloseAutoFocus:pe(n.onCloseAutoFocus,a=>{s.current||i.triggerRef.current?.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:pe(n.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,c=l.button===2||u;i.modal&&!c||(s.current=!0)}),style:{...n.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)"}})});By.displayName=Py;var TR=Q((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(cR,{...i,...r,ref:e})});TR.displayName="DropdownMenuGroup";var SR=Q((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(dR,{...i,...r,ref:e})});SR.displayName="DropdownMenuLabel";var Fy=Q((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(hR,{...i,...r,ref:e})});Fy.displayName="DropdownMenuItem";var bR=Q((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(pR,{...i,...r,ref:e})});bR.displayName="DropdownMenuCheckboxItem";var NR=Q((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(fR,{...i,...r,ref:e})});NR.displayName="DropdownMenuRadioGroup";var CR=Q((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(mR,{...i,...r,ref:e})});CR.displayName="DropdownMenuRadioItem";var IR=Q((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(gR,{...i,...r,ref:e})});IR.displayName="DropdownMenuItemIndicator";var wR=Q((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(ER,{...i,...r,ref:e})});wR.displayName="DropdownMenuSeparator";var RR=Q((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(vR,{...i,...r,ref:e})});RR.displayName="DropdownMenuArrow";var DR=Q((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(AR,{...i,...r,ref:e})});DR.displayName="DropdownMenuSubTrigger";var kR=Q((n,e)=>{const{__scopeDropdownMenu:t,...r}=n,i=It(t);return N(_R,{...i,...r,ref:e,style:{...n.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)"}})});kR.displayName="DropdownMenuSubContent";var LR=Ly,xR=My,MR=By,PR=Fy;function Zl(n){const{popoverComponent:e,popoverProps:t,children:r,type:i="popover",...o}=n,[s,a]=ne(void 0),[l,u]=ne(!1);let c,d,h;return i==="menu"?(c=LR,d=xR,h=MR):(c=yw,d=Ow,h=Tw),N(t1.Provider,{value:{closePopover:()=>u(!1)},children:N(c,{modal:!0,open:l,onOpenChange:u,children:[N(d,{asChild:!0,children:N("button",{...o,ref:p=>(f=>{const m=f?.closest("[t-menu-boundary]")??void 0;a(m)})(p),children:r})}),N(h,{hideWhenDetached:!0,collisionBoundary:s,style:{zIndex:1e3},onWheel:p=>p.stopPropagation(),onTouchMove:p=>p.stopPropagation(),children:N(e,{...t})})]})})}function uo(n){return N(PR,{...n})}function BR(n){return Zf(n)}function co(n){return n.photoUrl??function(e,t){const r=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
126
126
  <rect x="0" y="0" width="100" height="100" fill="${Zf(e)}"/>
127
127
  <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>
128
128
  </svg>`.replace(/\s+/g," ");return"data:image/svg+xml;base64,"+qT(r)}(n.id,QT(n.name))}function Ql(n){return n<1024?n+" B":n<1048576?Math.floor(n/1024)+" KB":n<1073741824?Math.floor(n/1048576)+" MB":n<1099511627776?Math.floor(n/1073741824)+" GB":Math.floor(n/1099511627776)+" TB"}function Uy({latitude:n,longitude:e}){const t=n+","+e;return{imageUrl:`https://maps.googleapis.com/maps/api/staticmap?center=${t}&zoom=15&size=300x200&scale=2&maptype=roadmap&markers=${t}&key=${GT}`,linkUrl:`https://maps.google.com/maps?q=${t}&z=15`}}function FR(n,e){const[t,r]=ne({long:"",short:""});return pt(()=>{let i,o=!0;const s=()=>{const l=Date.now(),u=function(c,d,h){const p=c-d;let f,m,g;const E=new Date(d),v={month:"short",day:"numeric"};if(p<$y)return{changeTimeout:5e3,short:h.JUST_NOW,long:h.JUST_NOW};if(p<jy)f=$y,m="MINUTES",g=h.MINUTES;else if(p<Yy)f=jy,m="HOURS",g=h.HOURS;else{if(!(p<$R)){if(E.getFullYear()===new Date(c).getFullYear()){const _=E.toLocaleDateString(h.locale,v);return{changeTimeout:void 0,short:_,long:_}}{const _=E.toLocaleDateString(h.locale,{...v,year:"numeric"});return{changeTimeout:void 0,short:_,long:_}}}f=Yy,m="DAYS",g=h.DAYS}const A=Math.floor(p/f);return{changeTimeout:f,short:A+g,long:jR(A,m.toLowerCase(),h.locale)}}(l,n>l?l-2e3:n,e);return r(u),u},a=()=>{const l=s();o&&l.changeTimeout&&(i=window.setTimeout(a,l.changeTimeout))};return s(),i=window.setTimeout(a,100),()=>{o=!1,clearTimeout(i)}},[e,n]),t}function Hy(n){n=Math.floor(n);const e=Math.floor(n/3600);n%=3600;const t=Math.floor(n/60);n%=60;const r=o=>o.toString().padStart(2,"0");let i=`${r(t)}:${r(n)}`;return e>0&&(i=`${r(e)}:${i}`),i}const UR=864e5;function HR(n,e){const t=Date.now(),r=(i=n,o=t,Math.floor((o-i)/UR));var i,o;if(r<0||r===0)return e.TODAY;if(r===1)return e.YESTERDAY;const s={weekday:"long"},a=new Date(n);if(r<7)return a.toLocaleDateString(e.locale,s);const l=new Date(t);return function(c,d){return Math.floor((d-c)/31536e6)}(l.setFullYear(l.getFullYear()-1),n)===0?a.toLocaleDateString(e.locale,{...s,month:"long",day:"numeric"}):a.toLocaleDateString(e.locale,{...s,year:"numeric",month:"long",day:"numeric"})}const $y=6e4,jy=36e5,Yy=864e5,$R=6048e5;function jR(n,e,t){return new Intl.RelativeTimeFormat(t).format(-n,e)}function z(n,...e){const t=NT.bind(Ce.createElement)(n,...e);return Array.isArray(t)?Ce.createElement(Ce.Fragment,{},...t):t}function YR(n){const{common:e}=n;return e.conversation.subject?z`
@@ -1062,18 +1062,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1062
1062
 
1063
1063
  ${e.reactions.length>0&&z`
1064
1064
  <div className="t-emoji-reactions">
1065
- ${e.reactions.map(O=>{const T=O.currentUserReacted?"remove your reaction":"add reaction",S=O.count===1?"person":"people";return z`
1065
+ ${e.reactions.map(y=>{const T=y.currentUserReacted?"remove your reaction":"add reaction",S=y.count===1?"person":"people";return z`
1066
1066
  <button
1067
1067
  className="t-reaction-button"
1068
- t-active=${O.currentUserReacted?"true":void 0}
1069
- onClick=${()=>l.toggleReaction(e.id,O)}
1068
+ t-active=${y.currentUserReacted?"true":void 0}
1069
+ onClick=${()=>l.toggleReaction(e.id,y)}
1070
1070
  disabled=${!r.canAddReaction}
1071
- aria-label="${O.count} ${S} reacted with ${O.emoji}. Press to ${T}"
1072
- aria-pressed=${O.currentUserReacted}
1073
- key=${O.emoji}
1071
+ aria-label="${y.count} ${S} reacted with ${y.emoji}. Press to ${T}"
1072
+ aria-pressed=${y.currentUserReacted}
1073
+ key=${y.emoji}
1074
1074
  >
1075
- <span className="t-emoji">${O.emoji}</span>
1076
- <span className="t-num-reactions">${O.count}</span>
1075
+ <span className="t-emoji">${y.emoji}</span>
1076
+ <span className="t-num-reactions">${y.count}</span>
1077
1077
  </button>
1078
1078
  `})}
1079
1079
  </div>
@@ -1304,21 +1304,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1304
1304
  `;case"autolink":case"autoLink":case"suppressed":case"emoji":return i.text;case"codeblock":case"codeBlock":return"```"+i.language+`
1305
1305
  `+i.text+"```";case"codespan":case"codeSpan":return"```"+i.text+"```";case"mention":return r?`<!!mention:${i.id}|${i.text}>`:`@${i.text}`;case"customemoji":case"customEmoji":return r?`<!!customemoji:${i.text}>`:i.text;case"link":return`<${i.url}|${Dn(i.children)}>`;case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return function(o){const s=new URLSearchParams(o.params).toString(),a=s?o.action+"?"+s:o.action;return`<${o.type}:${a}|${Dn(o.children)}>`}(i);case"bulletlist":case"bulletList":return`
1306
1306
  `+Dn(i.children);case"bulletpoint":case"bulletPoint":return"- "+Dn(i.children)+`
1307
- `}}).join("")}(n,e).trim()}class qy{constructor(e,t,r,i,o){this.send=t,this.attachFile=r,this.shareLocation=i,this.toggleEmojiPicker=o,this.isEmpty=e.isEmpty,this.isTyping=e.isTyping,this.atTextLimit=e.atTextLimit,this.characterCount=e.characterCount,this.showEmojiPicker=e.showEmojiPicker}}const Jy=(n,e)=>t=>{const r=t.nodeBefore?.text;if(!r)return;const i=r.match(n);if(!i)return;const o=i[2],s=t.pos-o.length,a=t.pos;if(!t.doc.rangeHasMark(s,a,e.marks.literal))return{range:{from:s,to:a},text:o}},KR=/(^|\s)(:[^:\s]+:?)$/,qR=/(^|\s)(@[^@]*)$/;class Zy{constructor(e,t,r){this.state$=e,this.device$=t,this.userPermissions$=r,this.currentDoc=gl.EMPTY,this.maxLength=1e3,this.markAsTyping=function(i,o){let s=!1;return(...a)=>{if(!s)return s=!0,setTimeout(()=>{s=!1},o),i(...a)}}(()=>{this.controller?.markAsTyping()},5e3),this._suggesterKeydownHandlers={emoji:void 0,mention:void 0},this.toggleEmojiPicker=i=>{const o=this.state$.showEmojiPicker;i??=!o.peek(),o.set(i),i===!1&&this.focus()},this.spellcheck$=Ue(),this.placeholder$=Ue()}setEditorView(e){this.editorView=e}emojiSuggesterPlugin(){if(this.device$.peek().supportsEmojiPicker)return Rv({debug:!1,matcher:Jy(KR,Ze),onEnter:e=>this.suggestEmoji(e.text,e.range),onChange:e=>this.suggestEmoji(e.text,e.range),onExit:()=>this.onExitSuggester(),onKeyDown:({event:e})=>this._suggesterKeydownHandlers.emoji?.(e.key)??!1})}mentionsPlugin(){const e=this.userPermissions$.peek();if(Ie.defined(e),e.canMention)return Rv({debug:!1,matcher:Jy(qR,Ze),onEnter:t=>this.suggestMention(t.text,t.range),onChange:t=>this.suggestMention(t.text,t.range),onExit:()=>this.onExitSuggester(),onKeyDown:({event:t})=>this._suggesterKeydownHandlers.mention?.(t.key)??!1})}closeSuggester(){Ie.defined(this._suggestionRange),function(e,t){const{from:r,to:i}=t,o=e.state.tr.addMark(r,i,Ze.marks.literal.create());e.dispatch(o)}(this.editorView,this._suggestionRange)}listenKeydown(e,t){this._suggesterKeydownHandlers[e]=t}onExitSuggester(){this._suggestionRange=void 0,this.state$.suggestEmojiQuery.set(void 0),this.state$.suggestMentionQuery.set(void 0)}suggestEmoji(e,t){e.length<2||(this._suggestionRange=t,this.state$.suggestEmojiQuery.set(e))}suggestMention(e,t){e.length<1||(this._suggestionRange=t,this.state$.suggestMentionQuery.set(e))}onPasteImage(e){Ie.defined(this.uploadFile),this.uploadFile(e)}onChange(e){this.currentDoc=e;const t=e.asText(),r=e.size>this.maxLength&&t.length>this.maxLength;e.hasContent&&this.markAsTyping(),this.state$.assign({isTyping:e.hasContent,atTextLimit:r,isEmpty:!e.hasContent||t.trim().length===0,characterCount:e.size===0?0:e.size-2})}setMaxLength(e){this.maxLength=e}focus(){this.editorView?.dom.focus()}setText(e){this.editorView&&function(t,r){const i=t.state.doc.content.size,o=r.split(/(<!!(?:mention|customemoji):.*?>)/g).filter(a=>a||a.length).map(a=>{const[l,u,c]=a.match(/<!!mention:(.*)\|(.*)>/)||[null];if(l&&u&&c)return kv(u,c);const[d,h]=a.match(/<!!customemoji:(.*?)>/)||[null];return d&&h?Dv(h):Ze.text(a)}),s=t.state.tr.replaceWith(0,i,o);t.dispatch(s)}(this.editorView,e)}typeText(e){this.editorView&&function(t,r,i="replace"){const o=t.state.doc.content.size,s=i=="insert"?t.state.tr.insertText(r):t.state.tr.insertText(r,0,o);t.dispatch(s)}(this.editorView,e,"insert")}getText(){return this.currentDoc.asText().trim()}clearText(){this.editorView&&function(e){const t=e.state.doc.content.size,r=e.state.tr.insertText("",0,t);e.dispatch(r)}(this.editorView)}selectEmoji(e){Ie.defined(this.editorView),function(t,r,i){const o=Dv(r);let s;if(i){const{from:a,to:l}=i;s=t.state.tr.replaceRangeWith(a,l,o)}else s=t.state.tr.replaceSelectionWith(o,!1);t.dispatch(s)}(this.editorView,e,this._suggestionRange),this.focus()}selectMention(e){Ie.defined(this.editorView),function(t,r,i){const o=kv(r.id,r.name);let s=t.state.tr;if(i){const{from:a,to:l}=i;s=s.replaceRangeWith(a,l,o)}else s=s.replaceSelectionWith(o,!1);s=s.insertText(" "),t.dispatch(s)}(this.editorView,e,this._suggestionRange),this.focus()}}function Qy(n){const e=sn(),t=Re(),r=Li(),i=ye(t.referencedMessage$),o=ye(t.state$.userPermissions),s=Po(),{sendMessage:a}=QS(),l=ye(s.state$);let u;return u=n.editMessageId===void 0?new qy(l,a,n.attachFile,n.shareLocation,s.toggleEmojiPicker):new qy(l,n.onEditMessage,()=>{},()=>{},()=>{}),N(Fm.Provider,{value:{onClose:()=>s.toggleEmojiPicker(!1),onEmojiSelected:c=>s.selectEmoji(c)},children:N(e.MessageField,{common:r,referencedMessage:i,permissions:o,editor:u,editMessageId:n.editMessageId})})}function JR({message:n}){const e=Re(),t=yi(),r=ye(e.state$.editingMessageId),i=ce(()=>Dn(n.content[0].children),[n]),o=rr({isEmpty:i.length===0,isTyping:!1,atTextLimit:!1,characterCount:i.length,showEmojiPicker:!1,suggestEmojiQuery:void 0,suggestMentionQuery:void 0}),s=ce(()=>new Zy(o,e.device$,e.state$.userPermissions),[o,e]),a=ie(async()=>{const l=s.state$;if(l.isEmpty.peek()||l.atTextLimit.peek())return;const u=s.getText();u&&await t.editMessage(n.id,{text:u}),e.state$.editingMessageId.set(null)},[e,t,s,n.id]);return V(()=>{s.onEnter=a},[s,a]),V(()=>{s.focus(),s.setText(Dn(n.content[0].children,!0))},[s,n]),N(Mm.Provider,{value:s,children:N(Qy,{editMessageId:r,onEditMessage:a})})}function ZR(){const n=sn(),e=Li();return N(n.MessageListFooter,{common:e})}function QR(n){const e=sn(),t=Li();return N(e.MessageDivider,{common:t,...n})}function eD({message:n}){const e=sn(),t=Re(),r=Li(),[i,o]=ne("sent");return ki(s=>{if(n.id.startsWith("ephemeral-"))return o("sending");const a=t.state$.currentConversation.everyoneReadUntil.get();return a!==void 0?n.createdAt<=a?o("everyoneRead"):o("sent"):void 0}),N(e.Message,{common:r,message:n,messageStatus:i,permissions:t.messagePermissions$(n).get()})}function tD({extConversationId:n}){const e=Bo(),t=Re(),r=yi(),i=W(!0),o=W(null);pt(()=>{i.current=o.current.scrollTop>-30}),V(()=>{i.current&&(o.current.scrollTop=0)}),V(()=>{const l=new IntersectionObserver(u=>t.state$.visibility.isInView.set(u[0].isIntersecting),{threshold:.9});return l.observe(o.current),()=>l.disconnect()},[t]),V(()=>{const l=()=>t.state$.visibility.tabFocused.set(!document.hidden);return document.addEventListener("visibilitychange",l),()=>document.removeEventListener("visibilitychange",l)},[t]),ki(l=>{if(!o.current)return;const u=t.state$.visibility.tabFocused.get(),c=t.state$.visibility.isInView.get(),d=o.current.checkVisibility({contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0,checkOpacity:!0,checkVisibilityCSS:!0}),h=t.state$.currentConversation.get();return h&&h.isUnread&&u&&c&&d?e.conversation(h.id).markAsRead():void 0});const s=ie(l=>{const u=l.currentTarget;u.scrollHeight-u.clientHeight+u.scrollTop<90&&t.messageSubscription&&t.messageSubscription.loadMore(10)},[t.messageSubscription]),a=ye(t.state$.typing.child(n));return N("div",{className:"t-message-list",ref:o,"t-menu-boundary":"",onScroll:s,children:[a&&N(ZR,{}),N(Pc,{each:t.chatItems$,children:l=>N("div",{className:"t-message-group",children:N(Pc,{each:l,item:nD,itemProps:{controller:r,extConversationId:n}})})})]})}function nD({item$:n}){const e=Re(),t=ye(n),r=ye(e.state$.editingMessageId);return t instanceof Fc?N(QR,{timestamp:t.timestamp,isReadMarker:t.isReadMarker,isDayMarker:t.isDayMarker}):r===t.id?N(JR,{message:t}):N(eD,{message:t})}const rD=new Set(["ByV39eoc","B1FxElnd","aW4c49tW","qGfuGtx","SbERe5ee","ilaVEa15","FOlWOSaH","dao5gGmT","DLUgAhzL","fqXFumr6","FtiWHMYT","66iWOyWt","1375amYi","mWbJgzpt","jO7GqAvL","SkFIKxo5","2z4ILc3y","aDr8oPL1","Hku1c4Pt"]);function eu({appId:n,chatboxState:e}){const t=n.charAt(0)==="t"||rD.has(n);return V(()=>{switch(e.type){case"auth-failed":Un.error("Could not authenticate user. Check if you are authenticating correctly.");break;case"unknown-user":Un.error(`User \`${e.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":Un.error(e.error);break;case"wrong-app-id":Un.error(`Could not find given appId: "${e.appId}". You can find your appId on https://talkjs.com/dashboard.`);break;case"server-error":break;default:Ie.never(e)}},[e]),N("div",{className:"t-panel t-error-panel",children:[N("span",{className:"t-heading",children:"Something went wrong."}),N("p",{children:"Please reload the page and try again."}),N("p",t?{style:{fontStyle:"italic"},children:["Developer note: check your browser's developer tools console for messages that may help solve the problem.",N("br",{}),N("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 iD(){return N("div",{className:"t-panel t-error-panel",children:N("span",{className:"t-heading",style:{fontStyle:"italic"},children:ye(Re().t$).CHAT_NOT_FOUND})})}function eO(){return N("div",{className:"t-panel t-loading-panel",children:N(ih,{})})}function tO(){const n=ye(Re().t$);return N("div",{className:"t-panel t-error-panel",children:[N("span",{className:"t-heading",style:{fontStyle:"italic"},children:n.AUTH_EXPIRED_OVERLAY_TITLE}),N("p",{children:n.AUTH_EXPIRED_OVERLAY_DESCRIPTION})]})}const oD=()=>!0;async function up(n,e,{initialDelay:t,maxDelay:r,log:i,shouldRetry:o=oD}){return e().catch(async s=>{if(i&&i(`[TalkJS] Retries left: ${n}. Error: ${JSON.stringify(s)}.`),n===0||!await o(s))throw s;const a=1e3*t*1.2,l=r?Math.min(1e3*r,a):a,u=l*(1-(c=.05)+2*Math.random()*c);var c;return function(d){return d<=0?Promise.resolve():new Promise(h=>setTimeout(h,d))}(u).then(()=>up(n-1,e,{initialDelay:u/1e3,maxDelay:r,log:i,shouldRetry:o}))})}function Bs(){const n={},e=new Promise(function(t,r){n.resolve=t,n.reject=r});return n.promise=e,n}function sD(n,e,t){const{beforeBrowserPermissionPrompt:r,onMissingBrowserPermissionCallback:i}=qe(Pm);return ie(async()=>{function o(c){c==="denied"&&i({type:n})}if(!r||!await async function(c){if(!("permissions"in navigator))return!1;const d=c;try{return(await navigator.permissions.query({name:d})).state==="prompt"}catch{return!1}}(n))return e(c=>{o(c)});const s=Bs(),a=Bs(),l={type:n,showPrompt:async()=>(a.resolve({cancelled:!1}),await s.promise),cancel:()=>{a.resolve({cancelled:!0})}};try{r(l)}catch(c){Un.error("Your beforeBrowserPermissionPrompt callback threw an error: ",c),a.resolve({cancelled:!0})}const{cancelled:u}=await a.promise;return u?void 0:e(c=>{s.resolve(c),o(c)})},[r,i,n,e,...t])}function aD({onClose:n}){const e=Re(),t=yi(),r=Bo(),[i,o]=ne(null),s=ie(async l=>{try{if(l||(l=(await new Promise(m=>{const g=document.createElement("input");g.type="file",g.multiple=!1,g.addEventListener("change",()=>{m([...g.files])}),g.addEventListener("cancel",()=>{m([])}),g.click()}))[0]),!l)return;const{uploadPromise:u,upload:c}=await async function(m,g){const E=m.name;if(function(O){return/\.(mp4|ts|mov|webm|ogv)$/i.test(O)}(m.name)){const O=await dp("video",m,b=>({width:b.videoWidth,height:b.videoHeight,duration:b.duration,filename:E})),T=g.uploadVideo(m,O),S=function(b){switch(b.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"}}(m);return{uploadPromise:T,upload:{type:"video",file:m,metadata:O,temporaryBlobUrl:URL.createObjectURL(new Blob([m],{type:S}))}}}if(function(O){return/\.(mp3|m4a|ogg|oga|opus|flac|wav)$/i.test(O)}(m.name)){const O=await dp("audio",m,T=>({duration:T.duration,filename:E}));return{uploadPromise:g.uploadAudio(m,O),upload:{type:"audio",file:m,metadata:O,temporaryBlobUrl:URL.createObjectURL(new Blob([m]))}}}if(function(O){return/(gif|png|jpg|jpeg|svg|bmp|webp)$/i.test(O)}(m.name)){const O=await dp("img",m,T=>({width:T.naturalWidth,height:T.naturalHeight,filename:E}));return{uploadPromise:g.uploadImage(m,O),upload:{type:"image",file:m,metadata:O,temporaryBlobUrl:URL.createObjectURL(new Blob([m]))}}}const v={filename:E},A=g.uploadFile(m,v),_=URL.createObjectURL(new Blob([m]));return{uploadPromise:A,upload:{type:"file",file:m,metadata:v,temporaryBlobUrl:_}}}(l,r),d=c.file.size+","+c.file.name;e.state$.localFileBlobUrls.child(e.state$.extCurrentConversationId.peek()).child(d).set({url:c.temporaryBlobUrl,fetching:!1}),e.latestFileUpload=c;const h=Bs(),p={upload:c,closePreview:h.resolve,uploaded:!1};let f;o(p);try{f=await nO(u,h.promise),o({...p,uploaded:!0})}catch(m){if(m===cp)return;o(g=>({...g,error:m.toString()}))}if(await h.promise==="cancel")return;Ie.defined(f),t.sendFileMessage({fileToken:f})}finally{n(),o(null)}},[t,r,o,e,n]),a=sD("geolocation",async l=>{try{const u=Bs(),c={upload:{type:"location",location:void 0},uploaded:!1,closePreview:u.resolve};o(c);const{permissionResult:d,location:h}=await nO(new Promise(p=>{navigator.geolocation.getCurrentPosition(f=>{const m={latitude:f.coords.latitude,longitude:f.coords.longitude};p({permissionResult:"granted",location:m})},f=>{f.code===1?p({permissionResult:"denied"}):p({permissionResult:"granted"})})}),u.promise);if(l(d),!h||(o({...c,upload:{type:"location",location:h},uploaded:!0}),await u.promise==="cancel"))return;t.sendLocationMessage({location:h})}catch(u){if(u===cp)return;throw u}finally{n(),o(null)}},[t,o,n]);return{attachFile:s,shareLocation:a,uploadState:i}}const cp=Symbol("cancelled");function nO(n,e){return Promise.race([n,e.then(()=>Promise.reject(cp))])}async function dp(n,e,t){const r=document.createElement(n);try{return r.src=URL.createObjectURL(e),await new Promise((i,o)=>{const s=n==="img"?"load":"loadedmetadata";r.addEventListener(s,()=>{try{i(t(r))}catch(a){o(a)}},{once:!0})})}finally{URL.revokeObjectURL(r.src)}}function rO({children:n,className:e,...t}){return N("div",{className:"t-attach-overlay "+e,...t,children:n})}function lD({uploadState:n}){const e=n.error,t=n.uploaded;vl(()=>n.closePreview("cancel"),".t-upload-preview");const r=W(null);V(()=>{t&&r.current.focus()},[t]);const i=ye(Re().t$);return N(rO,{className:"t-upload-preview",children:N("div",{className:"t-preview",children:[N(uD,{upload:n.upload,uploaded:t}),e!==void 0&&N("div",{className:"t-error-row",children:e}),N("div",{className:"t-send-row",children:[N("button",{className:"t-cancel",onClick:()=>n.closePreview("cancel"),children:i.CANCEL}),e===void 0&&t&&N("button",{className:"t-confirm-send test__confirm-upload-button",onClick:()=>n.closePreview("send"),ref:r,children:i.SEND_BUTTON_TEXT})]})]})})}function uD({upload:n,uploaded:e}){const t=ye(Re().t$);return n.type!=="location"?N(xe,{children:[N(dD,{upload:n}),N(hD,{upload:n,uploaded:e,t})]}):e?N(cD,{location:n.location}):N("div",{className:"t-loading",children:N(ih,{})})}function cD({location:n}){const{imageUrl:e,linkUrl:t}=Uy(n);return N("a",{href:t,target:"_blank",rel:"noreferrer",className:"t-location-upload-preview",style:{background:`url(${JSON.stringify(e)}) center center / cover no-repeat`}})}const dD=Ce.memo(function({upload:n}){let e=null;const t=n.file;if(n.type==="video"){const r=/[.]ts/i.test(t.name)?"mpegts":"native";e=N("div",{className:"video-container",children:N(pD,{src:n.temporaryBlobUrl,videoType:r,playsInline:!0,controls:!0,preload:"auto"})})}else n.type==="image"?e=N("div",{className:"t-img-container",children:N("img",{src:URL.createObjectURL(t)})}):n.type==="audio"&&(e=N(Uc,{src:URL.createObjectURL(t),filename:t.name}));return e}),hD=Ce.memo(function({uploaded:n,upload:e,t}){let r;r=n?e.metadata.filename:t.UPLOAD_IN_PROGRESS;let i="",o="";return e.type==="file"&&(i="is-file",n&&(o="file-block")),N("div",{className:`t-filename-row ${i}`,children:N("div",{className:o,children:r})})});function pD(n){const{videoType:e,...t}=n;return N("video",{...t})}function fD(){const n=sn(),e=Re(),t=Li(),r=ye(e.state$.isUserConnected),i=ye(e.state$.userPermissions);return N(n.ChatHeader,{common:t,isUserConnected:r,permissions:i})}function mD({appId:n,chatHeaderVisible:e,messageFieldVisible:t}){const r=Po(),i=function(){const p=Re(),f=rr(()=>{const E=p.extUserId$.get(),v=p.errors$.get(),A=p.authTokenState$.get(),_=E&&p.currentUser$.get(),O=p.state$.currentConversation.get(),T=p.state$.extCurrentConversationId.get(),S=T&&p.state$.participants.child(T).get(),b=p.app$.get();return p.device$.get(),v.serverError?"server-error":v.wrongAppId?"wrong-app-id":A==="loading"||A==="idle"?"loading-token":A==="invalid"?"invalid-token":A==="expired"?"expired-token":A==="valid"?v.unknownUser?"unknown-user":v.unknownConversation?"loading-conv-failed":_&&O&&S&&b?"loaded":"loading-data":void Ie.unreachable()}),m=rr({type:"loading"});ki(E=>{const v=f.get(),A=p.state$.extCurrentConversationId.peek(),_=p.extUserId$.peek(),O=p.appId$.peek();function T(S){m.set({type:"loading"});const b=setTimeout(()=>{m.set(S)},5e3);return()=>clearTimeout(b)}switch(v){case"invalid-token":m.set({type:"auth-failed"});break;case"expired-token":m.set({type:"expired-token"});break;case"wrong-app-id":m.set({type:"wrong-app-id",appId:O});break;case"server-error":m.set({type:"server-error"});break;case"loading-data":case"loading-token":m.set({type:"loading"});break;case"loaded":m.set({type:"loaded",conversationId:A,userId:_});break;case"loading-conv-failed":E.onCleanup=T({type:"inaccessible-conversation",userId:_,conversationId:A});break;case"unknown-user":E.onCleanup=T({type:"unknown-user",userId:_});break;default:Ie.never(v)}});const g=rr({type:"loading"});return ki(E=>{if(m.type.get()==="loading"){g.set({type:"invisible-loading"});const v=setTimeout(()=>{g.set({type:"loading"})},1e3);E.onCleanup=()=>{clearTimeout(v)}}else g.set(m.get())}),ye(g)}(),{attachFile:o,shareLocation:s,uploadState:a}=aD({onClose:()=>r.focus()});V(()=>{r.uploadFile=o},[r,o]);const[l,u]=ne(!1),c=ie(p=>{o(p.dataTransfer.files[0]),p.preventDefault(),u(!1)},[o]),d=ie(p=>{p.preventDefault(),u(!0)},[]),h=ie(p=>{p.preventDefault(),u(!1)},[]);return i.type==="invisible-loading"?N(xe,{}):i.type==="loading"?N(eO,{}):i.type==="inaccessible-conversation"?N(iD,{}):i.type==="unknown-user"||i.type==="auth-failed"||i.type==="wrong-app-id"||i.type==="server-error"||i.type==="unexpected-error"?N(eu,{appId:n,chatboxState:i}):i.type=="expired-token"?N(tO,{}):i.type==="loaded"?N("div",{className:"t-chatbox-content",onDragOver:d,onDragLeave:h,onDrop:c,children:[e&&N(fD,{}),N(tD,{extConversationId:i.conversationId}),t&&N(Qy,{attachFile:o,shareLocation:s}),a&&N(lD,{uploadState:a}),l&&N(rO,{className:"t-drop-overlay",children:N(Ya,{type:"attach"})})]}):N(xe,{})}function gD(n,e){return n.map(r=>function(i,o){if(i.type==="text")return function(s,a){const l=Mv(a);return tu(s,l)}(i.children,o);if(i.type==="file"&&i.subtype==="video")return`🎥 ${pa(i.url)}`;if(i.type==="file"&&i.subtype==="image")return`📷 ${pa(i.url)}`;if(i.type==="file"&&i.subtype==="audio")return`🎧 ${pa(i.url)}`;if(i.type==="file"&&i.subtype==="voice"){const s=i.duration;return s===void 0?"🎙️":`🎙️ (${Math.floor(s/60)}:${Math.floor(s%60).toString().padStart(2,"0")})`}return i.type==="file"?(i.subtype,`📎 ${pa(i.url)}`):i.type==="location"?"📍":""}(r,e)).join(`
1307
+ `}}).join("")}(n,e).trim()}class qy{constructor(e,t,r,i,o){this.send=t,this.attachFile=r,this.shareLocation=i,this.toggleEmojiPicker=o,this.isEmpty=e.isEmpty,this.isTyping=e.isTyping,this.atTextLimit=e.atTextLimit,this.characterCount=e.characterCount,this.showEmojiPicker=e.showEmojiPicker}}const Jy=(n,e)=>t=>{const r=t.nodeBefore?.text;if(!r)return;const i=r.match(n);if(!i)return;const o=i[2],s=t.pos-o.length,a=t.pos;if(!t.doc.rangeHasMark(s,a,e.marks.literal))return{range:{from:s,to:a},text:o}},KR=/(^|\s)(:[^:\s]+:?)$/,qR=/(^|\s)(@[^@]*)$/;class Zy{constructor(e,t,r){this.state$=e,this.device$=t,this.userPermissions$=r,this.currentDoc=gl.EMPTY,this.maxLength=1e3,this.markAsTyping=function(i,o){let s=!1;return(...a)=>{if(!s)return s=!0,setTimeout(()=>{s=!1},o),i(...a)}}(()=>{this.controller?.markAsTyping()},5e3),this._suggesterKeydownHandlers={emoji:void 0,mention:void 0},this.toggleEmojiPicker=i=>{const o=this.state$.showEmojiPicker;i??=!o.peek(),o.set(i),i===!1&&this.focus()},this.spellcheck$=Ue(),this.placeholder$=Ue()}setEditorView(e){this.editorView=e}emojiSuggesterPlugin(){if(this.device$.peek().supportsEmojiPicker)return Rv({debug:!1,matcher:Jy(KR,Ze),onEnter:e=>this.suggestEmoji(e.text,e.range),onChange:e=>this.suggestEmoji(e.text,e.range),onExit:()=>this.onExitSuggester(),onKeyDown:({event:e})=>this._suggesterKeydownHandlers.emoji?.(e.key)??!1})}mentionsPlugin(){const e=this.userPermissions$.peek();if(Ie.defined(e),e.canMention)return Rv({debug:!1,matcher:Jy(qR,Ze),onEnter:t=>this.suggestMention(t.text,t.range),onChange:t=>this.suggestMention(t.text,t.range),onExit:()=>this.onExitSuggester(),onKeyDown:({event:t})=>this._suggesterKeydownHandlers.mention?.(t.key)??!1})}closeSuggester(){Ie.defined(this._suggestionRange),function(e,t){const{from:r,to:i}=t,o=e.state.tr.addMark(r,i,Ze.marks.literal.create());e.dispatch(o)}(this.editorView,this._suggestionRange)}listenKeydown(e,t){this._suggesterKeydownHandlers[e]=t}onExitSuggester(){this._suggestionRange=void 0,this.state$.suggestEmojiQuery.set(void 0),this.state$.suggestMentionQuery.set(void 0)}suggestEmoji(e,t){e.length<2||(this._suggestionRange=t,this.state$.suggestEmojiQuery.set(e))}suggestMention(e,t){e.length<1||(this._suggestionRange=t,this.state$.suggestMentionQuery.set(e))}onPasteImage(e){Ie.defined(this.uploadFile),this.uploadFile(e)}onChange(e){this.currentDoc=e;const t=e.asText(),r=e.size>this.maxLength&&t.length>this.maxLength;e.hasContent&&this.markAsTyping(),this.state$.assign({isTyping:e.hasContent,atTextLimit:r,isEmpty:!e.hasContent||t.trim().length===0,characterCount:e.size===0?0:e.size-2})}setMaxLength(e){this.maxLength=e}focus(){this.editorView?.dom.focus()}setText(e){this.editorView&&function(t,r){const i=t.state.doc.content.size,o=r.split(/(<!!(?:mention|customemoji):.*?>)/g).filter(a=>a||a.length).map(a=>{const[l,u,c]=a.match(/<!!mention:(.*)\|(.*)>/)||[null];if(l&&u&&c)return kv(u,c);const[d,h]=a.match(/<!!customemoji:(.*?)>/)||[null];return d&&h?Dv(h):Ze.text(a)}),s=t.state.tr.replaceWith(0,i,o);t.dispatch(s)}(this.editorView,e)}typeText(e){this.editorView&&function(t,r,i="replace"){const o=t.state.doc.content.size,s=i=="insert"?t.state.tr.insertText(r):t.state.tr.insertText(r,0,o);t.dispatch(s)}(this.editorView,e,"insert")}getText(){return this.currentDoc.asText().trim()}clearText(){this.editorView&&function(e){const t=e.state.doc.content.size,r=e.state.tr.insertText("",0,t);e.dispatch(r)}(this.editorView)}selectEmoji(e){Ie.defined(this.editorView),function(t,r,i){const o=Dv(r);let s;if(i){const{from:a,to:l}=i;s=t.state.tr.replaceRangeWith(a,l,o)}else s=t.state.tr.replaceSelectionWith(o,!1);t.dispatch(s)}(this.editorView,e,this._suggestionRange),this.focus()}selectMention(e){Ie.defined(this.editorView),function(t,r,i){const o=kv(r.id,r.name);let s=t.state.tr;if(i){const{from:a,to:l}=i;s=s.replaceRangeWith(a,l,o)}else s=s.replaceSelectionWith(o,!1);s=s.insertText(" "),t.dispatch(s)}(this.editorView,e,this._suggestionRange),this.focus()}}function Qy(n){const e=sn(),t=Re(),r=Li(),i=ye(t.referencedMessage$),o=ye(t.state$.userPermissions),s=Po(),{sendMessage:a}=QS(),l=ye(s.state$);let u;return u=n.editMessageId===void 0?new qy(l,a,n.attachFile,n.shareLocation,s.toggleEmojiPicker):new qy(l,n.onEditMessage,()=>{},()=>{},()=>{}),N(Fm.Provider,{value:{onClose:()=>s.toggleEmojiPicker(!1),onEmojiSelected:c=>s.selectEmoji(c)},children:N(e.MessageField,{common:r,referencedMessage:i,permissions:o,editor:u,editMessageId:n.editMessageId})})}function JR({message:n}){const e=Re(),t=yi(),r=ye(e.state$.editingMessageId),i=ce(()=>Dn(n.content[0].children),[n]),o=rr({isEmpty:i.length===0,isTyping:!1,atTextLimit:!1,characterCount:i.length,showEmojiPicker:!1,suggestEmojiQuery:void 0,suggestMentionQuery:void 0}),s=ce(()=>new Zy(o,e.device$,e.state$.userPermissions),[o,e]),a=oe(async()=>{const l=s.state$;if(l.isEmpty.peek()||l.atTextLimit.peek())return;const u=s.getText();u&&await t.editMessage(n.id,{text:u}),e.state$.editingMessageId.set(null)},[e,t,s,n.id]);return V(()=>{s.onEnter=a},[s,a]),V(()=>{s.focus(),s.setText(Dn(n.content[0].children,!0))},[s,n]),N(Mm.Provider,{value:s,children:N(Qy,{editMessageId:r,onEditMessage:a})})}function ZR(){const n=sn(),e=Li();return N(n.MessageListFooter,{common:e})}function QR(n){const e=sn(),t=Li();return N(e.MessageDivider,{common:t,...n})}function eD({message:n}){const e=sn(),t=Re(),r=Li(),[i,o]=ne("sent");return ki(s=>{if(n.id.startsWith("ephemeral-"))return o("sending");const a=t.state$.currentConversation.everyoneReadUntil.get();return a!==void 0?n.createdAt<=a?o("everyoneRead"):o("sent"):void 0}),N(e.Message,{common:r,message:n,messageStatus:i,permissions:t.messagePermissions$(n).get()})}function tD({extConversationId:n}){const e=Bo(),t=Re(),r=yi(),i=W(!0),o=W(null);pt(()=>{i.current=o.current.scrollTop>-30}),V(()=>{i.current&&(o.current.scrollTop=0)}),V(()=>{const l=new IntersectionObserver(u=>t.state$.visibility.isInView.set(u[0].isIntersecting),{threshold:.9});return l.observe(o.current),()=>l.disconnect()},[t]),V(()=>{const l=()=>t.state$.visibility.tabFocused.set(!document.hidden);return document.addEventListener("visibilitychange",l),()=>document.removeEventListener("visibilitychange",l)},[t]),ki(l=>{if(!o.current)return;const u=t.state$.visibility.tabFocused.get(),c=t.state$.visibility.isInView.get(),d=o.current.checkVisibility({contentVisibilityAuto:!0,opacityProperty:!0,visibilityProperty:!0,checkOpacity:!0,checkVisibilityCSS:!0}),h=t.state$.currentConversation.get();return h&&h.isUnread&&u&&c&&d?e.conversation(h.id).markAsRead():void 0});const s=oe(l=>{const u=l.currentTarget;u.scrollHeight-u.clientHeight+u.scrollTop<90&&t.messageSubscription&&t.messageSubscription.loadMore(10)},[t.messageSubscription]),a=ye(t.state$.typing.child(n));return N("div",{className:"t-message-list",ref:o,"t-menu-boundary":"",onScroll:s,children:[a&&N(ZR,{}),N(Pc,{each:t.chatItems$,children:l=>N("div",{className:"t-message-group",children:N(Pc,{each:l,item:nD,itemProps:{controller:r,extConversationId:n}})})})]})}function nD({item$:n}){const e=Re(),t=ye(n),r=ye(e.state$.editingMessageId);return t instanceof Fc?N(QR,{timestamp:t.timestamp,isReadMarker:t.isReadMarker,isDayMarker:t.isDayMarker}):r===t.id?N(JR,{message:t}):N(eD,{message:t})}const rD=new Set(["ByV39eoc","B1FxElnd","aW4c49tW","qGfuGtx","SbERe5ee","ilaVEa15","FOlWOSaH","dao5gGmT","DLUgAhzL","fqXFumr6","FtiWHMYT","66iWOyWt","1375amYi","mWbJgzpt","jO7GqAvL","SkFIKxo5","2z4ILc3y","aDr8oPL1","Hku1c4Pt"]);function eu({appId:n,chatboxState:e}){const t=n.charAt(0)==="t"||rD.has(n);return V(()=>{switch(e.type){case"auth-failed":Un.error("Could not authenticate user. Check if you are authenticating correctly.");break;case"unknown-user":Un.error(`User \`${e.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":Un.error(e.error);break;case"wrong-app-id":Un.error(`Could not find given appId: "${e.appId}". You can find your appId on https://talkjs.com/dashboard.`);break;case"server-error":break;default:Ie.never(e)}},[e]),N("div",{className:"t-panel t-error-panel",children:[N("span",{className:"t-heading",children:"Something went wrong."}),N("p",{children:"Please reload the page and try again."}),N("p",t?{style:{fontStyle:"italic"},children:["Developer note: check your browser's developer tools console for messages that may help solve the problem.",N("br",{}),N("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 iD(){return N("div",{className:"t-panel t-error-panel",children:N("span",{className:"t-heading",style:{fontStyle:"italic"},children:ye(Re().t$).CHAT_NOT_FOUND})})}function eO(){return N("div",{className:"t-panel t-loading-panel",children:N(ih,{})})}function tO(){const n=ye(Re().t$);return N("div",{className:"t-panel t-error-panel",children:[N("span",{className:"t-heading",style:{fontStyle:"italic"},children:n.AUTH_EXPIRED_OVERLAY_TITLE}),N("p",{children:n.AUTH_EXPIRED_OVERLAY_DESCRIPTION})]})}const oD=()=>!0;async function up(n,e,{initialDelay:t,maxDelay:r,log:i,shouldRetry:o=oD}){return e().catch(async s=>{if(i&&i(`[TalkJS] Retries left: ${n}. Error: ${JSON.stringify(s)}.`),n===0||!await o(s))throw s;const a=1e3*t*1.2,l=r?Math.min(1e3*r,a):a,u=l*(1-(c=.05)+2*Math.random()*c);var c;return function(d){return d<=0?Promise.resolve():new Promise(h=>setTimeout(h,d))}(u).then(()=>up(n-1,e,{initialDelay:u/1e3,maxDelay:r,log:i,shouldRetry:o}))})}function Bs(){const n={},e=new Promise(function(t,r){n.resolve=t,n.reject=r});return n.promise=e,n}function sD(n,e,t){const{beforeBrowserPermissionPrompt:r,onMissingBrowserPermissionCallback:i}=qe(Pm);return oe(async()=>{function o(c){c==="denied"&&i({type:n})}if(!r||!await async function(c){if(!("permissions"in navigator))return!1;const d=c;try{return(await navigator.permissions.query({name:d})).state==="prompt"}catch{return!1}}(n))return e(c=>{o(c)});const s=Bs(),a=Bs(),l={type:n,showPrompt:async()=>(a.resolve({cancelled:!1}),await s.promise),cancel:()=>{a.resolve({cancelled:!0})}};try{r(l)}catch(c){Un.error("Your beforeBrowserPermissionPrompt callback threw an error: ",c),a.resolve({cancelled:!0})}const{cancelled:u}=await a.promise;return u?void 0:e(c=>{s.resolve(c),o(c)})},[r,i,n,e,...t])}function aD({onClose:n}){const e=Re(),t=yi(),r=Bo(),[i,o]=ne(null),s=oe(async l=>{try{if(l||(l=(await new Promise(m=>{const g=document.createElement("input");g.type="file",g.multiple=!1,g.addEventListener("change",()=>{m([...g.files])}),g.addEventListener("cancel",()=>{m([])}),g.click()}))[0]),!l)return;const{uploadPromise:u,upload:c}=await async function(m,g){const E=m.name;if(function(y){return/\.(mp4|ts|mov|webm|ogv)$/i.test(y)}(m.name)){const y=await dp("video",m,b=>({width:b.videoWidth,height:b.videoHeight,duration:b.duration,filename:E})),T=g.uploadVideo(m,y),S=function(b){switch(b.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"}}(m);return{uploadPromise:T,upload:{type:"video",file:m,metadata:y,temporaryBlobUrl:URL.createObjectURL(new Blob([m],{type:S}))}}}if(function(y){return/\.(mp3|m4a|ogg|oga|opus|flac|wav)$/i.test(y)}(m.name)){const y=await dp("audio",m,T=>({duration:T.duration,filename:E}));return{uploadPromise:g.uploadAudio(m,y),upload:{type:"audio",file:m,metadata:y,temporaryBlobUrl:URL.createObjectURL(new Blob([m]))}}}if(function(y){return/(gif|png|jpg|jpeg|svg|bmp|webp)$/i.test(y)}(m.name)){const y=await dp("img",m,T=>({width:T.naturalWidth,height:T.naturalHeight,filename:E}));return{uploadPromise:g.uploadImage(m,y),upload:{type:"image",file:m,metadata:y,temporaryBlobUrl:URL.createObjectURL(new Blob([m]))}}}const v={filename:E},A=g.uploadFile(m,v),_=URL.createObjectURL(new Blob([m]));return{uploadPromise:A,upload:{type:"file",file:m,metadata:v,temporaryBlobUrl:_}}}(l,r),d=c.file.size+","+c.file.name;e.state$.localFileBlobUrls.child(e.state$.extCurrentConversationId.peek()).child(d).set({url:c.temporaryBlobUrl,fetching:!1}),e.latestFileUpload=c;const h=Bs(),p={upload:c,closePreview:h.resolve,uploaded:!1};let f;o(p);try{f=await nO(u,h.promise),o({...p,uploaded:!0})}catch(m){if(m===cp)return;o(g=>({...g,error:m.toString()}))}if(await h.promise==="cancel")return;Ie.defined(f),t.sendFileMessage({fileToken:f})}finally{n(),o(null)}},[t,r,o,e,n]),a=sD("geolocation",async l=>{try{const u=Bs(),c={upload:{type:"location",location:void 0},uploaded:!1,closePreview:u.resolve};o(c);const{permissionResult:d,location:h}=await nO(new Promise(p=>{navigator.geolocation.getCurrentPosition(f=>{const m={latitude:f.coords.latitude,longitude:f.coords.longitude};p({permissionResult:"granted",location:m})},f=>{f.code===1?p({permissionResult:"denied"}):p({permissionResult:"granted"})})}),u.promise);if(l(d),!h||(o({...c,upload:{type:"location",location:h},uploaded:!0}),await u.promise==="cancel"))return;t.sendLocationMessage({location:h})}catch(u){if(u===cp)return;throw u}finally{n(),o(null)}},[t,o,n]);return{attachFile:s,shareLocation:a,uploadState:i}}const cp=Symbol("cancelled");function nO(n,e){return Promise.race([n,e.then(()=>Promise.reject(cp))])}async function dp(n,e,t){const r=document.createElement(n);try{return r.src=URL.createObjectURL(e),await new Promise((i,o)=>{const s=n==="img"?"load":"loadedmetadata";r.addEventListener(s,()=>{try{i(t(r))}catch(a){o(a)}},{once:!0})})}finally{URL.revokeObjectURL(r.src)}}function rO({children:n,className:e,...t}){return N("div",{className:"t-attach-overlay "+e,...t,children:n})}function lD({uploadState:n}){const e=n.error,t=n.uploaded;vl(()=>n.closePreview("cancel"),".t-upload-preview");const r=W(null);V(()=>{t&&r.current.focus()},[t]);const i=ye(Re().t$);return N(rO,{className:"t-upload-preview",children:N("div",{className:"t-preview",children:[N(uD,{upload:n.upload,uploaded:t}),e!==void 0&&N("div",{className:"t-error-row",children:e}),N("div",{className:"t-send-row",children:[N("button",{className:"t-cancel",onClick:()=>n.closePreview("cancel"),children:i.CANCEL}),e===void 0&&t&&N("button",{className:"t-confirm-send test__confirm-upload-button",onClick:()=>n.closePreview("send"),ref:r,children:i.SEND_BUTTON_TEXT})]})]})})}function uD({upload:n,uploaded:e}){const t=ye(Re().t$);return n.type!=="location"?N(xe,{children:[N(dD,{upload:n}),N(hD,{upload:n,uploaded:e,t})]}):e?N(cD,{location:n.location}):N("div",{className:"t-loading",children:N(ih,{})})}function cD({location:n}){const{imageUrl:e,linkUrl:t}=Uy(n);return N("a",{href:t,target:"_blank",rel:"noreferrer",className:"t-location-upload-preview",style:{background:`url(${JSON.stringify(e)}) center center / cover no-repeat`}})}const dD=Ce.memo(function({upload:n}){let e=null;const t=n.file;if(n.type==="video"){const r=/[.]ts/i.test(t.name)?"mpegts":"native";e=N("div",{className:"video-container",children:N(pD,{src:n.temporaryBlobUrl,videoType:r,playsInline:!0,controls:!0,preload:"auto"})})}else n.type==="image"?e=N("div",{className:"t-img-container",children:N("img",{src:URL.createObjectURL(t)})}):n.type==="audio"&&(e=N(Uc,{src:URL.createObjectURL(t),filename:t.name}));return e}),hD=Ce.memo(function({uploaded:n,upload:e,t}){let r;r=n?e.metadata.filename:t.UPLOAD_IN_PROGRESS;let i="",o="";return e.type==="file"&&(i="is-file",n&&(o="file-block")),N("div",{className:`t-filename-row ${i}`,children:N("div",{className:o,children:r})})});function pD(n){const{videoType:e,...t}=n;return N("video",{...t})}function fD(){const n=sn(),e=Re(),t=Li(),r=ye(e.state$.isUserConnected),i=ye(e.state$.userPermissions);return N(n.ChatHeader,{common:t,isUserConnected:r,permissions:i})}function mD({appId:n,chatHeaderVisible:e,messageFieldVisible:t}){const r=Po(),i=function(){const p=Re(),f=rr(()=>{const E=p.extUserId$.get(),v=p.errors$.get(),A=p.authTokenState$.get(),_=E&&p.currentUser$.get(),y=p.state$.currentConversation.get(),T=p.state$.extCurrentConversationId.get(),S=T&&p.state$.participants.child(T).get(),b=p.app$.get();return p.device$.get(),v.serverError?"server-error":v.wrongAppId?"wrong-app-id":A==="loading"||A==="idle"?"loading-token":A==="invalid"?"invalid-token":A==="expired"?"expired-token":A==="valid"?v.unknownUser?"unknown-user":v.unknownConversation?"loading-conv-failed":_&&y&&S&&b?"loaded":"loading-data":void Ie.unreachable()}),m=rr({type:"loading"});ki(E=>{const v=f.get(),A=p.state$.extCurrentConversationId.peek(),_=p.extUserId$.peek(),y=p.appId$.peek();function T(S){m.set({type:"loading"});const b=setTimeout(()=>{m.set(S)},5e3);return()=>clearTimeout(b)}switch(v){case"invalid-token":m.set({type:"auth-failed"});break;case"expired-token":m.set({type:"expired-token"});break;case"wrong-app-id":m.set({type:"wrong-app-id",appId:y});break;case"server-error":m.set({type:"server-error"});break;case"loading-data":case"loading-token":m.set({type:"loading"});break;case"loaded":m.set({type:"loaded",conversationId:A,userId:_});break;case"loading-conv-failed":E.onCleanup=T({type:"inaccessible-conversation",userId:_,conversationId:A});break;case"unknown-user":E.onCleanup=T({type:"unknown-user",userId:_});break;default:Ie.never(v)}});const g=rr({type:"loading"});return ki(E=>{if(m.type.get()==="loading"){g.set({type:"invisible-loading"});const v=setTimeout(()=>{g.set({type:"loading"})},1e3);E.onCleanup=()=>{clearTimeout(v)}}else g.set(m.get())}),ye(g)}(),{attachFile:o,shareLocation:s,uploadState:a}=aD({onClose:()=>r.focus()});V(()=>{r.uploadFile=o},[r,o]);const[l,u]=ne(!1),c=oe(p=>{o(p.dataTransfer.files[0]),p.preventDefault(),u(!1)},[o]),d=oe(p=>{p.preventDefault(),u(!0)},[]),h=oe(p=>{p.preventDefault(),u(!1)},[]);return i.type==="invisible-loading"?N(xe,{}):i.type==="loading"?N(eO,{}):i.type==="inaccessible-conversation"?N(iD,{}):i.type==="unknown-user"||i.type==="auth-failed"||i.type==="wrong-app-id"||i.type==="server-error"||i.type==="unexpected-error"?N(eu,{appId:n,chatboxState:i}):i.type=="expired-token"?N(tO,{}):i.type==="loaded"?N("div",{className:"t-chatbox-content",onDragOver:d,onDragLeave:h,onDrop:c,children:[e&&N(fD,{}),N(tD,{extConversationId:i.conversationId}),t&&N(Qy,{attachFile:o,shareLocation:s}),a&&N(lD,{uploadState:a}),l&&N(rO,{className:"t-drop-overlay",children:N(Ya,{type:"attach"})})]}):N(xe,{})}function gD(n,e){return n.map(r=>function(i,o){if(i.type==="text")return function(s,a){const l=Mv(a);return tu(s,l)}(i.children,o);if(i.type==="file"&&i.subtype==="video")return`🎥 ${pa(i.url)}`;if(i.type==="file"&&i.subtype==="image")return`📷 ${pa(i.url)}`;if(i.type==="file"&&i.subtype==="audio")return`🎧 ${pa(i.url)}`;if(i.type==="file"&&i.subtype==="voice"){const s=i.duration;return s===void 0?"🎙️":`🎙️ (${Math.floor(s/60)}:${Math.floor(s%60).toString().padStart(2,"0")})`}return i.type==="file"?(i.subtype,`📎 ${pa(i.url)}`):i.type==="location"?"📍":""}(r,e)).join(`
1308
1308
 
1309
1309
  `)}function tu(n,e){return n.flatMap(t=>{if(typeof t=="string")return t;switch(t.type){case"blockquote":case"bold":case"italic":case"strikethrough":case"link":case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return tu(t.children,e);case"bulletlist":case"bulletList":return`
1310
1310
  `+tu(t.children,e);case"bulletpoint":case"bulletPoint":return"- "+tu(t.children,e)+`
1311
- `;case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"emoji":case"customemoji":case"customEmoji":return t.text;case"suppressed":return e.contactInfoHiddenText;case"mention":return`@${t.text}`}}).join("")}function iO(){const n=typeof window<"u"?window.crypto:void 0,e=n?()=>n.getRandomValues(new Uint8Array(1))[0]:()=>Math.floor(255*Math.random());return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(t^e()&15>>t/4).toString(16))}class ED{constructor(e,t,r,i,o){this.store=e,this.talkSession=t,this.editorInternals=r,this.onSendMessage=i,this.onDeleteMessage=o}async deleteMessage(e){const t=this.store.state$.extCurrentConversationId.peek(),r=this.store.state$.messages.child(t).lookup.child(e).peek(),i=this.talkSession.conversation(t).message(e),[o]=await Promise.all([r??i.get(),i.delete()]);if(o){const s={currentUser:this.store.currentUser$.peek(),conversation:this.store.state$.currentConversation.peek(),message:r};this.onDeleteMessage(s)}}setEditing(e){this.store.state$.editingMessageId.set(e)}async editMessage(e,t){const r=this.store.state$.extCurrentConversationId.peek();await this.talkSession.conversation(r).message(e).edit(t)}setReferencedMessage(e){this.store.state$.referencedMessageId.set(e)}async sendMessage(e){const t=this.store.state$.extCurrentConversationId.peek(),r=await async function(s,a){const l=s.state$.extCurrentConversationId.peek(),u=s.state$.messages.child(l),c=typeof a.referencedMessage=="string"?u.lookup.child(a.referencedMessage).peek():await(a.referencedMessage?.get()??null),d=c&&{...c,type:"UserMessage",sender:c.sender,referencedMessageId:c.referencedMessage?.id??null};d&&delete d.referencedMessage;const h=s.latestFileUpload,p="content"in a?[oO(h,a.content[0])]:[vD(a.text)],f="text"in a?a.text:gD(a.content.map(m=>oO(h,m)),{});return{id:"ephemeral-"+iO(),type:"UserMessage",sender:s.currentUser$.peek(),createdAt:Date.now(),editedAt:null,custom:a.custom??{},origin:"web",referencedMessage:d,reactions:[],content:p,plaintext:f}}(this.store,e);this.store.state$.ephemeralMessages.child(t).child(r.id).set(r);const i=Bs();this.store.readyForNewMessagesPromise=i.promise;const o=await this.talkSession.conversation(t).send(e);this.store.state$.ephemeralMessageIdMapping.child(t).child(o.id).set(r.id),i.resolve(),this.onSendMessage({message:await o.get(),currentUser:this.store.currentUser$.peek(),conversation:this.store.state$.currentConversation.peek()})}sendFileMessage(e){const t={type:"file",fileToken:e.fileToken};return this.sendMessage({content:[t],custom:e.custom})}sendLocationMessage(e){const t={type:"location",latitude:e.location.latitude,longitude:e.location.longitude};return this.sendMessage({content:[t],custom:e.custom})}getMessageFieldText(){return this.editorInternals.getText()}setMessageFieldText(e){this.editorInternals.setText(e)}markAsTyping(){const e=this.store.state$.extCurrentConversationId.peek();this.talkSession.conversation(e).markAsTyping()}async toggleReaction(e,t){this.store.state$.extCurrentConversationId.peek();const r=this.getReactionRef(e,t.emoji);t.currentUserReacted?await r.remove():await r.add()}async addReaction(e,t){this.store.state$.extCurrentConversationId.peek(),await this.getReactionRef(e,t).add()}getReactionRef(e,t){const r=this.store.state$.extCurrentConversationId.peek();return this.talkSession.conversation(r).message(e).reaction(t)}}const vD=n=>({type:"text",children:function(t){return bv(t,{except:["FormattedLink","Actions"]})}(n)});function oO(n,e){switch(e.type){case"text":case"location":return e;case"file":return function(t,r){return{type:"file",subtype:t.type==="file"?void 0:t.type,...t.metadata,size:t.file.size,filename:t.file.name,fileToken:r.fileToken,url:t.temporaryBlobUrl}}(n,e)}}var sO,AD=Object.defineProperty,_D=Object.defineProperties,yD=Object.getOwnPropertyDescriptors,nu=Object.getOwnPropertySymbols,aO=Object.prototype.hasOwnProperty,lO=Object.prototype.propertyIsEnumerable,uO=(n,e,t)=>e in n?AD(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Se=(n,e)=>{for(var t in e||(e={}))aO.call(e,t)&&uO(n,t,e[t]);if(nu)for(var t of nu(e))lO.call(e,t)&&uO(n,t,e[t]);return n},mn=(n,e)=>_D(n,yD(e)),cO=(n,e)=>{var t={};for(var r in n)aO.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&nu)for(var r of nu(n))e.indexOf(r)<0&&lO.call(n,r)&&(t[r]=n[r]);return t},$=(n,e,t)=>new Promise((r,i)=>{var o=l=>{try{a(t.next(l))}catch(u){i(u)}},s=l=>{try{a(t.throw(l))}catch(u){i(u)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((t=t.apply(n,e)).next())});function Be(n,e){if(e.ok)return e.value.data;throw e.value==="SESSION_DESTROYED"?new Error(`${n} failed because the session was destroyed`):e.where==="server"?new Error(Fs(n,e.value)):"unreachable"}function Fs(n,e){let t;return t=Array.isArray(e.reasons)?e.reasons.join():JSON.stringify(e.reasons),`${n} failed, got status ${e.status} ${e.errorCode}, reasons: ${t}`}function nn(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(e[t]!=="*"&&n[t]!==e[t])return!1;return!0}function dO(n){return n<=0?Promise.resolve():new Promise(e=>setTimeout(e,n))}function hp(n,e){return n*(1-e+2*Math.random()*e)}const OD=()=>!0;function hO(n,e,t){return $(this,arguments,function*(r,i,{initialDelay:o,maxDelay:s,log:a,shouldRetry:l=OD}){return i().catch(u=>$(this,null,function*(){if(r===0||!(yield l(u)))throw u;const c=1e3*o*1.2,d=hp(s?Math.min(1e3*s,c):c,.05);return dO(d).then(()=>hO(r-1,i,{initialDelay:d/1e3,maxDelay:s,log:a,shouldRetry:l}))}))})}function ri(){const n={},e=new Promise(function(t,r){n.resolve=t,n.reject=r});return n.promise=e,n}class ru{constructor(e,t,r){this.layer=e,this.states=t,this.transitions=r,this._state=t[0]}get state(){return this._state}transition(e){const t=this.transitions[e];if(!t||!this.canTransition(e))return;const r=this.state;this._state=t.to,t.afterTransition({from:r,to:this.state})}canTransition(e){const t=this.transitions[e];return!!t&&(t.from==="ANY"||t.from.includes(this.state))}}function K(n){return{ok:!0,value:n}}function je(n){return{ok:!1,where:"client",value:n}}function ii(n){return{ok:!1,where:"server",value:n}}function Us(){const n={},e=new Promise(t=>{n.ok=r=>$(this,null,function*(){return t(K(r))}),n.clientErr=r=>t(je(r)),n.serverErr=r=>t(ii(r)),n.resolve=r=>t(r)});return n.promise=e,n}class TD{constructor(e,t){this.realtimeUrl=e,this.handlers=t,this.socket=null,this.stateMachine=new ru("ReconnectingSocket",["STOPPED","CONNECTING","READY","DISCONNECTED","TERMINATED"],{startWs:{from:["STOPPED","DISCONNECTED"],to:"CONNECTING",afterTransition:()=>{const r=new(function(){if(globalThis.WebSocket)return globalThis.WebSocket;throw new Error("Missing WebSocket implementation")}())(this.realtimeUrl+"&talkjs-time="+Date.now());this.socket=r,r.addEventListener("open",()=>{this.socket===r&&this.stateMachine.transition("onOpen")}),r.addEventListener("close",()=>{this.socket===r&&this.stateMachine.transition("onClose")}),r.addEventListener("message",i=>{this.socket===r&&this.handlers.onMessage(i)})}},onOpen:{from:["CONNECTING"],to:"READY",afterTransition:()=>{this.handlers.onOpen()}},onClose:{from:["CONNECTING","READY"],to:"DISCONNECTED",afterTransition:r=>$(this,[r],function*({from:i}){i==="READY"&&this.handlers.onClose(),this.socket=null;const o=hp(1e4,.5);setTimeout(()=>{this.stateMachine.state==="DISCONNECTED"&&this.stateMachine.transition("startWs")},o)})},stopWs:{from:["CONNECTING","DISCONNECTED","READY"],to:"STOPPED",afterTransition:({from:r})=>{r==="READY"&&this.handlers.onClose();const i=this.socket;this.socket=null,i?.close(1e3)}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{const r=this.socket;this.socket=null,r?.close(1e3)}}})}stopWs(){this.stateMachine.transition("stopWs")}startWs(){this.stateMachine.transition("startWs")}send(e){return this.stateMachine.state==="READY"?(this.socket.send(e),K(void 0)):je("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 SD{constructor(e,t){this.handlers=t,this.socket=new TD(e,{onOpen:()=>this.handlers.onOpen(),onClose:()=>this.handlers.onClose(),onMessage:r=>this.onWebSocketMessage(r)})}call(e,t,r,i){const o=`/${r.map(a=>encodeURIComponent(a)).join("/")}`,s=JSON.stringify([e,t,o,i]);return this.socket.send(s)}stopWs(){this.socket.stopWs()}startWs(){this.socket.startWs()}destroy(){this.socket.destroy()}terminate(){this.socket.terminate()}onWebSocketMessage(e){if(e.data!=="Auth token expired")try{const t=JSON.parse(e.data);if(t[1]==="PUBLISH"){const r=t[0],i=JSON.stringify([r,"ACK"]);this.socket.send(i);const o=t.slice(2),s=[];o.forEach(a=>{a.type==="session.expired"?this.handlers.onAuthExpired():a.type==="upstream.restarting"?this.handlers.onUpstreamRestarting():s.push(a)}),s.length>0&&this.handlers.onPublish(r,s)}else{const r=t[0],i=t[1],o=t[2];this.handlers.onResponse(r,i,o)}}catch{}else this.handlers.onAuthExpired()}}class iu{constructor(e){this.delayMs=e,this.timeout=void 0}schedule(e){this.stop(),this.timeout=setTimeout(()=>{this.timeout!==void 0&&(this.stop(),e())},this.delayMs)}stop(){this.timeout!==void 0&&(clearTimeout(this.timeout),this.timeout=void 0)}}class bD{constructor(){this.i=-1}next(){return this.i++,this.i}reset(){this.i=-1}}class ND{constructor(e,t){this.handlers=t,this.seqCounter=new bD,this.responseHandlers={},this.heartbeats=new CD(this),this.socket=new SD(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(r=>{r.clientErr("WEBSOCKET_DISCONNECTED")}),this.responseHandlers={},this.seqCounter.reset(),this.handlers.onNotReady()},onResponse:(r,i,o)=>{this.heartbeats.serverActive(),this.onResponse(r,i,o)},onPublish:(r,i)=>{this.heartbeats.serverActive(),this.handlers.onPublish(r,i),this.heartbeats.clientActive()},onAuthExpired:()=>{this.heartbeats.serverActive(),this.handlers.onAuthExpired()}})}call(e,t,r){const i=this.seqCounter.next(),o=Us();this.responseHandlers[i]=o;const s=this.socket.call(i,e,t,r);return s.ok||o.resolve(s),this.heartbeats.clientActive(),o.promise}onResponse(e,t,r){return $(this,null,function*(){const i=this.responseHandlers[e];i&&(t===200?i.ok({status:t,data:r}):i.serverErr({status:t,errorCode:r.errorCode,reasons:r.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 CD{constructor(e){this.connection=e,this.clientInactivityTimer=new iu(25e3),this.serverInactivityTimer=new iu(1e4),this.serverTimeoutTimer=new iu(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 ID{constructor(e,t,r){this.authProvider=t,this.handlers=r,this.stateMachine=new ru("AuthenticatedConnection",["WAITING_FOR_WS","LOGGING_IN","RENEWING_SESSION","READY","TERMINATED"],{logIn:{from:["WAITING_FOR_WS"],to:"LOGGING_IN",afterTransition:()=>$(this,null,function*(){yield this.renewSession()})},logInFailed:{from:["LOGGING_IN"],to:"LOGGING_IN",afterTransition:()=>$(this,null,function*(){this.authProvider.refreshToken(),yield this.renewSession()})},scheduledReauth:{from:["READY"],to:"RENEWING_SESSION",afterTransition:()=>$(this,null,function*(){yield this.renewSession()})},scheduledReauthFailed:{from:["RENEWING_SESSION"],to:"RENEWING_SESSION",afterTransition:()=>$(this,null,function*(){this.authProvider.refreshToken(),yield this.renewSession()})},authenticated:{from:["LOGGING_IN","RENEWING_SESSION"],to:"READY",afterTransition:({from:i})=>{i==="LOGGING_IN"&&this.handlers.onReady()}},authExpired:{from:["READY","RENEWING_SESSION"],to:"LOGGING_IN",afterTransition:()=>$(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:i})=>{i!=="READY"&&i!=="RENEWING_SESSION"||this.handlers.onNotReady(),this.authProvider.clearScheduledRefresh()}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{this.authProvider.clearScheduledRefresh(),this.connection.destroy()}}}),this.connection=new ND(e,{onUpstreamRestarting:()=>this.handlers.onUpstreamRestarting(),onReady:()=>this.stateMachine.transition("logIn"),onNotReady:()=>{this.stateMachine.transition("wsDisconnected")},onAuthExpired:()=>{this.stateMachine.transition("authExpired")},onPublish:(i,o)=>{this.handlers.onPublish(i,o)}}),t.onTokenChanged(()=>{this.stateMachine.state==="READY"&&this.stateMachine.transition("scheduledReauth")})}call(e,t,r){const i=this.connection.call(e,t,r);return i.then(o=>{o.ok||o.where!=="server"||o.value.status!==401||this.stateMachine.state!=="READY"&&this.stateMachine.state!=="RENEWING_SESSION"||this.stateMachine.transition("authExpired")}),i}stopWs(){this.connection.stopWs()}startWs(){this.connection.startWs()}destroy(){this.stateMachine.transition("destroy")}renewSession(){return $(this,null,function*(){const e=yield this.authProvider.getToken(),t=yield this.connection.call("POST",["session","renew"],{token:e});if(!t.ok&&t.where==="client")return;const r=t.value;if(r.status,r.status===200){const o=r.data.expiresInSeconds;return void(o!==null&&o<120?(console.warn(`[TalkJS] Authenticated with a token that expires in ${o}s. Treating it as already expired and refreshing. Newly generated tokens should last at least 10 minutes.`),this.stateMachine.state==="LOGGING_IN"?this.stateMachine.transition("logInFailed"):this.stateMachine.state==="RENEWING_SESSION"&&this.stateMachine.transition("scheduledReauthFailed")):(this.authProvider.scheduleRefresh(o),this.authProvider.emitTokenAccepted(e),this.stateMachine.canTransition("authenticated")&&this.stateMachine.transition("authenticated")))}if(r.status===401)return void(this.stateMachine.state==="LOGGING_IN"?this.stateMachine.transition("logInFailed"):this.stateMachine.state==="RENEWING_SESSION"&&this.stateMachine.transition("scheduledReauthFailed"));if(r.status===400)return void this.authProvider.emitTokenRefreshFailed(Fs("Authentication",r));if(r.status===402)return void this.authProvider.emitTokenRefreshFailed(Fs("Authentication",r));const i=5e3*Math.random()+5e3;setTimeout(()=>{this.call("POST",["session","renew"],{token:e}).catch(()=>{})},i)})}}class wD{constructor(e,t,r){this.handlers=r,this.stateMachine=new ru("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 iu(3e3),this.connection=new ID(e,t,{onUpstreamRestarting:()=>{this.handlers.onUpstreamRestarting()},onReady:()=>{this.stateMachine.transition("ready")},onNotReady:()=>{this.stateMachine.state==="READY"&&this.stateMachine.transition("unexpectedDisconnect")},onPublish:(i,o)=>{this.handlers.onPublish(i,o)}})}get inactive(){return this.pendingCalls===0&&this.activeSubscriptions===0}ensureStarted(){this.stateMachine.canTransition("start")&&this.stateMachine.transition("start")}call(e,t,r){return $(this,null,function*(){this.inactivityTimer.stop(),this.pendingCalls++;const i=yield this.connection.call(e,t,r);return this.pendingCalls--,e==="SUBSCRIBE"&&i.ok?this.activeSubscriptions++:e==="UNSUBSCRIBE"&&i.ok&&this.activeSubscriptions--,this.inactive&&this.inactivityTimer.schedule(()=>{this.stateMachine.transition("stop")}),i})}destroy(){this.stateMachine.transition("destroy")}isConnected(){return this.stateMachine.state==="READY"}}class RD{constructor(e,t,r){this.handlers=r,this.stateMachine=new ru("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(i=>i.deferred.ok({status:200,data:{}})),this.subscribeQueue={},this.handlers.onSubscriptionsLost()}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{for(var i;this.callQueue.length;){const o=(i=this.callQueue.shift())==null?void 0:i.deferred;o?.clientErr("SESSION_DESTROYED")}this.connection.destroy()}}}),this.subscribeQueue={},this.callQueue=[],this.connection=new wD(e,t,{onUpstreamRestarting:()=>{this.handlers.onUpstreamRestarting()},onReady:()=>{this.stateMachine.transition("processQueue")},onNotReady:()=>{this.stateMachine.transition("notReady")},onPublish:(i,o)=>{this.handlers.onPublish(i,o)}})}call(e,t,r){return this.stateMachine.state==="READY"?this.connection.call(e,t,r):(this.stateMachine.state==="NOT_READY"&&this.connection.ensureStarted(),e==="SUBSCRIBE"||e==="UNSUBSCRIBE"?this._subscribe(e,t,r):this._call(e,t,r))}_subscribe(e,t,r){const i=t.join("/"),o=this.subscribeQueue[i];if(o&&o.method===e)return o.deferred.promise;o&&o.method!==e&&(o.deferred.ok({status:200,data:{}}),delete this.subscribeQueue[i]);const s={deferred:Us(),method:e,path:t,data:r};return this.subscribeQueue[i]=s,s.deferred.promise}_call(e,t,r){const i={deferred:Us(),method:e,path:t,data:r};return this.callQueue.push(i),i.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 $(this,null,function*(){let e=0;for(;this.stateMachine.state==="PROCESSING_QUEUE";){e++;const t=this.dequeue();if(!t)return void this.stateMachine.transition("ready");this.connection.call(t.method,t.path,t.data).then(r=>{t.deferred.resolve(r)}),e>50&&(yield new Promise(r=>setTimeout(r,100)))}})}isConnected(){return this.stateMachine.state==="READY"||this.stateMachine.state==="PROCESSING_QUEUE"}}const DD=typeof window<"u"&&(sO=window.queueMicrotask)!=null?sO:setTimeout;class pO{constructor(e,t){this.clearPendingBatch=e,this.sendCalls=t,this.sent=!1,DD(()=>this.send())}send(){this.sent||(this.sent=!0,this.clearPendingBatch(),this.sendCalls())}destroy(){this.sent=!0}}class ou extends pO{constructor(e,t){super(t,()=>{this.sendSubscribe(),this.sendGet()}),this.connection=e,this.getCalls=[],this.subscribeCalls=[]}canPush(e,t){return ou.isCorrectBatchTypeFor(e,t)}static isCorrectBatchTypeFor(e,t){return nn(t,["users","*"])&&(e==="GET"||e==="SUBSCRIBE")}push(e,t,r){const i=t[1],o=Us();return e==="GET"?this.getCalls.push({userId:i,deferred:o}):this.subscribeCalls.push({userId:i,deferred:o}),this.getCalls.length!==1e3&&this.subscribeCalls.length!==1e3||this.send(),o.promise}sendGet(){return $(this,null,function*(){if(this.getCalls.length===0)return;const e=[...new Set(this.getCalls.map(r=>r.userId))],t=yield this.connection.call("GET",["users"],{ids:e,includePrivateFields:!1});if(t.ok)for(const r of this.getCalls){const i=t.value.data[r.userId];i?r.deferred.ok({status:200,data:i}):r.deferred.serverErr({status:404,errorCode:"NOT_FOUND",reasons:["No user with that ID exists"]})}else this.getCalls.forEach(r=>r.deferred.resolve(t))})}sendSubscribe(){if(this.subscribeCalls.length===0)return;const e=[...new Set(this.subscribeCalls.map(t=>t.userId))];this.connection.call("SUBSCRIBE",["users"],{ids:e}).then(t=>this.subscribeCalls.forEach(r=>r.deferred.resolve(t)))}}class su extends pO{constructor(e,t,r){super(r,()=>this.sendMutate()),this.conversationId=e,this.connection=t,this.calls=[]}canPush(e,t){return!!su.isCorrectBatchTypeFor(e,t)&&t[1]===this.conversationId}static isCorrectBatchTypeFor(e,t){return nn(t,["conversations","*","participants","*"])&&(e==="PUT"||e==="POST"||e==="PATCH")}push(e,t,r){const i=t[3],o=Us();return this.calls.push({action:{id:i,method:e,params:r},deferred:o}),this.calls.length===100&&this.send(),o.promise}sendMutate(){return $(this,null,function*(){const e=this.calls.map(i=>i.action),t=yield this.connection.call("POST",["conversations",this.conversationId,"participants"],{actions:e});if(!t.ok)return void this.calls.forEach(i=>i.deferred.resolve(t));const r=t.value.data.responses;for(let i=0;i<r.length;i++){const o=this.calls[i].deferred,s=r[i];s.status===200?o.ok(mn(Se({},s),{data:{}})):o.serverErr(s)}})}}class kD{constructor(e,t,r){this.pendingBatch=null,this.connection=new RD(e,t,r)}call(e,t,r){return $(this,null,function*(){var i;if((i=this.pendingBatch)!=null&&i.canPush(e,t))return this.pendingBatch.push(e,t,r);this.pendingBatch&&this.pendingBatch.send();const o=this.createEmptyBatchFor(e,t);return o?(this.pendingBatch=o,o.push(e,t,r)):this.connection.call(e,t,r)})}destroy(){var e;this.connection.destroy(),(e=this.pendingBatch)==null||e.destroy()}isConnected(){return this.connection.isConnected()}createEmptyBatchFor(e,t){if(ou.isCorrectBatchTypeFor(e,t))return new ou(this.connection,()=>this.pendingBatch=null);if(su.isCorrectBatchTypeFor(e,t)){const r=t[1];return new su(r,this.connection,()=>this.pendingBatch=null)}return null}}const LD={200:"RESOLVE",400:"RESOLVE",401:"RETRY",402:"RESOLVE",403:"RESOLVE",404:"RESOLVE",405:"RESOLVE",409:"RESOLVE",429:"DELAY",500:"DELAY"};class xD{constructor(e,t,r){this.throttler=new MD,this.alive=!0,this.connection=new kD(e,t,r)}call(e,t,r){return $(this,null,function*(){let i=0;for(;this.alive;){const o=yield this.connection.call(e,t,r);if((o.ok||o.where!=="client"||o.value!=="SOCKET_NOT_READY")&&(o.ok||o.where!=="server"||o.value.status!==500)||i++,i===10)return o;if(o.ok||o.where!=="client"){const s=o.value,a=s.status,l=LD[a];if(l==="RESOLVE")return this.throttler.resetDelay(),o;if(l==="RETRY")continue;if(l==="DELAY"){yield this.throttler.wait();continue}return console.warn("[TalkJS] Unexpected status code",a),s}if(o.value==="SESSION_DESTROYED")return je("SESSION_DESTROYED");o.value!=="WEBSOCKET_DISCONNECTED"&&(o.value!=="SOCKET_NOT_READY"?o.value:yield this.throttler.wait())}return je("SESSION_DESTROYED")})}destroy(){this.alive=!1,this.connection.destroy()}isConnected(){return this.connection.isConnected()}}class MD{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=hp(this.currentDelayMs,.05),r=this.lastCall+t,i=Math.max(0,r-e);return this.lastCall=e+i,this.currentDelayMs=Math.min(t*this.exponentialFactor,this.maxDelayMs),dO(i)}resetDelay(){this.currentDelayMs=this.initialDelayMs}}function pp(n){return n.map(e=>encodeURIComponent(e)).join()}class PD{constructor(){this.paths={}}add(e){this.paths[pp(e)]=e}delete(e){delete this.paths[pp(e)]}has(e){return Object.hasOwnProperty.call(this.paths,pp(e))}clear(){this.paths={}}forEach(e){Object.values(this.paths).forEach(t=>e(t))}}class BD{constructor(e,t,r){this.handlers=r,this.targetSubscriptions=new PD,this.connection=new xD(e,t,{onUpstreamRestarting:()=>this.handlers.onUpstreamRestarting(),onSubscriptionsLost:()=>{this.targetSubscriptions.forEach(i=>{this.resubscribe(i)}),this.handlers.onResubscribeSent()},onReady:()=>this.handlers.onReady(),onPublish:(i,o)=>{this.handlers.onPublish(i,o)}})}call(e,t,r){return this.connection.call(e,t,r)}subscribe(e){return $(this,null,function*(){return this.targetSubscriptions.add(e),this.connection.call("SUBSCRIBE",e,{})})}unsubscribe(e){return $(this,null,function*(){return this.targetSubscriptions.delete(e),this.connection.call("UNSUBSCRIBE",e,{})})}resubscribe(e){return $(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 Ye(n,e){return e===void 0?n:e}function fp(n,e){if(e===void 0)return n;if(e===null)return{};const t=Se({},n);for(const r in e){const i=e[r];i===null?delete t[r]:t[r]=i}return t}function yt(n,e){if(n===e)return!0;if(!n||!e||typeof n!="object"||typeof e!="object"||n.constructor!==e.constructor)return!1;if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!yt(n[t],e[t]))return!1}else{const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const r of t)if(!Object.hasOwnProperty.call(e,r)||!yt(n[r],e[r]))return!1}return!0}class fO{constructor(){this.prev=Promise.resolve()}runExclusive(e){return $(this,null,function*(){const t=this.prev.then(()=>e());return this.prev=t,t})}}class FD{constructor(e){this.initialised=!1,this.getPointer=void 0,this.pendingStates=[e],e.resultPromise.then(()=>this.initialised=!0)}get pendingPointer(){if(this.pendingStates.length!==0)return this.pendingStates[this.pendingStates.length-1]}get mostRecentState(){var e;return(e=this.pendingPointer)!=null?e:this.getPointer}canAppendState(e){var t,r;const i=(t=this.getPointer)==null?void 0:t.seq;if(i!==void 0&&e<=i)return!1;const o=(r=this.pendingPointer)==null?void 0:r.seq;return!(o!==void 0&&e<o)}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 r=this.mostRecentState.resultPromise.then(i=>i.ok?t(i):i);this.pendingStates.push({seq:e,resultPromise:r})}get(e){for(;this.pendingStates.length>0&&(this.getPointer===void 0||this.pendingStates[0].seq<=e);)this.getPointer=this.pendingStates.shift();return this.getPointer}}class UD extends FD{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(r=>r.ok?r.value:t),e.then(r=>{r.ok||this.setError(r)})}setError(e){var t;this._error||(this._error=e,(t=this.onTeardown)==null||t.call(this,e),this.lastGoodState.then(r=>{r!==void 0&&this.teardownNested(r)}))}}class au extends UD{constructor(e,t){const r=new Promise(i=>setTimeout(i)).then(()=>this.fetchInitial(e));super({seq:e,resultPromise:r},t),this.initialSeq=e,this.getDeepMutex=new fO,this.lastDeep=void 0}refetchInitial(e){return $(this,null,function*(){const t=this.mostRecentState.resultPromise,r=this.fetchInitial(e),[i,o]=yield Promise.all([t,r]);return i!==void 0&&i.ok&&o.ok&&this.equal(i.value,o.value)?i:o})}refetch(e){if(this.error!==null)return;const t={seq:e,resultPromise:this.refetchInitial(e)};this.set(t)}changedBetween(e,t){return $(this,null,function*(){if(e>=t)return!1;const r=this.get(t),i=yield r.resultPromise;return!!i.ok&&(i.value.lastChanged>Math.max(this.initialSeq,e)&&i.value.lastChanged<=t||(yield this.anyChildChanged(e,t,i.value)))})}getDeep(e){return $(this,null,function*(){return this.getDeepMutex.runExclusive(()=>$(this,null,function*(){var t;if(this.error!==null)return this.error;const r=(t=this.lastDeep)==null?void 0:t.seq;if(e===r)return this.lastDeep.deep;if(r!==void 0){if(e<r)throw`Trying to load seq ${e} when we have previously loaded seq ${r}`;if(!(yield this.changedBetween(r,e)))return this.lastDeep.seq=e,this.lastDeep.deep}const i=this.get(e).resultPromise,o=i.then(a=>a.ok?this.loadNested(e,a.value):a);this.lastDeep={seq:e,shallow:i,deep:o};const s=yield o;return s.ok||this.setError(s),s}))})}}class Or extends au{constructor(e,t,r){super(e,r),this.emitMutex=t,this.unsubscribeTimer=new HD,this.referencedByOtherStores=0,this.listeners=[],this.lastEmitSeq=void 0,this.lastEmitResult=void 0,t.runExclusive(()=>$(this,null,function*(){yield this.emit(e)}))}registerInternalSubscription(){this.referencedByOtherStores++;let e=!0;return()=>{e&&(e=!1,this.referencedByOtherStores--,this.startUnsubscribeTimerIfOrphan())}}get onlyUsedInternally(){return this.listeners.length===0}listen(e){return this.unsubscribeTimer.stop(),this.listeners.push(e),this.lastEmitResult!==void 0&&e(this.lastEmitResult),()=>{this.listeners=this.listeners.filter(t=>t!==e),this.startUnsubscribeTimerIfOrphan()}}startUnsubscribeTimerIfOrphan(){this.referencedByOtherStores===0&&this.listeners.length===0&&this.unsubscribeTimer.restart(()=>{this.setError(je("UNSUBSCRIBED"))},this.unsubscribeDebounceMs)}getLoadMoreSeq(){var e;const t=(e=this.lastEmitSeq)!=null?e:0,r=this.mostRecentState.seq;return Math.max(t,r)+1e-6}emit(e){return $(this,null,function*(){var t;if(this.onlyUsedInternally||this.lastEmitSeq&&this.lastEmitSeq>=e||((t=this.lastEmitResult)==null?void 0:t.ok)===!1)return;this.lastEmitSeq=e;const r=yield this.getDeep(e);r!==this.lastEmitResult&&(this.lastEmitResult=r,this.listeners.forEach(i=>i(r)))})}}class HD{constructor(){this.timerId=void 0}restart(e,t){this.timerId!==void 0&&clearTimeout(this.timerId),this.timerId=setTimeout(()=>e(),t)}stop(){clearTimeout(this.timerId)}}class $D extends Or{constructor(e,t,r,i,o){super(e,i,o),this.userId=t,this.realtimeClient=r,this.unsubscribeDebounceMs=1e4}fetchInitial(e){return $(this,null,function*(){const t=yield this.realtimeClient.call("GET",["users",this.userId],{includePrivateFields:!1},{bypassCache:!0});return t.ok?K({snapshot:this.realtimeClient.createUserSnapshot(t.value.data),lastChanged:e}):t.where==="server"&&t.value.status===404?K({snapshot:null,lastChanged:e}):t})}equal(e,t){return yt(e.snapshot,t.snapshot)}loadNested(e,t){return $(this,null,function*(){return K(t)})}userCreated(e,t){this.mutate(e,r=>r.value.snapshot!==null?r:K({snapshot:this.realtimeClient.createUserSnapshot(t.state),lastChanged:e}))}userEdited(e,t){this.mutate(e,r=>{const i=r.value.snapshot;return i===null?(console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."),r):K({snapshot:{id:i.id,name:Ye(i.name,t.diff.name),custom:fp(i.custom,t.diff.custom),locale:Ye(i.locale,t.diff.locale),photoUrl:Ye(i.photoUrl,t.diff.photoUrl),role:Ye(i.role,t.diff.role),welcomeMessage:Ye(i.welcomeMessage,t.diff.welcomeMessage)},lastChanged:e})})}getFromCache(){return $(this,null,function*(){const e=yield this.mostRecentState.resultPromise;return e.ok?e.value.snapshot===null?ii({status:404,errorCode:"USER_NOT_FOUND",reasons:["That user does not exist yet"]}):K({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}}):je("NOT_IN_CACHE")})}teardownNested(e){}anyChildChanged(e,t,r){return $(this,null,function*(){return!1})}}var mO,lu={};function gO(n,e){const t=e.lastIndex;let r;const i=[];for(;(r=e.exec(n))!==null;)i.push(r);return e.lastIndex=t,i}function uu(n){const e=n.replace(/%2F/g,"/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/,"$1");return decodeURIComponent(e)}function mp(n,e){n()||e||(e=n.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/,"`$1`")+" was not true")}(function(){if(mO)return lu;function n(t){return String.fromCharCode(parseInt(t.slice(1),16))}function e(t){return`%${`00${t.charCodeAt(0).toString(16)}`.slice(-2)}`}mO=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.encode=function(t){return btoa(encodeURIComponent(t).replace(/%[0-9A-F]{2}/g,n))},lu.decode=function(t){return decodeURIComponent(Array.from(atob(t),e).join(""))}})(),(n=>{function e(t,r){(function(i,o){switch(o){case"undefined":return i===void 0;case String:return typeof i=="string"||i instanceof String;case Boolean:return typeof i=="boolean"||i instanceof Boolean;case Number:return typeof i=="number"||i instanceof Number;default:return i instanceof o}})(t,r)||(r.name,String(t))}n.defined=function(t){},n.has=function(t,r){t[r]},n.is=e,n.equals=function(t,r){},n.oneOf=function(t,r){r.includes(t)||JSON.stringify(r)},n.isArray=function(t,r){e(t,Array),t&&t.length>0&&e(t[0],r)},n.optional=function(t,r){t!==void 0&&e(t,r)},n.falsy=function(t){},n.never=function(t){}})(mp||(mp={}));const gp=mp,jD=/^\/.*[^\\]\/[im]*$/;function EO(n){return!!jD.test(n)&&!Ep(n).test("")}function Ep(n){const e=n.match(/^\/(.*[^\\])\/(.*)$/);if(!e)throw new Error(`Expected ${n} to be a (non-empty) regex`);let t=e[2]||"";return t=t.replace(/[^im]/g,"")+"g",new RegExp(e[1],t)}class YD{constructor({mode:e,allowedHostnames:t,allowedPhoneNrs:r,allowedMatches:i,forbiddenMatches:o,suppressLinks:s,suppressEmailAddresses:a,suppressPhoneNumbers:l,replacement:u}){gp.oneOf(e,["all","otherOnly","off"]),this.mode=e,this.suppressLinks=s!==!1,this.suppressEmailAddresses=a!==!1,this.suppressPhoneNumbers=l!==!1,this.allowedHostnames=t||[],this.allowedPhoneNrs=(r||[]).filter(c=>c).map(c=>c.replace(/[^0-9]/g,"")),this.allowedMatches=(i||[]).filter(EO).map(c=>Ep(c)),this.forbiddenMatches=(o||[]).filter(EO).map(c=>Ep(c)),gp(()=>this.allowedMatches.every(c=>c.flags.includes("g")),"All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"),gp(()=>this.forbiddenMatches.every(c=>c.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 this.mode==="all"||this.mode==="otherOnly"&&!e}}function cu(n,e){return n.map(t=>function(r,i){if(r.type==="text")return du(r.children,function(o){var s,a,l,u,c,d,h,p,f,m,g,E;let v="";return o.t&&(v=`(${o.t("CONTACT_INFORMATION_HIDDEN")})`),{formattedLinks:(s=o.formattedLinks)!=null?s:"plaintext",markup:(a=o.markup)!=null&&a,useFallbackMentions:(l=o.useFallbackMentions)!=null&&l,sameTabLinkRules:(u=o.sameTabLinkRules)!=null?u:[],enableEmojiImageFallback:(c=o.enableEmojiImageFallback)!=null&&c,highlight:(d=o.highlight)!=null?d:[],contactInfo:(h=o.contactInfo)!=null&&h,suppression:(p=o.suppression)!=null?p:new YD({mode:"off"}),contactInfoHiddenText:(g=(m=o.contactInfoHiddenText)!=null?m:(f=o.suppression)==null?void 0:f.replacement)!=null?g:v,customEmojiUrls:(E=o.customEmojiUrls)!=null?E:{}}}(i));if(r.type==="file"&&r.subtype==="video")return`🎥 ${uu(r.url)}`;if(r.type==="file"&&r.subtype==="image")return`📷 ${uu(r.url)}`;if(r.type==="file"&&r.subtype==="audio")return`🎧 ${uu(r.url)}`;if(r.type==="file"&&r.subtype==="voice"){const o=r.duration;return o===void 0?"🎙️":`🎙️ (${Math.floor(o/60)}:${Math.floor(o%60).toString().padStart(2,"0")})`}return r.type==="file"?(r.subtype,`📎 ${uu(r.url)}`):r.type==="location"?"📍":""}(t,e)).join(`
1311
+ `;case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"emoji":case"customemoji":case"customEmoji":return t.text;case"suppressed":return e.contactInfoHiddenText;case"mention":return`@${t.text}`}}).join("")}function iO(){const n=typeof window<"u"?window.crypto:void 0,e=n?()=>n.getRandomValues(new Uint8Array(1))[0]:()=>Math.floor(255*Math.random());return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(t^e()&15>>t/4).toString(16))}class ED{constructor(e,t,r,i,o){this.store=e,this.talkSession=t,this.editorInternals=r,this.onSendMessage=i,this.onDeleteMessage=o}async deleteMessage(e){const t=this.store.state$.extCurrentConversationId.peek(),r=this.store.state$.messages.child(t).lookup.child(e).peek(),i=this.talkSession.conversation(t).message(e),[o]=await Promise.all([r??i.get(),i.delete()]);if(o){const s={currentUser:this.store.currentUser$.peek(),conversation:this.store.state$.currentConversation.peek(),message:r};this.onDeleteMessage(s)}}setEditing(e){this.store.state$.editingMessageId.set(e)}async editMessage(e,t){const r=this.store.state$.extCurrentConversationId.peek();await this.talkSession.conversation(r).message(e).edit(t)}setReferencedMessage(e){this.store.state$.referencedMessageId.set(e)}async sendMessage(e){const t=this.store.state$.extCurrentConversationId.peek(),r=await async function(s,a){const l=s.state$.extCurrentConversationId.peek(),u=s.state$.messages.child(l),c=typeof a.referencedMessage=="string"?u.lookup.child(a.referencedMessage).peek():await(a.referencedMessage?.get()??null),d=c&&{...c,type:"UserMessage",sender:c.sender,referencedMessageId:c.referencedMessage?.id??null};d&&delete d.referencedMessage;const h=s.latestFileUpload,p="content"in a?[oO(h,a.content[0])]:[vD(a.text)],f="text"in a?a.text:gD(a.content.map(m=>oO(h,m)),{});return{id:"ephemeral-"+iO(),type:"UserMessage",sender:s.currentUser$.peek(),createdAt:Date.now(),editedAt:null,custom:a.custom??{},origin:"web",referencedMessage:d,reactions:[],content:p,plaintext:f}}(this.store,e);this.store.state$.ephemeralMessages.child(t).child(r.id).set(r);const i=Bs();this.store.readyForNewMessagesPromise=i.promise;const o=await this.talkSession.conversation(t).send(e);this.store.state$.ephemeralMessageIdMapping.child(t).child(o.id).set(r.id),i.resolve(),this.onSendMessage({message:await o.get(),currentUser:this.store.currentUser$.peek(),conversation:this.store.state$.currentConversation.peek()})}sendFileMessage(e){const t={type:"file",fileToken:e.fileToken};return this.sendMessage({content:[t],custom:e.custom})}sendLocationMessage(e){const t={type:"location",latitude:e.location.latitude,longitude:e.location.longitude};return this.sendMessage({content:[t],custom:e.custom})}getMessageFieldText(){return this.editorInternals.getText()}setMessageFieldText(e){this.editorInternals.setText(e)}markAsTyping(){const e=this.store.state$.extCurrentConversationId.peek();this.talkSession.conversation(e).markAsTyping()}async toggleReaction(e,t){this.store.state$.extCurrentConversationId.peek();const r=this.getReactionRef(e,t.emoji);t.currentUserReacted?await r.remove():await r.add()}async addReaction(e,t){this.store.state$.extCurrentConversationId.peek(),await this.getReactionRef(e,t).add()}getReactionRef(e,t){const r=this.store.state$.extCurrentConversationId.peek();return this.talkSession.conversation(r).message(e).reaction(t)}}const vD=n=>({type:"text",children:function(t){return bv(t,{except:["FormattedLink","Actions"]})}(n)});function oO(n,e){switch(e.type){case"text":case"location":return e;case"file":return function(t,r){return{type:"file",subtype:t.type==="file"?void 0:t.type,...t.metadata,size:t.file.size,filename:t.file.name,fileToken:r.fileToken,url:t.temporaryBlobUrl}}(n,e)}}var sO,AD=Object.defineProperty,_D=Object.defineProperties,yD=Object.getOwnPropertyDescriptors,nu=Object.getOwnPropertySymbols,aO=Object.prototype.hasOwnProperty,lO=Object.prototype.propertyIsEnumerable,uO=(n,e,t)=>e in n?AD(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Se=(n,e)=>{for(var t in e||(e={}))aO.call(e,t)&&uO(n,t,e[t]);if(nu)for(var t of nu(e))lO.call(e,t)&&uO(n,t,e[t]);return n},mn=(n,e)=>_D(n,yD(e)),cO=(n,e)=>{var t={};for(var r in n)aO.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&nu)for(var r of nu(n))e.indexOf(r)<0&&lO.call(n,r)&&(t[r]=n[r]);return t},H=(n,e,t)=>new Promise((r,i)=>{var o=l=>{try{a(t.next(l))}catch(u){i(u)}},s=l=>{try{a(t.throw(l))}catch(u){i(u)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((t=t.apply(n,e)).next())});function Be(n,e){if(e.ok)return e.value.data;throw e.value==="SESSION_DESTROYED"?new Error(`${n} failed because the session was destroyed`):e.where==="server"?new Error(Fs(n,e.value)):"unreachable"}function Fs(n,e){let t;return t=Array.isArray(e.reasons)?e.reasons.join():JSON.stringify(e.reasons),`${n} failed, got status ${e.status} ${e.errorCode}, reasons: ${t}`}function nn(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(e[t]!=="*"&&n[t]!==e[t])return!1;return!0}function dO(n){return n<=0?Promise.resolve():new Promise(e=>setTimeout(e,n))}function hp(n,e){return n*(1-e+2*Math.random()*e)}const OD=()=>!0;function hO(n,e,t){return H(this,arguments,function*(r,i,{initialDelay:o,maxDelay:s,log:a,shouldRetry:l=OD}){return i().catch(u=>H(this,null,function*(){if(r===0||!(yield l(u)))throw u;const c=1e3*o*1.2,d=hp(s?Math.min(1e3*s,c):c,.05);return dO(d).then(()=>hO(r-1,i,{initialDelay:d/1e3,maxDelay:s,log:a,shouldRetry:l}))}))})}function ri(){const n={},e=new Promise(function(t,r){n.resolve=t,n.reject=r});return n.promise=e,n}class ru{constructor(e,t,r){this.layer=e,this.states=t,this.transitions=r,this._state=t[0]}get state(){return this._state}transition(e){const t=this.transitions[e];if(!t||!this.canTransition(e))return;const r=this.state;this._state=t.to,t.afterTransition({from:r,to:this.state})}canTransition(e){const t=this.transitions[e];return!!t&&(t.from==="ANY"||t.from.includes(this.state))}}function K(n){return{ok:!0,value:n}}function je(n){return{ok:!1,where:"client",value:n}}function ii(n){return{ok:!1,where:"server",value:n}}function Us(){const n={},e=new Promise(t=>{n.ok=r=>H(this,null,function*(){return t(K(r))}),n.clientErr=r=>t(je(r)),n.serverErr=r=>t(ii(r)),n.resolve=r=>t(r)});return n.promise=e,n}class TD{constructor(e,t){this.realtimeUrl=e,this.handlers=t,this.socket=null,this.stateMachine=new ru("ReconnectingSocket",["STOPPED","CONNECTING","READY","DISCONNECTED","TERMINATED"],{startWs:{from:["STOPPED","DISCONNECTED"],to:"CONNECTING",afterTransition:()=>{const r=new(function(){if(globalThis.WebSocket)return globalThis.WebSocket;throw new Error("Missing WebSocket implementation")}())(this.realtimeUrl+"&talkjs-time="+Date.now());this.socket=r,r.addEventListener("open",()=>{this.socket===r&&this.stateMachine.transition("onOpen")}),r.addEventListener("close",()=>{this.socket===r&&this.stateMachine.transition("onClose")}),r.addEventListener("message",i=>{this.socket===r&&this.handlers.onMessage(i)})}},onOpen:{from:["CONNECTING"],to:"READY",afterTransition:()=>{this.handlers.onOpen()}},onClose:{from:["CONNECTING","READY"],to:"DISCONNECTED",afterTransition:r=>H(this,[r],function*({from:i}){i==="READY"&&this.handlers.onClose(),this.socket=null;const o=hp(1e4,.5);setTimeout(()=>{this.stateMachine.state==="DISCONNECTED"&&this.stateMachine.transition("startWs")},o)})},stopWs:{from:["CONNECTING","DISCONNECTED","READY"],to:"STOPPED",afterTransition:({from:r})=>{r==="READY"&&this.handlers.onClose();const i=this.socket;this.socket=null,i?.close(1e3)}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{const r=this.socket;this.socket=null,r?.close(1e3)}}})}stopWs(){this.stateMachine.transition("stopWs")}startWs(){this.stateMachine.transition("startWs")}send(e){return this.stateMachine.state==="READY"?(this.socket.send(e),K(void 0)):je("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 SD{constructor(e,t){this.handlers=t,this.socket=new TD(e,{onOpen:()=>this.handlers.onOpen(),onClose:()=>this.handlers.onClose(),onMessage:r=>this.onWebSocketMessage(r)})}call(e,t,r,i){const o=`/${r.map(a=>encodeURIComponent(a)).join("/")}`,s=JSON.stringify([e,t,o,i]);return this.socket.send(s)}stopWs(){this.socket.stopWs()}startWs(){this.socket.startWs()}destroy(){this.socket.destroy()}terminate(){this.socket.terminate()}onWebSocketMessage(e){if(e.data!=="Auth token expired")try{const t=JSON.parse(e.data);if(t[1]==="PUBLISH"){const r=t[0],i=JSON.stringify([r,"ACK"]);this.socket.send(i);const o=t.slice(2),s=[];o.forEach(a=>{a.type==="session.expired"?this.handlers.onAuthExpired():a.type==="upstream.restarting"?this.handlers.onUpstreamRestarting():s.push(a)}),s.length>0&&this.handlers.onPublish(r,s)}else{const r=t[0],i=t[1],o=t[2];this.handlers.onResponse(r,i,o)}}catch{}else this.handlers.onAuthExpired()}}class iu{constructor(e){this.delayMs=e,this.timeout=void 0}schedule(e){this.stop(),this.timeout=setTimeout(()=>{this.timeout!==void 0&&(this.stop(),e())},this.delayMs)}stop(){this.timeout!==void 0&&(clearTimeout(this.timeout),this.timeout=void 0)}}class bD{constructor(){this.i=-1}next(){return this.i++,this.i}reset(){this.i=-1}}class ND{constructor(e,t){this.handlers=t,this.seqCounter=new bD,this.responseHandlers={},this.heartbeats=new CD(this),this.socket=new SD(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(r=>{r.clientErr("WEBSOCKET_DISCONNECTED")}),this.responseHandlers={},this.seqCounter.reset(),this.handlers.onNotReady()},onResponse:(r,i,o)=>{this.heartbeats.serverActive(),this.onResponse(r,i,o)},onPublish:(r,i)=>{this.heartbeats.serverActive(),this.handlers.onPublish(r,i),this.heartbeats.clientActive()},onAuthExpired:()=>{this.heartbeats.serverActive(),this.handlers.onAuthExpired()}})}call(e,t,r){const i=this.seqCounter.next(),o=Us();this.responseHandlers[i]=o;const s=this.socket.call(i,e,t,r);return s.ok||o.resolve(s),this.heartbeats.clientActive(),o.promise}onResponse(e,t,r){return H(this,null,function*(){const i=this.responseHandlers[e];i&&(t===200?i.ok({status:t,data:r}):i.serverErr({status:t,errorCode:r.errorCode,reasons:r.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 CD{constructor(e){this.connection=e,this.clientInactivityTimer=new iu(25e3),this.serverInactivityTimer=new iu(1e4),this.serverTimeoutTimer=new iu(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 ID{constructor(e,t,r){this.authProvider=t,this.handlers=r,this.stateMachine=new ru("AuthenticatedConnection",["WAITING_FOR_WS","LOGGING_IN","RENEWING_SESSION","READY","TERMINATED"],{logIn:{from:["WAITING_FOR_WS"],to:"LOGGING_IN",afterTransition:()=>H(this,null,function*(){yield this.renewSession()})},logInFailed:{from:["LOGGING_IN"],to:"LOGGING_IN",afterTransition:()=>H(this,null,function*(){this.authProvider.refreshToken(),yield this.renewSession()})},scheduledReauth:{from:["READY"],to:"RENEWING_SESSION",afterTransition:()=>H(this,null,function*(){yield this.renewSession()})},scheduledReauthFailed:{from:["RENEWING_SESSION"],to:"RENEWING_SESSION",afterTransition:()=>H(this,null,function*(){this.authProvider.refreshToken(),yield this.renewSession()})},authenticated:{from:["LOGGING_IN","RENEWING_SESSION"],to:"READY",afterTransition:({from:i})=>{i==="LOGGING_IN"&&this.handlers.onReady()}},authExpired:{from:["READY","RENEWING_SESSION"],to:"LOGGING_IN",afterTransition:()=>H(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:i})=>{i!=="READY"&&i!=="RENEWING_SESSION"||this.handlers.onNotReady(),this.authProvider.clearScheduledRefresh()}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{this.authProvider.clearScheduledRefresh(),this.connection.destroy()}}}),this.connection=new ND(e,{onUpstreamRestarting:()=>this.handlers.onUpstreamRestarting(),onReady:()=>this.stateMachine.transition("logIn"),onNotReady:()=>{this.stateMachine.transition("wsDisconnected")},onAuthExpired:()=>{this.stateMachine.transition("authExpired")},onPublish:(i,o)=>{this.handlers.onPublish(i,o)}}),t.onTokenChanged(()=>{this.stateMachine.state==="READY"&&this.stateMachine.transition("scheduledReauth")})}call(e,t,r){const i=this.connection.call(e,t,r);return i.then(o=>{o.ok||o.where!=="server"||o.value.status!==401||this.stateMachine.state!=="READY"&&this.stateMachine.state!=="RENEWING_SESSION"||this.stateMachine.transition("authExpired")}),i}stopWs(){this.connection.stopWs()}startWs(){this.connection.startWs()}destroy(){this.stateMachine.transition("destroy")}renewSession(){return H(this,null,function*(){const e=yield this.authProvider.getToken(),t=yield this.connection.call("POST",["session","renew"],{token:e});if(!t.ok&&t.where==="client")return;const r=t.value;if(r.status,r.status===200){const o=r.data.expiresInSeconds;return void(o!==null&&o<120?(console.warn(`[TalkJS] Authenticated with a token that expires in ${o}s. Treating it as already expired and refreshing. Newly generated tokens should last at least 10 minutes.`),this.stateMachine.state==="LOGGING_IN"?this.stateMachine.transition("logInFailed"):this.stateMachine.state==="RENEWING_SESSION"&&this.stateMachine.transition("scheduledReauthFailed")):(this.authProvider.scheduleRefresh(o),this.authProvider.emitTokenAccepted(e),this.stateMachine.canTransition("authenticated")&&this.stateMachine.transition("authenticated")))}if(r.status===401)return void(this.stateMachine.state==="LOGGING_IN"?this.stateMachine.transition("logInFailed"):this.stateMachine.state==="RENEWING_SESSION"&&this.stateMachine.transition("scheduledReauthFailed"));if(r.status===400)return void this.authProvider.emitTokenRefreshFailed(Fs("Authentication",r));if(r.status===402)return void this.authProvider.emitTokenRefreshFailed(Fs("Authentication",r));const i=5e3*Math.random()+5e3;setTimeout(()=>{this.call("POST",["session","renew"],{token:e}).catch(()=>{})},i)})}}class wD{constructor(e,t,r){this.handlers=r,this.stateMachine=new ru("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 iu(3e3),this.connection=new ID(e,t,{onUpstreamRestarting:()=>{this.handlers.onUpstreamRestarting()},onReady:()=>{this.stateMachine.transition("ready")},onNotReady:()=>{this.stateMachine.state==="READY"&&this.stateMachine.transition("unexpectedDisconnect")},onPublish:(i,o)=>{this.handlers.onPublish(i,o)}})}get inactive(){return this.pendingCalls===0&&this.activeSubscriptions===0}ensureStarted(){this.stateMachine.canTransition("start")&&this.stateMachine.transition("start")}call(e,t,r){return H(this,null,function*(){this.inactivityTimer.stop(),this.pendingCalls++;const i=yield this.connection.call(e,t,r);return this.pendingCalls--,e==="SUBSCRIBE"&&i.ok?this.activeSubscriptions++:e==="UNSUBSCRIBE"&&i.ok&&this.activeSubscriptions--,this.inactive&&this.inactivityTimer.schedule(()=>{this.stateMachine.transition("stop")}),i})}destroy(){this.stateMachine.transition("destroy")}isConnected(){return this.stateMachine.state==="READY"}}class RD{constructor(e,t,r){this.handlers=r,this.stateMachine=new ru("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(i=>i.deferred.ok({status:200,data:{}})),this.subscribeQueue={},this.handlers.onSubscriptionsLost()}},destroy:{from:"ANY",to:"TERMINATED",afterTransition:()=>{for(var i;this.callQueue.length;){const o=(i=this.callQueue.shift())==null?void 0:i.deferred;o?.clientErr("SESSION_DESTROYED")}this.connection.destroy()}}}),this.subscribeQueue={},this.callQueue=[],this.connection=new wD(e,t,{onUpstreamRestarting:()=>{this.handlers.onUpstreamRestarting()},onReady:()=>{this.stateMachine.transition("processQueue")},onNotReady:()=>{this.stateMachine.transition("notReady")},onPublish:(i,o)=>{this.handlers.onPublish(i,o)}})}call(e,t,r){return this.stateMachine.state==="READY"?this.connection.call(e,t,r):(this.stateMachine.state==="NOT_READY"&&this.connection.ensureStarted(),e==="SUBSCRIBE"||e==="UNSUBSCRIBE"?this._subscribe(e,t,r):this._call(e,t,r))}_subscribe(e,t,r){const i=t.join("/"),o=this.subscribeQueue[i];if(o&&o.method===e)return o.deferred.promise;o&&o.method!==e&&(o.deferred.ok({status:200,data:{}}),delete this.subscribeQueue[i]);const s={deferred:Us(),method:e,path:t,data:r};return this.subscribeQueue[i]=s,s.deferred.promise}_call(e,t,r){const i={deferred:Us(),method:e,path:t,data:r};return this.callQueue.push(i),i.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 H(this,null,function*(){let e=0;for(;this.stateMachine.state==="PROCESSING_QUEUE";){e++;const t=this.dequeue();if(!t)return void this.stateMachine.transition("ready");this.connection.call(t.method,t.path,t.data).then(r=>{t.deferred.resolve(r)}),e>50&&(yield new Promise(r=>setTimeout(r,100)))}})}isConnected(){return this.stateMachine.state==="READY"||this.stateMachine.state==="PROCESSING_QUEUE"}}const DD=typeof window<"u"&&(sO=window.queueMicrotask)!=null?sO:setTimeout;class pO{constructor(e,t){this.clearPendingBatch=e,this.sendCalls=t,this.sent=!1,DD(()=>this.send())}send(){this.sent||(this.sent=!0,this.clearPendingBatch(),this.sendCalls())}destroy(){this.sent=!0}}class ou extends pO{constructor(e,t){super(t,()=>{this.sendSubscribe(),this.sendGet()}),this.connection=e,this.getCalls=[],this.subscribeCalls=[]}canPush(e,t){return ou.isCorrectBatchTypeFor(e,t)}static isCorrectBatchTypeFor(e,t){return nn(t,["users","*"])&&(e==="GET"||e==="SUBSCRIBE")}push(e,t,r){const i=t[1],o=Us();return e==="GET"?this.getCalls.push({userId:i,deferred:o}):this.subscribeCalls.push({userId:i,deferred:o}),this.getCalls.length!==1e3&&this.subscribeCalls.length!==1e3||this.send(),o.promise}sendGet(){return H(this,null,function*(){if(this.getCalls.length===0)return;const e=[...new Set(this.getCalls.map(r=>r.userId))],t=yield this.connection.call("GET",["users"],{ids:e,includePrivateFields:!1});if(t.ok)for(const r of this.getCalls){const i=t.value.data[r.userId];i?r.deferred.ok({status:200,data:i}):r.deferred.serverErr({status:404,errorCode:"NOT_FOUND",reasons:["No user with that ID exists"]})}else this.getCalls.forEach(r=>r.deferred.resolve(t))})}sendSubscribe(){if(this.subscribeCalls.length===0)return;const e=[...new Set(this.subscribeCalls.map(t=>t.userId))];this.connection.call("SUBSCRIBE",["users"],{ids:e}).then(t=>this.subscribeCalls.forEach(r=>r.deferred.resolve(t)))}}class su extends pO{constructor(e,t,r){super(r,()=>this.sendMutate()),this.conversationId=e,this.connection=t,this.calls=[]}canPush(e,t){return!!su.isCorrectBatchTypeFor(e,t)&&t[1]===this.conversationId}static isCorrectBatchTypeFor(e,t){return nn(t,["conversations","*","participants","*"])&&(e==="PUT"||e==="POST"||e==="PATCH")}push(e,t,r){const i=t[3],o=Us();return this.calls.push({action:{id:i,method:e,params:r},deferred:o}),this.calls.length===100&&this.send(),o.promise}sendMutate(){return H(this,null,function*(){const e=this.calls.map(i=>i.action),t=yield this.connection.call("POST",["conversations",this.conversationId,"participants"],{actions:e});if(!t.ok)return void this.calls.forEach(i=>i.deferred.resolve(t));const r=t.value.data.responses;for(let i=0;i<r.length;i++){const o=this.calls[i].deferred,s=r[i];s.status===200?o.ok(mn(Se({},s),{data:{}})):o.serverErr(s)}})}}class kD{constructor(e,t,r){this.pendingBatch=null,this.connection=new RD(e,t,r)}call(e,t,r){return H(this,null,function*(){var i;if((i=this.pendingBatch)!=null&&i.canPush(e,t))return this.pendingBatch.push(e,t,r);this.pendingBatch&&this.pendingBatch.send();const o=this.createEmptyBatchFor(e,t);return o?(this.pendingBatch=o,o.push(e,t,r)):this.connection.call(e,t,r)})}destroy(){var e;this.connection.destroy(),(e=this.pendingBatch)==null||e.destroy()}isConnected(){return this.connection.isConnected()}createEmptyBatchFor(e,t){if(ou.isCorrectBatchTypeFor(e,t))return new ou(this.connection,()=>this.pendingBatch=null);if(su.isCorrectBatchTypeFor(e,t)){const r=t[1];return new su(r,this.connection,()=>this.pendingBatch=null)}return null}}const LD={200:"RESOLVE",400:"RESOLVE",401:"RETRY",402:"RESOLVE",403:"RESOLVE",404:"RESOLVE",405:"RESOLVE",409:"RESOLVE",429:"DELAY",500:"DELAY"};class xD{constructor(e,t,r){this.throttler=new MD,this.alive=!0,this.connection=new kD(e,t,r)}call(e,t,r){return H(this,null,function*(){let i=0;for(;this.alive;){const o=yield this.connection.call(e,t,r);if((o.ok||o.where!=="client"||o.value!=="SOCKET_NOT_READY")&&(o.ok||o.where!=="server"||o.value.status!==500)||i++,i===10)return o;if(o.ok||o.where!=="client"){const s=o.value,a=s.status,l=LD[a];if(l==="RESOLVE")return this.throttler.resetDelay(),o;if(l==="RETRY")continue;if(l==="DELAY"){yield this.throttler.wait();continue}return console.warn("[TalkJS] Unexpected status code",a),s}if(o.value==="SESSION_DESTROYED")return je("SESSION_DESTROYED");o.value!=="WEBSOCKET_DISCONNECTED"&&(o.value!=="SOCKET_NOT_READY"?o.value:yield this.throttler.wait())}return je("SESSION_DESTROYED")})}destroy(){this.alive=!1,this.connection.destroy()}isConnected(){return this.connection.isConnected()}}class MD{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=hp(this.currentDelayMs,.05),r=this.lastCall+t,i=Math.max(0,r-e);return this.lastCall=e+i,this.currentDelayMs=Math.min(t*this.exponentialFactor,this.maxDelayMs),dO(i)}resetDelay(){this.currentDelayMs=this.initialDelayMs}}function pp(n){return n.map(e=>encodeURIComponent(e)).join()}class PD{constructor(){this.paths={}}add(e){this.paths[pp(e)]=e}delete(e){delete this.paths[pp(e)]}has(e){return Object.hasOwnProperty.call(this.paths,pp(e))}clear(){this.paths={}}forEach(e){Object.values(this.paths).forEach(t=>e(t))}}class BD{constructor(e,t,r){this.handlers=r,this.targetSubscriptions=new PD,this.connection=new xD(e,t,{onUpstreamRestarting:()=>this.handlers.onUpstreamRestarting(),onSubscriptionsLost:()=>{this.targetSubscriptions.forEach(i=>{this.resubscribe(i)}),this.handlers.onResubscribeSent()},onReady:()=>this.handlers.onReady(),onPublish:(i,o)=>{this.handlers.onPublish(i,o)}})}call(e,t,r){return this.connection.call(e,t,r)}subscribe(e){return H(this,null,function*(){return this.targetSubscriptions.add(e),this.connection.call("SUBSCRIBE",e,{})})}unsubscribe(e){return H(this,null,function*(){return this.targetSubscriptions.delete(e),this.connection.call("UNSUBSCRIBE",e,{})})}resubscribe(e){return H(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 Ye(n,e){return e===void 0?n:e}function fp(n,e){if(e===void 0)return n;if(e===null)return{};const t=Se({},n);for(const r in e){const i=e[r];i===null?delete t[r]:t[r]=i}return t}function yt(n,e){if(n===e)return!0;if(!n||!e||typeof n!="object"||typeof e!="object"||n.constructor!==e.constructor)return!1;if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!yt(n[t],e[t]))return!1}else{const t=Object.keys(n);if(t.length!==Object.keys(e).length)return!1;for(const r of t)if(!Object.hasOwnProperty.call(e,r)||!yt(n[r],e[r]))return!1}return!0}class fO{constructor(){this.prev=Promise.resolve()}runExclusive(e){return H(this,null,function*(){const t=this.prev.then(()=>e());return this.prev=t,t})}}class FD{constructor(e){this.initialised=!1,this.getPointer=void 0,this.pendingStates=[e],e.resultPromise.then(()=>this.initialised=!0)}get pendingPointer(){if(this.pendingStates.length!==0)return this.pendingStates[this.pendingStates.length-1]}get mostRecentState(){var e;return(e=this.pendingPointer)!=null?e:this.getPointer}canAppendState(e){var t,r;const i=(t=this.getPointer)==null?void 0:t.seq;if(i!==void 0&&e<=i)return!1;const o=(r=this.pendingPointer)==null?void 0:r.seq;return!(o!==void 0&&e<o)}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 r=this.mostRecentState.resultPromise.then(i=>i.ok?t(i):i);this.pendingStates.push({seq:e,resultPromise:r})}get(e){for(;this.pendingStates.length>0&&(this.getPointer===void 0||this.pendingStates[0].seq<=e);)this.getPointer=this.pendingStates.shift();return this.getPointer}}class UD extends FD{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(r=>r.ok?r.value:t),e.then(r=>{r.ok||this.setError(r)})}setError(e){var t;this._error||(this._error=e,(t=this.onTeardown)==null||t.call(this,e),this.lastGoodState.then(r=>{r!==void 0&&this.teardownNested(r)}))}}class au extends UD{constructor(e,t){const r=new Promise(i=>setTimeout(i)).then(()=>this.fetchInitial(e));super({seq:e,resultPromise:r},t),this.initialSeq=e,this.getDeepMutex=new fO,this.lastDeep=void 0}refetchInitial(e){return H(this,null,function*(){const t=this.mostRecentState.resultPromise,r=this.fetchInitial(e),[i,o]=yield Promise.all([t,r]);return i!==void 0&&i.ok&&o.ok&&this.equal(i.value,o.value)?i:o})}refetch(e){if(this.error!==null)return;const t={seq:e,resultPromise:this.refetchInitial(e)};this.set(t)}changedBetween(e,t){return H(this,null,function*(){if(e>=t)return!1;const r=this.get(t),i=yield r.resultPromise;return!!i.ok&&(i.value.lastChanged>Math.max(this.initialSeq,e)&&i.value.lastChanged<=t||(yield this.anyChildChanged(e,t,i.value)))})}getDeep(e){return H(this,null,function*(){return this.getDeepMutex.runExclusive(()=>H(this,null,function*(){var t;if(this.error!==null)return this.error;const r=(t=this.lastDeep)==null?void 0:t.seq;if(e===r)return this.lastDeep.deep;if(r!==void 0){if(e<r)throw`Trying to load seq ${e} when we have previously loaded seq ${r}`;if(!(yield this.changedBetween(r,e)))return this.lastDeep.seq=e,this.lastDeep.deep}const i=this.get(e).resultPromise,o=i.then(a=>a.ok?this.loadNested(e,a.value):a);this.lastDeep={seq:e,shallow:i,deep:o};const s=yield o;return s.ok||this.setError(s),s}))})}}class Or extends au{constructor(e,t,r){super(e,r),this.emitMutex=t,this.unsubscribeTimer=new HD,this.referencedByOtherStores=0,this.listeners=[],this.lastEmitSeq=void 0,this.lastEmitResult=void 0,t.runExclusive(()=>H(this,null,function*(){yield this.emit(e)}))}registerInternalSubscription(){this.referencedByOtherStores++;let e=!0;return()=>{e&&(e=!1,this.referencedByOtherStores--,this.startUnsubscribeTimerIfOrphan())}}get onlyUsedInternally(){return this.listeners.length===0}listen(e){return this.unsubscribeTimer.stop(),this.listeners.push(e),this.lastEmitResult!==void 0&&e(this.lastEmitResult),()=>{this.listeners=this.listeners.filter(t=>t!==e),this.startUnsubscribeTimerIfOrphan()}}startUnsubscribeTimerIfOrphan(){this.referencedByOtherStores===0&&this.listeners.length===0&&this.unsubscribeTimer.restart(()=>{this.setError(je("UNSUBSCRIBED"))},this.unsubscribeDebounceMs)}getLoadMoreSeq(){var e;const t=(e=this.lastEmitSeq)!=null?e:0,r=this.mostRecentState.seq;return Math.max(t,r)+1e-6}emit(e){return H(this,null,function*(){var t;if(this.onlyUsedInternally||this.lastEmitSeq&&this.lastEmitSeq>=e||((t=this.lastEmitResult)==null?void 0:t.ok)===!1)return;this.lastEmitSeq=e;const r=yield this.getDeep(e);r!==this.lastEmitResult&&(this.lastEmitResult=r,this.listeners.forEach(i=>i(r)))})}}class HD{constructor(){this.timerId=void 0}restart(e,t){this.timerId!==void 0&&clearTimeout(this.timerId),this.timerId=setTimeout(()=>e(),t)}stop(){clearTimeout(this.timerId)}}class $D extends Or{constructor(e,t,r,i,o){super(e,i,o),this.userId=t,this.realtimeClient=r,this.unsubscribeDebounceMs=1e4}fetchInitial(e){return H(this,null,function*(){const t=yield this.realtimeClient.call("GET",["users",this.userId],{includePrivateFields:!1},{bypassCache:!0});return t.ok?K({snapshot:this.realtimeClient.createUserSnapshot(t.value.data),lastChanged:e}):t.where==="server"&&t.value.status===404?K({snapshot:null,lastChanged:e}):t})}equal(e,t){return yt(e.snapshot,t.snapshot)}loadNested(e,t){return H(this,null,function*(){return K(t)})}userCreated(e,t){this.mutate(e,r=>r.value.snapshot!==null?r:K({snapshot:this.realtimeClient.createUserSnapshot(t.state),lastChanged:e}))}userEdited(e,t){this.mutate(e,r=>{const i=r.value.snapshot;return i===null?(console.warn("[TalkJS] Received a 'used edited' event for a user that we thought didn't exist."),r):K({snapshot:{id:i.id,name:Ye(i.name,t.diff.name),custom:fp(i.custom,t.diff.custom),locale:Ye(i.locale,t.diff.locale),photoUrl:Ye(i.photoUrl,t.diff.photoUrl),role:Ye(i.role,t.diff.role),welcomeMessage:Ye(i.welcomeMessage,t.diff.welcomeMessage)},lastChanged:e})})}getFromCache(){return H(this,null,function*(){const e=yield this.mostRecentState.resultPromise;return e.ok?e.value.snapshot===null?ii({status:404,errorCode:"USER_NOT_FOUND",reasons:["That user does not exist yet"]}):K({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}}):je("NOT_IN_CACHE")})}teardownNested(e){}anyChildChanged(e,t,r){return H(this,null,function*(){return!1})}}var mO,lu={};function gO(n,e){const t=e.lastIndex;let r;const i=[];for(;(r=e.exec(n))!==null;)i.push(r);return e.lastIndex=t,i}function uu(n){const e=n.replace(/%2F/g,"/").replace(/^.*?\/([^/]+?)(?:\?.*)?$/,"$1");return decodeURIComponent(e)}function mp(n,e){n()||e||(e=n.toString().replace(/^function\s*\(\)\s*\{\s*return\s*(.*);\s*\}\s*$/,"`$1`")+" was not true")}(function(){if(mO)return lu;function n(t){return String.fromCharCode(parseInt(t.slice(1),16))}function e(t){return`%${`00${t.charCodeAt(0).toString(16)}`.slice(-2)}`}mO=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.encode=function(t){return btoa(encodeURIComponent(t).replace(/%[0-9A-F]{2}/g,n))},lu.decode=function(t){return decodeURIComponent(Array.from(atob(t),e).join(""))}})(),(n=>{function e(t,r){(function(i,o){switch(o){case"undefined":return i===void 0;case String:return typeof i=="string"||i instanceof String;case Boolean:return typeof i=="boolean"||i instanceof Boolean;case Number:return typeof i=="number"||i instanceof Number;default:return i instanceof o}})(t,r)||(r.name,String(t))}n.defined=function(t){},n.has=function(t,r){t[r]},n.is=e,n.equals=function(t,r){},n.oneOf=function(t,r){r.includes(t)||JSON.stringify(r)},n.isArray=function(t,r){e(t,Array),t&&t.length>0&&e(t[0],r)},n.optional=function(t,r){t!==void 0&&e(t,r)},n.falsy=function(t){},n.never=function(t){}})(mp||(mp={}));const gp=mp,jD=/^\/.*[^\\]\/[im]*$/;function EO(n){return!!jD.test(n)&&!Ep(n).test("")}function Ep(n){const e=n.match(/^\/(.*[^\\])\/(.*)$/);if(!e)throw new Error(`Expected ${n} to be a (non-empty) regex`);let t=e[2]||"";return t=t.replace(/[^im]/g,"")+"g",new RegExp(e[1],t)}class YD{constructor({mode:e,allowedHostnames:t,allowedPhoneNrs:r,allowedMatches:i,forbiddenMatches:o,suppressLinks:s,suppressEmailAddresses:a,suppressPhoneNumbers:l,replacement:u}){gp.oneOf(e,["all","otherOnly","off"]),this.mode=e,this.suppressLinks=s!==!1,this.suppressEmailAddresses=a!==!1,this.suppressPhoneNumbers=l!==!1,this.allowedHostnames=t||[],this.allowedPhoneNrs=(r||[]).filter(c=>c).map(c=>c.replace(/[^0-9]/g,"")),this.allowedMatches=(i||[]).filter(EO).map(c=>Ep(c)),this.forbiddenMatches=(o||[]).filter(EO).map(c=>Ep(c)),gp(()=>this.allowedMatches.every(c=>c.flags.includes("g")),"All regexes in `suppressContactInfo.allowedMatches` must be global. Check `allowedMatches`!"),gp(()=>this.forbiddenMatches.every(c=>c.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 this.mode==="all"||this.mode==="otherOnly"&&!e}}function cu(n,e){return n.map(t=>function(r,i){if(r.type==="text")return du(r.children,function(o){var s,a,l,u,c,d,h,p,f,m,g,E;let v="";return o.t&&(v=`(${o.t("CONTACT_INFORMATION_HIDDEN")})`),{formattedLinks:(s=o.formattedLinks)!=null?s:"plaintext",markup:(a=o.markup)!=null&&a,useFallbackMentions:(l=o.useFallbackMentions)!=null&&l,sameTabLinkRules:(u=o.sameTabLinkRules)!=null?u:[],enableEmojiImageFallback:(c=o.enableEmojiImageFallback)!=null&&c,highlight:(d=o.highlight)!=null?d:[],contactInfo:(h=o.contactInfo)!=null&&h,suppression:(p=o.suppression)!=null?p:new YD({mode:"off"}),contactInfoHiddenText:(g=(m=o.contactInfoHiddenText)!=null?m:(f=o.suppression)==null?void 0:f.replacement)!=null?g:v,customEmojiUrls:(E=o.customEmojiUrls)!=null?E:{}}}(i));if(r.type==="file"&&r.subtype==="video")return`🎥 ${uu(r.url)}`;if(r.type==="file"&&r.subtype==="image")return`📷 ${uu(r.url)}`;if(r.type==="file"&&r.subtype==="audio")return`🎧 ${uu(r.url)}`;if(r.type==="file"&&r.subtype==="voice"){const o=r.duration;return o===void 0?"🎙️":`🎙️ (${Math.floor(o/60)}:${Math.floor(o%60).toString().padStart(2,"0")})`}return r.type==="file"?(r.subtype,`📎 ${uu(r.url)}`):r.type==="location"?"📍":""}(t,e)).join(`
1312
1312
 
1313
1313
  `)}function du(n,e){return n.flatMap(t=>{if(typeof t=="string")return t;switch(t.type){case"blockquote":case"bold":case"italic":case"strikethrough":case"link":case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return du(t.children,e);case"bulletlist":case"bulletList":return`
1314
1314
  `+du(t.children,e);case"bulletpoint":case"bulletPoint":return"- "+du(t.children,e)+`
1315
- `;case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"emoji":case"customemoji":case"customEmoji":return t.text;case"suppressed":return e.contactInfoHiddenText;case"mention":return`@${t.text}`}}).join("")}class ho extends au{constructor(e,t,r,i){super(e),this.conversationId=t,this.message=r,this.realtimeClient=i}get messageId(){return typeof this.message=="string"?this.message:this.message.id}fetchInitial(e){return $(this,null,function*(){let t;if(typeof this.message=="object")t=this.message;else{const r=yield this.realtimeClient.call("GET",["me","conversations",this.conversationId,"messages",this.message],{},{bypassCache:!0});if(!r.ok)return r;t=r.value.data}return K({lastChanged:e,sender:t.senderId===null?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:cu(t.content,{}),content:t.content,reactions:vp(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 yt(e.data,t.data)}teardownNested(e){var t;(t=e.sender)==null||t.unsubscribe()}anyChildChanged(e,t,r){return $(this,null,function*(){var i;const o=(i=r.sender)==null?void 0:i.store;return(yield o?.changedBetween(e,t))===!0})}loadNested(e,t){return $(this,null,function*(){var r,i,o;const s=yield(i=(r=t.sender)==null?void 0:r.store)==null?void 0:i.getDeep(e);if(s?.ok===!1)return s;if(t.data===null)return K({snapshot:null});const a=s?.value;return K({snapshot:{sender:(o=a?.snapshot)!=null?o: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:cu(t.data.content,{}),content:t.data.content,referencedMessageId:t.data.referencedMessageId,reactions:t.data.reactions}})})}messageEdited(e,t){this.mutate(e,r=>r.value.data===null?r:K({lastChanged:e,sender:r.value.sender,data:{id:r.value.data.id,type:r.value.data.type,createdAt:r.value.data.createdAt,origin:r.value.data.origin,referencedMessageId:r.value.data.referencedMessageId,editedAt:Ye(r.value.data.editedAt,t.diff.editedAt),custom:fp(r.value.data.custom,t.diff.custom),content:Ye(r.value.data.content,t.diff.content),reactions:zD(r.value.data.reactions,t.diff.reactions)}}))}messageDeleted(e,t){this.mutate(e,r=>r.value.data===null?r:this.messageId===t.messageId?(this.teardownNested(r.value),K({lastChanged:e,sender:null,data:null})):r.value.data.referencedMessageId===t.messageId?K({lastChanged:e,sender:r.value.sender,data:{id:r.value.data.id,type:r.value.data.type,createdAt:r.value.data.createdAt,origin:r.value.data.origin,referencedMessageId:null,editedAt:r.value.data.editedAt,custom:r.value.data.custom,content:r.value.data.content,reactions:r.value.data.reactions}}):r)}getFromCache(){return $(this,null,function*(){var e;const t=yield this.mostRecentState.resultPromise;if(!t.ok)return je("NOT_IN_CACHE");if(t.value.data===null)return ii({status:404,errorCode:"MESSAGE_NOT_FOUND",reasons:["No message with that ID exists"]});const r=t.value,{sender:i}=r,o=cO(r,["sender"]),s={};return o.data.reactions.forEach(a=>{s[a.emoji]={count:a.count,currentUserReacted:a.currentUserReacted}}),K({status:200,data:mn(Se({},o.data),{senderId:(e=i?.store.userId)!=null?e:null,reactions:s})})})}}function zD(n,e){if(e===void 0)return n;const t=n.map(i=>{const o=e[i.emoji];return o===void 0?i:o===null?mn(Se({},i),{count:0}):{emoji:i.emoji,count:Ye(i.count,o.count),currentUserReacted:Ye(i.currentUserReacted,o.currentUserReacted)}}).filter(i=>i.count>0),r=new Set(t.map(i=>i.emoji));for(const i in e){const o=e[i];o&&!r.has(i)&&t.push({emoji:i,count:o.count,currentUserReacted:o.currentUserReacted})}return t.sort((i,o)=>i.emoji.localeCompare(o.emoji)),t}function vp(n){const e=Object.entries(n).map(([t,r])=>({emoji:t,count:r.count,currentUserReacted:r.currentUserReacted}));return e.sort((t,r)=>t.emoji.localeCompare(r.emoji)),e}class Ap extends au{constructor(e,t,r,i){super(e),this.createdAt=t,this.dataStore=r,this.referencedDataStore=i}get messageId(){return this.dataStore.messageId}fetchInitial(e){return $(this,null,function*(){return K({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,r){return $(this,arguments,function*(i,o,{dataStore:s,referencedDataStore:a}){return(yield s.changedBetween(i,o))===!0||(yield a?.changedBetween(i,o))===!0})}loadNested(e,t){return $(this,null,function*(){var r,i,o;const s=yield t.dataStore.getDeep(e);if(!s.ok)return s;const a=s.value;if(a.snapshot===null)return K({snapshot:null});const l=yield(r=t.referencedDataStore)==null?void 0:r.getDeep(e);if(l&&!l.ok)return l;const u=(i=l?.value)!=null?i:null,c=(o=u?.snapshot)!=null?o:null;return K({snapshot:{id:a.snapshot.id,type:a.snapshot.type,sender:a.snapshot.sender,custom:a.snapshot.custom,createdAt:a.snapshot.createdAt,editedAt:a.snapshot.editedAt,referencedMessage:c,origin:a.snapshot.origin,plaintext:a.snapshot.plaintext,content:a.snapshot.content,reactions:a.snapshot.reactions}})})}}class VD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.conversationId=t,this.realtimeClient=r,this.unsubscribeDebounceMs=1e3,this.pendingLoadMore=void 0}listen(e){return this.onlyUsedInternally&&this.mostRecentState.resultPromise.then(t=>{if(t.ok&&t.value.inWindow!==null){const r=30-t.value.inWindow.length;r>0&&this._loadMoreMessages(r)}}),super.listen(e)}fetchInitial(e){return $(this,null,function*(){const t=this.onlyUsedInternally?1:30,r=yield vO({realtimeClient:this.realtimeClient,conversationId:this.conversationId,count:t});return r.ok?r.value.messages===null?K({lastChanged:e,lastMessageChanged:e,stores:null,inWindow:null,windowEnd:null}):AO({seq:e,messages:r.value.messages,cursor:r.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):r})}teardownNested(e){if(e.stores){const t=je("TERMINATED");Object.values(e.stores).forEach(r=>r.setError(t)),e.inWindow.forEach(r=>r.setError(t))}}anyChildChanged(e,t,r){return $(this,null,function*(){for(const i in r.stores){const o=r.stores[i];if((yield o?.changedBetween(e,t))===!0)return!0}return!1})}lastMessageChangedBetween(e,t){return $(this,null,function*(){if(e>=t)return!1;const r=yield this.get(t).resultPromise;if(!r.ok)return!1;if(r.value.lastMessageChanged>e)return!0;if(r.value.stores===null)return!1;const i=r.value.inWindow[0];return i!==void 0&&(yield i.changedBetween(e,t))===!0})}equal(e,t){return e.stores===null&&t.stores===null||e.stores!==null&&t.stores!==null&&!!yt(Object.keys(e.stores),Object.keys(t.stores))&&!!yt(e.inWindow.map(r=>r.messageId),t.inWindow.map(r=>r.messageId))&&yt(e.windowEnd,t.windowEnd)}loadNested(e,t){return $(this,null,function*(){if(t.stores===null)return K({snapshot:null,loadedAll:!0});const r=yield Promise.all(t.inWindow.map(o=>o.getDeep(e)));return r.find(o=>!o.ok)||K({snapshot:r.filter(o=>o.value.snapshot!==null).map(o=>o.value.snapshot),loadedAll:t.windowEnd===null})})}loadMore(e){return $(this,null,function*(){if(this.pendingLoadMore)return this.pendingLoadMore;const t=ri();this.pendingLoadMore=t.promise,yield this._loadMoreMessages(e),t.resolve(),this.pendingLoadMore=void 0})}_loadMoreMessages(e=30){return $(this,null,function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok||t.value.windowEnd===null)return;const r=t.value.windowEnd.cursor,i=yield vO({count:e,cursor:r,conversationId:this.conversationId,realtimeClient:this.realtimeClient}),o=this.getLoadMoreSeq();this.mutate(o,s=>s.value.windowEnd===null||r!==s.value.windowEnd.cursor?s:i.ok?i.value.messages===null?(console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."),s):AO({seq:o,prevState:s.value,messages:i.value.messages,cursor:i.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):i),yield this.emitMutex.runExclusive(()=>this.emit(o))})}messageCreated(e,t){this.mutate(e,r=>{if(r.value.stores===null)return console.warn("[TalkJS] Received a 'message.created' event for a nonexistent conversation."),r;if(r.value.windowEnd&&t.state.createdAt<r.value.windowEnd.oldestMessageTs||Object.hasOwnProperty.call(r.value.stores,t.state.id))return r;const i=Se({},r.value.stores),o=new ho(e,this.conversationId,t.state,this.realtimeClient);i[t.state.id]=o;const s=t.state.referencedMessageId;let a;s===null?a=null:s in i?a=i[s]:(a=new ho(e,this.conversationId,s,this.realtimeClient),i[s]=a);const l=new Ap(e,t.state.createdAt,o,a),u=[...r.value.inWindow,l];u.sort((d,h)=>h.createdAt-d.createdAt);const c=u[0].messageId===t.messageId?e:r.value.lastMessageChanged;return K({lastChanged:e,lastMessageChanged:c,stores:i,inWindow:u,windowEnd:r.value.windowEnd})})}messageEdited(e,t){this.mutate(e,r=>{var i;return r.value.stores===null?(console.warn("[TalkJS] Received a 'message.edited' event for a nonexistent conversation."),r):((i=r.value.stores[t.messageId])==null||i.messageEdited(e,t),r)})}messageDeleted(e,t){this.mutate(e,r=>{if(r.value.stores===null)return console.warn("[TalkJS] Received a 'message.deleted' event for a conversation that we thought didn't exist."),r;if(Object.values(r.value.stores).forEach(a=>a.messageDeleted(e,t)),r.value.stores[t.messageId]===void 0)return r;const i=Se({},r.value.stores);delete i[t.messageId];const o=r.value.inWindow.filter(a=>a.messageId!==t.messageId);if(t.newLastMessage&&o.length===0){const a=new ho(e,this.conversationId,t.newLastMessage,this.realtimeClient);i[a.messageId]=a;const l=t.newLastMessage.referencedMessageId;let u;l===null?u=null:l in i?u=i[l]:(u=new ho(e,this.conversationId,l,this.realtimeClient),i[l]=u);const c=new Ap(e,t.newLastMessage.createdAt,a,u);o.push(c)}const s=t.newLastMessage!==void 0?e:r.value.lastMessageChanged;return K({lastChanged:e,lastMessageChanged:s,stores:i,inWindow:o,windowEnd:r.value.windowEnd})})}conversationCleared(e,t){this.mutate(e,r=>{var i;return((i=r.value.inWindow)==null?void 0:i.length)===0&&r.value.windowEnd===null?r:(this.teardownNested(r.value),K({lastChanged:e,lastMessageChanged:e,stores:{},inWindow:[],windowEnd:null}))})}sideCreated(e,t){const r=this.fetchInitial(e);this.mutate(e,i=>i.value.stores!==null?(r.then(o=>{o.ok&&this.teardownNested(o.value)}),i):r)}sideDeleted(e,t){this.mutate(e,r=>r.value.stores===null?r:(this.teardownNested(r.value),K({lastChanged:e,lastMessageChanged:e,stores:null,inWindow:null,windowEnd:null})))}getMessageFromCache(e){return $(this,null,function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok||t.value.stores===null)return je("NOT_IN_CACHE");const r=t.value.stores[e];return r===void 0?je("NOT_IN_CACHE"):r.getFromCache()})}}function vO(n){return $(this,arguments,function*({cursor:e,realtimeClient:t,conversationId:r,count:i}){const o={limit:i,cursor:e},s=yield t.call("GET",["me","conversations",r,"messages"],o,{bypassCache:!0});if(s.ok){const{data:a,cursor:l}=s.value.data;return K({messages:a,nextCursor:l})}return!s.ok&&s.where==="server"&&s.value.status===404||!s.ok&&s.where==="server"&&s.value.status===403&&s.value.errorCode==="NOT_A_PARTICIPANT"?K({messages:null,nextCursor:null}):s})}function AO({seq:n,prevState:e,messages:t,cursor:r,conversationId:i,realtimeClient:o}){var s,a,l,u;const c=e?Se({},e.stores):{};for(const p of t)if(c[p.id]===void 0){const f=new ho(n,i,p,o);c[f.messageId]=f}for(const p of t){const f=p.referencedMessageId;if(f&&c[f]===void 0){const m=new ho(n,i,f,o);c[m.messageId]=m}}const d=e?[...e.inWindow]:[];for(const p of t)d.push(new Ap(n,p.createdAt,c[p.id],p.referencedMessageId?c[p.referencedMessageId]:null));d.sort((p,f)=>f.createdAt-p.createdAt);const h=((a=(s=e?.inWindow)==null?void 0:s[0])==null?void 0:a.messageId)===((l=d?.[0])==null?void 0:l.messageId)&&(u=e?.lastMessageChanged)!=null?u:n;return K(r===null?{lastChanged:n,lastMessageChanged:h,stores:c,inWindow:d,windowEnd:null}:{lastChanged:n,lastMessageChanged:h,stores:c,inWindow:d,windowEnd:{cursor:r,oldestMessageTs:t[t.length-1].createdAt}})}class WD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.convDataStore=t,this.realtimeClient=r,this.unsubscribeDebounceMs=0}fetchInitial(e){return $(this,null,function*(){return K({lastChanged:e,store:this.convDataStore})})}teardownNested(e){e.store.unsubscribe()}anyChildChanged(e,t,r){return $(this,null,function*(){return r.store.store.changedBetween(e,t)})}equal(e,t){return!0}loadNested(e,t){return $(this,null,function*(){return t.store.store.getDeep(e)})}getFromCache(){return $(this,null,function*(){return this.convDataStore.store.getFromCache()})}}function _p(n,e){for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(n[t],t)}function yp(n,e){return function(t){let r={};return _p(t,(i,o)=>{const[s,a]=(([l,u])=>[l,e(u,l)])([o,i],0);r[s]=a}),r}(n)}class GD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.conversationId=t,this.realtimeClient=r,this.unsubscribeDebounceMs=1e4}fetchInitial(e){return $(this,null,function*(){const t=yield this.realtimeClient.call("GET",["me","conversations",this.conversationId,"typing"],{},{bypassCache:!0});if(!t.ok&&t.where==="server"&&t.value.status===404)return K({data:null,lastChanged:e});if(!t.ok&&t.where==="server"&&t.value.status===403&&t.value.errorCode==="NOT_A_PARTICIPANT")return K({data:null,lastChanged:e});if(!t.ok)return t;const r=t.value.data;return r.many?K({data:{usersTyping:null,many:!0},userSubscriptions:{},lastChanged:e}):K({data:r,userSubscriptions:yp(r.usersTyping,(i,o)=>this.realtimeClient.internalSubscribe(["users",o])),lastChanged:e})})}equal(e,t){return yt(e.data,t.data)}loadNested(e,t){return $(this,null,function*(){if(t.data===null)return K({snapshot:null,lastChanged:t.lastChanged});if(t.data.many)return K({snapshot:{many:!0},lastChanged:t.lastChanged});const r=Object.entries(t.data.usersTyping).sort(([u,c],[d,h])=>c-h).map(([u,c])=>u).map(u=>t.userSubscriptions[u].store.getDeep(e)),i=yield Promise.all(r),o=i.find(u=>!u.ok);if(o)return o;const s=i.map(u=>u.value),a=s.map(u=>u.snapshot),l=s.map(u=>u.lastChanged);return K({snapshot:{users:a,many:!1},lastChanged:Math.max(t.lastChanged,...l)})})}typingAvailable(e,t){this.mutate(e,()=>K({data:t.state,userSubscriptions:t.state.many?{}:yp(t.state.usersTyping,(r,i)=>this.realtimeClient.internalSubscribe(["users",i])),lastChanged:e}))}typingChanged(e,t){this.mutate(e,r=>{if(r.value.data===null)return r;if(t.diff.many===void 0){if(r.value.data.many===!0)return r;const i=Se({},r.value.data.usersTyping),o=Se({},r.value.userSubscriptions);return _p(t.diff.usersTyping,(s,a)=>{var l;typeof s=="number"?(i[a]=s,o[a]=this.realtimeClient.internalSubscribe(["users",a])):s===null&&(delete i[a],(l=o[a])==null||l.unsubscribe(),delete o[a])}),K({data:{usersTyping:i,many:!1},userSubscriptions:o,lastChanged:e})}if(t.diff.many===!0)return r.value.data.many?r:K({data:{usersTyping:null,many:!0},userSubscriptions:{},lastChanged:e});if(t.diff.many===!1){if(r.value.data.many===!1)return r;const i=yp(t.diff.usersTyping,(o,s)=>this.realtimeClient.internalSubscribe(["users",s]));return K({data:t.diff,userSubscriptions:i,lastChanged:e})}throw t.diff,"Unreachable"})}sideDeleted(e,t){this.mutate(e,r=>r.value.data===null?r:K({data:null,lastChanged:e}))}teardownNested(e){e.data&&_p(e.userSubscriptions,t=>t.unsubscribe())}anyChildChanged(e,t,r){return $(this,null,function*(){var i;if(r.data===null)return!1;for(const o in r.userSubscriptions){const s=r.userSubscriptions[o];if((yield(i=s?.store)==null?void 0:i.changedBetween(e,t))===!0)return!0}return!1})}}class _O extends au{constructor(e,t,r,i){super(e),this.conversationId=t,this.participantData=r,this.realtimeClient=i}fetchInitial(e){return $(this,null,function*(){return K({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 r,i,o,s;return((i=(r=e.user)==null?void 0:r.store)==null?void 0:i.userId)===((s=(o=t.user)==null?void 0:o.store)==null?void 0:s.userId)&&yt(e.data,t.data)}teardownNested(e){var t;(t=e.user)==null||t.unsubscribe()}anyChildChanged(e,t,r){return $(this,null,function*(){var i;const o=(i=r.user)==null?void 0:i.store;return(yield o?.changedBetween(e,t))===!0})}loadNested(e,t){return $(this,null,function*(){if(t.data===null)return K({snapshot:null});const r=yield t.user.store.getDeep(e);if(r.ok===!1)return r;const i=r.value.snapshot;return K({snapshot:this.realtimeClient.createParticipantSnapshotPreloaded(t.data,i)})})}participantEdited(e,t){this.mutate(e,r=>r.value.data===null?r:K({lastChanged:e,user:r.value.user,data:{id:r.value.data.id,access:Ye(r.value.data.access,t.diff.access),notify:Ye(r.value.data.notify,t.diff.notify),joinedAt:r.value.data.joinedAt}}))}participantDeleted(e,t){this.mutate(e,r=>r.value.data===null?r:(this.teardownNested(r.value),K({lastChanged:e,user:null,data:null})))}getFromCache(){return $(this,null,function*(){const e=yield this.mostRecentState.resultPromise;return e.ok?e.value.data===null?ii({status:404,errorCode:"PARTICIPANT_NOT_FOUND",reasons:["No participant with that ID exists"]}):K({status:200,data:e.value.data}):je("NOT_IN_CACHE")})}}class XD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.conversationId=t,this.realtimeClient=r,this.unsubscribeDebounceMs=1e3,this.pendingLoadMore=void 0}fetchInitial(e){return $(this,null,function*(){const t=yield yO({realtimeClient:this.realtimeClient,conversationId:this.conversationId,count:10});return t.ok?t.value.participants===null?K({lastChanged:e,stores:null,inWindow:null,windowEnd:null}):OO({seq:e,participants:t.value.participants,cursor:t.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):t})}teardownNested(e){if(e.stores){const t=je("TERMINATED");Object.values(e.stores).forEach(r=>r.setError(t))}}anyChildChanged(e,t,r){return $(this,null,function*(){for(const i in r.stores){const o=r.stores[i];if((yield o?.changedBetween(e,t))===!0)return!0}return!1})}equal(e,t){return e.stores===null&&t.stores===null||e.stores!==null&&t.stores!==null&&!!yt(Object.keys(e.stores),Object.keys(t.stores))&&yt(e.windowEnd,t.windowEnd)}loadNested(e,t){return $(this,null,function*(){if(t.stores===null)return K({snapshot:null,loadedAll:!0});const r=yield Promise.all(Object.values(t.stores).map(s=>s.getDeep(e))),i=r.find(s=>!s.ok);if(i)return i;const o=r.filter(s=>s.value.snapshot!==null).map(s=>s.value.snapshot);return o.sort((s,a)=>a.joinedAt-s.joinedAt),K({snapshot:o,loadedAll:t.windowEnd===null})})}loadMore(e){return $(this,null,function*(){if(this.pendingLoadMore)return this.pendingLoadMore;const t=ri();this.pendingLoadMore=t.promise,yield this._loadMoreParticipants(e),t.resolve(),this.pendingLoadMore=void 0})}_loadMoreParticipants(e=10){return $(this,null,function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok||t.value.windowEnd===null)return;const r=t.value.windowEnd.cursor,i=yield yO({count:e,cursor:r,conversationId:this.conversationId,realtimeClient:this.realtimeClient}),o=this.getLoadMoreSeq();this.mutate(o,s=>s.value.windowEnd===null||r!==s.value.windowEnd.cursor?s:i.ok?i.value.participants===null?(console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."),s):OO({seq:o,prevStores:s.value.stores,participants:i.value.participants,cursor:i.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):i),yield this.emitMutex.runExclusive(()=>this.emit(o))})}participantCreated(e,t){this.mutate(e,r=>{if(r.value.stores===null)return console.warn("[TalkJS] Received a 'participant.created' event for a nonexistent conversation."),r;if(r.value.windowEnd&&t.state.joinedAt<r.value.windowEnd.oldestParticipantTs||Object.hasOwnProperty.call(r.value.stores,t.state.id))return r;const i=Se({},r.value.stores),o=new _O(e,this.conversationId,t.state,this.realtimeClient);return i[t.state.id]=o,K({lastChanged:e,stores:i,windowEnd:r.value.windowEnd})})}participantEdited(e,t){this.mutate(e,r=>{var i;return r.value.stores===null?(console.warn("[TalkJS] Received a 'participant.edited' event for a nonexistent conversation."),r):((i=r.value.stores[t.userId])==null||i.participantEdited(e,t),r)})}participantDeleted(e,t){this.mutate(e,r=>{if(r.value.stores===null)return console.warn("[TalkJS] Received a 'participant.deleted' event for a conversation that we thought didn't exist."),r;const i=r.value.stores[t.userId];if(i===void 0)return r;i.participantDeleted(e,t);const o=Se({},r.value.stores);return delete o[t.userId],K({lastChanged:e,stores:o,windowEnd:r.value.windowEnd})})}sideCreated(e,t){const r=this.fetchInitial(e);this.mutate(e,i=>i.value.stores!==null?(r.then(o=>{o.ok&&this.teardownNested(o.value)}),i):r)}sideDeleted(e,t){this.mutate(e,r=>r.value.stores===null?r:(this.teardownNested(r.value),K({lastChanged:e,stores:null,inWindow:null,windowEnd:null})))}getParticipantFromCache(e){return $(this,null,function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok||t.value.stores===null)return je("NOT_IN_CACHE");const r=t.value.stores[e];return r===void 0?je("NOT_IN_CACHE"):r.getFromCache()})}}function yO(n){return $(this,arguments,function*({cursor:e,realtimeClient:t,conversationId:r,count:i}){const o={limit:i,cursor:e},s=yield t.call("GET",["me","conversations",r,"participants"],o,{bypassCache:!0});if(s.ok){const{data:a,cursor:l}=s.value.data;return K({participants:a,nextCursor:l})}return!s.ok&&s.where==="server"&&s.value.status===404||!s.ok&&s.where==="server"&&s.value.status===403&&s.value.errorCode==="NOT_A_PARTICIPANT"?K({participants:null,nextCursor:null}):s})}function OO({seq:n,prevStores:e,participants:t,cursor:r,conversationId:i,realtimeClient:o}){const s=e?Se({},e):{};for(const a of t)if(s[a.id]===void 0){const l=new _O(n,i,a,o);s[a.id]=l}return K(r===null?{lastChanged:n,stores:s,windowEnd:null}:{lastChanged:n,stores:s,windowEnd:{cursor:r,oldestParticipantTs:t[t.length-1].joinedAt}})}class KD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.getConvDataStore=t,this.realtimeClient=r,this.unsubscribeDebounceMs=1e3,this.pendingLoadMore=void 0}fetchInitial(e){return $(this,null,function*(){const t=yield TO({realtimeClient:this.realtimeClient,count:20});return t.ok?t.value.conversations===null?K({lastChanged:e,stores:null,windowEnd:null}):SO({seq:e,conversations:t.value.conversations,cursor:t.value.nextCursor,getConvDataStore:this.getConvDataStore}):t})}teardownNested(e){e.stores!==null&&Object.values(e.stores).forEach(t=>t.unsubscribe())}anyChildChanged(e,t,r){return $(this,null,function*(){var i;for(const o in r.stores){const s=r.stores[o];if((yield(i=s?.store)==null?void 0:i.changedBetween(e,t))===!0)return!0}return!1})}equal(e,t){return e.stores===null&&t.stores===null||e.stores!==null&&t.stores!==null&&!!yt(Object.keys(e.stores),Object.keys(t.stores))&&yt(e.windowEnd,t.windowEnd)}loadNested(e,t){return $(this,null,function*(){if(t.stores===null)return K({snapshot:[],loadedAll:!0});const r=yield Promise.all(Object.values(t.stores).map(s=>s.store.getDeep(e))),i=r.find(s=>!s.ok);if(i)return i;const o=r.filter(s=>s.value.snapshot!==null).map(s=>s.value.snapshot);return o.sort((s,a)=>{var l,u,c,d;const h=(u=(l=s.lastMessage)==null?void 0:l.createdAt)!=null?u:s.joinedAt;return((d=(c=a.lastMessage)==null?void 0:c.createdAt)!=null?d:a.joinedAt)-h}),K({snapshot:o,loadedAll:t.windowEnd===null})})}loadMore(e){return $(this,null,function*(){if(this.pendingLoadMore)return this.pendingLoadMore;const t=ri();this.pendingLoadMore=t.promise,yield this._loadMoreConversations(e),t.resolve(),this.pendingLoadMore=void 0})}_loadMoreConversations(e=20){return $(this,null,function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok||t.value.windowEnd===null)return;const r=t.value.windowEnd.cursor,i=yield TO({count:e,cursor:r,realtimeClient:this.realtimeClient}),o=this.getLoadMoreSeq();this.mutate(o,s=>s.value.windowEnd===null||r!==s.value.windowEnd.cursor?s:i.ok?i.value.conversations===null?(console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."),s):SO({seq:o,prevStores:s.value.stores,conversations:i.value.conversations,cursor:i.value.nextCursor,getConvDataStore:this.getConvDataStore}):i),yield this.emitMutex.runExclusive(()=>this.emit(o))})}getConvFromCache(e){return $(this,null,function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return je("NOT_IN_CACHE");if(t.value.stores===null)return ii({status:404,errorCode:"USER_NOT_FOUND",reasons:["No user with that ID exists"]});const r=t.value.stores[e];return r===void 0?je("NOT_IN_CACHE"):r.store.getFromCache()})}userCreated(e,t){this.mutate(e,r=>r.value.stores!==null?r:K({lastChanged:r.value.lastChanged,stores:{},windowEnd:null}))}sideCreated(e,t){const r=this.getConvDataStore(t.state);this.mutate(e,i=>Object.hasOwnProperty.call(i.value.stores,t.conversationId)?(r.unsubscribe(),i):K({lastChanged:e,stores:mn(Se({},i.value.stores),{[t.conversationId]:r}),windowEnd:i.value.windowEnd}))}sideDeleted(e,t){this.mutate(e,r=>{var i;if(!Object.hasOwnProperty.call(r.value.stores,t.conversationId))return r;const o=Se({},r.value.stores);return(i=o[t.conversationId])==null||i.unsubscribe(),delete o[t.conversationId],K({lastChanged:e,stores:o,windowEnd:r.value.windowEnd})})}sideEdited(e,t){const r=t.diff.lastMessageAt;r!==void 0&&this.mutate(e,i=>{var o;if(i.value.stores===null)return console.warn("[TalkJS] Received a 'side.edited' event when we thought your user didn't exist."),i;if(i.value.windowEnd===null)return i;const s=Object.hasOwnProperty.call(i.value.stores,t.conversationId);if(s&&r<i.value.windowEnd.oldestMessageTs){const a=Se({},i.value.stores);return(o=a[t.conversationId])==null||o.unsubscribe(),delete a[t.conversationId],K({lastChanged:e,stores:a,windowEnd:i.value.windowEnd})}if(!s&&r>=i.value.windowEnd.oldestMessageTs){const a=this.getConvDataStore(t.conversationId);return K({lastChanged:e,stores:mn(Se({},i.value.stores),{[t.conversationId]:a}),windowEnd:i.value.windowEnd})}return i})}}function TO(n){return $(this,arguments,function*({cursor:e,realtimeClient:t,count:r}){const i={limit:r,cursor:e},o=yield t.call("GET",["me","conversations"],i,{bypassCache:!0});if(o.ok){const{data:s,cursor:a}=o.value.data;return K({conversations:s,nextCursor:a})}return o.ok||o.where!=="server"||o.value.status!==404||o.value.errorCode!=="USER_NOT_FOUND"?o:K({conversations:null,nextCursor:null})})}function SO({seq:n,prevStores:e,conversations:t,cursor:r,getConvDataStore:i}){const o=e?Se({},e):{};for(const s of t)o[s.id]===void 0&&(o[s.id]=i(s));return K(r===null?{lastChanged:n,stores:o,windowEnd:null}:{lastChanged:n,stores:o,windowEnd:{cursor:r,oldestMessageTs:Math.min(...t.map(s=>s.lastMessageAt))}})}class qD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.conversation=t,this.realtimeClient=r,this.unsubscribeDebounceMs=5e3}get conversationId(){return typeof this.conversation=="string"?this.conversation:this.conversation.id}fetchInitial(e){return $(this,null,function*(){const t=this.realtimeClient.internalSubscribe(["me","conversations",this.conversationId,"messages"]);if(typeof this.conversation=="object")return K({lastChanged:e,snapshot:this.conversation,messageWindowStore:t});const r=yield this.realtimeClient.call("GET",["me","conversations",this.conversationId],{},{bypassCache:!0});let i;if(r.ok)i=r.value.data;else if(r.where==="server"&&r.value.status===404)i=null;else{if(r.where!=="server"||r.value.status!==403||r.value.errorCode!=="NOT_A_PARTICIPANT")return t.unsubscribe(),r;i=null}return K({lastChanged:e,snapshot:i,messageWindowStore:t})})}teardownNested(e){var t;(t=e.messageWindowStore)==null||t.unsubscribe()}anyChildChanged(e,t,r){return $(this,null,function*(){return(yield r.messageWindowStore.store.lastMessageChangedBetween(e,t))===!0})}equal(e,t){return yt(e.snapshot,t.snapshot)}loadNested(e,t){return $(this,null,function*(){var r;if(!t.snapshot)return K({snapshot:null,loadedAll:!0});const i=yield t.messageWindowStore.store.getDeep(e);if(!i.ok)return i;const o=i.value.snapshot,s=(r=o?.[0])!=null?r:null;return K({snapshot:mn(Se({},t.snapshot),{lastMessage:s})})})}participantEdited(e,t){this.mutate(e,r=>r.value.snapshot===null?(console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."),r):K({lastChanged:e,snapshot:Op(r.value.snapshot,t.diff),messageWindowStore:r.value.messageWindowStore}))}conversationEdited(e,t){this.mutate(e,r=>r.value.snapshot===null?(console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."),r):K({lastChanged:e,snapshot:Op(r.value.snapshot,t.diff),messageWindowStore:r.value.messageWindowStore}))}sideEdited(e,t){this.mutate(e,r=>r.value.snapshot===null?(console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."),r):K({lastChanged:e,snapshot:Op(r.value.snapshot,t.diff),messageWindowStore:r.value.messageWindowStore}))}sideCreated(e,t){this.mutate(e,r=>r.value.snapshot?r:K({lastChanged:e,snapshot:t.state,messageWindowStore:r.value.messageWindowStore}))}sideDeleted(e,t){this.mutate(e,r=>r.value.snapshot===null?r:K({lastChanged:e,snapshot:null,messageWindowStore:r.value.messageWindowStore}))}getFromCache(){return $(this,null,function*(){const e=yield this.mostRecentState.resultPromise;return e.ok&&e.value.snapshot?K({status:200,data:e.value.snapshot}):je("NOT_IN_CACHE")})}}function Op(n,e){const t=e;return{id:n.id,createdAt:n.createdAt,subject:Ye(n.subject,t.subject),photoUrl:Ye(n.photoUrl,t.photoUrl),welcomeMessages:Ye(n.welcomeMessages,t.welcomeMessages),custom:fp(n.custom,t.custom),lastMessageAt:Ye(n.lastMessageAt,t.lastMessageAt),unreadMessageCount:Ye(n.unreadMessageCount,t.unreadMessageCount),isUnread:Ye(n.isUnread,t.isUnread),access:Ye(n.access,t.access),notify:Ye(n.notify,t.notify),readUntil:Ye(n.readUntil,t.readUntil),everyoneReadUntil:Ye(n.everyoneReadUntil,t.everyoneReadUntil),joinedAt:n.joinedAt}}class JD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.userId=t,this.realtimeClient=r,this.unsubscribeDebounceMs=1e3}fetchInitial(e){return $(this,null,function*(){const t=this.realtimeClient.internalSubscribe(["users",this.userId]),r=yield this.realtimeClient.call("GET",["users",this.userId,"online"],{},{bypassCache:!0});return r.ok||r.where!=="server"||r.value.status!==404||r.value.errorCode!=="USER_NOT_FOUND"?r.ok?K({lastChanged:e,user:t,data:r.value.data}):r:K({lastChanged:e,user:t,data:null})})}equal(e,t){return yt(e.data,t.data)}teardownNested(e){e.user.unsubscribe()}anyChildChanged(e,t,r){return $(this,null,function*(){return r.user.store.changedBetween(e,t)})}loadNested(e,t){return $(this,null,function*(){const r=yield t.user.store.getDeep(e);if(!r.ok)return r;const i=r.value.snapshot;return t.data===null||i===null?K({snapshot:null}):K({snapshot:Se({user:i},t.data)})})}userCreated(e,t){const r=this.fetchInitial(e);this.mutate(e,i=>i.value.data!==null?(r.then(o=>{o.ok&&this.teardownNested(o.value)}),i):r)}userOnlineChanged(e,t){this.mutate(e,r=>r.value.data===null?r:K({lastChanged:e,user:r.value.user,data:t.diff}))}getFromCache(){return $(this,null,function*(){const e=yield this.mostRecentState.resultPromise;if(!e.ok)return je("NOT_IN_CACHE");if(e.value.data===null)return ii({status:404,errorCode:"USER_NOT_FOUND",reasons:["No user with that ID exists"]});const t=e.value,r=cO(t,["user"]);return K({status:200,data:Se({},r.data)})})}}class ZD{constructor(e,t,r){this.realtimeClient=r,this.convDataStores={},this.storeMap={},this.emitMutex=new fO,this.seqOffset=0,this.seqInThisConnection=0,this.refetchOnNextNetworkLoss=!0,this.connection=new BD(e,t,{onUpstreamRestarting:()=>{this.refetchOnNextNetworkLoss=!1},onReady:()=>{this.refetchOnNextNetworkLoss=!0},onResubscribeSent:()=>{if(this.seqOffset+=this.seq,this.seqInThisConnection=0,this.refetchOnNextNetworkLoss){this.seqOffset++;const i=this.seq;this.refetchAll(i),this.emitAll(i)}},onResubscribeError:(i,o)=>{var s;(s=this.storeMap[Tp(i)])==null||s.setError(o)},onPublish:(i,o)=>{this.seqInThisConnection=i;const s=this.seq;for(const a of o)this.handlePublish(s,a);this.emitAll(s)}})}get seq(){return this.seqOffset+this.seqInThisConnection}refetchAll(e){Object.values(this.storeMap).forEach(t=>t?.refetch(e))}emitAll(e){return this.emitMutex.runExclusive(()=>$(this,null,function*(){const t=Object.values(this.storeMap).map(r=>r?.emit(e));yield Promise.all(t)}))}handlePublish(e,t){var r,i,o,s,a,l,u,c,d,h,p,f,m,g,E,v,A,_,O,T,S,b,y,C,w,I,F;switch(t.type){case"user.created":return(r=this.storeMap[`/users/${t.userId}`])==null||r.userCreated(e,t),(i=this.storeMap["/me/conversations"])==null||i.userCreated(e,t),void((o=this.storeMap[`/users/${t.userId}/online`])==null||o.userCreated(e,t));case"user.edited":return void((s=this.storeMap[`/users/${t.userId}`])==null||s.userEdited(e,t));case"side.created":return(a=this.convDataStores[t.conversationId])==null||a.sideCreated(e,t),(l=this.storeMap[`/me/conversations/${t.conversationId}/messages`])==null||l.sideCreated(e,t),(u=this.storeMap[`/me/conversations/${t.conversationId}/participants`])==null||u.sideCreated(e,t),void((c=this.storeMap["/me/conversations"])==null||c.sideCreated(e,t));case"side.edited":return(d=this.convDataStores[t.conversationId])==null||d.sideEdited(e,t),void((h=this.storeMap["/me/conversations"])==null||h.sideEdited(e,t));case"side.deleted":return(p=this.convDataStores[t.conversationId])==null||p.sideDeleted(e,t),(f=this.storeMap[`/me/conversations/${t.conversationId}/messages`])==null||f.sideDeleted(e,t),(m=this.storeMap[`/me/conversations/${t.conversationId}/participants`])==null||m.sideDeleted(e,t),(g=this.storeMap[`/me/conversations/${t.conversationId}/typing`])==null||g.sideDeleted(e,t),void((E=this.storeMap["/me/conversations"])==null||E.sideDeleted(e,t));case"conversation.edited":return void((v=this.convDataStores[t.conversationId])==null||v.conversationEdited(e,t));case"message.created":return void((A=this.storeMap[`/me/conversations/${t.conversationId}/messages`])==null||A.messageCreated(e,t));case"message.edited":return void((_=this.storeMap[`/me/conversations/${t.conversationId}/messages`])==null||_.messageEdited(e,t));case"message.deleted":return void((O=this.storeMap[`/me/conversations/${t.conversationId}/messages`])==null||O.messageDeleted(e,t));case"typing.available":return void((T=this.storeMap[`/me/conversations/${t.conversationId}/typing`])==null||T.typingAvailable(e,t));case"typing.changed":return void((S=this.storeMap[`/me/conversations/${t.conversationId}/typing`])==null||S.typingChanged(e,t));case"conversation.cleared":return void((b=this.storeMap[`/me/conversations/${t.conversationId}/messages`])==null||b.conversationCleared(e,t));case"participant.edited":return(y=this.convDataStores[t.conversationId])==null||y.participantEdited(e,t),void((C=this.storeMap[`/me/conversations/${t.conversationId}/participants`])==null||C.participantEdited(e,t));case"participant.created":return void((w=this.storeMap[`/me/conversations/${t.conversationId}/participants`])==null||w.participantCreated(e,t));case"participant.deleted":return void((I=this.storeMap[`/me/conversations/${t.conversationId}/participants`])==null||I.participantDeleted(e,t));case"user.online.changed":return void((F=this.storeMap[`/users/${t.userId}/online`])==null||F.userOnlineChanged(e,t))}}call(e,t,r,i){return $(this,null,function*(){if(!i.bypassCache&&e==="GET"){const o=Tp(t);if(o in this.storeMap){const s=o,a=this.storeMap[s];if(a&&"getFromCache"in a){const l=yield a.getFromCache();if(l.value!=="NOT_IN_CACHE")return l}}else if(nn(t,["me","conversations","*","messages","*"])){const s=this.storeMap[`/me/conversations/${t[2]}/messages`];if(s){const a=yield s.getMessageFromCache(t[4]);if(a.value!=="NOT_IN_CACHE")return a}}else if(nn(t,["me","conversations","*","participants","*"])){const s=this.storeMap[`/me/conversations/${t[2]}/participants`];if(s){const a=yield s.getParticipantFromCache(t[4]);if(a.value!=="NOT_IN_CACHE")return a}}else if(nn(t,["me","conversations","*"])){const s=this.storeMap["/me/conversations"];if(s){const a=yield s.getConvFromCache(t[2]);if(a.value!=="NOT_IN_CACHE")return a}}}return this.connection.call(e,t,r)})}subscribe(e,t){const r=this.getOrCreateStore(e),i=ri(),o=ri();i.promise.catch(()=>{}),o.promise.catch(()=>{});const s={state:{type:"pending",latestSnapshot:void 0},connected:i.promise,terminated:o.promise,loadMore:l=>$(this,null,function*(){"loadMore"in r&&(yield r.loadMore(l))}),unsubscribe:()=>{}},a=r.listen(l=>{if(l.ok){const u=!("loadedAll"in l.value)||l.value.loadedAll,c={type:"active",latestSnapshot:l.value.snapshot,loadedAll:u};s.state=c,t?.(l.value.snapshot,u),i.resolve(c)}else if(s.state.type==="pending"||s.state.type==="active"){if(l.where==="server"){const u={type:"error",error:new Error(Fs(`Subscribe to ${e.join("/")}`,l.value))};return s.state=u,o.resolve(u),void i.reject("Subscription encountered an error during initial connection")}if(l.value==="SESSION_DESTROYED"){const u={type:"error",error:new Error("Session was destroyed causing all subscriptions to be terminated")};return s.state=u,o.resolve(u),void i.reject("Subscription encountered an error during initial connection")}if(l.value==="UNSUBSCRIBED"||l.value==="TERMINATED")return;l.value}});return s.unsubscribe=()=>{if(s.state.type==="pending"||s.state.type==="active"){a();const l={type:"unsubscribed"};s.state=l,o.resolve(l),i.reject("Subscription was unsubscribed before connecting")}},s}getOrCreateStore(e){const t=Tp(e);if(t in this.storeMap)return this.storeMap[t];this.connection.subscribe(e).then(i=>{i.ok||r.setError(i)});const r=this.instantiateStore(e,()=>{delete this.storeMap[t],this.connection.unsubscribe(e)});return this.storeMap[t]=r,r}destroy(){this.storeMap={},this.convDataStores={},this.connection.destroy()}isConnected(){return this.connection.isConnected()}instantiateStore(e,t){if(nn(e,["users","*"]))return new $D(this.seq,e[1],this.realtimeClient,this.emitMutex,t);if(nn(e,["me","conversations","*"]))return new WD(this.seq,this.subscribeConvData(e[2]),this.realtimeClient,this.emitMutex,t);if(nn(e,["me","conversations","*","messages"]))return new VD(this.seq,e[2],this.realtimeClient,this.emitMutex,t);if(nn(e,["me","conversations","*","participants"]))return new XD(this.seq,e[2],this.realtimeClient,this.emitMutex,t);if(nn(e,["me","conversations","*","typing"]))return new GD(this.seq,e[2],this.realtimeClient,this.emitMutex,t);if(nn(e,["me","conversations"]))return new KD(this.seq,r=>this.subscribeConvData(r),this.realtimeClient,this.emitMutex,t);if(nn(e,["users","*","online"]))return new JD(this.seq,e[1],this.realtimeClient,this.emitMutex,t);throw"Unreachable"}subscribeConvData(e){const t=typeof e=="string"?e:e.id;if(Object.hasOwnProperty.call(this.convDataStores,t)){const i=this.convDataStores[t];return{store:i,unsubscribe:i.registerInternalSubscription()}}const r=new qD(this.seq,e,this.realtimeClient,this.emitMutex,()=>{delete this.convDataStores[t]});return this.convDataStores[t]=r,{store:r,unsubscribe:r.registerInternalSubscription()}}}function Tp(n){return`/${n.join("/")}`}class QD{constructor(e,t,r){this.userId=t,this.alive=!0,this.connection=new ZD(e,r,this),r.onTokenRefreshFailed(()=>{this.destroy()})}call(e,t,r){return $(this,arguments,function*(i,o,s,a={}){return this.alive?this.connection.call(i,o,s,a):je("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 $(this,null,function*(){const r=yield this.call("GET",["me","conversations",e,"messages"],t);if(!r.ok)return Sp(r,"Listing messages in "+e);const i=r.value.data.data,o=yield Promise.all(i.map(a=>this.createMessageSnapshot(a,e))),s=o.find(a=>!a.ok);return s===void 0||s.ok?K(o.map(({value:a})=>a)):s})}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 $(this,null,function*(){const r=e.senderId===null?Promise.resolve(K(null)):this.getUser(e.senderId),i=e.referencedMessageId===null?Promise.resolve(K(null)):this.getReferencedMessage(t,e.referencedMessageId),o=yield r;if(!o.ok)return o;const s=yield i;return s.ok?K(this.createMessageSnapshotPreloaded(e,o.value,s.value)):s})}getReferencedMessage(e,t){return $(this,null,function*(){const r=yield this.call("GET",["me","conversations",e,"messages",t],{});if(!r.ok&&r.where==="server"&&r.value.status===404||!r.ok&&r.where==="server"&&r.value.status===403&&r.value.errorCode==="NOT_A_PARTICIPANT")return K(null);if(!r.ok)return Sp(r,`Fetching referenced message ${t} in conversation ${e}`);const i=r.value.data,o=yield this.getUser(i.senderId);if(!o.ok)return o;const s=o.value;return K(this.createReferencedMessageSnapshotPreloaded(i,s))})}getUser(e){return $(this,null,function*(){const t=yield this.call("GET",["users",e],{includePrivateFields:!1});return t.ok||t.where!=="server"||t.value.status!==404?t.ok?K(this.createUserSnapshot(t.value.data)):Sp(t,"Get user "+e):K(null)})}createMessageSnapshotPreloaded(e,t,r){return{id:e.id,type:e.type,sender:t,referencedMessage:r,custom:e.custom,createdAt:e.createdAt,editedAt:e.editedAt,origin:e.origin,content:e.content,reactions:vp(e.reactions),plaintext:cu(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:vp(e.reactions),plaintext:cu(e.content,{})}}}function Sp(n,e){return n.where==="server"?ii(mn(Se({},n.value),{operation:e})):n}function bp(n,e){var t;if(e.ok)return e.value;throw e.value==="SESSION_DESTROYED"?new Error(`${n} failed because the session was destroyed`):new Error(Fs((t=e.value.operation)!=null?t:n,e.value))}class bO{constructor(e,t){this.id=e,this._realtimeClient=t}get brandedId(){return this.id}get(){return $(this,null,function*(){const e=yield this._realtimeClient.getUser(this.brandedId);return bp("Get user "+this.id,e)})}set(e){return $(this,null,function*(){e.role===null&&(e.role="default");const t=typeof e.email=="string"?[e.email]:e.email,r=typeof e.phone=="string"?[e.phone]:e.phone,i=yield this._realtimeClient.call("PUT",["users",this.brandedId],mn(Se({},e),{email:t,phone:r}));Be("Set user "+this.id,i)})}createIfNotExists(e){return $(this,null,function*(){e.role===void 0&&(e.role="default");const t=typeof e.email=="string"?[e.email]:e.email,r=typeof e.phone=="string"?[e.phone]:e.phone,i=yield this._realtimeClient.call("POST",["users",this.brandedId],mn(Se({},e),{email:t,phone:r}));(i.ok||i.where!=="server"||i.value.status!=409)&&Be(`Create user ${this.id} if not exists`,i)})}subscribe(e){return this._realtimeClient.subscribe(["users",this.brandedId],e)}subscribeOnline(e){return this._realtimeClient.subscribe(["users",this.brandedId,"online"],e)}}class NO{constructor(e,t,r){this.userId=e,this.conversationId=t,this._realtimeClient=r}get brandedUserId(){return this.userId}get brandedConversationId(){return this.conversationId}get(){return $(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}),[r,i]=yield Promise.all([e,t]);if(!r.ok&&r.where==="server"&&r.value.status===404||!i.ok&&i.where==="server"&&i.value.status===404)return null;const o=Be(`Get participant ${this.userId} in conversation ${this.conversationId}`,r),s=Be(`Get user ${this.userId}`,i),a=this._realtimeClient.createUserSnapshot(s);return this._realtimeClient.createParticipantSnapshotPreloaded(o,a)})}set(){return $(this,arguments,function*(e={}){const t=yield this._realtimeClient.call("PUT",["conversations",this.brandedConversationId,"participants",this.brandedUserId],e);Be(`Set participant ${this.userId} in conversation ${this.conversationId}`,t)})}edit(){return $(this,arguments,function*(e={}){const t=yield this._realtimeClient.call("PATCH",["conversations",this.brandedConversationId,"participants",this.brandedUserId],e);Be(`Edit participant ${this.userId} in conversation ${this.conversationId}`,t)})}createIfNotExists(){return $(this,arguments,function*(e={}){const t=yield this._realtimeClient.call("POST",["conversations",this.brandedConversationId,"participants",this.brandedUserId],e);(t.ok||t.where!=="server"||t.value.status!==409)&&Be(`Add participant ${this.userId} to conversation ${this.conversationId}`,t)})}delete(){return $(this,null,function*(){const e=yield this._realtimeClient.call("DELETE",["conversations",this.brandedConversationId,"participants",this.brandedUserId],{});(e.ok||e.where!=="server"||e.value.status!==404)&&Be(`Remove participant ${this.userId} from conversation ${this.conversationId}`,e)})}}function ek(n){const e="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";let t=0;const r=[],i=n===t;t=n;const o=new Array(8);for(let a=7;a>=0;a--)o[a]=e.charAt(n%64),n=Math.floor(n/64);if(n!==0)throw new Error("We should have converted the entire timestamp.");let s=o.join("");if(i){let a;for(a=11;a>=0&&r[a]===63;a--)r[a]=0;r[a]++}else for(let a=0;a<12;a++)r[a]=Math.floor(64*Math.random());for(let a=0;a<12;a++)s+=e.charAt(r[a]);if(s.length!=20)throw new Error("Length should be 20.");return s}const Hs=(n,e,t=void 0)=>n.reduce((r,i,o)=>r.concat((s=>{if(typeof s=="string")return e(s,t);switch(s.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return[{type:s.type,children:Hs(s.children,e,s.type)}];case"link":return[{type:s.type,url:s.url,children:Hs(s.children,e,s.type)}];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return[{type:s.type,action:s.action,params:s.params,children:Hs(s.children,e,s.type)}];case"mention":case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return[s]}})(i)),[]);function Jn(n,e){return t=>{const r=t;let i=0;const o=[];for(const s of gO(t,n)){s.index-i>0&&o.push(r.substring(i,s.index));const a=e(s);Array.isArray(a)?o.push(...a):o.push(a),i=s.index+s[0].length}return i<t.length&&o.push(t.substring(i)),o}}const CO="’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var oi,Np=((oi=Np||{})[oi.italic=1]="italic",oi[oi.strikethrough=2]="strikethrough",oi[oi.bold=4]="bold",oi);const tk=[0,1,2,3,4,5,6].map(n=>{const e=[];return 1&n||e.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/),2&n||e.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/),4&n||e.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/),new RegExp(e.map(t=>t.source).join("|"),"g")}),nk={_:1,"*":4,"~":2};function rk(n){return IO(n,0)}function IO(n,e=0){const t=tk[e],r=t?function(i){const o=Jn(ik.getOrCompute(i,()=>new RegExp(`(?:^|[\\s${CO}])(?:${i.source})(?=[\\s${CO}]|$)`,"g")),s=>{const a=s[0][1],l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6];return[" ",{type:Np[nk[a]],children:[l]}]});return s=>{const[a,...l]=o(" "+s);return a.length>1&&l.unshift(a.substring(1)),l}}(t):()=>[n];return Hs(r(n),(i,o)=>o==="bold"||o==="italic"||o==="strikethrough"?IO(i,e|Np[o]):[i])}const ik=function(){const n=function(){try{return new WeakMap}catch{const t={has:()=>!1,get:()=>{},set:()=>t};return t}}();return{getOrCompute(e,t){if(n.has(e))return n.get(e);const r=t();return n.set(e,r),r}}}();function wO(n,e){if(Array.prototype.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function si(n,e){for(var t=n.length-1;t>=0;t--)e(n[t])===!0&&n.splice(t,1)}function RO(n){throw new Error("Unhandled case for value: '"+n+"'")}var Cp=function(){function n(e){e===void 0&&(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 n.prototype.setTagName=function(e){return this.tagName=e,this},n.prototype.getTagName=function(){return this.tagName||""},n.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},n.prototype.getAttr=function(e){return this.getAttrs()[e]},n.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},n.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},n.prototype.setClass=function(e){return this.setAttr("class",e)},n.prototype.addClass=function(e){for(var t,r=this.getClass(),i=this.whitespaceRegex,o=r?r.split(i):[],s=e.split(i);t=s.shift();)wO(o,t)===-1&&o.push(t);return this.getAttrs().class=o.join(" "),this},n.prototype.removeClass=function(e){for(var t,r=this.getClass(),i=this.whitespaceRegex,o=r?r.split(i):[],s=e.split(i);o.length&&(t=s.shift());){var a=wO(o,t);a!==-1&&o.splice(a,1)}return this.getAttrs().class=o.join(" "),this},n.prototype.getClass=function(){return this.getAttrs().class||""},n.prototype.hasClass=function(e){return(" "+this.getClass()+" ").indexOf(" "+e+" ")!==-1},n.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},n.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},n.prototype.getInnerHTML=function(){return this.innerHTML||""},n.prototype.getInnerHtml=function(){return this.getInnerHTML()},n.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},n.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")},n}(),DO=function(){function n(e){e===void 0&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return n.prototype.build=function(e){return new Cp({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},n.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},r=this.createCssClass(e);return r&&(t.class=r),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},n.prototype.createCssClass=function(e){var t=this.className;if(t){for(var r=[t],i=e.getCssClassSuffixes(),o=0,s=i.length;o<s;o++)r.push(t+"-"+i[o]);return r.join(" ")}return""},n.prototype.processAnchorText=function(e){return this.doTruncate(e)},n.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var r,i,o,s,a=t.length,l=t.location;return l==="smart"?function(u,c,d){var h,p;d==null?(d="&hellip;",p=3,h=8):(p=d.length,h=d.length);var f=function(w){var I="";return w.scheme&&w.host&&(I+=w.scheme+"://"),w.host&&(I+=w.host),w.path&&(I+="/"+w.path),w.query&&(I+="?"+w.query),w.fragment&&(I+="#"+w.fragment),I},m=function(w,I){var F=I/2,L=Math.ceil(F),j=-1*Math.floor(F),D="";return j<0&&(D=w.substr(j)),w.substr(0,L)+d+D};if(u.length<=c)return u;var g,E,v,A=c-p,_=(g={},(v=(E=u).match(/^([a-z]+):\/\//i))&&(g.scheme=v[1],E=E.substr(v[0].length)),(v=E.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(g.host=v[1],E=E.substr(v[0].length)),(v=E.match(/^\/(.*?)(?=(\?|#|$))/i))&&(g.path=v[1],E=E.substr(v[0].length)),(v=E.match(/^\?(.*?)(?=(#|$))/i))&&(g.query=v[1],E=E.substr(v[0].length)),(v=E.match(/^#(.*?)$/i))&&(g.fragment=v[1]),g);if(_.query){var O=_.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);O&&(_.query=_.query.substr(0,O[1].length),u=f(_))}if(u.length<=c||(_.host&&(_.host=_.host.replace(/^www\./,""),u=f(_)),u.length<=c))return u;var T="";if(_.host&&(T+=_.host),T.length>=A)return _.host.length==c?(_.host.substr(0,c-p)+d).substr(0,A+h):m(T,A).substr(0,A+h);var S="";if(_.path&&(S+="/"+_.path),_.query&&(S+="?"+_.query),S){if((T+S).length>=A)return(T+S).length==c?(T+S).substr(0,c):(T+m(S,A-T.length)).substr(0,A+h);T+=S}if(_.fragment){var b="#"+_.fragment;if((T+b).length>=A)return(T+b).length==c?(T+b).substr(0,c):(T+m(b,A-T.length)).substr(0,A+h);T+=b}if(_.scheme&&_.host){var y=_.scheme+"://";if((T+y).length<A)return(y+T).substr(0,c)}if(T.length<=c)return T;var C="";return A>0&&(C=T.substr(-1*Math.floor(A/2))),(T.substr(0,Math.ceil(A/2))+d+C).substr(0,A+h)}(e,a):l==="middle"?function(u,c,d){if(u.length<=c)return u;var h,p;d==null?(d="&hellip;",h=8,p=3):(h=d.length,p=d.length);var f=c-p,m="";return f>0&&(m=u.substr(-1*Math.floor(f/2))),(u.substr(0,Math.ceil(f/2))+d+m).substr(0,f+h)}(e,a):(i=a,o=void 0,(r=e).length>i&&(o==null?(o="&hellip;",s=3):s=o.length,r=r.substring(0,i-s)+o),r)},n}(),po=function(){function n(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return n.prototype.getMatchedText=function(){return this.matchedText},n.prototype.setOffset=function(e){this.offset=e},n.prototype.getOffset=function(){return this.offset},n.prototype.getCssClassSuffixes=function(){return[this.getType()]},n.prototype.buildTag=function(){return this.tagBuilder.build(this)},n}(),kO=function(n,e){return(kO=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])})(n,e)};function kn(n,e){function t(){this.constructor=n}kO(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var LO,Fe=function(){return Fe=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},Fe.apply(this,arguments)},Ip=function(n){function e(t){var r=n.call(this,t)||this;return r.email="",r.email=t.email,r}return kn(e,n),e.prototype.getType=function(){return"email"},e.prototype.getEmail=function(){return this.email},e.prototype.getAnchorHref=function(){return"mailto:"+this.email},e.prototype.getAnchorText=function(){return this.email},e}(po),xO=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="",r.hashtag="",r.serviceName=t.serviceName,r.hashtag=t.hashtag,r}return kn(e,n),e.prototype.getType=function(){return"hashtag"},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getHashtag=function(){return this.hashtag},e.prototype.getAnchorHref=function(){var t=this.serviceName,r=this.hashtag;switch(t){case"twitter":return"https://twitter.com/hashtag/"+r;case"facebook":return"https://www.facebook.com/hashtag/"+r;case"instagram":return"https://instagram.com/explore/tags/"+r;default:throw new Error("Unknown service name to point hashtag to: "+t)}},e.prototype.getAnchorText=function(){return"#"+this.hashtag},e}(po),MO=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.mention="",r.mention=t.mention,r.serviceName=t.serviceName,r}return kn(e,n),e.prototype.getType=function(){return"mention"},e.prototype.getMention=function(){return this.mention},e.prototype.getServiceName=function(){return this.serviceName},e.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)}},e.prototype.getAnchorText=function(){return"@"+this.mention},e.prototype.getCssClassSuffixes=function(){var t=n.prototype.getCssClassSuffixes.call(this),r=this.getServiceName();return r&&t.push(r),t},e}(po),PO=function(n){function e(t){var r=n.call(this,t)||this;return r.number="",r.plusSign=!1,r.number=t.number,r.plusSign=t.plusSign,r}return kn(e,n),e.prototype.getType=function(){return"phone"},e.prototype.getPhoneNumber=function(){return this.number},e.prototype.getNumber=function(){return this.getPhoneNumber()},e.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},e.prototype.getAnchorText=function(){return this.matchedText},e}(po),wp=function(n){function e(t){var r=n.call(this,t)||this;return r.url="",r.urlMatchType="scheme",r.protocolUrlMatch=!1,r.protocolRelativeMatch=!1,r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.schemePrefixRegex=/^(https?:\/\/)?/i,r.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,r.protocolRelativeRegex=/^\/\//,r.protocolPrepended=!1,r.urlMatchType=t.urlMatchType,r.url=t.url,r.protocolUrlMatch=t.protocolUrlMatch,r.protocolRelativeMatch=t.protocolRelativeMatch,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return kn(e,n),e.prototype.getType=function(){return"url"},e.prototype.getUrlMatchType=function(){return this.urlMatchType},e.prototype.getUrl=function(){var t=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(t=this.url="http://"+t,this.protocolPrepended=!0),t},e.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,"&")},e.prototype.getAnchorText=function(){var t=this.getMatchedText();return this.protocolRelativeMatch&&(t=this.stripProtocolRelativePrefix(t)),this.stripPrefix.scheme&&(t=this.stripSchemePrefix(t)),this.stripPrefix.www&&(t=this.stripWwwPrefix(t)),this.stripTrailingSlash&&(t=this.removeTrailingSlash(t)),this.decodePercentEncoding&&(t=this.removePercentEncoding(t)),t},e.prototype.stripSchemePrefix=function(t){return t.replace(this.schemePrefixRegex,"")},e.prototype.stripWwwPrefix=function(t){return t.replace(this.wwwPrefixRegex,"$1")},e.prototype.stripProtocolRelativePrefix=function(t){return t.replace(this.protocolRelativeRegex,"")},e.prototype.removeTrailingSlash=function(t){return t.charAt(t.length-1)==="/"&&(t=t.slice(0,-1)),t},e.prototype.removePercentEncoding=function(t){var r=t.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(r)}catch{return r}},e}(po),fo=function(n){this.__jsduckDummyDocProp=null,this.tagBuilder=n.tagBuilder},Rp=/[A-Za-z]/,ok=/[\d]/,sk=/[\D]/,ai=/\s/,Dp=/['"]/,ak=/[\x00-\x1F\x7F]/,BO=/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,FO=BO+/\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,hu=/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,lk=FO+hu,ze=FO+hu,uk="(?:["+hu+"]{1,3}\\.){3}["+hu+"]{1,3}",ck="["+ze+"](?:["+ze+"\\-]{0,61}["+ze+"])?",UO=function(n){return"(?=("+ck+"))\\"+n},kp=function(n){return"(?:"+UO(n)+"(?:\\."+UO(n+1)+"){0,126}|"+uk+")"},pu=new RegExp("["+ze+"]"),HO=/(?: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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,dk=new RegExp("["+ze+"!#$%&'*+/=?^_`{|}~-]"),hk=new RegExp("^"+HO.source+"$"),$O=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.localPartCharRegex=dk,t.strictTldRegex=hk,t}return kn(e,n),e.prototype.parseMatches=function(t){for(var r=this.tagBuilder,i=this.localPartCharRegex,o=this.strictTldRegex,s=[],a=t.length,l=new fu,u={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},c=0,d=0,h=l;c<a;){var p=t.charAt(c);switch(d){case 0:(f=p)==="m"?T(1):i.test(f)&&T();break;case 1:m(t.charAt(c-1),p);break;case 2:g(p);break;case 3:E(p);break;case 4:v(p);break;case 5:A(p);break;case 6:_(p);break;case 7:O(p);break;default:RO(d)}c++}var f;return b(),s;function m(y,C){y===":"?i.test(C)?(d=2,h=new fu(Fe(Fe({},h),{hasMailtoPrefix:!0}))):S():u[y]===C||(i.test(C)?d=2:C==="."?d=3:C==="@"?d=4:S())}function g(y){y==="."?d=3:y==="@"?d=4:i.test(y)||S()}function E(y){y==="."||y==="@"?S():i.test(y)?d=2:S()}function v(y){pu.test(y)?d=5:S()}function A(y){y==="."?d=7:y==="-"?d=6:pu.test(y)||b()}function _(y){y==="-"||y==="."?b():pu.test(y)?d=5:b()}function O(y){y==="."||y==="-"?b():pu.test(y)?(d=5,h=new fu(Fe(Fe({},h),{hasDomainDot:!0}))):b()}function T(y){y===void 0&&(y=2),d=y,h=new fu({idx:c})}function S(){d=0,h=l}function b(){if(h.hasDomainDot){var y=t.slice(h.idx,c);/[-.]$/.test(y)&&(y=y.slice(0,-1));var C=h.hasMailtoPrefix?y.slice(7):y;(function(w){var I=(w.split(".").pop()||"").toLowerCase();return o.test(I)})(C)&&s.push(new Ip({tagBuilder:r,matchedText:y,offset:h.idx,email:C}))}S()}},e}(fo),fu=function(n){n===void 0&&(n={}),this.idx=n.idx!==void 0?n.idx:-1,this.hasMailtoPrefix=!!n.hasMailtoPrefix,this.hasDomainDot=!!n.hasDomainDot},pk=function(){function n(){}return n.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},n.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return e.match(t)!==null},n.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},n.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),r=t&&t[0].toLowerCase();return r!=="javascript:"&&r!=="vbscript:"},n.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||e.indexOf(".")!==-1)},n.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t||this.hasFullProtocolRegex.test(t)||this.hasWordCharAfterProtocolRegex.test(e))},n.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,n.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,n.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+BO+"]"),n.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]*)?\/?$/,n}(),fk=(LO=new RegExp("[/?#](?:["+ze+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+ze+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,kp(2),")","|","(","(//)?",/(?:www\.)/.source,kp(6),")","|","(","(//)?",kp(10)+"\\.",HO.source,"(?![-"+lk+"])",")",")","(?::[0-9]+)?","(?:"+LO.source+")?"].join(""),"gi")),mk=new RegExp("["+ze+"]"),jO=function(n){function e(t){var r=n.call(this,t)||this;return r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.matcherRegex=fk,r.wordCharRegExp=mk,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return kn(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.stripPrefix,s=this.stripTrailingSlash,a=this.decodePercentEncoding,l=this.tagBuilder,u=[],c=function(){var h=r[0],p=r[1],f=r[4],m=r[5],g=r[9],E=r.index,v=m||g,A=t.charAt(E-1);if(!pk.isValid(h,p)||E>0&&A==="@"||E>0&&v&&d.wordCharRegExp.test(A))return"continue";if(/\?$/.test(h)&&(h=h.substr(0,h.length-1)),d.matchHasUnbalancedClosingParen(h))h=h.substr(0,h.length-1);else{var _=d.matchHasInvalidCharAfterTld(h,p);_>-1&&(h=h.substr(0,_))}var O=["http://","https://"].find(function(y){return!!p&&p.indexOf(y)!==-1});if(O){var T=h.indexOf(O);h=h.substr(T),p=p.substr(T),E+=T}var S=p?"scheme":f?"www":"tld",b=!!p;u.push(new wp({tagBuilder:l,matchedText:h,offset:E,urlMatchType:S,url:h,protocolUrlMatch:b,protocolRelativeMatch:!!v,stripPrefix:o,stripTrailingSlash:s,decodePercentEncoding:a}))},d=this;(r=i.exec(t))!==null;)c();return u},e.prototype.matchHasUnbalancedClosingParen=function(t){var r,i=t.charAt(t.length-1);if(i===")")r="(";else if(i==="]")r="[";else{if(i!=="}")return!1;r="{"}for(var o=0,s=0,a=t.length-1;s<a;s++){var l=t.charAt(s);l===r?o++:l===i&&(o=Math.max(o-1,0))}return o===0},e.prototype.matchHasInvalidCharAfterTld=function(t,r){if(!t)return-1;var i=0;r&&(i=t.indexOf(":"),t=t.slice(i));var o=new RegExp("^((.?//)?[-."+ze+"]*[-"+ze+"]\\.[-"+ze+"]+)").exec(t);return o===null?-1:(i+=o[1].length,t=t.slice(o[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(t)?i:-1)},e}(fo),gk=new RegExp("#[_"+ze+"]{1,139}(?![_"+ze+"])","g"),Ek=new RegExp("[^"+ze+"]"),YO=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.matcherRegex=gk,r.nonWordCharRegex=Ek,r.serviceName=t.serviceName,r}return kn(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.nonWordCharRegex,s=this.serviceName,a=this.tagBuilder,l=[];(r=i.exec(t))!==null;){var u=r.index,c=t.charAt(u-1);if(u===0||o.test(c)){var d=r[0],h=r[0].slice(1);l.push(new xO({tagBuilder:a,matchedText:d,offset:u,serviceName:s,hashtag:h}))}}return l},e}(fo),vk=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"),zO=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.matcherRegex=vk,t}return kn(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.tagBuilder,s=[];(r=i.exec(t))!==null;){var a=r[0],l=a.replace(/[^0-9,;#]/g,""),u=!(!r[1]&&!r[2]),c=r.index==0?"":t.substr(r.index-1,1),d=t.substr(r.index+a.length,1),h=!c.match(/\d/)&&!d.match(/\d/);this.testMatch(r[3])&&this.testMatch(a)&&h&&s.push(new PO({tagBuilder:o,matchedText:a,offset:r.index,number:l,plusSign:u}))}return s},e.prototype.testMatch=function(t){return sk.test(t)},e}(fo),Ak=new RegExp("@[_"+ze+"]{1,50}(?![_"+ze+"])","g"),_k=new RegExp("@[_."+ze+"]{1,30}(?![_"+ze+"])","g"),yk=new RegExp("@[-_."+ze+"]{1,50}(?![-_"+ze+"])","g"),Ok=new RegExp("[^"+ze+"]"),VO=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.matcherRegexes={twitter:Ak,instagram:_k,soundcloud:yk},r.nonWordCharRegex=Ok,r.serviceName=t.serviceName,r}return kn(e,n),e.prototype.parseMatches=function(t){var r,i=this.serviceName,o=this.matcherRegexes[this.serviceName],s=this.nonWordCharRegex,a=this.tagBuilder,l=[];if(!o)return l;for(;(r=o.exec(t))!==null;){var u=r.index,c=t.charAt(u-1);if(u===0||s.test(c)){var d=r[0].replace(/\.+$/g,""),h=d.slice(1);l.push(new MO({tagBuilder:a,matchedText:d,offset:u,serviceName:i,mention:h}))}}return l},e}(fo),Ln=function(n){n===void 0&&(n={}),this.idx=n.idx!==void 0?n.idx:-1,this.type=n.type||"tag",this.name=n.name||"",this.isOpening=!!n.isOpening,this.isClosing=!!n.isClosing},Tk=function(){function n(e){e===void 0&&(e={}),this.version=n.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(e.urls),this.email=typeof e.email=="boolean"?e.email:this.email,this.phone=typeof e.phone=="boolean"?e.phone:this.phone,this.hashtag=e.hashtag||this.hashtag,this.mention=e.mention||this.mention,this.newWindow=typeof e.newWindow=="boolean"?e.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(e.stripPrefix),this.stripTrailingSlash=typeof e.stripTrailingSlash=="boolean"?e.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=typeof e.decodePercentEncoding=="boolean"?e.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=e.sanitizeHtml||!1;var t=this.mention;if(t!==!1&&t!=="twitter"&&t!=="instagram"&&t!=="soundcloud")throw new Error("invalid `mention` cfg - see docs");var r=this.hashtag;if(r!==!1&&r!=="twitter"&&r!=="facebook"&&r!=="instagram")throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(e.truncate),this.className=e.className||this.className,this.replaceFn=e.replaceFn||this.replaceFn,this.context=e.context||this}return n.link=function(e,t){return new n(t).link(e)},n.parse=function(e,t){return new n(t).parse(e)},n.prototype.normalizeUrlsCfg=function(e){return e==null&&(e=!0),typeof e=="boolean"?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:typeof e.schemeMatches!="boolean"||e.schemeMatches,wwwMatches:typeof e.wwwMatches!="boolean"||e.wwwMatches,tldMatches:typeof e.tldMatches!="boolean"||e.tldMatches}},n.prototype.normalizeStripPrefixCfg=function(e){return e==null&&(e=!0),typeof e=="boolean"?{scheme:e,www:e}:{scheme:typeof e.scheme!="boolean"||e.scheme,www:typeof e.www!="boolean"||e.www}},n.prototype.normalizeTruncateCfg=function(e){return typeof e=="number"?{length:e,location:"end"}:function(t,r){for(var i in r)r.hasOwnProperty(i)&&t[i]===void 0&&(t[i]=r[i]);return t}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},n.prototype.parse=function(e){var t=this,r=["a","style","script"],i=0,o=[];return function(s,a){for(var l,u=a.onOpenTag,c=a.onCloseTag,d=a.onText,h=a.onComment,p=a.onDoctype,f=new Ln,m=0,g=s.length,E=0,v=0,A=f;m<g;){var _=s.charAt(m);switch(E){case 0:_==="<"&&Z();break;case 1:O(_);break;case 2:S(_);break;case 3:T(_);break;case 4:b(_);break;case 5:y(_);break;case 6:C(_);break;case 7:w(_);break;case 8:I(_);break;case 9:F(_);break;case 10:L(_);break;case 11:j(_);break;case 12:D(_);break;case 13:s.substr(m,2)==="--"?(m+=2,A=new Ln(Fe(Fe({},A),{type:"comment"})),E=14):s.substr(m,7).toUpperCase()==="DOCTYPE"?(m+=7,A=new Ln(Fe(Fe({},A),{type:"doctype"})),E=20):k();break;case 14:B(_);break;case 15:H(_);break;case 16:x(_);break;case 17:Q(_);break;case 18:Y(_);break;case 19:J(_);break;case 20:se(_);break;default:RO(E)}m++}function O(U){U==="!"?E=13:U==="/"?(E=2,A=new Ln(Fe(Fe({},A),{isClosing:!0}))):U==="<"?Z():Rp.test(U)?(E=3,A=new Ln(Fe(Fe({},A),{isOpening:!0}))):(E=0,A=f)}function T(U){ai.test(U)?(A=new Ln(Fe(Fe({},A),{name:oe()})),E=4):U==="<"?Z():U==="/"?(A=new Ln(Fe(Fe({},A),{name:oe()})),E=12):U===">"?(A=new Ln(Fe(Fe({},A),{name:oe()})),te()):Rp.test(U)||ok.test(U)||U===":"||k()}function S(U){U===">"?k():Rp.test(U)?E=3:k()}function b(U){ai.test(U)||(U==="/"?E=12:U===">"?te():U==="<"?Z():U==="="||Dp.test(U)||ak.test(U)?k():E=5)}function y(U){ai.test(U)?E=6:U==="/"?E=12:U==="="?E=7:U===">"?te():U==="<"?Z():Dp.test(U)&&k()}function C(U){ai.test(U)||(U==="/"?E=12:U==="="?E=7:U===">"?te():U==="<"?Z():Dp.test(U)?k():E=5)}function w(U){ai.test(U)||(U==='"'?E=8:U==="'"?E=9:/[>=`]/.test(U)?k():U==="<"?Z():E=10)}function I(U){U==='"'&&(E=11)}function F(U){U==="'"&&(E=11)}function L(U){ai.test(U)?E=4:U===">"?te():U==="<"&&Z()}function j(U){ai.test(U)?E=4:U==="/"?E=12:U===">"?te():U==="<"?Z():(E=4,m--)}function D(U){U===">"?(A=new Ln(Fe(Fe({},A),{isClosing:!0})),te()):E=4}function B(U){U==="-"?E=15:U===">"?k():E=16}function H(U){U==="-"?E=18:U===">"?k():E=16}function x(U){U==="-"&&(E=17)}function Q(U){E=U==="-"?18:16}function Y(U){U===">"?te():U==="!"?E=19:U==="-"||(E=16)}function J(U){U==="-"?E=17:U===">"?te():E=16}function se(U){U===">"?te():U==="<"&&Z()}function k(){E=0,A=f}function Z(){E=1,A=new Ln({idx:m})}function te(){var U=s.slice(v,A.idx);U&&d(U,v),A.type==="comment"?h(A.idx):A.type==="doctype"?p(A.idx):(A.isOpening&&u(A.name,A.idx),A.isClosing&&c(A.name,A.idx)),k(),v=m+1}function oe(){var U=A.idx+(A.isClosing?2:1);return s.slice(U,m).toLowerCase()}v<m&&(l=s.slice(v,m),d(l,v),v=m+1)}(e,{onOpenTag:function(s){r.indexOf(s)>=0&&i++},onText:function(s,a){if(i===0){var l=function(c,d){if(!d.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var h,p=[],f=0;h=d.exec(c);)p.push(c.substring(f,h.index)),p.push(h[0]),f=h.index+h[0].length;return p.push(c.substring(f)),p}(s,/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),u=a;l.forEach(function(c,d){if(d%2==0){var h=t.parseText(c,u);o.push.apply(o,h)}u+=c.length})}},onCloseTag:function(s){r.indexOf(s)>=0&&(i=Math.max(i-1,0))},onComment:function(s){},onDoctype:function(s){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o)},n.prototype.compactMatches=function(e){e.sort(function(l,u){return l.getOffset()-u.getOffset()});for(var t=0;t<e.length-1;t++){var r=e[t],i=r.getOffset(),o=r.getMatchedText().length,s=i+o;if(t+1<e.length){if(e[t+1].getOffset()===i){var a=e[t+1].getMatchedText().length>o?t:t+1;e.splice(a,1);continue}e[t+1].getOffset()<s&&e.splice(t+1,1)}}return e},n.prototype.removeUnwantedMatches=function(e){return this.hashtag||si(e,function(t){return t.getType()==="hashtag"}),this.email||si(e,function(t){return t.getType()==="email"}),this.phone||si(e,function(t){return t.getType()==="phone"}),this.mention||si(e,function(t){return t.getType()==="mention"}),this.urls.schemeMatches||si(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="scheme"}),this.urls.wwwMatches||si(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="www"}),this.urls.tldMatches||si(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="tld"}),e},n.prototype.parseText=function(e,t){t===void 0&&(t=0),t=t||0;for(var r=this.getMatchers(),i=[],o=0,s=r.length;o<s;o++){for(var a=r[o].parseMatches(e),l=0,u=a.length;l<u;l++)a[l].setOffset(t+a[l].getOffset());i.push.apply(i,a)}return i},n.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var t=this.parse(e),r=[],i=0,o=0,s=t.length;o<s;o++){var a=t[o];r.push(e.substring(i,a.getOffset())),r.push(this.createMatchReturnVal(a)),i=a.getOffset()+a.getMatchedText().length}return r.push(e.substring(i)),r.join("")},n.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),typeof t=="string"?t:t===!1?e.getMatchedText():t instanceof Cp?t.toAnchorString():e.buildTag().toAnchorString()},n.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new YO({tagBuilder:e,serviceName:this.hashtag}),new $O({tagBuilder:e}),new zO({tagBuilder:e}),new VO({tagBuilder:e,serviceName:this.mention}),new jO({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},n.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new DO({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},n.version="3.14.3",n.AnchorTagBuilder=DO,n.HtmlTag=Cp,n.matcher={Email:$O,Hashtag:YO,Matcher:fo,Mention:VO,Phone:zO,Url:jO},n.match={Email:Ip,Hashtag:xO,Match:po,Mention:MO,Phone:PO,Url:wp},n}();function WO(n,e=n){return{type:"autolink",url:n,text:e}}const Sk=Jn(/<!!mention:([^>\s]*?)\|(.*?)>/gm,([n,e,t])=>function(r,i){return{type:"mention",id:r,text:i}}(decodeURIComponent(e),t)),bk=Jn(/<!!customemoji:(.*?)>/gm,([n,e])=>function(t){return{type:"customemoji",text:t}}(e)),GO=Jn(/<((?:https?|mailto):.*?)\|(.*?)>/gi,([n,e,t])=>function(r,i=[]){return{type:"link",url:r,children:i}}(e,[t])),Nk=Jn(/<actionlink:([^|]+)[|]([^>]*)>/gi,([n,e,t])=>{const{action:r,params:i}=XO(e);return function(o,s,a=[]){return{type:"actionlink",action:o,params:s,children:a}}(r,i,[t])}),Ck=Jn(/<actionbutton:([^|]+)[|]([^>]*)>/gi,([n,e,t])=>{const{action:r,params:i}=XO(e);return function(o,s,a=[]){return{type:"actionbutton",action:o,params:s,children:a}}(r,i,[t])});function XO(n){const e=n.indexOf("?");return e===-1?{action:n,params:{}}:{action:n.slice(0,e),params:Object.fromEntries(new URLSearchParams(n.slice(e)))}}const Ik=Jn(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g,([n])=>function(e=[]){return{type:"bulletlist",children:e}}([n.startsWith(`
1315
+ `;case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"emoji":case"customemoji":case"customEmoji":return t.text;case"suppressed":return e.contactInfoHiddenText;case"mention":return`@${t.text}`}}).join("")}class ho extends au{constructor(e,t,r,i){super(e),this.conversationId=t,this.message=r,this.realtimeClient=i}get messageId(){return typeof this.message=="string"?this.message:this.message.id}fetchInitial(e){return H(this,null,function*(){let t;if(typeof this.message=="object")t=this.message;else{const r=yield this.realtimeClient.call("GET",["me","conversations",this.conversationId,"messages",this.message],{},{bypassCache:!0});if(!r.ok)return r;t=r.value.data}return K({lastChanged:e,sender:t.senderId===null?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:cu(t.content,{}),content:t.content,reactions:vp(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 yt(e.data,t.data)}teardownNested(e){var t;(t=e.sender)==null||t.unsubscribe()}anyChildChanged(e,t,r){return H(this,null,function*(){var i;const o=(i=r.sender)==null?void 0:i.store;return(yield o?.changedBetween(e,t))===!0})}loadNested(e,t){return H(this,null,function*(){var r,i,o;const s=yield(i=(r=t.sender)==null?void 0:r.store)==null?void 0:i.getDeep(e);if(s?.ok===!1)return s;if(t.data===null)return K({snapshot:null});const a=s?.value;return K({snapshot:{sender:(o=a?.snapshot)!=null?o: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:cu(t.data.content,{}),content:t.data.content,referencedMessageId:t.data.referencedMessageId,reactions:t.data.reactions}})})}messageEdited(e,t){this.mutate(e,r=>r.value.data===null?r:K({lastChanged:e,sender:r.value.sender,data:{id:r.value.data.id,type:r.value.data.type,createdAt:r.value.data.createdAt,origin:r.value.data.origin,referencedMessageId:r.value.data.referencedMessageId,editedAt:Ye(r.value.data.editedAt,t.diff.editedAt),custom:fp(r.value.data.custom,t.diff.custom),content:Ye(r.value.data.content,t.diff.content),reactions:zD(r.value.data.reactions,t.diff.reactions)}}))}messageDeleted(e,t){this.mutate(e,r=>r.value.data===null?r:this.messageId===t.messageId?(this.teardownNested(r.value),K({lastChanged:e,sender:null,data:null})):r.value.data.referencedMessageId===t.messageId?K({lastChanged:e,sender:r.value.sender,data:{id:r.value.data.id,type:r.value.data.type,createdAt:r.value.data.createdAt,origin:r.value.data.origin,referencedMessageId:null,editedAt:r.value.data.editedAt,custom:r.value.data.custom,content:r.value.data.content,reactions:r.value.data.reactions}}):r)}getFromCache(){return H(this,null,function*(){var e;const t=yield this.mostRecentState.resultPromise;if(!t.ok)return je("NOT_IN_CACHE");if(t.value.data===null)return ii({status:404,errorCode:"MESSAGE_NOT_FOUND",reasons:["No message with that ID exists"]});const r=t.value,{sender:i}=r,o=cO(r,["sender"]),s={};return o.data.reactions.forEach(a=>{s[a.emoji]={count:a.count,currentUserReacted:a.currentUserReacted}}),K({status:200,data:mn(Se({},o.data),{senderId:(e=i?.store.userId)!=null?e:null,reactions:s})})})}}function zD(n,e){if(e===void 0)return n;const t=n.map(i=>{const o=e[i.emoji];return o===void 0?i:o===null?mn(Se({},i),{count:0}):{emoji:i.emoji,count:Ye(i.count,o.count),currentUserReacted:Ye(i.currentUserReacted,o.currentUserReacted)}}).filter(i=>i.count>0),r=new Set(t.map(i=>i.emoji));for(const i in e){const o=e[i];o&&!r.has(i)&&t.push({emoji:i,count:o.count,currentUserReacted:o.currentUserReacted})}return t.sort((i,o)=>i.emoji.localeCompare(o.emoji)),t}function vp(n){const e=Object.entries(n).map(([t,r])=>({emoji:t,count:r.count,currentUserReacted:r.currentUserReacted}));return e.sort((t,r)=>t.emoji.localeCompare(r.emoji)),e}class Ap extends au{constructor(e,t,r,i){super(e),this.createdAt=t,this.dataStore=r,this.referencedDataStore=i}get messageId(){return this.dataStore.messageId}fetchInitial(e){return H(this,null,function*(){return K({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,r){return H(this,arguments,function*(i,o,{dataStore:s,referencedDataStore:a}){return(yield s.changedBetween(i,o))===!0||(yield a?.changedBetween(i,o))===!0})}loadNested(e,t){return H(this,null,function*(){var r,i,o;const s=yield t.dataStore.getDeep(e);if(!s.ok)return s;const a=s.value;if(a.snapshot===null)return K({snapshot:null});const l=yield(r=t.referencedDataStore)==null?void 0:r.getDeep(e);if(l&&!l.ok)return l;const u=(i=l?.value)!=null?i:null,c=(o=u?.snapshot)!=null?o:null;return K({snapshot:{id:a.snapshot.id,type:a.snapshot.type,sender:a.snapshot.sender,custom:a.snapshot.custom,createdAt:a.snapshot.createdAt,editedAt:a.snapshot.editedAt,referencedMessage:c,origin:a.snapshot.origin,plaintext:a.snapshot.plaintext,content:a.snapshot.content,reactions:a.snapshot.reactions}})})}}class VD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.conversationId=t,this.realtimeClient=r,this.unsubscribeDebounceMs=1e3,this.pendingLoadMore=void 0}listen(e){return this.onlyUsedInternally&&this.mostRecentState.resultPromise.then(t=>{if(t.ok&&t.value.inWindow!==null){const r=30-t.value.inWindow.length;r>0&&this._loadMoreMessages(r)}}),super.listen(e)}fetchInitial(e){return H(this,null,function*(){const t=this.onlyUsedInternally?1:30,r=yield vO({realtimeClient:this.realtimeClient,conversationId:this.conversationId,count:t});return r.ok?r.value.messages===null?K({lastChanged:e,lastMessageChanged:e,stores:null,inWindow:null,windowEnd:null}):AO({seq:e,messages:r.value.messages,cursor:r.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):r})}teardownNested(e){if(e.stores){const t=je("TERMINATED");Object.values(e.stores).forEach(r=>r.setError(t)),e.inWindow.forEach(r=>r.setError(t))}}anyChildChanged(e,t,r){return H(this,null,function*(){for(const i in r.stores){const o=r.stores[i];if((yield o?.changedBetween(e,t))===!0)return!0}return!1})}lastMessageChangedBetween(e,t){return H(this,null,function*(){if(e>=t)return!1;const r=yield this.get(t).resultPromise;if(!r.ok)return!1;if(r.value.lastMessageChanged>e)return!0;if(r.value.stores===null)return!1;const i=r.value.inWindow[0];return i!==void 0&&(yield i.changedBetween(e,t))===!0})}equal(e,t){return e.stores===null&&t.stores===null||e.stores!==null&&t.stores!==null&&!!yt(Object.keys(e.stores),Object.keys(t.stores))&&!!yt(e.inWindow.map(r=>r.messageId),t.inWindow.map(r=>r.messageId))&&yt(e.windowEnd,t.windowEnd)}loadNested(e,t){return H(this,null,function*(){if(t.stores===null)return K({snapshot:null,loadedAll:!0});const r=yield Promise.all(t.inWindow.map(o=>o.getDeep(e)));return r.find(o=>!o.ok)||K({snapshot:r.filter(o=>o.value.snapshot!==null).map(o=>o.value.snapshot),loadedAll:t.windowEnd===null})})}loadMore(e){return H(this,null,function*(){if(this.pendingLoadMore)return this.pendingLoadMore;const t=ri();this.pendingLoadMore=t.promise,yield this._loadMoreMessages(e),t.resolve(),this.pendingLoadMore=void 0})}_loadMoreMessages(e=30){return H(this,null,function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok||t.value.windowEnd===null)return;const r=t.value.windowEnd.cursor,i=yield vO({count:e,cursor:r,conversationId:this.conversationId,realtimeClient:this.realtimeClient}),o=this.getLoadMoreSeq();this.mutate(o,s=>s.value.windowEnd===null||r!==s.value.windowEnd.cursor?s:i.ok?i.value.messages===null?(console.warn("[TalkJS] When loading more messages, the conversation no longer existed. We should have been told about this."),s):AO({seq:o,prevState:s.value,messages:i.value.messages,cursor:i.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):i),yield this.emitMutex.runExclusive(()=>this.emit(o))})}messageCreated(e,t){this.mutate(e,r=>{if(r.value.stores===null)return console.warn("[TalkJS] Received a 'message.created' event for a nonexistent conversation."),r;if(r.value.windowEnd&&t.state.createdAt<r.value.windowEnd.oldestMessageTs||Object.hasOwnProperty.call(r.value.stores,t.state.id))return r;const i=Se({},r.value.stores),o=new ho(e,this.conversationId,t.state,this.realtimeClient);i[t.state.id]=o;const s=t.state.referencedMessageId;let a;s===null?a=null:s in i?a=i[s]:(a=new ho(e,this.conversationId,s,this.realtimeClient),i[s]=a);const l=new Ap(e,t.state.createdAt,o,a),u=[...r.value.inWindow,l];u.sort((d,h)=>h.createdAt-d.createdAt);const c=u[0].messageId===t.messageId?e:r.value.lastMessageChanged;return K({lastChanged:e,lastMessageChanged:c,stores:i,inWindow:u,windowEnd:r.value.windowEnd})})}messageEdited(e,t){this.mutate(e,r=>{var i;return r.value.stores===null?(console.warn("[TalkJS] Received a 'message.edited' event for a nonexistent conversation."),r):((i=r.value.stores[t.messageId])==null||i.messageEdited(e,t),r)})}messageDeleted(e,t){this.mutate(e,r=>{if(r.value.stores===null)return console.warn("[TalkJS] Received a 'message.deleted' event for a conversation that we thought didn't exist."),r;if(Object.values(r.value.stores).forEach(a=>a.messageDeleted(e,t)),r.value.stores[t.messageId]===void 0)return r;const i=Se({},r.value.stores);delete i[t.messageId];const o=r.value.inWindow.filter(a=>a.messageId!==t.messageId);if(t.newLastMessage&&o.length===0){const a=new ho(e,this.conversationId,t.newLastMessage,this.realtimeClient);i[a.messageId]=a;const l=t.newLastMessage.referencedMessageId;let u;l===null?u=null:l in i?u=i[l]:(u=new ho(e,this.conversationId,l,this.realtimeClient),i[l]=u);const c=new Ap(e,t.newLastMessage.createdAt,a,u);o.push(c)}const s=t.newLastMessage!==void 0?e:r.value.lastMessageChanged;return K({lastChanged:e,lastMessageChanged:s,stores:i,inWindow:o,windowEnd:r.value.windowEnd})})}conversationCleared(e,t){this.mutate(e,r=>{var i;return((i=r.value.inWindow)==null?void 0:i.length)===0&&r.value.windowEnd===null?r:(this.teardownNested(r.value),K({lastChanged:e,lastMessageChanged:e,stores:{},inWindow:[],windowEnd:null}))})}sideCreated(e,t){const r=this.fetchInitial(e);this.mutate(e,i=>i.value.stores!==null?(r.then(o=>{o.ok&&this.teardownNested(o.value)}),i):r)}sideDeleted(e,t){this.mutate(e,r=>r.value.stores===null?r:(this.teardownNested(r.value),K({lastChanged:e,lastMessageChanged:e,stores:null,inWindow:null,windowEnd:null})))}getMessageFromCache(e){return H(this,null,function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok||t.value.stores===null)return je("NOT_IN_CACHE");const r=t.value.stores[e];return r===void 0?je("NOT_IN_CACHE"):r.getFromCache()})}}function vO(n){return H(this,arguments,function*({cursor:e,realtimeClient:t,conversationId:r,count:i}){const o={limit:i,cursor:e},s=yield t.call("GET",["me","conversations",r,"messages"],o,{bypassCache:!0});if(s.ok){const{data:a,cursor:l}=s.value.data;return K({messages:a,nextCursor:l})}return!s.ok&&s.where==="server"&&s.value.status===404||!s.ok&&s.where==="server"&&s.value.status===403&&s.value.errorCode==="NOT_A_PARTICIPANT"?K({messages:null,nextCursor:null}):s})}function AO({seq:n,prevState:e,messages:t,cursor:r,conversationId:i,realtimeClient:o}){var s,a,l,u;const c=e?Se({},e.stores):{};for(const p of t)if(c[p.id]===void 0){const f=new ho(n,i,p,o);c[f.messageId]=f}for(const p of t){const f=p.referencedMessageId;if(f&&c[f]===void 0){const m=new ho(n,i,f,o);c[m.messageId]=m}}const d=e?[...e.inWindow]:[];for(const p of t)d.push(new Ap(n,p.createdAt,c[p.id],p.referencedMessageId?c[p.referencedMessageId]:null));d.sort((p,f)=>f.createdAt-p.createdAt);const h=((a=(s=e?.inWindow)==null?void 0:s[0])==null?void 0:a.messageId)===((l=d?.[0])==null?void 0:l.messageId)&&(u=e?.lastMessageChanged)!=null?u:n;return K(r===null?{lastChanged:n,lastMessageChanged:h,stores:c,inWindow:d,windowEnd:null}:{lastChanged:n,lastMessageChanged:h,stores:c,inWindow:d,windowEnd:{cursor:r,oldestMessageTs:t[t.length-1].createdAt}})}class WD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.convDataStore=t,this.realtimeClient=r,this.unsubscribeDebounceMs=0}fetchInitial(e){return H(this,null,function*(){return K({lastChanged:e,store:this.convDataStore})})}teardownNested(e){e.store.unsubscribe()}anyChildChanged(e,t,r){return H(this,null,function*(){return r.store.store.changedBetween(e,t)})}equal(e,t){return!0}loadNested(e,t){return H(this,null,function*(){return t.store.store.getDeep(e)})}getFromCache(){return H(this,null,function*(){return this.convDataStore.store.getFromCache()})}}function _p(n,e){for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(n[t],t)}function yp(n,e){return function(t){let r={};return _p(t,(i,o)=>{const[s,a]=(([l,u])=>[l,e(u,l)])([o,i],0);r[s]=a}),r}(n)}class GD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.conversationId=t,this.realtimeClient=r,this.unsubscribeDebounceMs=1e4}fetchInitial(e){return H(this,null,function*(){const t=yield this.realtimeClient.call("GET",["me","conversations",this.conversationId,"typing"],{},{bypassCache:!0});if(!t.ok&&t.where==="server"&&t.value.status===404)return K({data:null,lastChanged:e});if(!t.ok&&t.where==="server"&&t.value.status===403&&t.value.errorCode==="NOT_A_PARTICIPANT")return K({data:null,lastChanged:e});if(!t.ok)return t;const r=t.value.data;return r.many?K({data:{usersTyping:null,many:!0},userSubscriptions:{},lastChanged:e}):K({data:r,userSubscriptions:yp(r.usersTyping,(i,o)=>this.realtimeClient.internalSubscribe(["users",o])),lastChanged:e})})}equal(e,t){return yt(e.data,t.data)}loadNested(e,t){return H(this,null,function*(){if(t.data===null)return K({snapshot:null,lastChanged:t.lastChanged});if(t.data.many)return K({snapshot:{many:!0},lastChanged:t.lastChanged});const r=Object.entries(t.data.usersTyping).sort(([u,c],[d,h])=>c-h).map(([u,c])=>u).map(u=>t.userSubscriptions[u].store.getDeep(e)),i=yield Promise.all(r),o=i.find(u=>!u.ok);if(o)return o;const s=i.map(u=>u.value),a=s.map(u=>u.snapshot),l=s.map(u=>u.lastChanged);return K({snapshot:{users:a,many:!1},lastChanged:Math.max(t.lastChanged,...l)})})}typingAvailable(e,t){this.mutate(e,()=>K({data:t.state,userSubscriptions:t.state.many?{}:yp(t.state.usersTyping,(r,i)=>this.realtimeClient.internalSubscribe(["users",i])),lastChanged:e}))}typingChanged(e,t){this.mutate(e,r=>{if(r.value.data===null)return r;if(t.diff.many===void 0){if(r.value.data.many===!0)return r;const i=Se({},r.value.data.usersTyping),o=Se({},r.value.userSubscriptions);return _p(t.diff.usersTyping,(s,a)=>{var l;typeof s=="number"?(i[a]=s,o[a]=this.realtimeClient.internalSubscribe(["users",a])):s===null&&(delete i[a],(l=o[a])==null||l.unsubscribe(),delete o[a])}),K({data:{usersTyping:i,many:!1},userSubscriptions:o,lastChanged:e})}if(t.diff.many===!0)return r.value.data.many?r:K({data:{usersTyping:null,many:!0},userSubscriptions:{},lastChanged:e});if(t.diff.many===!1){if(r.value.data.many===!1)return r;const i=yp(t.diff.usersTyping,(o,s)=>this.realtimeClient.internalSubscribe(["users",s]));return K({data:t.diff,userSubscriptions:i,lastChanged:e})}throw t.diff,"Unreachable"})}sideDeleted(e,t){this.mutate(e,r=>r.value.data===null?r:K({data:null,lastChanged:e}))}teardownNested(e){e.data&&_p(e.userSubscriptions,t=>t.unsubscribe())}anyChildChanged(e,t,r){return H(this,null,function*(){var i;if(r.data===null)return!1;for(const o in r.userSubscriptions){const s=r.userSubscriptions[o];if((yield(i=s?.store)==null?void 0:i.changedBetween(e,t))===!0)return!0}return!1})}}class _O extends au{constructor(e,t,r,i){super(e),this.conversationId=t,this.participantData=r,this.realtimeClient=i}fetchInitial(e){return H(this,null,function*(){return K({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 r,i,o,s;return((i=(r=e.user)==null?void 0:r.store)==null?void 0:i.userId)===((s=(o=t.user)==null?void 0:o.store)==null?void 0:s.userId)&&yt(e.data,t.data)}teardownNested(e){var t;(t=e.user)==null||t.unsubscribe()}anyChildChanged(e,t,r){return H(this,null,function*(){var i;const o=(i=r.user)==null?void 0:i.store;return(yield o?.changedBetween(e,t))===!0})}loadNested(e,t){return H(this,null,function*(){if(t.data===null)return K({snapshot:null});const r=yield t.user.store.getDeep(e);if(r.ok===!1)return r;const i=r.value.snapshot;return K({snapshot:this.realtimeClient.createParticipantSnapshotPreloaded(t.data,i)})})}participantEdited(e,t){this.mutate(e,r=>r.value.data===null?r:K({lastChanged:e,user:r.value.user,data:{id:r.value.data.id,access:Ye(r.value.data.access,t.diff.access),notify:Ye(r.value.data.notify,t.diff.notify),joinedAt:r.value.data.joinedAt}}))}participantDeleted(e,t){this.mutate(e,r=>r.value.data===null?r:(this.teardownNested(r.value),K({lastChanged:e,user:null,data:null})))}getFromCache(){return H(this,null,function*(){const e=yield this.mostRecentState.resultPromise;return e.ok?e.value.data===null?ii({status:404,errorCode:"PARTICIPANT_NOT_FOUND",reasons:["No participant with that ID exists"]}):K({status:200,data:e.value.data}):je("NOT_IN_CACHE")})}}class XD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.conversationId=t,this.realtimeClient=r,this.unsubscribeDebounceMs=1e3,this.pendingLoadMore=void 0}fetchInitial(e){return H(this,null,function*(){const t=yield yO({realtimeClient:this.realtimeClient,conversationId:this.conversationId,count:10});return t.ok?t.value.participants===null?K({lastChanged:e,stores:null,inWindow:null,windowEnd:null}):OO({seq:e,participants:t.value.participants,cursor:t.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):t})}teardownNested(e){if(e.stores){const t=je("TERMINATED");Object.values(e.stores).forEach(r=>r.setError(t))}}anyChildChanged(e,t,r){return H(this,null,function*(){for(const i in r.stores){const o=r.stores[i];if((yield o?.changedBetween(e,t))===!0)return!0}return!1})}equal(e,t){return e.stores===null&&t.stores===null||e.stores!==null&&t.stores!==null&&!!yt(Object.keys(e.stores),Object.keys(t.stores))&&yt(e.windowEnd,t.windowEnd)}loadNested(e,t){return H(this,null,function*(){if(t.stores===null)return K({snapshot:null,loadedAll:!0});const r=yield Promise.all(Object.values(t.stores).map(s=>s.getDeep(e))),i=r.find(s=>!s.ok);if(i)return i;const o=r.filter(s=>s.value.snapshot!==null).map(s=>s.value.snapshot);return o.sort((s,a)=>a.joinedAt-s.joinedAt),K({snapshot:o,loadedAll:t.windowEnd===null})})}loadMore(e){return H(this,null,function*(){if(this.pendingLoadMore)return this.pendingLoadMore;const t=ri();this.pendingLoadMore=t.promise,yield this._loadMoreParticipants(e),t.resolve(),this.pendingLoadMore=void 0})}_loadMoreParticipants(e=10){return H(this,null,function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok||t.value.windowEnd===null)return;const r=t.value.windowEnd.cursor,i=yield yO({count:e,cursor:r,conversationId:this.conversationId,realtimeClient:this.realtimeClient}),o=this.getLoadMoreSeq();this.mutate(o,s=>s.value.windowEnd===null||r!==s.value.windowEnd.cursor?s:i.ok?i.value.participants===null?(console.warn("[TalkJS] When loading more participants, the conversation no longer existed. We should have been told about this."),s):OO({seq:o,prevStores:s.value.stores,participants:i.value.participants,cursor:i.value.nextCursor,conversationId:this.conversationId,realtimeClient:this.realtimeClient}):i),yield this.emitMutex.runExclusive(()=>this.emit(o))})}participantCreated(e,t){this.mutate(e,r=>{if(r.value.stores===null)return console.warn("[TalkJS] Received a 'participant.created' event for a nonexistent conversation."),r;if(r.value.windowEnd&&t.state.joinedAt<r.value.windowEnd.oldestParticipantTs||Object.hasOwnProperty.call(r.value.stores,t.state.id))return r;const i=Se({},r.value.stores),o=new _O(e,this.conversationId,t.state,this.realtimeClient);return i[t.state.id]=o,K({lastChanged:e,stores:i,windowEnd:r.value.windowEnd})})}participantEdited(e,t){this.mutate(e,r=>{var i;return r.value.stores===null?(console.warn("[TalkJS] Received a 'participant.edited' event for a nonexistent conversation."),r):((i=r.value.stores[t.userId])==null||i.participantEdited(e,t),r)})}participantDeleted(e,t){this.mutate(e,r=>{if(r.value.stores===null)return console.warn("[TalkJS] Received a 'participant.deleted' event for a conversation that we thought didn't exist."),r;const i=r.value.stores[t.userId];if(i===void 0)return r;i.participantDeleted(e,t);const o=Se({},r.value.stores);return delete o[t.userId],K({lastChanged:e,stores:o,windowEnd:r.value.windowEnd})})}sideCreated(e,t){const r=this.fetchInitial(e);this.mutate(e,i=>i.value.stores!==null?(r.then(o=>{o.ok&&this.teardownNested(o.value)}),i):r)}sideDeleted(e,t){this.mutate(e,r=>r.value.stores===null?r:(this.teardownNested(r.value),K({lastChanged:e,stores:null,inWindow:null,windowEnd:null})))}getParticipantFromCache(e){return H(this,null,function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok||t.value.stores===null)return je("NOT_IN_CACHE");const r=t.value.stores[e];return r===void 0?je("NOT_IN_CACHE"):r.getFromCache()})}}function yO(n){return H(this,arguments,function*({cursor:e,realtimeClient:t,conversationId:r,count:i}){const o={limit:i,cursor:e},s=yield t.call("GET",["me","conversations",r,"participants"],o,{bypassCache:!0});if(s.ok){const{data:a,cursor:l}=s.value.data;return K({participants:a,nextCursor:l})}return!s.ok&&s.where==="server"&&s.value.status===404||!s.ok&&s.where==="server"&&s.value.status===403&&s.value.errorCode==="NOT_A_PARTICIPANT"?K({participants:null,nextCursor:null}):s})}function OO({seq:n,prevStores:e,participants:t,cursor:r,conversationId:i,realtimeClient:o}){const s=e?Se({},e):{};for(const a of t)if(s[a.id]===void 0){const l=new _O(n,i,a,o);s[a.id]=l}return K(r===null?{lastChanged:n,stores:s,windowEnd:null}:{lastChanged:n,stores:s,windowEnd:{cursor:r,oldestParticipantTs:t[t.length-1].joinedAt}})}class KD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.getConvDataStore=t,this.realtimeClient=r,this.unsubscribeDebounceMs=1e3,this.pendingLoadMore=void 0}fetchInitial(e){return H(this,null,function*(){const t=yield TO({realtimeClient:this.realtimeClient,count:20});return t.ok?t.value.conversations===null?K({lastChanged:e,stores:null,windowEnd:null}):SO({seq:e,conversations:t.value.conversations,cursor:t.value.nextCursor,getConvDataStore:this.getConvDataStore}):t})}teardownNested(e){e.stores!==null&&Object.values(e.stores).forEach(t=>t.unsubscribe())}anyChildChanged(e,t,r){return H(this,null,function*(){var i;for(const o in r.stores){const s=r.stores[o];if((yield(i=s?.store)==null?void 0:i.changedBetween(e,t))===!0)return!0}return!1})}equal(e,t){return e.stores===null&&t.stores===null||e.stores!==null&&t.stores!==null&&!!yt(Object.keys(e.stores),Object.keys(t.stores))&&yt(e.windowEnd,t.windowEnd)}loadNested(e,t){return H(this,null,function*(){if(t.stores===null)return K({snapshot:[],loadedAll:!0});const r=yield Promise.all(Object.values(t.stores).map(s=>s.store.getDeep(e))),i=r.find(s=>!s.ok);if(i)return i;const o=r.filter(s=>s.value.snapshot!==null).map(s=>s.value.snapshot);return o.sort((s,a)=>{var l,u,c,d;const h=(u=(l=s.lastMessage)==null?void 0:l.createdAt)!=null?u:s.joinedAt;return((d=(c=a.lastMessage)==null?void 0:c.createdAt)!=null?d:a.joinedAt)-h}),K({snapshot:o,loadedAll:t.windowEnd===null})})}loadMore(e){return H(this,null,function*(){if(this.pendingLoadMore)return this.pendingLoadMore;const t=ri();this.pendingLoadMore=t.promise,yield this._loadMoreConversations(e),t.resolve(),this.pendingLoadMore=void 0})}_loadMoreConversations(e=20){return H(this,null,function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok||t.value.windowEnd===null)return;const r=t.value.windowEnd.cursor,i=yield TO({count:e,cursor:r,realtimeClient:this.realtimeClient}),o=this.getLoadMoreSeq();this.mutate(o,s=>s.value.windowEnd===null||r!==s.value.windowEnd.cursor?s:i.ok?i.value.conversations===null?(console.warn("[TalkJS] When loading more conversations, the user stopped existing, which should be impossible."),s):SO({seq:o,prevStores:s.value.stores,conversations:i.value.conversations,cursor:i.value.nextCursor,getConvDataStore:this.getConvDataStore}):i),yield this.emitMutex.runExclusive(()=>this.emit(o))})}getConvFromCache(e){return H(this,null,function*(){const t=yield this.mostRecentState.resultPromise;if(!t.ok)return je("NOT_IN_CACHE");if(t.value.stores===null)return ii({status:404,errorCode:"USER_NOT_FOUND",reasons:["No user with that ID exists"]});const r=t.value.stores[e];return r===void 0?je("NOT_IN_CACHE"):r.store.getFromCache()})}userCreated(e,t){this.mutate(e,r=>r.value.stores!==null?r:K({lastChanged:r.value.lastChanged,stores:{},windowEnd:null}))}sideCreated(e,t){const r=this.getConvDataStore(t.state);this.mutate(e,i=>Object.hasOwnProperty.call(i.value.stores,t.conversationId)?(r.unsubscribe(),i):K({lastChanged:e,stores:mn(Se({},i.value.stores),{[t.conversationId]:r}),windowEnd:i.value.windowEnd}))}sideDeleted(e,t){this.mutate(e,r=>{var i;if(!Object.hasOwnProperty.call(r.value.stores,t.conversationId))return r;const o=Se({},r.value.stores);return(i=o[t.conversationId])==null||i.unsubscribe(),delete o[t.conversationId],K({lastChanged:e,stores:o,windowEnd:r.value.windowEnd})})}sideEdited(e,t){const r=t.diff.lastMessageAt;r!==void 0&&this.mutate(e,i=>{var o;if(i.value.stores===null)return console.warn("[TalkJS] Received a 'side.edited' event when we thought your user didn't exist."),i;if(i.value.windowEnd===null)return i;const s=Object.hasOwnProperty.call(i.value.stores,t.conversationId);if(s&&r<i.value.windowEnd.oldestMessageTs){const a=Se({},i.value.stores);return(o=a[t.conversationId])==null||o.unsubscribe(),delete a[t.conversationId],K({lastChanged:e,stores:a,windowEnd:i.value.windowEnd})}if(!s&&r>=i.value.windowEnd.oldestMessageTs){const a=this.getConvDataStore(t.conversationId);return K({lastChanged:e,stores:mn(Se({},i.value.stores),{[t.conversationId]:a}),windowEnd:i.value.windowEnd})}return i})}}function TO(n){return H(this,arguments,function*({cursor:e,realtimeClient:t,count:r}){const i={limit:r,cursor:e},o=yield t.call("GET",["me","conversations"],i,{bypassCache:!0});if(o.ok){const{data:s,cursor:a}=o.value.data;return K({conversations:s,nextCursor:a})}return o.ok||o.where!=="server"||o.value.status!==404||o.value.errorCode!=="USER_NOT_FOUND"?o:K({conversations:null,nextCursor:null})})}function SO({seq:n,prevStores:e,conversations:t,cursor:r,getConvDataStore:i}){const o=e?Se({},e):{};for(const s of t)o[s.id]===void 0&&(o[s.id]=i(s));return K(r===null?{lastChanged:n,stores:o,windowEnd:null}:{lastChanged:n,stores:o,windowEnd:{cursor:r,oldestMessageTs:Math.min(...t.map(s=>s.lastMessageAt))}})}class qD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.conversation=t,this.realtimeClient=r,this.unsubscribeDebounceMs=5e3}get conversationId(){return typeof this.conversation=="string"?this.conversation:this.conversation.id}fetchInitial(e){return H(this,null,function*(){const t=this.realtimeClient.internalSubscribe(["me","conversations",this.conversationId,"messages"]);if(typeof this.conversation=="object")return K({lastChanged:e,snapshot:this.conversation,messageWindowStore:t});const r=yield this.realtimeClient.call("GET",["me","conversations",this.conversationId],{},{bypassCache:!0});let i;if(r.ok)i=r.value.data;else if(r.where==="server"&&r.value.status===404)i=null;else{if(r.where!=="server"||r.value.status!==403||r.value.errorCode!=="NOT_A_PARTICIPANT")return t.unsubscribe(),r;i=null}return K({lastChanged:e,snapshot:i,messageWindowStore:t})})}teardownNested(e){var t;(t=e.messageWindowStore)==null||t.unsubscribe()}anyChildChanged(e,t,r){return H(this,null,function*(){return(yield r.messageWindowStore.store.lastMessageChangedBetween(e,t))===!0})}equal(e,t){return yt(e.snapshot,t.snapshot)}loadNested(e,t){return H(this,null,function*(){var r;if(!t.snapshot)return K({snapshot:null,loadedAll:!0});const i=yield t.messageWindowStore.store.getDeep(e);if(!i.ok)return i;const o=i.value.snapshot,s=(r=o?.[0])!=null?r:null;return K({snapshot:mn(Se({},t.snapshot),{lastMessage:s})})})}participantEdited(e,t){this.mutate(e,r=>r.value.snapshot===null?(console.warn("[TalkJS] Received a 'participant.edited' event for a conversation that we thought didn't exist."),r):K({lastChanged:e,snapshot:Op(r.value.snapshot,t.diff),messageWindowStore:r.value.messageWindowStore}))}conversationEdited(e,t){this.mutate(e,r=>r.value.snapshot===null?(console.warn("[TalkJS] Received a 'conversation.edited' event for a conversation that we thought didn't exist."),r):K({lastChanged:e,snapshot:Op(r.value.snapshot,t.diff),messageWindowStore:r.value.messageWindowStore}))}sideEdited(e,t){this.mutate(e,r=>r.value.snapshot===null?(console.warn("[TalkJS] Received a 'side.edited' event for a conversation that we thought didn't exist."),r):K({lastChanged:e,snapshot:Op(r.value.snapshot,t.diff),messageWindowStore:r.value.messageWindowStore}))}sideCreated(e,t){this.mutate(e,r=>r.value.snapshot?r:K({lastChanged:e,snapshot:t.state,messageWindowStore:r.value.messageWindowStore}))}sideDeleted(e,t){this.mutate(e,r=>r.value.snapshot===null?r:K({lastChanged:e,snapshot:null,messageWindowStore:r.value.messageWindowStore}))}getFromCache(){return H(this,null,function*(){const e=yield this.mostRecentState.resultPromise;return e.ok&&e.value.snapshot?K({status:200,data:e.value.snapshot}):je("NOT_IN_CACHE")})}}function Op(n,e){const t=e;return{id:n.id,createdAt:n.createdAt,subject:Ye(n.subject,t.subject),photoUrl:Ye(n.photoUrl,t.photoUrl),welcomeMessages:Ye(n.welcomeMessages,t.welcomeMessages),custom:fp(n.custom,t.custom),lastMessageAt:Ye(n.lastMessageAt,t.lastMessageAt),unreadMessageCount:Ye(n.unreadMessageCount,t.unreadMessageCount),isUnread:Ye(n.isUnread,t.isUnread),access:Ye(n.access,t.access),notify:Ye(n.notify,t.notify),readUntil:Ye(n.readUntil,t.readUntil),everyoneReadUntil:Ye(n.everyoneReadUntil,t.everyoneReadUntil),joinedAt:n.joinedAt}}class JD extends Or{constructor(e,t,r,i,o){super(e,i,o),this.userId=t,this.realtimeClient=r,this.unsubscribeDebounceMs=1e3}fetchInitial(e){return H(this,null,function*(){const t=this.realtimeClient.internalSubscribe(["users",this.userId]),r=yield this.realtimeClient.call("GET",["users",this.userId,"online"],{},{bypassCache:!0});return r.ok||r.where!=="server"||r.value.status!==404||r.value.errorCode!=="USER_NOT_FOUND"?r.ok?K({lastChanged:e,user:t,data:r.value.data}):r:K({lastChanged:e,user:t,data:null})})}equal(e,t){return yt(e.data,t.data)}teardownNested(e){e.user.unsubscribe()}anyChildChanged(e,t,r){return H(this,null,function*(){return r.user.store.changedBetween(e,t)})}loadNested(e,t){return H(this,null,function*(){const r=yield t.user.store.getDeep(e);if(!r.ok)return r;const i=r.value.snapshot;return t.data===null||i===null?K({snapshot:null}):K({snapshot:Se({user:i},t.data)})})}userCreated(e,t){const r=this.fetchInitial(e);this.mutate(e,i=>i.value.data!==null?(r.then(o=>{o.ok&&this.teardownNested(o.value)}),i):r)}userOnlineChanged(e,t){this.mutate(e,r=>r.value.data===null?r:K({lastChanged:e,user:r.value.user,data:t.diff}))}getFromCache(){return H(this,null,function*(){const e=yield this.mostRecentState.resultPromise;if(!e.ok)return je("NOT_IN_CACHE");if(e.value.data===null)return ii({status:404,errorCode:"USER_NOT_FOUND",reasons:["No user with that ID exists"]});const t=e.value,r=cO(t,["user"]);return K({status:200,data:Se({},r.data)})})}}class ZD{constructor(e,t,r){this.realtimeClient=r,this.convDataStores={},this.storeMap={},this.emitMutex=new fO,this.seqOffset=0,this.seqInThisConnection=0,this.refetchOnNextNetworkLoss=!0,this.connection=new BD(e,t,{onUpstreamRestarting:()=>{this.refetchOnNextNetworkLoss=!1},onReady:()=>{this.refetchOnNextNetworkLoss=!0},onResubscribeSent:()=>{if(this.seqOffset+=this.seq,this.seqInThisConnection=0,this.refetchOnNextNetworkLoss){this.seqOffset++;const i=this.seq;this.refetchAll(i),this.emitAll(i)}},onResubscribeError:(i,o)=>{var s;(s=this.storeMap[Tp(i)])==null||s.setError(o)},onPublish:(i,o)=>{this.seqInThisConnection=i;const s=this.seq;for(const a of o)this.handlePublish(s,a);this.emitAll(s)}})}get seq(){return this.seqOffset+this.seqInThisConnection}refetchAll(e){Object.values(this.storeMap).forEach(t=>t?.refetch(e))}emitAll(e){return this.emitMutex.runExclusive(()=>H(this,null,function*(){const t=Object.values(this.storeMap).map(r=>r?.emit(e));yield Promise.all(t)}))}handlePublish(e,t){var r,i,o,s,a,l,u,c,d,h,p,f,m,g,E,v,A,_,y,T,S,b,O,C,w,I,F;switch(t.type){case"user.created":return(r=this.storeMap[`/users/${t.userId}`])==null||r.userCreated(e,t),(i=this.storeMap["/me/conversations"])==null||i.userCreated(e,t),void((o=this.storeMap[`/users/${t.userId}/online`])==null||o.userCreated(e,t));case"user.edited":return void((s=this.storeMap[`/users/${t.userId}`])==null||s.userEdited(e,t));case"side.created":return(a=this.convDataStores[t.conversationId])==null||a.sideCreated(e,t),(l=this.storeMap[`/me/conversations/${t.conversationId}/messages`])==null||l.sideCreated(e,t),(u=this.storeMap[`/me/conversations/${t.conversationId}/participants`])==null||u.sideCreated(e,t),void((c=this.storeMap["/me/conversations"])==null||c.sideCreated(e,t));case"side.edited":return(d=this.convDataStores[t.conversationId])==null||d.sideEdited(e,t),void((h=this.storeMap["/me/conversations"])==null||h.sideEdited(e,t));case"side.deleted":return(p=this.convDataStores[t.conversationId])==null||p.sideDeleted(e,t),(f=this.storeMap[`/me/conversations/${t.conversationId}/messages`])==null||f.sideDeleted(e,t),(m=this.storeMap[`/me/conversations/${t.conversationId}/participants`])==null||m.sideDeleted(e,t),(g=this.storeMap[`/me/conversations/${t.conversationId}/typing`])==null||g.sideDeleted(e,t),void((E=this.storeMap["/me/conversations"])==null||E.sideDeleted(e,t));case"conversation.edited":return void((v=this.convDataStores[t.conversationId])==null||v.conversationEdited(e,t));case"message.created":return void((A=this.storeMap[`/me/conversations/${t.conversationId}/messages`])==null||A.messageCreated(e,t));case"message.edited":return void((_=this.storeMap[`/me/conversations/${t.conversationId}/messages`])==null||_.messageEdited(e,t));case"message.deleted":return void((y=this.storeMap[`/me/conversations/${t.conversationId}/messages`])==null||y.messageDeleted(e,t));case"typing.available":return void((T=this.storeMap[`/me/conversations/${t.conversationId}/typing`])==null||T.typingAvailable(e,t));case"typing.changed":return void((S=this.storeMap[`/me/conversations/${t.conversationId}/typing`])==null||S.typingChanged(e,t));case"conversation.cleared":return void((b=this.storeMap[`/me/conversations/${t.conversationId}/messages`])==null||b.conversationCleared(e,t));case"participant.edited":return(O=this.convDataStores[t.conversationId])==null||O.participantEdited(e,t),void((C=this.storeMap[`/me/conversations/${t.conversationId}/participants`])==null||C.participantEdited(e,t));case"participant.created":return void((w=this.storeMap[`/me/conversations/${t.conversationId}/participants`])==null||w.participantCreated(e,t));case"participant.deleted":return void((I=this.storeMap[`/me/conversations/${t.conversationId}/participants`])==null||I.participantDeleted(e,t));case"user.online.changed":return void((F=this.storeMap[`/users/${t.userId}/online`])==null||F.userOnlineChanged(e,t))}}call(e,t,r,i){return H(this,null,function*(){if(!i.bypassCache&&e==="GET"){const o=Tp(t);if(o in this.storeMap){const s=o,a=this.storeMap[s];if(a&&"getFromCache"in a){const l=yield a.getFromCache();if(l.value!=="NOT_IN_CACHE")return l}}else if(nn(t,["me","conversations","*","messages","*"])){const s=this.storeMap[`/me/conversations/${t[2]}/messages`];if(s){const a=yield s.getMessageFromCache(t[4]);if(a.value!=="NOT_IN_CACHE")return a}}else if(nn(t,["me","conversations","*","participants","*"])){const s=this.storeMap[`/me/conversations/${t[2]}/participants`];if(s){const a=yield s.getParticipantFromCache(t[4]);if(a.value!=="NOT_IN_CACHE")return a}}else if(nn(t,["me","conversations","*"])){const s=this.storeMap["/me/conversations"];if(s){const a=yield s.getConvFromCache(t[2]);if(a.value!=="NOT_IN_CACHE")return a}}}return this.connection.call(e,t,r)})}subscribe(e,t){const r=this.getOrCreateStore(e),i=ri(),o=ri();i.promise.catch(()=>{}),o.promise.catch(()=>{});const s={state:{type:"pending",latestSnapshot:void 0},connected:i.promise,terminated:o.promise,loadMore:l=>H(this,null,function*(){"loadMore"in r&&(yield r.loadMore(l))}),unsubscribe:()=>{}},a=r.listen(l=>{if(l.ok){const u=!("loadedAll"in l.value)||l.value.loadedAll,c={type:"active",latestSnapshot:l.value.snapshot,loadedAll:u};s.state=c,t?.(l.value.snapshot,u),i.resolve(c)}else if(s.state.type==="pending"||s.state.type==="active"){if(l.where==="server"){const u={type:"error",error:new Error(Fs(`Subscribe to ${e.join("/")}`,l.value))};return s.state=u,o.resolve(u),void i.reject("Subscription encountered an error during initial connection")}if(l.value==="SESSION_DESTROYED"){const u={type:"error",error:new Error("Session was destroyed causing all subscriptions to be terminated")};return s.state=u,o.resolve(u),void i.reject("Subscription encountered an error during initial connection")}if(l.value==="UNSUBSCRIBED"||l.value==="TERMINATED")return;l.value}});return s.unsubscribe=()=>{if(s.state.type==="pending"||s.state.type==="active"){a();const l={type:"unsubscribed"};s.state=l,o.resolve(l),i.reject("Subscription was unsubscribed before connecting")}},s}getOrCreateStore(e){const t=Tp(e);if(t in this.storeMap)return this.storeMap[t];this.connection.subscribe(e).then(i=>{i.ok||r.setError(i)});const r=this.instantiateStore(e,()=>{delete this.storeMap[t],this.connection.unsubscribe(e)});return this.storeMap[t]=r,r}destroy(){this.storeMap={},this.convDataStores={},this.connection.destroy()}isConnected(){return this.connection.isConnected()}instantiateStore(e,t){if(nn(e,["users","*"]))return new $D(this.seq,e[1],this.realtimeClient,this.emitMutex,t);if(nn(e,["me","conversations","*"]))return new WD(this.seq,this.subscribeConvData(e[2]),this.realtimeClient,this.emitMutex,t);if(nn(e,["me","conversations","*","messages"]))return new VD(this.seq,e[2],this.realtimeClient,this.emitMutex,t);if(nn(e,["me","conversations","*","participants"]))return new XD(this.seq,e[2],this.realtimeClient,this.emitMutex,t);if(nn(e,["me","conversations","*","typing"]))return new GD(this.seq,e[2],this.realtimeClient,this.emitMutex,t);if(nn(e,["me","conversations"]))return new KD(this.seq,r=>this.subscribeConvData(r),this.realtimeClient,this.emitMutex,t);if(nn(e,["users","*","online"]))return new JD(this.seq,e[1],this.realtimeClient,this.emitMutex,t);throw"Unreachable"}subscribeConvData(e){const t=typeof e=="string"?e:e.id;if(Object.hasOwnProperty.call(this.convDataStores,t)){const i=this.convDataStores[t];return{store:i,unsubscribe:i.registerInternalSubscription()}}const r=new qD(this.seq,e,this.realtimeClient,this.emitMutex,()=>{delete this.convDataStores[t]});return this.convDataStores[t]=r,{store:r,unsubscribe:r.registerInternalSubscription()}}}function Tp(n){return`/${n.join("/")}`}class QD{constructor(e,t,r){this.userId=t,this.alive=!0,this.connection=new ZD(e,r,this),r.onTokenRefreshFailed(()=>{this.destroy()})}call(e,t,r){return H(this,arguments,function*(i,o,s,a={}){return this.alive?this.connection.call(i,o,s,a):je("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 H(this,null,function*(){const r=yield this.call("GET",["me","conversations",e,"messages"],t);if(!r.ok)return Sp(r,"Listing messages in "+e);const i=r.value.data.data,o=yield Promise.all(i.map(a=>this.createMessageSnapshot(a,e))),s=o.find(a=>!a.ok);return s===void 0||s.ok?K(o.map(({value:a})=>a)):s})}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 H(this,null,function*(){const r=e.senderId===null?Promise.resolve(K(null)):this.getUser(e.senderId),i=e.referencedMessageId===null?Promise.resolve(K(null)):this.getReferencedMessage(t,e.referencedMessageId),o=yield r;if(!o.ok)return o;const s=yield i;return s.ok?K(this.createMessageSnapshotPreloaded(e,o.value,s.value)):s})}getReferencedMessage(e,t){return H(this,null,function*(){const r=yield this.call("GET",["me","conversations",e,"messages",t],{});if(!r.ok&&r.where==="server"&&r.value.status===404||!r.ok&&r.where==="server"&&r.value.status===403&&r.value.errorCode==="NOT_A_PARTICIPANT")return K(null);if(!r.ok)return Sp(r,`Fetching referenced message ${t} in conversation ${e}`);const i=r.value.data,o=yield this.getUser(i.senderId);if(!o.ok)return o;const s=o.value;return K(this.createReferencedMessageSnapshotPreloaded(i,s))})}getUser(e){return H(this,null,function*(){const t=yield this.call("GET",["users",e],{includePrivateFields:!1});return t.ok||t.where!=="server"||t.value.status!==404?t.ok?K(this.createUserSnapshot(t.value.data)):Sp(t,"Get user "+e):K(null)})}createMessageSnapshotPreloaded(e,t,r){return{id:e.id,type:e.type,sender:t,referencedMessage:r,custom:e.custom,createdAt:e.createdAt,editedAt:e.editedAt,origin:e.origin,content:e.content,reactions:vp(e.reactions),plaintext:cu(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:vp(e.reactions),plaintext:cu(e.content,{})}}}function Sp(n,e){return n.where==="server"?ii(mn(Se({},n.value),{operation:e})):n}function bp(n,e){var t;if(e.ok)return e.value;throw e.value==="SESSION_DESTROYED"?new Error(`${n} failed because the session was destroyed`):new Error(Fs((t=e.value.operation)!=null?t:n,e.value))}class bO{constructor(e,t){this.id=e,this._realtimeClient=t}get brandedId(){return this.id}get(){return H(this,null,function*(){const e=yield this._realtimeClient.getUser(this.brandedId);return bp("Get user "+this.id,e)})}set(e){return H(this,null,function*(){e.role===null&&(e.role="default");const t=typeof e.email=="string"?[e.email]:e.email,r=typeof e.phone=="string"?[e.phone]:e.phone,i=yield this._realtimeClient.call("PUT",["users",this.brandedId],mn(Se({},e),{email:t,phone:r}));Be("Set user "+this.id,i)})}createIfNotExists(e){return H(this,null,function*(){e.role===void 0&&(e.role="default");const t=typeof e.email=="string"?[e.email]:e.email,r=typeof e.phone=="string"?[e.phone]:e.phone,i=yield this._realtimeClient.call("POST",["users",this.brandedId],mn(Se({},e),{email:t,phone:r}));(i.ok||i.where!=="server"||i.value.status!=409)&&Be(`Create user ${this.id} if not exists`,i)})}subscribe(e){return this._realtimeClient.subscribe(["users",this.brandedId],e)}subscribeOnline(e){return this._realtimeClient.subscribe(["users",this.brandedId,"online"],e)}}class NO{constructor(e,t,r){this.userId=e,this.conversationId=t,this._realtimeClient=r}get brandedUserId(){return this.userId}get brandedConversationId(){return this.conversationId}get(){return H(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}),[r,i]=yield Promise.all([e,t]);if(!r.ok&&r.where==="server"&&r.value.status===404||!i.ok&&i.where==="server"&&i.value.status===404)return null;const o=Be(`Get participant ${this.userId} in conversation ${this.conversationId}`,r),s=Be(`Get user ${this.userId}`,i),a=this._realtimeClient.createUserSnapshot(s);return this._realtimeClient.createParticipantSnapshotPreloaded(o,a)})}set(){return H(this,arguments,function*(e={}){const t=yield this._realtimeClient.call("PUT",["conversations",this.brandedConversationId,"participants",this.brandedUserId],e);Be(`Set participant ${this.userId} in conversation ${this.conversationId}`,t)})}edit(){return H(this,arguments,function*(e={}){const t=yield this._realtimeClient.call("PATCH",["conversations",this.brandedConversationId,"participants",this.brandedUserId],e);Be(`Edit participant ${this.userId} in conversation ${this.conversationId}`,t)})}createIfNotExists(){return H(this,arguments,function*(e={}){const t=yield this._realtimeClient.call("POST",["conversations",this.brandedConversationId,"participants",this.brandedUserId],e);(t.ok||t.where!=="server"||t.value.status!==409)&&Be(`Add participant ${this.userId} to conversation ${this.conversationId}`,t)})}delete(){return H(this,null,function*(){const e=yield this._realtimeClient.call("DELETE",["conversations",this.brandedConversationId,"participants",this.brandedUserId],{});(e.ok||e.where!=="server"||e.value.status!==404)&&Be(`Remove participant ${this.userId} from conversation ${this.conversationId}`,e)})}}function ek(n){const e="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz";let t=0;const r=[],i=n===t;t=n;const o=new Array(8);for(let a=7;a>=0;a--)o[a]=e.charAt(n%64),n=Math.floor(n/64);if(n!==0)throw new Error("We should have converted the entire timestamp.");let s=o.join("");if(i){let a;for(a=11;a>=0&&r[a]===63;a--)r[a]=0;r[a]++}else for(let a=0;a<12;a++)r[a]=Math.floor(64*Math.random());for(let a=0;a<12;a++)s+=e.charAt(r[a]);if(s.length!=20)throw new Error("Length should be 20.");return s}const Hs=(n,e,t=void 0)=>n.reduce((r,i,o)=>r.concat((s=>{if(typeof s=="string")return e(s,t);switch(s.type){case"bold":case"italic":case"strikethrough":case"blockquote":case"bulletlist":case"bulletList":case"bulletpoint":case"bulletPoint":return[{type:s.type,children:Hs(s.children,e,s.type)}];case"link":return[{type:s.type,url:s.url,children:Hs(s.children,e,s.type)}];case"actionlink":case"actionLink":case"actionbutton":case"actionButton":return[{type:s.type,action:s.action,params:s.params,children:Hs(s.children,e,s.type)}];case"mention":case"autolink":case"autoLink":case"codeblock":case"codeBlock":case"codespan":case"codeSpan":case"suppressed":case"emoji":case"customemoji":case"customEmoji":return[s]}})(i)),[]);function Jn(n,e){return t=>{const r=t;let i=0;const o=[];for(const s of gO(t,n)){s.index-i>0&&o.push(r.substring(i,s.index));const a=e(s);Array.isArray(a)?o.push(...a):o.push(a),i=s.index+s[0].length}return i<t.length&&o.push(t.substring(i)),o}}const CO="’'()[]{}<>:,‒–—―…!.«»-‐?‘’“”;/⁄␠·&@*\\•^¤¢$€£¥₩₪†‡°¡¿¬#№%‰‱¶′§~¨_|¦⁂☞∴‽※".replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var oi,Np=((oi=Np||{})[oi.italic=1]="italic",oi[oi.strikethrough=2]="strikethrough",oi[oi.bold=4]="bold",oi);const tk=[0,1,2,3,4,5,6].map(n=>{const e=[];return 1&n||e.push(/_([^\s_].*?[^\s_])_|_([^\s_])_/),2&n||e.push(/~([^\s~].*?[^\s~])~|~([^\s~])~/),4&n||e.push(/\*([^\s*].*?[^\s*])\*|\*([^\s*])\*/),new RegExp(e.map(t=>t.source).join("|"),"g")}),nk={_:1,"*":4,"~":2};function rk(n){return IO(n,0)}function IO(n,e=0){const t=tk[e],r=t?function(i){const o=Jn(ik.getOrCompute(i,()=>new RegExp(`(?:^|[\\s${CO}])(?:${i.source})(?=[\\s${CO}]|$)`,"g")),s=>{const a=s[0][1],l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6];return[" ",{type:Np[nk[a]],children:[l]}]});return s=>{const[a,...l]=o(" "+s);return a.length>1&&l.unshift(a.substring(1)),l}}(t):()=>[n];return Hs(r(n),(i,o)=>o==="bold"||o==="italic"||o==="strikethrough"?IO(i,e|Np[o]):[i])}const ik=function(){const n=function(){try{return new WeakMap}catch{const t={has:()=>!1,get:()=>{},set:()=>t};return t}}();return{getOrCompute(e,t){if(n.has(e))return n.get(e);const r=t();return n.set(e,r),r}}}();function wO(n,e){if(Array.prototype.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function si(n,e){for(var t=n.length-1;t>=0;t--)e(n[t])===!0&&n.splice(t,1)}function RO(n){throw new Error("Unhandled case for value: '"+n+"'")}var Cp=function(){function n(e){e===void 0&&(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 n.prototype.setTagName=function(e){return this.tagName=e,this},n.prototype.getTagName=function(){return this.tagName||""},n.prototype.setAttr=function(e,t){return this.getAttrs()[e]=t,this},n.prototype.getAttr=function(e){return this.getAttrs()[e]},n.prototype.setAttrs=function(e){return Object.assign(this.getAttrs(),e),this},n.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},n.prototype.setClass=function(e){return this.setAttr("class",e)},n.prototype.addClass=function(e){for(var t,r=this.getClass(),i=this.whitespaceRegex,o=r?r.split(i):[],s=e.split(i);t=s.shift();)wO(o,t)===-1&&o.push(t);return this.getAttrs().class=o.join(" "),this},n.prototype.removeClass=function(e){for(var t,r=this.getClass(),i=this.whitespaceRegex,o=r?r.split(i):[],s=e.split(i);o.length&&(t=s.shift());){var a=wO(o,t);a!==-1&&o.splice(a,1)}return this.getAttrs().class=o.join(" "),this},n.prototype.getClass=function(){return this.getAttrs().class||""},n.prototype.hasClass=function(e){return(" "+this.getClass()+" ").indexOf(" "+e+" ")!==-1},n.prototype.setInnerHTML=function(e){return this.innerHTML=e,this},n.prototype.setInnerHtml=function(e){return this.setInnerHTML(e)},n.prototype.getInnerHTML=function(){return this.innerHTML||""},n.prototype.getInnerHtml=function(){return this.getInnerHTML()},n.prototype.toAnchorString=function(){var e=this.getTagName(),t=this.buildAttrsStr();return["<",e,t=t?" "+t:"",">",this.getInnerHtml(),"</",e,">"].join("")},n.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var e=this.getAttrs(),t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r+'="'+e[r]+'"');return t.join(" ")},n}(),DO=function(){function n(e){e===void 0&&(e={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=e.newWindow||!1,this.truncate=e.truncate||{},this.className=e.className||""}return n.prototype.build=function(e){return new Cp({tagName:"a",attrs:this.createAttrs(e),innerHtml:this.processAnchorText(e.getAnchorText())})},n.prototype.createAttrs=function(e){var t={href:e.getAnchorHref()},r=this.createCssClass(e);return r&&(t.class=r),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},n.prototype.createCssClass=function(e){var t=this.className;if(t){for(var r=[t],i=e.getCssClassSuffixes(),o=0,s=i.length;o<s;o++)r.push(t+"-"+i[o]);return r.join(" ")}return""},n.prototype.processAnchorText=function(e){return this.doTruncate(e)},n.prototype.doTruncate=function(e){var t=this.truncate;if(!t||!t.length)return e;var r,i,o,s,a=t.length,l=t.location;return l==="smart"?function(u,c,d){var h,p;d==null?(d="&hellip;",p=3,h=8):(p=d.length,h=d.length);var f=function(w){var I="";return w.scheme&&w.host&&(I+=w.scheme+"://"),w.host&&(I+=w.host),w.path&&(I+="/"+w.path),w.query&&(I+="?"+w.query),w.fragment&&(I+="#"+w.fragment),I},m=function(w,I){var F=I/2,x=Math.ceil(F),$=-1*Math.floor(F),k="";return $<0&&(k=w.substr($)),w.substr(0,x)+d+k};if(u.length<=c)return u;var g,E,v,A=c-p,_=(g={},(v=(E=u).match(/^([a-z]+):\/\//i))&&(g.scheme=v[1],E=E.substr(v[0].length)),(v=E.match(/^(.*?)(?=(\?|#|\/|$))/i))&&(g.host=v[1],E=E.substr(v[0].length)),(v=E.match(/^\/(.*?)(?=(\?|#|$))/i))&&(g.path=v[1],E=E.substr(v[0].length)),(v=E.match(/^\?(.*?)(?=(#|$))/i))&&(g.query=v[1],E=E.substr(v[0].length)),(v=E.match(/^#(.*?)$/i))&&(g.fragment=v[1]),g);if(_.query){var y=_.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);y&&(_.query=_.query.substr(0,y[1].length),u=f(_))}if(u.length<=c||(_.host&&(_.host=_.host.replace(/^www\./,""),u=f(_)),u.length<=c))return u;var T="";if(_.host&&(T+=_.host),T.length>=A)return _.host.length==c?(_.host.substr(0,c-p)+d).substr(0,A+h):m(T,A).substr(0,A+h);var S="";if(_.path&&(S+="/"+_.path),_.query&&(S+="?"+_.query),S){if((T+S).length>=A)return(T+S).length==c?(T+S).substr(0,c):(T+m(S,A-T.length)).substr(0,A+h);T+=S}if(_.fragment){var b="#"+_.fragment;if((T+b).length>=A)return(T+b).length==c?(T+b).substr(0,c):(T+m(b,A-T.length)).substr(0,A+h);T+=b}if(_.scheme&&_.host){var O=_.scheme+"://";if((T+O).length<A)return(O+T).substr(0,c)}if(T.length<=c)return T;var C="";return A>0&&(C=T.substr(-1*Math.floor(A/2))),(T.substr(0,Math.ceil(A/2))+d+C).substr(0,A+h)}(e,a):l==="middle"?function(u,c,d){if(u.length<=c)return u;var h,p;d==null?(d="&hellip;",h=8,p=3):(h=d.length,p=d.length);var f=c-p,m="";return f>0&&(m=u.substr(-1*Math.floor(f/2))),(u.substr(0,Math.ceil(f/2))+d+m).substr(0,f+h)}(e,a):(i=a,o=void 0,(r=e).length>i&&(o==null?(o="&hellip;",s=3):s=o.length,r=r.substring(0,i-s)+o),r)},n}(),po=function(){function n(e){this.__jsduckDummyDocProp=null,this.matchedText="",this.offset=0,this.tagBuilder=e.tagBuilder,this.matchedText=e.matchedText,this.offset=e.offset}return n.prototype.getMatchedText=function(){return this.matchedText},n.prototype.setOffset=function(e){this.offset=e},n.prototype.getOffset=function(){return this.offset},n.prototype.getCssClassSuffixes=function(){return[this.getType()]},n.prototype.buildTag=function(){return this.tagBuilder.build(this)},n}(),kO=function(n,e){return(kO=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])})(n,e)};function kn(n,e){function t(){this.constructor=n}kO(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var LO,Fe=function(){return Fe=Object.assign||function(n){for(var e,t=1,r=arguments.length;t<r;t++)for(var i in e=arguments[t])Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n},Fe.apply(this,arguments)},Ip=function(n){function e(t){var r=n.call(this,t)||this;return r.email="",r.email=t.email,r}return kn(e,n),e.prototype.getType=function(){return"email"},e.prototype.getEmail=function(){return this.email},e.prototype.getAnchorHref=function(){return"mailto:"+this.email},e.prototype.getAnchorText=function(){return this.email},e}(po),xO=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="",r.hashtag="",r.serviceName=t.serviceName,r.hashtag=t.hashtag,r}return kn(e,n),e.prototype.getType=function(){return"hashtag"},e.prototype.getServiceName=function(){return this.serviceName},e.prototype.getHashtag=function(){return this.hashtag},e.prototype.getAnchorHref=function(){var t=this.serviceName,r=this.hashtag;switch(t){case"twitter":return"https://twitter.com/hashtag/"+r;case"facebook":return"https://www.facebook.com/hashtag/"+r;case"instagram":return"https://instagram.com/explore/tags/"+r;default:throw new Error("Unknown service name to point hashtag to: "+t)}},e.prototype.getAnchorText=function(){return"#"+this.hashtag},e}(po),MO=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.mention="",r.mention=t.mention,r.serviceName=t.serviceName,r}return kn(e,n),e.prototype.getType=function(){return"mention"},e.prototype.getMention=function(){return this.mention},e.prototype.getServiceName=function(){return this.serviceName},e.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)}},e.prototype.getAnchorText=function(){return"@"+this.mention},e.prototype.getCssClassSuffixes=function(){var t=n.prototype.getCssClassSuffixes.call(this),r=this.getServiceName();return r&&t.push(r),t},e}(po),PO=function(n){function e(t){var r=n.call(this,t)||this;return r.number="",r.plusSign=!1,r.number=t.number,r.plusSign=t.plusSign,r}return kn(e,n),e.prototype.getType=function(){return"phone"},e.prototype.getPhoneNumber=function(){return this.number},e.prototype.getNumber=function(){return this.getPhoneNumber()},e.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},e.prototype.getAnchorText=function(){return this.matchedText},e}(po),wp=function(n){function e(t){var r=n.call(this,t)||this;return r.url="",r.urlMatchType="scheme",r.protocolUrlMatch=!1,r.protocolRelativeMatch=!1,r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.schemePrefixRegex=/^(https?:\/\/)?/i,r.wwwPrefixRegex=/^(https?:\/\/)?(www\.)?/i,r.protocolRelativeRegex=/^\/\//,r.protocolPrepended=!1,r.urlMatchType=t.urlMatchType,r.url=t.url,r.protocolUrlMatch=t.protocolUrlMatch,r.protocolRelativeMatch=t.protocolRelativeMatch,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return kn(e,n),e.prototype.getType=function(){return"url"},e.prototype.getUrlMatchType=function(){return this.urlMatchType},e.prototype.getUrl=function(){var t=this.url;return this.protocolRelativeMatch||this.protocolUrlMatch||this.protocolPrepended||(t=this.url="http://"+t,this.protocolPrepended=!0),t},e.prototype.getAnchorHref=function(){return this.getUrl().replace(/&amp;/g,"&")},e.prototype.getAnchorText=function(){var t=this.getMatchedText();return this.protocolRelativeMatch&&(t=this.stripProtocolRelativePrefix(t)),this.stripPrefix.scheme&&(t=this.stripSchemePrefix(t)),this.stripPrefix.www&&(t=this.stripWwwPrefix(t)),this.stripTrailingSlash&&(t=this.removeTrailingSlash(t)),this.decodePercentEncoding&&(t=this.removePercentEncoding(t)),t},e.prototype.stripSchemePrefix=function(t){return t.replace(this.schemePrefixRegex,"")},e.prototype.stripWwwPrefix=function(t){return t.replace(this.wwwPrefixRegex,"$1")},e.prototype.stripProtocolRelativePrefix=function(t){return t.replace(this.protocolRelativeRegex,"")},e.prototype.removeTrailingSlash=function(t){return t.charAt(t.length-1)==="/"&&(t=t.slice(0,-1)),t},e.prototype.removePercentEncoding=function(t){var r=t.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(r)}catch{return r}},e}(po),fo=function(n){this.__jsduckDummyDocProp=null,this.tagBuilder=n.tagBuilder},Rp=/[A-Za-z]/,ok=/[\d]/,sk=/[\D]/,ai=/\s/,Dp=/['"]/,ak=/[\x00-\x1F\x7F]/,BO=/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,FO=BO+/\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,hu=/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,lk=FO+hu,ze=FO+hu,uk="(?:["+hu+"]{1,3}\\.){3}["+hu+"]{1,3}",ck="["+ze+"](?:["+ze+"\\-]{0,61}["+ze+"])?",UO=function(n){return"(?=("+ck+"))\\"+n},kp=function(n){return"(?:"+UO(n)+"(?:\\."+UO(n+1)+"){0,126}|"+uk+")"},pu=new RegExp("["+ze+"]"),HO=/(?: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|ελ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|工行|广东|微博|慈善|手机|手表|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|珠宝|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)/,dk=new RegExp("["+ze+"!#$%&'*+/=?^_`{|}~-]"),hk=new RegExp("^"+HO.source+"$"),$O=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.localPartCharRegex=dk,t.strictTldRegex=hk,t}return kn(e,n),e.prototype.parseMatches=function(t){for(var r=this.tagBuilder,i=this.localPartCharRegex,o=this.strictTldRegex,s=[],a=t.length,l=new fu,u={m:"a",a:"i",i:"l",l:"t",t:"o",o:":"},c=0,d=0,h=l;c<a;){var p=t.charAt(c);switch(d){case 0:(f=p)==="m"?T(1):i.test(f)&&T();break;case 1:m(t.charAt(c-1),p);break;case 2:g(p);break;case 3:E(p);break;case 4:v(p);break;case 5:A(p);break;case 6:_(p);break;case 7:y(p);break;default:RO(d)}c++}var f;return b(),s;function m(O,C){O===":"?i.test(C)?(d=2,h=new fu(Fe(Fe({},h),{hasMailtoPrefix:!0}))):S():u[O]===C||(i.test(C)?d=2:C==="."?d=3:C==="@"?d=4:S())}function g(O){O==="."?d=3:O==="@"?d=4:i.test(O)||S()}function E(O){O==="."||O==="@"?S():i.test(O)?d=2:S()}function v(O){pu.test(O)?d=5:S()}function A(O){O==="."?d=7:O==="-"?d=6:pu.test(O)||b()}function _(O){O==="-"||O==="."?b():pu.test(O)?d=5:b()}function y(O){O==="."||O==="-"?b():pu.test(O)?(d=5,h=new fu(Fe(Fe({},h),{hasDomainDot:!0}))):b()}function T(O){O===void 0&&(O=2),d=O,h=new fu({idx:c})}function S(){d=0,h=l}function b(){if(h.hasDomainDot){var O=t.slice(h.idx,c);/[-.]$/.test(O)&&(O=O.slice(0,-1));var C=h.hasMailtoPrefix?O.slice(7):O;(function(w){var I=(w.split(".").pop()||"").toLowerCase();return o.test(I)})(C)&&s.push(new Ip({tagBuilder:r,matchedText:O,offset:h.idx,email:C}))}S()}},e}(fo),fu=function(n){n===void 0&&(n={}),this.idx=n.idx!==void 0?n.idx:-1,this.hasMailtoPrefix=!!n.hasMailtoPrefix,this.hasDomainDot=!!n.hasDomainDot},pk=function(){function n(){}return n.isValid=function(e,t){return!(t&&!this.isValidUriScheme(t)||this.urlMatchDoesNotHaveProtocolOrDot(e,t)||this.urlMatchDoesNotHaveAtLeastOneWordChar(e,t)&&!this.isValidIpAddress(e)||this.containsMultipleDots(e))},n.isValidIpAddress=function(e){var t=new RegExp(this.hasFullProtocolRegex.source+this.ipRegex.source);return e.match(t)!==null},n.containsMultipleDots=function(e){var t=e;return this.hasFullProtocolRegex.test(e)&&(t=e.split("://")[1]),t.split("/")[0].indexOf("..")>-1},n.isValidUriScheme=function(e){var t=e.match(this.uriSchemeRegex),r=t&&t[0].toLowerCase();return r!=="javascript:"&&r!=="vbscript:"},n.urlMatchDoesNotHaveProtocolOrDot=function(e,t){return!(!e||t&&this.hasFullProtocolRegex.test(t)||e.indexOf(".")!==-1)},n.urlMatchDoesNotHaveAtLeastOneWordChar=function(e,t){return!(!e||!t||this.hasFullProtocolRegex.test(t)||this.hasWordCharAfterProtocolRegex.test(e))},n.hasFullProtocolRegex=/^[A-Za-z][-.+A-Za-z0-9]*:\/\//,n.uriSchemeRegex=/^[A-Za-z][-.+A-Za-z0-9]*:/,n.hasWordCharAfterProtocolRegex=new RegExp(":[^\\s]*?["+BO+"]"),n.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]*)?\/?$/,n}(),fk=(LO=new RegExp("[/?#](?:["+ze+"\\-+&@#/%=~_()|'$*\\[\\]{}?!:,.;^✓]*["+ze+"\\-+&@#/%=~_()|'$*\\[\\]{}✓])?"),new RegExp(["(?:","(",/(?:[A-Za-z][-.+A-Za-z0-9]{0,63}:(?![A-Za-z][-.+A-Za-z0-9]{0,63}:\/\/)(?!\d+\/?)(?:\/\/)?)/.source,kp(2),")","|","(","(//)?",/(?:www\.)/.source,kp(6),")","|","(","(//)?",kp(10)+"\\.",HO.source,"(?![-"+lk+"])",")",")","(?::[0-9]+)?","(?:"+LO.source+")?"].join(""),"gi")),mk=new RegExp("["+ze+"]"),jO=function(n){function e(t){var r=n.call(this,t)||this;return r.stripPrefix={scheme:!0,www:!0},r.stripTrailingSlash=!0,r.decodePercentEncoding=!0,r.matcherRegex=fk,r.wordCharRegExp=mk,r.stripPrefix=t.stripPrefix,r.stripTrailingSlash=t.stripTrailingSlash,r.decodePercentEncoding=t.decodePercentEncoding,r}return kn(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.stripPrefix,s=this.stripTrailingSlash,a=this.decodePercentEncoding,l=this.tagBuilder,u=[],c=function(){var h=r[0],p=r[1],f=r[4],m=r[5],g=r[9],E=r.index,v=m||g,A=t.charAt(E-1);if(!pk.isValid(h,p)||E>0&&A==="@"||E>0&&v&&d.wordCharRegExp.test(A))return"continue";if(/\?$/.test(h)&&(h=h.substr(0,h.length-1)),d.matchHasUnbalancedClosingParen(h))h=h.substr(0,h.length-1);else{var _=d.matchHasInvalidCharAfterTld(h,p);_>-1&&(h=h.substr(0,_))}var y=["http://","https://"].find(function(O){return!!p&&p.indexOf(O)!==-1});if(y){var T=h.indexOf(y);h=h.substr(T),p=p.substr(T),E+=T}var S=p?"scheme":f?"www":"tld",b=!!p;u.push(new wp({tagBuilder:l,matchedText:h,offset:E,urlMatchType:S,url:h,protocolUrlMatch:b,protocolRelativeMatch:!!v,stripPrefix:o,stripTrailingSlash:s,decodePercentEncoding:a}))},d=this;(r=i.exec(t))!==null;)c();return u},e.prototype.matchHasUnbalancedClosingParen=function(t){var r,i=t.charAt(t.length-1);if(i===")")r="(";else if(i==="]")r="[";else{if(i!=="}")return!1;r="{"}for(var o=0,s=0,a=t.length-1;s<a;s++){var l=t.charAt(s);l===r?o++:l===i&&(o=Math.max(o-1,0))}return o===0},e.prototype.matchHasInvalidCharAfterTld=function(t,r){if(!t)return-1;var i=0;r&&(i=t.indexOf(":"),t=t.slice(i));var o=new RegExp("^((.?//)?[-."+ze+"]*[-"+ze+"]\\.[-"+ze+"]+)").exec(t);return o===null?-1:(i+=o[1].length,t=t.slice(o[1].length),/^[^-.A-Za-z0-9:\/?#]/.test(t)?i:-1)},e}(fo),gk=new RegExp("#[_"+ze+"]{1,139}(?![_"+ze+"])","g"),Ek=new RegExp("[^"+ze+"]"),YO=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.matcherRegex=gk,r.nonWordCharRegex=Ek,r.serviceName=t.serviceName,r}return kn(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.nonWordCharRegex,s=this.serviceName,a=this.tagBuilder,l=[];(r=i.exec(t))!==null;){var u=r.index,c=t.charAt(u-1);if(u===0||o.test(c)){var d=r[0],h=r[0].slice(1);l.push(new xO({tagBuilder:a,matchedText:d,offset:u,serviceName:s,hashtag:h}))}}return l},e}(fo),vk=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"),zO=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.matcherRegex=vk,t}return kn(e,n),e.prototype.parseMatches=function(t){for(var r,i=this.matcherRegex,o=this.tagBuilder,s=[];(r=i.exec(t))!==null;){var a=r[0],l=a.replace(/[^0-9,;#]/g,""),u=!(!r[1]&&!r[2]),c=r.index==0?"":t.substr(r.index-1,1),d=t.substr(r.index+a.length,1),h=!c.match(/\d/)&&!d.match(/\d/);this.testMatch(r[3])&&this.testMatch(a)&&h&&s.push(new PO({tagBuilder:o,matchedText:a,offset:r.index,number:l,plusSign:u}))}return s},e.prototype.testMatch=function(t){return sk.test(t)},e}(fo),Ak=new RegExp("@[_"+ze+"]{1,50}(?![_"+ze+"])","g"),_k=new RegExp("@[_."+ze+"]{1,30}(?![_"+ze+"])","g"),yk=new RegExp("@[-_."+ze+"]{1,50}(?![-_"+ze+"])","g"),Ok=new RegExp("[^"+ze+"]"),VO=function(n){function e(t){var r=n.call(this,t)||this;return r.serviceName="twitter",r.matcherRegexes={twitter:Ak,instagram:_k,soundcloud:yk},r.nonWordCharRegex=Ok,r.serviceName=t.serviceName,r}return kn(e,n),e.prototype.parseMatches=function(t){var r,i=this.serviceName,o=this.matcherRegexes[this.serviceName],s=this.nonWordCharRegex,a=this.tagBuilder,l=[];if(!o)return l;for(;(r=o.exec(t))!==null;){var u=r.index,c=t.charAt(u-1);if(u===0||s.test(c)){var d=r[0].replace(/\.+$/g,""),h=d.slice(1);l.push(new MO({tagBuilder:a,matchedText:d,offset:u,serviceName:i,mention:h}))}}return l},e}(fo),Ln=function(n){n===void 0&&(n={}),this.idx=n.idx!==void 0?n.idx:-1,this.type=n.type||"tag",this.name=n.name||"",this.isOpening=!!n.isOpening,this.isClosing=!!n.isClosing},Tk=function(){function n(e){e===void 0&&(e={}),this.version=n.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(e.urls),this.email=typeof e.email=="boolean"?e.email:this.email,this.phone=typeof e.phone=="boolean"?e.phone:this.phone,this.hashtag=e.hashtag||this.hashtag,this.mention=e.mention||this.mention,this.newWindow=typeof e.newWindow=="boolean"?e.newWindow:this.newWindow,this.stripPrefix=this.normalizeStripPrefixCfg(e.stripPrefix),this.stripTrailingSlash=typeof e.stripTrailingSlash=="boolean"?e.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=typeof e.decodePercentEncoding=="boolean"?e.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=e.sanitizeHtml||!1;var t=this.mention;if(t!==!1&&t!=="twitter"&&t!=="instagram"&&t!=="soundcloud")throw new Error("invalid `mention` cfg - see docs");var r=this.hashtag;if(r!==!1&&r!=="twitter"&&r!=="facebook"&&r!=="instagram")throw new Error("invalid `hashtag` cfg - see docs");this.truncate=this.normalizeTruncateCfg(e.truncate),this.className=e.className||this.className,this.replaceFn=e.replaceFn||this.replaceFn,this.context=e.context||this}return n.link=function(e,t){return new n(t).link(e)},n.parse=function(e,t){return new n(t).parse(e)},n.prototype.normalizeUrlsCfg=function(e){return e==null&&(e=!0),typeof e=="boolean"?{schemeMatches:e,wwwMatches:e,tldMatches:e}:{schemeMatches:typeof e.schemeMatches!="boolean"||e.schemeMatches,wwwMatches:typeof e.wwwMatches!="boolean"||e.wwwMatches,tldMatches:typeof e.tldMatches!="boolean"||e.tldMatches}},n.prototype.normalizeStripPrefixCfg=function(e){return e==null&&(e=!0),typeof e=="boolean"?{scheme:e,www:e}:{scheme:typeof e.scheme!="boolean"||e.scheme,www:typeof e.www!="boolean"||e.www}},n.prototype.normalizeTruncateCfg=function(e){return typeof e=="number"?{length:e,location:"end"}:function(t,r){for(var i in r)r.hasOwnProperty(i)&&t[i]===void 0&&(t[i]=r[i]);return t}(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})},n.prototype.parse=function(e){var t=this,r=["a","style","script"],i=0,o=[];return function(s,a){for(var l,u=a.onOpenTag,c=a.onCloseTag,d=a.onText,h=a.onComment,p=a.onDoctype,f=new Ln,m=0,g=s.length,E=0,v=0,A=f;m<g;){var _=s.charAt(m);switch(E){case 0:_==="<"&&Z();break;case 1:y(_);break;case 2:S(_);break;case 3:T(_);break;case 4:b(_);break;case 5:O(_);break;case 6:C(_);break;case 7:w(_);break;case 8:I(_);break;case 9:F(_);break;case 10:x(_);break;case 11:$(_);break;case 12:k(_);break;case 13:s.substr(m,2)==="--"?(m+=2,A=new Ln(Fe(Fe({},A),{type:"comment"})),E=14):s.substr(m,7).toUpperCase()==="DOCTYPE"?(m+=7,A=new Ln(Fe(Fe({},A),{type:"doctype"})),E=20):D();break;case 14:M(_);break;case 15:Y(_);break;case 16:L(_);break;case 17:J(_);break;case 18:j(_);break;case 19:re(_);break;case 20:te(_);break;default:RO(E)}m++}function y(U){U==="!"?E=13:U==="/"?(E=2,A=new Ln(Fe(Fe({},A),{isClosing:!0}))):U==="<"?Z():Rp.test(U)?(E=3,A=new Ln(Fe(Fe({},A),{isOpening:!0}))):(E=0,A=f)}function T(U){ai.test(U)?(A=new Ln(Fe(Fe({},A),{name:se()})),E=4):U==="<"?Z():U==="/"?(A=new Ln(Fe(Fe({},A),{name:se()})),E=12):U===">"?(A=new Ln(Fe(Fe({},A),{name:se()})),ee()):Rp.test(U)||ok.test(U)||U===":"||D()}function S(U){U===">"?D():Rp.test(U)?E=3:D()}function b(U){ai.test(U)||(U==="/"?E=12:U===">"?ee():U==="<"?Z():U==="="||Dp.test(U)||ak.test(U)?D():E=5)}function O(U){ai.test(U)?E=6:U==="/"?E=12:U==="="?E=7:U===">"?ee():U==="<"?Z():Dp.test(U)&&D()}function C(U){ai.test(U)||(U==="/"?E=12:U==="="?E=7:U===">"?ee():U==="<"?Z():Dp.test(U)?D():E=5)}function w(U){ai.test(U)||(U==='"'?E=8:U==="'"?E=9:/[>=`]/.test(U)?D():U==="<"?Z():E=10)}function I(U){U==='"'&&(E=11)}function F(U){U==="'"&&(E=11)}function x(U){ai.test(U)?E=4:U===">"?ee():U==="<"&&Z()}function $(U){ai.test(U)?E=4:U==="/"?E=12:U===">"?ee():U==="<"?Z():(E=4,m--)}function k(U){U===">"?(A=new Ln(Fe(Fe({},A),{isClosing:!0})),ee()):E=4}function M(U){U==="-"?E=15:U===">"?D():E=16}function Y(U){U==="-"?E=18:U===">"?D():E=16}function L(U){U==="-"&&(E=17)}function J(U){E=U==="-"?18:16}function j(U){U===">"?ee():U==="!"?E=19:U==="-"||(E=16)}function re(U){U==="-"?E=17:U===">"?ee():E=16}function te(U){U===">"?ee():U==="<"&&Z()}function D(){E=0,A=f}function Z(){E=1,A=new Ln({idx:m})}function ee(){var U=s.slice(v,A.idx);U&&d(U,v),A.type==="comment"?h(A.idx):A.type==="doctype"?p(A.idx):(A.isOpening&&u(A.name,A.idx),A.isClosing&&c(A.name,A.idx)),D(),v=m+1}function se(){var U=A.idx+(A.isClosing?2:1);return s.slice(U,m).toLowerCase()}v<m&&(l=s.slice(v,m),d(l,v),v=m+1)}(e,{onOpenTag:function(s){r.indexOf(s)>=0&&i++},onText:function(s,a){if(i===0){var l=function(c,d){if(!d.global)throw new Error("`splitRegex` must have the 'g' flag set");for(var h,p=[],f=0;h=d.exec(c);)p.push(c.substring(f,h.index)),p.push(h[0]),f=h.index+h[0].length;return p.push(c.substring(f)),p}(s,/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi),u=a;l.forEach(function(c,d){if(d%2==0){var h=t.parseText(c,u);o.push.apply(o,h)}u+=c.length})}},onCloseTag:function(s){r.indexOf(s)>=0&&(i=Math.max(i-1,0))},onComment:function(s){},onDoctype:function(s){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o)},n.prototype.compactMatches=function(e){e.sort(function(l,u){return l.getOffset()-u.getOffset()});for(var t=0;t<e.length-1;t++){var r=e[t],i=r.getOffset(),o=r.getMatchedText().length,s=i+o;if(t+1<e.length){if(e[t+1].getOffset()===i){var a=e[t+1].getMatchedText().length>o?t:t+1;e.splice(a,1);continue}e[t+1].getOffset()<s&&e.splice(t+1,1)}}return e},n.prototype.removeUnwantedMatches=function(e){return this.hashtag||si(e,function(t){return t.getType()==="hashtag"}),this.email||si(e,function(t){return t.getType()==="email"}),this.phone||si(e,function(t){return t.getType()==="phone"}),this.mention||si(e,function(t){return t.getType()==="mention"}),this.urls.schemeMatches||si(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="scheme"}),this.urls.wwwMatches||si(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="www"}),this.urls.tldMatches||si(e,function(t){return t.getType()==="url"&&t.getUrlMatchType()==="tld"}),e},n.prototype.parseText=function(e,t){t===void 0&&(t=0),t=t||0;for(var r=this.getMatchers(),i=[],o=0,s=r.length;o<s;o++){for(var a=r[o].parseMatches(e),l=0,u=a.length;l<u;l++)a[l].setOffset(t+a[l].getOffset());i.push.apply(i,a)}return i},n.prototype.link=function(e){if(!e)return"";this.sanitizeHtml&&(e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var t=this.parse(e),r=[],i=0,o=0,s=t.length;o<s;o++){var a=t[o];r.push(e.substring(i,a.getOffset())),r.push(this.createMatchReturnVal(a)),i=a.getOffset()+a.getMatchedText().length}return r.push(e.substring(i)),r.join("")},n.prototype.createMatchReturnVal=function(e){var t;return this.replaceFn&&(t=this.replaceFn.call(this.context,e)),typeof t=="string"?t:t===!1?e.getMatchedText():t instanceof Cp?t.toAnchorString():e.buildTag().toAnchorString()},n.prototype.getMatchers=function(){if(this.matchers)return this.matchers;var e=this.getTagBuilder(),t=[new YO({tagBuilder:e,serviceName:this.hashtag}),new $O({tagBuilder:e}),new zO({tagBuilder:e}),new VO({tagBuilder:e,serviceName:this.mention}),new jO({tagBuilder:e,stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding})];return this.matchers=t},n.prototype.getTagBuilder=function(){var e=this.tagBuilder;return e||(e=this.tagBuilder=new DO({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),e},n.version="3.14.3",n.AnchorTagBuilder=DO,n.HtmlTag=Cp,n.matcher={Email:$O,Hashtag:YO,Matcher:fo,Mention:VO,Phone:zO,Url:jO},n.match={Email:Ip,Hashtag:xO,Match:po,Mention:MO,Phone:PO,Url:wp},n}();function WO(n,e=n){return{type:"autolink",url:n,text:e}}const Sk=Jn(/<!!mention:([^>\s]*?)\|(.*?)>/gm,([n,e,t])=>function(r,i){return{type:"mention",id:r,text:i}}(decodeURIComponent(e),t)),bk=Jn(/<!!customemoji:(.*?)>/gm,([n,e])=>function(t){return{type:"customemoji",text:t}}(e)),GO=Jn(/<((?:https?|mailto):.*?)\|(.*?)>/gi,([n,e,t])=>function(r,i=[]){return{type:"link",url:r,children:i}}(e,[t])),Nk=Jn(/<actionlink:([^|]+)[|]([^>]*)>/gi,([n,e,t])=>{const{action:r,params:i}=XO(e);return function(o,s,a=[]){return{type:"actionlink",action:o,params:s,children:a}}(r,i,[t])}),Ck=Jn(/<actionbutton:([^|]+)[|]([^>]*)>/gi,([n,e,t])=>{const{action:r,params:i}=XO(e);return function(o,s,a=[]){return{type:"actionbutton",action:o,params:s,children:a}}(r,i,[t])});function XO(n){const e=n.indexOf("?");return e===-1?{action:n,params:{}}:{action:n.slice(0,e),params:Object.fromEntries(new URLSearchParams(n.slice(e)))}}const Ik=Jn(/(?:^|\n)(?:\s*[-*+]\s+[^\n]+(?:\n|$))+/g,([n])=>function(e=[]){return{type:"bulletlist",children:e}}([n.startsWith(`
1316
1316
  `)?n.slice(1):n])),wk=Jn(/^\s*[-*+]\s+([^\n]+)(?:\n|$)/gm,([n,e])=>({type:"bulletpoint",children:[e]})),Rk=n=>{const e=/(?:^|[^-:/\w])([(+]?[0-9](?:[-_+ ().]?[0-9]){5,11}[0-9])(?:[^-:/\w]|$)/g;let t=0;const r=[];for(const i of gO(n,e)){const o=i[0],s=i[1],a=o.startsWith(s)?i.index:i.index+1;a-t>0&&r.push(n.substring(t,a));const l=WO("tel:"+s.replace(/[^0-9+]/g,""),s);r.push(l),t=a+s.length}return t<n.length&&r.push(n.substring(t)),r},Dk=n=>GO(n).flatMap(e=>typeof e=="string"?Lp(e):["<",...Lp(e.url),...Lp("|"+e.children[0]+">")]),Lp=n=>{const e=Tk.parse(n,{urls:!0,email:!0,phone:!1,hashtag:!1,mention:!1}),t=[];let r=0;for(const i of e){const o=i.getOffset(),s=i.getMatchedText(),a=s.length;let l=s;i instanceof Ip?l="mailto:"+i.getEmail():i instanceof wp&&(l=i.getUrl()),o>r&&t.push(n.substring(r,o)),t.push(WO(l,s)),r=o+a}return r<n.length&&t.push(n.substring(r)),t},kk=["Codeblock","Codespan","FormattedLink","Wikitext","Autolink","Actions","Mention","Mention","BulletPoint","CustomEmoji"],Lk=function(){const n=RegExp(`[^
1317
1317
  ]+
1318
1318
  ?|
1319
- `,"g");return e=>Array.from(e.match(n)||[])}();function xp(n,e={except:[]}){let t=function(r,i){let o=[r];return o=Mp(o,i.multilineSteps),o=Mp(o,[Lk]),o=Mp(o,i.singlelineSteps),o=qO(o),o}(n,function(r={except:[]}){var i;const o={multilineSteps:[],singlelineSteps:[]},s=(i=r.except)!=null?i:kk.filter(a=>!r.only.includes(a));return s.includes("BulletPoint")||o.multilineSteps.push(Ik,wk),s.includes("Mention")||o.singlelineSteps.push(Sk),s.includes("CustomEmoji")||o.singlelineSteps.push(bk),s.includes("Codespan")||o.multilineSteps.push(Jn(/```([^]+?)```/g,([a,l])=>({type:"codespan",text:l}))),s.includes("FormattedLink")||o.singlelineSteps.push(GO),s.includes("Actions")||(o.singlelineSteps.push(Nk),o.singlelineSteps.push(Ck)),s.includes("Wikitext")||o.singlelineSteps.push(rk),s.includes("Autolink")||o.singlelineSteps.push(Dk,Rk),o}(e));return t=JO(t,!1),t}function KO(n){return xp(n,{except:["FormattedLink","Actions"]})}function Mp(n,e){return e.reduce((t,r)=>Hs(t,r),n)}function qO(n){const e=[];let t=-1;for(const r of n)typeof r=="string"?typeof e[t]=="string"?e[t]+=r:e[++t]=r:e[++t]="children"in r?mn(Se({},r),{children:qO(r.children)}):r;return e}function JO(n,e){const t=[];let r=[];for(let i=0;i<n.length;i++){const o=n[i];typeof o=="string"?r.push(o):"children"in o?(r.length>0&&(t.push(r.join("")),r=[]),o.children=JO(o.children,e||o.type==="link"||o.type==="actionbutton"||o.type==="actionlink"),t.push(o)):o.type==="autolink"&&e?r.push(o.text):(r.length>0&&(t.push(r.join("")),r=[]),t.push(o))}return r.length>0&&(t.push(r.join("")),r=[]),t}let xk=class{constructor(n,e,t,r){this.emoji=n,this.messageId=e,this.conversationId=t,this._realtimeClient=r}get brandedMessageId(){return this.messageId}get brandedConversationId(){return this.conversationId}add(){return $(this,null,function*(){const n=yield this._realtimeClient.call("PUT",["conversations",this.brandedConversationId,"messages",this.brandedMessageId,"reactions",this.emoji,this._realtimeClient.userId],{});Be(`Add ${this.emoji} reaction on message ${this.messageId} in conversation ${this.conversationId}`,n)})}remove(){return $(this,null,function*(){const n=yield this._realtimeClient.call("DELETE",["conversations",this.brandedConversationId,"messages",this.brandedMessageId,"reactions",this.emoji,this._realtimeClient.userId],{});(n.ok||n.where!=="server"||n.value.status!==404)&&Be(`Remove ${this.emoji} reaction from message ${this.messageId} in conversation ${this.conversationId}`,n)})}};class ZO{constructor(e,t,r){this.id=e,this.conversationId=t,this._realtimeClient=r}get brandedId(){return this.id}get brandedConversationId(){return this.conversationId}reaction(e){if(typeof e!="string")throw new Error(`Creating ReactionRef failed because emoji "${e}" is not a string`);if(e==="")throw new Error(`Creating ReactionRef failed because emoji "${e}" is an empty string`);return new xk(e,this.brandedId,this.brandedConversationId,this._realtimeClient)}get(){return $(this,null,function*(){const e=yield this._realtimeClient.call("GET",["me","conversations",this.brandedConversationId,"messages",this.brandedId],{});if(!e.ok&&e.where==="server"&&e.value.status===404||!e.ok&&e.where==="server"&&e.value.status===403&&e.value.errorCode==="NOT_A_PARTICIPANT")return null;const t=Be("Get message "+this.id,e),r=yield this._realtimeClient.createMessageSnapshot(t,this.brandedConversationId);return bp("Get message "+this.id,r)})}edit(e){return $(this,null,function*(){const t={content:Mk(e),custom:typeof e=="string"?void 0:e.custom},r=yield this._realtimeClient.call("PATCH",["conversations",this.brandedConversationId,"messages",this.brandedId],t);Be(`Edit message ${this.id} in conversation ${this.conversationId}`,r)})}delete(){return $(this,null,function*(){const e=yield this._realtimeClient.call("DELETE",["conversations",this.brandedConversationId,"messages",this.brandedId],{});(e.ok||e.where!=="server"||e.value.status!==404)&&Be(`Delete message ${this.id} in conversation ${this.conversationId}`,e)})}}function Mk(n){return typeof n=="string"?[{type:"text",children:xp(n)}]:"text"in n&&n.text?[{type:"text",children:xp(n.text)}]:"content"in n&&n.content?n.content:void 0}class Pk{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){if(typeof e=="string"){if(e==="")throw new Error(`Creating ParticipantRef failed because ID "${e}" is an empty string`);return new NO(e,this.id,this._realtimeClient)}if("brandedId"in e)return new NO(e.id,this.id,this._realtimeClient);throw new Error(`Creating ParticipantRef failed because user "${e}" is not a string or a UserRef`)}message(e){if(typeof e!="string")throw new Error(`Creating MessageRef failed because ID "${e}" is not a string`);if(e==="")throw new Error(`Creating MessageRef failed because ID "${e}" is an empty string`);return new ZO(e,this.brandedId,this._realtimeClient)}get(){return $(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&&t.where==="server"&&t.value.status===404)return null;const r=Be("Get conversation "+this.id,t),i=bp("Get last message in conversation "+this.id,yield e),o=i.length===0?null:i[0];return this._realtimeClient.createConversationSnapshotPreloaded(r,o)})}set(e){return $(this,null,function*(){const t=this._realtimeClient.call("PUT",["conversations",this.brandedId],e),r=this._realtimeClient.call("PUT",["conversations",this.brandedId,"participants",this.brandedUserId],e),i=yield t;!i.ok&&i.where==="server"&&i.value.status===403&&i.value.errorCode==="UNAUTHORIZED_TO_EDIT"&&function(s){return s.subject===void 0&&s.photoUrl===void 0&&s.welcomeMessages===void 0&&s.custom!==null&&(s.custom===void 0||!Object.values(s.custom).some(a=>a!==void 0))}(e)||Be("Set conversation "+this.id,i);const o=yield r;!o.ok&&o.where==="server"&&o.value.status===403&&o.value.errorCode==="UNAUTHORIZED_TO_EDIT_PARTICIPANT"&&function(s){return s.access===void 0&&s.notify===void 0}(e)||Be("Set your participation in conversation "+this.id,o)})}createIfNotExists(){return $(this,arguments,function*(e={}){const t=this._realtimeClient.call("POST",["conversations",this.brandedId],e),r=this._realtimeClient.call("POST",["conversations",this.brandedId,"participants",this.brandedUserId],e),i=yield t;(i.ok||i.where!=="server"||i.value.status!==409)&&Be("Create conversation "+this.id,yield t);const o=yield r;(o.ok||o.where!=="server"||o.value.status!==409)&&Be("Join conversation "+this.id,yield r)})}markAsRead(){return $(this,null,function*(){const e=yield this._realtimeClient.call("POST",["me","conversations",this.brandedId,"read"],{});Be(`Mark ${this.id} as read`,e)})}markAsUnread(){return $(this,null,function*(){const e=yield this._realtimeClient.call("POST",["me","conversations",this.brandedId,"unread"],{});Be(`Mark ${this.id} as unread`,e)})}send(e){return $(this,null,function*(){const t={content:Bk(e),referencedMessageId:Fk(e),custom:typeof e=="string"?void 0:e.custom,idempotencyKey:ek(new Date().getTime())},r=yield this._realtimeClient.call("POST",["conversations",this.brandedId,"messages"],t),i=Be("Send message to conversation "+this.id,r);return new ZO(i.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 $(this,null,function*(){const e=yield this._realtimeClient.call("POST",["me","conversations",this.brandedId,"typing"],{});Be(`Set user as typing in ${this.id}`,e)})}}function Bk(n){return typeof n=="string"?[{type:"text",children:KO(n)}]:"text"in n?[{type:"text",children:KO(n.text)}]:n.content}function Fk(n){if(typeof n=="string")return;const e=n.referencedMessage;return e!==void 0?typeof e=="string"?e:e.id:void 0}class li{constructor(e,t,r){this.realtimeWsApiUrl=e,this.internalHttpApiUrl=t,this.restApiHttpUrl=r}getBokensUrl(e,t,r){return this.internalHttpApiUrl+`/${e}/bokens/${encodeURIComponent(t)}?signature=${encodeURIComponent(r??"")}`}getRealtimeWsUrl(e,t,r,i,o){const s=encodeURIComponent(t);return this.realtimeWsApiUrl+`/${e}/realtime/${s}?talkjs-client-build=${o??"standalone"}&talkjs-core=${r}&talkjs-client-id=${i}`}static fromHost(e){const t=new li("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 r=e.match(/\w+-(\w+)\.talkjs\.com/);if(r){const i=r[1];return new li(`wss://realtime-${i}.talkjs.com/v1`,`https://app-${i}.talkjs.com/api/v0`,`https://api-${i}.talkjs.com/v1`)}return t}return e.includes("localhost")||e.includes("localtest.me")||/^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e)?new li(`ws://${e}/public_api/v1`,`http://${e}/api/v0`,`http://${e}/public_api/v1`):new li(`wss://${e}/public_api/v1`,`https://${e}/api/v0`,`https://${e}/public_api/v1`)}}function mu({method:n,url:e,data:t,options:r,attempts:i,shouldRetry:o,authProvider:s}){var a;(!i||i<=0)&&(i=1);const l={"x-talkjs-client-build":"jssdk-dev","x-talkjs-client-date":"2025-08-28T08:53:22.349Z"};return t instanceof FormData||(l["Content-Type"]=(a=r?.contentType)!=null?a:"application/json"),hO(i,()=>$(this,null,function*(){if(s){const u=yield s.getToken();l.Authorization=`Bearer ${u}`}return fetch(e,{method:n,headers:l,body:t}).then(u=>{if(u.ok)return u;throw u})}),{initialDelay:.2,log:void 0,shouldRetry:u=>$(this,null,function*(){return s&&u.status===401?(gu.log(`401 error from ${n} ${e}, ${yield s.getToken()}`),s.refreshToken(),!0):o?o(u):!("status"in u&&u.status>=400&&u.status<500)})}).catch(u=>{if(Math.random()<.1&&!e.toString().startsWith("https://capture.trackjs.com")){const c=`Network Error for ${n} ${e}`;typeof window<"u"&&(u instanceof Response?u.clone().text().then(d=>gu.log(`${c} ${u.status} ${d} (10% logged)`)):gu.log(`${c} ${u} (10% logged)`)),console.error("[TalkJS]",c)}throw u})}const{cdnHost:pL,appHost:Uk,restHost:fL,realtimeHost:mL,appProtocol:gL,appWsProtocol:EL}=function(){if(typeof window>"u")return{cdnHost:"test-hostname",appHost:"test-hostname",appProtocol:"http:",appWsProtocol:"ws:"};const n=function(){if(document.currentScript)return document.currentScript.src;try{throw new Error}catch(l){const u=l.stack.match(/https?:\/\/.*\.(js|jsx|ts|tsx)/);return u?u[0]:""}}(),e=document.createElement("a");e.href=n;const t=e.host,r=(a=t).match(/^cdn[.-]/)?a.replace(/^cdn/,"app"):a==="talkjs.com"?"app.talkjs.com":a,i=function(l){return l.match(/^app[.-]/)?l.replace(/^app/,"api"):l+"/public_api"}(r),o=function(l){return l.match(/^app[.-]/)?l.replace(/^app/,"realtime"):l+"/public_api"}(r),s=e.protocol;var a;return{cdnHost:t,appHost:r,restHost:i,realtimeHost:o,appProtocol:s,appWsProtocol:s==="https:"?"wss:":"ws:"}}(),Hk=Uk.startsWith("app.talkjs.com"),gu=typeof window>"u"?{log:n=>Promise.resolve(),setData:n=>{}}:new class{constructor(n){this._timeCreated=Date.now(),this._enabled=Hk,this._trackJSData={customer:{application:"",correlationId:"",sessionId:"",token:"",userId:"",version:"dev-2025-08-28T08:53:22.349Z"},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-28T08:53:22.349Z",throttled:0},this._url=`https://capture.trackjs.com/capture?token=${n}`,this._trackJSData.customer.token=n}setData({appId:n,meId:e,sessionId:t}){this._trackJSData.customer.userId=n,this._trackJSData.customer.sessionId=`${n}/${e}`,this._trackJSData.customer.correlationId=t}log(n){return $(this,null,function*(){try{if(!this._enabled)return Promise.resolve();const e=mn(Se({},this._trackJSData),{message:n});yield mu({method:"POST",url:this._url,data:JSON.stringify(e),options:{contentType:"text/plain"}})}catch(e){console.error("[TalkJS] Failed when sending an error report. Error: ",e)}})}}("970cd0be0fb74630b75c8451051299dc");class $k{constructor(e,t={}){this._onSubscription=t,this._handlers={};for(const r in e)Object.hasOwnProperty.call(e,r)&&(this._handlers[r]=[])}emit(e,t){for(const r of this._handlers[e])try{r(t)}catch(i){console.error(`[TalkJS] '${String(e)}' handler threw an error:`,i)}}emitAsync(e,t){return $(this,null,function*(){try{const r=this._handlers[e].map(i=>i(t));yield Promise.all(r)}catch(r){console.error(`[TalkJS] '${String(e)}' handler threw an error:`,r)}})}supports(e){return e in this._handlers}on(e,t){var r,i;if(!this.supports(e))throw new Error(`Unknown event type '${String(e)}'`);(i=(r=this._onSubscription)[e])==null||i.call(r),this._handlers[e].push(t)}off(e,t){if(!Object.hasOwnProperty.call(this._handlers,e))throw new Error(`Unknown event type '${String(e)}'`);const r=this._handlers[e].indexOf(t);r!==-1&&this._handlers[e].splice(r,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 jk{constructor(e,t,r,i,o,s){if(this.appId=t,this.userId=r,this.tokenFetcher=o,this.usingBokens=!1,this.requestInProgress=!1,this.eventEmitter=new $k({tokenChanged(a){},tokenRefreshFailed(a){},tokenAccepted(a){}}),this.sessionExpiryWarningTimeoutId=void 0,s&&(i||o))throw new Error("[TalkJS] If providing a signature for authentication, you must not provide a token or tokenFetcher.");i?this.fetchToken(()=>i):(o||(this.usingBokens=!0,this.tokenFetcher=()=>this.sendBokenRequest(e,s)),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(),e===null)return;const t=this.tokenFetcher!==void 0;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.`),this.tokenFetcher!==void 0){const r=e>600?e-300:e/2,i=Math.min(1728e6,1e3*r);this.sessionExpiryWarningTimeoutId=setTimeout(()=>{this.refreshToken()},i)}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 $(this,null,function*(){if(this.requestInProgress)return;this.requestInProgress=!0;const t=()=>$(this,null,function*(){const r=yield e();return this.checkJwt(r),r});try{const r=this.token!==void 0;this.token=t(),yield this.token.then(i=>{r&&this.emitTokenChanged(i)}).catch(i=>{this.emitTokenRefreshFailed(i)})}catch(r){this.emitTokenRefreshFailed(r)}finally{this.requestInProgress=!1}})}checkJwt(e){(function(s){if(!(typeof s=="string"||s instanceof String))throw s===void 0?"Token was undefined":"Token must be a string, got: "+s})(e);const t=[];let r,i,o;if(typeof e=="string"?r=e:t.push(`Token type is ${typeof e} instead of a string.`),r)try{const s=function(a){const l=a.split(".");if(l.length!==3)throw"Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";return{header:QO(l[0]),payload:QO(l[1])}}(r);i=s.header,o=s.payload}catch(s){t.push(s)}if(i){const s=this.checkJwtHeader(i);t.push(...s)}if(o){const s=this.checkJwtPayload(o);t.push(...s)}if(t.length)if(this.usingBokens)gu.log(`JWT Errors detected by AuthProvider when using bokens: ${t.join(`
1320
- `)}`);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 s=t.length>1;t.forEach((a,l)=>{const u=s?`Reason ${l+1}:`:"Reason:";console.warn(`[TalkJS] ${u} ${a}`)}),console.warn(`[TalkJS]: Authentication token: "${e}"`)}}checkJwtHeader(e){const t=[],r=e.alg;return r===void 0?t.push('Token header must contain `"alg": "HS256"`, but no `alg` was specified.'):typeof r!="string"?t.push(`Token header must contain \`"alg": "HS256"\`, but \`alg\` was ${typeof r} instead of a string. Make sure you wrap the value in "".`):r!=="HS256"&&t.push(`Token header must contain \`"alg": "HS256"\`, but \`alg\` was set to "${r}" instead. HS256 is the only supported algorithm.`),t}checkJwtPayload(e){const t=[],r=e.iss;r===void 0?t.push(`Token payload must contain an \`iss\` claim set to your app ID (${this.appId}), but \`iss\` was missing.`):typeof r!="string"?t.push(`Token payload must contain an \`iss\` claim set to your app ID (${this.appId}), but \`iss\` was ${typeof r} instead of a string. Make sure you wrap the value in "".`):r!==this.appId&&t.push(`Token payload must contain an \`iss\` claim set to your app ID (${this.appId}), but \`iss\` was set to "${r}" instead.`);const i=e.sub;i===void 0?t.push(`Token payload must contain a \`sub\` claim set to your user ID (${this.userId}), but \`sub\` was missing.`):typeof i!="string"?t.push(`Token payload must contain a \`sub\` claim set to your user ID (${this.userId}), but \`sub\` was ${typeof i} instead of a string. Make sure you wrap the value in "".`):i!==this.userId&&t.push(`Token payload must contain a \`sub\` claim set to your userId ID (${this.userId}), but \`sub\` was set to "${i}" instead.`);const o=e.tokenType;o===void 0?t.push('Token payload must contain a `"tokenType": "user"` claim, but no `tokenType` was specified.'):typeof o!="string"?t.push(`Token payload must contain a \`"tokenType": "user"\` claim, but \`tokenType\` was ${typeof o} instead of a string. Make sure you wrap the value in "".`):o!=="user"&&t.push(`Token payload must contain a \`"tokenType": "user"\` claim, but \`tokenType\` was set to "${o}" instead.`);const s=e.exp;s===void 0||(typeof s!="number"?t.push(`Token payload contains an \`exp\` claim, but \`exp\` was ${typeof o} 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 "".`):s<1e9?t.push(`Token payload contains an \`exp\` claim, but \`exp\` is very small (${s}, representing ${new Date(1e3*s).toLocaleDateString()}). If set, \`exp\` should be the expiry date as a number of seconds since 1970-01-01.`):s>1e11?t.push(`Token payload contains an \`exp\` claim, but \`exp\` is very small (${s}, representing ${new Date(1e3*s).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.`):s<new Date().getTime()/1e3&&t.push(`Token payload contains an \`exp\` claim, but \`exp\` (${s}, representing ${new Date(1e3*s).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 a=e.nbf;return a===void 0||(typeof a!="number"?t.push(`Token payload contains a \`nbf\` (not-before) claim, but \`nbf\` was ${typeof o} 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.`):a>1e11&&t.push(`Token payload contains a \`nbf\` (not-before) claim, but \`nbf\` is very large (${a}, representing ${new Date(1e3*a).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 $(this,null,function*(){let r=0;const i=e.getBokensUrl(this.appId,this.userId,t);return(yield(yield mu({method:"GET",url:i,attempts:1e4,shouldRetry:s=>{if(s instanceof Error)return!0;if(s.status===401)throw"Check that you provided a valid signature.";if(s.status===404)throw"Check that you specified the correct App ID.";if(s.status===429||s.status===502)return!0;if(s.status>=400&&s.status<500)throw`Unexpected HTTP ${s.status} response when fetching auth token. Check that you configured the session correctly.`;if(r++,r>=5)throw`Unexpected HTTP ${s.status} response when fetching auth token, retrying did not help.`;return!0}})).json()).boken})}}function QO(n){try{const e=n.replace(/-/g,"+").replace(/_/g,"/"),t=decodeURIComponent(atob(e).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(t)}catch{throw`Could not base64-decode and JSON-parse token section: ${n}. Check that you base-64 encoded the section correctly.`}}class Yk{constructor(e){this.target=e}deref(){return this.target}}const eT=new class{constructor(){this.registry={}}getOrCreate(n){var e;const t=this.key(n),r=(e=this.registry[t])==null?void 0:e.deref();if(r)return r;const i=new tT(n),o=globalThis.WeakRef?new WeakRef(i):new Yk(i);return this.registry[t]=o,i}deregister(n,e){const t=this.key({appId:n,userId:e});delete this.registry[t]}key({appId:n,userId:e}){return`${n}:${e}`}};class tT{constructor(e){(function(l){function u(c,d){if(!c)throw new Error("[TalkJS] TalkSession: "+d)}u(l&&typeof l=="object","Expected an object argument in TalkSession#constructor."),u(l.appId&&typeof l.appId=="string","The `appId` property of TalkSession#constructor is required and it must be a non-empty string."),u(typeof l.userId=="string","The `userId` property of TalkSession#constructor is required and it must be a string."),l.token!==void 0&&u(l.token&&typeof l.token=="string","The `token` property of TalkSession#constructor must be a non-empty string."),l.tokenFetcher!==void 0&&u(typeof l.tokenFetcher=="function","The `tokenFetcher` property of TalkSession#constructor must be a function.")})(e);const{appId:t,userId:r,token:i,tokenFetcher:o,signature:s}=e;this._appId=t,this._apiUrls=e.apiUrls?new li(e.apiUrls.realtimeWsApiUrl,e.apiUrls.internalHttpApiUrl,e.apiUrls.restApiHttpUrl):li.fromHost(e.host),this._authProvider=new jk(this._apiUrls,t,r,i,o,s);const a=Math.random().toString().split(".")[1];this._realtimeClient=new QD(this._apiUrls.getRealtimeWsUrl(t,r,"1.5.1",a,e.clientBuild),r,this._authProvider),this.currentUser=new bO(this._realtimeClient.userId,this._realtimeClient),this._terminationReason=ri(),this._terminationReason.promise.then(l=>{console.error(`[TalkSession] ${l}`)}),function(l,u,c){return $(this,null,function*(){return mu({method:"GET",url:`${u}/${l}/app`,authProvider:c}).then(d=>d.status===200||d.status!==404&&(console.warn(`[TalkJS] Received unexpected ${d.status} status code when validating app ID. Assuming that the app ID is valid.`),!0)).catch(d=>{if(typeof d!="string"&&"status"in d){const h=d;return h.status===200||h.status!==404&&(console.warn(`[TalkJS] Received unexpected ${h.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(l=>{l||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(l=>{this.terminate(new Error(`Could not authenticate, cannot recover automatically: ${l}`))})}onError(e){const t=ri();return Promise.race([t.promise,this._terminationReason.promise]).then(r=>{r!=="UNSUBSCRIBED"&&e(r)}),{unsubscribe:()=>t.resolve("UNSUBSCRIBED")}}user(e){if(typeof e!="string")throw new Error(`Creating UserRef failed because ID "${e}" is not a string`);if(e==="")throw new Error(`Creating UserRef failed because ID "${e}" is an empty string`);return new bO(e,this._realtimeClient)}conversation(e){if(typeof e!="string")throw new Error(`Creating ConversationRef failed because ID "${e}" is not a string`);if(e==="")throw new Error(`Creating ConversationRef failed because ID "${e}" is an empty string`);return new Pk(e,this._realtimeClient)}subscribeConversations(e){return this._realtimeClient.subscribe(["me","conversations"],e)}terminate(e){eT.deregister(this._appId,this.currentUser.id),this._terminationReason.resolve(e),this._realtimeClient.destroy()}_isConnected(){return this._realtimeClient.isConnected()}uploadFile(e,t){return $s(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,t)}uploadImage(e,t){return $s(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,Se({subtype:"image"},t))}uploadVideo(e,t){return $s(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,Se({subtype:"video"},t))}uploadAudio(e,t){return $s(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,Se({subtype:"audio"},t))}uploadVoice(e,t){return $s(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,Se({subtype:"voice"},t))}}function $s(n,e,t,r){return $(this,arguments,function*(i,o,s,{subtype:a,filename:l,width:u,height:c,duration:d}){const h=new FormData;return h.set("file",s,l),a!==void 0&&h.set("subtype",a),u!==void 0&&h.set("width",u.toString()),c!==void 0&&h.set("height",c.toString()),d!==void 0&&h.set("duration",d.toString()),mu({method:"POST",url:i,data:h,authProvider:o}).then(p=>p.json()).then(p=>p.attachmentToken).catch(p=>$(this,null,function*(){if(p instanceof Response){const f=yield p.json(),m=`Unexpected response when uploading file, status code ${p.status} ${f.errorCode}, ${f.reasons}`;throw new Error(m)}throw p}))})}function nT(n){return Object.keys(n)}class Pp extends Error{constructor(e,t){const r=function(i){if(typeof i=="string")return i;if(Array.isArray(i))return i.join(`
1321
- `);try{return JSON.stringify(i)}catch{return String(i)}}(e);super(r),this.userMessage=t??r,Object.setPrototypeOf&&Object.setPrototypeOf(this,new.target.prototype)}}const js=console;class zk{constructor(e,t,r,i){this.apiUrls=e,this.appId=t,this.sessionId=r,this.authProvider=i,this._lastPutPromise=Promise.resolve()}async get(e,t={}){const r=this.endpointUrl(e,t),i=await Ys(()=>this.fetchWithReauth(r),{retries:11});return await this.handleResponse(i,r)}async queuedPut(e,t){await this._lastPutPromise;const r=Ys(()=>this._doPut(e,t));return this._lastPutPromise=r,r}put(e,t,r){const i=()=>this._doPut(e,t);return r?iT(i,r):Ys(i,{retries:5})}post(e,t,r){const i=()=>this._doPost(e,t);return r?iT(i,r):Ys(i,{retries:5})}delete(e,t={}){return Ys(()=>this._doDelete(e,t),{retries:11})}endpointUrl(e,t={}){const r=new URL(this.apiUrls.internalHttpApiUrl);r.pathname+=`/${this.appId}/${e}`,r.searchParams.set("sessionId",this.sessionId);for(const[i,o]of Object.entries(t))r.searchParams.set(i,o);return r}async _doPut(e,t){const r=this.endpointUrl(e),i=await this.fetchWithReauth(r,{method:"PUT",body:JSON.stringify(t)});return await this.handleResponse(i,r)}async _doPost(e,t){const r=this.endpointUrl(e),i=await this.fetchWithReauth(r,{method:"POST",body:JSON.stringify(t)});return await this.handleResponse(i,r)}async _doDelete(e,t){const r=this.endpointUrl(e,t),i=await this.fetchWithReauth(r,{method:"DELETE"});return await this.handleResponse(i,r)}async handleResponse(e,t){if(e.status>=300){if(e.status===404)throw Bc.error(`[${this.appId}][BackendRestClient] Couldn't find resource.`),new Pp("Could not find app.",`Could not find given appId: "${this.appId}". You can find your appId on https://talkjs.com/dashboard.`);if(e.status===401){const r=await this.authProvider.getToken();throw Bc.error(`[${this.appId}][BackendRestClient] Couldn't authenticate ${t} with token ${r}.`),new Pp("User not authenticated.","Could not authenticate user. Check if your signature is calculated correctly.")}if(e.status>=300&&e.status<500){const{error:r}=await e.json();throw new Pp(r)}{const r=await e.text();throw new Error(`Got non-success response (${r}) from the server for url: ${t}.`)}}return await e.json()}async fetchWithReauth(e,t){function r(s){const a={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${s}`};return fetch(e,{...t,headers:a})}const i=await this.authProvider.getToken(),o=await r(i);return o.status!==401?o:(js.error(`401 error from ${t?.method} ${e}, ${i}`),this.authProvider.refreshToken(),r(await this.authProvider.getToken()))}}function rT(n){return!n.userMessage}function Ys(n,{retries:e=30}={}){return up(e,n,{shouldRetry:rT,log:js.warn.bind(js),maxDelay:30,initialDelay:.2})}async function iT(n,e){try{return await n()}catch(r){if(!rT(r))throw r}let t=!1;return e.then(()=>{t=!0}),up(1e3,n,{initialDelay:.2,maxDelay:30,shouldRetry:()=>!t,log:js.warn.bind(js)})}var Bp={exports:{}};(function(n,e){var t="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",o="[object Function]",s="[object Object]",a=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[i]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[o]=u["[object Map]"]=u["[object Number]"]=u[s]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var c=typeof da=="object"&&da&&da.Object===Object&&da,d=typeof self=="object"&&self&&self.Object===Object&&self,h=c||d||Function("return this")(),p=e&&!e.nodeType&&e,f=p&&n&&!n.nodeType&&n,m=f&&f.exports===p,g=m&&c.process,E=function(){try{var R=f&&f.require&&f.require("util").types;return R||g&&g.binding&&g.binding("util")}catch{}}(),v=E&&E.isTypedArray,A,_=Array.prototype,O=Function.prototype,T=Object.prototype,S=h["__core-js_shared__"],b=O.toString,y=T.hasOwnProperty,C=(A=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",w=T.toString,I=b.call(Object),F=RegExp("^"+b.call(y).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),L=m?h.Buffer:void 0,j=h.Symbol,D=h.Uint8Array;L&&L.allocUnsafe;var B,H,x=(B=Object.getPrototypeOf,H=Object,function(R){return B(H(R))}),Q=Object.create,Y=T.propertyIsEnumerable,J=_.splice,se=j?j.toStringTag:void 0,k=function(){try{var R=Xs(Object,"defineProperty");return R({},"",{}),R}catch{}}(),Z=L?L.isBuffer:void 0,te=Math.max,oe=Date.now,U=Xs(h,"Map"),de=Xs(Object,"create"),fe=function(){function R(){}return function(M){if(!ci(M))return{};if(Q)return Q(M);R.prototype=M;var X=new R;return R.prototype=void 0,X}}();function Ne(R){var M=-1,X=R==null?0:R.length;for(this.clear();++M<X;){var re=R[M];this.set(re[0],re[1])}}function ge(R){var M=-1,X=R==null?0:R.length;for(this.clear();++M<X;){var re=R[M];this.set(re[0],re[1])}}function he(R){var M=-1,X=R==null?0:R.length;for(this.clear();++M<X;){var re=R[M];this.set(re[0],re[1])}}function et(R){var M=this.__data__=new ge(R);this.size=M.size}function rn(R,M){var X=Hp(R),re=!X&&Up(R),me=!X&&!re&&fT(R),Ve=!X&&!re&&!me&&gT(R),Le=X||re||me||Ve,Ot=Le?function(ot,Zn){for(var Rt=-1,_o=Array(ot);++Rt<ot;)_o[Rt]=Zn(Rt);return _o}(R.length,String):[],wt=Ot.length;for(var We in R)Le&&(We=="length"||me&&(We=="offset"||We=="parent")||Ve&&(We=="buffer"||We=="byteLength"||We=="byteOffset")||Ao(We,wt))||Ot.push(We);return Ot}function Vt(R,M,X){(X!==void 0&&!yu(R[M],X)||X===void 0&&!(M in R))&&gn(R,M,X)}function zs(R,M,X){var re=R[M];y.call(R,M)&&yu(re,X)&&(X!==void 0||M in R)||gn(R,M,X)}function go(R,M){for(var X=R.length;X--;)if(yu(R[X][0],M))return X;return-1}function gn(R,M,X){M=="__proto__"&&k?k(R,M,{configurable:!0,enumerable:!0,value:X,writable:!0}):R[M]=X}Ne.prototype.clear=function(){this.__data__=de?de(null):{},this.size=0},Ne.prototype.delete=function(R){var M=this.has(R)&&delete this.__data__[R];return this.size-=M?1:0,M},Ne.prototype.get=function(R){var M=this.__data__;if(de){var X=M[R];return X===t?void 0:X}return y.call(M,R)?M[R]:void 0},Ne.prototype.has=function(R){var M=this.__data__;return de?M[R]!==void 0:y.call(M,R)},Ne.prototype.set=function(R,M){var X=this.__data__;return this.size+=this.has(R)?0:1,X[R]=de&&M===void 0?t:M,this},ge.prototype.clear=function(){this.__data__=[],this.size=0},ge.prototype.delete=function(R){var M=this.__data__,X=go(M,R);return!(X<0)&&(X==M.length-1?M.pop():J.call(M,X,1),--this.size,!0)},ge.prototype.get=function(R){var M=this.__data__,X=go(M,R);return X<0?void 0:M[X][1]},ge.prototype.has=function(R){return go(this.__data__,R)>-1},ge.prototype.set=function(R,M){var X=this.__data__,re=go(X,R);return re<0?(++this.size,X.push([R,M])):X[re][1]=M,this},he.prototype.clear=function(){this.size=0,this.__data__={hash:new Ne,map:new(U||ge),string:new Ne}},he.prototype.delete=function(R){var M=vo(this,R).delete(R);return this.size-=M?1:0,M},he.prototype.get=function(R){return vo(this,R).get(R)},he.prototype.has=function(R){return vo(this,R).has(R)},he.prototype.set=function(R,M){var X=vo(this,R),re=X.size;return X.set(R,M),this.size+=X.size==re?0:1,this},et.prototype.clear=function(){this.__data__=new ge,this.size=0},et.prototype.delete=function(R){var M=this.__data__,X=M.delete(R);return this.size=M.size,X},et.prototype.get=function(R){return this.__data__.get(R)},et.prototype.has=function(R){return this.__data__.has(R)},et.prototype.set=function(R,M){var X=this.__data__;if(X instanceof ge){var re=X.__data__;if(!U||re.length<199)return re.push([R,M]),this.size=++X.size,this;X=this.__data__=new he(re)}return X.set(R,M),this.size=X.size,this};var Eo=function(R,M,X){for(var re=-1,me=Object(R),Ve=X(R),Le=Ve.length;Le--;){var Ot=Ve[++re];if(M(me[Ot],Ot,me)===!1)break}return R};function ui(R){return R==null?R===void 0?"[object Undefined]":"[object Null]":se&&se in Object(R)?function(M){var X=y.call(M,se),re=M[se];try{M[se]=void 0;var me=!0}catch{}var Ve=w.call(M);return me&&(X?M[se]=re:delete M[se]),Ve}(R):function(M){return w.call(M)}(R)}function Vs(R){return qs(R)&&ui(R)==i}function Ws(R){return!(!ci(R)||function(M){return!!C&&C in M}(R))&&(jp(R)?F:a).test(function(M){if(M!=null){try{return b.call(M)}catch{}try{return M+""}catch{}}return""}(R))}function vu(R){if(!ci(R))return function(me){var Ve=[];if(me!=null)for(var Le in Object(me))Ve.push(Le);return Ve}(R);var M=Ks(R),X=[];for(var re in R)(re!="constructor"||!M&&y.call(R,re))&&X.push(re);return X}function Gs(R,M,X,re,me){R!==M&&Eo(M,function(Ve,Le){if(me||(me=new et),ci(Ve))(function(wt,We,ot,Zn,Rt,_o,Js){var xn=Fp(wt,ot),Dt=Fp(We,ot),AT=Js.get(Dt);if(AT)return void Vt(wt,ot,AT);var Wt=_o?_o(xn,Dt,ot+"",wt,We,Js):void 0,Zs=Wt===void 0;if(Zs){var zp=Hp(Dt),Vp=!zp&&fT(Dt),_T=!zp&&!Vp&&gT(Dt);Wt=Dt,zp||Vp||_T?Hp(xn)?Wt=xn:qs(yT=xn)&&$p(yT)?Wt=function(tt,on){var ht=-1,Gt=tt.length;for(on||(on=Array(Gt));++ht<Gt;)on[ht]=tt[ht];return on}(xn):Vp?(Zs=!1,Wt=Dt.slice()):_T?(Zs=!1,Wt=function(tt){var on=(ht=tt.buffer,Gt=new ht.constructor(ht.byteLength),new D(Gt).set(new D(ht)),Gt),ht,Gt;return new tt.constructor(on,tt.byteOffset,tt.length)}(Dt)):Wt=[]:function(tt){if(!qs(tt)||ui(tt)!=s)return!1;var on=x(tt);if(on===null)return!0;var ht=y.call(on,"constructor")&&on.constructor;return typeof ht=="function"&&ht instanceof ht&&b.call(ht)==I}(Dt)||Up(Dt)?(Wt=xn,Up(xn)?Wt=function(tt){return function(on,ht,Gt){var oL=!Gt;Gt||(Gt={});for(var OT=-1,sL=ht.length;++OT<sL;){var Wp=ht[OT],Ou=void 0;Ou===void 0&&(Ou=on[Wp]),oL?gn(Gt,Wp,Ou):zs(Gt,Wp,Ou)}return Gt}(tt,ET(tt))}(xn):ci(xn)&&!jp(xn)||(Wt=function(tt){return typeof tt.constructor!="function"||Ks(tt)?{}:fe(x(tt))}(Dt))):Zs=!1}var yT;Zs&&(Js.set(Dt,Wt),Rt(Wt,Dt,Zn,_o,Js),Js.delete(Dt)),Vt(wt,ot,Wt)})(R,M,Le,X,Gs,re,me);else{var Ot=re?re(Fp(R,Le),Ve,Le+"",R,M,me):void 0;Ot===void 0&&(Ot=Ve),Vt(R,Le,Ot)}},ET)}function Au(R,M){return rL(function(X,re,me){return re=te(re===void 0?X.length-1:re,0),function(){for(var Ve=arguments,Le=-1,Ot=te(Ve.length-re,0),wt=Array(Ot);++Le<Ot;)wt[Le]=Ve[re+Le];Le=-1;for(var We=Array(re+1);++Le<re;)We[Le]=Ve[Le];return We[re]=me(wt),function(ot,Zn,Rt){switch(Rt.length){case 0:return ot.call(Zn);case 1:return ot.call(Zn,Rt[0]);case 2:return ot.call(Zn,Rt[0],Rt[1]);case 3:return ot.call(Zn,Rt[0],Rt[1],Rt[2])}return ot.apply(Zn,Rt)}(X,this,We)}}(R,M,vT),R+"")}var _u=k?function(R,M){return k(R,"toString",{configurable:!0,enumerable:!1,value:(X=M,function(){return X}),writable:!0});var X}:vT;function vo(R,M){var X,re,me=R.__data__;return((re=typeof(X=M))=="string"||re=="number"||re=="symbol"||re=="boolean"?X!=="__proto__":X===null)?me[typeof M=="string"?"string":"hash"]:me.map}function Xs(R,M){var X=function(re,me){return re?.[me]}(R,M);return Ws(X)?X:void 0}function Ao(R,M){var X=typeof R;return!!(M=M??r)&&(X=="number"||X!="symbol"&&l.test(R))&&R>-1&&R%1==0&&R<M}function Ks(R){var M=R&&R.constructor;return R===(typeof M=="function"&&M.prototype||T)}function Fp(R,M){if((M!=="constructor"||typeof R[M]!="function")&&M!="__proto__")return R[M]}var rL=function(R){var M=0,X=0;return function(){var re=oe(),me=16-(re-X);if(X=re,me>0){if(++M>=800)return arguments[0]}else M=0;return R.apply(void 0,arguments)}}(_u);function yu(R,M){return R===M||R!=R&&M!=M}var Up=Vs(function(){return arguments}())?Vs:function(R){return qs(R)&&y.call(R,"callee")&&!Y.call(R,"callee")},Hp=Array.isArray;function $p(R){return R!=null&&mT(R.length)&&!jp(R)}var fT=Z||function(){return!1};function jp(R){if(!ci(R))return!1;var M=ui(R);return M==o||M=="[object GeneratorFunction]"||M=="[object AsyncFunction]"||M=="[object Proxy]"}function mT(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=r}function ci(R){var M=typeof R;return R!=null&&(M=="object"||M=="function")}function qs(R){return R!=null&&typeof R=="object"}var gT=v?function(R){return function(M){return R(M)}}(v):function(R){return qs(R)&&mT(R.length)&&!!u[ui(R)]};function ET(R){return $p(R)?rn(R):vu(R)}var Yp,iL=(Yp=function(R,M,X){Gs(R,M,X)},Au(function(R,M){var X=-1,re=M.length,me=re>1?M[re-1]:void 0,Ve=re>2?M[2]:void 0;for(me=Yp.length>3&&typeof me=="function"?(re--,me):void 0,Ve&&function(Ot,wt,We){if(!ci(We))return!1;var ot=typeof wt;return!!(ot=="number"?$p(We)&&Ao(wt,We.length):ot=="string"&&wt in We)&&yu(We[wt],Ot)}(M[0],M[1],Ve)&&(me=re<3?void 0:me,re=1),R=Object(R);++X<re;){var Le=M[X];Le&&Yp(R,Le,X,me)}return R}));function vT(R){return R}n.exports=iL})(Bp,Bp.exports);const Vk=ha(Bp.exports);class Wk{constructor(e,t,r,i){this.backendRestClient=new zk(e,t,r,i)}async getApp(e){return function(t){return{appMetadata:{...t.appMetadata,id:t.appMetadata.id},features:t.features,role:Gk(t.configuration,t.features)}}(await this.backendRestClient.get("/app",{role_name:e}))}async checkIfAppExists(){return this.backendRestClient.get("/app").then(()=>!0).catch(e=>{if(e.message==="Could not find app.")return!1;throw e})}}function Gk(n,e){const t={general:{enableFileTransfers:e.includes("file_sharing"),enableLocation:e.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}},
1319
+ `,"g");return e=>Array.from(e.match(n)||[])}();function xp(n,e={except:[]}){let t=function(r,i){let o=[r];return o=Mp(o,i.multilineSteps),o=Mp(o,[Lk]),o=Mp(o,i.singlelineSteps),o=qO(o),o}(n,function(r={except:[]}){var i;const o={multilineSteps:[],singlelineSteps:[]},s=(i=r.except)!=null?i:kk.filter(a=>!r.only.includes(a));return s.includes("BulletPoint")||o.multilineSteps.push(Ik,wk),s.includes("Mention")||o.singlelineSteps.push(Sk),s.includes("CustomEmoji")||o.singlelineSteps.push(bk),s.includes("Codespan")||o.multilineSteps.push(Jn(/```([^]+?)```/g,([a,l])=>({type:"codespan",text:l}))),s.includes("FormattedLink")||o.singlelineSteps.push(GO),s.includes("Actions")||(o.singlelineSteps.push(Nk),o.singlelineSteps.push(Ck)),s.includes("Wikitext")||o.singlelineSteps.push(rk),s.includes("Autolink")||o.singlelineSteps.push(Dk,Rk),o}(e));return t=JO(t,!1),t}function KO(n){return xp(n,{except:["FormattedLink","Actions"]})}function Mp(n,e){return e.reduce((t,r)=>Hs(t,r),n)}function qO(n){const e=[];let t=-1;for(const r of n)typeof r=="string"?typeof e[t]=="string"?e[t]+=r:e[++t]=r:e[++t]="children"in r?mn(Se({},r),{children:qO(r.children)}):r;return e}function JO(n,e){const t=[];let r=[];for(let i=0;i<n.length;i++){const o=n[i];typeof o=="string"?r.push(o):"children"in o?(r.length>0&&(t.push(r.join("")),r=[]),o.children=JO(o.children,e||o.type==="link"||o.type==="actionbutton"||o.type==="actionlink"),t.push(o)):o.type==="autolink"&&e?r.push(o.text):(r.length>0&&(t.push(r.join("")),r=[]),t.push(o))}return r.length>0&&(t.push(r.join("")),r=[]),t}let xk=class{constructor(n,e,t,r){this.emoji=n,this.messageId=e,this.conversationId=t,this._realtimeClient=r}get brandedMessageId(){return this.messageId}get brandedConversationId(){return this.conversationId}add(){return H(this,null,function*(){const n=yield this._realtimeClient.call("PUT",["conversations",this.brandedConversationId,"messages",this.brandedMessageId,"reactions",this.emoji,this._realtimeClient.userId],{});Be(`Add ${this.emoji} reaction on message ${this.messageId} in conversation ${this.conversationId}`,n)})}remove(){return H(this,null,function*(){const n=yield this._realtimeClient.call("DELETE",["conversations",this.brandedConversationId,"messages",this.brandedMessageId,"reactions",this.emoji,this._realtimeClient.userId],{});(n.ok||n.where!=="server"||n.value.status!==404)&&Be(`Remove ${this.emoji} reaction from message ${this.messageId} in conversation ${this.conversationId}`,n)})}};class ZO{constructor(e,t,r){this.id=e,this.conversationId=t,this._realtimeClient=r}get brandedId(){return this.id}get brandedConversationId(){return this.conversationId}reaction(e){if(typeof e!="string")throw new Error(`Creating ReactionRef failed because emoji "${e}" is not a string`);if(e==="")throw new Error(`Creating ReactionRef failed because emoji "${e}" is an empty string`);return new xk(e,this.brandedId,this.brandedConversationId,this._realtimeClient)}get(){return H(this,null,function*(){const e=yield this._realtimeClient.call("GET",["me","conversations",this.brandedConversationId,"messages",this.brandedId],{});if(!e.ok&&e.where==="server"&&e.value.status===404||!e.ok&&e.where==="server"&&e.value.status===403&&e.value.errorCode==="NOT_A_PARTICIPANT")return null;const t=Be("Get message "+this.id,e),r=yield this._realtimeClient.createMessageSnapshot(t,this.brandedConversationId);return bp("Get message "+this.id,r)})}edit(e){return H(this,null,function*(){const t={content:Mk(e),custom:typeof e=="string"?void 0:e.custom},r=yield this._realtimeClient.call("PATCH",["conversations",this.brandedConversationId,"messages",this.brandedId],t);Be(`Edit message ${this.id} in conversation ${this.conversationId}`,r)})}delete(){return H(this,null,function*(){const e=yield this._realtimeClient.call("DELETE",["conversations",this.brandedConversationId,"messages",this.brandedId],{});(e.ok||e.where!=="server"||e.value.status!==404)&&Be(`Delete message ${this.id} in conversation ${this.conversationId}`,e)})}}function Mk(n){return typeof n=="string"?[{type:"text",children:xp(n)}]:"text"in n&&n.text?[{type:"text",children:xp(n.text)}]:"content"in n&&n.content?n.content:void 0}class Pk{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){if(typeof e=="string"){if(e==="")throw new Error(`Creating ParticipantRef failed because ID "${e}" is an empty string`);return new NO(e,this.id,this._realtimeClient)}if("brandedId"in e)return new NO(e.id,this.id,this._realtimeClient);throw new Error(`Creating ParticipantRef failed because user "${e}" is not a string or a UserRef`)}message(e){if(typeof e!="string")throw new Error(`Creating MessageRef failed because ID "${e}" is not a string`);if(e==="")throw new Error(`Creating MessageRef failed because ID "${e}" is an empty string`);return new ZO(e,this.brandedId,this._realtimeClient)}get(){return H(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&&t.where==="server"&&t.value.status===404)return null;const r=Be("Get conversation "+this.id,t),i=bp("Get last message in conversation "+this.id,yield e),o=i.length===0?null:i[0];return this._realtimeClient.createConversationSnapshotPreloaded(r,o)})}set(e){return H(this,null,function*(){const t=this._realtimeClient.call("PUT",["conversations",this.brandedId],e),r=this._realtimeClient.call("PUT",["conversations",this.brandedId,"participants",this.brandedUserId],e),i=yield t;!i.ok&&i.where==="server"&&i.value.status===403&&i.value.errorCode==="UNAUTHORIZED_TO_EDIT"&&function(s){return s.subject===void 0&&s.photoUrl===void 0&&s.welcomeMessages===void 0&&s.custom!==null&&(s.custom===void 0||!Object.values(s.custom).some(a=>a!==void 0))}(e)||Be("Set conversation "+this.id,i);const o=yield r;!o.ok&&o.where==="server"&&o.value.status===403&&o.value.errorCode==="UNAUTHORIZED_TO_EDIT_PARTICIPANT"&&function(s){return s.access===void 0&&s.notify===void 0}(e)||Be("Set your participation in conversation "+this.id,o)})}createIfNotExists(){return H(this,arguments,function*(e={}){const t=this._realtimeClient.call("POST",["conversations",this.brandedId],e),r=this._realtimeClient.call("POST",["conversations",this.brandedId,"participants",this.brandedUserId],e),i=yield t;(i.ok||i.where!=="server"||i.value.status!==409)&&Be("Create conversation "+this.id,yield t);const o=yield r;(o.ok||o.where!=="server"||o.value.status!==409)&&Be("Join conversation "+this.id,yield r)})}markAsRead(){return H(this,null,function*(){const e=yield this._realtimeClient.call("POST",["me","conversations",this.brandedId,"read"],{});Be(`Mark ${this.id} as read`,e)})}markAsUnread(){return H(this,null,function*(){const e=yield this._realtimeClient.call("POST",["me","conversations",this.brandedId,"unread"],{});Be(`Mark ${this.id} as unread`,e)})}send(e){return H(this,null,function*(){const t={content:Bk(e),referencedMessageId:Fk(e),custom:typeof e=="string"?void 0:e.custom,idempotencyKey:ek(new Date().getTime())},r=yield this._realtimeClient.call("POST",["conversations",this.brandedId,"messages"],t),i=Be("Send message to conversation "+this.id,r);return new ZO(i.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 H(this,null,function*(){const e=yield this._realtimeClient.call("POST",["me","conversations",this.brandedId,"typing"],{});Be(`Set user as typing in ${this.id}`,e)})}}function Bk(n){return typeof n=="string"?[{type:"text",children:KO(n)}]:"text"in n?[{type:"text",children:KO(n.text)}]:n.content}function Fk(n){if(typeof n=="string")return;const e=n.referencedMessage;return e!==void 0?typeof e=="string"?e:e.id:void 0}class li{constructor(e,t,r){this.realtimeWsApiUrl=e,this.internalHttpApiUrl=t,this.restApiHttpUrl=r}getBokensUrl(e,t,r){return this.internalHttpApiUrl+`/${e}/bokens/${encodeURIComponent(t)}?signature=${encodeURIComponent(r??"")}`}getRealtimeWsUrl(e,t,r,i,o){const s=encodeURIComponent(t);return this.realtimeWsApiUrl+`/${e}/realtime/${s}?talkjs-client-build=${o??"standalone"}&talkjs-core=${r}&talkjs-client-id=${i}`}static fromHost(e){const t=new li("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 r=e.match(/\w+-(\w+)\.talkjs\.com/);if(r){const i=r[1];return new li(`wss://realtime-${i}.talkjs.com/v1`,`https://app-${i}.talkjs.com/api/v0`,`https://api-${i}.talkjs.com/v1`)}return t}return e.includes("localhost")||e.includes("localtest.me")||/^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e)?new li(`ws://${e}/public_api/v1`,`http://${e}/api/v0`,`http://${e}/public_api/v1`):new li(`wss://${e}/public_api/v1`,`https://${e}/api/v0`,`https://${e}/public_api/v1`)}}function mu({method:n,url:e,data:t,options:r,attempts:i,shouldRetry:o,authProvider:s}){var a;(!i||i<=0)&&(i=1);const l={"x-talkjs-client-build":"jssdk-dev","x-talkjs-client-date":"2025-08-28T08:53:22.349Z"};return t instanceof FormData||(l["Content-Type"]=(a=r?.contentType)!=null?a:"application/json"),hO(i,()=>H(this,null,function*(){if(s){const u=yield s.getToken();l.Authorization=`Bearer ${u}`}return fetch(e,{method:n,headers:l,body:t}).then(u=>{if(u.ok)return u;throw u})}),{initialDelay:.2,log:void 0,shouldRetry:u=>H(this,null,function*(){return s&&u.status===401?(gu.log(`401 error from ${n} ${e}, ${yield s.getToken()}`),s.refreshToken(),!0):o?o(u):!("status"in u&&u.status>=400&&u.status<500)})}).catch(u=>{if(Math.random()<.1&&!e.toString().startsWith("https://capture.trackjs.com")){const c=`Network Error for ${n} ${e}`;typeof window<"u"&&(u instanceof Response?u.clone().text().then(d=>gu.log(`${c} ${u.status} ${d} (10% logged)`)):gu.log(`${c} ${u} (10% logged)`)),console.error("[TalkJS]",c)}throw u})}const{cdnHost:pL,appHost:Uk,restHost:fL,realtimeHost:mL,appProtocol:gL,appWsProtocol:EL}=function(){if(typeof window>"u")return{cdnHost:"test-hostname",appHost:"test-hostname",appProtocol:"http:",appWsProtocol:"ws:"};const n=function(){if(document.currentScript)return document.currentScript.src;try{throw new Error}catch(l){const u=l.stack.match(/https?:\/\/.*\.(js|jsx|ts|tsx)/);return u?u[0]:""}}(),e=document.createElement("a");e.href=n;const t=e.host,r=(a=t).match(/^cdn[.-]/)?a.replace(/^cdn/,"app"):a==="talkjs.com"?"app.talkjs.com":a,i=function(l){return l.match(/^app[.-]/)?l.replace(/^app/,"api"):l+"/public_api"}(r),o=function(l){return l.match(/^app[.-]/)?l.replace(/^app/,"realtime"):l+"/public_api"}(r),s=e.protocol;var a;return{cdnHost:t,appHost:r,restHost:i,realtimeHost:o,appProtocol:s,appWsProtocol:s==="https:"?"wss:":"ws:"}}(),Hk=Uk.startsWith("app.talkjs.com"),gu=typeof window>"u"?{log:n=>Promise.resolve(),setData:n=>{}}:new class{constructor(n){this._timeCreated=Date.now(),this._enabled=Hk,this._trackJSData={customer:{application:"",correlationId:"",sessionId:"",token:"",userId:"",version:"dev-2025-08-28T08:53:22.349Z"},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-28T08:53:22.349Z",throttled:0},this._url=`https://capture.trackjs.com/capture?token=${n}`,this._trackJSData.customer.token=n}setData({appId:n,meId:e,sessionId:t}){this._trackJSData.customer.userId=n,this._trackJSData.customer.sessionId=`${n}/${e}`,this._trackJSData.customer.correlationId=t}log(n){return H(this,null,function*(){try{if(!this._enabled)return Promise.resolve();const e=mn(Se({},this._trackJSData),{message:n});yield mu({method:"POST",url:this._url,data:JSON.stringify(e),options:{contentType:"text/plain"}})}catch(e){console.error("[TalkJS] Failed when sending an error report. Error: ",e)}})}}("970cd0be0fb74630b75c8451051299dc");class $k{constructor(e,t={}){this._onSubscription=t,this._handlers={};for(const r in e)Object.hasOwnProperty.call(e,r)&&(this._handlers[r]=[])}emit(e,t){for(const r of this._handlers[e])try{r(t)}catch(i){console.error(`[TalkJS] '${String(e)}' handler threw an error:`,i)}}emitAsync(e,t){return H(this,null,function*(){try{const r=this._handlers[e].map(i=>i(t));yield Promise.all(r)}catch(r){console.error(`[TalkJS] '${String(e)}' handler threw an error:`,r)}})}supports(e){return e in this._handlers}on(e,t){var r,i;if(!this.supports(e))throw new Error(`Unknown event type '${String(e)}'`);(i=(r=this._onSubscription)[e])==null||i.call(r),this._handlers[e].push(t)}off(e,t){if(!Object.hasOwnProperty.call(this._handlers,e))throw new Error(`Unknown event type '${String(e)}'`);const r=this._handlers[e].indexOf(t);r!==-1&&this._handlers[e].splice(r,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 jk{constructor(e,t,r,i,o,s){if(this.appId=t,this.userId=r,this.tokenFetcher=o,this.usingBokens=!1,this.requestInProgress=!1,this.eventEmitter=new $k({tokenChanged(a){},tokenRefreshFailed(a){},tokenAccepted(a){}}),this.sessionExpiryWarningTimeoutId=void 0,s&&(i||o))throw new Error("[TalkJS] If providing a signature for authentication, you must not provide a token or tokenFetcher.");i?this.fetchToken(()=>i):(o||(this.usingBokens=!0,this.tokenFetcher=()=>this.sendBokenRequest(e,s)),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(),e===null)return;const t=this.tokenFetcher!==void 0;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.`),this.tokenFetcher!==void 0){const r=e>600?e-300:e/2,i=Math.min(1728e6,1e3*r);this.sessionExpiryWarningTimeoutId=setTimeout(()=>{this.refreshToken()},i)}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 H(this,null,function*(){if(this.requestInProgress)return;this.requestInProgress=!0;const t=()=>H(this,null,function*(){const r=yield e();return this.checkJwt(r),r});try{const r=this.token!==void 0;this.token=t(),yield this.token.then(i=>{r&&this.emitTokenChanged(i)}).catch(i=>{this.emitTokenRefreshFailed(i)})}catch(r){this.emitTokenRefreshFailed(r)}finally{this.requestInProgress=!1}})}checkJwt(e){(function(s){if(!(typeof s=="string"||s instanceof String))throw s===void 0?"Token was undefined":"Token must be a string, got: "+s})(e);const t=[];let r,i,o;if(typeof e=="string"?r=e:t.push(`Token type is ${typeof e} instead of a string.`),r)try{const s=function(a){const l=a.split(".");if(l.length!==3)throw"Token does not contain exactly two `.`. Check that you generated your JWT correctly. It should be `<header>.<payload>.<signature>`.";return{header:QO(l[0]),payload:QO(l[1])}}(r);i=s.header,o=s.payload}catch(s){t.push(s)}if(i){const s=this.checkJwtHeader(i);t.push(...s)}if(o){const s=this.checkJwtPayload(o);t.push(...s)}if(t.length)if(this.usingBokens)gu.log(`JWT Errors detected by AuthProvider when using bokens: ${t.join(`
1320
+ `)}`);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 s=t.length>1;t.forEach((a,l)=>{const u=s?`Reason ${l+1}:`:"Reason:";console.warn(`[TalkJS] ${u} ${a}`)}),console.warn(`[TalkJS]: Authentication token: "${e}"`)}}checkJwtHeader(e){const t=[],r=e.alg;return r===void 0?t.push('Token header must contain `"alg": "HS256"`, but no `alg` was specified.'):typeof r!="string"?t.push(`Token header must contain \`"alg": "HS256"\`, but \`alg\` was ${typeof r} instead of a string. Make sure you wrap the value in "".`):r!=="HS256"&&t.push(`Token header must contain \`"alg": "HS256"\`, but \`alg\` was set to "${r}" instead. HS256 is the only supported algorithm.`),t}checkJwtPayload(e){const t=[],r=e.iss;r===void 0?t.push(`Token payload must contain an \`iss\` claim set to your app ID (${this.appId}), but \`iss\` was missing.`):typeof r!="string"?t.push(`Token payload must contain an \`iss\` claim set to your app ID (${this.appId}), but \`iss\` was ${typeof r} instead of a string. Make sure you wrap the value in "".`):r!==this.appId&&t.push(`Token payload must contain an \`iss\` claim set to your app ID (${this.appId}), but \`iss\` was set to "${r}" instead.`);const i=e.sub;i===void 0?t.push(`Token payload must contain a \`sub\` claim set to your user ID (${this.userId}), but \`sub\` was missing.`):typeof i!="string"?t.push(`Token payload must contain a \`sub\` claim set to your user ID (${this.userId}), but \`sub\` was ${typeof i} instead of a string. Make sure you wrap the value in "".`):i!==this.userId&&t.push(`Token payload must contain a \`sub\` claim set to your userId ID (${this.userId}), but \`sub\` was set to "${i}" instead.`);const o=e.tokenType;o===void 0?t.push('Token payload must contain a `"tokenType": "user"` claim, but no `tokenType` was specified.'):typeof o!="string"?t.push(`Token payload must contain a \`"tokenType": "user"\` claim, but \`tokenType\` was ${typeof o} instead of a string. Make sure you wrap the value in "".`):o!=="user"&&t.push(`Token payload must contain a \`"tokenType": "user"\` claim, but \`tokenType\` was set to "${o}" instead.`);const s=e.exp;s===void 0||(typeof s!="number"?t.push(`Token payload contains an \`exp\` claim, but \`exp\` was ${typeof o} 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 "".`):s<1e9?t.push(`Token payload contains an \`exp\` claim, but \`exp\` is very small (${s}, representing ${new Date(1e3*s).toLocaleDateString()}). If set, \`exp\` should be the expiry date as a number of seconds since 1970-01-01.`):s>1e11?t.push(`Token payload contains an \`exp\` claim, but \`exp\` is very small (${s}, representing ${new Date(1e3*s).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.`):s<new Date().getTime()/1e3&&t.push(`Token payload contains an \`exp\` claim, but \`exp\` (${s}, representing ${new Date(1e3*s).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 a=e.nbf;return a===void 0||(typeof a!="number"?t.push(`Token payload contains a \`nbf\` (not-before) claim, but \`nbf\` was ${typeof o} 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.`):a>1e11&&t.push(`Token payload contains a \`nbf\` (not-before) claim, but \`nbf\` is very large (${a}, representing ${new Date(1e3*a).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 H(this,null,function*(){let r=0;const i=e.getBokensUrl(this.appId,this.userId,t);return(yield(yield mu({method:"GET",url:i,attempts:1e4,shouldRetry:s=>{if(s instanceof Error)return!0;if(s.status===401)throw"Check that you provided a valid signature.";if(s.status===404)throw"Check that you specified the correct App ID.";if(s.status===429||s.status===502)return!0;if(s.status>=400&&s.status<500)throw`Unexpected HTTP ${s.status} response when fetching auth token. Check that you configured the session correctly.`;if(r++,r>=5)throw`Unexpected HTTP ${s.status} response when fetching auth token, retrying did not help.`;return!0}})).json()).boken})}}function QO(n){try{const e=n.replace(/-/g,"+").replace(/_/g,"/"),t=decodeURIComponent(atob(e).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join(""));return JSON.parse(t)}catch{throw`Could not base64-decode and JSON-parse token section: ${n}. Check that you base-64 encoded the section correctly.`}}class Yk{constructor(e){this.target=e}deref(){return this.target}}const eT=new class{constructor(){this.registry={}}getOrCreate(n){var e;const t=this.key(n),r=(e=this.registry[t])==null?void 0:e.deref();if(r)return r;const i=new tT(n),o=globalThis.WeakRef?new WeakRef(i):new Yk(i);return this.registry[t]=o,i}deregister(n,e){const t=this.key({appId:n,userId:e});delete this.registry[t]}key({appId:n,userId:e}){return`${n}:${e}`}};class tT{constructor(e){(function(l){function u(c,d){if(!c)throw new Error("[TalkJS] TalkSession: "+d)}u(l&&typeof l=="object","Expected an object argument in TalkSession#constructor."),u(l.appId&&typeof l.appId=="string","The `appId` property of TalkSession#constructor is required and it must be a non-empty string."),u(typeof l.userId=="string","The `userId` property of TalkSession#constructor is required and it must be a string."),l.token!==void 0&&u(l.token&&typeof l.token=="string","The `token` property of TalkSession#constructor must be a non-empty string."),l.tokenFetcher!==void 0&&u(typeof l.tokenFetcher=="function","The `tokenFetcher` property of TalkSession#constructor must be a function.")})(e);const{appId:t,userId:r,token:i,tokenFetcher:o,signature:s}=e;this._appId=t,this._apiUrls=e.apiUrls?new li(e.apiUrls.realtimeWsApiUrl,e.apiUrls.internalHttpApiUrl,e.apiUrls.restApiHttpUrl):li.fromHost(e.host),this._authProvider=new jk(this._apiUrls,t,r,i,o,s);const a=Math.random().toString().split(".")[1];this._realtimeClient=new QD(this._apiUrls.getRealtimeWsUrl(t,r,"1.5.1",a,e.clientBuild),r,this._authProvider),this.currentUser=new bO(this._realtimeClient.userId,this._realtimeClient),this._terminationReason=ri(),this._terminationReason.promise.then(l=>{console.error(`[TalkSession] ${l}`)}),function(l,u,c){return H(this,null,function*(){return mu({method:"GET",url:`${u}/${l}/app`,authProvider:c}).then(d=>d.status===200||d.status!==404&&(console.warn(`[TalkJS] Received unexpected ${d.status} status code when validating app ID. Assuming that the app ID is valid.`),!0)).catch(d=>{if(typeof d!="string"&&"status"in d){const h=d;return h.status===200||h.status!==404&&(console.warn(`[TalkJS] Received unexpected ${h.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(l=>{l||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(l=>{this.terminate(new Error(`Could not authenticate, cannot recover automatically: ${l}`))})}onError(e){const t=ri();return Promise.race([t.promise,this._terminationReason.promise]).then(r=>{r!=="UNSUBSCRIBED"&&e(r)}),{unsubscribe:()=>t.resolve("UNSUBSCRIBED")}}user(e){if(typeof e!="string")throw new Error(`Creating UserRef failed because ID "${e}" is not a string`);if(e==="")throw new Error(`Creating UserRef failed because ID "${e}" is an empty string`);return new bO(e,this._realtimeClient)}conversation(e){if(typeof e!="string")throw new Error(`Creating ConversationRef failed because ID "${e}" is not a string`);if(e==="")throw new Error(`Creating ConversationRef failed because ID "${e}" is an empty string`);return new Pk(e,this._realtimeClient)}subscribeConversations(e){return this._realtimeClient.subscribe(["me","conversations"],e)}terminate(e){eT.deregister(this._appId,this.currentUser.id),this._terminationReason.resolve(e),this._realtimeClient.destroy()}_isConnected(){return this._realtimeClient.isConnected()}uploadFile(e,t){return $s(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,t)}uploadImage(e,t){return $s(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,Se({subtype:"image"},t))}uploadVideo(e,t){return $s(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,Se({subtype:"video"},t))}uploadAudio(e,t){return $s(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,Se({subtype:"audio"},t))}uploadVoice(e,t){return $s(`${this._apiUrls.restApiHttpUrl}/${this._appId}/files`,this._authProvider,e,Se({subtype:"voice"},t))}}function $s(n,e,t,r){return H(this,arguments,function*(i,o,s,{subtype:a,filename:l,width:u,height:c,duration:d}){const h=new FormData;return h.set("file",s,l),a!==void 0&&h.set("subtype",a),u!==void 0&&h.set("width",u.toString()),c!==void 0&&h.set("height",c.toString()),d!==void 0&&h.set("duration",d.toString()),mu({method:"POST",url:i,data:h,authProvider:o}).then(p=>p.json()).then(p=>p.attachmentToken).catch(p=>H(this,null,function*(){if(p instanceof Response){const f=yield p.json(),m=`Unexpected response when uploading file, status code ${p.status} ${f.errorCode}, ${f.reasons}`;throw new Error(m)}throw p}))})}function nT(n){return Object.keys(n)}class Pp extends Error{constructor(e,t){const r=function(i){if(typeof i=="string")return i;if(Array.isArray(i))return i.join(`
1321
+ `);try{return JSON.stringify(i)}catch{return String(i)}}(e);super(r),this.userMessage=t??r,Object.setPrototypeOf&&Object.setPrototypeOf(this,new.target.prototype)}}const js=console;class zk{constructor(e,t,r,i){this.apiUrls=e,this.appId=t,this.sessionId=r,this.authProvider=i,this._lastPutPromise=Promise.resolve()}async get(e,t={}){const r=this.endpointUrl(e,t),i=await Ys(()=>this.fetchWithReauth(r),{retries:11});return await this.handleResponse(i,r)}async queuedPut(e,t){await this._lastPutPromise;const r=Ys(()=>this._doPut(e,t));return this._lastPutPromise=r,r}put(e,t,r){const i=()=>this._doPut(e,t);return r?iT(i,r):Ys(i,{retries:5})}post(e,t,r){const i=()=>this._doPost(e,t);return r?iT(i,r):Ys(i,{retries:5})}delete(e,t={}){return Ys(()=>this._doDelete(e,t),{retries:11})}endpointUrl(e,t={}){const r=new URL(this.apiUrls.internalHttpApiUrl);r.pathname+=`/${this.appId}/${e}`,r.searchParams.set("sessionId",this.sessionId);for(const[i,o]of Object.entries(t))r.searchParams.set(i,o);return r}async _doPut(e,t){const r=this.endpointUrl(e),i=await this.fetchWithReauth(r,{method:"PUT",body:JSON.stringify(t)});return await this.handleResponse(i,r)}async _doPost(e,t){const r=this.endpointUrl(e),i=await this.fetchWithReauth(r,{method:"POST",body:JSON.stringify(t)});return await this.handleResponse(i,r)}async _doDelete(e,t){const r=this.endpointUrl(e,t),i=await this.fetchWithReauth(r,{method:"DELETE"});return await this.handleResponse(i,r)}async handleResponse(e,t){if(e.status>=300){if(e.status===404)throw Bc.error(`[${this.appId}][BackendRestClient] Couldn't find resource.`),new Pp("Could not find app.",`Could not find given appId: "${this.appId}". You can find your appId on https://talkjs.com/dashboard.`);if(e.status===401){const r=await this.authProvider.getToken();throw Bc.error(`[${this.appId}][BackendRestClient] Couldn't authenticate ${t} with token ${r}.`),new Pp("User not authenticated.","Could not authenticate user. Check if your signature is calculated correctly.")}if(e.status>=300&&e.status<500){const{error:r}=await e.json();throw new Pp(r)}{const r=await e.text();throw new Error(`Got non-success response (${r}) from the server for url: ${t}.`)}}return await e.json()}async fetchWithReauth(e,t){function r(s){const a={Accept:"application/json","Content-Type":"application/json",Authorization:`Bearer ${s}`};return fetch(e,{...t,headers:a})}const i=await this.authProvider.getToken(),o=await r(i);return o.status!==401?o:(js.error(`401 error from ${t?.method} ${e}, ${i}`),this.authProvider.refreshToken(),r(await this.authProvider.getToken()))}}function rT(n){return!n.userMessage}function Ys(n,{retries:e=30}={}){return up(e,n,{shouldRetry:rT,log:js.warn.bind(js),maxDelay:30,initialDelay:.2})}async function iT(n,e){try{return await n()}catch(r){if(!rT(r))throw r}let t=!1;return e.then(()=>{t=!0}),up(1e3,n,{initialDelay:.2,maxDelay:30,shouldRetry:()=>!t,log:js.warn.bind(js)})}var Bp={exports:{}};(function(n,e){var t="__lodash_hash_undefined__",r=9007199254740991,i="[object Arguments]",o="[object Function]",s="[object Object]",a=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u[i]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u[o]=u["[object Map]"]=u["[object Number]"]=u[s]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1;var c=typeof da=="object"&&da&&da.Object===Object&&da,d=typeof self=="object"&&self&&self.Object===Object&&self,h=c||d||Function("return this")(),p=e&&!e.nodeType&&e,f=p&&n&&!n.nodeType&&n,m=f&&f.exports===p,g=m&&c.process,E=function(){try{var R=f&&f.require&&f.require("util").types;return R||g&&g.binding&&g.binding("util")}catch{}}(),v=E&&E.isTypedArray,A,_=Array.prototype,y=Function.prototype,T=Object.prototype,S=h["__core-js_shared__"],b=y.toString,O=T.hasOwnProperty,C=(A=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+A:"",w=T.toString,I=b.call(Object),F=RegExp("^"+b.call(O).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),x=m?h.Buffer:void 0,$=h.Symbol,k=h.Uint8Array;x&&x.allocUnsafe;var M,Y,L=(M=Object.getPrototypeOf,Y=Object,function(R){return M(Y(R))}),J=Object.create,j=T.propertyIsEnumerable,re=_.splice,te=$?$.toStringTag:void 0,D=function(){try{var R=Xs(Object,"defineProperty");return R({},"",{}),R}catch{}}(),Z=x?x.isBuffer:void 0,ee=Math.max,se=Date.now,U=Xs(h,"Map"),de=Xs(Object,"create"),fe=function(){function R(){}return function(P){if(!ci(P))return{};if(J)return J(P);R.prototype=P;var X=new R;return R.prototype=void 0,X}}();function Ne(R){var P=-1,X=R==null?0:R.length;for(this.clear();++P<X;){var ie=R[P];this.set(ie[0],ie[1])}}function ge(R){var P=-1,X=R==null?0:R.length;for(this.clear();++P<X;){var ie=R[P];this.set(ie[0],ie[1])}}function he(R){var P=-1,X=R==null?0:R.length;for(this.clear();++P<X;){var ie=R[P];this.set(ie[0],ie[1])}}function et(R){var P=this.__data__=new ge(R);this.size=P.size}function rn(R,P){var X=Hp(R),ie=!X&&Up(R),me=!X&&!ie&&fT(R),Ve=!X&&!ie&&!me&&gT(R),Le=X||ie||me||Ve,Ot=Le?function(ot,Zn){for(var Rt=-1,_o=Array(ot);++Rt<ot;)_o[Rt]=Zn(Rt);return _o}(R.length,String):[],wt=Ot.length;for(var We in R)Le&&(We=="length"||me&&(We=="offset"||We=="parent")||Ve&&(We=="buffer"||We=="byteLength"||We=="byteOffset")||Ao(We,wt))||Ot.push(We);return Ot}function Vt(R,P,X){(X!==void 0&&!yu(R[P],X)||X===void 0&&!(P in R))&&gn(R,P,X)}function zs(R,P,X){var ie=R[P];O.call(R,P)&&yu(ie,X)&&(X!==void 0||P in R)||gn(R,P,X)}function go(R,P){for(var X=R.length;X--;)if(yu(R[X][0],P))return X;return-1}function gn(R,P,X){P=="__proto__"&&D?D(R,P,{configurable:!0,enumerable:!0,value:X,writable:!0}):R[P]=X}Ne.prototype.clear=function(){this.__data__=de?de(null):{},this.size=0},Ne.prototype.delete=function(R){var P=this.has(R)&&delete this.__data__[R];return this.size-=P?1:0,P},Ne.prototype.get=function(R){var P=this.__data__;if(de){var X=P[R];return X===t?void 0:X}return O.call(P,R)?P[R]:void 0},Ne.prototype.has=function(R){var P=this.__data__;return de?P[R]!==void 0:O.call(P,R)},Ne.prototype.set=function(R,P){var X=this.__data__;return this.size+=this.has(R)?0:1,X[R]=de&&P===void 0?t:P,this},ge.prototype.clear=function(){this.__data__=[],this.size=0},ge.prototype.delete=function(R){var P=this.__data__,X=go(P,R);return!(X<0)&&(X==P.length-1?P.pop():re.call(P,X,1),--this.size,!0)},ge.prototype.get=function(R){var P=this.__data__,X=go(P,R);return X<0?void 0:P[X][1]},ge.prototype.has=function(R){return go(this.__data__,R)>-1},ge.prototype.set=function(R,P){var X=this.__data__,ie=go(X,R);return ie<0?(++this.size,X.push([R,P])):X[ie][1]=P,this},he.prototype.clear=function(){this.size=0,this.__data__={hash:new Ne,map:new(U||ge),string:new Ne}},he.prototype.delete=function(R){var P=vo(this,R).delete(R);return this.size-=P?1:0,P},he.prototype.get=function(R){return vo(this,R).get(R)},he.prototype.has=function(R){return vo(this,R).has(R)},he.prototype.set=function(R,P){var X=vo(this,R),ie=X.size;return X.set(R,P),this.size+=X.size==ie?0:1,this},et.prototype.clear=function(){this.__data__=new ge,this.size=0},et.prototype.delete=function(R){var P=this.__data__,X=P.delete(R);return this.size=P.size,X},et.prototype.get=function(R){return this.__data__.get(R)},et.prototype.has=function(R){return this.__data__.has(R)},et.prototype.set=function(R,P){var X=this.__data__;if(X instanceof ge){var ie=X.__data__;if(!U||ie.length<199)return ie.push([R,P]),this.size=++X.size,this;X=this.__data__=new he(ie)}return X.set(R,P),this.size=X.size,this};var Eo=function(R,P,X){for(var ie=-1,me=Object(R),Ve=X(R),Le=Ve.length;Le--;){var Ot=Ve[++ie];if(P(me[Ot],Ot,me)===!1)break}return R};function ui(R){return R==null?R===void 0?"[object Undefined]":"[object Null]":te&&te in Object(R)?function(P){var X=O.call(P,te),ie=P[te];try{P[te]=void 0;var me=!0}catch{}var Ve=w.call(P);return me&&(X?P[te]=ie:delete P[te]),Ve}(R):function(P){return w.call(P)}(R)}function Vs(R){return qs(R)&&ui(R)==i}function Ws(R){return!(!ci(R)||function(P){return!!C&&C in P}(R))&&(jp(R)?F:a).test(function(P){if(P!=null){try{return b.call(P)}catch{}try{return P+""}catch{}}return""}(R))}function vu(R){if(!ci(R))return function(me){var Ve=[];if(me!=null)for(var Le in Object(me))Ve.push(Le);return Ve}(R);var P=Ks(R),X=[];for(var ie in R)(ie!="constructor"||!P&&O.call(R,ie))&&X.push(ie);return X}function Gs(R,P,X,ie,me){R!==P&&Eo(P,function(Ve,Le){if(me||(me=new et),ci(Ve))(function(wt,We,ot,Zn,Rt,_o,Js){var xn=Fp(wt,ot),Dt=Fp(We,ot),AT=Js.get(Dt);if(AT)return void Vt(wt,ot,AT);var Wt=_o?_o(xn,Dt,ot+"",wt,We,Js):void 0,Zs=Wt===void 0;if(Zs){var zp=Hp(Dt),Vp=!zp&&fT(Dt),_T=!zp&&!Vp&&gT(Dt);Wt=Dt,zp||Vp||_T?Hp(xn)?Wt=xn:qs(yT=xn)&&$p(yT)?Wt=function(tt,on){var ht=-1,Gt=tt.length;for(on||(on=Array(Gt));++ht<Gt;)on[ht]=tt[ht];return on}(xn):Vp?(Zs=!1,Wt=Dt.slice()):_T?(Zs=!1,Wt=function(tt){var on=(ht=tt.buffer,Gt=new ht.constructor(ht.byteLength),new k(Gt).set(new k(ht)),Gt),ht,Gt;return new tt.constructor(on,tt.byteOffset,tt.length)}(Dt)):Wt=[]:function(tt){if(!qs(tt)||ui(tt)!=s)return!1;var on=L(tt);if(on===null)return!0;var ht=O.call(on,"constructor")&&on.constructor;return typeof ht=="function"&&ht instanceof ht&&b.call(ht)==I}(Dt)||Up(Dt)?(Wt=xn,Up(xn)?Wt=function(tt){return function(on,ht,Gt){var oL=!Gt;Gt||(Gt={});for(var OT=-1,sL=ht.length;++OT<sL;){var Wp=ht[OT],Ou=void 0;Ou===void 0&&(Ou=on[Wp]),oL?gn(Gt,Wp,Ou):zs(Gt,Wp,Ou)}return Gt}(tt,ET(tt))}(xn):ci(xn)&&!jp(xn)||(Wt=function(tt){return typeof tt.constructor!="function"||Ks(tt)?{}:fe(L(tt))}(Dt))):Zs=!1}var yT;Zs&&(Js.set(Dt,Wt),Rt(Wt,Dt,Zn,_o,Js),Js.delete(Dt)),Vt(wt,ot,Wt)})(R,P,Le,X,Gs,ie,me);else{var Ot=ie?ie(Fp(R,Le),Ve,Le+"",R,P,me):void 0;Ot===void 0&&(Ot=Ve),Vt(R,Le,Ot)}},ET)}function Au(R,P){return rL(function(X,ie,me){return ie=ee(ie===void 0?X.length-1:ie,0),function(){for(var Ve=arguments,Le=-1,Ot=ee(Ve.length-ie,0),wt=Array(Ot);++Le<Ot;)wt[Le]=Ve[ie+Le];Le=-1;for(var We=Array(ie+1);++Le<ie;)We[Le]=Ve[Le];return We[ie]=me(wt),function(ot,Zn,Rt){switch(Rt.length){case 0:return ot.call(Zn);case 1:return ot.call(Zn,Rt[0]);case 2:return ot.call(Zn,Rt[0],Rt[1]);case 3:return ot.call(Zn,Rt[0],Rt[1],Rt[2])}return ot.apply(Zn,Rt)}(X,this,We)}}(R,P,vT),R+"")}var _u=D?function(R,P){return D(R,"toString",{configurable:!0,enumerable:!1,value:(X=P,function(){return X}),writable:!0});var X}:vT;function vo(R,P){var X,ie,me=R.__data__;return((ie=typeof(X=P))=="string"||ie=="number"||ie=="symbol"||ie=="boolean"?X!=="__proto__":X===null)?me[typeof P=="string"?"string":"hash"]:me.map}function Xs(R,P){var X=function(ie,me){return ie?.[me]}(R,P);return Ws(X)?X:void 0}function Ao(R,P){var X=typeof R;return!!(P=P??r)&&(X=="number"||X!="symbol"&&l.test(R))&&R>-1&&R%1==0&&R<P}function Ks(R){var P=R&&R.constructor;return R===(typeof P=="function"&&P.prototype||T)}function Fp(R,P){if((P!=="constructor"||typeof R[P]!="function")&&P!="__proto__")return R[P]}var rL=function(R){var P=0,X=0;return function(){var ie=se(),me=16-(ie-X);if(X=ie,me>0){if(++P>=800)return arguments[0]}else P=0;return R.apply(void 0,arguments)}}(_u);function yu(R,P){return R===P||R!=R&&P!=P}var Up=Vs(function(){return arguments}())?Vs:function(R){return qs(R)&&O.call(R,"callee")&&!j.call(R,"callee")},Hp=Array.isArray;function $p(R){return R!=null&&mT(R.length)&&!jp(R)}var fT=Z||function(){return!1};function jp(R){if(!ci(R))return!1;var P=ui(R);return P==o||P=="[object GeneratorFunction]"||P=="[object AsyncFunction]"||P=="[object Proxy]"}function mT(R){return typeof R=="number"&&R>-1&&R%1==0&&R<=r}function ci(R){var P=typeof R;return R!=null&&(P=="object"||P=="function")}function qs(R){return R!=null&&typeof R=="object"}var gT=v?function(R){return function(P){return R(P)}}(v):function(R){return qs(R)&&mT(R.length)&&!!u[ui(R)]};function ET(R){return $p(R)?rn(R):vu(R)}var Yp,iL=(Yp=function(R,P,X){Gs(R,P,X)},Au(function(R,P){var X=-1,ie=P.length,me=ie>1?P[ie-1]:void 0,Ve=ie>2?P[2]:void 0;for(me=Yp.length>3&&typeof me=="function"?(ie--,me):void 0,Ve&&function(Ot,wt,We){if(!ci(We))return!1;var ot=typeof wt;return!!(ot=="number"?$p(We)&&Ao(wt,We.length):ot=="string"&&wt in We)&&yu(We[wt],Ot)}(P[0],P[1],Ve)&&(me=ie<3?void 0:me,ie=1),R=Object(R);++X<ie;){var Le=P[X];Le&&Yp(R,Le,X,me)}return R}));function vT(R){return R}n.exports=iL})(Bp,Bp.exports);const Vk=ha(Bp.exports);class Wk{constructor(e,t,r,i){this.backendRestClient=new zk(e,t,r,i)}async getApp(e){return function(t){return{appMetadata:{...t.appMetadata,id:t.appMetadata.id},features:t.features,role:Gk(t.configuration,t.features)}}(await this.backendRestClient.get("/app",{role_name:e}))}async checkIfAppExists(){return this.backendRestClient.get("/app").then(()=>!0).catch(e=>{if(e.message==="Could not find app.")return!1;throw e})}}function Gk(n,e){const t={general:{enableFileTransfers:e.includes("file_sharing"),enableLocation:e.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}},
1322
1322
  {{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}},
1323
1323
  The {{app.name}} team`,enableReplyToEmail:e.includes("reply_via_email"),emailThemeType:e.includes("email_templates")?"custom":"standard",emailTheme:"default_email",emailAttachmentMode:"enabledExcludingImages",htmlTemplate:`<div>
1324
1324
  Hi {{recipient.name}}, <br/>
@@ -1342,11 +1342,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1342
1342
  {{app.custom.websiteUrl}} Join the chat
1343
1343
 
1344
1344
  On behalf of {{sender.name}},
1345
- The {{app.name}} team`},smsSettings:{enabled:e.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 Vk(t,n)}class mo{constructor(e,t,r){this.realtimeWsApiUrl=e,this.internalHttpApiUrl=t,this.restApiHttpUrl=r}getBokensUrl(e,t,r){return this.internalHttpApiUrl+`/${e}/bokens/${encodeURIComponent(t)}?signature=${encodeURIComponent(r??"")}`}getRealtimeWsUrl(e,t,r,i,o){const s=encodeURIComponent(t);return this.realtimeWsApiUrl+`/${e}/realtime/${s}?talkjs-client-build=${o??"standalone"}&talkjs-core=${r}&talkjs-client-id=${i}`}static fromHost(e){const t=new mo("wss://realtime.talkjs.com/v1","https://app.talkjs.com/api/v0","https://api.talkjs.com/v1");if(!e)return t;if(e==="@currentHost"){if(typeof location>"u")throw new Error("You can only use @currentHost in a browser.");e=(window.top??window).location.host}if(e.endsWith("talkjs.com")){const r=e.match(/\w+-(\w+)\.talkjs\.com/);if(r){const i=r[1];return new mo(`wss://realtime-${i}.talkjs.com/v1`,`https://app-${i}.talkjs.com/api/v0`,`https://api-${i}.talkjs.com/v1`)}return t}return e.includes("localhost")||e.includes("localtest.me")||/^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e)?new mo(`ws://${e}/public_api/v1`,`http://${e}/api/v0`,`http://${e}/public_api/v1`):new mo(`wss://${e}/public_api/v1`,`https://${e}/api/v0`,`https://${e}/public_api/v1`)}}function oT(n,e){const t=e.appId,r=e.userId,i="conversationId"in e?e.conversationId:void 0,o=ce(()=>mo.fromHost(e.host),[e.host]);pt(()=>{n.updateThemeCustom(e.themeCustom)},[n,e.themeCustom]);const s=ce(()=>iO(),[e.appId,e.userId,e.token,e.tokenFetcher]),a=function(u){return u.forceCreateNew?new tT(u):eT.getOrCreate(u)}({apiUrls:o,appId:t,userId:r,token:e.token,tokenFetcher:e.tokenFetcher});V(()=>n.listenForErrors(a,i),[a,n,i]);const l=ce(()=>new Wk(o,t,s,a._authProvider),[t,s,a,o]);return V(()=>n.listenForAuthChanges(a,e.tokenFetcher),[a,n,e.tokenFetcher]),V(()=>n.listenForUserAndAppChanges(a,l),[n,l,a]),{session:a,restApi:l}}function Eu(n,e,t){return ie(r=>{n&&n(r),e?.tagName!=="T-CHATBOX"&&e?.tagName!=="T-CONVERSATION-LIST"||function(i,o,s){for(const a of s){const l=new Event(a);Object.assign(l,o),i.dispatchEvent(l)}}(e,r,t)},[n,e,t])}function sT(n){V(()=>{if(window.cordova){const e=n.current;Ie.defined(e);const t=r=>{r.target instanceof HTMLAnchorElement&&(r.preventDefault(),function(i){const o=window;o.cordova.InAppBrowser?o.cordova.InAppBrowser.open(i,"_system"):window.open(i,"_system","location=yes")}(r.target.href))};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)}},[n])}function aT(n,e,t){return n.clearRect(0,0,100,100),n.fillStyle=t,n.fillText(e,0,0),n.getImageData(0,0,1,1).data.join(",")}function lT(n){const e=function(){const i=document.createElement("canvas");i.width=i.height=1;const o=i.getContext("2d",{willReadFrequently:!0});return o.textBaseline="top",o.font='100px "Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',o.scale(.01,.01),o}(),t=aT(e,n,"#fff"),r=aT(e,n,"#000");return r===t&&!r.startsWith("0,0,0,")}function uT(){const[n,e]=ne(!0);return V(()=>{e(!1)},[]),n}(function(n="Twemoji Country Flags",e="https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2"){if(typeof window<"u"&&lT("😊")&&!lT("🇨🇭")){const t=document.createElement("style");return t.textContent=`@font-face {
1345
+ The {{app.name}} team`},smsSettings:{enabled:e.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 Vk(t,n)}class mo{constructor(e,t,r){this.realtimeWsApiUrl=e,this.internalHttpApiUrl=t,this.restApiHttpUrl=r}getBokensUrl(e,t,r){return this.internalHttpApiUrl+`/${e}/bokens/${encodeURIComponent(t)}?signature=${encodeURIComponent(r??"")}`}getRealtimeWsUrl(e,t,r,i,o){const s=encodeURIComponent(t);return this.realtimeWsApiUrl+`/${e}/realtime/${s}?talkjs-client-build=${o??"standalone"}&talkjs-core=${r}&talkjs-client-id=${i}`}static fromHost(e){const t=new mo("wss://realtime.talkjs.com/v1","https://app.talkjs.com/api/v0","https://api.talkjs.com/v1");if(!e)return t;if(e==="@currentHost"){if(typeof location>"u")throw new Error("You can only use @currentHost in a browser.");e=(window.top??window).location.host}if(e.endsWith("talkjs.com")){const r=e.match(/\w+-(\w+)\.talkjs\.com/);if(r){const i=r[1];return new mo(`wss://realtime-${i}.talkjs.com/v1`,`https://app-${i}.talkjs.com/api/v0`,`https://api-${i}.talkjs.com/v1`)}return t}return e.includes("localhost")||e.includes("localtest.me")||/^\d+\.\d+\.\d+\.\d+(:\d+)?$/.test(e)?new mo(`ws://${e}/public_api/v1`,`http://${e}/api/v0`,`http://${e}/public_api/v1`):new mo(`wss://${e}/public_api/v1`,`https://${e}/api/v0`,`https://${e}/public_api/v1`)}}function oT(n,e){const t=e.appId,r=e.userId,i="conversationId"in e?e.conversationId:void 0,o=ce(()=>mo.fromHost(e.host),[e.host]);pt(()=>{n.updateThemeCustom(e.themeCustom)},[n,e.themeCustom]);const s=ce(()=>iO(),[e.appId,e.userId,e.token,e.tokenFetcher]),a=function(u){return u.forceCreateNew?new tT(u):eT.getOrCreate(u)}({apiUrls:o,appId:t,userId:r,token:e.token,tokenFetcher:e.tokenFetcher});V(()=>n.listenForErrors(a,i),[a,n,i]);const l=ce(()=>new Wk(o,t,s,a._authProvider),[t,s,a,o]);return V(()=>n.listenForAuthChanges(a,e.tokenFetcher),[a,n,e.tokenFetcher]),V(()=>n.listenForUserAndAppChanges(a,l),[n,l,a]),{session:a,restApi:l}}function Eu(n,e,t){return oe(r=>{n&&n(r),e?.tagName!=="T-CHATBOX"&&e?.tagName!=="T-CONVERSATION-LIST"||function(i,o,s){for(const a of s){const l=new Event(a);Object.assign(l,o),i.dispatchEvent(l)}}(e,r,t)},[n,e,t])}function sT(n){V(()=>{if(window.cordova){const e=n.current;Ie.defined(e);const t=r=>{r.target instanceof HTMLAnchorElement&&(r.preventDefault(),function(i){const o=window;o.cordova.InAppBrowser?o.cordova.InAppBrowser.open(i,"_system"):window.open(i,"_system","location=yes")}(r.target.href))};return e.addEventListener("click",t),()=>e.removeEventListener("click",t)}},[n])}function aT(n,e,t){return n.clearRect(0,0,100,100),n.fillStyle=t,n.fillText(e,0,0),n.getImageData(0,0,1,1).data.join(",")}function lT(n){const e=function(){const i=document.createElement("canvas");i.width=i.height=1;const o=i.getContext("2d",{willReadFrequently:!0});return o.textBaseline="top",o.font='100px "Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif',o.scale(.01,.01),o}(),t=aT(e,n,"#fff"),r=aT(e,n,"#000");return r===t&&!r.startsWith("0,0,0,")}function uT(){const[n,e]=ne(!0);return V(()=>{e(!1)},[]),n}(function(n="Twemoji Country Flags",e="https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2"){if(typeof window<"u"&&lT("😊")&&!lT("🇨🇭")){const t=document.createElement("style");return t.textContent=`@font-face {
1346
1346
  font-family: "${n}";
1347
1347
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067,
1348
1348
  U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
1349
1349
  src: url('${e}') format('woff2');
1350
1350
  font-display: swap;
1351
- }`,document.head.appendChild(t),!0}})(),oh(),function({observableFunctions:n,observableProperties:e,jsonReplacer:t,jsonReviver:r}){if(n)for(const i in n){const o=n[i];Ba.set(i,o),wr.prototype[i]=function(...s){return o.call(this,this._node,...s)}}if(e)for(const i in e){const o=e[i];Rc.set(i,o),Object.defineProperty(wr.prototype,i,{configurable:!0,get(){return o.get.call(this,this._node)},set(s){return o.set.call(this,this._node,s)}})}t&&(De.replacer=t),r&&(De.reviver=r)}({observableFunctions:{child:(n,e)=>(Ie(typeof e=="string"||typeof e=="number","Key should be a string or a number"),gg.getProxy(n,e.toString()))}}),Un.registerHandler(({level:n,data:e})=>{console[n]("[TalkJS]",...e)});const Xk=ee(function(n,e){const{onSendMessage:t,onDeleteMessage:r,beforeBrowserPermissionPrompt:i,onMissingBrowserPermission:o,messageFieldPlaceholder:s,messageFieldSpellcheck:a,__hostElement:l}=n;V(()=>{n.__internalOnLoaded?.()},[]);const u=uT(),c=W(null);sT(c);const d=Eu(r,l,["deleteMessage","delete-message","deletemessage","DeleteMessage"]),h=Eu(t,l,["sendMessage","send-message","sendmessage","SendMessage"]),p={beforeBrowserPermissionPrompt:i,onMissingBrowserPermissionCallback:Eu(o,l,["browserPermissionDenied","browser-permission-denied","browserpermissiondenied","BrowserPermissionDenied"])},{store:f,controller:m,editorInternals:g,session:E}=function(_,O,T){const S=_.appId,b=_.userId,y=_.conversationId,C=ce(()=>new Dg,[_.appId]),{session:w,restApi:I}=oT(C,_),F=ce(()=>new Zy(C.state$.editor,C.device$,C.state$.userPermissions),[C]),L=ce(()=>new ED(C,w,F,O,T),[w,C,F,O,T]);return F.controller=L,V(()=>{let j,D=!0;C.resetState(S,b,y);const B=w.currentUser.subscribe(async J=>{if(D&&(C.errors$.unknownUser.set(!J),J&&(C.currentUser$.set(J),J.role!==j))){j=J.role;const se=await I.getApp(J.role);if(!D)return;C.app$.set(se)}}),H=w.conversation(y).subscribeMessages(async(J,se)=>{D&&J&&(await C.readyForNewMessagesPromise,C.storeMessages(y,J,se))});C.messageSubscription=H;const x=w.conversation(y).subscribeParticipants(J=>{D&&J&&C.state$.participants.child(y).set(J)});C.participantSubscription=x;const Q=w.conversation(y).subscribe(async J=>{D&&J&&C.state$.currentConversation.set(J)}),Y=w.conversation(y).subscribeTyping(J=>{D&&J&&C.storeTyping(y,J)});return()=>{D=!1,B.unsubscribe(),x.unsubscribe(),Q.unsubscribe(),H.unsubscribe(),Y.unsubscribe(),C.messageSubscription=null}},[y,b,S,I,w,C,L]),V(()=>{const j=C.state$.participants.child(y).onChange(({value:D})=>{if(!D)return;const B=new Set;for(const H of D)B.add(H.user.id);zo(()=>{for(const H of nT(C.onlineSubscriptions))B.has(H)||(C.onlineSubscriptions[H]?.unsubscribe(),delete C.onlineSubscriptions[H],C.state$.isUserConnected.child(H).set(!1))});for(const H of B)C.onlineSubscriptions[H]||(C.onlineSubscriptions[H]=w.user(H).subscribeOnline(x=>{x&&C.state$.isUserConnected.child(H).set(x.isConnected)}))},{initial:!0});return()=>{j();for(const D of nT(C.onlineSubscriptions))C.onlineSubscriptions[D].unsubscribe();C.onlineSubscriptions={},C.state$.isUserConnected.set({})}},[C,y,w]),{store:C,controller:L,editorInternals:F,session:w}}(n,h,d),v=ie(async()=>{const _=g.state$;if(_.isEmpty.peek()||_.atTextLimit.peek())return;const O=g.getText(),T=f.state$.referencedMessageId.peek();T&&m.setReferencedMessage(null),g.clearText(),f.state$.editor.showEmojiPicker.set(!1),await m.sendMessage({text:O,referencedMessage:T??void 0})},[m,g,f]);V(()=>{const _=n.enterSendsMessage??!0;g.onEnter=_?v:void 0},[g,n.enterSendsMessage,v]),V(()=>{g.spellcheck$.set(a)},[g,a]),V(()=>{g.placeholder$.set(s)},[g,s]),wo(e,()=>({deleteMessage:_=>m.deleteMessage(_),setEditing:_=>m.setEditing(_),editMessage:(_,O)=>m.editMessage(_,O),sendMessage:_=>m.sendMessage(_),sendFileMessage:_=>m.sendFileMessage(_),sendLocationMessage:_=>m.sendLocationMessage(_),setReferencedMessage:_=>m.setReferencedMessage(_),getMessageFieldText:()=>g.getText(),setMessageFieldText:_=>g.setText(_)}));const A=ie(({error:_})=>N(eu,{appId:n.appId,chatboxState:{type:"unexpected-error",error:_}}),[n.appId]);return N("div",u?{className:"t-chatbox",ref:c}:{className:"t-chatbox",ref:c,children:N(Ky,{fallbackRender:A,children:N(Mm.Provider,{value:g,children:N(Ac.Provider,{value:f,children:N(xm.Provider,{value:n.theme,children:N(Pm.Provider,{value:p,children:N(_c.Provider,{value:m,children:N(Bm.Provider,{value:E,children:N(ZS.Provider,{value:{sendMessage:v},children:N(mD,{appId:n.appId,chatHeaderVisible:n.chatHeaderVisible??!0,messageFieldVisible:n.messageFieldVisible??!0})})})})})})})})})})});function Kk({conversation:n}){const e=Re(),t=Bo(),r=sn(),i=Tg(),o=ye(e.extCurrentConversationId$),[s,a]=ne([]);return V(()=>{const l=t.conversation(n.id).subscribeParticipants(async u=>{u&&a(u)});return()=>l.unsubscribe()},[t,n.id]),s?N(r.ConversationListItem,{common:i,conversation:n,participants:s,isSelected:o===n.id}):null}function qk(){const n=Re(),e=W(null);V(()=>{let r=!0;const i=e.current;return async function(){let o=0;for(;r&&n.conversationListSubscription&&i.scrollHeight===i.clientHeight&&o<2;)await n.conversationListSubscription?.loadMore(20),o+=1}(),()=>{r=!1}},[n]);const t=ie(r=>{const i=r.currentTarget;i.scrollHeight-i.clientHeight-i.scrollTop<15&&n.conversationListSubscription&&n.conversationListSubscription.loadMore(20)},[n]);return N("div",{className:"t-conversation-list-scrollable",ref:e,"t-menu-boundary":"",onScroll:t,children:N(Pc,{each:n.conversationsArray$,children:r=>N(Kk,{conversation:r.get()})})})}function Jk({appId:n}){Re();const e=function(){const t=Re(),r=rr(()=>{const s=t.currentUser$.get(),a=t.app$.get(),l=t.errors$.get(),u=t.authTokenState$.get();return l.serverError?"server-error":l.wrongAppId?"wrong-app-id":u==="loading"||u==="idle"?"loading-token":u==="invalid"?"invalid-token":u==="expired"?"expired-token":u==="valid"?l.unknownUser?"unknown-user":s&&a?"loaded":"loading-data":void Ie.unreachable()}),i=rr({type:"loading"});ki(s=>{const a=r.get(),l=t.extUserId$.peek(),u=t.appId$.peek();switch(a){case"invalid-token":i.set({type:"auth-failed"});break;case"expired-token":i.set({type:"expired-token"});break;case"wrong-app-id":i.set({type:"wrong-app-id",appId:u});break;case"server-error":i.set({type:"server-error"});break;case"loading-data":case"loading-token":i.set({type:"loading"});break;case"loaded":i.set({type:"loaded",currentUser:t.currentUser$.peek()});break;case"unknown-user":s.onCleanup=function(c){i.set({type:"loading"});const d=setTimeout(()=>{i.set(c)},5e3);return()=>clearTimeout(d)}({type:"unknown-user",userId:l});break;default:Ie.never(a)}});const o=rr({type:"loading"});return ki(s=>{if(i.type.get()==="loading"){o.set({type:"invisible-loading"});const a=setTimeout(()=>{o.set({type:"loading"})},1e3);s.onCleanup=()=>{clearTimeout(a)}}else o.set(i.get())}),ye(o)}();return e.type==="invisible-loading"?N(xe,{}):e.type==="loading"?N(eO,{}):e.type==="unknown-user"||e.type==="auth-failed"||e.type==="wrong-app-id"||e.type==="server-error"||e.type==="unexpected-error"?N(eu,{appId:n,chatboxState:e}):e.type=="expired-token"?N(tO,{}):e.type==="loaded"?N(qk,{}):N(xe,{})}class Zk{constructor(e,t){this.store=e,this.onSelectConversation=t}selectConversation(e){if(e===this.store.extCurrentConversationId$.peek())return;this.store.extCurrentConversationId$.set(e);const t={currentUser:this.store.currentUser$.peek(),conversation:this.store.conversationsMap$.child(e).peek()};this.onSelectConversation(t)}}const Qk=ee(function(n,e){V(()=>{n.__internalOnLoaded?.()},[]);const t=uT(),r=W(null);sT(r);const i=Eu(n.onSelectConversation,n.__hostElement,["selectConversation","select-conversation","selectconversation","SelectConversation"]),o=ce(()=>new Pv,[n.appId]),{session:s}=oT(o,n);V(()=>{o.resetState(n.appId,n.userId)},[o,n.appId,n.userId]);const a=ce(()=>new Zk(o,i),[o,i]);V(()=>o.listenForConversations(s),[o,s]),V(()=>{n.selectedConversationId!==void 0&&o.extCurrentConversationId$.set(n.selectedConversationId)},[o,n.selectedConversationId]),wo(e,()=>({selectConversation:u=>a.selectConversation(u)}));const l=ie(({error:u})=>N(eu,{appId:n.appId,chatboxState:{type:"unexpected-error",error:u}}),[n.appId]);return N("div",t?{className:"t-conversation-list",ref:r}:{className:"t-conversation-list",ref:r,children:N(Ky,{fallbackRender:l,children:N(Ac.Provider,{value:o,children:N(xm.Provider,{value:n.theme,children:N(_c.Provider,{value:a,children:N(Bm.Provider,{value:s,children:N(Jk,{appId:n.appId})})})})})})})}),eL=new Promise(n=>{typeof document<"u"&&document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n(void 0)});function cT(n,e,t,r){const i=new Map,o=[],s=[];for(const[c,d]of(a=t,Object.entries(a))){const h=[c,c.toLowerCase(),tL(c)];for(const p of h)i.set(p,c);["string","boolean","number"].includes(d.type)&&o.push(...h),d.required!==!1&&s.push(c)}var a;class l extends HTMLElement{constructor(){super(),this._renderRequested=!1,this._props={},this._renderRoot=null,this._ref={current:null};for(const[d,h]of i){if(Object.hasOwnProperty.call(this,d)){const p=this[d];this.updateProp(h,p),delete this[d]}this.hasAttribute(d)&&this.syncAttributeToProp(d)}}static{this.observedAttributes=o}updateProp(d,h){const{type:p}=t[d];if(p==="boolean"&&typeof h=="string"?h=h!=="false":p==="number"&&typeof h=="string"&&(h=Number(h)),h==null){const f=d in this._props;return delete this._props[d],f}{const f=this._props[d]!==h;return this._props[d]=h,f}}syncAttributeToProp(d){const h=i.get(d);Ie(h,`Attribute "${d}" should have matching prop`);const p=this.getAttribute(d);return this.updateProp(h,p)}async requestRender(){this._renderRequested||(this._renderRequested=!0,this._renderRequested=await!1,this.render())}render(){var d;this._renderRoot||(this._renderRoot=(d=this,{render:function(g){Xu(g,d)},unmount:function(){qu(d)}}));const h=s.filter(g=>!(g in this._props));if(h.length>0)return r(h),void this._renderRoot.render(null);const p=Object.assign({},this._props),f=g=>{for(const[E,v]of Object.entries(g.current))typeof v=="function"&&(this[E]=(...A)=>g.current[E](...A))},m=n;this._renderRoot.render(N(m,{...p,ref:this._ref,__hostElement:this,__internalOnLoaded:()=>{f(this._ref)}}))}async connectedCallback(){await eL;for(const d of o)this.hasAttribute(d)&&this.syncAttributeToProp(d);this.requestRender()}disconnectedCallback(){this._renderRoot&&setTimeout(()=>{this._renderRoot&&(this._renderRoot.unmount(),this._renderRoot=null)})}attributeChangedCallback(d,h,p){h!==p&&this.syncAttributeToProp(d)&&this.requestRender()}}const u={};for(const[c,d]of i)u[c]={set(h){this.updateProp(d,h)&&this.requestRender()},get(){return this._props[d]??null}};return Object.defineProperties(l.prototype,u),Object.defineProperty(l,"name",{value:e}),l}function tL(n){return n.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase())}function dT(n,e){const t=JSON.stringify(e).replace(",",", ");Un.error(`Could not initialize ${n} because the following required props are missing: ${t}.`)}const hT=function(n){const e=function(r){return ee(function(i,o){return N(Xk,{...i,theme:i.theme??r,ref:o})})}(n);return cT(e,"ChatboxHTMLElement",{__internalOnLoaded:{type:"function",required:!1},appId:{type:"string"},userId:{type:"string"},conversationId:{type:"string"},theme:{type:"object",required:!1},token:{type:"string",required:!1},tokenFetcher:{type:"function",required:!1},host:{type:"string",required:!1},enterSendsMessage:{type:"boolean",required:!1},chatHeaderVisible:{type:"boolean",required:!1},messageFieldVisible:{type:"boolean",required:!1},messageFieldSpellcheck:{type:"boolean",required:!1},messageFieldPlaceholder:{type:"string",required:!1},onSendMessage:{type:"function",required:!1},onDeleteMessage:{type:"function",required:!1},beforeBrowserPermissionPrompt:{type:"function",required:!1},onMissingBrowserPermission:{type:"function",required:!1},themeCustom:{type:"object",required:!1}},r=>dT("<t-chatbox>",r))}(ap),pT=function(n){const e=function(r){return ee(function(i,o){return N(Qk,{...i,theme:i.theme??r,ref:o})})}(n);return cT(e,"ConversationListHTMLElement",{__internalOnLoaded:{type:"function",required:!1},appId:{type:"string"},userId:{type:"string"},selectedConversationId:{type:"string",required:!1},theme:{type:"object",required:!1},token:{type:"string",required:!1},tokenFetcher:{type:"function",required:!1},host:{type:"string",required:!1},themeCustom:{type:"object",required:!1}},r=>dT("<t-conversation-list>",r))}(ap),nL=ap;return customElements.get("t-chatbox")||customElements.define("t-chatbox",hT),customElements.get("t-conversation-list")||customElements.define("t-conversation-list",pT),To.ChatboxHTMLElement=hT,To.ConversationListHTMLElement=pT,To.defaultTheme=nL,Object.defineProperty(To,Symbol.toStringTag,{value:"Module"}),To}({});
1351
+ }`,document.head.appendChild(t),!0}})(),oh(),function({observableFunctions:n,observableProperties:e,jsonReplacer:t,jsonReviver:r}){if(n)for(const i in n){const o=n[i];Ba.set(i,o),wr.prototype[i]=function(...s){return o.call(this,this._node,...s)}}if(e)for(const i in e){const o=e[i];Rc.set(i,o),Object.defineProperty(wr.prototype,i,{configurable:!0,get(){return o.get.call(this,this._node)},set(s){return o.set.call(this,this._node,s)}})}t&&(De.replacer=t),r&&(De.reviver=r)}({observableFunctions:{child:(n,e)=>(Ie(typeof e=="string"||typeof e=="number","Key should be a string or a number"),gg.getProxy(n,e.toString()))}}),Un.registerHandler(({level:n,data:e})=>{console[n]("[TalkJS]",...e)});const Xk=Q(function(n,e){const{onSendMessage:t,onDeleteMessage:r,beforeBrowserPermissionPrompt:i,onMissingBrowserPermission:o,messageFieldPlaceholder:s,messageFieldSpellcheck:a,__hostElement:l}=n;V(()=>{n.__internalOnLoaded?.()},[]);const u=uT(),c=W(null);sT(c);const d=Eu(r,l,["deleteMessage","delete-message","deletemessage","DeleteMessage"]),h=Eu(t,l,["sendMessage","send-message","sendmessage","SendMessage"]),p={beforeBrowserPermissionPrompt:i,onMissingBrowserPermissionCallback:Eu(o,l,["browserPermissionDenied","browser-permission-denied","browserpermissiondenied","BrowserPermissionDenied"])},{store:f,controller:m,editorInternals:g,session:E}=function(y,T,S){const b=y.appId,O=y.userId,C=y.conversationId,w=ce(()=>new Dg,[y.appId]),{session:I,restApi:F}=oT(w,y),x=ce(()=>new Zy(w.state$.editor,w.device$,w.state$.userPermissions),[w]),$=ce(()=>new ED(w,I,x,T,S),[I,w,x,T,S]);return x.controller=$,V(()=>{let k,M=!0;w.resetState(b,O,C);const Y=I.currentUser.subscribe(async te=>{if(M&&(w.errors$.unknownUser.set(!te),te&&(w.currentUser$.set(te),te.role!==k))){k=te.role;const D=await F.getApp(te.role);if(!M)return;w.app$.set(D)}}),L=I.conversation(C).subscribeMessages(async(te,D)=>{M&&te&&(await w.readyForNewMessagesPromise,w.storeMessages(C,te,D))});w.messageSubscription=L;const J=I.conversation(C).subscribeParticipants(te=>{M&&te&&w.state$.participants.child(C).set(te)});w.participantSubscription=J;const j=I.conversation(C).subscribe(async te=>{M&&te&&w.state$.currentConversation.set(te)}),re=I.conversation(C).subscribeTyping(te=>{M&&te&&w.storeTyping(C,te)});return()=>{M=!1,Y.unsubscribe(),J.unsubscribe(),j.unsubscribe(),L.unsubscribe(),re.unsubscribe(),w.messageSubscription=null}},[C,O,b,F,I,w,$]),V(()=>{const k=w.state$.participants.child(C).onChange(({value:M})=>{if(!M)return;const Y=new Set;for(const L of M)Y.add(L.user.id);zo(()=>{for(const L of nT(w.onlineSubscriptions))Y.has(L)||(w.onlineSubscriptions[L]?.unsubscribe(),delete w.onlineSubscriptions[L],w.state$.isUserConnected.child(L).set(!1))});for(const L of Y)w.onlineSubscriptions[L]||(w.onlineSubscriptions[L]=I.user(L).subscribeOnline(J=>{J&&w.state$.isUserConnected.child(L).set(J.isConnected)}))},{initial:!0});return()=>{k();for(const M of nT(w.onlineSubscriptions))w.onlineSubscriptions[M].unsubscribe();w.onlineSubscriptions={},w.state$.isUserConnected.set({})}},[w,C,I]),{store:w,controller:$,editorInternals:x,session:I}}(n,h,d),v=oe(async()=>{const y=g.state$;if(y.isEmpty.peek()||y.atTextLimit.peek())return;const T=g.getText(),S=f.state$.referencedMessageId.peek();S&&m.setReferencedMessage(null),g.clearText(),f.state$.editor.showEmojiPicker.set(!1),await m.sendMessage({text:T,referencedMessage:S??void 0})},[m,g,f]);V(()=>{const y=n.enterSendsMessage??!0;g.onEnter=y?v:void 0},[g,n.enterSendsMessage,v]),V(()=>{g.spellcheck$.set(a)},[g,a]),V(()=>{g.placeholder$.set(s)},[g,s]),wo(e,()=>({deleteMessage:y=>m.deleteMessage(y),setEditing:y=>m.setEditing(y),editMessage:(y,T)=>m.editMessage(y,T),sendMessage:y=>m.sendMessage(y),sendFileMessage:y=>m.sendFileMessage(y),sendLocationMessage:y=>m.sendLocationMessage(y),setReferencedMessage:y=>m.setReferencedMessage(y),getMessageFieldText:()=>g.getText(),setMessageFieldText:y=>g.setText(y)}));const A=oe(({error:y})=>N(eu,{appId:n.appId,chatboxState:{type:"unexpected-error",error:y}}),[n.appId]),_="t-chatbox"+(n.className?` ${n.className}`:"");return N("div",u?{className:_,style:n.style,ref:c}:{className:_,style:n.style,ref:c,children:N(Ky,{fallbackRender:A,children:N(Mm.Provider,{value:g,children:N(Ac.Provider,{value:f,children:N(xm.Provider,{value:n.theme,children:N(Pm.Provider,{value:p,children:N(_c.Provider,{value:m,children:N(Bm.Provider,{value:E,children:N(ZS.Provider,{value:{sendMessage:v},children:N(mD,{appId:n.appId,chatHeaderVisible:n.chatHeaderVisible??!0,messageFieldVisible:n.messageFieldVisible??!0})})})})})})})})})})});function Kk({conversation:n}){const e=Re(),t=Bo(),r=sn(),i=Tg(),o=ye(e.extCurrentConversationId$),[s,a]=ne([]);return V(()=>{const l=t.conversation(n.id).subscribeParticipants(async u=>{u&&a(u)});return()=>l.unsubscribe()},[t,n.id]),s?N(r.ConversationListItem,{common:i,conversation:n,participants:s,isSelected:o===n.id}):null}function qk(){const n=Re(),e=W(null);V(()=>{let r=!0;const i=e.current;return async function(){let o=0;for(;r&&n.conversationListSubscription&&i.scrollHeight===i.clientHeight&&o<2;)await n.conversationListSubscription?.loadMore(20),o+=1}(),()=>{r=!1}},[n]);const t=oe(r=>{const i=r.currentTarget;i.scrollHeight-i.clientHeight-i.scrollTop<15&&n.conversationListSubscription&&n.conversationListSubscription.loadMore(20)},[n]);return N("div",{className:"t-conversation-list-scrollable",ref:e,"t-menu-boundary":"",onScroll:t,children:N(Pc,{each:n.conversationsArray$,children:r=>N(Kk,{conversation:r.get()})})})}function Jk({appId:n}){Re();const e=function(){const t=Re(),r=rr(()=>{const s=t.currentUser$.get(),a=t.app$.get(),l=t.errors$.get(),u=t.authTokenState$.get();return l.serverError?"server-error":l.wrongAppId?"wrong-app-id":u==="loading"||u==="idle"?"loading-token":u==="invalid"?"invalid-token":u==="expired"?"expired-token":u==="valid"?l.unknownUser?"unknown-user":s&&a?"loaded":"loading-data":void Ie.unreachable()}),i=rr({type:"loading"});ki(s=>{const a=r.get(),l=t.extUserId$.peek(),u=t.appId$.peek();switch(a){case"invalid-token":i.set({type:"auth-failed"});break;case"expired-token":i.set({type:"expired-token"});break;case"wrong-app-id":i.set({type:"wrong-app-id",appId:u});break;case"server-error":i.set({type:"server-error"});break;case"loading-data":case"loading-token":i.set({type:"loading"});break;case"loaded":i.set({type:"loaded",currentUser:t.currentUser$.peek()});break;case"unknown-user":s.onCleanup=function(c){i.set({type:"loading"});const d=setTimeout(()=>{i.set(c)},5e3);return()=>clearTimeout(d)}({type:"unknown-user",userId:l});break;default:Ie.never(a)}});const o=rr({type:"loading"});return ki(s=>{if(i.type.get()==="loading"){o.set({type:"invisible-loading"});const a=setTimeout(()=>{o.set({type:"loading"})},1e3);s.onCleanup=()=>{clearTimeout(a)}}else o.set(i.get())}),ye(o)}();return e.type==="invisible-loading"?N(xe,{}):e.type==="loading"?N(eO,{}):e.type==="unknown-user"||e.type==="auth-failed"||e.type==="wrong-app-id"||e.type==="server-error"||e.type==="unexpected-error"?N(eu,{appId:n,chatboxState:e}):e.type=="expired-token"?N(tO,{}):e.type==="loaded"?N(qk,{}):N(xe,{})}class Zk{constructor(e,t){this.store=e,this.onSelectConversation=t}selectConversation(e){if(e===this.store.extCurrentConversationId$.peek())return;this.store.extCurrentConversationId$.set(e);const t={currentUser:this.store.currentUser$.peek(),conversation:this.store.conversationsMap$.child(e).peek()};this.onSelectConversation(t)}}const Qk=Q(function(n,e){V(()=>{n.__internalOnLoaded?.()},[]);const t=uT(),r=W(null);sT(r);const i=Eu(n.onSelectConversation,n.__hostElement,["selectConversation","select-conversation","selectconversation","SelectConversation"]),o=ce(()=>new Pv,[n.appId]),{session:s}=oT(o,n);V(()=>{o.resetState(n.appId,n.userId)},[o,n.appId,n.userId]);const a=ce(()=>new Zk(o,i),[o,i]);V(()=>o.listenForConversations(s),[o,s]),V(()=>{n.selectedConversationId!==void 0&&o.extCurrentConversationId$.set(n.selectedConversationId)},[o,n.selectedConversationId]),wo(e,()=>({selectConversation:c=>a.selectConversation(c)}));const l=oe(({error:c})=>N(eu,{appId:n.appId,chatboxState:{type:"unexpected-error",error:c}}),[n.appId]),u="t-conversation-list"+(n.className?` ${n.className}`:"");return N("div",t?{className:u,style:n.style,ref:r}:{className:u,style:n.style,ref:r,children:N(Ky,{fallbackRender:l,children:N(Ac.Provider,{value:o,children:N(xm.Provider,{value:n.theme,children:N(_c.Provider,{value:a,children:N(Bm.Provider,{value:s,children:N(Jk,{appId:n.appId})})})})})})})}),eL=new Promise(n=>{typeof document<"u"&&document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n(void 0)});function cT(n,e,t,r){const i=new Map,o=[],s=[];for(const[c,d]of(a=t,Object.entries(a))){const h=[c,c.toLowerCase(),tL(c)];for(const p of h)i.set(p,c);["string","boolean","number"].includes(d.type)&&o.push(...h),d.required!==!1&&s.push(c)}var a;class l extends HTMLElement{constructor(){super(),this._renderRequested=!1,this._props={},this._renderRoot=null,this._ref={current:null};for(const[d,h]of i){if(Object.hasOwnProperty.call(this,d)){const p=this[d];this.updateProp(h,p),delete this[d]}this.hasAttribute(d)&&this.syncAttributeToProp(d)}}static{this.observedAttributes=o}updateProp(d,h){const{type:p}=t[d];if(p==="boolean"&&typeof h=="string"?h=h!=="false":p==="number"&&typeof h=="string"&&(h=Number(h)),h==null){const f=d in this._props;return delete this._props[d],f}{const f=this._props[d]!==h;return this._props[d]=h,f}}syncAttributeToProp(d){const h=i.get(d);Ie(h,`Attribute "${d}" should have matching prop`);const p=this.getAttribute(d);return this.updateProp(h,p)}async requestRender(){this._renderRequested||(this._renderRequested=!0,this._renderRequested=await!1,this.render())}render(){var d;this._renderRoot||(this._renderRoot=(d=this,{render:function(g){Xu(g,d)},unmount:function(){qu(d)}}));const h=s.filter(g=>!(g in this._props));if(h.length>0)return r(h),void this._renderRoot.render(null);const p=Object.assign({},this._props),f=g=>{for(const[E,v]of Object.entries(g.current))typeof v=="function"&&(this[E]=(...A)=>g.current[E](...A))},m=n;this._renderRoot.render(N(m,{...p,ref:this._ref,__hostElement:this,__internalOnLoaded:()=>{f(this._ref)}}))}async connectedCallback(){await eL;for(const d of o)this.hasAttribute(d)&&this.syncAttributeToProp(d);this.requestRender()}disconnectedCallback(){this._renderRoot&&setTimeout(()=>{this._renderRoot&&(this._renderRoot.unmount(),this._renderRoot=null)})}attributeChangedCallback(d,h,p){h!==p&&this.syncAttributeToProp(d)&&this.requestRender()}}const u={};for(const[c,d]of i)u[c]={set(h){this.updateProp(d,h)&&this.requestRender()},get(){return this._props[d]??null}};return Object.defineProperties(l.prototype,u),Object.defineProperty(l,"name",{value:e}),l}function tL(n){return n.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase())}function dT(n,e){const t=JSON.stringify(e).replace(",",", ");Un.error(`Could not initialize ${n} because the following required props are missing: ${t}.`)}const hT=function(n){const e=function(r){return Q(function(i,o){return N(Xk,{...i,theme:i.theme??r,ref:o})})}(n);return cT(e,"ChatboxHTMLElement",{__internalOnLoaded:{type:"function",required:!1},appId:{type:"string"},userId:{type:"string"},conversationId:{type:"string"},theme:{type:"object",required:!1},token:{type:"string",required:!1},tokenFetcher:{type:"function",required:!1},host:{type:"string",required:!1},enterSendsMessage:{type:"boolean",required:!1},chatHeaderVisible:{type:"boolean",required:!1},messageFieldVisible:{type:"boolean",required:!1},messageFieldSpellcheck:{type:"boolean",required:!1},messageFieldPlaceholder:{type:"string",required:!1},onSendMessage:{type:"function",required:!1},onDeleteMessage:{type:"function",required:!1},beforeBrowserPermissionPrompt:{type:"function",required:!1},onMissingBrowserPermission:{type:"function",required:!1},themeCustom:{type:"object",required:!1}},r=>dT("<t-chatbox>",r))}(ap),pT=function(n){const e=function(r){return Q(function(i,o){return N(Qk,{...i,theme:i.theme??r,ref:o})})}(n);return cT(e,"ConversationListHTMLElement",{__internalOnLoaded:{type:"function",required:!1},appId:{type:"string"},userId:{type:"string"},selectedConversationId:{type:"string",required:!1},theme:{type:"object",required:!1},token:{type:"string",required:!1},tokenFetcher:{type:"function",required:!1},host:{type:"string",required:!1},themeCustom:{type:"object",required:!1}},r=>dT("<t-conversation-list>",r))}(ap),nL=ap;return customElements.get("t-chatbox")||customElements.define("t-chatbox",hT),customElements.get("t-conversation-list")||customElements.define("t-conversation-list",pT),To.ChatboxHTMLElement=hT,To.ConversationListHTMLElement=pT,To.defaultTheme=nL,Object.defineProperty(To,Symbol.toStringTag,{value:"Module"}),To}({});
1352
1352
  //# sourceMappingURL=default.standalone.js.map