/*! For license information please see remark.mjs.LICENSE.txt */
(()=>{var e,t,n,r,o={5377:()=>{!function(){"use strict";var e=function(e,t){var n=function(e){for(var t=0,n=e.length;t<n;t++)r(e[t])},r=function(e){var t=e.target,n=e.attributeName,r=e.oldValue;t.attributeChangedCallback(n,r,t.getAttribute(n))};return function(o,i){var s=o.constructor.observedAttributes;return s&&e(i).then((function(){new t(n).observe(o,{attributes:!0,attributeOldValue:!0,attributeFilter:s});for(var e=0,i=s.length;e<i;e++)o.hasAttribute(s[e])&&r({target:o,attributeName:s[e],oldValue:null})})),o}};function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function n(e,n){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){l=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw s}}}}var r=!0,o=!1,i="querySelectorAll",s="querySelectorAll",a=self,l=a.document,c=a.Element,u=a.MutationObserver,h=a.Set,d=a.WeakMap,f=function(e){return s in e},m=[].filter,p=function(e){var t=new d,a=function(n,r){var o;if(r)for(var i,s=function(e){return e.matches||e.webkitMatchesSelector||e.msMatchesSelector}(n),a=0,l=g.length;a<l;a++)s.call(n,i=g[a])&&(t.has(n)||t.set(n,new h),(o=t.get(n)).has(i)||(o.add(i),e.handle(n,r,i)));else t.has(n)&&(o=t.get(n),t.delete(n),o.forEach((function(t){e.handle(n,r,t)})))},p=function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=0,r=e.length;n<r;n++)a(e[n],t)},g=e.query,v=e.root||l,_=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:MutationObserver,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:["*"],l=function t(o,s,a,l,c,u){var h,d=n(o);try{for(d.s();!(h=d.n()).done;){var f=h.value;(u||i in f)&&(c?a.has(f)||(a.add(f),l.delete(f),e(f,c)):l.has(f)||(l.add(f),a.delete(f),e(f,c)),u||t(f[i](s),s,a,l,c,r))}}catch(e){d.e(e)}finally{d.f()}},c=new s((function(e){if(a.length){var t,i=a.join(","),s=new Set,c=new Set,u=n(e);try{for(u.s();!(t=u.n()).done;){var h=t.value,d=h.addedNodes,f=h.removedNodes;l(f,i,s,c,o,o),l(d,i,s,c,r,o)}}catch(e){u.e(e)}finally{u.f()}}})),u=c.observe;return(c.observe=function(e){return u.call(c,e,{subtree:r,childList:r})})(t),c}(a,v,u,g),b=c.prototype.attachShadow;return b&&(c.prototype.attachShadow=function(e){var t=b.call(this,e);return _.observe(t),t}),g.length&&p(v[s](g)),{drop:function(e){for(var n=0,r=e.length;n<r;n++)t.delete(e[n])},flush:function(){for(var e=_.takeRecords(),t=0,n=e.length;t<n;t++)p(m.call(e[t].removedNodes,f),!1),p(m.call(e[t].addedNodes,f),!0)},observer:_,parse:p}},g=self,v=g.document,_=g.Map,b=g.MutationObserver,y=g.Object,w=g.Set,E=g.WeakMap,S=g.Element,k=g.HTMLElement,O=g.Node,M=g.Error,N=g.TypeError,C=g.Reflect,T=y.defineProperty,x=y.keys,P=y.getOwnPropertyNames,A=y.setPrototypeOf,L=!self.customElements,R=function(e){for(var t=x(e),n=[],r=t.length,o=0;o<r;o++)n[o]=e[t[o]],delete e[t[o]];return function(){for(var o=0;o<r;o++)e[t[o]]=n[o]}};if(L){var j=function(){var e=this.constructor;if(!B.has(e))throw new N("Illegal constructor");var t=B.get(e);if(G)return V(G,t);var n=I.call(v,t);return V(A(n,e.prototype),t)},I=v.createElement,B=new _,H=new _,U=new _,D=new _,F=[],$=p({query:F,handle:function(e,t,n){var r=U.get(n);if(t&&!r.isPrototypeOf(e)){var o=R(e);G=A(e,r);try{new r.constructor}finally{G=null,o()}}var i="".concat(t?"":"dis","connectedCallback");i in r&&e[i]()}}).parse,G=null,z=function(e){if(!H.has(e)){var t,n=new Promise((function(e){t=e}));H.set(e,{$:n,_:t})}return H.get(e).$},V=e(z,b);T(self,"customElements",{configurable:!0,value:{define:function(e,t){if(D.has(e))throw new M('the name "'.concat(e,'" has already been used with this registry'));B.set(t,e),U.set(e,t.prototype),D.set(e,t),F.push(e),z(e).then((function(){$(v.querySelectorAll(e))})),H.get(e)._(t)},get:function(e){return D.get(e)},whenDefined:z}}),T(j.prototype=k.prototype,"constructor",{value:j}),T(self,"HTMLElement",{configurable:!0,value:j}),T(v,"createElement",{configurable:!0,value:function(e,t){var n=t&&t.is,r=n?D.get(n):D.get(e);return r?new r:I.call(v,e)}}),"isConnected"in O.prototype||T(O.prototype,"isConnected",{configurable:!0,get:function(){return!(this.ownerDocument.compareDocumentPosition(this)&this.DOCUMENT_POSITION_DISCONNECTED)}})}else try{var W=function e(){return self.Reflect.construct(HTMLLIElement,[],e)};W.prototype=HTMLLIElement.prototype;var K="extends-li";self.customElements.define("extends-li",W,{extends:"li"}),L=v.createElement("li",{is:K}).outerHTML.indexOf(K)<0;var Z=self.customElements,q=Z.get,X=Z.whenDefined;T(self.customElements,"whenDefined",{configurable:!0,value:function(e){var t=this;return X.call(this,e).then((function(n){return n||q.call(t,e)}))}})}catch(e){L=!L}if(L){var Y=function(e){var t=ie.get(e);me(t.querySelectorAll(this),e.isConnected)},J=self.customElements,Q=v.createElement,ee=J.define,te=J.get,ne=J.upgrade,re=C||{construct:function(e){return e.call(this)}},oe=re.construct,ie=new E,se=new w,ae=new _,le=new _,ce=new _,ue=new _,he=[],de=[],fe=function(e){return ue.get(e)||te.call(J,e)},me=p({query:de,handle:function(e,t,n){var r=ce.get(n);if(t&&!r.isPrototypeOf(e)){var o=R(e);be=A(e,r);try{new r.constructor}finally{be=null,o()}}var i="".concat(t?"":"dis","connectedCallback");i in r&&e[i]()}}).parse,pe=p({query:he,handle:function(e,t){ie.has(e)&&(t?se.add(e):se.delete(e),de.length&&Y.call(de,e))}}).parse,ge=S.prototype.attachShadow;ge&&(S.prototype.attachShadow=function(e){var t=ge.call(this,e);return ie.set(this,t),t});var ve=function(e){if(!le.has(e)){var t,n=new Promise((function(e){t=e}));le.set(e,{$:n,_:t})}return le.get(e).$},_e=e(ve,b),be=null;P(self).filter((function(e){return/^HTML.*Element$/.test(e)})).forEach((function(e){var t=self[e];function n(){var e=this.constructor;if(!ae.has(e))throw new N("Illegal constructor");var n=ae.get(e),r=n.is,o=n.tag;if(r){if(be)return _e(be,r);var i=Q.call(v,o);return i.setAttribute("is",r),_e(A(i,e.prototype),r)}return oe.call(this,t,[],e)}T(n.prototype=t.prototype,"constructor",{value:n}),T(self,e,{value:n})})),T(v,"createElement",{configurable:!0,value:function(e,t){var n=t&&t.is;if(n){var r=ue.get(n);if(r&&ae.get(r).tag===e)return new r}var o=Q.call(v,e);return n&&o.setAttribute("is",n),o}}),T(J,"get",{configurable:!0,value:fe}),T(J,"whenDefined",{configurable:!0,value:ve}),T(J,"upgrade",{configurable:!0,value:function(e){var t=e.getAttribute("is");if(t){var n=ue.get(t);if(n)return void _e(A(e,n.prototype),t)}ne.call(J,e)}}),T(J,"define",{configurable:!0,value:function(e,t,n){if(fe(e))throw new M("'".concat(e,"' has already been defined as a custom element"));var r,o=n&&n.extends;ae.set(t,o?{is:e,tag:o}:{is:"",tag:e}),o?(r="".concat(o,'[is="').concat(e,'"]'),ce.set(r,t.prototype),ue.set(e,t),de.push(r)):(ee.apply(J,arguments),he.push(r=e)),ve(e).then((function(){o?(me(v.querySelectorAll(r)),se.forEach(Y,[r])):pe(v.querySelectorAll(r))})),le.get(e)._(t)}})}}()},9419:(e,t)=>{"use strict";function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=[e],i=t.mix,s=void 0===i?[]:i,a=t.mods,l=void 0===a?{}:a,c=function(t,n){var i=[e,r(t)];"boolean"!=typeof n&&i.push(r(n)),o.push(i.join("_"))};return Object.keys(n).forEach((function(e){!l.hasOwnProperty(e)&&n[e]&&c(e,n[e])})),Object.keys(l).forEach((function(e){l[e]&&c(e,l[e])})),s&&(o=o.concat(s)),o.join(" ")}function r(e){return e.toString().replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}Object.defineProperty(t,"__esModule",{value:!0}),e.exports=n,t.default=n},63:(e,t,n)=>{"use strict";var r=n(9415),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return r.isMemo(e)?s:a[e.$$typeof]||o}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=s;var c=Object.defineProperty,u=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=f(n);o&&o!==m&&e(t,o,r)}var s=u(n);h&&(s=s.concat(h(n)));for(var a=l(t),p=l(n),g=0;g<s.length;++g){var v=s[g];if(!(i[v]||r&&r[v]||p&&p[v]||a&&a[v])){var _=d(n,v);try{c(t,v,_)}catch(e){}}}}return t}},8670:(e,t,n)=>{var r=n(8471),o=n(6680);function i(e,t){for(var n in t)e[n]=t[n];return e}function s(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function a(e){this.props=e}function l(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:s(this.props,e)}function r(t){return this.shouldComponentUpdate=n,o.createElement(e,t)}return r.displayName="Memo("+(e.displayName||e.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(a.prototype=new o.Component).isPureReactComponent=!0,a.prototype.shouldComponentUpdate=function(e,t){return s(this.props,e)||s(this.state,t)};var c=o.options.__b;o.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),c&&c(e)};var u="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function h(e){function t(t,n){var r=i({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return t.$$typeof=u,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var d=function(e,t){return null==e?null:o.toChildArray(o.toChildArray(e).map(t))},f={map:d,forEach:d,count:function(e){return e?o.toChildArray(e).length:0},only:function(e){var t=o.toChildArray(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:o.toChildArray},m=o.options.__e;o.options.__e=function(e,t,n){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);m(e,t,n)};var p=o.options.unmount;function g(){this.__u=0,this.t=null,this.__b=null}function v(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function _(e){var t,n,r;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){r=e})),r)throw r;if(!n)throw t;return o.createElement(n,i)}return i.displayName="Lazy",i.__f=!0,i}function b(){this.o=null,this.u=null}o.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),p&&p(e)},(g.prototype=new o.Component).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=v(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(s,s)},g.prototype.componentWillUnmount=function(){this.t=[]},g.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=i({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var s=t.__e&&o.createElement(o.Fragment,null,e.fallback);return s&&(s.__h=null),[o.createElement(o.Fragment,null,t.__e?null:e.children),s]};var y=function(e,t,n){if(++n[1]===n[0]&&e.u.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.u.size))for(n=e.o;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.o=n=n[2]}};function w(e){return this.getChildContext=function(){return e.context},e.children}function E(e){var t=this,n=e.i;t.componentWillUnmount=function(){o.render(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),e.__v?(t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),o.render(o.createElement(w,{context:t.context},e.__v),t.l)):t.l&&t.componentWillUnmount()}function S(e,t){return o.createElement(E,{__v:e,i:t})}(b.prototype=new o.Component).__e=function(e){var t=this,n=v(t.__v),r=t.u.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),y(t,e,r)):o()};n?n(i):i()}},b.prototype.render=function(e){this.o=null,this.u=new Map;var t=o.toChildArray(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.u.set(t[n],this.o=[1,0,this.o]);return e.children},b.prototype.componentDidUpdate=b.prototype.componentDidMount=function(){var e=this;this.u.forEach((function(t,n){y(e,n,t)}))};var k="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,O=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,M="undefined"!=typeof document,N=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};function C(e,t,n){return null==t.__k&&(t.textContent=""),o.render(e,t),"function"==typeof n&&n(),e?e.__c:null}function T(e,t,n){return o.hydrate(e,t),"function"==typeof n&&n(),e?e.__c:null}o.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(o.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var x=o.options.event;function P(){}function A(){return this.cancelBubble}function L(){return this.defaultPrevented}o.options.event=function(e){return x&&(e=x(e)),e.persist=P,e.isPropagationStopped=A,e.isDefaultPrevented=L,e.nativeEvent=e};var R,j={configurable:!0,get:function(){return this.class}},I=o.options.vnode;o.options.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var i=-1===t.indexOf("-");for(var s in r={},n){var a=n[s];M&&"children"===s&&"noscript"===t||"value"===s&&"defaultValue"in n&&null==a||("defaultValue"===s&&"value"in n&&null==n.value?s="value":"download"===s&&!0===a?a="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+t)&&!N(n.type)?s="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(s)?s=s.toLowerCase():i&&O.test(s)?s=s.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===a&&(a=void 0),r[s]=a)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=o.toChildArray(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=o.toChildArray(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(j.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",j))}e.$$typeof=k,I&&I(e)};var B=o.options.__r;o.options.__r=function(e){B&&B(e),R=e.__c};var H={ReactCurrentDispatcher:{current:{readContext:function(e){return R.__n[e.__c].props.value}}}};function U(e){return o.createElement.bind(null,e)}function D(e){return!!e&&e.$$typeof===k}function F(e){return D(e)?o.cloneElement.apply(null,arguments):e}function $(e){return!!e.__k&&(o.render(null,e),!0)}function G(e){return e&&(e.base||1===e.nodeType&&e)||null}var z=function(e,t){return e(t)},V=function(e,t){return e(t)},W=o.Fragment,K={useState:r.useState,useReducer:r.useReducer,useEffect:r.useEffect,useLayoutEffect:r.useLayoutEffect,useRef:r.useRef,useImperativeHandle:r.useImperativeHandle,useMemo:r.useMemo,useCallback:r.useCallback,useContext:r.useContext,useDebugValue:r.useDebugValue,version:"17.0.2",Children:f,render:C,hydrate:T,unmountComponentAtNode:$,createPortal:S,createElement:o.createElement,createContext:o.createContext,createFactory:U,cloneElement:F,createRef:o.createRef,Fragment:o.Fragment,isValidElement:D,findDOMNode:G,Component:o.Component,PureComponent:a,memo:l,forwardRef:h,flushSync:V,unstable_batchedUpdates:z,StrictMode:W,Suspense:g,SuspenseList:b,lazy:_,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:H};Object.keys(r).forEach((function(e){t[e]=r[e]})),t.createElement=o.createElement,t.createContext=o.createContext,t.createRef=o.createRef,t.Fragment=o.Fragment,t.Component=o.Component,t.version="17.0.2",t.Children=f,t.render=C,t.hydrate=T,t.unmountComponentAtNode=$,t.createPortal=S,t.createFactory=U,t.cloneElement=F,t.isValidElement=D,t.findDOMNode=G,t.PureComponent=a,t.memo=l,t.forwardRef=h,t.flushSync=V,t.unstable_batchedUpdates=z,t.StrictMode=W,t.Suspense=g,t.SuspenseList=b,t.lazy=_,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H,t.default=K},6680:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Component:()=>y,Fragment:()=>b,cloneElement:()=>F,createContext:()=>$,createElement:()=>g,createRef:()=>_,h:()=>g,hydrate:()=>D,isValidElement:()=>s,options:()=>o,render:()=>U,toChildArray:()=>N});var r,o,i,s,a,l,c,u,h={},d=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function m(e,t){for(var n in t)e[n]=t[n];return e}function p(e){var t=e.parentNode;t&&t.removeChild(e)}function g(e,t,n){var o,i,s,a={};for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return v(e,a,o,i,null)}function v(e,t,n,r,s){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==s?++i:s};return null==s&&null!=o.vnode&&o.vnode(a),a}function _(){return{current:null}}function b(e){return e.children}function y(e,t){this.props=e,this.context=t}function w(e,t){if(null==t)return e.__?w(e.__,e.__.__k.indexOf(e)+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?w(e):null}function E(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return E(e)}}function S(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!k.__r++||c!==o.debounceRendering)&&((c=o.debounceRendering)||l)(k)}function k(){for(var e;k.__r=a.length;)e=a.sort((function(e,t){return e.__v.__b-t.__v.__b})),a=[],e.some((function(e){var t,n,r,o,i,s;e.__d&&(i=(o=(t=e).__v).__e,(s=t.__P)&&(n=[],(r=m({},o)).__v=o.__v+1,L(s,o,r,t.__n,void 0!==s.ownerSVGElement,null!=o.__h?[i]:null,n,null==i?w(o):i,o.__h),R(n,o),o.__e!=i&&E(o)))}))}function O(e,t,n,r,o,i,s,a,l,c){var u,f,m,p,g,_,y,E=r&&r.__k||d,S=E.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(p=n.__k[u]=null==(p=t[u])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?v(null,p,null,null,p):Array.isArray(p)?v(b,{children:p},null,null,null):p.__b>0?v(p.type,p.props,p.key,null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(m=E[u])||m&&p.key==m.key&&p.type===m.type)E[u]=void 0;else for(f=0;f<S;f++){if((m=E[f])&&p.key==m.key&&p.type===m.type){E[f]=void 0;break}m=null}L(e,p,m=m||h,o,i,s,a,l,c),g=p.__e,(f=p.ref)&&m.ref!=f&&(y||(y=[]),m.ref&&y.push(m.ref,null,p),y.push(f,p.__c||g,p)),null!=g?(null==_&&(_=g),"function"==typeof p.type&&p.__k===m.__k?p.__d=l=M(p,l,e):l=C(e,p,m,E,g,l),"function"==typeof n.type&&(n.__d=l)):l&&m.__e==l&&l.parentNode!=e&&(l=w(m))}for(n.__e=_,u=S;u--;)null!=E[u]&&("function"==typeof n.type&&null!=E[u].__e&&E[u].__e==n.__d&&(n.__d=w(r,u+1)),B(E[u],E[u]));if(y)for(u=0;u<y.length;u++)I(y[u],y[++u],y[++u])}function M(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t="function"==typeof r.type?M(r,t,n):C(n,r,r,o,r.__e,t));return t}function N(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){N(e,t)})):t.push(e)),t}function C(e,t,n,r,o,i){var s,a,l;if(void 0!==t.__d)s=t.__d,t.__d=void 0;else if(null==n||o!=i||null==o.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(o),s=null;else{for(a=i,l=0;(a=a.nextSibling)&&l<r.length;l+=2)if(a==o)break e;e.insertBefore(o,i),s=i}return void 0!==s?s:o.nextSibling}function T(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||f.test(t)?n:n+"px"}function x(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||T(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||T(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?A:P,i):e.removeEventListener(t,i?A:P,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function P(e){this.l[e.type+!1](o.event?o.event(e):e)}function A(e){this.l[e.type+!0](o.event?o.event(e):e)}function L(e,t,n,r,i,s,a,l,c){var u,h,d,f,p,g,v,_,w,E,S,k=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(c=n.__h,l=t.__e=n.__e,t.__h=null,s=[l]),(u=o.__b)&&u(t);try{e:if("function"==typeof k){if(_=t.props,w=(u=k.contextType)&&r[u.__c],E=u?w?w.props.value:u.__:r,n.__c?v=(h=t.__c=n.__c).__=h.__E:("prototype"in k&&k.prototype.render?t.__c=h=new k(_,E):(t.__c=h=new y(_,E),h.constructor=k,h.render=H),w&&w.sub(h),h.props=_,h.state||(h.state={}),h.context=E,h.__n=r,d=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=k.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=m({},h.__s)),m(h.__s,k.getDerivedStateFromProps(_,h.__s))),f=h.props,p=h.state,d)null==k.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==k.getDerivedStateFromProps&&_!==f&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(_,E),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(_,h.__s,E)||t.__v===n.__v){h.props=_,h.state=h.__s,t.__v!==n.__v&&(h.__d=!1),h.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),h.__h.length&&a.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(_,h.__s,E),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(f,p,g)}))}h.context=E,h.props=_,h.state=h.__s,(u=o.__r)&&u(t),h.__d=!1,h.__v=t,h.__P=e,u=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(r=m(m({},r),h.getChildContext())),d||null==h.getSnapshotBeforeUpdate||(g=h.getSnapshotBeforeUpdate(f,p)),S=null!=u&&u.type===b&&null==u.key?u.props.children:u,O(e,Array.isArray(S)?S:[S],t,n,r,i,s,a,l,c),h.base=t.__e,t.__h=null,h.__h.length&&a.push(h),v&&(h.__E=h.__=null),h.__e=!1}else null==s&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=j(n.__e,t,n,r,i,s,a,c);(u=o.diffed)&&u(t)}catch(e){t.__v=null,(c||null!=s)&&(t.__e=l,t.__h=!!c,s[s.indexOf(l)]=null),o.__e(e,t,n)}}function R(e,t){o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function j(e,t,n,o,i,s,a,l){var c,u,d,f=n.props,m=t.props,g=t.type,v=0;if("svg"===g&&(i=!0),null!=s)for(;v<s.length;v++)if((c=s[v])&&"setAttribute"in c==!!g&&(g?c.localName===g:3===c.nodeType)){e=c,s[v]=null;break}if(null==e){if(null===g)return document.createTextNode(m);e=i?document.createElementNS("http://www.w3.org/2000/svg",g):document.createElement(g,m.is&&m),s=null,l=!1}if(null===g)f===m||l&&e.data===m||(e.data=m);else{if(s=s&&r.call(e.childNodes),u=(f=n.props||h).dangerouslySetInnerHTML,d=m.dangerouslySetInnerHTML,!l){if(null!=s)for(f={},v=0;v<e.attributes.length;v++)f[e.attributes[v].name]=e.attributes[v].value;(d||u)&&(d&&(u&&d.__html==u.__html||d.__html===e.innerHTML)||(e.innerHTML=d&&d.__html||""))}if(function(e,t,n,r,o){var i;for(i in n)"children"===i||"key"===i||i in t||x(e,i,null,n[i],r);for(i in t)o&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||x(e,i,t[i],n[i],r)}(e,m,f,i,l),d)t.__k=[];else if(v=t.props.children,O(e,Array.isArray(v)?v:[v],t,n,o,i&&"foreignObject"!==g,s,a,s?s[0]:n.__k&&w(n,0),l),null!=s)for(v=s.length;v--;)null!=s[v]&&p(s[v]);l||("value"in m&&void 0!==(v=m.value)&&(v!==f.value||v!==e.value||"progress"===g&&!v)&&x(e,"value",v,f.value,!1),"checked"in m&&void 0!==(v=m.checked)&&v!==e.checked&&x(e,"checked",v,f.checked,!1))}return e}function I(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){o.__e(e,n)}}function B(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||I(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&B(r[i],t,"function"!=typeof e.type);n||null==e.__e||p(e.__e),e.__e=e.__d=void 0}function H(e,t,n){return this.constructor(e,n)}function U(e,t,n){var i,s,a;o.__&&o.__(e,t),s=(i="function"==typeof n)?null:n&&n.__k||t.__k,a=[],L(t,e=(!i&&n||t).__k=g(b,null,[e]),s||h,h,void 0!==t.ownerSVGElement,!i&&n?[n]:s?null:t.firstChild?r.call(t.childNodes):null,a,!i&&n?n:s?s.__e:t.firstChild,i),R(a,e)}function D(e,t){U(e,t,D)}function F(e,t,n){var o,i,s,a=m({},e.props);for(s in t)"key"==s?o=t[s]:"ref"==s?i=t[s]:a[s]=t[s];return arguments.length>2&&(a.children=arguments.length>3?r.call(arguments,2):n),v(e.type,a,o||e.key,i||e.ref,null)}function $(e,t){var n={__c:t="__cC"+u++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(S)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=d.slice,o={__e:function(e,t){for(var n,r,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},i=0,s=function(e){return null!=e&&void 0===e.constructor},y.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=m({},this.state),"function"==typeof e&&(e=e(m({},n),this.props)),e&&m(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),S(this))},y.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),S(this))},y.prototype.render=b,a=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,k.__r=0,u=0},8471:(e,t,n)=>{"use strict";n.r(t),n.d(t,{useCallback:()=>E,useContext:()=>S,useDebugValue:()=>k,useEffect:()=>v,useErrorBoundary:()=>O,useImperativeHandle:()=>y,useLayoutEffect:()=>_,useMemo:()=>w,useReducer:()=>g,useRef:()=>b,useState:()=>p});var r,o,i,s=n(6680),a=0,l=[],c=s.options.__b,u=s.options.__r,h=s.options.diffed,d=s.options.__c,f=s.options.unmount;function m(e,t){s.options.__h&&s.options.__h(o,e,a||t),a=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function p(e){return a=1,g(P,e)}function g(e,t,n){var i=m(r++,2);return i.t=e,i.__c||(i.__=[n?n(t):P(void 0,t),function(e){var t=i.t(i.__[0],e);i.__[0]!==t&&(i.__=[t,i.__[1]],i.__c.setState({}))}],i.__c=o),i.__}function v(e,t){var n=m(r++,3);!s.options.__s&&x(n.__H,t)&&(n.__=e,n.__H=t,o.__H.__h.push(n))}function _(e,t){var n=m(r++,4);!s.options.__s&&x(n.__H,t)&&(n.__=e,n.__H=t,o.__h.push(n))}function b(e){return a=5,w((function(){return{current:e}}),[])}function y(e,t,n){a=6,_((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==n?n:n.concat(e))}function w(e,t){var n=m(r++,7);return x(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function E(e,t){return a=8,w((function(){return e}),t)}function S(e){var t=o.context[e.__c],n=m(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function k(e,t){s.options.useDebugValue&&s.options.useDebugValue(t?t(e):e)}function O(e){var t=m(r++,10),n=p();return t.__=e,o.componentDidCatch||(o.componentDidCatch=function(e){t.__&&t.__(e),n[1](e)}),[n[0],function(){n[1](void 0)}]}function M(){l.forEach((function(e){if(e.__P)try{e.__H.__h.forEach(C),e.__H.__h.forEach(T),e.__H.__h=[]}catch(t){e.__H.__h=[],s.options.__e(t,e.__v)}})),l=[]}s.options.__b=function(e){o=null,c&&c(e)},s.options.__r=function(e){u&&u(e),r=0;var t=(o=e.__c).__H;t&&(t.__h.forEach(C),t.__h.forEach(T),t.__h=[])},s.options.diffed=function(e){h&&h(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==l.push(t)&&i===s.options.requestAnimationFrame||((i=s.options.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),N&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);N&&(t=requestAnimationFrame(n))})(M)),o=null},s.options.__c=function(e,t){t.some((function(e){try{e.__h.forEach(C),e.__h=e.__h.filter((function(e){return!e.__||T(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],s.options.__e(n,e.__v)}})),d&&d(e,t)},s.options.unmount=function(e){f&&f(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{C(e)}catch(e){t=e}})),t&&s.options.__e(t,n.__v))};var N="function"==typeof requestAnimationFrame;function C(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function T(e){var t=o;e.__c=e.__(),o=t}function x(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function P(e,t){return"function"==typeof t?t(e):t}},4507:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,p=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,_=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,y=n?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case h:case i:case a:case s:case f:return e;default:switch(e=e&&e.$$typeof){case c:case d:case g:case p:case l:return e;default:return t}}case o:return t}}}function E(e){return w(e)===h}t.AsyncMode=u,t.ConcurrentMode=h,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=d,t.Fragment=i,t.Lazy=g,t.Memo=p,t.Portal=o,t.Profiler=a,t.StrictMode=s,t.Suspense=f,t.isAsyncMode=function(e){return E(e)||w(e)===u},t.isConcurrentMode=E,t.isContextConsumer=function(e){return w(e)===c},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===i},t.isLazy=function(e){return w(e)===g},t.isMemo=function(e){return w(e)===p},t.isPortal=function(e){return w(e)===o},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===h||e===a||e===s||e===f||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===p||e.$$typeof===l||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===b||e.$$typeof===y||e.$$typeof===v)},t.typeOf=w},9415:(e,t,n)=>{"use strict";e.exports=n(4507)},208:(e,t)=>{"use strict";Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen");Symbol.for("react.module.reference")},9999:(e,t,n)=>{"use strict";n(208)},1502:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="/web/apple-dark.svg"},4756:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="/web/apple-light.svg"},2652:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="/web/dev.svg"},2552:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="/web/facebook.svg"},5463:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="/web/github-dark.svg"},1220:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="/web/github-light.svg"},7372:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="/web/google.svg"},8369:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="/web/microsoft.svg"},8932:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="/web/patreon.svg"},237:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="/web/telegram.svg"},1253:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="/web/twitter.svg"},7284:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r="/web/yandex.svg"},8464:(e,t,n)=>{"use strict";var r=n(8670),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return a((function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})}),[e,n,t]),s((function(){return c(o)&&u({inst:o}),e((function(){c(o)&&u({inst:o})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},8200:(e,t,n)=>{"use strict";var r=n(8670),o=n(1598),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=o.useSyncExternalStore,a=r.useRef,l=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var h=a(null);if(null===h.current){var d={hasValue:!1,value:null};h.current=d}else d=h.current;h=c((function(){function e(e){if(!l){if(l=!0,s=e,e=r(e),void 0!==o&&d.hasValue){var t=d.value;if(o(t,e))return a=t}return a=e}if(t=a,i(s,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(s=e,a=n)}var s,a,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,o]);var f=s(e,h[0],h[1]);return l((function(){d.hasValue=!0,d.value=f}),[f]),u(f),f}},1598:(e,t,n)=>{"use strict";e.exports=n(8464)},8592:(e,t,n)=>{"use strict";e.exports=n(8200)}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return o[e](n,n.exports,s),n.loaded=!0,n.exports}s.m=o,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,s.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);s.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var a=2&r&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((e=>i[e]=()=>n[e]));return i.default=()=>n,s.d(o,i),o},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>({43:"ja",135:"fi",220:"ua",231:"fr",300:"tr",313:"be",352:"es",371:"node-emoji",372:"bg",491:"ko",521:"zh-tw",640:"pl",677:"bp",697:"ru",850:"ar",913:"de",922:"zh",928:"it",929:"th",936:"vi",993:"cs"}[e]+".mjs"),s.miniCssF=e=>{},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n={},r="@remark42/app:",s.l=(e,t,o,i)=>{if(n[e])n[e].push(t);else{var a,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var h=c[u];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==r+o){a=h;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",r+o),a.src=e),n[e]=[t];var d=(t,r)=>{a.onerror=a.onload=null,clearTimeout(f);var o=n[e];if(delete n[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(r))),t)return t(r)},f=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.p="/web/",(()=>{var e={829:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var i=s.p+s.u(t),a=new Error;s.l(i,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,o,[i,a,l]=n,c=0;if(i.some((t=>0!==e[t]))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);l&&l(s)}for(t&&t(n);c<i.length;c++)o=i[c],s.o(e,o)&&e[o]&&e[o][0](),e[o]=0},n=self.webpackChunk_remark42_app=self.webpackChunk_remark42_app||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";var e={};s.r(e),s.d(e,{activeComment:()=>Ua,allComments:()=>Ha,childComments:()=>Ia,comments:()=>Fa,pinnedComments:()=>Da,topComments:()=>Ra});var t={};s.r(t),s.d(t,{info:()=>Ga});var n={};s.r(n),s.d(n,{theme:()=>za});var r={};s.r(r),s.d(r,{bannedUsers:()=>Wa,hiddenUsers:()=>Ka,user:()=>Va});var o={};s.r(o),s.d(o,{collapsedThreads:()=>Xa});var i=s(6680);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function u(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var h="function"==typeof Symbol&&Symbol.observable||"@@observable",d=function(){return Math.random().toString(36).substring(7).split("").join(".")},f={INIT:"@@redux/INIT"+d(),REPLACE:"@@redux/REPLACE"+d(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+d()}};function m(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function p(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,s=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:f.INIT}))throw new Error(u(12));if(void 0===n(void 0,{type:f.PROBE_UNKNOWN_ACTION()}))throw new Error(u(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},a=0;a<s.length;a++){var l=s[a],c=n[l],h=e[l],d=c(h,t);if(void 0===d)throw t&&t.type,new Error(u(14));o[l]=d,r=r||d!==h}return(r=r||s.length!==Object.keys(e).length)?o:e}}function g(e,t){return function(){return t(e.apply(this,arguments))}}function v(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}var _=s(1598),b=s(8592),y=s(8670),w=s.n(y);let E=function(e){e()};const S=()=>E,k=w().createContext(null);function O(){return(0,y.useContext)(k)}let M=()=>{throw new Error("uSES not initialized!")};const N=(e,t)=>e===t;function C(e=k){const t=e===k?O:()=>(0,y.useContext)(e);return function(e,n=N){const{store:r,subscription:o,getServerState:i}=t(),s=M(o.addNestedSub,r.getState,i||r.getState,e,n);return(0,y.useDebugValue)(s),s}}const T=C();s(63),s(9999);const x={notify(){},get:()=>[]};const P="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?y.useLayoutEffect:y.useEffect;let A=null;const L=function({store:e,context:t,children:n,serverState:r}){const o=(0,y.useMemo)((()=>{const t=function(e,t){let n,r=x;function o(){s.onStateChange&&s.onStateChange()}function i(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=function(){const e=S();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}const s={addNestedSub:function(e){return i(),r.subscribe(e)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=x)},getListeners:()=>r};return s}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0}}),[e,r]),i=(0,y.useMemo)((()=>e.getState()),[e]);P((()=>{const{subscription:t}=o;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),i!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[o,i]);const s=t||k;return w().createElement(s.Provider,{value:o},n)};function R(e=k){const t=e===k?O:()=>(0,y.useContext)(e);return function(){const{store:e}=t();return e}}const j=R();function I(e=k){const t=e===k?j:R(e);return function(){return t().dispatch}}const B=I();function H(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function U(e,t){if(H(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!H(e[n[r]],t[n[r]]))return!1;return!0}var D,F;F=b.useSyncExternalStoreWithSelector,M=F,(e=>{A=e})(_.useSyncExternalStore),D=y.unstable_batchedUpdates,E=D;var $=function(e,t){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},$(e,t)};function G(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var z=function(){return z=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},z.apply(this,arguments)};function V(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function W(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}Object.create,Object.create;var K,Z,q,X=y.createContext(null),Y=(X.Consumer,X.Provider),J=X;function Q(e,t,n){if(void 0===n&&(n=Error),!e)throw new n(t)}function ee(e){return e.type===Z.literal}function te(e){return e.type===Z.argument}function ne(e){return e.type===Z.number}function re(e){return e.type===Z.date}function oe(e){return e.type===Z.time}function ie(e){return e.type===Z.select}function se(e){return e.type===Z.plural}function ae(e){return e.type===Z.pound}function le(e){return e.type===Z.tag}function ce(e){return!(!e||"object"!=typeof e||e.type!==q.number)}function ue(e){return!(!e||"object"!=typeof e||e.type!==q.dateTime)}!function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"}(K||(K={})),function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"}(Z||(Z={})),function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"}(q||(q={}));var he=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,de=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function fe(e){var t={};return e.replace(de,(function(e){var n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"short":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""})),t}var me=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i,pe=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,ge=/^(@+)?(\+|#+)?[rs]?$/g,ve=/(\*)(0+)|(#+)(0+)|(0+)/g,_e=/^(0+)$/;function be(e){var t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(ge,(function(e,n,r){return"string"!=typeof r?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===r?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof r?r.length:0)),""})),t}function ye(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function we(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!_e.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function Ee(e){return ye(e)||{}}function Se(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n];switch(o.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=o.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=o.options[0].replace(/^(.*?)-/,"");continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t=z(z(z({},t),{notation:"scientific"}),o.options.reduce((function(e,t){return z(z({},e),Ee(t))}),{}));continue;case"engineering":t=z(z(z({},t),{notation:"engineering"}),o.options.reduce((function(e,t){return z(z({},e),Ee(t))}),{}));continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(o.options[0]);continue;case"integer-width":if(o.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");o.options[0].replace(ve,(function(e,n,r,o,i,s){if(n)t.minimumIntegerDigits=r.length;else{if(o&&i)throw new Error("We currently do not support maximum integer digits");if(s)throw new Error("We currently do not support exact integer digits")}return""}));continue}if(_e.test(o.stem))t.minimumIntegerDigits=o.stem.length;else if(pe.test(o.stem)){if(o.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");o.stem.replace(pe,(function(e,n,r,o,i,s){return"*"===r?t.minimumFractionDigits=n.length:o&&"#"===o[0]?t.maximumFractionDigits=o.length:i&&s?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+s.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""}));var i=o.options[0];"w"===i?t=z(z({},t),{trailingZeroDisplay:"stripIfInteger"}):i&&(t=z(z({},t),be(i)))}else if(ge.test(o.stem))t=z(z({},t),be(o.stem));else{var s=ye(o.stem);s&&(t=z(z({},t),s));var a=we(o.stem);a&&(t=z(z({},t),a))}}return t}var ke,Oe={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Me(e){var t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n,r=e.language;return"root"!==r&&(n=e.maximize().region),(Oe[n||""]||Oe[r||""]||Oe["".concat(r,"-001")]||Oe["001"])[0]}var Ne=new RegExp("^".concat(he.source,"*")),Ce=new RegExp("".concat(he.source,"*$"));function Te(e,t){return{start:e,end:t}}var xe=!!String.prototype.startsWith,Pe=!!String.fromCodePoint,Ae=!!Object.fromEntries,Le=!!String.prototype.codePointAt,Re=!!String.prototype.trimStart,je=!!String.prototype.trimEnd,Ie=Number.isSafeInteger?Number.isSafeInteger:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&Math.abs(e)<=9007199254740991},Be=!0;try{Be="a"===(null===(ke=Ve("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))||void 0===ke?void 0:ke[0])}catch(e){Be=!1}var He,Ue=xe?function(e,t,n){return e.startsWith(t,n)}:function(e,t,n){return e.slice(n,n+t.length)===t},De=Pe?String.fromCodePoint:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n,r="",o=e.length,i=0;o>i;){if((n=e[i++])>1114111)throw RangeError(n+" is not a valid code point");r+=n<65536?String.fromCharCode(n):String.fromCharCode(55296+((n-=65536)>>10),n%1024+56320)}return r},Fe=Ae?Object.fromEntries:function(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n],i=o[0],s=o[1];t[i]=s}return t},$e=Le?function(e,t){return e.codePointAt(t)}:function(e,t){var n=e.length;if(!(t<0||t>=n)){var r,o=e.charCodeAt(t);return o<55296||o>56319||t+1===n||(r=e.charCodeAt(t+1))<56320||r>57343?o:r-56320+(o-55296<<10)+65536}},Ge=Re?function(e){return e.trimStart()}:function(e){return e.replace(Ne,"")},ze=je?function(e){return e.trimEnd()}:function(e){return e.replace(Ce,"")};function Ve(e,t){return new RegExp(e,t)}if(Be){var We=Ve("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");He=function(e,t){var n;return We.lastIndex=t,null!==(n=We.exec(e)[1])&&void 0!==n?n:""}}else He=function(e,t){for(var n=[];;){var r=$e(e,t);if(void 0===r||qe(r)||Xe(r))break;n.push(r),t+=r>=65536?2:1}return De.apply(void 0,n)};var Ke=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,n){for(var r=[];!this.isEOF();){var o=this.char();if(123===o){if((i=this.parseArgument(e,n)).err)return i;r.push(i.val)}else{if(125===o&&e>0)break;if(35!==o||"plural"!==t&&"selectordinal"!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(K.UNMATCHED_CLOSING_TAG,Te(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&Ze(this.peek()||0)){if((i=this.parseTag(e,t)).err)return i;r.push(i.val)}else{var i;if((i=this.parseLiteral(e,t)).err)return i;r.push(i.val)}}else{var s=this.clonePosition();this.bump(),r.push({type:Z.pound,location:Te(s,this.clonePosition())})}}}return{val:r,err:null}},e.prototype.parseTag=function(e,t){var n=this.clonePosition();this.bump();var r=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Z.literal,value:"<".concat(r,"/>"),location:Te(n,this.clonePosition())},err:null};if(this.bumpIf(">")){var o=this.parseMessage(e+1,t,!0);if(o.err)return o;var i=o.val,s=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Ze(this.char()))return this.error(K.INVALID_TAG,Te(s,this.clonePosition()));var a=this.clonePosition();return r!==this.parseTagName()?this.error(K.UNMATCHED_CLOSING_TAG,Te(a,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:Z.tag,value:r,children:i,location:Te(n,this.clonePosition())},err:null}:this.error(K.INVALID_TAG,Te(s,this.clonePosition())))}return this.error(K.UNCLOSED_TAG,Te(n,this.clonePosition()))}return this.error(K.INVALID_TAG,Te(n,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var n=this.clonePosition(),r="";;){var o=this.tryParseQuote(t);if(o)r+=o;else{var i=this.tryParseUnquoted(e,t);if(i)r+=i;else{var s=this.tryParseLeftAngleBracket();if(!s)break;r+=s}}}var a=Te(n,this.clonePosition());return{val:{type:Z.literal,value:r,location:a},err:null}},e.prototype.tryParseLeftAngleBracket=function(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Ze(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var n=this.char();if(39===n){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(n);this.bump()}return De.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),De(n))},e.prototype.parseArgument=function(e,t){var n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(K.EXPECT_ARGUMENT_CLOSING_BRACE,Te(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(K.EMPTY_ARGUMENT,Te(n,this.clonePosition()));var r=this.parseIdentifierIfPossible().value;if(!r)return this.error(K.MALFORMED_ARGUMENT,Te(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(K.EXPECT_ARGUMENT_CLOSING_BRACE,Te(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Z.argument,value:r,location:Te(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(K.EXPECT_ARGUMENT_CLOSING_BRACE,Te(n,this.clonePosition())):this.parseArgumentOptions(e,t,r,n);default:return this.error(K.MALFORMED_ARGUMENT,Te(n,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),n=He(this.message,t),r=t+n.length;return this.bumpTo(r),{value:n,location:Te(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,n,r){var o,i=this.clonePosition(),s=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(s){case"":return this.error(K.EXPECT_ARGUMENT_TYPE,Te(i,a));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var c=this.clonePosition();if((v=this.parseSimpleArgStyleIfPossible()).err)return v;if(0===(f=ze(v.val)).length)return this.error(K.EXPECT_ARGUMENT_STYLE,Te(this.clonePosition(),this.clonePosition()));l={style:f,styleLocation:Te(c,this.clonePosition())}}if((_=this.tryParseArgumentClose(r)).err)return _;var u=Te(r,this.clonePosition());if(l&&Ue(null==l?void 0:l.style,"::",0)){var h=Ge(l.style.slice(2));if("number"===s)return(v=this.parseNumberSkeletonFromString(h,l.styleLocation)).err?v:{val:{type:Z.number,value:n,location:u,style:v.val},err:null};if(0===h.length)return this.error(K.EXPECT_DATE_TIME_SKELETON,u);var d=h;this.locale&&(d=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e.charAt(r);if("j"===o){for(var i=0;r+1<e.length&&e.charAt(r+1)===o;)i++,r++;var s=1+(1&i),a=i<2?1:3+(i>>1),l=Me(t);for("H"!=l&&"k"!=l||(a=0);a-- >0;)n+="a";for(;s-- >0;)n=l+n}else n+="J"===o?"H":o}return n}(h,this.locale));var f={type:q.dateTime,pattern:d,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?fe(d):{}};return{val:{type:"date"===s?Z.date:Z.time,value:n,location:u,style:f},err:null}}return{val:{type:"number"===s?Z.number:"date"===s?Z.date:Z.time,value:n,location:u,style:null!==(o=null==l?void 0:l.style)&&void 0!==o?o:null},err:null};case"plural":case"selectordinal":case"select":var m=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(K.EXPECT_SELECT_ARGUMENT_OPTIONS,Te(m,z({},m)));this.bumpSpace();var p=this.parseIdentifierIfPossible(),g=0;if("select"!==s&&"offset"===p.value){if(!this.bumpIf(":"))return this.error(K.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Te(this.clonePosition(),this.clonePosition()));var v;if(this.bumpSpace(),(v=this.tryParseDecimalInteger(K.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,K.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE)).err)return v;this.bumpSpace(),p=this.parseIdentifierIfPossible(),g=v.val}var _,b=this.tryParsePluralOrSelectOptions(e,s,t,p);if(b.err)return b;if((_=this.tryParseArgumentClose(r)).err)return _;var y=Te(r,this.clonePosition());return"select"===s?{val:{type:Z.select,value:n,options:Fe(b.val),location:y},err:null}:{val:{type:Z.plural,value:n,options:Fe(b.val),offset:g,pluralType:"plural"===s?"cardinal":"ordinal",location:y},err:null};default:return this.error(K.INVALID_ARGUMENT_TYPE,Te(i,a))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(K.EXPECT_ARGUMENT_CLOSING_BRACE,Te(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var n=this.clonePosition();if(!this.bumpUntil("'"))return this.error(K.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Te(n,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");for(var t=e.split(me).filter((function(e){return e.length>0})),n=[],r=0,o=t;r<o.length;r++){var i=o[r].split("/");if(0===i.length)throw new Error("Invalid number skeleton");for(var s=i[0],a=i.slice(1),l=0,c=a;l<c.length;l++)if(0===c[l].length)throw new Error("Invalid number skeleton");n.push({stem:s,options:a})}return n}(e)}catch(e){return this.error(K.INVALID_NUMBER_SKELETON,t)}return{val:{type:q.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?Se(n):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,n,r){for(var o,i=!1,s=[],a=new Set,l=r.value,c=r.location;;){if(0===l.length){var u=this.clonePosition();if("select"===t||!this.bumpIf("="))break;var h=this.tryParseDecimalInteger(K.EXPECT_PLURAL_ARGUMENT_SELECTOR,K.INVALID_PLURAL_ARGUMENT_SELECTOR);if(h.err)return h;c=Te(u,this.clonePosition()),l=this.message.slice(u.offset,this.offset())}if(a.has(l))return this.error("select"===t?K.DUPLICATE_SELECT_ARGUMENT_SELECTOR:K.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===l&&(i=!0),this.bumpSpace();var d=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?K.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:K.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Te(this.clonePosition(),this.clonePosition()));var f=this.parseMessage(e+1,t,n);if(f.err)return f;var m=this.tryParseArgumentClose(d);if(m.err)return m;s.push([l,{value:f.val,location:Te(d,this.clonePosition())}]),a.add(l),this.bumpSpace(),l=(o=this.parseIdentifierIfPossible()).value,c=o.location}return 0===s.length?this.error("select"===t?K.EXPECT_SELECT_ARGUMENT_SELECTOR:K.EXPECT_PLURAL_ARGUMENT_SELECTOR,Te(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!i?this.error(K.MISSING_OTHER_CLAUSE,Te(this.clonePosition(),this.clonePosition())):{val:s,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var n=1,r=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);for(var o=!1,i=0;!this.isEOF();){var s=this.char();if(!(s>=48&&s<=57))break;o=!0,i=10*i+(s-48),this.bump()}var a=Te(r,this.clonePosition());return o?Ie(i*=n)?{val:i,err:null}:this.error(t,a):this.error(e,a)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=$e(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(Ue(this.message,e,this.offset())){for(var t=0;t<e.length;t++)this.bump();return!0}return!1},e.prototype.bumpUntil=function(e){var t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&qe(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),n=this.message.charCodeAt(t+(e>=65536?2:1));return null!=n?n:null},e}();function Ze(e){return e>=97&&e<=122||e>=65&&e<=90}function qe(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Xe(e){return e>=33&&e<=35||36===e||e>=37&&e<=39||40===e||41===e||42===e||43===e||44===e||45===e||e>=46&&e<=47||e>=58&&e<=59||e>=60&&e<=62||e>=63&&e<=64||91===e||92===e||93===e||94===e||96===e||123===e||124===e||125===e||126===e||161===e||e>=162&&e<=165||166===e||167===e||169===e||171===e||172===e||174===e||176===e||177===e||182===e||187===e||191===e||215===e||247===e||e>=8208&&e<=8213||e>=8214&&e<=8215||8216===e||8217===e||8218===e||e>=8219&&e<=8220||8221===e||8222===e||8223===e||e>=8224&&e<=8231||e>=8240&&e<=8248||8249===e||8250===e||e>=8251&&e<=8254||e>=8257&&e<=8259||8260===e||8261===e||8262===e||e>=8263&&e<=8273||8274===e||8275===e||e>=8277&&e<=8286||e>=8592&&e<=8596||e>=8597&&e<=8601||e>=8602&&e<=8603||e>=8604&&e<=8607||8608===e||e>=8609&&e<=8610||8611===e||e>=8612&&e<=8613||8614===e||e>=8615&&e<=8621||8622===e||e>=8623&&e<=8653||e>=8654&&e<=8655||e>=8656&&e<=8657||8658===e||8659===e||8660===e||e>=8661&&e<=8691||e>=8692&&e<=8959||e>=8960&&e<=8967||8968===e||8969===e||8970===e||8971===e||e>=8972&&e<=8991||e>=8992&&e<=8993||e>=8994&&e<=9e3||9001===e||9002===e||e>=9003&&e<=9083||9084===e||e>=9085&&e<=9114||e>=9115&&e<=9139||e>=9140&&e<=9179||e>=9180&&e<=9185||e>=9186&&e<=9254||e>=9255&&e<=9279||e>=9280&&e<=9290||e>=9291&&e<=9311||e>=9472&&e<=9654||9655===e||e>=9656&&e<=9664||9665===e||e>=9666&&e<=9719||e>=9720&&e<=9727||e>=9728&&e<=9838||9839===e||e>=9840&&e<=10087||10088===e||10089===e||10090===e||10091===e||10092===e||10093===e||10094===e||10095===e||10096===e||10097===e||10098===e||10099===e||10100===e||10101===e||e>=10132&&e<=10175||e>=10176&&e<=10180||10181===e||10182===e||e>=10183&&e<=10213||10214===e||10215===e||10216===e||10217===e||10218===e||10219===e||10220===e||10221===e||10222===e||10223===e||e>=10224&&e<=10239||e>=10240&&e<=10495||e>=10496&&e<=10626||10627===e||10628===e||10629===e||10630===e||10631===e||10632===e||10633===e||10634===e||10635===e||10636===e||10637===e||10638===e||10639===e||10640===e||10641===e||10642===e||10643===e||10644===e||10645===e||10646===e||10647===e||10648===e||e>=10649&&e<=10711||10712===e||10713===e||10714===e||10715===e||e>=10716&&e<=10747||10748===e||10749===e||e>=10750&&e<=11007||e>=11008&&e<=11055||e>=11056&&e<=11076||e>=11077&&e<=11078||e>=11079&&e<=11084||e>=11085&&e<=11123||e>=11124&&e<=11125||e>=11126&&e<=11157||11158===e||e>=11159&&e<=11263||e>=11776&&e<=11777||11778===e||11779===e||11780===e||11781===e||e>=11782&&e<=11784||11785===e||11786===e||11787===e||11788===e||11789===e||e>=11790&&e<=11798||11799===e||e>=11800&&e<=11801||11802===e||11803===e||11804===e||11805===e||e>=11806&&e<=11807||11808===e||11809===e||11810===e||11811===e||11812===e||11813===e||11814===e||11815===e||11816===e||11817===e||e>=11818&&e<=11822||11823===e||e>=11824&&e<=11833||e>=11834&&e<=11835||e>=11836&&e<=11839||11840===e||11841===e||11842===e||e>=11843&&e<=11855||e>=11856&&e<=11857||11858===e||e>=11859&&e<=11903||e>=12289&&e<=12291||12296===e||12297===e||12298===e||12299===e||12300===e||12301===e||12302===e||12303===e||12304===e||12305===e||e>=12306&&e<=12307||12308===e||12309===e||12310===e||12311===e||12312===e||12313===e||12314===e||12315===e||12316===e||12317===e||e>=12318&&e<=12319||12320===e||12336===e||64830===e||64831===e||e>=65093&&e<=65094}function Ye(e){e.forEach((function(e){if(delete e.location,ie(e)||se(e))for(var t in e.options)delete e.options[t].location,Ye(e.options[t].value);else ne(e)&&ce(e.style)||(re(e)||oe(e))&&ue(e.style)?delete e.style.location:le(e)&&Ye(e.children)}))}function Je(e,t){void 0===t&&(t={}),t=z({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Ke(e,t).parse();if(n.err){var r=SyntaxError(K[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return(null==t?void 0:t.captureLocation)||Ye(n.val),n.val}function Qe(e,t){var n=t&&t.cache?t.cache:at,r=t&&t.serializer?t.serializer:ot;return(t&&t.strategy?t.strategy:rt)(e,{cache:n,serializer:r})}function et(e,t,n,r){var o,i=null==(o=r)||"number"==typeof o||"boolean"==typeof o?r:n(r),s=t.get(i);return void 0===s&&(s=e.call(this,r),t.set(i,s)),s}function tt(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),i=t.get(o);return void 0===i&&(i=e.apply(this,r),t.set(o,i)),i}function nt(e,t,n,r,o){return n.bind(t,e,r,o)}function rt(e,t){return nt(e,this,1===e.length?et:tt,t.cache.create(),t.serializer)}var ot=function(){return JSON.stringify(arguments)};function it(){this.cache=Object.create(null)}it.prototype.get=function(e){return this.cache[e]},it.prototype.set=function(e,t){this.cache[e]=t};var st,at={create:function(){return new it}},lt={variadic:function(e,t){return nt(e,this,tt,t.cache.create(),t.serializer)},monadic:function(e,t){return nt(e,this,et,t.cache.create(),t.serializer)}};!function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"}(st||(st={}));var ct,ut=function(e){function t(t,n,r){var o=e.call(this,t)||this;return o.code=n,o.originalMessage=r,o}return G(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),ht=function(e){function t(t,n,r,o){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(n,'". Options are "').concat(Object.keys(r).join('", "'),'"'),st.INVALID_VALUE,o)||this}return G(t,e),t}(ut),dt=function(e){function t(t,n,r){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(n),st.INVALID_VALUE,r)||this}return G(t,e),t}(ut),ft=function(e){function t(t,n){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(n,'"'),st.MISSING_VALUE,n)||this}return G(t,e),t}(ut);function mt(e){return"function"==typeof e}function pt(e,t,n,r,o,i,s){if(1===e.length&&ee(e[0]))return[{type:ct.literal,value:e[0].value}];for(var a=[],l=0,c=e;l<c.length;l++){var u=c[l];if(ee(u))a.push({type:ct.literal,value:u.value});else if(ae(u))"number"==typeof i&&a.push({type:ct.literal,value:n.getNumberFormat(t).format(i)});else{var h=u.value;if(!o||!(h in o))throw new ft(h,s);var d=o[h];if(te(u))d&&"string"!=typeof d&&"number"!=typeof d||(d="string"==typeof d||"number"==typeof d?String(d):""),a.push({type:"string"==typeof d?ct.literal:ct.object,value:d});else if(re(u)){var f="string"==typeof u.style?r.date[u.style]:ue(u.style)?u.style.parsedOptions:void 0;a.push({type:ct.literal,value:n.getDateTimeFormat(t,f).format(d)})}else if(oe(u))f="string"==typeof u.style?r.time[u.style]:ue(u.style)?u.style.parsedOptions:r.time.medium,a.push({type:ct.literal,value:n.getDateTimeFormat(t,f).format(d)});else if(ne(u))(f="string"==typeof u.style?r.number[u.style]:ce(u.style)?u.style.parsedOptions:void 0)&&f.scale&&(d*=f.scale||1),a.push({type:ct.literal,value:n.getNumberFormat(t,f).format(d)});else{if(le(u)){var m=u.children,p=u.value,g=o[p];if(!mt(g))throw new dt(p,"function",s);var v=g(pt(m,t,n,r,o,i).map((function(e){return e.value})));Array.isArray(v)||(v=[v]),a.push.apply(a,v.map((function(e){return{type:"string"==typeof e?ct.literal:ct.object,value:e}})))}if(ie(u)){if(!(_=u.options[d]||u.options.other))throw new ht(u.value,d,Object.keys(u.options),s);a.push.apply(a,pt(_.value,t,n,r,o))}else if(se(u)){var _;if(!(_=u.options["=".concat(d)])){if(!Intl.PluralRules)throw new ut('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',st.MISSING_INTL_API,s);var b=n.getPluralRules(t,{type:u.pluralType}).select(d-(u.offset||0));_=u.options[b]||u.options.other}if(!_)throw new ht(u.value,d,Object.keys(u.options),s);a.push.apply(a,pt(_.value,t,n,r,o,d-(u.offset||0)))}}}}return(y=a).length<2?y:y.reduce((function(e,t){var n=e[e.length-1];return n&&n.type===ct.literal&&t.type===ct.literal?n.value+=t.value:e.push(t),e}),[]);var y}function gt(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}!function(e){e[e.literal=0]="literal",e[e.object=1]="object"}(ct||(ct={}));var vt,_t=function(){function e(t,n,r,o){var i,s,a,l=this;if(void 0===n&&(n=e.defaultLocale),this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=l.formatToParts(e);if(1===t.length)return t[0].value;var n=t.reduce((function(e,t){return e.length&&t.type===ct.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e}),[]);return n.length<=1?n[0]||"":n},this.formatToParts=function(e){return pt(l.ast,l.locales,l.formatters,l.formats,e,void 0,l.message)},this.resolvedOptions=function(){var e;return{locale:(null===(e=l.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(l.locales)[0]}},this.getAst=function(){return l.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),"string"==typeof t){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");this.ast=e.__parse(t,{ignoreTag:null==o?void 0:o.ignoreTag,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=(s=e.formats,(a=r)?Object.keys(s).reduce((function(e,t){var n,r;return e[t]=(n=s[t],(r=a[t])?z(z(z({},n||{}),r||{}),Object.keys(n).reduce((function(e,t){return e[t]=z(z({},n[t]),r[t]||{}),e}),{})):n),e}),z({},s)):s),this.formatters=o&&o.formatters||(void 0===(i=this.formatterCache)&&(i={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Qe((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.NumberFormat).bind.apply(e,W([void 0],t,!1)))}),{cache:gt(i.number),strategy:lt.variadic}),getDateTimeFormat:Qe((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.DateTimeFormat).bind.apply(e,W([void 0],t,!1)))}),{cache:gt(i.dateTime),strategy:lt.variadic}),getPluralRules:Qe((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.PluralRules).bind.apply(e,W([void 0],t,!1)))}),{cache:gt(i.pluralRules),strategy:lt.variadic})})}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(e){if(void 0!==Intl.Locale){var t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])}},e.__parse=Je,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();!function(e){e.FORMAT_ERROR="FORMAT_ERROR",e.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",e.INVALID_CONFIG="INVALID_CONFIG",e.MISSING_DATA="MISSING_DATA",e.MISSING_TRANSLATION="MISSING_TRANSLATION"}(vt||(vt={}));var bt=function(e){function t(n,r,o){var i=this,s=o?o instanceof Error?o:new Error(String(o)):void 0;return(i=e.call(this,"[@formatjs/intl Error ".concat(n,"] ").concat(r,"\n").concat(s?"\n".concat(s.message,"\n").concat(s.stack):""))||this).code=n,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(i,t),i}return G(t,e),t}(Error),yt=function(e){function t(t,n){return e.call(this,vt.UNSUPPORTED_FORMATTER,t,n)||this}return G(t,e),t}(bt),wt=function(e){function t(t,n){return e.call(this,vt.INVALID_CONFIG,t,n)||this}return G(t,e),t}(bt),Et=function(e){function t(t,n){return e.call(this,vt.MISSING_DATA,t,n)||this}return G(t,e),t}(bt),St=function(e){function t(t,n,r){return e.call(this,vt.FORMAT_ERROR,"".concat(t,"\nLocale: ").concat(n,"\n"),r)||this}return G(t,e),t}(bt),kt=function(e){function t(t,n,r,o){var i=e.call(this,"".concat(t,"\nMessageID: ").concat(null==r?void 0:r.id,"\nDefault Message: ").concat(null==r?void 0:r.defaultMessage,"\nDescription: ").concat(null==r?void 0:r.description,"\n"),n,o)||this;return i.descriptor=r,i}return G(t,e),t}(St),Ot=function(e){function t(t,n){var r=e.call(this,vt.MISSING_TRANSLATION,'Missing message: "'.concat(t.id,'" for locale "').concat(n,'", using ').concat(t.defaultMessage?"default message (".concat("string"==typeof t.defaultMessage?t.defaultMessage:t.defaultMessage.map((function(e){var t;return null!==(t=e.value)&&void 0!==t?t:JSON.stringify(e)})).join(),")"):"id"," as fallback."))||this;return r.descriptor=t,r}return G(t,e),t}(bt);function Mt(e,t,n){return void 0===n&&(n={}),t.reduce((function(t,r){return r in e?t[r]=e[r]:r in n&&(t[r]=n[r]),t}),{})}var Nt={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:function(e){},onWarn:function(e){}};function Ct(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function Tt(e,t,n,r){var o,i=e&&e[t];if(i&&(o=i[n]),o)return o;r(new yt("No ".concat(t," format named: ").concat(n)))}function xt(e){Q(e,"[React Intl] Could not find required `intl` object. <IntlProvider> needs to exist in the component ancestry.")}var Pt=z(z({},Nt),{textComponent:y.Fragment});function At(e,t){if(e===t)return!0;if(!e||!t)return!1;var n=Object.keys(e),r=Object.keys(t),o=n.length;if(r.length!==o)return!1;for(var i=0;i<o;i++){var s=n[i];if(e[s]!==t[s]||!Object.prototype.hasOwnProperty.call(t,s))return!1}return!0}function Lt(e,t){return Object.keys(e).reduce((function(n,r){return n[r]=z({timeZone:t},e[r]),n}),{})}function Rt(e,t){return Object.keys(z(z({},e),t)).reduce((function(n,r){return n[r]=z(z({},e[r]||{}),t[r]||{}),n}),{})}function jt(e,t){if(!t)return e;var n=_t.formats;return z(z(z({},n),e),{date:Rt(Lt(n.date,t),Lt(e.date||{},t)),time:Rt(Lt(n.time,t),Lt(e.time||{},t))})}var It=function(e,t,n,r,o){var i=e.locale,s=e.formats,a=e.messages,l=e.defaultLocale,c=e.defaultFormats,u=e.fallbackOnEmptyString,h=e.onError,d=e.timeZone,f=e.defaultRichTextElements;void 0===n&&(n={id:""});var m=n.id,p=n.defaultMessage;Q(!!m,"[@formatjs/intl] An `id` must be provided to format a message. You can either:\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\nto autofix this issue");var g=String(m),v=a&&Object.prototype.hasOwnProperty.call(a,g)&&a[g];if(Array.isArray(v)&&1===v.length&&v[0].type===Z.literal)return v[0].value;if(!r&&v&&"string"==typeof v&&!f)return v.replace(/'\{(.*?)\}'/gi,"{$1}");if(r=z(z({},f),r||{}),s=jt(s,d),c=jt(c,d),!v){if(!1===u&&""===v)return v;if((!p||i&&i.toLowerCase()!==l.toLowerCase())&&h(new Ot(n,i)),p)try{return t.getMessageFormat(p,l,c,o).format(r)}catch(e){return h(new kt('Error formatting default message for: "'.concat(g,'", rendering default message verbatim'),i,n,e)),"string"==typeof p?p:g}return g}try{return t.getMessageFormat(v,i,s,z({formatters:t},o||{})).format(r)}catch(e){h(new kt('Error formatting message: "'.concat(g,'", using ').concat(p?"default message":"id"," as fallback."),i,n,e))}if(p)try{return t.getMessageFormat(p,l,c,o).format(r)}catch(e){h(new kt('Error formatting the default message for: "'.concat(g,'", rendering message verbatim'),i,n,e))}return"string"==typeof v?v:"string"==typeof p?p:g},Bt=["style","currency","currencyDisplay","unit","unitDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","currencyDisplay","currencySign","notation","signDisplay","unit","unitDisplay","numberingSystem"];function Ht(e,t,n){var r=e.locale,o=e.formats,i=e.onError;void 0===n&&(n={});var s=n.format,a=s&&Tt(o,"number",s,i)||{};return t(r,Mt(n,Bt,a))}function Ut(e,t,n,r){void 0===r&&(r={});try{return Ht(e,t,r).format(n)}catch(t){e.onError(new bt(vt.FORMAT_ERROR,"Error formatting number.",t))}return String(n)}function Dt(e,t,n,r){void 0===r&&(r={});try{return Ht(e,t,r).formatToParts(n)}catch(t){e.onError(new bt(vt.FORMAT_ERROR,"Error formatting number.",t))}return[]}var Ft=["numeric","style"];function $t(e,t,n,r,o){void 0===o&&(o={}),r||(r="second"),Intl.RelativeTimeFormat||e.onError(new ut('Intl.RelativeTimeFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-relativetimeformat"\n',st.MISSING_INTL_API));try{return function(e,t,n){var r=e.locale,o=e.formats,i=e.onError;void 0===n&&(n={});var s=n.format,a=!!s&&Tt(o,"relative",s,i)||{};return t(r,Mt(n,Ft,a))}(e,t,o).format(n,r)}catch(t){e.onError(new St("Error formatting relative time.",e.locale,t))}return String(n)}var Gt=["formatMatcher","timeZone","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName","hourCycle","dateStyle","timeStyle","calendar","numberingSystem","fractionalSecondDigits"];function zt(e,t,n,r){var o=e.locale,i=e.formats,s=e.onError,a=e.timeZone;void 0===r&&(r={});var l=r.format,c=z(z({},a&&{timeZone:a}),l&&Tt(i,t,l,s)),u=Mt(r,Gt,c);return"time"!==t||u.hour||u.minute||u.second||u.timeStyle||u.dateStyle||(u=z(z({},u),{hour:"numeric",minute:"numeric"})),n(o,u)}function Vt(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=n[0],i=n[1],s=void 0===i?{}:i,a="string"==typeof o?new Date(o||0):o;try{return zt(e,"date",t,s).format(a)}catch(t){e.onError(new bt(vt.FORMAT_ERROR,"Error formatting date.",t))}return String(a)}function Wt(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=n[0],i=n[1],s=void 0===i?{}:i,a="string"==typeof o?new Date(o||0):o;try{return zt(e,"time",t,s).format(a)}catch(t){e.onError(new bt(vt.FORMAT_ERROR,"Error formatting time.",t))}return String(a)}function Kt(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=n[0],i=n[1],s=n[2],a=void 0===s?{}:s,l=e.timeZone,c=e.locale,u=e.onError,h=Mt(a,Gt,l?{timeZone:l}:{});try{return t(c,h).formatRange(o,i)}catch(e){u(new bt(vt.FORMAT_ERROR,"Error formatting date time range.",e))}return String(o)}function Zt(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=n[0],i=n[1],s=void 0===i?{}:i,a="string"==typeof o?new Date(o||0):o;try{return zt(e,"date",t,s).formatToParts(a)}catch(t){e.onError(new bt(vt.FORMAT_ERROR,"Error formatting date.",t))}return[]}function qt(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=n[0],i=n[1],s=void 0===i?{}:i,a="string"==typeof o?new Date(o||0):o;try{return zt(e,"time",t,s).formatToParts(a)}catch(t){e.onError(new bt(vt.FORMAT_ERROR,"Error formatting time.",t))}return[]}var Xt=["type"];function Yt(e,t,n,r){var o=e.locale,i=e.onError;void 0===r&&(r={}),Intl.PluralRules||i(new ut('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',st.MISSING_INTL_API));var s=Mt(r,Xt);try{return t(o,s).select(n)}catch(e){i(new St("Error formatting plural.",o,e))}return"other"}var Jt=["type","style"],Qt=Date.now();function en(e,t,n,r){void 0===r&&(r={});var o=tn(e,t,n,r).reduce((function(e,t){var n=t.value;return"string"!=typeof n?e.push(n):"string"==typeof e[e.length-1]?e[e.length-1]+=n:e.push(n),e}),[]);return 1===o.length?o[0]:o}function tn(e,t,n,r){var o=e.locale,i=e.onError;void 0===r&&(r={}),Intl.ListFormat||i(new ut('Intl.ListFormat is not available in this environment.\nTry polyfilling it using "@formatjs/intl-listformat"\n',st.MISSING_INTL_API));var s=Mt(r,Jt);try{var a={},l=n.map((function(e,t){if("object"==typeof e){var n=function(e){return"".concat(Qt,"_").concat(e,"_").concat(Qt)}(t);return a[n]=e,n}return String(e)}));return t(o,s).formatToParts(l).map((function(e){return"literal"===e.type?e:z(z({},e),{value:a[e.value]||e.value})}))}catch(e){i(new bt(vt.FORMAT_ERROR,"Error formatting list.",e))}return n}var nn=["style","type","fallback"];function rn(e,t,n,r){var o=e.locale,i=e.onError;Intl.DisplayNames||i(new ut('Intl.DisplayNames is not available in this environment.\nTry polyfilling it using "@formatjs/intl-displaynames"\n',st.MISSING_INTL_API));var s=Mt(r,nn);try{return t(o,s).of(n)}catch(e){i(new bt(vt.FORMAT_ERROR,"Error formatting display name.",e))}}function on(e,t){var n=function(e){void 0===e&&(e={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}});var t=Intl.RelativeTimeFormat,n=Intl.ListFormat,r=Intl.DisplayNames,o=Qe((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.DateTimeFormat).bind.apply(e,W([void 0],t,!1)))}),{cache:Ct(e.dateTime),strategy:lt.variadic}),i=Qe((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.NumberFormat).bind.apply(e,W([void 0],t,!1)))}),{cache:Ct(e.number),strategy:lt.variadic}),s=Qe((function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new((e=Intl.PluralRules).bind.apply(e,W([void 0],t,!1)))}),{cache:Ct(e.pluralRules),strategy:lt.variadic});return{getDateTimeFormat:o,getNumberFormat:i,getMessageFormat:Qe((function(e,t,n,r){return new _t(e,t,n,z({formatters:{getNumberFormat:i,getDateTimeFormat:o,getPluralRules:s}},r||{}))}),{cache:Ct(e.message),strategy:lt.variadic}),getRelativeTimeFormat:Qe((function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new(t.bind.apply(t,W([void 0],e,!1)))}),{cache:Ct(e.relativeTime),strategy:lt.variadic}),getPluralRules:s,getListFormat:Qe((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(n.bind.apply(n,W([void 0],e,!1)))}),{cache:Ct(e.list),strategy:lt.variadic}),getDisplayNames:Qe((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(r.bind.apply(r,W([void 0],e,!1)))}),{cache:Ct(e.displayNames),strategy:lt.variadic})}}(t),r=z(z({},Nt),e),o=r.locale,i=r.defaultLocale,s=r.onError;return o?!Intl.NumberFormat.supportedLocalesOf(o).length&&s?s(new Et('Missing locale data for locale: "'.concat(o,'" in Intl.NumberFormat. Using default locale: "').concat(i,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):!Intl.DateTimeFormat.supportedLocalesOf(o).length&&s&&s(new Et('Missing locale data for locale: "'.concat(o,'" in Intl.DateTimeFormat. Using default locale: "').concat(i,'" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details'))):(s&&s(new wt('"locale" was not configured, using "'.concat(i,'" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details'))),r.locale=r.defaultLocale||"en"),function(e){e.onWarn&&e.defaultRichTextElements&&function(e){return"string"==typeof(e?e[Object.keys(e)[0]]:void 0)}(e.messages||{})&&e.onWarn('[@formatjs/intl] "defaultRichTextElements" was specified but "message" was not pre-compiled. \nPlease consider using "@formatjs/cli" to pre-compile your messages for performance.\nFor more details see https://formatjs.io/docs/getting-started/message-distribution')}(r),z(z({},r),{formatters:n,formatNumber:Ut.bind(null,r,n.getNumberFormat),formatNumberToParts:Dt.bind(null,r,n.getNumberFormat),formatRelativeTime:$t.bind(null,r,n.getRelativeTimeFormat),formatDate:Vt.bind(null,r,n.getDateTimeFormat),formatDateToParts:Zt.bind(null,r,n.getDateTimeFormat),formatTime:Wt.bind(null,r,n.getDateTimeFormat),formatDateTimeRange:Kt.bind(null,r,n.getDateTimeFormat),formatTimeToParts:qt.bind(null,r,n.getDateTimeFormat),formatPlural:Yt.bind(null,r,n.getPluralRules),formatMessage:It.bind(null,r,n),$t:It.bind(null,r,n),formatList:en.bind(null,r,n.getListFormat),formatListToParts:tn.bind(null,r,n.getListFormat),formatDisplayName:rn.bind(null,r,n.getDisplayNames)})}function sn(e){return{locale:e.locale,timeZone:e.timeZone,fallbackOnEmptyString:e.fallbackOnEmptyString,formats:e.formats,textComponent:e.textComponent,messages:e.messages,defaultLocale:e.defaultLocale,defaultFormats:e.defaultFormats,onError:e.onError,onWarn:e.onWarn,wrapRichTextChunksInFragment:e.wrapRichTextChunksInFragment,defaultRichTextElements:e.defaultRichTextElements}}function an(e){return e?Object.keys(e).reduce((function(t,n){var r,o=e[n];return t[n]=mt(o)?(r=o,function(e){return r(y.Children.toArray(e))}):o,t}),{}):e}var ln=function(e,t,n,r){for(var o=[],i=4;i<arguments.length;i++)o[i-4]=arguments[i];var s=an(r),a=It.apply(void 0,W([e,t,n,s],o,!1));return Array.isArray(a)?y.Children.toArray(a):a},cn=function(e,t){var n=e.defaultRichTextElements,r=V(e,["defaultRichTextElements"]),o=an(n),i=on(z(z(z({},Pt),r),{defaultRichTextElements:o}),t),s={locale:i.locale,timeZone:i.timeZone,fallbackOnEmptyString:i.fallbackOnEmptyString,formats:i.formats,defaultLocale:i.defaultLocale,defaultFormats:i.defaultFormats,messages:i.messages,onError:i.onError,defaultRichTextElements:o};return z(z({},i),{formatMessage:ln.bind(null,s,i.formatters),$t:ln.bind(null,s,i.formatters)})},un=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.cache={dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}},t.state={cache:t.cache,intl:cn(sn(t.props),t.cache),prevConfig:sn(t.props)},t}return G(t,e),t.getDerivedStateFromProps=function(e,t){var n=t.prevConfig,r=t.cache,o=sn(e);return At(n,o)?null:{intl:cn(o,r),prevConfig:o}},t.prototype.render=function(){return xt(this.state.intl),y.createElement(Y,{value:this.state.intl},this.props.children)},t.displayName="IntlProvider",t.defaultProps=Pt,t}(y.PureComponent);const hn=un;const dn={};function fn(e){return!(!window.parent||window.parent===window||(window.parent.postMessage(e,"*"),0))}function mn({data:e}){return"object"!=typeof e||null===e||Array.isArray(e)?{}:e}function pn(e){let t=0;if(e){const{top:n}=e.getBoundingClientRect();t=window.scrollY+Math.abs(n)+e.scrollHeight+20}const n=document.body.offsetHeight+12;fn({height:Math.max(t,n)})}var gn,vn,_n=s(8471),bn=s(9419),yn=s.n(bn);function wn(){var e=y.useContext(J);return xt(e),e}!function(e){e.formatDate="FormattedDate",e.formatTime="FormattedTime",e.formatNumber="FormattedNumber",e.formatList="FormattedList",e.formatDisplayName="FormattedDisplayName"}(gn||(gn={})),function(e){e.formatDate="FormattedDateParts",e.formatTime="FormattedTimeParts",e.formatNumber="FormattedNumberParts",e.formatList="FormattedListParts"}(vn||(vn={}));var En=function(e){var t=wn(),n=e.value,r=e.children,o=V(e,["value","children"]);return r(t.formatNumberToParts(n,o))};function Sn(e){var t=function(t){var n=wn(),r=t.value,o=t.children,i=V(t,["value","children"]),s="string"==typeof r?new Date(r||0):r;return o("formatDate"===e?n.formatDateToParts(s,i):n.formatTimeToParts(s,i))};return t.displayName=vn[e],t}function kn(e){var t=function(t){var n=wn(),r=t.value,o=t.children,i=V(t,["value","children"]),s=n[e](r,i);if("function"==typeof o)return o(s);var a=n.textComponent||y.Fragment;return y.createElement(a,null,s)};return t.displayName=gn[e],t}function On(e){var t=wn(),n=t.formatMessage,r=t.textComponent,o=void 0===r?y.Fragment:r,i=e.id,s=e.description,a=e.defaultMessage,l=e.values,c=e.children,u=e.tagName,h=void 0===u?o:u,d=n({id:i,description:s,defaultMessage:a},l,{ignoreTag:e.ignoreTag});return"function"==typeof c?c(Array.isArray(d)?d:[d]):h?y.createElement(h,null,y.Children.toArray(d)):y.createElement(y.Fragment,null,d)}En.displayName="FormattedNumberParts",En.displayName="FormattedNumberParts",kn("formatDate"),kn("formatTime"),kn("formatNumber"),kn("formatList"),kn("formatDisplayName"),Sn("formatDate"),Sn("formatTime"),On.displayName="FormattedMessage";var Mn=y.memo(On,(function(e,t){var n=e.values,r=V(e,["values"]),o=t.values,i=V(t,["values"]);return At(o,n)&&At(r,i)}));Mn.displayName="MemoizedFormattedMessage";const Nn=Mn;function Cn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Cn(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}const Tn=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Cn(e))&&(r&&(r+=" "),r+=t);return r},xn=function(){var e;const t=null!==(e=window.remark_config.host)&&void 0!==e?e:"https://r42p-01.b37m.ru";if(!t)throw new Error("Remark42: remark_config.host wasn't configured.");try{const{protocol:e}=new URL(t);if(e!==window.location.protocol&&console.error("Remark42: Protocol mismatch."),!e.startsWith("http"))throw console.error("Remark42: Wrong protocol in host URL."),new Error}catch(e){throw new Error("Remark42: Invalid host URL.")}return t}(),Pn="__remarkCollapsed",An="__remark_comment_value",Ln="__remarkHiddenUsers",Rn="__remarkSort",jn="__remarkEmail",In=["light","dark"],Bn=/Android|webOS|iPhone|iPad|iPod|Opera Mini|Windows Phone/i.test(navigator.userAgent),Hn=(()=>{try{localStorage.setItem("localstorage_availability_test",""),localStorage.removeItem("localstorage_availability_test")}catch(e){return!1}return!0})(),Un=(()=>{try{return window.parent.location.host!==window.location.host}catch(e){return!0}})();function Dn(e=window.location.search){const t={};return new URLSearchParams(e).forEach(((e,n)=>{t[n]=e})),t}var Fn;const $n=Dn(),Gn=null!==(Fn=function(e){if("string"!=typeof e)return;const t=+e;return isNaN(t)?void 0:t}($n.max_shown_comments))&&void 0!==Fn?Fn:10,zn=($n.show_email_subscription,$n.show_telegram_subscription,void 0===$n.show_rss_subscription||$n.show_rss_subscription,$n.theme=(Vn=In,Wn=$n.theme,Vn.includes(Wn)?$n.theme:In[0]));var Vn,Wn;const Kn=$n.site_id||"remark",Zn=$n.page_title,qn=$n.url,Xn=($n.token,$n.locale||"en"),Yn=($n.no_footer,{"fetch-error":{id:"errors.failed-fetch",defaultMessage:"Failed to fetch. Please check your internet connection or try again a bit later"},0:{id:"errors.0",defaultMessage:"Something went wrong. Please try again a bit later."},1:{id:"errors.1",defaultMessage:"Comment cannot be found. Please refresh the page and try again."},2:{id:"errors.2",defaultMessage:"Failed to unmarshal incoming request."},3:{id:"errors.3",defaultMessage:"You don't have permission for this operation."},4:{id:"errors.4",defaultMessage:"Invalid comment data."},5:{id:"errors.5",defaultMessage:"Comment cannot be found. Please refresh the page and try again."},6:{id:"errors.6",defaultMessage:"Site cannot be found. Please refresh the page and try again."},7:{id:"errors.7",defaultMessage:"User has been blocked."},8:{id:"errors.8",defaultMessage:"Can't post comments on this page. Comments are read only."},9:{id:"errors.9",defaultMessage:"Comment changing failed. Please try again a bit later."},10:{id:"errors.10",defaultMessage:"It is too late to edit the comment."},11:{id:"errors.11",defaultMessage:"Comment already has reply, editing is not possible."},12:{id:"errors.12",defaultMessage:"Cannot save voting result. Please try again a bit later."},13:{id:"errors.13",defaultMessage:"You cannot vote for your own comment."},14:{id:"errors.14",defaultMessage:"You have already voted for the comment."},15:{id:"errors.15",defaultMessage:"Too many votes for the comment."},16:{id:"errors.16",defaultMessage:"Min score reached for the comment."},17:{id:"errors.17",defaultMessage:"Action rejected. Please try again a bit later."},18:{id:"errors.18",defaultMessage:"Requested file cannot be found."},19:{id:"errors.19",defaultMessage:"Comment contains restricted words."},20:{id:"errors.20",defaultMessage:"Posted image not found. Please try to upload it again."},401:{id:"errors.not-authorized",defaultMessage:"Not authorized."},403:{id:"errors.forbidden",defaultMessage:"Forbidden."},409:{id:"errors.conflict",defaultMessage:"Conflict."},429:{id:"errors.to-many-request",defaultMessage:"You have reached maximum request limit."},500:{id:"errors.unexpected-error",defaultMessage:"Something went wrong."}});function Jn(e,t){return"string"==typeof e?e:e instanceof Qn?t.formatMessage(Yn[e.code]):t.formatMessage(Yn[0])}class Qn extends Error{constructor(e,t){super(e),this.code=t,this.error=e}}const er={config:{version:"",edit_duration:5e3,max_comment_size:5e3,admins:[],admin_email:"",auth_providers:[],critical_score:0,low_score:0,positive_score:!1,readonly_age:0,max_image_size:0,simple_view:!1,anon_vote:!1,email_notifications:!1,telegram_notifications:!1,emoji_enabled:!1}};const tr="X-JWT";let nr;const rr=(e="")=>{const t=(t,n,r={},o)=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}(void 0,void 0,void 0,(function*(){var i;const s=new URLSearchParams(Object.assign({site:Kn},r)),a=`${e}${n}?${s}`,l={},c={method:t};nr&&(l["X-JWT"]=nr);const u=function(e){const t=document.cookie.match(new RegExp(`(?:^|; )${"XSRF-TOKEN".replace(/([.$?*|{}()[\]\\/+^])/g,"\\$1")}=([^;]*)`));return t?decodeURIComponent(t[1]):void 0}();void 0!==u&&(l["X-XSRF-TOKEN"]=u),o instanceof FormData?c.body=o:"object"==typeof o&&null!==o?(l["Content-Type"]="application/json",c.body=JSON.stringify(Object.assign(Object.assign({},o),{site:Kn}))):c.body=o;try{const e=yield fetch(a,Object.assign(Object.assign({},c),{headers:l})),t=e.headers.has("date")&&e.headers.get("date")||"",n=isNaN(Date.parse(t))?0:Date.parse(t);if(er.serverClientTimeDiff=((new Date).getTime()-n)/1e3,e.headers.has(tr)&&(nr=e.headers.get(tr)),[401,403].includes(e.status)&&(nr=void 0),e.status>=400){const t=Yn[e.status];if(t)throw new Qn(t.defaultMessage,e.status);return e.text().then((e=>{let t;try{t=JSON.parse(e)}catch(e){throw new Qn(Yn[500].defaultMessage,0)}throw t}))}return 0===(null===(i=e.headers.get("Content-Type"))||void 0===i?void 0:i.indexOf("application/json"))?e.json():e.text()}catch(e){if(e instanceof Error&&"Failed to fetch"===e.message)throw new Qn(e.message,"fetch-error");throw e}}));return{get:(e,n,r)=>t("get",e,n,r),put:(e,n,r)=>t("put",e,n,r),post:(e,n,r)=>t("post",e,n,r),delete:(e,n,r)=>t("delete",e,n,r)}},or=rr(`${xn}/api/v1`),ir=rr(`${xn}/auth`),sr=rr(`${xn}/api/v1/admin`),ar=e=>or.post("/preview",{},{text:e});function lr(){return or.get("/user").catch((()=>null))}const cr=e=>{const t=new FormData;return t.append("file",e),or.post("/picture",{},t).then((t=>({name:e.name,size:e.size,type:e.type,url:`${xn+"/api/v1"}/picture/${t.id}`})))};const ur="/email/login",hr="/telegram/login";let dr,fr=!1,mr=null;function pr(e){return mr=window.open(e),fr?Promise.resolve(null):new Promise(((e,t)=>{function n(){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){if(!document.hasFocus()||document.hidden||!(null==mr?void 0:mr.closed))return;const t=yield lr();if(clearTimeout(dr),null===t)return dr=setTimeout((()=>{n()}),6e4),null;e(t),document.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n),fr=!1,clearTimeout(dr)}))}setTimeout((()=>{t()}),3e5),document.addEventListener("visibilitychange",n),window.addEventListener("focus",n)}))}function gr(){return ir.get(hr)}function vr(){return ir.get("/logout")}function _r(e){return function(e){const t=new Date;switch(e){case"permanently":return t.setFullYear(t.getFullYear()+100),t;case"43200m":return t.setMonth(t.getMonth()+1),t;case"10080m":return t.setDate(t.getDate()+7),t;case"1440m":return t.setDate(t.getDate()+1),t;default:throw new Error("unknown block ttl")}}(e).toISOString()}function br(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}const yr="remark42: localStorage access denied, check browser preferences",wr=Hn?localStorage.setItem.bind(localStorage):()=>{console.error(yr)},Er=Hn?localStorage.getItem.bind(localStorage):()=>(console.error(yr),null);function Sr(e){try{const t=Er(e);return null===t?null:JSON.parse(t)}catch(t){return console.error(`remark42: error on read JSON from ${e} in localStorage`,t),null}}function kr(e,t){try{wr(e,JSON.stringify(t))}catch(t){console.error(`remark42: error on parse JSON from ${e} in localStorage`,t)}}function Or(e,t){const n=Sr(e);if(Array.isArray(t)&&Array.isArray(n))kr(e,[...n,...t]);else if(br(t))kr(e,Object.assign(Object.assign({},n),t));else{if("function"!=typeof t)throw new Error(`remark42: error on update JSON for ${e} in localStorage`);kr(e,t(n))}}function Mr(){try{const e=JSON.parse(Er(Ln)||"{}");if("object"==typeof e&&null!==e&&!Array.isArray(e))return e}catch(e){console.error("incorrect hidden user data in local storage",e)}return{}}Hn&&localStorage.removeItem.bind(localStorage);const Nr="USER/SET",Cr="USER/BANLIST_SET",Tr="USER/BAN",xr="USER/UNBAN",Pr="USER/HIDELIST_SET",Ar="USER/HIDE",Lr="USER/UNHIDE";var Rr;!function(e){e[e.None=0]="None",e[e.Reply=1]="Reply",e[e.Edit=2]="Edit"}(Rr||(Rr={}));const jr="POST_INFO/SET";function Ir(e){return{type:jr,info:e}}function Br(e,t){let n=!1;const r=e.reduce(((e,r)=>{if(!t(r))return n=!0,e;const o=r.replies?Object.assign(Object.assign({},r),{replies:Br(r.replies,t)}):r;return o!==r&&(n=!0),e.push(o),e}),[]);return n?r:e}function Hr(e){let t=[];return e.comment.pin&&(t=t.concat(e.comment)),e.replies&&(t=t.concat(e.replies.reduce(((e,t)=>e.concat(Hr(t))),[]))),t}function Ur(e){return e.reduce(((e,t)=>e.concat(Hr(t))),[])}const Dr="COMMENT/PATCH",Fr="COMMENTS/SET",$r="COMMENTS/APPEND",Gr="COMMENTS/EDIT",zr="COMMENTS/PATCH",Vr="COMMENT_MODE/SET",Wr="COMMENTS/FETCHING",Kr="COMMENTS/FETCHING_SUCCESS",Zr="COMMENTS/SET_SORT";var qr=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const Xr=(e,t,n)=>r=>qr(void 0,void 0,void 0,(function*(){const o=yield(({title:e,text:t,pid:n})=>or.post("/comment",{},Object.assign({title:e,text:t,locator:{site:Kn,url:qn}},n?{pid:n}:{})))({text:e,title:t,pid:n});r({type:$r,pid:n||null,comment:o})}));function Yr(e){return{type:Gr,comment:e}}const Jr=(e,t)=>n=>qr(void 0,void 0,void 0,(function*(){const r=yield(({text:e,id:t})=>or.put(`/comment/${t}`,{url:qn},{text:e}))({id:e,text:t});n(Yr(r))})),Qr=e=>(t,n)=>qr(void 0,void 0,void 0,(function*(){const{hiddenUsers:r,comments:o}=n(),i=Object.keys(r);t({type:Wr});const s=yield(e=>or.get("/find",{url:qn,sort:e,format:"tree"}))(e||o.sort);return t({type:Kr}),i.length>0&&(s.comments=Br(s.comments,(e=>-1===i.indexOf(e.comment.user.id)))),t((e=>t=>{t({type:Fr,comments:e})})(s.comments)),t(Ir(s.info)),s}));function eo(e=null){return{type:Vr,mode:e}}const to={apple:{name:"Apple",icons:{light:s(4756).Z,dark:s(1502).Z}},facebook:s(2552).Z,twitter:s(1253).Z,patreon:s(8932).Z,google:s(7372).Z,microsoft:s(8369).Z,yandex:s(7284).Z,dev:s(2652).Z,github:{name:"GitHub",icons:{light:s(1220).Z,dark:s(5463).Z}},telegram:s(237).Z},no=Object.keys(to);var ro=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function oo(e=null){return{type:Nr,user:e}}const io=(e,t,n)=>r=>ro(void 0,void 0,void 0,(function*(){yield((e,t)=>sr.put(`/user/${e}`,{block:1,ttl:"permanently"===t?void 0:t}))(e,n),r({type:Tr,user:{id:e,name:t,time:_r(n)}})})),so=e=>(t,n)=>ro(void 0,void 0,void 0,(function*(){yield(e=>sr.put(`/user/${e}`,{block:0}))(e),t({type:xr,id:e});const r=Object.values(n().comments.allComments),o=r.filter((t=>t.user.id===e));if(!o.length)return;const i=r[0].user;t({type:zr,ids:o.map((e=>e.id)),patch:{user:Object.assign(Object.assign({},i),{block:!1})}})})),ao=()=>e=>{const t=Mr();e({type:Pr,payload:t})},lo=e=>(t,n)=>{const r=Mr();r[e.id]=e,wr(Ln,JSON.stringify(r));const o=Object.values(n().comments.allComments).filter((t=>t.user.id===e.id)).map((e=>e.id));t({type:Ar,user:e}),t({type:zr,ids:o,patch:{hidden:!0}})},co="THEME/SET",uo={button:"E_A",suffix:"E_B",selected:"E_C",xs:"E_D",sm:"E_E",transparent:"E_F",hollow:"E_G",link:"E_H E_G"};function ho(){return ho=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ho.apply(this,arguments)}function fo(e){var{children:t,size:n,kind:r,suffix:o,selected:s,className:a,onChange:l}=e,c=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children","size","kind","suffix","selected","className","onChange"]);return(0,i.h)("button",ho({className:Tn(a,uo.button,r&&uo[r],n&&uo[n],{[uo.selected]:s})},c),t,o&&(0,i.h)("div",{className:uo.suffix},o))}function mo({className:e}){return(0,i.h)("div",{className:Tn("preloader",e),"aria-label":"Loading..."})}const po=e=>Object.assign({role:"button",onClick:e,onKeyPress:t=>((e,t)=>{" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),t&&t(e))})(t,e)},e?{tabIndex:0}:{});function go(){return T((({theme:e})=>e))}function vo(){return vo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vo.apply(this,arguments)}const _o={id:"settings.block-user",defaultMessage:"Do you want to block {userName}?"},bo={id:"settings.unblock-user",defaultMessage:"Do you want to unblock {userName}?"},yo={id:"settings.hidden-users-title",defaultMessage:"Hidden users"},wo={id:"settings.blocked-users-title",defaultMessage:"Blocked users"};class Eo extends i.Component{constructor(e){super(e),this.block=e=>{window.confirm(this.props.intl.formatMessage(_o,{userName:e.name}))&&(this.setState({unblockedUsers:this.state.unblockedUsers.filter((t=>t!==e.id))}),this.props.blockUser(e.id,e.name,"permanently"))},this.unblock=e=>{window.confirm(this.props.intl.formatMessage(bo,{userName:e.name}))&&(this.setState({unblockedUsers:this.state.unblockedUsers.concat([e.id])}),this.props.unblockUser(e.id),this.props.onUnblockSomeone())},this.hide=e=>{this.setState({unhiddenUsers:this.state.unhiddenUsers.filter((t=>t!==e.id))}),this.props.hideUser(e)},this.unhide=e=>{this.setState({unhiddenUsers:this.state.unhiddenUsers.concat([e.id])}),this.props.unhideUser(e.id),this.props.onUnblockSomeone()},this.__isUserHidden=e=>!this.state.unhiddenUsers.includes(e.id),this.state={blockedUsers:e.blockedUsers.slice(),unblockedUsers:[],hiddenUsers:Object.assign({},e.hiddenUsers),unhiddenUsers:[]}}render({user:e,theme:t},{blockedUsers:n,unblockedUsers:r,unhiddenUsers:o}){const s=Object.values(this.state.hiddenUsers),a=this.props.intl;return(0,i.h)("div",{className:yn()("settings",{},{theme:t})},(0,i.h)("div",{className:"settings__section settings__hidden-users",role:"region","aria-label":a.formatMessage(yo)},(0,i.h)("h3",null,(0,i.h)(Nn,{id:"settings.hidden-user-header",defaultMessage:"Hidden users:"})),!s.length&&(0,i.h)("h4",{className:"settings__dimmed"},(0,i.h)(Nn,{id:"settings.no-hidden-users",defaultMessage:"There are no hidden users."})),!!s.length&&(0,i.h)("ul",{className:"settings__list"},s.map((e=>{const t=o.includes(e.id);return(0,i.h)("li",{key:e.id,className:"settings__list-item"},(0,i.h)("span",{className:["settings__username",t?"settings__invisible":null].join(" "),title:e.id},e.name?e.name:(0,i.h)(Nn,{id:"settings.unknown",defaultMessage:"unknown"})),this.__isUserHidden(e)?(0,i.h)("span",vo({className:"settings__action"},po((()=>this.unhide(e)))),(0,i.h)(Nn,{id:"settings.show",defaultMessage:"show"})):(0,i.h)("span",vo({className:"settings__action"},po((()=>this.hide(e)))),(0,i.h)(Nn,{id:"settings.hide",defaultMessage:"hide"})),(0,i.h)("div",null,(0,i.h)("span",{className:"settings__user-id"},"id: ",(0,i.h)("span",null,e.id))))})))),e&&e.admin&&(0,i.h)("div",{className:"settings__section settings__blocked-users",role:"region","aria-label":a.formatMessage(wo)},(0,i.h)("h3",null,(0,i.h)(Nn,{id:"settings.blocked-users-header",defaultMessage:"Blocked users:"})),!n.length&&(0,i.h)("h4",{className:"settings__dimmed"},(0,i.h)(Nn,{id:"settings.no-blocked-users",defaultMessage:"There are no blocked users."})),!!n.length&&(0,i.h)("ul",{className:"settings__list settings__blocked-users-list"},n.map((e=>{const t=r.includes(e.id);return(0,i.h)("li",{key:e.id,className:"settings__list-item"},(0,i.h)("span",{className:["settings__username",t?"settings__invisible":null].join(" "),title:e.id},e.name?e.name:(0,i.h)(Nn,{id:"settings.unknown",defaultMessage:"unknown"})),(0,i.h)("span",{className:"settings__blocked-users-user-block-ttl"}," ",(0,i.h)(ko,{time:new Date(e.time)})),t&&(0,i.h)("span",vo({},po((()=>this.block(e))),{className:"settings__action"}),(0,i.h)(Nn,{id:"settings.block",defaultMessage:"block"})),!t&&(0,i.h)("span",vo({},po((()=>this.unblock(e))),{className:"settings__action"}),(0,i.h)(Nn,{id:"settings.unblock",defaultMessage:"unblock"})),(0,i.h)("div",null,(0,i.h)("span",{className:"settings__user-id"},"id: ",(0,i.h)("span",null,e.id))))})))))}}function So(e){const t=go();return(0,i.h)(Eo,vo({theme:t},e))}function ko({time:e}){const t=wn(),n=(new Date).getFullYear();return e.getFullYear()-n>=50?(0,i.h)(Nn,{id:"settings.permanently",defaultMessage:"permanently"}):(0,i.h)(Nn,{id:"settings.block-time",defaultMessage:"until {day} at {time}",values:{day:t.formatDate(e),time:t.formatTime(e)}})}function Oo(e,t){for(var n in t)e[n]=t[n];return e}function Mo(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function No(e){this.props=e}(No.prototype=new i.Component).isPureReactComponent=!0,No.prototype.shouldComponentUpdate=function(e,t){return Mo(this.props,e)||Mo(this.state,t)};var Co=i.options.__b;i.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Co&&Co(e)};var To="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function xo(e){function t(t,n){var r=Oo({},t);return delete r.ref,e(r,(n=t.ref||n)&&("object"!=typeof n||"current"in n)?n:null)}return t.$$typeof=To,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var Po=(i.toChildArray,i.options.__e);i.options.__e=function(e,t,n){if(e.then)for(var r,o=t;o=o.__;)if((r=o.__c)&&r.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),r.__c(e,t);Po(e,t,n)};var Ao=i.options.unmount;function Lo(){this.__u=0,this.t=null,this.__b=null}function Ro(e){var t=e.__.__c;return t&&t.__e&&t.__e(e)}function jo(){this.u=null,this.o=null}i.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&!0===e.__h&&(e.type=null),Ao&&Ao(e)},(Lo.prototype=new i.Component).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=Ro(r.__v),i=!1,s=function(){i||(i=!0,n.__R=null,o?o(a):a())};n.__R=s;var a=function(){if(!--r.__u){if(r.state.__e){var e=r.state.__e;r.__v.__k[0]=function e(t,n,r){return t&&(t.__v=null,t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)})),t.__c&&t.__c.__P===n&&(t.__e&&r.insertBefore(t.__e,t.__d),t.__c.__e=!0,t.__c.__P=r)),t}(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__e:r.__b=null});t=r.t.pop();)t.forceUpdate()}},l=!0===t.__h;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),e.then(s,s)},Lo.prototype.componentWillUnmount=function(){this.t=[]},Lo.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function e(t,n,r){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),t.__c.__H=null),null!=(t=Oo({},t)).__c&&(t.__c.__P===r&&(t.__c.__P=n),t.__c=null),t.__k=t.__k&&t.__k.map((function(t){return e(t,n,r)}))),t}(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__e&&(0,i.createElement)(i.Fragment,null,e.fallback);return o&&(o.__h=null),[(0,i.createElement)(i.Fragment,null,t.__e?null:e.children),o]};var Io=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};(jo.prototype=new i.Component).__e=function(e){var t=this,n=Ro(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),Io(t,e,r)):o()};n?n(i):i()}},jo.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,i.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},jo.prototype.componentDidUpdate=jo.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){Io(e,n,t)}))};var Bo="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Ho=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Uo="undefined"!=typeof document,Do=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/i:/fil|che|ra/i).test(e)};i.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(i.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var Fo=i.options.event;function $o(){}function Go(){return this.cancelBubble}function zo(){return this.defaultPrevented}i.options.event=function(e){return Fo&&(e=Fo(e)),e.persist=$o,e.isPropagationStopped=Go,e.isDefaultPrevented=zo,e.nativeEvent=e};var Vo={configurable:!0,get:function(){return this.class}},Wo=i.options.vnode;i.options.vnode=function(e){var t=e.type,n=e.props,r=n;if("string"==typeof t){var o=-1===t.indexOf("-");for(var s in r={},n){var a=n[s];Uo&&"children"===s&&"noscript"===t||"value"===s&&"defaultValue"in n&&null==a||("defaultValue"===s&&"value"in n&&null==n.value?s="value":"download"===s&&!0===a?a="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+t)&&!Do(n.type)?s="oninput":/^on(Ani|Tra|Tou|BeforeInp)/.test(s)?s=s.toLowerCase():o&&Ho.test(s)?s=s.replace(/[A-Z0-9]/,"-$&").toLowerCase():null===a&&(a=void 0),r[s]=a)}"select"==t&&r.multiple&&Array.isArray(r.value)&&(r.value=(0,i.toChildArray)(n.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==t&&null!=r.defaultValue&&(r.value=(0,i.toChildArray)(n.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),e.props=r,n.class!=n.className&&(Vo.enumerable="className"in n,null!=n.className&&(r.class=n.className),Object.defineProperty(r,"className",Vo))}e.$$typeof=Bo,Wo&&Wo(e)};var Ko=i.options.__r;function Zo(){return Zo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zo.apply(this,arguments)}i.options.__r=function(e){Ko&&Ko(e),e.__c},i.Fragment,_n.useState,_n.useReducer,_n.useEffect,_n.useLayoutEffect,_n.useRef,_n.useImperativeHandle,_n.useMemo,_n.useCallback,_n.useContext,_n.useDebugValue,i.createElement,i.createContext,i.createRef,i.Fragment,i.Component,i.Fragment;const qo=xo(((e,t)=>{var{children:n,theme:r,mods:o,mix:s,kind:a,type:l="button",size:c,className:u}=e,h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children","theme","mods","mix","kind","type","size","className"]);return(0,i.h)("button",Zo({className:Tn(yn()("button",{mods:{kind:a,size:c,theme:r},mix:s},Object.assign({},o)),u),type:l},h,{ref:t}),n)}));function Xo(){return Xo=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xo.apply(this,arguments)}function Yo(e){var{className:t,type:n,invalid:r}=e,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["className","type","invalid"]);return(0,i.h)("input",Xo({className:Tn(t,"R_A",{R_B:r}),type:null!=n?n:"text"},o))}const Jo={id:"auth.telegram-message-1",defaultMessage:"Open Telegram"},Qo={id:"auth.telegram-link",defaultMessage:"by the link"},ei={id:"auth.telegram-message-2",defaultMessage:"and click “Start” there."},ti={id:"auth.telegram-message-3",defaultMessage:"Afterwards, click “Check” below."},ni={id:"auth.telegram-optional-qr",defaultMessage:"or by scanning the QR code"},ri={id:"auth.telegram-qr",defaultMessage:"Telegram QR-code"},oi={id:"auth.telegram-check",defaultMessage:"Check"},ii={telegram:"P_A",telegramQR:"P_B",button:"P_C"},si=({bot:e,token:t,errorMessage:n,onSubmit:r})=>{const o=wn(),s=`https://t.me/${e}/?start=${t}`;return(0,i.h)(i.Fragment,null,(0,i.h)("p",{className:Tn("telegram",ii.telegram)},o.formatMessage(Jo)," ",(0,i.h)("a",{target:"_blank",rel:"noopener noreferrer",href:s},o.formatMessage(Qo)),window.screen.width>=768&&` ${o.formatMessage(ni)}`," ",o.formatMessage(ei),(0,i.h)("br",null),o.formatMessage(ti)),window.screen.width>=768&&(0,i.h)("img",{src:`${xn}/api/v1/qr/telegram?url=${s}`,height:"200",width:"200",className:Tn("telegram-qr",ii.telegramQR),alt:o.formatMessage(ri)}),n&&(0,i.h)("div",{className:Tn("auth-error",ii.error)},n),(0,i.h)(qo,{key:"submit",kind:"primary",size:"large",className:Tn("auth-submit",ii.button),type:"submit",onClick:r},o.formatMessage(oi)))};function ai(){return ai=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ai.apply(this,arguments)}function li(e){var{size:t=14}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["size"]);return(0,i.h)("svg",ai({width:t,height:t,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),(0,i.h)("path",{d:"M2 2L12 12M12 2L2 12",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))}function ci(){return ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ci.apply(this,arguments)}function ui(e){e.style.height="",e.style.height=`${e.scrollHeight}px`}const hi=xo(((e,t)=>{var{onInput:n,value:r}=e,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["onInput","value"]);const s=(0,_n.useRef)(null),a=t||s;return(0,_n.useEffect)((()=>{a.current&&ui(a.current)}),[r,a]),(0,i.h)("textarea",ci({},o,{onInput:e=>{if(a.current)return n?n(e):void ui(a.current)},value:r,ref:a}))})),di={signin:{id:"auth.signin",defaultMessage:"Sign In"},or:{id:"auth.or",defaultMessage:"or"},username:{id:"auth.username",defaultMessage:"Username"},usernameRestriction:{id:"auth.symbols-restriction",defaultMessage:"Username must contain only letters, numbers, underscores or spaces"},userNotFound:{id:"auth.user-not-found",defaultMessage:"No user was found"},emailAddress:{id:"auth.email-address",defaultMessage:"Email Address"},token:{id:"token",defaultMessage:"Copy and paste the token from the email"},expiredToken:{id:"token.expired",defaultMessage:"Token is expired"},invalidToken:{id:"token.invalid",defaultMessage:"Token is invalid"},oauthSource:{id:"auth.oauth-source",defaultMessage:"Use Social Network"},oauthTitle:{id:"auth.oauth-button",defaultMessage:"Sign In with {provider}"},back:{id:"auth.back",defaultMessage:"Back"},loading:{id:"auth.loading",defaultMessage:"Loading..."},submit:{id:"auth.submit",defaultMessage:"Submit"},openProfile:{id:"auth.open-profile",defaultMessage:"Open My Profile"},signout:{id:"auth.signout",defaultMessage:"Sign Out"}};function fi({color:e}){const t=wn();return(0,i.h)("div",{className:Tn("spinner","D_A",{D_C:"gray"===e}),role:"presentation","aria-label":t.formatMessage(di.loading)})}function mi(){return mi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mi.apply(this,arguments)}function pi(e){var{size:t=14}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["size"]);return(0,i.h)("svg",mi({width:t,height:t,viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),(0,i.h)("path",{d:"M6 11.5L14.5 19L22 11",stroke:"currentColor","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"}))}const gi={root:"Q_A",item:"Q_B",button:"Q_C",full:"Q_D",name:"Q_E"},vi=encodeURIComponent(`${window.location.origin}${window.location.pathname}?selfClose`);function _i({providers:e,onOauthClick:t}){const n=wn(),r=go(),o=2===(s=e.length)?"name":1===s?"full":"icon";var s;return(0,i.h)("ul",{className:Tn("oauth",gi.root)},e.map((e=>{const{name:s,icon:a}=function(e,t){const n=to[e];return"string"!=typeof n?{name:n.name,icon:n.icons[t]}:{name:(r=e,`${r.charAt(0).toLocaleUpperCase()}${r.slice(1)}`),icon:n};var r}(e,r);return(0,i.h)("li",{key:s,className:Tn("oauth-item",gi.item)},(0,i.h)("a",{target:"_blank",rel:"noopener noreferrer",href:`${xn}/auth/${e}/login?from=${vi}&site=${Kn}`,onClick:t,className:Tn("oauth-button",gi.button,gi[o],gi[e]),"data-provider-name":s,title:n.formatMessage(di.oauthTitle,{provider:s})},(0,i.h)("img",{className:"oauth-icon",src:`${xn}${a}`,width:"20",height:"20",alt:"","aria-hidden":!0})))})))}const bi={root:"N_A",buttonArrow:"N_B",dropdown:"N_C",title:"N_D",divider:"N_E",tabs:"N_F",provider:"N_G",radio:"N_H",row:"N_I",backButton:"N_J",backButtonArrow:"N_K",closeButton:"N_L",textarea:"N_M R_A",honeypot:"N_N",submit:"N_O",error:"N_P"};var yi=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function wi(){const e=wn(),t=(0,_n.useRef)(null),n=(0,_n.useRef)(""),r=B(),[o,s]=function(){const e=[],t=[];return er.config.auth_providers.forEach((n=>{no.includes(n)?e.push(n):t.push(n)})),[e,t]}(),[a,l]=(0,_n.useState)(!1),[c,u]=(0,_n.useState)(s[0]),[h,d,f]=function(e){const t=(0,_n.useRef)(null),n=(0,_n.useRef)(!1),[r,o]=(0,_n.useState)(!1);return(0,_n.useEffect)((()=>{const i=t.current;if(r&&i)return i.addEventListener("click",l,{capture:!0}),document.addEventListener("click",a),window.addEventListener("message",s),()=>{i.removeEventListener("click",l),document.removeEventListener("click",a),window.removeEventListener("message",s)};function s(t){const n=mn(t);e&&n.clickOutside||o(!1)}function a(){const t=n.current;n.current=!1,e||t||o(!1)}function l(){n.current=!0}}),[r,e]),(0,_n.useEffect)((()=>{const e=t.current;if(!e)return;pn(e);const n=new ResizeObserver((()=>{pn(e)}));return n.observe(e),()=>{document.body.style.removeProperty("min-height"),n.disconnect()}}),[r]),[t,r,function(){o((e=>!e))}]}("token"===c||"telegram"===c),[m,p]=function(){const e=wn(),[t,n]=(0,_n.useState)(null);return(0,_n.useMemo)((()=>{let r=t;return null!==t&&"string"==typeof t&&di[t]&&(r=e.formatMessage(di[t])),null!==t&&Yn[t]&&(r=e.formatMessage(Yn[t])),"number"==typeof r&&(console.error("Wrong error message",r),r=null),[r,function(e){if(null===e)return void n(null);if("string"==typeof e)return void n(e);const t=e instanceof Qn||br(e)?e.error:e instanceof Error?e.message:0;n(t)}]}),[e,t])}();function g(){u(s[0]),p(null)}function v(e){e.preventDefault(),g(),f()}function _(e){const{value:t}=e.currentTarget;u(t),p(null)}const b=o.length>0,y=s.length>0,w=(0,i.h)(i.Fragment,null,m&&(0,i.h)("div",{className:Tn("auth-error",bi.error)},m),(0,i.h)(fo,{className:"auth-submit",type:"submit",disabled:a},a?(0,i.h)(fi,null):e.formatMessage(di.submit)));return(0,i.h)("div",{className:Tn("auth",bi.root)},(0,i.h)(fo,{className:"auth-button",selected:d,onClick:function(e){e.preventDefault(),f()},suffix:(0,i.h)(pi,null)},e.formatMessage(di.signin)),d&&(0,i.h)("div",{className:Tn("auth-dropdown",bi.dropdown),ref:h},(0,i.h)("form",{className:Tn("auth-form",bi.form),onSubmit:function(e){return yi(this,void 0,void 0,(function*(){const t=new FormData(e.target);e.preventDefault(),l(!0),p(null);try{switch(c){case"anonymous":{const e=t.get("username"),n=yield function(e){return ir.get("/anonymous/login",{user:e,aud:Kn})}(e);r(oo(n));break}case"email":{const e=t.get("email"),r=t.get("username");n.current=e,yield function(e,t){return ir.get(ur,{address:e,user:t})}(e,r),u("token");break}case"token":{const e=t.get("token"),i=function(e){try{if(function(e){const{exp:t}=function(e){const[,t]=e.split("."),n=t.replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(atob(n).split("").map((e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`)).join(""));return JSON.parse(r)}(e);return 1e3*t<Date.now()}(e))return"expiredToken"}catch(e){return"invalidToken"}return null}(e);if(i){p(i);break}const s=yield function(e){return ir.get(ur,{token:e})}(e);r(oo(s)),o=n.current,wr(jn,o);break}}}catch(e){p(e)}var o;l(!1)}))}},"telegram"===c&&null!==t.current?(0,i.h)(i.Fragment,null,(0,i.h)("div",{className:Tn("auth-row",bi.row)},(0,i.h)("div",{className:bi.backButton},(0,i.h)(fo,{className:"auth-back-button",size:"xs",kind:"transparent",onClick:function(e){e.preventDefault(),g()}},(0,i.h)("svg",{className:bi.backButtonArrow,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("path",{d:"M8.75 3L5 7.25L9 11",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})),e.formatMessage(di.back))),(0,i.h)("button",{className:Tn("auth-close-button",bi.closeButton),title:"Close sign-in dropdown",onClick:v},(0,i.h)(li,null))),(0,i.h)(si,{onSubmit:function(e){return yi(this,void 0,void 0,(function*(){if(e.preventDefault(),l(!0),p(null),null===t.current)try{t.current=yield gr()}catch(e){return void p(e)}try{const e=yield(n=t.current.token,ir.get(hr,{token:n}));r(oo(e))}catch(e){p(e)}var n;l(!1)}))},errorMessage:m,bot:t.current.bot,token:t.current.token})):"token"===c?(0,i.h)(i.Fragment,null,(0,i.h)("div",{className:Tn("auth-row",bi.row)},(0,i.h)("div",{className:bi.backButton},(0,i.h)(fo,{className:"auth-back-button",size:"xs",kind:"transparent",onClick:function(e){e.preventDefault(),u("email"),p(null)}},(0,i.h)("svg",{className:bi.backButtonArrow,width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,i.h)("path",{d:"M8.75 3L5 7.25L9 11",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})),e.formatMessage(di.back))),(0,i.h)("button",{className:Tn("auth-close-button",bi.closeButton),title:"Close sign-in dropdown",onClick:v},(0,i.h)(li,null))),(0,i.h)("div",{className:Tn("auth-row",bi.row)},(0,i.h)(hi,{name:"token",className:Tn("auth-token-textarea",bi.textarea),placeholder:e.formatMessage(di.token),disabled:a})),w):(0,i.h)(i.Fragment,null,b&&(0,i.h)(i.Fragment,null,(0,i.h)("h5",{className:Tn("auth-form-title",bi.title)},e.formatMessage(di.oauthSource)),(0,i.h)(_i,{providers:o,onOauthClick:function(e){var n;return yi(this,void 0,void 0,(function*(){e.preventDefault();const{href:o,dataset:i}=e.currentTarget;if("telegram"===(null===(n=i.providerName)||void 0===n?void 0:n.toLowerCase())){try{t.current=yield gr()}catch(e){return void p(e)}return u("telegram"),void p(null)}try{const e=yield pr(o);if(null===e)return;r(oo(e))}catch(e){p(e)}}))}})),b&&y&&(0,i.h)("div",{className:Tn("auth-divider",bi.divider),title:e.formatMessage(di.or)}),y&&(0,i.h)(i.Fragment,null,1===s.length?(0,i.h)("h5",{className:Tn("auth-form-title",bi.title)},s[0]):(0,i.h)("div",{className:Tn("auth-tabs",bi.tabs)},s.map((e=>(0,i.h)(i.Fragment,{key:e},(0,i.h)("input",{className:bi.radio,type:"radio",id:`form-provider-${e}`,name:"form-provider",value:e,onChange:_,checked:e===c}),(0,i.h)("label",{className:Tn("auth-tabs-item",bi.provider),htmlFor:`form-provider-${e}`},e.slice(0,6)))))),(0,i.h)("div",{className:Tn("auth-row",bi.row)},(0,i.h)(Yo,{className:"auth-input-username",required:!0,name:"username",minLength:3,pattern:"[\\p{L}\\d\\s_]+",title:e.formatMessage(di.usernameRestriction),placeholder:e.formatMessage(di.username),disabled:a,onBlur:e=>{const t=e.target;t.value=t.value.trim()}})),"email"===c&&(0,i.h)("div",{className:Tn("auth-row",bi.row)},(0,i.h)(Yo,{className:"auth-input-email",required:!0,name:"email",type:"email",placeholder:e.formatMessage(di.emailAddress),disabled:a})),(0,i.h)("input",{className:bi.honeypot,type:"checkbox",tabIndex:-1,autoComplete:"off"}),w)))))}function Ei({url:e}){const t=e||`${xn}/web/ghost.svg`;return(0,i.h)("img",{className:Tn("avatar","F_A",!e&&"F_B"),src:t,"aria-hidden":"true"})}function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Si.apply(this,arguments)}function ki(e){var{size:t=16}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["size"]);return(0,i.h)("svg",Si({width:t,height:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),(0,i.h)("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M5.7 15H2.6A1.6 1.6 0 011 13.4V2.6A1.6 1.6 0 012.6 1h3M11.1 11.9L15 8l-3.9-3.9M15 8H5.7"}))}function Oi(){return Oi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Oi.apply(this,arguments)}function Mi(e){var{children:t,className:n}=e,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children","className"]);return(0,i.h)("button",Oi({className:Tn("icon-button",n,"C_A")},r),t)}function Ni(){return Ni=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ni.apply(this,arguments)}class Ci extends i.Component{constructor(){super(...arguments),this.state={isBlockedVisible:!1,anonymousUsernameInputValue:"anon"},this.toggleBlockedVisibility=()=>{this.state.isBlockedVisible?this.props.onBlockedUsersHide&&this.props.onBlockedUsersHide():this.props.onBlockedUsersShow&&this.props.onBlockedUsersShow(),this.setState({isBlockedVisible:!this.state.isBlockedVisible})},this.toggleCommentsAvailability=()=>{this.props.onCommentsChangeReadOnlyMode(!this.props.isCommentsDisabled)},this.renderAuthorized=e=>(0,i.h)("div",{className:Tn("user","H_A")},(0,i.h)("button",{className:Tn("user-profile-button","H_B"),onClick:()=>fn({profile:Object.assign(Object.assign({},e),{current:"1"})}),title:this.props.intl.formatMessage(di.openProfile)},(0,i.h)("div",{className:Tn("user-avatar","H_D")},(0,i.h)(Ei,{url:e.picture})),e.name)," ",(0,i.h)("div",{className:Tn("user-logout-button","H_C H_B")},(0,i.h)(Mi,{title:this.props.intl.formatMessage(di.signout),onClick:this.props.signout},(0,i.h)(ki,{size:"14"})))),this.renderThirdPartyWarning=()=>Hn||!Un?null:(0,i.h)("div",{className:"auth-panel__column"},(0,i.h)(Nn,{id:"authPanel.disabled-cookies",defaultMessage:"Disable third-party cookies blocking to login or open comments in"})," ",(0,i.h)("a",{className:"auth-panel__pseudo-link",href:`${window.location.origin}/web/comments.html${window.location.search}`,target:"_blank",rel:"noreferrer"},(0,i.h)(Nn,{id:"authPanel.new-page",defaultMessage:"new page"}))),this.renderCookiesWarning=()=>Hn||Un?null:(0,i.h)("div",{className:"auth-panel__column"},(0,i.h)(Nn,{id:"authPanel.enable-cookies",defaultMessage:"Allow cookies to login and comment"})),this.renderSettingsLabel=()=>(0,i.h)(qo,Ni({kind:"link",mix:"auth-panel__admin-action"},po(this.toggleBlockedVisibility),{role:"link"}),this.state.isBlockedVisible?(0,i.h)(Nn,{id:"authPanel.hide-settings",defaultMessage:"Hide settings"}):(0,i.h)(Nn,{id:"authPanel.show-settings",defaultMessage:"Show settings"})),this.renderReadOnlySwitch=()=>{const{isCommentsDisabled:e}=this.props;return(0,i.h)(qo,Ni({kind:"link",mix:"auth-panel__admin-action"},po(this.toggleCommentsAvailability),{role:"link"}),e?(0,i.h)(Nn,{id:"authPanel.enable-comments",defaultMessage:"Enable comments"}):(0,i.h)(Nn,{id:"authPanel.disable-comments",defaultMessage:"Disable comments"}))}}render({user:e,postInfo:t,theme:n},{isBlockedVisible:r}){const{read_only:o}=t,s=e&&e.admin,a=Object.keys(this.props.hiddenUsers).length>0||s||r;return(0,i.h)("div",{className:yn()("auth-panel",{},{theme:n,loggedIn:!!e})},(0,i.h)("div",{className:"auth-panel__column"},e?this.renderAuthorized(e):o&&(0,i.h)(wi,null)),this.renderThirdPartyWarning(),this.renderCookiesWarning(),(0,i.h)("div",{className:"auth-panel__column auth-panel__column_separated"},a&&(0,i.h)("span",null,this.renderSettingsLabel()),s&&(0,i.h)("span",null,this.renderReadOnlySwitch()),!s&&o&&(0,i.h)("span",null,(0,i.h)(Nn,{id:"authPanel.read-only",defaultMessage:"Read-only"}))))}}function Ti(e){const t=wn(),n=go();return(0,i.h)(Ci,Ni({intl:t,theme:n},e))}function xi(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var Pi=xi();Pi.withExtraArgument=xi;const Ai=Pi,Li=function(e,t){return e===t||e!=e&&t!=t},Ri=function(e,t){for(var n=e.length;n--;)if(Li(e[n][0],t))return n;return-1};var ji=Array.prototype.splice;function Ii(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ii.prototype.clear=function(){this.__data__=[],this.size=0},Ii.prototype.delete=function(e){var t=this.__data__,n=Ri(t,e);return!(n<0||(n==t.length-1?t.pop():ji.call(t,n,1),--this.size,0))},Ii.prototype.get=function(e){var t=this.__data__,n=Ri(t,e);return n<0?void 0:t[n][1]},Ii.prototype.has=function(e){return Ri(this.__data__,e)>-1},Ii.prototype.set=function(e,t){var n=this.__data__,r=Ri(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const Bi=Ii,Hi="object"==typeof global&&global&&global.Object===Object&&global;var Ui="object"==typeof self&&self&&self.Object===Object&&self;const Di=Hi||Ui||Function("return this")(),Fi=Di.Symbol;var $i=Object.prototype,Gi=$i.hasOwnProperty,zi=$i.toString,Vi=Fi?Fi.toStringTag:void 0;var Wi=Object.prototype.toString;var Ki=Fi?Fi.toStringTag:void 0;const Zi=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ki&&Ki in Object(e)?function(e){var t=Gi.call(e,Vi),n=e[Vi];try{e[Vi]=void 0;var r=!0}catch(e){}var o=zi.call(e);return r&&(t?e[Vi]=n:delete e[Vi]),o}(e):function(e){return Wi.call(e)}(e)},qi=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Xi=function(e){if(!qi(e))return!1;var t=Zi(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Yi=Di["__core-js_shared__"];var Ji,Qi=(Ji=/[^.]+$/.exec(Yi&&Yi.keys&&Yi.keys.IE_PROTO||""))?"Symbol(src)_1."+Ji:"";var es=Function.prototype.toString;const ts=function(e){if(null!=e){try{return es.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var ns=/^\[object .+?Constructor\]$/,rs=Function.prototype,os=Object.prototype,is=rs.toString,ss=os.hasOwnProperty,as=RegExp("^"+is.call(ss).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const ls=function(e){return!(!qi(e)||(t=e,Qi&&Qi in t))&&(Xi(e)?as:ns).test(ts(e));var t},cs=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ls(n)?n:void 0},us=cs(Di,"Map"),hs=cs(Object,"create");var ds=Object.prototype.hasOwnProperty;var fs=Object.prototype.hasOwnProperty;function ms(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ms.prototype.clear=function(){this.__data__=hs?hs(null):{},this.size=0},ms.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ms.prototype.get=function(e){var t=this.__data__;if(hs){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ds.call(t,e)?t[e]:void 0},ms.prototype.has=function(e){var t=this.__data__;return hs?void 0!==t[e]:fs.call(t,e)},ms.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=hs&&void 0===t?"__lodash_hash_undefined__":t,this};const ps=ms,gs=function(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map};function vs(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}vs.prototype.clear=function(){this.size=0,this.__data__={hash:new ps,map:new(us||Bi),string:new ps}},vs.prototype.delete=function(e){var t=gs(this,e).delete(e);return this.size-=t?1:0,t},vs.prototype.get=function(e){return gs(this,e).get(e)},vs.prototype.has=function(e){return gs(this,e).has(e)},vs.prototype.set=function(e,t){var n=gs(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const _s=vs;function bs(e){var t=this.__data__=new Bi(e);this.size=t.size}bs.prototype.clear=function(){this.__data__=new Bi,this.size=0},bs.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},bs.prototype.get=function(e){return this.__data__.get(e)},bs.prototype.has=function(e){return this.__data__.has(e)},bs.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Bi){var r=n.__data__;if(!us||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _s(r)}return n.set(e,t),this.size=n.size,this};const ys=bs;function ws(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new _s;++t<n;)this.add(e[t])}ws.prototype.add=ws.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ws.prototype.has=function(e){return this.__data__.has(e)};const Es=ws,Ss=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},ks=function(e,t,n,r,o,i){var s=1&n,a=e.length,l=t.length;if(a!=l&&!(s&&l>a))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,f=2&n?new Es:void 0;for(i.set(e,t),i.set(t,e);++h<a;){var m=e[h],p=t[h];if(r)var g=s?r(p,m,h,t,e,i):r(m,p,h,e,t,i);if(void 0!==g){if(g)continue;d=!1;break}if(f){if(!Ss(t,(function(e,t){if(s=t,!f.has(s)&&(m===e||o(m,e,n,r,i)))return f.push(t);var s}))){d=!1;break}}else if(m!==p&&!o(m,p,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d},Os=Di.Uint8Array,Ms=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},Ns=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var Cs=Fi?Fi.prototype:void 0,Ts=Cs?Cs.valueOf:void 0;const xs=Array.isArray;var Ps=Object.prototype.propertyIsEnumerable,As=Object.getOwnPropertySymbols;const Ls=As?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}(As(e),(function(t){return Ps.call(e,t)})))}:function(){return[]},Rs=function(e){return null!=e&&"object"==typeof e},js=function(e){return Rs(e)&&"[object Arguments]"==Zi(e)};var Is=Object.prototype,Bs=Is.hasOwnProperty,Hs=Is.propertyIsEnumerable;const Us=js(function(){return arguments}())?js:function(e){return Rs(e)&&Bs.call(e,"callee")&&!Hs.call(e,"callee")};var Ds="object"==typeof exports&&exports&&!exports.nodeType&&exports,Fs=Ds&&"object"==typeof module&&module&&!module.nodeType&&module,$s=Fs&&Fs.exports===Ds?Di.Buffer:void 0;const Gs=($s?$s.isBuffer:void 0)||function(){return!1};var zs=/^(?:0|[1-9]\d*)$/;const Vs=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&zs.test(e))&&e>-1&&e%1==0&&e<t},Ws=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var Ks={};Ks["[object Float32Array]"]=Ks["[object Float64Array]"]=Ks["[object Int8Array]"]=Ks["[object Int16Array]"]=Ks["[object Int32Array]"]=Ks["[object Uint8Array]"]=Ks["[object Uint8ClampedArray]"]=Ks["[object Uint16Array]"]=Ks["[object Uint32Array]"]=!0,Ks["[object Arguments]"]=Ks["[object Array]"]=Ks["[object ArrayBuffer]"]=Ks["[object Boolean]"]=Ks["[object DataView]"]=Ks["[object Date]"]=Ks["[object Error]"]=Ks["[object Function]"]=Ks["[object Map]"]=Ks["[object Number]"]=Ks["[object Object]"]=Ks["[object RegExp]"]=Ks["[object Set]"]=Ks["[object String]"]=Ks["[object WeakMap]"]=!1;var Zs="object"==typeof exports&&exports&&!exports.nodeType&&exports,qs=Zs&&"object"==typeof module&&module&&!module.nodeType&&module,Xs=qs&&qs.exports===Zs&&Hi.process,Ys=function(){try{return qs&&qs.require&&qs.require("util").types||Xs&&Xs.binding&&Xs.binding("util")}catch(e){}}(),Js=Ys&&Ys.isTypedArray;const Qs=Js?(ea=Js,function(e){return ea(e)}):function(e){return Rs(e)&&Ws(e.length)&&!!Ks[Zi(e)]};var ea,ta=Object.prototype.hasOwnProperty;const na=function(e,t){var n=xs(e),r=!n&&Us(e),o=!n&&!r&&Gs(e),i=!n&&!r&&!o&&Qs(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],l=a.length;for(var c in e)!t&&!ta.call(e,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Vs(c,l))||a.push(c);return a};var ra=Object.prototype;const oa=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object);var ia=Object.prototype.hasOwnProperty;const sa=function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||ra))return oa(e);var t,n,r=[];for(var o in Object(e))ia.call(e,o)&&"constructor"!=o&&r.push(o);return r},aa=function(e){return null!=(t=e)&&Ws(t.length)&&!Xi(t)?na(e):sa(e);var t},la=function(e){return function(e,t,n){var r=t(e);return xs(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,aa,Ls)};var ca=Object.prototype.hasOwnProperty;const ua=cs(Di,"DataView"),ha=cs(Di,"Promise"),da=cs(Di,"Set"),fa=cs(Di,"WeakMap");var ma="[object Map]",pa="[object Promise]",ga="[object Set]",va="[object WeakMap]",_a="[object DataView]",ba=ts(ua),ya=ts(us),wa=ts(ha),Ea=ts(da),Sa=ts(fa),ka=Zi;(ua&&ka(new ua(new ArrayBuffer(1)))!=_a||us&&ka(new us)!=ma||ha&&ka(ha.resolve())!=pa||da&&ka(new da)!=ga||fa&&ka(new fa)!=va)&&(ka=function(e){var t=Zi(e),n="[object Object]"==t?e.constructor:void 0,r=n?ts(n):"";if(r)switch(r){case ba:return _a;case ya:return ma;case wa:return pa;case Ea:return ga;case Sa:return va}return t});const Oa=ka;var Ma="[object Arguments]",Na="[object Array]",Ca="[object Object]",Ta=Object.prototype.hasOwnProperty;const xa=function(e,t,n,r,o,i){var s=xs(e),a=xs(t),l=s?Na:Oa(e),c=a?Na:Oa(t),u=(l=l==Ma?Ca:l)==Ca,h=(c=c==Ma?Ca:c)==Ca,d=l==c;if(d&&Gs(e)){if(!Gs(t))return!1;s=!0,u=!1}if(d&&!u)return i||(i=new ys),s||Qs(e)?ks(e,t,n,r,o,i):function(e,t,n,r,o,i,s){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Os(e),new Os(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Li(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Ms;case"[object Set]":var l=1&r;if(a||(a=Ns),e.size!=t.size&&!l)return!1;var c=s.get(e);if(c)return c==t;r|=2,s.set(e,t);var u=ks(a(e),a(t),r,o,i,s);return s.delete(e),u;case"[object Symbol]":if(Ts)return Ts.call(e)==Ts.call(t)}return!1}(e,t,l,n,r,o,i);if(!(1&n)){var f=u&&Ta.call(e,"__wrapped__"),m=h&&Ta.call(t,"__wrapped__");if(f||m){var p=f?e.value():e,g=m?t.value():t;return i||(i=new ys),o(p,g,n,r,i)}}return!!d&&(i||(i=new ys),function(e,t,n,r,o,i){var s=1&n,a=la(e),l=a.length;if(l!=la(t).length&&!s)return!1;for(var c=l;c--;){var u=a[c];if(!(s?u in t:ca.call(t,u)))return!1}var h=i.get(e),d=i.get(t);if(h&&d)return h==t&&d==e;var f=!0;i.set(e,t),i.set(t,e);for(var m=s;++c<l;){var p=e[u=a[c]],g=t[u];if(r)var v=s?r(g,p,u,t,e,i):r(p,g,u,e,t,i);if(!(void 0===v?p===g||o(p,g,n,r,i):v)){f=!1;break}m||(m="constructor"==u)}if(f&&!m){var _=e.constructor,b=t.constructor;_==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof _&&_ instanceof _&&"function"==typeof b&&b instanceof b||(f=!1)}return i.delete(e),i.delete(t),f}(e,t,n,r,o,i))},Pa=function e(t,n,r,o,i){return t===n||(null==t||null==n||!Rs(t)&&!Rs(n)?t!=t&&n!=n:xa(t,n,r,o,e,i))},Aa=function(e,t){return Pa(e,t)};function La(e,t){return Aa(e,t)?e:t}const Ra=(e=[],t)=>{switch(t.type){case Fr:return La(e,t.comments.map((e=>e.comment.id)));case $r:return t.comment.pid?e:[t.comment.id,...e];default:return e}},ja=(e,t)=>{if(!t.replies)return e;e[t.comment.id]||(e[t.comment.id]=[]);for(const n of t.replies)e[t.comment.id].push(n.comment.id),n.replies&&ja(e,n);return e},Ia=(e={},t)=>{switch(t.type){case Fr:return t.comments.reduce(ja,{});case $r:return t.comment.pid?Object.assign(Object.assign({},e),{[t.comment.pid]:[t.comment.id,...e[t.comment.pid]||[]]}):e;default:return e}},Ba=(e,t)=>{var n,r;return e[t.comment.id]=(n=e[t.comment.id],r=t.comment,n?n.id!==r.id?r:n.edit?r.edit?n.edit.time!==r.edit.time?r:n:r:r.edit?r:n:r),t.replies&&t.replies.reduce(Ba,e),e},Ha=(e={},t)=>{switch(t.type){case Fr:return t.comments.reduce(Ba,Object.assign({},e));case $r:case Gr:return Object.assign(Object.assign({},e),{[t.comment.id]:t.comment});case Dr:return Object.assign(Object.assign({},e),{[t.patch.id]:Object.assign(Object.assign({},e[t.patch.id]),t.patch)});case zr:{let n=e,r=!1;const o={summary:"",time:(new Date).toISOString()};for(const i of t.ids)Object.prototype.hasOwnProperty.call(e,i)&&(r||(r=!0,n=Object.assign({},n)),n[i]=Object.assign(Object.assign(Object.assign({},n[i]),{edit:o}),t.patch));return n}default:return e}},Ua=(e=null,t)=>t.type===Vr?t.mode:e,Da=(e=[],t)=>{switch(t.type){case Fr:return Ur(t.comments).map((e=>e.id));case Gr:{const n=e.indexOf(t.comment.id);if(!t.comment.pin){if(-1===n)return e;const t=[...e];return t.splice(n,1),t}return-1!==n?e:[...e,t.comment.id]}case zr:return Object.prototype.hasOwnProperty.call(t.patch,"pin")?t.patch.pin?[...e,...t.ids].reduce(((e,t)=>(-1===e.indexOf(t)&&e.push(t),e)),[]):e.filter((e=>-1===t.ids.indexOf(e))):e;default:return e}},Fa=p({sort:function(e=function(){return Er(Rn)||"-active"}(),t){return t.type===Zr?t.payload:e},isFetching:function(e=!1,t){switch(t.type){case Wr:return!0;case Kr:case"COMMENTS/FETCHING_FAILURE":return!1;default:return e}},topComments:Ra,childComments:Ia,allComments:Ha,activeComment:Ua,pinnedComments:Da}),$a={url:"",count:0,read_only:!1,first_time:"",last_time:""};function Ga(e=$a,t){return t.type===jr?La(e,t.info):e}function za(e=zn,t){return t.type===co?t.theme:e}const Va=(e=null,t)=>{switch(t.type){case Nr:return t.user;case"USER_SUBSCRIPTION/SET":return null===e?e:Object.assign(Object.assign({},e),{email_subscription:t.payload});default:return e}},Wa=(e=[],t)=>{switch(t.type){case Cr:return t.list;case Tr:return void 0!==e.find((e=>e.id===t.user.id))?e:[t.user,...e];case xr:{const n=e.findIndex((e=>e.id===t.id));return-1===n?e:[...e.slice(0,n),...e.slice(n+1)]}default:return e}},Ka=(e={},t)=>{switch(t.type){case Pr:return t.payload;case Ar:return Object.assign(Object.assign({},e),{[t.user.id]:t.user});case Lr:{if(!Object.prototype.hasOwnProperty.call(e,t.id))return e;const n=Object.assign({},e);return delete n[t.id],n}default:return e}},Za="THREAD/COLLAPSE_RESTORE",qa="THREAD/COLLAPSE_SET";function Xa(e={},t){switch(t.type){case Za:return t.ids.reduce(((e,t)=>(e[t]=!0,e)),{});case qa:return Object.assign(Object.assign({},e),{[t.id]:t.collapsed});default:return e}}const Ya=p(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},e),n),t),o),r)),Ja=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(u(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=v.apply(void 0,i)(n.dispatch),c(c({},n),{},{dispatch:r})}}}(Ai),Qa=function e(t,n,r){var o;if("function"==typeof n&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw new Error(u(0));if("function"==typeof n&&void 0===r&&(r=n,n=void 0),void 0!==r){if("function"!=typeof r)throw new Error(u(1));return r(e)(t,n)}if("function"!=typeof t)throw new Error(u(2));var i=t,s=n,a=[],l=a,c=!1;function d(){l===a&&(l=a.slice())}function p(){if(c)throw new Error(u(3));return s}function g(e){if("function"!=typeof e)throw new Error(u(4));if(c)throw new Error(u(5));var t=!0;return d(),l.push(e),function(){if(t){if(c)throw new Error(u(6));t=!1,d();var n=l.indexOf(e);l.splice(n,1),a=null}}}function v(e){if(!m(e))throw new Error(u(7));if(void 0===e.type)throw new Error(u(8));if(c)throw new Error(u(9));try{c=!0,s=i(s,e)}finally{c=!1}for(var t=a=l,n=0;n<t.length;n++)(0,t[n])();return e}function _(e){if("function"!=typeof e)throw new Error(u(10));i=e,v({type:f.REPLACE})}function b(){var e,t=g;return e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(u(11));function n(){e.next&&e.next(p())}return n(),{unsubscribe:t(n)}}},e[h]=function(){return this},e}return v({type:f.INIT}),(o={dispatch:v,subscribe:g,getState:p,replaceReducer:_})[h]=b,o}(Ya,v(Ja)),el=B,tl=T,nl={root:"L_A",sm:"L_B",rootFocused:"L_C",select:"L_D",arrow:"L_E"};function rl(){return rl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rl.apply(this,arguments)}function ol(e){var{items:t,selected:n,size:r="md"}=e,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["items","selected","size"]);const[s,a]=(0,_n.useState)(!1),l=null!=n?n:t[0];return(0,i.h)("span",{className:Tn("select",nl.root,r&&nl[r],{[nl.rootFocused]:s,select_focused:s,[`select_${r}`]:r})},l.label,(0,i.h)(pi,{size:{sm:10,md:12}[r],className:Tn("select-arrow",nl.arrow)}),(0,i.h)("select",rl({},o,{onFocus:()=>a(!0),onBlur:()=>a(!1),className:Tn("select-element",nl.select)}),t.map((e=>(0,i.h)("option",{key:e.value,value:e.value,selected:l.value===e.value},e.label)))))}function il(){const e=el(),t=wn(),[n,r]=(0,_n.useMemo)((()=>{const e={"-score":t.formatMessage(sl.best),"+score":t.formatMessage(sl.worst),"-time":t.formatMessage(sl.newest),"+time":t.formatMessage(sl.oldest),"-active":t.formatMessage(sl.recentlyUpdated),"+active":t.formatMessage(sl.leastRecentlyUpdated),"-controversy":t.formatMessage(sl.mostControversial),"+controversy":t.formatMessage(sl.leastControversial)},n=Object.entries(e).map((([e,t])=>({value:e,label:t}))),r=n.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t.value]:t})),{});return[n.filter((e=>!window.remark_config.hide_votes||!["-score","+score"].indexOf(e.value))),r]}),[t]),o=tl((e=>e.comments.sort))||n[0].value,s=r[o];return(0,i.h)("span",{className:"sort-picker"},(0,i.h)(Nn,{id:"sort-by",defaultMessage:"Sort by"})," ",(0,i.h)(ol,{items:n,selected:s,onChange:function(t){const{value:n}=t.target;n in r&&e(function(e){return(t,n)=>qr(this,void 0,void 0,(function*(){const{sort:r}=n().comments;t({type:Zr,payload:e});try{yield t(Qr(e)),wr(Rn,e)}catch(e){t({type:Zr,payload:r})}}))}(n))}}))}const sl={best:{id:"commentsSort.best",defaultMessage:"Best"},worst:{id:"commentsSort.worst",defaultMessage:"Worst"},newest:{id:"commentsSort.newest",defaultMessage:"Newest"},oldest:{id:"commentsSort.oldest",defaultMessage:"Oldest"},recentlyUpdated:{id:"commentsSort.recently-updated",defaultMessage:"Recently updated"},leastRecentlyUpdated:{id:"commentsSort.least-recently-updated",defaultMessage:"Least recently updated"},mostControversial:{id:"commentsSort.most-controversial",defaultMessage:"Most controversial"},leastControversial:{id:"commentsSort.least-controversial",defaultMessage:"Least controversial"}};function al(e){return null===e||"anonymous_"===(null==e?void 0:e.id.substring(0,10))}function ll(e=1e3){return new Promise((t=>setTimeout(t,e)))}function cl(e,t,n){return e.substring(0,t[0])+n+e.substring(t[1])}s(5377);var ul,hl,dl=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)};const fl=["[data-md-button]","md-header","md-bold","md-italic","md-quote","md-code","md-link","md-image","md-unordered-list","md-ordered-list","md-task-list","md-mention","md-ref","md-strikethrough"];function ml(e){const t=[];for(const n of e.querySelectorAll(fl.join(", ")))n.hidden||n.offsetWidth<=0&&n.offsetHeight<=0||n.closest("markdown-toolbar")===e&&t.push(n);return t}const pl=new WeakMap;class gl extends HTMLElement{constructor(){super();const e=()=>{const e=pl.get(this);e&&Dl(this,e)};this.addEventListener("keydown",function(e){return function(t){" "!==t.key&&"Enter"!==t.key||(t.preventDefault(),e(t))}}(e)),this.addEventListener("click",e)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","button")}click(){const e=pl.get(this);e&&Dl(this,e)}}class vl extends gl{constructor(){super(...arguments),ul.add(this)}connectedCallback(){const e=parseInt(this.getAttribute("level")||"3",10);dl(this,ul,"m",hl).call(this,e)}static get observedAttributes(){return["level"]}attributeChangedCallback(e,t,n){if("level"!==e)return;const r=parseInt(n||"3",10);dl(this,ul,"m",hl).call(this,r)}}ul=new WeakSet,hl=function(e){if(e<1||e>6)return;const t=`${"#".repeat(e)} `;pl.set(this,{prefix:t})},window.customElements.get("md-header")||(window.MarkdownHeaderButtonElement=vl,window.customElements.define("md-header",vl));class _l extends gl{connectedCallback(){pl.set(this,{prefix:"**",suffix:"**",trimFirst:!0})}}window.customElements.get("md-bold")||(window.MarkdownBoldButtonElement=_l,window.customElements.define("md-bold",_l));class bl extends gl{connectedCallback(){pl.set(this,{prefix:"_",suffix:"_",trimFirst:!0})}}window.customElements.get("md-italic")||(window.MarkdownItalicButtonElement=bl,window.customElements.define("md-italic",bl));class yl extends gl{connectedCallback(){pl.set(this,{prefix:"> ",multiline:!0,surroundWithNewlines:!0})}}window.customElements.get("md-quote")||(window.MarkdownQuoteButtonElement=yl,window.customElements.define("md-quote",yl));class wl extends gl{connectedCallback(){pl.set(this,{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"})}}window.customElements.get("md-code")||(window.MarkdownCodeButtonElement=wl,window.customElements.define("md-code",wl));class El extends gl{connectedCallback(){pl.set(this,{prefix:"[",suffix:"](url)",replaceNext:"url",scanFor:"https?://"})}}window.customElements.get("md-link")||(window.MarkdownLinkButtonElement=El,window.customElements.define("md-link",El));class Sl extends gl{connectedCallback(){pl.set(this,{prefix:"![",suffix:"](url)",replaceNext:"url",scanFor:"https?://"})}}window.customElements.get("md-image")||(window.MarkdownImageButtonElement=Sl,window.customElements.define("md-image",Sl));class kl extends gl{connectedCallback(){pl.set(this,{prefix:"- ",multiline:!0,unorderedList:!0})}}window.customElements.get("md-unordered-list")||(window.MarkdownUnorderedListButtonElement=kl,window.customElements.define("md-unordered-list",kl));class Ol extends gl{connectedCallback(){pl.set(this,{prefix:"1. ",multiline:!0,orderedList:!0})}}window.customElements.get("md-ordered-list")||(window.MarkdownOrderedListButtonElement=Ol,window.customElements.define("md-ordered-list",Ol));class Ml extends gl{connectedCallback(){pl.set(this,{prefix:"- [ ] ",multiline:!0,surroundWithNewlines:!0})}}window.customElements.get("md-task-list")||(window.MarkdownTaskListButtonElement=Ml,window.customElements.define("md-task-list",Ml));class Nl extends gl{connectedCallback(){pl.set(this,{prefix:"@",prefixSpace:!0})}}window.customElements.get("md-mention")||(window.MarkdownMentionButtonElement=Nl,window.customElements.define("md-mention",Nl));class Cl extends gl{connectedCallback(){pl.set(this,{prefix:"#",prefixSpace:!0})}}window.customElements.get("md-ref")||(window.MarkdownRefButtonElement=Cl,window.customElements.define("md-ref",Cl));class Tl extends gl{connectedCallback(){pl.set(this,{prefix:"~~",suffix:"~~",trimFirst:!0})}}window.customElements.get("md-strikethrough")||(window.MarkdownStrikethroughButtonElement=Tl,window.customElements.define("md-strikethrough",Tl));class xl extends HTMLElement{connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.addEventListener("keydown",Al),this.setAttribute("tabindex","0"),this.addEventListener("focus",Pl,{once:!0})}disconnectedCallback(){this.removeEventListener("keydown",Al)}get field(){const e=this.getAttribute("for");if(!e)return null;const t="getRootNode"in this?this.getRootNode():document;let n;return(t instanceof Document||t instanceof ShadowRoot)&&(n=t.getElementById(e)),n instanceof HTMLTextAreaElement?n:null}}function Pl({target:e}){if(!(e instanceof Element))return;e.removeAttribute("tabindex");let t="0";for(const n of ml(e))n.setAttribute("tabindex",t),"0"===t&&(n.focus(),t="-1")}function Al(e){const t=e.key;if("ArrowRight"!==t&&"ArrowLeft"!==t&&"Home"!==t&&"End"!==t)return;const n=e.currentTarget;if(!(n instanceof HTMLElement))return;const r=ml(n),o=r.indexOf(e.target),i=r.length;if(-1===o)return;let s=0;"ArrowLeft"===t&&(s=o-1),"ArrowRight"===t&&(s=o+1),"End"===t&&(s=i-1),s<0&&(s=i-1),s>i-1&&(s=0);for(let e=0;e<i;e+=1)r[e].setAttribute("tabindex",e===s?"0":"-1");e.preventDefault(),r[s].focus()}function Ll(e){return e.trim().split("\n").length>1}function Rl(e,t){return Array(t+1).join(e)}window.customElements.get("markdown-toolbar")||(window.MarkdownToolbarElement=xl,window.customElements.define("markdown-toolbar",xl));let jl=null;function Il(e){const t=e.value.slice(0,e.selectionStart),n=e.value.slice(e.selectionEnd),r=t.match(/\n*$/),o=n.match(/^\n*/),i=r?r[0].length:0,s=o?o[0].length:0;let a,l;return t.match(/\S/)&&i<2&&(a=Rl("\n",2-i)),n.match(/\S/)&&s<2&&(l=Rl("\n",2-s)),null==a&&(a=""),null==l&&(l=""),{newlinesToAppend:a,newlinesToPrepend:l}}function Bl(e){const t=e.split("\n"),n=/^\d+\.\s+/,r=t.every((e=>n.test(e)));let o=t;return r&&(o=t.map((e=>e.replace(n,"")))),{text:o.join("\n"),processed:r}}function Hl(e){const t=e.split("\n"),n=t.every((e=>e.startsWith("- ")));let r=t;return n&&(r=t.map((e=>e.slice("- ".length,e.length)))),{text:r.join("\n"),processed:n}}function Ul(e,t){return t?"- ":`${e+1}. `}function Dl(e,t){const n=e.closest("markdown-toolbar");if(!(n instanceof xl))return;const r=Object.assign(Object.assign({},{prefix:"",suffix:"",blockPrefix:"",blockSuffix:"",multiline:!1,replaceNext:"",prefixSpace:!1,scanFor:"",surroundWithNewlines:!1,orderedList:!1,unorderedList:!1,trimFirst:!1}),t),o=n.field;o&&(o.focus(),function(e,t){const n=e.value.slice(e.selectionStart,e.selectionEnd);let r;r=t.orderedList||t.unorderedList?function(e,t){const n=e.selectionStart===e.selectionEnd;let r=e.selectionStart,o=e.selectionEnd;!function(e){const t=e.value.split("\n");let n=0;for(let r=0;r<t.length;r++){const o=t[r].length+1;e.selectionStart>=n&&e.selectionStart<n+o&&(e.selectionStart=n),e.selectionEnd>=n&&e.selectionEnd<n+o&&(e.selectionEnd=n+o-1),n+=o}}(e);const i=e.value.slice(e.selectionStart,e.selectionEnd),[s,a,l]=function(e,t){let n,r,o;return e.orderedList?(r=Bl(t),n=Hl(r.text),o=n.text):(r=Hl(t),n=Bl(r.text),o=n.text),[r,n,o]}(t,i),c=l.split("\n").map(((e,n)=>`${Ul(n,t.unorderedList)}${e}`)),u=c.reduce(((e,n,r)=>e+Ul(r,t.unorderedList).length),0),h=c.reduce(((e,n,r)=>e+Ul(r,!t.unorderedList).length),0);if(s.processed)return n?(r=Math.max(r-Ul(0,t.unorderedList).length,0),o=r):(r=e.selectionStart,o=e.selectionEnd-u),{text:l,selectionStart:r,selectionEnd:o};const{newlinesToAppend:d,newlinesToPrepend:f}=Il(e),m=d+c.join("\n")+f;return n?(r=Math.max(r+Ul(0,t.unorderedList).length+d.length,0),o=r):a.processed?(r=Math.max(e.selectionStart+d.length,0),o=e.selectionEnd+d.length+u-h):(r=Math.max(e.selectionStart+d.length,0),o=e.selectionEnd+d.length+u),{text:m,selectionStart:r,selectionEnd:o}}(e,t):t.multiline&&Ll(n)?function(e,t){const{prefix:n,suffix:r,surroundWithNewlines:o}=t;let i=e.value.slice(e.selectionStart,e.selectionEnd),s=e.selectionStart,a=e.selectionEnd;const l=i.split("\n");if(l.every((e=>e.startsWith(n)&&e.endsWith(r))))i=l.map((e=>e.slice(n.length,e.length-r.length))).join("\n"),a=s+i.length;else if(i=l.map((e=>n+e+r)).join("\n"),o){const{newlinesToAppend:t,newlinesToPrepend:n}=Il(e);s+=t.length,a=s+i.length,i=t+i+n}return{text:i,selectionStart:s,selectionEnd:a}}(e,t):function(e,t){let n,r;const{prefix:o,suffix:i,blockPrefix:s,blockSuffix:a,replaceNext:l,prefixSpace:c,scanFor:u,surroundWithNewlines:h}=t,d=e.selectionStart,f=e.selectionEnd;let m=e.value.slice(e.selectionStart,e.selectionEnd),p=Ll(m)&&s.length>0?`${s}\n`:o,g=Ll(m)&&a.length>0?`\n${a}`:i;if(c){const t=e.value[e.selectionStart-1];0===e.selectionStart||null==t||t.match(/\s/)||(p=` ${p}`)}m=function(e,t,n,r=!1){if(e.selectionStart===e.selectionEnd)e.selectionStart=function(e,t){let n=t;for(;e[n]&&null!=e[n-1]&&!e[n-1].match(/\s/);)n--;return n}(e.value,e.selectionStart),e.selectionEnd=function(e,t,n){let r=t;const o=n?/\n/:/\s/;for(;e[r]&&!e[r].match(o);)r++;return r}(e.value,e.selectionEnd,r);else{const r=e.selectionStart-t.length,o=e.selectionEnd+n.length,i=e.value.slice(r,e.selectionStart)===t,s=e.value.slice(e.selectionEnd,o)===n;i&&s&&(e.selectionStart=r,e.selectionEnd=o)}return e.value.slice(e.selectionStart,e.selectionEnd)}(e,p,g,t.multiline);let v=e.selectionStart,_=e.selectionEnd;const b=l.length>0&&g.indexOf(l)>-1&&m.length>0;if(h){const t=Il(e);n=t.newlinesToAppend,r=t.newlinesToPrepend,p=n+o,g+=r}if(m.startsWith(p)&&m.endsWith(g)){const e=m.slice(p.length,m.length-g.length);if(d===f){let t=d-p.length;t=Math.max(t,v),t=Math.min(t,v+e.length),v=_=t}else _=v+e.length;return{text:e,selectionStart:v,selectionEnd:_}}if(b){if(u.length>0&&m.match(u)){g=g.replace(l,m);const e=p+g;return v=_=v+p.length,{text:e,selectionStart:v,selectionEnd:_}}{const e=p+m+g;return v=v+p.length+m.length+g.indexOf(l),_=v+l.length,{text:e,selectionStart:v,selectionEnd:_}}}{let e=p+m+g;v=d+p.length,_=f+p.length;const n=m.match(/^\s*|\s*$/g);if(t.trimFirst&&n){const t=n[0]||"",r=n[1]||"";e=t+p+m.trim()+g+r,v+=t.length,_-=r.length}return{text:e,selectionStart:v,selectionEnd:_}}}(e,t),function(e,{text:t,selectionStart:n,selectionEnd:r}){const o=e.selectionStart,i=e.value.slice(0,o),s=e.value.slice(e.selectionEnd);if(null===jl||!0===jl){e.contentEditable="true";try{jl=document.execCommand("insertText",!1,t)}catch(e){jl=!1}e.contentEditable="false"}if(jl&&!e.value.slice(0,e.selectionStart).endsWith(t)&&(jl=!1),!jl){try{document.execCommand("ms-beginUndoUnit")}catch(e){}e.value=i+t+s;try{document.execCommand("ms-endUndoUnit")}catch(e){}e.dispatchEvent(new CustomEvent("input",{bubbles:!0,cancelable:!0}))}null!=n&&null!=r?e.setSelectionRange(n,r):e.setSelectionRange(o,e.selectionEnd)}(e,r)}(o,r))}function Fl(){return(0,i.h)("svg",{className:"comment-form__toolbar-icon",viewBox:"0 0 10 16",version:"1.1",width:"10",height:"16","aria-hidden":"true"},(0,i.h)("path",{"fill-rule":"evenodd",d:"M1 2h3.83c2.48 0 4.3.75 4.3 2.95 0 1.14-.63 2.23-1.67 2.61v.06c1.33.3 2.3 1.23 2.3 2.86 0 2.39-1.97 3.52-4.61 3.52H1V2zm3.66 4.95c1.67 0 2.38-.66 2.38-1.69 0-1.17-.78-1.61-2.34-1.61H3.13v3.3h1.53zm.27 5.39c1.77 0 2.75-.64 2.75-1.98 0-1.27-.95-1.81-2.75-1.81h-1.8v3.8h1.8v-.01z"}))}function $l(){return(0,i.h)("svg",{className:"comment-form__toolbar-icon",viewBox:"0 0 18 16",version:"1.1",width:"18",height:"16","aria-hidden":"true"},(0,i.h)("path",{"fill-rule":"evenodd",d:"M13.62 9.08L12.1 3.66h-.06l-1.5 5.42h3.08zM5.7 10.13S4.68 6.52 4.53 6.02h-.08l-1.13 4.11H5.7zM17.31 14h-2.25l-.95-3.25h-4.07L9.09 14H6.84l-.69-2.33H2.87L2.17 14H0l3.3-9.59h2.5l2.17 6.34L10.86 2h2.52l3.94 12h-.01z"}))}function Gl(){return(0,i.h)("svg",{className:"comment-form__toolbar-icon",viewBox:"0 0 6 16",version:"1.1",width:"6",height:"16","aria-hidden":"true"},(0,i.h)("path",{"fill-rule":"evenodd",d:"M2.81 5h1.98L3 14H1l1.81-9zm.36-2.7c0-.7.58-1.3 1.33-1.3.56 0 1.13.38 1.13 1.03 0 .75-.59 1.3-1.33 1.3-.58 0-1.13-.38-1.13-1.03z"}))}function zl(){return(0,i.h)("svg",{className:"comment-form__toolbar-icon",viewBox:"0 0 14 16",version:"1.1",width:"14",height:"16","aria-hidden":"true"},(0,i.h)("path",{"fill-rule":"evenodd",d:"M6.16 3.5C3.73 5.06 2.55 6.67 2.55 9.36c.16-.05.3-.05.44-.05 1.27 0 2.5.86 2.5 2.41 0 1.61-1.03 2.61-2.5 2.61-1.9 0-2.99-1.52-2.99-4.25 0-3.8 1.75-6.53 5.02-8.42L6.16 3.5zm7 0c-2.43 1.56-3.61 3.17-3.61 5.86.16-.05.3-.05.44-.05 1.27 0 2.5.86 2.5 2.41 0 1.61-1.03 2.61-2.5 2.61-1.89 0-2.98-1.52-2.98-4.25 0-3.8 1.75-6.53 5.02-8.42l1.14 1.84h-.01z"}))}function Vl(){return(0,i.h)("svg",{className:"comment-form__toolbar-icon",viewBox:"0 0 14 16",version:"1.1",width:"14",height:"16","aria-hidden":"true"},(0,i.h)("path",{"fill-rule":"evenodd",d:"M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"}))}function Wl(){return(0,i.h)("svg",{className:"comment-form__toolbar-icon",viewBox:"0 0 12 16",version:"1.1",width:"12",height:"16","aria-hidden":"true"},(0,i.h)("path",{"fill-rule":"evenodd",d:"M2 13c0 .59 0 1-.59 1H.59C0 14 0 13.59 0 13c0-.59 0-1 .59-1h.81c.59 0 .59.41.59 1H2zm2.59-9h6.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1H4.59C4 2 4 2.41 4 3c0 .59 0 1 .59 1zM1.41 7H.59C0 7 0 7.41 0 8c0 .59 0 1 .59 1h.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1h.01zm0-5H.59C0 2 0 2.41 0 3c0 .59 0 1 .59 1h.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1h.01zm10 5H4.59C4 7 4 7.41 4 8c0 .59 0 1 .59 1h6.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1h.01zm0 5H4.59C4 12 4 12.41 4 13c0 .59 0 1 .59 1h6.81c.59 0 .59-.41.59-1 0-.59 0-1-.59-1h.01z"}))}function Kl(){return(0,i.h)("svg",{className:"comment-form__toolbar-icon",viewBox:"0 0 12 16",version:"1.1",width:"12",height:"16","aria-hidden":"true"},(0,i.h)("path",{"fill-rule":"evenodd",d:"M12.01 13c0 .59 0 1-.59 1H4.6c-.59 0-.59-.41-.59-1 0-.59 0-1 .59-1h6.81c.59 0 .59.41.59 1h.01zM4.6 4h6.81C12 4 12 3.59 12 3c0-.59 0-1-.59-1H4.6c-.59 0-.59.41-.59 1 0 .59 0 1 .59 1zm6.81 3H4.6c-.59 0-.59.41-.59 1 0 .59 0 1 .59 1h6.81C12 9 12 8.59 12 8c0-.59 0-1-.59-1zm-9.4-6h-.72c-.3.19-.58.25-1.03.34V2h.75v2.14H.17V5h2.84v-.86h-1V1zm.392 8.12c-.129 0-.592.04-.802.07.53-.56 1.14-1.25 1.14-1.89C2.72 6.52 2.18 6 1.38 6c-.59 0-.97.2-1.38.64l.58.58c.19-.19.38-.38.64-.38.28 0 .48.16.48.52 0 .53-.77 1.2-1.7 2.06V10h3v-.88h-.598zm-.222 3.79v-.03c.44-.19.64-.47.64-.86 0-.7-.56-1.11-1.44-1.11-.48 0-.89.19-1.28.52l.55.64c.25-.2.44-.31.69-.31.27 0 .42.13.42.36 0 .27-.2.44-.86.44v.75c.83 0 .98.17.98.47 0 .25-.23.38-.58.38-.28 0-.56-.14-.81-.38l-.48.66c.3.36.77.56 1.41.56.83 0 1.53-.41 1.53-1.16 0-.5-.31-.81-.77-.94v.01z"}))}const Zl={id:"toolbar.bold",defaultMessage:"Add bold text {shortcut}"},ql={id:"toolbar.header",defaultMessage:"Add header text"},Xl={id:"toolbar.italic",defaultMessage:"Add italic text {shortcut}"},Yl={id:"toolbar.quote",defaultMessage:"Insert a quote"},Jl={id:"toolbar.code",defaultMessage:"Insert a code"},Ql={id:"toolbar.link",defaultMessage:"Add a link {shortcut}"},ec={id:"toolbar.unordered-list",defaultMessage:"Add a bulleted list"},tc={id:"toolbar.ordered-list",defaultMessage:"Add a numbered list"},nc={id:"toolbar.attach-image",defaultMessage:"Attach the image, drag & drop or paste from clipboard"};class rc extends i.Component{constructor(e){super(e),this.uploadImages=this.uploadImages.bind(this)}uploadImages(e){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const t=e.currentTarget;if(!(this.props.allowUpload&&t&&t.files&&0!==t.files.length))return;const n=Array.from(t.files);yield this.props.uploadImages(n),t.value=null}))}render(e){const t=e.intl,n=t.formatMessage(Zl,{shortcut:"<cmd-b>"}),r=t.formatMessage(ql),o=t.formatMessage(Xl,{shortcut:"<cmd-i>"}),s=t.formatMessage(Yl),a=t.formatMessage(Jl),l=(t.formatMessage(Ql,{shortcut:"<cmd-k>"}),t.formatMessage(ec)),c=t.formatMessage(tc);return t.formatMessage(nc),(0,i.h)("markdown-toolbar",{className:"comment-form__toolbar",for:e.textareaId},(0,i.h)("div",{className:"comment-form__toolbar-group"},(0,i.h)("md-header",{className:"comment-form__toolbar-item",title:r,"aria-label":r},(0,i.h)($l,null)),(0,i.h)("md-bold",{className:"comment-form__toolbar-item",title:n,"aria-label":n},(0,i.h)(Fl,null)),(0,i.h)("md-italic",{className:"comment-form__toolbar-item",title:o,"aria-label":o},(0,i.h)(Gl,null))),(0,i.h)("div",{className:"comment-form__toolbar-group"},(0,i.h)("md-quote",{className:"comment-form__toolbar-item",title:s,"aria-label":s},(0,i.h)(zl,null)),(0,i.h)("md-code",{className:"comment-form__toolbar-item",title:a,"aria-label":a},(0,i.h)(Vl,null))),(0,i.h)("div",{className:"comment-form__toolbar-group"},(0,i.h)("md-unordered-list",{className:"comment-form__toolbar-item",title:l,"aria-label":l},(0,i.h)(Wl,null)),(0,i.h)("md-ordered-list",{className:"comment-form__toolbar-item",title:c,"aria-label":c},(0,i.h)(Kl,null))))}}const oc=!!navigator.userAgent.match(/Macintosh/);class ic{constructor(e,t){this.input=e,this.list=t,this.isComposing=!1,t.id||(t.id=`combobox-${Math.random().toString().slice(2,6)}`),this.keyboardEventHandler=e=>function(e,t){if(!(e.shiftKey||e.metaKey||e.altKey)&&(oc||!e.ctrlKey)&&!t.isComposing)switch(e.key){case"Enter":case"Tab":(function(e,t){const n=t.querySelector('[aria-selected="true"]');return!!n&&("true"===n.getAttribute("aria-disabled")||n.click(),!0)})(t.input,t.list)&&e.preventDefault();break;case"Escape":t.clearSelection();break;case"ArrowDown":t.navigate(1),e.preventDefault();break;case"ArrowUp":t.navigate(-1),e.preventDefault();break;case"n":oc&&e.ctrlKey&&(t.navigate(1),e.preventDefault());break;case"p":oc&&e.ctrlKey&&(t.navigate(-1),e.preventDefault());break;default:if(e.ctrlKey)break;t.clearSelection()}}(e,this),this.compositionEventHandler=e=>function(e,t){t.isComposing="compositionstart"===e.type,document.getElementById(t.input.getAttribute("aria-controls")||"")&&t.clearSelection()}(e,this),this.inputHandler=this.clearSelection.bind(this),e.setAttribute("role","combobox"),e.setAttribute("aria-controls",t.id),e.setAttribute("aria-expanded","false"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",sc)}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",sc)}navigate(e=1){const t=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(ac)[0],n=Array.from(this.list.querySelectorAll('[role="option"]')).filter(ac),r=n.indexOf(t);if(r===n.length-1&&1===e||0===r&&-1===e)return this.clearSelection(),void this.input.focus();let o=1===e?0:n.length-1;if(t&&r>=0){const t=r+e;t>=0&&t<n.length&&(o=t)}const i=n[o];if(i)for(const e of n)i===e?(this.input.setAttribute("aria-activedescendant",i.id),i.setAttribute("aria-selected","true"),lc(this.list,i)):e.setAttribute("aria-selected","false")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const e of this.list.querySelectorAll('[aria-selected="true"]'))e.setAttribute("aria-selected","false")}}function sc(e){if(!(e.target instanceof Element))return;const t=e.target.closest('[role="option"]');t&&"true"!==t.getAttribute("aria-disabled")&&function(e){e.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0}))}(t)}function ac(e){return!e.hidden&&!(e instanceof HTMLInputElement&&"hidden"===e.type)&&(e.offsetWidth>0||e.offsetHeight>0)}function lc(e,t){(function(e,t){const n=e.scrollTop,r=n+e.clientHeight,o=t.offsetTop,i=o+t.clientHeight;return o>=n&&i<=r})(e,t)||(e.scrollTop=t.offsetTop)}const cc=/\s|\(|\[/;function uc(e,t,n,{multiWord:r,lookBackIndex:o,lastMatchPosition:i}={multiWord:!1,lookBackIndex:0,lastMatchPosition:null}){let s=e.lastIndexOf(t,n-1);if(-1===s)return;if(s<o)return;if(r){if(null!=i){if(i===s)return;s=i-t.length}if(" "===e[s+1]&&n>=s+t.length+1)return;if(e.lastIndexOf("\n",n-1)>s)return;if(e.lastIndexOf(".",n-1)>s)return}else if(e.lastIndexOf(" ",n-1)>s)return;const a=e[s-1];return!a||cc.test(a)?{text:e.substring(s+t.length,n),position:s+t.length}:void 0}const hc=["position:absolute;","overflow:auto;","word-wrap:break-word;","top:0px;","left:-9999px;"],dc=["box-sizing","font-family","font-size","font-style","font-variant","font-weight","height","letter-spacing","line-height","max-height","min-height","padding-bottom","padding-left","padding-right","padding-top","border-bottom","border-left","border-right","border-top","text-decoration","text-indent","text-transform","width","word-spacing"],fc=new WeakMap;const mc=new WeakMap;class pc{constructor(e,t){this.expander=e,this.input=t,this.combobox=null,this.menu=null,this.match=null,this.justPasted=!1,this.lookBackIndex=0,this.oninput=this.onInput.bind(this),this.onpaste=this.onPaste.bind(this),this.onkeydown=this.onKeydown.bind(this),this.oncommit=this.onCommit.bind(this),this.onmousedown=this.onMousedown.bind(this),this.onblur=this.onBlur.bind(this),this.interactingWithList=!1,t.addEventListener("paste",this.onpaste),t.addEventListener("input",this.oninput),t.addEventListener("keydown",this.onkeydown),t.addEventListener("blur",this.onblur)}destroy(){this.input.removeEventListener("paste",this.onpaste),this.input.removeEventListener("input",this.oninput),this.input.removeEventListener("keydown",this.onkeydown),this.input.removeEventListener("blur",this.onblur)}dismissMenu(){this.deactivate()&&(this.lookBackIndex=this.input.selectionEnd||this.lookBackIndex)}activate(e,t){var n,r;if(this.input!==document.activeElement&&this.input!==(null===(r=null===(n=document.activeElement)||void 0===n?void 0:n.shadowRoot)||void 0===r?void 0:r.activeElement))return;this.deactivate(),this.menu=t,t.id||(t.id=`text-expander-${Math.floor(1e5*Math.random()).toString()}`),this.expander.append(t),this.combobox=new ic(this.input,t);const{top:o,left:i}=function(e,t=e.selectionEnd){const{mirror:n,marker:r}=function(e,t){const n=e.nodeName.toLowerCase();if("textarea"!==n&&"input"!==n)throw new Error("expected textField to a textarea or input");let r=fc.get(e);if(r&&r.parentElement===e.parentElement)r.innerHTML="";else{r=document.createElement("div"),fc.set(e,r);const t=window.getComputedStyle(e),o=hc.slice(0);"textarea"===n?o.push("white-space:pre-wrap;"):o.push("white-space:nowrap;");for(let e=0,n=dc.length;e<n;e++){const n=dc[e];o.push(`${n}:${t.getPropertyValue(n)};`)}r.style.cssText=o.join(" ")}const o=document.createElement("span");let i,s;if(o.style.cssText="position: absolute;",o.innerHTML="&nbsp;","number"==typeof t){let n=e.value.substring(0,t);n&&(i=document.createTextNode(n)),n=e.value.substring(t),n&&(s=document.createTextNode(n))}else{const t=e.value;t&&(i=document.createTextNode(t))}if(i&&r.appendChild(i),r.appendChild(o),s&&r.appendChild(s),!r.parentElement){if(!e.parentElement)throw new Error("textField must have a parentElement to mirror");e.parentElement.insertBefore(r,e)}return r.scrollTop=e.scrollTop,r.scrollLeft=e.scrollLeft,{mirror:r,marker:o}}(e,t),o=n.getBoundingClientRect(),i=r.getBoundingClientRect();return setTimeout((()=>{n.remove()}),5e3),{top:i.top-o.top,left:i.left-o.left}}(this.input,e.position);t.style.top=`${o}px`,t.style.left=`${i}px`,this.combobox.start(),t.addEventListener("combobox-commit",this.oncommit),t.addEventListener("mousedown",this.onmousedown),this.combobox.navigate(1)}deactivate(){const e=this.menu;return!(!e||!this.combobox||(this.menu=null,e.removeEventListener("combobox-commit",this.oncommit),e.removeEventListener("mousedown",this.onmousedown),this.combobox.destroy(),this.combobox=null,e.remove(),0))}onCommit({target:e}){const t=e;if(!(t instanceof HTMLElement))return;if(!this.combobox)return;const n=this.match;if(!n)return;const r=this.input.value.substring(0,n.position-n.key.length),o=this.input.value.substring(n.position+n.text.length),i={item:t,key:n.key,value:null};if(!this.expander.dispatchEvent(new CustomEvent("text-expander-value",{cancelable:!0,detail:i})))return;if(!i.value)return;const s=`${i.value} `;this.input.value=r+s+o;const a=r.length+s.length;this.deactivate(),this.input.focus({preventScroll:!0}),this.input.selectionStart=a,this.input.selectionEnd=a,this.lookBackIndex=a,this.match=null}onBlur(){this.interactingWithList?this.interactingWithList=!1:this.deactivate()}onPaste(){this.justPasted=!0}async onInput(){if(this.justPasted)return void(this.justPasted=!1);const e=this.findMatch();if(e){this.match=e;const t=await this.notifyProviders(e);if(!this.match)return;t?this.activate(e,t):this.deactivate()}else this.match=null,this.deactivate()}findMatch(){const e=this.input.selectionEnd||0,t=this.input.value;e<=this.lookBackIndex&&(this.lookBackIndex=e-1);for(const{key:n,multiWord:r}of this.expander.keys){const o=uc(t,n,e,{multiWord:r,lookBackIndex:this.lookBackIndex,lastMatchPosition:this.match?this.match.position:null});if(o)return{text:o.text,key:n,position:o.position}}}async notifyProviders(e){const t=[];if(!this.expander.dispatchEvent(new CustomEvent("text-expander-change",{cancelable:!0,detail:{provide:e=>t.push(e),text:e.text,key:e.key}})))return;const n=(await Promise.all(t)).filter((e=>e.matched)).map((e=>e.fragment));return n[0]}onMousedown(){this.interactingWithList=!0}onKeydown(e){"Escape"===e.key&&(this.match=null,this.deactivate()&&(this.lookBackIndex=this.input.selectionEnd||this.lookBackIndex,e.stopImmediatePropagation(),e.preventDefault()))}}class gc extends HTMLElement{get keys(){const e=this.getAttribute("keys"),t=e?e.split(" "):[],n=this.getAttribute("multiword"),r=n?n.split(" "):[],o=0===r.length&&this.hasAttribute("multiword");return t.map((e=>({key:e,multiWord:o||r.includes(e)})))}connectedCallback(){const e=this.querySelector('input[type="text"], textarea');if(!(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))return;const t=new pc(this,e);mc.set(this,t)}disconnectedCallback(){const e=mc.get(this);e&&(e.destroy(),mc.delete(this))}dismiss(){const e=mc.get(this);e&&e.dismissMenu()}}window.customElements.get("text-expander")||(window.TextExpanderElement=gc,window.customElements.define("text-expander",gc));function vc({items:e,theme:t}){const n="dark"===t;return(0,i.h)("ul",{className:Tn("M_A",{M_B:n})},e.map((({key:e,emoji:t})=>(0,i.h)("li",{key:e,role:"option",className:Tn("M_C",{M_D:n}),"data-value":e},(0,i.h)("span",{className:"M_E"},t)," ",e))))}const _c=({children:e})=>{const t=(0,_n.useRef)(),n=go();return(0,_n.useEffect)((()=>{if(t.current){const e=t.current;e.setAttribute("keys",":");const r=e=>{const{provide:t,key:r,text:o}=e.detail;t(function(e,t,n){return s.e(371).then(s.t.bind(s,3804,23)).then((r=>{if(":"===e){const e=r.search(t);if(0===e.length)return Promise.resolve({matched:!1});const o=document.createDocumentFragment();return(0,i.render)((0,i.h)(vc,{theme:n,items:e.slice(0,5)}),o),Promise.resolve({matched:!0,fragment:o.firstChild})}return Promise.resolve({matched:!1})})).catch((()=>Promise.resolve({matched:!1})))}(r,o,n))},o=e=>{const{key:t,item:n}=e.detail;":"===t&&(e.detail.value=`:${n.dataset.value}:`)};return e.addEventListener("text-expander-change",r),e.addEventListener("text-expander-value",o),()=>{e.removeEventListener("text-expander-change",r),e.removeEventListener("text-expander-value",o)}}return()=>{}}),[n]),er.config.emoji_enabled?(0,i.h)("text-expander",{ref:t},e):(0,i.h)(i.Fragment,null,e)};function bc(){return Sr(An)}function yc(e,t){Or(An,Object.assign(Object.assign({},bc()),{[e]:t}))}var wc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const Ec=/image\//i;class Sc extends i.Component{constructor(e){var t,n;super(e),this.textareaRef=(0,i.createRef)(),this.state={preview:null,isErrorShown:!1,errorMessage:null,errorLock:!1,isDisabled:!1,text:"",buttonText:null},this.onKeyDown=e=>{13===e.keyCode&&(e.metaKey||e.ctrlKey)&&this.send(e)},this.onInput=e=>{const{value:t}=e.target,n=t.substring(0,er.config.max_comment_size);yc(this.props.id,t),this.state.errorLock?this.setState({preview:null,text:n}):this.setState({isErrorShown:!1,errorMessage:null,preview:null,text:n})},this.onPaste=e=>wc(this,void 0,void 0,(function*(){if(!(e.clipboardData&&e.clipboardData.files.length>0))return;e.preventDefault();const t=Array.from(e.clipboardData.files);yield this.uploadImages(t)})),this.send=e=>wc(this,void 0,void 0,(function*(){const{text:t}=this.state;if(e&&e.preventDefault(),t&&t.trim()){t===this.props.value&&(this.props.onCancel&&this.props.onCancel(),this.setState({preview:null,text:""})),this.setState({isDisabled:!0,isErrorShown:!1,text:t});try{yield this.props.onSubmit(t,Zn||document.title)}catch(e){return void this.setState({isDisabled:!1,isErrorShown:!0,errorMessage:Jn(e,this.props.intl)})}var n;n=this.props.id,Or(An,(e=>e?(delete e[n],e):null)),this.setState({isDisabled:!1,preview:null,text:""})}})),this.getPreview=()=>{var e,t;const n=null!==(t=null===(e=this.textareaRef.current)||void 0===e?void 0:e.value)&&void 0!==t?t:this.state.text;n&&n.trim()&&(this.setState({isErrorShown:!1,errorMessage:null,text:n}),this.props.getPreview(n).then((e=>this.setState({preview:e}))).catch((e=>{this.setState({isErrorShown:!0,errorMessage:Jn(e,this.props.intl)})})))},this.appendError=(...e)=>{this.state.errorMessage?this.setState({errorMessage:`${this.state.errorMessage}\n${e.join("\n")}`,isErrorShown:!0}):this.setState({errorMessage:e.join("\n"),isErrorShown:!0})},this.onDragOver=e=>{if(this.props.user||e.preventDefault(),!this.props.uploadImage)return;if(0===er.config.max_image_size)return;if(!this.textareaRef.current)return;if(!e.dataTransfer)return;const t=Array.from(e.dataTransfer.items);0!==Array.from(t).filter((e=>"file"===e.kind&&Ec.test(e.type))).length&&(e.preventDefault(),e.dataTransfer.dropEffect="copy")},this.onDrop=e=>{const t=this.props.user&&al(this.props.user);if(!this.props.user||t){const n=t?kc.anonymousUploadingDisabled:kc.unauthorizedUploadingDisabled;return this.setState({isErrorShown:!0,errorMessage:this.props.intl.formatMessage(n)}),void e.preventDefault()}if(!this.props.uploadImage)return;if(0===er.config.max_image_size)return;if(!e.dataTransfer)return;const n=Array.from(e.dataTransfer.files).filter((e=>Ec.test(e.type)));0!==n.length&&(e.preventDefault(),this.uploadImages(n))},this.uploadImage=e=>wc(this,void 0,void 0,(function*(){const t=this.props.intl;return this.props.uploadImage(e).catch((n=>new Error(t.formatMessage(kc.uploadFileFail,{fileName:e.name,errorMessage:Jn(n,this.props.intl)}))))})),this.uploadImages=e=>wc(this,void 0,void 0,(function*(){const t=this.props.intl;if(!this.props.uploadImage)return;if(!this.textareaRef.current)return;const n=`${(er.config.max_image_size/1024/1024).toFixed(2)}MB`;this.setState({errorLock:!0,errorMessage:null,isErrorShown:!1,isDisabled:!0,buttonText:t.formatMessage(kc.uploading)});for(let r=0;r<e.length;r++){const o=e[r],i=0===r,s=0===this.state.text.length?"":"\n",a=`${s}![${t.formatMessage(kc.uploadingFile,{fileName:o.name})}]()`,l=a.length,c=this.getSelection(),u=this.state.text,h=()=>wc(this,void 0,void 0,(function*(){this.setState({text:u}),yield ll(100),this.setSelection(c)}));if(o.size>er.config.max_image_size){this.appendError(t.formatMessage(kc.exceededSize,{fileName:o.name,maxImageSize:n}));continue}this.setState({text:cl(this.state.text,c,a)},(()=>{yc(this.props.id,this.state.text)})),!i&&(yield ll(5e3));const d=yield this.uploadImage(o);if(d instanceof Error){this.appendError(d.message),yield h();continue}const f=`${s}![${d.name}](${d.url})`;this.setState({text:cl(this.state.text,[c[0],c[0]+l],f)},(()=>{yc(this.props.id,this.state.text)})),yield ll(100);const m=c[0]+f.length;this.setSelection([m,m])}this.setState({errorLock:!1,isDisabled:!1,buttonText:null})})),this.renderMarkdownTip=()=>null,this.renderSubscribeButtons=()=>null;const r=function(e){const t=bc();if(t&&e)return t[e]}(e.id);this.state.text=null!==(n=null!==(t=e.value)&&void 0!==t?t:r)&&void 0!==n?n:"",Sc.textareaId+=1}componentWillReceiveProps(e){e.value!==this.props.value&&this.setState({text:e.value||""}),e.user&&!this.props.value&&this.setState({isErrorShown:!1,errorMessage:null})}shouldComponentUpdate(e,t){const n=null!==this.props.user&&this.props.user.id;return(null!==e.user&&e.user.id)!==n||e.mode!==this.props.mode||e.theme!==this.props.theme||e.value!==this.props.value||e.errorMessage!==this.props.errorMessage||t!==this.state}getSelection(){const e=this.textareaRef.current;if(e)return[e.selectionStart,e.selectionEnd];throw new Error("No textarea element reference exists")}setSelection(e){const t=this.textareaRef.current;if(t)return t.selectionStart=e[0],void(t.selectionEnd=e[1]);throw new Error("No textarea element reference exists")}render(){const{theme:e,mode:t,mix:n,uploadImage:r,autofocus:o,user:s,intl:a}=this.props,{isDisabled:l,isErrorShown:c,preview:u,text:h,buttonText:d}=this.state,f=er.config.max_comment_size-h.length,m=this.props.errorMessage||this.state.errorMessage,p={main:(0,i.h)(Nn,{id:"commentForm.send",defaultMessage:"Send"}),edit:(0,i.h)(Nn,{id:"commentForm.save",defaultMessage:"Save"}),reply:(0,i.h)(Nn,{id:"commentForm.reply",defaultMessage:"Reply"})},g=`textarea_${Sc.textareaId}`,v=d||p[t||"main"],_=a.formatMessage(kc.placeholder),b=er.config.simple_view;return(0,i.h)("form",{className:yn()("comment-form",{mods:{theme:e,type:t||"reply",simple:b},mix:n}),onSubmit:this.send,"aria-label":a.formatMessage(kc.newComment),onDragOver:this.onDragOver,onDrop:this.onDrop},!b&&(0,i.h)("div",{className:"comment-form__control-panel"},(0,i.h)(rc,{intl:a,allowUpload:Boolean(r),uploadImages:this.uploadImages,textareaId:g})),(0,i.h)("div",{className:"comment-form__field-wrapper"},(0,i.h)(_c,null,(0,i.h)(hi,{id:g,ref:this.textareaRef,onPaste:this.onPaste,className:"comment-form__field",placeholder:_,value:h,onInput:this.onInput,onKeyDown:this.onKeyDown,disabled:l,autofocus:!!o,spellcheck:!0})),f<100&&(0,i.h)("span",{className:"comment-form__counter"},f)),(c||!!m)&&(m||a.formatMessage(kc.unexpectedError)).split("\n").map((e=>(0,i.h)("p",{className:"comment-form__error",role:"alert",key:e},e))),(0,i.h)("div",{className:"comment-form__actions"},s?(0,i.h)(i.Fragment,null,(0,i.h)("div",null,!b&&(0,i.h)(qo,{kind:"secondary",theme:e,size:"large",mix:"comment-form__button",disabled:l,onClick:this.getPreview},(0,i.h)(Nn,{id:"commentForm.preview",defaultMessage:"Preview"})),(0,i.h)(qo,{kind:"primary",size:"large",mix:"comment-form__button",type:"submit",disabled:l},v)),"main"===t&&(0,i.h)("div",{className:"comment-form__rss"},this.renderMarkdownTip(),this.renderSubscribeButtons())):(0,i.h)(i.Fragment,null,(0,i.h)(wi,null),this.renderMarkdownTip())),!!u&&(0,i.h)("div",{className:"comment-form__preview-wrapper"},(0,i.h)("div",{className:"comment-form__preview raw-content",dangerouslySetInnerHTML:{__html:u}})))}}Sc.textareaId=0;const kc={placeholder:{id:"commentForm.input-placeholder",defaultMessage:"Your comment here"},uploadFileFail:{id:"commentForm.upload-file-fail",defaultMessage:'{fileName} upload failed with "{errorMessage}"'},uploading:{id:"commentForm.uploading",defaultMessage:"Uploading..."},uploadingFile:{id:"commentForm.uploading-file",defaultMessage:"uploading {fileName}..."},exceededSize:{id:"commentForm.exceeded-size",defaultMessage:"{fileName} exceeds size limit of {maxImageSize}"},newComment:{id:"commentForm.new-comment",defaultMessage:"New comment"},unexpectedError:{id:"commentForm.unexpected-error",defaultMessage:"Something went wrong. Please try again a bit later."},unauthorizedUploadingDisabled:{id:"commentForm.unauthorized-uploading-disabled",defaultMessage:"Image uploading is disabled for unauthorized users. You should login before uploading."},anonymousUploadingDisabled:{id:"commentForm.anonymous-uploading-disabled",defaultMessage:"Image uploading is disabled for anonymous users. Please log in not as anonymous user to be able to attach images."}};function Oc(){return JSON.parse(Er(Pn)||"[]")}const Mc=()=>({type:Za,ids:Oc().reduce(((e,t)=>{const n=t.split("_");return n[0]===Kn&&n[1]===qn&&e.push(n[2]),e}),[])}),Nc=(e,t)=>(n,r)=>{n({type:qa,id:e,collapsed:t}),((e,t,n)=>{const r=n.map((n=>`${e}_${t}_${n}`)),o=Oc().filter((n=>-1===n.indexOf(`${e}_${t}`))),i=new Set([...o,...r]);wr(Pn,JSON.stringify([...i]))})(Kn,qn,Object.entries(r().collapsedThreads).reduce(((e,[t,n])=>(n&&e.push(t),e)),[]))},Cc=e=>t=>{const n=t.collapsedThreads[e.id];return null!=n?n:(e.score||0)<=er.config.critical_score};let Tc,xc;function Pc(){return xc&&Tc||(Tc=new WeakMap,xc=new window.IntersectionObserver((e=>{e.forEach((e=>{const t=Tc.get(e.target);t&&t(e.isIntersecting)}))}),{rootMargin:"50px"})),{observer:xc,instanceMap:Tc}}function Ac({children:e}){const[t,n]=(0,_n.useState)(!1),r=(0,_n.useRef)(null);return(0,_n.useEffect)((()=>{const e=r.current,{observer:t,instanceMap:o}=Pc();if((null==e?void 0:e.base)instanceof Element)return t.observe(e.base),o.set(e.base,n),()=>{e.base instanceof Element&&(t.unobserve(e.base),o.delete(e.base))}}),[]),e({inView:t,ref:r})}function Lc(){return Lc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lc.apply(this,arguments)}function Rc(e){var{size:t=12}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["size"]);return(0,i.h)("svg",Lc({xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 16 16"},n),(0,i.h)("path",{fill:"currentColor",d:"m5.823 14.822-1.28.206a.824.824 0 0 1-.9-.52l-.463-1.212a.824.824 0 0 0-.476-.476l-1.212-.462a.824.824 0 0 1-.52-.9l.206-1.281a.824.824 0 0 0-.175-.65L.185 8.52a.824.824 0 0 1 0-1.04l.818-1.006a.824.824 0 0 0 .175-.65L.972 4.542a.824.824 0 0 1 .52-.9l1.212-.463a.824.824 0 0 0 .476-.476l.462-1.212a.824.824 0 0 1 .9-.52l1.281.206a.824.824 0 0 0 .65-.175L7.48.185a.824.824 0 0 1 1.04 0l1.006.818a.824.824 0 0 0 .65.175l1.281-.206a.824.824 0 0 1 .9.52l.463 1.212c.084.22.257.392.476.476l1.212.462c.365.14.582.515.52.9l-.206 1.281a.824.824 0 0 0 .175.65l.818 1.007a.824.824 0 0 1 0 1.04l-.818 1.006a.824.824 0 0 0-.175.65l.206 1.281a.824.824 0 0 1-.52.9l-1.212.463a.824.824 0 0 0-.476.476l-.462 1.212a.824.824 0 0 1-.9.52l-1.281-.206a.824.824 0 0 0-.65.175l-1.007.818a.824.824 0 0 1-1.04 0l-1.006-.818a.824.824 0 0 0-.65-.175z"}),(0,i.h)("path",{fill:"none",stroke:"#fff","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round",d:"M4.755 8.252 7 10.5l4.495-4.495"}))}const jc={id:"comment.block",defaultMessage:"Block"},Ic={id:"blockingDuration.permanently",defaultMessage:"Permanently"},Bc={id:"blockingDuration.month",defaultMessage:"For a month"},Hc={id:"blockingDuration.week",defaultMessage:"For a week"},Uc={id:"blockingDuration.day",defaultMessage:"For a day"};function Dc(e){return[{label:e.formatMessage(jc),value:void 0},{label:e.formatMessage(Ic),value:"permanently"},{label:e.formatMessage(Bc),value:"43200m"},{label:e.formatMessage(Hc),value:"10080m"},{label:e.formatMessage(Uc),value:"1440m"}]}const Fc={root:"K_A",rootDisabled:"K_B",voteButton:"K_C",upVoteButton:"K_D",upVoteButtonActive:"K_E",downVoteButton:"K_F",downVoteButtonActive:"K_G",votes:"K_H",votesNegative:"K_I",votesPositive:"K_J",upVoteIcon:"K_K",errorMessage:"K_L"},$c={root:"O_A",tooltip:"O_B",rootVisible:"O_C",tooltipPermanent:"O_D",permanent:"O_E","top-left":"O_F","top-right":"O_G"};function Gc({className:e,children:t,content:n,permanent:r,hideBehavior:o,hideTimeout:s,position:a,onHide:l}){return(0,_n.useEffect)((()=>{n&&s&&l&&setTimeout(l,s)}),[n,s,l]),(0,i.h)("div",{className:Tn($c.root,e)},n&&(0,i.h)("div",{role:"tooltip",className:Tn($c.tooltip,r&&$c.tooltipPermanent,$c[a]),onMouseLeave:"mouseleave"===o?l:void 0},n),t)}function zc({id:e,votes:t,vote:n,disabled:r}){var o;const s=wn(),a=B(),[l,c]=(0,_n.useState)(null),[u,h]=(0,_n.useState)(void 0);function d(r){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const{value:o}=r.currentTarget.dataset,i=Number(o);c({vote:n+i,votes:t+i});try{const t=yield(({id:e,vote:t})=>or.put(`/vote/${e}`,{url:qn,vote:t}))({id:e,vote:i});a((l=Object.assign(Object.assign({},t),{vote:n+i}),{type:Dr,patch:l})),h(void 0),setTimeout((()=>c(null)),200)}catch(e){h(Jn(e,s)),c(null)}var l}))}const f=1===n,m=-1===n,p=null!==(o=null==l?void 0:l.votes)&&void 0!==o?o:t,g=er.config.positive_score&&p>-1;return(0,i.h)("span",{className:Tn(Fc.root,r&&Fc.rootDisabled)},Boolean(!r)&&(0,i.h)("button",{className:Tn(Fc.voteButton,Fc.downVoteButton,m&&Fc.downVoteButtonActive),onClick:d,"data-value":-1,title:s.formatMessage(Vc.downvote),disabled:null!==l||m||g},(0,i.h)(pi,{className:Fc.downVoteIcon})),(0,i.h)(Gc,{content:u?(0,i.h)("div",{class:Fc.errorMessage},u):void 0,position:"top-left",hideBehavior:"mouseleave",hideTimeout:1e4,permanent:!0,onHide:()=>{h(void 0)}},(0,i.h)("div",{title:s.formatMessage(Vc.score),className:Tn(Fc.votes,{[Fc.votesNegative]:t<0,[Fc.votesPositive]:t>0})},p)),!r&&(0,i.h)("button",{className:Tn(Fc.voteButton,Fc.upVoteButton,f&&Fc.upVoteButtonActive),onClick:d,"data-value":1,title:s.formatMessage(Vc.upvote),disabled:null!==l||f},(0,i.h)(pi,{className:Fc.upVoteIcon})))}const Vc={score:{id:"vote.score",defaultMessage:"Votes score"},upvote:{id:"vote.upvote",defaultMessage:"Vote up"},downvote:{id:"vote.downvote",defaultMessage:"Vote down"},controversy:{id:"vote.controversy",defaultMessage:"Controversy: {value}"}};function Wc({timestamp:e=0,onTimePassed:t}){const[n,r]=(0,_n.useState)(Kc(e)),o=(0,_n.useRef)();return(0,_n.useEffect)((()=>{if(!e)return;const t=window.setInterval((()=>r(Kc(e||0))),1e3);return o.current=t,r(Kc(e||0)),()=>{window.clearInterval(t)}}),[e]),(0,_n.useEffect)((()=>{0===n&&(null==t||t(),window.clearInterval(o.current))}),[n,t]),e?(0,i.h)(i.Fragment,null,n,"s"):null}function Kc(e){return Math.ceil(Math.max(0,(e-Date.now())/1e3))}function Zc({admin:e,pinned:t,copied:n,readOnly:r,editable:o,editing:s,replying:a,currentUser:l,bannedUser:c,editDeadline:u,onCopy:h,onToggleEditing:d,onDelete:f,onTogglePin:m,onToggleReplying:p,onDisableEditing:g,onHideUser:v,onBlockUser:_,onUnblockUser:b}){const y=wn(),w=(0,i.h)(fo,{kind:"link",size:"sm",onClick:f},y.formatMessage(qc.delete));return(0,i.h)("div",{className:Tn("comment-actions","J_A")},!r&&(0,i.h)(fo,{kind:"link",size:"sm",onClick:p},y.formatMessage(a?qc.cancel:qc.reply)),o&&u&&(0,i.h)(i.Fragment,null,(0,i.h)(fo,{kind:"link",size:"sm",onClick:d},y.formatMessage(s?qc.cancel:qc.edit)),(0,i.h)("span",{role:"timer",title:y.formatMessage(qc.editCountdown),className:Tn("comment-actions-countdown","J_C")},(0,i.h)(Wc,{timestamp:u,onTimePassed:g}))),(0,i.h)("div",{className:Tn("comment-actions-additional","J_B")},!l&&(0,i.h)(fo,{kind:"link",size:"sm",onClick:v},y.formatMessage(qc.hide)),e&&(0,i.h)(i.Fragment,null,(0,i.h)(fo,{kind:"link",size:"sm",onClick:h,disabled:n},y.formatMessage(n?qc.copied:qc.copy)),(0,i.h)(fo,{kind:"link",size:"sm",onClick:m},y.formatMessage(t?qc.unpin:qc.pin)),c?(0,i.h)(fo,{kind:"link",size:"sm",onClick:b},y.formatMessage(qc.unblock)):(0,i.h)(ol,{title:y.formatMessage(qc.blockingPeriod),size:"sm",items:Dc(y),onChange:e=>_(e.currentTarget.value)})),(l&&void 0!==u||e)&&w))}const qc={unblock:{id:"comment.unblock",defaultMessage:"Unblock"},pin:{id:"comment.pin",defaultMessage:"Pin"},unpin:{id:"comment.unpin",defaultMessage:"Unpin"},hide:{id:"comment.hide",defaultMessage:"Hide"},cancel:{id:"comment.cancel",defaultMessage:"Cancel"},edit:{id:"comment.edit",defaultMessage:"Edit"},reply:{id:"comment.reply",defaultMessage:"Reply"},delete:{id:"comment.delete",defaultMessage:"Delete"},editCountdown:{id:"comment.edit-countdown",defaultMessage:"Edit will be disabled"},copied:{id:"comment.copied",defaultMessage:"Copied!"},copy:{id:"comment.copy",defaultMessage:"Copy"},blockingPeriod:{id:"comment.blocking-period",defaultMessage:"Blocking period"}};var Xc=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};class Yc extends i.Component{constructor(){super(...arguments),this.textNode=(0,i.createRef)(),this.isAdmin=()=>{var e;return Boolean(null===(e=this.props.user)||void 0===e?void 0:e.admin)},this.isGuest=()=>null===this.props.user,this.isAnonymous=()=>al(this.props.user),this.isCurrentUser=()=>{var e;return!this.isGuest()&&this.props.data.user.id===(null===(e=this.props.user)||void 0===e?void 0:e.id)},this.updateState=e=>{const t={};if(e.inView&&(t.renderDummy=!1),this.isCurrentUser()){const n=er.config.edit_duration,r=er.serverClientTimeDiff||0,o=new Date(e.data.time).getTime()+r+1e3*n;t.editDeadline=o>Date.now()?o:void 0}return t},this.state=Object.assign({renderDummy:"boolean"==typeof this.props.inView&&!this.props.inView,isCopied:!1,editDeadline:void 0,voteErrorMessage:null,initial:!0},this.updateState(this.props)),this.toggleReplying=()=>{const{editMode:e,setReplyEditState:t,data:n}=this.props;null==t||t({id:n.id,state:e===Rr.Reply?Rr.None:Rr.Reply})},this.toggleEditing=()=>{const{editMode:e,setReplyEditState:t,data:n}=this.props;null==t||t({id:n.id,state:e===Rr.Edit?Rr.None:Rr.Edit})},this.toggleUserInfoVisibility=()=>{var e;const t=Object.assign({},this.props.data.user);(null===(e=this.props.user)||void 0===e?void 0:e.id)===t.id&&(t.current="1"),fn({profile:t})},this.togglePin=()=>{const e=!this.props.data.pin,t=this.props.intl,n=e?t.formatMessage(eu.pinComment):t.formatMessage(eu.unpinComment);window.confirm(n)&&this.props.setPinState(this.props.data.id,e)},this.toggleVerify=()=>{const e=!this.props.data.user.verified,t=this.props.data.user.id,n=this.props.intl,r=this.props.data.user.name,o=n.formatMessage(e?eu.verifyUser:eu.unverifyUser,{userName:r});window.confirm(o)&&this.props.setVerifiedStatus(t,e)},this.blockUser=function(e,t=1e3){let n;return function(...r){window.clearTimeout(n),n=window.setTimeout((()=>e.apply(this,r)),t)}}((e=>{const{user:t}=this.props.data,n=Dc(this.props.intl).find((t=>t.value===e));if(!n)return;const r=n.label,o=this.props.intl.formatMessage(eu.blockUser,{userName:t.name,duration:r.toLowerCase()});window.confirm(o)&&this.props.blockUser(t.id,t.name,e)}),100),this.unblockUser=()=>{const{user:e}=this.props.data,t=this.props.intl.formatMessage(eu.unblockUser);window.confirm(t)&&this.props.unblockUser(e.id)},this.deleteComment=()=>{const e=this.props.intl.formatMessage(eu.deleteMessage);window.confirm(e)&&(this.props.setReplyEditState({id:this.props.data.id,state:Rr.None}),this.props.removeComment(this.props.data.id))},this.hideUser=()=>{const e=this.props.intl.formatMessage(eu.hideUserComments,{userName:this.props.data.user.name});window.confirm(e)&&this.props.hideUser(this.props.data.user)},this.addComment=(e,t,n)=>Xc(this,void 0,void 0,(function*(){yield this.props.addComment(e,t,n),this.props.setReplyEditState({id:this.props.data.id,state:Rr.None})})),this.updateComment=(e,t)=>Xc(this,void 0,void 0,(function*(){yield this.props.updateComment(e,t),this.props.setReplyEditState({id:this.props.data.id,state:Rr.None})})),this.scrollToParent=e=>{const{pid:t}=this.props.data,n=document.getElementById(`remark42__comment-${t}`);e.preventDefault(),n&&(fn({scrollTo:n.getBoundingClientRect().top})||n.scrollIntoView())},this.copyComment=()=>Xc(this,void 0,void 0,(function*(){var e,t;const{name:n}=this.props.data.user,r=Qc(this.props.intl,new Date(this.props.data.time)),o=null!==(t=null===(e=this.textNode.current)||void 0===e?void 0:e.textContent)&&void 0!==t?t:"";try{yield function(e){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){if("clipboard"in window.navigator){const t=new Blob([e],{type:"text/plain"});return navigator.clipboard.write([new ClipboardItem({[t.type]:t})])}const t=document.createElement("div"),n=document.activeElement;t.innerHTML=e,Object.assign(t.style,{contain:"strict",position:"absolute",left:"-9999px",fontSize:"12pt"}),document.body.appendChild(t);const r=window.getSelection(),o=r&&r.rangeCount>0?r.getRangeAt(0):null,i=document.createRange();i.selectNodeContents(t),r&&(r.removeAllRanges(),r.addRange(i));let s=!1;try{s=document.execCommand("copy")}catch(e){}return r&&r.removeAllRanges(),document.body.removeChild(t),o&&r&&r.addRange(o),n&&n.focus(),s?Promise.resolve():Promise.reject()}))}(`${n} ${r}\n${o}`)}catch(e){console.log(e)}this.setState({isCopied:!0},(()=>{setTimeout((()=>this.setState({isCopied:!1})),3e3)}))}))}componentWillReceiveProps(e){this.setState(this.updateState(e))}componentDidMount(){this.setState({initial:!1})}get isVotesDisabled(){var e;return!!window.remark_config.hide_votes||"main"!==this.props.view||(null===(e=this.props.post_info)||void 0===e?void 0:e.read_only)||this.props.data.delete||this.isCurrentUser()||this.isGuest()||!er.config.anon_vote&&this.isAnonymous()}render(e,t){var n;const r=this.isAdmin(),o=this.isGuest(),a=this.isCurrentUser(),l=e.editMode===Rr.Reply,c=e.editMode===Rr.Edit,u=this.isAnonymous()?void 0:this.props.uploadImage,h=e.intl,d=this.props.CommentForm||null,f=Object.assign(Object.assign({},e.data),{text:"preview"===e.view?Jc(e.data.text):e.data.delete?h.formatMessage(eu.deletedComment):e.data.text,time:new Date(e.data.time),orig:c?e.data.orig&&e.data.orig.replace(/&[#A-Za-z0-9]+;/gi,(e=>{const t=document.createElement("span");return t.innerHTML=e,t.innerText})):e.data.orig,user:e.data.user}),m={disabled:e.disabled,pinned:e.data.pin,useless:!!e.isUserBanned||!!e.data.delete||"preview"!==e.view&&e.data.score<er.config.low_score&&!e.data.pin&&!e.disabled,guest:o,view:"main"===e.view||"pinned"===e.view?e.data.user.admin&&"admin":e.view,replying:"main"===e.view&&l,editing:"main"===e.view&&c,theme:"preview"===e.view?void 0:e.theme,level:e.level,collapsed:e.collapsed};if("preview"===e.view)return(0,i.h)("article",{className:yn()("comment",{mix:e.mix},m)},(0,i.h)("div",{className:"comment__body"},!!f.title&&(0,i.h)("div",{className:"comment__title"},(0,i.h)("a",{className:"comment__title-link",href:`${f.locator.url}#remark42__comment-${f.id}`},f.title)),(0,i.h)("div",{className:"comment__info"},!!f.title&&f.user.name,!f.title&&(0,i.h)("a",{href:`${f.locator.url}#remark42__comment-${f.id}`,className:"comment__username"},f.user.name))," ",(0,i.h)("div",{className:"comment__text raw-content",dangerouslySetInnerHTML:{__html:f.text}})));if(this.state.renderDummy&&!e.editMode){const[t,n]=this.base?[this.base.scrollWidth,this.base.scrollHeight]:[100,100];return(0,i.h)("article",{id:e.disabled?void 0:`remark42__comment-${f.id}`,style:{width:`${t}px`,height:`${n}px`}})}const p=h.formatMessage(eu.goToParent);return(0,i.h)("article",{className:yn()("comment",{mix:this.props.mix},m),id:e.disabled?void 0:`remark42__comment-${f.id}`},"user"===e.view&&f.title&&(0,i.h)("div",{className:"comment__title"},(0,i.h)("a",{className:"comment__title-link",href:`${f.locator.url}#remark42__comment-${f.id}`},f.title)),(0,i.h)("div",{className:"comment__info"},"user"!==e.view&&!e.collapsed&&(0,i.h)("div",{className:"comment__avatar"},(0,i.h)(Ei,{url:f.user.picture})),(0,i.h)("div",{className:"G_A"},"user"!==e.view&&(0,i.h)("button",{onClick:()=>this.toggleUserInfoVisibility(),className:"comment__username"},f.user.name),r&&"user"!==e.view&&(0,i.h)("button",{className:"G_B",onClick:this.toggleVerify,title:h.formatMessage(eu.toggleVerification)},(0,i.h)(Rc,{title:h.formatMessage(f.user.verified?eu.verifiedUser:eu.unverifiedUser),className:Tn("G_C",!f.user.verified&&"G_D")})),!r&&f.user.verified&&"user"!==e.view&&(0,i.h)(Rc,{className:"G_C",title:h.formatMessage(eu.verifiedUser)}),f.user.paid_sub&&(0,i.h)("img",{width:12,height:12,src:s(8932).Z,alt:h.formatMessage(eu.paidPatreon)})),(0,i.h)("a",{href:`${f.locator.url}#remark42__comment-${f.id}`,className:"comment__time"},Qc(this.props.intl,f.time)),!!e.level&&e.level>0&&"main"===e.view&&(0,i.h)("a",{className:"G_E",href:`${f.locator.url}#remark42__comment-${f.pid}`,title:p,onClick:e=>this.scrollToParent(e)},(0,i.h)("svg",{width:"7",height:"11",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 7 11","aria-hidden":!0},(0,i.h)("path",{fill:"currentColor",d:"M.815 5.905L2.915 4v7H4.08V4l2.105 1.905.815-.74-3.5-3.17L0 5.165l.815.74zM0 1.045h7V0H0v1.045z"}))),e.isUserBanned&&"user"!==e.view&&(0,i.h)("span",{className:"comment__status"},(0,i.h)(Nn,{id:"comment.blocked-user",defaultMessage:"Blocked"})),r&&!e.isUserBanned&&e.data.delete&&(0,i.h)("span",{className:"comment__status"},(0,i.h)(Nn,{id:"comment.deleted-user",defaultMessage:"Deleted"})),"pinned"!==this.props.view&&(0,i.h)(zc,{id:this.props.data.id,vote:e.data.vote,votes:e.data.score,controversy:e.data.controversy,disabled:this.isVotesDisabled})),(0,i.h)("div",{className:"comment__body"},(!e.collapsed||"pinned"===e.view)&&(0,i.h)("div",{className:"comment__text raw-content",ref:this.textNode,dangerouslySetInnerHTML:{__html:f.text}}),(!e.collapsed||!this.props.data.delete)&&"pinned"!==e.view&&(0,i.h)(Zc,{admin:r,pinned:e.data.pin,copied:t.isCopied,editing:c,replying:l,editable:0===e.repliesCount&&void 0!==t.editDeadline,editDeadline:t.editDeadline,readOnly:null===(n=e.post_info)||void 0===n?void 0:n.read_only,onToggleReplying:this.toggleReplying,onDisableEditing:()=>this.setState({editDeadline:void 0}),currentUser:a,bannedUser:e.isUserBanned,onCopy:this.copyComment,onTogglePin:this.togglePin,onToggleEditing:this.toggleEditing,onDelete:this.deleteComment,onHideUser:this.hideUser,onBlockUser:this.blockUser,onUnblockUser:this.unblockUser})),d&&l&&"main"===e.view&&(0,i.h)(d,{id:f.id,intl:this.props.intl,user:e.user,theme:e.theme,mode:"reply",mix:"comment__input",onSubmit:(e,t)=>this.addComment(e,t,f.id),onCancel:this.toggleReplying,getPreview:this.props.getPreview,autofocus:!0,uploadImage:u}),d&&c&&"main"===e.view&&(0,i.h)(d,{id:f.id,intl:this.props.intl,user:e.user,theme:e.theme,value:f.orig,mode:"edit",mix:"comment__input",onSubmit:t=>this.updateComment(e.data.id,t),onCancel:this.toggleEditing,getPreview:this.props.getPreview,errorMessage:void 0===t.editDeadline?h.formatMessage(eu.expiredTime):void 0,autofocus:!0,uploadImage:u}))}}function Jc(e){const t=document.createElement("div");t.innerHTML=e.replace("</p><p>"," ");const n=t.innerText||"",r=n.substring(0,100);return 100===r.length&&100!==n.length?`${r}...`:r}function Qc(e,t){return e.formatMessage(eu.commentTime,{day:e.formatDate(t),time:e.formatTime(t)})}const eu={deleteMessage:{id:"comment.delete-message",defaultMessage:"Do you want to delete this comment?"},hideUserComments:{id:"comment.hide-user-comment",defaultMessage:"Do you want to hide comments of {userName}?"},pinComment:{id:"comment.pin-comment",defaultMessage:"Do you want to pin this comment?"},unpinComment:{id:"comment.unpin-comment",defaultMessage:"Do you want to unpin this comment?"},verifyUser:{id:"comment.verify-user",defaultMessage:"Do you want to verify {userName}?"},unverifyUser:{id:"comment.unverify-user",defaultMessage:"Do you want to unverify {userName}?"},blockUser:{id:"comment.block-user",defaultMessage:"Do you want to block {userName} {duration}?"},unblockUser:{id:"comment.unblock-user",defaultMessage:"Do you want to unblock this user?"},deletedComment:{id:"comment.deleted-comment",defaultMessage:"This comment was deleted"},toggleVerification:{id:"comment.toggle-verification",defaultMessage:"Toggle verification"},verifiedUser:{id:"comment.verified-user",defaultMessage:"Verified user"},unverifiedUser:{id:"comment.unverified-user",defaultMessage:"Unverified user"},goToParent:{id:"comment.go-to-parent",defaultMessage:"Go to parent comment"},expiredTime:{id:"comment.expired-time",defaultMessage:"Editing time has expired."},commentTime:{id:"comment.time",defaultMessage:"{day} at {time}"},paidPatreon:{id:"comment.paid-patreon",defaultMessage:"Patreon Paid Subscriber"}},tu=e=>{const t=B();return(0,_n.useMemo)((()=>Object.entries(e).reduce(((e,[n,r])=>(e[n]=(...e)=>t(r(...e)),e)),{})),[t,...Object.values(e)])};function nu(){return nu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nu.apply(this,arguments)}const ru={addComment:Xr,updateComment:Jr,removeComment:e=>(t,n)=>qr(void 0,void 0,void 0,(function*(){const r=n().user;if(!r)return;r.admin?yield(e=>sr.delete(`/comment/${e}`,{url:qn}))(e):yield(e=>or.put(`/comment/${e}`,{url:qn},{delete:!0}))(e);let o=n().comments.allComments[e];o=Object.assign(Object.assign({},o),{delete:!0,edit:{summary:"",time:(new Date).toISOString()}}),t(Yr(o))})),setReplyEditState:e=>t=>{null!==e&&e.state===Rr.None&&(e=null),t(eo(e))},setPinState:(e,t)=>(n,r)=>qr(void 0,void 0,void 0,(function*(){t?yield(e=>sr.put(`/pin/${e}`,{url:qn,pin:1}))(e):yield(e=>sr.put(`/pin/${e}`,{url:qn,pin:0}))(e);let o=r().comments.allComments[e];o=Object.assign(Object.assign({},o),{pin:t,edit:{summary:"",time:(new Date).toISOString()}}),n(Yr(o))})),blockUser:io,unblockUser:so,hideUser:lo,setVerifiedStatus:(e,t)=>(n,r)=>ro(void 0,void 0,void 0,(function*(){t?yield(e=>sr.put(`/verify/${e}`,{verified:1}))(e):yield(e=>sr.put(`/verify/${e}`,{verified:0}))(e);const o=Object.values(r().comments.allComments).filter((t=>t.user.id===e));if(!o.length)return;const i=o[0].user;n({type:zr,ids:o.map((e=>e.id)),patch:{user:Object.assign(Object.assign({},i),{verified:t})}})}))},ou=e=>{const t=tl((t=>{return{editMode:(n=e.data.id,e=>null===e.comments.activeComment||e.comments.activeComment.id!==n?Rr.None:e.comments.activeComment.state)(t),user:t.user,isUserBanned:e.data.user.block||void 0!==t.bannedUsers.find((t=>t.id===e.data.user.id)),post_info:t.info,isCommentsDisabled:t.info.read_only||!1,theme:t.theme,collapsed:Cc(e.data)(t),getPreview:ar,uploadImage:cr};var n})),n=tu(ru),r=wn();return(0,i.h)(Yc,nu({},e,t,n,{intl:r}))};function iu(){return iu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},iu.apply(this,arguments)}const su=({id:e,level:t,mix:n,getPreview:r})=>{const o=el(),s=wn(),{collapsed:a,comment:l,childs:c,theme:u}=tl((e=>t=>{const{theme:n,comments:r}=t,{allComments:o,childComments:i}=r,s=o[e];return{comment:s,childs:i[e],collapsed:Cc(s)(t),theme:n}})(e),U),h=(0,_n.useCallback)((()=>{o(Nc(e,!a))}),[e,a,o]);if(l.hidden)return null;const d=t>0,f=c?c.length:0;return(0,i.h)("div",{className:yn()("thread",{mix:n},{level:t,theme:u,indented:d}),role:["listitem"].concat(!a&&f?"list":[]).join(" "),"aria-expanded":!a},(0,i.h)(Ac,null,(n=>(0,i.h)(ou,{CommentForm:Sc,ref:n.ref,key:`comment-${e}`,view:"main",intl:s,data:l,repliesCount:f,level:t,inView:n.inView}))),!a&&c&&!!c.length&&c.map((e=>(0,i.h)(su,{key:`thread-${e}`,id:e,level:Math.min(t+1,6),getPreview:r}))),t<6&&(0,i.h)("div",iu({className:yn()("thread__collapse",{mods:{collapsed:a}})},po(h)),(0,i.h)("div",null)))};function au(){return au=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},au.apply(this,arguments)}var lu=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};const cu=e=>({sort:e.comments.sort,isCommentsLoading:e.comments.isFetching,user:e.user,childToParentComments:Object.entries(e.comments.childComments).reduce(((e,[t,n])=>(n.forEach((n=>e[n]=t)),e)),{}),collapsedThreads:e.collapsedThreads,topComments:e.comments.topComments,pinnedComments:e.comments.pinnedComments.map((t=>e.comments.allComments[t])).filter((e=>!e.hidden)),theme:e.theme,info:e.info,hiddenUsers:e.hiddenUsers,blockedUsers:e.bannedUsers,getPreview:ar,uploadImage:cr}),uu={fetchComments:Qr,fetchUser:()=>e=>ro(void 0,void 0,void 0,(function*(){const t=yield lr();return e(oo(t)),t})),fetchBlockedUsers:()=>e=>ro(void 0,void 0,void 0,(function*(){const t=(yield sr.get("/blocked"))||[];return e({type:Cr,list:t}),t})),setTheme:e=>t=>t({type:co,theme:e}),setCommentsReadOnlyState:function(e){return(t,n)=>function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const{info:r}=n();yield e?sr.put("/readonly",{url:qn,ro:1}):sr.put("/readonly",{url:qn,ro:0}),t(eo()),t(Ir(Object.assign(Object.assign({},r),{read_only:e})))}))},blockUser:io,unblockUser:so,hideUser:lo,unhideUser:e=>(t,n)=>{const r=Mr();Object.prototype.hasOwnProperty.call(r,e)&&delete r[e],wr(Ln,JSON.stringify(r)),t({type:Lr,id:e})},addComment:Xr,updateComment:Jr,setCollapse:Nc,signout:function(e=!0){return t=>ro(this,void 0,void 0,(function*(){e&&(yield vr()),wr(jn,""),t(oo()),t(eo()),t(Qr())}))}},hu={id:"root.pinned-comments",defaultMessage:"Pinned comments"};class du extends i.Component{constructor(){super(...arguments),this.state={isUserLoading:!0,commentsShown:Gn,wasSomeoneUnblocked:!1,isSettingsVisible:!1},this.checkUrlHash=e=>{const t=e?`#${e.newURL.split("#")[1]}`:window.location.hash;if(0===t.indexOf("#remark42__comment-"))if(e&&e.preventDefault(),document.querySelector(t))this.toMessage(t);else{const e=((e,t)=>{let n=e.replace("#remark42__comment-","");for(;t[n];)n=t[n];return n})(t,this.props.childToParentComments),n=this.props.topComments.findIndex((t=>t===e)),r=Math.ceil(n/10);this.setState({commentsShown:this.state.commentsShown+10*r},(()=>setTimeout((()=>this.toMessage(t)),500)))}},this.toMessage=e=>{const t=document.querySelector(e);t&&(fn({scrollTo:t.getBoundingClientRect().top}),t.classList.add("comment_highlighting"),setTimeout((()=>{t.classList.remove("comment_highlighting")}),5e3))},this.onMessage=e=>{const t=mn(e);!0===t.signout&&this.props.signout(!1),t.theme&&In.includes(t.theme)&&this.props.setTheme(t.theme)},this.onBlockedUsersShow=()=>lu(this,void 0,void 0,(function*(){this.props.user&&this.props.user.admin&&(yield this.props.fetchBlockedUsers()),this.setState({isSettingsVisible:!0})})),this.onBlockedUsersHide=()=>lu(this,void 0,void 0,(function*(){this.state.wasSomeoneUnblocked&&this.props.fetchComments(),this.setState({wasSomeoneUnblocked:!1,isSettingsVisible:!1})})),this.onUnblockSomeone=()=>{this.setState({wasSomeoneUnblocked:!0})},this.showMore=()=>{this.setState({commentsShown:this.state.commentsShown+10})}}componentDidMount(){const e=this.props.fetchUser().finally((()=>this.setState({isUserLoading:!1})));Promise.all([e,this.props.fetchComments()]).finally((()=>{setTimeout(this.checkUrlHash),window.addEventListener("hashchange",this.checkUrlHash)})),window.addEventListener("message",this.onMessage)}render(e,{isUserLoading:t,commentsShown:n,isSettingsVisible:r}){if(t)return(0,i.h)(mo,{className:"root__preloader"});const o=e.info.read_only,s=al(this.props.user)?void 0:this.props.uploadImage;return(0,i.h)(i.Fragment,null,(0,i.h)(Ti,{user:this.props.user,hiddenUsers:this.props.hiddenUsers,isCommentsDisabled:o,postInfo:this.props.info,signout:this.props.signout,onBlockedUsersShow:this.onBlockedUsersShow,onBlockedUsersHide:this.onBlockedUsersHide,onCommentsChangeReadOnlyMode:this.props.setCommentsReadOnlyState}),(0,i.h)("div",{className:"root__main"},r?(0,i.h)(So,{intl:this.props.intl,user:this.props.user,hiddenUsers:this.props.hiddenUsers,blockedUsers:this.props.blockedUsers,blockUser:this.props.blockUser,unblockUser:this.props.unblockUser,hideUser:this.props.hideUser,unhideUser:this.props.unhideUser,onUnblockSomeone:this.onUnblockSomeone}):(0,i.h)(i.Fragment,null,!o&&(0,i.h)(Sc,{id:encodeURI(qn||""),intl:this.props.intl,theme:e.theme,mix:"root__input",mode:"main",user:e.user,onSubmit:(e,t)=>this.props.addComment(e,t),getPreview:this.props.getPreview,uploadImage:s}),this.props.pinnedComments.length>0&&(0,i.h)("div",{className:"root__pinned-comments",role:"region","aria-label":this.props.intl.formatMessage(hu)},this.props.pinnedComments.map((e=>(0,i.h)(ou,{CommentForm:Sc,intl:this.props.intl,key:`pinned-comment-${e.id}`,view:"pinned",data:e,level:0,disabled:!0,mix:"root__pinned-comment"})))),(0,i.h)("div",{className:Tn("sort-picker","B_A")},(0,i.h)(il,null)),(0,i.h)(fu,{commentsShown:n,isLoading:e.isCommentsLoading,topComments:e.topComments,showMore:this.showMore}))))}}function fu({isLoading:e,topComments:t,commentsShown:n,showMore:r}){const o=Bn&&n<t.length?t.slice(0,n):t,s=Bn&&n<t.length;return(0,i.h)("div",{className:"root__threads",role:"list"},e?(0,i.h)(mo,{className:"root__preloader"}):(0,i.h)(i.Fragment,null,t.length>0&&o.map((e=>(0,i.h)(su,{key:`thread-${e}`,id:e,mix:"root__thread",level:0,getPreview:ar}))),s&&(0,i.h)(fo,{className:Tn("more-comments","B_B"),onClick:r},(0,i.h)(Nn,{id:"root.show-more",defaultMessage:"Show more"}))))}function mu(){const e=wn(),t=T(cu),n=tu(uu);return(0,_n.useEffect)((()=>{const e=new ResizeObserver((()=>pn()));return pn(),e.observe(document.body),()=>e.disconnect()}),[]),(0,i.h)("div",{className:Tn(yn()("root",{},{theme:t.theme}),t.theme)},(0,i.h)(du,au({},t,n,{intl:e})))}function pu(){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){const e=yield or.post("/deleteme"),t=er.config.admin_email,{subject:n,message:r}=function(e,t,n){return{subject:encodeURIComponent("Request to delete user's information"),message:encodeURIComponent(`Request to delete all information about ${e} from remark42 on ${t}\n\n[you can provide the reason for removal request, optional]\n\n=== DO NOT REMOVE THE TEXT BELOW THIS LINE ===\n\nsite: ${t}\nuser: ${e}\nlink: ${n}\n`).replace("%0A","%0D%0A")}}(e.user_id,Kn,e.link);window.location.href=`mailto:${t}?subject=${n}&body=${r}`}))}function gu(e,t={}){Object.entries(t).forEach((([t,n])=>{e.style[t]=`${n}`}))}const vu=({children:e})=>(0,i.h)("div",{className:"I_A"},e);var _u=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))};function bu(){return _u(this,void 0,void 0,(function*(){fn({profile:null,signout:!0}),yield vr()}))}function yu(){const e=wn(),t=(0,_n.useRef)(null),n=(0,_n.useMemo)((()=>Dn()),[]),[r,o]=(0,_n.useState)(!1),[s,a]=(0,_n.useState)(!1),[l,c]=(0,_n.useState)(null),[u,h]=(0,_n.useState)(0),d=(0,_n.useRef)(0),[f,m]=(0,_n.useState)(!1),p=(0,_n.useCallback)((()=>_u(this,void 0,void 0,(function*(){o(!0),a(!1);try{const{comments:e,count:t}=yield((e,t={limit:10,skip:0})=>or.get("/comments",Object.assign({user:e},t)))(n.id,{skip:d.current,limit:10});d.current+=10,c((t=>[...t||[],...e])),h(t)}catch(e){a(!0)}finally{o(!1)}}))),[]);if((0,_n.useEffect)((()=>{p()}),[p]),(0,_n.useEffect)((()=>{const e={height:"100%",padding:0};function t(e){"Escape"===e.code&&fn({profile:null})}return gu(document.documentElement,e),gu(document.body,e),document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}}),[]),(0,_n.useEffect)((()=>{t.current&&t.current.classList.add("A_B")}),[]),!n.id)return null;const g=u>d.current,v="1"===n.current,_=(null==l?void 0:l.length)?(0,i.h)(i.Fragment,null,(0,i.h)("div",{className:"A_P"},(0,i.h)("h3",{className:Tn("profile-title","A_Q")},v?(0,i.h)(Nn,{key:"user.my-comments",id:"user.my-comments",defaultMessage:"My comments"}):(0,i.h)(Nn,{key:"user.comments",id:"user.comments",defaultMessage:"Comments"})),u>0&&(0,i.h)("div",{className:"A_R"},(0,i.h)(vu,null,u))),l.map((t=>(0,i.h)(Yc,{key:t.id,user:null,intl:e,data:t,level:0,view:"user",isCommentsDisabled:!1,theme:n.theme||"light"}))),g&&(0,i.h)("div",{className:"A_U"},r?(0,i.h)(fi,{color:"gray"}):(0,i.h)(fo,{kind:"link",size:"sm",onClick:p},(0,i.h)(Nn,{id:"user.load-more",defaultMessage:"Load more"})))):(0,i.h)("p",{className:Tn("profile-emptyState","A_S")},(0,i.h)(Nn,{id:"empty-state",defaultMessage:"Don't have comments yet"}));return(0,i.h)("div",{className:Tn("profile","A_A"),ref:t},(0,i.h)("div",{className:Tn("profile-close-button-wrapper","A_E"),onClick:function(){const e=t.current;e&&(e.classList.remove("A_B"),e.classList.add("A_C"),e.addEventListener("transitionend",(()=>{fn({profile:null})})))}},(0,i.h)(Mi,{title:e.formatMessage({id:"profile.close",defaultMessage:"Close profile"})},(0,i.h)(li,{size:"16"}))),(0,i.h)("aside",{className:Tn("profile-sidebar",v&&"profile_current","A_D")},(0,i.h)("header",{className:Tn("profile-header","A_F")},(0,i.h)("div",{className:Tn("profile-avatar","A_K")},(0,i.h)(Ei,{url:n.picture})),(0,i.h)("div",{className:Tn("profile-content","A_L")},(0,i.h)("div",{className:Tn("profile-title","A_M")},n.name),(0,i.h)("div",{className:Tn("profile-id","A_N")},n.id)),v&&(0,i.h)("button",{className:Tn("profile-signout","A_O"),title:e.formatMessage(di.signout),onClick:function(){return _u(this,void 0,void 0,(function*(){m(!0),yield bu(),null==m||m(!1)}))},disabled:f},f?(0,i.h)(fi,null):(0,i.h)(ki,null))),(0,i.h)("section",{className:Tn("profile-content","A_G")},s&&(0,i.h)("div",{className:"A_H"},(0,i.h)("p",{className:Tn("profile-error","A_I")},(0,i.h)(Nn,{id:"errors.0",defaultMessage:"Something went wrong. Please try again a bit later."})),(0,i.h)(fo,{kind:"link",size:"sm",onClick:p},(0,i.h)(Nn,{id:"retry",defaultMessage:"Retry"}))),null===l&&r&&(0,i.h)(mo,{className:"A_T"}),null!==l&&_),v&&!al(n)?(0,i.h)("footer",{className:Tn("profile-footer","A_J")},(0,i.h)(fo,{kind:"hollow",size:"sm",onClick:function(){return _u(this,void 0,void 0,(function*(){yield pu(),yield bu()}))}},(0,i.h)(Nn,{id:"profile.request-to-delete-data",defaultMessage:"Request my data removal"}))):null))}function wu(){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){s.p=`${xn}/web/`;const e=document.getElementById("remark42");if(!e)throw new Error("Remark42: Can't find root node.");const t=yield function(e){return function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function*(){return"ru"===e?s.e(697).then(s.t.bind(s,8205,19)).then((e=>e.default)).catch((()=>dn)):"de"===e?s.e(913).then(s.t.bind(s,9033,19)).then((e=>e.default)).catch((()=>dn)):"fi"===e?s.e(135).then(s.t.bind(s,7413,19)).then((e=>e.default)).catch((()=>dn)):"es"===e?s.e(352).then(s.t.bind(s,7721,19)).then((e=>e.default)).catch((()=>dn)):"zh"===e?s.e(922).then(s.t.bind(s,4171,19)).then((e=>e.default)).catch((()=>dn)):"tr"===e?s.e(300).then(s.t.bind(s,3766,19)).then((e=>e.default)).catch((()=>dn)):"bg"===e?s.e(372).then(s.t.bind(s,2861,19)).then((e=>e.default)).catch((()=>dn)):"ua"===e?s.e(220).then(s.t.bind(s,5276,19)).then((e=>e.default)).catch((()=>dn)):"pl"===e?s.e(640).then(s.t.bind(s,6315,19)).then((e=>e.default)).catch((()=>dn)):"vi"===e?s.e(936).then(s.t.bind(s,2948,19)).then((e=>e.default)).catch((()=>dn)):"be"===e?s.e(313).then(s.t.bind(s,9937,19)).then((e=>e.default)).catch((()=>dn)):"fr"===e?s.e(231).then(s.t.bind(s,1994,19)).then((e=>e.default)).catch((()=>dn)):"ja"===e?s.e(43).then(s.t.bind(s,9704,19)).then((e=>e.default)).catch((()=>dn)):"ko"===e?s.e(491).then(s.t.bind(s,2289,19)).then((e=>e.default)).catch((()=>dn)):"bp"===e?s.e(677).then(s.t.bind(s,1036,19)).then((e=>e.default)).catch((()=>dn)):"it"===e?s.e(928).then(s.t.bind(s,9575,19)).then((e=>e.default)).catch((()=>dn)):"ar"===e?s.e(850).then(s.t.bind(s,4383,19)).then((e=>e.default)).catch((()=>dn)):"zh-tw"===e?s.e(521).then(s.t.bind(s,3499,19)).then((e=>e.default)).catch((()=>dn)):"th"===e?s.e(929).then(s.t.bind(s,9158,19)).then((e=>e.default)).catch((()=>dn)):"cs"===e?s.e(993).then(s.t.bind(s,2404,19)).then((e=>e.default)).catch((()=>dn)):dn}))}(Xn).catch((()=>({}))),n=function(e,t){if("function"==typeof e)return g(e,t);if("object"!=typeof e||null===e)throw new Error(u(16));var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=g(o,t))}return n}({fetchHiddenUsers:ao,restoreCollapsedThreads:Mc},Qa.dispatch);e.innerHTML="",window.addEventListener("message",(e=>{const t=mn(e);"light"===t.theme&&document.body.classList.remove("dark"),"dark"===t.theme&&document.body.classList.add("dark")})),"dark"===zn&&document.body.classList.add("dark"),n.fetchHiddenUsers(),n.restoreCollapsedThreads();const r=yield or.get("/config");er.config=Object.assign(Object.assign({},r),{simple_view:r.simple_view||"true"===$n.simple_view}),(0,i.render)((0,i.h)(hn,{locale:Xn,messages:t},(0,i.h)(L,{store:Qa},"profile"===$n.page?(0,i.h)(yu,null):(0,i.h)(mu,null))),e)}))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",wu):wu()})()})();