@memori.ai/memori-webcomponent 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,13 +58,13 @@ var n=o("bqBrJ"),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}function a(
58
58
  * This source code is licensed under the MIT license found in the
59
59
  * LICENSE file in the root directory of this source tree.
60
60
  */
61
- e.exports=function(t){var n={},r=o("kyWRD"),i=o("85Hg2"),a=o("kMsGZ");function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,c=60103,u=60106,d=60107,h=60108,f=60114,p=60109,m=60110,g=60112,v=60113,b=60120,y=60115,w=60116,S=60121,x=60129,M=60130,_=60131;if("function"==typeof Symbol&&Symbol.for){var A=Symbol.for;c=A("react.element"),u=A("react.portal"),d=A("react.fragment"),h=A("react.strict_mode"),f=A("react.profiler"),p=A("react.provider"),m=A("react.context"),g=A("react.forward_ref"),v=A("react.suspense"),b=A("react.suspense_list"),y=A("react.memo"),w=A("react.lazy"),S=A("react.block"),A("react.scope"),x=A("react.debug_trace_mode"),M=A("react.offscreen"),_=A("react.legacy_hidden")}var E="function"==typeof Symbol&&Symbol.iterator;function C(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=E&&e[E]||e["@@iterator"])?e:null}function T(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case d:return"Fragment";case u:return"Portal";case f:return"Profiler";case h:return"StrictMode";case v:return"Suspense";case b:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case m:return(e.displayName||"Context")+".Consumer";case p:return(e._context.displayName||"Context")+".Provider";case g:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case y:return T(e.type);case S:return T(e._render);case w:t=e._payload,e=e._init;try{return T(e(t))}catch(e){}}return null}function I(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function k(e){if(I(e)!==e)throw Error(s(188))}function R(e){var t=e.alternate;if(!t){if(null===(t=I(e)))throw Error(s(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return k(i),e;if(o===r)return k(i),t;o=o.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,l=i.child;l;){if(l===n){a=!0,n=i,r=o;break}if(l===r){a=!0,r=i,n=o;break}l=l.sibling}if(!a){for(l=o.child;l;){if(l===n){a=!0,n=o,r=i;break}if(l===r){a=!0,r=o,n=i;break}l=l.sibling}if(!a)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(3!==n.tag)throw Error(s(188));return n.stateNode.current===n?e:t}function O(e){if(!(e=R(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function P(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var N,B=t.getPublicInstance,L=t.getRootHostContext,D=t.getChildHostContext,U=t.prepareForCommit,F=t.resetAfterCommit,z=t.createInstance,j=t.appendInitialChild,H=t.finalizeInitialChildren,G=t.prepareUpdate,V=t.shouldSetTextContent,W=t.createTextInstance,q=t.scheduleTimeout,K=t.cancelTimeout,J=t.noTimeout,Q=t.isPrimaryRenderer,X=t.supportsMutation,Y=t.supportsPersistence,Z=t.supportsHydration,$=t.getInstanceFromNode,ee=t.makeOpaqueHydratingObject,te=t.makeClientId,ne=t.beforeActiveInstanceBlur,re=t.afterActiveInstanceBlur,ie=t.preparePortalMount,oe=t.supportsTestSelectors,ae=t.findFiberRoot,se=t.getBoundingRect,le=t.getTextContent,ce=t.isHiddenSubtree,ue=t.matchAccessibilityRole,de=t.setFocusIfFocusable,he=t.setupIntersectionObserver,fe=t.appendChild,pe=t.appendChildToContainer,me=t.commitTextUpdate,ge=t.commitMount,ve=t.commitUpdate,be=t.insertBefore,ye=t.insertInContainerBefore,we=t.removeChild,Se=t.removeChildFromContainer,xe=t.resetTextContent,Me=t.hideInstance,_e=t.hideTextInstance,Ae=t.unhideInstance,Ee=t.unhideTextInstance,Ce=t.clearContainer,Te=t.cloneInstance,Ie=t.createContainerChildSet,ke=t.appendChildToContainerChildSet,Re=t.finalizeContainerChildren,Oe=t.replaceContainerChildren,Pe=t.cloneHiddenInstance,Ne=t.cloneHiddenTextInstance,Be=t.canHydrateInstance,Le=t.canHydrateTextInstance,De=t.isSuspenseInstancePending,Ue=t.isSuspenseInstanceFallback,Fe=t.getNextHydratableSibling,ze=t.getFirstHydratableChild,je=t.hydrateInstance,He=t.hydrateTextInstance,Ge=t.getNextHydratableInstanceAfterSuspenseInstance,Ve=t.commitHydratedContainer,We=t.commitHydratedSuspenseInstance;function qe(e){if(void 0===N)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);N=t&&t[1]||""}return"\n"+N+e}var Ke=!1;function Je(e,t){if(!e||Ke)return"";Ke=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var i=e.stack.split("\n"),o=r.stack.split("\n"),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||i[a]!==o[s])return"\n"+i[a].replace(" at new "," at ")}while(1<=a&&0<=s);break}}}finally{Ke=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qe(e):""}var Qe=[],Xe=-1;function Ye(e){return{current:e}}function Ze(e){0>Xe||(e.current=Qe[Xe],Qe[Xe]=null,Xe--)}function $e(e,t){Xe++,Qe[Xe]=e.current,e.current=t}var et={},tt=Ye(et),nt=Ye(!1),rt=et;function it(e,t){var n=e.type.contextTypes;if(!n)return et;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ot(e){return null!=(e=e.childContextTypes)}function at(){Ze(nt),Ze(tt)}function st(e,t,n){if(tt.current!==et)throw Error(s(168));$e(tt,t),$e(nt,n)}function lt(e,t,n){var i=e.stateNode;if(e=t.childContextTypes,"function"!=typeof i.getChildContext)return n;for(var o in i=i.getChildContext())if(!(o in e))throw Error(s(108,T(t)||"Unknown",o));return r({},n,i)}function ct(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||et,rt=tt.current,$e(tt,e),$e(nt,nt.current),!0}function ut(e,t,n){var r=e.stateNode;if(!r)throw Error(s(169));n?(e=lt(e,t,rt),r.__reactInternalMemoizedMergedChildContext=e,Ze(nt),Ze(tt),$e(tt,e)):Ze(nt),$e(nt,n)}var dt=null,ht=null;(0,a.unstable_now)();var ft=0,pt=8;function mt(e){if(0!=(1&e))return pt=15,1;if(0!=(2&e))return pt=14,2;if(0!=(4&e))return pt=13,4;var t=24&e;return 0!==t?(pt=12,t):0!=(32&e)?(pt=11,32):0!==(t=192&e)?(pt=10,t):0!=(256&e)?(pt=9,256):0!==(t=3584&e)?(pt=8,t):0!=(4096&e)?(pt=7,4096):0!==(t=4186112&e)?(pt=6,t):0!==(t=62914560&e)?(pt=5,t):67108864&e?(pt=4,67108864):0!=(134217728&e)?(pt=3,134217728):0!==(t=805306368&e)?(pt=2,t):0!=(1073741824&e)?(pt=1,1073741824):(pt=8,e)}function gt(e,t){var n=e.pendingLanes;if(0===n)return pt=0;var r=0,i=0,o=e.expiredLanes,a=e.suspendedLanes,s=e.pingedLanes;if(0!==o)r=o,i=pt=15;else if(0!==(o=134217727&n)){var l=o&~a;0!==l?(r=mt(l),i=pt):0!==(s&=o)&&(r=mt(s),i=pt)}else 0!==(o=n&~a)?(r=mt(o),i=pt):0!==s&&(r=mt(s),i=pt);if(0===r)return 0;if(r=n&((0>(r=31-xt(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0==(t&a)){if(mt(t),i<=pt)return t;pt=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-xt(t)),r|=e[n],t&=~i;return r}function vt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function bt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=yt(24&~t))?bt(10,t):e;case 10:return 0===(e=yt(192&~t))?bt(8,t):e;case 8:return 0===(e=yt(3584&~t))&&(0===(e=yt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=yt(805306368&~t))&&(t=268435456),t}throw Error(s(358,e))}function yt(e){return e&-e}function wt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function St(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-xt(t)]=n}var xt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Mt(e)/_t|0)|0},Mt=Math.log,_t=Math.LN2;var At=a.unstable_runWithPriority,Et=a.unstable_scheduleCallback,Ct=a.unstable_cancelCallback,Tt=a.unstable_shouldYield,It=a.unstable_requestPaint,kt=a.unstable_now,Rt=a.unstable_getCurrentPriorityLevel,Ot=a.unstable_ImmediatePriority,Pt=a.unstable_UserBlockingPriority,Nt=a.unstable_NormalPriority,Bt=a.unstable_LowPriority,Lt=a.unstable_IdlePriority,Dt={},Ut=void 0!==It?It:function(){},Ft=null,zt=null,jt=!1,Ht=kt(),Gt=1e4>Ht?kt:function(){return kt()-Ht};function Vt(){switch(Rt()){case Ot:return 99;case Pt:return 98;case Nt:return 97;case Bt:return 96;case Lt:return 95;default:throw Error(s(332))}}function Wt(e){switch(e){case 99:return Ot;case 98:return Pt;case 97:return Nt;case 96:return Bt;case 95:return Lt;default:throw Error(s(332))}}function qt(e,t){return e=Wt(e),At(e,t)}function Kt(e,t,n){return e=Wt(e),Et(e,t,n)}function Jt(){if(null!==zt){var e=zt;zt=null,Ct(e)}Qt()}function Qt(){if(!jt&&null!==Ft){jt=!0;var e=0;try{var t=Ft;qt(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Ft=null}catch(t){throw null!==Ft&&(Ft=Ft.slice(e+1)),Et(Ot,Jt),t}finally{jt=!1}}}var Xt=l.ReactCurrentBatchConfig;var Yt="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Zt=Object.prototype.hasOwnProperty;function $t(e,t){if(Yt(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!Zt.call(t,n[r])||!Yt(e[n[r]],t[n[r]]))return!1;return!0}function en(e){switch(e.tag){case 5:return qe(e.type);case 16:return qe("Lazy");case 13:return qe("Suspense");case 19:return qe("SuspenseList");case 0:case 2:case 15:return e=Je(e.type,!1);case 11:return e=Je(e.type.render,!1);case 22:return e=Je(e.type._render,!1);case 1:return e=Je(e.type,!0);default:return""}}function tn(e,t){if(e&&e.defaultProps){for(var n in t=r({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var nn=Ye(null),rn=null,on=null,an=null;function sn(){an=on=rn=null}function ln(e,t){e=e.type._context,Q?($e(nn,e._currentValue),e._currentValue=t):($e(nn,e._currentValue2),e._currentValue2=t)}function cn(e){var t=nn.current;Ze(nn),e=e.type._context,Q?e._currentValue=t:e._currentValue2=t}function un(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function dn(e,t){rn=e,an=on=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Hr=!0),e.firstContext=null)}function hn(e,t){if(an!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(an=e,t=1073741823),t={context:e,observedBits:t,next:null},null===on){if(null===rn)throw Error(s(308));on=t,rn.dependencies={lanes:0,firstContext:t,responders:null}}else on=on.next=t;return Q?e._currentValue:e._currentValue2}var fn=!1;function pn(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function mn(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function gn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function vn(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function bn(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function yn(e,t,n,i){var o=e.updateQueue;fn=!1;var a=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(null!==l){o.shared.pending=null;var c=l,u=c.next;c.next=null,null===s?a=u:s.next=u,s=c;var d=e.alternate;if(null!==d){var h=(d=d.updateQueue).lastBaseUpdate;h!==s&&(null===h?d.firstBaseUpdate=u:h.next=u,d.lastBaseUpdate=c)}}if(null!==a){for(h=o.baseState,s=0,d=u=c=null;;){l=a.lane;var f=a.eventTime;if((i&l)===l){null!==d&&(d=d.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,m=a;switch(l=t,f=n,m.tag){case 1:if("function"==typeof(p=m.payload)){h=p.call(f,h,l);break e}h=p;break e;case 3:p.flags=-4097&p.flags|64;case 0:if(null==(l="function"==typeof(p=m.payload)?p.call(f,h,l):p))break e;h=r({},h,l);break e;case 2:fn=!0}}null!==a.callback&&(e.flags|=32,null===(l=o.effects)?o.effects=[a]:l.push(a))}else f={eventTime:f,lane:l,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===d?(u=d=f,c=h):d=d.next=f,s|=l;if(null===(a=a.next)){if(null===(l=o.shared.pending))break;a=l.next,l.next=null,o.lastBaseUpdate=l,o.shared.pending=null}}null===d&&(c=h),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,ho|=s,e.lanes=s,e.memoizedState=h}}function wn(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(s(191,i));i.call(r)}}}var Sn=(new i.Component).refs;function xn(e,t,n,i){n=null==(n=n(i,t=e.memoizedState))?t:r({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Mn={isMounted:function(e){return!!(e=e._reactInternals)&&I(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Do(),i=Uo(e),o=gn(r,i);o.payload=t,null!=n&&(o.callback=n),vn(e,o),Fo(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Do(),i=Uo(e),o=gn(r,i);o.tag=1,o.payload=t,null!=n&&(o.callback=n),vn(e,o),Fo(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Do(),r=Uo(e),i=gn(n,r);i.tag=2,null!=t&&(i.callback=t),vn(e,i),Fo(e,r,n)}};function _n(e,t,n,r,i,o,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!$t(n,r)||!$t(i,o))}function An(e,t,n){var r=!1,i=et,o=t.contextType;return"object"==typeof o&&null!==o?o=hn(o):(i=ot(t)?rt:tt.current,o=(r=null!=(r=t.contextTypes))?it(e,i):et),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Mn,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function En(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Mn.enqueueReplaceState(t,t.state,null)}function Cn(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=Sn,pn(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=hn(o):(o=ot(t)?rt:tt.current,i.context=it(e,o)),yn(e,n,i,r),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(xn(e,t,o,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&Mn.enqueueReplaceState(i,i.state,null),yn(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var Tn=Array.isArray;function In(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(s(309));var r=n.stateNode}if(!r)throw Error(s(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=r.refs;t===Sn&&(t=r.refs={}),null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!=typeof e)throw Error(s(284));if(!n._owner)throw Error(s(290,e))}return e}function kn(e,t){if("textarea"!==e.type)throw Error(s(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Rn(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=_a(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function a(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Ta(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=In(e,t,n),r.return=e,r):((r=Aa(n.type,n.key,n.props,null,e.mode,r)).ref=In(e,t,n),r.return=e,r)}function f(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Ia(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function p(e,t,n,r,o){return null===t||7!==t.tag?((t=Ea(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function m(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Ta(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case c:return(n=Aa(t.type,t.key,t.props,null,e.mode,n)).ref=In(e,null,t),n.return=e,n;case u:return(t=Ia(t,e.mode,n)).return=e,t}if(Tn(t)||C(t))return(t=Ea(t,e.mode,n,null)).return=e,t;kn(e,t)}return null}function g(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case c:return n.key===i?n.type===d?p(e,t,n.props.children,r,i):h(e,t,n,r):null;case u:return n.key===i?f(e,t,n,r):null}if(Tn(n)||C(n))return null!==i?null:p(e,t,n,r,null);kn(e,n)}return null}function v(e,t,n,r,i){if("string"==typeof r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case c:return e=e.get(null===r.key?n:r.key)||null,r.type===d?p(t,e,r.props.children,i,r.key):h(t,e,r,i);case u:return f(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(Tn(r)||C(r))return p(t,e=e.get(n)||null,r,i,null);kn(t,r)}return null}function b(i,a,s,l){for(var c=null,u=null,d=a,h=a=0,f=null;null!==d&&h<s.length;h++){d.index>h?(f=d,d=null):f=d.sibling;var p=g(i,d,s[h],l);if(null===p){null===d&&(d=f);break}e&&d&&null===p.alternate&&t(i,d),a=o(p,a,h),null===u?c=p:u.sibling=p,u=p,d=f}if(h===s.length)return n(i,d),c;if(null===d){for(;h<s.length;h++)null!==(d=m(i,s[h],l))&&(a=o(d,a,h),null===u?c=d:u.sibling=d,u=d);return c}for(d=r(i,d);h<s.length;h++)null!==(f=v(d,i,h,s[h],l))&&(e&&null!==f.alternate&&d.delete(null===f.key?h:f.key),a=o(f,a,h),null===u?c=f:u.sibling=f,u=f);return e&&d.forEach((function(e){return t(i,e)})),c}function y(i,a,l,c){var u=C(l);if("function"!=typeof u)throw Error(s(150));if(null==(l=u.call(l)))throw Error(s(151));for(var d=u=null,h=a,f=a=0,p=null,b=l.next();null!==h&&!b.done;f++,b=l.next()){h.index>f?(p=h,h=null):p=h.sibling;var y=g(i,h,b.value,c);if(null===y){null===h&&(h=p);break}e&&h&&null===y.alternate&&t(i,h),a=o(y,a,f),null===d?u=y:d.sibling=y,d=y,h=p}if(b.done)return n(i,h),u;if(null===h){for(;!b.done;f++,b=l.next())null!==(b=m(i,b.value,c))&&(a=o(b,a,f),null===d?u=b:d.sibling=b,d=b);return u}for(h=r(i,h);!b.done;f++,b=l.next())null!==(b=v(h,i,f,b.value,c))&&(e&&null!==b.alternate&&h.delete(null===b.key?f:b.key),a=o(b,a,f),null===d?u=b:d.sibling=b,d=b);return e&&h.forEach((function(e){return t(i,e)})),u}return function(e,r,o,l){var h="object"==typeof o&&null!==o&&o.type===d&&null===o.key;h&&(o=o.props.children);var f="object"==typeof o&&null!==o;if(f)switch(o.$$typeof){case c:e:{for(f=o.key,h=r;null!==h;){if(h.key===f){if(7===h.tag){if(o.type===d){n(e,h.sibling),(r=i(h,o.props.children)).return=e,e=r;break e}}else if(h.elementType===o.type){n(e,h.sibling),(r=i(h,o.props)).ref=In(e,h,o),r.return=e,e=r;break e}n(e,h);break}t(e,h),h=h.sibling}o.type===d?((r=Ea(o.props.children,e.mode,l,o.key)).return=e,e=r):((l=Aa(o.type,o.key,o.props,null,e.mode,l)).ref=In(e,r,o),l.return=e,e=l)}return a(e);case u:e:{for(h=o.key;null!==r;){if(r.key===h){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Ia(o,e.mode,l)).return=e,e=r}return a(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=Ta(o,e.mode,l)).return=e,e=r),a(e);if(Tn(o))return b(e,r,o,l);if(C(o))return y(e,r,o,l);if(f&&kn(e,o),void 0===o&&!h)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(s(152,T(e.type)||"Component"))}return n(e,r)}}var On=Rn(!0),Pn=Rn(!1),Nn={},Bn=Ye(Nn),Ln=Ye(Nn),Dn=Ye(Nn);function Un(e){if(e===Nn)throw Error(s(174));return e}function Fn(e,t){$e(Dn,t),$e(Ln,e),$e(Bn,Nn),e=L(t),Ze(Bn),$e(Bn,e)}function zn(){Ze(Bn),Ze(Ln),Ze(Dn)}function jn(e){var t=Un(Dn.current),n=Un(Bn.current);n!==(t=D(n,e.type,t))&&($e(Ln,e),$e(Bn,t))}function Hn(e){Ln.current===e&&(Ze(Bn),Ze(Ln))}var Gn=Ye(0);function Vn(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||De(n)||Ue(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wn=null,qn=null,Kn=!1;function Jn(e,t){var n=xa(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Qn(e,t){switch(e.tag){case 5:return null!==(t=Be(t,e.type,e.pendingProps))&&(e.stateNode=t,!0);case 6:return null!==(t=Le(t,e.pendingProps))&&(e.stateNode=t,!0);default:return!1}}function Xn(e){if(Kn){var t=qn;if(t){var n=t;if(!Qn(e,t)){if(!(t=Fe(n))||!Qn(e,t))return e.flags=-1025&e.flags|2,Kn=!1,void(Wn=e);Jn(Wn,n)}Wn=e,qn=ze(t)}else e.flags=-1025&e.flags|2,Kn=!1,Wn=e}}function Yn(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Wn=e}function Zn(e){if(!Z||e!==Wn)return!1;if(!Kn)return Yn(e),Kn=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!V(t,e.memoizedProps))for(t=qn;t;)Jn(e,t),t=Fe(t);if(Yn(e),13===e.tag){if(!Z)throw Error(s(316));if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(s(317));qn=Ge(e)}else qn=Wn?Fe(e.stateNode):null;return!0}function $n(){Z&&(qn=Wn=null,Kn=!1)}var er=[];function tr(){for(var e=0;e<er.length;e++){var t=er[e];Q?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}er.length=0}var nr=l.ReactCurrentDispatcher,rr=l.ReactCurrentBatchConfig,ir=0,or=null,ar=null,sr=null,lr=!1,cr=!1;function ur(){throw Error(s(321))}function dr(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yt(e[n],t[n]))return!1;return!0}function hr(e,t,n,r,i,o){if(ir=o,or=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,nr.current=null===e||null===e.memoizedState?Ur:Fr,e=n(r,i),cr){o=0;do{if(cr=!1,!(25>o))throw Error(s(301));o+=1,sr=ar=null,t.updateQueue=null,nr.current=zr,e=n(r,i)}while(cr)}if(nr.current=Dr,t=null!==ar&&null!==ar.next,ir=0,sr=ar=or=null,lr=!1,t)throw Error(s(300));return e}function fr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===sr?or.memoizedState=sr=e:sr=sr.next=e,sr}function pr(){if(null===ar){var e=or.alternate;e=null!==e?e.memoizedState:null}else e=ar.next;var t=null===sr?or.memoizedState:sr.next;if(null!==t)sr=t,ar=e;else{if(null===e)throw Error(s(310));e={memoizedState:(ar=e).memoizedState,baseState:ar.baseState,baseQueue:ar.baseQueue,queue:ar.queue,next:null},null===sr?or.memoizedState=sr=e:sr=sr.next=e}return sr}function mr(e,t){return"function"==typeof t?t(e):t}function gr(e){var t=pr(),n=t.queue;if(null===n)throw Error(s(311));n.lastRenderedReducer=e;var r=ar,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var l=a=o=null,c=i;do{var u=c.lane;if((ir&u)===u)null!==l&&(l=l.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===e?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===l?(a=l=d,o=r):l=l.next=d,or.lanes|=u,ho|=u}c=c.next}while(null!==c&&c!==i);null===l?o=r:l.next=a,Yt(r,t.memoizedState)||(Hr=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function vr(e){var t=pr(),n=t.queue;if(null===n)throw Error(s(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{o=e(o,a.action),a=a.next}while(a!==i);Yt(o,t.memoizedState)||(Hr=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function br(e,t,n){var r=t._getVersion;r=r(t._source);var i=Q?t._workInProgressVersionPrimary:t._workInProgressVersionSecondary;if(null!==i?e=i===r:(e=e.mutableReadLanes,(e=(ir&e)===e)&&(Q?t._workInProgressVersionPrimary=r:t._workInProgressVersionSecondary=r,er.push(t))),e)return n(t._source);throw er.push(t),Error(s(350))}function yr(e,t,n,r){var i=ro;if(null===i)throw Error(s(349));var o=t._getVersion,a=o(t._source),l=nr.current,c=l.useState((function(){return br(i,t,n)})),u=c[1],d=c[0];c=sr;var h=e.memoizedState,f=h.refs,p=f.getSnapshot,m=h.source;h=h.subscribe;var g=or;return e.memoizedState={refs:f,source:t,subscribe:r},l.useEffect((function(){f.getSnapshot=n,f.setSnapshot=u;var e=o(t._source);if(!Yt(a,e)){e=n(t._source),Yt(d,e)||(u(e),e=Uo(g),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var r=i.entanglements,s=e;0<s;){var l=31-xt(s),c=1<<l;r[l]|=e,s&=~c}}}),[n,t,r]),l.useEffect((function(){return r(t._source,(function(){var e=f.getSnapshot,n=f.setSnapshot;try{n(e(t._source));var r=Uo(g);i.mutableReadLanes|=r&i.pendingLanes}catch(e){n((function(){throw e}))}}))}),[t,r]),Yt(p,n)&&Yt(m,t)&&Yt(h,r)||((e={pending:null,dispatch:null,lastRenderedReducer:mr,lastRenderedState:d}).dispatch=u=Lr.bind(null,or,e),c.queue=e,c.baseQueue=null,d=br(i,t,n),c.memoizedState=c.baseState=d),d}function wr(e,t,n){return yr(pr(),e,t,n)}function Sr(e){var t=fr();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:mr,lastRenderedState:e}).dispatch=Lr.bind(null,or,e),[t.memoizedState,e]}function xr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=or.updateQueue)?(t={lastEffect:null},or.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Mr(e){return e={current:e},fr().memoizedState=e}function _r(){return pr().memoizedState}function Ar(e,t,n,r){var i=fr();or.flags|=e,i.memoizedState=xr(1|t,n,void 0,void 0===r?null:r)}function Er(e,t,n,r){var i=pr();r=void 0===r?null:r;var o=void 0;if(null!==ar){var a=ar.memoizedState;if(o=a.destroy,null!==r&&dr(r,a.deps))return void xr(t,n,o,r)}or.flags|=e,i.memoizedState=xr(1|t,n,o,r)}function Cr(e,t){return Ar(516,4,e,t)}function Tr(e,t){return Er(516,4,e,t)}function Ir(e,t){return Er(4,2,e,t)}function kr(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Rr(e,t,n){return n=null!=n?n.concat([e]):null,Er(4,2,kr.bind(null,t,e),n)}function Or(){}function Pr(e,t){var n=pr();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&dr(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Nr(e,t){var n=pr();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&dr(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Br(e,t){var n=Vt();qt(98>n?98:n,(function(){e(!0)})),qt(97<n?97:n,(function(){var n=rr.transition;rr.transition=1;try{e(!1),t()}finally{rr.transition=n}}))}function Lr(e,t,n){var r=Do(),i=Uo(e),o={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},a=t.pending;if(null===a?o.next=o:(o.next=a.next,a.next=o),t.pending=o,a=e.alternate,e===or||null!==a&&a===or)cr=lr=!0;else{if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,l=a(s,n);if(o.eagerReducer=a,o.eagerState=l,Yt(l,s))return}catch(e){}Fo(e,i,r)}}var Dr={readContext:hn,useCallback:ur,useContext:ur,useEffect:ur,useImperativeHandle:ur,useLayoutEffect:ur,useMemo:ur,useReducer:ur,useRef:ur,useState:ur,useDebugValue:ur,useDeferredValue:ur,useTransition:ur,useMutableSource:ur,useOpaqueIdentifier:ur,unstable_isNewReconciler:!1},Ur={readContext:hn,useCallback:function(e,t){return fr().memoizedState=[e,void 0===t?null:t],e},useContext:hn,useEffect:Cr,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ar(4,2,kr.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ar(4,2,e,t)},useMemo:function(e,t){var n=fr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=fr();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Lr.bind(null,or,e),[r.memoizedState,e]},useRef:Mr,useState:Sr,useDebugValue:Or,useDeferredValue:function(e){var t=Sr(e),n=t[0],r=t[1];return Cr((function(){var t=rr.transition;rr.transition=1;try{r(e)}finally{rr.transition=t}}),[e]),n},useTransition:function(){var e=Sr(!1),t=e[0];return Mr(e=Br.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=fr();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},yr(r,e,t,n)},useOpaqueIdentifier:function(){if(Kn){var e=!1,t=ee((function(){throw e||(e=!0,n(te())),Error(s(355))})),n=Sr(t)[1];return 0==(2&or.mode)&&(or.flags|=516,xr(5,(function(){n(te())}),void 0,null)),t}return Sr(t=te()),t},unstable_isNewReconciler:!1},Fr={readContext:hn,useCallback:Pr,useContext:hn,useEffect:Tr,useImperativeHandle:Rr,useLayoutEffect:Ir,useMemo:Nr,useReducer:gr,useRef:_r,useState:function(){return gr(mr)},useDebugValue:Or,useDeferredValue:function(e){var t=gr(mr),n=t[0],r=t[1];return Tr((function(){var t=rr.transition;rr.transition=1;try{r(e)}finally{rr.transition=t}}),[e]),n},useTransition:function(){var e=gr(mr)[0];return[_r().current,e]},useMutableSource:wr,useOpaqueIdentifier:function(){return gr(mr)[0]},unstable_isNewReconciler:!1},zr={readContext:hn,useCallback:Pr,useContext:hn,useEffect:Tr,useImperativeHandle:Rr,useLayoutEffect:Ir,useMemo:Nr,useReducer:vr,useRef:_r,useState:function(){return vr(mr)},useDebugValue:Or,useDeferredValue:function(e){var t=vr(mr),n=t[0],r=t[1];return Tr((function(){var t=rr.transition;rr.transition=1;try{r(e)}finally{rr.transition=t}}),[e]),n},useTransition:function(){var e=vr(mr)[0];return[_r().current,e]},useMutableSource:wr,useOpaqueIdentifier:function(){return vr(mr)[0]},unstable_isNewReconciler:!1},jr=l.ReactCurrentOwner,Hr=!1;function Gr(e,t,n,r){t.child=null===e?Pn(t,null,n,r):On(t,e.child,n,r)}function Vr(e,t,n,r,i){n=n.render;var o=t.ref;return dn(t,i),r=hr(e,t,n,r,o,i),null===e||Hr?(t.flags|=1,Gr(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,di(e,t,i))}function Wr(e,t,n,r,i,o){if(null===e){var a=n.type;return"function"!=typeof a||Ma(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Aa(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,qr(e,t,a,r,i,o))}return a=e.child,0==(i&o)&&(i=a.memoizedProps,(n=null!==(n=n.compare)?n:$t)(i,r)&&e.ref===t.ref)?di(e,t,o):(t.flags|=1,(e=_a(a,r)).ref=t.ref,e.return=t,t.child=e)}function qr(e,t,n,r,i,o){if(null!==e&&$t(e.memoizedProps,r)&&e.ref===t.ref){if(Hr=!1,0==(o&i))return t.lanes=e.lanes,di(e,t,o);0!=(16384&e.flags)&&(Hr=!0)}return Qr(e,t,n,r,o)}function Kr(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},Ko(t,n);else{if(0==(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},Ko(t,e),null;t.memoizedState={baseLanes:0},Ko(t,null!==o?o.baseLanes:n)}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,Ko(t,r);return Gr(e,t,i,n),t.child}function Jr(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Qr(e,t,n,r,i){var o=ot(n)?rt:tt.current;return o=it(t,o),dn(t,i),n=hr(e,t,n,r,o,i),null===e||Hr?(t.flags|=1,Gr(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,di(e,t,i))}function Xr(e,t,n,r,i){if(ot(n)){var o=!0;ct(t)}else o=!1;if(dn(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),An(t,n,r),Cn(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=hn(c):c=it(t,c=ot(n)?rt:tt.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&En(t,a,r,c),fn=!1;var h=t.memoizedState;a.state=h,yn(t,r,a,i),l=t.memoizedState,s!==r||h!==l||nt.current||fn?("function"==typeof u&&(xn(t,n,u,r),l=t.memoizedState),(s=fn||_n(t,n,s,r,h,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4)):("function"==typeof a.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4),r=!1)}else{a=t.stateNode,mn(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:tn(t.type,s),a.props=c,d=t.pendingProps,h=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=hn(l):l=it(t,l=ot(n)?rt:tt.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||h!==l)&&En(t,a,r,l),fn=!1,h=t.memoizedState,a.state=h,yn(t,r,a,i);var p=t.memoizedState;s!==d||h!==p||nt.current||fn?("function"==typeof f&&(xn(t,n,f,r),p=t.memoizedState),(c=fn||_n(t,n,c,r,h,p,l))?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=256),r=!1)}return Yr(e,t,n,r,o,i)}function Yr(e,t,n,r,i,o){Jr(e,t);var a=0!=(64&t.flags);if(!r&&!a)return i&&ut(t,n,!1),di(e,t,o);r=t.stateNode,jr.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=On(t,e.child,null,o),t.child=On(t,null,s,o)):Gr(e,t,s,o),t.memoizedState=r.state,i&&ut(t,n,!0),t.child}function Zr(e){var t=e.stateNode;t.pendingContext?st(0,t.pendingContext,t.pendingContext!==t.context):t.context&&st(0,t.context,!1),Fn(e,t.containerInfo)}var $r,ei,ti,ni,ri={dehydrated:null,retryLane:0};function ii(e,t,n){var r,i=t.pendingProps,o=Gn.current,a=!1;return(r=0!=(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!=(2&o)),r?(a=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(o|=1),$e(Gn,1&o),null===e?(void 0!==i.fallback&&Xn(t),e=i.children,o=i.fallback,a?(e=oi(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=ri,e):"number"==typeof i.unstable_expectedLoadTime?(e=oi(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=ri,t.lanes=33554432,e):((n=Ca({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,a?(i=si(e,t,i.children,i.fallback,n),a=t.child,o=e.child.memoizedState,a.memoizedState=null===o?{baseLanes:n}:{baseLanes:o.baseLanes|n},a.childLanes=e.childLanes&~n,t.memoizedState=ri,i):(n=ai(e,t,i.children,n),t.memoizedState=null,n))}function oi(e,t,n,r){var i=e.mode,o=e.child;return t={mode:"hidden",children:t},0==(2&i)&&null!==o?(o.childLanes=0,o.pendingProps=t):o=Ca(t,i,0,null),n=Ea(n,i,r,null),o.return=e,n.return=e,o.sibling=n,e.child=o,n}function ai(e,t,n,r){var i=e.child;return e=i.sibling,n=_a(i,{mode:"visible",children:n}),0==(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function si(e,t,n,r,i){var o=t.mode,a=e.child;e=a.sibling;var s={mode:"hidden",children:n};return 0==(2&o)&&t.child!==a?((n=t.child).childLanes=0,n.pendingProps=s,null!==(a=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=a,a.nextEffect=null):t.firstEffect=t.lastEffect=null):n=_a(a,s),null!==e?r=_a(e,r):(r=Ea(r,o,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function li(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),un(e.return,t)}function ci(e,t,n,r,i,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i,a.lastEffect=o)}function ui(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Gr(e,t,r.children,n),0!=(2&(r=Gn.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&li(e,n);else if(19===e.tag)li(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if($e(Gn,r),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Vn(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ci(t,!1,i,n,o,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Vn(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ci(t,!0,n,null,o,t.lastEffect);break;case"together":ci(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function di(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),ho|=t.lanes,0!=(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(s(153));if(null!==t.child){for(n=_a(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=_a(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function hi(e){e.flags|=4}if(X)$r=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)j(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},ei=function(){},ti=function(e,t,n,r,i){if((e=e.memoizedProps)!==r){var o=t.stateNode,a=Un(Bn.current);n=G(o,n,e,r,i,a),(t.updateQueue=n)&&hi(t)}},ni=function(e,t,n,r){n!==r&&hi(t)};else if(Y){$r=function(e,t,n,r){for(var i=t.child;null!==i;){if(5===i.tag){var o=i.stateNode;n&&r&&(o=Pe(o,i.type,i.memoizedProps,i)),j(e,o)}else if(6===i.tag)o=i.stateNode,n&&r&&(o=Ne(o,i.memoizedProps,i)),j(e,o);else if(4!==i.tag){if(13===i.tag&&0!=(4&i.flags)&&(o=null!==i.memoizedState)){var a=i.child;if(null!==a&&(null!==a.child&&(a.child.return=a,$r(e,a,!0,o)),null!==(o=a.sibling))){o.return=i,i=o;continue}}if(null!==i.child){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};var fi=function(e,t,n,r){for(var i=t.child;null!==i;){if(5===i.tag){var o=i.stateNode;n&&r&&(o=Pe(o,i.type,i.memoizedProps,i)),ke(e,o)}else if(6===i.tag)o=i.stateNode,n&&r&&(o=Ne(o,i.memoizedProps,i)),ke(e,o);else if(4!==i.tag){if(13===i.tag&&0!=(4&i.flags)&&(o=null!==i.memoizedState)){var a=i.child;if(null!==a&&(null!==a.child&&(a.child.return=a,fi(e,a,!0,o)),null!==(o=a.sibling))){o.return=i,i=o;continue}}if(null!==i.child){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};ei=function(e){var t=e.stateNode;if(null!==e.firstEffect){var n=t.containerInfo,r=Ie(n);fi(r,e,!1,!1),t.pendingChildren=r,hi(e),Re(n,r)}},ti=function(e,t,n,r,i){var o=e.stateNode,a=e.memoizedProps;if((e=null===t.firstEffect)&&a===r)t.stateNode=o;else{var s=t.stateNode,l=Un(Bn.current),c=null;a!==r&&(c=G(s,n,a,r,i,l)),e&&null===c?t.stateNode=o:(o=Te(o,c,n,a,r,t,e,s),H(o,n,r,i,l)&&hi(t),t.stateNode=o,e?hi(t):$r(o,t,!1,!1))}},ni=function(e,t,n,r){n!==r?(e=Un(Dn.current),n=Un(Bn.current),t.stateNode=W(r,e,n,t),hi(t)):t.stateNode=e.stateNode}}else ei=function(){},ti=function(){},ni=function(){};function pi(e,t){if(!Kn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function mi(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return ot(t.type)&&at(),null;case 3:return zn(),Ze(nt),Ze(tt),tr(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Zn(t)?hi(t):r.hydrate||(t.flags|=256)),ei(t),null;case 5:Hn(t);var i=Un(Dn.current);if(n=t.type,null!==e&&null!=t.stateNode)ti(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(s(166));return null}if(e=Un(Bn.current),Zn(t)){if(!Z)throw Error(s(175));e=je(t.stateNode,t.type,t.memoizedProps,i,e,t),t.updateQueue=e,null!==e&&hi(t)}else{var o=z(n,r,i,e,t);$r(o,t,!1,!1),t.stateNode=o,H(o,n,r,i,e)&&hi(t)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)ni(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(s(166));if(e=Un(Dn.current),i=Un(Bn.current),Zn(t)){if(!Z)throw Error(s(176));He(t.stateNode,t.memoizedProps,t)&&hi(t)}else t.stateNode=W(r,e,i,t)}return null;case 13:return Ze(Gn),r=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(r=null!==r,i=!1,null===e?void 0!==t.memoizedProps.fallback&&Zn(t):i=null!==e.memoizedState,r&&!i&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Gn.current)?0===lo&&(lo=3):(0!==lo&&3!==lo||(lo=4),null===ro||0==(134217727&ho)&&0==(134217727&fo)||Go(ro,oo))),Y&&r&&(t.flags|=4),X&&(r||i)&&(t.flags|=4),null);case 4:return zn(),ei(t),null===e&&ie(t.stateNode.containerInfo),null;case 10:return cn(t),null;case 19:if(Ze(Gn),null===(r=t.memoizedState))return null;if(i=0!=(64&t.flags),null===(o=r.rendering))if(i)pi(r,!1);else{if(0!==lo||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(o=Vn(e))){for(t.flags|=64,pi(r,!1),null!==(e=o.updateQueue)&&(t.updateQueue=e,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,e=n,r=t.child;null!==r;)n=e,(i=r).flags&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(o=i.alternate)?(i.childLanes=0,i.lanes=n,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,n=o.dependencies,i.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext}),r=r.sibling;return $e(Gn,1&Gn.current|2),t.child}e=e.sibling}null!==r.tail&&Gt()>vo&&(t.flags|=64,i=!0,pi(r,!1),t.lanes=33554432)}else{if(!i)if(null!==(e=Vn(o))){if(t.flags|=64,i=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),pi(r,!0),null===r.tail&&"hidden"===r.tailMode&&!o.alternate&&!Kn)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Gt()-r.renderingStartTime>vo&&1073741824!==n&&(t.flags|=64,i=!0,pi(r,!1),t.lanes=33554432);r.isBackwards?(o.sibling=t.child,t.child=o):(null!==(e=r.last)?e.sibling=o:t.child=o,r.last=o)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Gt(),e.sibling=null,t=Gn.current,$e(Gn,i?1&t|2:1&t),e):null;case 23:case 24:return Jo(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(s(156,t.tag))}function gi(e){switch(e.tag){case 1:ot(e.type)&&at();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(zn(),Ze(nt),Ze(tt),tr(),0!=(64&(t=e.flags)))throw Error(s(285));return e.flags=-4097&t|64,e;case 5:return Hn(e),null;case 13:return Ze(Gn),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return Ze(Gn),null;case 4:return zn(),null;case 10:return cn(e),null;case 23:case 24:return Jo(),null;default:return null}}function vi(e,t){try{var n="",r=t;do{n+=en(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i}}function bi(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var yi="function"==typeof WeakMap?WeakMap:Map;function wi(e,t,n){(n=gn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){So||(So=!0,xo=r),bi(0,t)},n}function Si(e,t,n){(n=gn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return bi(0,t),r(i)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Mo?Mo=new Set([this]):Mo.add(this),bi(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var xi="function"==typeof WeakSet?WeakSet:Set;function Mi(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){da(e,t)}else t.current=null}function _i(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:tn(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(X&&256&t.flags&&Ce(t.stateNode.containerInfo))}throw Error(s(163))}function Ai(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==t)}}function Ei(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;r=i.next,0!=(4&(i=i.tag))&&0!=(1&i)&&(la(n,e),sa(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:tn(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&wn(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=B(n.child.stateNode);break;case 1:e=n.child.stateNode}wn(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&ge(e,n.type,n.memoizedProps,n));case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(Z&&null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&We(n)))))}throw Error(s(163))}function Ci(e,t){if(X)for(var n=e;;){if(5===n.tag){var r=n.stateNode;t?Me(r):Ae(n.stateNode,n.memoizedProps)}else if(6===n.tag)r=n.stateNode,t?_e(r):Ee(r,n.memoizedProps);else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function Ti(e,t){if(ht&&"function"==typeof ht.onCommitFiberUnmount)try{ht.onCommitFiberUnmount(dt,t)}catch(e){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(0!=(4&r))la(t,n);else{r=t;try{i()}catch(e){da(r,e)}}n=n.next}while(n!==e)}break;case 1:if(Mi(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){da(t,e)}break;case 5:Mi(t);break;case 4:X?Bi(e,t):Y&&Y&&(t=t.stateNode.containerInfo,e=Ie(t),Oe(t,e))}}function Ii(e,t){for(var n=t;;)if(Ti(e,n),null===n.child||X&&4===n.tag){if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}else n.child.return=n,n=n.child}function ki(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function Ri(e){return 5===e.tag||3===e.tag||4===e.tag}function Oi(e){if(X){e:{for(var t=e.return;null!==t;){if(Ri(t))break e;t=t.return}throw Error(s(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(s(161))}16&n.flags&&(xe(t),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||Ri(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?Pi(e,n,t):Ni(e,n,t)}}function Pi(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?ye(n,e,t):pe(n,e);else if(4!==r&&null!==(e=e.child))for(Pi(e,t,n),e=e.sibling;null!==e;)Pi(e,t,n),e=e.sibling}function Ni(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?be(n,e,t):fe(n,e);else if(4!==r&&null!==(e=e.child))for(Ni(e,t,n),e=e.sibling;null!==e;)Ni(e,t,n),e=e.sibling}function Bi(e,t){for(var n,r,i=t,o=!1;;){if(!o){o=i.return;e:for(;;){if(null===o)throw Error(s(160));switch(n=o.stateNode,o.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}o=o.return}o=!0}if(5===i.tag||6===i.tag)Ii(e,i),r?Se(n,i.stateNode):we(n,i.stateNode);else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(Ti(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(o=!1)}i.sibling.return=i.return,i=i.sibling}}function Li(e,t){if(X){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void Ai(3,t);case 1:case 12:case 17:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps;e=null!==e?e.memoizedProps:r;var i=t.type,o=t.updateQueue;t.updateQueue=null,null!==o&&ve(n,o,i,e,r,t)}return;case 6:if(null===t.stateNode)throw Error(s(162));return n=t.memoizedProps,void me(t.stateNode,null!==e?e.memoizedProps:n,n);case 3:return void(Z&&(t=t.stateNode,t.hydrate&&(t.hydrate=!1,Ve(t.containerInfo))));case 13:return Di(t),void Ui(t);case 19:return void Ui(t);case 23:case 24:return void Ci(t,null!==t.memoizedState)}throw Error(s(163))}switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void Ai(3,t);case 12:case 23:case 24:return;case 13:return Di(t),void Ui(t);case 19:return void Ui(t);case 3:Z&&((n=t.stateNode).hydrate&&(n.hydrate=!1,Ve(n.containerInfo)))}e:if(Y){switch(t.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:t=t.stateNode,Oe(t.containerInfo,t.pendingChildren);break e}throw Error(s(163))}}function Di(e){null!==e.memoizedState&&(go=Gt(),X&&Ci(e.child,!0))}function Ui(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new xi),t.forEach((function(t){var r=fa.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Fi(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var zi=0,ji=1,Hi=2,Gi=3,Vi=4;if("function"==typeof Symbol&&Symbol.for){var Wi=Symbol.for;zi=Wi("selector.component"),ji=Wi("selector.has_pseudo_class"),Hi=Wi("selector.role"),Gi=Wi("selector.test_id"),Vi=Wi("selector.text")}function qi(e){var t=$(e);if(null!=t){if("string"!=typeof t.memoizedProps["data-testname"])throw Error(s(364));return t}if(null===(e=ae(e)))throw Error(s(362));return e.stateNode.current}function Ki(e,t){switch(t.$$typeof){case zi:if(e.type===t.value)return!0;break;case ji:e:{t=t.value,e=[e,0];for(var n=0;n<e.length;){var r=e[n++],i=e[n++],o=t[i];if(5!==r.tag||!ce(r)){for(;null!=o&&Ki(r,o);)o=t[++i];if(i===t.length){t=!0;break e}for(r=r.child;null!==r;)e.push(r,i),r=r.sibling}}t=!1}return t;case Hi:if(5===e.tag&&ue(e.stateNode,t.value))return!0;break;case Vi:if((5===e.tag||6===e.tag)&&null!==(e=le(e))&&0<=e.indexOf(t.value))return!0;break;case Gi:if(5===e.tag&&("string"==typeof(e=e.memoizedProps["data-testname"])&&e.toLowerCase()===t.value.toLowerCase()))return!0;break;default:throw Error(s(365,t))}return!1}function Ji(e){switch(e.$$typeof){case zi:return"<"+(T(e.value)||"Unknown")+">";case ji:return":has("+(Ji(e)||"")+")";case Hi:return'[role="'+e.value+'"]';case Vi:return'"'+e.value+'"';case Gi:return'[data-testname="'+e.value+'"]';default:throw Error(s(365,e))}}function Qi(e,t){var n=[];e=[e,0];for(var r=0;r<e.length;){var i=e[r++],o=e[r++],a=t[o];if(5!==i.tag||!ce(i)){for(;null!=a&&Ki(i,a);)a=t[++o];if(o===t.length)n.push(i);else for(i=i.child;null!==i;)e.push(i,o),i=i.sibling}}return n}function Xi(e,t){if(!oe)throw Error(s(363));e=Qi(e=qi(e),t),t=[],e=Array.from(e);for(var n=0;n<e.length;){var r=e[n++];if(5===r.tag)ce(r)||t.push(r.stateNode);else for(r=r.child;null!==r;)e.push(r),r=r.sibling}return t}var Yi=null;var Zi=Math.ceil,$i=l.ReactCurrentDispatcher,eo=l.ReactCurrentOwner,to=l.IsSomeRendererActing,no=0,ro=null,io=null,oo=0,ao=0,so=Ye(0),lo=0,co=null,uo=0,ho=0,fo=0,po=0,mo=null,go=0,vo=1/0;function bo(){vo=Gt()+500}var yo,wo=null,So=!1,xo=null,Mo=null,_o=!1,Ao=null,Eo=90,Co=[],To=[],Io=null,ko=0,Ro=null,Oo=-1,Po=0,No=0,Bo=null,Lo=!1;function Do(){return 0!=(48&no)?Gt():-1!==Oo?Oo:Oo=Gt()}function Uo(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===Vt()?1:2;if(0===Po&&(Po=uo),0!==Xt.transition){0!==No&&(No=null!==mo?mo.pendingLanes:0),e=Po;var t=4186112&~No;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Vt(),0!=(4&no)&&98===e?e=bt(12,Po):e=bt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),Po),e}function Fo(e,t,n){if(50<ko)throw ko=0,Ro=null,Error(s(185));if(null===(e=zo(e,t)))return null;St(e,t,n),e===ro&&(fo|=t,4===lo&&Go(e,oo));var r=Vt();1===t?0!=(8&no)&&0==(48&no)?Vo(e):(jo(e,n),0===no&&(bo(),Jt())):(0==(4&no)||98!==r&&99!==r||(null===Io?Io=new Set([e]):Io.add(e)),jo(e,n)),mo=e}function zo(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function jo(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-xt(a),c=1<<l,u=o[l];if(-1===u){if(0==(c&r)||0!=(c&i)){u=t,mt(c);var d=pt;o[l]=10<=d?u+250:6<=d?u+5e3:-1}}else u<=t&&(e.expiredLanes|=c);a&=~c}if(r=gt(e,e===ro?oo:0),t=pt,0===r)null!==n&&(n!==Dt&&Ct(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Dt&&Ct(n)}15===t?(n=Vo.bind(null,e),null===Ft?(Ft=[n],zt=Et(Ot,Qt)):Ft.push(n),n=Dt):14===t?n=Kt(99,Vo.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(s(358,e))}}(t),n=Kt(n,Ho.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function Ho(e){if(Oo=-1,No=Po=0,0!=(48&no))throw Error(s(327));var t=e.callbackNode;if(aa()&&e.callbackNode!==t)return null;var n=gt(e,e===ro?oo:0);if(0===n)return null;var r=n,i=no;no|=16;var o=Yo();for(ro===e&&oo===r||(bo(),Qo(e,r));;)try{ea();break}catch(t){Xo(e,t)}if(sn(),$i.current=o,no=i,null!==io?r=0:(ro=null,oo=0,r=lo),0!=(uo&fo))Qo(e,0);else if(0!==r){if(2===r&&(no|=64,e.hydrate&&(e.hydrate=!1,Ce(e.containerInfo)),0!==(n=vt(e))&&(r=Zo(e,n))),1===r)throw t=co,Qo(e,0),Go(e,n),jo(e,Gt()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(s(345));case 2:case 5:ra(e);break;case 3:if(Go(e,n),(62914560&n)===n&&10<(r=go+500-Gt())){if(0!==gt(e,0))break;if(((i=e.suspendedLanes)&n)!==n){Do(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=q(ra.bind(null,e),r);break}ra(e);break;case 4:if(Go(e,n),(4186112&n)===n)break;for(r=e.eventTimes,i=-1;0<n;){var a=31-xt(n);o=1<<a,(a=r[a])>i&&(i=a),n&=~o}if(n=i,10<(n=(120>(n=Gt()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Zi(n/1960))-n)){e.timeoutHandle=q(ra.bind(null,e),n);break}ra(e);break;default:throw Error(s(329))}}return jo(e,Gt()),e.callbackNode===t?Ho.bind(null,e):null}function Go(e,t){for(t&=~po,t&=~fo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-xt(t),r=1<<n;e[n]=-1,t&=~r}}function Vo(e){if(0!=(48&no))throw Error(s(327));if(aa(),e===ro&&0!=(e.expiredLanes&oo)){var t=oo,n=Zo(e,t);0!=(uo&fo)&&(n=Zo(e,t=gt(e,t)))}else n=Zo(e,t=gt(e,0));if(0!==e.tag&&2===n&&(no|=64,e.hydrate&&(e.hydrate=!1,Ce(e.containerInfo)),0!==(t=vt(e))&&(n=Zo(e,t))),1===n)throw n=co,Qo(e,0),Go(e,t),jo(e,Gt()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,ra(e),jo(e,Gt()),null}function Wo(e,t){var n=no;no|=1;try{return e(t)}finally{0===(no=n)&&(bo(),Jt())}}function qo(e,t){var n=no;if(0!=(48&n))return e(t);no|=1;try{if(e)return qt(99,e.bind(null,t))}finally{no=n,Jt()}}function Ko(e,t){$e(so,ao),ao|=t,uo|=t}function Jo(){ao=so.current,Ze(so)}function Qo(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==J&&(e.timeoutHandle=J,K(n)),null!==io)for(n=io.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&at();break;case 3:zn(),Ze(nt),Ze(tt),tr();break;case 5:Hn(r);break;case 4:zn();break;case 13:case 19:Ze(Gn);break;case 10:cn(r);break;case 23:case 24:Jo()}n=n.return}ro=e,io=_a(e.current,null),oo=ao=uo=t,lo=0,co=null,po=fo=ho=0}function Xo(e,t){for(;;){var n=io;try{if(sn(),nr.current=Dr,lr){for(var r=or.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}lr=!1}if(ir=0,sr=ar=or=null,cr=!1,eo.current=null,null===n||null===n.return){lo=1,co=t,io=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=oo,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var c=l;if(0==(2&s.mode)){var u=s.alternate;u?(s.updateQueue=u.updateQueue,s.memoizedState=u.memoizedState,s.lanes=u.lanes):(s.updateQueue=null,s.memoizedState=null)}var d=0!=(1&Gn.current),h=a;do{var f;if(f=13===h.tag){var p=h.memoizedState;if(null!==p)f=null!==p.dehydrated;else{var m=h.memoizedProps;f=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!d)}}if(f){var g=h.updateQueue;if(null===g){var v=new Set;v.add(c),h.updateQueue=v}else g.add(c);if(0==(2&h.mode)){if(h.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var b=gn(-1,1);b.tag=2,vn(s,b)}s.lanes|=1;break e}l=void 0,s=t;var y=o.pingCache;if(null===y?(y=o.pingCache=new yi,l=new Set,y.set(c,l)):void 0===(l=y.get(c))&&(l=new Set,y.set(c,l)),!l.has(s)){l.add(s);var w=ha.bind(null,o,c,s);c.then(w,w)}h.flags|=4096,h.lanes=t;break e}h=h.return}while(null!==h);l=Error((T(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==lo&&(lo=2),l=vi(l,s),h=a;do{switch(h.tag){case 3:o=l,h.flags|=4096,t&=-t,h.lanes|=t,bn(h,wi(0,o,t));break e;case 1:o=l;var S=h.type,x=h.stateNode;if(0==(64&h.flags)&&("function"==typeof S.getDerivedStateFromError||null!==x&&"function"==typeof x.componentDidCatch&&(null===Mo||!Mo.has(x)))){h.flags|=4096,t&=-t,h.lanes|=t,bn(h,Si(h,o,t));break e}}h=h.return}while(null!==h)}na(n)}catch(e){t=e,io===n&&null!==n&&(io=n=n.return);continue}break}}function Yo(){var e=$i.current;return $i.current=Dr,null===e?Dr:e}function Zo(e,t){var n=no;no|=16;var r=Yo();for(ro===e&&oo===t||Qo(e,t);;)try{$o();break}catch(t){Xo(e,t)}if(sn(),no=n,$i.current=r,null!==io)throw Error(s(261));return ro=null,oo=0,lo}function $o(){for(;null!==io;)ta(io)}function ea(){for(;null!==io&&!Tt();)ta(io)}function ta(e){var t=yo(e.alternate,e,ao);e.memoizedProps=e.pendingProps,null===t?na(e):io=t,eo.current=null}function na(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=mi(n,t,ao)))return void(io=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&ao)||0==(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=gi(t)))return n.flags&=2047,void(io=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(io=t);io=t=e}while(null!==t);0===lo&&(lo=5)}function ra(e){var t=Vt();return qt(99,ia.bind(null,e,t)),null}function ia(e,t){do{aa()}while(null!==Ao);if(0!=(48&no))throw Error(s(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(s(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,o=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var a=e.eventTimes,l=e.expirationTimes;0<o;){var c=31-xt(o),u=1<<c;i[c]=0,a[c]=-1,l[c]=-1,o&=~u}if(null!==Io&&0==(24&r)&&Io.has(e)&&Io.delete(e),e===ro&&(io=ro=null,oo=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){i=no,no|=32,eo.current=null,Bo=U(e.containerInfo),Lo=!1,wo=r;do{try{oa()}catch(e){if(null===wo)throw Error(s(330));da(wo,e),wo=wo.nextEffect}}while(null!==wo);Bo=null,wo=r;do{try{for(a=e;null!==wo;){var d=wo.flags;if(16&d&&X&&xe(wo.stateNode),128&d){var h=wo.alternate;if(null!==h){var f=h.ref;null!==f&&("function"==typeof f?f(null):f.current=null)}}switch(1038&d){case 2:Oi(wo),wo.flags&=-3;break;case 6:Oi(wo),wo.flags&=-3,Li(wo.alternate,wo);break;case 1024:wo.flags&=-1025;break;case 1028:wo.flags&=-1025,Li(wo.alternate,wo);break;case 4:Li(wo.alternate,wo);break;case 8:l=a,o=wo,X?Bi(l,o):Ii(l,o);var p=o.alternate;ki(o),null!==p&&ki(p)}wo=wo.nextEffect}}catch(e){if(null===wo)throw Error(s(330));da(wo,e),wo=wo.nextEffect}}while(null!==wo);Lo&&re(),F(e.containerInfo),e.current=n,wo=r;do{try{for(d=e;null!==wo;){var m=wo.flags;if(36&m&&Ei(d,wo.alternate,wo),128&m){h=void 0;var g=wo.ref;if(null!==g){var v=wo.stateNode;if(5===wo.tag)h=B(v);else h=v;"function"==typeof g?g(h):g.current=h}}wo=wo.nextEffect}}catch(e){if(null===wo)throw Error(s(330));da(wo,e),wo=wo.nextEffect}}while(null!==wo);wo=null,Ut(),no=i}else e.current=n;if(_o)_o=!1,Ao=e,Eo=t;else for(wo=r;null!==wo;)t=wo.nextEffect,wo.nextEffect=null,8&wo.flags&&((m=wo).sibling=null,m.stateNode=null),wo=t;if(0===(r=e.pendingLanes)&&(Mo=null),1===r?e===Ro?ko++:(ko=0,Ro=e):ko=0,n=n.stateNode,ht&&"function"==typeof ht.onCommitFiberRoot)try{ht.onCommitFiberRoot(dt,n,void 0,64==(64&n.current.flags))}catch(e){}if(jo(e,Gt()),So)throw So=!1,e=xo,xo=null,e;return 0!=(8&no)||Jt(),null}function oa(){for(;null!==wo;){var e=wo.alternate;Lo||null===Bo||(0!=(8&wo.flags)?P(wo,Bo)&&(Lo=!0,ne()):13===wo.tag&&Fi(e,wo)&&P(wo,Bo)&&(Lo=!0,ne()));var t=wo.flags;0!=(256&t)&&_i(e,wo),0==(512&t)||_o||(_o=!0,Kt(97,(function(){return aa(),null}))),wo=wo.nextEffect}}function aa(){if(90!==Eo){var e=97<Eo?97:Eo;return Eo=90,qt(e,ca)}return!1}function sa(e,t){Co.push(t,e),_o||(_o=!0,Kt(97,(function(){return aa(),null})))}function la(e,t){To.push(t,e),_o||(_o=!0,Kt(97,(function(){return aa(),null})))}function ca(){if(null===Ao)return!1;var e=Ao;if(Ao=null,0!=(48&no))throw Error(s(331));var t=no;no|=32;var n=To;To=[];for(var r=0;r<n.length;r+=2){var i=n[r],o=n[r+1],a=i.destroy;if(i.destroy=void 0,"function"==typeof a)try{a()}catch(e){if(null===o)throw Error(s(330));da(o,e)}}for(n=Co,Co=[],r=0;r<n.length;r+=2){i=n[r],o=n[r+1];try{var l=i.create;i.destroy=l()}catch(e){if(null===o)throw Error(s(330));da(o,e)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return no=t,Jt(),!0}function ua(e,t,n){vn(e,t=wi(0,t=vi(n,t),1)),t=Do(),null!==(e=zo(e,1))&&(St(e,1,t),jo(e,t))}function da(e,t){if(3===e.tag)ua(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){ua(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Mo||!Mo.has(r))){var i=Si(n,e=vi(t,e),1);if(vn(n,i),i=Do(),null!==(n=zo(n,1)))St(n,1,i),jo(n,i);else if("function"==typeof r.componentDidCatch&&(null===Mo||!Mo.has(r)))try{r.componentDidCatch(t,e)}catch(e){}break}}n=n.return}}function ha(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Do(),e.pingedLanes|=e.suspendedLanes&n,ro===e&&(oo&n)===n&&(4===lo||3===lo&&(62914560&oo)===oo&&500>Gt()-go?Qo(e,0):po|=n),jo(e,t)}function fa(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===Vt()?1:2:(0===Po&&(Po=uo),0===(t=yt(62914560&~Po))&&(t=4194304))),n=Do(),null!==(e=zo(e,t))&&(St(e,t,n),jo(e,n))}yo=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||nt.current)Hr=!0;else{if(0==(n&r)){switch(Hr=!1,t.tag){case 3:Zr(t),$n();break;case 5:jn(t);break;case 1:ot(t.type)&&ct(t);break;case 4:Fn(t,t.stateNode.containerInfo);break;case 10:ln(t,t.memoizedProps.value);break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?ii(e,t,n):($e(Gn,1&Gn.current),null!==(t=di(e,t,n))?t.sibling:null);$e(Gn,1&Gn.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(64&e.flags)){if(r)return ui(e,t,n);t.flags|=64}var i=t.memoizedState;if(null!==i&&(i.rendering=null,i.tail=null,i.lastEffect=null),$e(Gn,Gn.current),r)break;return null;case 23:case 24:return t.lanes=0,Kr(e,t,n)}return di(e,t,n)}Hr=0!=(16384&e.flags)}else Hr=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=it(t,tt.current),dn(t,n),i=hr(null,t,r,e,i,n),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,ot(r)){var o=!0;ct(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,pn(t);var a=r.getDerivedStateFromProps;"function"==typeof a&&xn(t,r,a,e),i.updater=Mn,t.stateNode=i,i._reactInternals=t,Cn(t,r,e,n),t=Yr(null,t,r,!0,o,n)}else t.tag=0,Gr(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(o=i._init)(i._payload),t.type=i,o=t.tag=function(e){if("function"==typeof e)return Ma(e)?1:0;if(null!=e){if((e=e.$$typeof)===g)return 11;if(e===y)return 14}return 2}(i),e=tn(i,e),o){case 0:t=Qr(null,t,i,e,n);break e;case 1:t=Xr(null,t,i,e,n);break e;case 11:t=Vr(null,t,i,e,n);break e;case 14:t=Wr(null,t,i,tn(i.type,e),r,n);break e}throw Error(s(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,Qr(e,t,r,i=t.elementType===r?i:tn(r,i),n);case 1:return r=t.type,i=t.pendingProps,Xr(e,t,r,i=t.elementType===r?i:tn(r,i),n);case 3:if(Zr(t),r=t.updateQueue,null===e||null===r)throw Error(s(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,mn(e,t),yn(t,r,null,n),(r=t.memoizedState.element)===i)$n(),t=di(e,t,n);else{if((o=(i=t.stateNode).hydrate)&&(Z?(qn=ze(t.stateNode.containerInfo),Wn=t,o=Kn=!0):o=!1),o){if(Z&&null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)o=e[i],a=e[i+1],Q?o._workInProgressVersionPrimary=a:o._workInProgressVersionSecondary=a,er.push(o);for(n=Pn(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Gr(e,t,r,n),$n();t=t.child}return t;case 5:return jn(t),null===e&&Xn(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,V(r,i)?a=null:null!==o&&V(r,o)&&(t.flags|=16),Jr(e,t),Gr(e,t,a,n),t.child;case 6:return null===e&&Xn(t),null;case 13:return ii(e,t,n);case 4:return Fn(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=On(t,null,r,n):Gr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Vr(e,t,r,i=t.elementType===r?i:tn(r,i),n);case 7:return Gr(e,t,t.pendingProps,n),t.child;case 8:case 12:return Gr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,ln(t,o=i.value),null!==a){var l=a.value;if(0===(o=Yt(l,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,o):1073741823))){if(a.children===i.children&&!nt.current){t=di(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var c=l.dependencies;if(null!==c){a=l.child;for(var u=c.firstContext;null!==u;){if(u.context===r&&0!=(u.observedBits&o)){1===l.tag&&((u=gn(-1,n&-n)).tag=2,vn(l,u)),l.lanes|=n,null!==(u=l.alternate)&&(u.lanes|=n),un(l.return,n),c.lanes|=n;break}u=u.next}}else a=10===l.tag&&l.type===t.type?null:l.child;if(null!==a)a.return=l;else for(a=l;null!==a;){if(a===t){a=null;break}if(null!==(l=a.sibling)){l.return=a.return,a=l;break}a=a.return}l=a}}Gr(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(o=t.pendingProps).children,dn(t,n),r=r(i=hn(i,o.unstable_observedBits)),t.flags|=1,Gr(e,t,r,n),t.child;case 14:return o=tn(i=t.type,t.pendingProps),Wr(e,t,i,o=tn(i.type,o),r,n);case 15:return qr(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:tn(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,ot(r)?(e=!0,ct(t)):e=!1,dn(t,n),An(t,r,i),Cn(t,r,i,n),Yr(null,t,r,!0,e,n);case 19:return ui(e,t,n);case 23:case 24:return Kr(e,t,n)}throw Error(s(156,t.tag))};var pa={current:!1},ma=a.unstable_flushAllWithoutAsserting,ga="function"==typeof ma;function va(){if(void 0!==ma)return ma();for(var e=!1;aa();)e=!0;return e}function ba(t){try{va(),function(t){if(null===Yi)try{var n=("require"+Math.random()).slice(0,7);Yi=(e&&e[n]).call(e,"timers").setImmediate}catch(e){Yi=function(e){var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}Yi(t)}((function(){va()?ba(t):t()}))}catch(e){t(e)}}var ya=0,wa=!1;function Sa(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function xa(e,t,n,r){return new Sa(e,t,n,r)}function Ma(e){return!(!(e=e.prototype)||!e.isReactComponent)}function _a(e,t){var n=e.alternate;return null===n?((n=xa(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Aa(e,t,n,r,i,o){var a=2;if(r=e,"function"==typeof e)Ma(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case d:return Ea(n.children,i,o,t);case x:a=8,i|=16;break;case h:a=8,i|=1;break;case f:return(e=xa(12,n,t,8|i)).elementType=f,e.type=f,e.lanes=o,e;case v:return(e=xa(13,n,t,i)).type=v,e.elementType=v,e.lanes=o,e;case b:return(e=xa(19,n,t,i)).elementType=b,e.lanes=o,e;case M:return Ca(n,i,o,t);case _:return(e=xa(24,n,t,i)).elementType=_,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case p:a=10;break e;case m:a=9;break e;case g:a=11;break e;case y:a=14;break e;case w:a=16,r=null;break e;case S:a=22;break e}throw Error(s(130,null==e?e:typeof e,""))}return(t=xa(a,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Ea(e,t,n,r){return(e=xa(7,e,r,t)).lanes=n,e}function Ca(e,t,n,r){return(e=xa(23,e,r,t)).elementType=M,e.lanes=n,e}function Ta(e,t,n){return(e=xa(6,e,null,t)).lanes=n,e}function Ia(e,t,n){return(t=xa(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ka(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=J,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=wt(0),this.expirationTimes=wt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),Z&&(this.mutableSourceEagerHydrationData=null)}function Ra(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(s(188));throw Error(s(268,Object.keys(e)))}return null===(e=O(t))?null:e.stateNode}function Oa(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Pa(e,t){Oa(e,t),(e=e.alternate)&&Oa(e,t)}function Na(e){return null===(e=O(e))?null:e.stateNode}function Ba(){return null}return n.IsThisRendererActing=pa,n.act=function(e){function t(){ya--,to.current=n,pa.current=r}!1===wa&&(wa=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),ya++;var n=to.current,r=pa.current;to.current=!0,pa.current=!0;try{var i=Wo(e)}catch(e){throw t(),e}if(null!==i&&"object"==typeof i&&"function"==typeof i.then)return{then:function(e,r){i.then((function(){1<ya||!0===ga&&!0===n?(t(),e()):ba((function(n){t(),n?r(n):e()}))}),(function(e){t(),r(e)}))}};try{1!==ya||!1!==ga&&!1!==n||va(),t()}catch(e){throw t(),e}return{then:function(e){e()}}},n.attemptContinuousHydration=function(e){13===e.tag&&(Fo(e,67108864,Do()),Pa(e,67108864))},n.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag){var t=Do(),n=Uo(e);Fo(e,n,t),Pa(e,n)}},n.attemptSynchronousHydration=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.hydrate){var n=mt(t.pendingLanes);t.expiredLanes|=n&t.pendingLanes,jo(t,Gt()),0==(48&no)&&(bo(),Jt())}break;case 13:var r=Do();qo((function(){return Fo(e,1,r)})),Pa(e,4)}},n.attemptUserBlockingHydration=function(e){13===e.tag&&(Fo(e,4,Do()),Pa(e,4))},n.batchedEventUpdates=function(e,t){var n=no;no|=2;try{return e(t)}finally{0===(no=n)&&(bo(),Jt())}},n.batchedUpdates=Wo,n.createComponentSelector=function(e){return{$$typeof:zi,value:e}},n.createContainer=function(e,t,n){return e=new ka(e,t,n),t=xa(3,null,null,2===t?7:1===t?3:0),e.current=t,t.stateNode=e,pn(t),e},n.createHasPsuedoClassSelector=function(e){return{$$typeof:ji,value:e}},n.createPortal=function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:u,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}},n.createRoleSelector=function(e){return{$$typeof:Hi,value:e}},n.createTestNameSelector=function(e){return{$$typeof:Gi,value:e}},n.createTextSelector=function(e){return{$$typeof:Vi,value:e}},n.deferredUpdates=function(e){return qt(97,e)},n.discreteUpdates=function(e,t,n,r,i){var o=no;no|=4;try{return qt(98,e.bind(null,t,n,r,i))}finally{0===(no=o)&&(bo(),Jt())}},n.findAllNodes=Xi,n.findBoundingRects=function(e,t){if(!oe)throw Error(s(363));t=Xi(e,t),e=[];for(var n=0;n<t.length;n++)e.push(se(t[n]));for(t=e.length-1;0<t;t--)for(var r=(n=e[t]).x,i=r+n.width,o=n.y,a=o+n.height,l=t-1;0<=l;l--)if(t!==l){var c=e[l],u=c.x,d=u+c.width,h=c.y,f=h+c.height;if(r>=u&&o>=h&&i<=d&&a<=f){e.splice(t,1);break}if(!(r!==u||n.width!==c.width||f<o||h>a)){h>o&&(c.height+=h-o,c.y=o),f<a&&(c.height=a-h),e.splice(t,1);break}if(!(o!==h||n.height!==c.height||d<r||u>i)){u>r&&(c.width+=u-r,c.x=r),d<i&&(c.width=i-u),e.splice(t,1);break}}return e},n.findHostInstance=Ra,n.findHostInstanceWithNoPortals=function(e){return null===(e=function(e){if(!(e=R(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child&&4!==t.tag)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}(e))?null:20===e.tag?e.stateNode.instance:e.stateNode},n.findHostInstanceWithWarning=function(e){return Ra(e)},n.flushControlled=function(e){var t=no;no|=1;try{qt(99,e)}finally{0===(no=t)&&(bo(),Jt())}},n.flushDiscreteUpdates=function(){0==(49&no)&&(function(){if(null!==Io){var e=Io;Io=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,jo(e,Gt())}))}Jt()}(),aa())},n.flushPassiveEffects=aa,n.flushSync=qo,n.focusWithin=function(e,t){if(!oe)throw Error(s(363));for(t=Qi(e=qi(e),t),t=Array.from(t),e=0;e<t.length;){var n=t[e++];if(!ce(n)){if(5===n.tag&&de(n.stateNode))return!0;for(n=n.child;null!==n;)t.push(n),n=n.sibling}}return!1},n.getCurrentUpdateLanePriority=function(){return ft},n.getFindAllNodesFailureDescription=function(e,t){if(!oe)throw Error(s(363));var n=0,r=[];e=[qi(e),0];for(var i=0;i<e.length;){var o=e[i++],a=e[i++],l=t[a];if((5!==o.tag||!ce(o))&&(Ki(o,l)&&(r.push(Ji(l)),++a>n&&(n=a)),a<t.length))for(o=o.child;null!==o;)e.push(o,a),o=o.sibling}if(n<t.length){for(e=[];n<t.length;n++)e.push(Ji(t[n]));return"findAllNodes was able to match part of the selector:\n "+r.join(" > ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},n.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?B(e.child.stateNode):e.child.stateNode:null},n.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:Na,findFiberByHostInstance:e.findFiberByHostInstance||Ba,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t.isDisabled&&t.supportsFiber)try{dt=t.inject(e),ht=t}catch(e){}e=!0}return e},n.observeVisibleRects=function(e,t,n,r){if(!oe)throw Error(s(363));e=Xi(e,t);var i=he(e,n,r).disconnect;return{disconnect:function(){i()}}},n.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},n.runWithPriority=function(e,t){var n=ft;try{return ft=e,t()}finally{ft=n}},n.shouldSuspend=function(){return!1},n.unbatchedUpdates=function(e,t){var n=no;no&=-2,no|=8;try{return e(t)}finally{0===(no=n)&&(bo(),Jt())}},n.updateContainer=function(e,t,n,r){var i=t.current,o=Do(),a=Uo(i);e:if(n){t:{if(I(n=n._reactInternals)!==n||1!==n.tag)throw Error(s(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(ot(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(s(171))}if(1===n.tag){var c=n.type;if(ot(c)){n=lt(n,c,l);break e}}n=l}else n=et;return null===t.context?t.context=n:t.pendingContext=n,(t=gn(o,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),vn(i,t),Fo(i,a,o),a},n}})),o("juxiN").register(JSON.parse('{"adfgW":"index.js","cmazm":"abap.bc6c1a94.js","jPTA1":"abnf.a3fdbafa.js","jdWNC":"actionscript.59d9b9ea.js","2CBqg":"ada.7ae8a3a8.js","3wHhO":"agda.c22a72e2.js","kFVdl":"al.43edf93f.js","3V4RR":"antlr4.fab93bd9.js","ksX9L":"apacheconf.1ea6f6bc.js","3N81M":"apex.5f5d0b00.js","lBh32":"apl.f0e0255a.js","1cOI2":"applescript.f8873ad2.js","hwV5I":"aql.0596cd74.js","cxQUy":"arduino.8a10351d.js","h8XDs":"arff.b6eba224.js","1glOK":"asciidoc.3591554e.js","5YI5Q":"asm6502.eb3baf93.js","5aM2c":"asmatmel.93b67168.js","aKcNk":"aspnet.a154be94.js","bYGuI":"csharp.60bc2788.js","4ffJ6":"autohotkey.dc99c6b5.js","6o8gr":"autoit.7bd54007.js","d0QlI":"avisynth.506bbdad.js","1vpfH":"avro-idl.ab78e3d7.js","d78C2":"basic.09310972.js","1V5ou":"batch.5c48c918.js","h9qnw":"bbcode.4e0cb2f2.js","eluAn":"bicep.e394696d.js","jD2Yh":"birb.54766d79.js","3ligT":"bison.2c2552ab.js","cSnAi":"bnf.ec556d42.js","gmloY":"brainfuck.4e81eb1d.js","77rtQ":"brightscript.3c7cc723.js","hfFki":"bro.8db28f8a.js","8SYqo":"bsl.260fabfb.js","i4HkI":"cfscript.92c90b90.js","1rBYK":"chaiscript.76481f4b.js","gQYEz":"cil.622792d1.js","bq2uf":"clike.36346267.js","h7tza":"clojure.9da4900e.js","aK2oY":"cmake.234b57e3.js","3V5TZ":"cobol.2e8bd2ea.js","72v5N":"coffeescript.261b318a.js","lNJYg":"concurnas.9d189a8c.js","cHo4f":"coq.917e2a53.js","7GKmU":"crystal.d23925f3.js","a5f4n":"cshtml.92086949.js","2nOzn":"csp.9b5dd573.js","iZH8k":"css-extras.7f3088a6.js","3V9km":"css.fb6f00e3.js","7TCh4":"csv.06af3522.js","8MqYl":"cypher.6af6e534.js","6Oo3A":"d.303192e5.js","6ks0D":"dart.6fb62874.js","huqsT":"dataweave.e97ef31d.js","YtcLG":"dax.013d5e9a.js","1s9Hz":"dhall.d5ee83ba.js","b677V":"diff.9ef56ea8.js","ak2pO":"django.13b0bb49.js","8LDFZ":"dns-zone-file.189b08c5.js","1awLf":"docker.1da9769e.js","9dPYr":"dot.8dca92f3.js","e2ZjS":"ebnf.58c0fa63.js","9h8KW":"editorconfig.9c7b63a5.js","4SWgd":"eiffel.090bab86.js","6HmuU":"ejs.0ee535c3.js","2KAkF":"elixir.dc192ee6.js","jPV3v":"elm.c88782bd.js","agNrQ":"erb.55ec7cf0.js","9BmS2":"erlang.956455fa.js","fqf1c":"etlua.79f6dba5.js","cgMSr":"lua.88c0a077.js","92McF":"excel-formula.d0dd1424.js","juFxG":"factor.e311ca38.js","1dWPh":"false.a93fe44c.js","2k0b2":"firestore-security-rules.4ea155d7.js","dvL1Q":"flow.96e0f48a.js","5oumN":"fortran.0811bc79.js","fP8jO":"fsharp.0119d0fd.js","7L6sP":"ftl.c5671dbe.js","2ujce":"gap.b0574953.js","hzgIA":"gcode.29260c31.js","5MUDD":"gdscript.545f127b.js","ghckm":"gedcom.d53f8a81.js","ian9z":"gherkin.0c5a099f.js","dsuH3":"git.2d89a25c.js","dvV8S":"glsl.0bf837a6.js","6BDWE":"gml.04204c1b.js","btSYt":"gn.cbb4c3be.js","j94Lr":"go-module.2bebc9b8.js","207xG":"go.cc49e5b2.js","iQ4Nh":"graphql.3d658adb.js","9E9pJ":"groovy.3e5836cd.js","hLXUt":"haml.9a056759.js","5ob5h":"handlebars.8c13dfe6.js","1nDhS":"haskell.3c80aa72.js","kQehe":"haxe.40a1dc98.js","1sziu":"hcl.84488f47.js","28Tam":"hlsl.323b0c17.js","awNOU":"hoon.df16cb45.js","eeLMI":"hpkp.9c950797.js","gjEKw":"hsts.0440ab7b.js","3bCJ7":"http.96d5f1c1.js","id4YZ":"ichigojam.c0bd16f5.js","5TKHe":"icon.439feb9f.js","eijPh":"icu-message-format.e96f6551.js","lv8gR":"idris.d3811412.js","bW8K3":"iecst.3fdbbc52.js","b8EBv":"ignore.00726ce9.js","jOS96":"inform7.65978ef5.js","dn3Yf":"ini.1cbb0515.js","iUSU6":"io.e628fd7e.js","6wbwo":"j.b959d174.js","5qA0j":"java.0ffd8069.js","hdx4d":"javadoc.b99752ae.js","jRMSs":"javadoclike.8cc3d825.js","l2DRD":"javascript.fe729813.js","cpOeo":"javastacktrace.cc22fb4b.js","fSVrK":"jexl.2cce5cc0.js","03mi8":"jolie.d8f352cd.js","j6YjP":"jq.65b95777.js","6JQIv":"js-extras.7d041902.js","5nVrm":"js-templates.a3463d0b.js","9gPZY":"jsdoc.0c5cc4d3.js","8q0xA":"json5.b9de5531.js","fIx8j":"jsonp.eefdc553.js","a3ur7":"jsstacktrace.8d3a2b71.js","bKtxi":"julia.679e1c74.js","9vqI0":"keepalived.e694c167.js","lDUCl":"keyman.d1406200.js","gcEXq":"kotlin.fd040b34.js","cxxOt":"kumir.b2072cfc.js","b8NIc":"kusto.98546fcc.js","iXz7U":"latex.ecc17a0d.js","9nRbn":"latte.18295a4f.js","lWxq2":"less.a8a986ab.js","7dEcL":"lilypond.0423d709.js","ck7Ll":"scheme.4039466f.js","hI3m3":"liquid.533f073c.js","7qpQZ":"lisp.b075bd53.js","8Cm1D":"livescript.2b19fb05.js","9sT8D":"llvm.6b74465d.js","gQkTU":"log.b74346d6.js","86y52":"lolcode.0fbc730a.js","6bXdx":"magma.bbb66246.js","hDIxO":"makefile.bf1a7653.js","4wRUQ":"markdown.4a5510a8.js","66rgq":"markup.973a8c4c.js","iAx9A":"matlab.caaa1e9f.js","5SXMq":"maxscript.58a0bf4d.js","gnQ55":"mel.c5da9d2e.js","8G54S":"mermaid.ced53190.js","gfXsu":"mizar.4e6d6035.js","7nZsb":"mongodb.5c4e0cf9.js","hUs37":"monkey.9be800f3.js","fKqwA":"moonscript.fc782589.js","luHXo":"n1ql.7f05115f.js","j0sqX":"n4js.318f41b7.js","avS2d":"nand2tetris-hdl.be3bb656.js","8fNUI":"naniscript.ec3afc9a.js","6PKtR":"nasm.1ee2623a.js","2LUGi":"neon.1d5a4ec8.js","esMLb":"nevod.6908715c.js","jQ8dR":"nginx.404fbeb4.js","1kuW2":"nim.36bf497b.js","7YxPR":"nix.3af3b6b2.js","b1EPY":"nsis.94e1fb71.js","j169M":"objectivec.49a6b342.js","1b4qw":"ocaml.c5fca1eb.js","c0JxA":"opencl.4194613a.js","54ivl":"openqasm.4b589cb3.js","kYO5l":"oz.498e9cbd.js","811Qi":"parigp.ed6a3789.js","gXO52":"parser.3329b2ab.js","4SQCy":"pascal.82aebbcf.js","9KuwN":"pascaligo.4bbd3a85.js","eM7TR":"pcaxis.e636466e.js","6w6GH":"peoplecode.32e124c6.js","eQPpI":"perl.7d72d7fd.js","b83gb":"php-extras.9606406b.js","l8BPM":"phpdoc.617f8af6.js","2cVRv":"plsql.482f8da9.js","gOyA3":"powerquery.486ee359.js","1BYb4":"powershell.856a4dd0.js","lIwm5":"processing.2c7d4403.js","cHCln":"prolog.812b5c86.js","d460J":"promql.8e6b9da4.js","lAnQP":"properties.40afd4d0.js","dG8OA":"protobuf.84963e3e.js","eRbDh":"psl.9c32166c.js","27W0o":"pug.54462c11.js","75Y4h":"puppet.2646aef5.js","kgGGG":"pure.a10bd6b4.js","hFuIq":"purebasic.629b75cd.js","db2yj":"purescript.216751ba.js","8ZppB":"q.b46a94a4.js","iFM89":"qml.bd71f711.js","7FNJV":"qore.d7e006f8.js","6AsUF":"qsharp.7bab07d1.js","7Xrsp":"r.3036c5c0.js","dh9BI":"racket.b867dd29.js","8pRTf":"reason.405183ad.js","kUbHD":"regex.aa4684b4.js","bNx4l":"rego.61da6b5d.js","jbksA":"renpy.ff0ce389.js","gP26j":"rest.91bee177.js","6FCYh":"rip.33f479a4.js","lEjxk":"roboconf.0ba2e9bf.js","c8BOJ":"robotframework.72ccad61.js","elAoE":"rust.9a35cb62.js","eDL1o":"sas.b3b3be64.js","gIQMB":"sass.165275f3.js","i7Y8T":"scala.a51a6234.js","OzRer":"shell-session.c47a7880.js","hZA2W":"smali.46e3f703.js","gT51y":"smalltalk.fb31e155.js","2OoIP":"smarty.abd6973e.js","33hrk":"sml.6d8c2545.js","3uuqi":"solidity.80562c5b.js","kHJvD":"solution-file.30e00f5f.js","6iiDq":"soy.46a7ec1f.js","2TkEp":"sparql.dbb56be0.js","eirDq":"turtle.b8836781.js","jmDes":"splunk-spl.149146f6.js","81dr7":"sqf.ea070acb.js","i4XqC":"squirrel.1efaf6f3.js","1zw3p":"stan.6efb4565.js","kfIG2":"stylus.d4d41ca4.js","dksml":"swift.ea86fdd0.js","4w3mZ":"systemd.df819c28.js","6b6p1":"t4-cs.b3eaa646.js","budu0":"t4-templating.db399052.js","7RUUk":"t4-vb.082c208c.js","2cwdT":"vbnet.ac572fcc.js","fBA7X":"tap.82e5520b.js","gqbYu":"yaml.3d0bf472.js","lCVk7":"tcl.fffb53bb.js","aKXaK":"textile.20ae1d45.js","ks7hU":"toml.69754057.js","kCJbl":"tremor.262b95d4.js","iZ71n":"tt2.f07906cb.js","5mLLA":"twig.a95c4964.js","i9AIa":"typoscript.3dbd38d9.js","iHNMy":"unrealscript.e5c3fc1d.js","bKWLJ":"uorazor.cf3ed6dc.js","2XcAn":"uri.59c4e10c.js","enDcg":"v.fe8e0874.js","db4Ta":"vala.386e6270.js","cmaSk":"velocity.9a0ffb21.js","29RKO":"verilog.4308f028.js","4aBVG":"vhdl.ca8ee4c0.js","6Jrfy":"vim.897929a5.js","kNyzl":"visual-basic.bc36aaac.js","4LJ5s":"warpscript.6d00b50f.js","6Ocza":"wasm.029f651e.js","hvPGO":"web-idl.97fc763d.js","lS90V":"wiki.1179d7f8.js","9LY8Y":"wolfram.7017e6a0.js","bFBdJ":"wren.d4121438.js","iskNq":"xeora.cce693be.js","ek7X7":"xml-doc.025d4193.js","hwA94":"xojo.843f212e.js","f8rnQ":"xquery.50701bd4.js","3Q9qv":"yang.2c70775f.js","a0Oht":"zig.e33efe11.js","dnGOp":"core.ade097c7.js","9u7s7":"index.css"}'));var a;a=o("9Hk4c"),o("85Hg2");var s={};!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),s=o("bU6y3");var l,c=o("85Hg2");l=o("bG9xl")();var u,d=o("dCyaf"),h=o("1DJXa"),f=new Uint8Array(16);function p(){if(!u&&!(u="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return u(f)}var m=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var g=function(e){return"string"==typeof e&&m.test(e)},v=[],b=0;b<256;++b)v.push((b+256).toString(16).substr(1));var y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(v[e[t+0]]+v[e[t+1]]+v[e[t+2]]+v[e[t+3]]+"-"+v[e[t+4]]+v[e[t+5]]+"-"+v[e[t+6]]+v[e[t+7]]+"-"+v[e[t+8]]+v[e[t+9]]+"-"+v[e[t+10]]+v[e[t+11]]+v[e[t+12]]+v[e[t+13]]+v[e[t+14]]+v[e[t+15]]).toLowerCase();if(!g(n))throw TypeError("Stringified UUID is invalid");return n};var w=function(e,t,n){var r=(e=e||{}).random||(e.rng||p)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return y(r)};const S=()=>w(),x=()=>S().replace(new RegExp("-","g"),"").toUpperCase();var M,_,A,E,C,T,I,k;(_=M||(M={}))[_.Debug=0]="Debug",_[_.Info=1]="Info",_[_.Warning=2]="Warning",_[_.Error=3]="Error",_[_.None=4]="None";class R{constructor(e,t){this.privName=e,this.privEventId=x(),this.privEventTime=(new Date).toISOString(),this.privEventType=t,this.privMetadata={}}get name(){return this.privName}get eventId(){return this.privEventId}get eventTime(){return this.privEventTime}get eventType(){return this.privEventType}get metadata(){return this.privMetadata}}class O extends R{constructor(e,t,n=M.Info){super(e,n),this.privAudioSourceId=t}get audioSourceId(){return this.privAudioSourceId}}class P extends O{constructor(e){super("AudioSourceInitializingEvent",e)}}class N extends O{constructor(e){super("AudioSourceReadyEvent",e)}}class B extends O{constructor(e){super("AudioSourceOffEvent",e)}}class L extends O{constructor(e,t){super("AudioSourceErrorEvent",e,M.Error),this.privError=t}get error(){return this.privError}}class D extends O{constructor(e,t,n){super(e,t),this.privAudioNodeId=n}get audioNodeId(){return this.privAudioNodeId}}class U extends D{constructor(e,t){super("AudioStreamNodeAttachingEvent",e,t)}}class F extends D{constructor(e,t){super("AudioStreamNodeAttachedEvent",e,t)}}class z extends D{constructor(e,t){super("AudioStreamNodeDetachedEvent",e,t)}}class j extends D{constructor(e,t,n){super("AudioStreamNodeErrorEvent",e,t),this.privError=n}get error(){return this.privError}}class H extends R{constructor(e,t,n=M.Info){super(e,n),this.privJsonResult=t}get jsonString(){return this.privJsonResult}}class G extends R{constructor(e,t,n=M.Info){super(e,n),this.privConnectionId=t}get connectionId(){return this.privConnectionId}}class V extends G{constructor(e,t,n){super("ConnectionStartEvent",e),this.privUri=t,this.privHeaders=n}get uri(){return this.privUri}get headers(){return this.privHeaders}}class W extends G{constructor(e){super("ConnectionEstablishedEvent",e)}}class q extends G{constructor(e,t,n){super("ConnectionClosedEvent",e,M.Debug),this.privReason=n,this.privStatusCode=t}get reason(){return this.privReason}get statusCode(){return this.privStatusCode}}class K extends G{constructor(e,t,n){super("ConnectionErrorEvent",e,M.Debug),this.privMessage=t,this.privType=n}get message(){return this.privMessage}get type(){return this.privType}}class J extends G{constructor(e,t,n){super("ConnectionEstablishErrorEvent",e,M.Error),this.privStatusCode=t,this.privReason=n}get reason(){return this.privReason}get statusCode(){return this.privStatusCode}}class Q extends G{constructor(e,t,n){super("ConnectionMessageReceivedEvent",e),this.privNetworkReceivedTime=t,this.privMessage=n}get networkReceivedTime(){return this.privNetworkReceivedTime}get message(){return this.privMessage}}class X extends G{constructor(e,t,n){super("ConnectionMessageSentEvent",e),this.privNetworkSentTime=t,this.privMessage=n}get networkSentTime(){return this.privNetworkSentTime}get message(){return this.privMessage}}class Y extends Error{constructor(e){super(e),this.name="ArgumentNull",this.message=e}}class Z extends Error{constructor(e){super(e),this.name="InvalidOperation",this.message=e}}class $ extends Error{constructor(e,t){super(t),this.name=e+"ObjectDisposed",this.message=t}}(E=A||(A={}))[E.Text=0]="Text",E[E.Binary=1]="Binary";class ee{constructor(e,t,n,r){if(this.privBody=null,e===A.Text&&t&&"string"!=typeof t)throw new Z("Payload must be a string");if(e===A.Binary&&t&&!(t instanceof ArrayBuffer))throw new Z("Payload must be ArrayBuffer");switch(this.privMessageType=e,this.privBody=t,this.privHeaders=n||{},this.privId=r||x(),this.messageType){case A.Binary:this.privSize=null!==this.binaryBody?this.binaryBody.byteLength:0;break;case A.Text:this.privSize=this.textBody.length}}get messageType(){return this.privMessageType}get headers(){return this.privHeaders}get body(){return this.privBody}get textBody(){if(this.privMessageType===A.Binary)throw new Z("Not supported for binary message");return this.privBody}get binaryBody(){if(this.privMessageType===A.Text)throw new Z("Not supported for text message");return this.privBody}get id(){return this.privId}}class te{constructor(e,t){this.privStatusCode=e,this.privReason=t}get statusCode(){return this.privStatusCode}get reason(){return this.privReason}}class ne{constructor(e){this.privEventListeners={},this.privIsDisposed=!1,this.privConsoleListener=void 0,this.privMetadata=e}onEvent(e){if(this.isDisposed())throw new $("EventSource");if(this.metadata)for(const t in this.metadata)t&&e.metadata&&(e.metadata[t]||(e.metadata[t]=this.metadata[t]));for(const t in this.privEventListeners)t&&this.privEventListeners[t]&&this.privEventListeners[t](e)}attach(e){const t=x();return this.privEventListeners[t]=e,{detach:()=>(delete this.privEventListeners[t],Promise.resolve())}}attachListener(e){return this.attach((t=>e.onEvent(t)))}attachConsoleListener(e){return this.privConsoleListener&&this.privConsoleListener.detach(),this.privConsoleListener=this.attach((t=>e.onEvent(t))),this.privConsoleListener}isDisposed(){return this.privIsDisposed}dispose(){this.privEventListeners=null,this.privIsDisposed=!0}get metadata(){return this.privMetadata}}class re{static setEventSource(e){if(!e)throw new Y("eventSource");re.privInstance=e}static get instance(){return re.privInstance}}re.privInstance=new ne,(T=C||(C={}))[T.None=0]="None",T[T.Connected=1]="Connected",T[T.Connecting=2]="Connecting",T[T.Disconnected=3]="Disconnected",(k=I||(I={}))[k.None=0]="None",k[k.Resolved=1]="Resolved",k[k.Rejected=2]="Rejected";class ie{constructor(){this.resolve=e=>(this.privResolve(e),this),this.reject=e=>(this.privReject(e),this),this.privPromise=new Promise(((e,t)=>{this.privResolve=e,this.privReject=t}))}get promise(){return this.privPromise}}function oe(e,t,n){e.then((e=>{try{t&&t(e)}catch(e){if(n)try{if(e instanceof Error){const t=e;n(t.name+": "+t.message)}else n(e)}catch(e){}}}),(e=>{if(n)try{if(e instanceof Error){const t=e;n(t.name+": "+t.message)}else n(e)}catch(e){}}))}var ae={};e(ae,"Queue",(()=>de),(e=>de=e));class se{constructor(e){if(this.privSubscriptionIdCounter=0,this.privAddSubscriptions={},this.privRemoveSubscriptions={},this.privDisposedSubscriptions={},this.privDisposeReason=null,this.privList=[],e)for(const t of e)this.privList.push(t)}get(e){return this.throwIfDisposed(),this.privList[e]}first(){return this.get(0)}last(){return this.get(this.length()-1)}add(e){this.throwIfDisposed(),this.insertAt(this.privList.length,e)}insertAt(e,t){this.throwIfDisposed(),0===e?this.privList.unshift(t):e===this.privList.length?this.privList.push(t):this.privList.splice(e,0,t),this.triggerSubscriptions(this.privAddSubscriptions)}removeFirst(){return this.throwIfDisposed(),this.removeAt(0)}removeLast(){return this.throwIfDisposed(),this.removeAt(this.length()-1)}removeAt(e){return this.throwIfDisposed(),this.remove(e,1)[0]}remove(e,t){this.throwIfDisposed();const n=this.privList.splice(e,t);return this.triggerSubscriptions(this.privRemoveSubscriptions),n}clear(){this.throwIfDisposed(),this.remove(0,this.length())}length(){return this.throwIfDisposed(),this.privList.length}onAdded(e){this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privAddSubscriptions[t]=e,{detach:()=>(delete this.privAddSubscriptions[t],Promise.resolve())}}onRemoved(e){this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privRemoveSubscriptions[t]=e,{detach:()=>(delete this.privRemoveSubscriptions[t],Promise.resolve())}}onDisposed(e){this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privDisposedSubscriptions[t]=e,{detach:()=>(delete this.privDisposedSubscriptions[t],Promise.resolve())}}join(e){return this.throwIfDisposed(),this.privList.join(e)}toArray(){const e=Array();return this.privList.forEach((t=>{e.push(t)})),e}any(e){return this.throwIfDisposed(),e?this.where(e).length()>0:this.length()>0}all(e){return this.throwIfDisposed(),this.where(e).length()===this.length()}forEach(e){this.throwIfDisposed();for(let t=0;t<this.length();t++)e(this.privList[t],t)}select(e){this.throwIfDisposed();const t=[];for(let n=0;n<this.privList.length;n++)t.push(e(this.privList[n],n));return new se(t)}where(e){this.throwIfDisposed();const t=new se;for(let n=0;n<this.privList.length;n++)e(this.privList[n],n)&&t.add(this.privList[n]);return t}orderBy(e){this.throwIfDisposed();const t=this.toArray().sort(e);return new se(t)}orderByDesc(e){return this.throwIfDisposed(),this.orderBy(((t,n)=>e(n,t)))}clone(){return this.throwIfDisposed(),new se(this.toArray())}concat(e){return this.throwIfDisposed(),new se(this.privList.concat(e.toArray()))}concatArray(e){return this.throwIfDisposed(),new se(this.privList.concat(e))}isDisposed(){return null==this.privList}dispose(e){this.isDisposed()||(this.privDisposeReason=e,this.privList=null,this.privAddSubscriptions=null,this.privRemoveSubscriptions=null,this.triggerSubscriptions(this.privDisposedSubscriptions))}throwIfDisposed(){if(this.isDisposed())throw new $("List",this.privDisposeReason)}triggerSubscriptions(e){if(e)for(const t in e)t&&e[t]()}}var le,ce,ue=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};(ce=le||(le={}))[ce.Dequeue=0]="Dequeue",ce[ce.Peek=1]="Peek";class de{constructor(e){this.privPromiseStore=new se,this.privIsDrainInProgress=!1,this.privIsDisposing=!1,this.privDisposeReason=null,this.privList=e||new se,this.privDetachables=[],this.privSubscribers=new se,this.privDetachables.push(this.privList.onAdded((()=>this.drain())))}enqueue(e){this.throwIfDispose(),this.enqueueFromPromise(new Promise((t=>t(e))))}enqueueFromPromise(e){this.throwIfDispose(),e.then((e=>{this.privList.add(e)}),(()=>{}))}dequeue(){this.throwIfDispose();const e=new ie;return this.privSubscribers&&(this.privSubscribers.add({deferral:e,type:le.Dequeue}),this.drain()),e.promise}peek(){this.throwIfDispose();const e=new ie;return this.privSubscribers&&(this.privSubscribers.add({deferral:e,type:le.Peek}),this.drain()),e.promise}length(){return this.throwIfDispose(),this.privList.length()}isDisposed(){return null==this.privSubscribers}drainAndDispose(e,t){return ue(this,void 0,void 0,(function*(){if(!this.isDisposed()&&!this.privIsDisposing){this.privDisposeReason=t,this.privIsDisposing=!0;const n=this.privSubscribers;if(n){for(;n.length()>0;){n.removeFirst().deferral.resolve(void 0)}this.privSubscribers===n&&(this.privSubscribers=n)}for(const e of this.privDetachables)yield e.detach();if(this.privPromiseStore.length()>0&&e){const t=[];return this.privPromiseStore.toArray().forEach((e=>{t.push(e)})),Promise.all(t).finally((()=>{this.privSubscribers=null,this.privList.forEach((t=>{e(t)})),this.privList=null})).then()}this.privSubscribers=null,this.privList=null}}))}dispose(e){return ue(this,void 0,void 0,(function*(){yield this.drainAndDispose(null,e)}))}drain(){if(!this.privIsDrainInProgress&&!this.privIsDisposing){this.privIsDrainInProgress=!0;const e=this.privSubscribers,t=this.privList;if(e&&t){for(;t.length()>0&&e.length()>0&&!this.privIsDisposing;){const n=e.removeFirst();if(n.type===le.Peek)n.deferral.resolve(t.first());else{const e=t.removeFirst();n.deferral.resolve(e)}}this.privSubscribers===e&&(this.privSubscribers=e),this.privList===t&&(this.privList=t)}this.privIsDrainInProgress=!1}}throwIfDispose(){if(this.isDisposed()){if(this.privDisposeReason)throw new Z(this.privDisposeReason);throw new $("Queue")}if(this.privIsDisposing)throw new Z("Queue disposing")}}class he{constructor(e,t,n){if(this.privPayload=null,!t)throw new Y("payload");if(e===A.Binary&&"ArrayBuffer"!==t.__proto__.constructor.name)throw new Z("Payload must be ArrayBuffer");if(e===A.Text&&"string"!=typeof t)throw new Z("Payload must be a string");this.privMessageType=e,this.privPayload=t,this.privId=n||x()}get messageType(){return this.privMessageType}get payload(){return this.privPayload}get textContent(){if(this.privMessageType===A.Binary)throw new Z("Not supported for binary message");return this.privPayload}get binaryContent(){if(this.privMessageType===A.Text)throw new Z("Not supported for text message");return this.privPayload}get id(){return this.privId}}class fe{constructor(e,t){this.privActualSampleRate=e,this.privDesiredSampleRate=t}encode(e){const t=this.downSampleAudioFrame(e,this.privActualSampleRate,this.privDesiredSampleRate);if(!t)return null;const n=2*t.length,r=new ArrayBuffer(n),i=new DataView(r);return this.floatTo16BitPCM(i,0,t),r}setString(e,t,n){for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))}floatTo16BitPCM(e,t,n){for(let r=0;r<n.length;r++,t+=2){const i=Math.max(-1,Math.min(1,n[r]));e.setInt16(t,i<0?32768*i:32767*i,!0)}}downSampleAudioFrame(e,t,n){if(!e)return null;if(n===t||n>t)return e;const r=t/n,i=Math.round(e.length/r),o=new Float32Array(i);let a=0,s=0;for(;s<i;){const t=Math.round((s+1)*r);let n=0,i=0;for(;a<t&&a<e.length;)n+=e[a++],i++;o[s++]=n/i}return o}}var pe={};e(pe,"Stream",(()=>be),(e=>be=e));var me,ge,ve=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class be{constructor(e){this.privIsWriteEnded=!1,this.privIsReadEnded=!1,this.privId=e||x(),this.privReaderQueue=new(0,ae.Queue)}get isClosed(){return this.privIsWriteEnded}get isReadEnded(){return this.privIsReadEnded}get id(){return this.privId}close(){this.privIsWriteEnded||(this.writeStreamChunk({buffer:null,isEnd:!0,timeReceived:Date.now()}),this.privIsWriteEnded=!0)}writeStreamChunk(e){if(this.throwIfClosed(),!this.privReaderQueue.isDisposed())try{this.privReaderQueue.enqueue(e)}catch(e){}}read(){if(this.privIsReadEnded)throw new Z("Stream read has already finished");return this.privReaderQueue.dequeue().then((e=>ve(this,void 0,void 0,(function*(){return(void 0===e||e.isEnd)&&(yield this.privReaderQueue.dispose("End of stream reached")),e}))))}readEnded(){this.privIsReadEnded||(this.privIsReadEnded=!0,this.privReaderQueue=new(0,ae.Queue))}throwIfClosed(){if(this.privIsWriteEnded)throw new Z("Stream closed")}}(ge=me||(me={}))[ge.Success=0]="Success",ge[ge.Error=1]="Error";class ye extends pe.Stream{constructor(e,t){super(t),this.privTargetChunkSize=e,this.privNextBufferReadyBytes=0}writeStreamChunk(e){if(e.isEnd||0===this.privNextBufferReadyBytes&&e.buffer.byteLength===this.privTargetChunkSize)return void super.writeStreamChunk(e);let t=0;for(;t<e.buffer.byteLength;){void 0===this.privNextBufferToWrite&&(this.privNextBufferToWrite=new ArrayBuffer(this.privTargetChunkSize),this.privNextBufferStartTime=e.timeReceived);const n=Math.min(e.buffer.byteLength-t,this.privTargetChunkSize-this.privNextBufferReadyBytes),r=new Uint8Array(this.privNextBufferToWrite),i=new Uint8Array(e.buffer.slice(t,n+t));r.set(i,this.privNextBufferReadyBytes),this.privNextBufferReadyBytes+=n,t+=n,this.privNextBufferReadyBytes===this.privTargetChunkSize&&(super.writeStreamChunk({buffer:this.privNextBufferToWrite,isEnd:!1,timeReceived:this.privNextBufferStartTime}),this.privNextBufferReadyBytes=0,this.privNextBufferToWrite=void 0)}}close(){0===this.privNextBufferReadyBytes||this.isClosed||super.writeStreamChunk({buffer:this.privNextBufferToWrite.slice(0,this.privNextBufferReadyBytes),isEnd:!1,timeReceived:this.privNextBufferStartTime}),super.close()}}class we{static load(e){const t=new Map([[0,()=>{}]]),n=new Map,r=new Worker(e);r.addEventListener("message",(({data:e})=>{if(we.isCallNotification(e)){const{params:{timerId:r}}=e,i=t.get(r);if("number"==typeof i){const e=n.get(i);if(void 0===e||e!==r)throw new Error("The timer is in an undefined state.")}else{if(void 0===i)throw new Error("The timer is in an undefined state.");i(),t.delete(r)}}else{if(!we.isClearResponse(e)){const{error:{message:t}}=e;throw new Error(t)}{const{id:r}=e,i=n.get(r);if(void 0===i)throw new Error("The timer is in an undefined state.");n.delete(r),t.delete(i)}}}));return{clearTimeout:e=>{const i=Math.random();n.set(i,e),t.set(e,i),r.postMessage({id:i,method:"clear",params:{timerId:e}})},setTimeout:(e,n)=>{const i=Math.random();return t.set(i,e),r.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:i}}),i}}}static loadWorkerTimers(){return()=>{if(null!==we.workerTimers)return we.workerTimers;const e=new Blob(['!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return d}));const r=new Map,o=new Map,i=e=>{const t=r.get(e);if(void 0===t)throw new Error(\'There is no interval scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),r.delete(e)},u=e=>{const t=o.get(e);if(void 0===t)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),o.delete(e)},f=(e,t)=>{let n,r;if("performance"in self){const o=performance.now();n=o,r=e-Math.max(0,o-t)}else n=Date.now(),r=e;return{expected:n+r,remainingDelay:r}},c=(e,t,n,r)=>{const o="performance"in self?performance.now():Date.now();o>n?postMessage({id:null,method:"call",params:{timerId:t}}):e.set(t,setTimeout(c,n-o,e,t,n))},a=(e,t,n)=>{const{expected:o,remainingDelay:i}=f(e,n);r.set(t,setTimeout(c,i,r,t,o))},d=(e,t,n)=>{const{expected:r,remainingDelay:i}=f(e,n);o.set(t,setTimeout(c,i,o,t,r))}},function(e,t,n){"use strict";n.r(t);var r=n(2);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(3);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(4);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o);var f=n(5);for(var o in f)"default"!==o&&function(e){n.d(t,e,(function(){return f[e]}))}(o);var c=n(6);for(var o in c)"default"!==o&&function(e){n.d(t,e,(function(){return c[e]}))}(o);var a=n(7);for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);var d=n(8);for(var o in d)"default"!==o&&function(e){n.d(t,e,(function(){return d[e]}))}(o);var s=n(9);for(var o in s)"default"!==o&&function(e){n.d(t,e,(function(){return s[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(11);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(12);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(13);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);var u=n(10);for(var i in u)"default"!==i&&function(e){n.d(t,e,(function(){return u[e]}))}(i);addEventListener("message",({data:e})=>{try{if("clear"===e.method){const{id:t,params:{timerId:n}}=e;Object(r.b)(n),postMessage({error:null,id:t})}else{if("set"!==e.method)throw new Error(\'The given method "\'.concat(e.method,\'" is not supported\'));{const{params:{delay:t,now:n,timerId:o}}=e;Object(r.d)(t,o,n)}}}catch(t){postMessage({error:{message:t.message},id:e.id,result:null})}})}]);'],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return we.workerTimers=we.load(t),we.workerTimers.setTimeout((()=>URL.revokeObjectURL(t)),0),we.workerTimers}}static isCallNotification(e){return void 0!==e.method&&"call"===e.method}static isClearResponse(e){return null===e.error&&"number"==typeof e.id}}we.workerTimers=null,we.clearTimeout=e=>we.timers().clearTimeout(e),we.setTimeout=(e,t)=>we.timers().setTimeout(e,t),we.timers=we.loadWorkerTimers();class Se extends R{constructor(e,t,n){super(e,t),this.privSignature=n}}class xe extends Se{constructor(e){super("OCSPMemoryCacheHitEvent",M.Debug,e)}}class Me extends Se{constructor(e){super("OCSPCacheMissEvent",M.Debug,e)}}class _e extends Se{constructor(e){super("OCSPDiskCacheHitEvent",M.Debug,e)}}class Ae extends Se{constructor(e){super("OCSPCacheUpdateNeededEvent",M.Debug,e)}}class Ee extends Se{constructor(e){super("OCSPMemoryCacheStoreEvent",M.Debug,e)}}class Ce extends Se{constructor(e){super("OCSPDiskCacheStoreEvent",M.Debug,e)}}class Te extends Se{constructor(e){super("OCSPCacheUpdateCompleteEvent",M.Debug,e)}}class Ie extends Se{constructor(){super("OCSPStapleReceivedEvent",M.Debug,"")}}class ke extends Se{constructor(e,t){super("OCSPCacheEntryExpiredEvent",M.Debug,e),this.privExpireTime=t}}class Re extends Se{constructor(e,t,n){super("OCSPCacheEntryNeedsRefreshEvent",M.Debug,e),this.privExpireTime=n,this.privStartTime=t}}class Oe extends Se{constructor(e,t,n){super("OCSPCacheHitEvent",M.Debug,e),this.privExpireTime=n,this.privExpireTimeString=new Date(n).toLocaleDateString(),this.privStartTime=t,this.privStartTimeString=new Date(t).toLocaleTimeString()}}class Pe extends Se{constructor(e,t){super("OCSPVerificationFailedEvent",M.Debug,e),this.privError=t}}class Ne extends Se{constructor(e,t){super("OCSPCacheFetchErrorEvent",M.Debug,e),this.privError=t}}class Be extends Se{constructor(e){super("OCSPResponseRetrievedEvent",M.Debug,e)}}class Le extends Se{constructor(e,t){super("OCSPCacheUpdateErrorEvent",M.Debug,e),this.privError=t}}class De extends R{constructor(e){super("BackgroundEvent",M.Error),this.privError=e}get error(){return this.privError}}class Ue{static throwIfNullOrUndefined(e,t){if(null==e)throw new Error("throwIfNullOrUndefined:"+t)}static throwIfNull(e,t){if(null===e)throw new Error("throwIfNull:"+t)}static throwIfNullOrWhitespace(e,t){if(Ue.throwIfNullOrUndefined(e,t),(""+e).trim().length<1)throw new Error("throwIfNullOrWhitespace:"+t)}static throwIfDisposed(e){if(e)throw new Error("the object is already disposed")}static throwIfArrayEmptyOrWhitespace(e,t){if(Ue.throwIfNullOrUndefined(e,t),0===e.length)throw new Error("throwIfArrayEmptyOrWhitespace:"+t);for(const n of e)Ue.throwIfNullOrWhitespace(n,t)}static throwIfFileDoesNotExist(e,t){Ue.throwIfNullOrWhitespace(e,t)}static throwIfNotUndefined(e,t){if(void 0!==e)throw new Error("throwIfNotUndefined:"+t)}}var Fe={};e(Fe,"MicAudioSource",(()=>tr),(e=>tr=e));class ze{}ze.AuthKey="Ocp-Apim-Subscription-Key",ze.ConnectionId="X-ConnectionId",ze.ContentType="Content-Type",ze.CustomCommandsAppId="X-CommandsAppId",ze.Path="Path",ze.RequestId="X-RequestId",ze.RequestStreamId="X-StreamId",ze.RequestTimestamp="X-Timestamp";class je{constructor(e,t){this.privHeaderName=e,this.privToken=t}get headerName(){return this.privHeaderName}get token(){return this.privToken}}class He{constructor(e){if(!e)throw new Y("subscriptionKey");this.privAuthInfo=new je(ze.AuthKey,e)}fetch(e){return Promise.resolve(this.privAuthInfo)}fetchOnExpiry(e){return Promise.resolve(this.privAuthInfo)}}const Ge="Authorization";class Ve{constructor(e,t){if(!e)throw new Y("fetchCallback");if(!t)throw new Y("fetchOnExpiryCallback");this.privFetchCallback=e,this.privFetchOnExpiryCallback=t}fetch(e){return this.privFetchCallback(e).then((e=>new je(Ge,Ve.privTokenPrefix+e)))}fetchOnExpiry(e){return this.privFetchOnExpiryCallback(e).then((e=>new je(Ge,Ve.privTokenPrefix+e)))}}Ve.privTokenPrefix="bearer ";var We,qe,Ke,Je,Qe,Xe,Ye={};e(Ye,"ServiceRecognizerBase",(()=>ut),(e=>ut=e)),(qe=We||(We={}))[qe.NoError=0]="NoError",qe[qe.AuthenticationFailure=1]="AuthenticationFailure",qe[qe.BadRequestParameters=2]="BadRequestParameters",qe[qe.TooManyRequests=3]="TooManyRequests",qe[qe.ConnectionFailure=4]="ConnectionFailure",qe[qe.ServiceTimeout=5]="ServiceTimeout",qe[qe.ServiceError=6]="ServiceError",qe[qe.RuntimeError=7]="RuntimeError",qe[qe.Forbidden=8]="Forbidden",(Je=Ke||(Ke={}))[Je.Error=0]="Error",Je[Je.EndOfStream=1]="EndOfStream",(Xe=Qe||(Qe={}))[Xe.SpeechServiceConnection_Key=0]="SpeechServiceConnection_Key",Xe[Xe.SpeechServiceConnection_Endpoint=1]="SpeechServiceConnection_Endpoint",Xe[Xe.SpeechServiceConnection_Region=2]="SpeechServiceConnection_Region",Xe[Xe.SpeechServiceAuthorization_Token=3]="SpeechServiceAuthorization_Token",Xe[Xe.SpeechServiceAuthorization_Type=4]="SpeechServiceAuthorization_Type",Xe[Xe.SpeechServiceConnection_EndpointId=5]="SpeechServiceConnection_EndpointId",Xe[Xe.SpeechServiceConnection_TranslationToLanguages=6]="SpeechServiceConnection_TranslationToLanguages",Xe[Xe.SpeechServiceConnection_TranslationVoice=7]="SpeechServiceConnection_TranslationVoice",Xe[Xe.SpeechServiceConnection_TranslationFeatures=8]="SpeechServiceConnection_TranslationFeatures",Xe[Xe.SpeechServiceConnection_IntentRegion=9]="SpeechServiceConnection_IntentRegion",Xe[Xe.SpeechServiceConnection_ProxyHostName=10]="SpeechServiceConnection_ProxyHostName",Xe[Xe.SpeechServiceConnection_ProxyPort=11]="SpeechServiceConnection_ProxyPort",Xe[Xe.SpeechServiceConnection_ProxyUserName=12]="SpeechServiceConnection_ProxyUserName",Xe[Xe.SpeechServiceConnection_ProxyPassword=13]="SpeechServiceConnection_ProxyPassword",Xe[Xe.SpeechServiceConnection_RecoMode=14]="SpeechServiceConnection_RecoMode",Xe[Xe.SpeechServiceConnection_RecoLanguage=15]="SpeechServiceConnection_RecoLanguage",Xe[Xe.Speech_SessionId=16]="Speech_SessionId",Xe[Xe.SpeechServiceConnection_SynthLanguage=17]="SpeechServiceConnection_SynthLanguage",Xe[Xe.SpeechServiceConnection_SynthVoice=18]="SpeechServiceConnection_SynthVoice",Xe[Xe.SpeechServiceConnection_SynthOutputFormat=19]="SpeechServiceConnection_SynthOutputFormat",Xe[Xe.SpeechServiceConnection_AutoDetectSourceLanguages=20]="SpeechServiceConnection_AutoDetectSourceLanguages",Xe[Xe.SpeechServiceResponse_RequestDetailedResultTrueFalse=21]="SpeechServiceResponse_RequestDetailedResultTrueFalse",Xe[Xe.SpeechServiceResponse_RequestProfanityFilterTrueFalse=22]="SpeechServiceResponse_RequestProfanityFilterTrueFalse",Xe[Xe.SpeechServiceResponse_JsonResult=23]="SpeechServiceResponse_JsonResult",Xe[Xe.SpeechServiceResponse_JsonErrorDetails=24]="SpeechServiceResponse_JsonErrorDetails",Xe[Xe.CancellationDetails_Reason=25]="CancellationDetails_Reason",Xe[Xe.CancellationDetails_ReasonText=26]="CancellationDetails_ReasonText",Xe[Xe.CancellationDetails_ReasonDetailedText=27]="CancellationDetails_ReasonDetailedText",Xe[Xe.LanguageUnderstandingServiceResponse_JsonResult=28]="LanguageUnderstandingServiceResponse_JsonResult",Xe[Xe.SpeechServiceConnection_Url=29]="SpeechServiceConnection_Url",Xe[Xe.SpeechServiceConnection_InitialSilenceTimeoutMs=30]="SpeechServiceConnection_InitialSilenceTimeoutMs",Xe[Xe.SpeechServiceConnection_EndSilenceTimeoutMs=31]="SpeechServiceConnection_EndSilenceTimeoutMs",Xe[Xe.Speech_SegmentationSilenceTimeoutMs=32]="Speech_SegmentationSilenceTimeoutMs",Xe[Xe.SpeechServiceConnection_EnableAudioLogging=33]="SpeechServiceConnection_EnableAudioLogging",Xe[Xe.SpeechServiceConnection_AtStartLanguageIdPriority=34]="SpeechServiceConnection_AtStartLanguageIdPriority",Xe[Xe.SpeechServiceConnection_ContinuousLanguageIdPriority=35]="SpeechServiceConnection_ContinuousLanguageIdPriority",Xe[Xe.SpeechServiceConnection_RecognitionEndpointVersion=36]="SpeechServiceConnection_RecognitionEndpointVersion",Xe[Xe.SpeechServiceResponse_ProfanityOption=37]="SpeechServiceResponse_ProfanityOption",Xe[Xe.SpeechServiceResponse_PostProcessingOption=38]="SpeechServiceResponse_PostProcessingOption",Xe[Xe.SpeechServiceResponse_RequestWordLevelTimestamps=39]="SpeechServiceResponse_RequestWordLevelTimestamps",Xe[Xe.SpeechServiceResponse_StablePartialResultThreshold=40]="SpeechServiceResponse_StablePartialResultThreshold",Xe[Xe.SpeechServiceResponse_OutputFormatOption=41]="SpeechServiceResponse_OutputFormatOption",Xe[Xe.SpeechServiceResponse_TranslationRequestStablePartialResult=42]="SpeechServiceResponse_TranslationRequestStablePartialResult",Xe[Xe.SpeechServiceResponse_RequestWordBoundary=43]="SpeechServiceResponse_RequestWordBoundary",Xe[Xe.SpeechServiceResponse_RequestPunctuationBoundary=44]="SpeechServiceResponse_RequestPunctuationBoundary",Xe[Xe.SpeechServiceResponse_RequestSentenceBoundary=45]="SpeechServiceResponse_RequestSentenceBoundary",Xe[Xe.Conversation_ApplicationId=46]="Conversation_ApplicationId",Xe[Xe.Conversation_DialogType=47]="Conversation_DialogType",Xe[Xe.Conversation_Initial_Silence_Timeout=48]="Conversation_Initial_Silence_Timeout",Xe[Xe.Conversation_From_Id=49]="Conversation_From_Id",Xe[Xe.Conversation_Conversation_Id=50]="Conversation_Conversation_Id",Xe[Xe.Conversation_Custom_Voice_Deployment_Ids=51]="Conversation_Custom_Voice_Deployment_Ids",Xe[Xe.Conversation_Speech_Activity_Template=52]="Conversation_Speech_Activity_Template",Xe[Xe.Conversation_Request_Bot_Status_Messages=53]="Conversation_Request_Bot_Status_Messages",Xe[Xe.Conversation_Agent_Connection_Id=54]="Conversation_Agent_Connection_Id",Xe[Xe.SpeechServiceConnection_Host=55]="SpeechServiceConnection_Host",Xe[Xe.ConversationTranslator_Host=56]="ConversationTranslator_Host",Xe[Xe.ConversationTranslator_Name=57]="ConversationTranslator_Name",Xe[Xe.ConversationTranslator_CorrelationId=58]="ConversationTranslator_CorrelationId",Xe[Xe.ConversationTranslator_Token=59]="ConversationTranslator_Token",Xe[Xe.PronunciationAssessment_ReferenceText=60]="PronunciationAssessment_ReferenceText",Xe[Xe.PronunciationAssessment_GradingSystem=61]="PronunciationAssessment_GradingSystem",Xe[Xe.PronunciationAssessment_Granularity=62]="PronunciationAssessment_Granularity",Xe[Xe.PronunciationAssessment_EnableMiscue=63]="PronunciationAssessment_EnableMiscue",Xe[Xe.PronunciationAssessment_Json=64]="PronunciationAssessment_Json",Xe[Xe.PronunciationAssessment_Params=65]="PronunciationAssessment_Params",Xe[Xe.SpeakerRecognition_Api_Version=66]="SpeakerRecognition_Api_Version";class Ze{constructor(e){this.privSessionId=e}get sessionId(){return this.privSessionId}}class $e extends Ze{constructor(e,t){super(t),this.privOffset=e}get offset(){return this.privOffset}}class et extends ee{constructor(e,t,n,r,i,o,a,s){if(!t)throw new Y("path");if(!n)throw new Y("requestId");const l={};if(l[ze.Path]=t,l[ze.RequestId]=n,l[ze.RequestTimestamp]=(new Date).toISOString(),r&&(l[ze.ContentType]=r),o&&(l[ze.RequestStreamId]=o),a)for(const e in a)e&&(l[e]=a[e]);s?super(e,i,l,s):super(e,i,l),this.privPath=t,this.privRequestId=n,this.privContentType=r,this.privStreamId=o,this.privAdditionalHeaders=a}get path(){return this.privPath}get requestId(){return this.privRequestId}get contentType(){return this.privContentType}get streamId(){return this.privStreamId}get additionalHeaders(){return this.privAdditionalHeaders}static fromConnectionMessage(e){let t=null,n=null,r=null,i=null;const o={};if(e.headers)for(const a in e.headers)a&&(a.toLowerCase()===ze.Path.toLowerCase()?t=e.headers[a]:a.toLowerCase()===ze.RequestId.toLowerCase()?n=e.headers[a]:a.toLowerCase()===ze.ContentType.toLowerCase()?r=e.headers[a]:a.toLowerCase()===ze.RequestStreamId.toLowerCase()?i=e.headers[a]:o[a]=e.headers[a]);return new et(e.messageType,t,n,r,e.body,i,o,e.id)}}var tt,nt,rt,it,ot,at,st,lt,ct=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class ut{constructor(e,t,n,r,i){if(this.privConnectionConfigurationPromise=void 0,this.privConnectionPromise=void 0,this.privSetTimeout=setTimeout,this.privIsLiveAudio=!1,this.recognizeOverride=void 0,this.disconnectOverride=void 0,this.receiveMessageOverride=void 0,this.sendPrePayloadJSONOverride=void 0,this.postConnectImplOverride=void 0,this.configConnectionOverride=void 0,!e)throw new Y("authentication");if(!t)throw new Y("connectionFactory");if(!n)throw new Y("audioSource");if(!r)throw new Y("recognizerConfig");this.privMustReportEndOfStream=!1,this.privAuthentication=e,this.privConnectionFactory=t,this.privAudioSource=n,this.privRecognizerConfig=r,this.privIsDisposed=!1,this.privRecognizer=i,this.privRequestSession=new(0,Wt.RequestSession)(this.privAudioSource.id()),this.privConnectionEvents=new ne,this.privServiceEvents=new ne,this.privDynamicGrammar=new ln,this.privSpeechContext=new sn(this.privDynamicGrammar),this.privAgentConfig=new An,"undefined"!=typeof Blob&&"undefined"!=typeof Worker&&(this.privSetTimeout=we.setTimeout),this.connectionEvents.attach((e=>{if("ConnectionClosedEvent"===e.name){const t=e;(1003===t.statusCode||1007===t.statusCode||1002===t.statusCode||4e3===t.statusCode||this.privRequestSession.numConnectionAttempts>this.privRecognizerConfig.maxRetryCount)&&this.cancelRecognitionLocal(Ke.Error,1007===t.statusCode?We.BadRequestParameters:We.ConnectionFailure,`${t.reason} websocket error code: ${t.statusCode}`)}}))}get audioSource(){return this.privAudioSource}get speechContext(){return this.privSpeechContext}get dynamicGrammar(){return this.privDynamicGrammar}get agentConfig(){return this.privAgentConfig}set conversationTranslatorToken(e){this.privRecognizerConfig.parameters.setProperty(Qe.ConversationTranslator_Token,e)}set authentication(e){this.privAuthentication=this.authentication}isDisposed(){return this.privIsDisposed}dispose(e){return ct(this,void 0,void 0,(function*(){if(this.privIsDisposed=!0,void 0!==this.privConnectionConfigurationPromise)try{const t=yield this.privConnectionConfigurationPromise;yield t.dispose(e)}catch(e){return}}))}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}get recognitionMode(){return this.privRecognizerConfig.recognitionMode}recognize(e,t,n){return ct(this,void 0,void 0,(function*(){if(void 0!==this.recognizeOverride)return void(yield this.recognizeOverride(e,t,n));this.privConnectionConfigurationPromise=void 0,this.privRecognizerConfig.recognitionMode=e,this.privSuccessCallback=t,this.privErrorCallback=n,this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privAudioSource.events);const r=this.connectImpl();let i;try{const e=yield this.audioSource.attach(this.privRequestSession.audioNodeId),t=yield this.audioSource.format,n=yield this.audioSource.deviceInfo;this.privIsLiveAudio=n.type&&n.type===st.Microphones,i=new br(e,t.avgBytesPerSec),yield this.privRequestSession.onAudioSourceAttachCompleted(i,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:n}}catch(e){throw yield this.privRequestSession.onStopRecognizing(),e}try{yield r}catch(e){return void(yield this.cancelRecognitionLocal(Ke.Error,We.ConnectionFailure,e))}const o=new Ze(this.privRequestSession.sessionId);this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,o),this.receiveMessage();this.sendAudio(i).catch((e=>ct(this,void 0,void 0,(function*(){yield this.cancelRecognitionLocal(Ke.Error,We.RuntimeError,e)}))))}))}stopRecognizing(){return ct(this,void 0,void 0,(function*(){if(this.privRequestSession.isRecognizing)try{yield this.audioSource.turnOff(),yield this.sendFinalAudio(),yield this.privRequestSession.onStopRecognizing(),yield this.privRequestSession.turnCompletionPromise}finally{yield this.privRequestSession.dispose()}}))}connect(){return ct(this,void 0,void 0,(function*(){return yield this.connectImpl(),Promise.resolve()}))}connectAsync(e,t){this.connectImpl().then((()=>{try{e&&e()}catch(e){t&&t(e)}}),(e=>{try{t&&t(e)}catch(e){}}))}disconnect(){return ct(this,void 0,void 0,(function*(){if(yield this.cancelRecognitionLocal(Ke.Error,We.NoError,"Disconnecting"),void 0!==this.disconnectOverride&&(yield this.disconnectOverride()),void 0!==this.privConnectionPromise)try{yield(yield this.privConnectionPromise).dispose()}catch(e){}this.privConnectionPromise=void 0}))}sendMessage(e){}sendNetworkMessage(e,t){return ct(this,void 0,void 0,(function*(){const n="string"==typeof t?A.Text:A.Binary,r="string"==typeof t?"application/json":"";return(yield this.fetchConnection()).send(new et(n,e,this.privRequestSession.requestId,r,t))}))}set activityTemplate(e){this.privActivityTemplate=e}get activityTemplate(){return this.privActivityTemplate}sendTelemetryData(){return ct(this,void 0,void 0,(function*(){const e=this.privRequestSession.getTelemetry();if(!0!==ut.telemetryDataEnabled||this.privIsDisposed||null===e)return;if(ut.telemetryData)try{ut.telemetryData(e)}catch(e){}const t=yield this.fetchConnection();yield t.send(new et(A.Text,"telemetry",this.privRequestSession.requestId,"application/json",e))}))}cancelRecognitionLocal(e,t,n){return ct(this,void 0,void 0,(function*(){this.privRequestSession.isRecognizing&&(yield this.privRequestSession.onStopRecognizing(),this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,e,t,n))}))}receiveMessage(){return ct(this,void 0,void 0,(function*(){try{if(this.privIsDisposed)return;let e=yield this.fetchConnection();const t=yield e.read();if(void 0!==this.receiveMessageOverride)return this.receiveMessageOverride();if(!t)return this.privRequestSession.isRecognizing?this.receiveMessage():void 0;this.privServiceHasSentMessage=!0;const n=et.fromConnectionMessage(t);if(n.requestId.toLowerCase()===this.privRequestSession.requestId.toLowerCase())switch(n.path.toLowerCase()){case"turn.start":this.privMustReportEndOfStream=!0,this.privRequestSession.onServiceTurnStartResponse();break;case"speech.startdetected":const t=Pt.fromJSON(n.textBody),r=new $e(t.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechStartDetected&&this.privRecognizer.speechStartDetected(this.privRecognizer,r);break;case"speech.enddetected":let i;i=n.textBody.length>0?n.textBody:"{ Offset: 0 }";const o=Pt.fromJSON(i);this.privRecognizerConfig.isContinuousRecognition&&this.privRequestSession.onServiceRecognized(o.Offset+this.privRequestSession.currentTurnAudioOffset);const a=new $e(o.Offset+this.privRequestSession.currentTurnAudioOffset,this.privRequestSession.sessionId);this.privRecognizer.speechEndDetected&&this.privRecognizer.speechEndDetected(this.privRecognizer,a);break;case"turn.end":yield this.sendTelemetryData(),this.privRequestSession.isSpeechEnded&&this.privMustReportEndOfStream&&(this.privMustReportEndOfStream=!1,yield this.cancelRecognitionLocal(Ke.EndOfStream,We.NoError,void 0));const s=new Ze(this.privRequestSession.sessionId);if(yield this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition),!this.privRecognizerConfig.isContinuousRecognition||this.privRequestSession.isSpeechEnded||!this.privRequestSession.isRecognizing)return void(this.privRecognizer.sessionStopped&&this.privRecognizer.sessionStopped(this.privRecognizer,s));e=yield this.fetchConnection(),yield this.sendPrePayloadJSON(e);break;default:(yield this.processTypeSpecificMessages(n))||this.privServiceEvents&&this.serviceEvents.onEvent(new H(n.path.toLowerCase(),n.textBody))}return this.receiveMessage()}catch(e){return null}}))}sendSpeechContext(e,t){const n=this.speechContext.toJSON();if(t&&this.privRequestSession.onSpeechContext(),n)return e.send(new et(A.Text,"speech.context",this.privRequestSession.requestId,"application/json",n))}sendPrePayloadJSON(e,t=!0){return ct(this,void 0,void 0,(function*(){if(void 0!==this.sendPrePayloadJSONOverride)return this.sendPrePayloadJSONOverride(e);yield this.sendSpeechContext(e,t),yield this.sendWaveHeader(e)}))}sendWaveHeader(e){return ct(this,void 0,void 0,(function*(){const t=yield this.audioSource.format;return e.send(new et(A.Binary,"audio",this.privRequestSession.requestId,"audio/x-wav",t.header))}))}connectImpl(){return void 0!==this.privConnectionPromise?this.privConnectionPromise.then((e=>e.state()===C.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=void 0,this.privServiceHasSentMessage=!1,this.connectImpl()):this.privConnectionPromise),(()=>(this.privConnectionId=null,this.privConnectionPromise=void 0,this.privServiceHasSentMessage=!1,this.connectImpl()))):(this.privConnectionPromise=this.retryableConnect(),this.privConnectionPromise.catch((()=>{})),void 0!==this.postConnectImplOverride?this.postConnectImplOverride(this.privConnectionPromise):this.privConnectionPromise)}sendSpeechServiceConfig(e,t,n){if(t.onSpeechContext(),!0!==ut.telemetryDataEnabled){const e={context:{system:JSON.parse(n).context.system}};n=JSON.stringify(e)}if("true"===this.privRecognizerConfig.parameters.getProperty("TranscriptionService_SingleChannel","false").toLowerCase()){const e=JSON.parse(n);e.context.DisableReferenceChannel="True",e.context.MicSpec="1_0_0",n=JSON.stringify(e)}if(n)return e.send(new et(A.Text,"speech.config",t.requestId,"application/json",n))}fetchConnection(){return ct(this,void 0,void 0,(function*(){return void 0!==this.privConnectionConfigurationPromise?this.privConnectionConfigurationPromise.then((e=>e.state()===C.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.privServiceHasSentMessage=!1,this.fetchConnection()):this.privConnectionConfigurationPromise),(()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.privServiceHasSentMessage=!1,this.fetchConnection()))):(this.privConnectionConfigurationPromise=this.configureConnection(),yield this.privConnectionConfigurationPromise)}))}sendAudio(e){return ct(this,void 0,void 0,(function*(){const t=yield this.audioSource.format;let n=Date.now();const r=this.privRecognizerConfig.parameters.getProperty("SPEECH-TransmitLengthBeforThrottleMs","5000"),i=t.avgBytesPerSec/1e3*parseInt(r,10),o=this.privRequestSession.recogNumber,a=()=>ct(this,void 0,void 0,(function*(){if(!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===o){const r=yield this.fetchConnection(),s=yield e.read();if(this.privRequestSession.isSpeechEnded)return;let l,c;if(!s||s.isEnd?(l=null,c=0):(l=s.buffer,this.privRequestSession.onAudioSent(l.byteLength),c=i>=this.privRequestSession.bytesSent?0:Math.max(0,n-Date.now())),0!==c&&(yield this.delay(c)),null!==l&&(n=Date.now()+1e3*l.byteLength/(2*t.avgBytesPerSec)),!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===o){if(r.send(new et(A.Binary,"audio",this.privRequestSession.requestId,null,l)).catch((()=>{this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition).catch((()=>{}))})),!(null==s?void 0:s.isEnd))return a();this.privIsLiveAudio||this.privRequestSession.onSpeechEnded()}}}));return a()}))}retryableConnect(){return ct(this,void 0,void 0,(function*(){let e=!1;this.privAuthFetchEventId=x();const t=this.privRequestSession.sessionId;this.privConnectionId=void 0!==t?t:x(),this.privRequestSession.onPreConnectionStart(this.privAuthFetchEventId,this.privConnectionId);let n=0,r="";for(;this.privRequestSession.numConnectionAttempts<=this.privRecognizerConfig.maxRetryCount;){const t=e?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId),i=yield t;yield this.privRequestSession.onAuthCompleted(!1);const o=this.privConnectionFactory.create(this.privRecognizerConfig,i,this.privConnectionId);this.privRequestSession.listenForServiceTelemetry(o.events),o.events.attach((e=>{this.connectionEvents.onEvent(e)}));const a=yield o.open();if(200===a.statusCode)return yield this.privRequestSession.onConnectionEstablishCompleted(a.statusCode),Promise.resolve(o);1006===a.statusCode&&(e=!0),n=a.statusCode,r=a.reason,this.privRequestSession.onRetryConnection()}return yield this.privRequestSession.onConnectionEstablishCompleted(n,r),Promise.reject(`Unable to contact server. StatusCode: ${n}, ${this.privRecognizerConfig.parameters.getProperty(Qe.SpeechServiceConnection_Endpoint)} Reason: ${r}`)}))}delay(e){return new Promise((t=>this.privSetTimeout(t,e)))}writeBufferToConsole(e){let t="Buffer Size: ";if(null===e)t+="null";else{const n=new Uint8Array(e);t+=`${e.byteLength}\r\n`;for(let r=0;r<e.byteLength;r++)t+=n[r].toString(16).padStart(2,"0")+" "}console.info(t)}sendFinalAudio(){return ct(this,void 0,void 0,(function*(){const e=yield this.fetchConnection();yield e.send(new et(A.Binary,"audio",this.privRequestSession.requestId,null,null))}))}configureConnection(){return ct(this,void 0,void 0,(function*(){const e=yield this.connectImpl();return void 0!==this.configConnectionOverride?this.configConnectionOverride(e):(yield this.sendSpeechServiceConfig(e,this.privRequestSession,this.privRecognizerConfig.SpeechServiceConfig.serialize()),yield this.sendPrePayloadJSON(e,!1),e)}))}}ut.telemetryDataEnabled=!0,(nt=tt||(tt={}))[nt.Interactive=0]="Interactive",nt[nt.Conversation=1]="Conversation",nt[nt.Dictation=2]="Dictation",(it=rt||(rt={}))[it.Simple=0]="Simple",it[it.Detailed=1]="Detailed";class dt{constructor(e,t){this.privSpeechServiceConfig=e||new ht(new ft(null)),this.privParameters=t,this.privMaxRetryCount=parseInt(t.getProperty("SPEECH-Error-MaxRetryCount","4"),10),this.privLanguageIdPriority=t.getProperty(Qe.SpeechServiceConnection_ContinuousLanguageIdPriority,void 0),this.privLanguageIdMode="Latency"===this.privLanguageIdPriority?"DetectContinuous":"DetectAtAudioStart","DetectAtAudioStart"===this.privLanguageIdMode&&(this.privLanguageIdPriority=t.getProperty(Qe.SpeechServiceConnection_AtStartLanguageIdPriority,void 0))}get parameters(){return this.privParameters}get recognitionMode(){return this.privRecognitionMode}set recognitionMode(e){this.privRecognitionMode=e,this.privRecognitionActivityTimeout=e===tt.Interactive?8e3:25e3,this.privSpeechServiceConfig.Recognition=tt[e]}get SpeechServiceConfig(){return this.privSpeechServiceConfig}get recognitionActivityTimeout(){return this.privRecognitionActivityTimeout}get isContinuousRecognition(){return this.privRecognitionMode!==tt.Interactive}get languageIdPriority(){return this.privLanguageIdPriority?`Prioritize${this.privLanguageIdPriority}`:""}get languageIdMode(){return this.privLanguageIdMode}get autoDetectSourceLanguages(){return this.parameters.getProperty(Qe.SpeechServiceConnection_AutoDetectSourceLanguages,void 0)}get recognitionEndpointVersion(){return this.parameters.getProperty(Qe.SpeechServiceConnection_RecognitionEndpointVersion,void 0)}get sourceLanguageModels(){const e=[];let t=!1;if(void 0!==this.autoDetectSourceLanguages)for(const n of this.autoDetectSourceLanguages.split(",")){const r=n+Qe.SpeechServiceConnection_EndpointId.toString(),i=this.parameters.getProperty(r,void 0);void 0!==i?(e.push({language:n,endpoint:i}),t=!0):e.push({language:n,endpoint:""})}return t?e:void 0}get maxRetryCount(){return this.privMaxRetryCount}}class ht{constructor(e){this.context=e}serialize(){return JSON.stringify(this,((e,t)=>{if(t&&"object"==typeof t){const e={};for(const n in t)Object.hasOwnProperty.call(t,n)&&(e[n&&n.charAt(0).toLowerCase()+n.substring(1)]=t[n]);return e}return t}))}get Context(){return this.context}get Recognition(){return this.recognition}set Recognition(e){this.recognition=e.toLowerCase()}}class ft{constructor(e){this.system=new pt,this.os=e}}class pt{constructor(){this.name="SpeechSDK",this.version="1.22.0",this.build="JavaScript",this.lang="JavaScript"}}class mt{constructor(e,t,n){this.platform=e,this.name=t,this.version=n}}(at=ot||(ot={})).Bluetooth="Bluetooth",at.Wired="Wired",at.WiFi="WiFi",at.Cellular="Cellular",at.InBuilt="InBuilt",at.Unknown="Unknown",(lt=st||(st={})).Phone="Phone",lt.Speaker="Speaker",lt.Car="Car",lt.Headset="Headset",lt.Thermostat="Thermostat",lt.Microphones="Microphones",lt.Deskphone="Deskphone",lt.RemoteControl="RemoteControl",lt.Unknown="Unknown",lt.File="File",lt.Stream="Stream";class gt{toConnectionMessage(e){const t=new ie;try{if(e.messageType===A.Text){const n=e.textContent;let r={},i=null;if(n){const e=n.split("\r\n\r\n");e&&e.length>0&&(r=this.parseHeaders(e[0]),e.length>1&&(i=e[1]))}t.resolve(new ee(e.messageType,i,r,e.id))}else if(e.messageType===A.Binary){const n=e.binaryContent;let r={},i=null;if(!n||n.byteLength<2)throw new Error("Invalid binary message format. Header length missing.");const o=new DataView(n),a=o.getInt16(0);if(n.byteLength<a+2)throw new Error("Invalid binary message format. Header content missing.");let s="";for(let e=0;e<a;e++)s+=String.fromCharCode(o.getInt8(e+2));r=this.parseHeaders(s),n.byteLength>a+2&&(i=n.slice(2+a)),t.resolve(new ee(e.messageType,i,r,e.id))}}catch(e){t.reject(`Error formatting the message. Error: ${e}`)}return t.promise}fromConnectionMessage(e){const t=new ie;try{if(e.messageType===A.Text){const n=`${this.makeHeaders(e)}\r\n${e.textBody?e.textBody:""}`;t.resolve(new he(A.Text,n,e.id))}else if(e.messageType===A.Binary){const n=this.makeHeaders(e),r=e.binaryBody,i=this.stringToArrayBuffer(n),o=new Int8Array(i),a=o.byteLength,s=new Int8Array(2+a+(r?r.byteLength:0));if(s[0]=a>>8&255,s[1]=255&a,s.set(o,2),r){const e=new Int8Array(r);s.set(e,2+a)}const l=s.buffer;t.resolve(new he(A.Binary,l,e.id))}}catch(e){t.reject(`Error formatting the message. ${e}`)}return t.promise}makeHeaders(e){let t="";if(e.headers)for(const n in e.headers)n&&(t+=`${n}: ${e.headers[n]}\r\n`);return t}parseHeaders(e){const t={};if(e){const n=e.match(/[^\r\n]+/g);if(t)for(const e of n)if(e){const n=e.indexOf(":"),r=n>0?e.substr(0,n).trim().toLowerCase():e,i=n>0&&e.length>n+1?e.substr(n+1).trim():"";t[r]=i}}return t}stringToArrayBuffer(e){const t=new ArrayBuffer(e.length),n=new DataView(t);for(let t=0;t<e.length;t++)n.setUint8(t,e.charCodeAt(t));return t}}var vt,bt,yt,wt,St,xt,Mt,_t;(bt=vt||(vt={}))[bt.Simple=0]="Simple",bt[bt.Detailed=1]="Detailed";class At{}At.BotId="botid",At.CustomSpeechDeploymentId="cid",At.CustomVoiceDeploymentId="deploymentId",At.EnableAudioLogging="storeAudio",At.EnableLanguageId="lidEnabled",At.EnableWordLevelTimestamps="wordLevelTimestamps",At.EndSilenceTimeoutMs="endSilenceTimeoutMs",At.SegmentationSilenceTimeoutMs="segmentationSilenceTimeoutMs",At.Format="format",At.InitialSilenceTimeoutMs="initialSilenceTimeoutMs",At.Language="language",At.Profanity="profanity",At.RequestBotStatusMessages="enableBotMessageStatus",At.StableIntermediateThreshold="stableIntermediateThreshold",At.StableTranslation="stableTranslation",At.TestHooks="testhooks",At.Postprocessing="postprocessing";class Et{static getHostSuffix(e){if(e){if(e.toLowerCase().startsWith("china"))return".azure.cn";if(e.toLowerCase().startsWith("usgov"))return".azure.us"}return".microsoft.com"}setCommonUrlParams(e,t,n){new Map([[Qe.Speech_SegmentationSilenceTimeoutMs,At.SegmentationSilenceTimeoutMs],[Qe.SpeechServiceConnection_EnableAudioLogging,At.EnableAudioLogging],[Qe.SpeechServiceConnection_EndSilenceTimeoutMs,At.EndSilenceTimeoutMs],[Qe.SpeechServiceConnection_InitialSilenceTimeoutMs,At.InitialSilenceTimeoutMs],[Qe.SpeechServiceResponse_PostProcessingOption,At.Postprocessing],[Qe.SpeechServiceResponse_ProfanityOption,At.Profanity],[Qe.SpeechServiceResponse_RequestWordLevelTimestamps,At.EnableWordLevelTimestamps],[Qe.SpeechServiceResponse_StablePartialResultThreshold,At.StableIntermediateThreshold]]).forEach(((r,i)=>{this.setUrlParameter(i,r,e,t,n)}));const r=JSON.parse(e.parameters.getProperty(Zn,"{}"));Object.keys(r).forEach((e=>{t[e]=r[e]}))}setUrlParameter(e,t,n,r,i){const o=n.parameters.getProperty(e,void 0);!o||i&&-1!==i.search(t)||(r[t]=o.toLocaleLowerCase())}}class Ct extends Et{constructor(){super(...arguments),this.interactiveRelativeUri="/speech/recognition/interactive/cognitiveservices/v1",this.conversationRelativeUri="/speech/recognition/conversation/cognitiveservices/v1",this.dictationRelativeUri="/speech/recognition/dictation/cognitiveservices/v1",this.universalUri="/speech/universal/v"}create(e,t,n){let r=e.parameters.getProperty(Qe.SpeechServiceConnection_Endpoint,void 0);const i=e.parameters.getProperty(Qe.SpeechServiceConnection_Region,void 0),o=Et.getHostSuffix(i),a=e.parameters.getProperty(Qe.SpeechServiceConnection_Host,"wss://"+i+".stt.speech"+o),s={},l=e.parameters.getProperty(Qe.SpeechServiceConnection_EndpointId,void 0),c=e.parameters.getProperty(Qe.SpeechServiceConnection_RecoLanguage,void 0);if(l?r&&-1!==r.search(At.CustomSpeechDeploymentId)||(s[At.CustomSpeechDeploymentId]=l):c&&(r&&-1!==r.search(At.Language)||(s[At.Language]=c)),r&&-1!==r.search(At.Format)||(s[At.Format]=e.parameters.getProperty(Xn,vt[vt.Simple]).toLowerCase()),void 0!==e.autoDetectSourceLanguages&&(s[At.EnableLanguageId]="true"),this.setCommonUrlParams(e,s,r),!r)switch(e.recognitionMode){case tt.Conversation:r="true"===e.parameters.getProperty($n,"false")?a+this.dictationRelativeUri:void 0!==e.recognitionEndpointVersion&&parseInt(e.recognitionEndpointVersion,10)>1?`${a}${this.universalUri}${e.recognitionEndpointVersion}`:a+this.conversationRelativeUri;break;case tt.Dictation:r=a+this.dictationRelativeUri;break;default:r=void 0!==e.recognitionEndpointVersion&&parseInt(e.recognitionEndpointVersion,10)>1?`${a}${this.universalUri}${e.recognitionEndpointVersion}`:a+this.interactiveRelativeUri}const u={};void 0!==t.token&&""!==t.token&&(u[t.headerName]=t.token),u[ze.ConnectionId]=n,e.parameters.setProperty(Qe.SpeechServiceConnection_Url,r);const d="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new(0,ar.WebsocketConnection)(r,s,u,new gt,wr.fromRecognizerConfig(e),d,n)}}class Tt{constructor(){this.synthesisUri="/cognitiveservices/websocket/v1"}create(e,t,n){let r=e.parameters.getProperty(Qe.SpeechServiceConnection_Endpoint,void 0);const i=e.parameters.getProperty(Qe.SpeechServiceConnection_Region,void 0),o=Et.getHostSuffix(i),a=e.parameters.getProperty(Qe.SpeechServiceConnection_EndpointId,void 0),s=void 0===a?"tts":"voice",l=e.parameters.getProperty(Qe.SpeechServiceConnection_Host,"wss://"+i+"."+s+".speech"+o);r||(r=l+this.synthesisUri);const c={};void 0!==t.token&&""!==t.token&&(c[t.headerName]=t.token),c[ze.ConnectionId]=n,void 0!==a&&(c[At.CustomVoiceDeploymentId]=a),e.parameters.setProperty(Qe.SpeechServiceConnection_Url,r);const u="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new(0,ar.WebsocketConnection)(r,{},c,new gt,wr.fromParameters(e.parameters),u,n)}}(wt=yt||(yt={}))[wt.NoMatch=0]="NoMatch",wt[wt.Canceled=1]="Canceled",wt[wt.RecognizingSpeech=2]="RecognizingSpeech",wt[wt.RecognizedSpeech=3]="RecognizedSpeech",wt[wt.RecognizedKeyword=4]="RecognizedKeyword",wt[wt.RecognizingIntent=5]="RecognizingIntent",wt[wt.RecognizedIntent=6]="RecognizedIntent",wt[wt.TranslatingSpeech=7]="TranslatingSpeech",wt[wt.TranslatedSpeech=8]="TranslatedSpeech",wt[wt.SynthesizingAudio=9]="SynthesizingAudio",wt[wt.SynthesizingAudioCompleted=10]="SynthesizingAudioCompleted",wt[wt.SynthesizingAudioStarted=11]="SynthesizingAudioStarted",wt[wt.EnrollingVoiceProfile=12]="EnrollingVoiceProfile",wt[wt.EnrolledVoiceProfile=13]="EnrolledVoiceProfile",wt[wt.RecognizedSpeakers=14]="RecognizedSpeakers",wt[wt.RecognizedSpeaker=15]="RecognizedSpeaker",wt[wt.ResetVoiceProfile=16]="ResetVoiceProfile",wt[wt.DeletedVoiceProfile=17]="DeletedVoiceProfile",wt[wt.VoicesListRetrieved=18]="VoicesListRetrieved";class It{static implTranslateRecognitionResult(e){let t=yt.Canceled;switch(e){case Mt.Success:t=yt.RecognizedSpeech;break;case Mt.NoMatch:case Mt.InitialSilenceTimeout:case Mt.BabbleTimeout:case Mt.EndOfDictation:t=yt.NoMatch;break;case Mt.Error:case Mt.BadRequest:case Mt.Forbidden:default:t=yt.Canceled}return t}static implTranslateCancelResult(e){let t=Ke.EndOfStream;switch(e){case Mt.Success:case Mt.EndOfDictation:case Mt.NoMatch:t=Ke.EndOfStream;break;case Mt.InitialSilenceTimeout:case Mt.BabbleTimeout:case Mt.Error:case Mt.BadRequest:case Mt.Forbidden:default:t=Ke.Error}return t}static implTranslateCancelErrorCode(e){let t=We.NoError;switch(e){case Mt.Error:t=We.ServiceError;break;case Mt.TooManyRequests:t=We.TooManyRequests;break;case Mt.BadRequest:t=We.BadRequestParameters;break;case Mt.Forbidden:t=We.Forbidden;break;default:t=We.NoError}return t}static implTranslateErrorDetails(e){let t="The speech service encountered an internal error and could not continue.";switch(e){case We.Forbidden:t="The recognizer is using a free subscription that ran out of quota.";break;case We.BadRequestParameters:t="Invalid parameter or unsupported audio format in the request.";break;case We.TooManyRequests:t="The number of parallel requests exceeded the number of allowed concurrent transcriptions."}return t}}(xt=St||(St={}))[xt.Success=0]="Success",xt[xt.SynthesisEnd=1]="SynthesisEnd",xt[xt.Error=2]="Error",(_t=Mt||(Mt={}))[_t.Success=0]="Success",_t[_t.NoMatch=1]="NoMatch",_t[_t.InitialSilenceTimeout=2]="InitialSilenceTimeout",_t[_t.BabbleTimeout=3]="BabbleTimeout",_t[_t.Error=4]="Error",_t[_t.EndOfDictation=5]="EndOfDictation",_t[_t.TooManyRequests=6]="TooManyRequests",_t[_t.BadRequest=7]="BadRequest",_t[_t.Forbidden=8]="Forbidden";class kt{constructor(){this.privKeys=[],this.privValues=[]}getProperty(e,t){let n;n="string"==typeof e?e:Qe[e];for(let e=0;e<this.privKeys.length;e++)if(this.privKeys[e]===n)return this.privValues[e];if(void 0!==t)return String(t)}setProperty(e,t){let n;n="string"==typeof e?e:Qe[e];for(let e=0;e<this.privKeys.length;e++)if(this.privKeys[e]===n)return void(this.privValues[e]=t);this.privKeys.push(n),this.privValues.push(t)}clone(){const e=new kt;for(let t=0;t<this.privKeys.length;t++)e.privKeys.push(this.privKeys[t]),e.privValues.push(this.privValues[t]);return e}mergeTo(e){this.privKeys.forEach((t=>{if(void 0===e.getProperty(t,void 0)){const n=this.getProperty(t);e.setProperty(t,n)}}))}get keys(){return this.privKeys}}class Rt{constructor(e,t,n,r,i,o,a,s,l,c){this.privResultId=e,this.privReason=t,this.privText=n,this.privDuration=r,this.privOffset=i,this.privLanguage=o,this.privLanguageDetectionConfidence=a,this.privErrorDetails=s,this.privJson=l,this.privProperties=c}get resultId(){return this.privResultId}get reason(){return this.privReason}get text(){return this.privText}get duration(){return this.privDuration}get offset(){return this.privOffset}get language(){return this.privLanguage}get languageDetectionConfidence(){return this.privLanguageDetectionConfidence}get errorDetails(){return this.privErrorDetails}get json(){return this.privJson}get properties(){return this.privProperties}}class Ot extends Rt{constructor(e,t,n,r,i,o,a,s,l,c,u){super(e,t,n,r,i,o,a,l,c,u),this.privSpeakerId=s}get speakerId(){return this.privSpeakerId}}class Pt{constructor(e){this.privSpeechStartDetected=JSON.parse(e)}static fromJSON(e){return new Pt(e)}get Offset(){return this.privSpeechStartDetected.Offset}}class Nt{constructor(e){this.privSpeechHypothesis=JSON.parse(e)}static fromJSON(e){return new Nt(e)}get Text(){return this.privSpeechHypothesis.Text}get Offset(){return this.privSpeechHypothesis.Offset}get Duration(){return this.privSpeechHypothesis.Duration}get Language(){return void 0===this.privSpeechHypothesis.PrimaryLanguage?void 0:this.privSpeechHypothesis.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privSpeechHypothesis.PrimaryLanguage?void 0:this.privSpeechHypothesis.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSpeechHypothesis.SpeakerId}}var Bt={};e(Bt,"SpeechServiceRecognizer",(()=>zt),(e=>zt=e));class Lt extends $e{constructor(e,t,n,r,i){super(r,i),this.privReason=e,this.privErrorDetails=t,this.privErrorCode=n}get reason(){return this.privReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}}class Dt extends Lt{}class Ut extends $e{constructor(e,t,n){super(t,n),this.privResult=e}get result(){return this.privResult}}var Ft=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class zt extends Ye.ServiceRecognizerBase{constructor(e,t,n,r,i){if(super(e,t,n,r,i),this.privSpeechRecognizer=i,void 0!==r.autoDetectSourceLanguages){const e=r.autoDetectSourceLanguages.split(",");this.privSpeechContext.setSection("languageId",{Priority:r.languageIdPriority,languages:e,mode:r.languageIdMode,onSuccess:{action:"Recognize"},onUnknown:{action:"None"}}),this.privSpeechContext.setSection("phraseOutput",{interimResults:{resultType:"Auto"},phraseResults:{resultType:"Always"}});const t=r.sourceLanguageModels;void 0!==t&&this.privSpeechContext.setSection("phraseDetection",{customModels:t,onInterim:{action:"None"},onSuccess:{action:"None"}})}}processTypeSpecificMessages(e){return Ft(this,void 0,void 0,(function*(){let t;const n=new kt;n.setProperty(Qe.SpeechServiceResponse_JsonResult,e.textBody);let r=!1;switch(e.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":const i=Nt.fromJSON(e.textBody),o=i.Offset+this.privRequestSession.currentTurnAudioOffset;t=new Ot(this.privRequestSession.requestId,yt.RecognizingSpeech,i.Text,i.Duration,o,i.Language,i.LanguageDetectionConfidence,void 0,void 0,e.textBody,n),this.privRequestSession.onHypothesis(o);const a=new Ut(t,i.Duration,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognizing)try{this.privSpeechRecognizer.recognizing(this.privSpeechRecognizer,a)}catch(e){}r=!0;break;case"speech.phrase":const s=Ht.fromJSON(e.textBody),l=It.implTranslateRecognitionResult(s.RecognitionStatus);if(this.privRequestSession.onPhraseRecognized(this.privRequestSession.currentTurnAudioOffset+s.Offset+s.Duration),yt.Canceled===l){const e=It.implTranslateCancelResult(s.RecognitionStatus),t=It.implTranslateCancelErrorCode(s.RecognitionStatus);yield this.cancelRecognitionLocal(e,t,It.implTranslateErrorDetails(t))}else{if(!this.privRequestSession.isSpeechEnded||l!==yt.NoMatch||s.RecognitionStatus===Mt.InitialSilenceTimeout){if(this.privRecognizerConfig.parameters.getProperty(Xn)===vt[vt.Simple])t=new Ot(this.privRequestSession.requestId,l,s.DisplayText,s.Duration,s.Offset+this.privRequestSession.currentTurnAudioOffset,s.Language,s.LanguageDetectionConfidence,void 0,void 0,e.textBody,n);else{const r=jt.fromJSON(e.textBody),i=r.Offset+this.privRequestSession.currentTurnAudioOffset,o=r.getJsonWithCorrectedOffsets(i);t=new Ot(this.privRequestSession.requestId,l,r.RecognitionStatus===Mt.Success?r.NBest[0].Display:void 0,r.Duration,i,r.Language,r.LanguageDetectionConfidence,void 0,void 0,o,n)}const r=new Ut(t,t.offset,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognized)try{this.privSpeechRecognizer.recognized(this.privSpeechRecognizer,r)}catch(e){}}if(this.privSuccessCallback){try{this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}r=!0}return r}))}cancelRecognition(e,t,n,r,i){const o=new kt;if(o.setProperty(Yn,We[r]),this.privSpeechRecognizer.canceled){const t=new Dt(n,i,r,void 0,e);try{this.privSpeechRecognizer.canceled(this.privSpeechRecognizer,t)}catch(e){}}if(this.privSuccessCallback){const e=new Ot(t,yt.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,i,void 0,o);try{this.privSuccessCallback(e),this.privSuccessCallback=void 0}catch(e){}}}}class jt{constructor(e){this.privDetailedSpeechPhrase=JSON.parse(e),this.privDetailedSpeechPhrase.RecognitionStatus=Mt[this.privDetailedSpeechPhrase.RecognitionStatus]}static fromJSON(e){return new jt(e)}getJsonWithCorrectedOffsets(e){if(this.privDetailedSpeechPhrase.NBest){let t;for(const e of this.privDetailedSpeechPhrase.NBest)if(e.Words&&e.Words[0]){t=e.Words[0].Offset;break}if(t&&t<e){const n=e-t;for(const e of this.privDetailedSpeechPhrase.NBest)if(e.Words)for(const t of e.Words)t.Offset+=n}}return JSON.stringify(this.privDetailedSpeechPhrase)}get RecognitionStatus(){return this.privDetailedSpeechPhrase.RecognitionStatus}get NBest(){return this.privDetailedSpeechPhrase.NBest}get Duration(){return this.privDetailedSpeechPhrase.Duration}get Offset(){return this.privDetailedSpeechPhrase.Offset}get Language(){return void 0===this.privDetailedSpeechPhrase.PrimaryLanguage?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privDetailedSpeechPhrase.PrimaryLanguage?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Confidence}get Text(){return this.privDetailedSpeechPhrase.NBest&&this.privDetailedSpeechPhrase.NBest[0]?this.privDetailedSpeechPhrase.NBest[0].Display||this.privDetailedSpeechPhrase.NBest[0].DisplayText:this.privDetailedSpeechPhrase.DisplayText}get SpeakerId(){return this.privDetailedSpeechPhrase.SpeakerId}}class Ht{constructor(e){this.privSimpleSpeechPhrase=JSON.parse(e),this.privSimpleSpeechPhrase.RecognitionStatus=Mt[this.privSimpleSpeechPhrase.RecognitionStatus]}static fromJSON(e){return new Ht(e)}get RecognitionStatus(){return this.privSimpleSpeechPhrase.RecognitionStatus}get DisplayText(){return this.privSimpleSpeechPhrase.DisplayText}get Offset(){return this.privSimpleSpeechPhrase.Offset}get Duration(){return this.privSimpleSpeechPhrase.Duration}get Language(){return void 0===this.privSimpleSpeechPhrase.PrimaryLanguage?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privSimpleSpeechPhrase.PrimaryLanguage?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSimpleSpeechPhrase.SpeakerId}}var Gt,Vt,Wt={};e(Wt,"RequestSession",(()=>an),(e=>an=e));class qt extends R{constructor(e,t,n,r=M.Info){super(e,r),this.privRequestId=t,this.privSessionId=n}get requestId(){return this.privRequestId}get sessionId(){return this.privSessionId}}class Kt extends qt{constructor(e,t,n,r){super("RecognitionTriggeredEvent",e,t),this.privAudioSourceId=n,this.privAudioNodeId=r}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}}class Jt extends qt{constructor(e,t,n,r){super("ListeningStartedEvent",e,t),this.privAudioSourceId=n,this.privAudioNodeId=r}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}}class Qt extends qt{constructor(e,t,n){super("ConnectingToServiceEvent",e,n),this.privAuthFetchEventid=t}get authFetchEventid(){return this.privAuthFetchEventid}}class Xt extends qt{constructor(e,t,n,r,i){super("RecognitionStartedEvent",e,i),this.privAudioSourceId=t,this.privAudioNodeId=n,this.privAuthFetchEventId=r}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}get authFetchEventId(){return this.privAuthFetchEventId}}(Vt=Gt||(Gt={}))[Vt.Success=0]="Success",Vt[Vt.AudioSourceError=1]="AudioSourceError",Vt[Vt.AudioSourceTimeout=2]="AudioSourceTimeout",Vt[Vt.AuthTokenFetchError=3]="AuthTokenFetchError",Vt[Vt.AuthTokenFetchTimeout=4]="AuthTokenFetchTimeout",Vt[Vt.UnAuthorized=5]="UnAuthorized",Vt[Vt.ConnectTimeout=6]="ConnectTimeout",Vt[Vt.ConnectError=7]="ConnectError",Vt[Vt.ClientRecognitionActivityTimeout=8]="ClientRecognitionActivityTimeout",Vt[Vt.UnknownError=9]="UnknownError";class Yt{constructor(e,t,n){this.privIsDisposed=!1,this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privRequestId=e,this.privAudioSourceId=t,this.privAudioNodeId=n,this.privReceivedMessages={},this.privPhraseLatencies=[],this.privHypothesisLatencies=[]}phraseReceived(e){e>0&&this.privPhraseLatencies.push(Date.now()-e)}hypothesisReceived(e){e>0&&this.privHypothesisLatencies.push(Date.now()-e)}onEvent(e){if(!this.privIsDisposed&&(e instanceof Kt&&e.requestId===this.privRequestId&&(this.privListeningTriggerMetric={End:e.eventTime,Name:"ListeningTrigger",Start:e.eventTime}),e instanceof U&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=e.eventTime),e instanceof F&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=e.eventTime),e instanceof L&&e.audioSourceId===this.privAudioSourceId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:this.privMicStartTime})),e instanceof j&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:this.privMicStartTime})),e instanceof z&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Name:"Microphone",Start:this.privMicStartTime})),e instanceof Qt&&e.requestId===this.privRequestId&&(this.privConnectionId=e.sessionId),e instanceof V&&e.connectionId===this.privConnectionId&&(this.privConnectionStartTime=e.eventTime),e instanceof W&&e.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:e.eventTime,Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),e instanceof J&&e.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:e.eventTime,Error:this.getConnectionError(e.statusCode),Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),e instanceof Q&&e.connectionId===this.privConnectionId&&e.message&&e.message.headers&&e.message.headers.path)){this.privReceivedMessages[e.message.headers.path]||(this.privReceivedMessages[e.message.headers.path]=new Array);const t=50;this.privReceivedMessages[e.message.headers.path].length<t&&this.privReceivedMessages[e.message.headers.path].push(e.networkReceivedTime)}}getTelemetry(){const e=new Array;this.privListeningTriggerMetric&&e.push(this.privListeningTriggerMetric),this.privMicMetric&&e.push(this.privMicMetric),this.privConnectionEstablishMetric&&e.push(this.privConnectionEstablishMetric),this.privPhraseLatencies.length>0&&e.push({PhraseLatencyMs:this.privPhraseLatencies}),this.privHypothesisLatencies.length>0&&e.push({FirstHypothesisLatencyMs:this.privHypothesisLatencies});const t={Metrics:e,ReceivedMessages:this.privReceivedMessages},n=JSON.stringify(t);return this.privReceivedMessages={},this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privPhraseLatencies=[],this.privHypothesisLatencies=[],n}get hasTelemetry(){return 0!==Object.keys(this.privReceivedMessages).length||null!==this.privListeningTriggerMetric||null!==this.privMicMetric||null!==this.privConnectionEstablishMetric||0!==this.privPhraseLatencies.length||0!==this.privHypothesisLatencies.length}dispose(){this.privIsDisposed=!0}getConnectionError(e){switch(e){case 400:case 1002:case 1003:case 1005:case 1007:case 1008:case 1009:return"BadRequest";case 401:return"Unauthorized";case 403:return"Forbidden";case 503:case 1001:return"ServerUnavailable";case 500:case 1011:return"ServerError";case 408:case 504:return"Timeout";default:return"statuscode:"+e.toString()}}}var Zt,$t,en,tn,nn,rn,on=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class an{constructor(e){this.privIsDisposed=!1,this.privDetachables=new Array,this.privIsAudioNodeDetached=!1,this.privIsRecognizing=!1,this.privIsSpeechEnded=!1,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privHypothesisReceived=!1,this.privBytesSent=0,this.privRecogNumber=0,this.privInTurn=!1,this.privConnectionAttempts=0,this.privAudioSourceId=e,this.privRequestId=x(),this.privAudioNodeId=x(),this.privTurnDeferral=new ie,this.privTurnDeferral.resolve()}get sessionId(){return this.privSessionId}get requestId(){return this.privRequestId}get audioNodeId(){return this.privAudioNodeId}get turnCompletionPromise(){return this.privTurnDeferral.promise}get isSpeechEnded(){return this.privIsSpeechEnded}get isRecognizing(){return this.privIsRecognizing}get currentTurnAudioOffset(){return this.privTurnStartAudioOffset}get recogNumber(){return this.privRecogNumber}get numConnectionAttempts(){return this.privConnectionAttempts}get bytesSent(){return this.privBytesSent}listenForServiceTelemetry(e){this.privServiceTelemetryListener&&this.privDetachables.push(e.attachListener(this.privServiceTelemetryListener))}startNewRecognition(){this.privIsSpeechEnded=!1,this.privIsRecognizing=!0,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privRecogNumber++,this.privServiceTelemetryListener=new Yt(this.privRequestId,this.privAudioSourceId,this.privAudioNodeId),this.onEvent(new Kt(this.requestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}onAudioSourceAttachCompleted(e,t){return on(this,void 0,void 0,(function*(){this.privAudioNode=e,this.privIsAudioNodeDetached=!1,t?yield this.onComplete():this.onEvent(new Jt(this.privRequestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}))}onPreConnectionStart(e,t){this.privAuthFetchEventId=e,this.privSessionId=t,this.onEvent(new Qt(this.privRequestId,this.privAuthFetchEventId,this.privSessionId))}onAuthCompleted(e){return on(this,void 0,void 0,(function*(){e&&(yield this.onComplete())}))}onConnectionEstablishCompleted(e,t){return on(this,void 0,void 0,(function*(){if(200===e)return this.onEvent(new Xt(this.requestId,this.privAudioSourceId,this.privAudioNodeId,this.privAuthFetchEventId,this.privSessionId)),this.privAudioNode&&this.privAudioNode.replay(),this.privTurnStartAudioOffset=this.privLastRecoOffset,void(this.privBytesSent=0);403===e&&(yield this.onComplete())}))}onServiceTurnEndResponse(e){return on(this,void 0,void 0,(function*(){this.privTurnDeferral.resolve(),!e||this.isSpeechEnded?(yield this.onComplete(),this.privInTurn=!1):(this.privTurnStartAudioOffset=this.privLastRecoOffset,this.privAudioNode.replay())}))}onSpeechContext(){this.privRequestId=x()}onServiceTurnStartResponse(){this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch((()=>{}))),this.privInTurn=!0,this.privTurnDeferral=new ie}onHypothesis(e){this.privHypothesisReceived||(this.privHypothesisReceived=!0,this.privServiceTelemetryListener.hypothesisReceived(this.privAudioNode.findTimeAtOffset(e)))}onPhraseRecognized(e){this.privServiceTelemetryListener.phraseReceived(this.privAudioNode.findTimeAtOffset(e)),this.onServiceRecognized(e)}onServiceRecognized(e){this.privLastRecoOffset=e,this.privHypothesisReceived=!1,this.privAudioNode.shrinkBuffers(e),this.privConnectionAttempts=0}onAudioSent(e){this.privBytesSent+=e}onRetryConnection(){this.privConnectionAttempts++}dispose(){return on(this,void 0,void 0,(function*(){if(!this.privIsDisposed){this.privIsDisposed=!0;for(const e of this.privDetachables)yield e.detach();this.privServiceTelemetryListener&&this.privServiceTelemetryListener.dispose(),this.privIsRecognizing=!1}}))}getTelemetry(){return this.privServiceTelemetryListener.hasTelemetry?this.privServiceTelemetryListener.getTelemetry():null}onStopRecognizing(){return on(this,void 0,void 0,(function*(){yield this.onComplete()}))}onSpeechEnded(){this.privIsSpeechEnded=!0}onEvent(e){this.privServiceTelemetryListener&&this.privServiceTelemetryListener.onEvent(e),re.instance.onEvent(e)}onComplete(){return on(this,void 0,void 0,(function*(){this.privIsRecognizing&&(this.privIsRecognizing=!1,yield this.detachAudioNode())}))}detachAudioNode(){return on(this,void 0,void 0,(function*(){this.privIsAudioNodeDetached||(this.privIsAudioNodeDetached=!0,this.privAudioNode&&(yield this.privAudioNode.detach()))}))}}class sn{constructor(e){this.privContext={},this.privDynamicGrammar=e}setSection(e,t){this.privContext[e]=t}setPronunciationAssessmentParams(e){void 0===this.privContext.phraseDetection&&(this.privContext.phraseDetection={enrichment:{pronunciationAssessment:{}}}),this.privContext.phraseDetection.enrichment.pronunciationAssessment=JSON.parse(e),this.setWordLevelTimings(),this.privContext.phraseOutput.detailed.options.push("PronunciationAssessment"),-1===this.privContext.phraseOutput.detailed.options.indexOf("SNR")&&this.privContext.phraseOutput.detailed.options.push("SNR")}setWordLevelTimings(){void 0===this.privContext.phraseOutput&&(this.privContext.phraseOutput={detailed:{options:[]},format:{}}),void 0===this.privContext.phraseOutput.detailed&&(this.privContext.phraseOutput.detailed={options:[]}),this.privContext.phraseOutput.format="Detailed",-1===this.privContext.phraseOutput.detailed.options.indexOf("WordTimings")&&this.privContext.phraseOutput.detailed.options.push("WordTimings")}toJSON(){const e=this.privDynamicGrammar.generateGrammarObject();this.setSection("dgi",e);return JSON.stringify(this.privContext)}}class ln{addPhrase(e){this.privPhrases||(this.privPhrases=[]),e instanceof Array?this.privPhrases=this.privPhrases.concat(e):this.privPhrases.push(e)}clearPhrases(){this.privPhrases=void 0}addReferenceGrammar(e){this.privGrammars||(this.privGrammars=[]),e instanceof Array?this.privGrammars=this.privGrammars.concat(e):this.privGrammars.push(e)}clearGrammars(){this.privGrammars=void 0}generateGrammarObject(){if(void 0===this.privGrammars&&void 0===this.privPhrases)return;const e={};if(e.ReferenceGrammars=this.privGrammars,void 0!==this.privPhrases&&0!==this.privPhrases.length){const t=[];this.privPhrases.forEach((e=>{t.push({Text:e})})),e.Groups=[{Type:"Generic",Items:t}]}return e}}($t=Zt||(Zt={}))[$t.Raw8Khz8BitMonoMULaw=0]="Raw8Khz8BitMonoMULaw",$t[$t.Riff16Khz16KbpsMonoSiren=1]="Riff16Khz16KbpsMonoSiren",$t[$t.Audio16Khz16KbpsMonoSiren=2]="Audio16Khz16KbpsMonoSiren",$t[$t.Audio16Khz32KBitRateMonoMp3=3]="Audio16Khz32KBitRateMonoMp3",$t[$t.Audio16Khz128KBitRateMonoMp3=4]="Audio16Khz128KBitRateMonoMp3",$t[$t.Audio16Khz64KBitRateMonoMp3=5]="Audio16Khz64KBitRateMonoMp3",$t[$t.Audio24Khz48KBitRateMonoMp3=6]="Audio24Khz48KBitRateMonoMp3",$t[$t.Audio24Khz96KBitRateMonoMp3=7]="Audio24Khz96KBitRateMonoMp3",$t[$t.Audio24Khz160KBitRateMonoMp3=8]="Audio24Khz160KBitRateMonoMp3",$t[$t.Raw16Khz16BitMonoTrueSilk=9]="Raw16Khz16BitMonoTrueSilk",$t[$t.Riff16Khz16BitMonoPcm=10]="Riff16Khz16BitMonoPcm",$t[$t.Riff8Khz16BitMonoPcm=11]="Riff8Khz16BitMonoPcm",$t[$t.Riff24Khz16BitMonoPcm=12]="Riff24Khz16BitMonoPcm",$t[$t.Riff8Khz8BitMonoMULaw=13]="Riff8Khz8BitMonoMULaw",$t[$t.Raw16Khz16BitMonoPcm=14]="Raw16Khz16BitMonoPcm",$t[$t.Raw24Khz16BitMonoPcm=15]="Raw24Khz16BitMonoPcm",$t[$t.Raw8Khz16BitMonoPcm=16]="Raw8Khz16BitMonoPcm",$t[$t.Ogg16Khz16BitMonoOpus=17]="Ogg16Khz16BitMonoOpus",$t[$t.Ogg24Khz16BitMonoOpus=18]="Ogg24Khz16BitMonoOpus",$t[$t.Raw48Khz16BitMonoPcm=19]="Raw48Khz16BitMonoPcm",$t[$t.Riff48Khz16BitMonoPcm=20]="Riff48Khz16BitMonoPcm",$t[$t.Audio48Khz96KBitRateMonoMp3=21]="Audio48Khz96KBitRateMonoMp3",$t[$t.Audio48Khz192KBitRateMonoMp3=22]="Audio48Khz192KBitRateMonoMp3",$t[$t.Ogg48Khz16BitMonoOpus=23]="Ogg48Khz16BitMonoOpus",$t[$t.Webm16Khz16BitMonoOpus=24]="Webm16Khz16BitMonoOpus",$t[$t.Webm24Khz16BitMonoOpus=25]="Webm24Khz16BitMonoOpus",$t[$t.Raw24Khz16BitMonoTrueSilk=26]="Raw24Khz16BitMonoTrueSilk",$t[$t.Raw8Khz8BitMonoALaw=27]="Raw8Khz8BitMonoALaw",$t[$t.Riff8Khz8BitMonoALaw=28]="Riff8Khz8BitMonoALaw",$t[$t.Webm24Khz16Bit24KbpsMonoOpus=29]="Webm24Khz16Bit24KbpsMonoOpus",$t[$t.Audio16Khz16Bit32KbpsMonoOpus=30]="Audio16Khz16Bit32KbpsMonoOpus",$t[$t.Audio24Khz16Bit48KbpsMonoOpus=31]="Audio24Khz16Bit48KbpsMonoOpus",$t[$t.Audio24Khz16Bit24KbpsMonoOpus=32]="Audio24Khz16Bit24KbpsMonoOpus",$t[$t.Raw22050Hz16BitMonoPcm=33]="Raw22050Hz16BitMonoPcm",$t[$t.Riff22050Hz16BitMonoPcm=34]="Riff22050Hz16BitMonoPcm",$t[$t.Raw44100Hz16BitMonoPcm=35]="Raw44100Hz16BitMonoPcm",$t[$t.Riff44100Hz16BitMonoPcm=36]="Riff44100Hz16BitMonoPcm",(tn=en||(en={}))[tn.PCM=1]="PCM",tn[tn.MuLaw=2]="MuLaw",tn[tn.Siren=3]="Siren",tn[tn.MP3=4]="MP3",tn[tn.SILKSkype=5]="SILKSkype",tn[tn.OGG_OPUS=6]="OGG_OPUS",tn[tn.WEBM_OPUS=7]="WEBM_OPUS",tn[tn.ALaw=8]="ALaw",tn[tn.FLAC=9]="FLAC",tn[tn.OPUS=10]="OPUS";class cn{static getDefaultInputFormat(){return un.getDefaultInputFormat()}static getWaveFormat(e,t,n,r){return new un(e,t,n,r)}static getWaveFormatPCM(e,t,n){return new un(e,t,n)}}class un extends cn{constructor(e=16e3,t=16,n=1,r=en.PCM){super();let i=!0;switch(r){case en.PCM:this.formatTag=1;break;case en.ALaw:this.formatTag=6;break;case en.MuLaw:this.formatTag=7;break;default:i=!1}if(this.bitsPerSample=t,this.samplesPerSec=e,this.channels=n,this.avgBytesPerSec=this.samplesPerSec*this.channels*(this.bitsPerSample/8),this.blockAlign=this.channels*Math.max(this.bitsPerSample,8),i){this.privHeader=new ArrayBuffer(44);const e=new DataView(this.privHeader);this.setString(e,0,"RIFF"),e.setUint32(4,0,!0),this.setString(e,8,"WAVEfmt "),e.setUint32(16,16,!0),e.setUint16(20,this.formatTag,!0),e.setUint16(22,this.channels,!0),e.setUint32(24,this.samplesPerSec,!0),e.setUint32(28,this.avgBytesPerSec,!0),e.setUint16(32,this.channels*(this.bitsPerSample/8),!0),e.setUint16(34,this.bitsPerSample,!0),this.setString(e,36,"data"),e.setUint32(40,0,!0)}}static getDefaultInputFormat(){return new un}static getAudioContext(e){const t=window.AudioContext||window.webkitAudioContext||!1;if(t)return void 0!==e&&navigator.mediaDevices.getSupportedConstraints().sampleRate?new t({sampleRate:e}):new t;throw new Error("Browser does not support Web Audio API (AudioContext is not available).")}close(){}get header(){return this.privHeader}setString(e,t,n){for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))}}class dn extends un{constructor(e,t,n,r,i,o,a,s,l){super(n,o,t,e),this.formatTag=e,this.avgBytesPerSec=r,this.blockAlign=i,this.priAudioFormatString=a,this.priRequestAudioFormatString=s,this.priHasHeader=l}static fromSpeechSynthesisOutputFormat(e){return void 0===e?dn.getDefaultOutputFormat():dn.fromSpeechSynthesisOutputFormatString(dn.SpeechSynthesisOutputFormatToString[e])}static fromSpeechSynthesisOutputFormatString(e){switch(e){case"raw-8khz-8bit-mono-mulaw":return new dn(en.MuLaw,1,8e3,8e3,1,8,e,e,!1);case"riff-16khz-16kbps-mono-siren":return new dn(en.Siren,1,16e3,2e3,40,0,e,"audio-16khz-16kbps-mono-siren",!0);case"audio-16khz-16kbps-mono-siren":return new dn(en.Siren,1,16e3,2e3,40,0,e,e,!1);case"audio-16khz-32kbitrate-mono-mp3":return new dn(en.MP3,1,16e3,4096,2,16,e,e,!1);case"audio-16khz-128kbitrate-mono-mp3":return new dn(en.MP3,1,16e3,16384,2,16,e,e,!1);case"audio-16khz-64kbitrate-mono-mp3":return new dn(en.MP3,1,16e3,8192,2,16,e,e,!1);case"audio-24khz-48kbitrate-mono-mp3":return new dn(en.MP3,1,24e3,6144,2,16,e,e,!1);case"audio-24khz-96kbitrate-mono-mp3":return new dn(en.MP3,1,24e3,12288,2,16,e,e,!1);case"audio-24khz-160kbitrate-mono-mp3":return new dn(en.MP3,1,24e3,20480,2,16,e,e,!1);case"raw-16khz-16bit-mono-truesilk":return new dn(en.SILKSkype,1,16e3,32e3,2,16,e,e,!1);case"riff-8khz-16bit-mono-pcm":return new dn(en.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!0);case"riff-24khz-16bit-mono-pcm":return new dn(en.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!0);case"riff-8khz-8bit-mono-mulaw":return new dn(en.MuLaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-mulaw",!0);case"raw-16khz-16bit-mono-pcm":return new dn(en.PCM,1,16e3,32e3,2,16,e,"raw-16khz-16bit-mono-pcm",!1);case"raw-24khz-16bit-mono-pcm":return new dn(en.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!1);case"raw-8khz-16bit-mono-pcm":return new dn(en.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!1);case"ogg-16khz-16bit-mono-opus":return new dn(en.OGG_OPUS,1,16e3,8192,2,16,e,e,!1);case"ogg-24khz-16bit-mono-opus":return new dn(en.OGG_OPUS,1,24e3,8192,2,16,e,e,!1);case"raw-48khz-16bit-mono-pcm":return new dn(en.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!1);case"riff-48khz-16bit-mono-pcm":return new dn(en.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!0);case"audio-48khz-96kbitrate-mono-mp3":return new dn(en.MP3,1,48e3,12288,2,16,e,e,!1);case"audio-48khz-192kbitrate-mono-mp3":return new dn(en.MP3,1,48e3,24576,2,16,e,e,!1);case"ogg-48khz-16bit-mono-opus":return new dn(en.OGG_OPUS,1,48e3,12e3,2,16,e,e,!1);case"webm-16khz-16bit-mono-opus":return new dn(en.WEBM_OPUS,1,16e3,4e3,2,16,e,e,!1);case"webm-24khz-16bit-mono-opus":return new dn(en.WEBM_OPUS,1,24e3,6e3,2,16,e,e,!1);case"webm-24khz-16bit-24kbps-mono-opus":return new dn(en.WEBM_OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-16khz-16bit-32kbps-mono-opus":return new dn(en.OPUS,1,16e3,4e3,2,16,e,e,!1);case"audio-24khz-16bit-48kbps-mono-opus":return new dn(en.OPUS,1,24e3,6e3,2,16,e,e,!1);case"audio-24khz-16bit-24kbps-mono-opus":return new dn(en.OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-24khz-16bit-mono-flac":return new dn(en.FLAC,1,24e3,24e3,2,16,e,e,!1);case"audio-48khz-16bit-mono-flac":return new dn(en.FLAC,1,48e3,3e4,2,16,e,e,!1);case"raw-24khz-16bit-mono-truesilk":return new dn(en.SILKSkype,1,24e3,48e3,2,16,e,e,!1);case"raw-8khz-8bit-mono-alaw":return new dn(en.ALaw,1,8e3,8e3,1,8,e,e,!1);case"riff-8khz-8bit-mono-alaw":return new dn(en.ALaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-alaw",!0);case"raw-22050hz-16bit-mono-pcm":return new dn(en.PCM,1,22050,44100,2,16,e,e,!1);case"riff-22050hz-16bit-mono-pcm":return new dn(en.PCM,1,22050,44100,2,16,e,"raw-22050hz-16bit-mono-pcm",!0);case"raw-44100hz-16bit-mono-pcm":return new dn(en.PCM,1,44100,88200,2,16,e,e,!1);case"riff-44100hz-16bit-mono-pcm":return new dn(en.PCM,1,44100,88200,2,16,e,"raw-44100hz-16bit-mono-pcm",!0);default:return new dn(en.PCM,1,16e3,32e3,2,16,"riff-16khz-16bit-mono-pcm","raw-16khz-16bit-mono-pcm",!0)}}static getDefaultOutputFormat(){return dn.fromSpeechSynthesisOutputFormatString("undefined"!=typeof window?"audio-24khz-48kbitrate-mono-mp3":"riff-16khz-16bit-mono-pcm")}get hasHeader(){return this.priHasHeader}get header(){if(this.hasHeader)return this.privHeader}updateHeader(e){if(this.priHasHeader){const t=new DataView(this.privHeader);t.setUint32(4,e+this.privHeader.byteLength-8,!0),t.setUint32(40,e,!0)}}get requestAudioFormatString(){return this.priRequestAudioFormatString}}dn.SpeechSynthesisOutputFormatToString={[Zt.Raw8Khz8BitMonoMULaw]:"raw-8khz-8bit-mono-mulaw",[Zt.Riff16Khz16KbpsMonoSiren]:"riff-16khz-16kbps-mono-siren",[Zt.Audio16Khz16KbpsMonoSiren]:"audio-16khz-16kbps-mono-siren",[Zt.Audio16Khz32KBitRateMonoMp3]:"audio-16khz-32kbitrate-mono-mp3",[Zt.Audio16Khz128KBitRateMonoMp3]:"audio-16khz-128kbitrate-mono-mp3",[Zt.Audio16Khz64KBitRateMonoMp3]:"audio-16khz-64kbitrate-mono-mp3",[Zt.Audio24Khz48KBitRateMonoMp3]:"audio-24khz-48kbitrate-mono-mp3",[Zt.Audio24Khz96KBitRateMonoMp3]:"audio-24khz-96kbitrate-mono-mp3",[Zt.Audio24Khz160KBitRateMonoMp3]:"audio-24khz-160kbitrate-mono-mp3",[Zt.Raw16Khz16BitMonoTrueSilk]:"raw-16khz-16bit-mono-truesilk",[Zt.Riff16Khz16BitMonoPcm]:"riff-16khz-16bit-mono-pcm",[Zt.Riff8Khz16BitMonoPcm]:"riff-8khz-16bit-mono-pcm",[Zt.Riff24Khz16BitMonoPcm]:"riff-24khz-16bit-mono-pcm",[Zt.Riff8Khz8BitMonoMULaw]:"riff-8khz-8bit-mono-mulaw",[Zt.Raw16Khz16BitMonoPcm]:"raw-16khz-16bit-mono-pcm",[Zt.Raw24Khz16BitMonoPcm]:"raw-24khz-16bit-mono-pcm",[Zt.Raw8Khz16BitMonoPcm]:"raw-8khz-16bit-mono-pcm",[Zt.Ogg16Khz16BitMonoOpus]:"ogg-16khz-16bit-mono-opus",[Zt.Ogg24Khz16BitMonoOpus]:"ogg-24khz-16bit-mono-opus",[Zt.Raw48Khz16BitMonoPcm]:"raw-48khz-16bit-mono-pcm",[Zt.Riff48Khz16BitMonoPcm]:"riff-48khz-16bit-mono-pcm",[Zt.Audio48Khz96KBitRateMonoMp3]:"audio-48khz-96kbitrate-mono-mp3",[Zt.Audio48Khz192KBitRateMonoMp3]:"audio-48khz-192kbitrate-mono-mp3",[Zt.Ogg48Khz16BitMonoOpus]:"ogg-48khz-16bit-mono-opus",[Zt.Webm16Khz16BitMonoOpus]:"webm-16khz-16bit-mono-opus",[Zt.Webm24Khz16BitMonoOpus]:"webm-24khz-16bit-mono-opus",[Zt.Webm24Khz16Bit24KbpsMonoOpus]:"webm-24khz-16bit-24kbps-mono-opus",[Zt.Raw24Khz16BitMonoTrueSilk]:"raw-24khz-16bit-mono-truesilk",[Zt.Raw8Khz8BitMonoALaw]:"raw-8khz-8bit-mono-alaw",[Zt.Riff8Khz8BitMonoALaw]:"riff-8khz-8bit-mono-alaw",[Zt.Audio16Khz16Bit32KbpsMonoOpus]:"audio-16khz-16bit-32kbps-mono-opus",[Zt.Audio24Khz16Bit48KbpsMonoOpus]:"audio-24khz-16bit-48kbps-mono-opus",[Zt.Audio24Khz16Bit24KbpsMonoOpus]:"audio-24khz-16bit-24kbps-mono-opus",[Zt.Raw22050Hz16BitMonoPcm]:"raw-22050hz-16bit-mono-pcm",[Zt.Riff22050Hz16BitMonoPcm]:"riff-22050hz-16bit-mono-pcm",[Zt.Raw44100Hz16BitMonoPcm]:"raw-44100hz-16bit-mono-pcm",[Zt.Riff44100Hz16BitMonoPcm]:"riff-44100hz-16bit-mono-pcm"};(rn=nn||(nn={}))[rn.Masked=0]="Masked",rn[rn.Removed=1]="Removed",rn[rn.Raw=2]="Raw";class hn{constructor(){}static fromSubscription(e,t){Ue.throwIfNullOrWhitespace(e,"subscriptionKey"),Ue.throwIfNullOrWhitespace(t,"region");const n=new fn;return n.setProperty(Qe.SpeechServiceConnection_Region,t),n.setProperty(Qe.SpeechServiceConnection_IntentRegion,t),n.setProperty(Qe.SpeechServiceConnection_Key,e),n}static fromEndpoint(e,t){Ue.throwIfNull(e,"endpoint");const n=new fn;return n.setProperty(Qe.SpeechServiceConnection_Endpoint,e.href),void 0!==t&&n.setProperty(Qe.SpeechServiceConnection_Key,t),n}static fromHost(e,t){Ue.throwIfNull(e,"hostName");const n=new fn;return n.setProperty(Qe.SpeechServiceConnection_Host,e.protocol+"//"+e.hostname+(""===e.port?"":":"+e.port)),void 0!==t&&n.setProperty(Qe.SpeechServiceConnection_Key,t),n}static fromAuthorizationToken(e,t){Ue.throwIfNull(e,"authorizationToken"),Ue.throwIfNullOrWhitespace(t,"region");const n=new fn;return n.setProperty(Qe.SpeechServiceConnection_Region,t),n.setProperty(Qe.SpeechServiceConnection_IntentRegion,t),n.authorizationToken=e,n}close(){}}class fn extends hn{constructor(){super(),this.privProperties=new kt,this.speechRecognitionLanguage="en-US",this.outputFormat=vt.Simple}get properties(){return this.privProperties}get endPoint(){return new URL(this.privProperties.getProperty(Qe.SpeechServiceConnection_Endpoint))}get subscriptionKey(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_Key)}get region(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_Region)}get authorizationToken(){return this.privProperties.getProperty(Qe.SpeechServiceAuthorization_Token)}set authorizationToken(e){this.privProperties.setProperty(Qe.SpeechServiceAuthorization_Token,e)}get speechRecognitionLanguage(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_RecoLanguage)}set speechRecognitionLanguage(e){this.privProperties.setProperty(Qe.SpeechServiceConnection_RecoLanguage,e)}get autoDetectSourceLanguages(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_AutoDetectSourceLanguages)}set autoDetectSourceLanguages(e){this.privProperties.setProperty(Qe.SpeechServiceConnection_AutoDetectSourceLanguages,e)}get outputFormat(){return vt[this.privProperties.getProperty(Xn,void 0)]}set outputFormat(e){this.privProperties.setProperty(Xn,vt[e])}get endpointId(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_EndpointId)}set endpointId(e){this.privProperties.setProperty(Qe.SpeechServiceConnection_EndpointId,e)}setProperty(e,t){Ue.throwIfNull(t,"value"),this.privProperties.setProperty(e,t)}getProperty(e,t){return this.privProperties.getProperty(e,t)}setProxy(e,t,n,r){this.setProperty(Qe[Qe.SpeechServiceConnection_ProxyHostName],e),this.setProperty(Qe[Qe.SpeechServiceConnection_ProxyPort],t),this.setProperty(Qe[Qe.SpeechServiceConnection_ProxyUserName],n),this.setProperty(Qe[Qe.SpeechServiceConnection_ProxyPassword],r)}setServiceProperty(e,t){const n=JSON.parse(this.privProperties.getProperty(Zn,"{}"));n[e]=t,this.privProperties.setProperty(Zn,JSON.stringify(n))}setProfanity(e){this.privProperties.setProperty(Qe.SpeechServiceResponse_ProfanityOption,nn[e])}enableAudioLogging(){this.privProperties.setProperty(Qe.SpeechServiceConnection_EnableAudioLogging,"true")}requestWordLevelTimestamps(){this.privProperties.setProperty(Qe.SpeechServiceResponse_RequestWordLevelTimestamps,"true")}enableDictation(){this.privProperties.setProperty($n,"true")}clone(){const e=new fn;return e.privProperties=this.privProperties.clone(),e}get speechSynthesisLanguage(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_SynthLanguage)}set speechSynthesisLanguage(e){this.privProperties.setProperty(Qe.SpeechServiceConnection_SynthLanguage,e)}get speechSynthesisVoiceName(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_SynthVoice)}set speechSynthesisVoiceName(e){this.privProperties.setProperty(Qe.SpeechServiceConnection_SynthVoice,e)}get speechSynthesisOutputFormat(){return Zt[this.privProperties.getProperty(Qe.SpeechServiceConnection_SynthOutputFormat,void 0)]}set speechSynthesisOutputFormat(e){this.privProperties.setProperty(Qe.SpeechServiceConnection_SynthOutputFormat,Zt[e])}}var pn={};e(pn,"AudioOutputStream",(()=>bn),(e=>bn=e)),e(pn,"PullAudioOutputStream",(()=>yn),(e=>yn=e)),e(pn,"PullAudioOutputStreamImpl",(()=>wn),(e=>wn=e)),e(pn,"PushAudioOutputStream",(()=>Sn),(e=>Sn=e)),e(pn,"PushAudioOutputStreamImpl",(()=>xn),(e=>xn=e));var mn,gn,vn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class bn{constructor(){}static createPullStream(){return yn.create()}}class yn extends bn{static create(){return new wn}}class wn extends yn{constructor(){super(),this.privId=x(),this.privStream=new(0,pe.Stream)}set format(e){null==e&&(this.privFormat=dn.getDefaultOutputFormat()),this.privFormat=e}get format(){return this.privFormat}get isClosed(){return this.privStream.isClosed}id(){return this.privId}read(e){return vn(this,void 0,void 0,(function*(){const t=new Int8Array(e);let n=0;if(void 0!==this.privLastChunkView){if(this.privLastChunkView.length>e.byteLength)return t.set(this.privLastChunkView.slice(0,e.byteLength)),this.privLastChunkView=this.privLastChunkView.slice(e.byteLength),Promise.resolve(e.byteLength);t.set(this.privLastChunkView),n=this.privLastChunkView.length,this.privLastChunkView=void 0}for(;n<e.byteLength&&!this.privStream.isReadEnded;){const r=yield this.privStream.read();if(void 0===r||r.isEnd)this.privStream.readEnded();else{let i;r.buffer.byteLength>e.byteLength-n?(i=r.buffer.slice(0,e.byteLength-n),this.privLastChunkView=new Int8Array(r.buffer.slice(e.byteLength-n))):i=r.buffer,t.set(new Int8Array(i),n),n+=i.byteLength}}return n}))}write(e){Ue.throwIfNullOrUndefined(this.privStream,"must set format before writing"),this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}}class Sn extends bn{constructor(){super()}static create(e){return new xn(e)}}class xn extends Sn{constructor(e){super(),this.privId=x(),this.privCallback=e}set format(e){}write(e){this.privCallback.write&&this.privCallback.write(e)}close(){this.privCallback.close&&this.privCallback.close()}id(){return this.privId}}(gn=mn||(mn={}))[gn.None=0]="None",gn[gn.TextToSpeechAudio=1]="TextToSpeechAudio";var Mn,_n;class An{toJsonString(){return JSON.stringify(this.iPrivConfig)}get(){return this.iPrivConfig}set(e){this.iPrivConfig=e}}(_n=Mn||(Mn={})).WordBoundary="WordBoundary",_n.Bookmark="Bookmark",_n.Viseme="Viseme",_n.SentenceBoundary="SentenceBoundary",_n.SessionEnd="SessionEnd";class En{constructor(e){this.privSynthesisAudioMetadata=JSON.parse(e)}static fromJSON(e){return new En(e)}get Metadata(){return this.privSynthesisAudioMetadata.Metadata}}var Cn={};e(Cn,"SynthesisTurn",(()=>qn),(e=>qn=e));var Tn={};e(Tn,"SynthesisAdapterBase",(()=>Ln),(e=>Ln=e));class In{constructor(e,t){this.privAudioOffset=e,this.privText=t}get audioOffset(){return this.privAudioOffset}get text(){return this.privText}}class kn{constructor(e){this.privResult=e}get result(){return this.privResult}}class Rn{constructor(e,t,n,r){this.privResultId=e,this.privReason=t,this.privErrorDetails=n,this.privProperties=r}get resultId(){return this.privResultId}get reason(){return this.privReason}get errorDetails(){return this.privErrorDetails}get properties(){return this.privProperties}}class On extends Rn{constructor(e,t,n,r,i,o){super(e,t,r,i),this.privAudioData=n,this.privAudioDuration=o}get audioData(){return this.privAudioData}get audioDuration(){return this.privAudioDuration}}class Pn{constructor(e,t,n){this.privAudioOffset=e,this.privVisemeId=t,this.privAnimation=n}get audioOffset(){return this.privAudioOffset}get visemeId(){return this.privVisemeId}get animation(){return this.privAnimation}}class Nn{constructor(e,t,n,r,i,o){this.privAudioOffset=e,this.privDuration=t,this.privText=n,this.privWordLength=r,this.privTextOffset=i,this.privBoundaryType=o}get audioOffset(){return this.privAudioOffset}get duration(){return this.privDuration}get text(){return this.privText}get wordLength(){return this.privWordLength}get textOffset(){return this.privTextOffset}get boundaryType(){return this.privBoundaryType}}var Bn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class Ln{constructor(e,t,n,r,i){if(this.speakOverride=void 0,this.receiveMessageOverride=void 0,this.connectImplOverride=void 0,this.configConnectionOverride=void 0,this.privConnectionConfigurationPromise=void 0,!e)throw new Y("authentication");if(!t)throw new Y("connectionFactory");if(!n)throw new Y("synthesizerConfig");this.privAuthentication=e,this.privConnectionFactory=t,this.privSynthesizerConfig=n,this.privIsDisposed=!1,this.privSpeechSynthesizer=r,this.privSessionAudioDestination=i,this.privSynthesisTurn=new(0,Cn.SynthesisTurn),this.privConnectionEvents=new ne,this.privServiceEvents=new ne,this.privSynthesisContext=new Qn(this.privSpeechSynthesizer),this.privAgentConfig=new An,this.connectionEvents.attach((e=>{if("ConnectionClosedEvent"===e.name){const t=e;1e3!==t.statusCode&&this.cancelSynthesisLocal(Ke.Error,1007===t.statusCode?We.BadRequestParameters:We.ConnectionFailure,`${t.reason} websocket error code: ${t.statusCode}`)}}))}get synthesisContext(){return this.privSynthesisContext}get agentConfig(){return this.privAgentConfig}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}set activityTemplate(e){this.privActivityTemplate=e}get activityTemplate(){return this.privActivityTemplate}set audioOutputFormat(e){this.privAudioOutputFormat=e,this.privSynthesisTurn.audioOutputFormat=e,void 0!==this.privSessionAudioDestination&&(this.privSessionAudioDestination.format=e),void 0!==this.synthesisContext&&(this.synthesisContext.audioOutputFormat=e)}static addHeader(e,t){if(!t.hasHeader)return e;t.updateHeader(e.byteLength);const n=new Uint8Array(e.byteLength+t.header.byteLength);return n.set(new Uint8Array(t.header),0),n.set(new Uint8Array(e),t.header.byteLength),n.buffer}isDisposed(){return this.privIsDisposed}dispose(e){return Bn(this,void 0,void 0,(function*(){if(this.privIsDisposed=!0,void 0!==this.privSessionAudioDestination&&this.privSessionAudioDestination.close(),void 0!==this.privConnectionConfigurationPromise){const t=yield this.privConnectionConfigurationPromise;yield t.dispose(e)}}))}connect(){return Bn(this,void 0,void 0,(function*(){yield this.connectImpl()}))}sendNetworkMessage(e,t){return Bn(this,void 0,void 0,(function*(){const n="string"==typeof t?A.Text:A.Binary,r="string"==typeof t?"application/json":"";return(yield this.fetchConnection()).send(new et(n,e,this.privSynthesisTurn.requestId,r,t))}))}Speak(e,t,n,r,i,o){return Bn(this,void 0,void 0,(function*(){let a;if(a=t?e:this.privSpeechSynthesizer.buildSsml(e),void 0!==this.speakOverride)return this.speakOverride(a,n,r,i);this.privSuccessCallback=r,this.privErrorCallback=i,this.privSynthesisTurn.startNewSynthesis(n,e,t,o);try{yield this.connectImpl();const e=yield this.fetchConnection();yield this.sendSynthesisContext(e),yield this.sendSsmlMessage(e,a,n);const t=new kn(new On(n,yt.SynthesizingAudioStarted));this.privSpeechSynthesizer.synthesisStarted&&this.privSpeechSynthesizer.synthesisStarted(this.privSpeechSynthesizer,t),this.receiveMessage()}catch(e){return this.cancelSynthesisLocal(Ke.Error,We.ConnectionFailure,e),Promise.reject(e)}}))}cancelSynthesis(e,t,n,r){const i=new kt;i.setProperty(Yn,We[n]);const o=new On(e,yt.Canceled,void 0,r,i);if(this.privSpeechSynthesizer.SynthesisCanceled){const e=new kn(o);try{this.privSpeechSynthesizer.SynthesisCanceled(this.privSpeechSynthesizer,e)}catch(e){}}if(this.privSuccessCallback)try{this.privSuccessCallback(o)}catch(e){}}cancelSynthesisLocal(e,t,n){this.privSynthesisTurn.isSynthesizing&&(this.privSynthesisTurn.onStopSynthesizing(),this.cancelSynthesis(this.privSynthesisTurn.requestId,e,t,n))}processTypeSpecificMessages(e){return!0}receiveMessage(){return Bn(this,void 0,void 0,(function*(){try{const e=yield this.fetchConnection(),t=yield e.read();if(void 0!==this.receiveMessageOverride)return this.receiveMessageOverride();if(this.privIsDisposed)return;if(!t)return this.privSynthesisTurn.isSynthesizing?this.receiveMessage():void 0;const n=et.fromConnectionMessage(t);if(n.requestId.toLowerCase()===this.privSynthesisTurn.requestId.toLowerCase())switch(n.path.toLowerCase()){case"turn.start":this.privSynthesisTurn.onServiceTurnStartResponse();break;case"response":this.privSynthesisTurn.onServiceResponseMessage(n.textBody);break;case"audio":if(this.privSynthesisTurn.streamId.toLowerCase()===n.streamId.toLowerCase()&&n.binaryBody){if(this.privSynthesisTurn.onAudioChunkReceived(n.binaryBody),this.privSpeechSynthesizer.synthesizing)try{const e=Ln.addHeader(n.binaryBody,this.privSynthesisTurn.audioOutputFormat),t=new kn(new On(this.privSynthesisTurn.requestId,yt.SynthesizingAudio,e));this.privSpeechSynthesizer.synthesizing(this.privSpeechSynthesizer,t)}catch(e){}void 0!==this.privSessionAudioDestination&&this.privSessionAudioDestination.write(n.binaryBody)}break;case"audio.metadata":const e=En.fromJSON(n.textBody).Metadata;for(const t of e)switch(t.Type){case Mn.WordBoundary:case Mn.SentenceBoundary:this.privSynthesisTurn.onTextBoundaryEvent(t);const e=new Nn(t.Data.Offset,t.Data.Duration,t.Data.text.Text,t.Data.text.Length,t.Type===Mn.WordBoundary?this.privSynthesisTurn.currentTextOffset:this.privSynthesisTurn.currentSentenceOffset,t.Data.text.BoundaryType);if(this.privSpeechSynthesizer.wordBoundary)try{this.privSpeechSynthesizer.wordBoundary(this.privSpeechSynthesizer,e)}catch(e){}break;case Mn.Bookmark:const n=new In(t.Data.Offset,t.Data.Bookmark);if(this.privSpeechSynthesizer.bookmarkReached)try{this.privSpeechSynthesizer.bookmarkReached(this.privSpeechSynthesizer,n)}catch(e){}break;case Mn.Viseme:if(this.privSynthesisTurn.onVisemeMetadataReceived(t),t.Data.IsLastAnimation){const e=new Pn(t.Data.Offset,t.Data.VisemeId,this.privSynthesisTurn.getAndClearVisemeAnimation());if(this.privSpeechSynthesizer.visemeReceived)try{this.privSpeechSynthesizer.visemeReceived(this.privSpeechSynthesizer,e)}catch(e){}}break;case Mn.SessionEnd:this.privSynthesisTurn.onSessionEnd(t)}break;case"turn.end":let t;this.privSynthesisTurn.onServiceTurnEndResponse();try{const e=yield this.privSynthesisTurn.getAllReceivedAudioWithHeader();t=new On(this.privSynthesisTurn.requestId,yt.SynthesizingAudioCompleted,e,void 0,void 0,this.privSynthesisTurn.audioDuration),this.privSuccessCallback&&this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}if(this.privSpeechSynthesizer.synthesisCompleted)try{this.privSpeechSynthesizer.synthesisCompleted(this.privSpeechSynthesizer,new kn(t))}catch(e){}break;default:this.processTypeSpecificMessages(n)||this.privServiceEvents&&this.serviceEvents.onEvent(new H(n.path.toLowerCase(),n.textBody))}return this.receiveMessage()}catch(e){}}))}sendSynthesisContext(e){const t=this.synthesisContext.toJSON();if(t)return e.send(new et(A.Text,"synthesis.context",this.privSynthesisTurn.requestId,"application/json",t))}connectImpl(e=!1){if(null!=this.privConnectionPromise)return this.privConnectionPromise.then((e=>e.state()===C.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=null,this.connectImpl()):this.privConnectionPromise),(()=>(this.privConnectionId=null,this.privConnectionPromise=null,this.connectImpl())));this.privAuthFetchEventId=x(),this.privConnectionId=x(),this.privSynthesisTurn.onPreConnectionStart(this.privAuthFetchEventId);const t=e?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId);return this.privConnectionPromise=t.then((t=>Bn(this,void 0,void 0,(function*(){this.privSynthesisTurn.onAuthCompleted(!1);const n=this.privConnectionFactory.create(this.privSynthesizerConfig,t,this.privConnectionId);n.events.attach((e=>{this.connectionEvents.onEvent(e)}));const r=yield n.open();return 200===r.statusCode?(this.privSynthesisTurn.onConnectionEstablishCompleted(r.statusCode),Promise.resolve(n)):403!==r.statusCode||e?(this.privSynthesisTurn.onConnectionEstablishCompleted(r.statusCode),Promise.reject(`Unable to contact server. StatusCode: ${r.statusCode}, ${this.privSynthesizerConfig.parameters.getProperty(Qe.SpeechServiceConnection_Endpoint)} Reason: ${r.reason}`)):this.connectImpl(!0)}))),(e=>{throw this.privSynthesisTurn.onAuthCompleted(!0),new Error(e)})),this.privConnectionPromise.catch((()=>{})),this.privConnectionPromise}sendSpeechServiceConfig(e,t){if(t)return e.send(new et(A.Text,"speech.config",this.privSynthesisTurn.requestId,"application/json",t))}sendSsmlMessage(e,t,n){return e.send(new et(A.Text,"ssml",n,"application/ssml+xml",t))}fetchConnection(){return Bn(this,void 0,void 0,(function*(){return void 0!==this.privConnectionConfigurationPromise?this.privConnectionConfigurationPromise.then((e=>e.state()===C.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection()):this.privConnectionConfigurationPromise),(()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection()))):(this.privConnectionConfigurationPromise=this.configureConnection(),yield this.privConnectionConfigurationPromise)}))}configureConnection(){return Bn(this,void 0,void 0,(function*(){const e=yield this.connectImpl();return void 0!==this.configConnectionOverride?this.configConnectionOverride(e):(yield this.sendSpeechServiceConfig(e,this.privSynthesizerConfig.SpeechServiceConfig.serialize()),e)}))}}Ln.telemetryDataEnabled=!0;class Dn extends R{constructor(e,t,n=M.Info){super(e,n),this.privRequestId=t}get requestId(){return this.privRequestId}}class Un extends Dn{constructor(e,t,n){super("SynthesisTriggeredEvent",e),this.privSessionAudioDestinationId=t,this.privTurnAudioDestinationId=n}get audioSessionDestinationId(){return this.privSessionAudioDestinationId}get audioTurnDestinationId(){return this.privTurnAudioDestinationId}}class Fn extends Dn{constructor(e,t){super("ConnectingToSynthesisServiceEvent",e),this.privAuthFetchEventId=t}get authFetchEventId(){return this.privAuthFetchEventId}}class zn extends Dn{constructor(e,t){super("SynthesisStartedEvent",e),this.privAuthFetchEventId=t}get authFetchEventId(){return this.privAuthFetchEventId}}var jn,Hn,Gn,Vn,Wn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class qn{constructor(){this.privIsDisposed=!1,this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!1,this.privBytesReceived=0,this.privInTurn=!1,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.privSentenceOffset=0,this.privNextSearchSentenceIndex=0,this.privRequestId=x(),this.privTurnDeferral=new ie,this.privTurnDeferral.resolve()}get requestId(){return this.privRequestId}get streamId(){return this.privStreamId}set streamId(e){this.privStreamId=e}get audioOutputFormat(){return this.privAudioOutputFormat}set audioOutputFormat(e){this.privAudioOutputFormat=e}get turnCompletionPromise(){return this.privTurnDeferral.promise}get isSynthesisEnded(){return this.privIsSynthesisEnded}get isSynthesizing(){return this.privIsSynthesizing}get currentTextOffset(){return this.privTextOffset}get currentSentenceOffset(){return this.privSentenceOffset}get bytesReceived(){return this.privBytesReceived}get audioDuration(){return this.privAudioDuration}getAllReceivedAudio(){return Wn(this,void 0,void 0,(function*(){return this.privReceivedAudio?Promise.resolve(this.privReceivedAudio):this.privIsSynthesisEnded?(yield this.readAllAudioFromStream(),Promise.resolve(this.privReceivedAudio)):null}))}getAllReceivedAudioWithHeader(){return Wn(this,void 0,void 0,(function*(){if(this.privReceivedAudioWithHeader)return this.privReceivedAudioWithHeader;if(!this.privIsSynthesisEnded)return null;if(this.audioOutputFormat.hasHeader){const e=yield this.getAllReceivedAudio();return this.privReceivedAudioWithHeader=Tn.SynthesisAdapterBase.addHeader(e,this.audioOutputFormat),this.privReceivedAudioWithHeader}return this.getAllReceivedAudio()}))}startNewSynthesis(e,t,n,r){this.privIsSynthesisEnded=!1,this.privIsSynthesizing=!0,this.privRequestId=e,this.privRawText=t,this.privIsSSML=n,this.privAudioOutputStream=new(0,pn.PullAudioOutputStreamImpl),this.privAudioOutputStream.format=this.privAudioOutputFormat,this.privReceivedAudio=null,this.privReceivedAudioWithHeader=null,this.privBytesReceived=0,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.privSentenceOffset=0,this.privNextSearchSentenceIndex=0,this.privPartialVisemeAnimation="",void 0!==r&&(this.privTurnAudioDestination=r,this.privTurnAudioDestination.format=this.privAudioOutputFormat),this.onEvent(new Un(this.requestId,void 0,void 0===r?void 0:r.id()))}onPreConnectionStart(e){this.privAuthFetchEventId=e,this.onEvent(new Fn(this.privRequestId,this.privAuthFetchEventId))}onAuthCompleted(e){e&&this.onComplete()}onConnectionEstablishCompleted(e){if(200===e)return this.onEvent(new zn(this.requestId,this.privAuthFetchEventId)),void(this.privBytesReceived=0);403===e&&this.onComplete()}onServiceResponseMessage(e){const t=JSON.parse(e);this.streamId=t.audio.streamId}onServiceTurnEndResponse(){this.privInTurn=!1,this.privTurnDeferral.resolve(),this.onComplete()}onServiceTurnStartResponse(){this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch((()=>{}))),this.privInTurn=!0,this.privTurnDeferral=new ie}onAudioChunkReceived(e){this.isSynthesizing&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength,void 0!==this.privTurnAudioDestination&&this.privTurnAudioDestination.write(e))}onTextBoundaryEvent(e){this.updateTextOffset(e.Data.text.Text,e.Type)}onVisemeMetadataReceived(e){void 0!==e.Data.AnimationChunk&&(this.privPartialVisemeAnimation+=e.Data.AnimationChunk)}onSessionEnd(e){this.privAudioDuration=e.Data.Offset}dispose(){this.privIsDisposed||(this.privIsDisposed=!0)}onStopSynthesizing(){this.onComplete()}getAndClearVisemeAnimation(){const e=this.privPartialVisemeAnimation;return this.privPartialVisemeAnimation="",e}onEvent(e){re.instance.onEvent(e)}static isXmlTag(e){return e.length>=2&&"<"===e[0]&&">"===e[e.length-1]}updateTextOffset(e,t){t===Mn.WordBoundary?(this.privTextOffset=this.privRawText.indexOf(e,this.privNextSearchTextIndex),this.privTextOffset>=0&&(this.privNextSearchTextIndex=this.privTextOffset+e.length,this.privIsSSML&&this.withinXmlTag(this.privTextOffset)&&!qn.isXmlTag(e)&&this.updateTextOffset(e,t))):(this.privSentenceOffset=this.privRawText.indexOf(e,this.privNextSearchSentenceIndex),this.privSentenceOffset>=0&&(this.privNextSearchSentenceIndex=this.privSentenceOffset+e.length,this.privIsSSML&&this.withinXmlTag(this.privSentenceOffset)&&!qn.isXmlTag(e)&&this.updateTextOffset(e,t)))}onComplete(){this.privIsSynthesizing&&(this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!0,this.privAudioOutputStream.close(),this.privInTurn=!1,void 0!==this.privTurnAudioDestination&&(this.privTurnAudioDestination.close(),this.privTurnAudioDestination=void 0))}readAllAudioFromStream(){return Wn(this,void 0,void 0,(function*(){if(this.privIsSynthesisEnded){this.privReceivedAudio=new ArrayBuffer(this.bytesReceived);try{yield this.privAudioOutputStream.read(this.privReceivedAudio)}catch(e){this.privReceivedAudio=new ArrayBuffer(0)}}}))}withinXmlTag(e){return this.privRawText.indexOf("<",e+1)>this.privRawText.indexOf(">",e+1)}}class Kn{constructor(e){let t=e.parameters.getProperty(Qe.SpeechServiceConnection_Endpoint,void 0);if(!t){const n=e.parameters.getProperty(Qe.SpeechServiceConnection_Region,"westus"),r=Et.getHostSuffix(n);t=e.parameters.getProperty(Qe.SpeechServiceConnection_Host,`https://${n}.tts.speech${r}`)}this.privUri=`${t}/cognitiveservices/voices/list`;const n=kr.requestOptions;n.headers[kr.configParams.subscriptionKey]=e.parameters.getProperty(Qe.SpeechServiceConnection_Key,void 0),this.privRestAdapter=new(0,Sr.RestMessageAdapter)(n)}getVoicesList(e){return this.privRestAdapter.setHeaders(ze.ConnectionId,e),this.privRestAdapter.request(Sr.RestRequestType.Get,this.privUri)}}(Hn=jn||(jn={}))[Hn.Standard=0]="Standard",Hn[Hn.Custom=1]="Custom";class Jn{constructor(e,t){this.privSynthesisServiceType=jn.Standard,this.privSpeechServiceConfig=e||new ht(new ft(null)),this.privParameters=t}get parameters(){return this.privParameters}get synthesisServiceType(){return this.privSynthesisServiceType}set synthesisServiceType(e){this.privSynthesisServiceType=e}get SpeechServiceConfig(){return this.privSpeechServiceConfig}}class Qn{constructor(e){this.privContext={},this.privSpeechSynthesizer=e}setSection(e,t){this.privContext[e]=t}set audioOutputFormat(e){this.privAudioOutputFormat=e}toJSON(){const e=this.buildSynthesisContext();return this.setSection("synthesis",e),JSON.stringify(this.privContext)}buildSynthesisContext(){return{audio:{metadataOptions:{bookmarkEnabled:!!this.privSpeechSynthesizer.bookmarkReached,punctuationBoundaryEnabled:this.privSpeechSynthesizer.properties.getProperty(Qe.SpeechServiceResponse_RequestPunctuationBoundary,!!this.privSpeechSynthesizer.wordBoundary),sentenceBoundaryEnabled:this.privSpeechSynthesizer.properties.getProperty(Qe.SpeechServiceResponse_RequestSentenceBoundary,!1),sessionEndEnabled:!0,visemeEnabled:!!this.privSpeechSynthesizer.visemeReceived,wordBoundaryEnabled:this.privSpeechSynthesizer.properties.getProperty(Qe.SpeechServiceResponse_RequestWordBoundary,!!this.privSpeechSynthesizer.wordBoundary)},outputFormat:this.privAudioOutputFormat.requestAudioFormatString},language:{autoDetection:this.privSpeechSynthesizer.autoDetectSourceLanguage}}}}(Vn=Gn||(Gn={}))[Vn.TextIndependentIdentification=0]="TextIndependentIdentification",Vn[Vn.TextDependentVerification=1]="TextDependentVerification",Vn[Vn.TextIndependentVerification=2]="TextIndependentVerification";const Xn="OutputFormat",Yn="CancellationErrorCode",Zn="ServiceProperties",$n="ForceDictation";var er=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class tr{constructor(e,t,n,r){this.privRecorder=e,this.deviceId=t,this.privStreams={},this.privOutputChunkSize=tr.AUDIOFORMAT.avgBytesPerSec/10,this.privId=n||x(),this.privEvents=new ne,this.privMediaStream=r||null,this.privIsClosing=!1}get format(){return Promise.resolve(tr.AUDIOFORMAT)}get blob(){return Promise.reject("Not implemented for Mic input")}turnOn(){if(this.privInitializeDeferral)return this.privInitializeDeferral.promise;this.privInitializeDeferral=new ie;try{this.createAudioContext()}catch(e){if(e instanceof Error){const t=e;this.privInitializeDeferral.reject(t.name+": "+t.message)}else this.privInitializeDeferral.reject(e);return this.privInitializeDeferral.promise}const e=window.navigator;let t=e.getUserMedia||e.webkitGetUserMedia||e.mozGetUserMedia||e.msGetUserMedia;if(e.mediaDevices&&(t=(t,n,r)=>{e.mediaDevices.getUserMedia(t).then(n).catch(r)}),t){const e=()=>{this.onEvent(new P(this.privId)),this.privMediaStream&&this.privMediaStream.active?(this.onEvent(new N(this.privId)),this.privInitializeDeferral.resolve()):t({audio:!this.deviceId||{deviceId:this.deviceId},video:!1},(e=>{this.privMediaStream=e,this.onEvent(new N(this.privId)),this.privInitializeDeferral.resolve()}),(e=>{const t=`Error occurred during microphone initialization: ${e}`;this.privInitializeDeferral.reject(t),this.onEvent(new L(this.privId,t))}))};"suspended"===this.privContext.state?this.privContext.resume().then(e).catch((e=>{this.privInitializeDeferral.reject(`Failed to initialize audio context: ${e}`)})):e()}else{const e="Browser does not support getUserMedia.";this.privInitializeDeferral.reject(e),this.onEvent(new L(e,""))}return this.privInitializeDeferral.promise}id(){return this.privId}attach(e){return this.onEvent(new U(this.privId,e)),this.listen(e).then((t=>(this.onEvent(new F(this.privId,e)),{detach:()=>er(this,void 0,void 0,(function*(){return t.readEnded(),delete this.privStreams[e],this.onEvent(new z(this.privId,e)),this.turnOff()})),id:()=>e,read:()=>t.read()})))}detach(e){e&&this.privStreams[e]&&(this.privStreams[e].close(),delete this.privStreams[e],this.onEvent(new z(this.privId,e)))}turnOff(){return er(this,void 0,void 0,(function*(){for(const e in this.privStreams)if(e){const t=this.privStreams[e];t&&t.close()}this.onEvent(new B(this.privId)),this.privInitializeDeferral&&(yield this.privInitializeDeferral,this.privInitializeDeferral=null),yield this.destroyAudioContext()}))}get events(){return this.privEvents}get deviceInfo(){return this.getMicrophoneLabel().then((e=>({bitspersample:tr.AUDIOFORMAT.bitsPerSample,channelcount:tr.AUDIOFORMAT.channels,connectivity:ot.Unknown,manufacturer:"Speech SDK",model:e,samplerate:tr.AUDIOFORMAT.samplesPerSec,type:st.Microphones})))}setProperty(e,t){if("MICROPHONE-WorkletSourceUrl"!==e)throw new Error("Property '"+e+"' is not supported on Microphone.");this.privRecorder.setWorkletUrl(t)}getMicrophoneLabel(){const e="microphone";if(void 0!==this.privMicrophoneLabel)return Promise.resolve(this.privMicrophoneLabel);if(void 0===this.privMediaStream||!this.privMediaStream.active)return Promise.resolve(e);this.privMicrophoneLabel=e;const t=this.privMediaStream.getTracks()[0].getSettings().deviceId;if(void 0===t)return Promise.resolve(this.privMicrophoneLabel);const n=new ie;return navigator.mediaDevices.enumerateDevices().then((e=>{for(const n of e)if(n.deviceId===t){this.privMicrophoneLabel=n.label;break}n.resolve(this.privMicrophoneLabel)}),(()=>n.resolve(this.privMicrophoneLabel))),n.promise}listen(e){return er(this,void 0,void 0,(function*(){yield this.turnOn();const t=new ye(this.privOutputChunkSize,e);this.privStreams[e]=t;try{this.privRecorder.record(this.privContext,this.privMediaStream,t)}catch(t){throw this.onEvent(new j(this.privId,e,t)),t}return t}))}onEvent(e){this.privEvents.onEvent(e),re.instance.onEvent(e)}createAudioContext(){this.privContext||(this.privContext=un.getAudioContext(tr.AUDIOFORMAT.samplesPerSec))}destroyAudioContext(){return er(this,void 0,void 0,(function*(){if(!this.privContext)return;this.privRecorder.releaseMediaResources(this.privContext);let e=!1;"close"in this.privContext&&(e=!0),e?this.privIsClosing||(this.privIsClosing=!0,yield this.privContext.close(),this.privContext=null,this.privIsClosing=!1):null!==this.privContext&&"running"===this.privContext.state&&(yield this.privContext.suspend())}))}}tr.AUDIOFORMAT=cn.getDefaultInputFormat();var nr={};e(nr,"FileAudioSource",(()=>ir),(e=>ir=e));var rr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class ir{constructor(e,t,n){this.privStreams={},this.privHeaderEnd=44,this.privId=n||x(),this.privEvents=new ne,this.privSource=e,"undefined"!=typeof window&&"undefined"!=typeof Blob&&this.privSource instanceof Blob?this.privFilename=e.name:this.privFilename=t||"unknown.wav",this.privAudioFormatPromise=this.readHeader()}get format(){return this.privAudioFormatPromise}get blob(){return Promise.resolve(this.privSource)}turnOn(){if(this.privFilename.lastIndexOf(".wav")!==this.privFilename.length-4){const e=this.privFilename+" is not supported. Only WAVE files are allowed at the moment.";return this.onEvent(new L(e,"")),Promise.reject(e)}this.onEvent(new P(this.privId)),this.onEvent(new N(this.privId))}id(){return this.privId}attach(e){return rr(this,void 0,void 0,(function*(){this.onEvent(new U(this.privId,e));const t=yield this.upload(e);return this.onEvent(new F(this.privId,e)),Promise.resolve({detach:()=>rr(this,void 0,void 0,(function*(){t.readEnded(),delete this.privStreams[e],this.onEvent(new z(this.privId,e)),yield this.turnOff()})),id:()=>e,read:()=>t.read()})}))}detach(e){e&&this.privStreams[e]&&(this.privStreams[e].close(),delete this.privStreams[e],this.onEvent(new z(this.privId,e)))}turnOff(){for(const e in this.privStreams)if(e){const t=this.privStreams[e];t&&!t.isClosed&&t.close()}return this.onEvent(new B(this.privId)),Promise.resolve()}get events(){return this.privEvents}get deviceInfo(){return this.privAudioFormatPromise.then((e=>Promise.resolve({bitspersample:e.bitsPerSample,channelcount:e.channels,connectivity:ot.Unknown,manufacturer:"Speech SDK",model:"File",samplerate:e.samplesPerSec,type:st.File})))}readHeader(){const e=this.privSource.slice(0,512),t=new ie,n=e=>{const n=new DataView(e),r=e=>String.fromCharCode(n.getUint8(e),n.getUint8(e+1),n.getUint8(e+2),n.getUint8(e+3));if("RIFF"!==r(0))return void t.reject("Invalid WAV header in file, RIFF was not found");if("WAVE"!==r(8)||"fmt "!==r(12))return void t.reject("Invalid WAV header in file, WAVEfmt was not found");const i=n.getInt32(16,!0),o=n.getUint16(22,!0),a=n.getUint32(24,!0),s=n.getUint16(34,!0);let l=36+Math.max(i-16,0);for(;"data"!==r(l);l+=2)if(l>504)return void t.reject("Invalid WAV header in file, data block was not found");this.privHeaderEnd=l+8,t.resolve(cn.getWaveFormatPCM(a,s,o))};if("undefined"!=typeof window&&"undefined"!=typeof Blob&&e instanceof Blob){const t=new FileReader;t.onload=e=>{const t=e.target.result;n(t)},t.readAsArrayBuffer(e)}else{const t=e;n(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength))}return t.promise}upload(e){return rr(this,void 0,void 0,(function*(){const t=t=>{const n=`Error occurred while processing '${this.privFilename}'. ${t}`;throw this.onEvent(new j(this.privId,e,n)),new Error(n)};try{yield this.turnOn();const n=yield this.privAudioFormatPromise,r=new ye(n.avgBytesPerSec/10,e);this.privStreams[e]=r;const i=this.privSource.slice(this.privHeaderEnd),o=e=>{r.isClosed||(r.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()}),r.close())};if("undefined"!=typeof window&&"undefined"!=typeof Blob&&i instanceof Blob){const e=new FileReader;e.onerror=e=>t(e.toString()),e.onload=e=>{const t=e.target.result;o(t)},e.readAsArrayBuffer(i)}else{const e=i;o(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}return r}catch(e){t(e)}}))}onEvent(e){this.privEvents.onEvent(e),re.instance.onEvent(e)}}class or{constructor(e){this.privStopInputOnRelease=e}record(e,t,n){const r=new fe(e.sampleRate,16e3),i=e.createMediaStreamSource(t);if(!this.privSpeechProcessorScript){const e=new Blob(["class SP extends AudioWorkletProcessor {\n constructor(options) {\n super(options);\n }\n process(inputs, outputs) {\n const input = inputs[0];\n const output = [];\n for (let channel = 0; channel < input.length; channel += 1) {\n output[channel] = input[channel];\n }\n this.port.postMessage(output[0]);\n return true;\n }\n }\n registerProcessor('speech-processor', SP);"],{type:"application/javascript; charset=utf-8"});this.privSpeechProcessorScript=URL.createObjectURL(e)}const o=()=>{const o=(()=>{let t=0;try{return e.createScriptProcessor(t,1,1)}catch(n){t=2048;let r=e.sampleRate;for(;t<16384&&r>=32e3;)t<<=1,r>>=1;return e.createScriptProcessor(t,1,1)}})();o.onaudioprocess=e=>{const t=e.inputBuffer.getChannelData(0);if(n&&!n.isClosed){const e=r.encode(t);e&&n.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}},i.connect(o),o.connect(e.destination),this.privMediaResources={scriptProcessorNode:o,source:i,stream:t}};if(this.privSpeechProcessorScript&&e.audioWorklet)e.audioWorklet.addModule(this.privSpeechProcessorScript).then((()=>{const o=new AudioWorkletNode(e,"speech-processor");o.port.onmessage=e=>{const t=e.data;if(n&&!n.isClosed){const e=r.encode(t);e&&n.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}},i.connect(o),o.connect(e.destination),this.privMediaResources={scriptProcessorNode:o,source:i,stream:t}})).catch((()=>{o()}));else try{o()}catch(e){throw new Error(`Unable to start audio worklet node for PCMRecorder: ${e}`)}}releaseMediaResources(e){this.privMediaResources&&(this.privMediaResources.scriptProcessorNode&&(this.privMediaResources.scriptProcessorNode.disconnect(e.destination),this.privMediaResources.scriptProcessorNode=null),this.privMediaResources.source&&(this.privMediaResources.source.disconnect(),this.privStopInputOnRelease&&this.privMediaResources.stream.getTracks().forEach((e=>e.stop())),this.privMediaResources.source=null))}setWorkletUrl(e){this.privSpeechProcessorScript=e}}var ar={};e(ar,"WebsocketConnection",(()=>vr),(e=>vr=e));var sr={};e(sr,"WebsocketMessageAdapter",(()=>mr),(e=>mr=e));h=o("1DJXa");var lr={};e(lr,"CertCheckAgent",(()=>fr),(e=>fr=e));h=o("1DJXa");var cr=o("5U18c"),ur=(h=o("1DJXa"),h=o("1DJXa"),h=o("1DJXa"),h=o("1DJXa"),o("bqBrJ").Buffer),dr=o("ePtPP"),hr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class fr{constructor(e){e&&(this.privProxyInfo=e),fr.privDiskCache||(fr.privDiskCache=new(n(h))("microsoft-cognitiveservices-speech-sdk-cache",{supportBuffer:!0,location:void 0}))}static forceReinitDiskCache(){fr.privDiskCache=void 0,fr.privMemCache={}}GetAgent(e){const t=new(n(h).Agent)(this.CreateConnection);if(void 0!==this.privProxyInfo&&void 0!==this.privProxyInfo.HostName&&this.privProxyInfo.Port>0){t["privProxyInfo"]=this.privProxyInfo}return t}static GetProxyAgent(e){const t={host:e.HostName,port:e.Port};e.UserName?t.headers={"Proxy-Authentication":"Basic "+new ur(`${e.UserName}:${void 0===e.Password?"":e.Password}`).toString("base64")}:t.headers={},t.headers.requestOCSP="true";return new(n(h))(t)}static OCSPCheck(e,t){return hr(this,void 0,void 0,(function*(){let n,r,i=!1;const o=yield e;o.cork();const a=o;return new Promise(((e,s)=>{o.on("OCSPResponse",(e=>{e&&(this.onEvent(new Ie),r=e)})),o.on("error",(e=>{i||(i=!0,o.destroy(),s(e))})),a.on("secure",(()=>hr(this,void 0,void 0,(function*(){const l=a.getPeerCertificate(!0);try{const a=yield this.GetIssuer(l);n=cr.request.generate(l.raw,a.raw);const s=n.id.toString("hex");if(!r){const e=yield fr.GetResponseFromCache(s,n,t);r=e}yield this.VerifyOCSPResponse(r,n,t),o.uncork(),i=!0,e(o)}catch(e){o.destroy(),i=!0,s(e)}}))))}))}))}static GetIssuer(e){return e.issuerCertificate?Promise.resolve(e.issuerCertificate):new Promise(((t,n)=>{new cr.Agent({}).fetchIssuer(e,null,((e,r)=>{e?n(e):t(r)}))}))}static GetResponseFromCache(e,t,n){return hr(this,void 0,void 0,(function*(){let r=fr.privMemCache[e];if(r&&this.onEvent(new xe(e)),!r)try{const t=yield fr.privDiskCache.get(e);t.isCached&&(fr.onEvent(new _e(e)),fr.StoreMemoryCacheEntry(e,t.value),r=t.value)}catch(e){r=null}if(!r)return r;try{const i=cr.utils.parseResponse(r),o=i.value.tbsResponseData;if(o.responses.length<1)return void this.onEvent(new Ne(e,"Not enough data in cached response"));const a=o.responses[0].thisUpdate,s=o.responses[0].nextUpdate;if(s<Date.now()+this.testTimeOffset-6e4)this.onEvent(new ke(e,s)),r=null;else{const r=Math.min(864e5,(s-a)/2);s-(Date.now()+this.testTimeOffset)<r?(this.onEvent(new Re(e,a,s)),this.UpdateCache(t,n).catch((t=>{this.onEvent(new Le(e,t.toString()))}))):this.onEvent(new Oe(e,a,s))}}catch(t){this.onEvent(new Ne(e,t)),r=null}return r||this.onEvent(new Me(e)),r}))}static VerifyOCSPResponse(e,t,n){return hr(this,void 0,void 0,(function*(){let r=e;return r||(r=yield fr.GetOCSPResponse(t,n)),new Promise(((i,o)=>{cr.verify({request:t,response:r},(a=>{a?(fr.onEvent(new Pe(t.id.toString("hex"),a)),e?this.VerifyOCSPResponse(null,t,n).then((()=>{i()}),(e=>{o(e)})):o(a)):(e||fr.StoreCacheEntry(t.id.toString("hex"),r),i())}))}))}))}static UpdateCache(e,t){return hr(this,void 0,void 0,(function*(){const n=e.id.toString("hex");this.onEvent(new Ae(n));const r=yield this.GetOCSPResponse(e,t);this.StoreCacheEntry(n,r),this.onEvent(new Te(e.id.toString("hex")))}))}static StoreCacheEntry(e,t){this.StoreMemoryCacheEntry(e,t),this.StoreDiskCacheEntry(e,t)}static StoreMemoryCacheEntry(e,t){this.privMemCache[e]=t,this.onEvent(new Ee(e))}static StoreDiskCacheEntry(e,t){this.privDiskCache.set(e,t).then((()=>{this.onEvent(new Ce(e))}))}static GetOCSPResponse(e,t){let n={};if(t){const e=fr.GetProxyAgent(t);n.agent=e}return new Promise(((t,r)=>{cr.utils.getAuthorityInfo(e.cert,"1.3.6.1.5.5.7.48.1",((i,o)=>{if(i)return void r(i);const a=new URL(o);n=Object.assign(Object.assign({},n),{host:a.host,protocol:a.protocol,port:a.port,path:a.pathname,hostname:a.host}),cr.utils.getResponse(n,e.data,((n,i)=>{if(n)return void r(n);const o=e.certID;this.onEvent(new Be(o.toString("hex"))),t(i)}))}))}))}static onEvent(e){re.instance.onEvent(e)}CreateConnection(e,t){const n=void 0!==dr&&t.secureEndpoint;let r;if(t=Object.assign(Object.assign({},t),{requestOCSP:!fr.forceDisableOCSPStapling,servername:t.host}),this.privProxyInfo){const n=fr.GetProxyAgent(this.privProxyInfo);r=new Promise(((r,i)=>{n.callback(e,t,((e,t)=>{e?i(e):r(t)}))}))}else r=(t.secureEndpoint,Promise.resolve(h.connect(t)));return n?fr.OCSPCheck(r,this.privProxyInfo):r}}fr.testTimeOffset=0,fr.forceDisableOCSPStapling=!1,fr.privMemCache={};var pr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class mr{constructor(e,t,n,r,i,o){if(!e)throw new Y("uri");if(!n)throw new Y("messageFormatter");this.proxyInfo=r,this.privConnectionEvents=new ne,this.privConnectionId=t,this.privMessageFormatter=n,this.privConnectionState=C.None,this.privUri=e,this.privHeaders=i,this.privEnableCompression=o,this.privHeaders[ze.ConnectionId]=this.privConnectionId,this.privLastErrorReceived=""}get state(){return this.privConnectionState}open(){if(this.privConnectionState===C.Disconnected)return Promise.reject(`Cannot open a connection that is in ${this.privConnectionState} state`);if(this.privConnectionEstablishDeferral)return this.privConnectionEstablishDeferral.promise;this.privConnectionEstablishDeferral=new ie,this.privCertificateValidatedDeferral=new ie,this.privConnectionState=C.Connecting;try{if("undefined"==typeof WebSocket||mr.forceNpmWebSocket){const e={headers:this.privHeaders,perMessageDeflate:this.privEnableCompression};this.privCertificateValidatedDeferral.resolve();const t=new(0,lr.CertCheckAgent)(this.proxyInfo);e.agent=t.GetAgent();let r=new URL(this.privUri).protocol;"wss:"===(null==r?void 0:r.toLocaleLowerCase())?r="https:":"ws:"===(null==r?void 0:r.toLocaleLowerCase())&&(r="http:"),e.agent.protocol=r,this.privWebsocketClient=new(n(h))(this.privUri,e)}else this.privCertificateValidatedDeferral.resolve(),this.privWebsocketClient=new WebSocket(this.privUri);this.privWebsocketClient.binaryType="arraybuffer",this.privReceivingMessageQueue=new(0,ae.Queue),this.privDisconnectDeferral=new ie,this.privSendMessageQueue=new(0,ae.Queue),this.processSendQueue().catch((e=>{re.instance.onEvent(new De(e))}))}catch(e){return this.privConnectionEstablishDeferral.resolve(new te(500,e)),this.privConnectionEstablishDeferral.promise}return this.onEvent(new V(this.privConnectionId,this.privUri)),this.privWebsocketClient.onopen=()=>{this.privCertificateValidatedDeferral.promise.then((()=>{this.privConnectionState=C.Connected,this.onEvent(new W(this.privConnectionId)),this.privConnectionEstablishDeferral.resolve(new te(200,""))}),(e=>{this.privConnectionEstablishDeferral.reject(e)}))},this.privWebsocketClient.onerror=e=>{this.onEvent(new K(this.privConnectionId,e.message,e.type)),this.privLastErrorReceived=e.message},this.privWebsocketClient.onclose=e=>{this.privConnectionState===C.Connecting?(this.privConnectionState=C.Disconnected,this.privConnectionEstablishDeferral.resolve(new te(e.code,e.reason+" "+this.privLastErrorReceived))):(this.privConnectionState=C.Disconnected,this.privWebsocketClient=null,this.onEvent(new q(this.privConnectionId,e.code,e.reason))),this.onClose(e.code,e.reason).catch((e=>{re.instance.onEvent(new De(e))}))},this.privWebsocketClient.onmessage=e=>{const t=(new Date).toISOString();if(this.privConnectionState===C.Connected){const n=new ie;if(this.privReceivingMessageQueue.enqueueFromPromise(n.promise),e.data instanceof ArrayBuffer){const r=new he(A.Binary,e.data);this.privMessageFormatter.toConnectionMessage(r).then((e=>{this.onEvent(new Q(this.privConnectionId,t,e)),n.resolve(e)}),(e=>{n.reject(`Invalid binary message format. Error: ${e}`)}))}else{const r=new he(A.Text,e.data);this.privMessageFormatter.toConnectionMessage(r).then((e=>{this.onEvent(new Q(this.privConnectionId,t,e)),n.resolve(e)}),(e=>{n.reject(`Invalid text message format. Error: ${e}`)}))}}},this.privConnectionEstablishDeferral.promise}send(e){if(this.privConnectionState!==C.Connected)return Promise.reject(`Cannot send on connection that is in ${C[this.privConnectionState]} state`);const t=new ie,n=new ie;return this.privSendMessageQueue.enqueueFromPromise(n.promise),this.privMessageFormatter.fromConnectionMessage(e).then((r=>{n.resolve({Message:e,RawWebsocketMessage:r,sendStatusDeferral:t})}),(e=>{n.reject(`Error formatting the message. ${e}`)})),t.promise}read(){return this.privConnectionState!==C.Connected?Promise.reject(`Cannot read on connection that is in ${this.privConnectionState} state`):this.privReceivingMessageQueue.dequeue()}close(e){return this.privWebsocketClient?(this.privConnectionState!==C.Disconnected&&this.privWebsocketClient.close(1e3,e||"Normal closure by client"),this.privDisconnectDeferral.promise):Promise.resolve()}get events(){return this.privConnectionEvents}sendRawMessage(e){try{return e?(this.onEvent(new X(this.privConnectionId,(new Date).toISOString(),e.Message)),this.isWebsocketOpen?(this.privWebsocketClient.send(e.RawWebsocketMessage.payload),Promise.resolve()):Promise.reject("websocket send error: Websocket not ready "+this.privConnectionId+" "+e.Message.id+" "+(new Error).stack)):Promise.resolve()}catch(e){return Promise.reject(`websocket send error: ${e}`)}}onClose(e,t){return pr(this,void 0,void 0,(function*(){const n=`Connection closed. ${e}: ${t}`;this.privConnectionState=C.Disconnected,this.privDisconnectDeferral.resolve(),yield this.privReceivingMessageQueue.drainAndDispose((()=>{}),n),yield this.privSendMessageQueue.drainAndDispose((e=>{e.sendStatusDeferral.reject(n)}),n)}))}processSendQueue(){return pr(this,void 0,void 0,(function*(){for(;;){const e=this.privSendMessageQueue.dequeue(),t=yield e;if(!t)return;try{yield this.sendRawMessage(t),t.sendStatusDeferral.resolve()}catch(e){t.sendStatusDeferral.reject(e)}}}))}onEvent(e){this.privConnectionEvents.onEvent(e),re.instance.onEvent(e)}get isWebsocketOpen(){return this.privWebsocketClient&&this.privWebsocketClient.readyState===this.privWebsocketClient.OPEN}}mr.forceNpmWebSocket=!1;var gr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class vr{constructor(e,t,n,r,i,o=!1,a){if(this.privIsDisposed=!1,!e)throw new Y("uri");if(!r)throw new Y("messageFormatter");this.privMessageFormatter=r;let s="",l=0;if(t)for(const n in t)if(n){s+=0===l&&-1===e.indexOf("?")?"?":"&";s+=`${n}=${encodeURIComponent(t[n])}`,l++}if(n)for(const t in n)if(t){s+=0===l&&-1===e.indexOf("?")?"?":"&";s+=`${t}=${encodeURIComponent(n[t])}`,l++}this.privUri=e+s,this.privId=a||x(),this.privConnectionMessageAdapter=new(0,sr.WebsocketMessageAdapter)(this.privUri,this.id,this.privMessageFormatter,i,n,o)}dispose(){return gr(this,void 0,void 0,(function*(){this.privIsDisposed=!0,this.privConnectionMessageAdapter&&(yield this.privConnectionMessageAdapter.close())}))}isDisposed(){return this.privIsDisposed}get id(){return this.privId}state(){return this.privConnectionMessageAdapter.state}open(){return this.privConnectionMessageAdapter.open()}send(e){return this.privConnectionMessageAdapter.send(e)}read(){return this.privConnectionMessageAdapter.read()}get events(){return this.privConnectionMessageAdapter.events}}class br{constructor(e,t){this.privBuffers=[],this.privReplayOffset=0,this.privLastShrinkOffset=0,this.privBufferStartOffset=0,this.privBufferSerial=0,this.privBufferedBytes=0,this.privReplay=!1,this.privLastChunkAcquiredTime=0,this.privAudioNode=e,this.privBytesPerSecond=t}id(){return this.privAudioNode.id()}read(){if(this.privReplay&&0!==this.privBuffers.length){const e=this.privReplayOffset-this.privBufferStartOffset;let t=Math.round(e*this.privBytesPerSecond*1e-7);0!=t%2&&t++;let n=0;for(;n<this.privBuffers.length&&t>=this.privBuffers[n].chunk.buffer.byteLength;)t-=this.privBuffers[n++].chunk.buffer.byteLength;if(n<this.privBuffers.length){const e=this.privBuffers[n].chunk.buffer.slice(t);return this.privReplayOffset+=e.byteLength/this.privBytesPerSecond*1e7,n===this.privBuffers.length-1&&(this.privReplay=!1),Promise.resolve({buffer:e,isEnd:!1,timeReceived:this.privBuffers[n].chunk.timeReceived})}}return this.privAudioNode.read().then((e=>(e&&e.buffer&&(this.privBuffers.push(new yr(e,this.privBufferSerial++,this.privBufferedBytes)),this.privBufferedBytes+=e.buffer.byteLength),e)))}detach(){return this.privBuffers=void 0,this.privAudioNode.detach()}replay(){this.privBuffers&&0!==this.privBuffers.length&&(this.privReplay=!0,this.privReplayOffset=this.privLastShrinkOffset)}shrinkBuffers(e){if(void 0===this.privBuffers||0===this.privBuffers.length)return;this.privLastShrinkOffset=e;const t=e-this.privBufferStartOffset;let n=Math.round(t*this.privBytesPerSecond*1e-7),r=0;for(;r<this.privBuffers.length&&n>=this.privBuffers[r].chunk.buffer.byteLength;)n-=this.privBuffers[r++].chunk.buffer.byteLength;this.privBufferStartOffset=Math.round(e-n/this.privBytesPerSecond*1e7),this.privBuffers=this.privBuffers.slice(r)}findTimeAtOffset(e){if(e<this.privBufferStartOffset||void 0===this.privBuffers)return 0;for(const t of this.privBuffers){const n=t.byteOffset/this.privBytesPerSecond*1e7,r=n+t.chunk.buffer.byteLength/this.privBytesPerSecond*1e7;if(e>=n&&e<=r)return t.chunk.timeReceived}return 0}}class yr{constructor(e,t,n){this.chunk=e,this.serial=t,this.byteOffset=n}}class wr{constructor(e,t,n,r){this.privProxyHostName=e,this.privProxyPort=t,this.privProxyUserName=n,this.privProxyPassword=r}static fromParameters(e){return new wr(e.getProperty(Qe.SpeechServiceConnection_ProxyHostName),parseInt(e.getProperty(Qe.SpeechServiceConnection_ProxyPort),10),e.getProperty(Qe.SpeechServiceConnection_ProxyUserName),e.getProperty(Qe.SpeechServiceConnection_ProxyPassword))}static fromRecognizerConfig(e){return this.fromParameters(e.parameters)}get HostName(){return this.privProxyHostName}get Port(){return this.privProxyPort}get UserName(){return this.privProxyUserName}get Password(){return this.privProxyPassword}}var Sr={};e(Sr,"RestRequestType",(()=>Er),(e=>Er=e)),e(Sr,"RestMessageAdapter",(()=>Ir),(e=>Ir=e));var xr,Mr;const _r=new Set(["json","buffer","string"]);Mr=e=>(...t)=>{const n=new Set;let r,i,o,a="";return t.forEach((e=>{if("string"==typeof e)if(e.toUpperCase()===e){if(r){throw new Error(`Can't set method to ${e}, already set to ${r}.`)}r=e}else if(e.startsWith("http:")||e.startsWith("https:"))a=e;else{if(!_r.has(e))throw new Error(`Unknown encoding, ${e}`);i=e}else if("number"==typeof e)n.add(e);else{if("object"!=typeof e)throw new Error("Unknown type: "+typeof e);if(Array.isArray(e)||e instanceof Set)e.forEach((e=>n.add(e)));else{if(o)throw new Error("Cannot set headers twice.");o=e}}})),r||(r="GET"),0===n.size&&n.add(200),e(n,r,i,o,a)};class Ar extends Error{constructor(e,...t){let n;super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Ar),this.name="StatusError",this.message=e.statusMessage,this.statusCode=e.status,this.res=e,this.json=e.json.bind(e),this.text=e.text.bind(e),this.arrayBuffer=e.arrayBuffer.bind(e);Object.defineProperty(this,"responseBody",{get:()=>(n||(n=this.arrayBuffer()),n)}),this.headers={};for(const[t,n]of e.headers.entries())this.headers[t.toLowerCase()]=n}}xr=Mr(((e,t,n,r,i)=>async(o,a,s={})=>{o=i+(o||"");let l=new URL(o);if(r||(r={}),l.username&&(r.Authorization="Basic "+btoa(l.username+":"+l.password),l=new URL(l.protocol+"//"+l.host+l.pathname+l.search)),"https:"!==l.protocol&&"http:"!==l.protocol)throw new Error(`Unknown protocol, ${l.protocol}`);if(a)if(a instanceof ArrayBuffer||ArrayBuffer.isView(a)||"string"==typeof a);else{if("object"!=typeof a)throw new Error("Unknown body type.");a=JSON.stringify(a),r["Content-Type"]="application/json"}s=new Headers({...r||{},...s});const c=await fetch(l,{method:t,headers:s,body:a});if(c.statusCode=c.status,!e.has(c.status))throw new Ar(c);return"json"===n?c.json():"buffer"===n?c.arrayBuffer():"string"===n?c.text():c}));var Er,Cr,Tr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};(Cr=Er||(Er={})).Get="GET",Cr.Post="POST",Cr.Delete="DELETE",Cr.File="file";class Ir{constructor(e){if(!e)throw new Y("configParams");this.privHeaders=e.headers,this.privIgnoreCache=e.ignoreCache}static extractHeaderValue(e,t){let n="";try{const r=t.trim().split(/[\r\n]+/),i={};r.forEach((e=>{const t=e.split(": "),n=t.shift().toLowerCase(),r=t.join(": ");i[n]=r})),n=i[e.toLowerCase()]}catch(e){}return n}set options(e){this.privHeaders=e.headers,this.privIgnoreCache=e.ignoreCache}setHeaders(e,t){this.privHeaders[e]=t}request(e,t,r={},i=null,o=null){const a=new ie,s=e===Er.File?"POST":e,l=(e,t={})=>{const n=e;return{data:JSON.stringify(t),headers:JSON.stringify(e.headers),json:t,ok:e.statusCode>=200&&e.statusCode<300,status:e.statusCode,statusText:t.error?t.error.message:n.statusText?n.statusText:n.statusMessage}},c=i=>{n(xr)(t,s,this.privHeaders,200,201,202,204,400,401,402,403,404)(""===this.queryParams(r)?"":`?${this.queryParams(r)}`,i).then((t=>Tr(this,void 0,void 0,(function*(){if(e===Er.Delete||204===t.statusCode)a.resolve(l(t));else try{const e=yield t.json();a.resolve(l(t,e))}catch(e){a.resolve(l(t))}})))).catch((e=>{a.reject(e)}))};if(this.privIgnoreCache&&(this.privHeaders["Cache-Control"]="no-cache"),e===Er.File&&o){const e="multipart/form-data";this.privHeaders["content-type"]=e,this.privHeaders["Content-Type"]=e,"undefined"!=typeof Blob&&o instanceof Blob?(e=>{const t=new FileReader;return t.readAsArrayBuffer(e),new Promise((e=>{t.onloadend=()=>{e(t.result)}}))})(o).then((e=>{c(e)})).catch((e=>{a.reject(e)})):c(o)}else e===Er.Post&&i&&(this.privHeaders["content-type"]="application/json",this.privHeaders["Content-Type"]="application/json"),c(i);return a.promise}withQuery(e,t={}){const n=this.queryParams(t);return n?e+(-1===e.indexOf("?")?"?":"&")+n:e}queryParams(e={}){return Object.keys(e).map((t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&")}}class kr{static get requestOptions(){return kr.privDefaultRequestOptions}static get configParams(){return kr.privDefaultParams}static get restErrors(){return kr.privRestErrors}}kr.privDefaultRequestOptions={headers:{Accept:"application/json"},ignoreCache:!1,timeout:1e4},kr.privRestErrors={authInvalidSubscriptionKey:"You must specify either an authentication token to use, or a Cognitive Speech subscription key.",authInvalidSubscriptionRegion:"You must specify the Cognitive Speech region to use.",invalidArgs:"Required input not found: {arg}.",invalidCreateJoinConversationResponse:"Creating/Joining conversation failed with HTTP {status}.",invalidParticipantRequest:"The requested participant was not found.",permissionDeniedConnect:"Required credentials not found.",permissionDeniedConversation:"Invalid operation: only the host can {command} the conversation.",permissionDeniedParticipant:"Invalid operation: only the host can {command} a participant.",permissionDeniedSend:"Invalid operation: the conversation is not in a connected state.",permissionDeniedStart:"Invalid operation: there is already an active conversation."},kr.privDefaultParams={apiVersion:"api-version",authorization:"Authorization",clientAppId:"X-ClientAppId",contentTypeKey:"Content-Type",correlationId:"X-CorrelationId",languageCode:"language",nickname:"nickname",profanity:"profanity",requestId:"X-RequestId",roomId:"roomid",sessionToken:"token",subscriptionKey:"Ocp-Apim-Subscription-Key",subscriptionRegion:"Ocp-Apim-Subscription-Region",token:"X-CapitoToken"};var Rr={};e(Rr,"AudioInputStream",(()=>Nr),(e=>Nr=e)),e(Rr,"PullAudioInputStreamImpl",(()=>Ur),(e=>Ur=e));var Or=o("bqBrJ").Buffer,Pr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class Nr{constructor(){}static createPushStream(e){return Br.create(e)}static createPullStream(e,t){return Dr.create(e,t)}}class Br extends Nr{static create(e){return new Lr(e)}}class Lr extends Br{constructor(e){super(),this.privFormat=void 0===e?un.getDefaultInputFormat():e,this.privEvents=new ne,this.privId=x(),this.privStream=new ye(this.privFormat.avgBytesPerSec/10)}get format(){return Promise.resolve(this.privFormat)}write(e){this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}id(){return this.privId}get blob(){return this.attach("id").then((e=>{const t=[];let n=Or.from("");const r=()=>e.read().then((e=>!e||e.isEnd?"undefined"!=typeof XMLHttpRequest&&"undefined"!=typeof Blob?Promise.resolve(new Blob(t)):Promise.resolve(Or.from(n)):("undefined"!=typeof Blob?t.push(e.buffer):n=Or.concat([n,this.toBuffer(e.buffer)]),r())));return r()}))}turnOn(){this.onEvent(new P(this.privId)),this.onEvent(new N(this.privId))}attach(e){return Pr(this,void 0,void 0,(function*(){this.onEvent(new U(this.privId,e)),yield this.turnOn();const t=this.privStream;return this.onEvent(new F(this.privId,e)),{detach:()=>Pr(this,void 0,void 0,(function*(){return this.onEvent(new z(this.privId,e)),this.turnOff()})),id:()=>e,read:()=>t.read()}}))}detach(e){this.onEvent(new z(this.privId,e))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:ot.Unknown,manufacturer:"Speech SDK",model:"PushStream",samplerate:this.privFormat.samplesPerSec,type:st.Stream})}onEvent(e){this.privEvents.onEvent(e),re.instance.onEvent(e)}toBuffer(e){const t=Or.alloc(e.byteLength),n=new Uint8Array(e);for(let e=0;e<t.length;++e)t[e]=n[e];return t}}class Dr extends Nr{constructor(){super()}static create(e,t){return new Ur(e,t)}}class Ur extends Dr{constructor(e,t){super(),this.privFormat=void 0===t?cn.getDefaultInputFormat():t,this.privEvents=new ne,this.privId=x(),this.privCallback=e,this.privIsClosed=!1,this.privBufferSize=this.privFormat.avgBytesPerSec/10}get format(){return Promise.resolve(this.privFormat)}close(){this.privIsClosed=!0,this.privCallback.close()}id(){return this.privId}get blob(){return Promise.reject("Not implemented")}turnOn(){this.onEvent(new P(this.privId)),this.onEvent(new N(this.privId))}attach(e){return Pr(this,void 0,void 0,(function*(){return this.onEvent(new U(this.privId,e)),yield this.turnOn(),this.onEvent(new F(this.privId,e)),{detach:()=>(this.privCallback.close(),this.onEvent(new z(this.privId,e)),this.turnOff()),id:()=>e,read:()=>{let e,t=0;for(;t<this.privBufferSize;){const n=new ArrayBuffer(this.privBufferSize-t),r=this.privCallback.read(n);if(void 0===e)e=n;else{new Int8Array(e).set(new Int8Array(n),t)}if(0===r)break;t+=r}return Promise.resolve({buffer:e.slice(0,t),isEnd:this.privIsClosed||0===t,timeReceived:Date.now()})}}}))}detach(e){this.onEvent(new z(this.privId,e))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:ot.Unknown,manufacturer:"Speech SDK",model:"PullStream",samplerate:this.privFormat.samplesPerSec,type:st.Stream})}onEvent(e){this.privEvents.onEvent(e),re.instance.onEvent(e)}}class Fr{}class zr{}var jr={};e(jr,"SpeakerAudioDestination",(()=>Vr),(e=>Vr=e));var Hr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const Gr={[en.PCM]:"audio/wav",[en.MuLaw]:"audio/x-wav",[en.MP3]:"audio/mpeg",[en.OGG_OPUS]:"audio/ogg",[en.WEBM_OPUS]:"audio/webm; codecs=opus",[en.ALaw]:"audio/x-wav",[en.FLAC]:"audio/flac"};class Vr{constructor(e){this.privPlaybackStarted=!1,this.privAppendingToBuffer=!1,this.privMediaSourceOpened=!1,this.privBytesReceived=0,this.privId=e||x(),this.privIsPaused=!1,this.privIsClosed=!1}id(){return this.privId}write(e,t,n){void 0!==this.privAudioBuffer?(this.privAudioBuffer.push(e),this.updateSourceBuffer().then((()=>{t&&t()}),(e=>{n&&n(e)}))):void 0!==this.privAudioOutputStream&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength)}close(e,t){if(this.privIsClosed=!0,void 0!==this.privSourceBuffer)this.handleSourceBufferUpdateEnd().then((()=>{e&&e()}),(e=>{t&&t(e)}));else if(void 0!==this.privAudioOutputStream&&"undefined"!=typeof window)if(this.privFormat.formatTag!==en.PCM&&this.privFormat.formatTag!==en.MuLaw&&this.privFormat.formatTag!==en.ALaw||!1!==this.privFormat.hasHeader){let n=new ArrayBuffer(this.privBytesReceived);this.privAudioOutputStream.read(n).then((()=>{n=Tn.SynthesisAdapterBase.addHeader(n,this.privFormat);const r=new Blob([n],{type:Gr[this.privFormat.formatTag]});this.privAudio.src=window.URL.createObjectURL(r),this.notifyPlayback().then((()=>{e&&e()}),(e=>{t&&t(e)}))}),(e=>{t&&t(e)}))}else console.warn("Play back is not supported for raw PCM, mulaw or alaw format without header."),this.onAudioEnd&&this.onAudioEnd(this);else this.onAudioEnd&&this.onAudioEnd(this)}set format(e){if("undefined"!=typeof AudioContext||"undefined"!=typeof window&&void 0!==window.webkitAudioContext){this.privFormat=e;const t=Gr[this.privFormat.formatTag];void 0===t?console.warn(`Unknown mimeType for format ${en[this.privFormat.formatTag]}; playback is not supported.`):"undefined"!=typeof MediaSource&&MediaSource.isTypeSupported(t)?(this.privAudio=new Audio,this.privAudioBuffer=[],this.privMediaSource=new MediaSource,this.privAudio.src=URL.createObjectURL(this.privMediaSource),this.privAudio.load(),this.privMediaSource.onsourceopen=()=>{this.privMediaSourceOpened=!0,this.privMediaSource.duration=1800,this.privSourceBuffer=this.privMediaSource.addSourceBuffer(t),this.privSourceBuffer.onupdate=()=>{this.updateSourceBuffer().catch((e=>{re.instance.onEvent(new De(e))}))},this.privSourceBuffer.onupdateend=()=>{this.handleSourceBufferUpdateEnd().catch((e=>{re.instance.onEvent(new De(e))}))},this.privSourceBuffer.onupdatestart=()=>{this.privAppendingToBuffer=!1}},this.updateSourceBuffer().catch((e=>{re.instance.onEvent(new De(e))}))):(console.warn(`Format ${en[this.privFormat.formatTag]} could not be played by MSE, streaming playback is not enabled.`),this.privAudioOutputStream=new(0,pn.PullAudioOutputStreamImpl),this.privAudioOutputStream.format=this.privFormat,this.privAudio=new Audio)}}get volume(){var e,t;return null!==(t=null===(e=this.privAudio)||void 0===e?void 0:e.volume)&&void 0!==t?t:-1}set volume(e){this.privAudio&&(this.privAudio.volume=e)}mute(){this.privAudio&&(this.privAudio.muted=!0)}unmute(){this.privAudio&&(this.privAudio.muted=!1)}get isClosed(){return this.privIsClosed}get currentTime(){return void 0!==this.privAudio?this.privAudio.currentTime:-1}pause(){this.privIsPaused||void 0===this.privAudio||(this.privAudio.pause(),this.privIsPaused=!0)}resume(e,t){this.privIsPaused&&void 0!==this.privAudio&&(this.privAudio.play().then((()=>{e&&e()}),(e=>{t&&t(e)})),this.privIsPaused=!1)}get internalAudio(){return this.privAudio}updateSourceBuffer(){return Hr(this,void 0,void 0,(function*(){if(void 0!==this.privAudioBuffer&&this.privAudioBuffer.length>0&&this.sourceBufferAvailable()){this.privAppendingToBuffer=!0;const e=this.privAudioBuffer.shift();try{this.privSourceBuffer.appendBuffer(e)}catch(t){return this.privAudioBuffer.unshift(e),void console.log("buffer filled, pausing addition of binaries until space is made")}yield this.notifyPlayback()}else this.canEndStream()&&(yield this.handleSourceBufferUpdateEnd())}))}handleSourceBufferUpdateEnd(){return Hr(this,void 0,void 0,(function*(){this.canEndStream()&&this.sourceBufferAvailable()&&(this.privMediaSource.endOfStream(),yield this.notifyPlayback())}))}notifyPlayback(){return Hr(this,void 0,void 0,(function*(){this.privPlaybackStarted||void 0===this.privAudio||(this.privPlaybackStarted=!0,this.onAudioStart&&this.onAudioStart(this),this.privAudio.onended=()=>{this.onAudioEnd&&this.onAudioEnd(this)},this.privIsPaused||(yield this.privAudio.play()))}))}canEndStream(){return this.isClosed&&void 0!==this.privSourceBuffer&&0===this.privAudioBuffer.length&&this.privMediaSourceOpened&&!this.privAppendingToBuffer&&"open"===this.privMediaSource.readyState}sourceBufferAvailable(){return void 0!==this.privSourceBuffer&&!this.privSourceBuffer.updating}}h=o("1DJXa");class Wr{constructor(e){Ue.throwIfNullOrUndefined(h.openSync,"\nFile System access not available, please use Push or PullAudioOutputStream"),this.privFd=h.openSync(e,"w")}set format(e){Ue.throwIfNotUndefined(this.privAudioFormat,"format is already set"),this.privAudioFormat=e;let t=0;this.privAudioFormat.hasHeader&&(t=this.privAudioFormat.header.byteLength),void 0!==this.privFd&&(this.privWriteStream=h.createWriteStream("",{fd:this.privFd,start:t,autoClose:!1}))}write(e){Ue.throwIfNullOrUndefined(this.privAudioFormat,"must set format before writing."),void 0!==this.privWriteStream&&this.privWriteStream.write(new Uint8Array(e.slice(0)))}close(){void 0!==this.privFd&&(this.privWriteStream.on("finish",(()=>{this.privAudioFormat.hasHeader&&(this.privAudioFormat.updateHeader(this.privWriteStream.bytesWritten),h.writeSync(this.privFd,new Int8Array(this.privAudioFormat.header),0,this.privAudioFormat.header.byteLength,0)),h.closeSync(this.privFd),this.privFd=void 0})),this.privWriteStream.end())}id(){return this.privId}}class qr{static fromDefaultMicrophoneInput(){const e=new or(!0);return new Kr(new(0,Fe.MicAudioSource)(e))}static fromMicrophoneInput(e){const t=new or(!0);return new Kr(new(0,Fe.MicAudioSource)(t,e))}static fromWavFileInput(e,t="unnamedBuffer.wav"){return new Kr(new(0,nr.FileAudioSource)(e,t))}static fromStreamInput(e){if(e instanceof Fr)return new Kr(new(0,Rr.PullAudioInputStreamImpl)(e));if(e instanceof Rr.AudioInputStream)return new Kr(e);if("undefined"!=typeof MediaStream&&e instanceof MediaStream){const t=new or(!1);return new Kr(new(0,Fe.MicAudioSource)(t,null,null,e))}throw new Error("Not Supported Type")}static fromDefaultSpeakerOutput(){return new Jr(new(0,jr.SpeakerAudioDestination))}static fromSpeakerOutput(e){if(void 0===e)return qr.fromDefaultSpeakerOutput();if(e instanceof jr.SpeakerAudioDestination)return new Jr(e);throw new Error("Not Supported Type")}static fromAudioFileOutput(e){return new Jr(new Wr(e))}static fromStreamOutput(e){if(e instanceof zr)return new Jr(new(0,pn.PushAudioOutputStreamImpl)(e));if(e instanceof pn.PushAudioOutputStream)return new Jr(e);if(e instanceof pn.PullAudioOutputStream)return new Jr(e);throw new Error("Not Supported Type")}}class Kr extends qr{constructor(e){super(),this.privSource=e}get format(){return this.privSource.format}close(e,t){this.privSource.turnOff().then((()=>{e&&e()}),(e=>{t&&t(e)}))}id(){return this.privSource.id()}get blob(){return this.privSource.blob}turnOn(){return this.privSource.turnOn()}attach(e){return this.privSource.attach(e)}detach(e){return this.privSource.detach(e)}turnOff(){return this.privSource.turnOff()}get events(){return this.privSource.events}setProperty(e,t){if(Ue.throwIfNull(t,"value"),void 0===this.privSource.setProperty)throw new Error("This AudioConfig instance does not support setting properties.");this.privSource.setProperty(e,t)}getProperty(e,t){if(void 0!==this.privSource.getProperty)return this.privSource.getProperty(e,t);throw new Error("This AudioConfig instance does not support getting properties.")}get deviceInfo(){return this.privSource.deviceInfo}}class Jr extends qr{constructor(e){super(),this.privDestination=e}set format(e){this.privDestination.format=e}write(e){this.privDestination.write(e)}close(){this.privDestination.close()}id(){return this.privDestination.id()}setProperty(){throw new Error("This AudioConfig instance does not support setting properties.")}getProperty(){throw new Error("This AudioConfig instance does not support getting properties.")}}var Qr={};e(Qr,"SpeechRecognizer",(()=>ei),(e=>ei=e));var Xr={};e(Xr,"Recognizer",(()=>Zr),(e=>Zr=e));var Yr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class Zr{constructor(e,t,n){this.audioConfig=void 0!==e?e:qr.fromDefaultMicrophoneInput(),this.privDisposed=!1,this.privProperties=t.clone(),this.privConnectionFactory=n,this.implCommonRecognizerSetup()}close(e,t){Ue.throwIfDisposed(this.privDisposed),oe(this.dispose(!0),e,t)}get internalData(){return this.privReco}dispose(e){return Yr(this,void 0,void 0,(function*(){this.privDisposed||(this.privDisposed=!0,e&&this.privReco&&(yield this.privReco.audioSource.turnOff(),yield this.privReco.dispose()))}))}static get telemetryEnabled(){return Ye.ServiceRecognizerBase.telemetryDataEnabled}static enableTelemetry(e){Ye.ServiceRecognizerBase.telemetryDataEnabled=e}implCommonRecognizerSetup(){let e="undefined"!=typeof window?"Browser":"Node",t="unknown",n="unknown";"undefined"!=typeof navigator&&(e=e+"/"+navigator.platform,t=navigator.userAgent,n=navigator.appVersion);const r=this.createRecognizerConfig(new ht(new ft(new mt(e,t,n))));this.privReco=this.createServiceRecognizer(Zr.getAuthFromProperties(this.privProperties),this.privConnectionFactory,this.audioConfig,r)}recognizeOnceAsyncImpl(e){return Yr(this,void 0,void 0,(function*(){Ue.throwIfDisposed(this.privDisposed);const t=new ie;yield this.implRecognizerStop(),yield this.privReco.recognize(e,t.resolve,t.reject);const n=yield t.promise;return yield this.implRecognizerStop(),n}))}startContinuousRecognitionAsyncImpl(e){return Yr(this,void 0,void 0,(function*(){Ue.throwIfDisposed(this.privDisposed),yield this.implRecognizerStop(),yield this.privReco.recognize(e,void 0,void 0)}))}stopContinuousRecognitionAsyncImpl(){return Yr(this,void 0,void 0,(function*(){Ue.throwIfDisposed(this.privDisposed),yield this.implRecognizerStop()}))}implRecognizerStop(){return Yr(this,void 0,void 0,(function*(){this.privReco&&(yield this.privReco.stopRecognizing())}))}static getAuthFromProperties(e){const t=e.getProperty(Qe.SpeechServiceConnection_Key,void 0);return t&&""!==t?new He(t):new Ve((()=>{const t=e.getProperty(Qe.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(t)}),(()=>{const t=e.getProperty(Qe.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(t)}))}}var $r=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class ei extends Xr.Recognizer{constructor(e,t){const n=e;Ue.throwIfNull(n,"speechConfig"),Ue.throwIfNullOrWhitespace(n.properties.getProperty(Qe.SpeechServiceConnection_RecoLanguage),Qe[Qe.SpeechServiceConnection_RecoLanguage]),super(t,n.properties,new Ct),this.privDisposedRecognizer=!1}static FromConfig(e,t,n){const r=e;t.properties.mergeTo(r.properties);return new ei(e,n)}get endpointId(){return Ue.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(Qe.SpeechServiceConnection_EndpointId,"00000000-0000-0000-0000-000000000000")}get authorizationToken(){return this.properties.getProperty(Qe.SpeechServiceAuthorization_Token)}set authorizationToken(e){Ue.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(Qe.SpeechServiceAuthorization_Token,e)}get speechRecognitionLanguage(){return Ue.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(Qe.SpeechServiceConnection_RecoLanguage)}get outputFormat(){return Ue.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(Xn,vt[vt.Simple])===vt[vt.Simple]?vt.Simple:vt.Detailed}get properties(){return this.privProperties}recognizeOnceAsync(e,t){oe(this.recognizeOnceAsyncImpl(tt.Interactive),e,t)}startContinuousRecognitionAsync(e,t){oe(this.startContinuousRecognitionAsyncImpl(tt.Conversation),e,t)}stopContinuousRecognitionAsync(e,t){oe(this.stopContinuousRecognitionAsyncImpl(),e,t)}startKeywordRecognitionAsync(e,t,n){Ue.throwIfNull(e,"model"),n&&n("Not yet implemented.")}stopKeywordRecognitionAsync(e){e&&e()}close(e,t){Ue.throwIfDisposed(this.privDisposedRecognizer),oe(this.dispose(!0),e,t)}dispose(e){const t=Object.create(null,{dispose:{get:()=>super.dispose}});return $r(this,void 0,void 0,(function*(){this.privDisposedRecognizer||(e&&(this.privDisposedRecognizer=!0,yield this.implRecognizerStop()),yield t.dispose.call(this,e))}))}createRecognizerConfig(e){return new dt(e,this.properties)}createServiceRecognizer(e,t,n,r){return new(0,Bt.SpeechServiceRecognizer)(e,t,n,r,this)}}var ti,ni,ri,ii,oi={};e(oi,"SpeechSynthesizer",(()=>ci),(e=>ci=e)),(ni=ti||(ti={}))[ni.Unknown=0]="Unknown",ni[ni.Female=1]="Female",ni[ni.Male=2]="Male",(ii=ri||(ri={}))[ii.OnlineNeural=1]="OnlineNeural",ii[ii.OnlineStandard=2]="OnlineStandard",ii[ii.OfflineNeural=3]="OfflineNeural",ii[ii.OfflineStandard=4]="OfflineStandard";class ai{constructor(e){if(this.privStyleList=[],this.privVoicePath="",e&&(this.privName=e.Name,this.privLocale=e.Locale,this.privShortName=e.ShortName,this.privLocalName=e.LocalName,this.privVoiceType=e.VoiceType.endsWith("Standard")?ri.OnlineStandard:ri.OnlineNeural,this.privGender="Male"===e.Gender?ti.Male:"Female"===e.Gender?ti.Female:ti.Unknown,e.StyleList&&Array.isArray(e.StyleList)))for(const t of e.StyleList)this.privStyleList.push(t)}get name(){return this.privName}get locale(){return this.privLocale}get shortName(){return this.privShortName}get localName(){return this.privLocalName}get gender(){return this.privGender}get voiceType(){return this.privVoiceType}get styleList(){return this.privStyleList}get voicePath(){return this.privVoicePath}}class si extends Rn{constructor(e,t,n){if(Array.isArray(t)){super(e,yt.VoicesListRetrieved,void 0,new kt),this.privVoices=[];for(const e of t)this.privVoices.push(new ai(e))}else super(e,yt.Canceled,n||"Error information unavailable",new kt)}get voices(){return this.privVoices}}var li=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class ci{constructor(e,t){const n=e;Ue.throwIfNull(n,"speechConfig"),null!==t&&(this.audioConfig=void 0===t?"undefined"==typeof window?void 0:qr.fromDefaultSpeakerOutput():t),this.privProperties=n.properties.clone(),this.privDisposed=!1,this.privSynthesizing=!1,this.privConnectionFactory=new Tt,this.synthesisRequestQueue=new(0,ae.Queue),this.implCommonSynthesizeSetup()}get authorizationToken(){return this.properties.getProperty(Qe.SpeechServiceAuthorization_Token)}set authorizationToken(e){Ue.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(Qe.SpeechServiceAuthorization_Token,e)}get properties(){return this.privProperties}get autoDetectSourceLanguage(){return"OpenRange"===this.properties.getProperty(Qe.SpeechServiceConnection_AutoDetectSourceLanguages)}static FromConfig(e,t,n){const r=e;return t.properties.mergeTo(r.properties),new ci(e,n)}buildSsml(e){const t={"af-ZA":"af-ZA-AdriNeural","am-ET":"am-ET-AmehaNeural","ar-AE":"ar-AE-FatimaNeural","ar-BH":"ar-BH-AliNeural","ar-DZ":"ar-DZ-AminaNeural","ar-EG":"ar-EG-SalmaNeural","ar-IQ":"ar-IQ-BasselNeural","ar-JO":"ar-JO-SanaNeural","ar-KW":"ar-KW-FahedNeural","ar-LY":"ar-LY-ImanNeural","ar-MA":"ar-MA-JamalNeural","ar-QA":"ar-QA-AmalNeural","ar-SA":"ar-SA-HamedNeural","ar-SY":"ar-SY-AmanyNeural","ar-TN":"ar-TN-HediNeural","ar-YE":"ar-YE-MaryamNeural","bg-BG":"bg-BG-BorislavNeural","bn-BD":"bn-BD-NabanitaNeural","bn-IN":"bn-IN-BashkarNeural","ca-ES":"ca-ES-JoanaNeural","cs-CZ":"cs-CZ-AntoninNeural","cy-GB":"cy-GB-AledNeural","da-DK":"da-DK-ChristelNeural","de-AT":"de-AT-IngridNeural","de-CH":"de-CH-JanNeural","de-DE":"de-DE-KatjaNeural","el-GR":"el-GR-AthinaNeural","en-AU":"en-AU-NatashaNeural","en-CA":"en-CA-ClaraNeural","en-GB":"en-GB-LibbyNeural","en-HK":"en-HK-SamNeural","en-IE":"en-IE-ConnorNeural","en-IN":"en-IN-NeerjaNeural","en-KE":"en-KE-AsiliaNeural","en-NG":"en-NG-AbeoNeural","en-NZ":"en-NZ-MitchellNeural","en-PH":"en-PH-JamesNeural","en-SG":"en-SG-LunaNeural","en-TZ":"en-TZ-ElimuNeural","en-US":"en-US-JennyNeural","en-ZA":"en-ZA-LeahNeural","es-AR":"es-AR-ElenaNeural","es-BO":"es-BO-MarceloNeural","es-CL":"es-CL-CatalinaNeural","es-CO":"es-CO-GonzaloNeural","es-CR":"es-CR-JuanNeural","es-CU":"es-CU-BelkysNeural","es-DO":"es-DO-EmilioNeural","es-EC":"es-EC-AndreaNeural","es-ES":"es-ES-AlvaroNeural","es-GQ":"es-GQ-JavierNeural","es-GT":"es-GT-AndresNeural","es-HN":"es-HN-CarlosNeural","es-MX":"es-MX-DaliaNeural","es-NI":"es-NI-FedericoNeural","es-PA":"es-PA-MargaritaNeural","es-PE":"es-PE-AlexNeural","es-PR":"es-PR-KarinaNeural","es-PY":"es-PY-MarioNeural","es-SV":"es-SV-LorenaNeural","es-US":"es-US-AlonsoNeural","es-UY":"es-UY-MateoNeural","es-VE":"es-VE-PaolaNeural","et-EE":"et-EE-AnuNeural","fa-IR":"fa-IR-DilaraNeural","fi-FI":"fi-FI-SelmaNeural","fil-PH":"fil-PH-AngeloNeural","fr-BE":"fr-BE-CharlineNeural","fr-CA":"fr-CA-SylvieNeural","fr-CH":"fr-CH-ArianeNeural","fr-FR":"fr-FR-DeniseNeural","ga-IE":"ga-IE-ColmNeural","gl-ES":"gl-ES-RoiNeural","gu-IN":"gu-IN-DhwaniNeural","he-IL":"he-IL-AvriNeural","hi-IN":"hi-IN-MadhurNeural","hr-HR":"hr-HR-GabrijelaNeural","hu-HU":"hu-HU-NoemiNeural","id-ID":"id-ID-ArdiNeural","is-IS":"is-IS-GudrunNeural","it-IT":"it-IT-IsabellaNeural","ja-JP":"ja-JP-NanamiNeural","jv-ID":"jv-ID-DimasNeural","kk-KZ":"kk-KZ-AigulNeural","km-KH":"km-KH-PisethNeural","kn-IN":"kn-IN-GaganNeural","ko-KR":"ko-KR-SunHiNeural","lo-LA":"lo-LA-ChanthavongNeural","lt-LT":"lt-LT-LeonasNeural","lv-LV":"lv-LV-EveritaNeural","mk-MK":"mk-MK-AleksandarNeural","ml-IN":"ml-IN-MidhunNeural","mr-IN":"mr-IN-AarohiNeural","ms-MY":"ms-MY-OsmanNeural","mt-MT":"mt-MT-GraceNeural","my-MM":"my-MM-NilarNeural","nb-NO":"nb-NO-PernilleNeural","nl-BE":"nl-BE-ArnaudNeural","nl-NL":"nl-NL-ColetteNeural","pl-PL":"pl-PL-AgnieszkaNeural","ps-AF":"ps-AF-GulNawazNeural","pt-BR":"pt-BR-FranciscaNeural","pt-PT":"pt-PT-DuarteNeural","ro-RO":"ro-RO-AlinaNeural","ru-RU":"ru-RU-SvetlanaNeural","si-LK":"si-LK-SameeraNeural","sk-SK":"sk-SK-LukasNeural","sl-SI":"sl-SI-PetraNeural","so-SO":"so-SO-MuuseNeural","sr-RS":"sr-RS-NicholasNeural","su-ID":"su-ID-JajangNeural","sv-SE":"sv-SE-SofieNeural","sw-KE":"sw-KE-RafikiNeural","sw-TZ":"sw-TZ-DaudiNeural","ta-IN":"ta-IN-PallaviNeural","ta-LK":"ta-LK-KumarNeural","ta-SG":"ta-SG-AnbuNeural","te-IN":"te-IN-MohanNeural","th-TH":"th-TH-PremwadeeNeural","tr-TR":"tr-TR-AhmetNeural","uk-UA":"uk-UA-OstapNeural","ur-IN":"ur-IN-GulNeural","ur-PK":"ur-PK-AsadNeural","uz-UZ":"uz-UZ-MadinaNeural","vi-VN":"vi-VN-HoaiMyNeural","zh-CN":"zh-CN-XiaoxiaoNeural","zh-HK":"zh-HK-HiuMaanNeural","zh-TW":"zh-TW-HsiaoChenNeural","zu-ZA":"zu-ZA-ThandoNeural"};let n=this.properties.getProperty(Qe.SpeechServiceConnection_SynthLanguage,"en-US"),r=this.properties.getProperty(Qe.SpeechServiceConnection_SynthVoice,""),i=ci.XMLEncode(e);return this.autoDetectSourceLanguage?n="en-US":r=r||t[n],r&&(i=`<voice name='${r}'>${i}</voice>`),i=`<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xmlns:emo='http://www.w3.org/2009/10/emotionml' xml:lang='${n}'>${i}</speak>`,i}speakTextAsync(e,t,n,r){this.speakImpl(e,!1,t,n,r)}speakSsmlAsync(e,t,n,r){this.speakImpl(e,!0,t,n,r)}getVoicesAsync(e=""){return li(this,void 0,void 0,(function*(){return this.getVoices(e)}))}close(e,t){Ue.throwIfDisposed(this.privDisposed),oe(this.dispose(!0),e,t)}get internalData(){return this.privAdapter}dispose(e){return li(this,void 0,void 0,(function*(){this.privDisposed||(e&&this.privAdapter&&(yield this.privAdapter.dispose()),this.privDisposed=!0)}))}createSynthesizerConfig(e){return new Jn(e,this.privProperties)}createSynthesisAdapter(e,t,n,r){return new(0,Tn.SynthesisAdapterBase)(e,t,r,this,this.audioConfig)}implCommonSynthesizeSetup(){let e="undefined"!=typeof window?"Browser":"Node",t="unknown",n="unknown";"undefined"!=typeof navigator&&(e=e+"/"+navigator.platform,t=navigator.userAgent,n=navigator.appVersion);const r=this.createSynthesizerConfig(new ht(new ft(new mt(e,t,n)))),i=this.privProperties.getProperty(Qe.SpeechServiceConnection_Key,void 0),o=i&&""!==i?new He(i):new Ve((()=>{const e=this.privProperties.getProperty(Qe.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(e)}),(()=>{const e=this.privProperties.getProperty(Qe.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(e)}));this.privAdapter=this.createSynthesisAdapter(o,this.privConnectionFactory,this.audioConfig,r),this.privAdapter.audioOutputFormat=dn.fromSpeechSynthesisOutputFormat(Zt[this.properties.getProperty(Qe.SpeechServiceConnection_SynthOutputFormat,void 0)]),this.privRestAdapter=new Kn(r)}speakImpl(e,t,n,r,i){try{Ue.throwIfDisposed(this.privDisposed);const o=x();let a;a=i instanceof zr?new(0,pn.PushAudioOutputStreamImpl)(i):i instanceof pn.PullAudioOutputStream?i:void 0!==i?new Wr(i):void 0,this.synthesisRequestQueue.enqueue(new ui(o,e,t,(e=>{if(this.privSynthesizing=!1,n)try{n(e)}catch(e){r&&r(e)}n=void 0,this.adapterSpeak().catch((()=>{}))}),(e=>{r&&r(e)}),a)),this.adapterSpeak().catch((()=>{}))}catch(e){if(r)if(e instanceof Error){const t=e;r(t.name+": "+t.message)}else r(e);this.dispose(!0).catch((()=>{}))}}getVoices(e){return li(this,void 0,void 0,(function*(){const t=x(),n=yield this.privRestAdapter.getVoicesList(t);if(n.ok&&Array.isArray(n.json)){let r=n.json;return e&&e.length>0&&(r=r.filter((t=>!!t.Locale&&t.Locale.toLowerCase()===e.toLowerCase()))),new si(t,r,void 0)}return new si(t,void 0,`Error: ${n.status}: ${n.statusText}`)}))}adapterSpeak(){return li(this,void 0,void 0,(function*(){if(!this.privDisposed&&!this.privSynthesizing){this.privSynthesizing=!0;const e=yield this.synthesisRequestQueue.dequeue();return this.privAdapter.Speak(e.text,e.isSSML,e.requestId,e.cb,e.err,e.dataStream)}}))}static XMLEncode(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}}class ui{constructor(e,t,n,r,i,o){this.requestId=e,this.text=t,this.isSSML=n,this.cb=r,this.err=i,this.dataStream=o}}function di(){
62
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */di=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof d?t:d,o=Object.create(i.prototype),a=new M(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return A()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function d(){}function h(){}function f(){}var p={};s(p,i,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(_([])));g&&g!==t&&n.call(g,i)&&(p=g);var v=f.prototype=d.prototype=Object.create(p);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function r(i,o,a,s){var l=c(e[i],e,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function _(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:A}}function A(){return{value:void 0,done:!0}}return h.prototype=f,s(v,"constructor",f),s(f,"constructor",h),h.displayName=s(f,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,s(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(y.prototype),s(y.prototype,o,(function(){return this})),e.AsyncIterator=y,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new y(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(v),s(v,a,"Generator"),s(v,i,(function(){return this})),s(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=_,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:_(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function hi(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function fi(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){hi(o,r,i,a,s,"next",e)}function s(e){hi(o,r,i,a,s,"throw",e)}a(void 0)}))}}function pi(){return pi=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},pi.apply(this,arguments)}var mi=function(e,t){return n(d)(""+t.apiUrl+e,pi({},t,{body:null!=t&&t.body?JSON.stringify(t.body):void 0,mode:"cors",credentials:"include",headers:pi({"Content-Type":"application/json"},null==t?void 0:t.headers)})).then((function(e){return null!=t&&t.text?e.text():e.json()}))},gi=function(e){return{getTenantPublicMemoriList:function(t){return mi("/TenantPublicMemori/"+encodeURI(t),{apiUrl:e})},getPublicMemoriList:function(t){return mi("/PublicMemori/"+t,{apiUrl:e})},getAllMemori:function(t){return mi("/AllMemori/"+t,{apiUrl:e})},getUserMemoriList:function(t){return mi("/Memori/"+t,{apiUrl:e})},getSharedMemoriList:function(t){return mi("/SharedMemori/"+t,{apiUrl:e})},getTenantCategories:function(t){return mi("/TenantMemoriCategories/"+encodeURI(t),{apiUrl:e})},getMemoriConfigs:function(t){return mi("/MemoriConfigs/"+t,{apiUrl:e})},createMemori:function(t,n){return mi("/Memori/"+t,{apiUrl:e,body:n,method:"POST"})},updateMemori:function(t,n){return mi("/Memori/"+t+"/"+n.memoriID,{apiUrl:e,body:n,method:"PATCH"})},deleteMemori:function(t,n){return mi("/Memori/"+t,{apiUrl:e,body:n,method:"DELETE"})},getMemoriById:function(t,n){return mi("/Memori/"+t+"/"+n,{apiUrl:e})},getMemoriByUserAndId:function(t,n,r,i){return mi("/MemoriById/"+t+"/"+n+"/"+r+(i?"/"+i:""),{apiUrl:e})},getMemori:function(t,n,r,i){return mi("/Memori/"+encodeURI(t)+"/"+encodeURI(n)+"/"+encodeURI(r)+"/"+(null!=i?i:""),{apiUrl:e})},getMemoriSessions:function(t,n,r,i){return mi("/MemoriSessions/"+t+"/"+n+(r?"/"+r:"")+(r&&i?"/"+i:""),{apiUrl:e})},transferMemori:function(t,n){return mi("/TransferMemori/"+t,{apiUrl:e,body:n,method:"POST"})},memoriContentUpdated:function(t,n){return mi("/MemoriContentUpdated/"+t+"/"+n,{apiUrl:e,method:"POST"})}}},vi=function(e){return{userSignIn:function(t){return mi("/User",{apiUrl:e,body:t,method:"POST"})},userConfirmSignIn:function(t){return mi("/UserConfirm",{apiUrl:e,body:t,method:"POST"})},userLogin:function(t){return mi("/Login",{apiUrl:e,body:t,method:"POST"})},userLogout:function(t){return mi("/Logout/"+t,{apiUrl:e,method:"POST"})},getUser:function(t,n){return mi("/User/"+t+"/"+n,{apiUrl:e})},getUsersList:function(t){return mi("/Users/"+t,{apiUrl:e})},deleteUser:function(t,n){return mi("/User/"+t+"/"+n,{apiUrl:e,method:"DELETE"})},updateUser:function(t,n,r){return mi("/User/"+t+"/"+n,{apiUrl:e,method:"PATCH",body:r})},resetPassword:function(t){return mi("/ResetPassword",{apiUrl:e,body:t,method:"POST"})},resetConfirm:function(t){return mi("/ResetConfirm",{apiUrl:e,body:t,method:"POST"})},recoverUsername:function(t){return mi("/RecoverUsername",{apiUrl:e,body:t,method:"POST"})},getTenantConfig:function(t){return mi("/Tenant/"+t,{apiUrl:e})},resendVerificationCode:function(t){return mi("/ResendVerificationCode",{apiUrl:e,body:t,method:"POST"})},createUser:function(t,n){return mi("/User/"+t,{apiUrl:e,body:n,method:"POST"})}}},bi=function(e){return{getMemoriIntegrationsList:function(t,n){return mi("/Integrations/"+t+"/"+n,{apiUrl:e})},getAllIntegrationsList:function(t){return mi("/AllIntegrations/"+t,{apiUrl:e})},getIntegration:function(t,n){return mi("/Integration/"+t+"/"+n,{apiUrl:e})},deleteIntegration:function(t,n){return mi("/Integration/"+t+"/"+n,{apiUrl:e,method:"DELETE"})},createIntegration:function(t,n){return mi("/Integration/"+t,{apiUrl:e,method:"POST",body:n})},updateIntegration:function(t,n,r){return mi("/Integration/"+t+"/"+n,{apiUrl:e,method:"PATCH",body:r})}}},yi=function(e){return{getUploadAssetURL:function(t,n,r){return e+"/Asset/"+t+"/"+n+(r?"/"+r:"")},uploadAsset:(t=fi(di().mark((function t(n,r,i,o,a){var s,l,c,u;return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=new FormData,t.next=3,fetch(r);case 3:return l=t.sent,t.next=6,l.blob();case 6:return c=t.sent,s.append(n,c,n),t.next=10,fetch(e+"/Asset/"+i+"/"+o+(a?"/"+a:""),{method:"POST",body:s});case 10:return u=t.sent,t.next=13,u.json();case 13:return t.abrupt("return",t.sent);case 14:case"end":return t.stop()}}),t)}))),function(e,n,r,i,o){return t.apply(this,arguments)}),getAsset:function(t,n){return mi("/Asset/"+t+"/"+n,{apiUrl:e,method:"GET"})},updateAsset:function(t,n,r){return mi("/Asset/"+t+"/"+n.split("/").reverse()[0],{apiUrl:e,method:"PATCH",body:r})},deleteAsset:function(t,n){return mi("/Asset/"+t+"/"+n.split("/").reverse()[0],{apiUrl:e,method:"DELETE"})}};var t},wi=function(e){return{getSentInvitations:function(t){return mi("/SentInvitations/"+t,{apiUrl:e})},getReceivedInvitations:function(t){return mi("/ReceivedInvitations/"+t,{apiUrl:e})},getAllInvitations:function(t){return mi("/AllInvitations/"+t,{apiUrl:e})},getInvitation:function(t,n){return mi("/Invitation/"+t+"/"+n,{apiUrl:e})},updateInvitation:function(t,n){return mi("/Invitation/"+t+"/"+n.invitationID,{apiUrl:e,method:"PATCH",body:n})},deleteInvitation:function(t,n){return mi("/Invitation/"+t+"/"+n,{apiUrl:e,method:"DELETE"})},acceptInvitation:function(t,n){return mi("/AcceptInvitation/"+t+"/"+n,{apiUrl:e,method:"POST"})},rejectInvitation:function(t,n){return mi("/RejectInvitation/"+t+"/"+n,{apiUrl:e,method:"POST"})},sendInvitation:function(t,n){return mi("/SendInvitation/"+t,{apiUrl:e,method:"POST",body:n})}}},Si=function(e){return{getTenantConsumptionLogs:function(t,n,r,i,o){return mi("/TenantConsumptionLogs/"+t+"/"+n+"/"+r+(i?"/"+i:"")+(i&&o?"/"+o:""),{apiUrl:e})},getUserConsumptionLogs:function(t,n,r,i,o){return mi("/UserConsumptionLogs/"+t+"/"+n+"/"+r+(i?"/"+i:"")+(i&&o?"/"+o:""),{apiUrl:e})},getMemoriConsumptionLogs:function(t,n,r,i,o){return mi("/MemoriConsumptionLogs/"+t+"/"+n+"/"+r+(i?"/"+i:"")+(i&&o?"/"+o:""),{apiUrl:e})}}},xi=function(e){return{getTenantNotifications:function(t){return mi("/TenantNotifications/"+t,{apiUrl:e})},getUserNotifications:function(t){return mi("/UserNotifications/"+t,{apiUrl:e})}}},Mi=function(e){return pi({asset:yi(e),memori:gi(e),user:vi(e),integration:bi(e),invitation:wi(e),consumptionLogs:Si(e),notifications:xi(e)},yi(e),gi(e),vi(e),bi(e),wi(e),Si(e),xi(e))},_i=function(e){return{getCorrelationPairs:(n=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CorrelationPairs/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),deleteCorrelationPair:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CorrelationPair/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n},Ai=function(e){return{postTextEnteredEvent:(c=fi(di().mark((function t(n){var r,i;return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.sessionId,i=n.text,t.abrupt("return",mi("/TextEnteredEvent/"+r,{method:"POST",apiUrl:e,body:{text:i}}));case 2:case"end":return t.stop()}}),t)}))),function(e){return c.apply(this,arguments)}),postPlaceChangedEvent:(l=fi(di().mark((function t(n){var r,i,o,a,s;return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.sessionId,i=n.placeName,o=n.latitude,a=n.longitude,s=n.uncertaintyKm,t.abrupt("return",mi("/PlaceChangedEvent/"+r,{method:"POST",apiUrl:e,body:{placeName:i,latitude:o,longitude:a,uncertaintyKm:s}}));case 2:case"end":return t.stop()}}),t)}))),function(e){return l.apply(this,arguments)}),postDateChangedEvent:(s=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/DateChangedEvent/"+n,{method:"POST",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return s.apply(this,arguments)}),postTagChangedEvent:(a=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/TagChangedEvent/"+n,{method:"POST",apiUrl:e,body:{tag:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return a.apply(this,arguments)}),postTimeoutEvent:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/TimeoutEvent/"+n,{method:"POST",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),postMediumSelectedEvent:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/MediumSelectedEvent/"+n,{method:"POST",apiUrl:e,body:{medium:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),postDateSelectedEvent:(r=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/DateSelectedEvent/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),postPlaceSelectedEvent:(n=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/PlaceSelectedEvent/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),postTagSelectedEvent:(t=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/TagSelectedEvent/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r,i,o,a,s,l,c},Ei=function(e){return{importCSV:(n=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ImportExport/ImportCSV/"+n,{method:"POST",apiUrl:e,body:pi({csvRows:r},i)}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),exportCSV:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ImportExport/ExportCSV/"+n,{method:"POST",apiUrl:e,body:r,text:!0}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n},Ci=function(e){return{getIntents:(u=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Intents/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return u.apply(this,arguments)}),getIntent:(c=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Intent/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return c.apply(this,arguments)}),patchIntent:(l=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Intent/"+n+"/"+r.intentID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return l.apply(this,arguments)}),deleteIntent:(s=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Intent/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return s.apply(this,arguments)}),createIntent:(a=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Intent/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return a.apply(this,arguments)}),getIntentSlots:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/IntentSlots/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getIntentSlot:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/IntentSlot/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),patchIntentSlot:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/IntentSlot/"+n+"/"+r.intentSlotID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),deleteIntentSlot:(n=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/IntentSlot/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),createIntentSlot:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/IntentSlot/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o,a,s,l,c,u},Ti=function(e){return{getLocalizationKeys:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/LocalizationKeys/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getLocalizationKey:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/LocalizationKey/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),deleteLocalizationKey:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/LocalizationKey/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postLocalizationKey:(n=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/LocalizationKey/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),patchLocalizationKey:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/LocalizationKey/"+n,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o},Ii=function(e){return{getMedia:(o=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Media/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),deleteMedia:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Media/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),getMedium:(r=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Medium/"+n+"/"+r+"/"+i,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)}),patchMedium:(n=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Medium/"+n+"/"+r+"/"+i,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),deleteMedium:function(t,n,r){return mi("/Medium/"+t+"/"+n+"/"+r,{method:"GET",apiUrl:e})},postMedium:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Medium/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o},ki=function(e){return{getMemories:(s=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Memories/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return s.apply(this,arguments)}),getMemoriesPaginated:(a=fi(di().mark((function t(n,r,i,o){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Memories/"+n+"/"+r+"/"+i+(o?"/"+o:""),{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n,r){return a.apply(this,arguments)}),getMemory:(o=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Memory/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),patchMemory:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Memory/"+n+"/"+r.memoryID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),deleteMemory:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Memory/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postMemory:(n=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Memory/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),getMemoryAccess:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/MemoryAccess/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o,a,s},Ri=function(e){return{getWordVector:(o=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/WordVector/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),getSimilarWords:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/SimilarWords/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),guessLanguage:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/GuessLanguage/"+n,{method:"POST",apiUrl:e,body:{text:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),computeSimilarity:(n=fi(di().mark((function t(n,r,i,o,a){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ComputeSimilarity/"+n,{method:"POST",apiUrl:e,body:{referenceText:r,referenceTextType:i,comparisonText:o,comparisonTextType:a}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r,i,o){return n.apply(this,arguments)}),checkWords:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CheckWords/"+n,{method:"POST",apiUrl:e,body:{text:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o},Oi=function(e){return{getPeople:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/People/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getPerson:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Person/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),patchPerson:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Person/"+n+"/"+r.personID,{method:"PATCH",body:r,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),deletePerson:(n=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Person/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),postPerson:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Person/"+n,{method:"POST",body:r,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o},Pi=function(e){return{getPromptedQuestions:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/PromptedQuestions/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getPromptedQuestion:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/PromptedQuestion/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),patchPromptedQuestion:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/PromptedQuestion/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),deletePromptedQuestion:(n=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/PromptedQuestion/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),postPromptedQuestion:(t=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/PromptedQuestion/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r,i,o},Ni=function(e){return{searchMemory:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Search/"+n,{method:"POST",body:r,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postRandom:(n=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Random/"+n,{method:"POST",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),postHints:(t=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Hints/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r},Bi=function(e){return{initSession:(r=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Session",{method:"POST",body:n,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),getSession:(n=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Session/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),deleteSession:(t=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Session/"+n,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r},Li=function(e){return{getStatistics:(a=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Statistics/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return a.apply(this,arguments)}),getContentQualityIndexes:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ContentQualityIndexes/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getTextQualityIndexes:(i=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/TextQualityIndexes/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getEventLogs:(r=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/EventLogs/"+n+"/"+r+"/"+i,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)}),getMemoryEventLogs:(n=fi(di().mark((function t(n,r,i,o){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/EventLogs/"+n+"/"+r+"/"+i+"/"+o,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r,i){return n.apply(this,arguments)}),getIntentEventLogs:(t=fi(di().mark((function t(n,r,i,o){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/EventLogs/"+n+"/"+r+"/"+i+"/"+o,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n,r,i){return t.apply(this,arguments)})};var t,n,r,i,o,a},Di=function(e){return{getUnansweredQuestions:(r=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/UnansweredQuestions/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),getUnansweredQuestionsPaginated:(n=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/UnansweredQuestions/"+n+"/"+r+"/"+i,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),deleteUnansweredQuestion:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/UnansweredQuestion/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r},Ui=function(e){return{getContextVars:(r=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ContextVars/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),getContextVarNames:(n=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ContextVarNames/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),getContextVarValues:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ContextVarValues/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r},Fi=function(e){return{getCustomWords:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CustomWords/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getCustomWord:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CustomWord/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),deleteCustomWord:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CustomWord/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postCustomWord:(n=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CustomWord/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),patchCustomWord:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CustomWord/"+n+"/"+r.customWordID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o},zi=function(e){return{getChatLogs:(r=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ChatLogs/"+n+(r?"/"+r:"")+(r&&i?"/"+i:""),{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)}),deleteChatLogs:(n=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ChatLogs/"+n+(r?"/"+r:"")+(r&&i?"/"+i:""),{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),deleteChatLog:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ChatLog/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r},ji={__proto__:null,allowedMediaTypes:["image/jpeg","image/png","image/jpg","image/gif","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/pdf","video/mp4","video/avi","audio/mpeg3","audio/wav","audio/mpeg","video/mpeg","model/gltf-binary"],anonTag:"👤"},Hi=function(e,t){return void 0===t&&(t=!1),function(n,r){var i,o,a=hn.fromSubscription(e,"eastus");o=new(0,jr.SpeakerAudioDestination);var s=qr.fromSpeakerOutput(o);a.speechSynthesisVoiceName=function(e,t){var n="";switch(e.toUpperCase()){case"IT":n="MALE"===t?"it-IT-DiegoNeural":"it-IT-ElsaNeural";break;case"DE":n="MALE"===t?"de-DE-ConradNeural":"de-DE-KatjaNeural";break;case"EN":n="MALE"===t?"en-GB-RyanNeural":"en-GB-SoniaNeural";break;case"ES":n="MALE"===t?"es-ES-AlvaroNeural":"es-ES-ElviraNeural";break;case"FR":n="MALE"===t?"fr-FR-HenriNeural":"fr-FR-DeniseNeural";break;case"PT":n="MALE"===t?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural";break;default:n="MALE"===t?"it-IT-DiegoNeural":"it-IT-IsabellaNeural"}return n}(n,r);var l=function(e){var t="";switch(e.toUpperCase()){case"IT":default:t="it-IT";break;case"DE":t="de-DE";break;case"EN":t="en-US";break;case"ES":t="es-ES";break;case"FR":t="fr-FR";break;case"PT":t="pt-PT"}return t}(n);a.speechSynthesisLanguage=l,a.speechRecognitionLanguage=l;var c,u=function(){o&&o.pause(),i&&(i.close(),i=null)},d=qr.fromDefaultMicrophoneInput(),h=function(e){c&&(c.stopContinuousRecognitionAsync(),c.close(),c=null,e&&e())};return{speak:function(e,n){u(),i=new(0,oi.SpeechSynthesizer)(a,s),n&&(o.onAudioEnd=n),i.speakTextAsync(e,(function(n){if(n)try{t&&console.log("speak result",n),i&&(i.close(),i=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e))}else t&&console.log("speak no result",n)}),(function(t){console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e))}))},isSpeaking:function(){return!!i},stopSpeaking:u,recognize:function(e){(c=new(0,Qr.SpeechRecognizer)(a,d)).recognizing=function(e,n){t&&console.log("RECOGNIZING: Text="+n.result.text)},c.recognized=function(n,r){var i;r.result.reason===yt.RecognizedSpeech?(t&&console.log("RECOGNIZED: Text="+r.result.text),e(null!=(i=r.result.text)?i:"")):r.result.reason===yt.NoMatch&&t&&console.log("NOMATCH: Speech could not be recognized.")},c.canceled=function(e,n){t&&console.log("CANCELED: Reason="+n.reason),n.reason===Ke.Error&&t&&(console.log('"CANCELED: ErrorCode='+n.errorCode),console.log('"CANCELED: ErrorDetails='+n.errorDetails),console.log("CANCELED: Did you set the speech resource key and region values?")),h()},c.sessionStopped=function(e,n){t&&console.log("\n Session stopped event."),c&&c.stopContinuousRecognitionAsync()},c.startContinuousRecognitionAsync()},isRecognizing:function(){return!!c},stopRecognizing:h}}},Gi=function(e){return{getResourceUrl:function(t){var n=t.type,r=t.resourceURI,i=t.sessionID,o=t.baseURL,a=void 0===o?"https://app.twincreator.com":o,s="cover"===n?a+"/images/memoriCover.png":a+"/images/memoriAvatar.png";return r&&0!==r.length?r.includes("memoriai/memory")?r+"?memori-ai-session-id="+i:r.startsWith("https://")||r.startsWith("http://")?r+(i?"/"+i:""):r.startsWith("cloud://")?e.replace(/v2/,"v1")+"/CloudAsset/"+r.replace("cloud://",""):r.startsWith("guid://")?e.replace(/v2/,"v1")+"/GuidAsset/"+r.replace("guid://",""):s:s}}},Vi=function(e){var t=function(e){return e?new URL(e.startsWith("http")?e:"https://"+e).origin.replace("http://","https://"):"https://backend.memori.ai"}(e);return pi({backend:Mi(t+"/api/v2")},function(e){return pi({correlationPairs:_i(e)},_i(e),{dialog:Ai(e)},Ai(e),{importExport:Ei(e)},Ei(e),{intents:Ci(e)},Ci(e),{localizationKeys:Ti(e)},Ti(e),{media:Ii(e)},Ii(e),{memories:ki(e)},ki(e),{nlp:Ri(e)},Ri(e),{people:Oi(e)},Oi(e),{promptedQuestions:Pi(e)},Pi(e),{search:Ni(e)},Ni(e),{session:Bi(e)},Bi(e),{stats:Li(e)},Li(e),{unansweredQuestions:Di(e)},Di(e),{contextVars:Ui(e)},Ui(e),{customDictionary:Fi(e)},Fi(e),{chatLogs:zi(e)},zi(e))}(t+"/memori/v2"),{speech:Hi,constants:ji,asset:Gi(t+"/api/v2")})},Wi=(c=o("85Hg2"),o("hcaHr")),qi={},Ki=o("k9HYU");(qi=function(e,t,n){return(t=Ki(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}).__esModule=!0,qi.default=qi;c=o("85Hg2");var Ji=o("ffgrs"),Qi=o("22y1y"),Xi=(c=o("85Hg2"),/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g),Yi={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Zi=function(e){return Yi[e]};function $i(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 eo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$i(Object(r),!0).forEach((function(t){n(qi)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var to,no={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(Xi,Zi)}},ro=(0,c.createContext)();function io(){return no}var oo=function(){function e(){n(Ji)(this,e),this.usedNamespaces={}}return n(Qi)(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function ao(){return to}var so={type:"3rdParty",init:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};no=eo(eo({},no),e)}(e.options.react),function(e){to=e}(e)}};function lo(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]="react-i18next:: ".concat(n[0])),(e=console).warn.apply(e,n)}}var co={};function uo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"==typeof t[0]&&co[t[0]]||("string"==typeof t[0]&&(co[t[0]]=new Date),lo.apply(void 0,t))}function ho(e,t,n){e.loadNamespaces(t,(function(){if(e.isInitialized)n();else{e.on("initialized",(function t(){setTimeout((function(){e.off("initialized",t)}),0),n()}))}}))}function fo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],i=!!t.options&&t.options.fallbackLng,o=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(r,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!a(r,e)||i&&!a(o,e))))}function po(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return uo("i18n.languages were undefined or empty",t.languages),!0;var r=void 0!==t.options.ignoreJSONStructure;return r?t.hasLoadedNamespace(e,{precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):fo(e,t,n)}function mo(e){return e.displayName||e.name||("string"==typeof e&&e.length>0?e:"Unknown")}function go(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 vo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?go(Object(r),!0).forEach((function(t){n(qi)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):go(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bo=function(e,t){var n=(0,c.useRef)();return(0,c.useEffect)((function(){n.current=t?n.current:e}),[e,t]),n.current};function yo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.i18n,i=(0,c.useContext)(ro)||{},o=i.i18n,a=i.defaultNS,s=r||o||ao();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new oo),!s){uo("You will need to pass in an i18next instance by using initReactI18next");var l=function(e){return Array.isArray(e)?e[e.length-1]:e},u=[l,{},!1];return u.t=l,u.i18n={},u.ready=!1,u}s.options.react&&void 0!==s.options.react.wait&&uo("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var d=vo(vo(vo({},io()),s.options.react),t),h=d.useSuspense,f=d.keyPrefix,p=e||a||s.options&&s.options.defaultNS;p="string"==typeof p?[p]:p||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(p);var m=(s.isInitialized||s.initializedStoreOnce)&&p.every((function(e){return po(e,s,d)}));function g(){return s.getFixedT(null,"fallback"===d.nsMode?p:p[0],f)}var v=(0,c.useState)(g),b=n(Wi)(v,2),y=b[0],w=b[1],S=p.join(),x=bo(S),M=(0,c.useRef)(!0);(0,c.useEffect)((function(){var e=d.bindI18n,t=d.bindI18nStore;function n(){M.current&&w(g)}return M.current=!0,m||h||ho(s,p,(function(){M.current&&w(g)})),m&&x&&x!==S&&M.current&&w(g),e&&s&&s.on(e,n),t&&s&&s.store.on(t,n),function(){M.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,n)})),t&&s&&t.split(" ").forEach((function(e){return s.store.off(e,n)}))}}),[s,S]);var _=(0,c.useRef)(!0);(0,c.useEffect)((function(){M.current&&!_.current&&w(g),_.current=!1}),[s,f]);var A=[y,s,m];if(A.t=y,A.i18n=s,A.ready=m,m)return A;if(!m&&!h)return A;throw new Promise((function(e){ho(s,p,(function(){e()}))}))}var wo={};!function(e,t,n,r){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(t),a=i(n),s=i(r),l=function(e,t,n){return{endTime:t,insertTime:n,type:"exponentialRampToValue",value:e}},c=function(e,t,n){return{endTime:t,insertTime:n,type:"linearRampToValue",value:e}},u=function(e,t){return{startTime:t,type:"setValue",value:e}},d=function(e,t,n){return{duration:n,startTime:t,type:"setValueCurve",values:e}},h=function(e,t,n){var r=n.startTime,i=n.target,o=n.timeConstant;return i+(t-i)*Math.exp((r-e)/o)},f=function(e){return"exponentialRampToValue"===e.type},p=function(e){return"linearRampToValue"===e.type},m=function(e){return f(e)||p(e)},g=function(e){return"setValue"===e.type},v=function(e){return"setValueCurve"===e.type},b=function e(t,n,r,i){var o=t[n];return void 0===o?i:m(o)||g(o)?o.value:v(o)?o.values[o.values.length-1]:h(r,e(t,n-1,o.startTime,i),o)},y=function(e,t,n,r,i){return void 0===n?[r.insertTime,i]:m(n)?[n.endTime,n.value]:g(n)?[n.startTime,n.value]:v(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,b(e,t-1,n.startTime,i)]},w=function(e){return"cancelAndHold"===e.type},S=function(e){return"cancelScheduledValues"===e.type},x=function(e){return w(e)||S(e)?e.cancelTime:f(e)||p(e)?e.endTime:e.startTime},M=function(e,t,n,r){var i=r.endTime,o=r.value;return n===o?o:0<n&&0<o||n<0&&o<0?n*Math.pow(o/n,(e-t)/(i-t)):0},_=function(e,t,n,r){return n+(e-t)/(r.endTime-t)*(r.value-n)},A=function(e,t){var n=Math.floor(t),r=Math.ceil(t);return n===r?e[n]:(1-(t-n))*e[n]+(1-(r-t))*e[r]},E=function(e,t){var n=t.duration,r=t.startTime,i=t.values,o=(e-r)/n*(i.length-1);return A(i,o)},C=function(e){return"setTarget"===e.type},T=function(e){function t(e){a.default(this,t),this._automationEvents=[],this._currenTime=0,this._defaultValue=e}return s.default(t,[{key:e,value:function(){return this._automationEvents[Symbol.iterator]()}},{key:"add",value:function(e){var t=x(e);if(w(e)||S(e)){var n=this._automationEvents.findIndex((function(n){return S(e)&&v(n)?n.startTime+n.duration>=t:x(n)>=t})),r=this._automationEvents[n];if(-1!==n&&(this._automationEvents=this._automationEvents.slice(0,n)),w(e)){var i=this._automationEvents[this._automationEvents.length-1];if(void 0!==r&&m(r)){if(C(i))throw new Error("The internal list is malformed.");var o=v(i)?i.startTime+i.duration:x(i),a=v(i)?i.values[i.values.length-1]:i.value,s=f(r)?M(t,o,a,r):_(t,o,a,r),h=f(r)?l(s,t,this._currenTime):c(s,t,this._currenTime);this._automationEvents.push(h)}void 0!==i&&C(i)&&this._automationEvents.push(u(this.getValue(t),t)),void 0!==i&&v(i)&&i.startTime+i.duration>t&&(this._automationEvents[this._automationEvents.length-1]=d(new Float32Array([6,7]),i.startTime,t-i.startTime))}}else{var g=this._automationEvents.findIndex((function(e){return x(e)>t})),b=-1===g?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[g-1];if(void 0!==b&&v(b)&&x(b)+b.duration>t)return!1;var y=f(e)?l(e.value,e.endTime,this._currenTime):p(e)?c(e.value,t,this._currenTime):e;if(-1===g)this._automationEvents.push(y);else{if(v(e)&&t+e.duration>x(this._automationEvents[g]))return!1;this._automationEvents.splice(g,0,y)}}return!0}},{key:"flush",value:function(e){var t=this._automationEvents.findIndex((function(t){return x(t)>e}));if(t>1){var n=this._automationEvents.slice(t-1),r=n[0];C(r)&&n.unshift(u(b(this._automationEvents,t-2,r.startTime,this._defaultValue),r.startTime)),this._automationEvents=n}}},{key:"getValue",value:function(e){if(0===this._automationEvents.length)return this._defaultValue;var t=this._automationEvents.findIndex((function(t){return x(t)>e})),n=this._automationEvents[t],r=(-1===t?this._automationEvents.length:t)-1,i=this._automationEvents[r];if(void 0!==i&&C(i)&&(void 0===n||!m(n)||n.insertTime>e))return h(e,b(this._automationEvents,r-1,i.startTime,this._defaultValue),i);if(void 0!==i&&g(i)&&(void 0===n||!m(n)))return i.value;if(void 0!==i&&v(i)&&(void 0===n||!m(n)||i.startTime+i.duration>e))return e<i.startTime+i.duration?E(e,i):i.values[i.values.length-1];if(void 0!==i&&m(i)&&(void 0===n||!m(n)))return i.value;if(void 0!==n&&f(n)){var a=y(this._automationEvents,r,i,n,this._defaultValue),s=o.default(a,2),l=s[0],c=s[1];return M(e,l,c,n)}if(void 0!==n&&p(n)){var u=y(this._automationEvents,r,i,n,this._defaultValue),d=o.default(u,2),w=d[0],S=d[1];return _(e,w,S,n)}return this._defaultValue}}]),t}(Symbol.iterator),I=function(e){return{cancelTime:e,type:"cancelAndHold"}},k=function(e){return{cancelTime:e,type:"cancelScheduledValues"}},R=function(e,t){return{endTime:t,type:"exponentialRampToValue",value:e}},O=function(e,t){return{endTime:t,type:"linearRampToValue",value:e}},P=function(e,t,n){return{startTime:t,target:e,timeConstant:n,type:"setTarget"}};e.AutomationEventList=T,e.createCancelAndHoldAutomationEvent=I,e.createCancelScheduledValuesAutomationEvent=k,e.createExponentialRampToValueAutomationEvent=R,e.createLinearRampToValueAutomationEvent=O,e.createSetTargetAutomationEvent=P,e.createSetValueAutomationEvent=u,e.createSetValueCurveAutomationEvent=d,Object.defineProperty(e,"__esModule",{value:!0})}(wo,o("hcaHr"),o("ffgrs"),o("22y1y"));const So=new WeakSet,xo=new WeakMap,Mo=new WeakMap,_o=new WeakMap,Ao=new WeakMap,Eo=new WeakMap,Co=new WeakMap,To=new WeakMap,Io=new WeakMap,ko=new WeakMap,Ro={construct:()=>Ro},Oo=e=>{try{new new Proxy(e,Ro)}catch{return!1}return!0},Po=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,No=(e,t)=>{const n=[];let r=e.replace(/^[\s]+/,""),i=r.match(Po);for(;null!==i;){const e=i[1].slice(1,-1),o=i[0].replace(/([\s]+)?;?$/,"").replace(e,new URL(e,t).toString());n.push(o),r=r.slice(i[0].length).replace(/^[\s]+/,""),i=r.match(Po)}return[n.join(";"),r]},Bo=e=>{if(void 0!==e&&!Array.isArray(e))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},Lo=e=>{if(!Oo(e))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===e.prototype||"object"!=typeof e.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},Do=(e,t)=>{const n=e.get(t);if(void 0===n)throw new Error("A value with the given key could not be found.");return n},Uo=(e,t)=>{const n=Array.from(e).filter(t);if(n.length>1)throw Error("More than one element was found.");if(0===n.length)throw Error("No element was found.");const[r]=n;return e.delete(r),r},Fo=(e,t,n,r)=>{const i=Do(e,t),o=Uo(i,(e=>e[0]===n&&e[1]===r));return 0===i.size&&e.delete(t),o},zo=e=>Do(Co,e),jo=e=>{if(So.has(e))throw new Error("The AudioNode is already stored.");So.add(e),zo(e).forEach((e=>e(!0)))},Ho=e=>"port"in e,Go=e=>{if(!So.has(e))throw new Error("The AudioNode is not stored.");So.delete(e),zo(e).forEach((e=>e(!1)))},Vo=(e,t)=>{!Ho(e)&&t.every((e=>0===e.size))&&Go(e)},Wo={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},qo=(e,t)=>e.context===t,Ko=e=>{try{e.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},Jo=()=>new DOMException("","IndexSizeError"),Qo=e=>{var t;e.getChannelData=(t=e.getChannelData,n=>{try{return t.call(e,n)}catch(e){if(12===e.code)throw Jo();throw e}})},Xo={numberOfChannels:1},Yo=-34028234663852886e22,Zo=34028234663852886e22,$o=e=>So.has(e),ea={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},ta=e=>"playbackRate"in e,na=e=>"frequency"in e&&"gain"in e,ra=e=>"offset"in e,ia=e=>!("frequency"in e)&&"gain"in e,oa=e=>"detune"in e&&"frequency"in e,aa=e=>"pan"in e,sa=e=>Do(xo,e),la=e=>Do(_o,e),ca=(e,t)=>{const{activeInputs:n}=sa(e);n.forEach((n=>n.forEach((([n])=>{t.includes(e)||ca(n,[...t,e])}))));const r=ta(e)?[e.playbackRate]:Ho(e)?Array.from(e.parameters.values()):na(e)?[e.Q,e.detune,e.frequency,e.gain]:ra(e)?[e.offset]:ia(e)?[e.gain]:oa(e)?[e.detune,e.frequency]:aa(e)?[e.pan]:[];for(const e of r){const n=la(e);void 0!==n&&n.activeInputs.forEach((([e])=>ca(e,t)))}$o(e)&&Go(e)},ua=e=>{ca(e.destination,[])},da=e=>void 0===e||"number"==typeof e||"string"==typeof e&&("balanced"===e||"interactive"===e||"playback"===e),ha=e=>"context"in e,fa=e=>ha(e[0]),pa=(e,t,n,r)=>{for(const t of e)if(n(t)){if(r)return!1;throw Error("The set contains at least one similar element.")}return e.add(t),!0},ma=(e,t,[n,r],i)=>{pa(e,[t,n,r],(e=>e[0]===t&&e[1]===n),i)},ga=(e,[t,n,r],i)=>{const o=e.get(t);void 0===o?e.set(t,new Set([[n,r]])):pa(o,[n,r],(e=>e[0]===n),i)},va=e=>"inputs"in e,ba=(e,t,n,r)=>{if(va(t)){const i=t.inputs[r];return e.connect(i,n,0),[i,n,0]}return e.connect(t,n,r),[t,n,r]},ya=(e,t,n)=>{for(const r of e)if(r[0]===t&&r[1]===n)return e.delete(r),r;return null},wa=(e,t,n)=>Uo(e,(e=>e[0]===t&&e[1]===n)),Sa=(e,t)=>{if(!zo(e).delete(t))throw new Error("Missing the expected event listener.")},xa=(e,t,n)=>{const r=Do(e,t),i=Uo(r,(e=>e[0]===n));return 0===r.size&&e.delete(t),i},Ma=(e,t,n,r)=>{va(t)?e.disconnect(t.inputs[r],n,0):e.disconnect(t,n,r)},_a=e=>Do(Mo,e),Aa=e=>Do(Ao,e),Ea=e=>To.has(e),Ca=e=>!So.has(e),Ta=(e,t)=>new Promise((n=>{if(null!==t)n(!0);else{const t=e.createScriptProcessor(256,1,1),r=e.createGain(),i=e.createBuffer(1,2,44100),o=i.getChannelData(0);o[0]=1,o[1]=1;const a=e.createBufferSource();a.buffer=i,a.loop=!0,a.connect(t).connect(e.destination),a.connect(r),a.disconnect(r),t.onaudioprocess=r=>{const i=r.inputBuffer.getChannelData(0);Array.prototype.some.call(i,(e=>1===e))?n(!0):n(!1),a.stop(),t.onaudioprocess=null,a.disconnect(t),t.disconnect(e.destination)},a.start()}})),Ia=(e,t)=>{const n=new Map;for(const t of e)for(const e of t){const t=n.get(e);n.set(e,void 0===t?1:t+1)}n.forEach(((e,n)=>t(n,e)))},ka=e=>"context"in e,Ra=e=>{const t=new Map;var n,r;e.connect=(n=e.connect.bind(e),(e,r=0,i=0)=>{const o=ka(e)?n(e,r,i):n(e,r),a=t.get(e);return void 0===a?t.set(e,[{input:i,output:r}]):a.every((e=>e.input!==i||e.output!==r))&&a.push({input:i,output:r}),o}),e.disconnect=(r=e.disconnect,(n,i,o)=>{if(r.apply(e),void 0===n)t.clear();else if("number"==typeof n)for(const[e,r]of t){const i=r.filter((e=>e.output!==n));0===i.length?t.delete(e):t.set(e,i)}else if(t.has(n))if(void 0===i)t.delete(n);else{const e=t.get(n);if(void 0!==e){const r=e.filter((e=>e.output!==i&&(e.input!==o||void 0===o)));0===r.length?t.delete(n):t.set(n,r)}}for(const[n,r]of t)r.forEach((t=>{ka(n)?e.connect(n,t.output,t.input):e.connect(n,t.output)}))})},Oa=(e,t,n,r)=>{const{activeInputs:i,passiveInputs:o}=la(t),{outputs:a}=sa(e),s=zo(e),l=a=>{const s=_a(e),l=Aa(t);if(a){const t=xa(o,e,n);ma(i,e,t,!1),r||Ea(e)||s.connect(l,n)}else{const t=wa(i,e,n);ga(o,t,!1),r||Ea(e)||s.disconnect(l,n)}};return!!pa(a,[t,n],(e=>e[0]===t&&e[1]===n),!0)&&(s.add(l),$o(e)?ma(i,e,[n,l],!0):ga(o,[e,n,l],!0),!0)},Pa=(e,t,n,r,i)=>{const[o,a]=((e,t,n,r)=>{const{activeInputs:i,passiveInputs:o}=sa(t),a=ya(i[r],e,n);if(null===a)return[Fo(o,e,n,r)[2],!1];return[a[2],!0]})(e,n,r,i);if(null!==o&&(Sa(e,o),!a||t||Ea(e)||Ma(_a(e),_a(n),r,i)),$o(n)){const{activeInputs:e}=sa(n);Vo(n,e)}},Na=(e,t,n,r)=>{const[i,o]=((e,t,n)=>{const{activeInputs:r,passiveInputs:i}=la(t),o=ya(r,e,n);if(null===o)return[xa(i,e,n)[1],!1];return[o[2],!0]})(e,n,r);null!==i&&(Sa(e,i),!o||t||Ea(e)||_a(e).disconnect(Aa(n),r))};class Ba{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach(((n,r)=>e.call(t,n,r,this)))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}}const La={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}};function Da(e,t,n,r,i){if("function"==typeof e.copyFromChannel)0===t[n].byteLength&&(t[n]=new Float32Array(128)),e.copyFromChannel(t[n],r,i);else{const o=e.getChannelData(r);if(0===t[n].byteLength)t[n]=o.slice(i,i+128);else{const e=new Float32Array(o.buffer,i*Float32Array.BYTES_PER_ELEMENT,128);t[n].set(e)}}}const Ua=(e,t,n,r,i)=>{"function"==typeof e.copyToChannel?0!==t[n].byteLength&&e.copyToChannel(t[n],r,i):0!==t[n].byteLength&&e.getChannelData(r).set(t[n],i)},Fa=(e,t)=>{const n=[];for(let r=0;r<e;r+=1){const e=[],i="number"==typeof t?t:t[r];for(let t=0;t<i;t+=1)e.push(new Float32Array(128));n.push(e)}return n},za=(e,t)=>{const n=Do(ko,e),r=_a(t);return Do(n,r)},ja=async(e,t,n,r,i,o,a)=>{const s=null===t?128*Math.ceil(e.context.length/128):t.length,l=r.channelCount*r.numberOfInputs,c=i.reduce(((e,t)=>e+t),0),u=0===c?null:n.createBuffer(c,s,n.sampleRate);if(void 0===o)throw new Error("Missing the processor constructor.");const d=sa(e),h=await za(n,e),f=Fa(r.numberOfInputs,r.channelCount),p=Fa(r.numberOfOutputs,i),m=Array.from(e.parameters.keys()).reduce(((e,t)=>({...e,[t]:new Float32Array(128)})),{});for(let c=0;c<s;c+=128){if(r.numberOfInputs>0&&null!==t)for(let e=0;e<r.numberOfInputs;e+=1)for(let n=0;n<r.channelCount;n+=1)Da(t,f[e],n,n,c);void 0!==o.parameterDescriptors&&null!==t&&o.parameterDescriptors.forEach((({name:e},n)=>{Da(t,m,e,l+n,c)}));for(let e=0;e<r.numberOfInputs;e+=1)for(let t=0;t<i[e];t+=1)0===p[e][t].byteLength&&(p[e][t]=new Float32Array(128));try{const e=f.map(((e,t)=>0===d.activeInputs[t].size?[]:e)),t=a(c/n.sampleRate,n.sampleRate,(()=>h.process(e,p,m)));if(null!==u)for(let e=0,t=0;e<r.numberOfOutputs;e+=1){for(let n=0;n<i[e];n+=1)Ua(u,p[e],n,t+n,c);t+=i[e]}if(!t)break}catch(t){e.dispatchEvent(new ErrorEvent("processorerror",{colno:t.colno,filename:t.filename,lineno:t.lineno,message:t.message}));break}}return u},Ha={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},Ga={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},Va={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},Wa={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},qa={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},Ka=e=>{const{port1:t,port2:n}=new MessageChannel;return new Promise((r=>{const i=()=>{n.onmessage=null,t.close(),n.close(),r()};n.onmessage=()=>i();try{t.postMessage(e,[e])}finally{i()}}))},Ja={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},Qa=e=>"delayTime"in e,Xa=(e,t,n)=>{const r=t[n];if(void 0===r)throw e();return r},Ya={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},Za={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},$a=()=>new DOMException("","InvalidStateError"),es=()=>new DOMException("","InvalidAccessError"),ts=e=>{var t;e.getFrequencyResponse=(t=e.getFrequencyResponse,(n,r,i)=>{if(n.length!==r.length||r.length!==i.length)throw es();return t.call(e,n,r,i)})},ns={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},rs=(e,t,n,r,i,o,a,s,l,c,u)=>{const d=c.length;let h=s;for(let s=0;s<d;s+=1){let d=n[0]*c[s];for(let t=1;t<i;t+=1){const r=h-t&l-1;d+=n[t]*o[r],d-=e[t]*a[r]}for(let e=i;e<r;e+=1)d+=n[e]*o[h-e&l-1];for(let n=i;n<t;n+=1)d-=e[n]*a[h-n&l-1];o[h]=c[s],a[h]=d,h=h+1&l-1,u[s]=d}return h},is={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},os=e=>{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const n=e.decodeAudioData(t.buffer,(()=>{}));return void 0!==n&&(n.catch((()=>{})),!0)}catch{}return!1},as={numberOfChannels:1},ss=(e,t,n)=>{const r=t[n];void 0!==r&&r!==e[n]&&(e[n]=r)},ls=(e,t)=>{ss(e,t,"channelCount"),ss(e,t,"channelCountMode"),ss(e,t,"channelInterpretation")},cs=e=>"function"==typeof e.getFloatTimeDomainData,us=(e,t,n)=>{const r=t[n];void 0!==r&&r!==e[n].value&&(e[n].value=r)},ds=e=>{e.start=(t=>{let n=!1;return(r=0,i=0,o)=>{if(n)throw $a();t.call(e,r,i,o),n=!0}})(e.start)},hs=e=>{var t;e.start=(t=e.start,(n=0,r=0,i)=>{if("number"==typeof i&&i<0||r<0||n<0)throw new RangeError("The parameters can't be negative.");t.call(e,n,r,i)})},fs=e=>{var t;e.stop=(t=e.stop,(n=0)=>{if(n<0)throw new RangeError("The parameter can't be negative.");t.call(e,n)})},ps=e=>{const{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}},ms=(e,t)=>null===e?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(e*t))))),gs=e=>new Promise(((t,n)=>{const{port1:r,port2:i}=new MessageChannel;r.onmessage=({data:e})=>{r.close(),i.close(),t(e)},r.onmessageerror=({data:e})=>{r.close(),i.close(),n(e)},i.postMessage(e)})),vs=async(e,t)=>new e(await gs(t)),bs=(e,t,n,r)=>{let i=ko.get(e);void 0===i&&(i=new WeakMap,ko.set(e,i));const o=vs(n,r);return i.set(t,o),o},ys=(e,t)=>{const n=e.createBiquadFilter();return ls(n,t),us(n,t,"Q"),us(n,t,"detune"),us(n,t,"frequency"),us(n,t,"gain"),ss(n,t,"type"),n},ws=e=>{const t=e.numberOfOutputs;Object.defineProperty(e,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw $a()}}),Object.defineProperty(e,"channelCountMode",{get:()=>"explicit",set:e=>{if("explicit"!==e)throw $a()}}),Object.defineProperty(e,"channelInterpretation",{get:()=>"discrete",set:e=>{if("discrete"!==e)throw $a()}})},Ss=(e,t)=>{const n=e.createChannelSplitter(t.numberOfOutputs);return ls(n,t),ws(n),n},xs=(e,t)=>(e.connect=t.connect.bind(t),e.disconnect=t.disconnect.bind(t),e),Ms=(e,t)=>{const n=e.createDelay(t.maxDelayTime);return ls(n,t),us(n,t,"delayTime"),n},_s=(e,t)=>{const n=e.createGain();return ls(n,t),us(n,t,"gain"),n};function As(e,t){const n=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/n,(e[1]*t[0]-e[0]*t[1])/n]}function Es(e,t){let n=[0,0];for(let o=e.length-1;o>=0;o-=1)i=t,n=[(r=n)[0]*i[0]-r[1]*i[1],r[0]*i[1]+r[1]*i[0]],n[0]+=e[o];var r,i;return n}const Cs=(e,t,n,r)=>e.createScriptProcessor(t,n,r),Ts=()=>new DOMException("","NotSupportedError"),Is={numberOfChannels:1},ks={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},Rs={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},Os={disableNormalization:!1},Ps={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},Ns=()=>new DOMException("","UnknownError"),Bs={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},Ls=(e,t,n)=>void 0===e.copyFromChannel?e.getChannelData(n)[0]:(e.copyFromChannel(t,n),t[0]),Ds=e=>{if(null===e)return!1;const t=e.length;return t%2!=0?0!==e[Math.floor(t/2)]:e[t/2-1]+e[t/2]!==0},Us=(e,t,n,r)=>{let i=e;for(;!i.hasOwnProperty(t);)i=Object.getPrototypeOf(i);const{get:o,set:a}=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,{get:n(o),set:r(a)})},Fs=(e,t,n)=>{try{e.setValueAtTime(t,n)}catch(r){if(9!==r.code)throw r;Fs(e,t,n+1e-7)}},zs=e=>{const t=e.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},js=e=>{const t=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=t,n.start(),n.stop();try{return n.stop(),!0}catch{return!1}},Hs=e=>{const t=e.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},Gs=(e,t)=>{const n=t.createGain();e.connect(n);const r=(i=e.disconnect,()=>{i.call(e,n),e.removeEventListener("ended",r)});var i;e.addEventListener("ended",r),xs(e,n),e.stop=(t=>{let r=!1;return(i=0)=>{if(r)try{t.call(e,i)}catch{n.gain.setValueAtTime(0,i)}else t.call(e,i),r=!0}})(e.stop)},Vs=(e,t)=>n=>{const r={value:e};return Object.defineProperties(n,{currentTarget:r,target:r}),"function"==typeof t?t.call(e,n):t.handleEvent.call(e,n)},Ws=(qs=pa,(e,t,[n,r,i],o)=>{qs(e[r],[t,n,i],(e=>e[0]===t&&e[1]===n),o)});var qs;const Ks=(e=>(t,n,[r,i,o],a)=>{const s=t.get(r);void 0===s?t.set(r,new Set([[i,n,o]])):e(s,[i,n,o],(e=>e[0]===i&&e[1]===n),a)})(pa),Js=(Qs=Uo,(e,t,n,r)=>Qs(e[r],(e=>e[0]===t&&e[1]===n)));var Qs;const Xs=new WeakMap,Ys=(Zs=Xs,e=>{var t;return null!==(t=Zs.get(e))&&void 0!==t?t:0});var Zs;const $s=(el=new Map,tl=new WeakMap,(e,t)=>{const n=tl.get(e);if(void 0!==n)return n;const r=el.get(e);if(void 0!==r)return r;try{const n=t();return n instanceof Promise?(el.set(e,n),n.catch((()=>!1)).then((t=>(el.delete(e),tl.set(e,t),t)))):(tl.set(e,n),n)}catch{return tl.set(e,!1),!1}});var el,tl;const nl="undefined"==typeof window?null:window,rl=(il=$s,ol=Jo,(e,t)=>{const n=e.createAnalyser();if(ls(n,t),!(t.maxDecibels>t.minDecibels))throw ol();return ss(n,t,"fftSize"),ss(n,t,"maxDecibels"),ss(n,t,"minDecibels"),ss(n,t,"smoothingTimeConstant"),il(cs,(()=>cs(n)))||(e=>{e.getFloatTimeDomainData=t=>{const n=new Uint8Array(t.length);e.getByteTimeDomainData(n);const r=Math.max(n.length,e.fftSize);for(let e=0;e<r;e+=1)t[e]=.0078125*(n[e]-128);return t}})(n),n});var il,ol;const al=(sl=sa,e=>{const t=sl(e);if(null===t.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return t.renderer});var sl;const ll=((e,t,n)=>async(r,i,o)=>{const a=e(r);await Promise.all(a.activeInputs.map(((e,a)=>Array.from(e).map((async([e,s])=>{const l=t(e),c=await l.render(e,i),u=r.context.destination;n(e)||r===u&&n(r)||c.connect(o,s,a)})))).reduce(((e,t)=>[...e,...t]),[]))})(sa,al,Ea),cl=(ul=rl,dl=_a,hl=ll,()=>{const e=new WeakMap;return{render(t,n){const r=e.get(n);return void 0!==r?Promise.resolve(r):(async(t,n)=>{let r=dl(t);if(!qo(r,n)){const e={channelCount:r.channelCount,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,fftSize:r.fftSize,maxDecibels:r.maxDecibels,minDecibels:r.minDecibels,smoothingTimeConstant:r.smoothingTimeConstant};r=ul(n,e)}return e.set(n,r),await hl(t,n,r),r})(t,n)}}});var ul,dl,hl;const fl=(pl=Eo,e=>{const t=pl.get(e);if(void 0===t)throw $a();return t});var pl;const ml=(e=>null===e?null:e.hasOwnProperty("OfflineAudioContext")?e.OfflineAudioContext:e.hasOwnProperty("webkitOfflineAudioContext")?e.webkitOfflineAudioContext:null)(nl),gl=(vl=ml,e=>null!==vl&&e instanceof vl);var vl;const bl=new WeakMap,yl=(wl=Vs,class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(e,t,n){if(null!==t){let r=this._listeners.get(t);void 0===r&&(r=wl(this,t),"function"==typeof t&&this._listeners.set(t,r)),this._nativeEventTarget.addEventListener(e,r,n)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,t,n){const r=null===t?void 0:this._listeners.get(t);this._nativeEventTarget.removeEventListener(e,void 0===r?null:r,n)}});var wl;const Sl=(e=>null===e?null:e.hasOwnProperty("AudioContext")?e.AudioContext:e.hasOwnProperty("webkitAudioContext")?e.webkitAudioContext:null)(nl),xl=(Ml=Sl,e=>null!==Ml&&e instanceof Ml);var Ml;const _l=(e=>t=>null!==e&&"function"==typeof e.AudioNode&&t instanceof e.AudioNode)(nl),Al=(e=>t=>null!==e&&"function"==typeof e.AudioParam&&t instanceof e.AudioParam)(nl),El=(e=>null===e?null:e.hasOwnProperty("AudioWorkletNode")?e.AudioWorkletNode:null)(nl),Cl=((e,t,n,r,i,o,a,s,l,c,u,d,h,f,p,m)=>class extends c{constructor(t,r,i,o){super(i),this._context=t,this._nativeAudioNode=i;const a=u(t);d(a)&&!0!==n(Ta,(()=>Ta(a,m)))&&Ra(i),Mo.set(this,i),Co.set(this,new Set),"closed"!==t.state&&r&&jo(this),e(this,o,i)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(e){this._nativeAudioNode.channelCount=e}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(e){this._nativeAudioNode.channelCountMode=e}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(e){this._nativeAudioNode.channelInterpretation=e}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(e,n=0,s=0){if(n<0||n>=this._nativeAudioNode.numberOfOutputs)throw i();const c=u(this._context),d=p(c);if(h(e)||f(e))throw o();if(ha(e)){const i=_a(e);try{const t=ba(this._nativeAudioNode,i,n,s),r=Ca(this);(d||r)&&this._nativeAudioNode.disconnect(...t),"closed"!==this.context.state&&!r&&Ca(e)&&jo(e)}catch(e){if(12===e.code)throw o();throw e}if(t(this,e,n,s,d)){const t=l([this],e);Ia(t,r(d))}return e}const m=Aa(e);if("playbackRate"===m.name&&1024===m.maxValue)throw a();try{this._nativeAudioNode.connect(m,n),(d||Ca(this))&&this._nativeAudioNode.disconnect(m,n)}catch(e){if(12===e.code)throw o();throw e}if(Oa(this,e,n,d)){const t=l([this],e);Ia(t,r(d))}}disconnect(e,t,n){let r;const a=u(this._context),c=p(a);if(void 0===e)r=((e,t)=>{const n=sa(e),r=[];for(const i of n.outputs)fa(i)?Pa(e,t,...i):Na(e,t,...i),r.push(i[0]);return n.outputs.clear(),r})(this,c);else if("number"==typeof e){if(e<0||e>=this.numberOfOutputs)throw i();r=((e,t,n)=>{const r=sa(e),i=[];for(const o of r.outputs)o[1]===n&&(fa(o)?Pa(e,t,...o):Na(e,t,...o),i.push(o[0]),r.outputs.delete(o));return i})(this,c,e)}else{if(void 0!==t&&(t<0||t>=this.numberOfOutputs))throw i();if(ha(e)&&void 0!==n&&(n<0||n>=e.numberOfInputs))throw i();if(r=((e,t,n,r,i)=>{const o=sa(e);return Array.from(o.outputs).filter((e=>!(e[0]!==n||void 0!==r&&e[1]!==r||void 0!==i&&e[2]!==i))).map((n=>(fa(n)?Pa(e,t,...n):Na(e,t,...n),o.outputs.delete(n),n[0])))})(this,c,e,t,n),0===r.length)throw o()}for(const e of r){const t=l([this],e);Ia(t,s)}}})((Tl=xo,(e,t,n)=>{const r=[];for(let e=0;e<n.numberOfInputs;e+=1)r.push(new Set);Tl.set(e,{activeInputs:r,outputs:new Set,passiveInputs:new WeakMap,renderer:t})}),((e,t,n,r,i,o,a,s,l,c,u,d,h)=>{const f=new WeakMap;return(p,m,g,v,b)=>{const{activeInputs:y,passiveInputs:w}=o(m),{outputs:S}=o(p),x=s(p),M=o=>{const s=l(m),c=l(p);if(o){const t=Fo(w,p,g,v);e(y,p,t,!1),b||d(p)||n(c,s,g,v),h(m)&&jo(m)}else{const e=r(y,p,g,v);t(w,v,e,!1),b||d(p)||i(c,s,g,v);const n=a(m);if(0===n)u(m)&&Vo(m,y);else{const e=f.get(m);void 0!==e&&clearTimeout(e),f.set(m,setTimeout((()=>{u(m)&&Vo(m,y)}),1e3*n))}}};return!!c(S,[m,g,v],(e=>e[0]===m&&e[1]===g&&e[2]===v),!0)&&(x.add(M),u(p)?e(y,p,[g,v,M],!0):t(w,v,[p,g,M],!0),!0)}})(Ws,Ks,ba,Js,Ma,sa,Ys,zo,_a,pa,$o,Ea,Ca),$s,((e,t,n,r,i,o)=>a=>(s,l)=>{const c=e.get(s);if(void 0===c){if(!a&&o(s)){const e=r(s),{outputs:o}=n(s);for(const n of o)if(fa(n)){const i=r(n[0]);t(e,i,n[1],n[2])}else{const t=i(n[0]);e.disconnect(t,n[1])}}e.set(s,l)}else e.set(s,c+l)})(To,Ma,sa,_a,Aa,$o),Jo,es,Ts,((e,t,n,r,i,o,a,s)=>(l,c)=>{const u=t.get(l);if(void 0===u)throw new Error("Missing the expected cycle count.");const d=o(l.context),h=s(d);if(u===c){if(t.delete(l),!h&&a(l)){const t=r(l),{outputs:o}=n(l);for(const n of o)if(fa(n)){const i=r(n[0]);e(t,i,n[1],n[2])}else{const e=i(n[0]);t.connect(e,n[1])}}}else t.set(l,u-c)})(ba,To,sa,_a,Aa,fl,$o,gl),((e,t,n)=>function r(i,o){const a=ha(o)?o:n(e,o);if(Qa(a))return[];if(i[0]===a)return[i];if(i.includes(a))return[];const{outputs:s}=t(a);return Array.from(s).map((e=>r([...i,a],e[0]))).reduce(((e,t)=>e.concat(t)),[])})(bl,sa,Do),yl,fl,xl,_l,Al,gl,El);var Tl;const Il=((e,t,n,r,i,o)=>class extends e{constructor(e,n){const a=i(e),s={...Wo,...n},l=r(a,s);super(e,!1,l,o(a)?t():null),this._nativeAnalyserNode=l}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(e){this._nativeAnalyserNode.fftSize=e}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(e){const t=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=e,!(e>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=t,n()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(e){const t=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=e,!(this._nativeAnalyserNode.maxDecibels>e))throw this._nativeAnalyserNode.minDecibels=t,n()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(e){this._nativeAnalyserNode.smoothingTimeConstant=e}getByteFrequencyData(e){this._nativeAnalyserNode.getByteFrequencyData(e)}getByteTimeDomainData(e){this._nativeAnalyserNode.getByteTimeDomainData(e)}getFloatFrequencyData(e){this._nativeAnalyserNode.getFloatFrequencyData(e)}getFloatTimeDomainData(e){this._nativeAnalyserNode.getFloatTimeDomainData(e)}})(Cl,cl,Jo,rl,fl,gl),kl=new WeakSet,Rl=(e=>null===e?null:e.hasOwnProperty("AudioBuffer")?e.AudioBuffer:null)(nl),Ol=(Pl=new Uint32Array(1),e=>(Pl[0]=e,Pl[0]));var Pl;const Nl=((e,t)=>n=>{n.copyFromChannel=(r,i,o=0)=>{const a=e(o),s=e(i);if(s>=n.numberOfChannels)throw t();const l=n.length,c=n.getChannelData(s),u=r.length;for(let e=a<0?-a:0;e+a<l&&e<u;e+=1)r[e]=c[e+a]},n.copyToChannel=(r,i,o=0)=>{const a=e(o),s=e(i);if(s>=n.numberOfChannels)throw t();const l=n.length,c=n.getChannelData(s),u=r.length;for(let e=a<0?-a:0;e+a<l&&e<u;e+=1)c[e+a]=r[e]}})(Ol,Jo),Bl=(Ll=Ol,e=>{var t,n;e.copyFromChannel=(t=e.copyFromChannel,(n,r,i=0)=>{const o=Ll(i),a=Ll(r);if(o<e.length)return t.call(e,n,a,o)}),e.copyToChannel=(n=e.copyToChannel,(t,r,i=0)=>{const o=Ll(i),a=Ll(r);if(o<e.length)return n.call(e,t,a,o)})});var Ll;const Dl=((e,t,n,r,i,o,a,s)=>{let l=null;return class c{constructor(c){if(null===i)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:u,numberOfChannels:d,sampleRate:h}={...Xo,...c};null===l&&(l=new i(1,1,44100));const f=null!==r&&t(o,o)?new r({length:u,numberOfChannels:d,sampleRate:h}):l.createBuffer(d,u,h);if(0===f.numberOfChannels)throw n();return"function"!=typeof f.copyFromChannel?(a(f),Qo(f)):t(Ko,(()=>Ko(f)))||s(f),e.add(f),f}static[Symbol.hasInstance](t){return null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===c.prototype||e.has(t)}}})(kl,$s,Ts,Rl,ml,(Ul=Rl,()=>{if(null===Ul)return!1;try{new Ul({length:1,sampleRate:44100})}catch{return!1}return!0}),Nl,Bl);var Ul;const Fl=(zl=_s,(e,t)=>{const n=zl(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(n).connect(e.destination);const r=()=>{t.removeEventListener("ended",r),t.disconnect(n),n.disconnect()};t.addEventListener("ended",r)});var zl;const jl=(Hl=al,Gl=la,Vl=Ea,async(e,t,n)=>{const r=Gl(e);await Promise.all(Array.from(r.activeInputs).map((async([e,r])=>{const i=Hl(e),o=await i.render(e,t);Vl(e)||o.connect(n,r)})))});var Hl,Gl,Vl;const Wl=(ql=jl,(e,t,n)=>ql(t,e,n));var ql;const Kl=((e,t,n,r,i,o,a,s,l,c,u)=>(d,h)=>{const f=d.createBufferSource();return ls(f,h),us(f,h,"playbackRate"),ss(f,h,"buffer"),ss(f,h,"loop"),ss(f,h,"loopEnd"),ss(f,h,"loopStart"),t(n,(()=>n(d)))||ds(f),t(r,(()=>r(d)))||l(f),t(i,(()=>i(d)))||c(f,d),t(o,(()=>o(d)))||hs(f),t(a,(()=>a(d)))||u(f,d),t(s,(()=>s(d)))||fs(f),e(d,f),f})(Fl,$s,(e=>{const t=e.createBufferSource();t.start();try{t.start()}catch{return!0}return!1}),(e=>{const t=e.createBufferSource(),n=e.createBuffer(1,1,44100);t.buffer=n;try{t.start(0,1)}catch{return!1}return!0}),(e=>{const t=e.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0}),zs,js,Hs,(e=>{var t;e.start=(t=e.start,(n=0,r=0,i)=>{const o=e.buffer,a=null===o?r:Math.min(o.duration,r);null!==o&&a>o.duration-.5/e.context.sampleRate?t.call(e,n,0,0):t.call(e,n,a,i)})}),(Jl=Us,(e,t)=>{const n=t.createBuffer(1,1,44100);null===e.buffer&&(e.buffer=n),Jl(e,"buffer",(t=>()=>{const r=t.call(e);return r===n?null:r}),(t=>r=>t.call(e,null===r?n:r)))}),Gs);var Jl;const Ql=((e,t)=>(n,r,i)=>(e(r).replay(i),t(r,n,i)))((e=>t=>{const n=e(t);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer})(la),jl),Xl=((e,t,n,r,i)=>()=>{const o=new WeakMap;let a=null,s=null;return{set start(e){a=e},set stop(e){s=e},render(l,c){const u=o.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=n(l);const d=qo(u,c);if(!d){const e={buffer:u.buffer,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,loop:u.loop,loopEnd:u.loopEnd,loopStart:u.loopStart,playbackRate:u.playbackRate.value};u=t(c,e),null!==a&&u.start(...a),null!==s&&u.stop(s)}return o.set(c,u),d?await e(c,l.playbackRate,u.playbackRate):await r(c,l.playbackRate,u.playbackRate),await i(l,c,u),u})(l,c)}}})(Wl,Kl,_a,Ql,ll),Yl=((e,t,n,r,i,o,a,s,l,c,u,d,h)=>(f,p,m,g=null,v=null)=>{const b=new(0,wo.AutomationEventList)(m.defaultValue),y=p?r(b):null,w={get defaultValue(){return m.defaultValue},get maxValue(){return null===g?m.maxValue:g},get minValue(){return null===v?m.minValue:v},get value(){return m.value},set value(e){m.value=e,w.setValueAtTime(e,f.context.currentTime)},cancelAndHoldAtTime(e){if("function"==typeof m.cancelAndHoldAtTime)null===y&&b.flush(f.context.currentTime),b.add(i(e)),m.cancelAndHoldAtTime(e);else{const t=Array.from(b).pop();null===y&&b.flush(f.context.currentTime),b.add(i(e));const n=Array.from(b).pop();m.cancelScheduledValues(e),t!==n&&void 0!==n&&("exponentialRampToValue"===n.type?m.exponentialRampToValueAtTime(n.value,n.endTime):"linearRampToValue"===n.type?m.linearRampToValueAtTime(n.value,n.endTime):"setValue"===n.type?m.setValueAtTime(n.value,n.startTime):"setValueCurve"===n.type&&m.setValueCurveAtTime(n.values,n.startTime,n.duration))}return w},cancelScheduledValues:e=>(null===y&&b.flush(f.context.currentTime),b.add(o(e)),m.cancelScheduledValues(e),w),exponentialRampToValueAtTime(e,t){if(0===e)throw new RangeError;if(!Number.isFinite(t)||t<0)throw new RangeError;return null===y&&b.flush(f.context.currentTime),b.add(a(e,t)),m.exponentialRampToValueAtTime(e,t),w},linearRampToValueAtTime:(e,t)=>(null===y&&b.flush(f.context.currentTime),b.add(s(e,t)),m.linearRampToValueAtTime(e,t),w),setTargetAtTime:(e,t,n)=>(null===y&&b.flush(f.context.currentTime),b.add(l(e,t,n)),m.setTargetAtTime(e,t,n),w),setValueAtTime:(e,t)=>(null===y&&b.flush(f.context.currentTime),b.add(c(e,t)),m.setValueAtTime(e,t),w),setValueCurveAtTime(e,t,n){const r=e instanceof Float32Array?e:new Float32Array(e);if(null!==d&&"webkitAudioContext"===d.name){const e=t+n,i=f.context.sampleRate,o=Math.ceil(t*i),a=Math.floor(e*i),s=a-o,l=new Float32Array(s);for(let e=0;e<s;e+=1){const a=(r.length-1)/n*((o+e)/i-t),s=Math.floor(a),c=Math.ceil(a);l[e]=s===c?r[s]:(1-(a-s))*r[s]+(1-(c-a))*r[c]}null===y&&b.flush(f.context.currentTime),b.add(u(l,t,n)),m.setValueCurveAtTime(l,t,n);const c=a/i;c<e&&h(w,l[l.length-1],c),h(w,r[r.length-1],e)}else null===y&&b.flush(f.context.currentTime),b.add(u(r,t,n)),m.setValueCurveAtTime(r,t,n);return w}};return n.set(w,m),t.set(w,f),e(w,y),w})((Zl=_o,(e,t)=>{Zl.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:t})}),bl,Ao,(e=>({replay(t){for(const n of e)if("exponentialRampToValue"===n.type){const{endTime:e,value:r}=n;t.exponentialRampToValueAtTime(r,e)}else if("linearRampToValue"===n.type){const{endTime:e,value:r}=n;t.linearRampToValueAtTime(r,e)}else if("setTarget"===n.type){const{startTime:e,target:r,timeConstant:i}=n;t.setTargetAtTime(r,e,i)}else if("setValue"===n.type){const{startTime:e,value:r}=n;t.setValueAtTime(r,e)}else{if("setValueCurve"!==n.type)throw new Error("Can't apply an unknown automation.");{const{duration:e,startTime:r,values:i}=n;t.setValueCurveAtTime(i,r,e)}}}})),wo.createCancelAndHoldAutomationEvent,wo.createCancelScheduledValuesAutomationEvent,wo.createExponentialRampToValueAutomationEvent,wo.createLinearRampToValueAutomationEvent,wo.createSetTargetAutomationEvent,wo.createSetValueAutomationEvent,wo.createSetValueCurveAutomationEvent,Sl,Fs);var Zl;const $l=((e,t,n,r,i,o,a,s)=>class extends e{constructor(e,r){const s=o(e),l={...ea,...r},c=i(s,l),u=a(s),d=u?t():null;super(e,!1,c,d),this._audioBufferSourceNodeRenderer=d,this._isBufferNullified=!1,this._isBufferSet=null!==l.buffer,this._nativeAudioBufferSourceNode=c,this._onended=null,this._playbackRate=n(this,u,c.playbackRate,Zo,Yo)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(e){if(this._nativeAudioBufferSourceNode.buffer=e,null!==e){if(this._isBufferSet)throw r();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(e){this._nativeAudioBufferSourceNode.loop=e}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(e){this._nativeAudioBufferSourceNode.loopEnd=e}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(e){this._nativeAudioBufferSourceNode.loopStart=e}get onended(){return this._onended}set onended(e){const t="function"==typeof e?s(this,e):null;this._nativeAudioBufferSourceNode.onended=t;const n=this._nativeAudioBufferSourceNode.onended;this._onended=null!==n&&n===t?e:n}get playbackRate(){return this._playbackRate}start(e=0,t=0,n){if(this._nativeAudioBufferSourceNode.start(e,t,n),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.start=void 0===n?[e,t]:[e,t,n]),"closed"!==this.context.state){jo(this);const e=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",e),$o(this)&&Go(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeAudioBufferSourceNode.stop(e),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=e)}})(Cl,Xl,Yl,$a,Kl,fl,gl,Vs),ec=((e,t,n,r,i,o,a,s)=>class extends e{constructor(e,n){const r=o(e),l=a(r),c=i(r,n,l);super(e,!1,c,l?t(s):null),this._isNodeOfNativeOfflineAudioContext=l,this._nativeAudioDestinationNode=c}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(e){if(this._isNodeOfNativeOfflineAudioContext)throw r();if(e>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=e}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(e){if(this._isNodeOfNativeOfflineAudioContext)throw r();this._nativeAudioDestinationNode.channelCountMode=e}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}})(Cl,(e=>{const t=new WeakMap;return{render(n,r){const i=t.get(r);return void 0!==i?Promise.resolve(i):(async(n,r)=>{const i=r.destination;return t.set(r,i),await e(n,r,i),i})(n,r)}}}),Jo,$a,((e,t)=>(n,r,i)=>{const o=n.destination;if(o.channelCount!==r)try{o.channelCount=r}catch{}i&&"explicit"!==o.channelCountMode&&(o.channelCountMode="explicit"),0===o.maxChannelCount&&Object.defineProperty(o,"maxChannelCount",{value:r});const a=e(n,{channelCount:r,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,gain:1});return t(a,"channelCount",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t);try{o.channelCount=t}catch(e){if(t>o.maxChannelCount)throw e}})),t(a,"channelCountMode",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),o.channelCountMode=t})),t(a,"channelInterpretation",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),o.channelInterpretation=t})),Object.defineProperty(a,"maxChannelCount",{get:()=>o.maxChannelCount}),a.connect(o),a})(_s,Us),fl,gl,ll),tc=((e,t,n,r,i)=>()=>{const o=new WeakMap;return{render(a,s){const l=o.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=qo(l,s);if(!c){const e={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=t(s,e)}return o.set(s,l),c?(await e(s,a.Q,l.Q),await e(s,a.detune,l.detune),await e(s,a.frequency,l.frequency),await e(s,a.gain,l.gain)):(await r(s,a.Q,l.Q),await r(s,a.detune,l.detune),await r(s,a.frequency,l.frequency),await r(s,a.gain,l.gain)),await i(a,s,l),l})(a,s)}}})(Wl,ys,_a,Ql,ll),nc=(e=>(t,n)=>e.set(t,n))(Xs),rc=(ic=Cl,oc=Yl,ac=tc,sc=es,lc=ys,cc=fl,uc=gl,dc=nc,class extends ic{constructor(e,t){const n=cc(e),r={...Ha,...t},i=lc(n,r),o=uc(n);super(e,!1,i,o?ac():null),this._Q=oc(this,o,i.Q,Zo,Yo),this._detune=oc(this,o,i.detune,1200*Math.log2(Zo),-1200*Math.log2(Zo)),this._frequency=oc(this,o,i.frequency,e.sampleRate/2,0),this._gain=oc(this,o,i.gain,40*Math.log10(Zo),Yo),this._nativeBiquadFilterNode=i,dc(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(e){this._nativeBiquadFilterNode.type=e}getFrequencyResponse(e,t,n){try{this._nativeBiquadFilterNode.getFrequencyResponse(e,t,n)}catch(e){if(11===e.code)throw sc();throw e}if(e.length!==t.length||t.length!==n.length)throw sc()}});var ic,oc,ac,sc,lc,cc,uc,dc;const hc=((e,t)=>(n,r,i)=>{const o=new Set;var a,s;return n.connect=(a=n.connect,(i,s=0,l=0)=>{const c=0===o.size;if(t(i))return a.call(n,i,s,l),e(o,[i,s,l],(e=>e[0]===i&&e[1]===s&&e[2]===l),!0),c&&r(),i;a.call(n,i,s),e(o,[i,s],(e=>e[0]===i&&e[1]===s),!0),c&&r()}),n.disconnect=(s=n.disconnect,(e,r,a)=>{const l=o.size>0;if(void 0===e)s.apply(n),o.clear();else if("number"==typeof e){s.call(n,e);for(const t of o)t[1]===e&&o.delete(t)}else{t(e)?s.call(n,e,r,a):s.call(n,e,r);for(const t of o)t[0]!==e||void 0!==r&&t[1]!==r||void 0!==a&&t[2]!==a||o.delete(t)}const c=0===o.size;l&&c&&i()}),n})(pa,_l),fc=(pc=$a,mc=hc,(e,t)=>{t.channelCount=1,t.channelCountMode="explicit",Object.defineProperty(t,"channelCount",{get:()=>1,set:()=>{throw pc()}}),Object.defineProperty(t,"channelCountMode",{get:()=>"explicit",set:()=>{throw pc()}});const n=e.createBufferSource();mc(t,(()=>{const e=t.numberOfInputs;for(let r=0;r<e;r+=1)n.connect(t,0,r)}),(()=>n.disconnect(t)))});var pc,mc;const gc=((e,t)=>(n,r)=>{const i=n.createChannelMerger(r.numberOfInputs);return null!==e&&"webkitAudioContext"===e.name&&t(n,i),ls(i,r),i})(Sl,fc),vc=((e,t,n)=>()=>{const r=new WeakMap;return{render(i,o){const a=r.get(o);return void 0!==a?Promise.resolve(a):(async(i,o)=>{let a=t(i);if(!qo(a,o)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=e(o,t)}return r.set(o,a),await n(i,o,a),a})(i,o)}}})(gc,_a,ll),bc=((e,t,n,r,i)=>class extends e{constructor(e,o){const a=r(e),s={...Ga,...o};super(e,!1,n(a,s),i(a)?t():null)}})(Cl,vc,gc,fl,gl),yc=((e,t,n)=>()=>{const r=new WeakMap;return{render(i,o){const a=r.get(o);return void 0!==a?Promise.resolve(a):(async(i,o)=>{let a=t(i);if(!qo(a,o)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=e(o,t)}return r.set(o,a),await n(i,o,a),a})(i,o)}}})(Ss,_a,ll),wc=((e,t,n,r,i,o)=>class extends e{constructor(e,a){const s=r(e),l=o({...Va,...a});super(e,!1,n(s,l),i(s)?t():null)}})(Cl,yc,Ss,fl,gl,(e=>({...e,channelCount:e.numberOfOutputs}))),Sc=((e,t,n,r)=>(i,{offset:o,...a})=>{const s=i.createBuffer(1,2,44100),l=t(i,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),c=n(i,{...a,gain:o}),u=s.getChannelData(0);u[0]=1,u[1]=1,l.buffer=s,l.loop=!0;const d={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){c.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){c.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){c.channelInterpretation=e},get context(){return c.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get offset(){return c.gain},get onended(){return l.onended},set onended(e){l.onended=e},addEventListener:(...e)=>l.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>l.dispatchEvent(e[0]),removeEventListener:(...e)=>l.removeEventListener(e[0],e[1],e[2]),start(e=0){l.start.call(l,e)},stop(e=0){l.stop.call(l,e)}};return e(i,l),r(xs(d,c),(()=>l.connect(c)),(()=>l.disconnect(c)))})(Fl,Kl,_s,hc),xc=((e,t,n,r,i)=>(o,a)=>{if(void 0===o.createConstantSource)return n(o,a);const s=o.createConstantSource();return ls(s,a),us(s,a,"offset"),t(r,(()=>r(o)))||hs(s),t(i,(()=>i(o)))||fs(s),e(o,s),s})(Fl,$s,Sc,zs,Hs),Mc=((e,t,n,r,i)=>()=>{const o=new WeakMap;let a=null,s=null;return{set start(e){a=e},set stop(e){s=e},render(l,c){const u=o.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=n(l);const d=qo(u,c);if(!d){const e={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,offset:u.offset.value};u=t(c,e),null!==a&&u.start(a),null!==s&&u.stop(s)}return o.set(c,u),d?await e(c,l.offset,u.offset):await r(c,l.offset,u.offset),await i(l,c,u),u})(l,c)}}})(Wl,xc,_a,Ql,ll),_c=((e,t,n,r,i,o,a)=>class extends e{constructor(e,a){const s=i(e),l={...Wa,...a},c=r(s,l),u=o(s),d=u?n():null;super(e,!1,c,d),this._constantSourceNodeRenderer=d,this._nativeConstantSourceNode=c,this._offset=t(this,u,c.offset,Zo,Yo),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(this,e):null;this._nativeConstantSourceNode.onended=t;const n=this._nativeConstantSourceNode.onended;this._onended=null!==n&&n===t?e:n}start(e=0){if(this._nativeConstantSourceNode.start(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=e),"closed"!==this.context.state){jo(this);const e=()=>{this._nativeConstantSourceNode.removeEventListener("ended",e),$o(this)&&Go(this)};this._nativeConstantSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeConstantSourceNode.stop(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=e)}})(Cl,Yl,Mc,xc,fl,gl,Vs),Ac=((e,t)=>(n,r)=>{const i=n.createConvolver();if(ls(i,r),r.disableNormalization===i.normalize&&(i.normalize=!r.disableNormalization),ss(i,r,"buffer"),r.channelCount>2)throw e();if(t(i,"channelCount",(e=>()=>e.call(i)),(t=>n=>{if(n>2)throw e();return t.call(i,n)})),"max"===r.channelCountMode)throw e();return t(i,"channelCountMode",(e=>()=>e.call(i)),(t=>n=>{if("max"===n)throw e();return t.call(i,n)})),i})(Ts,Us),Ec=((e,t,n)=>()=>{const r=new WeakMap;return{render(i,o){const a=r.get(o);return void 0!==a?Promise.resolve(a):(async(i,o)=>{let a=t(i);if(!qo(a,o)){const t={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=e(o,t)}return r.set(o,a),va(a)?await n(i,o,a.inputs[0]):await n(i,o,a),a})(i,o)}}})(Ac,_a,ll),Cc=((e,t,n,r,i,o)=>class extends e{constructor(e,a){const s=r(e),l={...qa,...a},c=n(s,l);super(e,!1,c,i(s)?t():null),this._isBufferNullified=!1,this._nativeConvolverNode=c,null!==l.buffer&&o(this,l.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(e){if(this._nativeConvolverNode.buffer=e,null===e&&null!==this._nativeConvolverNode.buffer){const e=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=e.createBuffer(1,1,e.sampleRate),this._isBufferNullified=!0,o(this,0)}else this._isBufferNullified=!1,o(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(e){this._nativeConvolverNode.normalize=e}})(Cl,Ec,Ac,fl,gl,nc),Tc=((e,t,n,r,i)=>o=>{const a=new WeakMap;return{render(s,l){const c=a.get(l);return void 0!==c?Promise.resolve(c):(async(s,l)=>{let c=n(s);const u=qo(c,l);if(!u){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,delayTime:c.delayTime.value,maxDelayTime:o};c=t(l,e)}return a.set(l,c),u?await e(l,s.delayTime,c.delayTime):await r(l,s.delayTime,c.delayTime),await i(s,l,c),c})(s,l)}}})(Wl,Ms,_a,Ql,ll),Ic=((e,t,n,r,i,o,a)=>class extends e{constructor(e,s){const l=i(e),c={...Ja,...s},u=r(l,c),d=o(l);super(e,!1,u,d?n(c.maxDelayTime):null),this._delayTime=t(this,d,u.delayTime),a(this,c.maxDelayTime)}get delayTime(){return this._delayTime}})(Cl,Yl,Tc,Ms,fl,gl,nc),kc=(Rc=Ts,(e,t)=>{const n=e.createDynamicsCompressor();if(ls(n,t),t.channelCount>2)throw Rc();if("max"===t.channelCountMode)throw Rc();return us(n,t,"attack"),us(n,t,"knee"),us(n,t,"ratio"),us(n,t,"release"),us(n,t,"threshold"),n});var Rc;const Oc=((e,t,n,r,i)=>()=>{const o=new WeakMap;return{render(a,s){const l=o.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=qo(l,s);if(!c){const e={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=t(s,e)}return o.set(s,l),c?(await e(s,a.attack,l.attack),await e(s,a.knee,l.knee),await e(s,a.ratio,l.ratio),await e(s,a.release,l.release),await e(s,a.threshold,l.threshold)):(await r(s,a.attack,l.attack),await r(s,a.knee,l.knee),await r(s,a.ratio,l.ratio),await r(s,a.release,l.release),await r(s,a.threshold,l.threshold)),await i(a,s,l),l})(a,s)}}})(Wl,kc,_a,Ql,ll),Pc=((e,t,n,r,i,o,a,s)=>class extends e{constructor(e,i){const l=o(e),c={...Ya,...i},u=r(l,c),d=a(l);super(e,!1,u,d?n():null),this._attack=t(this,d,u.attack),this._knee=t(this,d,u.knee),this._nativeDynamicsCompressorNode=u,this._ratio=t(this,d,u.ratio),this._release=t(this,d,u.release),this._threshold=t(this,d,u.threshold),s(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(e){const t=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=e,e>2)throw this._nativeDynamicsCompressorNode.channelCount=t,i()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(e){const t=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=e,"max"===e)throw this._nativeDynamicsCompressorNode.channelCountMode=t,i()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"==typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}})(Cl,Yl,Oc,kc,Ts,fl,gl,nc),Nc=((e,t,n,r,i)=>()=>{const o=new WeakMap;return{render(a,s){const l=o.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=qo(l,s);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(s,e)}return o.set(s,l),c?await e(s,a.gain,l.gain):await r(s,a.gain,l.gain),await i(a,s,l),l})(a,s)}}})(Wl,_s,_a,Ql,ll),Bc=((e,t,n,r,i,o)=>class extends e{constructor(e,a){const s=i(e),l={...Za,...a},c=r(s,l),u=o(s);super(e,!1,c,u?n():null),this._gain=t(this,u,c.gain,Zo,Yo)}get gain(){return this._gain}})(Cl,Yl,Nc,_s,fl,gl),Lc=((e,t,n,r)=>(i,o,{channelCount:a,channelCountMode:s,channelInterpretation:l,feedback:c,feedforward:u})=>{const d=ms(o,i.sampleRate),h=c instanceof Float64Array?c:new Float64Array(c),f=u instanceof Float64Array?u:new Float64Array(u),p=h.length,m=f.length,g=Math.min(p,m);if(0===p||p>20)throw r();if(0===h[0])throw t();if(0===m||m>20)throw r();if(0===f[0])throw t();if(1!==h[0]){for(let e=0;e<m;e+=1)f[e]/=h[0];for(let e=1;e<p;e+=1)h[e]/=h[0]}const v=n(i,d,a,a);v.channelCount=a,v.channelCountMode=s,v.channelInterpretation=l;const b=[],y=[],w=[];for(let e=0;e<a;e+=1){b.push(0);const e=new Float32Array(32),t=new Float32Array(32);e.fill(0),t.fill(0),y.push(e),w.push(t)}v.onaudioprocess=e=>{const t=e.inputBuffer,n=e.outputBuffer,r=t.numberOfChannels;for(let e=0;e<r;e+=1){const r=t.getChannelData(e),i=n.getChannelData(e);b[e]=rs(h,p,f,m,g,y[e],w[e],b[e],32,r,i)}};const S=i.sampleRate/2;return xs({get bufferSize(){return d},get channelCount(){return v.channelCount},set channelCount(e){v.channelCount=e},get channelCountMode(){return v.channelCountMode},set channelCountMode(e){v.channelCountMode=e},get channelInterpretation(){return v.channelInterpretation},set channelInterpretation(e){v.channelInterpretation=e},get context(){return v.context},get inputs(){return[v]},get numberOfInputs(){return v.numberOfInputs},get numberOfOutputs(){return v.numberOfOutputs},addEventListener:(...e)=>v.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>v.dispatchEvent(e[0]),getFrequencyResponse(t,n,r){if(t.length!==n.length||n.length!==r.length)throw e();const i=t.length;for(let e=0;e<i;e+=1){const i=-Math.PI*(t[e]/S),o=[Math.cos(i),Math.sin(i)],a=As(Es(f,o),Es(h,o));n[e]=Math.sqrt(a[0]*a[0]+a[1]*a[1]),r[e]=Math.atan2(a[1],a[0])}},removeEventListener:(...e)=>v.removeEventListener(e[0],e[1],e[2])},v)})(es,$a,Cs,Ts),Dc=((e,t,n,r)=>i=>e(os,(()=>os(i)))?Promise.resolve(e(r,r)).then((e=>{if(!e){const e=n(i,512,0,1);i.oncomplete=()=>{e.onaudioprocess=null,e.disconnect()},e.onaudioprocess=()=>i.currentTime,e.connect(i.destination)}return i.startRendering()})):new Promise((e=>{const n=t(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});i.oncomplete=t=>{n.disconnect(),e(t.renderedBuffer)},n.connect(i.destination),i.startRendering()})))($s,_s,Cs,((e,t)=>()=>{if(null===t)return Promise.resolve(!1);const n=new t(1,1,44100),r=e(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise((e=>{n.oncomplete=()=>{r.disconnect(),e(0!==n.currentTime)},n.startRendering()}))})(_s,ml)),Uc=((e,t,n,r,i)=>(o,a)=>{const s=new WeakMap;let l=null;const c=async(c,u)=>{let d=null,h=t(c);const f=qo(h,u);if(void 0===u.createIIRFilter?d=e(u,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):f||(h=u.createIIRFilter(a,o)),s.set(u,null===d?h:d),null!==d){if(null===l){if(null===n)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new n(c.context.destination.channelCount,c.context.length,u.sampleRate);l=(async()=>{await r(c,e,e.destination);return((e,t,n,r)=>{const i=n instanceof Float64Array?n:new Float64Array(n),o=r instanceof Float64Array?r:new Float64Array(r),a=i.length,s=o.length,l=Math.min(a,s);if(1!==i[0]){for(let e=0;e<a;e+=1)o[e]/=i[0];for(let e=1;e<s;e+=1)i[e]/=i[0]}const c=new Float32Array(32),u=new Float32Array(32),d=t.createBuffer(e.numberOfChannels,e.length,e.sampleRate),h=e.numberOfChannels;for(let t=0;t<h;t+=1){const n=e.getChannelData(t),r=d.getChannelData(t);c.fill(0),u.fill(0),rs(i,a,o,s,l,c,u,0,32,n,r)}return d})(await i(e),u,o,a)})()}const e=await l;return d.buffer=e,d.start(0),d}return await r(c,u,h),h};return{render(e,t){const n=s.get(t);return void 0!==n?Promise.resolve(n):c(e,t)}}})(Kl,_a,ml,ll,Dc),Fc=(zc=Lc,(e,t,n)=>{if(void 0===e.createIIRFilter)return zc(e,t,n);const r=e.createIIRFilter(n.feedforward,n.feedback);return ls(r,n),r});var zc;const jc=((e,t,n,r,i,o)=>class extends e{constructor(e,a){const s=r(e),l=i(s),c={...ns,...a},u=t(s,l?null:e.baseLatency,c);super(e,!1,u,l?n(c.feedback,c.feedforward):null),ts(u),this._nativeIIRFilterNode=u,o(this,1)}getFrequencyResponse(e,t,n){return this._nativeIIRFilterNode.getFrequencyResponse(e,t,n)}})(Cl,Fc,Uc,fl,gl,nc),Hc=((e,t,n,r,i,o,a,s)=>(l,c)=>{const u=c.listener,{forwardX:d,forwardY:h,forwardZ:f,positionX:p,positionY:m,positionZ:g,upX:v,upY:b,upZ:y}=void 0===u.forwardX?(()=>{const d=new Float32Array(1),h=t(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),f=a(c);let p=!1,m=[0,0,-1,0,1,0],g=[0,0,0];const v=()=>{if(p)return;p=!0;const e=r(c,256,9,0);e.onaudioprocess=({inputBuffer:e})=>{const t=[o(e,d,0),o(e,d,1),o(e,d,2),o(e,d,3),o(e,d,4),o(e,d,5)];t.some(((e,t)=>e!==m[t]))&&(u.setOrientation(...t),m=t);const n=[o(e,d,6),o(e,d,7),o(e,d,8)];n.some(((e,t)=>e!==g[t]))&&(u.setPosition(...n),g=n)},h.connect(e)},b=e=>t=>{t!==m[e]&&(m[e]=t,u.setOrientation(...m))},y=e=>t=>{t!==g[e]&&(g[e]=t,u.setPosition(...g))},w=(t,r,o)=>{const a=n(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:r});a.connect(h,0,t),a.start(),Object.defineProperty(a.offset,"defaultValue",{get:()=>r});const u=e({context:l},f,a.offset,Zo,Yo);var d,p,m,g,b,y,w;return s(u,"value",(e=>()=>e.call(u)),(e=>t=>{try{e.call(u,t)}catch(e){if(9!==e.code)throw e}v(),f&&o(t)})),u.cancelAndHoldAtTime=(d=u.cancelAndHoldAtTime,f?()=>{throw i()}:(...e)=>{const t=d.apply(u,e);return v(),t}),u.cancelScheduledValues=(p=u.cancelScheduledValues,f?()=>{throw i()}:(...e)=>{const t=p.apply(u,e);return v(),t}),u.exponentialRampToValueAtTime=(m=u.exponentialRampToValueAtTime,f?()=>{throw i()}:(...e)=>{const t=m.apply(u,e);return v(),t}),u.linearRampToValueAtTime=(g=u.linearRampToValueAtTime,f?()=>{throw i()}:(...e)=>{const t=g.apply(u,e);return v(),t}),u.setTargetAtTime=(b=u.setTargetAtTime,f?()=>{throw i()}:(...e)=>{const t=b.apply(u,e);return v(),t}),u.setValueAtTime=(y=u.setValueAtTime,f?()=>{throw i()}:(...e)=>{const t=y.apply(u,e);return v(),t}),u.setValueCurveAtTime=(w=u.setValueCurveAtTime,f?()=>{throw i()}:(...e)=>{const t=w.apply(u,e);return v(),t}),u};return{forwardX:w(0,0,b(0)),forwardY:w(1,0,b(1)),forwardZ:w(2,-1,b(2)),positionX:w(6,0,y(0)),positionY:w(7,0,y(1)),positionZ:w(8,0,y(2)),upX:w(3,0,b(3)),upY:w(4,1,b(4)),upZ:w(5,0,b(5))}})():u;return{get forwardX(){return d},get forwardY(){return h},get forwardZ(){return f},get positionX(){return p},get positionY(){return m},get positionZ(){return g},get upX(){return v},get upY(){return b},get upZ(){return y}}})(Yl,gc,xc,Cs,Ts,Ls,gl,Us),Gc=new WeakMap,Vc=((e,t,n,r,i,o)=>class extends n{constructor(n,o){super(n),this._nativeContext=n,Eo.set(this,n),r(n)&&i.set(n,new Set),this._destination=new e(this,o),this._listener=t(this,n),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(e){const t="function"==typeof e?o(this,e):null;this._nativeContext.onstatechange=t;const n=this._nativeContext.onstatechange;this._onstatechange=null!==n&&n===t?e:n}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}})(ec,Hc,yl,gl,Gc,Vs),Wc=((e,t,n,r,i,o)=>(a,s)=>{const l=a.createOscillator();return ls(l,s),us(l,s,"detune"),us(l,s,"frequency"),void 0!==s.periodicWave?l.setPeriodicWave(s.periodicWave):ss(l,s,"type"),t(n,(()=>n(a)))||hs(l),t(r,(()=>r(a)))||o(l,a),t(i,(()=>i(a)))||fs(l),e(a,l),l})(Fl,$s,zs,js,Hs,Gs),qc=((e,t,n,r,i)=>()=>{const o=new WeakMap;let a=null,s=null,l=null;return{set periodicWave(e){a=e},set start(e){s=e},set stop(e){l=e},render(c,u){const d=o.get(u);return void 0!==d?Promise.resolve(d):(async(c,u)=>{let d=n(c);const h=qo(d,u);if(!h){const e={channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,detune:d.detune.value,frequency:d.frequency.value,periodicWave:null===a?void 0:a,type:d.type};d=t(u,e),null!==s&&d.start(s),null!==l&&d.stop(l)}return o.set(u,d),h?(await e(u,c.detune,d.detune),await e(u,c.frequency,d.frequency)):(await r(u,c.detune,d.detune),await r(u,c.frequency,d.frequency)),await i(c,u,d),d})(c,u)}}})(Wl,Wc,_a,Ql,ll),Kc=((e,t,n,r,i,o,a)=>class extends e{constructor(e,a){const s=i(e),l={...ks,...a},c=n(s,l),u=o(s),d=u?r():null,h=e.sampleRate/2;super(e,!1,c,d),this._detune=t(this,u,c.detune,153600,-153600),this._frequency=t(this,u,c.frequency,h,-h),this._nativeOscillatorNode=c,this._onended=null,this._oscillatorNodeRenderer=d,null!==this._oscillatorNodeRenderer&&void 0!==l.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=l.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(this,e):null;this._nativeOscillatorNode.onended=t;const n=this._nativeOscillatorNode.onended;this._onended=null!==n&&n===t?e:n}get type(){return this._nativeOscillatorNode.type}set type(e){this._nativeOscillatorNode.type=e,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(e){this._nativeOscillatorNode.setPeriodicWave(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=e)}start(e=0){if(this._nativeOscillatorNode.start(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=e),"closed"!==this.context.state){jo(this);const e=()=>{this._nativeOscillatorNode.removeEventListener("ended",e),$o(this)&&Go(this)};this._nativeOscillatorNode.addEventListener("ended",e)}}stop(e=0){this._nativeOscillatorNode.stop(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=e)}})(Cl,Yl,Wc,qc,fl,gl,Vs),Jc=(Qc=Kl,(e,t)=>{const n=Qc(e,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),r=e.createBuffer(1,2,44100);return n.buffer=r,n.loop=!0,n.connect(t),n.start(),()=>{n.stop(),n.disconnect(t)}});var Qc;const Xc=((e,t,n,r,i)=>(o,{curve:a,oversample:s,...l})=>{const c=o.createWaveShaper(),u=o.createWaveShaper();ls(c,l),ls(u,l);const d=n(o,{...l,gain:1}),h=n(o,{...l,gain:-1}),f=n(o,{...l,gain:1}),p=n(o,{...l,gain:-1});let m=null,g=!1,v=null;const b={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){d.channelCount=e,h.channelCount=e,c.channelCount=e,f.channelCount=e,u.channelCount=e,p.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){d.channelCountMode=e,h.channelCountMode=e,c.channelCountMode=e,f.channelCountMode=e,u.channelCountMode=e,p.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){d.channelInterpretation=e,h.channelInterpretation=e,c.channelInterpretation=e,f.channelInterpretation=e,u.channelInterpretation=e,p.channelInterpretation=e},get context(){return c.context},get curve(){return v},set curve(n){if(null!==n&&n.length<2)throw t();if(null===n)c.curve=n,u.curve=n;else{const e=n.length,t=new Float32Array(e+2-e%2),r=new Float32Array(e+2-e%2);t[0]=n[0],r[0]=-n[e-1];const i=Math.ceil((e+1)/2),o=(e+1)/2-1;for(let a=1;a<i;a+=1){const s=a/i*o,l=Math.floor(s),c=Math.ceil(s);t[a]=l===c?n[l]:(1-(s-l))*n[l]+(1-(c-s))*n[c],r[a]=l===c?-n[e-1-l]:-(1-(s-l))*n[e-1-l]-(1-(c-s))*n[e-1-c]}t[i]=e%2==1?n[i-1]:(n[i-2]+n[i-1])/2,c.curve=t,u.curve=r}v=n,g&&(r(v)&&null===m?m=e(o,d):null!==m&&(m(),m=null))},get inputs(){return[d]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get oversample(){return c.oversample},set oversample(e){c.oversample=e,u.oversample=e},addEventListener:(...e)=>d.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>d.dispatchEvent(e[0]),removeEventListener:(...e)=>d.removeEventListener(e[0],e[1],e[2])};null!==a&&(b.curve=a instanceof Float32Array?a:new Float32Array(a)),s!==b.oversample&&(b.oversample=s);return i(xs(b,f),(()=>{d.connect(c).connect(f),d.connect(h).connect(u).connect(p).connect(f),g=!0,r(v)&&(m=e(o,d))}),(()=>{d.disconnect(c),c.disconnect(f),d.disconnect(h),h.disconnect(u),u.disconnect(p),p.disconnect(f),g=!1,null!==m&&(m(),m=null)}))})(Jc,$a,_s,Ds,hc),Yc=((e,t,n,r,i,o,a)=>(s,l)=>{const c=s.createWaveShaper();if(null!==o&&"webkitAudioContext"===o.name&&void 0===s.createGain().gain.automationRate)return n(s,l);ls(c,l);const u=null===l.curve||l.curve instanceof Float32Array?l.curve:new Float32Array(l.curve);if(null!==u&&u.length<2)throw t();ss(c,{curve:u},"curve"),ss(c,l,"oversample");let d=null,h=!1;a(c,"curve",(e=>()=>e.call(c)),(t=>n=>(t.call(c,n),h&&(r(n)&&null===d?d=e(s,c):r(n)||null===d||(d(),d=null)),n)));return i(c,(()=>{h=!0,r(c.curve)&&(d=e(s,c))}),(()=>{h=!1,null!==d&&(d(),d=null)}))})(Jc,$a,Xc,Ds,hc,Sl,Us),Zc=((e,t,n,r,i,o,a,s,l,c)=>(u,{coneInnerAngle:d,coneOuterAngle:h,coneOuterGain:f,distanceModel:p,maxDistance:m,orientationX:g,orientationY:v,orientationZ:b,panningModel:y,positionX:w,positionY:S,positionZ:x,refDistance:M,rolloffFactor:_,...A})=>{const E=u.createPanner();if(A.channelCount>2)throw a();if("max"===A.channelCountMode)throw a();ls(E,A);const C={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},T=n(u,{...C,channelInterpretation:"speakers",numberOfInputs:6}),I=r(u,{...A,gain:1}),k=r(u,{...C,gain:1}),R=r(u,{...C,gain:0}),O=r(u,{...C,gain:0}),P=r(u,{...C,gain:0}),N=r(u,{...C,gain:0}),B=r(u,{...C,gain:0}),L=i(u,256,6,1),D=o(u,{...C,curve:new Float32Array([1,1]),oversample:"none"});let U=[g,v,b],F=[w,S,x];const z=new Float32Array(1);L.onaudioprocess=({inputBuffer:e})=>{const t=[l(e,z,0),l(e,z,1),l(e,z,2)];t.some(((e,t)=>e!==U[t]))&&(E.setOrientation(...t),U=t);const n=[l(e,z,3),l(e,z,4),l(e,z,5)];n.some(((e,t)=>e!==F[t]))&&(E.setPosition(...n),F=n)},Object.defineProperty(R.gain,"defaultValue",{get:()=>0}),Object.defineProperty(O.gain,"defaultValue",{get:()=>0}),Object.defineProperty(P.gain,"defaultValue",{get:()=>0}),Object.defineProperty(N.gain,"defaultValue",{get:()=>0}),Object.defineProperty(B.gain,"defaultValue",{get:()=>0});const j={get bufferSize(){},get channelCount(){return E.channelCount},set channelCount(e){if(e>2)throw a();I.channelCount=e,E.channelCount=e},get channelCountMode(){return E.channelCountMode},set channelCountMode(e){if("max"===e)throw a();I.channelCountMode=e,E.channelCountMode=e},get channelInterpretation(){return E.channelInterpretation},set channelInterpretation(e){I.channelInterpretation=e,E.channelInterpretation=e},get coneInnerAngle(){return E.coneInnerAngle},set coneInnerAngle(e){E.coneInnerAngle=e},get coneOuterAngle(){return E.coneOuterAngle},set coneOuterAngle(e){E.coneOuterAngle=e},get coneOuterGain(){return E.coneOuterGain},set coneOuterGain(e){if(e<0||e>1)throw t();E.coneOuterGain=e},get context(){return E.context},get distanceModel(){return E.distanceModel},set distanceModel(e){E.distanceModel=e},get inputs(){return[I]},get maxDistance(){return E.maxDistance},set maxDistance(e){if(e<0)throw new RangeError;E.maxDistance=e},get numberOfInputs(){return E.numberOfInputs},get numberOfOutputs(){return E.numberOfOutputs},get orientationX(){return k.gain},get orientationY(){return R.gain},get orientationZ(){return O.gain},get panningModel(){return E.panningModel},set panningModel(e){E.panningModel=e},get positionX(){return P.gain},get positionY(){return N.gain},get positionZ(){return B.gain},get refDistance(){return E.refDistance},set refDistance(e){if(e<0)throw new RangeError;E.refDistance=e},get rolloffFactor(){return E.rolloffFactor},set rolloffFactor(e){if(e<0)throw new RangeError;E.rolloffFactor=e},addEventListener:(...e)=>I.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>I.dispatchEvent(e[0]),removeEventListener:(...e)=>I.removeEventListener(e[0],e[1],e[2])};d!==j.coneInnerAngle&&(j.coneInnerAngle=d),h!==j.coneOuterAngle&&(j.coneOuterAngle=h),f!==j.coneOuterGain&&(j.coneOuterGain=f),p!==j.distanceModel&&(j.distanceModel=p),m!==j.maxDistance&&(j.maxDistance=m),g!==j.orientationX.value&&(j.orientationX.value=g),v!==j.orientationY.value&&(j.orientationY.value=v),b!==j.orientationZ.value&&(j.orientationZ.value=b),y!==j.panningModel&&(j.panningModel=y),w!==j.positionX.value&&(j.positionX.value=w),S!==j.positionY.value&&(j.positionY.value=S),x!==j.positionZ.value&&(j.positionZ.value=x),M!==j.refDistance&&(j.refDistance=M),_!==j.rolloffFactor&&(j.rolloffFactor=_),1===U[0]&&0===U[1]&&0===U[2]||E.setOrientation(...U),0===F[0]&&0===F[1]&&0===F[2]||E.setPosition(...F);return c(xs(j,E),(()=>{I.connect(E),e(I,D,0,0),D.connect(k).connect(T,0,0),D.connect(R).connect(T,0,1),D.connect(O).connect(T,0,2),D.connect(P).connect(T,0,3),D.connect(N).connect(T,0,4),D.connect(B).connect(T,0,5),T.connect(L).connect(u.destination)}),(()=>{I.disconnect(E),s(I,D,0,0),D.disconnect(k),k.disconnect(T),D.disconnect(R),R.disconnect(T),D.disconnect(O),O.disconnect(T),D.disconnect(P),P.disconnect(T),D.disconnect(N),N.disconnect(T),D.disconnect(B),B.disconnect(T),T.disconnect(L),L.disconnect(u.destination)}))})(ba,$a,gc,_s,Cs,Yc,Ts,Ma,Ls,hc),$c=(eu=Zc,(e,t)=>{const n=e.createPanner();return void 0===n.orientationX?eu(e,t):(ls(n,t),us(n,t,"orientationX"),us(n,t,"orientationY"),us(n,t,"orientationZ"),us(n,t,"positionX"),us(n,t,"positionY"),us(n,t,"positionZ"),ss(n,t,"coneInnerAngle"),ss(n,t,"coneOuterAngle"),ss(n,t,"coneOuterGain"),ss(n,t,"distanceModel"),ss(n,t,"maxDistance"),ss(n,t,"panningModel"),ss(n,t,"refDistance"),ss(n,t,"rolloffFactor"),n)});var eu;const tu=((e,t,n,r,i,o,a,s,l,c)=>()=>{const u=new WeakMap;let d=null;return{render(h,f){const p=u.get(f);return void 0!==p?Promise.resolve(p):(async(h,f)=>{let p=null,m=o(h);const g={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},v={...g,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},b=qo(m,f);if("bufferSize"in m)p=r(f,{...g,gain:1});else if(!b){const e={...v,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=i(f,e)}if(u.set(f,null===p?m:p),null!==p){if(null===d){if(null===a)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new a(6,h.context.length,f.sampleRate),r=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});r.connect(e.destination),d=(async()=>{const t=await Promise.all([h.orientationX,h.orientationY,h.orientationZ,h.positionX,h.positionY,h.positionZ].map((async(t,r)=>{const i=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===r?1:0});return await s(e,t,i.offset),i})));for(let e=0;e<6;e+=1)t[e].connect(r,0,e),t[e].start(0);return c(e)})()}const e=await d,o=r(f,{...g,gain:1});await l(h,f,o);const u=[];for(let t=0;t<e.numberOfChannels;t+=1)u.push(e.getChannelData(t));let m=[u[0][0],u[1][0],u[2][0]],b=[u[3][0],u[4][0],u[5][0]],y=r(f,{...g,gain:1}),w=i(f,{...v,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:b[0],positionY:b[1],positionZ:b[2]});o.connect(y).connect(w.inputs[0]),w.connect(p);for(let t=128;t<e.length;t+=128){const e=[u[0][t],u[1][t],u[2][t]],n=[u[3][t],u[4][t],u[5][t]];if(e.some(((e,t)=>e!==m[t]))||n.some(((e,t)=>e!==b[t]))){m=e,b=n;const a=t/f.sampleRate;y.gain.setValueAtTime(0,a),y=r(f,{...g,gain:0}),w=i(f,{...v,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:b[0],positionY:b[1],positionZ:b[2]}),y.gain.setValueAtTime(1,a),o.connect(y).connect(w.inputs[0]),w.connect(p)}}return p}return b?(await e(f,h.orientationX,m.orientationX),await e(f,h.orientationY,m.orientationY),await e(f,h.orientationZ,m.orientationZ),await e(f,h.positionX,m.positionX),await e(f,h.positionY,m.positionY),await e(f,h.positionZ,m.positionZ)):(await s(f,h.orientationX,m.orientationX),await s(f,h.orientationY,m.orientationY),await s(f,h.orientationZ,m.orientationZ),await s(f,h.positionX,m.positionX),await s(f,h.positionY,m.positionY),await s(f,h.positionZ,m.positionZ)),va(m)?await l(h,f,m.inputs[0]):await l(h,f,m),m})(h,f)}}})(Wl,gc,xc,_s,$c,_a,ml,Ql,ll,Dc),nu=((e,t,n,r,i,o,a)=>class extends e{constructor(e,s){const l=i(e),c={...Rs,...s},u=n(l,c),d=o(l);super(e,!1,u,d?r():null),this._nativePannerNode=u,this._orientationX=t(this,d,u.orientationX,Zo,Yo),this._orientationY=t(this,d,u.orientationY,Zo,Yo),this._orientationZ=t(this,d,u.orientationZ,Zo,Yo),this._positionX=t(this,d,u.positionX,Zo,Yo),this._positionY=t(this,d,u.positionY,Zo,Yo),this._positionZ=t(this,d,u.positionZ,Zo,Yo),a(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(e){this._nativePannerNode.coneInnerAngle=e}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(e){this._nativePannerNode.coneOuterAngle=e}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(e){this._nativePannerNode.coneOuterGain=e}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(e){this._nativePannerNode.distanceModel=e}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(e){this._nativePannerNode.maxDistance=e}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(e){this._nativePannerNode.panningModel=e}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(e){this._nativePannerNode.refDistance=e}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(e){this._nativePannerNode.rolloffFactor=e}})(Cl,Yl,$c,tu,fl,gl,nc),ru=(e=>(t,{disableNormalization:n,imag:r,real:i})=>{const o=r instanceof Float32Array?r:new Float32Array(r),a=i instanceof Float32Array?i:new Float32Array(i),s=t.createPeriodicWave(a,o,{disableNormalization:n});if(Array.from(r).length<2)throw e();return s})(Jo),iu=((e,t,n,r)=>class i{constructor(i,o){const a=t(i),s=r({...Os,...o}),l=e(a,s);return n.add(l),l}static[Symbol.hasInstance](e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===i.prototype||n.has(e)}})(ru,fl,new WeakSet,(e=>{const{imag:t,real:n}=e;return void 0===t?void 0===n?{...e,imag:[0,0],real:[0,0]}:{...e,imag:Array.from(n,(()=>0)),real:n}:void 0===n?{...e,imag:t,real:Array.from(t,(()=>0))}:{...e,imag:t,real:n}})),ou=((e,t,n,r,i,o)=>{const a=16385,s=new Float32Array([1,1]),l=Math.PI/2,c={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...c,oversample:"none"},d=(e,o,d,h,f)=>{if(1===o)return((e,t,i,o)=>{const d=new Float32Array(a),h=new Float32Array(a);for(let e=0;e<a;e+=1){const t=e/16384*l;d[e]=Math.cos(t),h[e]=Math.sin(t)}const f=n(e,{...c,gain:0}),p=r(e,{...u,curve:d}),m=r(e,{...u,curve:s}),g=n(e,{...c,gain:0}),v=r(e,{...u,curve:h});return{connectGraph(){t.connect(f),t.connect(void 0===m.inputs?m:m.inputs[0]),t.connect(g),m.connect(i),i.connect(void 0===p.inputs?p:p.inputs[0]),i.connect(void 0===v.inputs?v:v.inputs[0]),p.connect(f.gain),v.connect(g.gain),f.connect(o,0,0),g.connect(o,0,1)},disconnectGraph(){t.disconnect(f),t.disconnect(void 0===m.inputs?m:m.inputs[0]),t.disconnect(g),m.disconnect(i),i.disconnect(void 0===p.inputs?p:p.inputs[0]),i.disconnect(void 0===v.inputs?v:v.inputs[0]),p.disconnect(f.gain),v.disconnect(g.gain),f.disconnect(o,0,0),g.disconnect(o,0,1)}}})(e,d,h,f);if(2===o)return((e,i,o,d)=>{const h=new Float32Array(a),f=new Float32Array(a),p=new Float32Array(a),m=new Float32Array(a),g=Math.floor(8192.5);for(let e=0;e<a;e+=1)if(e>g){const t=(e-g)/(16384-g)*l;h[e]=Math.cos(t),f[e]=Math.sin(t),p[e]=0,m[e]=1}else{const t=e/(16384-g)*l;h[e]=1,f[e]=0,p[e]=Math.cos(t),m[e]=Math.sin(t)}const v=t(e,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),b=n(e,{...c,gain:0}),y=r(e,{...u,curve:h}),w=n(e,{...c,gain:0}),S=r(e,{...u,curve:f}),x=r(e,{...u,curve:s}),M=n(e,{...c,gain:0}),_=r(e,{...u,curve:p}),A=n(e,{...c,gain:0}),E=r(e,{...u,curve:m});return{connectGraph(){i.connect(v),i.connect(void 0===x.inputs?x:x.inputs[0]),v.connect(b,0),v.connect(w,0),v.connect(M,1),v.connect(A,1),x.connect(o),o.connect(void 0===y.inputs?y:y.inputs[0]),o.connect(void 0===S.inputs?S:S.inputs[0]),o.connect(void 0===_.inputs?_:_.inputs[0]),o.connect(void 0===E.inputs?E:E.inputs[0]),y.connect(b.gain),S.connect(w.gain),_.connect(M.gain),E.connect(A.gain),b.connect(d,0,0),M.connect(d,0,0),w.connect(d,0,1),A.connect(d,0,1)},disconnectGraph(){i.disconnect(v),i.disconnect(void 0===x.inputs?x:x.inputs[0]),v.disconnect(b,0),v.disconnect(w,0),v.disconnect(M,1),v.disconnect(A,1),x.disconnect(o),o.disconnect(void 0===y.inputs?y:y.inputs[0]),o.disconnect(void 0===S.inputs?S:S.inputs[0]),o.disconnect(void 0===_.inputs?_:_.inputs[0]),o.disconnect(void 0===E.inputs?E:E.inputs[0]),y.disconnect(b.gain),S.disconnect(w.gain),_.disconnect(M.gain),E.disconnect(A.gain),b.disconnect(d,0,0),M.disconnect(d,0,0),w.disconnect(d,0,1),A.disconnect(d,0,1)}}})(e,d,h,f);throw i()};return(t,{channelCount:r,channelCountMode:a,pan:s,...l})=>{if("max"===a)throw i();const c=e(t,{...l,channelCount:1,channelCountMode:a,numberOfInputs:2}),u=n(t,{...l,channelCount:r,channelCountMode:a,gain:1}),h=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:s});let{connectGraph:f,disconnectGraph:p}=d(t,r,u,h,c);Object.defineProperty(h.gain,"defaultValue",{get:()=>0}),Object.defineProperty(h.gain,"maxValue",{get:()=>1}),Object.defineProperty(h.gain,"minValue",{get:()=>-1});const m={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){u.channelCount!==e&&(g&&p(),({connectGraph:f,disconnectGraph:p}=d(t,e,u,h,c)),g&&f()),u.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){if("clamped-max"===e||"max"===e)throw i();u.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){u.channelInterpretation=e},get context(){return u.context},get inputs(){return[u]},get numberOfInputs(){return u.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get pan(){return h.gain},addEventListener:(...e)=>u.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>u.dispatchEvent(e[0]),removeEventListener:(...e)=>u.removeEventListener(e[0],e[1],e[2])};let g=!1;return o(xs(m,c),(()=>{f(),g=!0}),(()=>{p(),g=!1}))}})(gc,Ss,_s,Yc,Ts,hc),au=((e,t)=>(n,r)=>{const i=r.channelCountMode;if("clamped-max"===i)throw t();if(void 0===n.createStereoPanner)return e(n,r);const o=n.createStereoPanner();return ls(o,r),us(o,r,"pan"),Object.defineProperty(o,"channelCountMode",{get:()=>i,set:e=>{if(e!==i)throw t()}}),o})(ou,Ts),su=((e,t,n,r,i)=>()=>{const o=new WeakMap;return{render(a,s){const l=o.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=qo(l,s);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(s,e)}return o.set(s,l),c?await e(s,a.pan,l.pan):await r(s,a.pan,l.pan),va(l)?await i(a,s,l.inputs[0]):await i(a,s,l),l})(a,s)}}})(Wl,au,_a,Ql,ll),lu=((e,t,n,r,i,o)=>class extends e{constructor(e,a){const s=i(e),l={...Ps,...a},c=n(s,l),u=o(s);super(e,!1,c,u?r():null),this._pan=t(this,u,c.pan)}get pan(){return this._pan}})(Cl,Yl,au,su,fl,gl),cu=((e,t,n)=>()=>{const r=new WeakMap;return{render(i,o){const a=r.get(o);return void 0!==a?Promise.resolve(a):(async(i,o)=>{let a=t(i);if(!qo(a,o)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=e(o,t)}return r.set(o,a),va(a)?await n(i,o,a.inputs[0]):await n(i,o,a),a})(i,o)}}})(Yc,_a,ll),uu=((e,t,n,r,i,o,a)=>class extends e{constructor(e,t){const s=i(e),l={...Bs,...t},c=n(s,l);super(e,!0,c,o(s)?r():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=c,a(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(e){if(null===e)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(e.length<2)throw t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=e}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(e){this._nativeWaveShaperNode.oversample=e}})(Cl,$a,Yc,cu,fl,gl,nc),du=(e=>null!==e&&e.isSecureContext)(nl),hu=(e=>(t,n,r)=>{Object.defineProperties(e,{currentFrame:{configurable:!0,get:()=>Math.round(t*n)},currentTime:{configurable:!0,get:()=>t}});try{return r()}finally{null!==e&&(delete e.currentFrame,delete e.currentTime)}})(nl),fu=new WeakMap,pu=((e,t)=>n=>{let r=e.get(n);if(void 0!==r)return r;if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");return r=new t(1,1,44100),e.set(n,r),r})(fu,ml),mu=du?((e,t,n,r,i,o,a,s,l,c,u,d,h)=>{let f=0;return(p,m,g={credentials:"omit"})=>{const v=u.get(p);if(void 0!==v&&v.has(m))return Promise.resolve();const b=c.get(p);if(void 0!==b){const e=b.get(m);if(void 0!==e)return e}const y=o(p),w=void 0===y.audioWorklet?i(m).then((([e,t])=>{const[r,i]=No(e,t);return n(`${r};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${i}\n})})(window,'_AWGS')`)})).then((()=>{const e=h._AWGS.pop();if(void 0===e)throw new SyntaxError;r(y.currentTime,y.sampleRate,(()=>e(class{},void 0,((e,n)=>{if(""===e.trim())throw t();const r=Io.get(y);if(void 0!==r){if(r.has(e))throw t();Lo(n),Bo(n.parameterDescriptors),r.set(e,n)}else Lo(n),Bo(n.parameterDescriptors),Io.set(y,new Map([[e,n]]))}),y.sampleRate,void 0,void 0)))})):Promise.all([i(m),Promise.resolve(e(d,d))]).then((([[e,t],n])=>{const r=f+1;f=r;const[i,o]=No(e,t),c=new Blob([`${i};((AudioWorkletProcessor,registerProcessor)=>{${o}\n})(${n?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${n?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${n?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${r}',class extends AudioWorkletProcessor{process(){return !1}})`],{type:"application/javascript; charset=utf-8"}),u=URL.createObjectURL(c);return y.audioWorklet.addModule(u,g).then((()=>{if(s(y))return y;const e=a(y);return e.audioWorklet.addModule(u,g).then((()=>e))})).then((e=>{if(null===l)throw new SyntaxError;try{new l(e,`__sac${r}`)}catch{throw new SyntaxError}})).finally((()=>URL.revokeObjectURL(u)))}));return void 0===b?c.set(p,new Map([[m,w]])):b.set(m,w),w.then((()=>{const e=u.get(p);void 0===e?u.set(p,new Set([m])):e.add(m)})).finally((()=>{const e=c.get(p);void 0!==e&&e.delete(m)})),w}})($s,Ts,(e=>t=>new Promise(((n,r)=>{if(null===e)return void r(new SyntaxError);const i=e.document.head;if(null===i)r(new SyntaxError);else{const o=e.document.createElement("script"),a=new Blob([t],{type:"application/javascript"}),s=URL.createObjectURL(a),l=e.onerror,c=()=>{e.onerror=l,URL.revokeObjectURL(s)};e.onerror=(t,n,i,o,a)=>n===s||n===e.location.href&&1===i&&1===o?(c(),r(a),!1):null!==l?l(t,n,i,o,a):void 0,o.onerror=()=>{c(),r(new SyntaxError)},o.onload=()=>{c(),n()},o.src=s,o.type="module",i.appendChild(o)}})))(nl),hu,(gu=()=>new DOMException("","AbortError"),async e=>{try{const t=await fetch(e);if(t.ok)return[await t.text(),t.url]}catch{}throw gu()}),fl,pu,gl,El,new WeakMap,new WeakMap,((e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const n=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),r=new t(1,128,44100),i=URL.createObjectURL(n);let o=!1,a=!1;try{await r.audioWorklet.addModule(i);const t=new e(r,"a",{numberOfOutputs:0}),n=r.createOscillator();t.port.onmessage=()=>o=!0,t.onprocessorerror=()=>a=!0,n.connect(t),n.start(0),await r.startRendering()}catch{}finally{URL.revokeObjectURL(i)}return o&&!a})(El,ml),nl):void 0;var gu;const vu=((e,t)=>n=>e(n)||t(n))(xl,gl),bu=((e,t,n,r,i,o,a,s,l,c,u)=>(d,h)=>{const f=a(d)?d:o(d);if(i.has(h)){const e=n();return Promise.reject(e)}try{i.add(h)}catch{}return t(l,(()=>l(f)))?f.decodeAudioData(h).then((n=>(Ka(h).catch((()=>{})),t(s,(()=>s(n)))||u(n),e.add(n),n))):new Promise(((t,n)=>{const i=async()=>{try{await Ka(h)}catch{}},o=e=>{n(e),i()};try{f.decodeAudioData(h,(n=>{"function"!=typeof n.copyFromChannel&&(c(n),Qo(n)),e.add(n),i().then((()=>t(n)))}),(e=>{o(null===e?r():e)}))}catch(e){o(e)}}))})(kl,$s,(()=>new DOMException("","DataCloneError")),(()=>new DOMException("","EncodingError")),new WeakSet,fl,vu,Ko,os,Nl,Bl),yu=(wu=mu,Su=Il,xu=Dl,Mu=$l,_u=rc,Au=bc,Eu=wc,Cu=_c,Tu=Cc,Iu=bu,ku=Ic,Ru=Pc,Ou=Bc,Pu=jc,Nu=Vc,Bu=Kc,Lu=nu,Du=iu,Uu=lu,Fu=uu,class extends Nu{constructor(e,t){super(e,t),this._nativeContext=e,this._audioWorklet=void 0===wu?void 0:{addModule:(e,t)=>wu(this,e,t)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new Su(this)}createBiquadFilter(){return new _u(this)}createBuffer(e,t,n){return new xu({length:t,numberOfChannels:e,sampleRate:n})}createBufferSource(){return new Mu(this)}createChannelMerger(e=6){return new Au(this,{numberOfInputs:e})}createChannelSplitter(e=6){return new Eu(this,{numberOfOutputs:e})}createConstantSource(){return new Cu(this)}createConvolver(){return new Tu(this)}createDelay(e=1){return new ku(this,{maxDelayTime:e})}createDynamicsCompressor(){return new Ru(this)}createGain(){return new Ou(this)}createIIRFilter(e,t){return new Pu(this,{feedback:t,feedforward:e})}createOscillator(){return new Bu(this)}createPanner(){return new Lu(this)}createPeriodicWave(e,t,n={disableNormalization:!1}){return new Du(this,{...n,imag:t,real:e})}createStereoPanner(){return new Uu(this)}createWaveShaper(){return new Fu(this)}decodeAudioData(e,t,n){return Iu(this._nativeContext,e).then((e=>("function"==typeof t&&t(e),e)),(e=>{throw"function"==typeof n&&n(e),e}))}});var wu,Su,xu,Mu,_u,Au,Eu,Cu,Tu,Iu,ku,Ru,Ou,Pu,Nu,Bu,Lu,Du,Uu,Fu;const zu=((e,t,n,r)=>class extends e{constructor(e,i){const o=n(e),a=t(o,i);if(r(o))throw TypeError();super(e,!0,a,null),this._nativeMediaElementAudioSourceNode=a}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}})(Cl,((e,t)=>e.createMediaElementSource(t.mediaElement)),fl,gl),ju=((e,t,n,r)=>class extends e{constructor(e,i){const o=n(e);if(r(o))throw new TypeError;const a={...is,...i},s=t(o,a);super(e,!1,s,null),this._nativeMediaStreamAudioDestinationNode=s}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}})(Cl,((e,t)=>{const n=e.createMediaStreamDestination();return ls(n,t),1===n.numberOfOutputs&&Object.defineProperty(n,"numberOfOutputs",{get:()=>0}),n}),fl,gl),Hu=((e,t,n,r)=>class extends e{constructor(e,i){const o=n(e),a=t(o,i);if(r(o))throw new TypeError;super(e,!0,a,null),this._nativeMediaStreamAudioSourceNode=a}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}})(Cl,((e,{mediaStream:t})=>{const n=t.getAudioTracks();n.sort(((e,t)=>e.id<t.id?-1:e.id>t.id?1:0));const r=n.slice(0,1),i=e.createMediaStreamSource(new MediaStream(r));return Object.defineProperty(i,"mediaStream",{value:t}),i}),fl,gl),Gu=((e,t)=>(n,{mediaStreamTrack:r})=>{if("function"==typeof n.createMediaStreamTrackSource)return n.createMediaStreamTrackSource(r);const i=new MediaStream([r]),o=n.createMediaStreamSource(i);if("audio"!==r.kind)throw e();if(t(n))throw new TypeError;return o})($a,gl),Vu=((e,t,n)=>class extends e{constructor(e,r){const i=n(e);super(e,!0,t(i,r),null)}})(Cl,Gu,fl),Wu=((e,t,n,r,i,o,a,s,l)=>class extends e{constructor(e={}){if(null===l)throw new Error("Missing the native AudioContext constructor.");let t;try{t=new l(e)}catch(e){if(12===e.code&&"sampleRate is not in range"===e.message)throw n();throw e}if(null===t)throw r();if(!da(e.latencyHint))throw new TypeError(`The provided value '${e.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==e.sampleRate&&t.sampleRate!==e.sampleRate)throw n();super(t,2);const{latencyHint:i}=e,{sampleRate:o}=t;if(this._baseLatency="number"==typeof t.baseLatency?t.baseLatency:"balanced"===i?512/o:"interactive"===i||void 0===i?256/o:"playback"===i?1024/o:128*Math.max(2,Math.min(128,Math.round(i*o/128)))/o,this._nativeAudioContext=t,"webkitAudioContext"===l.name?(this._nativeGainNode=t.createGain(),this._nativeOscillatorNode=t.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(t.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===t.state){this._state="suspended";const e=()=>{"suspended"===this._state&&(this._state=null),t.removeEventListener("statechange",e)};t.addEventListener("statechange",e)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then((()=>{throw t()})):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then((()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),ua(this)})))}createMediaElementSource(e){return new i(this,{mediaElement:e})}createMediaStreamDestination(){return new o(this)}createMediaStreamSource(e){return new a(this,{mediaStream:e})}createMediaStreamTrackSource(e){return new s(this,{mediaStreamTrack:e})}resume(){return"suspended"===this._state?new Promise(((e,t)=>{const n=()=>{this._nativeAudioContext.removeEventListener("statechange",n),"running"===this._nativeAudioContext.state?e():this.resume().then(e,t)};this._nativeAudioContext.addEventListener("statechange",n)})):this._nativeAudioContext.resume().catch((e=>{if(void 0===e||15===e.code)throw t();throw e}))}suspend(){return this._nativeAudioContext.suspend().catch((e=>{if(void 0===e)throw t();throw e}))}})(yu,$a,Ts,Ns,zu,ju,Hu,Vu,Sl),qu=(Ku=Gc,e=>{const t=Ku.get(e);if(void 0===t)throw new Error("The context has no set of AudioWorkletNodes.");return t});var Ku;const Ju=(Qu=qu,(e,t)=>{Qu(e).add(t)});var Qu;const Xu=(e=>(t,n,r=0,i=0)=>{const o=t[r];if(void 0===o)throw e();return ka(n)?o.connect(n,0,i):o.connect(n,0)})(Jo),Yu=(e=>(t,n)=>{e(t).delete(n)})(qu),Zu=(e=>(t,n,r,i=0)=>void 0===n?t.forEach((e=>e.disconnect())):"number"==typeof n?Xa(e,t,n).disconnect():ka(n)?void 0===r?t.forEach((e=>e.disconnect(n))):void 0===i?Xa(e,t,r).disconnect(n,0):Xa(e,t,r).disconnect(n,0,i):void 0===r?t.forEach((e=>e.disconnect(n))):Xa(e,t,r).disconnect(n,0))(Jo),$u=new WeakMap,ed=(td=$u,nd=Do,e=>nd(td,e));var td,nd;const rd=((e,t,n,r,i,o,a,s,l,c,u,d,h)=>(f,p,m,g)=>{if(0===g.numberOfInputs&&0===g.numberOfOutputs)throw l();const v=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(v.some((e=>e<1)))throw l();if(v.length!==g.numberOfOutputs)throw t();if("explicit"!==g.channelCountMode)throw l();const b=g.channelCount*g.numberOfInputs,y=v.reduce(((e,t)=>e+t),0),w=void 0===m.parameterDescriptors?0:m.parameterDescriptors.length;if(b+w>6||y>6)throw l();const S=new MessageChannel,x=[],M=[];for(let e=0;e<g.numberOfInputs;e+=1)x.push(a(f,{channelCount:g.channelCount,channelCountMode:g.channelCountMode,channelInterpretation:g.channelInterpretation,gain:1})),M.push(i(f,{channelCount:g.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:g.channelCount}));const _=[];if(void 0!==m.parameterDescriptors)for(const{defaultValue:e,maxValue:t,minValue:n,name:r}of m.parameterDescriptors){const i=o(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:void 0!==g.parameterData[r]?g.parameterData[r]:void 0===e?0:e});Object.defineProperties(i.offset,{defaultValue:{get:()=>void 0===e?0:e},maxValue:{get:()=>void 0===t?Zo:t},minValue:{get:()=>void 0===n?Yo:n}}),_.push(i)}const A=r(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,b+w)}),E=ms(p,f.sampleRate),C=s(f,E,b+w,Math.max(1,y)),T=i(f,{channelCount:Math.max(1,y),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,y)}),I=[];for(let e=0;e<g.numberOfOutputs;e+=1)I.push(r(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:v[e]}));for(let e=0;e<g.numberOfInputs;e+=1){x[e].connect(M[e]);for(let t=0;t<g.channelCount;t+=1)M[e].connect(A,t,e*g.channelCount+t)}const k=new Ba(void 0===m.parameterDescriptors?[]:m.parameterDescriptors.map((({name:e},t)=>{const n=_[t];return n.connect(A,0,b+t),n.start(0),[e,n.offset]})));A.connect(C);let R=g.channelInterpretation,O=null;const P=0===g.numberOfOutputs?[C]:I,N={get bufferSize(){return E},get channelCount(){return g.channelCount},set channelCount(e){throw n()},get channelCountMode(){return g.channelCountMode},set channelCountMode(e){throw n()},get channelInterpretation(){return R},set channelInterpretation(e){for(const t of x)t.channelInterpretation=e;R=e},get context(){return C.context},get inputs(){return x},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return O},set onprocessorerror(e){"function"==typeof O&&N.removeEventListener("processorerror",O),O="function"==typeof e?e:null,"function"==typeof O&&N.addEventListener("processorerror",O)},get parameters(){return k},get port(){return S.port2},addEventListener:(...e)=>C.addEventListener(e[0],e[1],e[2]),connect:e.bind(null,P),disconnect:c.bind(null,P),dispatchEvent:(...e)=>C.dispatchEvent(e[0]),removeEventListener:(...e)=>C.removeEventListener(e[0],e[1],e[2])},B=new Map;var L,D;S.port1.addEventListener=(L=S.port1.addEventListener,(...e)=>{if("message"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=B.get(e[1]);void 0!==n?e[1]=n:(e[1]=e=>{u(f.currentTime,f.sampleRate,(()=>t(e)))},B.set(t,e[1]))}}return L.call(S.port1,e[0],e[1],e[2])}),S.port1.removeEventListener=(D=S.port1.removeEventListener,(...e)=>{if("message"===e[0]){const t=B.get(e[1]);void 0!==t&&(B.delete(e[1]),e[1]=t)}return D.call(S.port1,e[0],e[1],e[2])});let U=null;Object.defineProperty(S.port1,"onmessage",{get:()=>U,set:e=>{"function"==typeof U&&S.port1.removeEventListener("message",U),U="function"==typeof e?e:null,"function"==typeof U&&(S.port1.addEventListener("message",U),S.port1.start())}}),m.prototype.port=S.port1;let F=null;bs(f,N,m,g).then((e=>F=e));const z=Fa(g.numberOfInputs,g.channelCount),j=Fa(g.numberOfOutputs,v),H=void 0===m.parameterDescriptors?[]:m.parameterDescriptors.reduce(((e,{name:t})=>({...e,[t]:new Float32Array(128)})),{});let G=!0;const V=()=>{g.numberOfOutputs>0&&C.disconnect(T);for(let e=0,t=0;e<g.numberOfOutputs;e+=1){const n=I[e];for(let r=0;r<v[e];r+=1)T.disconnect(n,t+r,r);t+=v[e]}},W=new Map;C.onaudioprocess=({inputBuffer:e,outputBuffer:t})=>{if(null!==F){const n=d(N);for(let r=0;r<E;r+=128){for(let t=0;t<g.numberOfInputs;t+=1)for(let n=0;n<g.channelCount;n+=1)Da(e,z[t],n,n,r);void 0!==m.parameterDescriptors&&m.parameterDescriptors.forEach((({name:t},n)=>{Da(e,H,t,b+n,r)}));for(let e=0;e<g.numberOfInputs;e+=1)for(let t=0;t<v[e];t+=1)0===j[e][t].byteLength&&(j[e][t]=new Float32Array(128));try{const e=z.map(((e,t)=>{if(n[t].size>0)return W.set(t,E/128),e;const r=W.get(t);return void 0===r?[]:(e.every((e=>e.every((e=>0===e))))&&(1===r?W.delete(t):W.set(t,r-1)),e)})),i=u(f.currentTime+r/f.sampleRate,f.sampleRate,(()=>F.process(e,j,H)));G=i;for(let e=0,n=0;e<g.numberOfOutputs;e+=1){for(let i=0;i<v[e];i+=1)Ua(t,j[e],i,n+i,r);n+=v[e]}}catch(e){G=!1,N.dispatchEvent(new ErrorEvent("processorerror",{colno:e.colno,filename:e.filename,lineno:e.lineno,message:e.message}))}if(!G){for(let e=0;e<g.numberOfInputs;e+=1){x[e].disconnect(M[e]);for(let t=0;t<g.channelCount;t+=1)M[r].disconnect(A,t,e*g.channelCount+t)}if(void 0!==m.parameterDescriptors){const e=m.parameterDescriptors.length;for(let t=0;t<e;t+=1){const e=_[t];e.disconnect(A,0,b+t),e.stop()}}A.disconnect(C),C.onaudioprocess=null,q?V():Q();break}}}};let q=!1;const K=a(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0}),J=()=>C.connect(K).connect(f.destination),Q=()=>{C.disconnect(K),K.disconnect()};return J(),h(N,(()=>{if(G){Q(),g.numberOfOutputs>0&&C.connect(T);for(let e=0,t=0;e<g.numberOfOutputs;e+=1){const n=I[e];for(let r=0;r<v[e];r+=1)T.connect(n,t+r,r);t+=v[e]}}q=!0}),(()=>{G&&(J(),V()),q=!1}))})(Xu,Jo,$a,gc,Ss,xc,_s,Cs,Ts,Zu,hu,ed,hc),id=((e,t,n,r,i)=>(o,a,s,l,c,u)=>{if(null!==s)try{const t=new s(o,l,u),r=new Map;let a=null;if(Object.defineProperties(t,{channelCount:{get:()=>u.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>"explicit",set:()=>{throw e()}},onprocessorerror:{get:()=>a,set:e=>{"function"==typeof a&&t.removeEventListener("processorerror",a),a="function"==typeof e?e:null,"function"==typeof a&&t.addEventListener("processorerror",a)}}}),t.addEventListener=(h=t.addEventListener,(...e)=>{if("processorerror"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=r.get(e[1]);void 0!==n?e[1]=n:(e[1]=n=>{"error"===n.type?(Object.defineProperties(n,{type:{value:"processorerror"}}),t(n)):t(new ErrorEvent(e[0],{...n}))},r.set(t,e[1]))}}return h.call(t,"error",e[1],e[2]),h.call(t,...e)}),t.removeEventListener=(d=t.removeEventListener,(...e)=>{if("processorerror"===e[0]){const t=r.get(e[1]);void 0!==t&&(r.delete(e[1]),e[1]=t)}return d.call(t,"error",e[1],e[2]),d.call(t,e[0],e[1],e[2])}),0!==u.numberOfOutputs){const e=n(o,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(e).connect(o.destination);return i(t,(()=>e.disconnect()),(()=>e.connect(o.destination)))}return t}catch(e){if(11===e.code)throw r();throw e}var d,h;if(void 0===c)throw r();return ps(u),t(o,a,c,u)})($a,rd,_s,Ts,hc),od=((e,t,n,r,i,o,a,s,l,c,u,d,h,f,p,m)=>(g,v,b)=>{const y=new WeakMap;let w=null;return{render(S,x){s(x,S);const M=y.get(x);return void 0!==M?Promise.resolve(M):(async(s,S)=>{let x=u(s),M=null;const _=qo(x,S),A=Array.isArray(v.outputChannelCount)?v.outputChannelCount:Array.from(v.outputChannelCount);if(null===d){const e=A.reduce(((e,t)=>e+t),0),n=i(S,{channelCount:Math.max(1,e),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,e)}),o=[];for(let e=0;e<s.numberOfOutputs;e+=1)o.push(r(S,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:A[e]}));const c=a(S,{channelCount:v.channelCount,channelCountMode:v.channelCountMode,channelInterpretation:v.channelInterpretation,gain:1});c.connect=t.bind(null,o),c.disconnect=l.bind(null,o),M=[n,o,c]}else _||(x=new d(S,g));if(y.set(S,null===M?x:M[2]),null!==M){if(null===w){if(void 0===b)throw new Error("Missing the processor constructor.");if(null===h)throw new Error("Missing the native OfflineAudioContext constructor.");const e=s.channelCount*s.numberOfInputs,t=void 0===b.parameterDescriptors?0:b.parameterDescriptors.length,n=e+t,l=async()=>{const l=new h(n,128*Math.ceil(s.context.length/128),S.sampleRate),c=[],u=[];for(let e=0;e<v.numberOfInputs;e+=1)c.push(a(l,{channelCount:v.channelCount,channelCountMode:v.channelCountMode,channelInterpretation:v.channelInterpretation,gain:1})),u.push(i(l,{channelCount:v.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:v.channelCount}));const d=await Promise.all(Array.from(s.parameters.values()).map((async e=>{const t=o(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:e.value});return await f(l,e,t.offset),t}))),g=r(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,e+t)});for(let e=0;e<v.numberOfInputs;e+=1){c[e].connect(u[e]);for(let t=0;t<v.channelCount;t+=1)u[e].connect(g,t,e*v.channelCount+t)}for(const[t,n]of d.entries())n.connect(g,0,e+t),n.start(0);return g.connect(l.destination),await Promise.all(c.map((e=>p(s,l,e)))),m(l)};w=ja(s,0===n?null:await l(),S,v,A,b,c)}const e=await w,t=n(S,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[l,u,d]=M;null!==e&&(t.buffer=e,t.start(0)),t.connect(l);for(let e=0,t=0;e<s.numberOfOutputs;e+=1){const n=u[e];for(let r=0;r<A[e];r+=1)l.connect(n,t+r,r);t+=A[e]}return d}if(_)for(const[t,n]of s.parameters.entries())await e(S,n,x.parameters.get(t));else for(const[e,t]of s.parameters.entries())await f(S,t,x.parameters.get(e));return await p(s,S,x),x})(S,x)}}})(Wl,Xu,Kl,gc,Ss,xc,_s,Yu,Zu,hu,_a,El,ml,Ql,ll,Dc),ad=(sd=fu,e=>sd.get(e));var sd;const ld=(e=>(t,n)=>{e.set(t,n)})($u),cd=(du&&((e,t,n,r,i,o,a,s,l,c,u,d,h,f)=>{})(Ju,Cl,Yl,od,id,sa,ad,fl,gl,El,(e=>({...e,outputChannelCount:void 0!==e.outputChannelCount?e.outputChannelCount:1===e.numberOfInputs&&1===e.numberOfOutputs?[e.channelCount]:Array.from({length:e.numberOfOutputs},(()=>1))})),ld,(e=>{const{port1:t,port2:n}=new MessageChannel;try{t.postMessage(e)}finally{t.close(),n.close()}}),Vs),((e,t,n,r,i)=>{})($a,Ts,Ns,Vc,Sl),((e,t)=>(n,r,i)=>{if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(n,r,i)}catch(t){if("SyntaxError"===t.name)throw e();throw t}})(Ts,ml)),ud=((e,t,n,r,i,o,a,s)=>(l,c)=>n(l).render(l,c).then((()=>Promise.all(Array.from(r(c)).map((e=>n(e).render(e,c)))))).then((()=>i(c))).then((n=>("function"!=typeof n.copyFromChannel?(a(n),Qo(n)):t(o,(()=>o(n)))||s(n),e.add(n),n))))(kl,$s,al,qu,Dc,Ko,Nl,Bl);dd=Mo,hd=_l;var dd,hd;fd=Ao,pd=Al;var fd,pd;var md={};
61
+ e.exports=function(t){var n={},r=o("kyWRD"),i=o("85Hg2"),a=o("kMsGZ");function s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var l=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,c=60103,u=60106,d=60107,h=60108,f=60114,p=60109,m=60110,g=60112,v=60113,b=60120,y=60115,w=60116,S=60121,x=60129,M=60130,_=60131;if("function"==typeof Symbol&&Symbol.for){var A=Symbol.for;c=A("react.element"),u=A("react.portal"),d=A("react.fragment"),h=A("react.strict_mode"),f=A("react.profiler"),p=A("react.provider"),m=A("react.context"),g=A("react.forward_ref"),v=A("react.suspense"),b=A("react.suspense_list"),y=A("react.memo"),w=A("react.lazy"),S=A("react.block"),A("react.scope"),x=A("react.debug_trace_mode"),M=A("react.offscreen"),_=A("react.legacy_hidden")}var E="function"==typeof Symbol&&Symbol.iterator;function C(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=E&&e[E]||e["@@iterator"])?e:null}function T(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case d:return"Fragment";case u:return"Portal";case f:return"Profiler";case h:return"StrictMode";case v:return"Suspense";case b:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case m:return(e.displayName||"Context")+".Consumer";case p:return(e._context.displayName||"Context")+".Provider";case g:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case y:return T(e.type);case S:return T(e._render);case w:t=e._payload,e=e._init;try{return T(e(t))}catch(e){}}return null}function I(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function k(e){if(I(e)!==e)throw Error(s(188))}function R(e){var t=e.alternate;if(!t){if(null===(t=I(e)))throw Error(s(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(null===i)break;var o=i.alternate;if(null===o){if(null!==(r=i.return)){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return k(i),e;if(o===r)return k(i),t;o=o.sibling}throw Error(s(188))}if(n.return!==r.return)n=i,r=o;else{for(var a=!1,l=i.child;l;){if(l===n){a=!0,n=i,r=o;break}if(l===r){a=!0,r=i,n=o;break}l=l.sibling}if(!a){for(l=o.child;l;){if(l===n){a=!0,n=o,r=i;break}if(l===r){a=!0,r=o,n=i;break}l=l.sibling}if(!a)throw Error(s(189))}}if(n.alternate!==r)throw Error(s(190))}if(3!==n.tag)throw Error(s(188));return n.stateNode.current===n?e:t}function O(e){if(!(e=R(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function P(e,t){for(var n=e.alternate;null!==t;){if(t===e||t===n)return!0;t=t.return}return!1}var N,B=t.getPublicInstance,L=t.getRootHostContext,D=t.getChildHostContext,U=t.prepareForCommit,F=t.resetAfterCommit,z=t.createInstance,j=t.appendInitialChild,H=t.finalizeInitialChildren,G=t.prepareUpdate,V=t.shouldSetTextContent,W=t.createTextInstance,q=t.scheduleTimeout,K=t.cancelTimeout,J=t.noTimeout,Q=t.isPrimaryRenderer,X=t.supportsMutation,Y=t.supportsPersistence,Z=t.supportsHydration,$=t.getInstanceFromNode,ee=t.makeOpaqueHydratingObject,te=t.makeClientId,ne=t.beforeActiveInstanceBlur,re=t.afterActiveInstanceBlur,ie=t.preparePortalMount,oe=t.supportsTestSelectors,ae=t.findFiberRoot,se=t.getBoundingRect,le=t.getTextContent,ce=t.isHiddenSubtree,ue=t.matchAccessibilityRole,de=t.setFocusIfFocusable,he=t.setupIntersectionObserver,fe=t.appendChild,pe=t.appendChildToContainer,me=t.commitTextUpdate,ge=t.commitMount,ve=t.commitUpdate,be=t.insertBefore,ye=t.insertInContainerBefore,we=t.removeChild,Se=t.removeChildFromContainer,xe=t.resetTextContent,Me=t.hideInstance,_e=t.hideTextInstance,Ae=t.unhideInstance,Ee=t.unhideTextInstance,Ce=t.clearContainer,Te=t.cloneInstance,Ie=t.createContainerChildSet,ke=t.appendChildToContainerChildSet,Re=t.finalizeContainerChildren,Oe=t.replaceContainerChildren,Pe=t.cloneHiddenInstance,Ne=t.cloneHiddenTextInstance,Be=t.canHydrateInstance,Le=t.canHydrateTextInstance,De=t.isSuspenseInstancePending,Ue=t.isSuspenseInstanceFallback,Fe=t.getNextHydratableSibling,ze=t.getFirstHydratableChild,je=t.hydrateInstance,He=t.hydrateTextInstance,Ge=t.getNextHydratableInstanceAfterSuspenseInstance,Ve=t.commitHydratedContainer,We=t.commitHydratedSuspenseInstance;function qe(e){if(void 0===N)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);N=t&&t[1]||""}return"\n"+N+e}var Ke=!1;function Je(e,t){if(!e||Ke)return"";Ke=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(e){if(e&&r&&"string"==typeof e.stack){for(var i=e.stack.split("\n"),o=r.stack.split("\n"),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||i[a]!==o[s])return"\n"+i[a].replace(" at new "," at ")}while(1<=a&&0<=s);break}}}finally{Ke=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?qe(e):""}var Qe=[],Xe=-1;function Ye(e){return{current:e}}function Ze(e){0>Xe||(e.current=Qe[Xe],Qe[Xe]=null,Xe--)}function $e(e,t){Xe++,Qe[Xe]=e.current,e.current=t}var et={},tt=Ye(et),nt=Ye(!1),rt=et;function it(e,t){var n=e.type.contextTypes;if(!n)return et;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in n)o[i]=t[i];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ot(e){return null!=(e=e.childContextTypes)}function at(){Ze(nt),Ze(tt)}function st(e,t,n){if(tt.current!==et)throw Error(s(168));$e(tt,t),$e(nt,n)}function lt(e,t,n){var i=e.stateNode;if(e=t.childContextTypes,"function"!=typeof i.getChildContext)return n;for(var o in i=i.getChildContext())if(!(o in e))throw Error(s(108,T(t)||"Unknown",o));return r({},n,i)}function ct(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||et,rt=tt.current,$e(tt,e),$e(nt,nt.current),!0}function ut(e,t,n){var r=e.stateNode;if(!r)throw Error(s(169));n?(e=lt(e,t,rt),r.__reactInternalMemoizedMergedChildContext=e,Ze(nt),Ze(tt),$e(tt,e)):Ze(nt),$e(nt,n)}var dt=null,ht=null;(0,a.unstable_now)();var ft=0,pt=8;function mt(e){if(0!=(1&e))return pt=15,1;if(0!=(2&e))return pt=14,2;if(0!=(4&e))return pt=13,4;var t=24&e;return 0!==t?(pt=12,t):0!=(32&e)?(pt=11,32):0!==(t=192&e)?(pt=10,t):0!=(256&e)?(pt=9,256):0!==(t=3584&e)?(pt=8,t):0!=(4096&e)?(pt=7,4096):0!==(t=4186112&e)?(pt=6,t):0!==(t=62914560&e)?(pt=5,t):67108864&e?(pt=4,67108864):0!=(134217728&e)?(pt=3,134217728):0!==(t=805306368&e)?(pt=2,t):0!=(1073741824&e)?(pt=1,1073741824):(pt=8,e)}function gt(e,t){var n=e.pendingLanes;if(0===n)return pt=0;var r=0,i=0,o=e.expiredLanes,a=e.suspendedLanes,s=e.pingedLanes;if(0!==o)r=o,i=pt=15;else if(0!==(o=134217727&n)){var l=o&~a;0!==l?(r=mt(l),i=pt):0!==(s&=o)&&(r=mt(s),i=pt)}else 0!==(o=n&~a)?(r=mt(o),i=pt):0!==s&&(r=mt(s),i=pt);if(0===r)return 0;if(r=n&((0>(r=31-xt(r))?0:1<<r)<<1)-1,0!==t&&t!==r&&0==(t&a)){if(mt(t),i<=pt)return t;pt=i}if(0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)i=1<<(n=31-xt(t)),r|=e[n],t&=~i;return r}function vt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function bt(e,t){switch(e){case 15:return 1;case 14:return 2;case 12:return 0===(e=yt(24&~t))?bt(10,t):e;case 10:return 0===(e=yt(192&~t))?bt(8,t):e;case 8:return 0===(e=yt(3584&~t))&&(0===(e=yt(4186112&~t))&&(e=512)),e;case 2:return 0===(t=yt(805306368&~t))&&(t=268435456),t}throw Error(s(358,e))}function yt(e){return e&-e}function wt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function St(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,(e=e.eventTimes)[t=31-xt(t)]=n}var xt=Math.clz32?Math.clz32:function(e){return 0===e?32:31-(Mt(e)/_t|0)|0},Mt=Math.log,_t=Math.LN2;var At=a.unstable_runWithPriority,Et=a.unstable_scheduleCallback,Ct=a.unstable_cancelCallback,Tt=a.unstable_shouldYield,It=a.unstable_requestPaint,kt=a.unstable_now,Rt=a.unstable_getCurrentPriorityLevel,Ot=a.unstable_ImmediatePriority,Pt=a.unstable_UserBlockingPriority,Nt=a.unstable_NormalPriority,Bt=a.unstable_LowPriority,Lt=a.unstable_IdlePriority,Dt={},Ut=void 0!==It?It:function(){},Ft=null,zt=null,jt=!1,Ht=kt(),Gt=1e4>Ht?kt:function(){return kt()-Ht};function Vt(){switch(Rt()){case Ot:return 99;case Pt:return 98;case Nt:return 97;case Bt:return 96;case Lt:return 95;default:throw Error(s(332))}}function Wt(e){switch(e){case 99:return Ot;case 98:return Pt;case 97:return Nt;case 96:return Bt;case 95:return Lt;default:throw Error(s(332))}}function qt(e,t){return e=Wt(e),At(e,t)}function Kt(e,t,n){return e=Wt(e),Et(e,t,n)}function Jt(){if(null!==zt){var e=zt;zt=null,Ct(e)}Qt()}function Qt(){if(!jt&&null!==Ft){jt=!0;var e=0;try{var t=Ft;qt(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Ft=null}catch(t){throw null!==Ft&&(Ft=Ft.slice(e+1)),Et(Ot,Jt),t}finally{jt=!1}}}var Xt=l.ReactCurrentBatchConfig;var Yt="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Zt=Object.prototype.hasOwnProperty;function $t(e,t){if(Yt(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++)if(!Zt.call(t,n[r])||!Yt(e[n[r]],t[n[r]]))return!1;return!0}function en(e){switch(e.tag){case 5:return qe(e.type);case 16:return qe("Lazy");case 13:return qe("Suspense");case 19:return qe("SuspenseList");case 0:case 2:case 15:return e=Je(e.type,!1);case 11:return e=Je(e.type.render,!1);case 22:return e=Je(e.type._render,!1);case 1:return e=Je(e.type,!0);default:return""}}function tn(e,t){if(e&&e.defaultProps){for(var n in t=r({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var nn=Ye(null),rn=null,on=null,an=null;function sn(){an=on=rn=null}function ln(e,t){e=e.type._context,Q?($e(nn,e._currentValue),e._currentValue=t):($e(nn,e._currentValue2),e._currentValue2=t)}function cn(e){var t=nn.current;Ze(nn),e=e.type._context,Q?e._currentValue=t:e._currentValue2=t}function un(e,t){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)===t){if(null===n||(n.childLanes&t)===t)break;n.childLanes|=t}else e.childLanes|=t,null!==n&&(n.childLanes|=t);e=e.return}}function dn(e,t){rn=e,an=on=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!=(e.lanes&t)&&(Hr=!0),e.firstContext=null)}function hn(e,t){if(an!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(an=e,t=1073741823),t={context:e,observedBits:t,next:null},null===on){if(null===rn)throw Error(s(308));on=t,rn.dependencies={lanes:0,firstContext:t,responders:null}}else on=on.next=t;return Q?e._currentValue:e._currentValue2}var fn=!1;function pn(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function mn(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function gn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function vn(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function bn(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var i=null,o=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===o?i=o=a:o=o.next=a,n=n.next}while(null!==n);null===o?i=o=t:o=o.next=t}else i=o=t;return n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function yn(e,t,n,i){var o=e.updateQueue;fn=!1;var a=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(null!==l){o.shared.pending=null;var c=l,u=c.next;c.next=null,null===s?a=u:s.next=u,s=c;var d=e.alternate;if(null!==d){var h=(d=d.updateQueue).lastBaseUpdate;h!==s&&(null===h?d.firstBaseUpdate=u:h.next=u,d.lastBaseUpdate=c)}}if(null!==a){for(h=o.baseState,s=0,d=u=c=null;;){l=a.lane;var f=a.eventTime;if((i&l)===l){null!==d&&(d=d.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var p=e,m=a;switch(l=t,f=n,m.tag){case 1:if("function"==typeof(p=m.payload)){h=p.call(f,h,l);break e}h=p;break e;case 3:p.flags=-4097&p.flags|64;case 0:if(null==(l="function"==typeof(p=m.payload)?p.call(f,h,l):p))break e;h=r({},h,l);break e;case 2:fn=!0}}null!==a.callback&&(e.flags|=32,null===(l=o.effects)?o.effects=[a]:l.push(a))}else f={eventTime:f,lane:l,tag:a.tag,payload:a.payload,callback:a.callback,next:null},null===d?(u=d=f,c=h):d=d.next=f,s|=l;if(null===(a=a.next)){if(null===(l=o.shared.pending))break;a=l.next,l.next=null,o.lastBaseUpdate=l,o.shared.pending=null}}null===d&&(c=h),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,ho|=s,e.lanes=s,e.memoizedState=h}}function wn(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(null!==i){if(r.callback=null,r=n,"function"!=typeof i)throw Error(s(191,i));i.call(r)}}}var Sn=(new i.Component).refs;function xn(e,t,n,i){n=null==(n=n(i,t=e.memoizedState))?t:r({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Mn={isMounted:function(e){return!!(e=e._reactInternals)&&I(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Do(),i=Uo(e),o=gn(r,i);o.payload=t,null!=n&&(o.callback=n),vn(e,o),Fo(e,i,r)},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Do(),i=Uo(e),o=gn(r,i);o.tag=1,o.payload=t,null!=n&&(o.callback=n),vn(e,o),Fo(e,i,r)},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Do(),r=Uo(e),i=gn(n,r);i.tag=2,null!=t&&(i.callback=t),vn(e,i),Fo(e,r,n)}};function _n(e,t,n,r,i,o,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!$t(n,r)||!$t(i,o))}function An(e,t,n){var r=!1,i=et,o=t.contextType;return"object"==typeof o&&null!==o?o=hn(o):(i=ot(t)?rt:tt.current,o=(r=null!=(r=t.contextTypes))?it(e,i):et),t=new t(n,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Mn,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function En(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Mn.enqueueReplaceState(t,t.state,null)}function Cn(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs=Sn,pn(e);var o=t.contextType;"object"==typeof o&&null!==o?i.context=hn(o):(o=ot(t)?rt:tt.current,i.context=it(e,o)),yn(e,n,i,r),i.state=e.memoizedState,"function"==typeof(o=t.getDerivedStateFromProps)&&(xn(e,t,o,n),i.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof i.getSnapshotBeforeUpdate||"function"!=typeof i.UNSAFE_componentWillMount&&"function"!=typeof i.componentWillMount||(t=i.state,"function"==typeof i.componentWillMount&&i.componentWillMount(),"function"==typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&Mn.enqueueReplaceState(i,i.state,null),yn(e,n,i,r),i.state=e.memoizedState),"function"==typeof i.componentDidMount&&(e.flags|=4)}var Tn=Array.isArray;function In(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(s(309));var r=n.stateNode}if(!r)throw Error(s(147,e));var i=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===i?t.ref:(t=function(e){var t=r.refs;t===Sn&&(t=r.refs={}),null===e?delete t[i]:t[i]=e},t._stringRef=i,t)}if("string"!=typeof e)throw Error(s(284));if(!n._owner)throw Error(s(290,e))}return e}function kn(e,t){if("textarea"!==e.type)throw Error(s(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t))}function Rn(e){function t(t,n){if(e){var r=t.lastEffect;null!==r?(r.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.flags=8}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=_a(e,t)).index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags=2,n):r:(t.flags=2,n):n}function a(t){return e&&null===t.alternate&&(t.flags=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Ta(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function h(e,t,n,r){return null!==t&&t.elementType===n.type?((r=i(t,n.props)).ref=In(e,t,n),r.return=e,r):((r=Aa(n.type,n.key,n.props,null,e.mode,r)).ref=In(e,t,n),r.return=e,r)}function f(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Ia(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function p(e,t,n,r,o){return null===t||7!==t.tag?((t=Ea(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function m(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=Ta(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case c:return(n=Aa(t.type,t.key,t.props,null,e.mode,n)).ref=In(e,null,t),n.return=e,n;case u:return(t=Ia(t,e.mode,n)).return=e,t}if(Tn(t)||C(t))return(t=Ea(t,e.mode,n,null)).return=e,t;kn(e,t)}return null}function g(e,t,n,r){var i=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==i?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case c:return n.key===i?n.type===d?p(e,t,n.props.children,r,i):h(e,t,n,r):null;case u:return n.key===i?f(e,t,n,r):null}if(Tn(n)||C(n))return null!==i?null:p(e,t,n,r,null);kn(e,n)}return null}function v(e,t,n,r,i){if("string"==typeof r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,i);if("object"==typeof r&&null!==r){switch(r.$$typeof){case c:return e=e.get(null===r.key?n:r.key)||null,r.type===d?p(t,e,r.props.children,i,r.key):h(t,e,r,i);case u:return f(t,e=e.get(null===r.key?n:r.key)||null,r,i)}if(Tn(r)||C(r))return p(t,e=e.get(n)||null,r,i,null);kn(t,r)}return null}function b(i,a,s,l){for(var c=null,u=null,d=a,h=a=0,f=null;null!==d&&h<s.length;h++){d.index>h?(f=d,d=null):f=d.sibling;var p=g(i,d,s[h],l);if(null===p){null===d&&(d=f);break}e&&d&&null===p.alternate&&t(i,d),a=o(p,a,h),null===u?c=p:u.sibling=p,u=p,d=f}if(h===s.length)return n(i,d),c;if(null===d){for(;h<s.length;h++)null!==(d=m(i,s[h],l))&&(a=o(d,a,h),null===u?c=d:u.sibling=d,u=d);return c}for(d=r(i,d);h<s.length;h++)null!==(f=v(d,i,h,s[h],l))&&(e&&null!==f.alternate&&d.delete(null===f.key?h:f.key),a=o(f,a,h),null===u?c=f:u.sibling=f,u=f);return e&&d.forEach((function(e){return t(i,e)})),c}function y(i,a,l,c){var u=C(l);if("function"!=typeof u)throw Error(s(150));if(null==(l=u.call(l)))throw Error(s(151));for(var d=u=null,h=a,f=a=0,p=null,b=l.next();null!==h&&!b.done;f++,b=l.next()){h.index>f?(p=h,h=null):p=h.sibling;var y=g(i,h,b.value,c);if(null===y){null===h&&(h=p);break}e&&h&&null===y.alternate&&t(i,h),a=o(y,a,f),null===d?u=y:d.sibling=y,d=y,h=p}if(b.done)return n(i,h),u;if(null===h){for(;!b.done;f++,b=l.next())null!==(b=m(i,b.value,c))&&(a=o(b,a,f),null===d?u=b:d.sibling=b,d=b);return u}for(h=r(i,h);!b.done;f++,b=l.next())null!==(b=v(h,i,f,b.value,c))&&(e&&null!==b.alternate&&h.delete(null===b.key?f:b.key),a=o(b,a,f),null===d?u=b:d.sibling=b,d=b);return e&&h.forEach((function(e){return t(i,e)})),u}return function(e,r,o,l){var h="object"==typeof o&&null!==o&&o.type===d&&null===o.key;h&&(o=o.props.children);var f="object"==typeof o&&null!==o;if(f)switch(o.$$typeof){case c:e:{for(f=o.key,h=r;null!==h;){if(h.key===f){if(7===h.tag){if(o.type===d){n(e,h.sibling),(r=i(h,o.props.children)).return=e,e=r;break e}}else if(h.elementType===o.type){n(e,h.sibling),(r=i(h,o.props)).ref=In(e,h,o),r.return=e,e=r;break e}n(e,h);break}t(e,h),h=h.sibling}o.type===d?((r=Ea(o.props.children,e.mode,l,o.key)).return=e,e=r):((l=Aa(o.type,o.key,o.props,null,e.mode,l)).ref=In(e,r,o),l.return=e,e=l)}return a(e);case u:e:{for(h=o.key;null!==r;){if(r.key===h){if(4===r.tag&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),(r=i(r,o.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Ia(o,e.mode,l)).return=e,e=r}return a(e)}if("string"==typeof o||"number"==typeof o)return o=""+o,null!==r&&6===r.tag?(n(e,r.sibling),(r=i(r,o)).return=e,e=r):(n(e,r),(r=Ta(o,e.mode,l)).return=e,e=r),a(e);if(Tn(o))return b(e,r,o,l);if(C(o))return y(e,r,o,l);if(f&&kn(e,o),void 0===o&&!h)switch(e.tag){case 1:case 22:case 0:case 11:case 15:throw Error(s(152,T(e.type)||"Component"))}return n(e,r)}}var On=Rn(!0),Pn=Rn(!1),Nn={},Bn=Ye(Nn),Ln=Ye(Nn),Dn=Ye(Nn);function Un(e){if(e===Nn)throw Error(s(174));return e}function Fn(e,t){$e(Dn,t),$e(Ln,e),$e(Bn,Nn),e=L(t),Ze(Bn),$e(Bn,e)}function zn(){Ze(Bn),Ze(Ln),Ze(Dn)}function jn(e){var t=Un(Dn.current),n=Un(Bn.current);n!==(t=D(n,e.type,t))&&($e(Ln,e),$e(Bn,t))}function Hn(e){Ln.current===e&&(Ze(Bn),Ze(Ln))}var Gn=Ye(0);function Vn(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||De(n)||Ue(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wn=null,qn=null,Kn=!1;function Jn(e,t){var n=xa(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Qn(e,t){switch(e.tag){case 5:return null!==(t=Be(t,e.type,e.pendingProps))&&(e.stateNode=t,!0);case 6:return null!==(t=Le(t,e.pendingProps))&&(e.stateNode=t,!0);default:return!1}}function Xn(e){if(Kn){var t=qn;if(t){var n=t;if(!Qn(e,t)){if(!(t=Fe(n))||!Qn(e,t))return e.flags=-1025&e.flags|2,Kn=!1,void(Wn=e);Jn(Wn,n)}Wn=e,qn=ze(t)}else e.flags=-1025&e.flags|2,Kn=!1,Wn=e}}function Yn(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Wn=e}function Zn(e){if(!Z||e!==Wn)return!1;if(!Kn)return Yn(e),Kn=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!V(t,e.memoizedProps))for(t=qn;t;)Jn(e,t),t=Fe(t);if(Yn(e),13===e.tag){if(!Z)throw Error(s(316));if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(s(317));qn=Ge(e)}else qn=Wn?Fe(e.stateNode):null;return!0}function $n(){Z&&(qn=Wn=null,Kn=!1)}var er=[];function tr(){for(var e=0;e<er.length;e++){var t=er[e];Q?t._workInProgressVersionPrimary=null:t._workInProgressVersionSecondary=null}er.length=0}var nr=l.ReactCurrentDispatcher,rr=l.ReactCurrentBatchConfig,ir=0,or=null,ar=null,sr=null,lr=!1,cr=!1;function ur(){throw Error(s(321))}function dr(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yt(e[n],t[n]))return!1;return!0}function hr(e,t,n,r,i,o){if(ir=o,or=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,nr.current=null===e||null===e.memoizedState?Ur:Fr,e=n(r,i),cr){o=0;do{if(cr=!1,!(25>o))throw Error(s(301));o+=1,sr=ar=null,t.updateQueue=null,nr.current=zr,e=n(r,i)}while(cr)}if(nr.current=Dr,t=null!==ar&&null!==ar.next,ir=0,sr=ar=or=null,lr=!1,t)throw Error(s(300));return e}function fr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===sr?or.memoizedState=sr=e:sr=sr.next=e,sr}function pr(){if(null===ar){var e=or.alternate;e=null!==e?e.memoizedState:null}else e=ar.next;var t=null===sr?or.memoizedState:sr.next;if(null!==t)sr=t,ar=e;else{if(null===e)throw Error(s(310));e={memoizedState:(ar=e).memoizedState,baseState:ar.baseState,baseQueue:ar.baseQueue,queue:ar.queue,next:null},null===sr?or.memoizedState=sr=e:sr=sr.next=e}return sr}function mr(e,t){return"function"==typeof t?t(e):t}function gr(e){var t=pr(),n=t.queue;if(null===n)throw Error(s(311));n.lastRenderedReducer=e;var r=ar,i=r.baseQueue,o=n.pending;if(null!==o){if(null!==i){var a=i.next;i.next=o.next,o.next=a}r.baseQueue=i=o,n.pending=null}if(null!==i){i=i.next,r=r.baseState;var l=a=o=null,c=i;do{var u=c.lane;if((ir&u)===u)null!==l&&(l=l.next={lane:0,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null}),r=c.eagerReducer===e?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,eagerReducer:c.eagerReducer,eagerState:c.eagerState,next:null};null===l?(a=l=d,o=r):l=l.next=d,or.lanes|=u,ho|=u}c=c.next}while(null!==c&&c!==i);null===l?o=r:l.next=a,Yt(r,t.memoizedState)||(Hr=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function vr(e){var t=pr(),n=t.queue;if(null===n)throw Error(s(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(null!==i){n.pending=null;var a=i=i.next;do{o=e(o,a.action),a=a.next}while(a!==i);Yt(o,t.memoizedState)||(Hr=!0),t.memoizedState=o,null===t.baseQueue&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function br(e,t,n){var r=t._getVersion;r=r(t._source);var i=Q?t._workInProgressVersionPrimary:t._workInProgressVersionSecondary;if(null!==i?e=i===r:(e=e.mutableReadLanes,(e=(ir&e)===e)&&(Q?t._workInProgressVersionPrimary=r:t._workInProgressVersionSecondary=r,er.push(t))),e)return n(t._source);throw er.push(t),Error(s(350))}function yr(e,t,n,r){var i=ro;if(null===i)throw Error(s(349));var o=t._getVersion,a=o(t._source),l=nr.current,c=l.useState((function(){return br(i,t,n)})),u=c[1],d=c[0];c=sr;var h=e.memoizedState,f=h.refs,p=f.getSnapshot,m=h.source;h=h.subscribe;var g=or;return e.memoizedState={refs:f,source:t,subscribe:r},l.useEffect((function(){f.getSnapshot=n,f.setSnapshot=u;var e=o(t._source);if(!Yt(a,e)){e=n(t._source),Yt(d,e)||(u(e),e=Uo(g),i.mutableReadLanes|=e&i.pendingLanes),e=i.mutableReadLanes,i.entangledLanes|=e;for(var r=i.entanglements,s=e;0<s;){var l=31-xt(s),c=1<<l;r[l]|=e,s&=~c}}}),[n,t,r]),l.useEffect((function(){return r(t._source,(function(){var e=f.getSnapshot,n=f.setSnapshot;try{n(e(t._source));var r=Uo(g);i.mutableReadLanes|=r&i.pendingLanes}catch(e){n((function(){throw e}))}}))}),[t,r]),Yt(p,n)&&Yt(m,t)&&Yt(h,r)||((e={pending:null,dispatch:null,lastRenderedReducer:mr,lastRenderedState:d}).dispatch=u=Lr.bind(null,or,e),c.queue=e,c.baseQueue=null,d=br(i,t,n),c.memoizedState=c.baseState=d),d}function wr(e,t,n){return yr(pr(),e,t,n)}function Sr(e){var t=fr();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:mr,lastRenderedState:e}).dispatch=Lr.bind(null,or,e),[t.memoizedState,e]}function xr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=or.updateQueue)?(t={lastEffect:null},or.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Mr(e){return e={current:e},fr().memoizedState=e}function _r(){return pr().memoizedState}function Ar(e,t,n,r){var i=fr();or.flags|=e,i.memoizedState=xr(1|t,n,void 0,void 0===r?null:r)}function Er(e,t,n,r){var i=pr();r=void 0===r?null:r;var o=void 0;if(null!==ar){var a=ar.memoizedState;if(o=a.destroy,null!==r&&dr(r,a.deps))return void xr(t,n,o,r)}or.flags|=e,i.memoizedState=xr(1|t,n,o,r)}function Cr(e,t){return Ar(516,4,e,t)}function Tr(e,t){return Er(516,4,e,t)}function Ir(e,t){return Er(4,2,e,t)}function kr(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Rr(e,t,n){return n=null!=n?n.concat([e]):null,Er(4,2,kr.bind(null,t,e),n)}function Or(){}function Pr(e,t){var n=pr();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&dr(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Nr(e,t){var n=pr();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&dr(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Br(e,t){var n=Vt();qt(98>n?98:n,(function(){e(!0)})),qt(97<n?97:n,(function(){var n=rr.transition;rr.transition=1;try{e(!1),t()}finally{rr.transition=n}}))}function Lr(e,t,n){var r=Do(),i=Uo(e),o={lane:i,action:n,eagerReducer:null,eagerState:null,next:null},a=t.pending;if(null===a?o.next=o:(o.next=a.next,a.next=o),t.pending=o,a=e.alternate,e===or||null!==a&&a===or)cr=lr=!0;else{if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var s=t.lastRenderedState,l=a(s,n);if(o.eagerReducer=a,o.eagerState=l,Yt(l,s))return}catch(e){}Fo(e,i,r)}}var Dr={readContext:hn,useCallback:ur,useContext:ur,useEffect:ur,useImperativeHandle:ur,useLayoutEffect:ur,useMemo:ur,useReducer:ur,useRef:ur,useState:ur,useDebugValue:ur,useDeferredValue:ur,useTransition:ur,useMutableSource:ur,useOpaqueIdentifier:ur,unstable_isNewReconciler:!1},Ur={readContext:hn,useCallback:function(e,t){return fr().memoizedState=[e,void 0===t?null:t],e},useContext:hn,useEffect:Cr,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ar(4,2,kr.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ar(4,2,e,t)},useMemo:function(e,t){var n=fr();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=fr();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=Lr.bind(null,or,e),[r.memoizedState,e]},useRef:Mr,useState:Sr,useDebugValue:Or,useDeferredValue:function(e){var t=Sr(e),n=t[0],r=t[1];return Cr((function(){var t=rr.transition;rr.transition=1;try{r(e)}finally{rr.transition=t}}),[e]),n},useTransition:function(){var e=Sr(!1),t=e[0];return Mr(e=Br.bind(null,e[1])),[e,t]},useMutableSource:function(e,t,n){var r=fr();return r.memoizedState={refs:{getSnapshot:t,setSnapshot:null},source:e,subscribe:n},yr(r,e,t,n)},useOpaqueIdentifier:function(){if(Kn){var e=!1,t=ee((function(){throw e||(e=!0,n(te())),Error(s(355))})),n=Sr(t)[1];return 0==(2&or.mode)&&(or.flags|=516,xr(5,(function(){n(te())}),void 0,null)),t}return Sr(t=te()),t},unstable_isNewReconciler:!1},Fr={readContext:hn,useCallback:Pr,useContext:hn,useEffect:Tr,useImperativeHandle:Rr,useLayoutEffect:Ir,useMemo:Nr,useReducer:gr,useRef:_r,useState:function(){return gr(mr)},useDebugValue:Or,useDeferredValue:function(e){var t=gr(mr),n=t[0],r=t[1];return Tr((function(){var t=rr.transition;rr.transition=1;try{r(e)}finally{rr.transition=t}}),[e]),n},useTransition:function(){var e=gr(mr)[0];return[_r().current,e]},useMutableSource:wr,useOpaqueIdentifier:function(){return gr(mr)[0]},unstable_isNewReconciler:!1},zr={readContext:hn,useCallback:Pr,useContext:hn,useEffect:Tr,useImperativeHandle:Rr,useLayoutEffect:Ir,useMemo:Nr,useReducer:vr,useRef:_r,useState:function(){return vr(mr)},useDebugValue:Or,useDeferredValue:function(e){var t=vr(mr),n=t[0],r=t[1];return Tr((function(){var t=rr.transition;rr.transition=1;try{r(e)}finally{rr.transition=t}}),[e]),n},useTransition:function(){var e=vr(mr)[0];return[_r().current,e]},useMutableSource:wr,useOpaqueIdentifier:function(){return vr(mr)[0]},unstable_isNewReconciler:!1},jr=l.ReactCurrentOwner,Hr=!1;function Gr(e,t,n,r){t.child=null===e?Pn(t,null,n,r):On(t,e.child,n,r)}function Vr(e,t,n,r,i){n=n.render;var o=t.ref;return dn(t,i),r=hr(e,t,n,r,o,i),null===e||Hr?(t.flags|=1,Gr(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,di(e,t,i))}function Wr(e,t,n,r,i,o){if(null===e){var a=n.type;return"function"!=typeof a||Ma(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Aa(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,qr(e,t,a,r,i,o))}return a=e.child,0==(i&o)&&(i=a.memoizedProps,(n=null!==(n=n.compare)?n:$t)(i,r)&&e.ref===t.ref)?di(e,t,o):(t.flags|=1,(e=_a(a,r)).ref=t.ref,e.return=t,t.child=e)}function qr(e,t,n,r,i,o){if(null!==e&&$t(e.memoizedProps,r)&&e.ref===t.ref){if(Hr=!1,0==(o&i))return t.lanes=e.lanes,di(e,t,o);0!=(16384&e.flags)&&(Hr=!0)}return Qr(e,t,n,r,o)}function Kr(e,t,n){var r=t.pendingProps,i=r.children,o=null!==e?e.memoizedState:null;if("hidden"===r.mode||"unstable-defer-without-hiding"===r.mode)if(0==(4&t.mode))t.memoizedState={baseLanes:0},Ko(t,n);else{if(0==(1073741824&n))return e=null!==o?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e},Ko(t,e),null;t.memoizedState={baseLanes:0},Ko(t,null!==o?o.baseLanes:n)}else null!==o?(r=o.baseLanes|n,t.memoizedState=null):r=n,Ko(t,r);return Gr(e,t,i,n),t.child}function Jr(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=128)}function Qr(e,t,n,r,i){var o=ot(n)?rt:tt.current;return o=it(t,o),dn(t,i),n=hr(e,t,n,r,o,i),null===e||Hr?(t.flags|=1,Gr(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-517,e.lanes&=~i,di(e,t,i))}function Xr(e,t,n,r,i){if(ot(n)){var o=!0;ct(t)}else o=!1;if(dn(t,i),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),An(t,n,r),Cn(t,n,r,i),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=hn(c):c=it(t,c=ot(n)?rt:tt.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==c)&&En(t,a,r,c),fn=!1;var h=t.memoizedState;a.state=h,yn(t,r,a,i),l=t.memoizedState,s!==r||h!==l||nt.current||fn?("function"==typeof u&&(xn(t,n,u,r),l=t.memoizedState),(s=fn||_n(t,n,s,r,h,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4)):("function"==typeof a.componentDidMount&&(t.flags|=4),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=c,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4),r=!1)}else{a=t.stateNode,mn(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:tn(t.type,s),a.props=c,d=t.pendingProps,h=a.context,"object"==typeof(l=n.contextType)&&null!==l?l=hn(l):l=it(t,l=ot(n)?rt:tt.current);var f=n.getDerivedStateFromProps;(u="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||h!==l)&&En(t,a,r,l),fn=!1,h=t.memoizedState,a.state=h,yn(t,r,a,i);var p=t.memoizedState;s!==d||h!==p||nt.current||fn?("function"==typeof f&&(xn(t,n,f,r),p=t.memoizedState),(c=fn||_n(t,n,c,r,h,p,l))?(u||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,p,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,p,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=256)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=256),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=l,r=c):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=256),r=!1)}return Yr(e,t,n,r,o,i)}function Yr(e,t,n,r,i,o){Jr(e,t);var a=0!=(64&t.flags);if(!r&&!a)return i&&ut(t,n,!1),di(e,t,o);r=t.stateNode,jr.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=On(t,e.child,null,o),t.child=On(t,null,s,o)):Gr(e,t,s,o),t.memoizedState=r.state,i&&ut(t,n,!0),t.child}function Zr(e){var t=e.stateNode;t.pendingContext?st(0,t.pendingContext,t.pendingContext!==t.context):t.context&&st(0,t.context,!1),Fn(e,t.containerInfo)}var $r,ei,ti,ni,ri={dehydrated:null,retryLane:0};function ii(e,t,n){var r,i=t.pendingProps,o=Gn.current,a=!1;return(r=0!=(64&t.flags))||(r=(null===e||null!==e.memoizedState)&&0!=(2&o)),r?(a=!0,t.flags&=-65):null!==e&&null===e.memoizedState||void 0===i.fallback||!0===i.unstable_avoidThisFallback||(o|=1),$e(Gn,1&o),null===e?(void 0!==i.fallback&&Xn(t),e=i.children,o=i.fallback,a?(e=oi(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=ri,e):"number"==typeof i.unstable_expectedLoadTime?(e=oi(t,e,o,n),t.child.memoizedState={baseLanes:n},t.memoizedState=ri,t.lanes=33554432,e):((n=Ca({mode:"visible",children:e},t.mode,n,null)).return=t,t.child=n)):(e.memoizedState,a?(i=si(e,t,i.children,i.fallback,n),a=t.child,o=e.child.memoizedState,a.memoizedState=null===o?{baseLanes:n}:{baseLanes:o.baseLanes|n},a.childLanes=e.childLanes&~n,t.memoizedState=ri,i):(n=ai(e,t,i.children,n),t.memoizedState=null,n))}function oi(e,t,n,r){var i=e.mode,o=e.child;return t={mode:"hidden",children:t},0==(2&i)&&null!==o?(o.childLanes=0,o.pendingProps=t):o=Ca(t,i,0,null),n=Ea(n,i,r,null),o.return=e,n.return=e,o.sibling=n,e.child=o,n}function ai(e,t,n,r){var i=e.child;return e=i.sibling,n=_a(i,{mode:"visible",children:n}),0==(2&t.mode)&&(n.lanes=r),n.return=t,n.sibling=null,null!==e&&(e.nextEffect=null,e.flags=8,t.firstEffect=t.lastEffect=e),t.child=n}function si(e,t,n,r,i){var o=t.mode,a=e.child;e=a.sibling;var s={mode:"hidden",children:n};return 0==(2&o)&&t.child!==a?((n=t.child).childLanes=0,n.pendingProps=s,null!==(a=n.lastEffect)?(t.firstEffect=n.firstEffect,t.lastEffect=a,a.nextEffect=null):t.firstEffect=t.lastEffect=null):n=_a(a,s),null!==e?r=_a(e,r):(r=Ea(r,o,i,null)).flags|=2,r.return=t,n.return=t,n.sibling=r,t.child=n,r}function li(e,t){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),un(e.return,t)}function ci(e,t,n,r,i,o){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,lastEffect:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i,a.lastEffect=o)}function ui(e,t,n){var r=t.pendingProps,i=r.revealOrder,o=r.tail;if(Gr(e,t,r.children,n),0!=(2&(r=Gn.current)))r=1&r|2,t.flags|=64;else{if(null!==e&&0!=(64&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&li(e,n);else if(19===e.tag)li(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if($e(Gn,r),0==(2&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;null!==n;)null!==(e=n.alternate)&&null===Vn(e)&&(i=n),n=n.sibling;null===(n=i)?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ci(t,!1,i,n,o,t.lastEffect);break;case"backwards":for(n=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===Vn(e)){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ci(t,!0,n,null,o,t.lastEffect);break;case"together":ci(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function di(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),ho|=t.lanes,0!=(n&t.childLanes)){if(null!==e&&t.child!==e.child)throw Error(s(153));if(null!==t.child){for(n=_a(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=_a(e,e.pendingProps)).return=t;n.sibling=null}return t.child}return null}function hi(e){e.flags|=4}if(X)$r=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)j(e,n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},ei=function(){},ti=function(e,t,n,r,i){if((e=e.memoizedProps)!==r){var o=t.stateNode,a=Un(Bn.current);n=G(o,n,e,r,i,a),(t.updateQueue=n)&&hi(t)}},ni=function(e,t,n,r){n!==r&&hi(t)};else if(Y){$r=function(e,t,n,r){for(var i=t.child;null!==i;){if(5===i.tag){var o=i.stateNode;n&&r&&(o=Pe(o,i.type,i.memoizedProps,i)),j(e,o)}else if(6===i.tag)o=i.stateNode,n&&r&&(o=Ne(o,i.memoizedProps,i)),j(e,o);else if(4!==i.tag){if(13===i.tag&&0!=(4&i.flags)&&(o=null!==i.memoizedState)){var a=i.child;if(null!==a&&(null!==a.child&&(a.child.return=a,$r(e,a,!0,o)),null!==(o=a.sibling))){o.return=i,i=o;continue}}if(null!==i.child){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};var fi=function(e,t,n,r){for(var i=t.child;null!==i;){if(5===i.tag){var o=i.stateNode;n&&r&&(o=Pe(o,i.type,i.memoizedProps,i)),ke(e,o)}else if(6===i.tag)o=i.stateNode,n&&r&&(o=Ne(o,i.memoizedProps,i)),ke(e,o);else if(4!==i.tag){if(13===i.tag&&0!=(4&i.flags)&&(o=null!==i.memoizedState)){var a=i.child;if(null!==a&&(null!==a.child&&(a.child.return=a,fi(e,a,!0,o)),null!==(o=a.sibling))){o.return=i,i=o;continue}}if(null!==i.child){i.child.return=i,i=i.child;continue}}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};ei=function(e){var t=e.stateNode;if(null!==e.firstEffect){var n=t.containerInfo,r=Ie(n);fi(r,e,!1,!1),t.pendingChildren=r,hi(e),Re(n,r)}},ti=function(e,t,n,r,i){var o=e.stateNode,a=e.memoizedProps;if((e=null===t.firstEffect)&&a===r)t.stateNode=o;else{var s=t.stateNode,l=Un(Bn.current),c=null;a!==r&&(c=G(s,n,a,r,i,l)),e&&null===c?t.stateNode=o:(o=Te(o,c,n,a,r,t,e,s),H(o,n,r,i,l)&&hi(t),t.stateNode=o,e?hi(t):$r(o,t,!1,!1))}},ni=function(e,t,n,r){n!==r?(e=Un(Dn.current),n=Un(Bn.current),t.stateNode=W(r,e,n,t),hi(t)):t.stateNode=e.stateNode}}else ei=function(){},ti=function(){},ni=function(){};function pi(e,t){if(!Kn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function mi(e,t,n){var r=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:case 17:return ot(t.type)&&at(),null;case 3:return zn(),Ze(nt),Ze(tt),tr(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(Zn(t)?hi(t):r.hydrate||(t.flags|=256)),ei(t),null;case 5:Hn(t);var i=Un(Dn.current);if(n=t.type,null!==e&&null!=t.stateNode)ti(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=128);else{if(!r){if(null===t.stateNode)throw Error(s(166));return null}if(e=Un(Bn.current),Zn(t)){if(!Z)throw Error(s(175));e=je(t.stateNode,t.type,t.memoizedProps,i,e,t),t.updateQueue=e,null!==e&&hi(t)}else{var o=z(n,r,i,e,t);$r(o,t,!1,!1),t.stateNode=o,H(o,n,r,i,e)&&hi(t)}null!==t.ref&&(t.flags|=128)}return null;case 6:if(e&&null!=t.stateNode)ni(e,t,e.memoizedProps,r);else{if("string"!=typeof r&&null===t.stateNode)throw Error(s(166));if(e=Un(Dn.current),i=Un(Bn.current),Zn(t)){if(!Z)throw Error(s(176));He(t.stateNode,t.memoizedProps,t)&&hi(t)}else t.stateNode=W(r,e,i,t)}return null;case 13:return Ze(Gn),r=t.memoizedState,0!=(64&t.flags)?(t.lanes=n,t):(r=null!==r,i=!1,null===e?void 0!==t.memoizedProps.fallback&&Zn(t):i=null!==e.memoizedState,r&&!i&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Gn.current)?0===lo&&(lo=3):(0!==lo&&3!==lo||(lo=4),null===ro||0==(134217727&ho)&&0==(134217727&fo)||Go(ro,oo))),Y&&r&&(t.flags|=4),X&&(r||i)&&(t.flags|=4),null);case 4:return zn(),ei(t),null===e&&ie(t.stateNode.containerInfo),null;case 10:return cn(t),null;case 19:if(Ze(Gn),null===(r=t.memoizedState))return null;if(i=0!=(64&t.flags),null===(o=r.rendering))if(i)pi(r,!1);else{if(0!==lo||null!==e&&0!=(64&e.flags))for(e=t.child;null!==e;){if(null!==(o=Vn(e))){for(t.flags|=64,pi(r,!1),null!==(e=o.updateQueue)&&(t.updateQueue=e,t.flags|=4),null===r.lastEffect&&(t.firstEffect=null),t.lastEffect=r.lastEffect,e=n,r=t.child;null!==r;)n=e,(i=r).flags&=2,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null,null===(o=i.alternate)?(i.childLanes=0,i.lanes=n,i.child=null,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,n=o.dependencies,i.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext}),r=r.sibling;return $e(Gn,1&Gn.current|2),t.child}e=e.sibling}null!==r.tail&&Gt()>vo&&(t.flags|=64,i=!0,pi(r,!1),t.lanes=33554432)}else{if(!i)if(null!==(e=Vn(o))){if(t.flags|=64,i=!0,null!==(e=e.updateQueue)&&(t.updateQueue=e,t.flags|=4),pi(r,!0),null===r.tail&&"hidden"===r.tailMode&&!o.alternate&&!Kn)return null!==(t=t.lastEffect=r.lastEffect)&&(t.nextEffect=null),null}else 2*Gt()-r.renderingStartTime>vo&&1073741824!==n&&(t.flags|=64,i=!0,pi(r,!1),t.lanes=33554432);r.isBackwards?(o.sibling=t.child,t.child=o):(null!==(e=r.last)?e.sibling=o:t.child=o,r.last=o)}return null!==r.tail?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=Gt(),e.sibling=null,t=Gn.current,$e(Gn,i?1&t|2:1&t),e):null;case 23:case 24:return Jo(),null!==e&&null!==e.memoizedState!=(null!==t.memoizedState)&&"unstable-defer-without-hiding"!==r.mode&&(t.flags|=4),null}throw Error(s(156,t.tag))}function gi(e){switch(e.tag){case 1:ot(e.type)&&at();var t=e.flags;return 4096&t?(e.flags=-4097&t|64,e):null;case 3:if(zn(),Ze(nt),Ze(tt),tr(),0!=(64&(t=e.flags)))throw Error(s(285));return e.flags=-4097&t|64,e;case 5:return Hn(e),null;case 13:return Ze(Gn),4096&(t=e.flags)?(e.flags=-4097&t|64,e):null;case 19:return Ze(Gn),null;case 4:return zn(),null;case 10:return cn(e),null;case 23:case 24:return Jo(),null;default:return null}}function vi(e,t){try{var n="",r=t;do{n+=en(r),r=r.return}while(r);var i=n}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:i}}function bi(e,t){try{console.error(t.value)}catch(e){setTimeout((function(){throw e}))}}var yi="function"==typeof WeakMap?WeakMap:Map;function wi(e,t,n){(n=gn(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){So||(So=!0,xo=r),bi(0,t)},n}function Si(e,t,n){(n=gn(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var i=t.value;n.payload=function(){return bi(0,t),r(i)}}var o=e.stateNode;return null!==o&&"function"==typeof o.componentDidCatch&&(n.callback=function(){"function"!=typeof r&&(null===Mo?Mo=new Set([this]):Mo.add(this),bi(0,t));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}var xi="function"==typeof WeakSet?WeakSet:Set;function Mi(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){da(e,t)}else t.current=null}function _i(e,t){switch(t.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:if(256&t.flags&&null!==e){var n=e.memoizedProps,r=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:tn(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:return void(X&&256&t.flags&&Ce(t.stateNode.containerInfo))}throw Error(s(163))}function Ai(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.destroy;n.destroy=void 0,void 0!==r&&r()}n=n.next}while(n!==t)}}function Ei(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{if(3==(3&e.tag)){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(null!==(t=null!==(t=n.updateQueue)?t.lastEffect:null)){e=t=t.next;do{var i=e;r=i.next,0!=(4&(i=i.tag))&&0!=(1&i)&&(la(n,e),sa(n,e)),e=r}while(e!==t)}return;case 1:return e=n.stateNode,4&n.flags&&(null===t?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:tn(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),void(null!==(t=n.updateQueue)&&wn(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=B(n.child.stateNode);break;case 1:e=n.child.stateNode}wn(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.flags&&ge(e,n.type,n.memoizedProps,n));case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(Z&&null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&We(n)))))}throw Error(s(163))}function Ci(e,t){if(X)for(var n=e;;){if(5===n.tag){var r=n.stateNode;t?Me(r):Ae(n.stateNode,n.memoizedProps)}else if(6===n.tag)r=n.stateNode,t?_e(r):Ee(r,n.memoizedProps);else if((23!==n.tag&&24!==n.tag||null===n.memoizedState||n===e)&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function Ti(e,t){if(ht&&"function"==typeof ht.onCommitFiberUnmount)try{ht.onCommitFiberUnmount(dt,t)}catch(e){}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var n=e=e.next;do{var r=n,i=r.destroy;if(r=r.tag,void 0!==i)if(0!=(4&r))la(t,n);else{r=t;try{i()}catch(e){da(r,e)}}n=n.next}while(n!==e)}break;case 1:if(Mi(t),"function"==typeof(e=t.stateNode).componentWillUnmount)try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(e){da(t,e)}break;case 5:Mi(t);break;case 4:X?Bi(e,t):Y&&Y&&(t=t.stateNode.containerInfo,e=Ie(t),Oe(t,e))}}function Ii(e,t){for(var n=t;;)if(Ti(e,n),null===n.child||X&&4===n.tag){if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}else n.child.return=n,n=n.child}function ki(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function Ri(e){return 5===e.tag||3===e.tag||4===e.tag}function Oi(e){if(X){e:{for(var t=e.return;null!==t;){if(Ri(t))break e;t=t.return}throw Error(s(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:case 4:t=t.containerInfo,r=!0;break;default:throw Error(s(161))}16&n.flags&&(xe(t),n.flags&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||Ri(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.flags)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.flags)){n=n.stateNode;break e}}r?Pi(e,n,t):Ni(e,n,t)}}function Pi(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?ye(n,e,t):pe(n,e);else if(4!==r&&null!==(e=e.child))for(Pi(e,t,n),e=e.sibling;null!==e;)Pi(e,t,n),e=e.sibling}function Ni(e,t,n){var r=e.tag,i=5===r||6===r;if(i)e=i?e.stateNode:e.stateNode.instance,t?be(n,e,t):fe(n,e);else if(4!==r&&null!==(e=e.child))for(Ni(e,t,n),e=e.sibling;null!==e;)Ni(e,t,n),e=e.sibling}function Bi(e,t){for(var n,r,i=t,o=!1;;){if(!o){o=i.return;e:for(;;){if(null===o)throw Error(s(160));switch(n=o.stateNode,o.tag){case 5:r=!1;break e;case 3:case 4:n=n.containerInfo,r=!0;break e}o=o.return}o=!0}if(5===i.tag||6===i.tag)Ii(e,i),r?Se(n,i.stateNode):we(n,i.stateNode);else if(4===i.tag){if(null!==i.child){n=i.stateNode.containerInfo,r=!0,i.child.return=i,i=i.child;continue}}else if(Ti(e,i),null!==i.child){i.child.return=i,i=i.child;continue}if(i===t)break;for(;null===i.sibling;){if(null===i.return||i.return===t)return;4===(i=i.return).tag&&(o=!1)}i.sibling.return=i.return,i=i.sibling}}function Li(e,t){if(X){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void Ai(3,t);case 1:case 12:case 17:return;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps;e=null!==e?e.memoizedProps:r;var i=t.type,o=t.updateQueue;t.updateQueue=null,null!==o&&ve(n,o,i,e,r,t)}return;case 6:if(null===t.stateNode)throw Error(s(162));return n=t.memoizedProps,void me(t.stateNode,null!==e?e.memoizedProps:n,n);case 3:return void(Z&&(t=t.stateNode,t.hydrate&&(t.hydrate=!1,Ve(t.containerInfo))));case 13:return Di(t),void Ui(t);case 19:return void Ui(t);case 23:case 24:return void Ci(t,null!==t.memoizedState)}throw Error(s(163))}switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void Ai(3,t);case 12:case 23:case 24:return;case 13:return Di(t),void Ui(t);case 19:return void Ui(t);case 3:Z&&((n=t.stateNode).hydrate&&(n.hydrate=!1,Ve(n.containerInfo)))}e:if(Y){switch(t.tag){case 1:case 5:case 6:case 20:break e;case 3:case 4:t=t.stateNode,Oe(t.containerInfo,t.pendingChildren);break e}throw Error(s(163))}}function Di(e){null!==e.memoizedState&&(go=Gt(),X&&Ci(e.child,!0))}function Ui(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new xi),t.forEach((function(t){var r=fa.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))}))}}function Fi(e,t){return null!==e&&(null===(e=e.memoizedState)||null!==e.dehydrated)&&(null!==(t=t.memoizedState)&&null===t.dehydrated)}var zi=0,ji=1,Hi=2,Gi=3,Vi=4;if("function"==typeof Symbol&&Symbol.for){var Wi=Symbol.for;zi=Wi("selector.component"),ji=Wi("selector.has_pseudo_class"),Hi=Wi("selector.role"),Gi=Wi("selector.test_id"),Vi=Wi("selector.text")}function qi(e){var t=$(e);if(null!=t){if("string"!=typeof t.memoizedProps["data-testname"])throw Error(s(364));return t}if(null===(e=ae(e)))throw Error(s(362));return e.stateNode.current}function Ki(e,t){switch(t.$$typeof){case zi:if(e.type===t.value)return!0;break;case ji:e:{t=t.value,e=[e,0];for(var n=0;n<e.length;){var r=e[n++],i=e[n++],o=t[i];if(5!==r.tag||!ce(r)){for(;null!=o&&Ki(r,o);)o=t[++i];if(i===t.length){t=!0;break e}for(r=r.child;null!==r;)e.push(r,i),r=r.sibling}}t=!1}return t;case Hi:if(5===e.tag&&ue(e.stateNode,t.value))return!0;break;case Vi:if((5===e.tag||6===e.tag)&&null!==(e=le(e))&&0<=e.indexOf(t.value))return!0;break;case Gi:if(5===e.tag&&("string"==typeof(e=e.memoizedProps["data-testname"])&&e.toLowerCase()===t.value.toLowerCase()))return!0;break;default:throw Error(s(365,t))}return!1}function Ji(e){switch(e.$$typeof){case zi:return"<"+(T(e.value)||"Unknown")+">";case ji:return":has("+(Ji(e)||"")+")";case Hi:return'[role="'+e.value+'"]';case Vi:return'"'+e.value+'"';case Gi:return'[data-testname="'+e.value+'"]';default:throw Error(s(365,e))}}function Qi(e,t){var n=[];e=[e,0];for(var r=0;r<e.length;){var i=e[r++],o=e[r++],a=t[o];if(5!==i.tag||!ce(i)){for(;null!=a&&Ki(i,a);)a=t[++o];if(o===t.length)n.push(i);else for(i=i.child;null!==i;)e.push(i,o),i=i.sibling}}return n}function Xi(e,t){if(!oe)throw Error(s(363));e=Qi(e=qi(e),t),t=[],e=Array.from(e);for(var n=0;n<e.length;){var r=e[n++];if(5===r.tag)ce(r)||t.push(r.stateNode);else for(r=r.child;null!==r;)e.push(r),r=r.sibling}return t}var Yi=null;var Zi=Math.ceil,$i=l.ReactCurrentDispatcher,eo=l.ReactCurrentOwner,to=l.IsSomeRendererActing,no=0,ro=null,io=null,oo=0,ao=0,so=Ye(0),lo=0,co=null,uo=0,ho=0,fo=0,po=0,mo=null,go=0,vo=1/0;function bo(){vo=Gt()+500}var yo,wo=null,So=!1,xo=null,Mo=null,_o=!1,Ao=null,Eo=90,Co=[],To=[],Io=null,ko=0,Ro=null,Oo=-1,Po=0,No=0,Bo=null,Lo=!1;function Do(){return 0!=(48&no)?Gt():-1!==Oo?Oo:Oo=Gt()}function Uo(e){if(0==(2&(e=e.mode)))return 1;if(0==(4&e))return 99===Vt()?1:2;if(0===Po&&(Po=uo),0!==Xt.transition){0!==No&&(No=null!==mo?mo.pendingLanes:0),e=Po;var t=4186112&~No;return 0===(t&=-t)&&(0===(t=(e=4186112&~e)&-e)&&(t=8192)),t}return e=Vt(),0!=(4&no)&&98===e?e=bt(12,Po):e=bt(e=function(e){switch(e){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(e),Po),e}function Fo(e,t,n){if(50<ko)throw ko=0,Ro=null,Error(s(185));if(null===(e=zo(e,t)))return null;St(e,t,n),e===ro&&(fo|=t,4===lo&&Go(e,oo));var r=Vt();1===t?0!=(8&no)&&0==(48&no)?Vo(e):(jo(e,n),0===no&&(bo(),Jt())):(0==(4&no)||98!==r&&99!==r||(null===Io?Io=new Set([e]):Io.add(e)),jo(e,n)),mo=e}function zo(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}function jo(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,i=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes;0<a;){var l=31-xt(a),c=1<<l,u=o[l];if(-1===u){if(0==(c&r)||0!=(c&i)){u=t,mt(c);var d=pt;o[l]=10<=d?u+250:6<=d?u+5e3:-1}}else u<=t&&(e.expiredLanes|=c);a&=~c}if(r=gt(e,e===ro?oo:0),t=pt,0===r)null!==n&&(n!==Dt&&Ct(n),e.callbackNode=null,e.callbackPriority=0);else{if(null!==n){if(e.callbackPriority===t)return;n!==Dt&&Ct(n)}15===t?(n=Vo.bind(null,e),null===Ft?(Ft=[n],zt=Et(Ot,Qt)):Ft.push(n),n=Dt):14===t?n=Kt(99,Vo.bind(null,e)):(n=function(e){switch(e){case 15:case 14:return 99;case 13:case 12:case 11:case 10:return 98;case 9:case 8:case 7:case 6:case 4:case 5:return 97;case 3:case 2:case 1:return 95;case 0:return 90;default:throw Error(s(358,e))}}(t),n=Kt(n,Ho.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function Ho(e){if(Oo=-1,No=Po=0,0!=(48&no))throw Error(s(327));var t=e.callbackNode;if(aa()&&e.callbackNode!==t)return null;var n=gt(e,e===ro?oo:0);if(0===n)return null;var r=n,i=no;no|=16;var o=Yo();for(ro===e&&oo===r||(bo(),Qo(e,r));;)try{ea();break}catch(t){Xo(e,t)}if(sn(),$i.current=o,no=i,null!==io?r=0:(ro=null,oo=0,r=lo),0!=(uo&fo))Qo(e,0);else if(0!==r){if(2===r&&(no|=64,e.hydrate&&(e.hydrate=!1,Ce(e.containerInfo)),0!==(n=vt(e))&&(r=Zo(e,n))),1===r)throw t=co,Qo(e,0),Go(e,n),jo(e,Gt()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(s(345));case 2:case 5:ra(e);break;case 3:if(Go(e,n),(62914560&n)===n&&10<(r=go+500-Gt())){if(0!==gt(e,0))break;if(((i=e.suspendedLanes)&n)!==n){Do(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=q(ra.bind(null,e),r);break}ra(e);break;case 4:if(Go(e,n),(4186112&n)===n)break;for(r=e.eventTimes,i=-1;0<n;){var a=31-xt(n);o=1<<a,(a=r[a])>i&&(i=a),n&=~o}if(n=i,10<(n=(120>(n=Gt()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Zi(n/1960))-n)){e.timeoutHandle=q(ra.bind(null,e),n);break}ra(e);break;default:throw Error(s(329))}}return jo(e,Gt()),e.callbackNode===t?Ho.bind(null,e):null}function Go(e,t){for(t&=~po,t&=~fo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-xt(t),r=1<<n;e[n]=-1,t&=~r}}function Vo(e){if(0!=(48&no))throw Error(s(327));if(aa(),e===ro&&0!=(e.expiredLanes&oo)){var t=oo,n=Zo(e,t);0!=(uo&fo)&&(n=Zo(e,t=gt(e,t)))}else n=Zo(e,t=gt(e,0));if(0!==e.tag&&2===n&&(no|=64,e.hydrate&&(e.hydrate=!1,Ce(e.containerInfo)),0!==(t=vt(e))&&(n=Zo(e,t))),1===n)throw n=co,Qo(e,0),Go(e,t),jo(e,Gt()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,ra(e),jo(e,Gt()),null}function Wo(e,t){var n=no;no|=1;try{return e(t)}finally{0===(no=n)&&(bo(),Jt())}}function qo(e,t){var n=no;if(0!=(48&n))return e(t);no|=1;try{if(e)return qt(99,e.bind(null,t))}finally{no=n,Jt()}}function Ko(e,t){$e(so,ao),ao|=t,uo|=t}function Jo(){ao=so.current,Ze(so)}function Qo(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==J&&(e.timeoutHandle=J,K(n)),null!==io)for(n=io.return;null!==n;){var r=n;switch(r.tag){case 1:null!=(r=r.type.childContextTypes)&&at();break;case 3:zn(),Ze(nt),Ze(tt),tr();break;case 5:Hn(r);break;case 4:zn();break;case 13:case 19:Ze(Gn);break;case 10:cn(r);break;case 23:case 24:Jo()}n=n.return}ro=e,io=_a(e.current,null),oo=ao=uo=t,lo=0,co=null,po=fo=ho=0}function Xo(e,t){for(;;){var n=io;try{if(sn(),nr.current=Dr,lr){for(var r=or.memoizedState;null!==r;){var i=r.queue;null!==i&&(i.pending=null),r=r.next}lr=!1}if(ir=0,sr=ar=or=null,cr=!1,eo.current=null,null===n||null===n.return){lo=1,co=t,io=null;break}e:{var o=e,a=n.return,s=n,l=t;if(t=oo,s.flags|=2048,s.firstEffect=s.lastEffect=null,null!==l&&"object"==typeof l&&"function"==typeof l.then){var c=l;if(0==(2&s.mode)){var u=s.alternate;u?(s.updateQueue=u.updateQueue,s.memoizedState=u.memoizedState,s.lanes=u.lanes):(s.updateQueue=null,s.memoizedState=null)}var d=0!=(1&Gn.current),h=a;do{var f;if(f=13===h.tag){var p=h.memoizedState;if(null!==p)f=null!==p.dehydrated;else{var m=h.memoizedProps;f=void 0!==m.fallback&&(!0!==m.unstable_avoidThisFallback||!d)}}if(f){var g=h.updateQueue;if(null===g){var v=new Set;v.add(c),h.updateQueue=v}else g.add(c);if(0==(2&h.mode)){if(h.flags|=64,s.flags|=16384,s.flags&=-2981,1===s.tag)if(null===s.alternate)s.tag=17;else{var b=gn(-1,1);b.tag=2,vn(s,b)}s.lanes|=1;break e}l=void 0,s=t;var y=o.pingCache;if(null===y?(y=o.pingCache=new yi,l=new Set,y.set(c,l)):void 0===(l=y.get(c))&&(l=new Set,y.set(c,l)),!l.has(s)){l.add(s);var w=ha.bind(null,o,c,s);c.then(w,w)}h.flags|=4096,h.lanes=t;break e}h=h.return}while(null!==h);l=Error((T(s.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.")}5!==lo&&(lo=2),l=vi(l,s),h=a;do{switch(h.tag){case 3:o=l,h.flags|=4096,t&=-t,h.lanes|=t,bn(h,wi(0,o,t));break e;case 1:o=l;var S=h.type,x=h.stateNode;if(0==(64&h.flags)&&("function"==typeof S.getDerivedStateFromError||null!==x&&"function"==typeof x.componentDidCatch&&(null===Mo||!Mo.has(x)))){h.flags|=4096,t&=-t,h.lanes|=t,bn(h,Si(h,o,t));break e}}h=h.return}while(null!==h)}na(n)}catch(e){t=e,io===n&&null!==n&&(io=n=n.return);continue}break}}function Yo(){var e=$i.current;return $i.current=Dr,null===e?Dr:e}function Zo(e,t){var n=no;no|=16;var r=Yo();for(ro===e&&oo===t||Qo(e,t);;)try{$o();break}catch(t){Xo(e,t)}if(sn(),no=n,$i.current=r,null!==io)throw Error(s(261));return ro=null,oo=0,lo}function $o(){for(;null!==io;)ta(io)}function ea(){for(;null!==io&&!Tt();)ta(io)}function ta(e){var t=yo(e.alternate,e,ao);e.memoizedProps=e.pendingProps,null===t?na(e):io=t,eo.current=null}function na(e){var t=e;do{var n=t.alternate;if(e=t.return,0==(2048&t.flags)){if(null!==(n=mi(n,t,ao)))return void(io=n);if(24!==(n=t).tag&&23!==n.tag||null===n.memoizedState||0!=(1073741824&ao)||0==(4&n.mode)){for(var r=0,i=n.child;null!==i;)r|=i.lanes|i.childLanes,i=i.sibling;n.childLanes=r}null!==e&&0==(2048&e.flags)&&(null===e.firstEffect&&(e.firstEffect=t.firstEffect),null!==t.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(null!==e.lastEffect?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}else{if(null!==(n=gi(t)))return n.flags&=2047,void(io=n);null!==e&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}if(null!==(t=t.sibling))return void(io=t);io=t=e}while(null!==t);0===lo&&(lo=5)}function ra(e){var t=Vt();return qt(99,ia.bind(null,e,t)),null}function ia(e,t){do{aa()}while(null!==Ao);if(0!=(48&no))throw Error(s(327));var n=e.finishedWork;if(null===n)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(s(177));e.callbackNode=null;var r=n.lanes|n.childLanes,i=r,o=e.pendingLanes&~i;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=i,e.mutableReadLanes&=i,e.entangledLanes&=i,i=e.entanglements;for(var a=e.eventTimes,l=e.expirationTimes;0<o;){var c=31-xt(o),u=1<<c;i[c]=0,a[c]=-1,l[c]=-1,o&=~u}if(null!==Io&&0==(24&r)&&Io.has(e)&&Io.delete(e),e===ro&&(io=ro=null,oo=0),1<n.flags?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){i=no,no|=32,eo.current=null,Bo=U(e.containerInfo),Lo=!1,wo=r;do{try{oa()}catch(e){if(null===wo)throw Error(s(330));da(wo,e),wo=wo.nextEffect}}while(null!==wo);Bo=null,wo=r;do{try{for(a=e;null!==wo;){var d=wo.flags;if(16&d&&X&&xe(wo.stateNode),128&d){var h=wo.alternate;if(null!==h){var f=h.ref;null!==f&&("function"==typeof f?f(null):f.current=null)}}switch(1038&d){case 2:Oi(wo),wo.flags&=-3;break;case 6:Oi(wo),wo.flags&=-3,Li(wo.alternate,wo);break;case 1024:wo.flags&=-1025;break;case 1028:wo.flags&=-1025,Li(wo.alternate,wo);break;case 4:Li(wo.alternate,wo);break;case 8:l=a,o=wo,X?Bi(l,o):Ii(l,o);var p=o.alternate;ki(o),null!==p&&ki(p)}wo=wo.nextEffect}}catch(e){if(null===wo)throw Error(s(330));da(wo,e),wo=wo.nextEffect}}while(null!==wo);Lo&&re(),F(e.containerInfo),e.current=n,wo=r;do{try{for(d=e;null!==wo;){var m=wo.flags;if(36&m&&Ei(d,wo.alternate,wo),128&m){h=void 0;var g=wo.ref;if(null!==g){var v=wo.stateNode;if(5===wo.tag)h=B(v);else h=v;"function"==typeof g?g(h):g.current=h}}wo=wo.nextEffect}}catch(e){if(null===wo)throw Error(s(330));da(wo,e),wo=wo.nextEffect}}while(null!==wo);wo=null,Ut(),no=i}else e.current=n;if(_o)_o=!1,Ao=e,Eo=t;else for(wo=r;null!==wo;)t=wo.nextEffect,wo.nextEffect=null,8&wo.flags&&((m=wo).sibling=null,m.stateNode=null),wo=t;if(0===(r=e.pendingLanes)&&(Mo=null),1===r?e===Ro?ko++:(ko=0,Ro=e):ko=0,n=n.stateNode,ht&&"function"==typeof ht.onCommitFiberRoot)try{ht.onCommitFiberRoot(dt,n,void 0,64==(64&n.current.flags))}catch(e){}if(jo(e,Gt()),So)throw So=!1,e=xo,xo=null,e;return 0!=(8&no)||Jt(),null}function oa(){for(;null!==wo;){var e=wo.alternate;Lo||null===Bo||(0!=(8&wo.flags)?P(wo,Bo)&&(Lo=!0,ne()):13===wo.tag&&Fi(e,wo)&&P(wo,Bo)&&(Lo=!0,ne()));var t=wo.flags;0!=(256&t)&&_i(e,wo),0==(512&t)||_o||(_o=!0,Kt(97,(function(){return aa(),null}))),wo=wo.nextEffect}}function aa(){if(90!==Eo){var e=97<Eo?97:Eo;return Eo=90,qt(e,ca)}return!1}function sa(e,t){Co.push(t,e),_o||(_o=!0,Kt(97,(function(){return aa(),null})))}function la(e,t){To.push(t,e),_o||(_o=!0,Kt(97,(function(){return aa(),null})))}function ca(){if(null===Ao)return!1;var e=Ao;if(Ao=null,0!=(48&no))throw Error(s(331));var t=no;no|=32;var n=To;To=[];for(var r=0;r<n.length;r+=2){var i=n[r],o=n[r+1],a=i.destroy;if(i.destroy=void 0,"function"==typeof a)try{a()}catch(e){if(null===o)throw Error(s(330));da(o,e)}}for(n=Co,Co=[],r=0;r<n.length;r+=2){i=n[r],o=n[r+1];try{var l=i.create;i.destroy=l()}catch(e){if(null===o)throw Error(s(330));da(o,e)}}for(l=e.current.firstEffect;null!==l;)e=l.nextEffect,l.nextEffect=null,8&l.flags&&(l.sibling=null,l.stateNode=null),l=e;return no=t,Jt(),!0}function ua(e,t,n){vn(e,t=wi(0,t=vi(n,t),1)),t=Do(),null!==(e=zo(e,1))&&(St(e,1,t),jo(e,t))}function da(e,t){if(3===e.tag)ua(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){ua(n,e,t);break}if(1===n.tag){var r=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===Mo||!Mo.has(r))){var i=Si(n,e=vi(t,e),1);if(vn(n,i),i=Do(),null!==(n=zo(n,1)))St(n,1,i),jo(n,i);else if("function"==typeof r.componentDidCatch&&(null===Mo||!Mo.has(r)))try{r.componentDidCatch(t,e)}catch(e){}break}}n=n.return}}function ha(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Do(),e.pingedLanes|=e.suspendedLanes&n,ro===e&&(oo&n)===n&&(4===lo||3===lo&&(62914560&oo)===oo&&500>Gt()-go?Qo(e,0):po|=n),jo(e,t)}function fa(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(0==(2&(t=e.mode))?t=1:0==(4&t)?t=99===Vt()?1:2:(0===Po&&(Po=uo),0===(t=yt(62914560&~Po))&&(t=4194304))),n=Do(),null!==(e=zo(e,t))&&(St(e,t,n),jo(e,n))}yo=function(e,t,n){var r=t.lanes;if(null!==e)if(e.memoizedProps!==t.pendingProps||nt.current)Hr=!0;else{if(0==(n&r)){switch(Hr=!1,t.tag){case 3:Zr(t),$n();break;case 5:jn(t);break;case 1:ot(t.type)&&ct(t);break;case 4:Fn(t,t.stateNode.containerInfo);break;case 10:ln(t,t.memoizedProps.value);break;case 13:if(null!==t.memoizedState)return 0!=(n&t.child.childLanes)?ii(e,t,n):($e(Gn,1&Gn.current),null!==(t=di(e,t,n))?t.sibling:null);$e(Gn,1&Gn.current);break;case 19:if(r=0!=(n&t.childLanes),0!=(64&e.flags)){if(r)return ui(e,t,n);t.flags|=64}var i=t.memoizedState;if(null!==i&&(i.rendering=null,i.tail=null,i.lastEffect=null),$e(Gn,Gn.current),r)break;return null;case 23:case 24:return t.lanes=0,Kr(e,t,n)}return di(e,t,n)}Hr=0!=(16384&e.flags)}else Hr=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=it(t,tt.current),dn(t,n),i=hr(null,t,r,e,i,n),t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,ot(r)){var o=!0;ct(t)}else o=!1;t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,pn(t);var a=r.getDerivedStateFromProps;"function"==typeof a&&xn(t,r,a,e),i.updater=Mn,t.stateNode=i,i._reactInternals=t,Cn(t,r,e,n),t=Yr(null,t,r,!0,o,n)}else t.tag=0,Gr(null,t,i,n),t=t.child;return t;case 16:i=t.elementType;e:{switch(null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=(o=i._init)(i._payload),t.type=i,o=t.tag=function(e){if("function"==typeof e)return Ma(e)?1:0;if(null!=e){if((e=e.$$typeof)===g)return 11;if(e===y)return 14}return 2}(i),e=tn(i,e),o){case 0:t=Qr(null,t,i,e,n);break e;case 1:t=Xr(null,t,i,e,n);break e;case 11:t=Vr(null,t,i,e,n);break e;case 14:t=Wr(null,t,i,tn(i.type,e),r,n);break e}throw Error(s(306,i,""))}return t;case 0:return r=t.type,i=t.pendingProps,Qr(e,t,r,i=t.elementType===r?i:tn(r,i),n);case 1:return r=t.type,i=t.pendingProps,Xr(e,t,r,i=t.elementType===r?i:tn(r,i),n);case 3:if(Zr(t),r=t.updateQueue,null===e||null===r)throw Error(s(282));if(r=t.pendingProps,i=null!==(i=t.memoizedState)?i.element:null,mn(e,t),yn(t,r,null,n),(r=t.memoizedState.element)===i)$n(),t=di(e,t,n);else{if((o=(i=t.stateNode).hydrate)&&(Z?(qn=ze(t.stateNode.containerInfo),Wn=t,o=Kn=!0):o=!1),o){if(Z&&null!=(e=i.mutableSourceEagerHydrationData))for(i=0;i<e.length;i+=2)o=e[i],a=e[i+1],Q?o._workInProgressVersionPrimary=a:o._workInProgressVersionSecondary=a,er.push(o);for(n=Pn(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|1024,n=n.sibling}else Gr(e,t,r,n),$n();t=t.child}return t;case 5:return jn(t),null===e&&Xn(t),r=t.type,i=t.pendingProps,o=null!==e?e.memoizedProps:null,a=i.children,V(r,i)?a=null:null!==o&&V(r,o)&&(t.flags|=16),Jr(e,t),Gr(e,t,a,n),t.child;case 6:return null===e&&Xn(t),null;case 13:return ii(e,t,n);case 4:return Fn(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=On(t,null,r,n):Gr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,Vr(e,t,r,i=t.elementType===r?i:tn(r,i),n);case 7:return Gr(e,t,t.pendingProps,n),t.child;case 8:case 12:return Gr(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,ln(t,o=i.value),null!==a){var l=a.value;if(0===(o=Yt(l,o)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,o):1073741823))){if(a.children===i.children&&!nt.current){t=di(e,t,n);break e}}else for(null!==(l=t.child)&&(l.return=t);null!==l;){var c=l.dependencies;if(null!==c){a=l.child;for(var u=c.firstContext;null!==u;){if(u.context===r&&0!=(u.observedBits&o)){1===l.tag&&((u=gn(-1,n&-n)).tag=2,vn(l,u)),l.lanes|=n,null!==(u=l.alternate)&&(u.lanes|=n),un(l.return,n),c.lanes|=n;break}u=u.next}}else a=10===l.tag&&l.type===t.type?null:l.child;if(null!==a)a.return=l;else for(a=l;null!==a;){if(a===t){a=null;break}if(null!==(l=a.sibling)){l.return=a.return,a=l;break}a=a.return}l=a}}Gr(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=(o=t.pendingProps).children,dn(t,n),r=r(i=hn(i,o.unstable_observedBits)),t.flags|=1,Gr(e,t,r,n),t.child;case 14:return o=tn(i=t.type,t.pendingProps),Wr(e,t,i,o=tn(i.type,o),r,n);case 15:return qr(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:tn(r,i),null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,ot(r)?(e=!0,ct(t)):e=!1,dn(t,n),An(t,r,i),Cn(t,r,i,n),Yr(null,t,r,!0,e,n);case 19:return ui(e,t,n);case 23:case 24:return Kr(e,t,n)}throw Error(s(156,t.tag))};var pa={current:!1},ma=a.unstable_flushAllWithoutAsserting,ga="function"==typeof ma;function va(){if(void 0!==ma)return ma();for(var e=!1;aa();)e=!0;return e}function ba(t){try{va(),function(t){if(null===Yi)try{var n=("require"+Math.random()).slice(0,7);Yi=(e&&e[n]).call(e,"timers").setImmediate}catch(e){Yi=function(e){var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}Yi(t)}((function(){va()?ba(t):t()}))}catch(e){t(e)}}var ya=0,wa=!1;function Sa(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function xa(e,t,n,r){return new Sa(e,t,n,r)}function Ma(e){return!(!(e=e.prototype)||!e.isReactComponent)}function _a(e,t){var n=e.alternate;return null===n?((n=xa(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Aa(e,t,n,r,i,o){var a=2;if(r=e,"function"==typeof e)Ma(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case d:return Ea(n.children,i,o,t);case x:a=8,i|=16;break;case h:a=8,i|=1;break;case f:return(e=xa(12,n,t,8|i)).elementType=f,e.type=f,e.lanes=o,e;case v:return(e=xa(13,n,t,i)).type=v,e.elementType=v,e.lanes=o,e;case b:return(e=xa(19,n,t,i)).elementType=b,e.lanes=o,e;case M:return Ca(n,i,o,t);case _:return(e=xa(24,n,t,i)).elementType=_,e.lanes=o,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case p:a=10;break e;case m:a=9;break e;case g:a=11;break e;case y:a=14;break e;case w:a=16,r=null;break e;case S:a=22;break e}throw Error(s(130,null==e?e:typeof e,""))}return(t=xa(a,n,t,i)).elementType=e,t.type=r,t.lanes=o,t}function Ea(e,t,n,r){return(e=xa(7,e,r,t)).lanes=n,e}function Ca(e,t,n,r){return(e=xa(23,e,r,t)).elementType=M,e.lanes=n,e}function Ta(e,t,n){return(e=xa(6,e,null,t)).lanes=n,e}function Ia(e,t,n){return(t=xa(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ka(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=J,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=wt(0),this.expirationTimes=wt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),Z&&(this.mutableSourceEagerHydrationData=null)}function Ra(e){var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(s(188));throw Error(s(268,Object.keys(e)))}return null===(e=O(t))?null:e.stateNode}function Oa(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Pa(e,t){Oa(e,t),(e=e.alternate)&&Oa(e,t)}function Na(e){return null===(e=O(e))?null:e.stateNode}function Ba(){return null}return n.IsThisRendererActing=pa,n.act=function(e){function t(){ya--,to.current=n,pa.current=r}!1===wa&&(wa=!0,console.error("act(...) is not supported in production builds of React, and might not behave as expected.")),ya++;var n=to.current,r=pa.current;to.current=!0,pa.current=!0;try{var i=Wo(e)}catch(e){throw t(),e}if(null!==i&&"object"==typeof i&&"function"==typeof i.then)return{then:function(e,r){i.then((function(){1<ya||!0===ga&&!0===n?(t(),e()):ba((function(n){t(),n?r(n):e()}))}),(function(e){t(),r(e)}))}};try{1!==ya||!1!==ga&&!1!==n||va(),t()}catch(e){throw t(),e}return{then:function(e){e()}}},n.attemptContinuousHydration=function(e){13===e.tag&&(Fo(e,67108864,Do()),Pa(e,67108864))},n.attemptHydrationAtCurrentPriority=function(e){if(13===e.tag){var t=Do(),n=Uo(e);Fo(e,n,t),Pa(e,n)}},n.attemptSynchronousHydration=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.hydrate){var n=mt(t.pendingLanes);t.expiredLanes|=n&t.pendingLanes,jo(t,Gt()),0==(48&no)&&(bo(),Jt())}break;case 13:var r=Do();qo((function(){return Fo(e,1,r)})),Pa(e,4)}},n.attemptUserBlockingHydration=function(e){13===e.tag&&(Fo(e,4,Do()),Pa(e,4))},n.batchedEventUpdates=function(e,t){var n=no;no|=2;try{return e(t)}finally{0===(no=n)&&(bo(),Jt())}},n.batchedUpdates=Wo,n.createComponentSelector=function(e){return{$$typeof:zi,value:e}},n.createContainer=function(e,t,n){return e=new ka(e,t,n),t=xa(3,null,null,2===t?7:1===t?3:0),e.current=t,t.stateNode=e,pn(t),e},n.createHasPsuedoClassSelector=function(e){return{$$typeof:ji,value:e}},n.createPortal=function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:u,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}},n.createRoleSelector=function(e){return{$$typeof:Hi,value:e}},n.createTestNameSelector=function(e){return{$$typeof:Gi,value:e}},n.createTextSelector=function(e){return{$$typeof:Vi,value:e}},n.deferredUpdates=function(e){return qt(97,e)},n.discreteUpdates=function(e,t,n,r,i){var o=no;no|=4;try{return qt(98,e.bind(null,t,n,r,i))}finally{0===(no=o)&&(bo(),Jt())}},n.findAllNodes=Xi,n.findBoundingRects=function(e,t){if(!oe)throw Error(s(363));t=Xi(e,t),e=[];for(var n=0;n<t.length;n++)e.push(se(t[n]));for(t=e.length-1;0<t;t--)for(var r=(n=e[t]).x,i=r+n.width,o=n.y,a=o+n.height,l=t-1;0<=l;l--)if(t!==l){var c=e[l],u=c.x,d=u+c.width,h=c.y,f=h+c.height;if(r>=u&&o>=h&&i<=d&&a<=f){e.splice(t,1);break}if(!(r!==u||n.width!==c.width||f<o||h>a)){h>o&&(c.height+=h-o,c.y=o),f<a&&(c.height=a-h),e.splice(t,1);break}if(!(o!==h||n.height!==c.height||d<r||u>i)){u>r&&(c.width+=u-r,c.x=r),d<i&&(c.width=i-u),e.splice(t,1);break}}return e},n.findHostInstance=Ra,n.findHostInstanceWithNoPortals=function(e){return null===(e=function(e){if(!(e=R(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child&&4!==t.tag)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}(e))?null:20===e.tag?e.stateNode.instance:e.stateNode},n.findHostInstanceWithWarning=function(e){return Ra(e)},n.flushControlled=function(e){var t=no;no|=1;try{qt(99,e)}finally{0===(no=t)&&(bo(),Jt())}},n.flushDiscreteUpdates=function(){0==(49&no)&&(function(){if(null!==Io){var e=Io;Io=null,e.forEach((function(e){e.expiredLanes|=24&e.pendingLanes,jo(e,Gt())}))}Jt()}(),aa())},n.flushPassiveEffects=aa,n.flushSync=qo,n.focusWithin=function(e,t){if(!oe)throw Error(s(363));for(t=Qi(e=qi(e),t),t=Array.from(t),e=0;e<t.length;){var n=t[e++];if(!ce(n)){if(5===n.tag&&de(n.stateNode))return!0;for(n=n.child;null!==n;)t.push(n),n=n.sibling}}return!1},n.getCurrentUpdateLanePriority=function(){return ft},n.getFindAllNodesFailureDescription=function(e,t){if(!oe)throw Error(s(363));var n=0,r=[];e=[qi(e),0];for(var i=0;i<e.length;){var o=e[i++],a=e[i++],l=t[a];if((5!==o.tag||!ce(o))&&(Ki(o,l)&&(r.push(Ji(l)),++a>n&&(n=a)),a<t.length))for(o=o.child;null!==o;)e.push(o,a),o=o.sibling}if(n<t.length){for(e=[];n<t.length;n++)e.push(Ji(t[n]));return"findAllNodes was able to match part of the selector:\n "+r.join(" > ")+"\n\nNo matching component was found for:\n "+e.join(" > ")}return null},n.getPublicRootInstance=function(e){return(e=e.current).child?5===e.child.tag?B(e.child.stateNode):e.child.stateNode:null},n.injectIntoDevTools=function(e){if(e={bundleType:e.bundleType,version:e.version,rendererPackageName:e.rendererPackageName,rendererConfig:e.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:l.ReactCurrentDispatcher,findHostInstanceByFiber:Na,findFiberByHostInstance:e.findFiberByHostInstance||Ba,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},"undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)e=!1;else{var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t.isDisabled&&t.supportsFiber)try{dt=t.inject(e),ht=t}catch(e){}e=!0}return e},n.observeVisibleRects=function(e,t,n,r){if(!oe)throw Error(s(363));e=Xi(e,t);var i=he(e,n,r).disconnect;return{disconnect:function(){i()}}},n.registerMutableSourceForHydration=function(e,t){var n=t._getVersion;n=n(t._source),null==e.mutableSourceEagerHydrationData?e.mutableSourceEagerHydrationData=[t,n]:e.mutableSourceEagerHydrationData.push(t,n)},n.runWithPriority=function(e,t){var n=ft;try{return ft=e,t()}finally{ft=n}},n.shouldSuspend=function(){return!1},n.unbatchedUpdates=function(e,t){var n=no;no&=-2,no|=8;try{return e(t)}finally{0===(no=n)&&(bo(),Jt())}},n.updateContainer=function(e,t,n,r){var i=t.current,o=Do(),a=Uo(i);e:if(n){t:{if(I(n=n._reactInternals)!==n||1!==n.tag)throw Error(s(170));var l=n;do{switch(l.tag){case 3:l=l.stateNode.context;break t;case 1:if(ot(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break t}}l=l.return}while(null!==l);throw Error(s(171))}if(1===n.tag){var c=n.type;if(ot(c)){n=lt(n,c,l);break e}}n=l}else n=et;return null===t.context?t.context=n:t.pendingContext=n,(t=gn(o,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),vn(i,t),Fo(i,a,o),a},n}})),o("juxiN").register(JSON.parse('{"adfgW":"index.js","cmazm":"abap.bc6c1a94.js","jPTA1":"abnf.a3fdbafa.js","jdWNC":"actionscript.59d9b9ea.js","2CBqg":"ada.7ae8a3a8.js","3wHhO":"agda.c22a72e2.js","kFVdl":"al.43edf93f.js","3V4RR":"antlr4.fab93bd9.js","ksX9L":"apacheconf.1ea6f6bc.js","3N81M":"apex.5f5d0b00.js","lBh32":"apl.f0e0255a.js","1cOI2":"applescript.f8873ad2.js","hwV5I":"aql.0596cd74.js","cxQUy":"arduino.8a10351d.js","h8XDs":"arff.b6eba224.js","1glOK":"asciidoc.3591554e.js","5YI5Q":"asm6502.eb3baf93.js","5aM2c":"asmatmel.93b67168.js","aKcNk":"aspnet.a154be94.js","bYGuI":"csharp.60bc2788.js","4ffJ6":"autohotkey.dc99c6b5.js","6o8gr":"autoit.7bd54007.js","d0QlI":"avisynth.506bbdad.js","1vpfH":"avro-idl.ab78e3d7.js","d78C2":"basic.09310972.js","1V5ou":"batch.5c48c918.js","h9qnw":"bbcode.4e0cb2f2.js","eluAn":"bicep.e394696d.js","jD2Yh":"birb.54766d79.js","3ligT":"bison.2c2552ab.js","cSnAi":"bnf.ec556d42.js","gmloY":"brainfuck.4e81eb1d.js","77rtQ":"brightscript.3c7cc723.js","hfFki":"bro.8db28f8a.js","8SYqo":"bsl.260fabfb.js","i4HkI":"cfscript.92c90b90.js","1rBYK":"chaiscript.76481f4b.js","gQYEz":"cil.622792d1.js","bq2uf":"clike.36346267.js","h7tza":"clojure.9da4900e.js","aK2oY":"cmake.234b57e3.js","3V5TZ":"cobol.2e8bd2ea.js","72v5N":"coffeescript.261b318a.js","lNJYg":"concurnas.9d189a8c.js","cHo4f":"coq.917e2a53.js","7GKmU":"crystal.d23925f3.js","a5f4n":"cshtml.92086949.js","2nOzn":"csp.9b5dd573.js","iZH8k":"css-extras.7f3088a6.js","3V9km":"css.fb6f00e3.js","7TCh4":"csv.06af3522.js","8MqYl":"cypher.6af6e534.js","6Oo3A":"d.303192e5.js","6ks0D":"dart.6fb62874.js","huqsT":"dataweave.e97ef31d.js","YtcLG":"dax.013d5e9a.js","1s9Hz":"dhall.d5ee83ba.js","b677V":"diff.9ef56ea8.js","ak2pO":"django.13b0bb49.js","8LDFZ":"dns-zone-file.189b08c5.js","1awLf":"docker.1da9769e.js","9dPYr":"dot.8dca92f3.js","e2ZjS":"ebnf.58c0fa63.js","9h8KW":"editorconfig.9c7b63a5.js","4SWgd":"eiffel.090bab86.js","6HmuU":"ejs.0ee535c3.js","2KAkF":"elixir.dc192ee6.js","jPV3v":"elm.c88782bd.js","agNrQ":"erb.55ec7cf0.js","9BmS2":"erlang.956455fa.js","fqf1c":"etlua.79f6dba5.js","cgMSr":"lua.88c0a077.js","92McF":"excel-formula.d0dd1424.js","juFxG":"factor.e311ca38.js","1dWPh":"false.a93fe44c.js","2k0b2":"firestore-security-rules.4ea155d7.js","dvL1Q":"flow.96e0f48a.js","5oumN":"fortran.0811bc79.js","fP8jO":"fsharp.0119d0fd.js","7L6sP":"ftl.c5671dbe.js","2ujce":"gap.b0574953.js","hzgIA":"gcode.29260c31.js","5MUDD":"gdscript.545f127b.js","ghckm":"gedcom.d53f8a81.js","ian9z":"gherkin.0c5a099f.js","dsuH3":"git.2d89a25c.js","dvV8S":"glsl.0bf837a6.js","6BDWE":"gml.04204c1b.js","btSYt":"gn.cbb4c3be.js","j94Lr":"go-module.2bebc9b8.js","207xG":"go.cc49e5b2.js","iQ4Nh":"graphql.3d658adb.js","9E9pJ":"groovy.3e5836cd.js","hLXUt":"haml.9a056759.js","5ob5h":"handlebars.8c13dfe6.js","1nDhS":"haskell.3c80aa72.js","kQehe":"haxe.40a1dc98.js","1sziu":"hcl.84488f47.js","28Tam":"hlsl.323b0c17.js","awNOU":"hoon.df16cb45.js","eeLMI":"hpkp.9c950797.js","gjEKw":"hsts.0440ab7b.js","3bCJ7":"http.96d5f1c1.js","id4YZ":"ichigojam.c0bd16f5.js","5TKHe":"icon.439feb9f.js","eijPh":"icu-message-format.e96f6551.js","lv8gR":"idris.d3811412.js","bW8K3":"iecst.3fdbbc52.js","b8EBv":"ignore.00726ce9.js","jOS96":"inform7.65978ef5.js","dn3Yf":"ini.1cbb0515.js","iUSU6":"io.e628fd7e.js","6wbwo":"j.b959d174.js","5qA0j":"java.0ffd8069.js","hdx4d":"javadoc.b99752ae.js","jRMSs":"javadoclike.8cc3d825.js","l2DRD":"javascript.fe729813.js","cpOeo":"javastacktrace.cc22fb4b.js","fSVrK":"jexl.2cce5cc0.js","03mi8":"jolie.d8f352cd.js","j6YjP":"jq.65b95777.js","6JQIv":"js-extras.7d041902.js","5nVrm":"js-templates.a3463d0b.js","9gPZY":"jsdoc.0c5cc4d3.js","8q0xA":"json5.b9de5531.js","fIx8j":"jsonp.eefdc553.js","a3ur7":"jsstacktrace.8d3a2b71.js","bKtxi":"julia.679e1c74.js","9vqI0":"keepalived.e694c167.js","lDUCl":"keyman.d1406200.js","gcEXq":"kotlin.fd040b34.js","cxxOt":"kumir.b2072cfc.js","b8NIc":"kusto.98546fcc.js","iXz7U":"latex.ecc17a0d.js","9nRbn":"latte.18295a4f.js","lWxq2":"less.a8a986ab.js","7dEcL":"lilypond.0423d709.js","ck7Ll":"scheme.4039466f.js","hI3m3":"liquid.533f073c.js","7qpQZ":"lisp.b075bd53.js","8Cm1D":"livescript.2b19fb05.js","9sT8D":"llvm.6b74465d.js","gQkTU":"log.b74346d6.js","86y52":"lolcode.0fbc730a.js","6bXdx":"magma.bbb66246.js","hDIxO":"makefile.bf1a7653.js","4wRUQ":"markdown.4a5510a8.js","66rgq":"markup.973a8c4c.js","iAx9A":"matlab.caaa1e9f.js","5SXMq":"maxscript.58a0bf4d.js","gnQ55":"mel.c5da9d2e.js","8G54S":"mermaid.ced53190.js","gfXsu":"mizar.4e6d6035.js","7nZsb":"mongodb.5c4e0cf9.js","hUs37":"monkey.9be800f3.js","fKqwA":"moonscript.fc782589.js","luHXo":"n1ql.7f05115f.js","j0sqX":"n4js.318f41b7.js","avS2d":"nand2tetris-hdl.be3bb656.js","8fNUI":"naniscript.ec3afc9a.js","6PKtR":"nasm.1ee2623a.js","2LUGi":"neon.1d5a4ec8.js","esMLb":"nevod.6908715c.js","jQ8dR":"nginx.404fbeb4.js","1kuW2":"nim.36bf497b.js","7YxPR":"nix.3af3b6b2.js","b1EPY":"nsis.94e1fb71.js","j169M":"objectivec.49a6b342.js","1b4qw":"ocaml.c5fca1eb.js","c0JxA":"opencl.4194613a.js","54ivl":"openqasm.4b589cb3.js","kYO5l":"oz.498e9cbd.js","811Qi":"parigp.ed6a3789.js","gXO52":"parser.3329b2ab.js","4SQCy":"pascal.82aebbcf.js","9KuwN":"pascaligo.4bbd3a85.js","eM7TR":"pcaxis.e636466e.js","6w6GH":"peoplecode.32e124c6.js","eQPpI":"perl.7d72d7fd.js","b83gb":"php-extras.9606406b.js","l8BPM":"phpdoc.617f8af6.js","2cVRv":"plsql.482f8da9.js","gOyA3":"powerquery.486ee359.js","1BYb4":"powershell.856a4dd0.js","lIwm5":"processing.2c7d4403.js","cHCln":"prolog.812b5c86.js","d460J":"promql.8e6b9da4.js","lAnQP":"properties.40afd4d0.js","dG8OA":"protobuf.84963e3e.js","eRbDh":"psl.9c32166c.js","27W0o":"pug.54462c11.js","75Y4h":"puppet.2646aef5.js","kgGGG":"pure.a10bd6b4.js","hFuIq":"purebasic.629b75cd.js","db2yj":"purescript.216751ba.js","8ZppB":"q.b46a94a4.js","iFM89":"qml.bd71f711.js","7FNJV":"qore.d7e006f8.js","6AsUF":"qsharp.7bab07d1.js","7Xrsp":"r.3036c5c0.js","dh9BI":"racket.b867dd29.js","8pRTf":"reason.405183ad.js","kUbHD":"regex.aa4684b4.js","bNx4l":"rego.61da6b5d.js","jbksA":"renpy.ff0ce389.js","gP26j":"rest.91bee177.js","6FCYh":"rip.33f479a4.js","lEjxk":"roboconf.0ba2e9bf.js","c8BOJ":"robotframework.72ccad61.js","elAoE":"rust.9a35cb62.js","eDL1o":"sas.b3b3be64.js","gIQMB":"sass.165275f3.js","i7Y8T":"scala.a51a6234.js","OzRer":"shell-session.c47a7880.js","hZA2W":"smali.46e3f703.js","gT51y":"smalltalk.fb31e155.js","2OoIP":"smarty.abd6973e.js","33hrk":"sml.6d8c2545.js","3uuqi":"solidity.80562c5b.js","kHJvD":"solution-file.30e00f5f.js","6iiDq":"soy.46a7ec1f.js","2TkEp":"sparql.dbb56be0.js","eirDq":"turtle.b8836781.js","jmDes":"splunk-spl.149146f6.js","81dr7":"sqf.ea070acb.js","i4XqC":"squirrel.1efaf6f3.js","1zw3p":"stan.6efb4565.js","kfIG2":"stylus.d4d41ca4.js","dksml":"swift.ea86fdd0.js","4w3mZ":"systemd.df819c28.js","6b6p1":"t4-cs.b3eaa646.js","budu0":"t4-templating.db399052.js","7RUUk":"t4-vb.082c208c.js","2cwdT":"vbnet.ac572fcc.js","fBA7X":"tap.82e5520b.js","gqbYu":"yaml.3d0bf472.js","lCVk7":"tcl.fffb53bb.js","aKXaK":"textile.20ae1d45.js","ks7hU":"toml.69754057.js","kCJbl":"tremor.262b95d4.js","iZ71n":"tt2.f07906cb.js","5mLLA":"twig.a95c4964.js","i9AIa":"typoscript.3dbd38d9.js","iHNMy":"unrealscript.e5c3fc1d.js","bKWLJ":"uorazor.cf3ed6dc.js","2XcAn":"uri.59c4e10c.js","enDcg":"v.fe8e0874.js","db4Ta":"vala.386e6270.js","cmaSk":"velocity.9a0ffb21.js","29RKO":"verilog.4308f028.js","4aBVG":"vhdl.ca8ee4c0.js","6Jrfy":"vim.897929a5.js","kNyzl":"visual-basic.bc36aaac.js","4LJ5s":"warpscript.6d00b50f.js","6Ocza":"wasm.029f651e.js","hvPGO":"web-idl.97fc763d.js","lS90V":"wiki.1179d7f8.js","9LY8Y":"wolfram.7017e6a0.js","bFBdJ":"wren.d4121438.js","iskNq":"xeora.cce693be.js","ek7X7":"xml-doc.025d4193.js","hwA94":"xojo.843f212e.js","f8rnQ":"xquery.50701bd4.js","3Q9qv":"yang.2c70775f.js","a0Oht":"zig.e33efe11.js","dnGOp":"core.ade097c7.js","9u7s7":"index.css"}'));var a;a=o("9Hk4c"),o("85Hg2");var s={};!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),s=o("bU6y3");var l,c=o("85Hg2");l=o("bG9xl")();var u,d=o("dCyaf"),h=o("1DJXa"),f=new Uint8Array(16);function p(){if(!u&&!(u="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return u(f)}var m=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var g=function(e){return"string"==typeof e&&m.test(e)},v=[],b=0;b<256;++b)v.push((b+256).toString(16).substr(1));var y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(v[e[t+0]]+v[e[t+1]]+v[e[t+2]]+v[e[t+3]]+"-"+v[e[t+4]]+v[e[t+5]]+"-"+v[e[t+6]]+v[e[t+7]]+"-"+v[e[t+8]]+v[e[t+9]]+"-"+v[e[t+10]]+v[e[t+11]]+v[e[t+12]]+v[e[t+13]]+v[e[t+14]]+v[e[t+15]]).toLowerCase();if(!g(n))throw TypeError("Stringified UUID is invalid");return n};var w=function(e,t,n){var r=(e=e||{}).random||(e.rng||p)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var i=0;i<16;++i)t[n+i]=r[i];return t}return y(r)};const S=()=>w(),x=()=>S().replace(new RegExp("-","g"),"").toUpperCase();var M,_,A,E,C,T,I,k;(_=M||(M={}))[_.Debug=0]="Debug",_[_.Info=1]="Info",_[_.Warning=2]="Warning",_[_.Error=3]="Error",_[_.None=4]="None";class R{constructor(e,t){this.privName=e,this.privEventId=x(),this.privEventTime=(new Date).toISOString(),this.privEventType=t,this.privMetadata={}}get name(){return this.privName}get eventId(){return this.privEventId}get eventTime(){return this.privEventTime}get eventType(){return this.privEventType}get metadata(){return this.privMetadata}}class O extends R{constructor(e,t,n=M.Info){super(e,n),this.privAudioSourceId=t}get audioSourceId(){return this.privAudioSourceId}}class P extends O{constructor(e){super("AudioSourceInitializingEvent",e)}}class N extends O{constructor(e){super("AudioSourceReadyEvent",e)}}class B extends O{constructor(e){super("AudioSourceOffEvent",e)}}class L extends O{constructor(e,t){super("AudioSourceErrorEvent",e,M.Error),this.privError=t}get error(){return this.privError}}class D extends O{constructor(e,t,n){super(e,t),this.privAudioNodeId=n}get audioNodeId(){return this.privAudioNodeId}}class U extends D{constructor(e,t){super("AudioStreamNodeAttachingEvent",e,t)}}class F extends D{constructor(e,t){super("AudioStreamNodeAttachedEvent",e,t)}}class z extends D{constructor(e,t){super("AudioStreamNodeDetachedEvent",e,t)}}class j extends D{constructor(e,t,n){super("AudioStreamNodeErrorEvent",e,t),this.privError=n}get error(){return this.privError}}class H extends R{constructor(e,t,n=M.Info){super(e,n),this.privJsonResult=t}get jsonString(){return this.privJsonResult}}class G extends R{constructor(e,t,n=M.Info){super(e,n),this.privConnectionId=t}get connectionId(){return this.privConnectionId}}class V extends G{constructor(e,t,n){super("ConnectionStartEvent",e),this.privUri=t,this.privHeaders=n}get uri(){return this.privUri}get headers(){return this.privHeaders}}class W extends G{constructor(e){super("ConnectionEstablishedEvent",e)}}class q extends G{constructor(e,t,n){super("ConnectionClosedEvent",e,M.Debug),this.privReason=n,this.privStatusCode=t}get reason(){return this.privReason}get statusCode(){return this.privStatusCode}}class K extends G{constructor(e,t,n){super("ConnectionErrorEvent",e,M.Debug),this.privMessage=t,this.privType=n}get message(){return this.privMessage}get type(){return this.privType}}class J extends G{constructor(e,t,n){super("ConnectionEstablishErrorEvent",e,M.Error),this.privStatusCode=t,this.privReason=n}get reason(){return this.privReason}get statusCode(){return this.privStatusCode}}class Q extends G{constructor(e,t,n){super("ConnectionMessageReceivedEvent",e),this.privNetworkReceivedTime=t,this.privMessage=n}get networkReceivedTime(){return this.privNetworkReceivedTime}get message(){return this.privMessage}}class X extends G{constructor(e,t,n){super("ConnectionMessageSentEvent",e),this.privNetworkSentTime=t,this.privMessage=n}get networkSentTime(){return this.privNetworkSentTime}get message(){return this.privMessage}}class Y extends Error{constructor(e){super(e),this.name="ArgumentNull",this.message=e}}class Z extends Error{constructor(e){super(e),this.name="InvalidOperation",this.message=e}}class $ extends Error{constructor(e,t){super(t),this.name=e+"ObjectDisposed",this.message=t}}(E=A||(A={}))[E.Text=0]="Text",E[E.Binary=1]="Binary";class ee{constructor(e,t,n,r){if(this.privBody=null,e===A.Text&&t&&"string"!=typeof t)throw new Z("Payload must be a string");if(e===A.Binary&&t&&!(t instanceof ArrayBuffer))throw new Z("Payload must be ArrayBuffer");switch(this.privMessageType=e,this.privBody=t,this.privHeaders=n||{},this.privId=r||x(),this.messageType){case A.Binary:this.privSize=null!==this.binaryBody?this.binaryBody.byteLength:0;break;case A.Text:this.privSize=this.textBody.length}}get messageType(){return this.privMessageType}get headers(){return this.privHeaders}get body(){return this.privBody}get textBody(){if(this.privMessageType===A.Binary)throw new Z("Not supported for binary message");return this.privBody}get binaryBody(){if(this.privMessageType===A.Text)throw new Z("Not supported for text message");return this.privBody}get id(){return this.privId}}class te{constructor(e,t){this.privStatusCode=e,this.privReason=t}get statusCode(){return this.privStatusCode}get reason(){return this.privReason}}class ne{constructor(e){this.privEventListeners={},this.privIsDisposed=!1,this.privConsoleListener=void 0,this.privMetadata=e}onEvent(e){if(this.isDisposed())throw new $("EventSource");if(this.metadata)for(const t in this.metadata)t&&e.metadata&&(e.metadata[t]||(e.metadata[t]=this.metadata[t]));for(const t in this.privEventListeners)t&&this.privEventListeners[t]&&this.privEventListeners[t](e)}attach(e){const t=x();return this.privEventListeners[t]=e,{detach:()=>(delete this.privEventListeners[t],Promise.resolve())}}attachListener(e){return this.attach((t=>e.onEvent(t)))}attachConsoleListener(e){return this.privConsoleListener&&this.privConsoleListener.detach(),this.privConsoleListener=this.attach((t=>e.onEvent(t))),this.privConsoleListener}isDisposed(){return this.privIsDisposed}dispose(){this.privEventListeners=null,this.privIsDisposed=!0}get metadata(){return this.privMetadata}}class re{static setEventSource(e){if(!e)throw new Y("eventSource");re.privInstance=e}static get instance(){return re.privInstance}}re.privInstance=new ne,(T=C||(C={}))[T.None=0]="None",T[T.Connected=1]="Connected",T[T.Connecting=2]="Connecting",T[T.Disconnected=3]="Disconnected",(k=I||(I={}))[k.None=0]="None",k[k.Resolved=1]="Resolved",k[k.Rejected=2]="Rejected";class ie{constructor(){this.resolve=e=>(this.privResolve(e),this),this.reject=e=>(this.privReject(e),this),this.privPromise=new Promise(((e,t)=>{this.privResolve=e,this.privReject=t}))}get promise(){return this.privPromise}}function oe(e,t,n){e.then((e=>{try{t&&t(e)}catch(e){if(n)try{if(e instanceof Error){const t=e;n(t.name+": "+t.message)}else n(e)}catch(e){}}}),(e=>{if(n)try{if(e instanceof Error){const t=e;n(t.name+": "+t.message)}else n(e)}catch(e){}}))}var ae={};e(ae,"Queue",(()=>de),(e=>de=e));class se{constructor(e){if(this.privSubscriptionIdCounter=0,this.privAddSubscriptions={},this.privRemoveSubscriptions={},this.privDisposedSubscriptions={},this.privDisposeReason=null,this.privList=[],e)for(const t of e)this.privList.push(t)}get(e){return this.throwIfDisposed(),this.privList[e]}first(){return this.get(0)}last(){return this.get(this.length()-1)}add(e){this.throwIfDisposed(),this.insertAt(this.privList.length,e)}insertAt(e,t){this.throwIfDisposed(),0===e?this.privList.unshift(t):e===this.privList.length?this.privList.push(t):this.privList.splice(e,0,t),this.triggerSubscriptions(this.privAddSubscriptions)}removeFirst(){return this.throwIfDisposed(),this.removeAt(0)}removeLast(){return this.throwIfDisposed(),this.removeAt(this.length()-1)}removeAt(e){return this.throwIfDisposed(),this.remove(e,1)[0]}remove(e,t){this.throwIfDisposed();const n=this.privList.splice(e,t);return this.triggerSubscriptions(this.privRemoveSubscriptions),n}clear(){this.throwIfDisposed(),this.remove(0,this.length())}length(){return this.throwIfDisposed(),this.privList.length}onAdded(e){this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privAddSubscriptions[t]=e,{detach:()=>(delete this.privAddSubscriptions[t],Promise.resolve())}}onRemoved(e){this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privRemoveSubscriptions[t]=e,{detach:()=>(delete this.privRemoveSubscriptions[t],Promise.resolve())}}onDisposed(e){this.throwIfDisposed();const t=this.privSubscriptionIdCounter++;return this.privDisposedSubscriptions[t]=e,{detach:()=>(delete this.privDisposedSubscriptions[t],Promise.resolve())}}join(e){return this.throwIfDisposed(),this.privList.join(e)}toArray(){const e=Array();return this.privList.forEach((t=>{e.push(t)})),e}any(e){return this.throwIfDisposed(),e?this.where(e).length()>0:this.length()>0}all(e){return this.throwIfDisposed(),this.where(e).length()===this.length()}forEach(e){this.throwIfDisposed();for(let t=0;t<this.length();t++)e(this.privList[t],t)}select(e){this.throwIfDisposed();const t=[];for(let n=0;n<this.privList.length;n++)t.push(e(this.privList[n],n));return new se(t)}where(e){this.throwIfDisposed();const t=new se;for(let n=0;n<this.privList.length;n++)e(this.privList[n],n)&&t.add(this.privList[n]);return t}orderBy(e){this.throwIfDisposed();const t=this.toArray().sort(e);return new se(t)}orderByDesc(e){return this.throwIfDisposed(),this.orderBy(((t,n)=>e(n,t)))}clone(){return this.throwIfDisposed(),new se(this.toArray())}concat(e){return this.throwIfDisposed(),new se(this.privList.concat(e.toArray()))}concatArray(e){return this.throwIfDisposed(),new se(this.privList.concat(e))}isDisposed(){return null==this.privList}dispose(e){this.isDisposed()||(this.privDisposeReason=e,this.privList=null,this.privAddSubscriptions=null,this.privRemoveSubscriptions=null,this.triggerSubscriptions(this.privDisposedSubscriptions))}throwIfDisposed(){if(this.isDisposed())throw new $("List",this.privDisposeReason)}triggerSubscriptions(e){if(e)for(const t in e)t&&e[t]()}}var le,ce,ue=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};(ce=le||(le={}))[ce.Dequeue=0]="Dequeue",ce[ce.Peek=1]="Peek";class de{constructor(e){this.privPromiseStore=new se,this.privIsDrainInProgress=!1,this.privIsDisposing=!1,this.privDisposeReason=null,this.privList=e||new se,this.privDetachables=[],this.privSubscribers=new se,this.privDetachables.push(this.privList.onAdded((()=>this.drain())))}enqueue(e){this.throwIfDispose(),this.enqueueFromPromise(new Promise((t=>t(e))))}enqueueFromPromise(e){this.throwIfDispose(),e.then((e=>{this.privList.add(e)}),(()=>{}))}dequeue(){this.throwIfDispose();const e=new ie;return this.privSubscribers&&(this.privSubscribers.add({deferral:e,type:le.Dequeue}),this.drain()),e.promise}peek(){this.throwIfDispose();const e=new ie;return this.privSubscribers&&(this.privSubscribers.add({deferral:e,type:le.Peek}),this.drain()),e.promise}length(){return this.throwIfDispose(),this.privList.length()}isDisposed(){return null==this.privSubscribers}drainAndDispose(e,t){return ue(this,void 0,void 0,(function*(){if(!this.isDisposed()&&!this.privIsDisposing){this.privDisposeReason=t,this.privIsDisposing=!0;const n=this.privSubscribers;if(n){for(;n.length()>0;){n.removeFirst().deferral.resolve(void 0)}this.privSubscribers===n&&(this.privSubscribers=n)}for(const e of this.privDetachables)yield e.detach();if(this.privPromiseStore.length()>0&&e){const t=[];return this.privPromiseStore.toArray().forEach((e=>{t.push(e)})),Promise.all(t).finally((()=>{this.privSubscribers=null,this.privList.forEach((t=>{e(t)})),this.privList=null})).then()}this.privSubscribers=null,this.privList=null}}))}dispose(e){return ue(this,void 0,void 0,(function*(){yield this.drainAndDispose(null,e)}))}drain(){if(!this.privIsDrainInProgress&&!this.privIsDisposing){this.privIsDrainInProgress=!0;const e=this.privSubscribers,t=this.privList;if(e&&t){for(;t.length()>0&&e.length()>0&&!this.privIsDisposing;){const n=e.removeFirst();if(n.type===le.Peek)n.deferral.resolve(t.first());else{const e=t.removeFirst();n.deferral.resolve(e)}}this.privSubscribers===e&&(this.privSubscribers=e),this.privList===t&&(this.privList=t)}this.privIsDrainInProgress=!1}}throwIfDispose(){if(this.isDisposed()){if(this.privDisposeReason)throw new Z(this.privDisposeReason);throw new $("Queue")}if(this.privIsDisposing)throw new Z("Queue disposing")}}class he{constructor(e,t,n){if(this.privPayload=null,!t)throw new Y("payload");if(e===A.Binary&&"ArrayBuffer"!==t.__proto__.constructor.name)throw new Z("Payload must be ArrayBuffer");if(e===A.Text&&"string"!=typeof t)throw new Z("Payload must be a string");this.privMessageType=e,this.privPayload=t,this.privId=n||x()}get messageType(){return this.privMessageType}get payload(){return this.privPayload}get textContent(){if(this.privMessageType===A.Binary)throw new Z("Not supported for binary message");return this.privPayload}get binaryContent(){if(this.privMessageType===A.Text)throw new Z("Not supported for text message");return this.privPayload}get id(){return this.privId}}class fe{constructor(e,t){this.privActualSampleRate=e,this.privDesiredSampleRate=t}encode(e){const t=this.downSampleAudioFrame(e,this.privActualSampleRate,this.privDesiredSampleRate);if(!t)return null;const n=2*t.length,r=new ArrayBuffer(n),i=new DataView(r);return this.floatTo16BitPCM(i,0,t),r}setString(e,t,n){for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))}floatTo16BitPCM(e,t,n){for(let r=0;r<n.length;r++,t+=2){const i=Math.max(-1,Math.min(1,n[r]));e.setInt16(t,i<0?32768*i:32767*i,!0)}}downSampleAudioFrame(e,t,n){if(!e)return null;if(n===t||n>t)return e;const r=t/n,i=Math.round(e.length/r),o=new Float32Array(i);let a=0,s=0;for(;s<i;){const t=Math.round((s+1)*r);let n=0,i=0;for(;a<t&&a<e.length;)n+=e[a++],i++;o[s++]=n/i}return o}}var pe={};e(pe,"Stream",(()=>be),(e=>be=e));var me,ge,ve=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class be{constructor(e){this.privIsWriteEnded=!1,this.privIsReadEnded=!1,this.privId=e||x(),this.privReaderQueue=new(0,ae.Queue)}get isClosed(){return this.privIsWriteEnded}get isReadEnded(){return this.privIsReadEnded}get id(){return this.privId}close(){this.privIsWriteEnded||(this.writeStreamChunk({buffer:null,isEnd:!0,timeReceived:Date.now()}),this.privIsWriteEnded=!0)}writeStreamChunk(e){if(this.throwIfClosed(),!this.privReaderQueue.isDisposed())try{this.privReaderQueue.enqueue(e)}catch(e){}}read(){if(this.privIsReadEnded)throw new Z("Stream read has already finished");return this.privReaderQueue.dequeue().then((e=>ve(this,void 0,void 0,(function*(){return(void 0===e||e.isEnd)&&(yield this.privReaderQueue.dispose("End of stream reached")),e}))))}readEnded(){this.privIsReadEnded||(this.privIsReadEnded=!0,this.privReaderQueue=new(0,ae.Queue))}throwIfClosed(){if(this.privIsWriteEnded)throw new Z("Stream closed")}}(ge=me||(me={}))[ge.Success=0]="Success",ge[ge.Error=1]="Error";class ye extends pe.Stream{constructor(e,t){super(t),this.privTargetChunkSize=e,this.privNextBufferReadyBytes=0}writeStreamChunk(e){if(e.isEnd||0===this.privNextBufferReadyBytes&&e.buffer.byteLength===this.privTargetChunkSize)return void super.writeStreamChunk(e);let t=0;for(;t<e.buffer.byteLength;){void 0===this.privNextBufferToWrite&&(this.privNextBufferToWrite=new ArrayBuffer(this.privTargetChunkSize),this.privNextBufferStartTime=e.timeReceived);const n=Math.min(e.buffer.byteLength-t,this.privTargetChunkSize-this.privNextBufferReadyBytes),r=new Uint8Array(this.privNextBufferToWrite),i=new Uint8Array(e.buffer.slice(t,n+t));r.set(i,this.privNextBufferReadyBytes),this.privNextBufferReadyBytes+=n,t+=n,this.privNextBufferReadyBytes===this.privTargetChunkSize&&(super.writeStreamChunk({buffer:this.privNextBufferToWrite,isEnd:!1,timeReceived:this.privNextBufferStartTime}),this.privNextBufferReadyBytes=0,this.privNextBufferToWrite=void 0)}}close(){0===this.privNextBufferReadyBytes||this.isClosed||super.writeStreamChunk({buffer:this.privNextBufferToWrite.slice(0,this.privNextBufferReadyBytes),isEnd:!1,timeReceived:this.privNextBufferStartTime}),super.close()}}class we{static load(e){const t=new Map([[0,()=>{}]]),n=new Map,r=new Worker(e);r.addEventListener("message",(({data:e})=>{if(we.isCallNotification(e)){const{params:{timerId:r}}=e,i=t.get(r);if("number"==typeof i){const e=n.get(i);if(void 0===e||e!==r)throw new Error("The timer is in an undefined state.")}else{if(void 0===i)throw new Error("The timer is in an undefined state.");i(),t.delete(r)}}else{if(!we.isClearResponse(e)){const{error:{message:t}}=e;throw new Error(t)}{const{id:r}=e,i=n.get(r);if(void 0===i)throw new Error("The timer is in an undefined state.");n.delete(r),t.delete(i)}}}));return{clearTimeout:e=>{const i=Math.random();n.set(i,e),t.set(e,i),r.postMessage({id:i,method:"clear",params:{timerId:e}})},setTimeout:(e,n)=>{const i=Math.random();return t.set(i,e),r.postMessage({id:null,method:"set",params:{delay:n,now:performance.now(),timerId:i}}),i}}}static loadWorkerTimers(){return()=>{if(null!==we.workerTimers)return we.workerTimers;const e=new Blob(['!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=14)}([function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return d}));const r=new Map,o=new Map,i=e=>{const t=r.get(e);if(void 0===t)throw new Error(\'There is no interval scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),r.delete(e)},u=e=>{const t=o.get(e);if(void 0===t)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(t),o.delete(e)},f=(e,t)=>{let n,r;if("performance"in self){const o=performance.now();n=o,r=e-Math.max(0,o-t)}else n=Date.now(),r=e;return{expected:n+r,remainingDelay:r}},c=(e,t,n,r)=>{const o="performance"in self?performance.now():Date.now();o>n?postMessage({id:null,method:"call",params:{timerId:t}}):e.set(t,setTimeout(c,n-o,e,t,n))},a=(e,t,n)=>{const{expected:o,remainingDelay:i}=f(e,n);r.set(t,setTimeout(c,i,r,t,o))},d=(e,t,n)=>{const{expected:r,remainingDelay:i}=f(e,n);o.set(t,setTimeout(c,i,o,t,r))}},function(e,t,n){"use strict";n.r(t);var r=n(2);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(3);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(4);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o);var f=n(5);for(var o in f)"default"!==o&&function(e){n.d(t,e,(function(){return f[e]}))}(o);var c=n(6);for(var o in c)"default"!==o&&function(e){n.d(t,e,(function(){return c[e]}))}(o);var a=n(7);for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);var d=n(8);for(var o in d)"default"!==o&&function(e){n.d(t,e,(function(){return d[e]}))}(o);var s=n(9);for(var o in s)"default"!==o&&function(e){n.d(t,e,(function(){return s[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(11);for(var o in r)"default"!==o&&function(e){n.d(t,e,(function(){return r[e]}))}(o);var i=n(12);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);var u=n(13);for(var o in u)"default"!==o&&function(e){n.d(t,e,(function(){return u[e]}))}(o)},function(e,t){},function(e,t){},function(e,t){},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(1);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);var u=n(10);for(var i in u)"default"!==i&&function(e){n.d(t,e,(function(){return u[e]}))}(i);addEventListener("message",({data:e})=>{try{if("clear"===e.method){const{id:t,params:{timerId:n}}=e;Object(r.b)(n),postMessage({error:null,id:t})}else{if("set"!==e.method)throw new Error(\'The given method "\'.concat(e.method,\'" is not supported\'));{const{params:{delay:t,now:n,timerId:o}}=e;Object(r.d)(t,o,n)}}}catch(t){postMessage({error:{message:t.message},id:e.id,result:null})}})}]);'],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return we.workerTimers=we.load(t),we.workerTimers.setTimeout((()=>URL.revokeObjectURL(t)),0),we.workerTimers}}static isCallNotification(e){return void 0!==e.method&&"call"===e.method}static isClearResponse(e){return null===e.error&&"number"==typeof e.id}}we.workerTimers=null,we.clearTimeout=e=>we.timers().clearTimeout(e),we.setTimeout=(e,t)=>we.timers().setTimeout(e,t),we.timers=we.loadWorkerTimers();class Se extends R{constructor(e,t,n){super(e,t),this.privSignature=n}}class xe extends Se{constructor(e){super("OCSPMemoryCacheHitEvent",M.Debug,e)}}class Me extends Se{constructor(e){super("OCSPCacheMissEvent",M.Debug,e)}}class _e extends Se{constructor(e){super("OCSPDiskCacheHitEvent",M.Debug,e)}}class Ae extends Se{constructor(e){super("OCSPCacheUpdateNeededEvent",M.Debug,e)}}class Ee extends Se{constructor(e){super("OCSPMemoryCacheStoreEvent",M.Debug,e)}}class Ce extends Se{constructor(e){super("OCSPDiskCacheStoreEvent",M.Debug,e)}}class Te extends Se{constructor(e){super("OCSPCacheUpdateCompleteEvent",M.Debug,e)}}class Ie extends Se{constructor(){super("OCSPStapleReceivedEvent",M.Debug,"")}}class ke extends Se{constructor(e,t){super("OCSPCacheEntryExpiredEvent",M.Debug,e),this.privExpireTime=t}}class Re extends Se{constructor(e,t,n){super("OCSPCacheEntryNeedsRefreshEvent",M.Debug,e),this.privExpireTime=n,this.privStartTime=t}}class Oe extends Se{constructor(e,t,n){super("OCSPCacheHitEvent",M.Debug,e),this.privExpireTime=n,this.privExpireTimeString=new Date(n).toLocaleDateString(),this.privStartTime=t,this.privStartTimeString=new Date(t).toLocaleTimeString()}}class Pe extends Se{constructor(e,t){super("OCSPVerificationFailedEvent",M.Debug,e),this.privError=t}}class Ne extends Se{constructor(e,t){super("OCSPCacheFetchErrorEvent",M.Debug,e),this.privError=t}}class Be extends Se{constructor(e){super("OCSPResponseRetrievedEvent",M.Debug,e)}}class Le extends Se{constructor(e,t){super("OCSPCacheUpdateErrorEvent",M.Debug,e),this.privError=t}}class De extends R{constructor(e){super("BackgroundEvent",M.Error),this.privError=e}get error(){return this.privError}}class Ue{static throwIfNullOrUndefined(e,t){if(null==e)throw new Error("throwIfNullOrUndefined:"+t)}static throwIfNull(e,t){if(null===e)throw new Error("throwIfNull:"+t)}static throwIfNullOrWhitespace(e,t){if(Ue.throwIfNullOrUndefined(e,t),(""+e).trim().length<1)throw new Error("throwIfNullOrWhitespace:"+t)}static throwIfDisposed(e){if(e)throw new Error("the object is already disposed")}static throwIfArrayEmptyOrWhitespace(e,t){if(Ue.throwIfNullOrUndefined(e,t),0===e.length)throw new Error("throwIfArrayEmptyOrWhitespace:"+t);for(const n of e)Ue.throwIfNullOrWhitespace(n,t)}static throwIfFileDoesNotExist(e,t){Ue.throwIfNullOrWhitespace(e,t)}static throwIfNotUndefined(e,t){if(void 0!==e)throw new Error("throwIfNotUndefined:"+t)}}var Fe={};e(Fe,"MicAudioSource",(()=>tr),(e=>tr=e));class ze{}ze.AuthKey="Ocp-Apim-Subscription-Key",ze.ConnectionId="X-ConnectionId",ze.ContentType="Content-Type",ze.CustomCommandsAppId="X-CommandsAppId",ze.Path="Path",ze.RequestId="X-RequestId",ze.RequestStreamId="X-StreamId",ze.RequestTimestamp="X-Timestamp";class je{constructor(e,t){this.privHeaderName=e,this.privToken=t}get headerName(){return this.privHeaderName}get token(){return this.privToken}}class He{constructor(e){if(!e)throw new Y("subscriptionKey");this.privAuthInfo=new je(ze.AuthKey,e)}fetch(e){return Promise.resolve(this.privAuthInfo)}fetchOnExpiry(e){return Promise.resolve(this.privAuthInfo)}}const Ge="Authorization";class Ve{constructor(e,t){if(!e)throw new Y("fetchCallback");if(!t)throw new Y("fetchOnExpiryCallback");this.privFetchCallback=e,this.privFetchOnExpiryCallback=t}fetch(e){return this.privFetchCallback(e).then((e=>new je(Ge,Ve.privTokenPrefix+e)))}fetchOnExpiry(e){return this.privFetchOnExpiryCallback(e).then((e=>new je(Ge,Ve.privTokenPrefix+e)))}}Ve.privTokenPrefix="bearer ";var We,qe,Ke,Je,Qe,Xe,Ye={};e(Ye,"ServiceRecognizerBase",(()=>ut),(e=>ut=e)),(qe=We||(We={}))[qe.NoError=0]="NoError",qe[qe.AuthenticationFailure=1]="AuthenticationFailure",qe[qe.BadRequestParameters=2]="BadRequestParameters",qe[qe.TooManyRequests=3]="TooManyRequests",qe[qe.ConnectionFailure=4]="ConnectionFailure",qe[qe.ServiceTimeout=5]="ServiceTimeout",qe[qe.ServiceError=6]="ServiceError",qe[qe.RuntimeError=7]="RuntimeError",qe[qe.Forbidden=8]="Forbidden",(Je=Ke||(Ke={}))[Je.Error=0]="Error",Je[Je.EndOfStream=1]="EndOfStream",(Xe=Qe||(Qe={}))[Xe.SpeechServiceConnection_Key=0]="SpeechServiceConnection_Key",Xe[Xe.SpeechServiceConnection_Endpoint=1]="SpeechServiceConnection_Endpoint",Xe[Xe.SpeechServiceConnection_Region=2]="SpeechServiceConnection_Region",Xe[Xe.SpeechServiceAuthorization_Token=3]="SpeechServiceAuthorization_Token",Xe[Xe.SpeechServiceAuthorization_Type=4]="SpeechServiceAuthorization_Type",Xe[Xe.SpeechServiceConnection_EndpointId=5]="SpeechServiceConnection_EndpointId",Xe[Xe.SpeechServiceConnection_TranslationToLanguages=6]="SpeechServiceConnection_TranslationToLanguages",Xe[Xe.SpeechServiceConnection_TranslationVoice=7]="SpeechServiceConnection_TranslationVoice",Xe[Xe.SpeechServiceConnection_TranslationFeatures=8]="SpeechServiceConnection_TranslationFeatures",Xe[Xe.SpeechServiceConnection_IntentRegion=9]="SpeechServiceConnection_IntentRegion",Xe[Xe.SpeechServiceConnection_ProxyHostName=10]="SpeechServiceConnection_ProxyHostName",Xe[Xe.SpeechServiceConnection_ProxyPort=11]="SpeechServiceConnection_ProxyPort",Xe[Xe.SpeechServiceConnection_ProxyUserName=12]="SpeechServiceConnection_ProxyUserName",Xe[Xe.SpeechServiceConnection_ProxyPassword=13]="SpeechServiceConnection_ProxyPassword",Xe[Xe.SpeechServiceConnection_RecoMode=14]="SpeechServiceConnection_RecoMode",Xe[Xe.SpeechServiceConnection_RecoLanguage=15]="SpeechServiceConnection_RecoLanguage",Xe[Xe.Speech_SessionId=16]="Speech_SessionId",Xe[Xe.SpeechServiceConnection_SynthLanguage=17]="SpeechServiceConnection_SynthLanguage",Xe[Xe.SpeechServiceConnection_SynthVoice=18]="SpeechServiceConnection_SynthVoice",Xe[Xe.SpeechServiceConnection_SynthOutputFormat=19]="SpeechServiceConnection_SynthOutputFormat",Xe[Xe.SpeechServiceConnection_AutoDetectSourceLanguages=20]="SpeechServiceConnection_AutoDetectSourceLanguages",Xe[Xe.SpeechServiceResponse_RequestDetailedResultTrueFalse=21]="SpeechServiceResponse_RequestDetailedResultTrueFalse",Xe[Xe.SpeechServiceResponse_RequestProfanityFilterTrueFalse=22]="SpeechServiceResponse_RequestProfanityFilterTrueFalse",Xe[Xe.SpeechServiceResponse_JsonResult=23]="SpeechServiceResponse_JsonResult",Xe[Xe.SpeechServiceResponse_JsonErrorDetails=24]="SpeechServiceResponse_JsonErrorDetails",Xe[Xe.CancellationDetails_Reason=25]="CancellationDetails_Reason",Xe[Xe.CancellationDetails_ReasonText=26]="CancellationDetails_ReasonText",Xe[Xe.CancellationDetails_ReasonDetailedText=27]="CancellationDetails_ReasonDetailedText",Xe[Xe.LanguageUnderstandingServiceResponse_JsonResult=28]="LanguageUnderstandingServiceResponse_JsonResult",Xe[Xe.SpeechServiceConnection_Url=29]="SpeechServiceConnection_Url",Xe[Xe.SpeechServiceConnection_InitialSilenceTimeoutMs=30]="SpeechServiceConnection_InitialSilenceTimeoutMs",Xe[Xe.SpeechServiceConnection_EndSilenceTimeoutMs=31]="SpeechServiceConnection_EndSilenceTimeoutMs",Xe[Xe.Speech_SegmentationSilenceTimeoutMs=32]="Speech_SegmentationSilenceTimeoutMs",Xe[Xe.SpeechServiceConnection_EnableAudioLogging=33]="SpeechServiceConnection_EnableAudioLogging",Xe[Xe.SpeechServiceConnection_AtStartLanguageIdPriority=34]="SpeechServiceConnection_AtStartLanguageIdPriority",Xe[Xe.SpeechServiceConnection_ContinuousLanguageIdPriority=35]="SpeechServiceConnection_ContinuousLanguageIdPriority",Xe[Xe.SpeechServiceConnection_RecognitionEndpointVersion=36]="SpeechServiceConnection_RecognitionEndpointVersion",Xe[Xe.SpeechServiceResponse_ProfanityOption=37]="SpeechServiceResponse_ProfanityOption",Xe[Xe.SpeechServiceResponse_PostProcessingOption=38]="SpeechServiceResponse_PostProcessingOption",Xe[Xe.SpeechServiceResponse_RequestWordLevelTimestamps=39]="SpeechServiceResponse_RequestWordLevelTimestamps",Xe[Xe.SpeechServiceResponse_StablePartialResultThreshold=40]="SpeechServiceResponse_StablePartialResultThreshold",Xe[Xe.SpeechServiceResponse_OutputFormatOption=41]="SpeechServiceResponse_OutputFormatOption",Xe[Xe.SpeechServiceResponse_TranslationRequestStablePartialResult=42]="SpeechServiceResponse_TranslationRequestStablePartialResult",Xe[Xe.SpeechServiceResponse_RequestWordBoundary=43]="SpeechServiceResponse_RequestWordBoundary",Xe[Xe.SpeechServiceResponse_RequestPunctuationBoundary=44]="SpeechServiceResponse_RequestPunctuationBoundary",Xe[Xe.SpeechServiceResponse_RequestSentenceBoundary=45]="SpeechServiceResponse_RequestSentenceBoundary",Xe[Xe.Conversation_ApplicationId=46]="Conversation_ApplicationId",Xe[Xe.Conversation_DialogType=47]="Conversation_DialogType",Xe[Xe.Conversation_Initial_Silence_Timeout=48]="Conversation_Initial_Silence_Timeout",Xe[Xe.Conversation_From_Id=49]="Conversation_From_Id",Xe[Xe.Conversation_Conversation_Id=50]="Conversation_Conversation_Id",Xe[Xe.Conversation_Custom_Voice_Deployment_Ids=51]="Conversation_Custom_Voice_Deployment_Ids",Xe[Xe.Conversation_Speech_Activity_Template=52]="Conversation_Speech_Activity_Template",Xe[Xe.Conversation_Request_Bot_Status_Messages=53]="Conversation_Request_Bot_Status_Messages",Xe[Xe.Conversation_Agent_Connection_Id=54]="Conversation_Agent_Connection_Id",Xe[Xe.SpeechServiceConnection_Host=55]="SpeechServiceConnection_Host",Xe[Xe.ConversationTranslator_Host=56]="ConversationTranslator_Host",Xe[Xe.ConversationTranslator_Name=57]="ConversationTranslator_Name",Xe[Xe.ConversationTranslator_CorrelationId=58]="ConversationTranslator_CorrelationId",Xe[Xe.ConversationTranslator_Token=59]="ConversationTranslator_Token",Xe[Xe.PronunciationAssessment_ReferenceText=60]="PronunciationAssessment_ReferenceText",Xe[Xe.PronunciationAssessment_GradingSystem=61]="PronunciationAssessment_GradingSystem",Xe[Xe.PronunciationAssessment_Granularity=62]="PronunciationAssessment_Granularity",Xe[Xe.PronunciationAssessment_EnableMiscue=63]="PronunciationAssessment_EnableMiscue",Xe[Xe.PronunciationAssessment_Json=64]="PronunciationAssessment_Json",Xe[Xe.PronunciationAssessment_Params=65]="PronunciationAssessment_Params",Xe[Xe.SpeakerRecognition_Api_Version=66]="SpeakerRecognition_Api_Version";class Ze{constructor(e){this.privSessionId=e}get sessionId(){return this.privSessionId}}class $e extends Ze{constructor(e,t){super(t),this.privOffset=e}get offset(){return this.privOffset}}class et extends ee{constructor(e,t,n,r,i,o,a,s){if(!t)throw new Y("path");if(!n)throw new Y("requestId");const l={};if(l[ze.Path]=t,l[ze.RequestId]=n,l[ze.RequestTimestamp]=(new Date).toISOString(),r&&(l[ze.ContentType]=r),o&&(l[ze.RequestStreamId]=o),a)for(const e in a)e&&(l[e]=a[e]);s?super(e,i,l,s):super(e,i,l),this.privPath=t,this.privRequestId=n,this.privContentType=r,this.privStreamId=o,this.privAdditionalHeaders=a}get path(){return this.privPath}get requestId(){return this.privRequestId}get contentType(){return this.privContentType}get streamId(){return this.privStreamId}get additionalHeaders(){return this.privAdditionalHeaders}static fromConnectionMessage(e){let t=null,n=null,r=null,i=null;const o={};if(e.headers)for(const a in e.headers)a&&(a.toLowerCase()===ze.Path.toLowerCase()?t=e.headers[a]:a.toLowerCase()===ze.RequestId.toLowerCase()?n=e.headers[a]:a.toLowerCase()===ze.ContentType.toLowerCase()?r=e.headers[a]:a.toLowerCase()===ze.RequestStreamId.toLowerCase()?i=e.headers[a]:o[a]=e.headers[a]);return new et(e.messageType,t,n,r,e.body,i,o,e.id)}}var tt,nt,rt,it,ot,at,st,lt,ct=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class ut{constructor(e,t,n,r,i){if(this.privConnectionConfigurationPromise=void 0,this.privConnectionPromise=void 0,this.privSetTimeout=setTimeout,this.privIsLiveAudio=!1,this.recognizeOverride=void 0,this.disconnectOverride=void 0,this.receiveMessageOverride=void 0,this.sendPrePayloadJSONOverride=void 0,this.postConnectImplOverride=void 0,this.configConnectionOverride=void 0,!e)throw new Y("authentication");if(!t)throw new Y("connectionFactory");if(!n)throw new Y("audioSource");if(!r)throw new Y("recognizerConfig");this.privMustReportEndOfStream=!1,this.privAuthentication=e,this.privConnectionFactory=t,this.privAudioSource=n,this.privRecognizerConfig=r,this.privIsDisposed=!1,this.privRecognizer=i,this.privRequestSession=new(0,Wt.RequestSession)(this.privAudioSource.id()),this.privConnectionEvents=new ne,this.privServiceEvents=new ne,this.privDynamicGrammar=new ln,this.privSpeechContext=new sn(this.privDynamicGrammar),this.privAgentConfig=new An,"undefined"!=typeof Blob&&"undefined"!=typeof Worker&&(this.privSetTimeout=we.setTimeout),this.connectionEvents.attach((e=>{if("ConnectionClosedEvent"===e.name){const t=e;(1003===t.statusCode||1007===t.statusCode||1002===t.statusCode||4e3===t.statusCode||this.privRequestSession.numConnectionAttempts>this.privRecognizerConfig.maxRetryCount)&&this.cancelRecognitionLocal(Ke.Error,1007===t.statusCode?We.BadRequestParameters:We.ConnectionFailure,`${t.reason} websocket error code: ${t.statusCode}`)}}))}get audioSource(){return this.privAudioSource}get speechContext(){return this.privSpeechContext}get dynamicGrammar(){return this.privDynamicGrammar}get agentConfig(){return this.privAgentConfig}set conversationTranslatorToken(e){this.privRecognizerConfig.parameters.setProperty(Qe.ConversationTranslator_Token,e)}set authentication(e){this.privAuthentication=this.authentication}isDisposed(){return this.privIsDisposed}dispose(e){return ct(this,void 0,void 0,(function*(){if(this.privIsDisposed=!0,void 0!==this.privConnectionConfigurationPromise)try{const t=yield this.privConnectionConfigurationPromise;yield t.dispose(e)}catch(e){return}}))}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}get recognitionMode(){return this.privRecognizerConfig.recognitionMode}recognize(e,t,n){return ct(this,void 0,void 0,(function*(){if(void 0!==this.recognizeOverride)return void(yield this.recognizeOverride(e,t,n));this.privConnectionConfigurationPromise=void 0,this.privRecognizerConfig.recognitionMode=e,this.privSuccessCallback=t,this.privErrorCallback=n,this.privRequestSession.startNewRecognition(),this.privRequestSession.listenForServiceTelemetry(this.privAudioSource.events);const r=this.connectImpl();let i;try{const e=yield this.audioSource.attach(this.privRequestSession.audioNodeId),t=yield this.audioSource.format,n=yield this.audioSource.deviceInfo;this.privIsLiveAudio=n.type&&n.type===st.Microphones,i=new br(e,t.avgBytesPerSec),yield this.privRequestSession.onAudioSourceAttachCompleted(i,!1),this.privRecognizerConfig.SpeechServiceConfig.Context.audio={source:n}}catch(e){throw yield this.privRequestSession.onStopRecognizing(),e}try{yield r}catch(e){return void(yield this.cancelRecognitionLocal(Ke.Error,We.ConnectionFailure,e))}const o=new Ze(this.privRequestSession.sessionId);this.privRecognizer.sessionStarted&&this.privRecognizer.sessionStarted(this.privRecognizer,o),this.receiveMessage();this.sendAudio(i).catch((e=>ct(this,void 0,void 0,(function*(){yield this.cancelRecognitionLocal(Ke.Error,We.RuntimeError,e)}))))}))}stopRecognizing(){return ct(this,void 0,void 0,(function*(){if(this.privRequestSession.isRecognizing)try{yield this.audioSource.turnOff(),yield this.sendFinalAudio(),yield this.privRequestSession.onStopRecognizing(),yield this.privRequestSession.turnCompletionPromise}finally{yield this.privRequestSession.dispose()}}))}connect(){return ct(this,void 0,void 0,(function*(){return yield this.connectImpl(),Promise.resolve()}))}connectAsync(e,t){this.connectImpl().then((()=>{try{e&&e()}catch(e){t&&t(e)}}),(e=>{try{t&&t(e)}catch(e){}}))}disconnect(){return ct(this,void 0,void 0,(function*(){if(yield this.cancelRecognitionLocal(Ke.Error,We.NoError,"Disconnecting"),void 0!==this.disconnectOverride&&(yield this.disconnectOverride()),void 0!==this.privConnectionPromise)try{yield(yield this.privConnectionPromise).dispose()}catch(e){}this.privConnectionPromise=void 0}))}sendMessage(e){}sendNetworkMessage(e,t){return ct(this,void 0,void 0,(function*(){const n="string"==typeof t?A.Text:A.Binary,r="string"==typeof t?"application/json":"";return(yield this.fetchConnection()).send(new et(n,e,this.privRequestSession.requestId,r,t))}))}set activityTemplate(e){this.privActivityTemplate=e}get activityTemplate(){return this.privActivityTemplate}sendTelemetryData(){return ct(this,void 0,void 0,(function*(){const e=this.privRequestSession.getTelemetry();if(!0!==ut.telemetryDataEnabled||this.privIsDisposed||null===e)return;if(ut.telemetryData)try{ut.telemetryData(e)}catch(e){}const t=yield this.fetchConnection();yield t.send(new et(A.Text,"telemetry",this.privRequestSession.requestId,"application/json",e))}))}cancelRecognitionLocal(e,t,n){return ct(this,void 0,void 0,(function*(){this.privRequestSession.isRecognizing&&(yield this.privRequestSession.onStopRecognizing(),this.cancelRecognition(this.privRequestSession.sessionId,this.privRequestSession.requestId,e,t,n))}))}receiveMessage(){return ct(this,void 0,void 0,(function*(){try{if(this.privIsDisposed)return;let e=yield this.fetchConnection();const t=yield e.read();if(void 0!==this.receiveMessageOverride)return this.receiveMessageOverride();if(!t)return this.privRequestSession.isRecognizing?this.receiveMessage():void 0;this.privServiceHasSentMessage=!0;const n=et.fromConnectionMessage(t);if(n.requestId.toLowerCase()===this.privRequestSession.requestId.toLowerCase())switch(n.path.toLowerCase()){case"turn.start":this.privMustReportEndOfStream=!0,this.privRequestSession.onServiceTurnStartResponse();break;case"speech.startdetected":const t=Pt.fromJSON(n.textBody),r=new $e(t.Offset,this.privRequestSession.sessionId);this.privRecognizer.speechStartDetected&&this.privRecognizer.speechStartDetected(this.privRecognizer,r);break;case"speech.enddetected":let i;i=n.textBody.length>0?n.textBody:"{ Offset: 0 }";const o=Pt.fromJSON(i);this.privRecognizerConfig.isContinuousRecognition&&this.privRequestSession.onServiceRecognized(o.Offset+this.privRequestSession.currentTurnAudioOffset);const a=new $e(o.Offset+this.privRequestSession.currentTurnAudioOffset,this.privRequestSession.sessionId);this.privRecognizer.speechEndDetected&&this.privRecognizer.speechEndDetected(this.privRecognizer,a);break;case"turn.end":yield this.sendTelemetryData(),this.privRequestSession.isSpeechEnded&&this.privMustReportEndOfStream&&(this.privMustReportEndOfStream=!1,yield this.cancelRecognitionLocal(Ke.EndOfStream,We.NoError,void 0));const s=new Ze(this.privRequestSession.sessionId);if(yield this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition),!this.privRecognizerConfig.isContinuousRecognition||this.privRequestSession.isSpeechEnded||!this.privRequestSession.isRecognizing)return void(this.privRecognizer.sessionStopped&&this.privRecognizer.sessionStopped(this.privRecognizer,s));e=yield this.fetchConnection(),yield this.sendPrePayloadJSON(e);break;default:(yield this.processTypeSpecificMessages(n))||this.privServiceEvents&&this.serviceEvents.onEvent(new H(n.path.toLowerCase(),n.textBody))}return this.receiveMessage()}catch(e){return null}}))}sendSpeechContext(e,t){const n=this.speechContext.toJSON();if(t&&this.privRequestSession.onSpeechContext(),n)return e.send(new et(A.Text,"speech.context",this.privRequestSession.requestId,"application/json",n))}sendPrePayloadJSON(e,t=!0){return ct(this,void 0,void 0,(function*(){if(void 0!==this.sendPrePayloadJSONOverride)return this.sendPrePayloadJSONOverride(e);yield this.sendSpeechContext(e,t),yield this.sendWaveHeader(e)}))}sendWaveHeader(e){return ct(this,void 0,void 0,(function*(){const t=yield this.audioSource.format;return e.send(new et(A.Binary,"audio",this.privRequestSession.requestId,"audio/x-wav",t.header))}))}connectImpl(){return void 0!==this.privConnectionPromise?this.privConnectionPromise.then((e=>e.state()===C.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=void 0,this.privServiceHasSentMessage=!1,this.connectImpl()):this.privConnectionPromise),(()=>(this.privConnectionId=null,this.privConnectionPromise=void 0,this.privServiceHasSentMessage=!1,this.connectImpl()))):(this.privConnectionPromise=this.retryableConnect(),this.privConnectionPromise.catch((()=>{})),void 0!==this.postConnectImplOverride?this.postConnectImplOverride(this.privConnectionPromise):this.privConnectionPromise)}sendSpeechServiceConfig(e,t,n){if(t.onSpeechContext(),!0!==ut.telemetryDataEnabled){const e={context:{system:JSON.parse(n).context.system}};n=JSON.stringify(e)}if("true"===this.privRecognizerConfig.parameters.getProperty("TranscriptionService_SingleChannel","false").toLowerCase()){const e=JSON.parse(n);e.context.DisableReferenceChannel="True",e.context.MicSpec="1_0_0",n=JSON.stringify(e)}if(n)return e.send(new et(A.Text,"speech.config",t.requestId,"application/json",n))}fetchConnection(){return ct(this,void 0,void 0,(function*(){return void 0!==this.privConnectionConfigurationPromise?this.privConnectionConfigurationPromise.then((e=>e.state()===C.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.privServiceHasSentMessage=!1,this.fetchConnection()):this.privConnectionConfigurationPromise),(()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.privServiceHasSentMessage=!1,this.fetchConnection()))):(this.privConnectionConfigurationPromise=this.configureConnection(),yield this.privConnectionConfigurationPromise)}))}sendAudio(e){return ct(this,void 0,void 0,(function*(){const t=yield this.audioSource.format;let n=Date.now();const r=this.privRecognizerConfig.parameters.getProperty("SPEECH-TransmitLengthBeforThrottleMs","5000"),i=t.avgBytesPerSec/1e3*parseInt(r,10),o=this.privRequestSession.recogNumber,a=()=>ct(this,void 0,void 0,(function*(){if(!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===o){const r=yield this.fetchConnection(),s=yield e.read();if(this.privRequestSession.isSpeechEnded)return;let l,c;if(!s||s.isEnd?(l=null,c=0):(l=s.buffer,this.privRequestSession.onAudioSent(l.byteLength),c=i>=this.privRequestSession.bytesSent?0:Math.max(0,n-Date.now())),0!==c&&(yield this.delay(c)),null!==l&&(n=Date.now()+1e3*l.byteLength/(2*t.avgBytesPerSec)),!this.privIsDisposed&&!this.privRequestSession.isSpeechEnded&&this.privRequestSession.isRecognizing&&this.privRequestSession.recogNumber===o){if(r.send(new et(A.Binary,"audio",this.privRequestSession.requestId,null,l)).catch((()=>{this.privRequestSession.onServiceTurnEndResponse(this.privRecognizerConfig.isContinuousRecognition).catch((()=>{}))})),!(null==s?void 0:s.isEnd))return a();this.privIsLiveAudio||this.privRequestSession.onSpeechEnded()}}}));return a()}))}retryableConnect(){return ct(this,void 0,void 0,(function*(){let e=!1;this.privAuthFetchEventId=x();const t=this.privRequestSession.sessionId;this.privConnectionId=void 0!==t?t:x(),this.privRequestSession.onPreConnectionStart(this.privAuthFetchEventId,this.privConnectionId);let n=0,r="";for(;this.privRequestSession.numConnectionAttempts<=this.privRecognizerConfig.maxRetryCount;){const t=e?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId),i=yield t;yield this.privRequestSession.onAuthCompleted(!1);const o=this.privConnectionFactory.create(this.privRecognizerConfig,i,this.privConnectionId);this.privRequestSession.listenForServiceTelemetry(o.events),o.events.attach((e=>{this.connectionEvents.onEvent(e)}));const a=yield o.open();if(200===a.statusCode)return yield this.privRequestSession.onConnectionEstablishCompleted(a.statusCode),Promise.resolve(o);1006===a.statusCode&&(e=!0),n=a.statusCode,r=a.reason,this.privRequestSession.onRetryConnection()}return yield this.privRequestSession.onConnectionEstablishCompleted(n,r),Promise.reject(`Unable to contact server. StatusCode: ${n}, ${this.privRecognizerConfig.parameters.getProperty(Qe.SpeechServiceConnection_Endpoint)} Reason: ${r}`)}))}delay(e){return new Promise((t=>this.privSetTimeout(t,e)))}writeBufferToConsole(e){let t="Buffer Size: ";if(null===e)t+="null";else{const n=new Uint8Array(e);t+=`${e.byteLength}\r\n`;for(let r=0;r<e.byteLength;r++)t+=n[r].toString(16).padStart(2,"0")+" "}console.info(t)}sendFinalAudio(){return ct(this,void 0,void 0,(function*(){const e=yield this.fetchConnection();yield e.send(new et(A.Binary,"audio",this.privRequestSession.requestId,null,null))}))}configureConnection(){return ct(this,void 0,void 0,(function*(){const e=yield this.connectImpl();return void 0!==this.configConnectionOverride?this.configConnectionOverride(e):(yield this.sendSpeechServiceConfig(e,this.privRequestSession,this.privRecognizerConfig.SpeechServiceConfig.serialize()),yield this.sendPrePayloadJSON(e,!1),e)}))}}ut.telemetryDataEnabled=!0,(nt=tt||(tt={}))[nt.Interactive=0]="Interactive",nt[nt.Conversation=1]="Conversation",nt[nt.Dictation=2]="Dictation",(it=rt||(rt={}))[it.Simple=0]="Simple",it[it.Detailed=1]="Detailed";class dt{constructor(e,t){this.privSpeechServiceConfig=e||new ht(new ft(null)),this.privParameters=t,this.privMaxRetryCount=parseInt(t.getProperty("SPEECH-Error-MaxRetryCount","4"),10),this.privLanguageIdPriority=t.getProperty(Qe.SpeechServiceConnection_ContinuousLanguageIdPriority,void 0),this.privLanguageIdMode="Latency"===this.privLanguageIdPriority?"DetectContinuous":"DetectAtAudioStart","DetectAtAudioStart"===this.privLanguageIdMode&&(this.privLanguageIdPriority=t.getProperty(Qe.SpeechServiceConnection_AtStartLanguageIdPriority,void 0))}get parameters(){return this.privParameters}get recognitionMode(){return this.privRecognitionMode}set recognitionMode(e){this.privRecognitionMode=e,this.privRecognitionActivityTimeout=e===tt.Interactive?8e3:25e3,this.privSpeechServiceConfig.Recognition=tt[e]}get SpeechServiceConfig(){return this.privSpeechServiceConfig}get recognitionActivityTimeout(){return this.privRecognitionActivityTimeout}get isContinuousRecognition(){return this.privRecognitionMode!==tt.Interactive}get languageIdPriority(){return this.privLanguageIdPriority?`Prioritize${this.privLanguageIdPriority}`:""}get languageIdMode(){return this.privLanguageIdMode}get autoDetectSourceLanguages(){return this.parameters.getProperty(Qe.SpeechServiceConnection_AutoDetectSourceLanguages,void 0)}get recognitionEndpointVersion(){return this.parameters.getProperty(Qe.SpeechServiceConnection_RecognitionEndpointVersion,void 0)}get sourceLanguageModels(){const e=[];let t=!1;if(void 0!==this.autoDetectSourceLanguages)for(const n of this.autoDetectSourceLanguages.split(",")){const r=n+Qe.SpeechServiceConnection_EndpointId.toString(),i=this.parameters.getProperty(r,void 0);void 0!==i?(e.push({language:n,endpoint:i}),t=!0):e.push({language:n,endpoint:""})}return t?e:void 0}get maxRetryCount(){return this.privMaxRetryCount}}class ht{constructor(e){this.context=e}serialize(){return JSON.stringify(this,((e,t)=>{if(t&&"object"==typeof t){const e={};for(const n in t)Object.hasOwnProperty.call(t,n)&&(e[n&&n.charAt(0).toLowerCase()+n.substring(1)]=t[n]);return e}return t}))}get Context(){return this.context}get Recognition(){return this.recognition}set Recognition(e){this.recognition=e.toLowerCase()}}class ft{constructor(e){this.system=new pt,this.os=e}}class pt{constructor(){this.name="SpeechSDK",this.version="1.22.0",this.build="JavaScript",this.lang="JavaScript"}}class mt{constructor(e,t,n){this.platform=e,this.name=t,this.version=n}}(at=ot||(ot={})).Bluetooth="Bluetooth",at.Wired="Wired",at.WiFi="WiFi",at.Cellular="Cellular",at.InBuilt="InBuilt",at.Unknown="Unknown",(lt=st||(st={})).Phone="Phone",lt.Speaker="Speaker",lt.Car="Car",lt.Headset="Headset",lt.Thermostat="Thermostat",lt.Microphones="Microphones",lt.Deskphone="Deskphone",lt.RemoteControl="RemoteControl",lt.Unknown="Unknown",lt.File="File",lt.Stream="Stream";class gt{toConnectionMessage(e){const t=new ie;try{if(e.messageType===A.Text){const n=e.textContent;let r={},i=null;if(n){const e=n.split("\r\n\r\n");e&&e.length>0&&(r=this.parseHeaders(e[0]),e.length>1&&(i=e[1]))}t.resolve(new ee(e.messageType,i,r,e.id))}else if(e.messageType===A.Binary){const n=e.binaryContent;let r={},i=null;if(!n||n.byteLength<2)throw new Error("Invalid binary message format. Header length missing.");const o=new DataView(n),a=o.getInt16(0);if(n.byteLength<a+2)throw new Error("Invalid binary message format. Header content missing.");let s="";for(let e=0;e<a;e++)s+=String.fromCharCode(o.getInt8(e+2));r=this.parseHeaders(s),n.byteLength>a+2&&(i=n.slice(2+a)),t.resolve(new ee(e.messageType,i,r,e.id))}}catch(e){t.reject(`Error formatting the message. Error: ${e}`)}return t.promise}fromConnectionMessage(e){const t=new ie;try{if(e.messageType===A.Text){const n=`${this.makeHeaders(e)}\r\n${e.textBody?e.textBody:""}`;t.resolve(new he(A.Text,n,e.id))}else if(e.messageType===A.Binary){const n=this.makeHeaders(e),r=e.binaryBody,i=this.stringToArrayBuffer(n),o=new Int8Array(i),a=o.byteLength,s=new Int8Array(2+a+(r?r.byteLength:0));if(s[0]=a>>8&255,s[1]=255&a,s.set(o,2),r){const e=new Int8Array(r);s.set(e,2+a)}const l=s.buffer;t.resolve(new he(A.Binary,l,e.id))}}catch(e){t.reject(`Error formatting the message. ${e}`)}return t.promise}makeHeaders(e){let t="";if(e.headers)for(const n in e.headers)n&&(t+=`${n}: ${e.headers[n]}\r\n`);return t}parseHeaders(e){const t={};if(e){const n=e.match(/[^\r\n]+/g);if(t)for(const e of n)if(e){const n=e.indexOf(":"),r=n>0?e.substr(0,n).trim().toLowerCase():e,i=n>0&&e.length>n+1?e.substr(n+1).trim():"";t[r]=i}}return t}stringToArrayBuffer(e){const t=new ArrayBuffer(e.length),n=new DataView(t);for(let t=0;t<e.length;t++)n.setUint8(t,e.charCodeAt(t));return t}}var vt,bt,yt,wt,St,xt,Mt,_t;(bt=vt||(vt={}))[bt.Simple=0]="Simple",bt[bt.Detailed=1]="Detailed";class At{}At.BotId="botid",At.CustomSpeechDeploymentId="cid",At.CustomVoiceDeploymentId="deploymentId",At.EnableAudioLogging="storeAudio",At.EnableLanguageId="lidEnabled",At.EnableWordLevelTimestamps="wordLevelTimestamps",At.EndSilenceTimeoutMs="endSilenceTimeoutMs",At.SegmentationSilenceTimeoutMs="segmentationSilenceTimeoutMs",At.Format="format",At.InitialSilenceTimeoutMs="initialSilenceTimeoutMs",At.Language="language",At.Profanity="profanity",At.RequestBotStatusMessages="enableBotMessageStatus",At.StableIntermediateThreshold="stableIntermediateThreshold",At.StableTranslation="stableTranslation",At.TestHooks="testhooks",At.Postprocessing="postprocessing";class Et{static getHostSuffix(e){if(e){if(e.toLowerCase().startsWith("china"))return".azure.cn";if(e.toLowerCase().startsWith("usgov"))return".azure.us"}return".microsoft.com"}setCommonUrlParams(e,t,n){new Map([[Qe.Speech_SegmentationSilenceTimeoutMs,At.SegmentationSilenceTimeoutMs],[Qe.SpeechServiceConnection_EnableAudioLogging,At.EnableAudioLogging],[Qe.SpeechServiceConnection_EndSilenceTimeoutMs,At.EndSilenceTimeoutMs],[Qe.SpeechServiceConnection_InitialSilenceTimeoutMs,At.InitialSilenceTimeoutMs],[Qe.SpeechServiceResponse_PostProcessingOption,At.Postprocessing],[Qe.SpeechServiceResponse_ProfanityOption,At.Profanity],[Qe.SpeechServiceResponse_RequestWordLevelTimestamps,At.EnableWordLevelTimestamps],[Qe.SpeechServiceResponse_StablePartialResultThreshold,At.StableIntermediateThreshold]]).forEach(((r,i)=>{this.setUrlParameter(i,r,e,t,n)}));const r=JSON.parse(e.parameters.getProperty(Zn,"{}"));Object.keys(r).forEach((e=>{t[e]=r[e]}))}setUrlParameter(e,t,n,r,i){const o=n.parameters.getProperty(e,void 0);!o||i&&-1!==i.search(t)||(r[t]=o.toLocaleLowerCase())}}class Ct extends Et{constructor(){super(...arguments),this.interactiveRelativeUri="/speech/recognition/interactive/cognitiveservices/v1",this.conversationRelativeUri="/speech/recognition/conversation/cognitiveservices/v1",this.dictationRelativeUri="/speech/recognition/dictation/cognitiveservices/v1",this.universalUri="/speech/universal/v"}create(e,t,n){let r=e.parameters.getProperty(Qe.SpeechServiceConnection_Endpoint,void 0);const i=e.parameters.getProperty(Qe.SpeechServiceConnection_Region,void 0),o=Et.getHostSuffix(i),a=e.parameters.getProperty(Qe.SpeechServiceConnection_Host,"wss://"+i+".stt.speech"+o),s={},l=e.parameters.getProperty(Qe.SpeechServiceConnection_EndpointId,void 0),c=e.parameters.getProperty(Qe.SpeechServiceConnection_RecoLanguage,void 0);if(l?r&&-1!==r.search(At.CustomSpeechDeploymentId)||(s[At.CustomSpeechDeploymentId]=l):c&&(r&&-1!==r.search(At.Language)||(s[At.Language]=c)),r&&-1!==r.search(At.Format)||(s[At.Format]=e.parameters.getProperty(Xn,vt[vt.Simple]).toLowerCase()),void 0!==e.autoDetectSourceLanguages&&(s[At.EnableLanguageId]="true"),this.setCommonUrlParams(e,s,r),!r)switch(e.recognitionMode){case tt.Conversation:r="true"===e.parameters.getProperty($n,"false")?a+this.dictationRelativeUri:void 0!==e.recognitionEndpointVersion&&parseInt(e.recognitionEndpointVersion,10)>1?`${a}${this.universalUri}${e.recognitionEndpointVersion}`:a+this.conversationRelativeUri;break;case tt.Dictation:r=a+this.dictationRelativeUri;break;default:r=void 0!==e.recognitionEndpointVersion&&parseInt(e.recognitionEndpointVersion,10)>1?`${a}${this.universalUri}${e.recognitionEndpointVersion}`:a+this.interactiveRelativeUri}const u={};void 0!==t.token&&""!==t.token&&(u[t.headerName]=t.token),u[ze.ConnectionId]=n,e.parameters.setProperty(Qe.SpeechServiceConnection_Url,r);const d="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new(0,ar.WebsocketConnection)(r,s,u,new gt,wr.fromRecognizerConfig(e),d,n)}}class Tt{constructor(){this.synthesisUri="/cognitiveservices/websocket/v1"}create(e,t,n){let r=e.parameters.getProperty(Qe.SpeechServiceConnection_Endpoint,void 0);const i=e.parameters.getProperty(Qe.SpeechServiceConnection_Region,void 0),o=Et.getHostSuffix(i),a=e.parameters.getProperty(Qe.SpeechServiceConnection_EndpointId,void 0),s=void 0===a?"tts":"voice",l=e.parameters.getProperty(Qe.SpeechServiceConnection_Host,"wss://"+i+"."+s+".speech"+o);r||(r=l+this.synthesisUri);const c={};void 0!==t.token&&""!==t.token&&(c[t.headerName]=t.token),c[ze.ConnectionId]=n,void 0!==a&&(c[At.CustomVoiceDeploymentId]=a),e.parameters.setProperty(Qe.SpeechServiceConnection_Url,r);const u="true"===e.parameters.getProperty("SPEECH-EnableWebsocketCompression","false");return new(0,ar.WebsocketConnection)(r,{},c,new gt,wr.fromParameters(e.parameters),u,n)}}(wt=yt||(yt={}))[wt.NoMatch=0]="NoMatch",wt[wt.Canceled=1]="Canceled",wt[wt.RecognizingSpeech=2]="RecognizingSpeech",wt[wt.RecognizedSpeech=3]="RecognizedSpeech",wt[wt.RecognizedKeyword=4]="RecognizedKeyword",wt[wt.RecognizingIntent=5]="RecognizingIntent",wt[wt.RecognizedIntent=6]="RecognizedIntent",wt[wt.TranslatingSpeech=7]="TranslatingSpeech",wt[wt.TranslatedSpeech=8]="TranslatedSpeech",wt[wt.SynthesizingAudio=9]="SynthesizingAudio",wt[wt.SynthesizingAudioCompleted=10]="SynthesizingAudioCompleted",wt[wt.SynthesizingAudioStarted=11]="SynthesizingAudioStarted",wt[wt.EnrollingVoiceProfile=12]="EnrollingVoiceProfile",wt[wt.EnrolledVoiceProfile=13]="EnrolledVoiceProfile",wt[wt.RecognizedSpeakers=14]="RecognizedSpeakers",wt[wt.RecognizedSpeaker=15]="RecognizedSpeaker",wt[wt.ResetVoiceProfile=16]="ResetVoiceProfile",wt[wt.DeletedVoiceProfile=17]="DeletedVoiceProfile",wt[wt.VoicesListRetrieved=18]="VoicesListRetrieved";class It{static implTranslateRecognitionResult(e){let t=yt.Canceled;switch(e){case Mt.Success:t=yt.RecognizedSpeech;break;case Mt.NoMatch:case Mt.InitialSilenceTimeout:case Mt.BabbleTimeout:case Mt.EndOfDictation:t=yt.NoMatch;break;case Mt.Error:case Mt.BadRequest:case Mt.Forbidden:default:t=yt.Canceled}return t}static implTranslateCancelResult(e){let t=Ke.EndOfStream;switch(e){case Mt.Success:case Mt.EndOfDictation:case Mt.NoMatch:t=Ke.EndOfStream;break;case Mt.InitialSilenceTimeout:case Mt.BabbleTimeout:case Mt.Error:case Mt.BadRequest:case Mt.Forbidden:default:t=Ke.Error}return t}static implTranslateCancelErrorCode(e){let t=We.NoError;switch(e){case Mt.Error:t=We.ServiceError;break;case Mt.TooManyRequests:t=We.TooManyRequests;break;case Mt.BadRequest:t=We.BadRequestParameters;break;case Mt.Forbidden:t=We.Forbidden;break;default:t=We.NoError}return t}static implTranslateErrorDetails(e){let t="The speech service encountered an internal error and could not continue.";switch(e){case We.Forbidden:t="The recognizer is using a free subscription that ran out of quota.";break;case We.BadRequestParameters:t="Invalid parameter or unsupported audio format in the request.";break;case We.TooManyRequests:t="The number of parallel requests exceeded the number of allowed concurrent transcriptions."}return t}}(xt=St||(St={}))[xt.Success=0]="Success",xt[xt.SynthesisEnd=1]="SynthesisEnd",xt[xt.Error=2]="Error",(_t=Mt||(Mt={}))[_t.Success=0]="Success",_t[_t.NoMatch=1]="NoMatch",_t[_t.InitialSilenceTimeout=2]="InitialSilenceTimeout",_t[_t.BabbleTimeout=3]="BabbleTimeout",_t[_t.Error=4]="Error",_t[_t.EndOfDictation=5]="EndOfDictation",_t[_t.TooManyRequests=6]="TooManyRequests",_t[_t.BadRequest=7]="BadRequest",_t[_t.Forbidden=8]="Forbidden";class kt{constructor(){this.privKeys=[],this.privValues=[]}getProperty(e,t){let n;n="string"==typeof e?e:Qe[e];for(let e=0;e<this.privKeys.length;e++)if(this.privKeys[e]===n)return this.privValues[e];if(void 0!==t)return String(t)}setProperty(e,t){let n;n="string"==typeof e?e:Qe[e];for(let e=0;e<this.privKeys.length;e++)if(this.privKeys[e]===n)return void(this.privValues[e]=t);this.privKeys.push(n),this.privValues.push(t)}clone(){const e=new kt;for(let t=0;t<this.privKeys.length;t++)e.privKeys.push(this.privKeys[t]),e.privValues.push(this.privValues[t]);return e}mergeTo(e){this.privKeys.forEach((t=>{if(void 0===e.getProperty(t,void 0)){const n=this.getProperty(t);e.setProperty(t,n)}}))}get keys(){return this.privKeys}}class Rt{constructor(e,t,n,r,i,o,a,s,l,c){this.privResultId=e,this.privReason=t,this.privText=n,this.privDuration=r,this.privOffset=i,this.privLanguage=o,this.privLanguageDetectionConfidence=a,this.privErrorDetails=s,this.privJson=l,this.privProperties=c}get resultId(){return this.privResultId}get reason(){return this.privReason}get text(){return this.privText}get duration(){return this.privDuration}get offset(){return this.privOffset}get language(){return this.privLanguage}get languageDetectionConfidence(){return this.privLanguageDetectionConfidence}get errorDetails(){return this.privErrorDetails}get json(){return this.privJson}get properties(){return this.privProperties}}class Ot extends Rt{constructor(e,t,n,r,i,o,a,s,l,c,u){super(e,t,n,r,i,o,a,l,c,u),this.privSpeakerId=s}get speakerId(){return this.privSpeakerId}}class Pt{constructor(e){this.privSpeechStartDetected=JSON.parse(e)}static fromJSON(e){return new Pt(e)}get Offset(){return this.privSpeechStartDetected.Offset}}class Nt{constructor(e){this.privSpeechHypothesis=JSON.parse(e)}static fromJSON(e){return new Nt(e)}get Text(){return this.privSpeechHypothesis.Text}get Offset(){return this.privSpeechHypothesis.Offset}get Duration(){return this.privSpeechHypothesis.Duration}get Language(){return void 0===this.privSpeechHypothesis.PrimaryLanguage?void 0:this.privSpeechHypothesis.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privSpeechHypothesis.PrimaryLanguage?void 0:this.privSpeechHypothesis.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSpeechHypothesis.SpeakerId}}var Bt={};e(Bt,"SpeechServiceRecognizer",(()=>zt),(e=>zt=e));class Lt extends $e{constructor(e,t,n,r,i){super(r,i),this.privReason=e,this.privErrorDetails=t,this.privErrorCode=n}get reason(){return this.privReason}get errorCode(){return this.privErrorCode}get errorDetails(){return this.privErrorDetails}}class Dt extends Lt{}class Ut extends $e{constructor(e,t,n){super(t,n),this.privResult=e}get result(){return this.privResult}}var Ft=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class zt extends Ye.ServiceRecognizerBase{constructor(e,t,n,r,i){if(super(e,t,n,r,i),this.privSpeechRecognizer=i,void 0!==r.autoDetectSourceLanguages){const e=r.autoDetectSourceLanguages.split(",");this.privSpeechContext.setSection("languageId",{Priority:r.languageIdPriority,languages:e,mode:r.languageIdMode,onSuccess:{action:"Recognize"},onUnknown:{action:"None"}}),this.privSpeechContext.setSection("phraseOutput",{interimResults:{resultType:"Auto"},phraseResults:{resultType:"Always"}});const t=r.sourceLanguageModels;void 0!==t&&this.privSpeechContext.setSection("phraseDetection",{customModels:t,onInterim:{action:"None"},onSuccess:{action:"None"}})}}processTypeSpecificMessages(e){return Ft(this,void 0,void 0,(function*(){let t;const n=new kt;n.setProperty(Qe.SpeechServiceResponse_JsonResult,e.textBody);let r=!1;switch(e.path.toLowerCase()){case"speech.hypothesis":case"speech.fragment":const i=Nt.fromJSON(e.textBody),o=i.Offset+this.privRequestSession.currentTurnAudioOffset;t=new Ot(this.privRequestSession.requestId,yt.RecognizingSpeech,i.Text,i.Duration,o,i.Language,i.LanguageDetectionConfidence,void 0,void 0,e.textBody,n),this.privRequestSession.onHypothesis(o);const a=new Ut(t,i.Duration,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognizing)try{this.privSpeechRecognizer.recognizing(this.privSpeechRecognizer,a)}catch(e){}r=!0;break;case"speech.phrase":const s=Ht.fromJSON(e.textBody),l=It.implTranslateRecognitionResult(s.RecognitionStatus);if(this.privRequestSession.onPhraseRecognized(this.privRequestSession.currentTurnAudioOffset+s.Offset+s.Duration),yt.Canceled===l){const e=It.implTranslateCancelResult(s.RecognitionStatus),t=It.implTranslateCancelErrorCode(s.RecognitionStatus);yield this.cancelRecognitionLocal(e,t,It.implTranslateErrorDetails(t))}else{if(!this.privRequestSession.isSpeechEnded||l!==yt.NoMatch||s.RecognitionStatus===Mt.InitialSilenceTimeout){if(this.privRecognizerConfig.parameters.getProperty(Xn)===vt[vt.Simple])t=new Ot(this.privRequestSession.requestId,l,s.DisplayText,s.Duration,s.Offset+this.privRequestSession.currentTurnAudioOffset,s.Language,s.LanguageDetectionConfidence,void 0,void 0,e.textBody,n);else{const r=jt.fromJSON(e.textBody),i=r.Offset+this.privRequestSession.currentTurnAudioOffset,o=r.getJsonWithCorrectedOffsets(i);t=new Ot(this.privRequestSession.requestId,l,r.RecognitionStatus===Mt.Success?r.NBest[0].Display:void 0,r.Duration,i,r.Language,r.LanguageDetectionConfidence,void 0,void 0,o,n)}const r=new Ut(t,t.offset,this.privRequestSession.sessionId);if(this.privSpeechRecognizer.recognized)try{this.privSpeechRecognizer.recognized(this.privSpeechRecognizer,r)}catch(e){}}if(this.privSuccessCallback){try{this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}this.privSuccessCallback=void 0,this.privErrorCallback=void 0}}r=!0}return r}))}cancelRecognition(e,t,n,r,i){const o=new kt;if(o.setProperty(Yn,We[r]),this.privSpeechRecognizer.canceled){const t=new Dt(n,i,r,void 0,e);try{this.privSpeechRecognizer.canceled(this.privSpeechRecognizer,t)}catch(e){}}if(this.privSuccessCallback){const e=new Ot(t,yt.Canceled,void 0,void 0,void 0,void 0,void 0,void 0,i,void 0,o);try{this.privSuccessCallback(e),this.privSuccessCallback=void 0}catch(e){}}}}class jt{constructor(e){this.privDetailedSpeechPhrase=JSON.parse(e),this.privDetailedSpeechPhrase.RecognitionStatus=Mt[this.privDetailedSpeechPhrase.RecognitionStatus]}static fromJSON(e){return new jt(e)}getJsonWithCorrectedOffsets(e){if(this.privDetailedSpeechPhrase.NBest){let t;for(const e of this.privDetailedSpeechPhrase.NBest)if(e.Words&&e.Words[0]){t=e.Words[0].Offset;break}if(t&&t<e){const n=e-t;for(const e of this.privDetailedSpeechPhrase.NBest)if(e.Words)for(const t of e.Words)t.Offset+=n}}return JSON.stringify(this.privDetailedSpeechPhrase)}get RecognitionStatus(){return this.privDetailedSpeechPhrase.RecognitionStatus}get NBest(){return this.privDetailedSpeechPhrase.NBest}get Duration(){return this.privDetailedSpeechPhrase.Duration}get Offset(){return this.privDetailedSpeechPhrase.Offset}get Language(){return void 0===this.privDetailedSpeechPhrase.PrimaryLanguage?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privDetailedSpeechPhrase.PrimaryLanguage?void 0:this.privDetailedSpeechPhrase.PrimaryLanguage.Confidence}get Text(){return this.privDetailedSpeechPhrase.NBest&&this.privDetailedSpeechPhrase.NBest[0]?this.privDetailedSpeechPhrase.NBest[0].Display||this.privDetailedSpeechPhrase.NBest[0].DisplayText:this.privDetailedSpeechPhrase.DisplayText}get SpeakerId(){return this.privDetailedSpeechPhrase.SpeakerId}}class Ht{constructor(e){this.privSimpleSpeechPhrase=JSON.parse(e),this.privSimpleSpeechPhrase.RecognitionStatus=Mt[this.privSimpleSpeechPhrase.RecognitionStatus]}static fromJSON(e){return new Ht(e)}get RecognitionStatus(){return this.privSimpleSpeechPhrase.RecognitionStatus}get DisplayText(){return this.privSimpleSpeechPhrase.DisplayText}get Offset(){return this.privSimpleSpeechPhrase.Offset}get Duration(){return this.privSimpleSpeechPhrase.Duration}get Language(){return void 0===this.privSimpleSpeechPhrase.PrimaryLanguage?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Language}get LanguageDetectionConfidence(){return void 0===this.privSimpleSpeechPhrase.PrimaryLanguage?void 0:this.privSimpleSpeechPhrase.PrimaryLanguage.Confidence}get SpeakerId(){return this.privSimpleSpeechPhrase.SpeakerId}}var Gt,Vt,Wt={};e(Wt,"RequestSession",(()=>an),(e=>an=e));class qt extends R{constructor(e,t,n,r=M.Info){super(e,r),this.privRequestId=t,this.privSessionId=n}get requestId(){return this.privRequestId}get sessionId(){return this.privSessionId}}class Kt extends qt{constructor(e,t,n,r){super("RecognitionTriggeredEvent",e,t),this.privAudioSourceId=n,this.privAudioNodeId=r}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}}class Jt extends qt{constructor(e,t,n,r){super("ListeningStartedEvent",e,t),this.privAudioSourceId=n,this.privAudioNodeId=r}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}}class Qt extends qt{constructor(e,t,n){super("ConnectingToServiceEvent",e,n),this.privAuthFetchEventid=t}get authFetchEventid(){return this.privAuthFetchEventid}}class Xt extends qt{constructor(e,t,n,r,i){super("RecognitionStartedEvent",e,i),this.privAudioSourceId=t,this.privAudioNodeId=n,this.privAuthFetchEventId=r}get audioSourceId(){return this.privAudioSourceId}get audioNodeId(){return this.privAudioNodeId}get authFetchEventId(){return this.privAuthFetchEventId}}(Vt=Gt||(Gt={}))[Vt.Success=0]="Success",Vt[Vt.AudioSourceError=1]="AudioSourceError",Vt[Vt.AudioSourceTimeout=2]="AudioSourceTimeout",Vt[Vt.AuthTokenFetchError=3]="AuthTokenFetchError",Vt[Vt.AuthTokenFetchTimeout=4]="AuthTokenFetchTimeout",Vt[Vt.UnAuthorized=5]="UnAuthorized",Vt[Vt.ConnectTimeout=6]="ConnectTimeout",Vt[Vt.ConnectError=7]="ConnectError",Vt[Vt.ClientRecognitionActivityTimeout=8]="ClientRecognitionActivityTimeout",Vt[Vt.UnknownError=9]="UnknownError";class Yt{constructor(e,t,n){this.privIsDisposed=!1,this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privRequestId=e,this.privAudioSourceId=t,this.privAudioNodeId=n,this.privReceivedMessages={},this.privPhraseLatencies=[],this.privHypothesisLatencies=[]}phraseReceived(e){e>0&&this.privPhraseLatencies.push(Date.now()-e)}hypothesisReceived(e){e>0&&this.privHypothesisLatencies.push(Date.now()-e)}onEvent(e){if(!this.privIsDisposed&&(e instanceof Kt&&e.requestId===this.privRequestId&&(this.privListeningTriggerMetric={End:e.eventTime,Name:"ListeningTrigger",Start:e.eventTime}),e instanceof U&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=e.eventTime),e instanceof F&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicStartTime=e.eventTime),e instanceof L&&e.audioSourceId===this.privAudioSourceId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:this.privMicStartTime})),e instanceof j&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Error:e.error,Name:"Microphone",Start:this.privMicStartTime})),e instanceof z&&e.audioSourceId===this.privAudioSourceId&&e.audioNodeId===this.privAudioNodeId&&(this.privMicMetric||(this.privMicMetric={End:e.eventTime,Name:"Microphone",Start:this.privMicStartTime})),e instanceof Qt&&e.requestId===this.privRequestId&&(this.privConnectionId=e.sessionId),e instanceof V&&e.connectionId===this.privConnectionId&&(this.privConnectionStartTime=e.eventTime),e instanceof W&&e.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:e.eventTime,Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),e instanceof J&&e.connectionId===this.privConnectionId&&(this.privConnectionEstablishMetric||(this.privConnectionEstablishMetric={End:e.eventTime,Error:this.getConnectionError(e.statusCode),Id:this.privConnectionId,Name:"Connection",Start:this.privConnectionStartTime})),e instanceof Q&&e.connectionId===this.privConnectionId&&e.message&&e.message.headers&&e.message.headers.path)){this.privReceivedMessages[e.message.headers.path]||(this.privReceivedMessages[e.message.headers.path]=new Array);const t=50;this.privReceivedMessages[e.message.headers.path].length<t&&this.privReceivedMessages[e.message.headers.path].push(e.networkReceivedTime)}}getTelemetry(){const e=new Array;this.privListeningTriggerMetric&&e.push(this.privListeningTriggerMetric),this.privMicMetric&&e.push(this.privMicMetric),this.privConnectionEstablishMetric&&e.push(this.privConnectionEstablishMetric),this.privPhraseLatencies.length>0&&e.push({PhraseLatencyMs:this.privPhraseLatencies}),this.privHypothesisLatencies.length>0&&e.push({FirstHypothesisLatencyMs:this.privHypothesisLatencies});const t={Metrics:e,ReceivedMessages:this.privReceivedMessages},n=JSON.stringify(t);return this.privReceivedMessages={},this.privListeningTriggerMetric=null,this.privMicMetric=null,this.privConnectionEstablishMetric=null,this.privPhraseLatencies=[],this.privHypothesisLatencies=[],n}get hasTelemetry(){return 0!==Object.keys(this.privReceivedMessages).length||null!==this.privListeningTriggerMetric||null!==this.privMicMetric||null!==this.privConnectionEstablishMetric||0!==this.privPhraseLatencies.length||0!==this.privHypothesisLatencies.length}dispose(){this.privIsDisposed=!0}getConnectionError(e){switch(e){case 400:case 1002:case 1003:case 1005:case 1007:case 1008:case 1009:return"BadRequest";case 401:return"Unauthorized";case 403:return"Forbidden";case 503:case 1001:return"ServerUnavailable";case 500:case 1011:return"ServerError";case 408:case 504:return"Timeout";default:return"statuscode:"+e.toString()}}}var Zt,$t,en,tn,nn,rn,on=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class an{constructor(e){this.privIsDisposed=!1,this.privDetachables=new Array,this.privIsAudioNodeDetached=!1,this.privIsRecognizing=!1,this.privIsSpeechEnded=!1,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privHypothesisReceived=!1,this.privBytesSent=0,this.privRecogNumber=0,this.privInTurn=!1,this.privConnectionAttempts=0,this.privAudioSourceId=e,this.privRequestId=x(),this.privAudioNodeId=x(),this.privTurnDeferral=new ie,this.privTurnDeferral.resolve()}get sessionId(){return this.privSessionId}get requestId(){return this.privRequestId}get audioNodeId(){return this.privAudioNodeId}get turnCompletionPromise(){return this.privTurnDeferral.promise}get isSpeechEnded(){return this.privIsSpeechEnded}get isRecognizing(){return this.privIsRecognizing}get currentTurnAudioOffset(){return this.privTurnStartAudioOffset}get recogNumber(){return this.privRecogNumber}get numConnectionAttempts(){return this.privConnectionAttempts}get bytesSent(){return this.privBytesSent}listenForServiceTelemetry(e){this.privServiceTelemetryListener&&this.privDetachables.push(e.attachListener(this.privServiceTelemetryListener))}startNewRecognition(){this.privIsSpeechEnded=!1,this.privIsRecognizing=!0,this.privTurnStartAudioOffset=0,this.privLastRecoOffset=0,this.privRecogNumber++,this.privServiceTelemetryListener=new Yt(this.privRequestId,this.privAudioSourceId,this.privAudioNodeId),this.onEvent(new Kt(this.requestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}onAudioSourceAttachCompleted(e,t){return on(this,void 0,void 0,(function*(){this.privAudioNode=e,this.privIsAudioNodeDetached=!1,t?yield this.onComplete():this.onEvent(new Jt(this.privRequestId,this.privSessionId,this.privAudioSourceId,this.privAudioNodeId))}))}onPreConnectionStart(e,t){this.privAuthFetchEventId=e,this.privSessionId=t,this.onEvent(new Qt(this.privRequestId,this.privAuthFetchEventId,this.privSessionId))}onAuthCompleted(e){return on(this,void 0,void 0,(function*(){e&&(yield this.onComplete())}))}onConnectionEstablishCompleted(e,t){return on(this,void 0,void 0,(function*(){if(200===e)return this.onEvent(new Xt(this.requestId,this.privAudioSourceId,this.privAudioNodeId,this.privAuthFetchEventId,this.privSessionId)),this.privAudioNode&&this.privAudioNode.replay(),this.privTurnStartAudioOffset=this.privLastRecoOffset,void(this.privBytesSent=0);403===e&&(yield this.onComplete())}))}onServiceTurnEndResponse(e){return on(this,void 0,void 0,(function*(){this.privTurnDeferral.resolve(),!e||this.isSpeechEnded?(yield this.onComplete(),this.privInTurn=!1):(this.privTurnStartAudioOffset=this.privLastRecoOffset,this.privAudioNode.replay())}))}onSpeechContext(){this.privRequestId=x()}onServiceTurnStartResponse(){this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch((()=>{}))),this.privInTurn=!0,this.privTurnDeferral=new ie}onHypothesis(e){this.privHypothesisReceived||(this.privHypothesisReceived=!0,this.privServiceTelemetryListener.hypothesisReceived(this.privAudioNode.findTimeAtOffset(e)))}onPhraseRecognized(e){this.privServiceTelemetryListener.phraseReceived(this.privAudioNode.findTimeAtOffset(e)),this.onServiceRecognized(e)}onServiceRecognized(e){this.privLastRecoOffset=e,this.privHypothesisReceived=!1,this.privAudioNode.shrinkBuffers(e),this.privConnectionAttempts=0}onAudioSent(e){this.privBytesSent+=e}onRetryConnection(){this.privConnectionAttempts++}dispose(){return on(this,void 0,void 0,(function*(){if(!this.privIsDisposed){this.privIsDisposed=!0;for(const e of this.privDetachables)yield e.detach();this.privServiceTelemetryListener&&this.privServiceTelemetryListener.dispose(),this.privIsRecognizing=!1}}))}getTelemetry(){return this.privServiceTelemetryListener.hasTelemetry?this.privServiceTelemetryListener.getTelemetry():null}onStopRecognizing(){return on(this,void 0,void 0,(function*(){yield this.onComplete()}))}onSpeechEnded(){this.privIsSpeechEnded=!0}onEvent(e){this.privServiceTelemetryListener&&this.privServiceTelemetryListener.onEvent(e),re.instance.onEvent(e)}onComplete(){return on(this,void 0,void 0,(function*(){this.privIsRecognizing&&(this.privIsRecognizing=!1,yield this.detachAudioNode())}))}detachAudioNode(){return on(this,void 0,void 0,(function*(){this.privIsAudioNodeDetached||(this.privIsAudioNodeDetached=!0,this.privAudioNode&&(yield this.privAudioNode.detach()))}))}}class sn{constructor(e){this.privContext={},this.privDynamicGrammar=e}setSection(e,t){this.privContext[e]=t}setPronunciationAssessmentParams(e){void 0===this.privContext.phraseDetection&&(this.privContext.phraseDetection={enrichment:{pronunciationAssessment:{}}}),this.privContext.phraseDetection.enrichment.pronunciationAssessment=JSON.parse(e),this.setWordLevelTimings(),this.privContext.phraseOutput.detailed.options.push("PronunciationAssessment"),-1===this.privContext.phraseOutput.detailed.options.indexOf("SNR")&&this.privContext.phraseOutput.detailed.options.push("SNR")}setWordLevelTimings(){void 0===this.privContext.phraseOutput&&(this.privContext.phraseOutput={detailed:{options:[]},format:{}}),void 0===this.privContext.phraseOutput.detailed&&(this.privContext.phraseOutput.detailed={options:[]}),this.privContext.phraseOutput.format="Detailed",-1===this.privContext.phraseOutput.detailed.options.indexOf("WordTimings")&&this.privContext.phraseOutput.detailed.options.push("WordTimings")}toJSON(){const e=this.privDynamicGrammar.generateGrammarObject();this.setSection("dgi",e);return JSON.stringify(this.privContext)}}class ln{addPhrase(e){this.privPhrases||(this.privPhrases=[]),e instanceof Array?this.privPhrases=this.privPhrases.concat(e):this.privPhrases.push(e)}clearPhrases(){this.privPhrases=void 0}addReferenceGrammar(e){this.privGrammars||(this.privGrammars=[]),e instanceof Array?this.privGrammars=this.privGrammars.concat(e):this.privGrammars.push(e)}clearGrammars(){this.privGrammars=void 0}generateGrammarObject(){if(void 0===this.privGrammars&&void 0===this.privPhrases)return;const e={};if(e.ReferenceGrammars=this.privGrammars,void 0!==this.privPhrases&&0!==this.privPhrases.length){const t=[];this.privPhrases.forEach((e=>{t.push({Text:e})})),e.Groups=[{Type:"Generic",Items:t}]}return e}}($t=Zt||(Zt={}))[$t.Raw8Khz8BitMonoMULaw=0]="Raw8Khz8BitMonoMULaw",$t[$t.Riff16Khz16KbpsMonoSiren=1]="Riff16Khz16KbpsMonoSiren",$t[$t.Audio16Khz16KbpsMonoSiren=2]="Audio16Khz16KbpsMonoSiren",$t[$t.Audio16Khz32KBitRateMonoMp3=3]="Audio16Khz32KBitRateMonoMp3",$t[$t.Audio16Khz128KBitRateMonoMp3=4]="Audio16Khz128KBitRateMonoMp3",$t[$t.Audio16Khz64KBitRateMonoMp3=5]="Audio16Khz64KBitRateMonoMp3",$t[$t.Audio24Khz48KBitRateMonoMp3=6]="Audio24Khz48KBitRateMonoMp3",$t[$t.Audio24Khz96KBitRateMonoMp3=7]="Audio24Khz96KBitRateMonoMp3",$t[$t.Audio24Khz160KBitRateMonoMp3=8]="Audio24Khz160KBitRateMonoMp3",$t[$t.Raw16Khz16BitMonoTrueSilk=9]="Raw16Khz16BitMonoTrueSilk",$t[$t.Riff16Khz16BitMonoPcm=10]="Riff16Khz16BitMonoPcm",$t[$t.Riff8Khz16BitMonoPcm=11]="Riff8Khz16BitMonoPcm",$t[$t.Riff24Khz16BitMonoPcm=12]="Riff24Khz16BitMonoPcm",$t[$t.Riff8Khz8BitMonoMULaw=13]="Riff8Khz8BitMonoMULaw",$t[$t.Raw16Khz16BitMonoPcm=14]="Raw16Khz16BitMonoPcm",$t[$t.Raw24Khz16BitMonoPcm=15]="Raw24Khz16BitMonoPcm",$t[$t.Raw8Khz16BitMonoPcm=16]="Raw8Khz16BitMonoPcm",$t[$t.Ogg16Khz16BitMonoOpus=17]="Ogg16Khz16BitMonoOpus",$t[$t.Ogg24Khz16BitMonoOpus=18]="Ogg24Khz16BitMonoOpus",$t[$t.Raw48Khz16BitMonoPcm=19]="Raw48Khz16BitMonoPcm",$t[$t.Riff48Khz16BitMonoPcm=20]="Riff48Khz16BitMonoPcm",$t[$t.Audio48Khz96KBitRateMonoMp3=21]="Audio48Khz96KBitRateMonoMp3",$t[$t.Audio48Khz192KBitRateMonoMp3=22]="Audio48Khz192KBitRateMonoMp3",$t[$t.Ogg48Khz16BitMonoOpus=23]="Ogg48Khz16BitMonoOpus",$t[$t.Webm16Khz16BitMonoOpus=24]="Webm16Khz16BitMonoOpus",$t[$t.Webm24Khz16BitMonoOpus=25]="Webm24Khz16BitMonoOpus",$t[$t.Raw24Khz16BitMonoTrueSilk=26]="Raw24Khz16BitMonoTrueSilk",$t[$t.Raw8Khz8BitMonoALaw=27]="Raw8Khz8BitMonoALaw",$t[$t.Riff8Khz8BitMonoALaw=28]="Riff8Khz8BitMonoALaw",$t[$t.Webm24Khz16Bit24KbpsMonoOpus=29]="Webm24Khz16Bit24KbpsMonoOpus",$t[$t.Audio16Khz16Bit32KbpsMonoOpus=30]="Audio16Khz16Bit32KbpsMonoOpus",$t[$t.Audio24Khz16Bit48KbpsMonoOpus=31]="Audio24Khz16Bit48KbpsMonoOpus",$t[$t.Audio24Khz16Bit24KbpsMonoOpus=32]="Audio24Khz16Bit24KbpsMonoOpus",$t[$t.Raw22050Hz16BitMonoPcm=33]="Raw22050Hz16BitMonoPcm",$t[$t.Riff22050Hz16BitMonoPcm=34]="Riff22050Hz16BitMonoPcm",$t[$t.Raw44100Hz16BitMonoPcm=35]="Raw44100Hz16BitMonoPcm",$t[$t.Riff44100Hz16BitMonoPcm=36]="Riff44100Hz16BitMonoPcm",(tn=en||(en={}))[tn.PCM=1]="PCM",tn[tn.MuLaw=2]="MuLaw",tn[tn.Siren=3]="Siren",tn[tn.MP3=4]="MP3",tn[tn.SILKSkype=5]="SILKSkype",tn[tn.OGG_OPUS=6]="OGG_OPUS",tn[tn.WEBM_OPUS=7]="WEBM_OPUS",tn[tn.ALaw=8]="ALaw",tn[tn.FLAC=9]="FLAC",tn[tn.OPUS=10]="OPUS";class cn{static getDefaultInputFormat(){return un.getDefaultInputFormat()}static getWaveFormat(e,t,n,r){return new un(e,t,n,r)}static getWaveFormatPCM(e,t,n){return new un(e,t,n)}}class un extends cn{constructor(e=16e3,t=16,n=1,r=en.PCM){super();let i=!0;switch(r){case en.PCM:this.formatTag=1;break;case en.ALaw:this.formatTag=6;break;case en.MuLaw:this.formatTag=7;break;default:i=!1}if(this.bitsPerSample=t,this.samplesPerSec=e,this.channels=n,this.avgBytesPerSec=this.samplesPerSec*this.channels*(this.bitsPerSample/8),this.blockAlign=this.channels*Math.max(this.bitsPerSample,8),i){this.privHeader=new ArrayBuffer(44);const e=new DataView(this.privHeader);this.setString(e,0,"RIFF"),e.setUint32(4,0,!0),this.setString(e,8,"WAVEfmt "),e.setUint32(16,16,!0),e.setUint16(20,this.formatTag,!0),e.setUint16(22,this.channels,!0),e.setUint32(24,this.samplesPerSec,!0),e.setUint32(28,this.avgBytesPerSec,!0),e.setUint16(32,this.channels*(this.bitsPerSample/8),!0),e.setUint16(34,this.bitsPerSample,!0),this.setString(e,36,"data"),e.setUint32(40,0,!0)}}static getDefaultInputFormat(){return new un}static getAudioContext(e){const t=window.AudioContext||window.webkitAudioContext||!1;if(t)return void 0!==e&&navigator.mediaDevices.getSupportedConstraints().sampleRate?new t({sampleRate:e}):new t;throw new Error("Browser does not support Web Audio API (AudioContext is not available).")}close(){}get header(){return this.privHeader}setString(e,t,n){for(let r=0;r<n.length;r++)e.setUint8(t+r,n.charCodeAt(r))}}class dn extends un{constructor(e,t,n,r,i,o,a,s,l){super(n,o,t,e),this.formatTag=e,this.avgBytesPerSec=r,this.blockAlign=i,this.priAudioFormatString=a,this.priRequestAudioFormatString=s,this.priHasHeader=l}static fromSpeechSynthesisOutputFormat(e){return void 0===e?dn.getDefaultOutputFormat():dn.fromSpeechSynthesisOutputFormatString(dn.SpeechSynthesisOutputFormatToString[e])}static fromSpeechSynthesisOutputFormatString(e){switch(e){case"raw-8khz-8bit-mono-mulaw":return new dn(en.MuLaw,1,8e3,8e3,1,8,e,e,!1);case"riff-16khz-16kbps-mono-siren":return new dn(en.Siren,1,16e3,2e3,40,0,e,"audio-16khz-16kbps-mono-siren",!0);case"audio-16khz-16kbps-mono-siren":return new dn(en.Siren,1,16e3,2e3,40,0,e,e,!1);case"audio-16khz-32kbitrate-mono-mp3":return new dn(en.MP3,1,16e3,4096,2,16,e,e,!1);case"audio-16khz-128kbitrate-mono-mp3":return new dn(en.MP3,1,16e3,16384,2,16,e,e,!1);case"audio-16khz-64kbitrate-mono-mp3":return new dn(en.MP3,1,16e3,8192,2,16,e,e,!1);case"audio-24khz-48kbitrate-mono-mp3":return new dn(en.MP3,1,24e3,6144,2,16,e,e,!1);case"audio-24khz-96kbitrate-mono-mp3":return new dn(en.MP3,1,24e3,12288,2,16,e,e,!1);case"audio-24khz-160kbitrate-mono-mp3":return new dn(en.MP3,1,24e3,20480,2,16,e,e,!1);case"raw-16khz-16bit-mono-truesilk":return new dn(en.SILKSkype,1,16e3,32e3,2,16,e,e,!1);case"riff-8khz-16bit-mono-pcm":return new dn(en.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!0);case"riff-24khz-16bit-mono-pcm":return new dn(en.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!0);case"riff-8khz-8bit-mono-mulaw":return new dn(en.MuLaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-mulaw",!0);case"raw-16khz-16bit-mono-pcm":return new dn(en.PCM,1,16e3,32e3,2,16,e,"raw-16khz-16bit-mono-pcm",!1);case"raw-24khz-16bit-mono-pcm":return new dn(en.PCM,1,24e3,48e3,2,16,e,"raw-24khz-16bit-mono-pcm",!1);case"raw-8khz-16bit-mono-pcm":return new dn(en.PCM,1,8e3,16e3,2,16,e,"raw-8khz-16bit-mono-pcm",!1);case"ogg-16khz-16bit-mono-opus":return new dn(en.OGG_OPUS,1,16e3,8192,2,16,e,e,!1);case"ogg-24khz-16bit-mono-opus":return new dn(en.OGG_OPUS,1,24e3,8192,2,16,e,e,!1);case"raw-48khz-16bit-mono-pcm":return new dn(en.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!1);case"riff-48khz-16bit-mono-pcm":return new dn(en.PCM,1,48e3,96e3,2,16,e,"raw-48khz-16bit-mono-pcm",!0);case"audio-48khz-96kbitrate-mono-mp3":return new dn(en.MP3,1,48e3,12288,2,16,e,e,!1);case"audio-48khz-192kbitrate-mono-mp3":return new dn(en.MP3,1,48e3,24576,2,16,e,e,!1);case"ogg-48khz-16bit-mono-opus":return new dn(en.OGG_OPUS,1,48e3,12e3,2,16,e,e,!1);case"webm-16khz-16bit-mono-opus":return new dn(en.WEBM_OPUS,1,16e3,4e3,2,16,e,e,!1);case"webm-24khz-16bit-mono-opus":return new dn(en.WEBM_OPUS,1,24e3,6e3,2,16,e,e,!1);case"webm-24khz-16bit-24kbps-mono-opus":return new dn(en.WEBM_OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-16khz-16bit-32kbps-mono-opus":return new dn(en.OPUS,1,16e3,4e3,2,16,e,e,!1);case"audio-24khz-16bit-48kbps-mono-opus":return new dn(en.OPUS,1,24e3,6e3,2,16,e,e,!1);case"audio-24khz-16bit-24kbps-mono-opus":return new dn(en.OPUS,1,24e3,3e3,2,16,e,e,!1);case"audio-24khz-16bit-mono-flac":return new dn(en.FLAC,1,24e3,24e3,2,16,e,e,!1);case"audio-48khz-16bit-mono-flac":return new dn(en.FLAC,1,48e3,3e4,2,16,e,e,!1);case"raw-24khz-16bit-mono-truesilk":return new dn(en.SILKSkype,1,24e3,48e3,2,16,e,e,!1);case"raw-8khz-8bit-mono-alaw":return new dn(en.ALaw,1,8e3,8e3,1,8,e,e,!1);case"riff-8khz-8bit-mono-alaw":return new dn(en.ALaw,1,8e3,8e3,1,8,e,"raw-8khz-8bit-mono-alaw",!0);case"raw-22050hz-16bit-mono-pcm":return new dn(en.PCM,1,22050,44100,2,16,e,e,!1);case"riff-22050hz-16bit-mono-pcm":return new dn(en.PCM,1,22050,44100,2,16,e,"raw-22050hz-16bit-mono-pcm",!0);case"raw-44100hz-16bit-mono-pcm":return new dn(en.PCM,1,44100,88200,2,16,e,e,!1);case"riff-44100hz-16bit-mono-pcm":return new dn(en.PCM,1,44100,88200,2,16,e,"raw-44100hz-16bit-mono-pcm",!0);default:return new dn(en.PCM,1,16e3,32e3,2,16,"riff-16khz-16bit-mono-pcm","raw-16khz-16bit-mono-pcm",!0)}}static getDefaultOutputFormat(){return dn.fromSpeechSynthesisOutputFormatString("undefined"!=typeof window?"audio-24khz-48kbitrate-mono-mp3":"riff-16khz-16bit-mono-pcm")}get hasHeader(){return this.priHasHeader}get header(){if(this.hasHeader)return this.privHeader}updateHeader(e){if(this.priHasHeader){const t=new DataView(this.privHeader);t.setUint32(4,e+this.privHeader.byteLength-8,!0),t.setUint32(40,e,!0)}}get requestAudioFormatString(){return this.priRequestAudioFormatString}}dn.SpeechSynthesisOutputFormatToString={[Zt.Raw8Khz8BitMonoMULaw]:"raw-8khz-8bit-mono-mulaw",[Zt.Riff16Khz16KbpsMonoSiren]:"riff-16khz-16kbps-mono-siren",[Zt.Audio16Khz16KbpsMonoSiren]:"audio-16khz-16kbps-mono-siren",[Zt.Audio16Khz32KBitRateMonoMp3]:"audio-16khz-32kbitrate-mono-mp3",[Zt.Audio16Khz128KBitRateMonoMp3]:"audio-16khz-128kbitrate-mono-mp3",[Zt.Audio16Khz64KBitRateMonoMp3]:"audio-16khz-64kbitrate-mono-mp3",[Zt.Audio24Khz48KBitRateMonoMp3]:"audio-24khz-48kbitrate-mono-mp3",[Zt.Audio24Khz96KBitRateMonoMp3]:"audio-24khz-96kbitrate-mono-mp3",[Zt.Audio24Khz160KBitRateMonoMp3]:"audio-24khz-160kbitrate-mono-mp3",[Zt.Raw16Khz16BitMonoTrueSilk]:"raw-16khz-16bit-mono-truesilk",[Zt.Riff16Khz16BitMonoPcm]:"riff-16khz-16bit-mono-pcm",[Zt.Riff8Khz16BitMonoPcm]:"riff-8khz-16bit-mono-pcm",[Zt.Riff24Khz16BitMonoPcm]:"riff-24khz-16bit-mono-pcm",[Zt.Riff8Khz8BitMonoMULaw]:"riff-8khz-8bit-mono-mulaw",[Zt.Raw16Khz16BitMonoPcm]:"raw-16khz-16bit-mono-pcm",[Zt.Raw24Khz16BitMonoPcm]:"raw-24khz-16bit-mono-pcm",[Zt.Raw8Khz16BitMonoPcm]:"raw-8khz-16bit-mono-pcm",[Zt.Ogg16Khz16BitMonoOpus]:"ogg-16khz-16bit-mono-opus",[Zt.Ogg24Khz16BitMonoOpus]:"ogg-24khz-16bit-mono-opus",[Zt.Raw48Khz16BitMonoPcm]:"raw-48khz-16bit-mono-pcm",[Zt.Riff48Khz16BitMonoPcm]:"riff-48khz-16bit-mono-pcm",[Zt.Audio48Khz96KBitRateMonoMp3]:"audio-48khz-96kbitrate-mono-mp3",[Zt.Audio48Khz192KBitRateMonoMp3]:"audio-48khz-192kbitrate-mono-mp3",[Zt.Ogg48Khz16BitMonoOpus]:"ogg-48khz-16bit-mono-opus",[Zt.Webm16Khz16BitMonoOpus]:"webm-16khz-16bit-mono-opus",[Zt.Webm24Khz16BitMonoOpus]:"webm-24khz-16bit-mono-opus",[Zt.Webm24Khz16Bit24KbpsMonoOpus]:"webm-24khz-16bit-24kbps-mono-opus",[Zt.Raw24Khz16BitMonoTrueSilk]:"raw-24khz-16bit-mono-truesilk",[Zt.Raw8Khz8BitMonoALaw]:"raw-8khz-8bit-mono-alaw",[Zt.Riff8Khz8BitMonoALaw]:"riff-8khz-8bit-mono-alaw",[Zt.Audio16Khz16Bit32KbpsMonoOpus]:"audio-16khz-16bit-32kbps-mono-opus",[Zt.Audio24Khz16Bit48KbpsMonoOpus]:"audio-24khz-16bit-48kbps-mono-opus",[Zt.Audio24Khz16Bit24KbpsMonoOpus]:"audio-24khz-16bit-24kbps-mono-opus",[Zt.Raw22050Hz16BitMonoPcm]:"raw-22050hz-16bit-mono-pcm",[Zt.Riff22050Hz16BitMonoPcm]:"riff-22050hz-16bit-mono-pcm",[Zt.Raw44100Hz16BitMonoPcm]:"raw-44100hz-16bit-mono-pcm",[Zt.Riff44100Hz16BitMonoPcm]:"riff-44100hz-16bit-mono-pcm"};(rn=nn||(nn={}))[rn.Masked=0]="Masked",rn[rn.Removed=1]="Removed",rn[rn.Raw=2]="Raw";class hn{constructor(){}static fromSubscription(e,t){Ue.throwIfNullOrWhitespace(e,"subscriptionKey"),Ue.throwIfNullOrWhitespace(t,"region");const n=new fn;return n.setProperty(Qe.SpeechServiceConnection_Region,t),n.setProperty(Qe.SpeechServiceConnection_IntentRegion,t),n.setProperty(Qe.SpeechServiceConnection_Key,e),n}static fromEndpoint(e,t){Ue.throwIfNull(e,"endpoint");const n=new fn;return n.setProperty(Qe.SpeechServiceConnection_Endpoint,e.href),void 0!==t&&n.setProperty(Qe.SpeechServiceConnection_Key,t),n}static fromHost(e,t){Ue.throwIfNull(e,"hostName");const n=new fn;return n.setProperty(Qe.SpeechServiceConnection_Host,e.protocol+"//"+e.hostname+(""===e.port?"":":"+e.port)),void 0!==t&&n.setProperty(Qe.SpeechServiceConnection_Key,t),n}static fromAuthorizationToken(e,t){Ue.throwIfNull(e,"authorizationToken"),Ue.throwIfNullOrWhitespace(t,"region");const n=new fn;return n.setProperty(Qe.SpeechServiceConnection_Region,t),n.setProperty(Qe.SpeechServiceConnection_IntentRegion,t),n.authorizationToken=e,n}close(){}}class fn extends hn{constructor(){super(),this.privProperties=new kt,this.speechRecognitionLanguage="en-US",this.outputFormat=vt.Simple}get properties(){return this.privProperties}get endPoint(){return new URL(this.privProperties.getProperty(Qe.SpeechServiceConnection_Endpoint))}get subscriptionKey(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_Key)}get region(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_Region)}get authorizationToken(){return this.privProperties.getProperty(Qe.SpeechServiceAuthorization_Token)}set authorizationToken(e){this.privProperties.setProperty(Qe.SpeechServiceAuthorization_Token,e)}get speechRecognitionLanguage(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_RecoLanguage)}set speechRecognitionLanguage(e){this.privProperties.setProperty(Qe.SpeechServiceConnection_RecoLanguage,e)}get autoDetectSourceLanguages(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_AutoDetectSourceLanguages)}set autoDetectSourceLanguages(e){this.privProperties.setProperty(Qe.SpeechServiceConnection_AutoDetectSourceLanguages,e)}get outputFormat(){return vt[this.privProperties.getProperty(Xn,void 0)]}set outputFormat(e){this.privProperties.setProperty(Xn,vt[e])}get endpointId(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_EndpointId)}set endpointId(e){this.privProperties.setProperty(Qe.SpeechServiceConnection_EndpointId,e)}setProperty(e,t){Ue.throwIfNull(t,"value"),this.privProperties.setProperty(e,t)}getProperty(e,t){return this.privProperties.getProperty(e,t)}setProxy(e,t,n,r){this.setProperty(Qe[Qe.SpeechServiceConnection_ProxyHostName],e),this.setProperty(Qe[Qe.SpeechServiceConnection_ProxyPort],t),this.setProperty(Qe[Qe.SpeechServiceConnection_ProxyUserName],n),this.setProperty(Qe[Qe.SpeechServiceConnection_ProxyPassword],r)}setServiceProperty(e,t){const n=JSON.parse(this.privProperties.getProperty(Zn,"{}"));n[e]=t,this.privProperties.setProperty(Zn,JSON.stringify(n))}setProfanity(e){this.privProperties.setProperty(Qe.SpeechServiceResponse_ProfanityOption,nn[e])}enableAudioLogging(){this.privProperties.setProperty(Qe.SpeechServiceConnection_EnableAudioLogging,"true")}requestWordLevelTimestamps(){this.privProperties.setProperty(Qe.SpeechServiceResponse_RequestWordLevelTimestamps,"true")}enableDictation(){this.privProperties.setProperty($n,"true")}clone(){const e=new fn;return e.privProperties=this.privProperties.clone(),e}get speechSynthesisLanguage(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_SynthLanguage)}set speechSynthesisLanguage(e){this.privProperties.setProperty(Qe.SpeechServiceConnection_SynthLanguage,e)}get speechSynthesisVoiceName(){return this.privProperties.getProperty(Qe.SpeechServiceConnection_SynthVoice)}set speechSynthesisVoiceName(e){this.privProperties.setProperty(Qe.SpeechServiceConnection_SynthVoice,e)}get speechSynthesisOutputFormat(){return Zt[this.privProperties.getProperty(Qe.SpeechServiceConnection_SynthOutputFormat,void 0)]}set speechSynthesisOutputFormat(e){this.privProperties.setProperty(Qe.SpeechServiceConnection_SynthOutputFormat,Zt[e])}}var pn={};e(pn,"AudioOutputStream",(()=>bn),(e=>bn=e)),e(pn,"PullAudioOutputStream",(()=>yn),(e=>yn=e)),e(pn,"PullAudioOutputStreamImpl",(()=>wn),(e=>wn=e)),e(pn,"PushAudioOutputStream",(()=>Sn),(e=>Sn=e)),e(pn,"PushAudioOutputStreamImpl",(()=>xn),(e=>xn=e));var mn,gn,vn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class bn{constructor(){}static createPullStream(){return yn.create()}}class yn extends bn{static create(){return new wn}}class wn extends yn{constructor(){super(),this.privId=x(),this.privStream=new(0,pe.Stream)}set format(e){null==e&&(this.privFormat=dn.getDefaultOutputFormat()),this.privFormat=e}get format(){return this.privFormat}get isClosed(){return this.privStream.isClosed}id(){return this.privId}read(e){return vn(this,void 0,void 0,(function*(){const t=new Int8Array(e);let n=0;if(void 0!==this.privLastChunkView){if(this.privLastChunkView.length>e.byteLength)return t.set(this.privLastChunkView.slice(0,e.byteLength)),this.privLastChunkView=this.privLastChunkView.slice(e.byteLength),Promise.resolve(e.byteLength);t.set(this.privLastChunkView),n=this.privLastChunkView.length,this.privLastChunkView=void 0}for(;n<e.byteLength&&!this.privStream.isReadEnded;){const r=yield this.privStream.read();if(void 0===r||r.isEnd)this.privStream.readEnded();else{let i;r.buffer.byteLength>e.byteLength-n?(i=r.buffer.slice(0,e.byteLength-n),this.privLastChunkView=new Int8Array(r.buffer.slice(e.byteLength-n))):i=r.buffer,t.set(new Int8Array(i),n),n+=i.byteLength}}return n}))}write(e){Ue.throwIfNullOrUndefined(this.privStream,"must set format before writing"),this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}}class Sn extends bn{constructor(){super()}static create(e){return new xn(e)}}class xn extends Sn{constructor(e){super(),this.privId=x(),this.privCallback=e}set format(e){}write(e){this.privCallback.write&&this.privCallback.write(e)}close(){this.privCallback.close&&this.privCallback.close()}id(){return this.privId}}(gn=mn||(mn={}))[gn.None=0]="None",gn[gn.TextToSpeechAudio=1]="TextToSpeechAudio";var Mn,_n;class An{toJsonString(){return JSON.stringify(this.iPrivConfig)}get(){return this.iPrivConfig}set(e){this.iPrivConfig=e}}(_n=Mn||(Mn={})).WordBoundary="WordBoundary",_n.Bookmark="Bookmark",_n.Viseme="Viseme",_n.SentenceBoundary="SentenceBoundary",_n.SessionEnd="SessionEnd";class En{constructor(e){this.privSynthesisAudioMetadata=JSON.parse(e)}static fromJSON(e){return new En(e)}get Metadata(){return this.privSynthesisAudioMetadata.Metadata}}var Cn={};e(Cn,"SynthesisTurn",(()=>qn),(e=>qn=e));var Tn={};e(Tn,"SynthesisAdapterBase",(()=>Ln),(e=>Ln=e));class In{constructor(e,t){this.privAudioOffset=e,this.privText=t}get audioOffset(){return this.privAudioOffset}get text(){return this.privText}}class kn{constructor(e){this.privResult=e}get result(){return this.privResult}}class Rn{constructor(e,t,n,r){this.privResultId=e,this.privReason=t,this.privErrorDetails=n,this.privProperties=r}get resultId(){return this.privResultId}get reason(){return this.privReason}get errorDetails(){return this.privErrorDetails}get properties(){return this.privProperties}}class On extends Rn{constructor(e,t,n,r,i,o){super(e,t,r,i),this.privAudioData=n,this.privAudioDuration=o}get audioData(){return this.privAudioData}get audioDuration(){return this.privAudioDuration}}class Pn{constructor(e,t,n){this.privAudioOffset=e,this.privVisemeId=t,this.privAnimation=n}get audioOffset(){return this.privAudioOffset}get visemeId(){return this.privVisemeId}get animation(){return this.privAnimation}}class Nn{constructor(e,t,n,r,i,o){this.privAudioOffset=e,this.privDuration=t,this.privText=n,this.privWordLength=r,this.privTextOffset=i,this.privBoundaryType=o}get audioOffset(){return this.privAudioOffset}get duration(){return this.privDuration}get text(){return this.privText}get wordLength(){return this.privWordLength}get textOffset(){return this.privTextOffset}get boundaryType(){return this.privBoundaryType}}var Bn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class Ln{constructor(e,t,n,r,i){if(this.speakOverride=void 0,this.receiveMessageOverride=void 0,this.connectImplOverride=void 0,this.configConnectionOverride=void 0,this.privConnectionConfigurationPromise=void 0,!e)throw new Y("authentication");if(!t)throw new Y("connectionFactory");if(!n)throw new Y("synthesizerConfig");this.privAuthentication=e,this.privConnectionFactory=t,this.privSynthesizerConfig=n,this.privIsDisposed=!1,this.privSpeechSynthesizer=r,this.privSessionAudioDestination=i,this.privSynthesisTurn=new(0,Cn.SynthesisTurn),this.privConnectionEvents=new ne,this.privServiceEvents=new ne,this.privSynthesisContext=new Qn(this.privSpeechSynthesizer),this.privAgentConfig=new An,this.connectionEvents.attach((e=>{if("ConnectionClosedEvent"===e.name){const t=e;1e3!==t.statusCode&&this.cancelSynthesisLocal(Ke.Error,1007===t.statusCode?We.BadRequestParameters:We.ConnectionFailure,`${t.reason} websocket error code: ${t.statusCode}`)}}))}get synthesisContext(){return this.privSynthesisContext}get agentConfig(){return this.privAgentConfig}get connectionEvents(){return this.privConnectionEvents}get serviceEvents(){return this.privServiceEvents}set activityTemplate(e){this.privActivityTemplate=e}get activityTemplate(){return this.privActivityTemplate}set audioOutputFormat(e){this.privAudioOutputFormat=e,this.privSynthesisTurn.audioOutputFormat=e,void 0!==this.privSessionAudioDestination&&(this.privSessionAudioDestination.format=e),void 0!==this.synthesisContext&&(this.synthesisContext.audioOutputFormat=e)}static addHeader(e,t){if(!t.hasHeader)return e;t.updateHeader(e.byteLength);const n=new Uint8Array(e.byteLength+t.header.byteLength);return n.set(new Uint8Array(t.header),0),n.set(new Uint8Array(e),t.header.byteLength),n.buffer}isDisposed(){return this.privIsDisposed}dispose(e){return Bn(this,void 0,void 0,(function*(){if(this.privIsDisposed=!0,void 0!==this.privSessionAudioDestination&&this.privSessionAudioDestination.close(),void 0!==this.privConnectionConfigurationPromise){const t=yield this.privConnectionConfigurationPromise;yield t.dispose(e)}}))}connect(){return Bn(this,void 0,void 0,(function*(){yield this.connectImpl()}))}sendNetworkMessage(e,t){return Bn(this,void 0,void 0,(function*(){const n="string"==typeof t?A.Text:A.Binary,r="string"==typeof t?"application/json":"";return(yield this.fetchConnection()).send(new et(n,e,this.privSynthesisTurn.requestId,r,t))}))}Speak(e,t,n,r,i,o){return Bn(this,void 0,void 0,(function*(){let a;if(a=t?e:this.privSpeechSynthesizer.buildSsml(e),void 0!==this.speakOverride)return this.speakOverride(a,n,r,i);this.privSuccessCallback=r,this.privErrorCallback=i,this.privSynthesisTurn.startNewSynthesis(n,e,t,o);try{yield this.connectImpl();const e=yield this.fetchConnection();yield this.sendSynthesisContext(e),yield this.sendSsmlMessage(e,a,n);const t=new kn(new On(n,yt.SynthesizingAudioStarted));this.privSpeechSynthesizer.synthesisStarted&&this.privSpeechSynthesizer.synthesisStarted(this.privSpeechSynthesizer,t),this.receiveMessage()}catch(e){return this.cancelSynthesisLocal(Ke.Error,We.ConnectionFailure,e),Promise.reject(e)}}))}cancelSynthesis(e,t,n,r){const i=new kt;i.setProperty(Yn,We[n]);const o=new On(e,yt.Canceled,void 0,r,i);if(this.privSpeechSynthesizer.SynthesisCanceled){const e=new kn(o);try{this.privSpeechSynthesizer.SynthesisCanceled(this.privSpeechSynthesizer,e)}catch(e){}}if(this.privSuccessCallback)try{this.privSuccessCallback(o)}catch(e){}}cancelSynthesisLocal(e,t,n){this.privSynthesisTurn.isSynthesizing&&(this.privSynthesisTurn.onStopSynthesizing(),this.cancelSynthesis(this.privSynthesisTurn.requestId,e,t,n))}processTypeSpecificMessages(e){return!0}receiveMessage(){return Bn(this,void 0,void 0,(function*(){try{const e=yield this.fetchConnection(),t=yield e.read();if(void 0!==this.receiveMessageOverride)return this.receiveMessageOverride();if(this.privIsDisposed)return;if(!t)return this.privSynthesisTurn.isSynthesizing?this.receiveMessage():void 0;const n=et.fromConnectionMessage(t);if(n.requestId.toLowerCase()===this.privSynthesisTurn.requestId.toLowerCase())switch(n.path.toLowerCase()){case"turn.start":this.privSynthesisTurn.onServiceTurnStartResponse();break;case"response":this.privSynthesisTurn.onServiceResponseMessage(n.textBody);break;case"audio":if(this.privSynthesisTurn.streamId.toLowerCase()===n.streamId.toLowerCase()&&n.binaryBody){if(this.privSynthesisTurn.onAudioChunkReceived(n.binaryBody),this.privSpeechSynthesizer.synthesizing)try{const e=Ln.addHeader(n.binaryBody,this.privSynthesisTurn.audioOutputFormat),t=new kn(new On(this.privSynthesisTurn.requestId,yt.SynthesizingAudio,e));this.privSpeechSynthesizer.synthesizing(this.privSpeechSynthesizer,t)}catch(e){}void 0!==this.privSessionAudioDestination&&this.privSessionAudioDestination.write(n.binaryBody)}break;case"audio.metadata":const e=En.fromJSON(n.textBody).Metadata;for(const t of e)switch(t.Type){case Mn.WordBoundary:case Mn.SentenceBoundary:this.privSynthesisTurn.onTextBoundaryEvent(t);const e=new Nn(t.Data.Offset,t.Data.Duration,t.Data.text.Text,t.Data.text.Length,t.Type===Mn.WordBoundary?this.privSynthesisTurn.currentTextOffset:this.privSynthesisTurn.currentSentenceOffset,t.Data.text.BoundaryType);if(this.privSpeechSynthesizer.wordBoundary)try{this.privSpeechSynthesizer.wordBoundary(this.privSpeechSynthesizer,e)}catch(e){}break;case Mn.Bookmark:const n=new In(t.Data.Offset,t.Data.Bookmark);if(this.privSpeechSynthesizer.bookmarkReached)try{this.privSpeechSynthesizer.bookmarkReached(this.privSpeechSynthesizer,n)}catch(e){}break;case Mn.Viseme:if(this.privSynthesisTurn.onVisemeMetadataReceived(t),t.Data.IsLastAnimation){const e=new Pn(t.Data.Offset,t.Data.VisemeId,this.privSynthesisTurn.getAndClearVisemeAnimation());if(this.privSpeechSynthesizer.visemeReceived)try{this.privSpeechSynthesizer.visemeReceived(this.privSpeechSynthesizer,e)}catch(e){}}break;case Mn.SessionEnd:this.privSynthesisTurn.onSessionEnd(t)}break;case"turn.end":let t;this.privSynthesisTurn.onServiceTurnEndResponse();try{const e=yield this.privSynthesisTurn.getAllReceivedAudioWithHeader();t=new On(this.privSynthesisTurn.requestId,yt.SynthesizingAudioCompleted,e,void 0,void 0,this.privSynthesisTurn.audioDuration),this.privSuccessCallback&&this.privSuccessCallback(t)}catch(e){this.privErrorCallback&&this.privErrorCallback(e)}if(this.privSpeechSynthesizer.synthesisCompleted)try{this.privSpeechSynthesizer.synthesisCompleted(this.privSpeechSynthesizer,new kn(t))}catch(e){}break;default:this.processTypeSpecificMessages(n)||this.privServiceEvents&&this.serviceEvents.onEvent(new H(n.path.toLowerCase(),n.textBody))}return this.receiveMessage()}catch(e){}}))}sendSynthesisContext(e){const t=this.synthesisContext.toJSON();if(t)return e.send(new et(A.Text,"synthesis.context",this.privSynthesisTurn.requestId,"application/json",t))}connectImpl(e=!1){if(null!=this.privConnectionPromise)return this.privConnectionPromise.then((e=>e.state()===C.Disconnected?(this.privConnectionId=null,this.privConnectionPromise=null,this.connectImpl()):this.privConnectionPromise),(()=>(this.privConnectionId=null,this.privConnectionPromise=null,this.connectImpl())));this.privAuthFetchEventId=x(),this.privConnectionId=x(),this.privSynthesisTurn.onPreConnectionStart(this.privAuthFetchEventId);const t=e?this.privAuthentication.fetchOnExpiry(this.privAuthFetchEventId):this.privAuthentication.fetch(this.privAuthFetchEventId);return this.privConnectionPromise=t.then((t=>Bn(this,void 0,void 0,(function*(){this.privSynthesisTurn.onAuthCompleted(!1);const n=this.privConnectionFactory.create(this.privSynthesizerConfig,t,this.privConnectionId);n.events.attach((e=>{this.connectionEvents.onEvent(e)}));const r=yield n.open();return 200===r.statusCode?(this.privSynthesisTurn.onConnectionEstablishCompleted(r.statusCode),Promise.resolve(n)):403!==r.statusCode||e?(this.privSynthesisTurn.onConnectionEstablishCompleted(r.statusCode),Promise.reject(`Unable to contact server. StatusCode: ${r.statusCode}, ${this.privSynthesizerConfig.parameters.getProperty(Qe.SpeechServiceConnection_Endpoint)} Reason: ${r.reason}`)):this.connectImpl(!0)}))),(e=>{throw this.privSynthesisTurn.onAuthCompleted(!0),new Error(e)})),this.privConnectionPromise.catch((()=>{})),this.privConnectionPromise}sendSpeechServiceConfig(e,t){if(t)return e.send(new et(A.Text,"speech.config",this.privSynthesisTurn.requestId,"application/json",t))}sendSsmlMessage(e,t,n){return e.send(new et(A.Text,"ssml",n,"application/ssml+xml",t))}fetchConnection(){return Bn(this,void 0,void 0,(function*(){return void 0!==this.privConnectionConfigurationPromise?this.privConnectionConfigurationPromise.then((e=>e.state()===C.Disconnected?(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection()):this.privConnectionConfigurationPromise),(()=>(this.privConnectionId=null,this.privConnectionConfigurationPromise=void 0,this.fetchConnection()))):(this.privConnectionConfigurationPromise=this.configureConnection(),yield this.privConnectionConfigurationPromise)}))}configureConnection(){return Bn(this,void 0,void 0,(function*(){const e=yield this.connectImpl();return void 0!==this.configConnectionOverride?this.configConnectionOverride(e):(yield this.sendSpeechServiceConfig(e,this.privSynthesizerConfig.SpeechServiceConfig.serialize()),e)}))}}Ln.telemetryDataEnabled=!0;class Dn extends R{constructor(e,t,n=M.Info){super(e,n),this.privRequestId=t}get requestId(){return this.privRequestId}}class Un extends Dn{constructor(e,t,n){super("SynthesisTriggeredEvent",e),this.privSessionAudioDestinationId=t,this.privTurnAudioDestinationId=n}get audioSessionDestinationId(){return this.privSessionAudioDestinationId}get audioTurnDestinationId(){return this.privTurnAudioDestinationId}}class Fn extends Dn{constructor(e,t){super("ConnectingToSynthesisServiceEvent",e),this.privAuthFetchEventId=t}get authFetchEventId(){return this.privAuthFetchEventId}}class zn extends Dn{constructor(e,t){super("SynthesisStartedEvent",e),this.privAuthFetchEventId=t}get authFetchEventId(){return this.privAuthFetchEventId}}var jn,Hn,Gn,Vn,Wn=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class qn{constructor(){this.privIsDisposed=!1,this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!1,this.privBytesReceived=0,this.privInTurn=!1,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.privSentenceOffset=0,this.privNextSearchSentenceIndex=0,this.privRequestId=x(),this.privTurnDeferral=new ie,this.privTurnDeferral.resolve()}get requestId(){return this.privRequestId}get streamId(){return this.privStreamId}set streamId(e){this.privStreamId=e}get audioOutputFormat(){return this.privAudioOutputFormat}set audioOutputFormat(e){this.privAudioOutputFormat=e}get turnCompletionPromise(){return this.privTurnDeferral.promise}get isSynthesisEnded(){return this.privIsSynthesisEnded}get isSynthesizing(){return this.privIsSynthesizing}get currentTextOffset(){return this.privTextOffset}get currentSentenceOffset(){return this.privSentenceOffset}get bytesReceived(){return this.privBytesReceived}get audioDuration(){return this.privAudioDuration}getAllReceivedAudio(){return Wn(this,void 0,void 0,(function*(){return this.privReceivedAudio?Promise.resolve(this.privReceivedAudio):this.privIsSynthesisEnded?(yield this.readAllAudioFromStream(),Promise.resolve(this.privReceivedAudio)):null}))}getAllReceivedAudioWithHeader(){return Wn(this,void 0,void 0,(function*(){if(this.privReceivedAudioWithHeader)return this.privReceivedAudioWithHeader;if(!this.privIsSynthesisEnded)return null;if(this.audioOutputFormat.hasHeader){const e=yield this.getAllReceivedAudio();return this.privReceivedAudioWithHeader=Tn.SynthesisAdapterBase.addHeader(e,this.audioOutputFormat),this.privReceivedAudioWithHeader}return this.getAllReceivedAudio()}))}startNewSynthesis(e,t,n,r){this.privIsSynthesisEnded=!1,this.privIsSynthesizing=!0,this.privRequestId=e,this.privRawText=t,this.privIsSSML=n,this.privAudioOutputStream=new(0,pn.PullAudioOutputStreamImpl),this.privAudioOutputStream.format=this.privAudioOutputFormat,this.privReceivedAudio=null,this.privReceivedAudioWithHeader=null,this.privBytesReceived=0,this.privTextOffset=0,this.privNextSearchTextIndex=0,this.privSentenceOffset=0,this.privNextSearchSentenceIndex=0,this.privPartialVisemeAnimation="",void 0!==r&&(this.privTurnAudioDestination=r,this.privTurnAudioDestination.format=this.privAudioOutputFormat),this.onEvent(new Un(this.requestId,void 0,void 0===r?void 0:r.id()))}onPreConnectionStart(e){this.privAuthFetchEventId=e,this.onEvent(new Fn(this.privRequestId,this.privAuthFetchEventId))}onAuthCompleted(e){e&&this.onComplete()}onConnectionEstablishCompleted(e){if(200===e)return this.onEvent(new zn(this.requestId,this.privAuthFetchEventId)),void(this.privBytesReceived=0);403===e&&this.onComplete()}onServiceResponseMessage(e){const t=JSON.parse(e);this.streamId=t.audio.streamId}onServiceTurnEndResponse(){this.privInTurn=!1,this.privTurnDeferral.resolve(),this.onComplete()}onServiceTurnStartResponse(){this.privTurnDeferral&&this.privInTurn&&(this.privTurnDeferral.reject("Another turn started before current completed."),this.privTurnDeferral.promise.then().catch((()=>{}))),this.privInTurn=!0,this.privTurnDeferral=new ie}onAudioChunkReceived(e){this.isSynthesizing&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength,void 0!==this.privTurnAudioDestination&&this.privTurnAudioDestination.write(e))}onTextBoundaryEvent(e){this.updateTextOffset(e.Data.text.Text,e.Type)}onVisemeMetadataReceived(e){void 0!==e.Data.AnimationChunk&&(this.privPartialVisemeAnimation+=e.Data.AnimationChunk)}onSessionEnd(e){this.privAudioDuration=e.Data.Offset}dispose(){this.privIsDisposed||(this.privIsDisposed=!0)}onStopSynthesizing(){this.onComplete()}getAndClearVisemeAnimation(){const e=this.privPartialVisemeAnimation;return this.privPartialVisemeAnimation="",e}onEvent(e){re.instance.onEvent(e)}static isXmlTag(e){return e.length>=2&&"<"===e[0]&&">"===e[e.length-1]}updateTextOffset(e,t){t===Mn.WordBoundary?(this.privTextOffset=this.privRawText.indexOf(e,this.privNextSearchTextIndex),this.privTextOffset>=0&&(this.privNextSearchTextIndex=this.privTextOffset+e.length,this.privIsSSML&&this.withinXmlTag(this.privTextOffset)&&!qn.isXmlTag(e)&&this.updateTextOffset(e,t))):(this.privSentenceOffset=this.privRawText.indexOf(e,this.privNextSearchSentenceIndex),this.privSentenceOffset>=0&&(this.privNextSearchSentenceIndex=this.privSentenceOffset+e.length,this.privIsSSML&&this.withinXmlTag(this.privSentenceOffset)&&!qn.isXmlTag(e)&&this.updateTextOffset(e,t)))}onComplete(){this.privIsSynthesizing&&(this.privIsSynthesizing=!1,this.privIsSynthesisEnded=!0,this.privAudioOutputStream.close(),this.privInTurn=!1,void 0!==this.privTurnAudioDestination&&(this.privTurnAudioDestination.close(),this.privTurnAudioDestination=void 0))}readAllAudioFromStream(){return Wn(this,void 0,void 0,(function*(){if(this.privIsSynthesisEnded){this.privReceivedAudio=new ArrayBuffer(this.bytesReceived);try{yield this.privAudioOutputStream.read(this.privReceivedAudio)}catch(e){this.privReceivedAudio=new ArrayBuffer(0)}}}))}withinXmlTag(e){return this.privRawText.indexOf("<",e+1)>this.privRawText.indexOf(">",e+1)}}class Kn{constructor(e){let t=e.parameters.getProperty(Qe.SpeechServiceConnection_Endpoint,void 0);if(!t){const n=e.parameters.getProperty(Qe.SpeechServiceConnection_Region,"westus"),r=Et.getHostSuffix(n);t=e.parameters.getProperty(Qe.SpeechServiceConnection_Host,`https://${n}.tts.speech${r}`)}this.privUri=`${t}/cognitiveservices/voices/list`;const n=kr.requestOptions;n.headers[kr.configParams.subscriptionKey]=e.parameters.getProperty(Qe.SpeechServiceConnection_Key,void 0),this.privRestAdapter=new(0,Sr.RestMessageAdapter)(n)}getVoicesList(e){return this.privRestAdapter.setHeaders(ze.ConnectionId,e),this.privRestAdapter.request(Sr.RestRequestType.Get,this.privUri)}}(Hn=jn||(jn={}))[Hn.Standard=0]="Standard",Hn[Hn.Custom=1]="Custom";class Jn{constructor(e,t){this.privSynthesisServiceType=jn.Standard,this.privSpeechServiceConfig=e||new ht(new ft(null)),this.privParameters=t}get parameters(){return this.privParameters}get synthesisServiceType(){return this.privSynthesisServiceType}set synthesisServiceType(e){this.privSynthesisServiceType=e}get SpeechServiceConfig(){return this.privSpeechServiceConfig}}class Qn{constructor(e){this.privContext={},this.privSpeechSynthesizer=e}setSection(e,t){this.privContext[e]=t}set audioOutputFormat(e){this.privAudioOutputFormat=e}toJSON(){const e=this.buildSynthesisContext();return this.setSection("synthesis",e),JSON.stringify(this.privContext)}buildSynthesisContext(){return{audio:{metadataOptions:{bookmarkEnabled:!!this.privSpeechSynthesizer.bookmarkReached,punctuationBoundaryEnabled:this.privSpeechSynthesizer.properties.getProperty(Qe.SpeechServiceResponse_RequestPunctuationBoundary,!!this.privSpeechSynthesizer.wordBoundary),sentenceBoundaryEnabled:this.privSpeechSynthesizer.properties.getProperty(Qe.SpeechServiceResponse_RequestSentenceBoundary,!1),sessionEndEnabled:!0,visemeEnabled:!!this.privSpeechSynthesizer.visemeReceived,wordBoundaryEnabled:this.privSpeechSynthesizer.properties.getProperty(Qe.SpeechServiceResponse_RequestWordBoundary,!!this.privSpeechSynthesizer.wordBoundary)},outputFormat:this.privAudioOutputFormat.requestAudioFormatString},language:{autoDetection:this.privSpeechSynthesizer.autoDetectSourceLanguage}}}}(Vn=Gn||(Gn={}))[Vn.TextIndependentIdentification=0]="TextIndependentIdentification",Vn[Vn.TextDependentVerification=1]="TextDependentVerification",Vn[Vn.TextIndependentVerification=2]="TextIndependentVerification";const Xn="OutputFormat",Yn="CancellationErrorCode",Zn="ServiceProperties",$n="ForceDictation";var er=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class tr{constructor(e,t,n,r){this.privRecorder=e,this.deviceId=t,this.privStreams={},this.privOutputChunkSize=tr.AUDIOFORMAT.avgBytesPerSec/10,this.privId=n||x(),this.privEvents=new ne,this.privMediaStream=r||null,this.privIsClosing=!1}get format(){return Promise.resolve(tr.AUDIOFORMAT)}get blob(){return Promise.reject("Not implemented for Mic input")}turnOn(){if(this.privInitializeDeferral)return this.privInitializeDeferral.promise;this.privInitializeDeferral=new ie;try{this.createAudioContext()}catch(e){if(e instanceof Error){const t=e;this.privInitializeDeferral.reject(t.name+": "+t.message)}else this.privInitializeDeferral.reject(e);return this.privInitializeDeferral.promise}const e=window.navigator;let t=e.getUserMedia||e.webkitGetUserMedia||e.mozGetUserMedia||e.msGetUserMedia;if(e.mediaDevices&&(t=(t,n,r)=>{e.mediaDevices.getUserMedia(t).then(n).catch(r)}),t){const e=()=>{this.onEvent(new P(this.privId)),this.privMediaStream&&this.privMediaStream.active?(this.onEvent(new N(this.privId)),this.privInitializeDeferral.resolve()):t({audio:!this.deviceId||{deviceId:this.deviceId},video:!1},(e=>{this.privMediaStream=e,this.onEvent(new N(this.privId)),this.privInitializeDeferral.resolve()}),(e=>{const t=`Error occurred during microphone initialization: ${e}`;this.privInitializeDeferral.reject(t),this.onEvent(new L(this.privId,t))}))};"suspended"===this.privContext.state?this.privContext.resume().then(e).catch((e=>{this.privInitializeDeferral.reject(`Failed to initialize audio context: ${e}`)})):e()}else{const e="Browser does not support getUserMedia.";this.privInitializeDeferral.reject(e),this.onEvent(new L(e,""))}return this.privInitializeDeferral.promise}id(){return this.privId}attach(e){return this.onEvent(new U(this.privId,e)),this.listen(e).then((t=>(this.onEvent(new F(this.privId,e)),{detach:()=>er(this,void 0,void 0,(function*(){return t.readEnded(),delete this.privStreams[e],this.onEvent(new z(this.privId,e)),this.turnOff()})),id:()=>e,read:()=>t.read()})))}detach(e){e&&this.privStreams[e]&&(this.privStreams[e].close(),delete this.privStreams[e],this.onEvent(new z(this.privId,e)))}turnOff(){return er(this,void 0,void 0,(function*(){for(const e in this.privStreams)if(e){const t=this.privStreams[e];t&&t.close()}this.onEvent(new B(this.privId)),this.privInitializeDeferral&&(yield this.privInitializeDeferral,this.privInitializeDeferral=null),yield this.destroyAudioContext()}))}get events(){return this.privEvents}get deviceInfo(){return this.getMicrophoneLabel().then((e=>({bitspersample:tr.AUDIOFORMAT.bitsPerSample,channelcount:tr.AUDIOFORMAT.channels,connectivity:ot.Unknown,manufacturer:"Speech SDK",model:e,samplerate:tr.AUDIOFORMAT.samplesPerSec,type:st.Microphones})))}setProperty(e,t){if("MICROPHONE-WorkletSourceUrl"!==e)throw new Error("Property '"+e+"' is not supported on Microphone.");this.privRecorder.setWorkletUrl(t)}getMicrophoneLabel(){const e="microphone";if(void 0!==this.privMicrophoneLabel)return Promise.resolve(this.privMicrophoneLabel);if(void 0===this.privMediaStream||!this.privMediaStream.active)return Promise.resolve(e);this.privMicrophoneLabel=e;const t=this.privMediaStream.getTracks()[0].getSettings().deviceId;if(void 0===t)return Promise.resolve(this.privMicrophoneLabel);const n=new ie;return navigator.mediaDevices.enumerateDevices().then((e=>{for(const n of e)if(n.deviceId===t){this.privMicrophoneLabel=n.label;break}n.resolve(this.privMicrophoneLabel)}),(()=>n.resolve(this.privMicrophoneLabel))),n.promise}listen(e){return er(this,void 0,void 0,(function*(){yield this.turnOn();const t=new ye(this.privOutputChunkSize,e);this.privStreams[e]=t;try{this.privRecorder.record(this.privContext,this.privMediaStream,t)}catch(t){throw this.onEvent(new j(this.privId,e,t)),t}return t}))}onEvent(e){this.privEvents.onEvent(e),re.instance.onEvent(e)}createAudioContext(){this.privContext||(this.privContext=un.getAudioContext(tr.AUDIOFORMAT.samplesPerSec))}destroyAudioContext(){return er(this,void 0,void 0,(function*(){if(!this.privContext)return;this.privRecorder.releaseMediaResources(this.privContext);let e=!1;"close"in this.privContext&&(e=!0),e?this.privIsClosing||(this.privIsClosing=!0,yield this.privContext.close(),this.privContext=null,this.privIsClosing=!1):null!==this.privContext&&"running"===this.privContext.state&&(yield this.privContext.suspend())}))}}tr.AUDIOFORMAT=cn.getDefaultInputFormat();var nr={};e(nr,"FileAudioSource",(()=>ir),(e=>ir=e));var rr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class ir{constructor(e,t,n){this.privStreams={},this.privHeaderEnd=44,this.privId=n||x(),this.privEvents=new ne,this.privSource=e,"undefined"!=typeof window&&"undefined"!=typeof Blob&&this.privSource instanceof Blob?this.privFilename=e.name:this.privFilename=t||"unknown.wav",this.privAudioFormatPromise=this.readHeader()}get format(){return this.privAudioFormatPromise}get blob(){return Promise.resolve(this.privSource)}turnOn(){if(this.privFilename.lastIndexOf(".wav")!==this.privFilename.length-4){const e=this.privFilename+" is not supported. Only WAVE files are allowed at the moment.";return this.onEvent(new L(e,"")),Promise.reject(e)}this.onEvent(new P(this.privId)),this.onEvent(new N(this.privId))}id(){return this.privId}attach(e){return rr(this,void 0,void 0,(function*(){this.onEvent(new U(this.privId,e));const t=yield this.upload(e);return this.onEvent(new F(this.privId,e)),Promise.resolve({detach:()=>rr(this,void 0,void 0,(function*(){t.readEnded(),delete this.privStreams[e],this.onEvent(new z(this.privId,e)),yield this.turnOff()})),id:()=>e,read:()=>t.read()})}))}detach(e){e&&this.privStreams[e]&&(this.privStreams[e].close(),delete this.privStreams[e],this.onEvent(new z(this.privId,e)))}turnOff(){for(const e in this.privStreams)if(e){const t=this.privStreams[e];t&&!t.isClosed&&t.close()}return this.onEvent(new B(this.privId)),Promise.resolve()}get events(){return this.privEvents}get deviceInfo(){return this.privAudioFormatPromise.then((e=>Promise.resolve({bitspersample:e.bitsPerSample,channelcount:e.channels,connectivity:ot.Unknown,manufacturer:"Speech SDK",model:"File",samplerate:e.samplesPerSec,type:st.File})))}readHeader(){const e=this.privSource.slice(0,512),t=new ie,n=e=>{const n=new DataView(e),r=e=>String.fromCharCode(n.getUint8(e),n.getUint8(e+1),n.getUint8(e+2),n.getUint8(e+3));if("RIFF"!==r(0))return void t.reject("Invalid WAV header in file, RIFF was not found");if("WAVE"!==r(8)||"fmt "!==r(12))return void t.reject("Invalid WAV header in file, WAVEfmt was not found");const i=n.getInt32(16,!0),o=n.getUint16(22,!0),a=n.getUint32(24,!0),s=n.getUint16(34,!0);let l=36+Math.max(i-16,0);for(;"data"!==r(l);l+=2)if(l>504)return void t.reject("Invalid WAV header in file, data block was not found");this.privHeaderEnd=l+8,t.resolve(cn.getWaveFormatPCM(a,s,o))};if("undefined"!=typeof window&&"undefined"!=typeof Blob&&e instanceof Blob){const t=new FileReader;t.onload=e=>{const t=e.target.result;n(t)},t.readAsArrayBuffer(e)}else{const t=e;n(t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength))}return t.promise}upload(e){return rr(this,void 0,void 0,(function*(){const t=t=>{const n=`Error occurred while processing '${this.privFilename}'. ${t}`;throw this.onEvent(new j(this.privId,e,n)),new Error(n)};try{yield this.turnOn();const n=yield this.privAudioFormatPromise,r=new ye(n.avgBytesPerSec/10,e);this.privStreams[e]=r;const i=this.privSource.slice(this.privHeaderEnd),o=e=>{r.isClosed||(r.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()}),r.close())};if("undefined"!=typeof window&&"undefined"!=typeof Blob&&i instanceof Blob){const e=new FileReader;e.onerror=e=>t(e.toString()),e.onload=e=>{const t=e.target.result;o(t)},e.readAsArrayBuffer(i)}else{const e=i;o(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}return r}catch(e){t(e)}}))}onEvent(e){this.privEvents.onEvent(e),re.instance.onEvent(e)}}class or{constructor(e){this.privStopInputOnRelease=e}record(e,t,n){const r=new fe(e.sampleRate,16e3),i=e.createMediaStreamSource(t);if(!this.privSpeechProcessorScript){const e=new Blob(["class SP extends AudioWorkletProcessor {\n constructor(options) {\n super(options);\n }\n process(inputs, outputs) {\n const input = inputs[0];\n const output = [];\n for (let channel = 0; channel < input.length; channel += 1) {\n output[channel] = input[channel];\n }\n this.port.postMessage(output[0]);\n return true;\n }\n }\n registerProcessor('speech-processor', SP);"],{type:"application/javascript; charset=utf-8"});this.privSpeechProcessorScript=URL.createObjectURL(e)}const o=()=>{const o=(()=>{let t=0;try{return e.createScriptProcessor(t,1,1)}catch(n){t=2048;let r=e.sampleRate;for(;t<16384&&r>=32e3;)t<<=1,r>>=1;return e.createScriptProcessor(t,1,1)}})();o.onaudioprocess=e=>{const t=e.inputBuffer.getChannelData(0);if(n&&!n.isClosed){const e=r.encode(t);e&&n.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}},i.connect(o),o.connect(e.destination),this.privMediaResources={scriptProcessorNode:o,source:i,stream:t}};if(this.privSpeechProcessorScript&&e.audioWorklet)e.audioWorklet.addModule(this.privSpeechProcessorScript).then((()=>{const o=new AudioWorkletNode(e,"speech-processor");o.port.onmessage=e=>{const t=e.data;if(n&&!n.isClosed){const e=r.encode(t);e&&n.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}},i.connect(o),o.connect(e.destination),this.privMediaResources={scriptProcessorNode:o,source:i,stream:t}})).catch((()=>{o()}));else try{o()}catch(e){throw new Error(`Unable to start audio worklet node for PCMRecorder: ${e}`)}}releaseMediaResources(e){this.privMediaResources&&(this.privMediaResources.scriptProcessorNode&&(this.privMediaResources.scriptProcessorNode.disconnect(e.destination),this.privMediaResources.scriptProcessorNode=null),this.privMediaResources.source&&(this.privMediaResources.source.disconnect(),this.privStopInputOnRelease&&this.privMediaResources.stream.getTracks().forEach((e=>e.stop())),this.privMediaResources.source=null))}setWorkletUrl(e){this.privSpeechProcessorScript=e}}var ar={};e(ar,"WebsocketConnection",(()=>vr),(e=>vr=e));var sr={};e(sr,"WebsocketMessageAdapter",(()=>mr),(e=>mr=e));h=o("1DJXa");var lr={};e(lr,"CertCheckAgent",(()=>fr),(e=>fr=e));h=o("1DJXa");var cr=o("5U18c"),ur=(h=o("1DJXa"),h=o("1DJXa"),h=o("1DJXa"),h=o("1DJXa"),o("ePtPP")),dr=o("bqBrJ").Buffer,hr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class fr{constructor(e){e&&(this.privProxyInfo=e),fr.privDiskCache||(fr.privDiskCache=new(n(h))("microsoft-cognitiveservices-speech-sdk-cache",{supportBuffer:!0,location:void 0}))}static forceReinitDiskCache(){fr.privDiskCache=void 0,fr.privMemCache={}}GetAgent(e){const t=new(n(h).Agent)(this.CreateConnection);if(void 0!==this.privProxyInfo&&void 0!==this.privProxyInfo.HostName&&this.privProxyInfo.Port>0){t["privProxyInfo"]=this.privProxyInfo}return t}static GetProxyAgent(e){const t={host:e.HostName,port:e.Port};e.UserName?t.headers={"Proxy-Authentication":"Basic "+new dr(`${e.UserName}:${void 0===e.Password?"":e.Password}`).toString("base64")}:t.headers={},t.headers.requestOCSP="true";return new(n(h))(t)}static OCSPCheck(e,t){return hr(this,void 0,void 0,(function*(){let n,r,i=!1;const o=yield e;o.cork();const a=o;return new Promise(((e,s)=>{o.on("OCSPResponse",(e=>{e&&(this.onEvent(new Ie),r=e)})),o.on("error",(e=>{i||(i=!0,o.destroy(),s(e))})),a.on("secure",(()=>hr(this,void 0,void 0,(function*(){const l=a.getPeerCertificate(!0);try{const a=yield this.GetIssuer(l);n=cr.request.generate(l.raw,a.raw);const s=n.id.toString("hex");if(!r){const e=yield fr.GetResponseFromCache(s,n,t);r=e}yield this.VerifyOCSPResponse(r,n,t),o.uncork(),i=!0,e(o)}catch(e){o.destroy(),i=!0,s(e)}}))))}))}))}static GetIssuer(e){return e.issuerCertificate?Promise.resolve(e.issuerCertificate):new Promise(((t,n)=>{new cr.Agent({}).fetchIssuer(e,null,((e,r)=>{e?n(e):t(r)}))}))}static GetResponseFromCache(e,t,n){return hr(this,void 0,void 0,(function*(){let r=fr.privMemCache[e];if(r&&this.onEvent(new xe(e)),!r)try{const t=yield fr.privDiskCache.get(e);t.isCached&&(fr.onEvent(new _e(e)),fr.StoreMemoryCacheEntry(e,t.value),r=t.value)}catch(e){r=null}if(!r)return r;try{const i=cr.utils.parseResponse(r),o=i.value.tbsResponseData;if(o.responses.length<1)return void this.onEvent(new Ne(e,"Not enough data in cached response"));const a=o.responses[0].thisUpdate,s=o.responses[0].nextUpdate;if(s<Date.now()+this.testTimeOffset-6e4)this.onEvent(new ke(e,s)),r=null;else{const r=Math.min(864e5,(s-a)/2);s-(Date.now()+this.testTimeOffset)<r?(this.onEvent(new Re(e,a,s)),this.UpdateCache(t,n).catch((t=>{this.onEvent(new Le(e,t.toString()))}))):this.onEvent(new Oe(e,a,s))}}catch(t){this.onEvent(new Ne(e,t)),r=null}return r||this.onEvent(new Me(e)),r}))}static VerifyOCSPResponse(e,t,n){return hr(this,void 0,void 0,(function*(){let r=e;return r||(r=yield fr.GetOCSPResponse(t,n)),new Promise(((i,o)=>{cr.verify({request:t,response:r},(a=>{a?(fr.onEvent(new Pe(t.id.toString("hex"),a)),e?this.VerifyOCSPResponse(null,t,n).then((()=>{i()}),(e=>{o(e)})):o(a)):(e||fr.StoreCacheEntry(t.id.toString("hex"),r),i())}))}))}))}static UpdateCache(e,t){return hr(this,void 0,void 0,(function*(){const n=e.id.toString("hex");this.onEvent(new Ae(n));const r=yield this.GetOCSPResponse(e,t);this.StoreCacheEntry(n,r),this.onEvent(new Te(e.id.toString("hex")))}))}static StoreCacheEntry(e,t){this.StoreMemoryCacheEntry(e,t),this.StoreDiskCacheEntry(e,t)}static StoreMemoryCacheEntry(e,t){this.privMemCache[e]=t,this.onEvent(new Ee(e))}static StoreDiskCacheEntry(e,t){this.privDiskCache.set(e,t).then((()=>{this.onEvent(new Ce(e))}))}static GetOCSPResponse(e,t){let n={};if(t){const e=fr.GetProxyAgent(t);n.agent=e}return new Promise(((t,r)=>{cr.utils.getAuthorityInfo(e.cert,"1.3.6.1.5.5.7.48.1",((i,o)=>{if(i)return void r(i);const a=new URL(o);n=Object.assign(Object.assign({},n),{host:a.host,protocol:a.protocol,port:a.port,path:a.pathname,hostname:a.host}),cr.utils.getResponse(n,e.data,((n,i)=>{if(n)return void r(n);const o=e.certID;this.onEvent(new Be(o.toString("hex"))),t(i)}))}))}))}static onEvent(e){re.instance.onEvent(e)}CreateConnection(e,t){const n=void 0!==ur&&t.secureEndpoint;let r;if(t=Object.assign(Object.assign({},t),{requestOCSP:!fr.forceDisableOCSPStapling,servername:t.host}),this.privProxyInfo){const n=fr.GetProxyAgent(this.privProxyInfo);r=new Promise(((r,i)=>{n.callback(e,t,((e,t)=>{e?i(e):r(t)}))}))}else r=(t.secureEndpoint,Promise.resolve(h.connect(t)));return n?fr.OCSPCheck(r,this.privProxyInfo):r}}fr.testTimeOffset=0,fr.forceDisableOCSPStapling=!1,fr.privMemCache={};var pr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class mr{constructor(e,t,n,r,i,o){if(!e)throw new Y("uri");if(!n)throw new Y("messageFormatter");this.proxyInfo=r,this.privConnectionEvents=new ne,this.privConnectionId=t,this.privMessageFormatter=n,this.privConnectionState=C.None,this.privUri=e,this.privHeaders=i,this.privEnableCompression=o,this.privHeaders[ze.ConnectionId]=this.privConnectionId,this.privLastErrorReceived=""}get state(){return this.privConnectionState}open(){if(this.privConnectionState===C.Disconnected)return Promise.reject(`Cannot open a connection that is in ${this.privConnectionState} state`);if(this.privConnectionEstablishDeferral)return this.privConnectionEstablishDeferral.promise;this.privConnectionEstablishDeferral=new ie,this.privCertificateValidatedDeferral=new ie,this.privConnectionState=C.Connecting;try{if("undefined"==typeof WebSocket||mr.forceNpmWebSocket){const e={headers:this.privHeaders,perMessageDeflate:this.privEnableCompression};this.privCertificateValidatedDeferral.resolve();const t=new(0,lr.CertCheckAgent)(this.proxyInfo);e.agent=t.GetAgent();let r=new URL(this.privUri).protocol;"wss:"===(null==r?void 0:r.toLocaleLowerCase())?r="https:":"ws:"===(null==r?void 0:r.toLocaleLowerCase())&&(r="http:"),e.agent.protocol=r,this.privWebsocketClient=new(n(h))(this.privUri,e)}else this.privCertificateValidatedDeferral.resolve(),this.privWebsocketClient=new WebSocket(this.privUri);this.privWebsocketClient.binaryType="arraybuffer",this.privReceivingMessageQueue=new(0,ae.Queue),this.privDisconnectDeferral=new ie,this.privSendMessageQueue=new(0,ae.Queue),this.processSendQueue().catch((e=>{re.instance.onEvent(new De(e))}))}catch(e){return this.privConnectionEstablishDeferral.resolve(new te(500,e)),this.privConnectionEstablishDeferral.promise}return this.onEvent(new V(this.privConnectionId,this.privUri)),this.privWebsocketClient.onopen=()=>{this.privCertificateValidatedDeferral.promise.then((()=>{this.privConnectionState=C.Connected,this.onEvent(new W(this.privConnectionId)),this.privConnectionEstablishDeferral.resolve(new te(200,""))}),(e=>{this.privConnectionEstablishDeferral.reject(e)}))},this.privWebsocketClient.onerror=e=>{this.onEvent(new K(this.privConnectionId,e.message,e.type)),this.privLastErrorReceived=e.message},this.privWebsocketClient.onclose=e=>{this.privConnectionState===C.Connecting?(this.privConnectionState=C.Disconnected,this.privConnectionEstablishDeferral.resolve(new te(e.code,e.reason+" "+this.privLastErrorReceived))):(this.privConnectionState=C.Disconnected,this.privWebsocketClient=null,this.onEvent(new q(this.privConnectionId,e.code,e.reason))),this.onClose(e.code,e.reason).catch((e=>{re.instance.onEvent(new De(e))}))},this.privWebsocketClient.onmessage=e=>{const t=(new Date).toISOString();if(this.privConnectionState===C.Connected){const n=new ie;if(this.privReceivingMessageQueue.enqueueFromPromise(n.promise),e.data instanceof ArrayBuffer){const r=new he(A.Binary,e.data);this.privMessageFormatter.toConnectionMessage(r).then((e=>{this.onEvent(new Q(this.privConnectionId,t,e)),n.resolve(e)}),(e=>{n.reject(`Invalid binary message format. Error: ${e}`)}))}else{const r=new he(A.Text,e.data);this.privMessageFormatter.toConnectionMessage(r).then((e=>{this.onEvent(new Q(this.privConnectionId,t,e)),n.resolve(e)}),(e=>{n.reject(`Invalid text message format. Error: ${e}`)}))}}},this.privConnectionEstablishDeferral.promise}send(e){if(this.privConnectionState!==C.Connected)return Promise.reject(`Cannot send on connection that is in ${C[this.privConnectionState]} state`);const t=new ie,n=new ie;return this.privSendMessageQueue.enqueueFromPromise(n.promise),this.privMessageFormatter.fromConnectionMessage(e).then((r=>{n.resolve({Message:e,RawWebsocketMessage:r,sendStatusDeferral:t})}),(e=>{n.reject(`Error formatting the message. ${e}`)})),t.promise}read(){return this.privConnectionState!==C.Connected?Promise.reject(`Cannot read on connection that is in ${this.privConnectionState} state`):this.privReceivingMessageQueue.dequeue()}close(e){return this.privWebsocketClient?(this.privConnectionState!==C.Disconnected&&this.privWebsocketClient.close(1e3,e||"Normal closure by client"),this.privDisconnectDeferral.promise):Promise.resolve()}get events(){return this.privConnectionEvents}sendRawMessage(e){try{return e?(this.onEvent(new X(this.privConnectionId,(new Date).toISOString(),e.Message)),this.isWebsocketOpen?(this.privWebsocketClient.send(e.RawWebsocketMessage.payload),Promise.resolve()):Promise.reject("websocket send error: Websocket not ready "+this.privConnectionId+" "+e.Message.id+" "+(new Error).stack)):Promise.resolve()}catch(e){return Promise.reject(`websocket send error: ${e}`)}}onClose(e,t){return pr(this,void 0,void 0,(function*(){const n=`Connection closed. ${e}: ${t}`;this.privConnectionState=C.Disconnected,this.privDisconnectDeferral.resolve(),yield this.privReceivingMessageQueue.drainAndDispose((()=>{}),n),yield this.privSendMessageQueue.drainAndDispose((e=>{e.sendStatusDeferral.reject(n)}),n)}))}processSendQueue(){return pr(this,void 0,void 0,(function*(){for(;;){const e=this.privSendMessageQueue.dequeue(),t=yield e;if(!t)return;try{yield this.sendRawMessage(t),t.sendStatusDeferral.resolve()}catch(e){t.sendStatusDeferral.reject(e)}}}))}onEvent(e){this.privConnectionEvents.onEvent(e),re.instance.onEvent(e)}get isWebsocketOpen(){return this.privWebsocketClient&&this.privWebsocketClient.readyState===this.privWebsocketClient.OPEN}}mr.forceNpmWebSocket=!1;var gr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class vr{constructor(e,t,n,r,i,o=!1,a){if(this.privIsDisposed=!1,!e)throw new Y("uri");if(!r)throw new Y("messageFormatter");this.privMessageFormatter=r;let s="",l=0;if(t)for(const n in t)if(n){s+=0===l&&-1===e.indexOf("?")?"?":"&";s+=`${n}=${encodeURIComponent(t[n])}`,l++}if(n)for(const t in n)if(t){s+=0===l&&-1===e.indexOf("?")?"?":"&";s+=`${t}=${encodeURIComponent(n[t])}`,l++}this.privUri=e+s,this.privId=a||x(),this.privConnectionMessageAdapter=new(0,sr.WebsocketMessageAdapter)(this.privUri,this.id,this.privMessageFormatter,i,n,o)}dispose(){return gr(this,void 0,void 0,(function*(){this.privIsDisposed=!0,this.privConnectionMessageAdapter&&(yield this.privConnectionMessageAdapter.close())}))}isDisposed(){return this.privIsDisposed}get id(){return this.privId}state(){return this.privConnectionMessageAdapter.state}open(){return this.privConnectionMessageAdapter.open()}send(e){return this.privConnectionMessageAdapter.send(e)}read(){return this.privConnectionMessageAdapter.read()}get events(){return this.privConnectionMessageAdapter.events}}class br{constructor(e,t){this.privBuffers=[],this.privReplayOffset=0,this.privLastShrinkOffset=0,this.privBufferStartOffset=0,this.privBufferSerial=0,this.privBufferedBytes=0,this.privReplay=!1,this.privLastChunkAcquiredTime=0,this.privAudioNode=e,this.privBytesPerSecond=t}id(){return this.privAudioNode.id()}read(){if(this.privReplay&&0!==this.privBuffers.length){const e=this.privReplayOffset-this.privBufferStartOffset;let t=Math.round(e*this.privBytesPerSecond*1e-7);0!=t%2&&t++;let n=0;for(;n<this.privBuffers.length&&t>=this.privBuffers[n].chunk.buffer.byteLength;)t-=this.privBuffers[n++].chunk.buffer.byteLength;if(n<this.privBuffers.length){const e=this.privBuffers[n].chunk.buffer.slice(t);return this.privReplayOffset+=e.byteLength/this.privBytesPerSecond*1e7,n===this.privBuffers.length-1&&(this.privReplay=!1),Promise.resolve({buffer:e,isEnd:!1,timeReceived:this.privBuffers[n].chunk.timeReceived})}}return this.privAudioNode.read().then((e=>(e&&e.buffer&&(this.privBuffers.push(new yr(e,this.privBufferSerial++,this.privBufferedBytes)),this.privBufferedBytes+=e.buffer.byteLength),e)))}detach(){return this.privBuffers=void 0,this.privAudioNode.detach()}replay(){this.privBuffers&&0!==this.privBuffers.length&&(this.privReplay=!0,this.privReplayOffset=this.privLastShrinkOffset)}shrinkBuffers(e){if(void 0===this.privBuffers||0===this.privBuffers.length)return;this.privLastShrinkOffset=e;const t=e-this.privBufferStartOffset;let n=Math.round(t*this.privBytesPerSecond*1e-7),r=0;for(;r<this.privBuffers.length&&n>=this.privBuffers[r].chunk.buffer.byteLength;)n-=this.privBuffers[r++].chunk.buffer.byteLength;this.privBufferStartOffset=Math.round(e-n/this.privBytesPerSecond*1e7),this.privBuffers=this.privBuffers.slice(r)}findTimeAtOffset(e){if(e<this.privBufferStartOffset||void 0===this.privBuffers)return 0;for(const t of this.privBuffers){const n=t.byteOffset/this.privBytesPerSecond*1e7,r=n+t.chunk.buffer.byteLength/this.privBytesPerSecond*1e7;if(e>=n&&e<=r)return t.chunk.timeReceived}return 0}}class yr{constructor(e,t,n){this.chunk=e,this.serial=t,this.byteOffset=n}}class wr{constructor(e,t,n,r){this.privProxyHostName=e,this.privProxyPort=t,this.privProxyUserName=n,this.privProxyPassword=r}static fromParameters(e){return new wr(e.getProperty(Qe.SpeechServiceConnection_ProxyHostName),parseInt(e.getProperty(Qe.SpeechServiceConnection_ProxyPort),10),e.getProperty(Qe.SpeechServiceConnection_ProxyUserName),e.getProperty(Qe.SpeechServiceConnection_ProxyPassword))}static fromRecognizerConfig(e){return this.fromParameters(e.parameters)}get HostName(){return this.privProxyHostName}get Port(){return this.privProxyPort}get UserName(){return this.privProxyUserName}get Password(){return this.privProxyPassword}}var Sr={};e(Sr,"RestRequestType",(()=>Er),(e=>Er=e)),e(Sr,"RestMessageAdapter",(()=>Ir),(e=>Ir=e));var xr,Mr;const _r=new Set(["json","buffer","string"]);Mr=e=>(...t)=>{const n=new Set;let r,i,o,a="";return t.forEach((e=>{if("string"==typeof e)if(e.toUpperCase()===e){if(r){throw new Error(`Can't set method to ${e}, already set to ${r}.`)}r=e}else if(e.startsWith("http:")||e.startsWith("https:"))a=e;else{if(!_r.has(e))throw new Error(`Unknown encoding, ${e}`);i=e}else if("number"==typeof e)n.add(e);else{if("object"!=typeof e)throw new Error("Unknown type: "+typeof e);if(Array.isArray(e)||e instanceof Set)e.forEach((e=>n.add(e)));else{if(o)throw new Error("Cannot set headers twice.");o=e}}})),r||(r="GET"),0===n.size&&n.add(200),e(n,r,i,o,a)};class Ar extends Error{constructor(e,...t){let n;super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Ar),this.name="StatusError",this.message=e.statusMessage,this.statusCode=e.status,this.res=e,this.json=e.json.bind(e),this.text=e.text.bind(e),this.arrayBuffer=e.arrayBuffer.bind(e);Object.defineProperty(this,"responseBody",{get:()=>(n||(n=this.arrayBuffer()),n)}),this.headers={};for(const[t,n]of e.headers.entries())this.headers[t.toLowerCase()]=n}}xr=Mr(((e,t,n,r,i)=>async(o,a,s={})=>{o=i+(o||"");let l=new URL(o);if(r||(r={}),l.username&&(r.Authorization="Basic "+btoa(l.username+":"+l.password),l=new URL(l.protocol+"//"+l.host+l.pathname+l.search)),"https:"!==l.protocol&&"http:"!==l.protocol)throw new Error(`Unknown protocol, ${l.protocol}`);if(a)if(a instanceof ArrayBuffer||ArrayBuffer.isView(a)||"string"==typeof a);else{if("object"!=typeof a)throw new Error("Unknown body type.");a=JSON.stringify(a),r["Content-Type"]="application/json"}s=new Headers({...r||{},...s});const c=await fetch(l,{method:t,headers:s,body:a});if(c.statusCode=c.status,!e.has(c.status))throw new Ar(c);return"json"===n?c.json():"buffer"===n?c.arrayBuffer():"string"===n?c.text():c}));var Er,Cr,Tr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};(Cr=Er||(Er={})).Get="GET",Cr.Post="POST",Cr.Delete="DELETE",Cr.File="file";class Ir{constructor(e){if(!e)throw new Y("configParams");this.privHeaders=e.headers,this.privIgnoreCache=e.ignoreCache}static extractHeaderValue(e,t){let n="";try{const r=t.trim().split(/[\r\n]+/),i={};r.forEach((e=>{const t=e.split(": "),n=t.shift().toLowerCase(),r=t.join(": ");i[n]=r})),n=i[e.toLowerCase()]}catch(e){}return n}set options(e){this.privHeaders=e.headers,this.privIgnoreCache=e.ignoreCache}setHeaders(e,t){this.privHeaders[e]=t}request(e,t,r={},i=null,o=null){const a=new ie,s=e===Er.File?"POST":e,l=(e,t={})=>{const n=e;return{data:JSON.stringify(t),headers:JSON.stringify(e.headers),json:t,ok:e.statusCode>=200&&e.statusCode<300,status:e.statusCode,statusText:t.error?t.error.message:n.statusText?n.statusText:n.statusMessage}},c=i=>{n(xr)(t,s,this.privHeaders,200,201,202,204,400,401,402,403,404)(""===this.queryParams(r)?"":`?${this.queryParams(r)}`,i).then((t=>Tr(this,void 0,void 0,(function*(){if(e===Er.Delete||204===t.statusCode)a.resolve(l(t));else try{const e=yield t.json();a.resolve(l(t,e))}catch(e){a.resolve(l(t))}})))).catch((e=>{a.reject(e)}))};if(this.privIgnoreCache&&(this.privHeaders["Cache-Control"]="no-cache"),e===Er.File&&o){const e="multipart/form-data";this.privHeaders["content-type"]=e,this.privHeaders["Content-Type"]=e,"undefined"!=typeof Blob&&o instanceof Blob?(e=>{const t=new FileReader;return t.readAsArrayBuffer(e),new Promise((e=>{t.onloadend=()=>{e(t.result)}}))})(o).then((e=>{c(e)})).catch((e=>{a.reject(e)})):c(o)}else e===Er.Post&&i&&(this.privHeaders["content-type"]="application/json",this.privHeaders["Content-Type"]="application/json"),c(i);return a.promise}withQuery(e,t={}){const n=this.queryParams(t);return n?e+(-1===e.indexOf("?")?"?":"&")+n:e}queryParams(e={}){return Object.keys(e).map((t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&")}}class kr{static get requestOptions(){return kr.privDefaultRequestOptions}static get configParams(){return kr.privDefaultParams}static get restErrors(){return kr.privRestErrors}}kr.privDefaultRequestOptions={headers:{Accept:"application/json"},ignoreCache:!1,timeout:1e4},kr.privRestErrors={authInvalidSubscriptionKey:"You must specify either an authentication token to use, or a Cognitive Speech subscription key.",authInvalidSubscriptionRegion:"You must specify the Cognitive Speech region to use.",invalidArgs:"Required input not found: {arg}.",invalidCreateJoinConversationResponse:"Creating/Joining conversation failed with HTTP {status}.",invalidParticipantRequest:"The requested participant was not found.",permissionDeniedConnect:"Required credentials not found.",permissionDeniedConversation:"Invalid operation: only the host can {command} the conversation.",permissionDeniedParticipant:"Invalid operation: only the host can {command} a participant.",permissionDeniedSend:"Invalid operation: the conversation is not in a connected state.",permissionDeniedStart:"Invalid operation: there is already an active conversation."},kr.privDefaultParams={apiVersion:"api-version",authorization:"Authorization",clientAppId:"X-ClientAppId",contentTypeKey:"Content-Type",correlationId:"X-CorrelationId",languageCode:"language",nickname:"nickname",profanity:"profanity",requestId:"X-RequestId",roomId:"roomid",sessionToken:"token",subscriptionKey:"Ocp-Apim-Subscription-Key",subscriptionRegion:"Ocp-Apim-Subscription-Region",token:"X-CapitoToken"};var Rr={};e(Rr,"AudioInputStream",(()=>Nr),(e=>Nr=e)),e(Rr,"PullAudioInputStreamImpl",(()=>Ur),(e=>Ur=e));var Or=o("bqBrJ").Buffer,Pr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class Nr{constructor(){}static createPushStream(e){return Br.create(e)}static createPullStream(e,t){return Dr.create(e,t)}}class Br extends Nr{static create(e){return new Lr(e)}}class Lr extends Br{constructor(e){super(),this.privFormat=void 0===e?un.getDefaultInputFormat():e,this.privEvents=new ne,this.privId=x(),this.privStream=new ye(this.privFormat.avgBytesPerSec/10)}get format(){return Promise.resolve(this.privFormat)}write(e){this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})}close(){this.privStream.close()}id(){return this.privId}get blob(){return this.attach("id").then((e=>{const t=[];let n=Or.from("");const r=()=>e.read().then((e=>!e||e.isEnd?"undefined"!=typeof XMLHttpRequest&&"undefined"!=typeof Blob?Promise.resolve(new Blob(t)):Promise.resolve(Or.from(n)):("undefined"!=typeof Blob?t.push(e.buffer):n=Or.concat([n,this.toBuffer(e.buffer)]),r())));return r()}))}turnOn(){this.onEvent(new P(this.privId)),this.onEvent(new N(this.privId))}attach(e){return Pr(this,void 0,void 0,(function*(){this.onEvent(new U(this.privId,e)),yield this.turnOn();const t=this.privStream;return this.onEvent(new F(this.privId,e)),{detach:()=>Pr(this,void 0,void 0,(function*(){return this.onEvent(new z(this.privId,e)),this.turnOff()})),id:()=>e,read:()=>t.read()}}))}detach(e){this.onEvent(new z(this.privId,e))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:ot.Unknown,manufacturer:"Speech SDK",model:"PushStream",samplerate:this.privFormat.samplesPerSec,type:st.Stream})}onEvent(e){this.privEvents.onEvent(e),re.instance.onEvent(e)}toBuffer(e){const t=Or.alloc(e.byteLength),n=new Uint8Array(e);for(let e=0;e<t.length;++e)t[e]=n[e];return t}}class Dr extends Nr{constructor(){super()}static create(e,t){return new Ur(e,t)}}class Ur extends Dr{constructor(e,t){super(),this.privFormat=void 0===t?cn.getDefaultInputFormat():t,this.privEvents=new ne,this.privId=x(),this.privCallback=e,this.privIsClosed=!1,this.privBufferSize=this.privFormat.avgBytesPerSec/10}get format(){return Promise.resolve(this.privFormat)}close(){this.privIsClosed=!0,this.privCallback.close()}id(){return this.privId}get blob(){return Promise.reject("Not implemented")}turnOn(){this.onEvent(new P(this.privId)),this.onEvent(new N(this.privId))}attach(e){return Pr(this,void 0,void 0,(function*(){return this.onEvent(new U(this.privId,e)),yield this.turnOn(),this.onEvent(new F(this.privId,e)),{detach:()=>(this.privCallback.close(),this.onEvent(new z(this.privId,e)),this.turnOff()),id:()=>e,read:()=>{let e,t=0;for(;t<this.privBufferSize;){const n=new ArrayBuffer(this.privBufferSize-t),r=this.privCallback.read(n);if(void 0===e)e=n;else{new Int8Array(e).set(new Int8Array(n),t)}if(0===r)break;t+=r}return Promise.resolve({buffer:e.slice(0,t),isEnd:this.privIsClosed||0===t,timeReceived:Date.now()})}}}))}detach(e){this.onEvent(new z(this.privId,e))}turnOff(){}get events(){return this.privEvents}get deviceInfo(){return Promise.resolve({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:ot.Unknown,manufacturer:"Speech SDK",model:"PullStream",samplerate:this.privFormat.samplesPerSec,type:st.Stream})}onEvent(e){this.privEvents.onEvent(e),re.instance.onEvent(e)}}class Fr{}class zr{}var jr={};e(jr,"SpeakerAudioDestination",(()=>Vr),(e=>Vr=e));var Hr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};const Gr={[en.PCM]:"audio/wav",[en.MuLaw]:"audio/x-wav",[en.MP3]:"audio/mpeg",[en.OGG_OPUS]:"audio/ogg",[en.WEBM_OPUS]:"audio/webm; codecs=opus",[en.ALaw]:"audio/x-wav",[en.FLAC]:"audio/flac"};class Vr{constructor(e){this.privPlaybackStarted=!1,this.privAppendingToBuffer=!1,this.privMediaSourceOpened=!1,this.privBytesReceived=0,this.privId=e||x(),this.privIsPaused=!1,this.privIsClosed=!1}id(){return this.privId}write(e,t,n){void 0!==this.privAudioBuffer?(this.privAudioBuffer.push(e),this.updateSourceBuffer().then((()=>{t&&t()}),(e=>{n&&n(e)}))):void 0!==this.privAudioOutputStream&&(this.privAudioOutputStream.write(e),this.privBytesReceived+=e.byteLength)}close(e,t){if(this.privIsClosed=!0,void 0!==this.privSourceBuffer)this.handleSourceBufferUpdateEnd().then((()=>{e&&e()}),(e=>{t&&t(e)}));else if(void 0!==this.privAudioOutputStream&&"undefined"!=typeof window)if(this.privFormat.formatTag!==en.PCM&&this.privFormat.formatTag!==en.MuLaw&&this.privFormat.formatTag!==en.ALaw||!1!==this.privFormat.hasHeader){let n=new ArrayBuffer(this.privBytesReceived);this.privAudioOutputStream.read(n).then((()=>{n=Tn.SynthesisAdapterBase.addHeader(n,this.privFormat);const r=new Blob([n],{type:Gr[this.privFormat.formatTag]});this.privAudio.src=window.URL.createObjectURL(r),this.notifyPlayback().then((()=>{e&&e()}),(e=>{t&&t(e)}))}),(e=>{t&&t(e)}))}else console.warn("Play back is not supported for raw PCM, mulaw or alaw format without header."),this.onAudioEnd&&this.onAudioEnd(this);else this.onAudioEnd&&this.onAudioEnd(this)}set format(e){if("undefined"!=typeof AudioContext||"undefined"!=typeof window&&void 0!==window.webkitAudioContext){this.privFormat=e;const t=Gr[this.privFormat.formatTag];void 0===t?console.warn(`Unknown mimeType for format ${en[this.privFormat.formatTag]}; playback is not supported.`):"undefined"!=typeof MediaSource&&MediaSource.isTypeSupported(t)?(this.privAudio=new Audio,this.privAudioBuffer=[],this.privMediaSource=new MediaSource,this.privAudio.src=URL.createObjectURL(this.privMediaSource),this.privAudio.load(),this.privMediaSource.onsourceopen=()=>{this.privMediaSourceOpened=!0,this.privMediaSource.duration=1800,this.privSourceBuffer=this.privMediaSource.addSourceBuffer(t),this.privSourceBuffer.onupdate=()=>{this.updateSourceBuffer().catch((e=>{re.instance.onEvent(new De(e))}))},this.privSourceBuffer.onupdateend=()=>{this.handleSourceBufferUpdateEnd().catch((e=>{re.instance.onEvent(new De(e))}))},this.privSourceBuffer.onupdatestart=()=>{this.privAppendingToBuffer=!1}},this.updateSourceBuffer().catch((e=>{re.instance.onEvent(new De(e))}))):(console.warn(`Format ${en[this.privFormat.formatTag]} could not be played by MSE, streaming playback is not enabled.`),this.privAudioOutputStream=new(0,pn.PullAudioOutputStreamImpl),this.privAudioOutputStream.format=this.privFormat,this.privAudio=new Audio)}}get volume(){var e,t;return null!==(t=null===(e=this.privAudio)||void 0===e?void 0:e.volume)&&void 0!==t?t:-1}set volume(e){this.privAudio&&(this.privAudio.volume=e)}mute(){this.privAudio&&(this.privAudio.muted=!0)}unmute(){this.privAudio&&(this.privAudio.muted=!1)}get isClosed(){return this.privIsClosed}get currentTime(){return void 0!==this.privAudio?this.privAudio.currentTime:-1}pause(){this.privIsPaused||void 0===this.privAudio||(this.privAudio.pause(),this.privIsPaused=!0)}resume(e,t){this.privIsPaused&&void 0!==this.privAudio&&(this.privAudio.play().then((()=>{e&&e()}),(e=>{t&&t(e)})),this.privIsPaused=!1)}get internalAudio(){return this.privAudio}updateSourceBuffer(){return Hr(this,void 0,void 0,(function*(){if(void 0!==this.privAudioBuffer&&this.privAudioBuffer.length>0&&this.sourceBufferAvailable()){this.privAppendingToBuffer=!0;const e=this.privAudioBuffer.shift();try{this.privSourceBuffer.appendBuffer(e)}catch(t){return this.privAudioBuffer.unshift(e),void console.log("buffer filled, pausing addition of binaries until space is made")}yield this.notifyPlayback()}else this.canEndStream()&&(yield this.handleSourceBufferUpdateEnd())}))}handleSourceBufferUpdateEnd(){return Hr(this,void 0,void 0,(function*(){this.canEndStream()&&this.sourceBufferAvailable()&&(this.privMediaSource.endOfStream(),yield this.notifyPlayback())}))}notifyPlayback(){return Hr(this,void 0,void 0,(function*(){this.privPlaybackStarted||void 0===this.privAudio||(this.privPlaybackStarted=!0,this.onAudioStart&&this.onAudioStart(this),this.privAudio.onended=()=>{this.onAudioEnd&&this.onAudioEnd(this)},this.privIsPaused||(yield this.privAudio.play()))}))}canEndStream(){return this.isClosed&&void 0!==this.privSourceBuffer&&0===this.privAudioBuffer.length&&this.privMediaSourceOpened&&!this.privAppendingToBuffer&&"open"===this.privMediaSource.readyState}sourceBufferAvailable(){return void 0!==this.privSourceBuffer&&!this.privSourceBuffer.updating}}h=o("1DJXa");class Wr{constructor(e){Ue.throwIfNullOrUndefined(h.openSync,"\nFile System access not available, please use Push or PullAudioOutputStream"),this.privFd=h.openSync(e,"w")}set format(e){Ue.throwIfNotUndefined(this.privAudioFormat,"format is already set"),this.privAudioFormat=e;let t=0;this.privAudioFormat.hasHeader&&(t=this.privAudioFormat.header.byteLength),void 0!==this.privFd&&(this.privWriteStream=h.createWriteStream("",{fd:this.privFd,start:t,autoClose:!1}))}write(e){Ue.throwIfNullOrUndefined(this.privAudioFormat,"must set format before writing."),void 0!==this.privWriteStream&&this.privWriteStream.write(new Uint8Array(e.slice(0)))}close(){void 0!==this.privFd&&(this.privWriteStream.on("finish",(()=>{this.privAudioFormat.hasHeader&&(this.privAudioFormat.updateHeader(this.privWriteStream.bytesWritten),h.writeSync(this.privFd,new Int8Array(this.privAudioFormat.header),0,this.privAudioFormat.header.byteLength,0)),h.closeSync(this.privFd),this.privFd=void 0})),this.privWriteStream.end())}id(){return this.privId}}class qr{static fromDefaultMicrophoneInput(){const e=new or(!0);return new Kr(new(0,Fe.MicAudioSource)(e))}static fromMicrophoneInput(e){const t=new or(!0);return new Kr(new(0,Fe.MicAudioSource)(t,e))}static fromWavFileInput(e,t="unnamedBuffer.wav"){return new Kr(new(0,nr.FileAudioSource)(e,t))}static fromStreamInput(e){if(e instanceof Fr)return new Kr(new(0,Rr.PullAudioInputStreamImpl)(e));if(e instanceof Rr.AudioInputStream)return new Kr(e);if("undefined"!=typeof MediaStream&&e instanceof MediaStream){const t=new or(!1);return new Kr(new(0,Fe.MicAudioSource)(t,null,null,e))}throw new Error("Not Supported Type")}static fromDefaultSpeakerOutput(){return new Jr(new(0,jr.SpeakerAudioDestination))}static fromSpeakerOutput(e){if(void 0===e)return qr.fromDefaultSpeakerOutput();if(e instanceof jr.SpeakerAudioDestination)return new Jr(e);throw new Error("Not Supported Type")}static fromAudioFileOutput(e){return new Jr(new Wr(e))}static fromStreamOutput(e){if(e instanceof zr)return new Jr(new(0,pn.PushAudioOutputStreamImpl)(e));if(e instanceof pn.PushAudioOutputStream)return new Jr(e);if(e instanceof pn.PullAudioOutputStream)return new Jr(e);throw new Error("Not Supported Type")}}class Kr extends qr{constructor(e){super(),this.privSource=e}get format(){return this.privSource.format}close(e,t){this.privSource.turnOff().then((()=>{e&&e()}),(e=>{t&&t(e)}))}id(){return this.privSource.id()}get blob(){return this.privSource.blob}turnOn(){return this.privSource.turnOn()}attach(e){return this.privSource.attach(e)}detach(e){return this.privSource.detach(e)}turnOff(){return this.privSource.turnOff()}get events(){return this.privSource.events}setProperty(e,t){if(Ue.throwIfNull(t,"value"),void 0===this.privSource.setProperty)throw new Error("This AudioConfig instance does not support setting properties.");this.privSource.setProperty(e,t)}getProperty(e,t){if(void 0!==this.privSource.getProperty)return this.privSource.getProperty(e,t);throw new Error("This AudioConfig instance does not support getting properties.")}get deviceInfo(){return this.privSource.deviceInfo}}class Jr extends qr{constructor(e){super(),this.privDestination=e}set format(e){this.privDestination.format=e}write(e){this.privDestination.write(e)}close(){this.privDestination.close()}id(){return this.privDestination.id()}setProperty(){throw new Error("This AudioConfig instance does not support setting properties.")}getProperty(){throw new Error("This AudioConfig instance does not support getting properties.")}}var Qr={};e(Qr,"SpeechRecognizer",(()=>ei),(e=>ei=e));var Xr={};e(Xr,"Recognizer",(()=>Zr),(e=>Zr=e));var Yr=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class Zr{constructor(e,t,n){this.audioConfig=void 0!==e?e:qr.fromDefaultMicrophoneInput(),this.privDisposed=!1,this.privProperties=t.clone(),this.privConnectionFactory=n,this.implCommonRecognizerSetup()}close(e,t){Ue.throwIfDisposed(this.privDisposed),oe(this.dispose(!0),e,t)}get internalData(){return this.privReco}dispose(e){return Yr(this,void 0,void 0,(function*(){this.privDisposed||(this.privDisposed=!0,e&&this.privReco&&(yield this.privReco.audioSource.turnOff(),yield this.privReco.dispose()))}))}static get telemetryEnabled(){return Ye.ServiceRecognizerBase.telemetryDataEnabled}static enableTelemetry(e){Ye.ServiceRecognizerBase.telemetryDataEnabled=e}implCommonRecognizerSetup(){let e="undefined"!=typeof window?"Browser":"Node",t="unknown",n="unknown";"undefined"!=typeof navigator&&(e=e+"/"+navigator.platform,t=navigator.userAgent,n=navigator.appVersion);const r=this.createRecognizerConfig(new ht(new ft(new mt(e,t,n))));this.privReco=this.createServiceRecognizer(Zr.getAuthFromProperties(this.privProperties),this.privConnectionFactory,this.audioConfig,r)}recognizeOnceAsyncImpl(e){return Yr(this,void 0,void 0,(function*(){Ue.throwIfDisposed(this.privDisposed);const t=new ie;yield this.implRecognizerStop(),yield this.privReco.recognize(e,t.resolve,t.reject);const n=yield t.promise;return yield this.implRecognizerStop(),n}))}startContinuousRecognitionAsyncImpl(e){return Yr(this,void 0,void 0,(function*(){Ue.throwIfDisposed(this.privDisposed),yield this.implRecognizerStop(),yield this.privReco.recognize(e,void 0,void 0)}))}stopContinuousRecognitionAsyncImpl(){return Yr(this,void 0,void 0,(function*(){Ue.throwIfDisposed(this.privDisposed),yield this.implRecognizerStop()}))}implRecognizerStop(){return Yr(this,void 0,void 0,(function*(){this.privReco&&(yield this.privReco.stopRecognizing())}))}static getAuthFromProperties(e){const t=e.getProperty(Qe.SpeechServiceConnection_Key,void 0);return t&&""!==t?new He(t):new Ve((()=>{const t=e.getProperty(Qe.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(t)}),(()=>{const t=e.getProperty(Qe.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(t)}))}}var $r=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class ei extends Xr.Recognizer{constructor(e,t){const n=e;Ue.throwIfNull(n,"speechConfig"),Ue.throwIfNullOrWhitespace(n.properties.getProperty(Qe.SpeechServiceConnection_RecoLanguage),Qe[Qe.SpeechServiceConnection_RecoLanguage]),super(t,n.properties,new Ct),this.privDisposedRecognizer=!1}static FromConfig(e,t,n){const r=e;t.properties.mergeTo(r.properties);return new ei(e,n)}get endpointId(){return Ue.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(Qe.SpeechServiceConnection_EndpointId,"00000000-0000-0000-0000-000000000000")}get authorizationToken(){return this.properties.getProperty(Qe.SpeechServiceAuthorization_Token)}set authorizationToken(e){Ue.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(Qe.SpeechServiceAuthorization_Token,e)}get speechRecognitionLanguage(){return Ue.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(Qe.SpeechServiceConnection_RecoLanguage)}get outputFormat(){return Ue.throwIfDisposed(this.privDisposedRecognizer),this.properties.getProperty(Xn,vt[vt.Simple])===vt[vt.Simple]?vt.Simple:vt.Detailed}get properties(){return this.privProperties}recognizeOnceAsync(e,t){oe(this.recognizeOnceAsyncImpl(tt.Interactive),e,t)}startContinuousRecognitionAsync(e,t){oe(this.startContinuousRecognitionAsyncImpl(tt.Conversation),e,t)}stopContinuousRecognitionAsync(e,t){oe(this.stopContinuousRecognitionAsyncImpl(),e,t)}startKeywordRecognitionAsync(e,t,n){Ue.throwIfNull(e,"model"),n&&n("Not yet implemented.")}stopKeywordRecognitionAsync(e){e&&e()}close(e,t){Ue.throwIfDisposed(this.privDisposedRecognizer),oe(this.dispose(!0),e,t)}dispose(e){const t=Object.create(null,{dispose:{get:()=>super.dispose}});return $r(this,void 0,void 0,(function*(){this.privDisposedRecognizer||(e&&(this.privDisposedRecognizer=!0,yield this.implRecognizerStop()),yield t.dispose.call(this,e))}))}createRecognizerConfig(e){return new dt(e,this.properties)}createServiceRecognizer(e,t,n,r){return new(0,Bt.SpeechServiceRecognizer)(e,t,n,r,this)}}var ti,ni,ri,ii,oi={};e(oi,"SpeechSynthesizer",(()=>ci),(e=>ci=e)),(ni=ti||(ti={}))[ni.Unknown=0]="Unknown",ni[ni.Female=1]="Female",ni[ni.Male=2]="Male",(ii=ri||(ri={}))[ii.OnlineNeural=1]="OnlineNeural",ii[ii.OnlineStandard=2]="OnlineStandard",ii[ii.OfflineNeural=3]="OfflineNeural",ii[ii.OfflineStandard=4]="OfflineStandard";class ai{constructor(e){if(this.privStyleList=[],this.privVoicePath="",e&&(this.privName=e.Name,this.privLocale=e.Locale,this.privShortName=e.ShortName,this.privLocalName=e.LocalName,this.privVoiceType=e.VoiceType.endsWith("Standard")?ri.OnlineStandard:ri.OnlineNeural,this.privGender="Male"===e.Gender?ti.Male:"Female"===e.Gender?ti.Female:ti.Unknown,e.StyleList&&Array.isArray(e.StyleList)))for(const t of e.StyleList)this.privStyleList.push(t)}get name(){return this.privName}get locale(){return this.privLocale}get shortName(){return this.privShortName}get localName(){return this.privLocalName}get gender(){return this.privGender}get voiceType(){return this.privVoiceType}get styleList(){return this.privStyleList}get voicePath(){return this.privVoicePath}}class si extends Rn{constructor(e,t,n){if(Array.isArray(t)){super(e,yt.VoicesListRetrieved,void 0,new kt),this.privVoices=[];for(const e of t)this.privVoices.push(new ai(e))}else super(e,yt.Canceled,n||"Error information unavailable",new kt)}get voices(){return this.privVoices}}var li=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};class ci{constructor(e,t){const n=e;Ue.throwIfNull(n,"speechConfig"),null!==t&&(this.audioConfig=void 0===t?"undefined"==typeof window?void 0:qr.fromDefaultSpeakerOutput():t),this.privProperties=n.properties.clone(),this.privDisposed=!1,this.privSynthesizing=!1,this.privConnectionFactory=new Tt,this.synthesisRequestQueue=new(0,ae.Queue),this.implCommonSynthesizeSetup()}get authorizationToken(){return this.properties.getProperty(Qe.SpeechServiceAuthorization_Token)}set authorizationToken(e){Ue.throwIfNullOrWhitespace(e,"token"),this.properties.setProperty(Qe.SpeechServiceAuthorization_Token,e)}get properties(){return this.privProperties}get autoDetectSourceLanguage(){return"OpenRange"===this.properties.getProperty(Qe.SpeechServiceConnection_AutoDetectSourceLanguages)}static FromConfig(e,t,n){const r=e;return t.properties.mergeTo(r.properties),new ci(e,n)}buildSsml(e){const t={"af-ZA":"af-ZA-AdriNeural","am-ET":"am-ET-AmehaNeural","ar-AE":"ar-AE-FatimaNeural","ar-BH":"ar-BH-AliNeural","ar-DZ":"ar-DZ-AminaNeural","ar-EG":"ar-EG-SalmaNeural","ar-IQ":"ar-IQ-BasselNeural","ar-JO":"ar-JO-SanaNeural","ar-KW":"ar-KW-FahedNeural","ar-LY":"ar-LY-ImanNeural","ar-MA":"ar-MA-JamalNeural","ar-QA":"ar-QA-AmalNeural","ar-SA":"ar-SA-HamedNeural","ar-SY":"ar-SY-AmanyNeural","ar-TN":"ar-TN-HediNeural","ar-YE":"ar-YE-MaryamNeural","bg-BG":"bg-BG-BorislavNeural","bn-BD":"bn-BD-NabanitaNeural","bn-IN":"bn-IN-BashkarNeural","ca-ES":"ca-ES-JoanaNeural","cs-CZ":"cs-CZ-AntoninNeural","cy-GB":"cy-GB-AledNeural","da-DK":"da-DK-ChristelNeural","de-AT":"de-AT-IngridNeural","de-CH":"de-CH-JanNeural","de-DE":"de-DE-KatjaNeural","el-GR":"el-GR-AthinaNeural","en-AU":"en-AU-NatashaNeural","en-CA":"en-CA-ClaraNeural","en-GB":"en-GB-LibbyNeural","en-HK":"en-HK-SamNeural","en-IE":"en-IE-ConnorNeural","en-IN":"en-IN-NeerjaNeural","en-KE":"en-KE-AsiliaNeural","en-NG":"en-NG-AbeoNeural","en-NZ":"en-NZ-MitchellNeural","en-PH":"en-PH-JamesNeural","en-SG":"en-SG-LunaNeural","en-TZ":"en-TZ-ElimuNeural","en-US":"en-US-JennyNeural","en-ZA":"en-ZA-LeahNeural","es-AR":"es-AR-ElenaNeural","es-BO":"es-BO-MarceloNeural","es-CL":"es-CL-CatalinaNeural","es-CO":"es-CO-GonzaloNeural","es-CR":"es-CR-JuanNeural","es-CU":"es-CU-BelkysNeural","es-DO":"es-DO-EmilioNeural","es-EC":"es-EC-AndreaNeural","es-ES":"es-ES-AlvaroNeural","es-GQ":"es-GQ-JavierNeural","es-GT":"es-GT-AndresNeural","es-HN":"es-HN-CarlosNeural","es-MX":"es-MX-DaliaNeural","es-NI":"es-NI-FedericoNeural","es-PA":"es-PA-MargaritaNeural","es-PE":"es-PE-AlexNeural","es-PR":"es-PR-KarinaNeural","es-PY":"es-PY-MarioNeural","es-SV":"es-SV-LorenaNeural","es-US":"es-US-AlonsoNeural","es-UY":"es-UY-MateoNeural","es-VE":"es-VE-PaolaNeural","et-EE":"et-EE-AnuNeural","fa-IR":"fa-IR-DilaraNeural","fi-FI":"fi-FI-SelmaNeural","fil-PH":"fil-PH-AngeloNeural","fr-BE":"fr-BE-CharlineNeural","fr-CA":"fr-CA-SylvieNeural","fr-CH":"fr-CH-ArianeNeural","fr-FR":"fr-FR-DeniseNeural","ga-IE":"ga-IE-ColmNeural","gl-ES":"gl-ES-RoiNeural","gu-IN":"gu-IN-DhwaniNeural","he-IL":"he-IL-AvriNeural","hi-IN":"hi-IN-MadhurNeural","hr-HR":"hr-HR-GabrijelaNeural","hu-HU":"hu-HU-NoemiNeural","id-ID":"id-ID-ArdiNeural","is-IS":"is-IS-GudrunNeural","it-IT":"it-IT-IsabellaNeural","ja-JP":"ja-JP-NanamiNeural","jv-ID":"jv-ID-DimasNeural","kk-KZ":"kk-KZ-AigulNeural","km-KH":"km-KH-PisethNeural","kn-IN":"kn-IN-GaganNeural","ko-KR":"ko-KR-SunHiNeural","lo-LA":"lo-LA-ChanthavongNeural","lt-LT":"lt-LT-LeonasNeural","lv-LV":"lv-LV-EveritaNeural","mk-MK":"mk-MK-AleksandarNeural","ml-IN":"ml-IN-MidhunNeural","mr-IN":"mr-IN-AarohiNeural","ms-MY":"ms-MY-OsmanNeural","mt-MT":"mt-MT-GraceNeural","my-MM":"my-MM-NilarNeural","nb-NO":"nb-NO-PernilleNeural","nl-BE":"nl-BE-ArnaudNeural","nl-NL":"nl-NL-ColetteNeural","pl-PL":"pl-PL-AgnieszkaNeural","ps-AF":"ps-AF-GulNawazNeural","pt-BR":"pt-BR-FranciscaNeural","pt-PT":"pt-PT-DuarteNeural","ro-RO":"ro-RO-AlinaNeural","ru-RU":"ru-RU-SvetlanaNeural","si-LK":"si-LK-SameeraNeural","sk-SK":"sk-SK-LukasNeural","sl-SI":"sl-SI-PetraNeural","so-SO":"so-SO-MuuseNeural","sr-RS":"sr-RS-NicholasNeural","su-ID":"su-ID-JajangNeural","sv-SE":"sv-SE-SofieNeural","sw-KE":"sw-KE-RafikiNeural","sw-TZ":"sw-TZ-DaudiNeural","ta-IN":"ta-IN-PallaviNeural","ta-LK":"ta-LK-KumarNeural","ta-SG":"ta-SG-AnbuNeural","te-IN":"te-IN-MohanNeural","th-TH":"th-TH-PremwadeeNeural","tr-TR":"tr-TR-AhmetNeural","uk-UA":"uk-UA-OstapNeural","ur-IN":"ur-IN-GulNeural","ur-PK":"ur-PK-AsadNeural","uz-UZ":"uz-UZ-MadinaNeural","vi-VN":"vi-VN-HoaiMyNeural","zh-CN":"zh-CN-XiaoxiaoNeural","zh-HK":"zh-HK-HiuMaanNeural","zh-TW":"zh-TW-HsiaoChenNeural","zu-ZA":"zu-ZA-ThandoNeural"};let n=this.properties.getProperty(Qe.SpeechServiceConnection_SynthLanguage,"en-US"),r=this.properties.getProperty(Qe.SpeechServiceConnection_SynthVoice,""),i=ci.XMLEncode(e);return this.autoDetectSourceLanguage?n="en-US":r=r||t[n],r&&(i=`<voice name='${r}'>${i}</voice>`),i=`<speak version='1.0' xmlns='http://www.w3.org/2001/10/synthesis' xmlns:mstts='http://www.w3.org/2001/mstts' xmlns:emo='http://www.w3.org/2009/10/emotionml' xml:lang='${n}'>${i}</speak>`,i}speakTextAsync(e,t,n,r){this.speakImpl(e,!1,t,n,r)}speakSsmlAsync(e,t,n,r){this.speakImpl(e,!0,t,n,r)}getVoicesAsync(e=""){return li(this,void 0,void 0,(function*(){return this.getVoices(e)}))}close(e,t){Ue.throwIfDisposed(this.privDisposed),oe(this.dispose(!0),e,t)}get internalData(){return this.privAdapter}dispose(e){return li(this,void 0,void 0,(function*(){this.privDisposed||(e&&this.privAdapter&&(yield this.privAdapter.dispose()),this.privDisposed=!0)}))}createSynthesizerConfig(e){return new Jn(e,this.privProperties)}createSynthesisAdapter(e,t,n,r){return new(0,Tn.SynthesisAdapterBase)(e,t,r,this,this.audioConfig)}implCommonSynthesizeSetup(){let e="undefined"!=typeof window?"Browser":"Node",t="unknown",n="unknown";"undefined"!=typeof navigator&&(e=e+"/"+navigator.platform,t=navigator.userAgent,n=navigator.appVersion);const r=this.createSynthesizerConfig(new ht(new ft(new mt(e,t,n)))),i=this.privProperties.getProperty(Qe.SpeechServiceConnection_Key,void 0),o=i&&""!==i?new He(i):new Ve((()=>{const e=this.privProperties.getProperty(Qe.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(e)}),(()=>{const e=this.privProperties.getProperty(Qe.SpeechServiceAuthorization_Token,void 0);return Promise.resolve(e)}));this.privAdapter=this.createSynthesisAdapter(o,this.privConnectionFactory,this.audioConfig,r),this.privAdapter.audioOutputFormat=dn.fromSpeechSynthesisOutputFormat(Zt[this.properties.getProperty(Qe.SpeechServiceConnection_SynthOutputFormat,void 0)]),this.privRestAdapter=new Kn(r)}speakImpl(e,t,n,r,i){try{Ue.throwIfDisposed(this.privDisposed);const o=x();let a;a=i instanceof zr?new(0,pn.PushAudioOutputStreamImpl)(i):i instanceof pn.PullAudioOutputStream?i:void 0!==i?new Wr(i):void 0,this.synthesisRequestQueue.enqueue(new ui(o,e,t,(e=>{if(this.privSynthesizing=!1,n)try{n(e)}catch(e){r&&r(e)}n=void 0,this.adapterSpeak().catch((()=>{}))}),(e=>{r&&r(e)}),a)),this.adapterSpeak().catch((()=>{}))}catch(e){if(r)if(e instanceof Error){const t=e;r(t.name+": "+t.message)}else r(e);this.dispose(!0).catch((()=>{}))}}getVoices(e){return li(this,void 0,void 0,(function*(){const t=x(),n=yield this.privRestAdapter.getVoicesList(t);if(n.ok&&Array.isArray(n.json)){let r=n.json;return e&&e.length>0&&(r=r.filter((t=>!!t.Locale&&t.Locale.toLowerCase()===e.toLowerCase()))),new si(t,r,void 0)}return new si(t,void 0,`Error: ${n.status}: ${n.statusText}`)}))}adapterSpeak(){return li(this,void 0,void 0,(function*(){if(!this.privDisposed&&!this.privSynthesizing){this.privSynthesizing=!0;const e=yield this.synthesisRequestQueue.dequeue();return this.privAdapter.Speak(e.text,e.isSSML,e.requestId,e.cb,e.err,e.dataStream)}}))}static XMLEncode(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}}class ui{constructor(e,t,n,r,i,o){this.requestId=e,this.text=t,this.isSSML=n,this.cb=r,this.err=i,this.dataStream=o}}function di(){
62
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */di=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var i=t&&t.prototype instanceof d?t:d,o=Object.create(i.prototype),a=new M(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return A()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=c(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===u)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u={};function d(){}function h(){}function f(){}var p={};s(p,i,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(_([])));g&&g!==t&&n.call(g,i)&&(p=g);var v=f.prototype=d.prototype=Object.create(p);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function r(i,o,a,s){var l=c(e[i],e,o);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==typeof d&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(l.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function M(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function _(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:A}}function A(){return{value:void 0,done:!0}}return h.prototype=f,s(v,"constructor",f),s(f,"constructor",h),h.displayName=s(f,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,s(e,a,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(y.prototype),s(y.prototype,o,(function(){return this})),e.AsyncIterator=y,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new y(l(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(v),s(v,a,"Generator"),s(v,i,(function(){return this})),s(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=_,M.prototype={constructor:M,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:_(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function hi(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}function fi(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){hi(o,r,i,a,s,"next",e)}function s(e){hi(o,r,i,a,s,"throw",e)}a(void 0)}))}}function pi(){return pi=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},pi.apply(this,arguments)}var mi=function(e,t){return n(d)(""+t.apiUrl+e,pi({},t,{body:null!=t&&t.body?JSON.stringify(t.body):void 0,mode:"cors",credentials:"include",headers:pi({"Content-Type":"application/json"},null==t?void 0:t.headers)})).then((function(e){return null!=t&&t.text?e.text():e.json()}))},gi=function(e){return{getTenantPublicMemoriList:function(t){return mi("/TenantPublicMemori/"+encodeURI(t),{apiUrl:e})},getTenantMetaverseMemoriList:function(t){return mi("/TenantMetaverseMemori/"+encodeURI(t),{apiUrl:e})},getPublicMemoriList:function(t){return mi("/PublicMemori/"+t,{apiUrl:e})},getAllMemori:function(t){return mi("/AllMemori/"+t,{apiUrl:e})},getUserMemoriList:function(t){return mi("/Memori/"+t,{apiUrl:e})},getSharedMemoriList:function(t){return mi("/SharedMemori/"+t,{apiUrl:e})},getTenantCategories:function(t){return mi("/TenantMemoriCategories/"+encodeURI(t),{apiUrl:e})},getMemoriConfigs:function(t){return mi("/MemoriConfigs/"+t,{apiUrl:e})},createMemori:function(t,n){return mi("/Memori/"+t,{apiUrl:e,body:n,method:"POST"})},updateMemori:function(t,n){return mi("/Memori/"+t+"/"+n.memoriID,{apiUrl:e,body:n,method:"PATCH"})},deleteMemori:function(t,n){return mi("/Memori/"+t,{apiUrl:e,body:n,method:"DELETE"})},getMemoriById:function(t,n){return mi("/Memori/"+t+"/"+n,{apiUrl:e})},getMemoriByUserAndId:function(t,n,r,i){return mi("/MemoriById/"+t+"/"+n+"/"+r+(i?"/"+i:""),{apiUrl:e})},getMemori:function(t,n,r,i){return mi("/Memori/"+encodeURI(t)+"/"+encodeURI(n)+"/"+encodeURI(r)+"/"+(null!=i?i:""),{apiUrl:e})},getMemoriSessions:function(t,n,r,i){return mi("/MemoriSessions/"+t+"/"+n+(r?"/"+r:"")+(r&&i?"/"+i:""),{apiUrl:e})},transferMemori:function(t,n){return mi("/TransferMemori/"+t,{apiUrl:e,body:n,method:"POST"})},memoriContentUpdated:function(t,n){return mi("/MemoriContentUpdated/"+t+"/"+n,{apiUrl:e,method:"POST"})}}},vi=function(e){return{userSignIn:function(t){return mi("/User",{apiUrl:e,body:t,method:"POST"})},userConfirmSignIn:function(t){return mi("/UserConfirm",{apiUrl:e,body:t,method:"POST"})},userLogin:function(t){return mi("/Login",{apiUrl:e,body:t,method:"POST"})},userLogout:function(t){return mi("/Logout/"+t,{apiUrl:e,method:"POST"})},getUser:function(t,n){return mi("/User/"+t+"/"+n,{apiUrl:e})},getUsersList:function(t){return mi("/Users/"+t,{apiUrl:e})},deleteUser:function(t,n){return mi("/User/"+t+"/"+n,{apiUrl:e,method:"DELETE"})},updateUser:function(t,n,r){return mi("/User/"+t+"/"+n,{apiUrl:e,method:"PATCH",body:r})},resetPassword:function(t){return mi("/ResetPassword",{apiUrl:e,body:t,method:"POST"})},resetConfirm:function(t){return mi("/ResetConfirm",{apiUrl:e,body:t,method:"POST"})},recoverUsername:function(t){return mi("/RecoverUsername",{apiUrl:e,body:t,method:"POST"})},getTenantConfig:function(t){return mi("/Tenant/"+t,{apiUrl:e})},resendVerificationCode:function(t){return mi("/ResendVerificationCode",{apiUrl:e,body:t,method:"POST"})},createUser:function(t,n){return mi("/User/"+t,{apiUrl:e,body:n,method:"POST"})}}},bi=function(e){return{getMemoriIntegrationsList:function(t,n){return mi("/Integrations/"+t+"/"+n,{apiUrl:e})},getAllIntegrationsList:function(t){return mi("/AllIntegrations/"+t,{apiUrl:e})},getIntegration:function(t,n){return mi("/Integration/"+t+"/"+n,{apiUrl:e})},deleteIntegration:function(t,n){return mi("/Integration/"+t+"/"+n,{apiUrl:e,method:"DELETE"})},createIntegration:function(t,n){return mi("/Integration/"+t,{apiUrl:e,method:"POST",body:n})},updateIntegration:function(t,n,r){return mi("/Integration/"+t+"/"+n,{apiUrl:e,method:"PATCH",body:r})}}},yi=function(e){return{getUploadAssetURL:function(t,n,r){return e+"/Asset/"+t+"/"+n+(r?"/"+r:"")},uploadAsset:(t=fi(di().mark((function t(n,r,i,o,a){var s,l,c,u;return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=new FormData,t.next=3,fetch(r);case 3:return l=t.sent,t.next=6,l.blob();case 6:return c=t.sent,s.append(n,c,n),t.next=10,fetch(e+"/Asset/"+i+"/"+o+(a?"/"+a:""),{method:"POST",body:s});case 10:return u=t.sent,t.next=13,u.json();case 13:return t.abrupt("return",t.sent);case 14:case"end":return t.stop()}}),t)}))),function(e,n,r,i,o){return t.apply(this,arguments)}),getAsset:function(t,n){return mi("/Asset/"+t+"/"+n,{apiUrl:e,method:"GET"})},updateAsset:function(t,n,r){return mi("/Asset/"+t+"/"+n.split("/").reverse()[0],{apiUrl:e,method:"PATCH",body:r})},deleteAsset:function(t,n){return mi("/Asset/"+t+"/"+n.split("/").reverse()[0],{apiUrl:e,method:"DELETE"})}};var t},wi=function(e){return{getSentInvitations:function(t){return mi("/SentInvitations/"+t,{apiUrl:e})},getReceivedInvitations:function(t){return mi("/ReceivedInvitations/"+t,{apiUrl:e})},getAllInvitations:function(t){return mi("/AllInvitations/"+t,{apiUrl:e})},getInvitation:function(t,n){return mi("/Invitation/"+t+"/"+n,{apiUrl:e})},updateInvitation:function(t,n){return mi("/Invitation/"+t+"/"+n.invitationID,{apiUrl:e,method:"PATCH",body:n})},deleteInvitation:function(t,n){return mi("/Invitation/"+t+"/"+n,{apiUrl:e,method:"DELETE"})},acceptInvitation:function(t,n){return mi("/AcceptInvitation/"+t+"/"+n,{apiUrl:e,method:"POST"})},rejectInvitation:function(t,n){return mi("/RejectInvitation/"+t+"/"+n,{apiUrl:e,method:"POST"})},sendInvitation:function(t,n){return mi("/SendInvitation/"+t,{apiUrl:e,method:"POST",body:n})}}},Si=function(e){return{getTenantConsumptionLogs:function(t,n,r,i,o){return mi("/TenantConsumptionLogs/"+t+"/"+n+"/"+r+(i?"/"+i:"")+(i&&o?"/"+o:""),{apiUrl:e})},getUserConsumptionLogs:function(t,n,r,i,o){return mi("/UserConsumptionLogs/"+t+"/"+n+"/"+r+(i?"/"+i:"")+(i&&o?"/"+o:""),{apiUrl:e})},getMemoriConsumptionLogs:function(t,n,r,i,o){return mi("/MemoriConsumptionLogs/"+t+"/"+n+"/"+r+(i?"/"+i:"")+(i&&o?"/"+o:""),{apiUrl:e})}}},xi=function(e){return{getTenantNotifications:function(t){return mi("/TenantNotifications/"+t,{apiUrl:e})},getUserNotifications:function(t){return mi("/UserNotifications/"+t,{apiUrl:e})}}},Mi=function(e){return pi({asset:yi(e),memori:gi(e),user:vi(e),integration:bi(e),invitation:wi(e),consumptionLogs:Si(e),notifications:xi(e)},yi(e),gi(e),vi(e),bi(e),wi(e),Si(e),xi(e))},_i=function(e){return{getCorrelationPairs:(n=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CorrelationPairs/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),deleteCorrelationPair:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CorrelationPair/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n},Ai=function(e){return{postTextEnteredEvent:(c=fi(di().mark((function t(n){var r,i;return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.sessionId,i=n.text,t.abrupt("return",mi("/TextEnteredEvent/"+r,{method:"POST",apiUrl:e,body:{text:i}}));case 2:case"end":return t.stop()}}),t)}))),function(e){return c.apply(this,arguments)}),postPlaceChangedEvent:(l=fi(di().mark((function t(n){var r,i,o,a,s;return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.sessionId,i=n.placeName,o=n.latitude,a=n.longitude,s=n.uncertaintyKm,t.abrupt("return",mi("/PlaceChangedEvent/"+r,{method:"POST",apiUrl:e,body:{placeName:i,latitude:o,longitude:a,uncertaintyKm:s}}));case 2:case"end":return t.stop()}}),t)}))),function(e){return l.apply(this,arguments)}),postDateChangedEvent:(s=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/DateChangedEvent/"+n,{method:"POST",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return s.apply(this,arguments)}),postTagChangedEvent:(a=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/TagChangedEvent/"+n,{method:"POST",apiUrl:e,body:{tag:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return a.apply(this,arguments)}),postTimeoutEvent:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/TimeoutEvent/"+n,{method:"POST",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),postMediumSelectedEvent:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/MediumSelectedEvent/"+n,{method:"POST",apiUrl:e,body:{medium:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),postDateSelectedEvent:(r=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/DateSelectedEvent/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),postPlaceSelectedEvent:(n=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/PlaceSelectedEvent/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),postTagSelectedEvent:(t=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/TagSelectedEvent/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r,i,o,a,s,l,c},Ei=function(e){return{importCSV:(n=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ImportExport/ImportCSV/"+n,{method:"POST",apiUrl:e,body:pi({csvRows:r},i)}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),exportCSV:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ImportExport/ExportCSV/"+n,{method:"POST",apiUrl:e,body:r,text:!0}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n},Ci=function(e){return{getIntents:(u=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Intents/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return u.apply(this,arguments)}),getIntent:(c=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Intent/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return c.apply(this,arguments)}),patchIntent:(l=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Intent/"+n+"/"+r.intentID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return l.apply(this,arguments)}),deleteIntent:(s=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Intent/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return s.apply(this,arguments)}),createIntent:(a=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Intent/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return a.apply(this,arguments)}),getIntentSlots:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/IntentSlots/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getIntentSlot:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/IntentSlot/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),patchIntentSlot:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/IntentSlot/"+n+"/"+r.intentSlotID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),deleteIntentSlot:(n=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/IntentSlot/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),createIntentSlot:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/IntentSlot/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o,a,s,l,c,u},Ti=function(e){return{getLocalizationKeys:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/LocalizationKeys/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getLocalizationKey:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/LocalizationKey/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),deleteLocalizationKey:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/LocalizationKey/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postLocalizationKey:(n=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/LocalizationKey/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),patchLocalizationKey:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/LocalizationKey/"+n,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o},Ii=function(e){return{getMedia:(o=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Media/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),deleteMedia:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Media/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),getMedium:(r=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Medium/"+n+"/"+r+"/"+i,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)}),patchMedium:(n=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Medium/"+n+"/"+r+"/"+i,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),deleteMedium:function(t,n,r){return mi("/Medium/"+t+"/"+n+"/"+r,{method:"GET",apiUrl:e})},postMedium:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Medium/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o},ki=function(e){return{getMemories:(s=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Memories/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return s.apply(this,arguments)}),getMemoriesPaginated:(a=fi(di().mark((function t(n,r,i,o){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Memories/"+n+"/"+r+"/"+i+(o?"/"+o:""),{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n,r){return a.apply(this,arguments)}),getMemory:(o=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Memory/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),patchMemory:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Memory/"+n+"/"+r.memoryID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),deleteMemory:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Memory/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postMemory:(n=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Memory/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),getMemoryAccess:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/MemoryAccess/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o,a,s},Ri=function(e){return{getWordVector:(o=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/WordVector/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return o.apply(this,arguments)}),getSimilarWords:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/SimilarWords/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),guessLanguage:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/GuessLanguage/"+n,{method:"POST",apiUrl:e,body:{text:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),computeSimilarity:(n=fi(di().mark((function t(n,r,i,o,a){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ComputeSimilarity/"+n,{method:"POST",apiUrl:e,body:{referenceText:r,referenceTextType:i,comparisonText:o,comparisonTextType:a}}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r,i,o){return n.apply(this,arguments)}),checkWords:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CheckWords/"+n,{method:"POST",apiUrl:e,body:{text:r}}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o},Oi=function(e){return{getPeople:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/People/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getPerson:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Person/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),patchPerson:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Person/"+n+"/"+r.personID,{method:"PATCH",body:r,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),deletePerson:(n=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Person/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),postPerson:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Person/"+n,{method:"POST",body:r,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o},Pi=function(e){return{getPromptedQuestions:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/PromptedQuestions/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getPromptedQuestion:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/PromptedQuestion/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),patchPromptedQuestion:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/PromptedQuestion/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),deletePromptedQuestion:(n=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/PromptedQuestion/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),postPromptedQuestion:(t=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/PromptedQuestion/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r,i,o},Ni=function(e){return{searchMemory:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Search/"+n,{method:"POST",body:r,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postRandom:(n=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Random/"+n,{method:"POST",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),postHints:(t=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Hints/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r},Bi=function(e){return{initSession:(r=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Session",{method:"POST",body:n,apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),getSession:(n=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Session/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),deleteSession:(t=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Session/"+n,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return t.apply(this,arguments)})};var t,n,r},Li=function(e){return{getStatistics:(a=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/Statistics/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return a.apply(this,arguments)}),getContentQualityIndexes:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ContentQualityIndexes/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getTextQualityIndexes:(i=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/TextQualityIndexes/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return i.apply(this,arguments)}),getEventLogs:(r=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/EventLogs/"+n+"/"+r+"/"+i,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)}),getMemoryEventLogs:(n=fi(di().mark((function t(n,r,i,o){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/EventLogs/"+n+"/"+r+"/"+i+"/"+o,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r,i){return n.apply(this,arguments)}),getIntentEventLogs:(t=fi(di().mark((function t(n,r,i,o){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/EventLogs/"+n+"/"+r+"/"+i+"/"+o,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n,r,i){return t.apply(this,arguments)})};var t,n,r,i,o,a},Di=function(e){return{getUnansweredQuestions:(r=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/UnansweredQuestions/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),getUnansweredQuestionsPaginated:(n=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/UnansweredQuestions/"+n+"/"+r+"/"+i,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),deleteUnansweredQuestion:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/UnansweredQuestion/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r},Ui=function(e){return{getContextVars:(r=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ContextVars/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return r.apply(this,arguments)}),getContextVarNames:(n=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ContextVarNames/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return n.apply(this,arguments)}),getContextVarValues:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ContextVarValues/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r},Fi=function(e){return{getCustomWords:(o=fi(di().mark((function t(n){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CustomWords/"+n,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e){return o.apply(this,arguments)}),getCustomWord:(i=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CustomWord/"+n+"/"+r,{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return i.apply(this,arguments)}),deleteCustomWord:(r=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CustomWord/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return r.apply(this,arguments)}),postCustomWord:(n=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CustomWord/"+n,{method:"POST",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,t){return n.apply(this,arguments)}),patchCustomWord:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/CustomWord/"+n+"/"+r.customWordID,{method:"PATCH",apiUrl:e,body:r}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r,i,o},zi=function(e){return{getChatLogs:(r=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ChatLogs/"+n+(r?"/"+r:"")+(r&&i?"/"+i:""),{method:"GET",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,n){return r.apply(this,arguments)}),deleteChatLogs:(n=fi(di().mark((function t(n,r,i){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ChatLogs/"+n+(r?"/"+r:"")+(r&&i?"/"+i:""),{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,t,r){return n.apply(this,arguments)}),deleteChatLog:(t=fi(di().mark((function t(n,r){return di().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",mi("/ChatLog/"+n+"/"+r,{method:"DELETE",apiUrl:e}));case 1:case"end":return t.stop()}}),t)}))),function(e,n){return t.apply(this,arguments)})};var t,n,r},ji={__proto__:null,allowedMediaTypes:["image/jpeg","image/png","image/jpg","image/gif","text/plain","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/pdf","video/mp4","video/avi","audio/mpeg3","audio/wav","audio/mpeg","video/mpeg","model/gltf-binary"],anonTag:"👤"},Hi=function(e,t){return void 0===t&&(t=!1),function(n,r){var i,o,a=hn.fromSubscription(e,"eastus");o=new(0,jr.SpeakerAudioDestination);var s=qr.fromSpeakerOutput(o);a.speechSynthesisVoiceName=function(e,t){var n="";switch(e.toUpperCase()){case"IT":n="MALE"===t?"it-IT-DiegoNeural":"it-IT-ElsaNeural";break;case"DE":n="MALE"===t?"de-DE-ConradNeural":"de-DE-KatjaNeural";break;case"EN":n="MALE"===t?"en-GB-RyanNeural":"en-GB-SoniaNeural";break;case"ES":n="MALE"===t?"es-ES-AlvaroNeural":"es-ES-ElviraNeural";break;case"FR":n="MALE"===t?"fr-FR-HenriNeural":"fr-FR-DeniseNeural";break;case"PT":n="MALE"===t?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural";break;default:n="MALE"===t?"it-IT-DiegoNeural":"it-IT-IsabellaNeural"}return n}(n,r);var l=function(e){var t="";switch(e.toUpperCase()){case"IT":default:t="it-IT";break;case"DE":t="de-DE";break;case"EN":t="en-US";break;case"ES":t="es-ES";break;case"FR":t="fr-FR";break;case"PT":t="pt-PT"}return t}(n);a.speechSynthesisLanguage=l,a.speechRecognitionLanguage=l;var c,u=function(){o&&o.pause(),i&&(i.close(),i=null)},d=qr.fromDefaultMicrophoneInput(),h=function(e){c&&(c.stopContinuousRecognitionAsync(),c.close(),c=null,e&&e())};return{speak:function(e,n){u(),i=new(0,oi.SpeechSynthesizer)(a,s),n&&(o.onAudioEnd=n),i.speakTextAsync(e,(function(n){if(n)try{t&&console.log("speak result",n),i&&(i.close(),i=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e))}else t&&console.log("speak no result",n)}),(function(t){console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e))}))},isSpeaking:function(){return!!i},stopSpeaking:u,recognize:function(e){(c=new(0,Qr.SpeechRecognizer)(a,d)).recognizing=function(e,n){t&&console.log("RECOGNIZING: Text="+n.result.text)},c.recognized=function(n,r){var i;r.result.reason===yt.RecognizedSpeech?(t&&console.log("RECOGNIZED: Text="+r.result.text),e(null!=(i=r.result.text)?i:"")):r.result.reason===yt.NoMatch&&t&&console.log("NOMATCH: Speech could not be recognized.")},c.canceled=function(e,n){t&&console.log("CANCELED: Reason="+n.reason),n.reason===Ke.Error&&t&&(console.log('"CANCELED: ErrorCode='+n.errorCode),console.log('"CANCELED: ErrorDetails='+n.errorDetails),console.log("CANCELED: Did you set the speech resource key and region values?")),h()},c.sessionStopped=function(e,n){t&&console.log("\n Session stopped event."),c&&c.stopContinuousRecognitionAsync()},c.startContinuousRecognitionAsync()},isRecognizing:function(){return!!c},stopRecognizing:h}}},Gi=function(e){return{getResourceUrl:function(t){var n=t.type,r=t.resourceURI,i=t.sessionID,o=t.baseURL,a=void 0===o?"https://app.twincreator.com":o,s="cover"===n?a+"/images/memoriCover.png":a+"/images/memoriAvatar.png";return r&&0!==r.length?r.includes("memoriai/memory")?r+"?memori-ai-session-id="+i:r.startsWith("https://")||r.startsWith("http://")?r+(i?"/"+i:""):r.startsWith("cloud://")?e.replace(/v2/,"v1")+"/CloudAsset/"+r.replace("cloud://",""):r.startsWith("guid://")?e.replace(/v2/,"v1")+"/GuidAsset/"+r.replace("guid://",""):s:s}}},Vi=function(e){var t=function(e){return e?new URL(e.startsWith("http")?e:"https://"+e).origin.replace("http://","https://"):"https://backend.memori.ai"}(e);return pi({backend:Mi(t+"/api/v2")},function(e){return pi({correlationPairs:_i(e)},_i(e),{dialog:Ai(e)},Ai(e),{importExport:Ei(e)},Ei(e),{intents:Ci(e)},Ci(e),{localizationKeys:Ti(e)},Ti(e),{media:Ii(e)},Ii(e),{memories:ki(e)},ki(e),{nlp:Ri(e)},Ri(e),{people:Oi(e)},Oi(e),{promptedQuestions:Pi(e)},Pi(e),{search:Ni(e)},Ni(e),{session:Bi(e)},Bi(e),{stats:Li(e)},Li(e),{unansweredQuestions:Di(e)},Di(e),{contextVars:Ui(e)},Ui(e),{customDictionary:Fi(e)},Fi(e),{chatLogs:zi(e)},zi(e))}(t+"/memori/v2"),{speech:Hi,constants:ji,asset:Gi(t+"/api/v2")})},Wi=(c=o("85Hg2"),o("hcaHr")),qi={},Ki=o("k9HYU");(qi=function(e,t,n){return(t=Ki(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}).__esModule=!0,qi.default=qi;c=o("85Hg2");var Ji=o("ffgrs"),Qi=o("22y1y"),Xi=(c=o("85Hg2"),/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g),Yi={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Zi=function(e){return Yi[e]};function $i(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 eo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$i(Object(r),!0).forEach((function(t){n(qi)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var to,no={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:function(e){return e.replace(Xi,Zi)}},ro=(0,c.createContext)();function io(){return no}var oo=function(){function e(){n(Ji)(this,e),this.usedNamespaces={}}return n(Qi)(e,[{key:"addUsedNamespaces",value:function(e){var t=this;e.forEach((function(e){t.usedNamespaces[e]||(t.usedNamespaces[e]=!0)}))}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function ao(){return to}var so={type:"3rdParty",init:function(e){!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};no=eo(eo({},no),e)}(e.options.react),function(e){to=e}(e)}};function lo(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]="react-i18next:: ".concat(n[0])),(e=console).warn.apply(e,n)}}var co={};function uo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];"string"==typeof t[0]&&co[t[0]]||("string"==typeof t[0]&&(co[t[0]]=new Date),lo.apply(void 0,t))}function ho(e,t,n){e.loadNamespaces(t,(function(){if(e.isInitialized)n();else{e.on("initialized",(function t(){setTimeout((function(){e.off("initialized",t)}),0),n()}))}}))}function fo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t.languages[0],i=!!t.options&&t.options.fallbackLng,o=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e))&&(!!t.hasResourceBundle(r,e)||(!(t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages))||!(!a(r,e)||i&&!a(o,e))))}function po(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t.languages||!t.languages.length)return uo("i18n.languages were undefined or empty",t.languages),!0;var r=void 0!==t.options.ignoreJSONStructure;return r?t.hasLoadedNamespace(e,{precheck:function(t,r){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):fo(e,t,n)}function mo(e){return e.displayName||e.name||("string"==typeof e&&e.length>0?e:"Unknown")}function go(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 vo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?go(Object(r),!0).forEach((function(t){n(qi)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):go(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var bo=function(e,t){var n=(0,c.useRef)();return(0,c.useEffect)((function(){n.current=t?n.current:e}),[e,t]),n.current};function yo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.i18n,i=(0,c.useContext)(ro)||{},o=i.i18n,a=i.defaultNS,s=r||o||ao();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new oo),!s){uo("You will need to pass in an i18next instance by using initReactI18next");var l=function(e){return Array.isArray(e)?e[e.length-1]:e},u=[l,{},!1];return u.t=l,u.i18n={},u.ready=!1,u}s.options.react&&void 0!==s.options.react.wait&&uo("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var d=vo(vo(vo({},io()),s.options.react),t),h=d.useSuspense,f=d.keyPrefix,p=e||a||s.options&&s.options.defaultNS;p="string"==typeof p?[p]:p||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(p);var m=(s.isInitialized||s.initializedStoreOnce)&&p.every((function(e){return po(e,s,d)}));function g(){return s.getFixedT(null,"fallback"===d.nsMode?p:p[0],f)}var v=(0,c.useState)(g),b=n(Wi)(v,2),y=b[0],w=b[1],S=p.join(),x=bo(S),M=(0,c.useRef)(!0);(0,c.useEffect)((function(){var e=d.bindI18n,t=d.bindI18nStore;function n(){M.current&&w(g)}return M.current=!0,m||h||ho(s,p,(function(){M.current&&w(g)})),m&&x&&x!==S&&M.current&&w(g),e&&s&&s.on(e,n),t&&s&&s.store.on(t,n),function(){M.current=!1,e&&s&&e.split(" ").forEach((function(e){return s.off(e,n)})),t&&s&&t.split(" ").forEach((function(e){return s.store.off(e,n)}))}}),[s,S]);var _=(0,c.useRef)(!0);(0,c.useEffect)((function(){M.current&&!_.current&&w(g),_.current=!1}),[s,f]);var A=[y,s,m];if(A.t=y,A.i18n=s,A.ready=m,m)return A;if(!m&&!h)return A;throw new Promise((function(e){ho(s,p,(function(){e()}))}))}var wo={};!function(e,t,n,r){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(t),a=i(n),s=i(r),l=function(e,t,n){return{endTime:t,insertTime:n,type:"exponentialRampToValue",value:e}},c=function(e,t,n){return{endTime:t,insertTime:n,type:"linearRampToValue",value:e}},u=function(e,t){return{startTime:t,type:"setValue",value:e}},d=function(e,t,n){return{duration:n,startTime:t,type:"setValueCurve",values:e}},h=function(e,t,n){var r=n.startTime,i=n.target,o=n.timeConstant;return i+(t-i)*Math.exp((r-e)/o)},f=function(e){return"exponentialRampToValue"===e.type},p=function(e){return"linearRampToValue"===e.type},m=function(e){return f(e)||p(e)},g=function(e){return"setValue"===e.type},v=function(e){return"setValueCurve"===e.type},b=function e(t,n,r,i){var o=t[n];return void 0===o?i:m(o)||g(o)?o.value:v(o)?o.values[o.values.length-1]:h(r,e(t,n-1,o.startTime,i),o)},y=function(e,t,n,r,i){return void 0===n?[r.insertTime,i]:m(n)?[n.endTime,n.value]:g(n)?[n.startTime,n.value]:v(n)?[n.startTime+n.duration,n.values[n.values.length-1]]:[n.startTime,b(e,t-1,n.startTime,i)]},w=function(e){return"cancelAndHold"===e.type},S=function(e){return"cancelScheduledValues"===e.type},x=function(e){return w(e)||S(e)?e.cancelTime:f(e)||p(e)?e.endTime:e.startTime},M=function(e,t,n,r){var i=r.endTime,o=r.value;return n===o?o:0<n&&0<o||n<0&&o<0?n*Math.pow(o/n,(e-t)/(i-t)):0},_=function(e,t,n,r){return n+(e-t)/(r.endTime-t)*(r.value-n)},A=function(e,t){var n=Math.floor(t),r=Math.ceil(t);return n===r?e[n]:(1-(t-n))*e[n]+(1-(r-t))*e[r]},E=function(e,t){var n=t.duration,r=t.startTime,i=t.values,o=(e-r)/n*(i.length-1);return A(i,o)},C=function(e){return"setTarget"===e.type},T=function(e){function t(e){a.default(this,t),this._automationEvents=[],this._currenTime=0,this._defaultValue=e}return s.default(t,[{key:e,value:function(){return this._automationEvents[Symbol.iterator]()}},{key:"add",value:function(e){var t=x(e);if(w(e)||S(e)){var n=this._automationEvents.findIndex((function(n){return S(e)&&v(n)?n.startTime+n.duration>=t:x(n)>=t})),r=this._automationEvents[n];if(-1!==n&&(this._automationEvents=this._automationEvents.slice(0,n)),w(e)){var i=this._automationEvents[this._automationEvents.length-1];if(void 0!==r&&m(r)){if(C(i))throw new Error("The internal list is malformed.");var o=v(i)?i.startTime+i.duration:x(i),a=v(i)?i.values[i.values.length-1]:i.value,s=f(r)?M(t,o,a,r):_(t,o,a,r),h=f(r)?l(s,t,this._currenTime):c(s,t,this._currenTime);this._automationEvents.push(h)}void 0!==i&&C(i)&&this._automationEvents.push(u(this.getValue(t),t)),void 0!==i&&v(i)&&i.startTime+i.duration>t&&(this._automationEvents[this._automationEvents.length-1]=d(new Float32Array([6,7]),i.startTime,t-i.startTime))}}else{var g=this._automationEvents.findIndex((function(e){return x(e)>t})),b=-1===g?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[g-1];if(void 0!==b&&v(b)&&x(b)+b.duration>t)return!1;var y=f(e)?l(e.value,e.endTime,this._currenTime):p(e)?c(e.value,t,this._currenTime):e;if(-1===g)this._automationEvents.push(y);else{if(v(e)&&t+e.duration>x(this._automationEvents[g]))return!1;this._automationEvents.splice(g,0,y)}}return!0}},{key:"flush",value:function(e){var t=this._automationEvents.findIndex((function(t){return x(t)>e}));if(t>1){var n=this._automationEvents.slice(t-1),r=n[0];C(r)&&n.unshift(u(b(this._automationEvents,t-2,r.startTime,this._defaultValue),r.startTime)),this._automationEvents=n}}},{key:"getValue",value:function(e){if(0===this._automationEvents.length)return this._defaultValue;var t=this._automationEvents.findIndex((function(t){return x(t)>e})),n=this._automationEvents[t],r=(-1===t?this._automationEvents.length:t)-1,i=this._automationEvents[r];if(void 0!==i&&C(i)&&(void 0===n||!m(n)||n.insertTime>e))return h(e,b(this._automationEvents,r-1,i.startTime,this._defaultValue),i);if(void 0!==i&&g(i)&&(void 0===n||!m(n)))return i.value;if(void 0!==i&&v(i)&&(void 0===n||!m(n)||i.startTime+i.duration>e))return e<i.startTime+i.duration?E(e,i):i.values[i.values.length-1];if(void 0!==i&&m(i)&&(void 0===n||!m(n)))return i.value;if(void 0!==n&&f(n)){var a=y(this._automationEvents,r,i,n,this._defaultValue),s=o.default(a,2),l=s[0],c=s[1];return M(e,l,c,n)}if(void 0!==n&&p(n)){var u=y(this._automationEvents,r,i,n,this._defaultValue),d=o.default(u,2),w=d[0],S=d[1];return _(e,w,S,n)}return this._defaultValue}}]),t}(Symbol.iterator),I=function(e){return{cancelTime:e,type:"cancelAndHold"}},k=function(e){return{cancelTime:e,type:"cancelScheduledValues"}},R=function(e,t){return{endTime:t,type:"exponentialRampToValue",value:e}},O=function(e,t){return{endTime:t,type:"linearRampToValue",value:e}},P=function(e,t,n){return{startTime:t,target:e,timeConstant:n,type:"setTarget"}};e.AutomationEventList=T,e.createCancelAndHoldAutomationEvent=I,e.createCancelScheduledValuesAutomationEvent=k,e.createExponentialRampToValueAutomationEvent=R,e.createLinearRampToValueAutomationEvent=O,e.createSetTargetAutomationEvent=P,e.createSetValueAutomationEvent=u,e.createSetValueCurveAutomationEvent=d,Object.defineProperty(e,"__esModule",{value:!0})}(wo,o("hcaHr"),o("ffgrs"),o("22y1y"));const So=new WeakSet,xo=new WeakMap,Mo=new WeakMap,_o=new WeakMap,Ao=new WeakMap,Eo=new WeakMap,Co=new WeakMap,To=new WeakMap,Io=new WeakMap,ko=new WeakMap,Ro={construct:()=>Ro},Oo=e=>{try{new new Proxy(e,Ro)}catch{return!1}return!0},Po=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,No=(e,t)=>{const n=[];let r=e.replace(/^[\s]+/,""),i=r.match(Po);for(;null!==i;){const e=i[1].slice(1,-1),o=i[0].replace(/([\s]+)?;?$/,"").replace(e,new URL(e,t).toString());n.push(o),r=r.slice(i[0].length).replace(/^[\s]+/,""),i=r.match(Po)}return[n.join(";"),r]},Bo=e=>{if(void 0!==e&&!Array.isArray(e))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},Lo=e=>{if(!Oo(e))throw new TypeError("The given value for processorCtor should be a constructor.");if(null===e.prototype||"object"!=typeof e.prototype)throw new TypeError("The given value for processorCtor should have a prototype.")},Do=(e,t)=>{const n=e.get(t);if(void 0===n)throw new Error("A value with the given key could not be found.");return n},Uo=(e,t)=>{const n=Array.from(e).filter(t);if(n.length>1)throw Error("More than one element was found.");if(0===n.length)throw Error("No element was found.");const[r]=n;return e.delete(r),r},Fo=(e,t,n,r)=>{const i=Do(e,t),o=Uo(i,(e=>e[0]===n&&e[1]===r));return 0===i.size&&e.delete(t),o},zo=e=>Do(Co,e),jo=e=>{if(So.has(e))throw new Error("The AudioNode is already stored.");So.add(e),zo(e).forEach((e=>e(!0)))},Ho=e=>"port"in e,Go=e=>{if(!So.has(e))throw new Error("The AudioNode is not stored.");So.delete(e),zo(e).forEach((e=>e(!1)))},Vo=(e,t)=>{!Ho(e)&&t.every((e=>0===e.size))&&Go(e)},Wo={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},qo=(e,t)=>e.context===t,Ko=e=>{try{e.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},Jo=()=>new DOMException("","IndexSizeError"),Qo=e=>{var t;e.getChannelData=(t=e.getChannelData,n=>{try{return t.call(e,n)}catch(e){if(12===e.code)throw Jo();throw e}})},Xo={numberOfChannels:1},Yo=-34028234663852886e22,Zo=34028234663852886e22,$o=e=>So.has(e),ea={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},ta=e=>"playbackRate"in e,na=e=>"frequency"in e&&"gain"in e,ra=e=>"offset"in e,ia=e=>!("frequency"in e)&&"gain"in e,oa=e=>"detune"in e&&"frequency"in e,aa=e=>"pan"in e,sa=e=>Do(xo,e),la=e=>Do(_o,e),ca=(e,t)=>{const{activeInputs:n}=sa(e);n.forEach((n=>n.forEach((([n])=>{t.includes(e)||ca(n,[...t,e])}))));const r=ta(e)?[e.playbackRate]:Ho(e)?Array.from(e.parameters.values()):na(e)?[e.Q,e.detune,e.frequency,e.gain]:ra(e)?[e.offset]:ia(e)?[e.gain]:oa(e)?[e.detune,e.frequency]:aa(e)?[e.pan]:[];for(const e of r){const n=la(e);void 0!==n&&n.activeInputs.forEach((([e])=>ca(e,t)))}$o(e)&&Go(e)},ua=e=>{ca(e.destination,[])},da=e=>void 0===e||"number"==typeof e||"string"==typeof e&&("balanced"===e||"interactive"===e||"playback"===e),ha=e=>"context"in e,fa=e=>ha(e[0]),pa=(e,t,n,r)=>{for(const t of e)if(n(t)){if(r)return!1;throw Error("The set contains at least one similar element.")}return e.add(t),!0},ma=(e,t,[n,r],i)=>{pa(e,[t,n,r],(e=>e[0]===t&&e[1]===n),i)},ga=(e,[t,n,r],i)=>{const o=e.get(t);void 0===o?e.set(t,new Set([[n,r]])):pa(o,[n,r],(e=>e[0]===n),i)},va=e=>"inputs"in e,ba=(e,t,n,r)=>{if(va(t)){const i=t.inputs[r];return e.connect(i,n,0),[i,n,0]}return e.connect(t,n,r),[t,n,r]},ya=(e,t,n)=>{for(const r of e)if(r[0]===t&&r[1]===n)return e.delete(r),r;return null},wa=(e,t,n)=>Uo(e,(e=>e[0]===t&&e[1]===n)),Sa=(e,t)=>{if(!zo(e).delete(t))throw new Error("Missing the expected event listener.")},xa=(e,t,n)=>{const r=Do(e,t),i=Uo(r,(e=>e[0]===n));return 0===r.size&&e.delete(t),i},Ma=(e,t,n,r)=>{va(t)?e.disconnect(t.inputs[r],n,0):e.disconnect(t,n,r)},_a=e=>Do(Mo,e),Aa=e=>Do(Ao,e),Ea=e=>To.has(e),Ca=e=>!So.has(e),Ta=(e,t)=>new Promise((n=>{if(null!==t)n(!0);else{const t=e.createScriptProcessor(256,1,1),r=e.createGain(),i=e.createBuffer(1,2,44100),o=i.getChannelData(0);o[0]=1,o[1]=1;const a=e.createBufferSource();a.buffer=i,a.loop=!0,a.connect(t).connect(e.destination),a.connect(r),a.disconnect(r),t.onaudioprocess=r=>{const i=r.inputBuffer.getChannelData(0);Array.prototype.some.call(i,(e=>1===e))?n(!0):n(!1),a.stop(),t.onaudioprocess=null,a.disconnect(t),t.disconnect(e.destination)},a.start()}})),Ia=(e,t)=>{const n=new Map;for(const t of e)for(const e of t){const t=n.get(e);n.set(e,void 0===t?1:t+1)}n.forEach(((e,n)=>t(n,e)))},ka=e=>"context"in e,Ra=e=>{const t=new Map;var n,r;e.connect=(n=e.connect.bind(e),(e,r=0,i=0)=>{const o=ka(e)?n(e,r,i):n(e,r),a=t.get(e);return void 0===a?t.set(e,[{input:i,output:r}]):a.every((e=>e.input!==i||e.output!==r))&&a.push({input:i,output:r}),o}),e.disconnect=(r=e.disconnect,(n,i,o)=>{if(r.apply(e),void 0===n)t.clear();else if("number"==typeof n)for(const[e,r]of t){const i=r.filter((e=>e.output!==n));0===i.length?t.delete(e):t.set(e,i)}else if(t.has(n))if(void 0===i)t.delete(n);else{const e=t.get(n);if(void 0!==e){const r=e.filter((e=>e.output!==i&&(e.input!==o||void 0===o)));0===r.length?t.delete(n):t.set(n,r)}}for(const[n,r]of t)r.forEach((t=>{ka(n)?e.connect(n,t.output,t.input):e.connect(n,t.output)}))})},Oa=(e,t,n,r)=>{const{activeInputs:i,passiveInputs:o}=la(t),{outputs:a}=sa(e),s=zo(e),l=a=>{const s=_a(e),l=Aa(t);if(a){const t=xa(o,e,n);ma(i,e,t,!1),r||Ea(e)||s.connect(l,n)}else{const t=wa(i,e,n);ga(o,t,!1),r||Ea(e)||s.disconnect(l,n)}};return!!pa(a,[t,n],(e=>e[0]===t&&e[1]===n),!0)&&(s.add(l),$o(e)?ma(i,e,[n,l],!0):ga(o,[e,n,l],!0),!0)},Pa=(e,t,n,r,i)=>{const[o,a]=((e,t,n,r)=>{const{activeInputs:i,passiveInputs:o}=sa(t),a=ya(i[r],e,n);if(null===a)return[Fo(o,e,n,r)[2],!1];return[a[2],!0]})(e,n,r,i);if(null!==o&&(Sa(e,o),!a||t||Ea(e)||Ma(_a(e),_a(n),r,i)),$o(n)){const{activeInputs:e}=sa(n);Vo(n,e)}},Na=(e,t,n,r)=>{const[i,o]=((e,t,n)=>{const{activeInputs:r,passiveInputs:i}=la(t),o=ya(r,e,n);if(null===o)return[xa(i,e,n)[1],!1];return[o[2],!0]})(e,n,r);null!==i&&(Sa(e,i),!o||t||Ea(e)||_a(e).disconnect(Aa(n),r))};class Ba{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach(((n,r)=>e.call(t,n,r,this)))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}}const La={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}};function Da(e,t,n,r,i){if("function"==typeof e.copyFromChannel)0===t[n].byteLength&&(t[n]=new Float32Array(128)),e.copyFromChannel(t[n],r,i);else{const o=e.getChannelData(r);if(0===t[n].byteLength)t[n]=o.slice(i,i+128);else{const e=new Float32Array(o.buffer,i*Float32Array.BYTES_PER_ELEMENT,128);t[n].set(e)}}}const Ua=(e,t,n,r,i)=>{"function"==typeof e.copyToChannel?0!==t[n].byteLength&&e.copyToChannel(t[n],r,i):0!==t[n].byteLength&&e.getChannelData(r).set(t[n],i)},Fa=(e,t)=>{const n=[];for(let r=0;r<e;r+=1){const e=[],i="number"==typeof t?t:t[r];for(let t=0;t<i;t+=1)e.push(new Float32Array(128));n.push(e)}return n},za=(e,t)=>{const n=Do(ko,e),r=_a(t);return Do(n,r)},ja=async(e,t,n,r,i,o,a)=>{const s=null===t?128*Math.ceil(e.context.length/128):t.length,l=r.channelCount*r.numberOfInputs,c=i.reduce(((e,t)=>e+t),0),u=0===c?null:n.createBuffer(c,s,n.sampleRate);if(void 0===o)throw new Error("Missing the processor constructor.");const d=sa(e),h=await za(n,e),f=Fa(r.numberOfInputs,r.channelCount),p=Fa(r.numberOfOutputs,i),m=Array.from(e.parameters.keys()).reduce(((e,t)=>({...e,[t]:new Float32Array(128)})),{});for(let c=0;c<s;c+=128){if(r.numberOfInputs>0&&null!==t)for(let e=0;e<r.numberOfInputs;e+=1)for(let n=0;n<r.channelCount;n+=1)Da(t,f[e],n,n,c);void 0!==o.parameterDescriptors&&null!==t&&o.parameterDescriptors.forEach((({name:e},n)=>{Da(t,m,e,l+n,c)}));for(let e=0;e<r.numberOfInputs;e+=1)for(let t=0;t<i[e];t+=1)0===p[e][t].byteLength&&(p[e][t]=new Float32Array(128));try{const e=f.map(((e,t)=>0===d.activeInputs[t].size?[]:e)),t=a(c/n.sampleRate,n.sampleRate,(()=>h.process(e,p,m)));if(null!==u)for(let e=0,t=0;e<r.numberOfOutputs;e+=1){for(let n=0;n<i[e];n+=1)Ua(u,p[e],n,t+n,c);t+=i[e]}if(!t)break}catch(t){e.dispatchEvent(new ErrorEvent("processorerror",{colno:t.colno,filename:t.filename,lineno:t.lineno,message:t.message}));break}}return u},Ha={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},Ga={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},Va={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},Wa={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},qa={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},Ka=e=>{const{port1:t,port2:n}=new MessageChannel;return new Promise((r=>{const i=()=>{n.onmessage=null,t.close(),n.close(),r()};n.onmessage=()=>i();try{t.postMessage(e,[e])}finally{i()}}))},Ja={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},Qa=e=>"delayTime"in e,Xa=(e,t,n)=>{const r=t[n];if(void 0===r)throw e();return r},Ya={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},Za={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},$a=()=>new DOMException("","InvalidStateError"),es=()=>new DOMException("","InvalidAccessError"),ts=e=>{var t;e.getFrequencyResponse=(t=e.getFrequencyResponse,(n,r,i)=>{if(n.length!==r.length||r.length!==i.length)throw es();return t.call(e,n,r,i)})},ns={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},rs=(e,t,n,r,i,o,a,s,l,c,u)=>{const d=c.length;let h=s;for(let s=0;s<d;s+=1){let d=n[0]*c[s];for(let t=1;t<i;t+=1){const r=h-t&l-1;d+=n[t]*o[r],d-=e[t]*a[r]}for(let e=i;e<r;e+=1)d+=n[e]*o[h-e&l-1];for(let n=i;n<t;n+=1)d-=e[n]*a[h-n&l-1];o[h]=c[s],a[h]=d,h=h+1&l-1,u[s]=d}return h},is={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},os=e=>{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const n=e.decodeAudioData(t.buffer,(()=>{}));return void 0!==n&&(n.catch((()=>{})),!0)}catch{}return!1},as={numberOfChannels:1},ss=(e,t,n)=>{const r=t[n];void 0!==r&&r!==e[n]&&(e[n]=r)},ls=(e,t)=>{ss(e,t,"channelCount"),ss(e,t,"channelCountMode"),ss(e,t,"channelInterpretation")},cs=e=>"function"==typeof e.getFloatTimeDomainData,us=(e,t,n)=>{const r=t[n];void 0!==r&&r!==e[n].value&&(e[n].value=r)},ds=e=>{e.start=(t=>{let n=!1;return(r=0,i=0,o)=>{if(n)throw $a();t.call(e,r,i,o),n=!0}})(e.start)},hs=e=>{var t;e.start=(t=e.start,(n=0,r=0,i)=>{if("number"==typeof i&&i<0||r<0||n<0)throw new RangeError("The parameters can't be negative.");t.call(e,n,r,i)})},fs=e=>{var t;e.stop=(t=e.stop,(n=0)=>{if(n<0)throw new RangeError("The parameter can't be negative.");t.call(e,n)})},ps=e=>{const{port1:t}=new MessageChannel;try{t.postMessage(e)}finally{t.close()}},ms=(e,t)=>null===e?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(e*t))))),gs=e=>new Promise(((t,n)=>{const{port1:r,port2:i}=new MessageChannel;r.onmessage=({data:e})=>{r.close(),i.close(),t(e)},r.onmessageerror=({data:e})=>{r.close(),i.close(),n(e)},i.postMessage(e)})),vs=async(e,t)=>new e(await gs(t)),bs=(e,t,n,r)=>{let i=ko.get(e);void 0===i&&(i=new WeakMap,ko.set(e,i));const o=vs(n,r);return i.set(t,o),o},ys=(e,t)=>{const n=e.createBiquadFilter();return ls(n,t),us(n,t,"Q"),us(n,t,"detune"),us(n,t,"frequency"),us(n,t,"gain"),ss(n,t,"type"),n},ws=e=>{const t=e.numberOfOutputs;Object.defineProperty(e,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw $a()}}),Object.defineProperty(e,"channelCountMode",{get:()=>"explicit",set:e=>{if("explicit"!==e)throw $a()}}),Object.defineProperty(e,"channelInterpretation",{get:()=>"discrete",set:e=>{if("discrete"!==e)throw $a()}})},Ss=(e,t)=>{const n=e.createChannelSplitter(t.numberOfOutputs);return ls(n,t),ws(n),n},xs=(e,t)=>(e.connect=t.connect.bind(t),e.disconnect=t.disconnect.bind(t),e),Ms=(e,t)=>{const n=e.createDelay(t.maxDelayTime);return ls(n,t),us(n,t,"delayTime"),n},_s=(e,t)=>{const n=e.createGain();return ls(n,t),us(n,t,"gain"),n};function As(e,t){const n=t[0]*t[0]+t[1]*t[1];return[(e[0]*t[0]+e[1]*t[1])/n,(e[1]*t[0]-e[0]*t[1])/n]}function Es(e,t){let n=[0,0];for(let o=e.length-1;o>=0;o-=1)i=t,n=[(r=n)[0]*i[0]-r[1]*i[1],r[0]*i[1]+r[1]*i[0]],n[0]+=e[o];var r,i;return n}const Cs=(e,t,n,r)=>e.createScriptProcessor(t,n,r),Ts=()=>new DOMException("","NotSupportedError"),Is={numberOfChannels:1},ks={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},Rs={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},Os={disableNormalization:!1},Ps={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},Ns=()=>new DOMException("","UnknownError"),Bs={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},Ls=(e,t,n)=>void 0===e.copyFromChannel?e.getChannelData(n)[0]:(e.copyFromChannel(t,n),t[0]),Ds=e=>{if(null===e)return!1;const t=e.length;return t%2!=0?0!==e[Math.floor(t/2)]:e[t/2-1]+e[t/2]!==0},Us=(e,t,n,r)=>{let i=e;for(;!i.hasOwnProperty(t);)i=Object.getPrototypeOf(i);const{get:o,set:a}=Object.getOwnPropertyDescriptor(i,t);Object.defineProperty(e,t,{get:n(o),set:r(a)})},Fs=(e,t,n)=>{try{e.setValueAtTime(t,n)}catch(r){if(9!==r.code)throw r;Fs(e,t,n+1e-7)}},zs=e=>{const t=e.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},js=e=>{const t=e.createBuffer(1,1,44100),n=e.createBufferSource();n.buffer=t,n.start(),n.stop();try{return n.stop(),!0}catch{return!1}},Hs=e=>{const t=e.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},Gs=(e,t)=>{const n=t.createGain();e.connect(n);const r=(i=e.disconnect,()=>{i.call(e,n),e.removeEventListener("ended",r)});var i;e.addEventListener("ended",r),xs(e,n),e.stop=(t=>{let r=!1;return(i=0)=>{if(r)try{t.call(e,i)}catch{n.gain.setValueAtTime(0,i)}else t.call(e,i),r=!0}})(e.stop)},Vs=(e,t)=>n=>{const r={value:e};return Object.defineProperties(n,{currentTarget:r,target:r}),"function"==typeof t?t.call(e,n):t.handleEvent.call(e,n)},Ws=(qs=pa,(e,t,[n,r,i],o)=>{qs(e[r],[t,n,i],(e=>e[0]===t&&e[1]===n),o)});var qs;const Ks=(e=>(t,n,[r,i,o],a)=>{const s=t.get(r);void 0===s?t.set(r,new Set([[i,n,o]])):e(s,[i,n,o],(e=>e[0]===i&&e[1]===n),a)})(pa),Js=(Qs=Uo,(e,t,n,r)=>Qs(e[r],(e=>e[0]===t&&e[1]===n)));var Qs;const Xs=new WeakMap,Ys=(Zs=Xs,e=>{var t;return null!==(t=Zs.get(e))&&void 0!==t?t:0});var Zs;const $s=(el=new Map,tl=new WeakMap,(e,t)=>{const n=tl.get(e);if(void 0!==n)return n;const r=el.get(e);if(void 0!==r)return r;try{const n=t();return n instanceof Promise?(el.set(e,n),n.catch((()=>!1)).then((t=>(el.delete(e),tl.set(e,t),t)))):(tl.set(e,n),n)}catch{return tl.set(e,!1),!1}});var el,tl;const nl="undefined"==typeof window?null:window,rl=(il=$s,ol=Jo,(e,t)=>{const n=e.createAnalyser();if(ls(n,t),!(t.maxDecibels>t.minDecibels))throw ol();return ss(n,t,"fftSize"),ss(n,t,"maxDecibels"),ss(n,t,"minDecibels"),ss(n,t,"smoothingTimeConstant"),il(cs,(()=>cs(n)))||(e=>{e.getFloatTimeDomainData=t=>{const n=new Uint8Array(t.length);e.getByteTimeDomainData(n);const r=Math.max(n.length,e.fftSize);for(let e=0;e<r;e+=1)t[e]=.0078125*(n[e]-128);return t}})(n),n});var il,ol;const al=(sl=sa,e=>{const t=sl(e);if(null===t.renderer)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return t.renderer});var sl;const ll=((e,t,n)=>async(r,i,o)=>{const a=e(r);await Promise.all(a.activeInputs.map(((e,a)=>Array.from(e).map((async([e,s])=>{const l=t(e),c=await l.render(e,i),u=r.context.destination;n(e)||r===u&&n(r)||c.connect(o,s,a)})))).reduce(((e,t)=>[...e,...t]),[]))})(sa,al,Ea),cl=(ul=rl,dl=_a,hl=ll,()=>{const e=new WeakMap;return{render(t,n){const r=e.get(n);return void 0!==r?Promise.resolve(r):(async(t,n)=>{let r=dl(t);if(!qo(r,n)){const e={channelCount:r.channelCount,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,fftSize:r.fftSize,maxDecibels:r.maxDecibels,minDecibels:r.minDecibels,smoothingTimeConstant:r.smoothingTimeConstant};r=ul(n,e)}return e.set(n,r),await hl(t,n,r),r})(t,n)}}});var ul,dl,hl;const fl=(pl=Eo,e=>{const t=pl.get(e);if(void 0===t)throw $a();return t});var pl;const ml=(e=>null===e?null:e.hasOwnProperty("OfflineAudioContext")?e.OfflineAudioContext:e.hasOwnProperty("webkitOfflineAudioContext")?e.webkitOfflineAudioContext:null)(nl),gl=(vl=ml,e=>null!==vl&&e instanceof vl);var vl;const bl=new WeakMap,yl=(wl=Vs,class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(e,t,n){if(null!==t){let r=this._listeners.get(t);void 0===r&&(r=wl(this,t),"function"==typeof t&&this._listeners.set(t,r)),this._nativeEventTarget.addEventListener(e,r,n)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,t,n){const r=null===t?void 0:this._listeners.get(t);this._nativeEventTarget.removeEventListener(e,void 0===r?null:r,n)}});var wl;const Sl=(e=>null===e?null:e.hasOwnProperty("AudioContext")?e.AudioContext:e.hasOwnProperty("webkitAudioContext")?e.webkitAudioContext:null)(nl),xl=(Ml=Sl,e=>null!==Ml&&e instanceof Ml);var Ml;const _l=(e=>t=>null!==e&&"function"==typeof e.AudioNode&&t instanceof e.AudioNode)(nl),Al=(e=>t=>null!==e&&"function"==typeof e.AudioParam&&t instanceof e.AudioParam)(nl),El=(e=>null===e?null:e.hasOwnProperty("AudioWorkletNode")?e.AudioWorkletNode:null)(nl),Cl=((e,t,n,r,i,o,a,s,l,c,u,d,h,f,p,m)=>class extends c{constructor(t,r,i,o){super(i),this._context=t,this._nativeAudioNode=i;const a=u(t);d(a)&&!0!==n(Ta,(()=>Ta(a,m)))&&Ra(i),Mo.set(this,i),Co.set(this,new Set),"closed"!==t.state&&r&&jo(this),e(this,o,i)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(e){this._nativeAudioNode.channelCount=e}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(e){this._nativeAudioNode.channelCountMode=e}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(e){this._nativeAudioNode.channelInterpretation=e}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(e,n=0,s=0){if(n<0||n>=this._nativeAudioNode.numberOfOutputs)throw i();const c=u(this._context),d=p(c);if(h(e)||f(e))throw o();if(ha(e)){const i=_a(e);try{const t=ba(this._nativeAudioNode,i,n,s),r=Ca(this);(d||r)&&this._nativeAudioNode.disconnect(...t),"closed"!==this.context.state&&!r&&Ca(e)&&jo(e)}catch(e){if(12===e.code)throw o();throw e}if(t(this,e,n,s,d)){const t=l([this],e);Ia(t,r(d))}return e}const m=Aa(e);if("playbackRate"===m.name&&1024===m.maxValue)throw a();try{this._nativeAudioNode.connect(m,n),(d||Ca(this))&&this._nativeAudioNode.disconnect(m,n)}catch(e){if(12===e.code)throw o();throw e}if(Oa(this,e,n,d)){const t=l([this],e);Ia(t,r(d))}}disconnect(e,t,n){let r;const a=u(this._context),c=p(a);if(void 0===e)r=((e,t)=>{const n=sa(e),r=[];for(const i of n.outputs)fa(i)?Pa(e,t,...i):Na(e,t,...i),r.push(i[0]);return n.outputs.clear(),r})(this,c);else if("number"==typeof e){if(e<0||e>=this.numberOfOutputs)throw i();r=((e,t,n)=>{const r=sa(e),i=[];for(const o of r.outputs)o[1]===n&&(fa(o)?Pa(e,t,...o):Na(e,t,...o),i.push(o[0]),r.outputs.delete(o));return i})(this,c,e)}else{if(void 0!==t&&(t<0||t>=this.numberOfOutputs))throw i();if(ha(e)&&void 0!==n&&(n<0||n>=e.numberOfInputs))throw i();if(r=((e,t,n,r,i)=>{const o=sa(e);return Array.from(o.outputs).filter((e=>!(e[0]!==n||void 0!==r&&e[1]!==r||void 0!==i&&e[2]!==i))).map((n=>(fa(n)?Pa(e,t,...n):Na(e,t,...n),o.outputs.delete(n),n[0])))})(this,c,e,t,n),0===r.length)throw o()}for(const e of r){const t=l([this],e);Ia(t,s)}}})((Tl=xo,(e,t,n)=>{const r=[];for(let e=0;e<n.numberOfInputs;e+=1)r.push(new Set);Tl.set(e,{activeInputs:r,outputs:new Set,passiveInputs:new WeakMap,renderer:t})}),((e,t,n,r,i,o,a,s,l,c,u,d,h)=>{const f=new WeakMap;return(p,m,g,v,b)=>{const{activeInputs:y,passiveInputs:w}=o(m),{outputs:S}=o(p),x=s(p),M=o=>{const s=l(m),c=l(p);if(o){const t=Fo(w,p,g,v);e(y,p,t,!1),b||d(p)||n(c,s,g,v),h(m)&&jo(m)}else{const e=r(y,p,g,v);t(w,v,e,!1),b||d(p)||i(c,s,g,v);const n=a(m);if(0===n)u(m)&&Vo(m,y);else{const e=f.get(m);void 0!==e&&clearTimeout(e),f.set(m,setTimeout((()=>{u(m)&&Vo(m,y)}),1e3*n))}}};return!!c(S,[m,g,v],(e=>e[0]===m&&e[1]===g&&e[2]===v),!0)&&(x.add(M),u(p)?e(y,p,[g,v,M],!0):t(w,v,[p,g,M],!0),!0)}})(Ws,Ks,ba,Js,Ma,sa,Ys,zo,_a,pa,$o,Ea,Ca),$s,((e,t,n,r,i,o)=>a=>(s,l)=>{const c=e.get(s);if(void 0===c){if(!a&&o(s)){const e=r(s),{outputs:o}=n(s);for(const n of o)if(fa(n)){const i=r(n[0]);t(e,i,n[1],n[2])}else{const t=i(n[0]);e.disconnect(t,n[1])}}e.set(s,l)}else e.set(s,c+l)})(To,Ma,sa,_a,Aa,$o),Jo,es,Ts,((e,t,n,r,i,o,a,s)=>(l,c)=>{const u=t.get(l);if(void 0===u)throw new Error("Missing the expected cycle count.");const d=o(l.context),h=s(d);if(u===c){if(t.delete(l),!h&&a(l)){const t=r(l),{outputs:o}=n(l);for(const n of o)if(fa(n)){const i=r(n[0]);e(t,i,n[1],n[2])}else{const e=i(n[0]);t.connect(e,n[1])}}}else t.set(l,u-c)})(ba,To,sa,_a,Aa,fl,$o,gl),((e,t,n)=>function r(i,o){const a=ha(o)?o:n(e,o);if(Qa(a))return[];if(i[0]===a)return[i];if(i.includes(a))return[];const{outputs:s}=t(a);return Array.from(s).map((e=>r([...i,a],e[0]))).reduce(((e,t)=>e.concat(t)),[])})(bl,sa,Do),yl,fl,xl,_l,Al,gl,El);var Tl;const Il=((e,t,n,r,i,o)=>class extends e{constructor(e,n){const a=i(e),s={...Wo,...n},l=r(a,s);super(e,!1,l,o(a)?t():null),this._nativeAnalyserNode=l}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(e){this._nativeAnalyserNode.fftSize=e}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(e){const t=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=e,!(e>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=t,n()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(e){const t=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=e,!(this._nativeAnalyserNode.maxDecibels>e))throw this._nativeAnalyserNode.minDecibels=t,n()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(e){this._nativeAnalyserNode.smoothingTimeConstant=e}getByteFrequencyData(e){this._nativeAnalyserNode.getByteFrequencyData(e)}getByteTimeDomainData(e){this._nativeAnalyserNode.getByteTimeDomainData(e)}getFloatFrequencyData(e){this._nativeAnalyserNode.getFloatFrequencyData(e)}getFloatTimeDomainData(e){this._nativeAnalyserNode.getFloatTimeDomainData(e)}})(Cl,cl,Jo,rl,fl,gl),kl=new WeakSet,Rl=(e=>null===e?null:e.hasOwnProperty("AudioBuffer")?e.AudioBuffer:null)(nl),Ol=(Pl=new Uint32Array(1),e=>(Pl[0]=e,Pl[0]));var Pl;const Nl=((e,t)=>n=>{n.copyFromChannel=(r,i,o=0)=>{const a=e(o),s=e(i);if(s>=n.numberOfChannels)throw t();const l=n.length,c=n.getChannelData(s),u=r.length;for(let e=a<0?-a:0;e+a<l&&e<u;e+=1)r[e]=c[e+a]},n.copyToChannel=(r,i,o=0)=>{const a=e(o),s=e(i);if(s>=n.numberOfChannels)throw t();const l=n.length,c=n.getChannelData(s),u=r.length;for(let e=a<0?-a:0;e+a<l&&e<u;e+=1)c[e+a]=r[e]}})(Ol,Jo),Bl=(Ll=Ol,e=>{var t,n;e.copyFromChannel=(t=e.copyFromChannel,(n,r,i=0)=>{const o=Ll(i),a=Ll(r);if(o<e.length)return t.call(e,n,a,o)}),e.copyToChannel=(n=e.copyToChannel,(t,r,i=0)=>{const o=Ll(i),a=Ll(r);if(o<e.length)return n.call(e,t,a,o)})});var Ll;const Dl=((e,t,n,r,i,o,a,s)=>{let l=null;return class c{constructor(c){if(null===i)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:u,numberOfChannels:d,sampleRate:h}={...Xo,...c};null===l&&(l=new i(1,1,44100));const f=null!==r&&t(o,o)?new r({length:u,numberOfChannels:d,sampleRate:h}):l.createBuffer(d,u,h);if(0===f.numberOfChannels)throw n();return"function"!=typeof f.copyFromChannel?(a(f),Qo(f)):t(Ko,(()=>Ko(f)))||s(f),e.add(f),f}static[Symbol.hasInstance](t){return null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===c.prototype||e.has(t)}}})(kl,$s,Ts,Rl,ml,(Ul=Rl,()=>{if(null===Ul)return!1;try{new Ul({length:1,sampleRate:44100})}catch{return!1}return!0}),Nl,Bl);var Ul;const Fl=(zl=_s,(e,t)=>{const n=zl(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(n).connect(e.destination);const r=()=>{t.removeEventListener("ended",r),t.disconnect(n),n.disconnect()};t.addEventListener("ended",r)});var zl;const jl=(Hl=al,Gl=la,Vl=Ea,async(e,t,n)=>{const r=Gl(e);await Promise.all(Array.from(r.activeInputs).map((async([e,r])=>{const i=Hl(e),o=await i.render(e,t);Vl(e)||o.connect(n,r)})))});var Hl,Gl,Vl;const Wl=(ql=jl,(e,t,n)=>ql(t,e,n));var ql;const Kl=((e,t,n,r,i,o,a,s,l,c,u)=>(d,h)=>{const f=d.createBufferSource();return ls(f,h),us(f,h,"playbackRate"),ss(f,h,"buffer"),ss(f,h,"loop"),ss(f,h,"loopEnd"),ss(f,h,"loopStart"),t(n,(()=>n(d)))||ds(f),t(r,(()=>r(d)))||l(f),t(i,(()=>i(d)))||c(f,d),t(o,(()=>o(d)))||hs(f),t(a,(()=>a(d)))||u(f,d),t(s,(()=>s(d)))||fs(f),e(d,f),f})(Fl,$s,(e=>{const t=e.createBufferSource();t.start();try{t.start()}catch{return!0}return!1}),(e=>{const t=e.createBufferSource(),n=e.createBuffer(1,1,44100);t.buffer=n;try{t.start(0,1)}catch{return!1}return!0}),(e=>{const t=e.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0}),zs,js,Hs,(e=>{var t;e.start=(t=e.start,(n=0,r=0,i)=>{const o=e.buffer,a=null===o?r:Math.min(o.duration,r);null!==o&&a>o.duration-.5/e.context.sampleRate?t.call(e,n,0,0):t.call(e,n,a,i)})}),(Jl=Us,(e,t)=>{const n=t.createBuffer(1,1,44100);null===e.buffer&&(e.buffer=n),Jl(e,"buffer",(t=>()=>{const r=t.call(e);return r===n?null:r}),(t=>r=>t.call(e,null===r?n:r)))}),Gs);var Jl;const Ql=((e,t)=>(n,r,i)=>(e(r).replay(i),t(r,n,i)))((e=>t=>{const n=e(t);if(null===n.renderer)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return n.renderer})(la),jl),Xl=((e,t,n,r,i)=>()=>{const o=new WeakMap;let a=null,s=null;return{set start(e){a=e},set stop(e){s=e},render(l,c){const u=o.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=n(l);const d=qo(u,c);if(!d){const e={buffer:u.buffer,channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,loop:u.loop,loopEnd:u.loopEnd,loopStart:u.loopStart,playbackRate:u.playbackRate.value};u=t(c,e),null!==a&&u.start(...a),null!==s&&u.stop(s)}return o.set(c,u),d?await e(c,l.playbackRate,u.playbackRate):await r(c,l.playbackRate,u.playbackRate),await i(l,c,u),u})(l,c)}}})(Wl,Kl,_a,Ql,ll),Yl=((e,t,n,r,i,o,a,s,l,c,u,d,h)=>(f,p,m,g=null,v=null)=>{const b=new(0,wo.AutomationEventList)(m.defaultValue),y=p?r(b):null,w={get defaultValue(){return m.defaultValue},get maxValue(){return null===g?m.maxValue:g},get minValue(){return null===v?m.minValue:v},get value(){return m.value},set value(e){m.value=e,w.setValueAtTime(e,f.context.currentTime)},cancelAndHoldAtTime(e){if("function"==typeof m.cancelAndHoldAtTime)null===y&&b.flush(f.context.currentTime),b.add(i(e)),m.cancelAndHoldAtTime(e);else{const t=Array.from(b).pop();null===y&&b.flush(f.context.currentTime),b.add(i(e));const n=Array.from(b).pop();m.cancelScheduledValues(e),t!==n&&void 0!==n&&("exponentialRampToValue"===n.type?m.exponentialRampToValueAtTime(n.value,n.endTime):"linearRampToValue"===n.type?m.linearRampToValueAtTime(n.value,n.endTime):"setValue"===n.type?m.setValueAtTime(n.value,n.startTime):"setValueCurve"===n.type&&m.setValueCurveAtTime(n.values,n.startTime,n.duration))}return w},cancelScheduledValues:e=>(null===y&&b.flush(f.context.currentTime),b.add(o(e)),m.cancelScheduledValues(e),w),exponentialRampToValueAtTime(e,t){if(0===e)throw new RangeError;if(!Number.isFinite(t)||t<0)throw new RangeError;return null===y&&b.flush(f.context.currentTime),b.add(a(e,t)),m.exponentialRampToValueAtTime(e,t),w},linearRampToValueAtTime:(e,t)=>(null===y&&b.flush(f.context.currentTime),b.add(s(e,t)),m.linearRampToValueAtTime(e,t),w),setTargetAtTime:(e,t,n)=>(null===y&&b.flush(f.context.currentTime),b.add(l(e,t,n)),m.setTargetAtTime(e,t,n),w),setValueAtTime:(e,t)=>(null===y&&b.flush(f.context.currentTime),b.add(c(e,t)),m.setValueAtTime(e,t),w),setValueCurveAtTime(e,t,n){const r=e instanceof Float32Array?e:new Float32Array(e);if(null!==d&&"webkitAudioContext"===d.name){const e=t+n,i=f.context.sampleRate,o=Math.ceil(t*i),a=Math.floor(e*i),s=a-o,l=new Float32Array(s);for(let e=0;e<s;e+=1){const a=(r.length-1)/n*((o+e)/i-t),s=Math.floor(a),c=Math.ceil(a);l[e]=s===c?r[s]:(1-(a-s))*r[s]+(1-(c-a))*r[c]}null===y&&b.flush(f.context.currentTime),b.add(u(l,t,n)),m.setValueCurveAtTime(l,t,n);const c=a/i;c<e&&h(w,l[l.length-1],c),h(w,r[r.length-1],e)}else null===y&&b.flush(f.context.currentTime),b.add(u(r,t,n)),m.setValueCurveAtTime(r,t,n);return w}};return n.set(w,m),t.set(w,f),e(w,y),w})((Zl=_o,(e,t)=>{Zl.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:t})}),bl,Ao,(e=>({replay(t){for(const n of e)if("exponentialRampToValue"===n.type){const{endTime:e,value:r}=n;t.exponentialRampToValueAtTime(r,e)}else if("linearRampToValue"===n.type){const{endTime:e,value:r}=n;t.linearRampToValueAtTime(r,e)}else if("setTarget"===n.type){const{startTime:e,target:r,timeConstant:i}=n;t.setTargetAtTime(r,e,i)}else if("setValue"===n.type){const{startTime:e,value:r}=n;t.setValueAtTime(r,e)}else{if("setValueCurve"!==n.type)throw new Error("Can't apply an unknown automation.");{const{duration:e,startTime:r,values:i}=n;t.setValueCurveAtTime(i,r,e)}}}})),wo.createCancelAndHoldAutomationEvent,wo.createCancelScheduledValuesAutomationEvent,wo.createExponentialRampToValueAutomationEvent,wo.createLinearRampToValueAutomationEvent,wo.createSetTargetAutomationEvent,wo.createSetValueAutomationEvent,wo.createSetValueCurveAutomationEvent,Sl,Fs);var Zl;const $l=((e,t,n,r,i,o,a,s)=>class extends e{constructor(e,r){const s=o(e),l={...ea,...r},c=i(s,l),u=a(s),d=u?t():null;super(e,!1,c,d),this._audioBufferSourceNodeRenderer=d,this._isBufferNullified=!1,this._isBufferSet=null!==l.buffer,this._nativeAudioBufferSourceNode=c,this._onended=null,this._playbackRate=n(this,u,c.playbackRate,Zo,Yo)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(e){if(this._nativeAudioBufferSourceNode.buffer=e,null!==e){if(this._isBufferSet)throw r();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(e){this._nativeAudioBufferSourceNode.loop=e}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(e){this._nativeAudioBufferSourceNode.loopEnd=e}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(e){this._nativeAudioBufferSourceNode.loopStart=e}get onended(){return this._onended}set onended(e){const t="function"==typeof e?s(this,e):null;this._nativeAudioBufferSourceNode.onended=t;const n=this._nativeAudioBufferSourceNode.onended;this._onended=null!==n&&n===t?e:n}get playbackRate(){return this._playbackRate}start(e=0,t=0,n){if(this._nativeAudioBufferSourceNode.start(e,t,n),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.start=void 0===n?[e,t]:[e,t,n]),"closed"!==this.context.state){jo(this);const e=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",e),$o(this)&&Go(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeAudioBufferSourceNode.stop(e),null!==this._audioBufferSourceNodeRenderer&&(this._audioBufferSourceNodeRenderer.stop=e)}})(Cl,Xl,Yl,$a,Kl,fl,gl,Vs),ec=((e,t,n,r,i,o,a,s)=>class extends e{constructor(e,n){const r=o(e),l=a(r),c=i(r,n,l);super(e,!1,c,l?t(s):null),this._isNodeOfNativeOfflineAudioContext=l,this._nativeAudioDestinationNode=c}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(e){if(this._isNodeOfNativeOfflineAudioContext)throw r();if(e>this._nativeAudioDestinationNode.maxChannelCount)throw n();this._nativeAudioDestinationNode.channelCount=e}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(e){if(this._isNodeOfNativeOfflineAudioContext)throw r();this._nativeAudioDestinationNode.channelCountMode=e}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}})(Cl,(e=>{const t=new WeakMap;return{render(n,r){const i=t.get(r);return void 0!==i?Promise.resolve(i):(async(n,r)=>{const i=r.destination;return t.set(r,i),await e(n,r,i),i})(n,r)}}}),Jo,$a,((e,t)=>(n,r,i)=>{const o=n.destination;if(o.channelCount!==r)try{o.channelCount=r}catch{}i&&"explicit"!==o.channelCountMode&&(o.channelCountMode="explicit"),0===o.maxChannelCount&&Object.defineProperty(o,"maxChannelCount",{value:r});const a=e(n,{channelCount:r,channelCountMode:o.channelCountMode,channelInterpretation:o.channelInterpretation,gain:1});return t(a,"channelCount",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t);try{o.channelCount=t}catch(e){if(t>o.maxChannelCount)throw e}})),t(a,"channelCountMode",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),o.channelCountMode=t})),t(a,"channelInterpretation",(e=>()=>e.call(a)),(e=>t=>{e.call(a,t),o.channelInterpretation=t})),Object.defineProperty(a,"maxChannelCount",{get:()=>o.maxChannelCount}),a.connect(o),a})(_s,Us),fl,gl,ll),tc=((e,t,n,r,i)=>()=>{const o=new WeakMap;return{render(a,s){const l=o.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=qo(l,s);if(!c){const e={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=t(s,e)}return o.set(s,l),c?(await e(s,a.Q,l.Q),await e(s,a.detune,l.detune),await e(s,a.frequency,l.frequency),await e(s,a.gain,l.gain)):(await r(s,a.Q,l.Q),await r(s,a.detune,l.detune),await r(s,a.frequency,l.frequency),await r(s,a.gain,l.gain)),await i(a,s,l),l})(a,s)}}})(Wl,ys,_a,Ql,ll),nc=(e=>(t,n)=>e.set(t,n))(Xs),rc=(ic=Cl,oc=Yl,ac=tc,sc=es,lc=ys,cc=fl,uc=gl,dc=nc,class extends ic{constructor(e,t){const n=cc(e),r={...Ha,...t},i=lc(n,r),o=uc(n);super(e,!1,i,o?ac():null),this._Q=oc(this,o,i.Q,Zo,Yo),this._detune=oc(this,o,i.detune,1200*Math.log2(Zo),-1200*Math.log2(Zo)),this._frequency=oc(this,o,i.frequency,e.sampleRate/2,0),this._gain=oc(this,o,i.gain,40*Math.log10(Zo),Yo),this._nativeBiquadFilterNode=i,dc(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(e){this._nativeBiquadFilterNode.type=e}getFrequencyResponse(e,t,n){try{this._nativeBiquadFilterNode.getFrequencyResponse(e,t,n)}catch(e){if(11===e.code)throw sc();throw e}if(e.length!==t.length||t.length!==n.length)throw sc()}});var ic,oc,ac,sc,lc,cc,uc,dc;const hc=((e,t)=>(n,r,i)=>{const o=new Set;var a,s;return n.connect=(a=n.connect,(i,s=0,l=0)=>{const c=0===o.size;if(t(i))return a.call(n,i,s,l),e(o,[i,s,l],(e=>e[0]===i&&e[1]===s&&e[2]===l),!0),c&&r(),i;a.call(n,i,s),e(o,[i,s],(e=>e[0]===i&&e[1]===s),!0),c&&r()}),n.disconnect=(s=n.disconnect,(e,r,a)=>{const l=o.size>0;if(void 0===e)s.apply(n),o.clear();else if("number"==typeof e){s.call(n,e);for(const t of o)t[1]===e&&o.delete(t)}else{t(e)?s.call(n,e,r,a):s.call(n,e,r);for(const t of o)t[0]!==e||void 0!==r&&t[1]!==r||void 0!==a&&t[2]!==a||o.delete(t)}const c=0===o.size;l&&c&&i()}),n})(pa,_l),fc=(pc=$a,mc=hc,(e,t)=>{t.channelCount=1,t.channelCountMode="explicit",Object.defineProperty(t,"channelCount",{get:()=>1,set:()=>{throw pc()}}),Object.defineProperty(t,"channelCountMode",{get:()=>"explicit",set:()=>{throw pc()}});const n=e.createBufferSource();mc(t,(()=>{const e=t.numberOfInputs;for(let r=0;r<e;r+=1)n.connect(t,0,r)}),(()=>n.disconnect(t)))});var pc,mc;const gc=((e,t)=>(n,r)=>{const i=n.createChannelMerger(r.numberOfInputs);return null!==e&&"webkitAudioContext"===e.name&&t(n,i),ls(i,r),i})(Sl,fc),vc=((e,t,n)=>()=>{const r=new WeakMap;return{render(i,o){const a=r.get(o);return void 0!==a?Promise.resolve(a):(async(i,o)=>{let a=t(i);if(!qo(a,o)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=e(o,t)}return r.set(o,a),await n(i,o,a),a})(i,o)}}})(gc,_a,ll),bc=((e,t,n,r,i)=>class extends e{constructor(e,o){const a=r(e),s={...Ga,...o};super(e,!1,n(a,s),i(a)?t():null)}})(Cl,vc,gc,fl,gl),yc=((e,t,n)=>()=>{const r=new WeakMap;return{render(i,o){const a=r.get(o);return void 0!==a?Promise.resolve(a):(async(i,o)=>{let a=t(i);if(!qo(a,o)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=e(o,t)}return r.set(o,a),await n(i,o,a),a})(i,o)}}})(Ss,_a,ll),wc=((e,t,n,r,i,o)=>class extends e{constructor(e,a){const s=r(e),l=o({...Va,...a});super(e,!1,n(s,l),i(s)?t():null)}})(Cl,yc,Ss,fl,gl,(e=>({...e,channelCount:e.numberOfOutputs}))),Sc=((e,t,n,r)=>(i,{offset:o,...a})=>{const s=i.createBuffer(1,2,44100),l=t(i,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),c=n(i,{...a,gain:o}),u=s.getChannelData(0);u[0]=1,u[1]=1,l.buffer=s,l.loop=!0;const d={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){c.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){c.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){c.channelInterpretation=e},get context(){return c.context},get inputs(){return[]},get numberOfInputs(){return l.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get offset(){return c.gain},get onended(){return l.onended},set onended(e){l.onended=e},addEventListener:(...e)=>l.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>l.dispatchEvent(e[0]),removeEventListener:(...e)=>l.removeEventListener(e[0],e[1],e[2]),start(e=0){l.start.call(l,e)},stop(e=0){l.stop.call(l,e)}};return e(i,l),r(xs(d,c),(()=>l.connect(c)),(()=>l.disconnect(c)))})(Fl,Kl,_s,hc),xc=((e,t,n,r,i)=>(o,a)=>{if(void 0===o.createConstantSource)return n(o,a);const s=o.createConstantSource();return ls(s,a),us(s,a,"offset"),t(r,(()=>r(o)))||hs(s),t(i,(()=>i(o)))||fs(s),e(o,s),s})(Fl,$s,Sc,zs,Hs),Mc=((e,t,n,r,i)=>()=>{const o=new WeakMap;let a=null,s=null;return{set start(e){a=e},set stop(e){s=e},render(l,c){const u=o.get(c);return void 0!==u?Promise.resolve(u):(async(l,c)=>{let u=n(l);const d=qo(u,c);if(!d){const e={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,offset:u.offset.value};u=t(c,e),null!==a&&u.start(a),null!==s&&u.stop(s)}return o.set(c,u),d?await e(c,l.offset,u.offset):await r(c,l.offset,u.offset),await i(l,c,u),u})(l,c)}}})(Wl,xc,_a,Ql,ll),_c=((e,t,n,r,i,o,a)=>class extends e{constructor(e,a){const s=i(e),l={...Wa,...a},c=r(s,l),u=o(s),d=u?n():null;super(e,!1,c,d),this._constantSourceNodeRenderer=d,this._nativeConstantSourceNode=c,this._offset=t(this,u,c.offset,Zo,Yo),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(this,e):null;this._nativeConstantSourceNode.onended=t;const n=this._nativeConstantSourceNode.onended;this._onended=null!==n&&n===t?e:n}start(e=0){if(this._nativeConstantSourceNode.start(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.start=e),"closed"!==this.context.state){jo(this);const e=()=>{this._nativeConstantSourceNode.removeEventListener("ended",e),$o(this)&&Go(this)};this._nativeConstantSourceNode.addEventListener("ended",e)}}stop(e=0){this._nativeConstantSourceNode.stop(e),null!==this._constantSourceNodeRenderer&&(this._constantSourceNodeRenderer.stop=e)}})(Cl,Yl,Mc,xc,fl,gl,Vs),Ac=((e,t)=>(n,r)=>{const i=n.createConvolver();if(ls(i,r),r.disableNormalization===i.normalize&&(i.normalize=!r.disableNormalization),ss(i,r,"buffer"),r.channelCount>2)throw e();if(t(i,"channelCount",(e=>()=>e.call(i)),(t=>n=>{if(n>2)throw e();return t.call(i,n)})),"max"===r.channelCountMode)throw e();return t(i,"channelCountMode",(e=>()=>e.call(i)),(t=>n=>{if("max"===n)throw e();return t.call(i,n)})),i})(Ts,Us),Ec=((e,t,n)=>()=>{const r=new WeakMap;return{render(i,o){const a=r.get(o);return void 0!==a?Promise.resolve(a):(async(i,o)=>{let a=t(i);if(!qo(a,o)){const t={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=e(o,t)}return r.set(o,a),va(a)?await n(i,o,a.inputs[0]):await n(i,o,a),a})(i,o)}}})(Ac,_a,ll),Cc=((e,t,n,r,i,o)=>class extends e{constructor(e,a){const s=r(e),l={...qa,...a},c=n(s,l);super(e,!1,c,i(s)?t():null),this._isBufferNullified=!1,this._nativeConvolverNode=c,null!==l.buffer&&o(this,l.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(e){if(this._nativeConvolverNode.buffer=e,null===e&&null!==this._nativeConvolverNode.buffer){const e=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=e.createBuffer(1,1,e.sampleRate),this._isBufferNullified=!0,o(this,0)}else this._isBufferNullified=!1,o(this,null===this._nativeConvolverNode.buffer?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(e){this._nativeConvolverNode.normalize=e}})(Cl,Ec,Ac,fl,gl,nc),Tc=((e,t,n,r,i)=>o=>{const a=new WeakMap;return{render(s,l){const c=a.get(l);return void 0!==c?Promise.resolve(c):(async(s,l)=>{let c=n(s);const u=qo(c,l);if(!u){const e={channelCount:c.channelCount,channelCountMode:c.channelCountMode,channelInterpretation:c.channelInterpretation,delayTime:c.delayTime.value,maxDelayTime:o};c=t(l,e)}return a.set(l,c),u?await e(l,s.delayTime,c.delayTime):await r(l,s.delayTime,c.delayTime),await i(s,l,c),c})(s,l)}}})(Wl,Ms,_a,Ql,ll),Ic=((e,t,n,r,i,o,a)=>class extends e{constructor(e,s){const l=i(e),c={...Ja,...s},u=r(l,c),d=o(l);super(e,!1,u,d?n(c.maxDelayTime):null),this._delayTime=t(this,d,u.delayTime),a(this,c.maxDelayTime)}get delayTime(){return this._delayTime}})(Cl,Yl,Tc,Ms,fl,gl,nc),kc=(Rc=Ts,(e,t)=>{const n=e.createDynamicsCompressor();if(ls(n,t),t.channelCount>2)throw Rc();if("max"===t.channelCountMode)throw Rc();return us(n,t,"attack"),us(n,t,"knee"),us(n,t,"ratio"),us(n,t,"release"),us(n,t,"threshold"),n});var Rc;const Oc=((e,t,n,r,i)=>()=>{const o=new WeakMap;return{render(a,s){const l=o.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=qo(l,s);if(!c){const e={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=t(s,e)}return o.set(s,l),c?(await e(s,a.attack,l.attack),await e(s,a.knee,l.knee),await e(s,a.ratio,l.ratio),await e(s,a.release,l.release),await e(s,a.threshold,l.threshold)):(await r(s,a.attack,l.attack),await r(s,a.knee,l.knee),await r(s,a.ratio,l.ratio),await r(s,a.release,l.release),await r(s,a.threshold,l.threshold)),await i(a,s,l),l})(a,s)}}})(Wl,kc,_a,Ql,ll),Pc=((e,t,n,r,i,o,a,s)=>class extends e{constructor(e,i){const l=o(e),c={...Ya,...i},u=r(l,c),d=a(l);super(e,!1,u,d?n():null),this._attack=t(this,d,u.attack),this._knee=t(this,d,u.knee),this._nativeDynamicsCompressorNode=u,this._ratio=t(this,d,u.ratio),this._release=t(this,d,u.release),this._threshold=t(this,d,u.threshold),s(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(e){const t=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=e,e>2)throw this._nativeDynamicsCompressorNode.channelCount=t,i()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(e){const t=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=e,"max"===e)throw this._nativeDynamicsCompressorNode.channelCountMode=t,i()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return"number"==typeof this._nativeDynamicsCompressorNode.reduction.value?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}})(Cl,Yl,Oc,kc,Ts,fl,gl,nc),Nc=((e,t,n,r,i)=>()=>{const o=new WeakMap;return{render(a,s){const l=o.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=qo(l,s);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(s,e)}return o.set(s,l),c?await e(s,a.gain,l.gain):await r(s,a.gain,l.gain),await i(a,s,l),l})(a,s)}}})(Wl,_s,_a,Ql,ll),Bc=((e,t,n,r,i,o)=>class extends e{constructor(e,a){const s=i(e),l={...Za,...a},c=r(s,l),u=o(s);super(e,!1,c,u?n():null),this._gain=t(this,u,c.gain,Zo,Yo)}get gain(){return this._gain}})(Cl,Yl,Nc,_s,fl,gl),Lc=((e,t,n,r)=>(i,o,{channelCount:a,channelCountMode:s,channelInterpretation:l,feedback:c,feedforward:u})=>{const d=ms(o,i.sampleRate),h=c instanceof Float64Array?c:new Float64Array(c),f=u instanceof Float64Array?u:new Float64Array(u),p=h.length,m=f.length,g=Math.min(p,m);if(0===p||p>20)throw r();if(0===h[0])throw t();if(0===m||m>20)throw r();if(0===f[0])throw t();if(1!==h[0]){for(let e=0;e<m;e+=1)f[e]/=h[0];for(let e=1;e<p;e+=1)h[e]/=h[0]}const v=n(i,d,a,a);v.channelCount=a,v.channelCountMode=s,v.channelInterpretation=l;const b=[],y=[],w=[];for(let e=0;e<a;e+=1){b.push(0);const e=new Float32Array(32),t=new Float32Array(32);e.fill(0),t.fill(0),y.push(e),w.push(t)}v.onaudioprocess=e=>{const t=e.inputBuffer,n=e.outputBuffer,r=t.numberOfChannels;for(let e=0;e<r;e+=1){const r=t.getChannelData(e),i=n.getChannelData(e);b[e]=rs(h,p,f,m,g,y[e],w[e],b[e],32,r,i)}};const S=i.sampleRate/2;return xs({get bufferSize(){return d},get channelCount(){return v.channelCount},set channelCount(e){v.channelCount=e},get channelCountMode(){return v.channelCountMode},set channelCountMode(e){v.channelCountMode=e},get channelInterpretation(){return v.channelInterpretation},set channelInterpretation(e){v.channelInterpretation=e},get context(){return v.context},get inputs(){return[v]},get numberOfInputs(){return v.numberOfInputs},get numberOfOutputs(){return v.numberOfOutputs},addEventListener:(...e)=>v.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>v.dispatchEvent(e[0]),getFrequencyResponse(t,n,r){if(t.length!==n.length||n.length!==r.length)throw e();const i=t.length;for(let e=0;e<i;e+=1){const i=-Math.PI*(t[e]/S),o=[Math.cos(i),Math.sin(i)],a=As(Es(f,o),Es(h,o));n[e]=Math.sqrt(a[0]*a[0]+a[1]*a[1]),r[e]=Math.atan2(a[1],a[0])}},removeEventListener:(...e)=>v.removeEventListener(e[0],e[1],e[2])},v)})(es,$a,Cs,Ts),Dc=((e,t,n,r)=>i=>e(os,(()=>os(i)))?Promise.resolve(e(r,r)).then((e=>{if(!e){const e=n(i,512,0,1);i.oncomplete=()=>{e.onaudioprocess=null,e.disconnect()},e.onaudioprocess=()=>i.currentTime,e.connect(i.destination)}return i.startRendering()})):new Promise((e=>{const n=t(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});i.oncomplete=t=>{n.disconnect(),e(t.renderedBuffer)},n.connect(i.destination),i.startRendering()})))($s,_s,Cs,((e,t)=>()=>{if(null===t)return Promise.resolve(!1);const n=new t(1,1,44100),r=e(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise((e=>{n.oncomplete=()=>{r.disconnect(),e(0!==n.currentTime)},n.startRendering()}))})(_s,ml)),Uc=((e,t,n,r,i)=>(o,a)=>{const s=new WeakMap;let l=null;const c=async(c,u)=>{let d=null,h=t(c);const f=qo(h,u);if(void 0===u.createIIRFilter?d=e(u,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):f||(h=u.createIIRFilter(a,o)),s.set(u,null===d?h:d),null!==d){if(null===l){if(null===n)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new n(c.context.destination.channelCount,c.context.length,u.sampleRate);l=(async()=>{await r(c,e,e.destination);return((e,t,n,r)=>{const i=n instanceof Float64Array?n:new Float64Array(n),o=r instanceof Float64Array?r:new Float64Array(r),a=i.length,s=o.length,l=Math.min(a,s);if(1!==i[0]){for(let e=0;e<a;e+=1)o[e]/=i[0];for(let e=1;e<s;e+=1)i[e]/=i[0]}const c=new Float32Array(32),u=new Float32Array(32),d=t.createBuffer(e.numberOfChannels,e.length,e.sampleRate),h=e.numberOfChannels;for(let t=0;t<h;t+=1){const n=e.getChannelData(t),r=d.getChannelData(t);c.fill(0),u.fill(0),rs(i,a,o,s,l,c,u,0,32,n,r)}return d})(await i(e),u,o,a)})()}const e=await l;return d.buffer=e,d.start(0),d}return await r(c,u,h),h};return{render(e,t){const n=s.get(t);return void 0!==n?Promise.resolve(n):c(e,t)}}})(Kl,_a,ml,ll,Dc),Fc=(zc=Lc,(e,t,n)=>{if(void 0===e.createIIRFilter)return zc(e,t,n);const r=e.createIIRFilter(n.feedforward,n.feedback);return ls(r,n),r});var zc;const jc=((e,t,n,r,i,o)=>class extends e{constructor(e,a){const s=r(e),l=i(s),c={...ns,...a},u=t(s,l?null:e.baseLatency,c);super(e,!1,u,l?n(c.feedback,c.feedforward):null),ts(u),this._nativeIIRFilterNode=u,o(this,1)}getFrequencyResponse(e,t,n){return this._nativeIIRFilterNode.getFrequencyResponse(e,t,n)}})(Cl,Fc,Uc,fl,gl,nc),Hc=((e,t,n,r,i,o,a,s)=>(l,c)=>{const u=c.listener,{forwardX:d,forwardY:h,forwardZ:f,positionX:p,positionY:m,positionZ:g,upX:v,upY:b,upZ:y}=void 0===u.forwardX?(()=>{const d=new Float32Array(1),h=t(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),f=a(c);let p=!1,m=[0,0,-1,0,1,0],g=[0,0,0];const v=()=>{if(p)return;p=!0;const e=r(c,256,9,0);e.onaudioprocess=({inputBuffer:e})=>{const t=[o(e,d,0),o(e,d,1),o(e,d,2),o(e,d,3),o(e,d,4),o(e,d,5)];t.some(((e,t)=>e!==m[t]))&&(u.setOrientation(...t),m=t);const n=[o(e,d,6),o(e,d,7),o(e,d,8)];n.some(((e,t)=>e!==g[t]))&&(u.setPosition(...n),g=n)},h.connect(e)},b=e=>t=>{t!==m[e]&&(m[e]=t,u.setOrientation(...m))},y=e=>t=>{t!==g[e]&&(g[e]=t,u.setPosition(...g))},w=(t,r,o)=>{const a=n(c,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:r});a.connect(h,0,t),a.start(),Object.defineProperty(a.offset,"defaultValue",{get:()=>r});const u=e({context:l},f,a.offset,Zo,Yo);var d,p,m,g,b,y,w;return s(u,"value",(e=>()=>e.call(u)),(e=>t=>{try{e.call(u,t)}catch(e){if(9!==e.code)throw e}v(),f&&o(t)})),u.cancelAndHoldAtTime=(d=u.cancelAndHoldAtTime,f?()=>{throw i()}:(...e)=>{const t=d.apply(u,e);return v(),t}),u.cancelScheduledValues=(p=u.cancelScheduledValues,f?()=>{throw i()}:(...e)=>{const t=p.apply(u,e);return v(),t}),u.exponentialRampToValueAtTime=(m=u.exponentialRampToValueAtTime,f?()=>{throw i()}:(...e)=>{const t=m.apply(u,e);return v(),t}),u.linearRampToValueAtTime=(g=u.linearRampToValueAtTime,f?()=>{throw i()}:(...e)=>{const t=g.apply(u,e);return v(),t}),u.setTargetAtTime=(b=u.setTargetAtTime,f?()=>{throw i()}:(...e)=>{const t=b.apply(u,e);return v(),t}),u.setValueAtTime=(y=u.setValueAtTime,f?()=>{throw i()}:(...e)=>{const t=y.apply(u,e);return v(),t}),u.setValueCurveAtTime=(w=u.setValueCurveAtTime,f?()=>{throw i()}:(...e)=>{const t=w.apply(u,e);return v(),t}),u};return{forwardX:w(0,0,b(0)),forwardY:w(1,0,b(1)),forwardZ:w(2,-1,b(2)),positionX:w(6,0,y(0)),positionY:w(7,0,y(1)),positionZ:w(8,0,y(2)),upX:w(3,0,b(3)),upY:w(4,1,b(4)),upZ:w(5,0,b(5))}})():u;return{get forwardX(){return d},get forwardY(){return h},get forwardZ(){return f},get positionX(){return p},get positionY(){return m},get positionZ(){return g},get upX(){return v},get upY(){return b},get upZ(){return y}}})(Yl,gc,xc,Cs,Ts,Ls,gl,Us),Gc=new WeakMap,Vc=((e,t,n,r,i,o)=>class extends n{constructor(n,o){super(n),this._nativeContext=n,Eo.set(this,n),r(n)&&i.set(n,new Set),this._destination=new e(this,o),this._listener=t(this,n),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(e){const t="function"==typeof e?o(this,e):null;this._nativeContext.onstatechange=t;const n=this._nativeContext.onstatechange;this._onstatechange=null!==n&&n===t?e:n}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}})(ec,Hc,yl,gl,Gc,Vs),Wc=((e,t,n,r,i,o)=>(a,s)=>{const l=a.createOscillator();return ls(l,s),us(l,s,"detune"),us(l,s,"frequency"),void 0!==s.periodicWave?l.setPeriodicWave(s.periodicWave):ss(l,s,"type"),t(n,(()=>n(a)))||hs(l),t(r,(()=>r(a)))||o(l,a),t(i,(()=>i(a)))||fs(l),e(a,l),l})(Fl,$s,zs,js,Hs,Gs),qc=((e,t,n,r,i)=>()=>{const o=new WeakMap;let a=null,s=null,l=null;return{set periodicWave(e){a=e},set start(e){s=e},set stop(e){l=e},render(c,u){const d=o.get(u);return void 0!==d?Promise.resolve(d):(async(c,u)=>{let d=n(c);const h=qo(d,u);if(!h){const e={channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,detune:d.detune.value,frequency:d.frequency.value,periodicWave:null===a?void 0:a,type:d.type};d=t(u,e),null!==s&&d.start(s),null!==l&&d.stop(l)}return o.set(u,d),h?(await e(u,c.detune,d.detune),await e(u,c.frequency,d.frequency)):(await r(u,c.detune,d.detune),await r(u,c.frequency,d.frequency)),await i(c,u,d),d})(c,u)}}})(Wl,Wc,_a,Ql,ll),Kc=((e,t,n,r,i,o,a)=>class extends e{constructor(e,a){const s=i(e),l={...ks,...a},c=n(s,l),u=o(s),d=u?r():null,h=e.sampleRate/2;super(e,!1,c,d),this._detune=t(this,u,c.detune,153600,-153600),this._frequency=t(this,u,c.frequency,h,-h),this._nativeOscillatorNode=c,this._onended=null,this._oscillatorNodeRenderer=d,null!==this._oscillatorNodeRenderer&&void 0!==l.periodicWave&&(this._oscillatorNodeRenderer.periodicWave=l.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(e){const t="function"==typeof e?a(this,e):null;this._nativeOscillatorNode.onended=t;const n=this._nativeOscillatorNode.onended;this._onended=null!==n&&n===t?e:n}get type(){return this._nativeOscillatorNode.type}set type(e){this._nativeOscillatorNode.type=e,null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(e){this._nativeOscillatorNode.setPeriodicWave(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.periodicWave=e)}start(e=0){if(this._nativeOscillatorNode.start(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.start=e),"closed"!==this.context.state){jo(this);const e=()=>{this._nativeOscillatorNode.removeEventListener("ended",e),$o(this)&&Go(this)};this._nativeOscillatorNode.addEventListener("ended",e)}}stop(e=0){this._nativeOscillatorNode.stop(e),null!==this._oscillatorNodeRenderer&&(this._oscillatorNodeRenderer.stop=e)}})(Cl,Yl,Wc,qc,fl,gl,Vs),Jc=(Qc=Kl,(e,t)=>{const n=Qc(e,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),r=e.createBuffer(1,2,44100);return n.buffer=r,n.loop=!0,n.connect(t),n.start(),()=>{n.stop(),n.disconnect(t)}});var Qc;const Xc=((e,t,n,r,i)=>(o,{curve:a,oversample:s,...l})=>{const c=o.createWaveShaper(),u=o.createWaveShaper();ls(c,l),ls(u,l);const d=n(o,{...l,gain:1}),h=n(o,{...l,gain:-1}),f=n(o,{...l,gain:1}),p=n(o,{...l,gain:-1});let m=null,g=!1,v=null;const b={get bufferSize(){},get channelCount(){return c.channelCount},set channelCount(e){d.channelCount=e,h.channelCount=e,c.channelCount=e,f.channelCount=e,u.channelCount=e,p.channelCount=e},get channelCountMode(){return c.channelCountMode},set channelCountMode(e){d.channelCountMode=e,h.channelCountMode=e,c.channelCountMode=e,f.channelCountMode=e,u.channelCountMode=e,p.channelCountMode=e},get channelInterpretation(){return c.channelInterpretation},set channelInterpretation(e){d.channelInterpretation=e,h.channelInterpretation=e,c.channelInterpretation=e,f.channelInterpretation=e,u.channelInterpretation=e,p.channelInterpretation=e},get context(){return c.context},get curve(){return v},set curve(n){if(null!==n&&n.length<2)throw t();if(null===n)c.curve=n,u.curve=n;else{const e=n.length,t=new Float32Array(e+2-e%2),r=new Float32Array(e+2-e%2);t[0]=n[0],r[0]=-n[e-1];const i=Math.ceil((e+1)/2),o=(e+1)/2-1;for(let a=1;a<i;a+=1){const s=a/i*o,l=Math.floor(s),c=Math.ceil(s);t[a]=l===c?n[l]:(1-(s-l))*n[l]+(1-(c-s))*n[c],r[a]=l===c?-n[e-1-l]:-(1-(s-l))*n[e-1-l]-(1-(c-s))*n[e-1-c]}t[i]=e%2==1?n[i-1]:(n[i-2]+n[i-1])/2,c.curve=t,u.curve=r}v=n,g&&(r(v)&&null===m?m=e(o,d):null!==m&&(m(),m=null))},get inputs(){return[d]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return c.numberOfOutputs},get oversample(){return c.oversample},set oversample(e){c.oversample=e,u.oversample=e},addEventListener:(...e)=>d.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>d.dispatchEvent(e[0]),removeEventListener:(...e)=>d.removeEventListener(e[0],e[1],e[2])};null!==a&&(b.curve=a instanceof Float32Array?a:new Float32Array(a)),s!==b.oversample&&(b.oversample=s);return i(xs(b,f),(()=>{d.connect(c).connect(f),d.connect(h).connect(u).connect(p).connect(f),g=!0,r(v)&&(m=e(o,d))}),(()=>{d.disconnect(c),c.disconnect(f),d.disconnect(h),h.disconnect(u),u.disconnect(p),p.disconnect(f),g=!1,null!==m&&(m(),m=null)}))})(Jc,$a,_s,Ds,hc),Yc=((e,t,n,r,i,o,a)=>(s,l)=>{const c=s.createWaveShaper();if(null!==o&&"webkitAudioContext"===o.name&&void 0===s.createGain().gain.automationRate)return n(s,l);ls(c,l);const u=null===l.curve||l.curve instanceof Float32Array?l.curve:new Float32Array(l.curve);if(null!==u&&u.length<2)throw t();ss(c,{curve:u},"curve"),ss(c,l,"oversample");let d=null,h=!1;a(c,"curve",(e=>()=>e.call(c)),(t=>n=>(t.call(c,n),h&&(r(n)&&null===d?d=e(s,c):r(n)||null===d||(d(),d=null)),n)));return i(c,(()=>{h=!0,r(c.curve)&&(d=e(s,c))}),(()=>{h=!1,null!==d&&(d(),d=null)}))})(Jc,$a,Xc,Ds,hc,Sl,Us),Zc=((e,t,n,r,i,o,a,s,l,c)=>(u,{coneInnerAngle:d,coneOuterAngle:h,coneOuterGain:f,distanceModel:p,maxDistance:m,orientationX:g,orientationY:v,orientationZ:b,panningModel:y,positionX:w,positionY:S,positionZ:x,refDistance:M,rolloffFactor:_,...A})=>{const E=u.createPanner();if(A.channelCount>2)throw a();if("max"===A.channelCountMode)throw a();ls(E,A);const C={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},T=n(u,{...C,channelInterpretation:"speakers",numberOfInputs:6}),I=r(u,{...A,gain:1}),k=r(u,{...C,gain:1}),R=r(u,{...C,gain:0}),O=r(u,{...C,gain:0}),P=r(u,{...C,gain:0}),N=r(u,{...C,gain:0}),B=r(u,{...C,gain:0}),L=i(u,256,6,1),D=o(u,{...C,curve:new Float32Array([1,1]),oversample:"none"});let U=[g,v,b],F=[w,S,x];const z=new Float32Array(1);L.onaudioprocess=({inputBuffer:e})=>{const t=[l(e,z,0),l(e,z,1),l(e,z,2)];t.some(((e,t)=>e!==U[t]))&&(E.setOrientation(...t),U=t);const n=[l(e,z,3),l(e,z,4),l(e,z,5)];n.some(((e,t)=>e!==F[t]))&&(E.setPosition(...n),F=n)},Object.defineProperty(R.gain,"defaultValue",{get:()=>0}),Object.defineProperty(O.gain,"defaultValue",{get:()=>0}),Object.defineProperty(P.gain,"defaultValue",{get:()=>0}),Object.defineProperty(N.gain,"defaultValue",{get:()=>0}),Object.defineProperty(B.gain,"defaultValue",{get:()=>0});const j={get bufferSize(){},get channelCount(){return E.channelCount},set channelCount(e){if(e>2)throw a();I.channelCount=e,E.channelCount=e},get channelCountMode(){return E.channelCountMode},set channelCountMode(e){if("max"===e)throw a();I.channelCountMode=e,E.channelCountMode=e},get channelInterpretation(){return E.channelInterpretation},set channelInterpretation(e){I.channelInterpretation=e,E.channelInterpretation=e},get coneInnerAngle(){return E.coneInnerAngle},set coneInnerAngle(e){E.coneInnerAngle=e},get coneOuterAngle(){return E.coneOuterAngle},set coneOuterAngle(e){E.coneOuterAngle=e},get coneOuterGain(){return E.coneOuterGain},set coneOuterGain(e){if(e<0||e>1)throw t();E.coneOuterGain=e},get context(){return E.context},get distanceModel(){return E.distanceModel},set distanceModel(e){E.distanceModel=e},get inputs(){return[I]},get maxDistance(){return E.maxDistance},set maxDistance(e){if(e<0)throw new RangeError;E.maxDistance=e},get numberOfInputs(){return E.numberOfInputs},get numberOfOutputs(){return E.numberOfOutputs},get orientationX(){return k.gain},get orientationY(){return R.gain},get orientationZ(){return O.gain},get panningModel(){return E.panningModel},set panningModel(e){E.panningModel=e},get positionX(){return P.gain},get positionY(){return N.gain},get positionZ(){return B.gain},get refDistance(){return E.refDistance},set refDistance(e){if(e<0)throw new RangeError;E.refDistance=e},get rolloffFactor(){return E.rolloffFactor},set rolloffFactor(e){if(e<0)throw new RangeError;E.rolloffFactor=e},addEventListener:(...e)=>I.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>I.dispatchEvent(e[0]),removeEventListener:(...e)=>I.removeEventListener(e[0],e[1],e[2])};d!==j.coneInnerAngle&&(j.coneInnerAngle=d),h!==j.coneOuterAngle&&(j.coneOuterAngle=h),f!==j.coneOuterGain&&(j.coneOuterGain=f),p!==j.distanceModel&&(j.distanceModel=p),m!==j.maxDistance&&(j.maxDistance=m),g!==j.orientationX.value&&(j.orientationX.value=g),v!==j.orientationY.value&&(j.orientationY.value=v),b!==j.orientationZ.value&&(j.orientationZ.value=b),y!==j.panningModel&&(j.panningModel=y),w!==j.positionX.value&&(j.positionX.value=w),S!==j.positionY.value&&(j.positionY.value=S),x!==j.positionZ.value&&(j.positionZ.value=x),M!==j.refDistance&&(j.refDistance=M),_!==j.rolloffFactor&&(j.rolloffFactor=_),1===U[0]&&0===U[1]&&0===U[2]||E.setOrientation(...U),0===F[0]&&0===F[1]&&0===F[2]||E.setPosition(...F);return c(xs(j,E),(()=>{I.connect(E),e(I,D,0,0),D.connect(k).connect(T,0,0),D.connect(R).connect(T,0,1),D.connect(O).connect(T,0,2),D.connect(P).connect(T,0,3),D.connect(N).connect(T,0,4),D.connect(B).connect(T,0,5),T.connect(L).connect(u.destination)}),(()=>{I.disconnect(E),s(I,D,0,0),D.disconnect(k),k.disconnect(T),D.disconnect(R),R.disconnect(T),D.disconnect(O),O.disconnect(T),D.disconnect(P),P.disconnect(T),D.disconnect(N),N.disconnect(T),D.disconnect(B),B.disconnect(T),T.disconnect(L),L.disconnect(u.destination)}))})(ba,$a,gc,_s,Cs,Yc,Ts,Ma,Ls,hc),$c=(eu=Zc,(e,t)=>{const n=e.createPanner();return void 0===n.orientationX?eu(e,t):(ls(n,t),us(n,t,"orientationX"),us(n,t,"orientationY"),us(n,t,"orientationZ"),us(n,t,"positionX"),us(n,t,"positionY"),us(n,t,"positionZ"),ss(n,t,"coneInnerAngle"),ss(n,t,"coneOuterAngle"),ss(n,t,"coneOuterGain"),ss(n,t,"distanceModel"),ss(n,t,"maxDistance"),ss(n,t,"panningModel"),ss(n,t,"refDistance"),ss(n,t,"rolloffFactor"),n)});var eu;const tu=((e,t,n,r,i,o,a,s,l,c)=>()=>{const u=new WeakMap;let d=null;return{render(h,f){const p=u.get(f);return void 0!==p?Promise.resolve(p):(async(h,f)=>{let p=null,m=o(h);const g={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},v={...g,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},b=qo(m,f);if("bufferSize"in m)p=r(f,{...g,gain:1});else if(!b){const e={...v,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=i(f,e)}if(u.set(f,null===p?m:p),null!==p){if(null===d){if(null===a)throw new Error("Missing the native OfflineAudioContext constructor.");const e=new a(6,h.context.length,f.sampleRate),r=t(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});r.connect(e.destination),d=(async()=>{const t=await Promise.all([h.orientationX,h.orientationY,h.orientationZ,h.positionX,h.positionY,h.positionZ].map((async(t,r)=>{const i=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:0===r?1:0});return await s(e,t,i.offset),i})));for(let e=0;e<6;e+=1)t[e].connect(r,0,e),t[e].start(0);return c(e)})()}const e=await d,o=r(f,{...g,gain:1});await l(h,f,o);const u=[];for(let t=0;t<e.numberOfChannels;t+=1)u.push(e.getChannelData(t));let m=[u[0][0],u[1][0],u[2][0]],b=[u[3][0],u[4][0],u[5][0]],y=r(f,{...g,gain:1}),w=i(f,{...v,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:b[0],positionY:b[1],positionZ:b[2]});o.connect(y).connect(w.inputs[0]),w.connect(p);for(let t=128;t<e.length;t+=128){const e=[u[0][t],u[1][t],u[2][t]],n=[u[3][t],u[4][t],u[5][t]];if(e.some(((e,t)=>e!==m[t]))||n.some(((e,t)=>e!==b[t]))){m=e,b=n;const a=t/f.sampleRate;y.gain.setValueAtTime(0,a),y=r(f,{...g,gain:0}),w=i(f,{...v,orientationX:m[0],orientationY:m[1],orientationZ:m[2],positionX:b[0],positionY:b[1],positionZ:b[2]}),y.gain.setValueAtTime(1,a),o.connect(y).connect(w.inputs[0]),w.connect(p)}}return p}return b?(await e(f,h.orientationX,m.orientationX),await e(f,h.orientationY,m.orientationY),await e(f,h.orientationZ,m.orientationZ),await e(f,h.positionX,m.positionX),await e(f,h.positionY,m.positionY),await e(f,h.positionZ,m.positionZ)):(await s(f,h.orientationX,m.orientationX),await s(f,h.orientationY,m.orientationY),await s(f,h.orientationZ,m.orientationZ),await s(f,h.positionX,m.positionX),await s(f,h.positionY,m.positionY),await s(f,h.positionZ,m.positionZ)),va(m)?await l(h,f,m.inputs[0]):await l(h,f,m),m})(h,f)}}})(Wl,gc,xc,_s,$c,_a,ml,Ql,ll,Dc),nu=((e,t,n,r,i,o,a)=>class extends e{constructor(e,s){const l=i(e),c={...Rs,...s},u=n(l,c),d=o(l);super(e,!1,u,d?r():null),this._nativePannerNode=u,this._orientationX=t(this,d,u.orientationX,Zo,Yo),this._orientationY=t(this,d,u.orientationY,Zo,Yo),this._orientationZ=t(this,d,u.orientationZ,Zo,Yo),this._positionX=t(this,d,u.positionX,Zo,Yo),this._positionY=t(this,d,u.positionY,Zo,Yo),this._positionZ=t(this,d,u.positionZ,Zo,Yo),a(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(e){this._nativePannerNode.coneInnerAngle=e}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(e){this._nativePannerNode.coneOuterAngle=e}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(e){this._nativePannerNode.coneOuterGain=e}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(e){this._nativePannerNode.distanceModel=e}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(e){this._nativePannerNode.maxDistance=e}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(e){this._nativePannerNode.panningModel=e}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(e){this._nativePannerNode.refDistance=e}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(e){this._nativePannerNode.rolloffFactor=e}})(Cl,Yl,$c,tu,fl,gl,nc),ru=(e=>(t,{disableNormalization:n,imag:r,real:i})=>{const o=r instanceof Float32Array?r:new Float32Array(r),a=i instanceof Float32Array?i:new Float32Array(i),s=t.createPeriodicWave(a,o,{disableNormalization:n});if(Array.from(r).length<2)throw e();return s})(Jo),iu=((e,t,n,r)=>class i{constructor(i,o){const a=t(i),s=r({...Os,...o}),l=e(a,s);return n.add(l),l}static[Symbol.hasInstance](e){return null!==e&&"object"==typeof e&&Object.getPrototypeOf(e)===i.prototype||n.has(e)}})(ru,fl,new WeakSet,(e=>{const{imag:t,real:n}=e;return void 0===t?void 0===n?{...e,imag:[0,0],real:[0,0]}:{...e,imag:Array.from(n,(()=>0)),real:n}:void 0===n?{...e,imag:t,real:Array.from(t,(()=>0))}:{...e,imag:t,real:n}})),ou=((e,t,n,r,i,o)=>{const a=16385,s=new Float32Array([1,1]),l=Math.PI/2,c={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...c,oversample:"none"},d=(e,o,d,h,f)=>{if(1===o)return((e,t,i,o)=>{const d=new Float32Array(a),h=new Float32Array(a);for(let e=0;e<a;e+=1){const t=e/16384*l;d[e]=Math.cos(t),h[e]=Math.sin(t)}const f=n(e,{...c,gain:0}),p=r(e,{...u,curve:d}),m=r(e,{...u,curve:s}),g=n(e,{...c,gain:0}),v=r(e,{...u,curve:h});return{connectGraph(){t.connect(f),t.connect(void 0===m.inputs?m:m.inputs[0]),t.connect(g),m.connect(i),i.connect(void 0===p.inputs?p:p.inputs[0]),i.connect(void 0===v.inputs?v:v.inputs[0]),p.connect(f.gain),v.connect(g.gain),f.connect(o,0,0),g.connect(o,0,1)},disconnectGraph(){t.disconnect(f),t.disconnect(void 0===m.inputs?m:m.inputs[0]),t.disconnect(g),m.disconnect(i),i.disconnect(void 0===p.inputs?p:p.inputs[0]),i.disconnect(void 0===v.inputs?v:v.inputs[0]),p.disconnect(f.gain),v.disconnect(g.gain),f.disconnect(o,0,0),g.disconnect(o,0,1)}}})(e,d,h,f);if(2===o)return((e,i,o,d)=>{const h=new Float32Array(a),f=new Float32Array(a),p=new Float32Array(a),m=new Float32Array(a),g=Math.floor(8192.5);for(let e=0;e<a;e+=1)if(e>g){const t=(e-g)/(16384-g)*l;h[e]=Math.cos(t),f[e]=Math.sin(t),p[e]=0,m[e]=1}else{const t=e/(16384-g)*l;h[e]=1,f[e]=0,p[e]=Math.cos(t),m[e]=Math.sin(t)}const v=t(e,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),b=n(e,{...c,gain:0}),y=r(e,{...u,curve:h}),w=n(e,{...c,gain:0}),S=r(e,{...u,curve:f}),x=r(e,{...u,curve:s}),M=n(e,{...c,gain:0}),_=r(e,{...u,curve:p}),A=n(e,{...c,gain:0}),E=r(e,{...u,curve:m});return{connectGraph(){i.connect(v),i.connect(void 0===x.inputs?x:x.inputs[0]),v.connect(b,0),v.connect(w,0),v.connect(M,1),v.connect(A,1),x.connect(o),o.connect(void 0===y.inputs?y:y.inputs[0]),o.connect(void 0===S.inputs?S:S.inputs[0]),o.connect(void 0===_.inputs?_:_.inputs[0]),o.connect(void 0===E.inputs?E:E.inputs[0]),y.connect(b.gain),S.connect(w.gain),_.connect(M.gain),E.connect(A.gain),b.connect(d,0,0),M.connect(d,0,0),w.connect(d,0,1),A.connect(d,0,1)},disconnectGraph(){i.disconnect(v),i.disconnect(void 0===x.inputs?x:x.inputs[0]),v.disconnect(b,0),v.disconnect(w,0),v.disconnect(M,1),v.disconnect(A,1),x.disconnect(o),o.disconnect(void 0===y.inputs?y:y.inputs[0]),o.disconnect(void 0===S.inputs?S:S.inputs[0]),o.disconnect(void 0===_.inputs?_:_.inputs[0]),o.disconnect(void 0===E.inputs?E:E.inputs[0]),y.disconnect(b.gain),S.disconnect(w.gain),_.disconnect(M.gain),E.disconnect(A.gain),b.disconnect(d,0,0),M.disconnect(d,0,0),w.disconnect(d,0,1),A.disconnect(d,0,1)}}})(e,d,h,f);throw i()};return(t,{channelCount:r,channelCountMode:a,pan:s,...l})=>{if("max"===a)throw i();const c=e(t,{...l,channelCount:1,channelCountMode:a,numberOfInputs:2}),u=n(t,{...l,channelCount:r,channelCountMode:a,gain:1}),h=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:s});let{connectGraph:f,disconnectGraph:p}=d(t,r,u,h,c);Object.defineProperty(h.gain,"defaultValue",{get:()=>0}),Object.defineProperty(h.gain,"maxValue",{get:()=>1}),Object.defineProperty(h.gain,"minValue",{get:()=>-1});const m={get bufferSize(){},get channelCount(){return u.channelCount},set channelCount(e){u.channelCount!==e&&(g&&p(),({connectGraph:f,disconnectGraph:p}=d(t,e,u,h,c)),g&&f()),u.channelCount=e},get channelCountMode(){return u.channelCountMode},set channelCountMode(e){if("clamped-max"===e||"max"===e)throw i();u.channelCountMode=e},get channelInterpretation(){return u.channelInterpretation},set channelInterpretation(e){u.channelInterpretation=e},get context(){return u.context},get inputs(){return[u]},get numberOfInputs(){return u.numberOfInputs},get numberOfOutputs(){return u.numberOfOutputs},get pan(){return h.gain},addEventListener:(...e)=>u.addEventListener(e[0],e[1],e[2]),dispatchEvent:(...e)=>u.dispatchEvent(e[0]),removeEventListener:(...e)=>u.removeEventListener(e[0],e[1],e[2])};let g=!1;return o(xs(m,c),(()=>{f(),g=!0}),(()=>{p(),g=!1}))}})(gc,Ss,_s,Yc,Ts,hc),au=((e,t)=>(n,r)=>{const i=r.channelCountMode;if("clamped-max"===i)throw t();if(void 0===n.createStereoPanner)return e(n,r);const o=n.createStereoPanner();return ls(o,r),us(o,r,"pan"),Object.defineProperty(o,"channelCountMode",{get:()=>i,set:e=>{if(e!==i)throw t()}}),o})(ou,Ts),su=((e,t,n,r,i)=>()=>{const o=new WeakMap;return{render(a,s){const l=o.get(s);return void 0!==l?Promise.resolve(l):(async(a,s)=>{let l=n(a);const c=qo(l,s);if(!c){const e={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(s,e)}return o.set(s,l),c?await e(s,a.pan,l.pan):await r(s,a.pan,l.pan),va(l)?await i(a,s,l.inputs[0]):await i(a,s,l),l})(a,s)}}})(Wl,au,_a,Ql,ll),lu=((e,t,n,r,i,o)=>class extends e{constructor(e,a){const s=i(e),l={...Ps,...a},c=n(s,l),u=o(s);super(e,!1,c,u?r():null),this._pan=t(this,u,c.pan)}get pan(){return this._pan}})(Cl,Yl,au,su,fl,gl),cu=((e,t,n)=>()=>{const r=new WeakMap;return{render(i,o){const a=r.get(o);return void 0!==a?Promise.resolve(a):(async(i,o)=>{let a=t(i);if(!qo(a,o)){const t={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=e(o,t)}return r.set(o,a),va(a)?await n(i,o,a.inputs[0]):await n(i,o,a),a})(i,o)}}})(Yc,_a,ll),uu=((e,t,n,r,i,o,a)=>class extends e{constructor(e,t){const s=i(e),l={...Bs,...t},c=n(s,l);super(e,!0,c,o(s)?r():null),this._isCurveNullified=!1,this._nativeWaveShaperNode=c,a(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(e){if(null===e)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(e.length<2)throw t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=e}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(e){this._nativeWaveShaperNode.oversample=e}})(Cl,$a,Yc,cu,fl,gl,nc),du=(e=>null!==e&&e.isSecureContext)(nl),hu=(e=>(t,n,r)=>{Object.defineProperties(e,{currentFrame:{configurable:!0,get:()=>Math.round(t*n)},currentTime:{configurable:!0,get:()=>t}});try{return r()}finally{null!==e&&(delete e.currentFrame,delete e.currentTime)}})(nl),fu=new WeakMap,pu=((e,t)=>n=>{let r=e.get(n);if(void 0!==r)return r;if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");return r=new t(1,1,44100),e.set(n,r),r})(fu,ml),mu=du?((e,t,n,r,i,o,a,s,l,c,u,d,h)=>{let f=0;return(p,m,g={credentials:"omit"})=>{const v=u.get(p);if(void 0!==v&&v.has(m))return Promise.resolve();const b=c.get(p);if(void 0!==b){const e=b.get(m);if(void 0!==e)return e}const y=o(p),w=void 0===y.audioWorklet?i(m).then((([e,t])=>{const[r,i]=No(e,t);return n(`${r};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${i}\n})})(window,'_AWGS')`)})).then((()=>{const e=h._AWGS.pop();if(void 0===e)throw new SyntaxError;r(y.currentTime,y.sampleRate,(()=>e(class{},void 0,((e,n)=>{if(""===e.trim())throw t();const r=Io.get(y);if(void 0!==r){if(r.has(e))throw t();Lo(n),Bo(n.parameterDescriptors),r.set(e,n)}else Lo(n),Bo(n.parameterDescriptors),Io.set(y,new Map([[e,n]]))}),y.sampleRate,void 0,void 0)))})):Promise.all([i(m),Promise.resolve(e(d,d))]).then((([[e,t],n])=>{const r=f+1;f=r;const[i,o]=No(e,t),c=new Blob([`${i};((AudioWorkletProcessor,registerProcessor)=>{${o}\n})(${n?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${n?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${n?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${r}',class extends AudioWorkletProcessor{process(){return !1}})`],{type:"application/javascript; charset=utf-8"}),u=URL.createObjectURL(c);return y.audioWorklet.addModule(u,g).then((()=>{if(s(y))return y;const e=a(y);return e.audioWorklet.addModule(u,g).then((()=>e))})).then((e=>{if(null===l)throw new SyntaxError;try{new l(e,`__sac${r}`)}catch{throw new SyntaxError}})).finally((()=>URL.revokeObjectURL(u)))}));return void 0===b?c.set(p,new Map([[m,w]])):b.set(m,w),w.then((()=>{const e=u.get(p);void 0===e?u.set(p,new Set([m])):e.add(m)})).finally((()=>{const e=c.get(p);void 0!==e&&e.delete(m)})),w}})($s,Ts,(e=>t=>new Promise(((n,r)=>{if(null===e)return void r(new SyntaxError);const i=e.document.head;if(null===i)r(new SyntaxError);else{const o=e.document.createElement("script"),a=new Blob([t],{type:"application/javascript"}),s=URL.createObjectURL(a),l=e.onerror,c=()=>{e.onerror=l,URL.revokeObjectURL(s)};e.onerror=(t,n,i,o,a)=>n===s||n===e.location.href&&1===i&&1===o?(c(),r(a),!1):null!==l?l(t,n,i,o,a):void 0,o.onerror=()=>{c(),r(new SyntaxError)},o.onload=()=>{c(),n()},o.src=s,o.type="module",i.appendChild(o)}})))(nl),hu,(gu=()=>new DOMException("","AbortError"),async e=>{try{const t=await fetch(e);if(t.ok)return[await t.text(),t.url]}catch{}throw gu()}),fl,pu,gl,El,new WeakMap,new WeakMap,((e,t)=>async()=>{if(null===e)return!0;if(null===t)return!1;const n=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),r=new t(1,128,44100),i=URL.createObjectURL(n);let o=!1,a=!1;try{await r.audioWorklet.addModule(i);const t=new e(r,"a",{numberOfOutputs:0}),n=r.createOscillator();t.port.onmessage=()=>o=!0,t.onprocessorerror=()=>a=!0,n.connect(t),n.start(0),await r.startRendering()}catch{}finally{URL.revokeObjectURL(i)}return o&&!a})(El,ml),nl):void 0;var gu;const vu=((e,t)=>n=>e(n)||t(n))(xl,gl),bu=((e,t,n,r,i,o,a,s,l,c,u)=>(d,h)=>{const f=a(d)?d:o(d);if(i.has(h)){const e=n();return Promise.reject(e)}try{i.add(h)}catch{}return t(l,(()=>l(f)))?f.decodeAudioData(h).then((n=>(Ka(h).catch((()=>{})),t(s,(()=>s(n)))||u(n),e.add(n),n))):new Promise(((t,n)=>{const i=async()=>{try{await Ka(h)}catch{}},o=e=>{n(e),i()};try{f.decodeAudioData(h,(n=>{"function"!=typeof n.copyFromChannel&&(c(n),Qo(n)),e.add(n),i().then((()=>t(n)))}),(e=>{o(null===e?r():e)}))}catch(e){o(e)}}))})(kl,$s,(()=>new DOMException("","DataCloneError")),(()=>new DOMException("","EncodingError")),new WeakSet,fl,vu,Ko,os,Nl,Bl),yu=(wu=mu,Su=Il,xu=Dl,Mu=$l,_u=rc,Au=bc,Eu=wc,Cu=_c,Tu=Cc,Iu=bu,ku=Ic,Ru=Pc,Ou=Bc,Pu=jc,Nu=Vc,Bu=Kc,Lu=nu,Du=iu,Uu=lu,Fu=uu,class extends Nu{constructor(e,t){super(e,t),this._nativeContext=e,this._audioWorklet=void 0===wu?void 0:{addModule:(e,t)=>wu(this,e,t)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new Su(this)}createBiquadFilter(){return new _u(this)}createBuffer(e,t,n){return new xu({length:t,numberOfChannels:e,sampleRate:n})}createBufferSource(){return new Mu(this)}createChannelMerger(e=6){return new Au(this,{numberOfInputs:e})}createChannelSplitter(e=6){return new Eu(this,{numberOfOutputs:e})}createConstantSource(){return new Cu(this)}createConvolver(){return new Tu(this)}createDelay(e=1){return new ku(this,{maxDelayTime:e})}createDynamicsCompressor(){return new Ru(this)}createGain(){return new Ou(this)}createIIRFilter(e,t){return new Pu(this,{feedback:t,feedforward:e})}createOscillator(){return new Bu(this)}createPanner(){return new Lu(this)}createPeriodicWave(e,t,n={disableNormalization:!1}){return new Du(this,{...n,imag:t,real:e})}createStereoPanner(){return new Uu(this)}createWaveShaper(){return new Fu(this)}decodeAudioData(e,t,n){return Iu(this._nativeContext,e).then((e=>("function"==typeof t&&t(e),e)),(e=>{throw"function"==typeof n&&n(e),e}))}});var wu,Su,xu,Mu,_u,Au,Eu,Cu,Tu,Iu,ku,Ru,Ou,Pu,Nu,Bu,Lu,Du,Uu,Fu;const zu=((e,t,n,r)=>class extends e{constructor(e,i){const o=n(e),a=t(o,i);if(r(o))throw TypeError();super(e,!0,a,null),this._nativeMediaElementAudioSourceNode=a}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}})(Cl,((e,t)=>e.createMediaElementSource(t.mediaElement)),fl,gl),ju=((e,t,n,r)=>class extends e{constructor(e,i){const o=n(e);if(r(o))throw new TypeError;const a={...is,...i},s=t(o,a);super(e,!1,s,null),this._nativeMediaStreamAudioDestinationNode=s}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}})(Cl,((e,t)=>{const n=e.createMediaStreamDestination();return ls(n,t),1===n.numberOfOutputs&&Object.defineProperty(n,"numberOfOutputs",{get:()=>0}),n}),fl,gl),Hu=((e,t,n,r)=>class extends e{constructor(e,i){const o=n(e),a=t(o,i);if(r(o))throw new TypeError;super(e,!0,a,null),this._nativeMediaStreamAudioSourceNode=a}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}})(Cl,((e,{mediaStream:t})=>{const n=t.getAudioTracks();n.sort(((e,t)=>e.id<t.id?-1:e.id>t.id?1:0));const r=n.slice(0,1),i=e.createMediaStreamSource(new MediaStream(r));return Object.defineProperty(i,"mediaStream",{value:t}),i}),fl,gl),Gu=((e,t)=>(n,{mediaStreamTrack:r})=>{if("function"==typeof n.createMediaStreamTrackSource)return n.createMediaStreamTrackSource(r);const i=new MediaStream([r]),o=n.createMediaStreamSource(i);if("audio"!==r.kind)throw e();if(t(n))throw new TypeError;return o})($a,gl),Vu=((e,t,n)=>class extends e{constructor(e,r){const i=n(e);super(e,!0,t(i,r),null)}})(Cl,Gu,fl),Wu=((e,t,n,r,i,o,a,s,l)=>class extends e{constructor(e={}){if(null===l)throw new Error("Missing the native AudioContext constructor.");let t;try{t=new l(e)}catch(e){if(12===e.code&&"sampleRate is not in range"===e.message)throw n();throw e}if(null===t)throw r();if(!da(e.latencyHint))throw new TypeError(`The provided value '${e.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(void 0!==e.sampleRate&&t.sampleRate!==e.sampleRate)throw n();super(t,2);const{latencyHint:i}=e,{sampleRate:o}=t;if(this._baseLatency="number"==typeof t.baseLatency?t.baseLatency:"balanced"===i?512/o:"interactive"===i||void 0===i?256/o:"playback"===i?1024/o:128*Math.max(2,Math.min(128,Math.round(i*o/128)))/o,this._nativeAudioContext=t,"webkitAudioContext"===l.name?(this._nativeGainNode=t.createGain(),this._nativeOscillatorNode=t.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(t.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,"running"===t.state){this._state="suspended";const e=()=>{"suspended"===this._state&&(this._state=null),t.removeEventListener("statechange",e)};t.addEventListener("statechange",e)}}get baseLatency(){return this._baseLatency}get state(){return null!==this._state?this._state:this._nativeAudioContext.state}close(){return"closed"===this.state?this._nativeAudioContext.close().then((()=>{throw t()})):("suspended"===this._state&&(this._state=null),this._nativeAudioContext.close().then((()=>{null!==this._nativeGainNode&&null!==this._nativeOscillatorNode&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),ua(this)})))}createMediaElementSource(e){return new i(this,{mediaElement:e})}createMediaStreamDestination(){return new o(this)}createMediaStreamSource(e){return new a(this,{mediaStream:e})}createMediaStreamTrackSource(e){return new s(this,{mediaStreamTrack:e})}resume(){return"suspended"===this._state?new Promise(((e,t)=>{const n=()=>{this._nativeAudioContext.removeEventListener("statechange",n),"running"===this._nativeAudioContext.state?e():this.resume().then(e,t)};this._nativeAudioContext.addEventListener("statechange",n)})):this._nativeAudioContext.resume().catch((e=>{if(void 0===e||15===e.code)throw t();throw e}))}suspend(){return this._nativeAudioContext.suspend().catch((e=>{if(void 0===e)throw t();throw e}))}})(yu,$a,Ts,Ns,zu,ju,Hu,Vu,Sl),qu=(Ku=Gc,e=>{const t=Ku.get(e);if(void 0===t)throw new Error("The context has no set of AudioWorkletNodes.");return t});var Ku;const Ju=(Qu=qu,(e,t)=>{Qu(e).add(t)});var Qu;const Xu=(e=>(t,n,r=0,i=0)=>{const o=t[r];if(void 0===o)throw e();return ka(n)?o.connect(n,0,i):o.connect(n,0)})(Jo),Yu=(e=>(t,n)=>{e(t).delete(n)})(qu),Zu=(e=>(t,n,r,i=0)=>void 0===n?t.forEach((e=>e.disconnect())):"number"==typeof n?Xa(e,t,n).disconnect():ka(n)?void 0===r?t.forEach((e=>e.disconnect(n))):void 0===i?Xa(e,t,r).disconnect(n,0):Xa(e,t,r).disconnect(n,0,i):void 0===r?t.forEach((e=>e.disconnect(n))):Xa(e,t,r).disconnect(n,0))(Jo),$u=new WeakMap,ed=(td=$u,nd=Do,e=>nd(td,e));var td,nd;const rd=((e,t,n,r,i,o,a,s,l,c,u,d,h)=>(f,p,m,g)=>{if(0===g.numberOfInputs&&0===g.numberOfOutputs)throw l();const v=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(v.some((e=>e<1)))throw l();if(v.length!==g.numberOfOutputs)throw t();if("explicit"!==g.channelCountMode)throw l();const b=g.channelCount*g.numberOfInputs,y=v.reduce(((e,t)=>e+t),0),w=void 0===m.parameterDescriptors?0:m.parameterDescriptors.length;if(b+w>6||y>6)throw l();const S=new MessageChannel,x=[],M=[];for(let e=0;e<g.numberOfInputs;e+=1)x.push(a(f,{channelCount:g.channelCount,channelCountMode:g.channelCountMode,channelInterpretation:g.channelInterpretation,gain:1})),M.push(i(f,{channelCount:g.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:g.channelCount}));const _=[];if(void 0!==m.parameterDescriptors)for(const{defaultValue:e,maxValue:t,minValue:n,name:r}of m.parameterDescriptors){const i=o(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:void 0!==g.parameterData[r]?g.parameterData[r]:void 0===e?0:e});Object.defineProperties(i.offset,{defaultValue:{get:()=>void 0===e?0:e},maxValue:{get:()=>void 0===t?Zo:t},minValue:{get:()=>void 0===n?Yo:n}}),_.push(i)}const A=r(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,b+w)}),E=ms(p,f.sampleRate),C=s(f,E,b+w,Math.max(1,y)),T=i(f,{channelCount:Math.max(1,y),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,y)}),I=[];for(let e=0;e<g.numberOfOutputs;e+=1)I.push(r(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:v[e]}));for(let e=0;e<g.numberOfInputs;e+=1){x[e].connect(M[e]);for(let t=0;t<g.channelCount;t+=1)M[e].connect(A,t,e*g.channelCount+t)}const k=new Ba(void 0===m.parameterDescriptors?[]:m.parameterDescriptors.map((({name:e},t)=>{const n=_[t];return n.connect(A,0,b+t),n.start(0),[e,n.offset]})));A.connect(C);let R=g.channelInterpretation,O=null;const P=0===g.numberOfOutputs?[C]:I,N={get bufferSize(){return E},get channelCount(){return g.channelCount},set channelCount(e){throw n()},get channelCountMode(){return g.channelCountMode},set channelCountMode(e){throw n()},get channelInterpretation(){return R},set channelInterpretation(e){for(const t of x)t.channelInterpretation=e;R=e},get context(){return C.context},get inputs(){return x},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return O},set onprocessorerror(e){"function"==typeof O&&N.removeEventListener("processorerror",O),O="function"==typeof e?e:null,"function"==typeof O&&N.addEventListener("processorerror",O)},get parameters(){return k},get port(){return S.port2},addEventListener:(...e)=>C.addEventListener(e[0],e[1],e[2]),connect:e.bind(null,P),disconnect:c.bind(null,P),dispatchEvent:(...e)=>C.dispatchEvent(e[0]),removeEventListener:(...e)=>C.removeEventListener(e[0],e[1],e[2])},B=new Map;var L,D;S.port1.addEventListener=(L=S.port1.addEventListener,(...e)=>{if("message"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=B.get(e[1]);void 0!==n?e[1]=n:(e[1]=e=>{u(f.currentTime,f.sampleRate,(()=>t(e)))},B.set(t,e[1]))}}return L.call(S.port1,e[0],e[1],e[2])}),S.port1.removeEventListener=(D=S.port1.removeEventListener,(...e)=>{if("message"===e[0]){const t=B.get(e[1]);void 0!==t&&(B.delete(e[1]),e[1]=t)}return D.call(S.port1,e[0],e[1],e[2])});let U=null;Object.defineProperty(S.port1,"onmessage",{get:()=>U,set:e=>{"function"==typeof U&&S.port1.removeEventListener("message",U),U="function"==typeof e?e:null,"function"==typeof U&&(S.port1.addEventListener("message",U),S.port1.start())}}),m.prototype.port=S.port1;let F=null;bs(f,N,m,g).then((e=>F=e));const z=Fa(g.numberOfInputs,g.channelCount),j=Fa(g.numberOfOutputs,v),H=void 0===m.parameterDescriptors?[]:m.parameterDescriptors.reduce(((e,{name:t})=>({...e,[t]:new Float32Array(128)})),{});let G=!0;const V=()=>{g.numberOfOutputs>0&&C.disconnect(T);for(let e=0,t=0;e<g.numberOfOutputs;e+=1){const n=I[e];for(let r=0;r<v[e];r+=1)T.disconnect(n,t+r,r);t+=v[e]}},W=new Map;C.onaudioprocess=({inputBuffer:e,outputBuffer:t})=>{if(null!==F){const n=d(N);for(let r=0;r<E;r+=128){for(let t=0;t<g.numberOfInputs;t+=1)for(let n=0;n<g.channelCount;n+=1)Da(e,z[t],n,n,r);void 0!==m.parameterDescriptors&&m.parameterDescriptors.forEach((({name:t},n)=>{Da(e,H,t,b+n,r)}));for(let e=0;e<g.numberOfInputs;e+=1)for(let t=0;t<v[e];t+=1)0===j[e][t].byteLength&&(j[e][t]=new Float32Array(128));try{const e=z.map(((e,t)=>{if(n[t].size>0)return W.set(t,E/128),e;const r=W.get(t);return void 0===r?[]:(e.every((e=>e.every((e=>0===e))))&&(1===r?W.delete(t):W.set(t,r-1)),e)})),i=u(f.currentTime+r/f.sampleRate,f.sampleRate,(()=>F.process(e,j,H)));G=i;for(let e=0,n=0;e<g.numberOfOutputs;e+=1){for(let i=0;i<v[e];i+=1)Ua(t,j[e],i,n+i,r);n+=v[e]}}catch(e){G=!1,N.dispatchEvent(new ErrorEvent("processorerror",{colno:e.colno,filename:e.filename,lineno:e.lineno,message:e.message}))}if(!G){for(let e=0;e<g.numberOfInputs;e+=1){x[e].disconnect(M[e]);for(let t=0;t<g.channelCount;t+=1)M[r].disconnect(A,t,e*g.channelCount+t)}if(void 0!==m.parameterDescriptors){const e=m.parameterDescriptors.length;for(let t=0;t<e;t+=1){const e=_[t];e.disconnect(A,0,b+t),e.stop()}}A.disconnect(C),C.onaudioprocess=null,q?V():Q();break}}}};let q=!1;const K=a(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0}),J=()=>C.connect(K).connect(f.destination),Q=()=>{C.disconnect(K),K.disconnect()};return J(),h(N,(()=>{if(G){Q(),g.numberOfOutputs>0&&C.connect(T);for(let e=0,t=0;e<g.numberOfOutputs;e+=1){const n=I[e];for(let r=0;r<v[e];r+=1)T.connect(n,t+r,r);t+=v[e]}}q=!0}),(()=>{G&&(J(),V()),q=!1}))})(Xu,Jo,$a,gc,Ss,xc,_s,Cs,Ts,Zu,hu,ed,hc),id=((e,t,n,r,i)=>(o,a,s,l,c,u)=>{if(null!==s)try{const t=new s(o,l,u),r=new Map;let a=null;if(Object.defineProperties(t,{channelCount:{get:()=>u.channelCount,set:()=>{throw e()}},channelCountMode:{get:()=>"explicit",set:()=>{throw e()}},onprocessorerror:{get:()=>a,set:e=>{"function"==typeof a&&t.removeEventListener("processorerror",a),a="function"==typeof e?e:null,"function"==typeof a&&t.addEventListener("processorerror",a)}}}),t.addEventListener=(h=t.addEventListener,(...e)=>{if("processorerror"===e[0]){const t="function"==typeof e[1]?e[1]:"object"==typeof e[1]&&null!==e[1]&&"function"==typeof e[1].handleEvent?e[1].handleEvent:null;if(null!==t){const n=r.get(e[1]);void 0!==n?e[1]=n:(e[1]=n=>{"error"===n.type?(Object.defineProperties(n,{type:{value:"processorerror"}}),t(n)):t(new ErrorEvent(e[0],{...n}))},r.set(t,e[1]))}}return h.call(t,"error",e[1],e[2]),h.call(t,...e)}),t.removeEventListener=(d=t.removeEventListener,(...e)=>{if("processorerror"===e[0]){const t=r.get(e[1]);void 0!==t&&(r.delete(e[1]),e[1]=t)}return d.call(t,"error",e[1],e[2]),d.call(t,e[0],e[1],e[2])}),0!==u.numberOfOutputs){const e=n(o,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(e).connect(o.destination);return i(t,(()=>e.disconnect()),(()=>e.connect(o.destination)))}return t}catch(e){if(11===e.code)throw r();throw e}var d,h;if(void 0===c)throw r();return ps(u),t(o,a,c,u)})($a,rd,_s,Ts,hc),od=((e,t,n,r,i,o,a,s,l,c,u,d,h,f,p,m)=>(g,v,b)=>{const y=new WeakMap;let w=null;return{render(S,x){s(x,S);const M=y.get(x);return void 0!==M?Promise.resolve(M):(async(s,S)=>{let x=u(s),M=null;const _=qo(x,S),A=Array.isArray(v.outputChannelCount)?v.outputChannelCount:Array.from(v.outputChannelCount);if(null===d){const e=A.reduce(((e,t)=>e+t),0),n=i(S,{channelCount:Math.max(1,e),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,e)}),o=[];for(let e=0;e<s.numberOfOutputs;e+=1)o.push(r(S,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:A[e]}));const c=a(S,{channelCount:v.channelCount,channelCountMode:v.channelCountMode,channelInterpretation:v.channelInterpretation,gain:1});c.connect=t.bind(null,o),c.disconnect=l.bind(null,o),M=[n,o,c]}else _||(x=new d(S,g));if(y.set(S,null===M?x:M[2]),null!==M){if(null===w){if(void 0===b)throw new Error("Missing the processor constructor.");if(null===h)throw new Error("Missing the native OfflineAudioContext constructor.");const e=s.channelCount*s.numberOfInputs,t=void 0===b.parameterDescriptors?0:b.parameterDescriptors.length,n=e+t,l=async()=>{const l=new h(n,128*Math.ceil(s.context.length/128),S.sampleRate),c=[],u=[];for(let e=0;e<v.numberOfInputs;e+=1)c.push(a(l,{channelCount:v.channelCount,channelCountMode:v.channelCountMode,channelInterpretation:v.channelInterpretation,gain:1})),u.push(i(l,{channelCount:v.channelCount,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:v.channelCount}));const d=await Promise.all(Array.from(s.parameters.values()).map((async e=>{const t=o(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:e.value});return await f(l,e,t.offset),t}))),g=r(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,e+t)});for(let e=0;e<v.numberOfInputs;e+=1){c[e].connect(u[e]);for(let t=0;t<v.channelCount;t+=1)u[e].connect(g,t,e*v.channelCount+t)}for(const[t,n]of d.entries())n.connect(g,0,e+t),n.start(0);return g.connect(l.destination),await Promise.all(c.map((e=>p(s,l,e)))),m(l)};w=ja(s,0===n?null:await l(),S,v,A,b,c)}const e=await w,t=n(S,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[l,u,d]=M;null!==e&&(t.buffer=e,t.start(0)),t.connect(l);for(let e=0,t=0;e<s.numberOfOutputs;e+=1){const n=u[e];for(let r=0;r<A[e];r+=1)l.connect(n,t+r,r);t+=A[e]}return d}if(_)for(const[t,n]of s.parameters.entries())await e(S,n,x.parameters.get(t));else for(const[e,t]of s.parameters.entries())await f(S,t,x.parameters.get(e));return await p(s,S,x),x})(S,x)}}})(Wl,Xu,Kl,gc,Ss,xc,_s,Yu,Zu,hu,_a,El,ml,Ql,ll,Dc),ad=(sd=fu,e=>sd.get(e));var sd;const ld=(e=>(t,n)=>{e.set(t,n)})($u),cd=(du&&((e,t,n,r,i,o,a,s,l,c,u,d,h,f)=>{})(Ju,Cl,Yl,od,id,sa,ad,fl,gl,El,(e=>({...e,outputChannelCount:void 0!==e.outputChannelCount?e.outputChannelCount:1===e.numberOfInputs&&1===e.numberOfOutputs?[e.channelCount]:Array.from({length:e.numberOfOutputs},(()=>1))})),ld,(e=>{const{port1:t,port2:n}=new MessageChannel;try{t.postMessage(e)}finally{t.close(),n.close()}}),Vs),((e,t,n,r,i)=>{})($a,Ts,Ns,Vc,Sl),((e,t)=>(n,r,i)=>{if(null===t)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(n,r,i)}catch(t){if("SyntaxError"===t.name)throw e();throw t}})(Ts,ml)),ud=((e,t,n,r,i,o,a,s)=>(l,c)=>n(l).render(l,c).then((()=>Promise.all(Array.from(r(c)).map((e=>n(e).render(e,c)))))).then((()=>i(c))).then((n=>("function"!=typeof n.copyFromChannel?(a(n),Qo(n)):t(o,(()=>o(n)))||s(n),e.add(n),n))))(kl,$s,al,qu,Dc,Ko,Nl,Bl);dd=Mo,hd=_l;var dd,hd;fd=Ao,pd=Al;var fd,pd;var md={};
63
63
  /*!
64
64
  Copyright (c) 2018 Jed Watson.
65
65
  Licensed under the MIT License (MIT), see
66
66
  http://jedwatson.github.io/classnames
67
- */!function(){"use strict";var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var o=typeof i;if("string"===o||"number"===o)n.push(i);else if(Array.isArray(i)){if(i.length){var a=t.apply(null,i);a&&n.push(a)}}else if("object"===o){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){n.push(i.toString());continue}for(var s in i)e.call(i,s)&&i[s]&&n.push(s)}}}return n.join(" ")}md?(t.default=t,md=t):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],(function(){return t})):window.classNames=t}();c=o("85Hg2");var gd={error:console.error,info:console.info,success:console.log};c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");var vd=({className:e,title:t,loading:r=!0})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:n(md)(e,{"memori-loading-icon":r}),"aria-label":t},n(c).createElement("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}));var bd=({primary:e=!1,outlined:t=!1,ghost:r=!1,padded:i=!0,shape:o="rounded",danger:a=!1,loading:s=!1,disabled:l=!1,block:u=!1,icon:d,className:h,title:f,htmlType:p,onClick:m,onTouchEnd:g,children:v})=>n(c).createElement("button",{type:p,onClick:m,onTouchEnd:g,title:f,disabled:s||l,className:n(md)(h,"memori-button",{"memori-button--primary":e,"memori-button--outlined":t,"memori-button--ghost":r,"memori-button--square":"square"===o,"memori-button--rounded":"rounded"===o,"memori-button--circle":"circle"===o,"memori-button--padded":i,"memori-button--block":u,"memori-button--with-icon":(d||s)&&v,"memori-button--icon-only":(d||s)&&!v,"memori-button--danger":a,"memori-button--loading":s})},d&&!s&&n(c).createElement("span",{className:"memori-button--icon"},d),s&&n(c).createElement("span",{className:"memori-button--icon loading-icon"},n(c).createElement(vd,{loading:!0})),v);c=o("85Hg2"),c=o("85Hg2");function yd(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,yd),r}c=o("85Hg2");var wd,Sd,xd=((Sd=xd||{})[Sd.None=0]="None",Sd[Sd.RenderStrategy=1]="RenderStrategy",Sd[Sd.Static=2]="Static",Sd),Md=((wd=Md||{})[wd.Unmount=0]="Unmount",wd[wd.Hidden=1]="Hidden",wd);function _d({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:a}){let s=Ed(t,e);if(o)return Ad(s,n,r,a);let l=null!=i?i:0;if(2&l){let{static:e=!1,...t}=s;if(e)return Ad(t,n,r,a)}if(1&l){let{unmount:e=!0,...t}=s;return yd(e?0:1,{0:()=>null,1:()=>Ad({...t,hidden:!0,style:{display:"none"}},n,r,a)})}return Ad(s,n,r,a)}function Ad(e,t={},n,r){let{as:i=n,children:o,refName:a="ref",...s}=Id(e,["unmount","static"]),l=void 0!==e.ref?{[a]:e.ref}:{},u="function"==typeof o?o(t):o;s.className&&"function"==typeof s.className&&(s.className=s.className(t));let d={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&n.push(r);e&&(d["data-headlessui-state"]=n.join(" "))}if(i===c.Fragment&&Object.keys(Td(s)).length>0){if(!(0,c.isValidElement)(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"));return(0,c.cloneElement)(u,Object.assign({},Ed(u.props,Td(Id(s,["ref"]))),d,l,function(...e){return{ref:e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(u.ref,l.ref)))}return(0,c.createElement)(i,Object.assign({},Id(s,["ref"]),i!==c.Fragment&&l,i!==c.Fragment&&d),u)}function Ed(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map((e=>[e,void 0]))));for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function Cd(e){var t;return Object.assign((0,c.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function Td(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function Id(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");const kd="undefined"==typeof window||"undefined"==typeof document;let Rd=kd?c.useEffect:c.useLayoutEffect;function Od(e){let t=(0,c.useRef)(e);return Rd((()=>{t.current=e}),[e]),t}let Pd=function(e){let t=Od(e);return n(c).useCallback(((...e)=>t.current(...e)),[t])},Nd=Symbol();function Bd(e,t=!0){return Object.assign(e,{[Nd]:t})}function Ld(...e){let t=(0,c.useRef)(e);(0,c.useEffect)((()=>{t.current=e}),[e]);let n=Pd((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[Nd])))?void 0:n}var Dd,Ud=((Dd=Ud||{}).Space=" ",Dd.Enter="Enter",Dd.Escape="Escape",Dd.Backspace="Backspace",Dd.Delete="Delete",Dd.ArrowLeft="ArrowLeft",Dd.ArrowUp="ArrowUp",Dd.ArrowRight="ArrowRight",Dd.ArrowDown="ArrowDown",Dd.Home="Home",Dd.End="End",Dd.PageUp="PageUp",Dd.PageDown="PageDown",Dd.Tab="Tab",Dd);function Fd(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}c=o("85Hg2"),c=o("85Hg2");let zd={serverHandoffComplete:!1};function jd(){let[e,t]=(0,c.useState)(zd.serverHandoffComplete);return(0,c.useEffect)((()=>{!0!==e&&t(!0)}),[e]),(0,c.useEffect)((()=>{!1===zd.serverHandoffComplete&&(zd.serverHandoffComplete=!0)}),[]),e}var Hd;let Gd=0;function Vd(){return++Gd}let Wd=null!=(Hd=n(c).useId)?Hd:function(){let e=jd(),[t,r]=n(c).useState(e?Vd:null);return Rd((()=>{null===t&&r(Vd())}),[t]),null!=t?""+t:void 0};c=o("85Hg2");var qd=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(qd||{});let Kd=Cd((function(e,t){let{features:n=1,...r}=e;return _d({ourProps:{ref:t,"aria-hidden":2==(2&n)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&n)&&2!=(2&n)&&{display:"none"}}},theirProps:r,slot:{},defaultTag:"div",name:"Hidden"})}));function Jd(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}function Qd(){let e=[],t=[],n={enqueue(e){t.push(e)},addEventListener:(e,t,r,i)=>(e.addEventListener(t,r,i),n.add((()=>e.removeEventListener(t,r,i)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return n.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>n.requestAnimationFrame((()=>n.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return n.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return Jd((()=>{t.current&&e[0]()})),n.add((()=>{t.current=!1}))},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0){let[t]=e.splice(n,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return n}function Xd(e){return kd?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Yd=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var Zd,$d,eh=(($d=eh||{})[$d.First=1]="First",$d[$d.Previous=2]="Previous",$d[$d.Next=4]="Next",$d[$d.Last=8]="Last",$d[$d.WrapAround=16]="WrapAround",$d[$d.NoScroll=32]="NoScroll",$d),th=((Zd=th||{})[Zd.Error=0]="Error",Zd[Zd.Overflow=1]="Overflow",Zd[Zd.Success=2]="Success",Zd[Zd.Underflow=3]="Underflow",Zd),nh=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(nh||{});function rh(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(Yd))}var ih=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(ih||{});function oh(e,t=0){var n;return e!==(null==(n=Xd(e))?void 0:n.body)&&yd(t,{0:()=>e.matches(Yd),1(){let t=e;for(;null!==t;){if(t.matches(Yd))return!0;t=t.parentElement}return!1}})}function ah(e){let t=Xd(e);Qd().nextFrame((()=>{t&&!oh(t.activeElement,0)&&sh(e)}))}function sh(e){null==e||e.focus({preventScroll:!0})}let lh=["textarea","input"].join(",");function ch(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),i=t(n);if(null===r||null===i)return 0;let o=r.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function uh(e,t){return dh(rh(),t,!0,e)}function dh(e,t,n=!0,r=null){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?ch(e):e:rh(e);r=null!=r?r:i.activeElement;let a,s=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,o.indexOf(r))-1;if(4&t)return Math.max(0,o.indexOf(r))+1;if(8&t)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&t?{preventScroll:!0}:{},u=0,d=o.length;do{if(u>=d||u+d<=0)return 0;let e=l+u;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}a=o[e],null==a||a.focus(c),u+=s}while(a!==i.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,lh))&&n}(a)&&a.select(),a.hasAttribute("tabindex")||a.setAttribute("tabindex","0"),2}c=o("85Hg2"),c=o("85Hg2");function hh(e,t,n){let r=Od(t);(0,c.useEffect)((()=>{function t(e){r.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)}),[e,n])}var fh=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(fh||{});function ph(){let e=(0,c.useRef)(0);return hh("keydown",(t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)}),!0),e}c=o("85Hg2");function mh(){let e=(0,c.useRef)(!1);return Rd((()=>(e.current=!0,()=>{e.current=!1})),[]),e}c=o("85Hg2");function gh(...e){return(0,c.useMemo)((()=>Xd(...e)),[...e])}c=o("85Hg2");function vh(e,t,n,r){let i=Od(n);(0,c.useEffect)((()=>{function n(e){i.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}),[e,t,r])}c=o("85Hg2");function bh(e,t){let n=(0,c.useRef)([]),r=Pd(e);(0,c.useEffect)((()=>{let e=[...n.current];for(let[i,o]of t.entries())if(n.current[i]!==o){let i=r(t,e);return n.current=t,i}}),[r,...t])}var yh=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(yh||{});let wh=Object.assign(Cd((function(e,t){let r=(0,c.useRef)(null),i=Ld(r,t),{initialFocus:o,containers:a,features:s=30,...l}=e;jd()||(s=1);let u=gh(r);!function({ownerDocument:e},t){let n=(0,c.useRef)(null);vh(null==e?void 0:e.defaultView,"focusout",(e=>{!t||n.current||(n.current=e.target)}),!0),bh((()=>{t||((null==e?void 0:e.activeElement)===(null==e?void 0:e.body)&&sh(n.current),n.current=null)}),[t]);let r=(0,c.useRef)(!1);(0,c.useEffect)((()=>(r.current=!1,()=>{r.current=!0,Jd((()=>{!r.current||(sh(n.current),n.current=null)}))})),[])}({ownerDocument:u},Boolean(16&s));let d=function({ownerDocument:e,container:t,initialFocus:n},r){let i=(0,c.useRef)(null),o=mh();return bh((()=>{if(!r)return;let a=t.current;!a||Jd((()=>{if(!o.current)return;let t=null==e?void 0:e.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===t)return void(i.current=t)}else if(a.contains(t))return void(i.current=t);null!=n&&n.current?sh(n.current):dh(a,eh.First)===th.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=null==e?void 0:e.activeElement}))}),[r]),i}({ownerDocument:u,container:r,initialFocus:o},Boolean(2&s));!function({ownerDocument:e,container:t,containers:n,previousActiveElement:r},i){let o=mh();vh(null==e?void 0:e.defaultView,"focus",(e=>{if(!i||!o.current)return;let a=new Set(null==n?void 0:n.current);a.add(t);let s=r.current;if(!s)return;let l=e.target;l&&l instanceof HTMLElement?function(e,t){var n;for(let r of e)if(null!=(n=r.current)&&n.contains(t))return!0;return!1}(a,l)?(r.current=l,sh(l)):(e.preventDefault(),e.stopPropagation(),sh(s)):sh(r.current)}),!0)}({ownerDocument:u,container:r,containers:a,previousActiveElement:d},Boolean(8&s));let h=ph(),f=Pd((()=>{let e=r.current;!e||yd(h.current,{[fh.Forwards]:()=>dh(e,eh.First),[fh.Backwards]:()=>dh(e,eh.Last)})})),p={ref:i};return n(c).createElement(n(c).Fragment,null,Boolean(4&s)&&n(c).createElement(Kd,{as:"button",type:"button",onFocus:f,features:qd.Focusable}),_d({ourProps:p,theirProps:l,defaultTag:"div",name:"FocusTrap"}),Boolean(4&s)&&n(c).createElement(Kd,{as:"button",type:"button",onFocus:f,features:qd.Focusable}))})),{features:yh});let Sh=new Set,xh=new Map;function Mh(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function _h(e){let t=xh.get(e);!t||(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function Ah(e,t=!0){Rd((()=>{if(!t||!e.current)return;let n=e.current,r=Xd(n);if(r){Sh.add(n);for(let e of xh.keys())e.contains(n)&&(_h(e),xh.delete(e));return r.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement){for(let t of Sh)if(e.contains(t))return;1===Sh.size&&(xh.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Mh(e))}})),()=>{if(Sh.delete(n),Sh.size>0)r.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement&&!xh.has(e)){for(let t of Sh)if(e.contains(t))return;xh.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Mh(e)}}));else for(let e of xh.keys())_h(e),xh.delete(e)}}}),[t])}c=o("85Hg2");let Eh=(0,(c=o("85Hg2")).createContext)(!1);function Ch(e){return n(c).createElement(Eh.Provider,{value:e.force},e.children)}function Th(e){let t=(0,c.useContext)(Eh),n=(0,c.useContext)(Oh),r=gh(e),[i,o]=(0,c.useState)((()=>{if(!t&&null!==n||kd)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let i=r.createElement("div");return i.setAttribute("id","headlessui-portal-root"),r.body.appendChild(i)}));return(0,c.useEffect)((()=>{null!==i&&(null!=r&&r.body.contains(i)||null==r||r.body.appendChild(i))}),[i,r]),(0,c.useEffect)((()=>{t||null!==n&&o(n.current)}),[n,o,t]),i}let Ih=c.Fragment,kh=Cd((function(e,t){let n=e,r=(0,c.useRef)(null),i=Ld(Bd((e=>{r.current=e})),t),o=gh(r),a=Th(r),[l]=(0,c.useState)((()=>{var e;return kd?null:null!=(e=null==o?void 0:o.createElement("div"))?e:null})),u=jd(),d=(0,c.useRef)(!1);return Rd((()=>{if(d.current=!1,a&&l)return a.contains(l)||(l.setAttribute("data-headlessui-portal",""),a.appendChild(l)),()=>{d.current=!0,Jd((()=>{var e;!d.current||!a||!l||(a.removeChild(l),a.childNodes.length<=0&&(null==(e=a.parentElement)||e.removeChild(a)))}))}}),[a,l]),u&&a&&l?(0,s.createPortal)(_d({ourProps:{ref:i},theirProps:n,defaultTag:Ih,name:"Portal"}),l):null})),Rh=c.Fragment,Oh=(0,c.createContext)(null),Ph=Cd((function(e,t){let{target:r,...i}=e,o={ref:Ld(t)};return n(c).createElement(Oh.Provider,{value:r},_d({ourProps:o,theirProps:i,defaultTag:Rh,name:"Popover.Group"}))})),Nh=Object.assign(kh,{Group:Ph});let Bh=(0,(c=o("85Hg2")).createContext)(null);function Lh(){let e=(0,c.useContext)(Bh);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Lh),e}return e}function Dh(){let[e,t]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=Pd((e=>(t((t=>[...t,e])),()=>t((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return n(c).createElement(Bh.Provider,{value:i},e.children)}),[t])]}let Uh=Cd((function(e,t){let n=Lh(),r=`headlessui-description-${Wd()}`,i=Ld(t);Rd((()=>n.register(r)),[r,n.register]);let o=e;return _d({ourProps:{ref:i,...n.props,id:r},theirProps:o,slot:n.slot||{},defaultTag:"p",name:n.name||"Description"})}));let Fh=(0,(c=o("85Hg2")).createContext)(null);Fh.displayName="OpenClosedContext";var zh=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(zh||{});function jh(){return(0,c.useContext)(Fh)}function Hh({value:e,children:t}){return n(c).createElement(Fh.Provider,{value:e},t)}let Gh=(0,(c=o("85Hg2")).createContext)((()=>{}));Gh.displayName="StackContext";var Vh=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Vh||{});function Wh({children:e,onUpdate:t,type:r,element:i,enabled:o}){let a=(0,c.useContext)(Gh),s=Pd(((...e)=>{null==t||t(...e),a(...e)}));return Rd((()=>{let e=void 0===o||!0===o;return e&&s(0,r,i),()=>{e&&s(1,r,i)}}),[s,r,i,o]),n(c).createElement(Gh.Provider,{value:s},e)}c=o("85Hg2"),c=o("85Hg2");function qh(e,t,n){let r=Od(t);(0,c.useEffect)((()=>{function t(e){r.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}function Kh(e,t,n=!0){let r=(0,c.useRef)(!1);function i(n,i){if(!r.current||n.defaultPrevented)return;let o=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e),a=i(n);if(null!==a&&a.getRootNode().contains(a)){for(let e of o){if(null===e)continue;let t=e instanceof HTMLElement?e:e.current;if(null!=t&&t.contains(a))return}return!oh(a,ih.Loose)&&-1!==a.tabIndex&&n.preventDefault(),t(n,a)}}(0,c.useEffect)((()=>{requestAnimationFrame((()=>{r.current=n}))}),[n]);let o=(0,c.useRef)(null);qh("mousedown",(e=>{var t,n;r.current&&(o.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)}),!0),qh("click",(e=>{!o.current||(i(e,(()=>o.current)),o.current=null)}),!0),qh("blur",(e=>i(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}var Jh=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Jh||{}),Qh=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Qh||{});let Xh={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},Yh=(0,c.createContext)(null);function Zh(e){let t=(0,c.useContext)(Yh);if(null===t){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Zh),t}return t}function $h(e,t){(0,c.useEffect)((()=>{var n;if(!t||!e)return;let r=Qd();function i(e,t,n){let i=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),r.add((()=>{Object.assign(e.style,{[t]:i})}))}let o=e.documentElement,a=(null!=(n=e.defaultView)?n:window).innerWidth-o.clientWidth;if(i(o,"overflow","hidden"),a>0){i(o,"paddingRight",`${a-(o.clientWidth-o.offsetWidth)}px`)}if(/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0){let e=window.pageYOffset;i(o,"position","fixed"),i(o,"marginTop",`-${e}px`),i(o,"width","100%"),r.add((()=>window.scrollTo(0,e)))}return r.dispose}),[e,t])}function ef(e,t){return yd(t.type,Xh,e,t)}Yh.displayName="DialogContext";let tf=xd.RenderStrategy|xd.Static,nf=Cd((function(e,t){let{open:r,onClose:i,initialFocus:o,__demoMode:a=!1,...s}=e,[l,u]=(0,c.useState)(0),d=jh();void 0===r&&null!==d&&(r=yd(d,{[zh.Open]:!0,[zh.Closed]:!1}));let h=(0,c.useRef)(new Set),f=(0,c.useRef)(null),p=Ld(f,t),m=(0,c.useRef)(null),g=gh(f),v=e.hasOwnProperty("open")||null!==d,b=e.hasOwnProperty("onClose");if(!v&&!b)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!b)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof r)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${r}`);if("function"!=typeof i)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${i}`);let y=r?0:1,[w,S]=(0,c.useReducer)(ef,{titleId:null,descriptionId:null,panelRef:(0,c.createRef)()}),x=Pd((()=>i(!1))),M=Pd((e=>S({type:0,id:e}))),_=!!jd()&&(!a&&0===y),A=l>1,E=null!==(0,c.useContext)(Yh),C=A?"parent":"leaf";Ah(f,!!A&&_),Kh((()=>{var e,t;return[...Array.from(null!=(e=null==g?void 0:g.querySelectorAll("body > *, [data-headlessui-portal]"))?e:[]).filter((e=>!(!(e instanceof HTMLElement)||e.contains(m.current)||w.panelRef.current&&e.contains(w.panelRef.current)))),null!=(t=w.panelRef.current)?t:f.current]}),x,_&&!A),vh(null==g?void 0:g.defaultView,"keydown",(e=>{e.defaultPrevented||e.key===Ud.Escape&&0===y&&(A||(e.preventDefault(),e.stopPropagation(),x()))})),$h(g,0===y&&!E),(0,c.useEffect)((()=>{if(0!==y||!f.current)return;let e=new IntersectionObserver((e=>{for(let t of e)0===t.boundingClientRect.x&&0===t.boundingClientRect.y&&0===t.boundingClientRect.width&&0===t.boundingClientRect.height&&x()}));return e.observe(f.current),()=>e.disconnect()}),[y,f,x]);let[T,I]=Dh(),k=`headlessui-dialog-${Wd()}`,R=(0,c.useMemo)((()=>[{dialogState:y,close:x,setTitleId:M},w]),[y,w,x,M]),O=(0,c.useMemo)((()=>({open:0===y})),[y]),P={ref:p,id:k,role:"dialog","aria-modal":0===y||void 0,"aria-labelledby":w.titleId,"aria-describedby":T};return n(c).createElement(Wh,{type:"Dialog",enabled:0===y,element:f,onUpdate:Pd(((e,t,n)=>{"Dialog"===t&&yd(e,{[Vh.Add](){h.current.add(n),u((e=>e+1))},[Vh.Remove](){h.current.add(n),u((e=>e-1))}})}))},n(c).createElement(Ch,{force:!0},n(c).createElement(Nh,null,n(c).createElement(Yh.Provider,{value:R},n(c).createElement(Nh.Group,{target:f},n(c).createElement(Ch,{force:!1},n(c).createElement(I,{slot:O,name:"Dialog.Description"},n(c).createElement(wh,{initialFocus:o,containers:h,features:_?yd(C,{parent:wh.features.RestoreFocus,leaf:wh.features.All&~wh.features.FocusLock}):wh.features.None},_d({ourProps:P,theirProps:s,slot:O,defaultTag:"div",features:tf,visible:0===y,name:"Dialog"})))))))),n(c).createElement(Kd,{features:qd.Hidden,ref:m}))})),rf=Cd((function(e,t){let[{dialogState:n,close:r}]=Zh("Dialog.Overlay");return _d({ourProps:{ref:Ld(t),id:`headlessui-dialog-overlay-${Wd()}`,"aria-hidden":!0,onClick:Pd((e=>{if(e.target===e.currentTarget){if(Fd(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),r()}}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n})),[n]),defaultTag:"div",name:"Dialog.Overlay"})})),of=Cd((function(e,t){let[{dialogState:r},i]=Zh("Dialog.Backdrop"),o=Ld(t),a=`headlessui-dialog-backdrop-${Wd()}`;(0,c.useEffect)((()=>{if(null===i.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")}),[i.panelRef]);let s=(0,c.useMemo)((()=>({open:0===r})),[r]);return n(c).createElement(Ch,{force:!0},n(c).createElement(Nh,null,_d({ourProps:{ref:o,id:a,"aria-hidden":!0},theirProps:e,slot:s,defaultTag:"div",name:"Dialog.Backdrop"})))})),af=Cd((function(e,t){let[{dialogState:n},r]=Zh("Dialog.Panel"),i=Ld(t,r.panelRef),o=`headlessui-dialog-panel-${Wd()}`,a=(0,c.useMemo)((()=>({open:0===n})),[n]);return _d({ourProps:{ref:i,id:o,onClick:Pd((e=>{e.stopPropagation()}))},theirProps:e,slot:a,defaultTag:"div",name:"Dialog.Panel"})})),sf=Cd((function(e,t){let[{dialogState:n,setTitleId:r}]=Zh("Dialog.Title"),i=`headlessui-dialog-title-${Wd()}`,o=Ld(t);(0,c.useEffect)((()=>(r(i),()=>r(null))),[i,r]);let a=(0,c.useMemo)((()=>({open:0===n})),[n]);return _d({ourProps:{ref:o,id:i},theirProps:e,slot:a,defaultTag:"h2",name:"Dialog.Title"})})),lf=Object.assign(nf,{Backdrop:of,Panel:af,Overlay:rf,Title:sf,Description:Uh});c=o("85Hg2");function cf(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function uf(e,...t){e&&t.length>0&&e.classList.add(...t)}function df(e,...t){e&&t.length>0&&e.classList.remove(...t)}var hf=(e=>(e.Ended="ended",e.Cancelled="cancelled",e))(hf||{});function ff(e,t,n,r){let i=n?"enter":"leave",o=Qd(),a=void 0!==r?cf(r):()=>{};"enter"===i&&(e.removeAttribute("hidden"),e.style.display="");let s=yd(i,{enter:()=>t.enter,leave:()=>t.leave}),l=yd(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=yd(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return df(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),uf(e,...s,...c),o.nextFrame((()=>{df(e,...c),uf(e,...l),function(e,t){let n=Qd();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,a]=[r,i].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t}));if(o+a!==0){let r=[];r.push(n.addEventListener(e,"transitionrun",(i=>{i.target===i.currentTarget&&(r.splice(0).forEach((e=>e())),r.push(n.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(t("ended"),r.splice(0).forEach((e=>e())))})),n.addEventListener(e,"transitioncancel",(e=>{e.target===e.currentTarget&&(t("cancelled"),r.splice(0).forEach((e=>e())))}))))})))}else t("ended");n.add((()=>t("cancelled"))),n.dispose}(e,(n=>("ended"===n&&(df(e,...s),uf(e,...t.entered)),a(n))))})),o.dispose}function pf(){let[e]=(0,c.useState)(Qd);return(0,c.useEffect)((()=>()=>e.dispose()),[e]),e}function mf({container:e,direction:t,classes:n,onStart:r,onStop:i}){let o=mh(),a=pf(),s=Od(t);Rd((()=>{let t=Qd();a.add(t.dispose);let l=e.current;if(l&&"idle"!==s.current&&o.current)return t.dispose(),r.current(s.current),t.add(ff(l,n.current,"enter"===s.current,(e=>{t.dispose(),yd(e,{[hf.Ended](){i.current(s.current)},[hf.Cancelled]:()=>{}})}))),t.dispose}),[t])}function gf(e=""){return e.split(" ").filter((e=>e.trim().length>1))}let vf=(0,(c=o("85Hg2")).createContext)(null);vf.displayName="TransitionContext";var bf,yf=((bf=yf||{}).Visible="visible",bf.Hidden="hidden",bf);let wf=(0,c.createContext)(null);function Sf(e){return"children"in e?Sf(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function xf(e,t){let n=Od(e),r=(0,c.useRef)([]),i=mh(),o=pf(),a=Pd(((e,t=Md.Hidden)=>{let a=r.current.findIndex((({el:t})=>t===e));-1!==a&&(yd(t,{[Md.Unmount](){r.current.splice(a,1)},[Md.Hidden](){r.current[a].state="hidden"}}),o.microTask((()=>{var e;!Sf(r)&&i.current&&(null==(e=n.current)||e.call(n))})))})),s=Pd((e=>{let t=r.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>a(e,Md.Unmount)})),l=(0,c.useRef)([]),u=(0,c.useRef)(Promise.resolve()),d=(0,c.useRef)({enter:[],leave:[],idle:[]}),h=Pd(((e,n,r)=>{l.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter((([t])=>t!==e))),null==t||t.chains.current[n].push([e,new Promise((e=>{l.current.push(e)}))]),null==t||t.chains.current[n].push([e,new Promise((e=>{Promise.all(d.current[n].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===n?u.current=u.current.then((()=>null==t?void 0:t.wait.current)).then((()=>r(n))):r(n)})),f=Pd(((e,t,n)=>{Promise.all(d.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=l.current.shift())||e()})).then((()=>n(t)))}));return(0,c.useMemo)((()=>({children:r,register:s,unregister:a,onStart:h,onStop:f,wait:u,chains:d})),[s,a,r,h,f,d,u])}function Mf(){}wf.displayName="NestingContext";let _f=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Af(e){var t;let n={};for(let r of _f)n[r]=null!=(t=e[r])?t:Mf;return n}let Ef=xd.RenderStrategy,Cf=Cd((function(e,t){let{beforeEnter:r,afterEnter:i,beforeLeave:o,afterLeave:a,enter:s,enterFrom:l,enterTo:u,entered:d,leave:h,leaveFrom:f,leaveTo:p,...m}=e,g=(0,c.useRef)(null),v=Ld(g,t),b=m.unmount?Md.Unmount:Md.Hidden,{show:y,appear:w,initial:S}=function(){let e=(0,c.useContext)(vf);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[x,M]=(0,c.useState)(y?"visible":"hidden"),_=function(){let e=(0,c.useContext)(wf);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:A,unregister:E}=_,C=(0,c.useRef)(null);(0,c.useEffect)((()=>A(g)),[A,g]),(0,c.useEffect)((()=>{if(b===Md.Hidden&&g.current)return y&&"visible"!==x?void M("visible"):yd(x,{hidden:()=>E(g),visible:()=>A(g)})}),[x,g,A,E,y,b]);let T=Od({enter:gf(s),enterFrom:gf(l),enterTo:gf(u),entered:gf(d),leave:gf(h),leaveFrom:gf(f),leaveTo:gf(p)}),I=function(e){let t=(0,c.useRef)(Af(e));return(0,c.useEffect)((()=>{t.current=Af(e)}),[e]),t}({beforeEnter:r,afterEnter:i,beforeLeave:o,afterLeave:a}),k=jd();(0,c.useEffect)((()=>{if(k&&"visible"===x&&null===g.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[g,x,k]);let R=S&&!w,O=!k||R||C.current===y?"idle":y?"enter":"leave",P=Pd((e=>yd(e,{enter:()=>I.current.beforeEnter(),leave:()=>I.current.beforeLeave(),idle:()=>{}}))),N=Pd((e=>yd(e,{enter:()=>I.current.afterEnter(),leave:()=>I.current.afterLeave(),idle:()=>{}}))),B=xf((()=>{M("hidden"),E(g)}),_);mf({container:g,classes:T,direction:O,onStart:Od((e=>{B.onStart(g,e,P)})),onStop:Od((e=>{B.onStop(g,e,N),"leave"===e&&!Sf(B)&&(M("hidden"),E(g))}))}),(0,c.useEffect)((()=>{!R||(b===Md.Hidden?C.current=null:C.current=y)}),[y,R,x]);let L=m,D={ref:v};return n(c).createElement(wf.Provider,{value:B},n(c).createElement(Hh,{value:yd(x,{visible:zh.Open,hidden:zh.Closed})},_d({ourProps:D,theirProps:L,defaultTag:"div",features:Ef,visible:"visible"===x,name:"Transition.Child"})))})),Tf=Cd((function(e,t){let{show:r,appear:i=!1,unmount:o,...a}=e,s=(0,c.useRef)(null),l=Ld(s,t);jd();let u=jh();if(void 0===r&&null!==u&&(r=yd(u,{[zh.Open]:!0,[zh.Closed]:!1})),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,h]=(0,c.useState)(r?"visible":"hidden"),f=xf((()=>{h("hidden")})),[p,m]=(0,c.useState)(!0),g=(0,c.useRef)([r]);Rd((()=>{!1!==p&&g.current[g.current.length-1]!==r&&(g.current.push(r),m(!1))}),[g,r]);let v=(0,c.useMemo)((()=>({show:r,appear:i,initial:p})),[r,i,p]);(0,c.useEffect)((()=>{if(r)h("visible");else if(Sf(f)){let e=s.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&h("hidden")}else h("hidden")}),[r,f]);let b={unmount:o};return n(c).createElement(wf.Provider,{value:f},n(c).createElement(vf.Provider,{value:v},_d({ourProps:{...b,as:c.Fragment,children:n(c).createElement(Cf,{ref:l,...b,...a})},theirProps:{},defaultTag:c.Fragment,features:Ef,visible:"visible"===d,name:"Transition"})))})),If=Cd((function(e,t){let r=null!==(0,c.useContext)(vf),i=null!==jh();return n(c).createElement(n(c).Fragment,null,!r&&i?n(c).createElement(Tf,{ref:t,...e}):n(c).createElement(Cf,{ref:t,...e}))})),kf=Object.assign(Tf,{Child:If,Root:Tf});c=o("85Hg2");var Rf=({spinning:e=!1,primary:t=!1,className:r,children:i})=>n(c).createElement("div",{className:n(md)("memori-spin",r,{"memori-spin--spinning":e,"memori-spin--primary":t})},i,n(c).createElement("div",{className:"memori-spin--spinner"},n(c).createElement(vd,{loading:!0})));c=o("85Hg2");var Of=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}));var Pf=({open:e=!1,onClose:t,className:r,title:i,description:o,children:a,footer:s,loading:l=!1,closable:u=!0,width:d="100%",widthMd:h="100%"})=>n(c).createElement(kf,{appear:!0,show:e,as:n(c).Fragment},n(c).createElement(lf,{open:e,onClose:t,className:n(md)("memori-modal",r)},n(c).createElement(kf.Child,{as:n(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},n(c).createElement("div",{className:"memori-modal--backdrop"})),n(c).createElement("div",{className:"memori-modal--container"},n(c).createElement("div",{className:"memori-modal--container-scrollable"},n(c).createElement(kf.Child,{as:n(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95"},n(c).createElement(lf.Panel,{className:"memori-modal--panel"},n(c).createElement("style",{dangerouslySetInnerHTML:{__html:`\n .memori-modal--panel {\n --memori-modal--width: ${d};\n --memori-modal--width-md: ${h};\n }\n `}}),u&&n(c).createElement("div",{className:"memori-modal--close"},n(c).createElement(bd,{ghost:!0,padded:!0,shape:"circle",icon:n(c).createElement(Of,null),onClick:()=>t(!1)})),n(c).createElement(Rf,{spinning:l},i&&n(c).createElement(lf.Title,{className:"memori-modal--title"},i),o&&n(c).createElement(lf.Description,{className:"memori-modal--description"},o),a,s&&n(c).createElement("div",{className:"memori-modal--footer"},s)))))))),Nf=(c=o("85Hg2"),e=>"checkbox"===e.type),Bf=e=>e instanceof Date,Lf=e=>null==e;const Df=e=>"object"==typeof e;var Uf=e=>!Lf(e)&&!Array.isArray(e)&&Df(e)&&!Bf(e),Ff=e=>Uf(e)&&e.target?Nf(e.target)?e.target.checked:e.target.value:e,zf=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),jf=e=>Array.isArray(e)?e.filter(Boolean):[],Hf=e=>void 0===e,Gf=(e,t,n)=>{if(!t||!Uf(e))return n;const r=jf(t.split(/[,[\].]+?/)).reduce(((e,t)=>Lf(e)?e:e[t]),e);return Hf(r)||r===e?Hf(e[t])?n:e[t]:r};const Vf="blur",Wf="focusout",qf="onBlur",Kf="onChange",Jf="onSubmit",Qf="onTouched",Xf="all",Yf="max",Zf="min",$f="maxLength",ep="minLength",tp="pattern",np="required",rp="validate";n(c).createContext(null);var ip=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const i=o;return t._proxyFormState[i]!==Xf&&(t._proxyFormState[i]=!r||Xf),n&&(n[i]=!0),e[i]}});return i},op=e=>Uf(e)&&!Object.keys(e).length,ap=(e,t,n)=>{const{name:r,...i}=e;return op(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find((e=>t[e]===(!n||Xf)))},sp=e=>Array.isArray(e)?e:[e];function lp(e){const t=n(c).useRef(e);t.current=e,n(c).useEffect((()=>{const n=!e.disabled&&t.current.subject.subscribe({next:t.current.callback});return()=>{n&&n.unsubscribe()}}),[e.disabled])}var cp=e=>"string"==typeof e,up=(e,t,n,r)=>cp(e)?(r&&t.watch.add(e),Gf(n,e)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),Gf(n,e)))):(t.watchAll=!!r,n),dp="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function hp(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(dp&&(e instanceof Blob||e instanceof FileList)||!n&&!Uf(e))return e;if(t=n?[]:{},Array.isArray(e)||(e=>{const t=e.constructor&&e.constructor.prototype;return Uf(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)t[n]=hp(e[n]);else t=e}return t}var fp=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},pp=e=>/^\w*$/.test(e),mp=e=>jf(e.replace(/["|']|\]/g,"").split(/\.|\[/));function gp(e,t,n){let r=-1;const i=pp(t)?[t]:mp(t),o=i.length,a=o-1;for(;++r<o;){const t=i[r];let o=n;if(r!==a){const n=e[t];o=Uf(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}e[t]=o,e=e[t]}return e}const vp=(e,t,n)=>{for(const r of n||Object.keys(e)){const n=Gf(e,r);if(n){const{_f:e,...r}=n;if(e&&t(e.name)){if(e.ref.focus){e.ref.focus();break}if(e.refs&&e.refs[0].focus){e.refs[0].focus();break}}else Uf(r)&&vp(r,t)}}};var bp=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))))),yp=(e,t,n)=>{const r=jf(Gf(e,n));return gp(r,"root",t[n]),gp(e,n,r),e},wp=e=>"boolean"==typeof e,Sp=e=>"file"===e.type,xp=e=>"function"==typeof e,Mp=e=>cp(e)||n(c).isValidElement(e),_p=e=>"radio"===e.type,Ap=e=>e instanceof RegExp;const Ep={value:!1,isValid:!1},Cp={value:!0,isValid:!0};var Tp=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Hf(e[0].attributes.value)?Hf(e[0].value)||""===e[0].value?Cp:{value:e[0].value,isValid:!0}:Cp:Ep}return Ep};const Ip={isValid:!1,value:null};var kp=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),Ip):Ip;function Rp(e,t,n="validate"){if(Mp(e)||Array.isArray(e)&&e.every(Mp)||wp(e)&&!e)return{type:n,message:Mp(e)?e:"",ref:t}}var Op=e=>Uf(e)&&!Ap(e)?e:{value:e,message:""},Pp=async(e,t,n,r,i)=>{const{ref:o,refs:a,required:s,maxLength:l,minLength:c,min:u,max:d,pattern:h,validate:f,name:p,valueAsNumber:m,mount:g,disabled:v}=e._f;if(!g||v)return{};const b=a?a[0]:o,y=e=>{r&&b.reportValidity&&(b.setCustomValidity(wp(e)?"":e||""),b.reportValidity())},w={},S=_p(o),x=Nf(o),M=S||x,_=(m||Sp(o))&&!o.value||""===t||Array.isArray(t)&&!t.length,A=fp.bind(null,p,n,w),E=(e,t,n,r=$f,i=ep)=>{const a=e?t:n;w[p]={type:e?r:i,message:a,ref:o,...A(e?r:i,a)}};if(i?!Array.isArray(t)||!t.length:s&&(!M&&(_||Lf(t))||wp(t)&&!t||x&&!Tp(a).isValid||S&&!kp(a).isValid)){const{value:e,message:t}=Mp(s)?{value:!!s,message:s}:Op(s);if(e&&(w[p]={type:np,message:t,ref:b,...A(np,t)},!n))return y(t),w}if(!(_||Lf(u)&&Lf(d))){let e,r;const i=Op(d),a=Op(u);if(Lf(t)||isNaN(t)){const n=o.valueAsDate||new Date(t),s=e=>new Date((new Date).toDateString()+" "+e),l="time"==o.type,c="week"==o.type;cp(i.value)&&t&&(e=l?s(t)>s(i.value):c?t>i.value:n>new Date(i.value)),cp(a.value)&&t&&(r=l?s(t)<s(a.value):c?t<a.value:n<new Date(a.value))}else{const n=o.valueAsNumber||(t?+t:t);Lf(i.value)||(e=n>i.value),Lf(a.value)||(r=n<a.value)}if((e||r)&&(E(!!e,i.message,a.message,Yf,Zf),!n))return y(w[p].message),w}if((l||c)&&!_&&(cp(t)||i&&Array.isArray(t))){const e=Op(l),r=Op(c),i=!Lf(e.value)&&t.length>e.value,o=!Lf(r.value)&&t.length<r.value;if((i||o)&&(E(i,e.message,r.message),!n))return y(w[p].message),w}if(h&&!_&&cp(t)){const{value:e,message:r}=Op(h);if(Ap(e)&&!t.match(e)&&(w[p]={type:tp,message:r,ref:o,...A(tp,r)},!n))return y(r),w}if(f)if(xp(f)){const e=Rp(await f(t),b);if(e&&(w[p]={...e,...A(rp,e.message)},!n))return y(e.message),w}else if(Uf(f)){let e={};for(const r in f){if(!op(e)&&!n)break;const i=Rp(await f[r](t),b,r);i&&(e={...i,...A(r,i.message)},y(i.message),n&&(w[p]=e))}if(!op(e)&&(w[p]={ref:b,...e},!n))return w}return y(!0),w};var Np=e=>({isOnSubmit:!e||e===Jf,isOnBlur:e===qf,isOnChange:e===Kf,isOnAll:e===Xf,isOnTouch:e===Qf});function Bp(e){for(const t in e)if(!Hf(e[t]))return!1;return!0}function Lp(e,t){const n=pp(t)?[t]:mp(t),r=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Hf(e)?r++:e[t[r++]];return e}(e,n),i=n[n.length-1];let o;r&&delete r[i];for(let t=0;t<n.slice(0,-1).length;t++){let r,i=-1;const a=n.slice(0,-(t+1)),s=a.length-1;for(t>0&&(o=e);++i<a.length;){const t=a[i];r=r?r[t]:e[t],s===i&&(Uf(r)&&op(r)||Array.isArray(r)&&Bp(r))&&(o?delete o[t]:delete e[t]),o=r}}return e}function Dp(){let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}}var Up=e=>Lf(e)||!Df(e);function Fp(e,t){if(Up(e)||Up(t))return e===t;if(Bf(e)&&Bf(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const n=e[i];if(!r.includes(i))return!1;if("ref"!==i){const e=t[i];if(Bf(n)&&Bf(e)||Uf(n)&&Uf(e)||Array.isArray(n)&&Array.isArray(e)?!Fp(n,e):n!==e)return!1}}return!0}var zp=e=>{const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},jp=e=>"select-multiple"===e.type,Hp=e=>zp(e)&&e.isConnected,Gp=e=>{for(const t in e)if(xp(e[t]))return!0;return!1};function Vp(e,t={}){const n=Array.isArray(e);if(Uf(e)||n)for(const n in e)Array.isArray(e[n])||Uf(e[n])&&!Gp(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Vp(e[n],t[n])):Lf(e[n])||(t[n]=!0);return t}function Wp(e,t,n){const r=Array.isArray(e);if(Uf(e)||r)for(const r in e)Array.isArray(e[r])||Uf(e[r])&&!Gp(e[r])?Hf(t)||Up(n[r])?n[r]=Array.isArray(e[r])?Vp(e[r],[]):{...Vp(e[r])}:Wp(e[r],Lf(t)?{}:t[r],n[r]):Fp(e[r],t[r])?delete n[r]:n[r]=!0;return n}var qp=(e,t)=>Wp(e,t,Vp(t)),Kp=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Hf(e)?e:t?""===e?NaN:e?+e:e:n&&cp(e)?new Date(e):r?r(e):e;function Jp(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return Sp(t)?t.files:_p(t)?kp(e.refs).value:jp(t)?[...t.selectedOptions].map((({value:e})=>e)):Nf(t)?Tp(e.refs).value:Kp(Hf(t.value)?e.ref.value:t.value,e)}var Qp=e=>Hf(e)?e:Ap(e)?e.source:Uf(e)?Ap(e.value)?e.value.source:e.value:e;function Xp(e,t,n){const r=Gf(e,n);if(r||pp(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const r=i.join("."),o=Gf(t,r),a=Gf(e,r);if(o&&!Array.isArray(o)&&n!==r)return{name:n};if(a&&a.type)return{name:r,error:a};i.pop()}return{name:n}}const Yp={mode:Jf,reValidateMode:Kf,shouldFocusError:!0};function Zp(e={}){let t,n={...Yp,...e},r={submitCount:0,isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},o=hp(n.defaultValues)||{},a=n.shouldUnregister?{}:hp(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c=0,u={};const d={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={watch:Dp(),array:Dp(),state:Dp()},f=Np(n.mode),p=Np(n.reValidateMode),m=n.criteriaMode===Xf,g=async()=>{let e=!1;return d.isValid&&(e=n.resolver?op((await w()).errors):await S(i,!0),e!==r.isValid&&(r.isValid=e,h.state.next({isValid:e}))),e},v=(e,t,n,r)=>{const l=Gf(i,e);if(l){const i=Gf(a,e,Hf(n)?Gf(o,e):n);Hf(i)||r&&r.defaultChecked||t?gp(a,e,t?i:Jp(l._f)):_(e,i),s.mount&&g()}},b=(e,t,n,i,a)=>{let s=!1,l=!1;const c={name:e};if(d.isDirty&&(l=r.isDirty,r.isDirty=c.isDirty=x(),s=l!==c.isDirty),d.dirtyFields&&(!n||i)){l=Gf(r.dirtyFields,e);const n=Fp(Gf(o,e),t);n?Lp(r.dirtyFields,e):gp(r.dirtyFields,e,!0),c.dirtyFields=r.dirtyFields,s=s||l!==!n}if(n){const t=Gf(r.touchedFields,e);t||(gp(r.touchedFields,e,n),c.touchedFields=r.touchedFields,s=s||d.touchedFields&&t!==n)}return s&&a&&h.state.next(c),s?c:{}},y=(n,i,o,a)=>{const s=Gf(r.errors,n),l=d.isValid&&wp(i)&&r.isValid!==i;var f;if(e.delayError&&o?(f=()=>((e,t)=>{gp(r.errors,e,t),h.state.next({errors:r.errors})})(n,o),t=e=>{clearTimeout(c),c=window.setTimeout(f,e)},t(e.delayError)):(clearTimeout(c),t=null,o?gp(r.errors,n,o):Lp(r.errors,n)),(o?!Fp(s,o):s)||!op(a)||l){const e={...a,...l&&wp(i)?{isValid:i}:{},errors:r.errors,name:n};r={...r,...e},h.state.next(e)}u[n]--,d.isValidating&&!Object.values(u).some((e=>e))&&(h.state.next({isValidating:!1}),u={})},w=async e=>n.resolver?await n.resolver({...a},n.context,((e,t,n,r)=>{const i={};for(const n of e){const e=Gf(t,n);e&&gp(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}})(e||l.mount,i,n.criteriaMode,n.shouldUseNativeValidation)):{},S=async(e,t,i={valid:!0})=>{for(const o in e){const s=e[o];if(s){const{_f:e,...o}=s;if(e){const o=l.array.has(e.name),c=await Pp(s,Gf(a,e.name),m,n.shouldUseNativeValidation,o);if(c[e.name]&&(i.valid=!1,t))break;!t&&(Gf(c,e.name)?o?yp(r.errors,c,e.name):gp(r.errors,e.name,c[e.name]):Lp(r.errors,e.name))}o&&await S(o,t,i)}}return i.valid},x=(e,t)=>(e&&t&&gp(a,e,t),!Fp(I(),o)),M=(e,t,n)=>up(e,l,{...s.mount?a:Hf(t)?o:cp(e)?{[e]:t}:t},n),_=(e,t,n={})=>{const r=Gf(i,e);let o=t;if(r){const n=r._f;n&&(!n.disabled&&gp(a,e,Kp(t,n)),o=dp&&zp(n.ref)&&Lf(t)?"":t,jp(n.ref)?[...n.ref.options].forEach((e=>e.selected=o.includes(e.value))):n.refs?Nf(n.ref)?n.refs.length>1?n.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find((t=>t===e.value)):o===e.value))):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach((e=>e.checked=e.value===o)):Sp(n.ref)?n.ref.value="":(n.ref.value=o,n.ref.type||h.watch.next({name:e})))}(n.shouldDirty||n.shouldTouch)&&b(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&T(e)},A=(e,t,n)=>{for(const r in t){const o=t[r],a=`${e}.${r}`,s=Gf(i,a);!l.array.has(e)&&Up(o)&&(!s||s._f)||Bf(o)?_(a,o,n):A(a,o,n)}},E=(e,t,n={})=>{const s=Gf(i,e),c=l.array.has(e),u=hp(t);gp(a,e,u),c?(h.array.next({name:e,values:a}),(d.isDirty||d.dirtyFields)&&n.shouldDirty&&(r.dirtyFields=qp(o,a),h.state.next({name:e,dirtyFields:r.dirtyFields,isDirty:x(e,u)}))):!s||s._f||Lf(u)?_(e,u,n):A(e,u,n),bp(e,l)&&h.state.next({}),h.watch.next({name:e})},C=async e=>{const o=e.target;let s=o.name;const c=Gf(i,s);if(c){let S,x;const M=o.type?Jp(c._f):Ff(e),_=e.type===Vf||e.type===Wf,A=!((v=c._f).mount&&(v.required||v.min||v.max||v.maxLength||v.minLength||v.pattern||v.validate)||n.resolver||Gf(r.errors,s)||c._f.deps)||((e,t,n,r,i)=>!i.isOnAll&&(!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e))(_,Gf(r.touchedFields,s),r.isSubmitted,p,f),E=bp(s,l,_);gp(a,s,M),_?(c._f.onBlur&&c._f.onBlur(e),t&&t(0)):c._f.onChange&&c._f.onChange(e);const C=b(s,M,_,!1),I=!op(C)||E;if(!_&&h.watch.next({name:s,type:e.type}),A)return d.isValid&&g(),I&&h.state.next({name:s,...E?{}:C});if(!_&&E&&h.state.next({}),u[s]=u[s]?u[s]+1:1,h.state.next({isValidating:!0}),n.resolver){const{errors:e}=await w([s]),t=Xp(r.errors,i,s),n=Xp(e,i,t.name||s);S=n.error,s=n.name,x=op(e)}else S=(await Pp(c,Gf(a,s),m,n.shouldUseNativeValidation))[s],g();c._f.deps&&T(c._f.deps),y(s,x,S,C)}var v},T=async(e,t={})=>{let o,a;const s=sp(e);if(h.state.next({isValidating:!0}),n.resolver){const t=await(async e=>{const{errors:t}=await w();if(e)for(const n of e){const e=Gf(t,n);e?gp(r.errors,n,e):Lp(r.errors,n)}else r.errors=t;return t})(Hf(e)?e:s);o=op(t),a=e?!s.some((e=>Gf(t,e))):o}else e?(a=(await Promise.all(s.map((async e=>{const t=Gf(i,e);return await S(t&&t._f?{[e]:t}:t)})))).every(Boolean),(a||r.isValid)&&g()):a=o=await S(i);return h.state.next({...!cp(e)||d.isValid&&o!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:o}:{},errors:r.errors,isValidating:!1}),t.shouldFocus&&!a&&vp(i,(e=>e&&Gf(r.errors,e)),e?s:l.mount),a},I=e=>{const t={...o,...s.mount?a:{}};return Hf(e)?t:cp(e)?Gf(t,e):e.map((e=>Gf(t,e)))},k=(e,t)=>({invalid:!!Gf((t||r).errors,e),isDirty:!!Gf((t||r).dirtyFields,e),isTouched:!!Gf((t||r).touchedFields,e),error:Gf((t||r).errors,e)}),R=(e,t={})=>{for(const s of e?sp(e):l.mount)l.mount.delete(s),l.array.delete(s),Gf(i,s)&&(t.keepValue||(Lp(i,s),Lp(a,s)),!t.keepError&&Lp(r.errors,s),!t.keepDirty&&Lp(r.dirtyFields,s),!t.keepTouched&&Lp(r.touchedFields,s),!n.shouldUnregister&&!t.keepDefaultValue&&Lp(o,s));h.watch.next({}),h.state.next({...r,...t.keepDirty?{isDirty:x()}:{}}),!t.keepIsValid&&g()},O=(e,t={})=>{let r=Gf(i,e);const c=wp(t.disabled);return gp(i,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),r?c&&gp(a,e,t.disabled?void 0:Gf(a,e,Jp(r._f))):v(e,!0,t.value),{...c?{disabled:t.disabled}:{},...n.shouldUseNativeValidation?{required:!!t.required,min:Qp(t.min),max:Qp(t.max),minLength:Qp(t.minLength),maxLength:Qp(t.maxLength),pattern:Qp(t.pattern)}:{},name:e,onChange:C,onBlur:C,ref:a=>{if(a){O(e,t),r=Gf(i,e);const n=Hf(a.value)&&a.querySelectorAll&&a.querySelectorAll("input,select,textarea")[0]||a,s=(e=>_p(e)||Nf(e))(n),l=r._f.refs||[];if(s?l.find((e=>e===n)):n===r._f.ref)return;gp(i,e,{_f:{...r._f,...s?{refs:[...l.filter(Hp),n,...Array.isArray(Gf(o,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),v(e,!1,void 0,n)}else r=Gf(i,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!zf(l.array,e)||!s.action)&&l.unMount.add(e)}}},P=()=>n.shouldFocusError&&vp(i,(e=>e&&Gf(r.errors,e)),l.mount);return{control:{register:O,unregister:R,getFieldState:k,_executeSchema:w,_focusError:P,_getWatch:M,_getDirty:x,_updateValid:g,_removeUnmounted:()=>{for(const e of l.unMount){const t=Gf(i,e);t&&(t._f.refs?t._f.refs.every((e=>!Hp(e))):!Hp(t._f.ref))&&R(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],n,l,c=!0,u=!0)=>{if(l&&n){if(s.action=!0,u&&Array.isArray(Gf(i,e))){const t=n(Gf(i,e),l.argA,l.argB);c&&gp(i,e,t)}if(u&&Array.isArray(Gf(r.errors,e))){const t=n(Gf(r.errors,e),l.argA,l.argB);c&&gp(r.errors,e,t),((e,t)=>{!jf(Gf(e,t)).length&&Lp(e,t)})(r.errors,e)}if(d.touchedFields&&u&&Array.isArray(Gf(r.touchedFields,e))){const t=n(Gf(r.touchedFields,e),l.argA,l.argB);c&&gp(r.touchedFields,e,t)}d.dirtyFields&&(r.dirtyFields=qp(o,a)),h.state.next({isDirty:x(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else gp(a,e,t)},_getFieldArray:t=>jf(Gf(s.mount?a:o,t,e.shouldUnregister?Gf(o,t,[]):[])),_subjects:h,_proxyFormState:d,get _fields(){return i},get _formValues(){return a},get _stateFlags(){return s},set _stateFlags(e){s=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:T,register:O,handleSubmit:(e,t)=>async o=>{o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let s=!0,l=hp(a);h.state.next({isSubmitting:!0});try{if(n.resolver){const{errors:e,values:t}=await w();r.errors=e,l=t}else await S(i);op(r.errors)?(h.state.next({errors:{},isSubmitting:!0}),await e(l,o)):(t&&await t({...r.errors},o),P())}catch(e){throw s=!1,e}finally{r.isSubmitted=!0,h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:op(r.errors)&&s,submitCount:r.submitCount+1,errors:r.errors})}},watch:(e,t)=>xp(e)?h.watch.subscribe({next:n=>e(M(void 0,t),n)}):M(e,t,!0),setValue:E,getValues:I,reset:(t,n)=>((t,n={})=>{const c=t||o,u=hp(c),f=t&&!op(t)?u:o;if(n.keepDefaultValues||(o=c),!n.keepValues){if(n.keepDirtyValues)for(const e of l.mount)Gf(r.dirtyFields,e)?gp(f,e,Gf(a,e)):E(e,Gf(f,e));else{if(dp&&Hf(t))for(const e of l.mount){const t=Gf(i,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(zp(e)){const t=e.closest("form");if(t){t.reset();break}}}}i={}}a=e.shouldUnregister?n.keepDefaultValues?hp(o):{}:u,h.array.next({values:f}),h.watch.next({values:f})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!n.keepIsValid,s.watch=!!e.shouldUnregister,h.state.next({submitCount:n.keepSubmitCount?r.submitCount:0,isDirty:n.keepDirty||n.keepDirtyValues?r.isDirty:!(!n.keepDefaultValues||Fp(t,o)),isSubmitted:!!n.keepIsSubmitted&&r.isSubmitted,dirtyFields:n.keepDirty||n.keepDirtyValues?r.dirtyFields:n.keepDefaultValues&&t?qp(o,t):{},touchedFields:n.keepTouched?r.touchedFields:{},errors:n.keepErrors?r.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(xp(t)?t(a):t,n),resetField:(e,t={})=>{Gf(i,e)&&(Hf(t.defaultValue)?E(e,Gf(o,e)):(E(e,t.defaultValue),gp(o,e,t.defaultValue)),t.keepTouched||Lp(r.touchedFields,e),t.keepDirty||(Lp(r.dirtyFields,e),r.isDirty=t.defaultValue?x(e,Gf(o,e)):x()),t.keepError||(Lp(r.errors,e),d.isValid&&g()),h.state.next({...r}))},clearErrors:e=>{e?sp(e).forEach((e=>Lp(r.errors,e))):r.errors={},h.state.next({errors:r.errors})},unregister:R,setError:(e,t,n)=>{const o=(Gf(i,e,{_f:{}})._f||{}).ref;gp(r.errors,e,{...t,ref:o}),h.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&o&&o.focus&&o.focus()},setFocus:(e,t={})=>{const n=Gf(i,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:k}}function $p(e={}){const t=n(c).useRef(),[r,i]=n(c).useState({isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:e.defaultValues});t.current||(t.current={...Zp(e),formState:r});const o=t.current.control;return o._options=e,lp({subject:o._subjects.state,callback:n(c).useCallback((e=>{ap(e,o._proxyFormState,!0)&&(o._formState={...o._formState,...e},i({...o._formState}))}),[o])}),n(c).useEffect((()=>{o._stateFlags.mount||(o._proxyFormState.isValid&&o._updateValid(),o._stateFlags.mount=!0),o._stateFlags.watch&&(o._stateFlags.watch=!1,o._subjects.state.next({})),o._removeUnmounted()})),n(c).useEffect((()=>{r.submitCount&&o._focusError()}),[o,r.submitCount]),t.current.formState=ip(r,o),t.current}c=o("85Hg2");var em=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),n(c).createElement("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"}));var tm=({pwdOrTokens:e,setPwdOrTokens:t,onFinish:r,minimumNumberOfRecoveryTokens:i=1,showTokens:o=!0,openModal:a=!1,withModal:s=!1})=>{var l;const{t:u}=yo(),{register:d,handleSubmit:h,formState:{errors:f},setError:p}=$p(),[m,g]=(0,c.useState)(1),[v,b]=(0,c.useState)(!!e),y=n(c).createElement("form",{name:"memoriAuth",onSubmit:h((t=>{var n,o,a;"password"===e&&!(null===(n=t.password)||void 0===n?void 0:n.length)||"tokens"===e&&(((null===(o=null==t?void 0:t.tokens)||void 0===o?void 0:o.length)||0)<i||!(null===(a=null==t?void 0:t.tokens)||void 0===a?void 0:a.every((e=>e.length))))?p("tokens",{type:"minLength",message:"Tokens"}):r&&r(t).then((()=>{b(!1)}))})),className:"memori-auth-widget--form"},("password"===e||!o)&&n(c).createElement("fieldset",{className:"memori-auth-widget--password-fieldset"},n(c).createElement("label",null,"Password:"," ",n(c).createElement("input",{className:"memori-auth-widget--input",required:!0,type:"password",placeholder:"Password",...d("password",{required:!0})})),o&&n(c).createElement(n(c).Fragment,null,n(c).createElement("hr",null),n(c).createElement(bd,{outlined:!0,onClick:()=>t("tokens")},u("auth.useRecoveryTokens")||"Recovery tokens"))),"tokens"===e&&o&&n(c).createElement("fieldset",{className:"memori-auth-widget--tokens-fieldset",name:"tokens"},n(c).createElement("legend",null,u("auth.tokens"),": "),(w=m,Array.from({length:w},((e,t)=>t))).map((e=>n(c).createElement("label",{className:"memori-auth-widget--token",key:e},n(c).createElement("input",{type:"password",className:"memori-auth-widget--input",placeholder:"Recovery token",required:!0,autoComplete:"off",...d(`tokens.${e}`,{required:!0})})))),n(c).createElement(bd,{onClick:()=>g((e=>e+1)),className:"memori-auth-widget--token-add",icon:n(c).createElement(em,null)},u("auth.addToken")||"Add token"),n(c).createElement("hr",null),n(c).createElement(bd,{outlined:!0,onClick:()=>t("password")},u("auth.usePassword")||"Password")),"minLength"===(null===(l=f.tokens)||void 0===l?void 0:l.type)&&n(c).createElement("div",{className:"memori-auth-widget--error"},u("auth.atLeast")||"At least"," ",i),n(c).createElement(bd,{htmlType:"submit",primary:!0,className:"memori-auth-widget--submit"},u("confirm")||"Submit"));var w;return s?n(c).createElement(Pf,{open:a||v,title:"Authentication",onClose:()=>t(null),closable:!1},y):y};c=o("85Hg2"),c=o("85Hg2");const nm=()=>{let e=!1;if("maxTouchPoints"in navigator)e=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)e=navigator.msMaxTouchPoints>0;else{const n=window&&"matchMedia"in window&&matchMedia("(pointer:coarse)");if(n&&"(pointer:coarse)"===n.media)e=!!n.matches;else if("orientation"in window)e=!0;else{var t=null===navigator||void 0===navigator?void 0:navigator.userAgent;e=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(t)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(t)}}return e};const rm=e=>e.slice(0,e.length/2).trim().toLowerCase()===e.slice(e.length/2+1).trim().toLowerCase()?e.slice(0,e.length/2):e,im=({type:e,resourceURI:t,sessionID:n,baseURL:r=""})=>{var i,o;let a="cover"===e?`${r}/images/memoriCover.png`:`${r}/images/memoriAvatar.png`;return t&&0!==t.length?t.includes("memoriai/memory")&&!t.includes("memori-ai-session-id")&&n?`${t}?memori-ai-session-id=${n}`:t.startsWith("https://")||t.startsWith("http://")?`${t}${n?`/${n}`:""}`:t.startsWith("cloud://")?`${i=void 0,(void 0===i?void 0:i.replace(/v2/,"v1"))||""}/CloudAsset/${t.replace("cloud://","")}`:t.startsWith("guid://")?`${o=void 0,(void 0===o?void 0:o.replace(/v2/,"v1"))||""}/GuidAsset/${t.replace("guid://","")}`:a:a};c=o("85Hg2"),c=o("85Hg2");var om=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}));var am=({message:e,memori:t,tenant:r,baseUrl:i})=>n(c).createElement(n(c).Fragment,null,e.initial&&n(c).createElement("div",{className:"memori-chat--bubble-initial"}),n(c).createElement(kf,{show:!0,appear:!0,as:"div",className:n(md)("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!e.fromUser})},!e.fromUser&&n(c).createElement(kf.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15")},n(c).createElement("source",{src:im({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:t.avatarURL,baseURL:i})}),n(c).createElement("img",{className:"memori-chat--bubble-avatar-img",alt:t.name,src:t.avatarURL&&t.avatarURL.length>0?im({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:t.avatarURL,baseURL:i}):im({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i||"https://app.twincreator.com"})})),n(c).createElement(kf.Child,{as:"div",className:n(md)("memori-chat--bubble",{"memori-chat--user-bubble":!!e.fromUser}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30")},(e.translatedText||e.text).split(/\r\n|\r|\n/).map(((e,t)=>n(c).createElement("p",{key:t},e)))),e.fromUser&&n(c).createElement(kf.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15")},n(c).createElement(om,null))));c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");var sm,lm=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})),cm={};sm=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function n(e,n){var r=e.el,i=e.elStyle,o=e.elHeight,a=e.rowsLimit,s=e.rowsWrapped,l=e.options,c=e.buffer,u=c;if(s===a+1)return t({},e);var d=c,h=s,f=o;return r.innerHTML=u=c.length?""+c+l.delimiter+n+l.replaceStr:""+n+l.replaceStr,parseFloat(i.height)>parseFloat(o)&&(h++,f=i.height,h===a+1)?(r.innerHTML=u="."===d[d.length-1]&&"..."===l.replaceStr?d+"..":""+d+l.replaceStr,t({},e,{elHeight:f,rowsWrapped:h})):(r.innerHTML=u=d.length?""+d+l.delimiter+n:""+n,t({},e,{buffer:u,elHeight:f,rowsWrapped:h}))}e.disableResponsive=function(e){window.removeEventListener("resize",e)},e.ellipsis=function e(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={replaceStr:"...",responsive:!1,debounceDelay:250,delimiter:" "},s=t({},a,o),l=r&&(r instanceof NodeList?r:1===r.nodeType?[r]:document.querySelectorAll(r)),c=[],u=0;u<l.length;u++){var d=l[u];c[u]=d.innerHTML;var h=d.innerHTML.split(s.delimiter);d.innerHTML="";var f=window.getComputedStyle(d);h.reduce(n,{el:d,buffer:d.innerHTML,elStyle:f,elHeight:0,rowsLimit:i,rowsWrapped:0,options:s})}if(s.responsive){var p=!1,m=window.innerWidth,g=function(){if(window.innerWidth!==m){m=window.innerWidth;for(var n=0;n<l.length;n++)l[n].innerHTML=c[n];e(r,i,t({},o,{responsive:!1}))}},v=function(){clearTimeout(p),p=setTimeout(g,s.debounceDelay)};return window.addEventListener("resize",v),v}}},"function"==typeof define&&define.amd?define(["exports"],sm):sm(cm);c=o("85Hg2");var um=({loading:e=!1,className:t,title:r,description:i,cover:o,hoverable:a=!1,children:s})=>n(c).createElement("div",{className:n(md)("memori-card",t,{"memori-card--loading":e,"memori-card--with-cover":o,"memori-card--hoverable":a})},n(c).createElement(Rf,{spinning:e},o&&n(c).createElement("div",{className:"memori-card--cover"},o),n(c).createElement("div",{className:"memori-card--content"},r&&n(c).createElement("h3",{className:"memori-card--title"},r),i&&n(c).createElement("p",{className:"memori-card--description"},i),n(c).createElement("div",{className:"memori-card--children"},s))));const dm=({item:e,baseUrl:t,onLinkPreviewInfo:r,descriptionOneLine:i=!1})=>{var o,a,s,l;const[u,d]=(0,c.useState)(null),h=(null===(o=e.url)||void 0===o?void 0:o.startsWith("http"))||!e.url||0===(null===(a=e.url)||void 0===a?void 0:a.length)?e.url:`https://${e.url}`;(0,c.useEffect)((()=>{var n,i;let o=(null===(n=e.url)||void 0===n?void 0:n.startsWith("http"))||!e.url||0===(null===(i=e.url)||void 0===i?void 0:i.length)?e.url:`https://${e.url}`;o&&o!==(null==u?void 0:u.urlKey)&&(async(e,t)=>{try{const n=await fetch(`${t||"https://app.twincreator.com"}/api/linkpreview/${encodeURIComponent(e)}`);return await n.json()}catch(e){return console.error("getSiteInfo",e),null}})(o,t).then((e=>{d(e?{...e,urlKey:o}:null),r&&e&&r(e)}))}),[null==e?void 0:e.url,t,r]);const f=e.title&&e.title.length>0?e.title:null==u?void 0:u.title,p=null==u?void 0:u.description,m=null==u?void 0:u.video,g=null!==(s=null==u?void 0:u.image)&&void 0!==s?s:null===(l=null==u?void 0:u.images)||void 0===l?void 0:l[0];return(0,c.useEffect)((()=>{setTimeout((()=>{(0,cm.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[p,e.mediumID]),n(c).createElement("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"memori-link-item--link"},n(c).createElement(um,{hoverable:!0,className:n(md)("memori-link-item--card",{"memori-link-item--card-description-oneline":i,"memori-link-item--card-has-image":g,"memori-link-item--card-has-video":m}),cover:m?n(c).createElement("iframe",{width:"100%",height:"100%",src:m,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):g?n(c).createElement("img",{className:"memori-link-item--card-cover-img",src:g,alt:e.title}):n(c).createElement("div",{className:"memori-link-item--card-cover-icon"},n(c).createElement(lm,{className:"memori-link-item--icon"})),title:f,description:p}))};var hm=({items:e,baseUrl:t,descriptionOneLine:r=!1,onLinkPreviewInfo:i})=>n(c).createElement(kf,{appear:!0,show:!0,as:"div",className:"memori-link-items"},n(c).createElement("div",{className:"memori-link-items--grid"},e.map(((e,o)=>n(c).createElement(kf.Child,{as:"div",className:"memori-link-item",key:e.mediumID,enter:"ease-out duration-500 delay-"+100*o,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95"},n(c).createElement(dm,{item:e,baseUrl:t,descriptionOneLine:r,onLinkPreviewInfo:i}))))));c=o("85Hg2");const fm=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],pm=async(e,t,n,r)=>{var i;const o=fm.indexOf(e.toLowerCase())>-1?"IT":null==n?void 0:n.toUpperCase(),a=await fetch(`${r||"https://app.twincreator.com"}/api/translate?text=${encodeURIComponent(e)}&target_lang=${t.toUpperCase()}${o?`&source_lang=${o}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),s=await a.json();return null===(i=null==s?void 0:s.translations)||void 0===i?void 0:i[0]},mm=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"}],gm="👤",vm=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}];c=o("85Hg2");var bm=({src:e,poster:t,alt:r=""})=>((0,c.useEffect)((()=>{const e=document.createElement("script");return e.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",e.type="module",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),n(c).createElement("div",{className:"model-viewer"},n(c).createElement("model-viewer",{src:e,"ios-src":"",poster:t,alt:r,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})));c=o("85Hg2"),c=o("85Hg2");var ym=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})),wm={};function Sm(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}(wm=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Sm(o,r,i,a,s,"next",e)}function s(e){Sm(o,r,i,a,s,"throw",e)}a(void 0)}))}}).__esModule=!0,wm.default=wm;var xm={};function Mm(){return xm=Mm=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},xm.__esModule=!0,xm.default=xm,Mm.apply(this,arguments)}(xm=Mm).__esModule=!0,xm.default=xm;Ji=o("ffgrs"),Qi=o("22y1y");var _m={},Am={};function Em(e,t){return Am=Em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Am.__esModule=!0,Am.default=Am,Em(e,t)}(Am=Em).__esModule=!0,Am.default=Am,(_m=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Am(e,t)}).__esModule=!0,_m.default=_m;var Cm={},Tm=o("lEJSL").default,Im={};(Im=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}).__esModule=!0,Im.default=Im,(Cm=function(e,t){if(t&&("object"===Tm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Im(e)}).__esModule=!0,Cm.default=Cm;var km={};function Rm(e){return km=Rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},km.__esModule=!0,km.default=km,Rm(e)}(km=Rm).__esModule=!0,km.default=km;var Om,Pm=o("7qcgS")();Om=Pm;try{regeneratorRuntime=Pm}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=Pm:Function("r","regeneratorRuntime = r")(Pm)}c=o("85Hg2");var Nm={},Bm={};(Bm=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}).__esModule=!0,Bm.default=Bm,(Nm=function(e,t){if(null==e)return{};var n,r,i=Bm(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}).__esModule=!0,Nm.default=Nm;var Lm={},Dm={},Um=o("e3mvX");(Dm=function(e){if(Array.isArray(e))return Um(e)}).__esModule=!0,Dm.default=Dm;var Fm={};(Fm=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}).__esModule=!0,Fm.default=Fm;var zm=o("8xD61"),jm={};(jm=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,jm.default=jm,(Lm=function(e){return Dm(e)||Fm(e)||zm(e)||jm()}).__esModule=!0,Lm.default=Lm;c=o("85Hg2"),c=o("85Hg2");function Hm(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 Gm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hm(Object(r),!0).forEach((function(t){n(qi)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Vm={};function Wm(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return Vm[r]||(Vm[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),Vm[r]}function qm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),i=Wm(r);return i.reduce((function(e,t){return Gm(Gm({},e),n[t])}),t)}function Km(e){return e.join(" ")}function Jm(e){var t=e.node,r=e.stylesheet,i=e.style,o=void 0===i?{}:i,a=e.useInlineStyles,s=e.key,l=t.properties,u=t.type,d=t.tagName,h=t.value;if("text"===u)return h;if(d){var f,p=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,i){return Jm({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})}))}}(r,a);if(a){var m=Object.keys(r).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&g.concat(l.className.filter((function(e){return!m.includes(e)})));f=Gm(Gm({},l),{},{className:Km(v)||void 0,style:qm(l.className,Object.assign({},l.style,o),r)})}else f=Gm(Gm({},l),{},{className:Km(l.className)});var b=p(t.children);return n(c).createElement(d,n(xm)({key:s},f),b)}}var Qm=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Xm(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 Ym(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xm(Object(r),!0).forEach((function(t){n(qi)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Zm=/\n/g;function $m(e){var t=e.codeString,r=e.codeStyle,i=e.containerStyle,o=void 0===i?{float:"left",paddingRight:"10px"}:i,a=e.numberStyle,s=void 0===a?{}:a,l=e.startingLineNumber;return n(c).createElement("code",{style:Object.assign({},r,o)},function(e){var t=e.lines,r=e.startingLineNumber,i=e.style;return t.map((function(e,t){var o=t+r;return n(c).createElement("span",{key:"line-".concat(t),className:"react-syntax-highlighter-line-number",style:"function"==typeof i?i(o):i},"".concat(o,"\n"))}))}({lines:t.replace(/\n$/,"").split("\n"),style:s,startingLineNumber:l}))}function eg(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function tg(e,t,n){var r,i={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},o="function"==typeof e?e(t):e;return Ym(Ym({},i),o)}function ng(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,a=e.lineProps,s=void 0===a?{}:a,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,h="function"==typeof s?s(n):s;if(h.className=c,n&&o){var f=tg(r,n,i);t.unshift(eg(n,f))}return d&u&&(h.style=Ym(Ym({},h.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:h,children:t}}function rg(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=0;i<e.length;i++){var o=e[i];if("text"===o.type)r.push(ng({children:[o],className:n(Lm)(new Set(t))}));else if(o.children){var a=t.concat(o.properties.className);rg(o.children,a).forEach((function(e){return r.push(e)}))}}return r}function ig(e,t,n,r,i,o,a,s,l){var c,u=rg(e.value),d=[],h=-1,f=0;function p(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return ng({children:e,lineNumber:t,lineNumberStyle:s,largestLineNumber:a,showInlineLineNumbers:i,lineProps:n,className:o,showLineNumbers:r,wrapLongLines:l})}function m(e,t){if(r&&t&&i){var n=tg(s,t,a);e.unshift(eg(t,n))}return e}function g(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?p(e,n,r):m(e,n)}for(var v=function(){var e=u[f],t=e.children[0].value;if(t.match(Zm)){var n=t.split("\n");n.forEach((function(t,i){var a=r&&d.length+o,s={type:"text",value:"".concat(t,"\n")};if(0===i){var l=g(u.slice(h+1,f).concat(ng({children:[s],className:e.properties.className})),a);d.push(l)}else if(i===n.length-1){var c=u[f+1]&&u[f+1].children&&u[f+1].children[0],p={type:"text",value:"".concat(t)};if(c){var m=ng({children:[p],className:e.properties.className});u.splice(f+1,0,m)}else{var v=g([p],a,e.properties.className);d.push(v)}}else{var b=g([s],a,e.properties.className);d.push(b)}})),h=f}f++};f<u.length;)v();if(h!==u.length-1){var b=u.slice(h+1,u.length);if(b&&b.length){var y=g(b,r&&d.length+o);d.push(y)}}return t?d:(c=[]).concat.apply(c,d)}function og(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return Jm({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function ag(e){return e&&void 0!==e.highlightAuto}function sg(e,t){return function(r){var i=r.language,o=r.children,a=r.style,s=void 0===a?t:a,l=r.customStyle,u=void 0===l?{}:l,d=r.codeTagProps,h=void 0===d?{className:i?"language-".concat(i):void 0,style:Ym(Ym({},s['code[class*="language-"]']),s['code[class*="language-'.concat(i,'"]')])}:d,f=r.useInlineStyles,p=void 0===f||f,m=r.showLineNumbers,g=void 0!==m&&m,v=r.showInlineLineNumbers,b=void 0===v||v,y=r.startingLineNumber,w=void 0===y?1:y,S=r.lineNumberContainerStyle,x=r.lineNumberStyle,M=void 0===x?{}:x,_=r.wrapLines,A=r.wrapLongLines,E=void 0!==A&&A,C=r.lineProps,T=void 0===C?{}:C,I=r.renderer,k=r.PreTag,R=void 0===k?"pre":k,O=r.CodeTag,P=void 0===O?"code":O,N=r.code,B=void 0===N?(Array.isArray(o)?o[0]:o)||"":N,L=r.astGenerator,D=n(Nm)(r,Qm);L=L||e;var U=g?n(c).createElement($m,{containerStyle:S,codeStyle:h.style||{},numberStyle:M,startingLineNumber:w,codeString:B}):null,F=s.hljs||s['pre[class*="language-"]']||{backgroundColor:"#fff"},z=ag(L)?"hljs":"prismjs",j=p?Object.assign({},D,{style:Object.assign({},F,u)}):Object.assign({},D,{className:D.className?"".concat(z," ").concat(D.className):z,style:Object.assign({},u)});if(h.style=Ym(Ym({},h.style),{},E?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"}),!L)return n(c).createElement(R,j,U,n(c).createElement(P,h,B));(void 0===_&&I||E)&&(_=!0),I=I||og;var H=[{type:"text",value:B}],G=function(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(ag(t)){var o=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:i}}catch(e){return{value:i}}}({astGenerator:L,language:i,code:B,defaultCodeValue:H});null===G.language&&(G.value=H);var V=ig(G,_,T,g,b,w,G.value.length+w,M,E);return n(c).createElement(R,j,n(c).createElement(P,h,!b&&U,I({rows:V,stylesheet:s,useInlineStyles:p})))}}function lg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=n(km)(e);if(t){var o=n(km)(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return n(Cm)(this,r)}}var cg,ug,dg,hg,fg,pg,mg,gg=function(e,t){return function(){var r=n(wm)(n(Om).mark((function r(i){var o;return n(Om).wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t();case 2:o=n.sent,i(e,o.default||o);case 4:case"end":return n.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},vg={abap:gg("abap",(function(){return o("bwHpE")})),abnf:gg("abnf",(function(){return o("daD87")})),actionscript:gg("actionscript",(function(){return o("lpEgO")})),ada:gg("ada",(function(){return o("1sGW9")})),agda:gg("agda",(function(){return o("e9VyR")})),al:gg("al",(function(){return o("kMFSe")})),antlr4:gg("antlr4",(function(){return o("8HlsP")})),apacheconf:gg("apacheconf",(function(){return o("isFCh")})),apex:gg("apex",(function(){return o("gUXVM")})),apl:gg("apl",(function(){return o("2L15v")})),applescript:gg("applescript",(function(){return o("8XyFT")})),aql:gg("aql",(function(){return o("gFWTI")})),arduino:gg("arduino",(function(){return o("jI3VB")})),arff:gg("arff",(function(){return o("6uYTH")})),asciidoc:gg("asciidoc",(function(){return o("gdYKH")})),asm6502:gg("asm6502",(function(){return o("ahFLg")})),asmatmel:gg("asmatmel",(function(){return o("4irIu")})),aspnet:gg("aspnet",(function(){return o("yDC6n")})),autohotkey:gg("autohotkey",(function(){return o("a4xpy")})),autoit:gg("autoit",(function(){return o("iNSix")})),avisynth:gg("avisynth",(function(){return o("kEBnk")})),avroIdl:gg("avroIdl",(function(){return o("lzthi")})),bash:gg("bash",(function(){return Promise.resolve(o("3aDLI"))})),basic:gg("basic",(function(){return o("cxDu6")})),batch:gg("batch",(function(){return o("6zDll")})),bbcode:gg("bbcode",(function(){return o("bPS87")})),bicep:gg("bicep",(function(){return o("8dy5f")})),birb:gg("birb",(function(){return o("3vHrY")})),bison:gg("bison",(function(){return o("bCjBS")})),bnf:gg("bnf",(function(){return o("4NqDW")})),brainfuck:gg("brainfuck",(function(){return o("4s0KX")})),brightscript:gg("brightscript",(function(){return o("jTsQ4")})),bro:gg("bro",(function(){return o("5lMc2")})),bsl:gg("bsl",(function(){return o("jBYxC")})),c:gg("c",(function(){return Promise.resolve(o("lyZgY"))})),cfscript:gg("cfscript",(function(){return o("coZDy")})),chaiscript:gg("chaiscript",(function(){return o("e1zEN")})),cil:gg("cil",(function(){return o("crKoM")})),clike:gg("clike",(function(){return o("4kO9t")})),clojure:gg("clojure",(function(){return o("01SpB")})),cmake:gg("cmake",(function(){return o("9yG4p")})),cobol:gg("cobol",(function(){return o("967Hn")})),coffeescript:gg("coffeescript",(function(){return o("7Yi6H")})),concurnas:gg("concurnas",(function(){return o("5tXmX")})),coq:gg("coq",(function(){return o("ektdr")})),cpp:gg("cpp",(function(){return Promise.resolve(o("lR39A"))})),crystal:gg("crystal",(function(){return o("8gt4L")})),csharp:gg("csharp",(function(){return o("7K6eJ")})),cshtml:gg("cshtml",(function(){return o("cVu4i")})),csp:gg("csp",(function(){return o("ecKo1")})),cssExtras:gg("cssExtras",(function(){return o("gnpv8")})),css:gg("css",(function(){return o("jx0H8")})),csv:gg("csv",(function(){return o("f9kmW")})),cypher:gg("cypher",(function(){return o("lojor")})),d:gg("d",(function(){return o("6Qa0U")})),dart:gg("dart",(function(){return o("74K1B")})),dataweave:gg("dataweave",(function(){return o("93H6c")})),dax:gg("dax",(function(){return o("cf9Y9")})),dhall:gg("dhall",(function(){return o("f6UWv")})),diff:gg("diff",(function(){return o("klPVo")})),django:gg("django",(function(){return o("jfxe9")})),dnsZoneFile:gg("dnsZoneFile",(function(){return o("5aMz5")})),docker:gg("docker",(function(){return o("kOauC")})),dot:gg("dot",(function(){return o("btE6k")})),ebnf:gg("ebnf",(function(){return o("aT88c")})),editorconfig:gg("editorconfig",(function(){return o("jWOl8")})),eiffel:gg("eiffel",(function(){return o("kHJaX")})),ejs:gg("ejs",(function(){return o("frfnA")})),elixir:gg("elixir",(function(){return o("hcrJ2")})),elm:gg("elm",(function(){return o("jd271")})),erb:gg("erb",(function(){return o("gczXL")})),erlang:gg("erlang",(function(){return o("FsabW")})),etlua:gg("etlua",(function(){return o("9DI9l")})),excelFormula:gg("excelFormula",(function(){return o("3QVue")})),factor:gg("factor",(function(){return o("ltNCT")})),falselang:gg("falselang",(function(){return o("g0Q6p")})),firestoreSecurityRules:gg("firestoreSecurityRules",(function(){return o("ukA2V")})),flow:gg("flow",(function(){return o("e5prn")})),fortran:gg("fortran",(function(){return o("gIEL6")})),fsharp:gg("fsharp",(function(){return o("3wQkt")})),ftl:gg("ftl",(function(){return o("7ZVWs")})),gap:gg("gap",(function(){return o("hOFj6")})),gcode:gg("gcode",(function(){return o("95BzQ")})),gdscript:gg("gdscript",(function(){return o("iul6t")})),gedcom:gg("gedcom",(function(){return o("e0qJM")})),gherkin:gg("gherkin",(function(){return o("2SHak")})),git:gg("git",(function(){return o("l6VFH")})),glsl:gg("glsl",(function(){return o("cEMfJ")})),gml:gg("gml",(function(){return o("8UVTr")})),gn:gg("gn",(function(){return o("kvibD")})),goModule:gg("goModule",(function(){return o("icqjF")})),go:gg("go",(function(){return o("jLkg8")})),graphql:gg("graphql",(function(){return o("aYGNi")})),groovy:gg("groovy",(function(){return o("4bTmH")})),haml:gg("haml",(function(){return o("h2A6V")})),handlebars:gg("handlebars",(function(){return o("79YVJ")})),haskell:gg("haskell",(function(){return o("bsiLW")})),haxe:gg("haxe",(function(){return o("94Kdj")})),hcl:gg("hcl",(function(){return o("9CheR")})),hlsl:gg("hlsl",(function(){return o("h3dqW")})),hoon:gg("hoon",(function(){return o("9WbsW")})),hpkp:gg("hpkp",(function(){return o("GiPN3")})),hsts:gg("hsts",(function(){return o("eaSn9")})),http:gg("http",(function(){return o("1uj7b")})),ichigojam:gg("ichigojam",(function(){return o("ge562")})),icon:gg("icon",(function(){return o("lVHUf")})),icuMessageFormat:gg("icuMessageFormat",(function(){return o("aYoUL")})),idris:gg("idris",(function(){return o("1RVAE")})),iecst:gg("iecst",(function(){return o("bi7Dr")})),ignore:gg("ignore",(function(){return o("cq0Pi")})),inform7:gg("inform7",(function(){return o("31K4E")})),ini:gg("ini",(function(){return o("l05OZ")})),io:gg("io",(function(){return o("6bY1b")})),j:gg("j",(function(){return o("1ebDS")})),java:gg("java",(function(){return o("iEZZI")})),javadoc:gg("javadoc",(function(){return o("aHy5a")})),javadoclike:gg("javadoclike",(function(){return o("5f3rE")})),javascript:gg("javascript",(function(){return o("7JDFI")})),javastacktrace:gg("javastacktrace",(function(){return o("gdCGE")})),jexl:gg("jexl",(function(){return o("cqMb9")})),jolie:gg("jolie",(function(){return o("cEDX4")})),jq:gg("jq",(function(){return o("kEWsh")})),jsExtras:gg("jsExtras",(function(){return o("74PI8")})),jsTemplates:gg("jsTemplates",(function(){return o("30TPr")})),jsdoc:gg("jsdoc",(function(){return o("9DH5c")})),json:gg("json",(function(){return Promise.resolve(o("l1Rj1"))})),json5:gg("json5",(function(){return o("920rv")})),jsonp:gg("jsonp",(function(){return o("9AwS1")})),jsstacktrace:gg("jsstacktrace",(function(){return o("bYXMr")})),jsx:gg("jsx",(function(){return Promise.resolve(o("6ho3O"))})),julia:gg("julia",(function(){return o("g0ibH")})),keepalived:gg("keepalived",(function(){return o("2hdnH")})),keyman:gg("keyman",(function(){return o("cIufI")})),kotlin:gg("kotlin",(function(){return o("c26dU")})),kumir:gg("kumir",(function(){return o("iYAha")})),kusto:gg("kusto",(function(){return o("9z1oX")})),latex:gg("latex",(function(){return o("lCPLU")})),latte:gg("latte",(function(){return o("c9oN0")})),less:gg("less",(function(){return o("hA3V9")})),lilypond:gg("lilypond",(function(){return o("hpHTA")})),liquid:gg("liquid",(function(){return o("kpZTm")})),lisp:gg("lisp",(function(){return o("chgK5")})),livescript:gg("livescript",(function(){return o("2gdiv")})),llvm:gg("llvm",(function(){return o("jUeFO")})),log:gg("log",(function(){return o("3BFSQ")})),lolcode:gg("lolcode",(function(){return o("lG9br")})),lua:gg("lua",(function(){return o("cVGpd")})),magma:gg("magma",(function(){return o("4LVzY")})),makefile:gg("makefile",(function(){return o("2NviD")})),markdown:gg("markdown",(function(){return o("jUFCF")})),markupTemplating:gg("markupTemplating",(function(){return Promise.resolve(o("t3W0d"))})),markup:gg("markup",(function(){return o("5hIXu")})),matlab:gg("matlab",(function(){return o("kPAC0")})),maxscript:gg("maxscript",(function(){return o("gHOJy")})),mel:gg("mel",(function(){return o("9mj6e")})),mermaid:gg("mermaid",(function(){return o("kozw5")})),mizar:gg("mizar",(function(){return o("2bN6W")})),mongodb:gg("mongodb",(function(){return o("eHKWX")})),monkey:gg("monkey",(function(){return o("7Fh0C")})),moonscript:gg("moonscript",(function(){return o("hDXwC")})),n1ql:gg("n1ql",(function(){return o("j9bkC")})),n4js:gg("n4js",(function(){return o("eTmBF")})),nand2tetrisHdl:gg("nand2tetrisHdl",(function(){return o("ezjCf")})),naniscript:gg("naniscript",(function(){return o("VxHk1")})),nasm:gg("nasm",(function(){return o("ly95T")})),neon:gg("neon",(function(){return o("7Fk34")})),nevod:gg("nevod",(function(){return o("3U8Qv")})),nginx:gg("nginx",(function(){return o("c6qVk")})),nim:gg("nim",(function(){return o("1JdCk")})),nix:gg("nix",(function(){return o("jcstS")})),nsis:gg("nsis",(function(){return o("kEJqW")})),objectivec:gg("objectivec",(function(){return o("lUP8A")})),ocaml:gg("ocaml",(function(){return o("lhTAD")})),opencl:gg("opencl",(function(){return o("8rxKO")})),openqasm:gg("openqasm",(function(){return o("ib0uL")})),oz:gg("oz",(function(){return o("csCUS")})),parigp:gg("parigp",(function(){return o("2DkHE")})),parser:gg("parser",(function(){return o("2cp75")})),pascal:gg("pascal",(function(){return o("fViVl")})),pascaligo:gg("pascaligo",(function(){return o("9Uuxa")})),pcaxis:gg("pcaxis",(function(){return o("jUdnN")})),peoplecode:gg("peoplecode",(function(){return o("l8w4e")})),perl:gg("perl",(function(){return o("aX7dM")})),phpExtras:gg("phpExtras",(function(){return o("3cMZl")})),php:gg("php",(function(){return Promise.resolve(o("5li5P"))})),phpdoc:gg("phpdoc",(function(){return o("bDyJN")})),plsql:gg("plsql",(function(){return o("cPuMN")})),powerquery:gg("powerquery",(function(){return o("jE1gU")})),powershell:gg("powershell",(function(){return o("k7t0j")})),processing:gg("processing",(function(){return o("jr8hV")})),prolog:gg("prolog",(function(){return o("hpuat")})),promql:gg("promql",(function(){return o("ckXC5")})),properties:gg("properties",(function(){return o("fAh6P")})),protobuf:gg("protobuf",(function(){return o("R6WqB")})),psl:gg("psl",(function(){return o("Al65w")})),pug:gg("pug",(function(){return o("dxbNS")})),puppet:gg("puppet",(function(){return o("lrSuh")})),pure:gg("pure",(function(){return o("6DKQK")})),purebasic:gg("purebasic",(function(){return o("7ZkSb")})),purescript:gg("purescript",(function(){return o("dBTYx")})),python:gg("python",(function(){return Promise.resolve(o("kiy5M"))})),q:gg("q",(function(){return o("4FXyy")})),qml:gg("qml",(function(){return o("2zZFj")})),qore:gg("qore",(function(){return o("iCK1Y")})),qsharp:gg("qsharp",(function(){return o("dvH9H")})),r:gg("r",(function(){return o("lQqRt")})),racket:gg("racket",(function(){return o("eHKmq")})),reason:gg("reason",(function(){return o("kkeLT")})),regex:gg("regex",(function(){return o("llX50")})),rego:gg("rego",(function(){return o("9hKdZ")})),renpy:gg("renpy",(function(){return o("cJgw5")})),rest:gg("rest",(function(){return o("867DK")})),rip:gg("rip",(function(){return o("3Odjx")})),roboconf:gg("roboconf",(function(){return o("gQ0Us")})),robotframework:gg("robotframework",(function(){return o("bLCgx")})),ruby:gg("ruby",(function(){return Promise.resolve(o("ch1PX"))})),rust:gg("rust",(function(){return o("cInT8")})),sas:gg("sas",(function(){return o("iz7eP")})),sass:gg("sass",(function(){return o("hrDC3")})),scala:gg("scala",(function(){return o("ub8Bf")})),scheme:gg("scheme",(function(){return o("7NAAt")})),scss:gg("scss",(function(){return Promise.resolve(o("fU6a0"))})),shellSession:gg("shellSession",(function(){return o("7kKCv")})),smali:gg("smali",(function(){return o("2lkCb")})),smalltalk:gg("smalltalk",(function(){return o("4280y")})),smarty:gg("smarty",(function(){return o("4hXYK")})),sml:gg("sml",(function(){return o("jh2E8")})),solidity:gg("solidity",(function(){return o("dTdF2")})),solutionFile:gg("solutionFile",(function(){return o("iI5tm")})),soy:gg("soy",(function(){return o("aoU5C")})),sparql:gg("sparql",(function(){return o("ggrvb")})),splunkSpl:gg("splunkSpl",(function(){return o("8LhCX")})),sqf:gg("sqf",(function(){return o("3tDsu")})),sql:gg("sql",(function(){return Promise.resolve(o("bnDV9"))})),squirrel:gg("squirrel",(function(){return o("bxaUV")})),stan:gg("stan",(function(){return o("dBqrq")})),stylus:gg("stylus",(function(){return o("JlHVK")})),swift:gg("swift",(function(){return o("c7NBs")})),systemd:gg("systemd",(function(){return o("jprZl")})),t4Cs:gg("t4Cs",(function(){return o("edsMI")})),t4Templating:gg("t4Templating",(function(){return o("bS9Wa")})),t4Vb:gg("t4Vb",(function(){return o("gYk20")})),tap:gg("tap",(function(){return o("byv7d")})),tcl:gg("tcl",(function(){return o("lUAIZ")})),textile:gg("textile",(function(){return o("7J2LO")})),toml:gg("toml",(function(){return o("eXtdM")})),tremor:gg("tremor",(function(){return o("vyajH")})),tsx:gg("tsx",(function(){return Promise.resolve(o("7cTnl"))})),tt2:gg("tt2",(function(){return o("8XOOm")})),turtle:gg("turtle",(function(){return o("1XvLQ")})),twig:gg("twig",(function(){return o("i9Fpp")})),typescript:gg("typescript",(function(){return Promise.resolve(o("fzL8k"))})),typoscript:gg("typoscript",(function(){return o("kKk69")})),unrealscript:gg("unrealscript",(function(){return o("jgq8Y")})),uorazor:gg("uorazor",(function(){return o("dsZ00")})),uri:gg("uri",(function(){return o("fqJRp")})),v:gg("v",(function(){return o("bgfyB")})),vala:gg("vala",(function(){return o("68x4q")})),vbnet:gg("vbnet",(function(){return o("eUhQs")})),velocity:gg("velocity",(function(){return o("fPNdV")})),verilog:gg("verilog",(function(){return o("2fM1V")})),vhdl:gg("vhdl",(function(){return o("hNF6q")})),vim:gg("vim",(function(){return o("75TCr")})),visualBasic:gg("visualBasic",(function(){return o("fc93z")})),warpscript:gg("warpscript",(function(){return o("jgHlG")})),wasm:gg("wasm",(function(){return o("dVZkI")})),webIdl:gg("webIdl",(function(){return o("9Jnxv")})),wiki:gg("wiki",(function(){return o("1Gimo")})),wolfram:gg("wolfram",(function(){return o("4SyRT")})),wren:gg("wren",(function(){return o("gaIVs")})),xeora:gg("xeora",(function(){return o("lagad")})),xmlDoc:gg("xmlDoc",(function(){return o("9DNYE")})),xojo:gg("xojo",(function(){return o("ksF4f")})),xquery:gg("xquery",(function(){return o("gXxHJ")})),yaml:gg("yaml",(function(){return o("6rk3j")})),yang:gg("yang",(function(){return o("kTyrQ")})),zig:gg("zig",(function(){return o("d3mFC")}))},bg=(ug=(cg={loader:function(){return o("bB2YF").then((function(e){return e.default||e}))},isLanguageRegistered:function(e,t){return e.registered(t)},languageLoaders:vg,registerLanguage:function(e,t,n){return e.register(n)}}).loader,dg=cg.isLanguageRegistered,hg=cg.registerLanguage,fg=cg.languageLoaders,pg=cg.noAsyncLoadingLanguages,mg=function(e){n(_m)(i,e);var t,r=lg(i);function i(){return n(Ji)(this,i),r.apply(this,arguments)}return n(Qi)(i,[{key:"componentDidUpdate",value:function(){!i.isRegistered(this.props.language)&&fg&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var e=this;i.astGeneratorPromise||i.loadAstGenerator(),i.astGenerator||i.astGeneratorPromise.then((function(){e.forceUpdate()})),!i.isRegistered(this.props.language)&&fg&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var e=this,t=this.props.language;"text"!==t&&i.loadLanguage(t).then((function(){return e.forceUpdate()})).catch((function(){}))}},{key:"normalizeLanguage",value:function(e){return i.isSupportedLanguage(e)?e:"text"}},{key:"render",value:function(){return n(c).createElement(i.highlightInstance,n(xm)({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:i.astGenerator}))}}],[{key:"preload",value:function(){return i.loadAstGenerator()}},{key:"loadLanguage",value:(t=n(wm)(n(Om).mark((function e(t){var r;return n(Om).wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(r=fg[t])){e.next=5;break}return e.abrupt("return",r(i.registerLanguage));case 5:throw new Error("Language ".concat(t," not supported"));case 6:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"isSupportedLanguage",value:function(e){return i.isRegistered(e)||"function"==typeof fg[e]}},{key:"loadAstGenerator",value:function(){return i.astGeneratorPromise=ug().then((function(e){i.astGenerator=e,hg&&i.languages.forEach((function(t,n){return hg(e,n,t)}))})),i.astGeneratorPromise}}]),i}(n(c).PureComponent),n(qi)(mg,"astGenerator",null),n(qi)(mg,"highlightInstance",sg(null,{})),n(qi)(mg,"astGeneratorPromise",null),n(qi)(mg,"languages",new Map),n(qi)(mg,"supportedLanguages",cg.supportedLanguages||Object.keys(fg||{})),n(qi)(mg,"isRegistered",(function(e){if(pg)return!0;if(!hg)throw new Error("Current syntax highlighter doesn't support registration of languages");return mg.astGenerator?dg(mg.astGenerator,e):mg.languages.has(e)})),n(qi)(mg,"registerLanguage",(function(e,t){if(!hg)throw new Error("Current syntax highlighter doesn't support registration of languages");if(mg.astGenerator)return hg(mg.astGenerator,e,t);mg.languages.set(e,t)})),mg),yg={},wg={};(wg=function(e){return e&&e.__esModule?e:{default:e}}).__esModule=!0,wg.default=wg,Object.defineProperty(yg,"__esModule",{value:!0}),Object.defineProperty(yg,"a11yDark",{enumerable:!0,get:function(){return Ig.default}}),Object.defineProperty(yg,"atomDark",{enumerable:!0,get:function(){return kg.default}}),Object.defineProperty(yg,"base16AteliersulphurpoolLight",{enumerable:!0,get:function(){return Rg.default}}),Object.defineProperty(yg,"cb",{enumerable:!0,get:function(){return Og.default}}),Object.defineProperty(yg,"coldarkCold",{enumerable:!0,get:function(){return Pg.default}}),Object.defineProperty(yg,"coldarkDark",{enumerable:!0,get:function(){return Ng.default}}),Object.defineProperty(yg,"coy",{enumerable:!0,get:function(){return Sg.default}}),Object.defineProperty(yg,"coyWithoutShadows",{enumerable:!0,get:function(){return Bg.default}}),Object.defineProperty(yg,"darcula",{enumerable:!0,get:function(){return Lg.default}}),Object.defineProperty(yg,"dark",{enumerable:!0,get:function(){return xg.default}}),Object.defineProperty(yg,"dracula",{enumerable:!0,get:function(){return Dg.default}}),Object.defineProperty(yg,"duotoneDark",{enumerable:!0,get:function(){return Ug.default}}),Object.defineProperty(yg,"duotoneEarth",{enumerable:!0,get:function(){return Fg.default}}),Object.defineProperty(yg,"duotoneForest",{enumerable:!0,get:function(){return zg.default}}),Object.defineProperty(yg,"duotoneLight",{enumerable:!0,get:function(){return jg.default}}),Object.defineProperty(yg,"duotoneSea",{enumerable:!0,get:function(){return Hg.default}}),Object.defineProperty(yg,"duotoneSpace",{enumerable:!0,get:function(){return Gg.default}}),Object.defineProperty(yg,"funky",{enumerable:!0,get:function(){return Mg.default}}),Object.defineProperty(yg,"ghcolors",{enumerable:!0,get:function(){return Vg.default}}),Object.defineProperty(yg,"gruvboxDark",{enumerable:!0,get:function(){return Wg.default}}),Object.defineProperty(yg,"gruvboxLight",{enumerable:!0,get:function(){return qg.default}}),Object.defineProperty(yg,"holiTheme",{enumerable:!0,get:function(){return Kg.default}}),Object.defineProperty(yg,"hopscotch",{enumerable:!0,get:function(){return Jg.default}}),Object.defineProperty(yg,"lucario",{enumerable:!0,get:function(){return Qg.default}}),Object.defineProperty(yg,"materialDark",{enumerable:!0,get:function(){return Xg.default}}),Object.defineProperty(yg,"materialLight",{enumerable:!0,get:function(){return Yg.default}}),Object.defineProperty(yg,"materialOceanic",{enumerable:!0,get:function(){return Zg.default}}),Object.defineProperty(yg,"nightOwl",{enumerable:!0,get:function(){return $g.default}}),Object.defineProperty(yg,"nord",{enumerable:!0,get:function(){return ev.default}}),Object.defineProperty(yg,"okaidia",{enumerable:!0,get:function(){return _g.default}}),Object.defineProperty(yg,"oneDark",{enumerable:!0,get:function(){return tv.default}}),Object.defineProperty(yg,"oneLight",{enumerable:!0,get:function(){return nv.default}}),Object.defineProperty(yg,"pojoaque",{enumerable:!0,get:function(){return rv.default}}),Object.defineProperty(yg,"prism",{enumerable:!0,get:function(){return Tg.default}}),Object.defineProperty(yg,"shadesOfPurple",{enumerable:!0,get:function(){return iv.default}}),Object.defineProperty(yg,"solarizedDarkAtom",{enumerable:!0,get:function(){return ov.default}}),Object.defineProperty(yg,"solarizedlight",{enumerable:!0,get:function(){return Ag.default}}),Object.defineProperty(yg,"synthwave84",{enumerable:!0,get:function(){return av.default}}),Object.defineProperty(yg,"tomorrow",{enumerable:!0,get:function(){return Eg.default}}),Object.defineProperty(yg,"twilight",{enumerable:!0,get:function(){return Cg.default}}),Object.defineProperty(yg,"vs",{enumerable:!0,get:function(){return sv.default}}),Object.defineProperty(yg,"vscDarkPlus",{enumerable:!0,get:function(){return lv.default}}),Object.defineProperty(yg,"xonokai",{enumerable:!0,get:function(){return cv.default}}),Object.defineProperty(yg,"zTouch",{enumerable:!0,get:function(){return uv.default}});var Sg=wg(o("jcF8U")),xg=wg(o("3Tppx")),Mg=wg(o("dBuK7")),_g=wg(o("eEjWK")),Ag=wg(o("awG2g")),Eg=wg(o("2oFzQ")),Cg=wg(o("4Au6Q")),Tg=wg(o("dAPqs")),Ig=wg(o("8eAql")),kg=wg(o("cv2QE")),Rg=wg(o("h5I9g")),Og=wg(o("i4C5w")),Pg=wg(o("3kFKo")),Ng=wg(o("17zK0")),Bg=wg(o("5Avqr")),Lg=wg(o("1jHMv")),Dg=wg(o("7Q8CE")),Ug=wg(o("jKUos")),Fg=wg(o("Uzm4J")),zg=wg(o("7yfkN")),jg=wg(o("lT2l1")),Hg=wg(o("fZ9um")),Gg=wg(o("1MoQL")),Vg=wg(o("4uys7")),Wg=wg(o("kaYsk")),qg=wg(o("kN6Vu")),Kg=wg(o("2Z6pG")),Jg=wg(o("4jQJK")),Qg=wg(o("bpXw0")),Xg=wg(o("i4S8s")),Yg=wg(o("5bNr4")),Zg=wg(o("5ZYWT")),$g=wg(o("ihJCU")),ev=wg(o("8iIbg")),tv=wg(o("424u7")),nv=wg(o("jPiNI")),rv=wg(o("OHVOA")),iv=wg(o("2OKTL")),ov=wg(o("2Mg8H")),av=wg(o("9Kud0")),sv=wg(o("eCrmR")),lv=wg(o("8UhcQ")),cv=wg(o("dtU9z")),uv=wg(o("4xtLO")),dv={};Object.defineProperty(dv,"__esModule",{value:!0}),dv.default=void 0;var hv=wg(o("7cTnl")).default;dv.default=hv;var fv={};Object.defineProperty(fv,"__esModule",{value:!0}),fv.default=void 0;var pv=wg(o("l1Rj1")).default;fv.default=pv;var mv={};Object.defineProperty(mv,"__esModule",{value:!0}),mv.default=void 0;var gv=wg(o("fU6a0")).default;mv.default=gv;var vv={};Object.defineProperty(vv,"__esModule",{value:!0}),vv.default=void 0;var bv=wg(o("3aDLI")).default;vv.default=bv;var yv={};Object.defineProperty(yv,"__esModule",{value:!0}),yv.default=void 0;var wv=wg(o("kiy5M")).default;yv.default=wv;var Sv={};Object.defineProperty(Sv,"__esModule",{value:!0}),Sv.default=void 0;var xv=wg(o("lR39A")).default;Sv.default=xv;var Mv={};Object.defineProperty(Mv,"__esModule",{value:!0}),Mv.default=void 0;var _v=wg(o("5li5P")).default;Mv.default=_v;var Av={};Object.defineProperty(Av,"__esModule",{value:!0}),Av.default=void 0;var Ev=wg(o("ch1PX")).default;Av.default=Ev;var Cv={};Object.defineProperty(Cv,"__esModule",{value:!0}),Cv.default=void 0;var Tv=wg(o("bnDV9")).default;Cv.default=Tv,bg.registerLanguage("tsx",n(dv)),bg.registerLanguage("json",n(fv)),bg.registerLanguage("scss",n(mv)),bg.registerLanguage("bash",n(vv)),bg.registerLanguage("python",n(yv)),bg.registerLanguage("cpp",n(Sv)),bg.registerLanguage("php",n(Mv)),bg.registerLanguage("ruby",n(Av)),bg.registerLanguage("sql",n(Cv));var Iv=({medium:e,className:t,preview:r=!1})=>{var i,o,a,s;const{t:l}=yo();return n(c).createElement("div",{className:"memori-snippet"},n(c).createElement("div",{className:"memori-snippet--content"},n(c).createElement(bg,{"aria-labelledby":`#snippet-${e.mediumID}`,className:t,style:yg.atomDark,showLineNumbers:!0,language:null!==(o=null===(i=vm.find((t=>e.mimeType===t.mimeType)))||void 0===i?void 0:i.lang)&&void 0!==o?o:"text"},(null===(a=e.content)||void 0===a?void 0:a.length)&&e.content.length>200&&r?`${e.content.slice(0,200)}\n...`:`${e.content}`),n(c).createElement(bd,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:l("copy")||"Copy",icon:n(c).createElement(ym,null),onClick:()=>{var t;return navigator.clipboard.writeText(null!==(t=e.content)&&void 0!==t?t:"")}})),!!(null===(s=e.title)||void 0===s?void 0:s.length)&&n(c).createElement("p",{id:`snippet-${e.mediumID}`,className:"memori-snippet--caption"},e.title))};c=o("85Hg2");var kv=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"}));c=o("85Hg2");var Rv=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"}));c=o("85Hg2");var Ov=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"}));c=o("85Hg2");var Pv=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"}));const Nv=({item:e,sessionID:t,tenantID:r,preview:i=!1})=>{switch(e.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:n(c).createElement("picture",{className:"memori-media-item--figure"},!i&&n(c).createElement("source",{srcSet:[im({resourceURI:e.url,sessionID:t,tenantID:r}),im({resourceURI:e.content,sessionID:t,tenantID:r}),e.url,e.content].join(", "),type:e.mimeType}),n(c).createElement("img",{alt:e.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),e.title&&n(c).createElement("figcaption",{className:"memori-media-item--figure-caption"},e.title))}));case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,cover:n(c).createElement(Pv,{className:"memori-media-item--icon"}),title:e.title}));case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,cover:n(c).createElement(Ov,{className:"memori-media-item--icon"}),title:e.title}));case"application/pdf":return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,cover:n(c).createElement(Rv,{className:"memori-media-item--icon"}),title:e.title}));case"video/mp4":case"video/avi":case"video/mpeg":return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,cover:n(c).createElement("video",{style:{width:"100%",height:"100%"},controls:!0,src:e.url,title:e.title}),title:e.title}));case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,cover:n(c).createElement("audio",{style:{width:"100%",height:"100%"},controls:!0,src:e.url}),title:e.title}));case"model/gltf-binary":return n(c).createElement(bm,{src:e.url,alt:"",poster:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="});default:return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,cover:n(c).createElement(kv,{className:"memori-media-item--icon"}),title:e.title}))}};var Bv=({items:e,sessionID:t,tenantID:r,translateTo:i})=>{const[o,a]=(0,c.useState)(e),s=(0,c.useCallback)((async()=>{if(!i)return;const t=await Promise.all((null!=e?e:[]).map((async e=>{var t;if(!e.title)return e;try{const n=await pm(e.title,i);return{...e,title:null!==(t=n.text)&&void 0!==t?t:e.title}}catch(t){return console.error(t),e}})));a(t)}),[i,e]);return(0,c.useEffect)((()=>{i&&s()}),[i,s]),(0,c.useEffect)((()=>{e.filter((e=>{var t;return"text/javascript"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).forEach((e=>{var t;try{new Function(null!==(t=e.content)&&void 0!==t?t:"")()}catch(e){console.error(e)}}))}),[]),n(c).createElement(kf,{appear:!0,show:!0,as:"div",className:"memori-media-items"},n(c).createElement("div",{className:"memori-media-items--grid"},o.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&!vm.map((e=>e.mimeType)).includes(e.mimeType)})).sort(((e,t)=>e.creationTimestamp>t.creationTimestamp?1:e.creationTimestamp<t.creationTimestamp?-1:0)).map(((e,i)=>n(c).createElement(kf.Child,{as:"div",className:"memori-media-item",key:e.url+"&index="+i,enter:"ease-out duration-500 delay-"+100*i,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95"},n(c).createElement(Nv,{sessionID:t,tenantID:r,item:{...e,title:e.title,url:e.url,content:e.content}}))))),o.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&vm.map((e=>e.mimeType)).includes(e.mimeType)})).map((e=>n(c).createElement(kf.Child,{as:"div",className:"memori-media-item--snippet",key:e.mediumID,enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0"},n(c).createElement(Iv,{key:e.mediumID,medium:e})))),o.filter((e=>{var t;return"text/css"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).map((e=>n(c).createElement("style",{key:e.mediumID,dangerouslySetInnerHTML:{__html:e.content||""}}))))};var Lv=({hints:e=[],links:t=[],media:r=[],simulateUserPrompt:i=(()=>{}),sessionID:o,baseUrl:a,translateTo:s})=>{const[l,u]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{u(!0)}),[e]),n(c).createElement("div",{className:"memori-media-widget"},(null==r?void 0:r.length)>0&&n(c).createElement(Bv,{items:r,sessionID:o,translateTo:s}),(null==t?void 0:t.length)>0&&n(c).createElement(hm,{items:t,baseUrl:a}),(null==e?void 0:e.length)>0&&l&&n(c).createElement(kf,{appear:!0,show:!0,as:"ul",className:"memori-media--hints"},e.map(((e,t)=>n(c).createElement(kf.Child,{as:"li",key:e.text+t,enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0"},n(c).createElement(bd,{key:e.text+t,className:n(md)("memori-media--hint"),primary:!0,onClick:()=>{i(e.originalText,e.text),u(!1)},onTouchEnd:()=>{i(e.originalText,e.text),u(!1)}},e.text))))))};c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");var Dv=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Dv||{});function Uv(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=null!=r?r:-1,o=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==i&&r.length-n-1>=i)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=i)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===o?r:o}c=o("85Hg2");function Fv({container:e,accept:t,walk:n,enabled:r=!0}){let i=(0,c.useRef)(t),o=(0,c.useRef)(n);(0,c.useEffect)((()=>{i.current=t,o.current=n}),[t,n]),Rd((()=>{if(!e||!r)return;let t=Xd(e);if(!t)return;let n=i.current,a=o.current,s=Object.assign((e=>n(e)),{acceptNode:n}),l=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,s,!1);for(;l.nextNode();)a(l.currentNode)}),[e,r,i,o])}c=o("85Hg2");function zv(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function jv(e,t){let[n,r]=(0,c.useState)((()=>zv(e)));return Rd((()=>{r(zv(e))}),[e.type,e.as]),Rd((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")}),[n,t]),n}var Hv=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Hv||{}),Gv=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Gv||{}),Vv=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(Vv||{});function Wv(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=ch(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{items:r,activeItemIndex:i}}let qv={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=Wv(e),i=Uv(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),o=i?e.items.indexOf(i):-1;return-1===o||o===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:o,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=Wv(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=Wv(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},Kv=(0,c.createContext)(null);function Jv(e){let t=(0,c.useContext)(Kv);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Jv),t}return t}function Qv(e,t){return yd(t.type,qv,e,t)}Kv.displayName="MenuContext";let Xv=c.Fragment,Yv=Cd((function(e,t){let r=(0,c.useReducer)(Qv,{menuState:1,buttonRef:(0,c.createRef)(),itemsRef:(0,c.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:o,buttonRef:a},s]=r,l=Ld(t);Kh([a,o],((e,t)=>{var n;s({type:1}),oh(t,ih.Loose)||(e.preventDefault(),null==(n=a.current)||n.focus())}),0===i);let u=Pd((()=>{s({type:1})})),d=(0,c.useMemo)((()=>({open:0===i,close:u})),[i,u]),h=e,f={ref:l};return n(c).createElement(Kv.Provider,{value:r},n(c).createElement(Hh,{value:yd(i,{0:zh.Open,1:zh.Closed})},_d({ourProps:f,theirProps:h,slot:d,defaultTag:Xv,name:"Menu"})))})),Zv=Cd((function(e,t){var n;let[r,i]=Jv("Menu.Button"),o=Ld(r.buttonRef,t),a=`headlessui-menu-button-${Wd()}`,s=pf(),l=Pd((e=>{switch(e.key){case Ud.Space:case Ud.Enter:case Ud.ArrowDown:e.preventDefault(),e.stopPropagation(),i({type:0}),s.nextFrame((()=>i({type:2,focus:Dv.First})));break;case Ud.ArrowUp:e.preventDefault(),e.stopPropagation(),i({type:0}),s.nextFrame((()=>i({type:2,focus:Dv.Last})))}})),u=Pd((e=>{if(e.key===Ud.Space)e.preventDefault()})),d=Pd((t=>{if(Fd(t.currentTarget))return t.preventDefault();e.disabled||(0===r.menuState?(i({type:1}),s.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),i({type:0})))})),h=(0,c.useMemo)((()=>({open:0===r.menuState})),[r]),f=e;return _d({ourProps:{ref:o,id:a,type:jv(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===r.menuState,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:f,slot:h,defaultTag:"button",name:"Menu.Button"})})),$v=xd.RenderStrategy|xd.Static,eb=Cd((function(e,t){var n,r;let[i,o]=Jv("Menu.Items"),a=Ld(i.itemsRef,t),s=gh(i.itemsRef),l=`headlessui-menu-items-${Wd()}`,u=pf(),d=jh(),h=null!==d?d===zh.Open:0===i.menuState;(0,c.useEffect)((()=>{let e=i.itemsRef.current;!e||0===i.menuState&&e!==(null==s?void 0:s.activeElement)&&e.focus({preventScroll:!0})}),[i.menuState,i.itemsRef,s]),Fv({container:i.itemsRef.current,enabled:0===i.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let f=Pd((e=>{var t,n;switch(u.dispose(),e.key){case Ud.Space:if(""!==i.searchQuery)return e.preventDefault(),e.stopPropagation(),o({type:3,value:e.key});case Ud.Enter:if(e.preventDefault(),e.stopPropagation(),o({type:1}),null!==i.activeItemIndex){let{dataRef:e}=i.items[i.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}ah(i.buttonRef.current);break;case Ud.ArrowDown:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Dv.Next});case Ud.ArrowUp:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Dv.Previous});case Ud.Home:case Ud.PageUp:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Dv.First});case Ud.End:case Ud.PageDown:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Dv.Last});case Ud.Escape:e.preventDefault(),e.stopPropagation(),o({type:1}),Qd().nextFrame((()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case Ud.Tab:e.preventDefault(),e.stopPropagation(),o({type:1}),Qd().nextFrame((()=>{uh(i.buttonRef.current,e.shiftKey?eh.Previous:eh.Next)}));break;default:1===e.key.length&&(o({type:3,value:e.key}),u.setTimeout((()=>o({type:4})),350))}})),p=Pd((e=>{if(e.key===Ud.Space)e.preventDefault()})),m=(0,c.useMemo)((()=>({open:0===i.menuState})),[i]),g=e;return _d({ourProps:{"aria-activedescendant":null===i.activeItemIndex||null==(n=i.items[i.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(r=i.buttonRef.current)?void 0:r.id,id:l,onKeyDown:f,onKeyUp:p,role:"menu",tabIndex:0,ref:a},theirProps:g,slot:m,defaultTag:"div",features:$v,visible:h,name:"Menu.Items"})})),tb=c.Fragment,nb=Cd((function(e,t){let{disabled:n=!1,...r}=e,[i,o]=Jv("Menu.Item"),a=`headlessui-menu-item-${Wd()}`,s=null!==i.activeItemIndex&&i.items[i.activeItemIndex].id===a,l=(0,c.useRef)(null),u=Ld(t,l);Rd((()=>{if(0!==i.menuState||!s||0===i.activationTrigger)return;let e=Qd();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=l.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[l,s,i.menuState,i.activationTrigger,i.activeItemIndex]);let d=(0,c.useRef)({disabled:n,domRef:l});Rd((()=>{d.current.disabled=n}),[d,n]),Rd((()=>{var e,t;d.current.textValue=null==(t=null==(e=l.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,l]),Rd((()=>(o({type:5,id:a,dataRef:d}),()=>o({type:6,id:a}))),[d,a]);let h=Pd((()=>{o({type:1})})),f=Pd((e=>{if(n)return e.preventDefault();o({type:1}),ah(i.buttonRef.current)})),p=Pd((()=>{if(n)return o({type:2,focus:Dv.Nothing});o({type:2,focus:Dv.Specific,id:a})})),m=Pd((()=>{n||s||o({type:2,focus:Dv.Specific,id:a,trigger:0})})),g=Pd((()=>{n||!s||o({type:2,focus:Dv.Nothing})})),v=(0,c.useMemo)((()=>({active:s,disabled:n,close:h})),[s,n,h]);return _d({ourProps:{id:a,ref:u,role:"menuitem",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,disabled:void 0,onClick:f,onFocus:p,onPointerMove:m,onMouseMove:m,onPointerLeave:g,onMouseLeave:g},theirProps:r,slot:v,defaultTag:tb,name:"Menu.Item"})})),rb=Object.assign(Yv,{Button:Zv,Items:eb,Item:nb});c=o("85Hg2");var ib=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 1 0 0-176 88 88 0 0 0 0 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}));c=o("85Hg2");var ob=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0 0 12.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0 0 12.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 0 0 174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}));var ab=({attachmentsMenuOpen:e,setAttachmentsMenuOpen:t,disabled:r=!1})=>n(c).createElement(rb,{as:"div",className:"memori-upload-menu"},n(c).createElement(rb.Button,{disabled:r,className:n(md)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button")},n(c).createElement("div",{className:"memori-button--icon"},n(c).createElement(ob,null))),n(c).createElement(rb.Items,{as:"ul",className:"memori-menu--overlay"},n(c).createElement(rb.Item,{as:"li",className:"memori-menu--li"},n(c).createElement(bd,{className:"memori-menu--button",ghost:!0,icon:n(c).createElement(lm,null),outlined:"link"===e,onClick:()=>t("link")},"Link")),n(c).createElement(rb.Item,null,n(c).createElement(bd,{className:"memori-menu--button",ghost:!0,icon:n(c).createElement(ib,null),outlined:"media"===e,onClick:()=>t("media")},"Media"))));c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");function sb(e=0){let[t,n]=(0,c.useState)(e),r=(0,c.useCallback)((e=>n((t=>t|e))),[t]),i=(0,c.useCallback)((e=>Boolean(t&e)),[t]),o=(0,c.useCallback)((e=>n((t=>t&~e))),[n]),a=(0,c.useCallback)((e=>n((t=>t^e))),[n]);return{addFlag:r,hasFlag:i,removeFlag:o,toggleFlag:a}}let lb=(0,(c=o("85Hg2")).createContext)(null);function cb(){let e=(0,c.useContext)(lb);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,cb),e}return e}function ub(){let[e,t]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=Pd((e=>(t((t=>[...t,e])),()=>t((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return n(c).createElement(lb.Provider,{value:i},e.children)}),[t])]}let db=Cd((function(e,t){let{passive:n=!1,...r}=e,i=cb(),o=`headlessui-label-${Wd()}`,a=Ld(t);Rd((()=>i.register(o)),[o,i.register]);let s={ref:a,...i.props,id:o};return n&&("onClick"in s&&delete s.onClick,"onClick"in r&&delete r.onClick),_d({ourProps:s,theirProps:r,slot:i.slot||{},defaultTag:"label",name:i.name||"Label"})}));function hb(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))pb(n,fb(t,r),i);return n}function fb(e,t){return e?e+"["+t+"]":t}function pb(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())pb(e,fb(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):hb(n,t,e)}function mb(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n)for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type)return void e.click()}c=o("85Hg2");function gb(e,t,n){let[r,i]=(0,c.useState)(n),o=void 0!==e,a=(0,c.useRef)(o),s=(0,c.useRef)(!1),l=(0,c.useRef)(!1);return!o||a.current||s.current?!o&&a.current&&!l.current&&(l.current=!0,a.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(s.current=!0,a.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[o?e:r,Pd((e=>(o||i(e),null==t?void 0:t(e))))]}var vb,bb=((vb=bb||{})[vb.RegisterOption=0]="RegisterOption",vb[vb.UnregisterOption=1]="UnregisterOption",vb);let yb={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:ch(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},wb=(0,c.createContext)(null);function Sb(e){let t=(0,c.useContext)(wb);if(null===t){let t=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Sb),t}return t}function xb(e,t){return yd(t.type,yb,e,t)}wb.displayName="RadioGroupContext";let Mb=Cd((function(e,t){let{value:r,defaultValue:i,name:o,onChange:a,by:s=((e,t)=>e===t),disabled:l=!1,...u}=e,d=Pd("string"==typeof s?(e,t)=>{let n=s;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:s),[h,f]=(0,c.useReducer)(xb,{options:[]}),p=h.options,[m,g]=ub(),[v,b]=Dh(),y=`headlessui-radiogroup-${Wd()}`,w=(0,c.useRef)(null),S=Ld(w,t),[x,M]=gb(r,a,i),_=(0,c.useMemo)((()=>p.find((e=>!e.propsRef.current.disabled))),[p]),A=(0,c.useMemo)((()=>p.some((e=>d(e.propsRef.current.value,x)))),[p,x]),E=Pd((e=>{var t;if(l||d(e,x))return!1;let n=null==(t=p.find((t=>d(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==M||M(e),!0)}));Fv({container:w.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let C=Pd((e=>{let t=w.current;if(!t)return;let n=Xd(t),r=p.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case Ud.Enter:mb(e.currentTarget);break;case Ud.ArrowLeft:case Ud.ArrowUp:if(e.preventDefault(),e.stopPropagation(),dh(r,eh.Previous|eh.WrapAround)===th.Success){let e=p.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&E(e.propsRef.current.value)}break;case Ud.ArrowRight:case Ud.ArrowDown:if(e.preventDefault(),e.stopPropagation(),dh(r,eh.Next|eh.WrapAround)===th.Success){let e=p.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&E(e.propsRef.current.value)}break;case Ud.Space:{e.preventDefault(),e.stopPropagation();let t=p.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&E(t.propsRef.current.value)}}})),T=Pd((e=>(f({type:0,...e}),()=>f({type:1,id:e.id})))),I=(0,c.useMemo)((()=>({registerOption:T,firstOption:_,containsCheckedOption:A,change:E,disabled:l,value:x,compare:d})),[T,_,A,E,l,x,d]),k={ref:S,id:y,role:"radiogroup","aria-labelledby":m,"aria-describedby":v,onKeyDown:C},R=(0,c.useMemo)((()=>({value:x})),[x]);return n(c).createElement(b,{name:"RadioGroup.Description"},n(c).createElement(g,{name:"RadioGroup.Label"},n(c).createElement(wb.Provider,{value:I},null!=o&&null!=x&&hb({[o]:x}).map((([e,t])=>n(c).createElement(Kd,{features:qd.Hidden,...Td({key:e,as:"input",type:"radio",checked:null!=t,hidden:!0,readOnly:!0,name:e,value:t})}))),_d({ourProps:k,theirProps:u,slot:R,defaultTag:"div",name:"RadioGroup"}))))}));var _b=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(_b||{});let Ab=Cd((function(e,t){let r=(0,c.useRef)(null),i=Ld(r,t),o=`headlessui-radiogroup-option-${Wd()}`,[a,s]=ub(),[l,u]=Dh(),{addFlag:d,removeFlag:h,hasFlag:f}=sb(1),{value:p,disabled:m=!1,...g}=e,v=(0,c.useRef)({value:p,disabled:m});Rd((()=>{v.current.value=p}),[p,v]),Rd((()=>{v.current.disabled=m}),[m,v]);let{registerOption:b,disabled:y,change:w,firstOption:S,containsCheckedOption:x,value:M,compare:_}=Sb("RadioGroup.Option");Rd((()=>b({id:o,element:r,propsRef:v})),[o,b,r,e]);let A=Pd((e=>{var t;if(Fd(e.currentTarget))return e.preventDefault();!w(p)||(d(2),null==(t=r.current)||t.focus())})),E=Pd((e=>{if(Fd(e.currentTarget))return e.preventDefault();d(2)})),C=Pd((()=>h(2))),T=(null==S?void 0:S.id)===o,I=y||m,k=_(M,p),R={ref:i,id:o,role:"radio","aria-checked":k?"true":"false","aria-labelledby":a,"aria-describedby":l,"aria-disabled":!!I||void 0,tabIndex:I?-1:k||!x&&T?0:-1,onClick:I?void 0:A,onFocus:I?void 0:E,onBlur:I?void 0:C},O=(0,c.useMemo)((()=>({checked:k,disabled:I,active:f(2)})),[k,I,f]);return n(c).createElement(u,{name:"RadioGroup.Description"},n(c).createElement(s,{name:"RadioGroup.Label"},_d({ourProps:R,theirProps:g,slot:O,defaultTag:"div",name:"RadioGroup.Option"})))})),Eb=Object.assign(Mb,{Option:Ab,Label:db,Description:Uh});var Cb=({sendOnEnter:e,setSendOnEnter:t})=>{const{t:r}=yo();return n(c).createElement(rb,{as:"div",className:"memori-send-on-enter-menu"},n(c).createElement(rb.Button,{className:n(md)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button")},n(c).createElement("div",{className:"memori-button--icon"},"…")),n(c).createElement(rb.Items,{className:"memori-menu--overlay"},n(c).createElement(Eb,{value:e,onChange:t},n(c).createElement(Eb.Option,{value:"keypress",className:"memori-menu--option"},(({checked:e})=>n(c).createElement(rb.Item,null,n(c).createElement(bd,{className:"memori-menu--button",ghost:!0,outlined:e,icon:n(c).createElement("span",{className:"memori-menu--icon"},e?"✓":"")},r("widget.sendOnKeypress"))))),n(c).createElement(Eb.Option,{value:"click",className:"memori-menu--option"},(({checked:e})=>n(c).createElement(rb.Item,null,n(c).createElement(bd,{className:"memori-menu--button",ghost:!0,outlined:e,icon:n(c).createElement("span",{className:"memori-menu--icon"},e?"✓":"")},r("widget.sendOnClick"))))))))};c=o("85Hg2"),c=o("85Hg2");var Tb=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"}));c=o("85Hg2");var Ib=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}));var kb=({disabled:e=!1,value:t,onChange:r,onPressEnter:i,onFocus:o,onBlur:a})=>{const[s,l]=(0,c.useState)(!1);return n(c).createElement("div",{"data-testid":"chat-textarea",className:n(md)("memori-chat-textarea",{"memori-chat-textarea--expanded":s,"memori-chat-textarea--disabled":e})},n(c).createElement("div",{className:"memori-chat-textarea--inner"},n(c).createElement("textarea",{className:"memori-chat-textarea--input",disabled:e,value:t,onChange:e=>{r(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&i&&i(e)},onFocus:o,onBlur:a}),n(c).createElement("div",{className:"memori-chat-textarea--expand"},n(c).createElement(bd,{className:n(md)("memori-chat-textarea--expand-button"),onClick:()=>l(!s),padded:!1,ghost:!0,icon:s?n(c).createElement(Ib,null):n(c).createElement(Tb,null)}))))};c=o("85Hg2");var Rb=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}));c=o("85Hg2");var Ob=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"}));c=o("85Hg2");var Pb=({content:e,className:t,alignLeft:r=!1,disabled:i=!1,visible:o=!1,children:a})=>n(c).createElement("div",{className:n(md)("memori-tooltip",t,{"memori-tooltip--align-left":r,"memori-tooltip--disabled":i,"memori-tooltip--visible":o})},n(c).createElement("div",{className:"memori-tooltip--content"},e),n(c).createElement("div",{className:"memori-tooltip--trigger"},a));var Nb=({dialogState:e,instruct:t=!1,sendOnEnter:r="click",setSendOnEnter:i,attachmentsMenuOpen:o,setAttachmentsMenuOpen:a,userMessage:s="",onChangeUserMessage:l,sendMessage:u,onTextareaFocus:d,onTextareaBlur:h,onTextareaPressEnter:f,showMicrophone:p=!1,listening:m=!1,isPlayingAudio:g=!1,stopAudio:v,startListening:b,stopListening:y})=>{const{t:w}=yo();return n(c).createElement("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===(null==e?void 0:e.state)||"X3"===(null==e?void 0:e.state)},t&&n(c).createElement(ab,{attachmentsMenuOpen:o,setAttachmentsMenuOpen:a,disabled:!(null==e?void 0:e.acceptsMedia)}),n(c).createElement(Cb,{sendOnEnter:r,setSendOnEnter:i}),n(c).createElement(kb,{value:s,onChange:l,onPressEnter:f,onFocus:d,onBlur:h,disabled:["R2","R3","R4","G3","X3"].includes((null==e?void 0:e.state)||"")}),n(c).createElement(bd,{shape:"circle",primary:!!(null==s?void 0:s.length),disabled:!s||0===s.length,className:"memori-chat-inputs--send",onClick:()=>u(s),title:w("send")||"Send",icon:n(c).createElement(Rb,null)}),p&&n(c).createElement(Pb,{alignLeft:!0,content:w(m?"write_and_speak.micButtonPopoverListening":"write_and_speak.micButtonPopover")},n(c).createElement(bd,{className:n(md)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":m}),disabled:g,onClick:()=>{m?y():(v(),b())},shape:"circle",icon:n(c).createElement(Ob,null)})))};var Bb=({memori:e,tenant:t,sessionID:r,baseUrl:i,translateTo:o,memoriTyping:a,history:s=[],dialogState:l,simulateUserPrompt:u,showDates:d=!1,showContextPerLine:h=!1,selectReceiverTag:f,preview:p=!1,instruct:m=!1,showInputs:g=!0,showMicrophone:v=!1,sendOnEnter:b,setSendOnEnter:y,attachmentsMenuOpen:w,setAttachmentsMenuOpen:S,userMessage:x="",onChangeUserMessage:M,sendMessage:_,listening:A,isPlayingAudio:E,stopAudio:C,startListening:T,stopListening:I,resetTranscript:k})=>{var R,O,P,N,B;const L=()=>{setTimeout((()=>{var e,t,n,r,i;document.body.classList.contains("chat-focused")?(null===(e=document.querySelector(".ant-tabs-nav"))||void 0===e||e.scrollIntoView(),null===(t=document.querySelector(".memori-chat--content"))||void 0===t||t.scrollTo(0,null!==(r=null===(n=document.querySelector(".memori-chat--content"))||void 0===n?void 0:n.scrollHeight)&&void 0!==r?r:0)):null===(i=document.querySelector("#end-messages-ref"))||void 0===i||i.scrollIntoView({behavior:"smooth"})}),200)};(0,c.useEffect)((()=>{!p&&L()}),[s,p]);return n(c).createElement("div",{className:n(md)("memori-chat--wrapper",{"memori-chat-wrapper--translate":o}),id:"chat-wrapper",lang:null==o?void 0:o.toUpperCase(),"data-memori-lang":null!==(N=null===(P=null===(O=null===(R=e.culture)||void 0===R?void 0:R.split("-"))||void 0===O?void 0:O[0])||void 0===P?void 0:P.toUpperCase())&&void 0!==N?N:"EN"},n(c).createElement("div",{className:n(md)("memori-chat--history",{"memori-chat--history-touch":nm()})},n(c).createElement("div",{className:n(md)("memori-chat--content",{"memori-chat--content-touch":nm()})},n(c).createElement("div",{className:n(md)("memori-chat--cover"),style:{backgroundImage:`url("${im({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:i})}"), url("${im({type:"cover",tenantID:null==t?void 0:t.id,baseURL:i||"https://app.twincreator.com"})}")`}}),s.map(((a,s)=>{var l,f,p,m;return n(c).createElement(n(c).Fragment,{key:s},n(c).createElement(am,{message:a,memori:e,tenant:t,baseUrl:i}),d&&!!a.timestamp&&n(c).createElement("small",{className:"memori-chat--timestamp "+(a.fromUser?"text-right":"text-left")},new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(a.timestamp.endsWith("Z")?a.timestamp:`${a.timestamp}Z`))),h&&!!Object.keys(null!==(l=a.contextVars)&&void 0!==l?l:{}).length&&n(c).createElement("div",{className:"memori-chat--context-vars"},Object.keys(null!==(f=a.contextVars)&&void 0!==f?f:{}).map((e=>{var t,r,i;return"-"===(null===(t=a.contextVars)||void 0===t?void 0:t[e])?n(c).createElement("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",key:e},n(c).createElement("span",{className:"memori-chat--context-tag-text"},e)):"✔️"===(null===(r=a.contextVars)||void 0===r?void 0:r[e])?n(c).createElement("div",{className:"memori-chat--context-tag",key:e},n(c).createElement("span",{className:"memori-chat--context-tag-text"},e)):n(c).createElement("div",{className:"memori-chat--context-tag",key:e},n(c).createElement("span",{className:"memori-chat--context-tag-text"},e,": ",null===(i=a.contextVars)||void 0===i?void 0:i[e]))}))),n(c).createElement(Lv,{simulateUserPrompt:u,media:null===(p=null==a?void 0:a.media)||void 0===p?void 0:p.filter((e=>"text/html"!==e.mimeType&&"text/plain"!==e.mimeType)),links:null===(m=null==a?void 0:a.media)||void 0===m?void 0:m.filter((e=>"text/html"===e.mimeType)),sessionID:r,baseUrl:i,translateTo:o}))})),a&&n(c).createElement("div",{className:"memori-chat--bubble"},n(c).createElement("div",{id:"wave"},n(c).createElement("span",{className:"dot"}),n(c).createElement("span",{className:"dot"}),n(c).createElement("span",{className:"dot"}))),(null==l?void 0:l.hints)&&l.hints.length>0&&n(c).createElement(Lv,{simulateUserPrompt:u,hints:l.translatedHints?l.translatedHints:l.hints.map((e=>({text:e,originalText:e})))}),n(c).createElement("div",{id:"end-messages-ref"}))),"X3"===(null==l?void 0:l.state)&&r&&n(c).createElement("div",{className:"memori-chat--known-tags"},Object.keys(null!==(B=l.knownTags)&&void 0!==B?B:{}).filter((t=>t!==e.giverTag)).map((e=>{var t;return n(c).createElement(bd,{key:e,icon:n(c).createElement("span",{className:"memori-chat--known-tag-icon"},e),className:"memori-chat--known-tag",onClick:()=>f(e)},null===(t=l.knownTags)||void 0===t?void 0:t[e])}))),g&&n(c).createElement(Nb,{userMessage:x,onChangeUserMessage:M,dialogState:l,instruct:m,sendMessage:_,sendOnEnter:b,setSendOnEnter:y,attachmentsMenuOpen:w,setAttachmentsMenuOpen:S,onTextareaPressEnter:()=>{"keypress"===b&&(null==x?void 0:x.length)>0&&(I(),_(x),M(""),k())},onTextareaFocus:()=>{var e,t;I(),nm()&&window.innerWidth<=768&&(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t||t.add("chat-focused"),setTimeout((()=>{L()}),300))},onTextareaBlur:()=>{var e,t,n;(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("chat-focused"))&&(null===(n=document.getElementById("chat-wrapper"))||void 0===n||n.classList.remove("chat-focused"),L())},startListening:T,stopListening:I,stopAudio:C,listening:A,isPlayingAudio:E,showMicrophone:v}))};c=o("85Hg2"),c=o("85Hg2");var Lb=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),n(c).createElement("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"}));c=o("85Hg2"),c=o("85Hg2");var Db=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}));var Ub=({memoriName:e,blockedUntil:t,showGiverInfo:r=!1,showTitle:i=!1,marginLeft:o=!1})=>{const{t:a}=yo(),s=new Date(t);return s>new Date?n(c).createElement(Pb,{className:"blocked-memori-badge--tooltip",content:n(c).createElement(n(c).Fragment,null,!r&&a("memoriBlockedAnon",{name:e,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(s)}),r&&a("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(s)}),r&&` ${a("memoriBlockedReasonExceedChats")}`,r&&n(c).createElement("br",null),r&&`\n${a("memoriBlockedGiverHelper")}`)},n(c).createElement("div",{className:"blocked-memori-badge--wrapper"},n(c).createElement("div",{className:"blocked-memori-badge "+(o?" margin-left":"")},n(c).createElement(Db,{className:"blocked-memori-badge--icon"})),i&&n(c).createElement("span",{className:"blocked-memori-badge--title"},a("memoriBlockedTitle")))):null};var Fb=({memori:e,tenant:t,gamificationLevel:r,language:i,userLang:o,setUserLang:a,baseUrl:s,position:l,openPositionDrawer:u,integrationConfig:d,instruct:h=!1,clickedStart:f,onClickStart:p})=>{var m,g;const{t:v,i18n:b}=yo(),[y,w]=(0,c.useState)(e.description),[S,x]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{var t,n,r,o,a,l;(null!==(n=null===(t=b.language)||void 0===t?void 0:t.toUpperCase())&&void 0!==n?n:"IT")!==(null!==(r=null==i?void 0:i.toUpperCase())&&void 0!==r?r:"IT")&&(null===(o=e.description)||void 0===o?void 0:o.length)&&pm(e.description,null!==(l=null===(a=b.language)||void 0===a?void 0:a.toUpperCase())&&void 0!==l?l:"IT",i,s).then((e=>{w(e.text)})).catch(console.error)}),[b.language,i,e.description,s]),n(c).createElement("div",{className:"memori--start-panel"},n(c).createElement("div",{className:"memori--cover",style:{backgroundImage:`url("${im({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:s})}"), url("${im({type:"cover",tenantID:null==t?void 0:t.id,baseURL:s})}")`}},!!(null===(m=null==r?void 0:r.badge)||void 0===m?void 0:m.length)&&n(c).createElement("div",{className:"memori--gamification-badge"},n(c).createElement(Pb,{alignLeft:!0,content:`${v("gamification.level")} ${r.badge}, ${r.points} ${v("gamification.points")}`},n(c).createElement("span",{"aria-label":`${v("gamification.level")} ${r.badge}, ${r.points} ${v("gamification.points")}`},r.badge)))),n(c).createElement("picture",{className:"memori--avatar"},n(c).createElement("source",{src:null!==(g=e.avatarURL)&&void 0!==g?g:im({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:s})}),n(c).createElement("img",{alt:e.name,src:e.avatarURL&&e.avatarURL.length>0?im({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:s}):im({type:"avatar",tenantID:null==t?void 0:t.id,baseURL:s})})),n(c).createElement("h2",{className:"memori--title"},e.name),e.needsPosition&&!l&&n(c).createElement("div",{className:"memori--needsPosition"},n(c).createElement("p",null,v("write_and_speak.requirePosition")),n(c).createElement(bd,{primary:!0,onClick:()=>u(),className:"memori--start-button"},v("widget.position"))),(e.needsPosition&&l||!e.needsPosition)&&n(c).createElement("div",{className:"memori--description"},n(c).createElement("p",null,n(c).createElement("span",{className:"memori--description-text"},y&&S?y:e.description),y!==e.description&&n(c).createElement(bd,{ghost:!0,className:"memori--translation-toggle",icon:n(c).createElement(Lb,null),onClick:()=>{x((e=>!e))}},v(S?"showOriginalText":"showTranslatedText"))),(null==d?void 0:d.multilanguage)&&!h&&n(c).createElement("div",{className:"memori--language-chooser"},n(c).createElement("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref"},v("write_and_speak.iWantToTalkToIn",{name:e.name})),n(c).createElement("select",{id:"user-lang-pref",value:(null!=o?o:b.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{a(e.target.value)}},mm.map((e=>n(c).createElement("option",{key:e.value,value:e.value,"aria-label":e.label},e.label))))),n(c).createElement(bd,{primary:!0,disabled:!!e.blockedUntil&&!e.isGiver,loading:f,onClick:()=>p&&p(),className:"memori--start-button"},v("write_and_speak."+(h?"instructButton":"tryMeButton"))),n(c).createElement("p",{className:"memori--start-description"},v(h?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")),!!e.blockedUntil&&n(c).createElement(Ub,{memoriName:e.name,blockedUntil:e.blockedUntil,showGiverInfo:e.isGiver,showTitle:!0,marginLeft:!0})))},zb=(c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2"),Wi=o("hcaHr"),c=o("85Hg2"),["forwardedRef"]);function jb(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 Hb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jb(Object(r),!0).forEach((function(t){n(qi)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}class Gb extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:n(c).createElement("div",{style:{background:"rgba(255, 255, 255, 0.4)",color:"#000",padding:"2rem",borderRadius:"10px"}},n(c).createElement("h2",null,this.props.t("error.generic")),n(c).createElement(bd,{primary:!0,onClick:()=>this.setState({hasError:!1})},this.props.t("error.tryAgain")||"Try again")):this.props.children}}var Vb=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){function i(i){var o=i.forwardedRef,a=n(Nm)(i,zb),s=yo(e,Hb(Hb({},a),{},{keyPrefix:t.keyPrefix})),l=n(Wi)(s,3),u=l[0],d=l[1],h=l[2],f=Hb(Hb({},a),{},{t:u,i18n:d,tReady:h});return t.withRef&&o?f.ref=o:!t.withRef&&o&&(f.forwardedRef=o),(0,c.createElement)(r,f)}i.displayName="withI18nextTranslation(".concat(mo(r),")"),i.WrappedComponent=r;return t.withRef?(0,c.forwardRef)((function(e,t){return(0,c.createElement)(i,Object.assign({},e,{forwardedRef:t}))})):i}}(["common"])(Gb),Wb=(c=o("85Hg2"),c=o("85Hg2"),{});e(Wb,"REVISION",(()=>qb)),e(Wb,"MOUSE",(()=>Kb)),e(Wb,"TOUCH",(()=>Jb)),e(Wb,"CullFaceNone",(()=>Qb)),e(Wb,"CullFaceBack",(()=>Xb)),e(Wb,"CullFaceFront",(()=>Yb)),e(Wb,"CullFaceFrontBack",(()=>Zb)),e(Wb,"BasicShadowMap",(()=>$b)),e(Wb,"PCFShadowMap",(()=>ey)),e(Wb,"PCFSoftShadowMap",(()=>ty)),e(Wb,"VSMShadowMap",(()=>ny)),e(Wb,"FrontSide",(()=>ry)),e(Wb,"BackSide",(()=>iy)),e(Wb,"DoubleSide",(()=>oy)),e(Wb,"NoBlending",(()=>ay)),e(Wb,"NormalBlending",(()=>sy)),e(Wb,"AdditiveBlending",(()=>ly)),e(Wb,"SubtractiveBlending",(()=>cy)),e(Wb,"MultiplyBlending",(()=>uy)),e(Wb,"CustomBlending",(()=>dy)),e(Wb,"AddEquation",(()=>hy)),e(Wb,"SubtractEquation",(()=>fy)),e(Wb,"ReverseSubtractEquation",(()=>py)),e(Wb,"MinEquation",(()=>my)),e(Wb,"MaxEquation",(()=>gy)),e(Wb,"ZeroFactor",(()=>vy)),e(Wb,"OneFactor",(()=>by)),e(Wb,"SrcColorFactor",(()=>yy)),e(Wb,"OneMinusSrcColorFactor",(()=>wy)),e(Wb,"SrcAlphaFactor",(()=>Sy)),e(Wb,"OneMinusSrcAlphaFactor",(()=>xy)),e(Wb,"DstAlphaFactor",(()=>My)),e(Wb,"OneMinusDstAlphaFactor",(()=>_y)),e(Wb,"DstColorFactor",(()=>Ay)),e(Wb,"OneMinusDstColorFactor",(()=>Ey)),e(Wb,"SrcAlphaSaturateFactor",(()=>Cy)),e(Wb,"NeverDepth",(()=>Ty)),e(Wb,"AlwaysDepth",(()=>Iy)),e(Wb,"LessDepth",(()=>ky)),e(Wb,"LessEqualDepth",(()=>Ry)),e(Wb,"EqualDepth",(()=>Oy)),e(Wb,"GreaterEqualDepth",(()=>Py)),e(Wb,"GreaterDepth",(()=>Ny)),e(Wb,"NotEqualDepth",(()=>By)),e(Wb,"MultiplyOperation",(()=>Ly)),e(Wb,"MixOperation",(()=>Dy)),e(Wb,"AddOperation",(()=>Uy)),e(Wb,"NoToneMapping",(()=>Fy)),e(Wb,"LinearToneMapping",(()=>zy)),e(Wb,"ReinhardToneMapping",(()=>jy)),e(Wb,"CineonToneMapping",(()=>Hy)),e(Wb,"ACESFilmicToneMapping",(()=>Gy)),e(Wb,"CustomToneMapping",(()=>Vy)),e(Wb,"UVMapping",(()=>Wy)),e(Wb,"CubeReflectionMapping",(()=>qy)),e(Wb,"CubeRefractionMapping",(()=>Ky)),e(Wb,"EquirectangularReflectionMapping",(()=>Jy)),e(Wb,"EquirectangularRefractionMapping",(()=>Qy)),e(Wb,"CubeUVReflectionMapping",(()=>Xy)),e(Wb,"RepeatWrapping",(()=>Yy)),e(Wb,"ClampToEdgeWrapping",(()=>Zy)),e(Wb,"MirroredRepeatWrapping",(()=>$y)),e(Wb,"NearestFilter",(()=>ew)),e(Wb,"NearestMipmapNearestFilter",(()=>tw)),e(Wb,"NearestMipMapNearestFilter",(()=>nw)),e(Wb,"NearestMipmapLinearFilter",(()=>rw)),e(Wb,"NearestMipMapLinearFilter",(()=>iw)),e(Wb,"LinearFilter",(()=>ow)),e(Wb,"LinearMipmapNearestFilter",(()=>aw)),e(Wb,"LinearMipMapNearestFilter",(()=>sw)),e(Wb,"LinearMipmapLinearFilter",(()=>lw)),e(Wb,"LinearMipMapLinearFilter",(()=>cw)),e(Wb,"UnsignedByteType",(()=>uw)),e(Wb,"ByteType",(()=>dw)),e(Wb,"ShortType",(()=>hw)),e(Wb,"UnsignedShortType",(()=>fw)),e(Wb,"IntType",(()=>pw)),e(Wb,"UnsignedIntType",(()=>mw)),e(Wb,"FloatType",(()=>gw)),e(Wb,"HalfFloatType",(()=>vw)),e(Wb,"UnsignedShort4444Type",(()=>bw)),e(Wb,"UnsignedShort5551Type",(()=>yw)),e(Wb,"UnsignedInt248Type",(()=>ww)),e(Wb,"AlphaFormat",(()=>Sw)),e(Wb,"RGBFormat",(()=>xw)),e(Wb,"RGBAFormat",(()=>Mw)),e(Wb,"LuminanceFormat",(()=>_w)),e(Wb,"LuminanceAlphaFormat",(()=>Aw)),e(Wb,"DepthFormat",(()=>Ew)),e(Wb,"DepthStencilFormat",(()=>Cw)),e(Wb,"RedFormat",(()=>Tw)),e(Wb,"RedIntegerFormat",(()=>Iw)),e(Wb,"RGFormat",(()=>kw)),e(Wb,"RGIntegerFormat",(()=>Rw)),e(Wb,"RGBAIntegerFormat",(()=>Ow)),e(Wb,"RGB_S3TC_DXT1_Format",(()=>Pw)),e(Wb,"RGBA_S3TC_DXT1_Format",(()=>Nw)),e(Wb,"RGBA_S3TC_DXT3_Format",(()=>Bw)),e(Wb,"RGBA_S3TC_DXT5_Format",(()=>Lw)),e(Wb,"RGB_PVRTC_4BPPV1_Format",(()=>Dw)),e(Wb,"RGB_PVRTC_2BPPV1_Format",(()=>Uw)),e(Wb,"RGBA_PVRTC_4BPPV1_Format",(()=>Fw)),e(Wb,"RGBA_PVRTC_2BPPV1_Format",(()=>zw)),e(Wb,"RGB_ETC1_Format",(()=>jw)),e(Wb,"RGB_ETC2_Format",(()=>Hw)),e(Wb,"RGBA_ETC2_EAC_Format",(()=>Gw)),e(Wb,"RGBA_ASTC_4x4_Format",(()=>Vw)),e(Wb,"RGBA_ASTC_5x4_Format",(()=>Ww)),e(Wb,"RGBA_ASTC_5x5_Format",(()=>qw)),e(Wb,"RGBA_ASTC_6x5_Format",(()=>Kw)),e(Wb,"RGBA_ASTC_6x6_Format",(()=>Jw)),e(Wb,"RGBA_ASTC_8x5_Format",(()=>Qw)),e(Wb,"RGBA_ASTC_8x6_Format",(()=>Xw)),e(Wb,"RGBA_ASTC_8x8_Format",(()=>Yw)),e(Wb,"RGBA_ASTC_10x5_Format",(()=>Zw)),e(Wb,"RGBA_ASTC_10x6_Format",(()=>$w)),e(Wb,"RGBA_ASTC_10x8_Format",(()=>eS)),e(Wb,"RGBA_ASTC_10x10_Format",(()=>tS)),e(Wb,"RGBA_ASTC_12x10_Format",(()=>nS)),e(Wb,"RGBA_ASTC_12x12_Format",(()=>rS)),e(Wb,"RGBA_BPTC_Format",(()=>iS)),e(Wb,"LoopOnce",(()=>oS)),e(Wb,"LoopRepeat",(()=>aS)),e(Wb,"LoopPingPong",(()=>sS)),e(Wb,"InterpolateDiscrete",(()=>lS)),e(Wb,"InterpolateLinear",(()=>cS)),e(Wb,"InterpolateSmooth",(()=>uS)),e(Wb,"ZeroCurvatureEnding",(()=>dS)),e(Wb,"ZeroSlopeEnding",(()=>hS)),e(Wb,"WrapAroundEnding",(()=>fS)),e(Wb,"NormalAnimationBlendMode",(()=>pS)),e(Wb,"AdditiveAnimationBlendMode",(()=>mS)),e(Wb,"TrianglesDrawMode",(()=>gS)),e(Wb,"TriangleStripDrawMode",(()=>vS)),e(Wb,"TriangleFanDrawMode",(()=>bS)),e(Wb,"LinearEncoding",(()=>yS)),e(Wb,"sRGBEncoding",(()=>wS)),e(Wb,"BasicDepthPacking",(()=>SS)),e(Wb,"RGBADepthPacking",(()=>xS)),e(Wb,"TangentSpaceNormalMap",(()=>MS)),e(Wb,"ObjectSpaceNormalMap",(()=>_S)),e(Wb,"NoColorSpace",(()=>AS)),e(Wb,"SRGBColorSpace",(()=>ES)),e(Wb,"LinearSRGBColorSpace",(()=>CS)),e(Wb,"ZeroStencilOp",(()=>TS)),e(Wb,"KeepStencilOp",(()=>IS)),e(Wb,"ReplaceStencilOp",(()=>kS)),e(Wb,"IncrementStencilOp",(()=>RS)),e(Wb,"DecrementStencilOp",(()=>OS)),e(Wb,"IncrementWrapStencilOp",(()=>PS)),e(Wb,"DecrementWrapStencilOp",(()=>NS)),e(Wb,"InvertStencilOp",(()=>BS)),e(Wb,"NeverStencilFunc",(()=>LS)),e(Wb,"LessStencilFunc",(()=>DS)),e(Wb,"EqualStencilFunc",(()=>US)),e(Wb,"LessEqualStencilFunc",(()=>FS)),e(Wb,"GreaterStencilFunc",(()=>zS)),e(Wb,"NotEqualStencilFunc",(()=>jS)),e(Wb,"GreaterEqualStencilFunc",(()=>HS)),e(Wb,"AlwaysStencilFunc",(()=>GS)),e(Wb,"StaticDrawUsage",(()=>VS)),e(Wb,"DynamicDrawUsage",(()=>WS)),e(Wb,"StreamDrawUsage",(()=>qS)),e(Wb,"StaticReadUsage",(()=>KS)),e(Wb,"DynamicReadUsage",(()=>JS)),e(Wb,"StreamReadUsage",(()=>QS)),e(Wb,"StaticCopyUsage",(()=>XS)),e(Wb,"DynamicCopyUsage",(()=>YS)),e(Wb,"StreamCopyUsage",(()=>ZS)),e(Wb,"GLSL1",(()=>$S)),e(Wb,"GLSL3",(()=>ex)),e(Wb,"_SRGBAFormat",(()=>tx)),e(Wb,"EventDispatcher",(()=>nx)),e(Wb,"MathUtils",(()=>gx)),e(Wb,"Vector2",(()=>vx)),e(Wb,"Matrix3",(()=>bx)),e(Wb,"ColorManagement",(()=>Ex)),e(Wb,"Color",(()=>Px)),e(Wb,"ImageUtils",(()=>Bx)),e(Wb,"Source",(()=>Lx)),e(Wb,"Texture",(()=>Fx)),e(Wb,"Vector4",(()=>zx)),e(Wb,"WebGLRenderTarget",(()=>jx)),e(Wb,"DataArrayTexture",(()=>Hx)),e(Wb,"WebGLArrayRenderTarget",(()=>Gx)),e(Wb,"Data3DTexture",(()=>Vx)),e(Wb,"WebGL3DRenderTarget",(()=>Wx)),e(Wb,"WebGLMultipleRenderTargets",(()=>qx)),e(Wb,"Quaternion",(()=>Kx)),e(Wb,"Vector3",(()=>Jx)),e(Wb,"Box3",(()=>Yx)),e(Wb,"Sphere",(()=>gM)),e(Wb,"Ray",(()=>_M)),e(Wb,"Matrix4",(()=>AM)),e(Wb,"Euler",(()=>BM)),e(Wb,"Layers",(()=>LM)),e(Wb,"Object3D",(()=>XM)),e(Wb,"Triangle",(()=>s_)),e(Wb,"Material",(()=>c_)),e(Wb,"MeshBasicMaterial",(()=>u_)),e(Wb,"BufferAttribute",(()=>f_)),e(Wb,"Int8BufferAttribute",(()=>p_)),e(Wb,"Uint8BufferAttribute",(()=>m_)),e(Wb,"Uint8ClampedBufferAttribute",(()=>g_)),e(Wb,"Int16BufferAttribute",(()=>v_)),e(Wb,"Uint16BufferAttribute",(()=>b_)),e(Wb,"Int32BufferAttribute",(()=>y_)),e(Wb,"Uint32BufferAttribute",(()=>w_)),e(Wb,"Float16BufferAttribute",(()=>S_)),e(Wb,"Float32BufferAttribute",(()=>x_)),e(Wb,"Float64BufferAttribute",(()=>M_)),e(Wb,"BufferGeometry",(()=>R_)),e(Wb,"Mesh",(()=>Q_)),e(Wb,"BoxGeometry",(()=>Y_)),e(Wb,"UniformsUtils",(()=>eA)),e(Wb,"ShaderMaterial",(()=>tA)),e(Wb,"Camera",(()=>nA)),e(Wb,"PerspectiveCamera",(()=>rA)),e(Wb,"CubeCamera",(()=>oA)),e(Wb,"CubeTexture",(()=>aA)),e(Wb,"WebGLCubeRenderTarget",(()=>sA)),e(Wb,"Plane",(()=>dA)),e(Wb,"Frustum",(()=>pA)),e(Wb,"PlaneGeometry",(()=>vA)),e(Wb,"ShaderChunk",(()=>bA)),e(Wb,"UniformsLib",(()=>yA)),e(Wb,"ShaderLib",(()=>wA)),e(Wb,"OrthographicCamera",(()=>CA)),e(Wb,"PMREMGenerator",(()=>LA)),e(Wb,"MeshDepthMaterial",(()=>OC)),e(Wb,"MeshDistanceMaterial",(()=>PC)),e(Wb,"WebGLUtils",(()=>DC)),e(Wb,"ArrayCamera",(()=>UC)),e(Wb,"Group",(()=>FC)),e(Wb,"DepthTexture",(()=>HC)),e(Wb,"WebGLRenderer",(()=>qC)),e(Wb,"WebGL1Renderer",(()=>KC)),e(Wb,"FogExp2",(()=>JC)),e(Wb,"Fog",(()=>QC)),e(Wb,"Scene",(()=>XC)),e(Wb,"InterleavedBuffer",(()=>YC)),e(Wb,"InterleavedBufferAttribute",(()=>$C)),e(Wb,"SpriteMaterial",(()=>eT)),e(Wb,"Sprite",(()=>pT)),e(Wb,"LOD",(()=>bT)),e(Wb,"SkinnedMesh",(()=>_T)),e(Wb,"Bone",(()=>AT)),e(Wb,"DataTexture",(()=>ET)),e(Wb,"Skeleton",(()=>IT)),e(Wb,"InstancedBufferAttribute",(()=>kT)),e(Wb,"InstancedMesh",(()=>BT)),e(Wb,"LineBasicMaterial",(()=>LT)),e(Wb,"Line",(()=>HT)),e(Wb,"LineSegments",(()=>WT)),e(Wb,"LineLoop",(()=>qT)),e(Wb,"PointsMaterial",(()=>KT)),e(Wb,"Points",(()=>ZT)),e(Wb,"VideoTexture",(()=>eI)),e(Wb,"FramebufferTexture",(()=>tI)),e(Wb,"CompressedTexture",(()=>nI)),e(Wb,"CanvasTexture",(()=>rI)),e(Wb,"Curve",(()=>iI)),e(Wb,"EllipseCurve",(()=>oI)),e(Wb,"ArcCurve",(()=>aI)),e(Wb,"CatmullRomCurve3",(()=>hI)),e(Wb,"CubicBezierCurve",(()=>gI)),e(Wb,"CubicBezierCurve3",(()=>vI)),e(Wb,"LineCurve",(()=>bI)),e(Wb,"LineCurve3",(()=>yI)),e(Wb,"QuadraticBezierCurve",(()=>wI)),e(Wb,"QuadraticBezierCurve3",(()=>SI)),e(Wb,"SplineCurve",(()=>xI)),e(Wb,"CurvePath",(()=>_I)),e(Wb,"Path",(()=>AI)),e(Wb,"LatheGeometry",(()=>EI)),e(Wb,"CapsuleGeometry",(()=>CI)),e(Wb,"CircleGeometry",(()=>TI)),e(Wb,"CylinderGeometry",(()=>II)),e(Wb,"ConeGeometry",(()=>kI)),e(Wb,"PolyhedronGeometry",(()=>RI)),e(Wb,"DodecahedronGeometry",(()=>OI)),e(Wb,"EdgesGeometry",(()=>DI)),e(Wb,"Shape",(()=>UI)),e(Wb,"ShapeUtils",(()=>uk)),e(Wb,"ExtrudeGeometry",(()=>fk)),e(Wb,"IcosahedronGeometry",(()=>mk)),e(Wb,"OctahedronGeometry",(()=>gk)),e(Wb,"RingGeometry",(()=>vk)),e(Wb,"ShapeGeometry",(()=>bk)),e(Wb,"SphereGeometry",(()=>yk)),e(Wb,"TetrahedronGeometry",(()=>wk)),e(Wb,"TorusGeometry",(()=>Sk)),e(Wb,"TorusKnotGeometry",(()=>xk)),e(Wb,"TubeGeometry",(()=>Mk)),e(Wb,"WireframeGeometry",(()=>_k)),e(Wb,"ShadowMaterial",(()=>Ck)),e(Wb,"RawShaderMaterial",(()=>Tk)),e(Wb,"MeshStandardMaterial",(()=>Ik)),e(Wb,"MeshPhysicalMaterial",(()=>kk)),e(Wb,"MeshPhongMaterial",(()=>Rk)),e(Wb,"MeshToonMaterial",(()=>Ok)),e(Wb,"MeshNormalMaterial",(()=>Pk)),e(Wb,"MeshLambertMaterial",(()=>Nk)),e(Wb,"MeshMatcapMaterial",(()=>Bk)),e(Wb,"LineDashedMaterial",(()=>Lk)),e(Wb,"AnimationUtils",(()=>Gk)),e(Wb,"Interpolant",(()=>Vk)),e(Wb,"CubicInterpolant",(()=>Wk)),e(Wb,"LinearInterpolant",(()=>qk)),e(Wb,"DiscreteInterpolant",(()=>Kk)),e(Wb,"KeyframeTrack",(()=>Jk)),e(Wb,"BooleanKeyframeTrack",(()=>Qk)),e(Wb,"ColorKeyframeTrack",(()=>Xk)),e(Wb,"NumberKeyframeTrack",(()=>Yk)),e(Wb,"QuaternionLinearInterpolant",(()=>Zk)),e(Wb,"QuaternionKeyframeTrack",(()=>$k)),e(Wb,"StringKeyframeTrack",(()=>eR)),e(Wb,"VectorKeyframeTrack",(()=>tR)),e(Wb,"AnimationClip",(()=>nR)),e(Wb,"Cache",(()=>iR)),e(Wb,"LoadingManager",(()=>oR)),e(Wb,"DefaultLoadingManager",(()=>aR)),e(Wb,"Loader",(()=>sR)),e(Wb,"FileLoader",(()=>uR)),e(Wb,"AnimationLoader",(()=>dR)),e(Wb,"CompressedTextureLoader",(()=>hR)),e(Wb,"ImageLoader",(()=>fR)),e(Wb,"CubeTextureLoader",(()=>pR)),e(Wb,"DataTextureLoader",(()=>mR)),e(Wb,"TextureLoader",(()=>gR)),e(Wb,"Light",(()=>vR)),e(Wb,"HemisphereLight",(()=>bR)),e(Wb,"SpotLight",(()=>_R)),e(Wb,"PointLight",(()=>IR)),e(Wb,"DirectionalLight",(()=>RR)),e(Wb,"AmbientLight",(()=>OR)),e(Wb,"RectAreaLight",(()=>PR)),e(Wb,"SphericalHarmonics3",(()=>NR)),e(Wb,"LightProbe",(()=>BR)),e(Wb,"MaterialLoader",(()=>LR)),e(Wb,"LoaderUtils",(()=>DR)),e(Wb,"InstancedBufferGeometry",(()=>UR)),e(Wb,"BufferGeometryLoader",(()=>FR)),e(Wb,"ObjectLoader",(()=>zR)),e(Wb,"ImageBitmapLoader",(()=>VR)),e(Wb,"AudioContext",(()=>qR)),e(Wb,"AudioLoader",(()=>KR)),e(Wb,"HemisphereLightProbe",(()=>JR)),e(Wb,"AmbientLightProbe",(()=>QR)),e(Wb,"StereoCamera",(()=>$R)),e(Wb,"Clock",(()=>eO)),e(Wb,"AudioListener",(()=>aO)),e(Wb,"Audio",(()=>sO)),e(Wb,"PositionalAudio",(()=>hO)),e(Wb,"AudioAnalyser",(()=>fO)),e(Wb,"PropertyMixer",(()=>pO)),e(Wb,"PropertyBinding",(()=>SO)),e(Wb,"AnimationObjectGroup",(()=>xO)),e(Wb,"AnimationMixer",(()=>AO)),e(Wb,"Uniform",(()=>EO)),e(Wb,"UniformsGroup",(()=>TO)),e(Wb,"InstancedInterleavedBuffer",(()=>IO)),e(Wb,"GLBufferAttribute",(()=>kO)),e(Wb,"Raycaster",(()=>RO)),e(Wb,"Spherical",(()=>NO)),e(Wb,"Cylindrical",(()=>BO)),e(Wb,"Box2",(()=>DO)),e(Wb,"Line3",(()=>zO)),e(Wb,"SpotLightHelper",(()=>HO)),e(Wb,"SkeletonHelper",(()=>qO)),e(Wb,"PointLightHelper",(()=>JO)),e(Wb,"HemisphereLightHelper",(()=>ZO)),e(Wb,"GridHelper",(()=>$O)),e(Wb,"PolarGridHelper",(()=>eP)),e(Wb,"DirectionalLightHelper",(()=>iP)),e(Wb,"CameraHelper",(()=>sP)),e(Wb,"BoxHelper",(()=>uP)),e(Wb,"Box3Helper",(()=>dP)),e(Wb,"PlaneHelper",(()=>hP)),e(Wb,"ArrowHelper",(()=>gP)),e(Wb,"AxesHelper",(()=>vP)),e(Wb,"ShapePath",(()=>bP)),e(Wb,"DataUtils",(()=>SP)),e(Wb,"ImmediateRenderObject",(()=>xP)),e(Wb,"WebGLMultisampleRenderTarget",(()=>MP)),e(Wb,"DataTexture2DArray",(()=>_P)),e(Wb,"DataTexture3D",(()=>AP)),e(Wb,"BoxBufferGeometry",(()=>EP)),e(Wb,"CapsuleBufferGeometry",(()=>CP)),e(Wb,"CircleBufferGeometry",(()=>TP)),e(Wb,"ConeBufferGeometry",(()=>IP)),e(Wb,"CylinderBufferGeometry",(()=>kP)),e(Wb,"DodecahedronBufferGeometry",(()=>RP)),e(Wb,"ExtrudeBufferGeometry",(()=>OP)),e(Wb,"IcosahedronBufferGeometry",(()=>PP)),e(Wb,"LatheBufferGeometry",(()=>NP)),e(Wb,"OctahedronBufferGeometry",(()=>BP)),e(Wb,"PlaneBufferGeometry",(()=>LP)),e(Wb,"PolyhedronBufferGeometry",(()=>DP)),e(Wb,"RingBufferGeometry",(()=>UP)),e(Wb,"ShapeBufferGeometry",(()=>FP)),e(Wb,"SphereBufferGeometry",(()=>zP)),e(Wb,"TetrahedronBufferGeometry",(()=>jP)),e(Wb,"TorusBufferGeometry",(()=>HP)),e(Wb,"TorusKnotBufferGeometry",(()=>GP)),e(Wb,"TubeBufferGeometry",(()=>VP));
67
+ */!function(){"use strict";var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var i=arguments[r];if(i){var o=typeof i;if("string"===o||"number"===o)n.push(i);else if(Array.isArray(i)){if(i.length){var a=t.apply(null,i);a&&n.push(a)}}else if("object"===o){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){n.push(i.toString());continue}for(var s in i)e.call(i,s)&&i[s]&&n.push(s)}}}return n.join(" ")}md?(t.default=t,md=t):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],(function(){return t})):window.classNames=t}();c=o("85Hg2");var gd={error:console.error,info:console.info,success:console.log};c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");var vd=({className:e,title:t,loading:r=!0})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:n(md)(e,{"memori-loading-icon":r}),"aria-label":t},n(c).createElement("path",{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}));var bd=({primary:e=!1,outlined:t=!1,ghost:r=!1,padded:i=!0,shape:o="rounded",danger:a=!1,loading:s=!1,disabled:l=!1,block:u=!1,icon:d,className:h,title:f,htmlType:p,onClick:m,onTouchEnd:g,children:v})=>n(c).createElement("button",{type:p,onClick:m,onTouchEnd:g,title:f,disabled:s||l,className:n(md)(h,"memori-button",{"memori-button--primary":e,"memori-button--outlined":t,"memori-button--ghost":r,"memori-button--square":"square"===o,"memori-button--rounded":"rounded"===o,"memori-button--circle":"circle"===o,"memori-button--padded":i,"memori-button--block":u,"memori-button--with-icon":(d||s)&&v,"memori-button--icon-only":(d||s)&&!v,"memori-button--danger":a,"memori-button--loading":s})},d&&!s&&n(c).createElement("span",{className:"memori-button--icon"},d),s&&n(c).createElement("span",{className:"memori-button--icon loading-icon"},n(c).createElement(vd,{loading:!0})),v);c=o("85Hg2"),c=o("85Hg2");function yd(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,yd),r}c=o("85Hg2");var wd,Sd,xd=((Sd=xd||{})[Sd.None=0]="None",Sd[Sd.RenderStrategy=1]="RenderStrategy",Sd[Sd.Static=2]="Static",Sd),Md=((wd=Md||{})[wd.Unmount=0]="Unmount",wd[wd.Hidden=1]="Hidden",wd);function _d({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:o=!0,name:a}){let s=Ed(t,e);if(o)return Ad(s,n,r,a);let l=null!=i?i:0;if(2&l){let{static:e=!1,...t}=s;if(e)return Ad(t,n,r,a)}if(1&l){let{unmount:e=!0,...t}=s;return yd(e?0:1,{0:()=>null,1:()=>Ad({...t,hidden:!0,style:{display:"none"}},n,r,a)})}return Ad(s,n,r,a)}function Ad(e,t={},n,r){let{as:i=n,children:o,refName:a="ref",...s}=Id(e,["unmount","static"]),l=void 0!==e.ref?{[a]:e.ref}:{},u="function"==typeof o?o(t):o;s.className&&"function"==typeof s.className&&(s.className=s.className(t));let d={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&n.push(r);e&&(d["data-headlessui-state"]=n.join(" "))}if(i===c.Fragment&&Object.keys(Td(s)).length>0){if(!(0,c.isValidElement)(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(s).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"));return(0,c.cloneElement)(u,Object.assign({},Ed(u.props,Td(Id(s,["ref"]))),d,l,function(...e){return{ref:e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}}(u.ref,l.ref)))}return(0,c.createElement)(i,Object.assign({},Id(s,["ref"]),i!==c.Fragment&&l,i!==c.Fragment&&d),u)}function Ed(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map((e=>[e,void 0]))));for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function Cd(e){var t;return Object.assign((0,c.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function Td(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function Id(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");const kd="undefined"==typeof window||"undefined"==typeof document;let Rd=kd?c.useEffect:c.useLayoutEffect;function Od(e){let t=(0,c.useRef)(e);return Rd((()=>{t.current=e}),[e]),t}let Pd=function(e){let t=Od(e);return n(c).useCallback(((...e)=>t.current(...e)),[t])},Nd=Symbol();function Bd(e,t=!0){return Object.assign(e,{[Nd]:t})}function Ld(...e){let t=(0,c.useRef)(e);(0,c.useEffect)((()=>{t.current=e}),[e]);let n=Pd((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[Nd])))?void 0:n}var Dd,Ud=((Dd=Ud||{}).Space=" ",Dd.Enter="Enter",Dd.Escape="Escape",Dd.Backspace="Backspace",Dd.Delete="Delete",Dd.ArrowLeft="ArrowLeft",Dd.ArrowUp="ArrowUp",Dd.ArrowRight="ArrowRight",Dd.ArrowDown="ArrowDown",Dd.Home="Home",Dd.End="End",Dd.PageUp="PageUp",Dd.PageDown="PageDown",Dd.Tab="Tab",Dd);function Fd(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=""===(null==t?void 0:t.getAttribute("disabled"));return(!r||!function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(n))&&r}c=o("85Hg2"),c=o("85Hg2");let zd={serverHandoffComplete:!1};function jd(){let[e,t]=(0,c.useState)(zd.serverHandoffComplete);return(0,c.useEffect)((()=>{!0!==e&&t(!0)}),[e]),(0,c.useEffect)((()=>{!1===zd.serverHandoffComplete&&(zd.serverHandoffComplete=!0)}),[]),e}var Hd;let Gd=0;function Vd(){return++Gd}let Wd=null!=(Hd=n(c).useId)?Hd:function(){let e=jd(),[t,r]=n(c).useState(e?Vd:null);return Rd((()=>{null===t&&r(Vd())}),[t]),null!=t?""+t:void 0};c=o("85Hg2");var qd=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(qd||{});let Kd=Cd((function(e,t){let{features:n=1,...r}=e;return _d({ourProps:{ref:t,"aria-hidden":2==(2&n)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&n)&&2!=(2&n)&&{display:"none"}}},theirProps:r,slot:{},defaultTag:"div",name:"Hidden"})}));function Jd(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}function Qd(){let e=[],t=[],n={enqueue(e){t.push(e)},addEventListener:(e,t,r,i)=>(e.addEventListener(t,r,i),n.add((()=>e.removeEventListener(t,r,i)))),requestAnimationFrame(...e){let t=requestAnimationFrame(...e);return n.add((()=>cancelAnimationFrame(t)))},nextFrame:(...e)=>n.requestAnimationFrame((()=>n.requestAnimationFrame(...e))),setTimeout(...e){let t=setTimeout(...e);return n.add((()=>clearTimeout(t)))},microTask(...e){let t={current:!0};return Jd((()=>{t.current&&e[0]()})),n.add((()=>{t.current=!1}))},add:t=>(e.push(t),()=>{let n=e.indexOf(t);if(n>=0){let[t]=e.splice(n,1);t()}}),dispose(){for(let t of e.splice(0))t()},async workQueue(){for(let e of t.splice(0))await e()}};return n}function Xd(e){return kd?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Yd=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var Zd,$d,eh=(($d=eh||{})[$d.First=1]="First",$d[$d.Previous=2]="Previous",$d[$d.Next=4]="Next",$d[$d.Last=8]="Last",$d[$d.WrapAround=16]="WrapAround",$d[$d.NoScroll=32]="NoScroll",$d),th=((Zd=th||{})[Zd.Error=0]="Error",Zd[Zd.Overflow=1]="Overflow",Zd[Zd.Success=2]="Success",Zd[Zd.Underflow=3]="Underflow",Zd),nh=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(nh||{});function rh(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(Yd))}var ih=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(ih||{});function oh(e,t=0){var n;return e!==(null==(n=Xd(e))?void 0:n.body)&&yd(t,{0:()=>e.matches(Yd),1(){let t=e;for(;null!==t;){if(t.matches(Yd))return!0;t=t.parentElement}return!1}})}function ah(e){let t=Xd(e);Qd().nextFrame((()=>{t&&!oh(t.activeElement,0)&&sh(e)}))}function sh(e){null==e||e.focus({preventScroll:!0})}let lh=["textarea","input"].join(",");function ch(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),i=t(n);if(null===r||null===i)return 0;let o=r.compareDocumentPosition(i);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function uh(e,t){return dh(rh(),t,!0,e)}function dh(e,t,n=!0,r=null){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?n?ch(e):e:rh(e);r=null!=r?r:i.activeElement;let a,s=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,o.indexOf(r))-1;if(4&t)return Math.max(0,o.indexOf(r))+1;if(8&t)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&t?{preventScroll:!0}:{},u=0,d=o.length;do{if(u>=d||u+d<=0)return 0;let e=l+u;if(16&t)e=(e+d)%d;else{if(e<0)return 3;if(e>=d)return 1}a=o[e],null==a||a.focus(c),u+=s}while(a!==i.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,lh))&&n}(a)&&a.select(),a.hasAttribute("tabindex")||a.setAttribute("tabindex","0"),2}c=o("85Hg2"),c=o("85Hg2");function hh(e,t,n){let r=Od(t);(0,c.useEffect)((()=>{function t(e){r.current(e)}return window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)}),[e,n])}var fh=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(fh||{});function ph(){let e=(0,c.useRef)(0);return hh("keydown",(t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)}),!0),e}c=o("85Hg2");function mh(){let e=(0,c.useRef)(!1);return Rd((()=>(e.current=!0,()=>{e.current=!1})),[]),e}c=o("85Hg2");function gh(...e){return(0,c.useMemo)((()=>Xd(...e)),[...e])}c=o("85Hg2");function vh(e,t,n,r){let i=Od(n);(0,c.useEffect)((()=>{function n(e){i.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}),[e,t,r])}c=o("85Hg2");function bh(e,t){let n=(0,c.useRef)([]),r=Pd(e);(0,c.useEffect)((()=>{let e=[...n.current];for(let[i,o]of t.entries())if(n.current[i]!==o){let i=r(t,e);return n.current=t,i}}),[r,...t])}var yh=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(yh||{});let wh=Object.assign(Cd((function(e,t){let r=(0,c.useRef)(null),i=Ld(r,t),{initialFocus:o,containers:a,features:s=30,...l}=e;jd()||(s=1);let u=gh(r);!function({ownerDocument:e},t){let n=(0,c.useRef)(null);vh(null==e?void 0:e.defaultView,"focusout",(e=>{!t||n.current||(n.current=e.target)}),!0),bh((()=>{t||((null==e?void 0:e.activeElement)===(null==e?void 0:e.body)&&sh(n.current),n.current=null)}),[t]);let r=(0,c.useRef)(!1);(0,c.useEffect)((()=>(r.current=!1,()=>{r.current=!0,Jd((()=>{!r.current||(sh(n.current),n.current=null)}))})),[])}({ownerDocument:u},Boolean(16&s));let d=function({ownerDocument:e,container:t,initialFocus:n},r){let i=(0,c.useRef)(null),o=mh();return bh((()=>{if(!r)return;let a=t.current;!a||Jd((()=>{if(!o.current)return;let t=null==e?void 0:e.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===t)return void(i.current=t)}else if(a.contains(t))return void(i.current=t);null!=n&&n.current?sh(n.current):dh(a,eh.First)===th.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=null==e?void 0:e.activeElement}))}),[r]),i}({ownerDocument:u,container:r,initialFocus:o},Boolean(2&s));!function({ownerDocument:e,container:t,containers:n,previousActiveElement:r},i){let o=mh();vh(null==e?void 0:e.defaultView,"focus",(e=>{if(!i||!o.current)return;let a=new Set(null==n?void 0:n.current);a.add(t);let s=r.current;if(!s)return;let l=e.target;l&&l instanceof HTMLElement?function(e,t){var n;for(let r of e)if(null!=(n=r.current)&&n.contains(t))return!0;return!1}(a,l)?(r.current=l,sh(l)):(e.preventDefault(),e.stopPropagation(),sh(s)):sh(r.current)}),!0)}({ownerDocument:u,container:r,containers:a,previousActiveElement:d},Boolean(8&s));let h=ph(),f=Pd((()=>{let e=r.current;!e||yd(h.current,{[fh.Forwards]:()=>dh(e,eh.First),[fh.Backwards]:()=>dh(e,eh.Last)})})),p={ref:i};return n(c).createElement(n(c).Fragment,null,Boolean(4&s)&&n(c).createElement(Kd,{as:"button",type:"button",onFocus:f,features:qd.Focusable}),_d({ourProps:p,theirProps:l,defaultTag:"div",name:"FocusTrap"}),Boolean(4&s)&&n(c).createElement(Kd,{as:"button",type:"button",onFocus:f,features:qd.Focusable}))})),{features:yh});let Sh=new Set,xh=new Map;function Mh(e){e.setAttribute("aria-hidden","true"),e.inert=!0}function _h(e){let t=xh.get(e);!t||(null===t["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert)}function Ah(e,t=!0){Rd((()=>{if(!t||!e.current)return;let n=e.current,r=Xd(n);if(r){Sh.add(n);for(let e of xh.keys())e.contains(n)&&(_h(e),xh.delete(e));return r.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement){for(let t of Sh)if(e.contains(t))return;1===Sh.size&&(xh.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Mh(e))}})),()=>{if(Sh.delete(n),Sh.size>0)r.querySelectorAll("body > *").forEach((e=>{if(e instanceof HTMLElement&&!xh.has(e)){for(let t of Sh)if(e.contains(t))return;xh.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),Mh(e)}}));else for(let e of xh.keys())_h(e),xh.delete(e)}}}),[t])}c=o("85Hg2");let Eh=(0,(c=o("85Hg2")).createContext)(!1);function Ch(e){return n(c).createElement(Eh.Provider,{value:e.force},e.children)}function Th(e){let t=(0,c.useContext)(Eh),n=(0,c.useContext)(Oh),r=gh(e),[i,o]=(0,c.useState)((()=>{if(!t&&null!==n||kd)return null;let e=null==r?void 0:r.getElementById("headlessui-portal-root");if(e)return e;if(null===r)return null;let i=r.createElement("div");return i.setAttribute("id","headlessui-portal-root"),r.body.appendChild(i)}));return(0,c.useEffect)((()=>{null!==i&&(null!=r&&r.body.contains(i)||null==r||r.body.appendChild(i))}),[i,r]),(0,c.useEffect)((()=>{t||null!==n&&o(n.current)}),[n,o,t]),i}let Ih=c.Fragment,kh=Cd((function(e,t){let n=e,r=(0,c.useRef)(null),i=Ld(Bd((e=>{r.current=e})),t),o=gh(r),a=Th(r),[l]=(0,c.useState)((()=>{var e;return kd?null:null!=(e=null==o?void 0:o.createElement("div"))?e:null})),u=jd(),d=(0,c.useRef)(!1);return Rd((()=>{if(d.current=!1,a&&l)return a.contains(l)||(l.setAttribute("data-headlessui-portal",""),a.appendChild(l)),()=>{d.current=!0,Jd((()=>{var e;!d.current||!a||!l||(a.removeChild(l),a.childNodes.length<=0&&(null==(e=a.parentElement)||e.removeChild(a)))}))}}),[a,l]),u&&a&&l?(0,s.createPortal)(_d({ourProps:{ref:i},theirProps:n,defaultTag:Ih,name:"Portal"}),l):null})),Rh=c.Fragment,Oh=(0,c.createContext)(null),Ph=Cd((function(e,t){let{target:r,...i}=e,o={ref:Ld(t)};return n(c).createElement(Oh.Provider,{value:r},_d({ourProps:o,theirProps:i,defaultTag:Rh,name:"Popover.Group"}))})),Nh=Object.assign(kh,{Group:Ph});let Bh=(0,(c=o("85Hg2")).createContext)(null);function Lh(){let e=(0,c.useContext)(Bh);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Lh),e}return e}function Dh(){let[e,t]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=Pd((e=>(t((t=>[...t,e])),()=>t((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return n(c).createElement(Bh.Provider,{value:i},e.children)}),[t])]}let Uh=Cd((function(e,t){let n=Lh(),r=`headlessui-description-${Wd()}`,i=Ld(t);Rd((()=>n.register(r)),[r,n.register]);let o=e;return _d({ourProps:{ref:i,...n.props,id:r},theirProps:o,slot:n.slot||{},defaultTag:"p",name:n.name||"Description"})}));let Fh=(0,(c=o("85Hg2")).createContext)(null);Fh.displayName="OpenClosedContext";var zh=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(zh||{});function jh(){return(0,c.useContext)(Fh)}function Hh({value:e,children:t}){return n(c).createElement(Fh.Provider,{value:e},t)}let Gh=(0,(c=o("85Hg2")).createContext)((()=>{}));Gh.displayName="StackContext";var Vh=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Vh||{});function Wh({children:e,onUpdate:t,type:r,element:i,enabled:o}){let a=(0,c.useContext)(Gh),s=Pd(((...e)=>{null==t||t(...e),a(...e)}));return Rd((()=>{let e=void 0===o||!0===o;return e&&s(0,r,i),()=>{e&&s(1,r,i)}}),[s,r,i,o]),n(c).createElement(Gh.Provider,{value:s},e)}c=o("85Hg2"),c=o("85Hg2");function qh(e,t,n){let r=Od(t);(0,c.useEffect)((()=>{function t(e){r.current(e)}return document.addEventListener(e,t,n),()=>document.removeEventListener(e,t,n)}),[e,n])}function Kh(e,t,n=!0){let r=(0,c.useRef)(!1);function i(n,i){if(!r.current||n.defaultPrevented)return;let o=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e),a=i(n);if(null!==a&&a.getRootNode().contains(a)){for(let e of o){if(null===e)continue;let t=e instanceof HTMLElement?e:e.current;if(null!=t&&t.contains(a))return}return!oh(a,ih.Loose)&&-1!==a.tabIndex&&n.preventDefault(),t(n,a)}}(0,c.useEffect)((()=>{requestAnimationFrame((()=>{r.current=n}))}),[n]);let o=(0,c.useRef)(null);qh("mousedown",(e=>{var t,n;r.current&&(o.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)}),!0),qh("click",(e=>{!o.current||(i(e,(()=>o.current)),o.current=null)}),!0),qh("blur",(e=>i(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}var Jh=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Jh||{}),Qh=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Qh||{});let Xh={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},Yh=(0,c.createContext)(null);function Zh(e){let t=(0,c.useContext)(Yh);if(null===t){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Zh),t}return t}function $h(e,t){(0,c.useEffect)((()=>{var n;if(!t||!e)return;let r=Qd();function i(e,t,n){let i=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),r.add((()=>{Object.assign(e.style,{[t]:i})}))}let o=e.documentElement,a=(null!=(n=e.defaultView)?n:window).innerWidth-o.clientWidth;if(i(o,"overflow","hidden"),a>0){i(o,"paddingRight",`${a-(o.clientWidth-o.offsetWidth)}px`)}if(/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0){let e=window.pageYOffset;i(o,"position","fixed"),i(o,"marginTop",`-${e}px`),i(o,"width","100%"),r.add((()=>window.scrollTo(0,e)))}return r.dispose}),[e,t])}function ef(e,t){return yd(t.type,Xh,e,t)}Yh.displayName="DialogContext";let tf=xd.RenderStrategy|xd.Static,nf=Cd((function(e,t){let{open:r,onClose:i,initialFocus:o,__demoMode:a=!1,...s}=e,[l,u]=(0,c.useState)(0),d=jh();void 0===r&&null!==d&&(r=yd(d,{[zh.Open]:!0,[zh.Closed]:!1}));let h=(0,c.useRef)(new Set),f=(0,c.useRef)(null),p=Ld(f,t),m=(0,c.useRef)(null),g=gh(f),v=e.hasOwnProperty("open")||null!==d,b=e.hasOwnProperty("onClose");if(!v&&!b)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!v)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!b)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof r)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${r}`);if("function"!=typeof i)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${i}`);let y=r?0:1,[w,S]=(0,c.useReducer)(ef,{titleId:null,descriptionId:null,panelRef:(0,c.createRef)()}),x=Pd((()=>i(!1))),M=Pd((e=>S({type:0,id:e}))),_=!!jd()&&(!a&&0===y),A=l>1,E=null!==(0,c.useContext)(Yh),C=A?"parent":"leaf";Ah(f,!!A&&_),Kh((()=>{var e,t;return[...Array.from(null!=(e=null==g?void 0:g.querySelectorAll("body > *, [data-headlessui-portal]"))?e:[]).filter((e=>!(!(e instanceof HTMLElement)||e.contains(m.current)||w.panelRef.current&&e.contains(w.panelRef.current)))),null!=(t=w.panelRef.current)?t:f.current]}),x,_&&!A),vh(null==g?void 0:g.defaultView,"keydown",(e=>{e.defaultPrevented||e.key===Ud.Escape&&0===y&&(A||(e.preventDefault(),e.stopPropagation(),x()))})),$h(g,0===y&&!E),(0,c.useEffect)((()=>{if(0!==y||!f.current)return;let e=new IntersectionObserver((e=>{for(let t of e)0===t.boundingClientRect.x&&0===t.boundingClientRect.y&&0===t.boundingClientRect.width&&0===t.boundingClientRect.height&&x()}));return e.observe(f.current),()=>e.disconnect()}),[y,f,x]);let[T,I]=Dh(),k=`headlessui-dialog-${Wd()}`,R=(0,c.useMemo)((()=>[{dialogState:y,close:x,setTitleId:M},w]),[y,w,x,M]),O=(0,c.useMemo)((()=>({open:0===y})),[y]),P={ref:p,id:k,role:"dialog","aria-modal":0===y||void 0,"aria-labelledby":w.titleId,"aria-describedby":T};return n(c).createElement(Wh,{type:"Dialog",enabled:0===y,element:f,onUpdate:Pd(((e,t,n)=>{"Dialog"===t&&yd(e,{[Vh.Add](){h.current.add(n),u((e=>e+1))},[Vh.Remove](){h.current.add(n),u((e=>e-1))}})}))},n(c).createElement(Ch,{force:!0},n(c).createElement(Nh,null,n(c).createElement(Yh.Provider,{value:R},n(c).createElement(Nh.Group,{target:f},n(c).createElement(Ch,{force:!1},n(c).createElement(I,{slot:O,name:"Dialog.Description"},n(c).createElement(wh,{initialFocus:o,containers:h,features:_?yd(C,{parent:wh.features.RestoreFocus,leaf:wh.features.All&~wh.features.FocusLock}):wh.features.None},_d({ourProps:P,theirProps:s,slot:O,defaultTag:"div",features:tf,visible:0===y,name:"Dialog"})))))))),n(c).createElement(Kd,{features:qd.Hidden,ref:m}))})),rf=Cd((function(e,t){let[{dialogState:n,close:r}]=Zh("Dialog.Overlay");return _d({ourProps:{ref:Ld(t),id:`headlessui-dialog-overlay-${Wd()}`,"aria-hidden":!0,onClick:Pd((e=>{if(e.target===e.currentTarget){if(Fd(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),r()}}))},theirProps:e,slot:(0,c.useMemo)((()=>({open:0===n})),[n]),defaultTag:"div",name:"Dialog.Overlay"})})),of=Cd((function(e,t){let[{dialogState:r},i]=Zh("Dialog.Backdrop"),o=Ld(t),a=`headlessui-dialog-backdrop-${Wd()}`;(0,c.useEffect)((()=>{if(null===i.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")}),[i.panelRef]);let s=(0,c.useMemo)((()=>({open:0===r})),[r]);return n(c).createElement(Ch,{force:!0},n(c).createElement(Nh,null,_d({ourProps:{ref:o,id:a,"aria-hidden":!0},theirProps:e,slot:s,defaultTag:"div",name:"Dialog.Backdrop"})))})),af=Cd((function(e,t){let[{dialogState:n},r]=Zh("Dialog.Panel"),i=Ld(t,r.panelRef),o=`headlessui-dialog-panel-${Wd()}`,a=(0,c.useMemo)((()=>({open:0===n})),[n]);return _d({ourProps:{ref:i,id:o,onClick:Pd((e=>{e.stopPropagation()}))},theirProps:e,slot:a,defaultTag:"div",name:"Dialog.Panel"})})),sf=Cd((function(e,t){let[{dialogState:n,setTitleId:r}]=Zh("Dialog.Title"),i=`headlessui-dialog-title-${Wd()}`,o=Ld(t);(0,c.useEffect)((()=>(r(i),()=>r(null))),[i,r]);let a=(0,c.useMemo)((()=>({open:0===n})),[n]);return _d({ourProps:{ref:o,id:i},theirProps:e,slot:a,defaultTag:"h2",name:"Dialog.Title"})})),lf=Object.assign(nf,{Backdrop:of,Panel:af,Overlay:rf,Title:sf,Description:Uh});c=o("85Hg2");function cf(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function uf(e,...t){e&&t.length>0&&e.classList.add(...t)}function df(e,...t){e&&t.length>0&&e.classList.remove(...t)}var hf=(e=>(e.Ended="ended",e.Cancelled="cancelled",e))(hf||{});function ff(e,t,n,r){let i=n?"enter":"leave",o=Qd(),a=void 0!==r?cf(r):()=>{};"enter"===i&&(e.removeAttribute("hidden"),e.style.display="");let s=yd(i,{enter:()=>t.enter,leave:()=>t.leave}),l=yd(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=yd(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return df(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),uf(e,...s,...c),o.nextFrame((()=>{df(e,...c),uf(e,...l),function(e,t){let n=Qd();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[o,a]=[r,i].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t}));if(o+a!==0){let r=[];r.push(n.addEventListener(e,"transitionrun",(i=>{i.target===i.currentTarget&&(r.splice(0).forEach((e=>e())),r.push(n.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(t("ended"),r.splice(0).forEach((e=>e())))})),n.addEventListener(e,"transitioncancel",(e=>{e.target===e.currentTarget&&(t("cancelled"),r.splice(0).forEach((e=>e())))}))))})))}else t("ended");n.add((()=>t("cancelled"))),n.dispose}(e,(n=>("ended"===n&&(df(e,...s),uf(e,...t.entered)),a(n))))})),o.dispose}function pf(){let[e]=(0,c.useState)(Qd);return(0,c.useEffect)((()=>()=>e.dispose()),[e]),e}function mf({container:e,direction:t,classes:n,onStart:r,onStop:i}){let o=mh(),a=pf(),s=Od(t);Rd((()=>{let t=Qd();a.add(t.dispose);let l=e.current;if(l&&"idle"!==s.current&&o.current)return t.dispose(),r.current(s.current),t.add(ff(l,n.current,"enter"===s.current,(e=>{t.dispose(),yd(e,{[hf.Ended](){i.current(s.current)},[hf.Cancelled]:()=>{}})}))),t.dispose}),[t])}function gf(e=""){return e.split(" ").filter((e=>e.trim().length>1))}let vf=(0,(c=o("85Hg2")).createContext)(null);vf.displayName="TransitionContext";var bf,yf=((bf=yf||{}).Visible="visible",bf.Hidden="hidden",bf);let wf=(0,c.createContext)(null);function Sf(e){return"children"in e?Sf(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function xf(e,t){let n=Od(e),r=(0,c.useRef)([]),i=mh(),o=pf(),a=Pd(((e,t=Md.Hidden)=>{let a=r.current.findIndex((({el:t})=>t===e));-1!==a&&(yd(t,{[Md.Unmount](){r.current.splice(a,1)},[Md.Hidden](){r.current[a].state="hidden"}}),o.microTask((()=>{var e;!Sf(r)&&i.current&&(null==(e=n.current)||e.call(n))})))})),s=Pd((e=>{let t=r.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>a(e,Md.Unmount)})),l=(0,c.useRef)([]),u=(0,c.useRef)(Promise.resolve()),d=(0,c.useRef)({enter:[],leave:[],idle:[]}),h=Pd(((e,n,r)=>{l.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter((([t])=>t!==e))),null==t||t.chains.current[n].push([e,new Promise((e=>{l.current.push(e)}))]),null==t||t.chains.current[n].push([e,new Promise((e=>{Promise.all(d.current[n].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===n?u.current=u.current.then((()=>null==t?void 0:t.wait.current)).then((()=>r(n))):r(n)})),f=Pd(((e,t,n)=>{Promise.all(d.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=l.current.shift())||e()})).then((()=>n(t)))}));return(0,c.useMemo)((()=>({children:r,register:s,unregister:a,onStart:h,onStop:f,wait:u,chains:d})),[s,a,r,h,f,d,u])}function Mf(){}wf.displayName="NestingContext";let _f=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Af(e){var t;let n={};for(let r of _f)n[r]=null!=(t=e[r])?t:Mf;return n}let Ef=xd.RenderStrategy,Cf=Cd((function(e,t){let{beforeEnter:r,afterEnter:i,beforeLeave:o,afterLeave:a,enter:s,enterFrom:l,enterTo:u,entered:d,leave:h,leaveFrom:f,leaveTo:p,...m}=e,g=(0,c.useRef)(null),v=Ld(g,t),b=m.unmount?Md.Unmount:Md.Hidden,{show:y,appear:w,initial:S}=function(){let e=(0,c.useContext)(vf);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[x,M]=(0,c.useState)(y?"visible":"hidden"),_=function(){let e=(0,c.useContext)(wf);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:A,unregister:E}=_,C=(0,c.useRef)(null);(0,c.useEffect)((()=>A(g)),[A,g]),(0,c.useEffect)((()=>{if(b===Md.Hidden&&g.current)return y&&"visible"!==x?void M("visible"):yd(x,{hidden:()=>E(g),visible:()=>A(g)})}),[x,g,A,E,y,b]);let T=Od({enter:gf(s),enterFrom:gf(l),enterTo:gf(u),entered:gf(d),leave:gf(h),leaveFrom:gf(f),leaveTo:gf(p)}),I=function(e){let t=(0,c.useRef)(Af(e));return(0,c.useEffect)((()=>{t.current=Af(e)}),[e]),t}({beforeEnter:r,afterEnter:i,beforeLeave:o,afterLeave:a}),k=jd();(0,c.useEffect)((()=>{if(k&&"visible"===x&&null===g.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[g,x,k]);let R=S&&!w,O=!k||R||C.current===y?"idle":y?"enter":"leave",P=Pd((e=>yd(e,{enter:()=>I.current.beforeEnter(),leave:()=>I.current.beforeLeave(),idle:()=>{}}))),N=Pd((e=>yd(e,{enter:()=>I.current.afterEnter(),leave:()=>I.current.afterLeave(),idle:()=>{}}))),B=xf((()=>{M("hidden"),E(g)}),_);mf({container:g,classes:T,direction:O,onStart:Od((e=>{B.onStart(g,e,P)})),onStop:Od((e=>{B.onStop(g,e,N),"leave"===e&&!Sf(B)&&(M("hidden"),E(g))}))}),(0,c.useEffect)((()=>{!R||(b===Md.Hidden?C.current=null:C.current=y)}),[y,R,x]);let L=m,D={ref:v};return n(c).createElement(wf.Provider,{value:B},n(c).createElement(Hh,{value:yd(x,{visible:zh.Open,hidden:zh.Closed})},_d({ourProps:D,theirProps:L,defaultTag:"div",features:Ef,visible:"visible"===x,name:"Transition.Child"})))})),Tf=Cd((function(e,t){let{show:r,appear:i=!1,unmount:o,...a}=e,s=(0,c.useRef)(null),l=Ld(s,t);jd();let u=jh();if(void 0===r&&null!==u&&(r=yd(u,{[zh.Open]:!0,[zh.Closed]:!1})),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[d,h]=(0,c.useState)(r?"visible":"hidden"),f=xf((()=>{h("hidden")})),[p,m]=(0,c.useState)(!0),g=(0,c.useRef)([r]);Rd((()=>{!1!==p&&g.current[g.current.length-1]!==r&&(g.current.push(r),m(!1))}),[g,r]);let v=(0,c.useMemo)((()=>({show:r,appear:i,initial:p})),[r,i,p]);(0,c.useEffect)((()=>{if(r)h("visible");else if(Sf(f)){let e=s.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&h("hidden")}else h("hidden")}),[r,f]);let b={unmount:o};return n(c).createElement(wf.Provider,{value:f},n(c).createElement(vf.Provider,{value:v},_d({ourProps:{...b,as:c.Fragment,children:n(c).createElement(Cf,{ref:l,...b,...a})},theirProps:{},defaultTag:c.Fragment,features:Ef,visible:"visible"===d,name:"Transition"})))})),If=Cd((function(e,t){let r=null!==(0,c.useContext)(vf),i=null!==jh();return n(c).createElement(n(c).Fragment,null,!r&&i?n(c).createElement(Tf,{ref:t,...e}):n(c).createElement(Cf,{ref:t,...e}))})),kf=Object.assign(Tf,{Child:If,Root:Tf});c=o("85Hg2");var Rf=({spinning:e=!1,primary:t=!1,className:r,children:i})=>n(c).createElement("div",{className:n(md)("memori-spin",r,{"memori-spin--spinning":e,"memori-spin--primary":t})},i,n(c).createElement("div",{className:"memori-spin--spinner"},n(c).createElement(vd,{loading:!0})));c=o("85Hg2");var Of=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}));var Pf=({open:e=!1,onClose:t,className:r,title:i,description:o,children:a,footer:s,loading:l=!1,closable:u=!0,width:d="100%",widthMd:h="100%"})=>n(c).createElement(kf,{appear:!0,show:e,as:n(c).Fragment},n(c).createElement(lf,{open:e,onClose:t,className:n(md)("memori-modal",r)},n(c).createElement(kf.Child,{as:n(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},n(c).createElement("div",{className:"memori-modal--backdrop"})),n(c).createElement("div",{className:"memori-modal--container"},n(c).createElement("div",{className:"memori-modal--container-scrollable"},n(c).createElement(kf.Child,{as:n(c).Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95"},n(c).createElement(lf.Panel,{className:"memori-modal--panel"},n(c).createElement("style",{dangerouslySetInnerHTML:{__html:`\n .memori-modal--panel {\n --memori-modal--width: ${d};\n --memori-modal--width-md: ${h};\n }\n `}}),u&&n(c).createElement("div",{className:"memori-modal--close"},n(c).createElement(bd,{ghost:!0,padded:!0,shape:"circle",icon:n(c).createElement(Of,null),onClick:()=>t(!1)})),n(c).createElement(Rf,{spinning:l},i&&n(c).createElement(lf.Title,{className:"memori-modal--title"},i),o&&n(c).createElement(lf.Description,{className:"memori-modal--description"},o),a,s&&n(c).createElement("div",{className:"memori-modal--footer"},s)))))))),Nf=(c=o("85Hg2"),e=>"checkbox"===e.type),Bf=e=>e instanceof Date,Lf=e=>null==e;const Df=e=>"object"==typeof e;var Uf=e=>!Lf(e)&&!Array.isArray(e)&&Df(e)&&!Bf(e),Ff=e=>Uf(e)&&e.target?Nf(e.target)?e.target.checked:e.target.value:e,zf=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),jf=e=>Array.isArray(e)?e.filter(Boolean):[],Hf=e=>void 0===e,Gf=(e,t,n)=>{if(!t||!Uf(e))return n;const r=jf(t.split(/[,[\].]+?/)).reduce(((e,t)=>Lf(e)?e:e[t]),e);return Hf(r)||r===e?Hf(e[t])?n:e[t]:r};const Vf="blur",Wf="focusout",qf="onBlur",Kf="onChange",Jf="onSubmit",Qf="onTouched",Xf="all",Yf="max",Zf="min",$f="maxLength",ep="minLength",tp="pattern",np="required",rp="validate";n(c).createContext(null);var ip=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(i,o,{get:()=>{const i=o;return t._proxyFormState[i]!==Xf&&(t._proxyFormState[i]=!r||Xf),n&&(n[i]=!0),e[i]}});return i},op=e=>Uf(e)&&!Object.keys(e).length,ap=(e,t,n)=>{const{name:r,...i}=e;return op(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find((e=>t[e]===(!n||Xf)))},sp=e=>Array.isArray(e)?e:[e];function lp(e){const t=n(c).useRef(e);t.current=e,n(c).useEffect((()=>{const n=!e.disabled&&t.current.subject.subscribe({next:t.current.callback});return()=>{n&&n.unsubscribe()}}),[e.disabled])}var cp=e=>"string"==typeof e,up=(e,t,n,r)=>cp(e)?(r&&t.watch.add(e),Gf(n,e)):Array.isArray(e)?e.map((e=>(r&&t.watch.add(e),Gf(n,e)))):(t.watchAll=!!r,n),dp="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function hp(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(dp&&(e instanceof Blob||e instanceof FileList)||!n&&!Uf(e))return e;if(t=n?[]:{},Array.isArray(e)||(e=>{const t=e.constructor&&e.constructor.prototype;return Uf(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const n in e)t[n]=hp(e[n]);else t=e}return t}var fp=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},pp=e=>/^\w*$/.test(e),mp=e=>jf(e.replace(/["|']|\]/g,"").split(/\.|\[/));function gp(e,t,n){let r=-1;const i=pp(t)?[t]:mp(t),o=i.length,a=o-1;for(;++r<o;){const t=i[r];let o=n;if(r!==a){const n=e[t];o=Uf(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}e[t]=o,e=e[t]}return e}const vp=(e,t,n)=>{for(const r of n||Object.keys(e)){const n=Gf(e,r);if(n){const{_f:e,...r}=n;if(e&&t(e.name)){if(e.ref.focus){e.ref.focus();break}if(e.refs&&e.refs[0].focus){e.refs[0].focus();break}}else Uf(r)&&vp(r,t)}}};var bp=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))))),yp=(e,t,n)=>{const r=jf(Gf(e,n));return gp(r,"root",t[n]),gp(e,n,r),e},wp=e=>"boolean"==typeof e,Sp=e=>"file"===e.type,xp=e=>"function"==typeof e,Mp=e=>cp(e)||n(c).isValidElement(e),_p=e=>"radio"===e.type,Ap=e=>e instanceof RegExp;const Ep={value:!1,isValid:!1},Cp={value:!0,isValid:!0};var Tp=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Hf(e[0].attributes.value)?Hf(e[0].value)||""===e[0].value?Cp:{value:e[0].value,isValid:!0}:Cp:Ep}return Ep};const Ip={isValid:!1,value:null};var kp=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),Ip):Ip;function Rp(e,t,n="validate"){if(Mp(e)||Array.isArray(e)&&e.every(Mp)||wp(e)&&!e)return{type:n,message:Mp(e)?e:"",ref:t}}var Op=e=>Uf(e)&&!Ap(e)?e:{value:e,message:""},Pp=async(e,t,n,r,i)=>{const{ref:o,refs:a,required:s,maxLength:l,minLength:c,min:u,max:d,pattern:h,validate:f,name:p,valueAsNumber:m,mount:g,disabled:v}=e._f;if(!g||v)return{};const b=a?a[0]:o,y=e=>{r&&b.reportValidity&&(b.setCustomValidity(wp(e)?"":e||""),b.reportValidity())},w={},S=_p(o),x=Nf(o),M=S||x,_=(m||Sp(o))&&!o.value||""===t||Array.isArray(t)&&!t.length,A=fp.bind(null,p,n,w),E=(e,t,n,r=$f,i=ep)=>{const a=e?t:n;w[p]={type:e?r:i,message:a,ref:o,...A(e?r:i,a)}};if(i?!Array.isArray(t)||!t.length:s&&(!M&&(_||Lf(t))||wp(t)&&!t||x&&!Tp(a).isValid||S&&!kp(a).isValid)){const{value:e,message:t}=Mp(s)?{value:!!s,message:s}:Op(s);if(e&&(w[p]={type:np,message:t,ref:b,...A(np,t)},!n))return y(t),w}if(!(_||Lf(u)&&Lf(d))){let e,r;const i=Op(d),a=Op(u);if(Lf(t)||isNaN(t)){const n=o.valueAsDate||new Date(t),s=e=>new Date((new Date).toDateString()+" "+e),l="time"==o.type,c="week"==o.type;cp(i.value)&&t&&(e=l?s(t)>s(i.value):c?t>i.value:n>new Date(i.value)),cp(a.value)&&t&&(r=l?s(t)<s(a.value):c?t<a.value:n<new Date(a.value))}else{const n=o.valueAsNumber||(t?+t:t);Lf(i.value)||(e=n>i.value),Lf(a.value)||(r=n<a.value)}if((e||r)&&(E(!!e,i.message,a.message,Yf,Zf),!n))return y(w[p].message),w}if((l||c)&&!_&&(cp(t)||i&&Array.isArray(t))){const e=Op(l),r=Op(c),i=!Lf(e.value)&&t.length>e.value,o=!Lf(r.value)&&t.length<r.value;if((i||o)&&(E(i,e.message,r.message),!n))return y(w[p].message),w}if(h&&!_&&cp(t)){const{value:e,message:r}=Op(h);if(Ap(e)&&!t.match(e)&&(w[p]={type:tp,message:r,ref:o,...A(tp,r)},!n))return y(r),w}if(f)if(xp(f)){const e=Rp(await f(t),b);if(e&&(w[p]={...e,...A(rp,e.message)},!n))return y(e.message),w}else if(Uf(f)){let e={};for(const r in f){if(!op(e)&&!n)break;const i=Rp(await f[r](t),b,r);i&&(e={...i,...A(r,i.message)},y(i.message),n&&(w[p]=e))}if(!op(e)&&(w[p]={ref:b,...e},!n))return w}return y(!0),w};var Np=e=>({isOnSubmit:!e||e===Jf,isOnBlur:e===qf,isOnChange:e===Kf,isOnAll:e===Xf,isOnTouch:e===Qf});function Bp(e){for(const t in e)if(!Hf(e[t]))return!1;return!0}function Lp(e,t){const n=pp(t)?[t]:mp(t),r=1==n.length?e:function(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Hf(e)?r++:e[t[r++]];return e}(e,n),i=n[n.length-1];let o;r&&delete r[i];for(let t=0;t<n.slice(0,-1).length;t++){let r,i=-1;const a=n.slice(0,-(t+1)),s=a.length-1;for(t>0&&(o=e);++i<a.length;){const t=a[i];r=r?r[t]:e[t],s===i&&(Uf(r)&&op(r)||Array.isArray(r)&&Bp(r))&&(o?delete o[t]:delete e[t]),o=r}}return e}function Dp(){let e=[];return{get observers(){return e},next:t=>{for(const n of e)n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}}var Up=e=>Lf(e)||!Df(e);function Fp(e,t){if(Up(e)||Up(t))return e===t;if(Bf(e)&&Bf(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const n=e[i];if(!r.includes(i))return!1;if("ref"!==i){const e=t[i];if(Bf(n)&&Bf(e)||Uf(n)&&Uf(e)||Array.isArray(n)&&Array.isArray(e)?!Fp(n,e):n!==e)return!1}}return!0}var zp=e=>{const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},jp=e=>"select-multiple"===e.type,Hp=e=>zp(e)&&e.isConnected,Gp=e=>{for(const t in e)if(xp(e[t]))return!0;return!1};function Vp(e,t={}){const n=Array.isArray(e);if(Uf(e)||n)for(const n in e)Array.isArray(e[n])||Uf(e[n])&&!Gp(e[n])?(t[n]=Array.isArray(e[n])?[]:{},Vp(e[n],t[n])):Lf(e[n])||(t[n]=!0);return t}function Wp(e,t,n){const r=Array.isArray(e);if(Uf(e)||r)for(const r in e)Array.isArray(e[r])||Uf(e[r])&&!Gp(e[r])?Hf(t)||Up(n[r])?n[r]=Array.isArray(e[r])?Vp(e[r],[]):{...Vp(e[r])}:Wp(e[r],Lf(t)?{}:t[r],n[r]):Fp(e[r],t[r])?delete n[r]:n[r]=!0;return n}var qp=(e,t)=>Wp(e,t,Vp(t)),Kp=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Hf(e)?e:t?""===e?NaN:e?+e:e:n&&cp(e)?new Date(e):r?r(e):e;function Jp(e){const t=e.ref;if(!(e.refs?e.refs.every((e=>e.disabled)):t.disabled))return Sp(t)?t.files:_p(t)?kp(e.refs).value:jp(t)?[...t.selectedOptions].map((({value:e})=>e)):Nf(t)?Tp(e.refs).value:Kp(Hf(t.value)?e.ref.value:t.value,e)}var Qp=e=>Hf(e)?e:Ap(e)?e.source:Uf(e)?Ap(e.value)?e.value.source:e.value:e;function Xp(e,t,n){const r=Gf(e,n);if(r||pp(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const r=i.join("."),o=Gf(t,r),a=Gf(e,r);if(o&&!Array.isArray(o)&&n!==r)return{name:n};if(a&&a.type)return{name:r,error:a};i.pop()}return{name:n}}const Yp={mode:Jf,reValidateMode:Kf,shouldFocusError:!0};function Zp(e={}){let t,n={...Yp,...e},r={submitCount:0,isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:{}},i={},o=hp(n.defaultValues)||{},a=n.shouldUnregister?{}:hp(o),s={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c=0,u={};const d={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={watch:Dp(),array:Dp(),state:Dp()},f=Np(n.mode),p=Np(n.reValidateMode),m=n.criteriaMode===Xf,g=async()=>{let e=!1;return d.isValid&&(e=n.resolver?op((await w()).errors):await S(i,!0),e!==r.isValid&&(r.isValid=e,h.state.next({isValid:e}))),e},v=(e,t,n,r)=>{const l=Gf(i,e);if(l){const i=Gf(a,e,Hf(n)?Gf(o,e):n);Hf(i)||r&&r.defaultChecked||t?gp(a,e,t?i:Jp(l._f)):_(e,i),s.mount&&g()}},b=(e,t,n,i,a)=>{let s=!1,l=!1;const c={name:e};if(d.isDirty&&(l=r.isDirty,r.isDirty=c.isDirty=x(),s=l!==c.isDirty),d.dirtyFields&&(!n||i)){l=Gf(r.dirtyFields,e);const n=Fp(Gf(o,e),t);n?Lp(r.dirtyFields,e):gp(r.dirtyFields,e,!0),c.dirtyFields=r.dirtyFields,s=s||l!==!n}if(n){const t=Gf(r.touchedFields,e);t||(gp(r.touchedFields,e,n),c.touchedFields=r.touchedFields,s=s||d.touchedFields&&t!==n)}return s&&a&&h.state.next(c),s?c:{}},y=(n,i,o,a)=>{const s=Gf(r.errors,n),l=d.isValid&&wp(i)&&r.isValid!==i;var f;if(e.delayError&&o?(f=()=>((e,t)=>{gp(r.errors,e,t),h.state.next({errors:r.errors})})(n,o),t=e=>{clearTimeout(c),c=window.setTimeout(f,e)},t(e.delayError)):(clearTimeout(c),t=null,o?gp(r.errors,n,o):Lp(r.errors,n)),(o?!Fp(s,o):s)||!op(a)||l){const e={...a,...l&&wp(i)?{isValid:i}:{},errors:r.errors,name:n};r={...r,...e},h.state.next(e)}u[n]--,d.isValidating&&!Object.values(u).some((e=>e))&&(h.state.next({isValidating:!1}),u={})},w=async e=>n.resolver?await n.resolver({...a},n.context,((e,t,n,r)=>{const i={};for(const n of e){const e=Gf(t,n);e&&gp(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}})(e||l.mount,i,n.criteriaMode,n.shouldUseNativeValidation)):{},S=async(e,t,i={valid:!0})=>{for(const o in e){const s=e[o];if(s){const{_f:e,...o}=s;if(e){const o=l.array.has(e.name),c=await Pp(s,Gf(a,e.name),m,n.shouldUseNativeValidation,o);if(c[e.name]&&(i.valid=!1,t))break;!t&&(Gf(c,e.name)?o?yp(r.errors,c,e.name):gp(r.errors,e.name,c[e.name]):Lp(r.errors,e.name))}o&&await S(o,t,i)}}return i.valid},x=(e,t)=>(e&&t&&gp(a,e,t),!Fp(I(),o)),M=(e,t,n)=>up(e,l,{...s.mount?a:Hf(t)?o:cp(e)?{[e]:t}:t},n),_=(e,t,n={})=>{const r=Gf(i,e);let o=t;if(r){const n=r._f;n&&(!n.disabled&&gp(a,e,Kp(t,n)),o=dp&&zp(n.ref)&&Lf(t)?"":t,jp(n.ref)?[...n.ref.options].forEach((e=>e.selected=o.includes(e.value))):n.refs?Nf(n.ref)?n.refs.length>1?n.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(o)?!!o.find((t=>t===e.value)):o===e.value))):n.refs[0]&&(n.refs[0].checked=!!o):n.refs.forEach((e=>e.checked=e.value===o)):Sp(n.ref)?n.ref.value="":(n.ref.value=o,n.ref.type||h.watch.next({name:e})))}(n.shouldDirty||n.shouldTouch)&&b(e,o,n.shouldTouch,n.shouldDirty,!0),n.shouldValidate&&T(e)},A=(e,t,n)=>{for(const r in t){const o=t[r],a=`${e}.${r}`,s=Gf(i,a);!l.array.has(e)&&Up(o)&&(!s||s._f)||Bf(o)?_(a,o,n):A(a,o,n)}},E=(e,t,n={})=>{const s=Gf(i,e),c=l.array.has(e),u=hp(t);gp(a,e,u),c?(h.array.next({name:e,values:a}),(d.isDirty||d.dirtyFields)&&n.shouldDirty&&(r.dirtyFields=qp(o,a),h.state.next({name:e,dirtyFields:r.dirtyFields,isDirty:x(e,u)}))):!s||s._f||Lf(u)?_(e,u,n):A(e,u,n),bp(e,l)&&h.state.next({}),h.watch.next({name:e})},C=async e=>{const o=e.target;let s=o.name;const c=Gf(i,s);if(c){let S,x;const M=o.type?Jp(c._f):Ff(e),_=e.type===Vf||e.type===Wf,A=!((v=c._f).mount&&(v.required||v.min||v.max||v.maxLength||v.minLength||v.pattern||v.validate)||n.resolver||Gf(r.errors,s)||c._f.deps)||((e,t,n,r,i)=>!i.isOnAll&&(!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e))(_,Gf(r.touchedFields,s),r.isSubmitted,p,f),E=bp(s,l,_);gp(a,s,M),_?(c._f.onBlur&&c._f.onBlur(e),t&&t(0)):c._f.onChange&&c._f.onChange(e);const C=b(s,M,_,!1),I=!op(C)||E;if(!_&&h.watch.next({name:s,type:e.type}),A)return d.isValid&&g(),I&&h.state.next({name:s,...E?{}:C});if(!_&&E&&h.state.next({}),u[s]=u[s]?u[s]+1:1,h.state.next({isValidating:!0}),n.resolver){const{errors:e}=await w([s]),t=Xp(r.errors,i,s),n=Xp(e,i,t.name||s);S=n.error,s=n.name,x=op(e)}else S=(await Pp(c,Gf(a,s),m,n.shouldUseNativeValidation))[s],g();c._f.deps&&T(c._f.deps),y(s,x,S,C)}var v},T=async(e,t={})=>{let o,a;const s=sp(e);if(h.state.next({isValidating:!0}),n.resolver){const t=await(async e=>{const{errors:t}=await w();if(e)for(const n of e){const e=Gf(t,n);e?gp(r.errors,n,e):Lp(r.errors,n)}else r.errors=t;return t})(Hf(e)?e:s);o=op(t),a=e?!s.some((e=>Gf(t,e))):o}else e?(a=(await Promise.all(s.map((async e=>{const t=Gf(i,e);return await S(t&&t._f?{[e]:t}:t)})))).every(Boolean),(a||r.isValid)&&g()):a=o=await S(i);return h.state.next({...!cp(e)||d.isValid&&o!==r.isValid?{}:{name:e},...n.resolver||!e?{isValid:o}:{},errors:r.errors,isValidating:!1}),t.shouldFocus&&!a&&vp(i,(e=>e&&Gf(r.errors,e)),e?s:l.mount),a},I=e=>{const t={...o,...s.mount?a:{}};return Hf(e)?t:cp(e)?Gf(t,e):e.map((e=>Gf(t,e)))},k=(e,t)=>({invalid:!!Gf((t||r).errors,e),isDirty:!!Gf((t||r).dirtyFields,e),isTouched:!!Gf((t||r).touchedFields,e),error:Gf((t||r).errors,e)}),R=(e,t={})=>{for(const s of e?sp(e):l.mount)l.mount.delete(s),l.array.delete(s),Gf(i,s)&&(t.keepValue||(Lp(i,s),Lp(a,s)),!t.keepError&&Lp(r.errors,s),!t.keepDirty&&Lp(r.dirtyFields,s),!t.keepTouched&&Lp(r.touchedFields,s),!n.shouldUnregister&&!t.keepDefaultValue&&Lp(o,s));h.watch.next({}),h.state.next({...r,...t.keepDirty?{isDirty:x()}:{}}),!t.keepIsValid&&g()},O=(e,t={})=>{let r=Gf(i,e);const c=wp(t.disabled);return gp(i,e,{...r||{},_f:{...r&&r._f?r._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),r?c&&gp(a,e,t.disabled?void 0:Gf(a,e,Jp(r._f))):v(e,!0,t.value),{...c?{disabled:t.disabled}:{},...n.shouldUseNativeValidation?{required:!!t.required,min:Qp(t.min),max:Qp(t.max),minLength:Qp(t.minLength),maxLength:Qp(t.maxLength),pattern:Qp(t.pattern)}:{},name:e,onChange:C,onBlur:C,ref:a=>{if(a){O(e,t),r=Gf(i,e);const n=Hf(a.value)&&a.querySelectorAll&&a.querySelectorAll("input,select,textarea")[0]||a,s=(e=>_p(e)||Nf(e))(n),l=r._f.refs||[];if(s?l.find((e=>e===n)):n===r._f.ref)return;gp(i,e,{_f:{...r._f,...s?{refs:[...l.filter(Hp),n,...Array.isArray(Gf(o,e))?[{}]:[]],ref:{type:n.type,name:e}}:{ref:n}}}),v(e,!1,void 0,n)}else r=Gf(i,e,{}),r._f&&(r._f.mount=!1),(n.shouldUnregister||t.shouldUnregister)&&(!zf(l.array,e)||!s.action)&&l.unMount.add(e)}}},P=()=>n.shouldFocusError&&vp(i,(e=>e&&Gf(r.errors,e)),l.mount);return{control:{register:O,unregister:R,getFieldState:k,_executeSchema:w,_focusError:P,_getWatch:M,_getDirty:x,_updateValid:g,_removeUnmounted:()=>{for(const e of l.unMount){const t=Gf(i,e);t&&(t._f.refs?t._f.refs.every((e=>!Hp(e))):!Hp(t._f.ref))&&R(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],n,l,c=!0,u=!0)=>{if(l&&n){if(s.action=!0,u&&Array.isArray(Gf(i,e))){const t=n(Gf(i,e),l.argA,l.argB);c&&gp(i,e,t)}if(u&&Array.isArray(Gf(r.errors,e))){const t=n(Gf(r.errors,e),l.argA,l.argB);c&&gp(r.errors,e,t),((e,t)=>{!jf(Gf(e,t)).length&&Lp(e,t)})(r.errors,e)}if(d.touchedFields&&u&&Array.isArray(Gf(r.touchedFields,e))){const t=n(Gf(r.touchedFields,e),l.argA,l.argB);c&&gp(r.touchedFields,e,t)}d.dirtyFields&&(r.dirtyFields=qp(o,a)),h.state.next({isDirty:x(e,t),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else gp(a,e,t)},_getFieldArray:t=>jf(Gf(s.mount?a:o,t,e.shouldUnregister?Gf(o,t,[]):[])),_subjects:h,_proxyFormState:d,get _fields(){return i},get _formValues(){return a},get _stateFlags(){return s},set _stateFlags(e){s=e},get _defaultValues(){return o},get _names(){return l},set _names(e){l=e},get _formState(){return r},set _formState(e){r=e},get _options(){return n},set _options(e){n={...n,...e}}},trigger:T,register:O,handleSubmit:(e,t)=>async o=>{o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let s=!0,l=hp(a);h.state.next({isSubmitting:!0});try{if(n.resolver){const{errors:e,values:t}=await w();r.errors=e,l=t}else await S(i);op(r.errors)?(h.state.next({errors:{},isSubmitting:!0}),await e(l,o)):(t&&await t({...r.errors},o),P())}catch(e){throw s=!1,e}finally{r.isSubmitted=!0,h.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:op(r.errors)&&s,submitCount:r.submitCount+1,errors:r.errors})}},watch:(e,t)=>xp(e)?h.watch.subscribe({next:n=>e(M(void 0,t),n)}):M(e,t,!0),setValue:E,getValues:I,reset:(t,n)=>((t,n={})=>{const c=t||o,u=hp(c),f=t&&!op(t)?u:o;if(n.keepDefaultValues||(o=c),!n.keepValues){if(n.keepDirtyValues)for(const e of l.mount)Gf(r.dirtyFields,e)?gp(f,e,Gf(a,e)):E(e,Gf(f,e));else{if(dp&&Hf(t))for(const e of l.mount){const t=Gf(i,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(zp(e)){const t=e.closest("form");if(t){t.reset();break}}}}i={}}a=e.shouldUnregister?n.keepDefaultValues?hp(o):{}:u,h.array.next({values:f}),h.watch.next({values:f})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!n.keepIsValid,s.watch=!!e.shouldUnregister,h.state.next({submitCount:n.keepSubmitCount?r.submitCount:0,isDirty:n.keepDirty||n.keepDirtyValues?r.isDirty:!(!n.keepDefaultValues||Fp(t,o)),isSubmitted:!!n.keepIsSubmitted&&r.isSubmitted,dirtyFields:n.keepDirty||n.keepDirtyValues?r.dirtyFields:n.keepDefaultValues&&t?qp(o,t):{},touchedFields:n.keepTouched?r.touchedFields:{},errors:n.keepErrors?r.errors:{},isSubmitting:!1,isSubmitSuccessful:!1})})(xp(t)?t(a):t,n),resetField:(e,t={})=>{Gf(i,e)&&(Hf(t.defaultValue)?E(e,Gf(o,e)):(E(e,t.defaultValue),gp(o,e,t.defaultValue)),t.keepTouched||Lp(r.touchedFields,e),t.keepDirty||(Lp(r.dirtyFields,e),r.isDirty=t.defaultValue?x(e,Gf(o,e)):x()),t.keepError||(Lp(r.errors,e),d.isValid&&g()),h.state.next({...r}))},clearErrors:e=>{e?sp(e).forEach((e=>Lp(r.errors,e))):r.errors={},h.state.next({errors:r.errors})},unregister:R,setError:(e,t,n)=>{const o=(Gf(i,e,{_f:{}})._f||{}).ref;gp(r.errors,e,{...t,ref:o}),h.state.next({name:e,errors:r.errors,isValid:!1}),n&&n.shouldFocus&&o&&o.focus&&o.focus()},setFocus:(e,t={})=>{const n=Gf(i,e),r=n&&n._f;if(r){const e=r.refs?r.refs[0]:r.ref;e.focus&&(e.focus(),t.shouldSelect&&e.select())}},getFieldState:k}}function $p(e={}){const t=n(c).useRef(),[r,i]=n(c).useState({isDirty:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:{},defaultValues:e.defaultValues});t.current||(t.current={...Zp(e),formState:r});const o=t.current.control;return o._options=e,lp({subject:o._subjects.state,callback:n(c).useCallback((e=>{ap(e,o._proxyFormState,!0)&&(o._formState={...o._formState,...e},i({...o._formState}))}),[o])}),n(c).useEffect((()=>{o._stateFlags.mount||(o._proxyFormState.isValid&&o._updateValid(),o._stateFlags.mount=!0),o._stateFlags.watch&&(o._stateFlags.watch=!1,o._subjects.state.next({})),o._removeUnmounted()})),n(c).useEffect((()=>{r.submitCount&&o._focusError()}),[o,r.submitCount]),t.current.formState=ip(r,o),t.current}c=o("85Hg2");var em=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}),n(c).createElement("path",{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"}));var tm=({pwdOrTokens:e,setPwdOrTokens:t,onFinish:r,minimumNumberOfRecoveryTokens:i=1,showTokens:o=!0,openModal:a=!1,withModal:s=!1})=>{var l;const{t:u}=yo(),{register:d,handleSubmit:h,formState:{errors:f},setError:p}=$p(),[m,g]=(0,c.useState)(1),[v,b]=(0,c.useState)(!!e),y=n(c).createElement("form",{name:"memoriAuth",onSubmit:h((t=>{var n,o,a;"password"===e&&!(null===(n=t.password)||void 0===n?void 0:n.length)||"tokens"===e&&(((null===(o=null==t?void 0:t.tokens)||void 0===o?void 0:o.length)||0)<i||!(null===(a=null==t?void 0:t.tokens)||void 0===a?void 0:a.every((e=>e.length))))?p("tokens",{type:"minLength",message:"Tokens"}):r&&r(t).then((()=>{b(!1)}))})),className:"memori-auth-widget--form"},("password"===e||!o)&&n(c).createElement("fieldset",{className:"memori-auth-widget--password-fieldset"},n(c).createElement("label",null,"Password:"," ",n(c).createElement("input",{className:"memori-auth-widget--input",required:!0,type:"password",placeholder:"Password",...d("password",{required:!0})})),o&&n(c).createElement(n(c).Fragment,null,n(c).createElement("hr",null),n(c).createElement(bd,{outlined:!0,onClick:()=>t("tokens")},u("auth.useRecoveryTokens")||"Recovery tokens"))),"tokens"===e&&o&&n(c).createElement("fieldset",{className:"memori-auth-widget--tokens-fieldset",name:"tokens"},n(c).createElement("legend",null,u("auth.tokens"),": "),(w=m,Array.from({length:w},((e,t)=>t))).map((e=>n(c).createElement("label",{className:"memori-auth-widget--token",key:e},n(c).createElement("input",{type:"password",className:"memori-auth-widget--input",placeholder:"Recovery token",required:!0,autoComplete:"off",...d(`tokens.${e}`,{required:!0})})))),n(c).createElement(bd,{onClick:()=>g((e=>e+1)),className:"memori-auth-widget--token-add",icon:n(c).createElement(em,null)},u("auth.addToken")||"Add token"),n(c).createElement("hr",null),n(c).createElement(bd,{outlined:!0,onClick:()=>t("password")},u("auth.usePassword")||"Password")),"minLength"===(null===(l=f.tokens)||void 0===l?void 0:l.type)&&n(c).createElement("div",{className:"memori-auth-widget--error"},u("auth.atLeast")||"At least"," ",i),n(c).createElement(bd,{htmlType:"submit",primary:!0,className:"memori-auth-widget--submit"},u("confirm")||"Submit"));var w;return s?n(c).createElement(Pf,{open:a||v,title:"Authentication",onClose:()=>t(null),closable:!1},y):y};c=o("85Hg2"),c=o("85Hg2");const nm=()=>{let e=!1;if("maxTouchPoints"in navigator)e=navigator.maxTouchPoints>0;else if("msMaxTouchPoints"in navigator)e=navigator.msMaxTouchPoints>0;else{const n=window&&"matchMedia"in window&&matchMedia("(pointer:coarse)");if(n&&"(pointer:coarse)"===n.media)e=!!n.matches;else if("orientation"in window)e=!0;else{var t=null===navigator||void 0===navigator?void 0:navigator.userAgent;e=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(t)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(t)}}return e};const rm=e=>e.slice(0,e.length/2).trim().toLowerCase()===e.slice(e.length/2+1).trim().toLowerCase()?e.slice(0,e.length/2):e,im=({type:e,resourceURI:t,sessionID:n,baseURL:r=""})=>{var i,o;let a="cover"===e?`${r}/images/memoriCover.png`:`${r}/images/memoriAvatar.png`;return t&&0!==t.length?t.includes("memoriai/memory")&&!t.includes("memori-ai-session-id")&&n?`${t}?memori-ai-session-id=${n}`:t.startsWith("https://")||t.startsWith("http://")?`${t}${n?`/${n}`:""}`:t.startsWith("cloud://")?`${i=void 0,(void 0===i?void 0:i.replace(/v2/,"v1"))||""}/CloudAsset/${t.replace("cloud://","")}`:t.startsWith("guid://")?`${o=void 0,(void 0===o?void 0:o.replace(/v2/,"v1"))||""}/GuidAsset/${t.replace("guid://","")}`:a:a};c=o("85Hg2"),c=o("85Hg2");var om=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M858.5 763.6a374 374 0 0 0-80.6-119.5 375.63 375.63 0 0 0-119.5-80.6c-.4-.2-.8-.3-1.2-.5C719.5 518 760 444.7 760 362c0-137-111-248-248-248S264 225 264 362c0 82.7 40.5 156 102.8 201.1-.4.2-.8.3-1.2.5-44.8 18.9-85 46-119.5 80.6a375.63 375.63 0 0 0-80.6 119.5A371.7 371.7 0 0 0 136 901.8a8 8 0 0 0 8 8.2h60c4.4 0 7.9-3.5 8-7.8 2-77.2 33-149.5 87.8-204.3 56.7-56.7 132-87.9 212.2-87.9s155.5 31.2 212.2 87.9C779 752.7 810 825 812 902.2c.1 4.4 3.6 7.8 8 7.8h60a8 8 0 0 0 8-8.2c-1-47.8-10.9-94.3-29.5-138.2zM512 534c-45.9 0-89.1-17.9-121.6-50.4S340 407.9 340 362c0-45.9 17.9-89.1 50.4-121.6S466.1 190 512 190s89.1 17.9 121.6 50.4S684 316.1 684 362c0 45.9-17.9 89.1-50.4 121.6S557.9 534 512 534z"}));var am=({message:e,memori:t,tenant:r,baseUrl:i})=>n(c).createElement(n(c).Fragment,null,e.initial&&n(c).createElement("div",{className:"memori-chat--bubble-initial"}),n(c).createElement(kf,{show:!0,appear:!0,as:"div",className:n(md)("memori-chat--bubble-container",{"memori-chat--bubble-from-user":!!e.fromUser})},!e.fromUser&&n(c).createElement(kf.Child,{as:"picture",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15")},n(c).createElement("source",{src:im({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:t.avatarURL,baseURL:i})}),n(c).createElement("img",{className:"memori-chat--bubble-avatar-img",alt:t.name,src:t.avatarURL&&t.avatarURL.length>0?im({type:"avatar",tenantID:null==r?void 0:r.id,resourceURI:t.avatarURL,baseURL:i}):im({tenantID:null==r?void 0:r.id,type:"avatar",baseURL:i||"https://app.twincreator.com"})})),n(c).createElement(kf.Child,{as:"div",className:n(md)("memori-chat--bubble",{"memori-chat--user-bubble":!!e.fromUser}),enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-09 translate-x-"+(e.fromUser?"30":"-30")},(e.translatedText||e.text).split(/\r\n|\r|\n/).map(((e,t)=>n(c).createElement("p",{key:t},e)))),e.fromUser&&n(c).createElement(kf.Child,{as:"div",className:"memori-chat--bubble-avatar",enter:"transition ease-in-out duration-300",enterFrom:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15"),enterTo:"opacity-1 scale-1 translate-x-0",leave:"transition ease-in-out duration-300",leaveFrom:"opacity-1 scale-1 translate-x-0",leaveTo:"opacity-0 scale-075 "+(e.fromUser?"translate-x-15":"translate-x--15")},n(c).createElement(om,null))));c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");var sm,lm=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M574 665.4a8.03 8.03 0 0 0-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 0 0-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 0 0 0 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 0 0 0 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 0 0-11.3 0L372.3 598.7a8.03 8.03 0 0 0 0 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"})),cm={};sm=function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function n(e,n){var r=e.el,i=e.elStyle,o=e.elHeight,a=e.rowsLimit,s=e.rowsWrapped,l=e.options,c=e.buffer,u=c;if(s===a+1)return t({},e);var d=c,h=s,f=o;return r.innerHTML=u=c.length?""+c+l.delimiter+n+l.replaceStr:""+n+l.replaceStr,parseFloat(i.height)>parseFloat(o)&&(h++,f=i.height,h===a+1)?(r.innerHTML=u="."===d[d.length-1]&&"..."===l.replaceStr?d+"..":""+d+l.replaceStr,t({},e,{elHeight:f,rowsWrapped:h})):(r.innerHTML=u=d.length?""+d+l.delimiter+n:""+n,t({},e,{buffer:u,elHeight:f,rowsWrapped:h}))}e.disableResponsive=function(e){window.removeEventListener("resize",e)},e.ellipsis=function e(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a={replaceStr:"...",responsive:!1,debounceDelay:250,delimiter:" "},s=t({},a,o),l=r&&(r instanceof NodeList?r:1===r.nodeType?[r]:document.querySelectorAll(r)),c=[],u=0;u<l.length;u++){var d=l[u];c[u]=d.innerHTML;var h=d.innerHTML.split(s.delimiter);d.innerHTML="";var f=window.getComputedStyle(d);h.reduce(n,{el:d,buffer:d.innerHTML,elStyle:f,elHeight:0,rowsLimit:i,rowsWrapped:0,options:s})}if(s.responsive){var p=!1,m=window.innerWidth,g=function(){if(window.innerWidth!==m){m=window.innerWidth;for(var n=0;n<l.length;n++)l[n].innerHTML=c[n];e(r,i,t({},o,{responsive:!1}))}},v=function(){clearTimeout(p),p=setTimeout(g,s.debounceDelay)};return window.addEventListener("resize",v),v}}},"function"==typeof define&&define.amd?define(["exports"],sm):sm(cm);c=o("85Hg2");var um=({loading:e=!1,className:t,title:r,description:i,cover:o,hoverable:a=!1,children:s})=>n(c).createElement("div",{className:n(md)("memori-card",t,{"memori-card--loading":e,"memori-card--with-cover":o,"memori-card--hoverable":a})},n(c).createElement(Rf,{spinning:e},o&&n(c).createElement("div",{className:"memori-card--cover"},o),n(c).createElement("div",{className:"memori-card--content"},r&&n(c).createElement("h3",{className:"memori-card--title"},r),i&&n(c).createElement("p",{className:"memori-card--description"},i),n(c).createElement("div",{className:"memori-card--children"},s))));const dm=({item:e,baseUrl:t,onLinkPreviewInfo:r,descriptionOneLine:i=!1})=>{var o,a,s,l;const[u,d]=(0,c.useState)(null),h=(null===(o=e.url)||void 0===o?void 0:o.startsWith("http"))||!e.url||0===(null===(a=e.url)||void 0===a?void 0:a.length)?e.url:`https://${e.url}`;(0,c.useEffect)((()=>{var n,i;let o=(null===(n=e.url)||void 0===n?void 0:n.startsWith("http"))||!e.url||0===(null===(i=e.url)||void 0===i?void 0:i.length)?e.url:`https://${e.url}`;o&&o!==(null==u?void 0:u.urlKey)&&(async(e,t)=>{try{const n=await fetch(`${t||"https://app.twincreator.com"}/api/linkpreview/${encodeURIComponent(e)}`);return await n.json()}catch(e){return console.error("getSiteInfo",e),null}})(o,t).then((e=>{d(e?{...e,urlKey:o}:null),r&&e&&r(e)}))}),[null==e?void 0:e.url,t,r]);const f=e.title&&e.title.length>0?e.title:null==u?void 0:u.title,p=null==u?void 0:u.description,m=null==u?void 0:u.video,g=null!==(s=null==u?void 0:u.image)&&void 0!==s?s:null===(l=null==u?void 0:u.images)||void 0===l?void 0:l[0];return(0,c.useEffect)((()=>{setTimeout((()=>{(0,cm.ellipsis)(".memori-link-item--card .memori-card--description",3,{responsive:!0})}),300)}),[p,e.mediumID]),n(c).createElement("a",{href:h,target:"_blank",rel:"noopener noreferrer",className:"memori-link-item--link"},n(c).createElement(um,{hoverable:!0,className:n(md)("memori-link-item--card",{"memori-link-item--card-description-oneline":i,"memori-link-item--card-has-image":g,"memori-link-item--card-has-video":m}),cover:m?n(c).createElement("iframe",{width:"100%",height:"100%",src:m,title:"Video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):g?n(c).createElement("img",{className:"memori-link-item--card-cover-img",src:g,alt:e.title}):n(c).createElement("div",{className:"memori-link-item--card-cover-icon"},n(c).createElement(lm,{className:"memori-link-item--icon"})),title:f,description:p}))};var hm=({items:e,baseUrl:t,descriptionOneLine:r=!1,onLinkPreviewInfo:i})=>n(c).createElement(kf,{appear:!0,show:!0,as:"div",className:"memori-link-items"},n(c).createElement("div",{className:"memori-link-items--grid"},e.map(((e,o)=>n(c).createElement(kf.Child,{as:"div",className:"memori-link-item",key:e.mediumID,enter:"ease-out duration-500 delay-"+100*o,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95"},n(c).createElement(dm,{item:e,baseUrl:t,descriptionOneLine:r,onLinkPreviewInfo:i}))))));c=o("85Hg2");const fm=["va bene","no grazie","si","no","sì","arrivederci","non c'entrava","non mi è piaciuto"],pm=async(e,t,n,r)=>{var i;const o=fm.indexOf(e.toLowerCase())>-1?"IT":null==n?void 0:n.toUpperCase(),a=await fetch(`${r||"https://app.twincreator.com"}/api/translate?text=${encodeURIComponent(e)}&target_lang=${t.toUpperCase()}${o?`&source_lang=${o}`:""}`,{method:"GET",headers:{Accept:"*/*"}}),s=await a.json();return null===(i=null==s?void 0:s.translations)||void 0===i?void 0:i[0]},mm=[{value:"IT",label:"Italiano"},{value:"EN",label:"English"},{value:"DE",label:"Deutsch"},{value:"ES",label:"Español"},{value:"FR",label:"Français"},{value:"PT",label:"Português"},{value:"UK",label:"Українська"},{value:"RU",label:"Русский"}],gm="👤",vm=[{name:"text",lang:"text",mimeType:"text/plain",monacoLang:"plaintext",executable:!0},{name:"javascript/jsx",lang:"jsx",mimeType:"text/javascript",monacoLang:"javascript",executable:!0},{name:"typescript/tsx",lang:"tsx",mimeType:"text/ecmascript",monacoLang:"typescript",executable:!0},{name:"json",lang:"json",mimeType:"application/json",monacoLang:"json",executable:!0},{name:"css",lang:"scss",mimeType:"text/css",monacoLang:"css",executable:!0},{name:"html/xml",lang:"tsx",mimeType:"application/xml",monacoLang:"xml"},{name:"bash",lang:"bash",mimeType:"application/x-sh",monacoLang:"shell"},{name:"python",lang:"python",mimeType:"text/x-python",monacoLang:"python"},{name:"cpp/csharp",lang:"cpp",mimeType:"text/x-c++src",monacoLang:"cpp"},{name:"php",lang:"php",mimeType:"application/x-php",monacoLang:"php"},{name:"ruby",lang:"ruby",mimeType:"text/x-ruby",monacoLang:"ruby"},{name:"sql",lang:"sql",mimeType:"text/x-sql",monacoLang:"sql"}];c=o("85Hg2");var bm=({src:e,poster:t,alt:r=""})=>((0,c.useEffect)((()=>{const e=document.createElement("script");return e.src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js",e.type="module",document.head.appendChild(e),()=>{document.head.removeChild(e)}}),[]),n(c).createElement("div",{className:"model-viewer"},n(c).createElement("model-viewer",{src:e,"ios-src":"",poster:t,alt:r,"shadow-intensity":"1","disable-zoom":!0,"camera-controls":!0,autoplay:!0})));c=o("85Hg2"),c=o("85Hg2");var ym=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"})),wm={};function Sm(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,i)}(wm=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){Sm(o,r,i,a,s,"next",e)}function s(e){Sm(o,r,i,a,s,"throw",e)}a(void 0)}))}}).__esModule=!0,wm.default=wm;var xm={};function Mm(){return xm=Mm=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},xm.__esModule=!0,xm.default=xm,Mm.apply(this,arguments)}(xm=Mm).__esModule=!0,xm.default=xm;Ji=o("ffgrs"),Qi=o("22y1y");var _m={},Am={};function Em(e,t){return Am=Em=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Am.__esModule=!0,Am.default=Am,Em(e,t)}(Am=Em).__esModule=!0,Am.default=Am,(_m=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Am(e,t)}).__esModule=!0,_m.default=_m;var Cm={},Tm=o("lEJSL").default,Im={};(Im=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}).__esModule=!0,Im.default=Im,(Cm=function(e,t){if(t&&("object"===Tm(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Im(e)}).__esModule=!0,Cm.default=Cm;var km={};function Rm(e){return km=Rm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},km.__esModule=!0,km.default=km,Rm(e)}(km=Rm).__esModule=!0,km.default=km;var Om,Pm=o("7qcgS")();Om=Pm;try{regeneratorRuntime=Pm}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=Pm:Function("r","regeneratorRuntime = r")(Pm)}c=o("85Hg2");var Nm={},Bm={};(Bm=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}).__esModule=!0,Bm.default=Bm,(Nm=function(e,t){if(null==e)return{};var n,r,i=Bm(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}).__esModule=!0,Nm.default=Nm;var Lm={},Dm={},Um=o("e3mvX");(Dm=function(e){if(Array.isArray(e))return Um(e)}).__esModule=!0,Dm.default=Dm;var Fm={};(Fm=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}).__esModule=!0,Fm.default=Fm;var zm=o("8xD61"),jm={};(jm=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}).__esModule=!0,jm.default=jm,(Lm=function(e){return Dm(e)||Fm(e)||zm(e)||jm()}).__esModule=!0,Lm.default=Lm;c=o("85Hg2"),c=o("85Hg2");function Hm(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 Gm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hm(Object(r),!0).forEach((function(t){n(qi)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Vm={};function Wm(e){if(0===e.length||1===e.length)return e;var t,n,r=e.join(".");return Vm[r]||(Vm[r]=0===(n=(t=e).length)||1===n?t:2===n?[t[0],t[1],"".concat(t[0],".").concat(t[1]),"".concat(t[1],".").concat(t[0])]:3===n?[t[0],t[1],t[2],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0])]:n>=4?[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]:void 0),Vm[r]}function qm(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.filter((function(e){return"token"!==e})),i=Wm(r);return i.reduce((function(e,t){return Gm(Gm({},e),n[t])}),t)}function Km(e){return e.join(" ")}function Jm(e){var t=e.node,r=e.stylesheet,i=e.style,o=void 0===i?{}:i,a=e.useInlineStyles,s=e.key,l=t.properties,u=t.type,d=t.tagName,h=t.value;if("text"===u)return h;if(d){var f,p=function(e,t){var n=0;return function(r){return n+=1,r.map((function(r,i){return Jm({node:r,stylesheet:e,useInlineStyles:t,key:"code-segment-".concat(n,"-").concat(i)})}))}}(r,a);if(a){var m=Object.keys(r).reduce((function(e,t){return t.split(".").forEach((function(t){e.includes(t)||e.push(t)})),e}),[]),g=l.className&&l.className.includes("token")?["token"]:[],v=l.className&&g.concat(l.className.filter((function(e){return!m.includes(e)})));f=Gm(Gm({},l),{},{className:Km(v)||void 0,style:qm(l.className,Object.assign({},l.style,o),r)})}else f=Gm(Gm({},l),{},{className:Km(l.className)});var b=p(t.children);return n(c).createElement(d,n(xm)({key:s},f),b)}}var Qm=["language","children","style","customStyle","codeTagProps","useInlineStyles","showLineNumbers","showInlineLineNumbers","startingLineNumber","lineNumberContainerStyle","lineNumberStyle","wrapLines","wrapLongLines","lineProps","renderer","PreTag","CodeTag","code","astGenerator"];function Xm(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 Ym(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Xm(Object(r),!0).forEach((function(t){n(qi)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xm(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Zm=/\n/g;function $m(e){var t=e.codeString,r=e.codeStyle,i=e.containerStyle,o=void 0===i?{float:"left",paddingRight:"10px"}:i,a=e.numberStyle,s=void 0===a?{}:a,l=e.startingLineNumber;return n(c).createElement("code",{style:Object.assign({},r,o)},function(e){var t=e.lines,r=e.startingLineNumber,i=e.style;return t.map((function(e,t){var o=t+r;return n(c).createElement("span",{key:"line-".concat(t),className:"react-syntax-highlighter-line-number",style:"function"==typeof i?i(o):i},"".concat(o,"\n"))}))}({lines:t.replace(/\n$/,"").split("\n"),style:s,startingLineNumber:l}))}function eg(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function tg(e,t,n){var r,i={display:"inline-block",minWidth:(r=n,"".concat(r.toString().length,".25em")),paddingRight:"1em",textAlign:"right",userSelect:"none"},o="function"==typeof e?e(t):e;return Ym(Ym({},i),o)}function ng(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,a=e.lineProps,s=void 0===a?{}:a,l=e.className,c=void 0===l?[]:l,u=e.showLineNumbers,d=e.wrapLongLines,h="function"==typeof s?s(n):s;if(h.className=c,n&&o){var f=tg(r,n,i);t.unshift(eg(n,f))}return d&u&&(h.style=Ym(Ym({},h.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:h,children:t}}function rg(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=0;i<e.length;i++){var o=e[i];if("text"===o.type)r.push(ng({children:[o],className:n(Lm)(new Set(t))}));else if(o.children){var a=t.concat(o.properties.className);rg(o.children,a).forEach((function(e){return r.push(e)}))}}return r}function ig(e,t,n,r,i,o,a,s,l){var c,u=rg(e.value),d=[],h=-1,f=0;function p(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return ng({children:e,lineNumber:t,lineNumberStyle:s,largestLineNumber:a,showInlineLineNumbers:i,lineProps:n,className:o,showLineNumbers:r,wrapLongLines:l})}function m(e,t){if(r&&t&&i){var n=tg(s,t,a);e.unshift(eg(t,n))}return e}function g(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return t||r.length>0?p(e,n,r):m(e,n)}for(var v=function(){var e=u[f],t=e.children[0].value;if(t.match(Zm)){var n=t.split("\n");n.forEach((function(t,i){var a=r&&d.length+o,s={type:"text",value:"".concat(t,"\n")};if(0===i){var l=g(u.slice(h+1,f).concat(ng({children:[s],className:e.properties.className})),a);d.push(l)}else if(i===n.length-1){var c=u[f+1]&&u[f+1].children&&u[f+1].children[0],p={type:"text",value:"".concat(t)};if(c){var m=ng({children:[p],className:e.properties.className});u.splice(f+1,0,m)}else{var v=g([p],a,e.properties.className);d.push(v)}}else{var b=g([s],a,e.properties.className);d.push(b)}})),h=f}f++};f<u.length;)v();if(h!==u.length-1){var b=u.slice(h+1,u.length);if(b&&b.length){var y=g(b,r&&d.length+o);d.push(y)}}return t?d:(c=[]).concat.apply(c,d)}function og(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map((function(e,t){return Jm({node:e,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(t)})}))}function ag(e){return e&&void 0!==e.highlightAuto}function sg(e,t){return function(r){var i=r.language,o=r.children,a=r.style,s=void 0===a?t:a,l=r.customStyle,u=void 0===l?{}:l,d=r.codeTagProps,h=void 0===d?{className:i?"language-".concat(i):void 0,style:Ym(Ym({},s['code[class*="language-"]']),s['code[class*="language-'.concat(i,'"]')])}:d,f=r.useInlineStyles,p=void 0===f||f,m=r.showLineNumbers,g=void 0!==m&&m,v=r.showInlineLineNumbers,b=void 0===v||v,y=r.startingLineNumber,w=void 0===y?1:y,S=r.lineNumberContainerStyle,x=r.lineNumberStyle,M=void 0===x?{}:x,_=r.wrapLines,A=r.wrapLongLines,E=void 0!==A&&A,C=r.lineProps,T=void 0===C?{}:C,I=r.renderer,k=r.PreTag,R=void 0===k?"pre":k,O=r.CodeTag,P=void 0===O?"code":O,N=r.code,B=void 0===N?(Array.isArray(o)?o[0]:o)||"":N,L=r.astGenerator,D=n(Nm)(r,Qm);L=L||e;var U=g?n(c).createElement($m,{containerStyle:S,codeStyle:h.style||{},numberStyle:M,startingLineNumber:w,codeString:B}):null,F=s.hljs||s['pre[class*="language-"]']||{backgroundColor:"#fff"},z=ag(L)?"hljs":"prismjs",j=p?Object.assign({},D,{style:Object.assign({},F,u)}):Object.assign({},D,{className:D.className?"".concat(z," ").concat(D.className):z,style:Object.assign({},u)});if(h.style=Ym(Ym({},h.style),{},E?{whiteSpace:"pre-wrap"}:{whiteSpace:"pre"}),!L)return n(c).createElement(R,j,U,n(c).createElement(P,h,B));(void 0===_&&I||E)&&(_=!0),I=I||og;var H=[{type:"text",value:B}],G=function(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(ag(t)){var o=function(e,t){return-1!==e.listLanguages().indexOf(t)}(t,n);return"text"===n?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&"text"!==n?{value:t.highlight(r,n)}:{value:i}}catch(e){return{value:i}}}({astGenerator:L,language:i,code:B,defaultCodeValue:H});null===G.language&&(G.value=H);var V=ig(G,_,T,g,b,w,G.value.length+w,M,E);return n(c).createElement(R,j,n(c).createElement(P,h,!b&&U,I({rows:V,stylesheet:s,useInlineStyles:p})))}}function lg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,i=n(km)(e);if(t){var o=n(km)(this).constructor;r=Reflect.construct(i,arguments,o)}else r=i.apply(this,arguments);return n(Cm)(this,r)}}var cg,ug,dg,hg,fg,pg,mg,gg=function(e,t){return function(){var r=n(wm)(n(Om).mark((function r(i){var o;return n(Om).wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t();case 2:o=n.sent,i(e,o.default||o);case 4:case"end":return n.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()},vg={abap:gg("abap",(function(){return o("bwHpE")})),abnf:gg("abnf",(function(){return o("daD87")})),actionscript:gg("actionscript",(function(){return o("lpEgO")})),ada:gg("ada",(function(){return o("1sGW9")})),agda:gg("agda",(function(){return o("e9VyR")})),al:gg("al",(function(){return o("kMFSe")})),antlr4:gg("antlr4",(function(){return o("8HlsP")})),apacheconf:gg("apacheconf",(function(){return o("isFCh")})),apex:gg("apex",(function(){return o("gUXVM")})),apl:gg("apl",(function(){return o("2L15v")})),applescript:gg("applescript",(function(){return o("8XyFT")})),aql:gg("aql",(function(){return o("gFWTI")})),arduino:gg("arduino",(function(){return o("jI3VB")})),arff:gg("arff",(function(){return o("6uYTH")})),asciidoc:gg("asciidoc",(function(){return o("gdYKH")})),asm6502:gg("asm6502",(function(){return o("ahFLg")})),asmatmel:gg("asmatmel",(function(){return o("4irIu")})),aspnet:gg("aspnet",(function(){return o("yDC6n")})),autohotkey:gg("autohotkey",(function(){return o("a4xpy")})),autoit:gg("autoit",(function(){return o("iNSix")})),avisynth:gg("avisynth",(function(){return o("kEBnk")})),avroIdl:gg("avroIdl",(function(){return o("lzthi")})),bash:gg("bash",(function(){return Promise.resolve(o("3aDLI"))})),basic:gg("basic",(function(){return o("cxDu6")})),batch:gg("batch",(function(){return o("6zDll")})),bbcode:gg("bbcode",(function(){return o("bPS87")})),bicep:gg("bicep",(function(){return o("8dy5f")})),birb:gg("birb",(function(){return o("3vHrY")})),bison:gg("bison",(function(){return o("bCjBS")})),bnf:gg("bnf",(function(){return o("4NqDW")})),brainfuck:gg("brainfuck",(function(){return o("4s0KX")})),brightscript:gg("brightscript",(function(){return o("jTsQ4")})),bro:gg("bro",(function(){return o("5lMc2")})),bsl:gg("bsl",(function(){return o("jBYxC")})),c:gg("c",(function(){return Promise.resolve(o("lyZgY"))})),cfscript:gg("cfscript",(function(){return o("coZDy")})),chaiscript:gg("chaiscript",(function(){return o("e1zEN")})),cil:gg("cil",(function(){return o("crKoM")})),clike:gg("clike",(function(){return o("4kO9t")})),clojure:gg("clojure",(function(){return o("01SpB")})),cmake:gg("cmake",(function(){return o("9yG4p")})),cobol:gg("cobol",(function(){return o("967Hn")})),coffeescript:gg("coffeescript",(function(){return o("7Yi6H")})),concurnas:gg("concurnas",(function(){return o("5tXmX")})),coq:gg("coq",(function(){return o("ektdr")})),cpp:gg("cpp",(function(){return Promise.resolve(o("lR39A"))})),crystal:gg("crystal",(function(){return o("8gt4L")})),csharp:gg("csharp",(function(){return o("7K6eJ")})),cshtml:gg("cshtml",(function(){return o("cVu4i")})),csp:gg("csp",(function(){return o("ecKo1")})),cssExtras:gg("cssExtras",(function(){return o("gnpv8")})),css:gg("css",(function(){return o("jx0H8")})),csv:gg("csv",(function(){return o("f9kmW")})),cypher:gg("cypher",(function(){return o("lojor")})),d:gg("d",(function(){return o("6Qa0U")})),dart:gg("dart",(function(){return o("74K1B")})),dataweave:gg("dataweave",(function(){return o("93H6c")})),dax:gg("dax",(function(){return o("cf9Y9")})),dhall:gg("dhall",(function(){return o("f6UWv")})),diff:gg("diff",(function(){return o("klPVo")})),django:gg("django",(function(){return o("jfxe9")})),dnsZoneFile:gg("dnsZoneFile",(function(){return o("5aMz5")})),docker:gg("docker",(function(){return o("kOauC")})),dot:gg("dot",(function(){return o("btE6k")})),ebnf:gg("ebnf",(function(){return o("aT88c")})),editorconfig:gg("editorconfig",(function(){return o("jWOl8")})),eiffel:gg("eiffel",(function(){return o("kHJaX")})),ejs:gg("ejs",(function(){return o("frfnA")})),elixir:gg("elixir",(function(){return o("hcrJ2")})),elm:gg("elm",(function(){return o("jd271")})),erb:gg("erb",(function(){return o("gczXL")})),erlang:gg("erlang",(function(){return o("FsabW")})),etlua:gg("etlua",(function(){return o("9DI9l")})),excelFormula:gg("excelFormula",(function(){return o("3QVue")})),factor:gg("factor",(function(){return o("ltNCT")})),falselang:gg("falselang",(function(){return o("g0Q6p")})),firestoreSecurityRules:gg("firestoreSecurityRules",(function(){return o("ukA2V")})),flow:gg("flow",(function(){return o("e5prn")})),fortran:gg("fortran",(function(){return o("gIEL6")})),fsharp:gg("fsharp",(function(){return o("3wQkt")})),ftl:gg("ftl",(function(){return o("7ZVWs")})),gap:gg("gap",(function(){return o("hOFj6")})),gcode:gg("gcode",(function(){return o("95BzQ")})),gdscript:gg("gdscript",(function(){return o("iul6t")})),gedcom:gg("gedcom",(function(){return o("e0qJM")})),gherkin:gg("gherkin",(function(){return o("2SHak")})),git:gg("git",(function(){return o("l6VFH")})),glsl:gg("glsl",(function(){return o("cEMfJ")})),gml:gg("gml",(function(){return o("8UVTr")})),gn:gg("gn",(function(){return o("kvibD")})),goModule:gg("goModule",(function(){return o("icqjF")})),go:gg("go",(function(){return o("jLkg8")})),graphql:gg("graphql",(function(){return o("aYGNi")})),groovy:gg("groovy",(function(){return o("4bTmH")})),haml:gg("haml",(function(){return o("h2A6V")})),handlebars:gg("handlebars",(function(){return o("79YVJ")})),haskell:gg("haskell",(function(){return o("bsiLW")})),haxe:gg("haxe",(function(){return o("94Kdj")})),hcl:gg("hcl",(function(){return o("9CheR")})),hlsl:gg("hlsl",(function(){return o("h3dqW")})),hoon:gg("hoon",(function(){return o("9WbsW")})),hpkp:gg("hpkp",(function(){return o("GiPN3")})),hsts:gg("hsts",(function(){return o("eaSn9")})),http:gg("http",(function(){return o("1uj7b")})),ichigojam:gg("ichigojam",(function(){return o("ge562")})),icon:gg("icon",(function(){return o("lVHUf")})),icuMessageFormat:gg("icuMessageFormat",(function(){return o("aYoUL")})),idris:gg("idris",(function(){return o("1RVAE")})),iecst:gg("iecst",(function(){return o("bi7Dr")})),ignore:gg("ignore",(function(){return o("cq0Pi")})),inform7:gg("inform7",(function(){return o("31K4E")})),ini:gg("ini",(function(){return o("l05OZ")})),io:gg("io",(function(){return o("6bY1b")})),j:gg("j",(function(){return o("1ebDS")})),java:gg("java",(function(){return o("iEZZI")})),javadoc:gg("javadoc",(function(){return o("aHy5a")})),javadoclike:gg("javadoclike",(function(){return o("5f3rE")})),javascript:gg("javascript",(function(){return o("7JDFI")})),javastacktrace:gg("javastacktrace",(function(){return o("gdCGE")})),jexl:gg("jexl",(function(){return o("cqMb9")})),jolie:gg("jolie",(function(){return o("cEDX4")})),jq:gg("jq",(function(){return o("kEWsh")})),jsExtras:gg("jsExtras",(function(){return o("74PI8")})),jsTemplates:gg("jsTemplates",(function(){return o("30TPr")})),jsdoc:gg("jsdoc",(function(){return o("9DH5c")})),json:gg("json",(function(){return Promise.resolve(o("l1Rj1"))})),json5:gg("json5",(function(){return o("920rv")})),jsonp:gg("jsonp",(function(){return o("9AwS1")})),jsstacktrace:gg("jsstacktrace",(function(){return o("bYXMr")})),jsx:gg("jsx",(function(){return Promise.resolve(o("6ho3O"))})),julia:gg("julia",(function(){return o("g0ibH")})),keepalived:gg("keepalived",(function(){return o("2hdnH")})),keyman:gg("keyman",(function(){return o("cIufI")})),kotlin:gg("kotlin",(function(){return o("c26dU")})),kumir:gg("kumir",(function(){return o("iYAha")})),kusto:gg("kusto",(function(){return o("9z1oX")})),latex:gg("latex",(function(){return o("lCPLU")})),latte:gg("latte",(function(){return o("c9oN0")})),less:gg("less",(function(){return o("hA3V9")})),lilypond:gg("lilypond",(function(){return o("hpHTA")})),liquid:gg("liquid",(function(){return o("kpZTm")})),lisp:gg("lisp",(function(){return o("chgK5")})),livescript:gg("livescript",(function(){return o("2gdiv")})),llvm:gg("llvm",(function(){return o("jUeFO")})),log:gg("log",(function(){return o("3BFSQ")})),lolcode:gg("lolcode",(function(){return o("lG9br")})),lua:gg("lua",(function(){return o("cVGpd")})),magma:gg("magma",(function(){return o("4LVzY")})),makefile:gg("makefile",(function(){return o("2NviD")})),markdown:gg("markdown",(function(){return o("jUFCF")})),markupTemplating:gg("markupTemplating",(function(){return Promise.resolve(o("t3W0d"))})),markup:gg("markup",(function(){return o("5hIXu")})),matlab:gg("matlab",(function(){return o("kPAC0")})),maxscript:gg("maxscript",(function(){return o("gHOJy")})),mel:gg("mel",(function(){return o("9mj6e")})),mermaid:gg("mermaid",(function(){return o("kozw5")})),mizar:gg("mizar",(function(){return o("2bN6W")})),mongodb:gg("mongodb",(function(){return o("eHKWX")})),monkey:gg("monkey",(function(){return o("7Fh0C")})),moonscript:gg("moonscript",(function(){return o("hDXwC")})),n1ql:gg("n1ql",(function(){return o("j9bkC")})),n4js:gg("n4js",(function(){return o("eTmBF")})),nand2tetrisHdl:gg("nand2tetrisHdl",(function(){return o("ezjCf")})),naniscript:gg("naniscript",(function(){return o("VxHk1")})),nasm:gg("nasm",(function(){return o("ly95T")})),neon:gg("neon",(function(){return o("7Fk34")})),nevod:gg("nevod",(function(){return o("3U8Qv")})),nginx:gg("nginx",(function(){return o("c6qVk")})),nim:gg("nim",(function(){return o("1JdCk")})),nix:gg("nix",(function(){return o("jcstS")})),nsis:gg("nsis",(function(){return o("kEJqW")})),objectivec:gg("objectivec",(function(){return o("lUP8A")})),ocaml:gg("ocaml",(function(){return o("lhTAD")})),opencl:gg("opencl",(function(){return o("8rxKO")})),openqasm:gg("openqasm",(function(){return o("ib0uL")})),oz:gg("oz",(function(){return o("csCUS")})),parigp:gg("parigp",(function(){return o("2DkHE")})),parser:gg("parser",(function(){return o("2cp75")})),pascal:gg("pascal",(function(){return o("fViVl")})),pascaligo:gg("pascaligo",(function(){return o("9Uuxa")})),pcaxis:gg("pcaxis",(function(){return o("jUdnN")})),peoplecode:gg("peoplecode",(function(){return o("l8w4e")})),perl:gg("perl",(function(){return o("aX7dM")})),phpExtras:gg("phpExtras",(function(){return o("3cMZl")})),php:gg("php",(function(){return Promise.resolve(o("5li5P"))})),phpdoc:gg("phpdoc",(function(){return o("bDyJN")})),plsql:gg("plsql",(function(){return o("cPuMN")})),powerquery:gg("powerquery",(function(){return o("jE1gU")})),powershell:gg("powershell",(function(){return o("k7t0j")})),processing:gg("processing",(function(){return o("jr8hV")})),prolog:gg("prolog",(function(){return o("hpuat")})),promql:gg("promql",(function(){return o("ckXC5")})),properties:gg("properties",(function(){return o("fAh6P")})),protobuf:gg("protobuf",(function(){return o("R6WqB")})),psl:gg("psl",(function(){return o("Al65w")})),pug:gg("pug",(function(){return o("dxbNS")})),puppet:gg("puppet",(function(){return o("lrSuh")})),pure:gg("pure",(function(){return o("6DKQK")})),purebasic:gg("purebasic",(function(){return o("7ZkSb")})),purescript:gg("purescript",(function(){return o("dBTYx")})),python:gg("python",(function(){return Promise.resolve(o("kiy5M"))})),q:gg("q",(function(){return o("4FXyy")})),qml:gg("qml",(function(){return o("2zZFj")})),qore:gg("qore",(function(){return o("iCK1Y")})),qsharp:gg("qsharp",(function(){return o("dvH9H")})),r:gg("r",(function(){return o("lQqRt")})),racket:gg("racket",(function(){return o("eHKmq")})),reason:gg("reason",(function(){return o("kkeLT")})),regex:gg("regex",(function(){return o("llX50")})),rego:gg("rego",(function(){return o("9hKdZ")})),renpy:gg("renpy",(function(){return o("cJgw5")})),rest:gg("rest",(function(){return o("867DK")})),rip:gg("rip",(function(){return o("3Odjx")})),roboconf:gg("roboconf",(function(){return o("gQ0Us")})),robotframework:gg("robotframework",(function(){return o("bLCgx")})),ruby:gg("ruby",(function(){return Promise.resolve(o("ch1PX"))})),rust:gg("rust",(function(){return o("cInT8")})),sas:gg("sas",(function(){return o("iz7eP")})),sass:gg("sass",(function(){return o("hrDC3")})),scala:gg("scala",(function(){return o("ub8Bf")})),scheme:gg("scheme",(function(){return o("7NAAt")})),scss:gg("scss",(function(){return Promise.resolve(o("fU6a0"))})),shellSession:gg("shellSession",(function(){return o("7kKCv")})),smali:gg("smali",(function(){return o("2lkCb")})),smalltalk:gg("smalltalk",(function(){return o("4280y")})),smarty:gg("smarty",(function(){return o("4hXYK")})),sml:gg("sml",(function(){return o("jh2E8")})),solidity:gg("solidity",(function(){return o("dTdF2")})),solutionFile:gg("solutionFile",(function(){return o("iI5tm")})),soy:gg("soy",(function(){return o("aoU5C")})),sparql:gg("sparql",(function(){return o("ggrvb")})),splunkSpl:gg("splunkSpl",(function(){return o("8LhCX")})),sqf:gg("sqf",(function(){return o("3tDsu")})),sql:gg("sql",(function(){return Promise.resolve(o("bnDV9"))})),squirrel:gg("squirrel",(function(){return o("bxaUV")})),stan:gg("stan",(function(){return o("dBqrq")})),stylus:gg("stylus",(function(){return o("JlHVK")})),swift:gg("swift",(function(){return o("c7NBs")})),systemd:gg("systemd",(function(){return o("jprZl")})),t4Cs:gg("t4Cs",(function(){return o("edsMI")})),t4Templating:gg("t4Templating",(function(){return o("bS9Wa")})),t4Vb:gg("t4Vb",(function(){return o("gYk20")})),tap:gg("tap",(function(){return o("byv7d")})),tcl:gg("tcl",(function(){return o("lUAIZ")})),textile:gg("textile",(function(){return o("7J2LO")})),toml:gg("toml",(function(){return o("eXtdM")})),tremor:gg("tremor",(function(){return o("vyajH")})),tsx:gg("tsx",(function(){return Promise.resolve(o("7cTnl"))})),tt2:gg("tt2",(function(){return o("8XOOm")})),turtle:gg("turtle",(function(){return o("1XvLQ")})),twig:gg("twig",(function(){return o("i9Fpp")})),typescript:gg("typescript",(function(){return Promise.resolve(o("fzL8k"))})),typoscript:gg("typoscript",(function(){return o("kKk69")})),unrealscript:gg("unrealscript",(function(){return o("jgq8Y")})),uorazor:gg("uorazor",(function(){return o("dsZ00")})),uri:gg("uri",(function(){return o("fqJRp")})),v:gg("v",(function(){return o("bgfyB")})),vala:gg("vala",(function(){return o("68x4q")})),vbnet:gg("vbnet",(function(){return o("eUhQs")})),velocity:gg("velocity",(function(){return o("fPNdV")})),verilog:gg("verilog",(function(){return o("2fM1V")})),vhdl:gg("vhdl",(function(){return o("hNF6q")})),vim:gg("vim",(function(){return o("75TCr")})),visualBasic:gg("visualBasic",(function(){return o("fc93z")})),warpscript:gg("warpscript",(function(){return o("jgHlG")})),wasm:gg("wasm",(function(){return o("dVZkI")})),webIdl:gg("webIdl",(function(){return o("9Jnxv")})),wiki:gg("wiki",(function(){return o("1Gimo")})),wolfram:gg("wolfram",(function(){return o("4SyRT")})),wren:gg("wren",(function(){return o("gaIVs")})),xeora:gg("xeora",(function(){return o("lagad")})),xmlDoc:gg("xmlDoc",(function(){return o("9DNYE")})),xojo:gg("xojo",(function(){return o("ksF4f")})),xquery:gg("xquery",(function(){return o("gXxHJ")})),yaml:gg("yaml",(function(){return o("6rk3j")})),yang:gg("yang",(function(){return o("kTyrQ")})),zig:gg("zig",(function(){return o("d3mFC")}))},bg=(ug=(cg={loader:function(){return o("bB2YF").then((function(e){return e.default||e}))},isLanguageRegistered:function(e,t){return e.registered(t)},languageLoaders:vg,registerLanguage:function(e,t,n){return e.register(n)}}).loader,dg=cg.isLanguageRegistered,hg=cg.registerLanguage,fg=cg.languageLoaders,pg=cg.noAsyncLoadingLanguages,mg=function(e){n(_m)(i,e);var t,r=lg(i);function i(){return n(Ji)(this,i),r.apply(this,arguments)}return n(Qi)(i,[{key:"componentDidUpdate",value:function(){!i.isRegistered(this.props.language)&&fg&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var e=this;i.astGeneratorPromise||i.loadAstGenerator(),i.astGenerator||i.astGeneratorPromise.then((function(){e.forceUpdate()})),!i.isRegistered(this.props.language)&&fg&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var e=this,t=this.props.language;"text"!==t&&i.loadLanguage(t).then((function(){return e.forceUpdate()})).catch((function(){}))}},{key:"normalizeLanguage",value:function(e){return i.isSupportedLanguage(e)?e:"text"}},{key:"render",value:function(){return n(c).createElement(i.highlightInstance,n(xm)({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:i.astGenerator}))}}],[{key:"preload",value:function(){return i.loadAstGenerator()}},{key:"loadLanguage",value:(t=n(wm)(n(Om).mark((function e(t){var r;return n(Om).wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("function"!=typeof(r=fg[t])){e.next=5;break}return e.abrupt("return",r(i.registerLanguage));case 5:throw new Error("Language ".concat(t," not supported"));case 6:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"isSupportedLanguage",value:function(e){return i.isRegistered(e)||"function"==typeof fg[e]}},{key:"loadAstGenerator",value:function(){return i.astGeneratorPromise=ug().then((function(e){i.astGenerator=e,hg&&i.languages.forEach((function(t,n){return hg(e,n,t)}))})),i.astGeneratorPromise}}]),i}(n(c).PureComponent),n(qi)(mg,"astGenerator",null),n(qi)(mg,"highlightInstance",sg(null,{})),n(qi)(mg,"astGeneratorPromise",null),n(qi)(mg,"languages",new Map),n(qi)(mg,"supportedLanguages",cg.supportedLanguages||Object.keys(fg||{})),n(qi)(mg,"isRegistered",(function(e){if(pg)return!0;if(!hg)throw new Error("Current syntax highlighter doesn't support registration of languages");return mg.astGenerator?dg(mg.astGenerator,e):mg.languages.has(e)})),n(qi)(mg,"registerLanguage",(function(e,t){if(!hg)throw new Error("Current syntax highlighter doesn't support registration of languages");if(mg.astGenerator)return hg(mg.astGenerator,e,t);mg.languages.set(e,t)})),mg),yg={},wg={};(wg=function(e){return e&&e.__esModule?e:{default:e}}).__esModule=!0,wg.default=wg,Object.defineProperty(yg,"__esModule",{value:!0}),Object.defineProperty(yg,"a11yDark",{enumerable:!0,get:function(){return Ig.default}}),Object.defineProperty(yg,"atomDark",{enumerable:!0,get:function(){return kg.default}}),Object.defineProperty(yg,"base16AteliersulphurpoolLight",{enumerable:!0,get:function(){return Rg.default}}),Object.defineProperty(yg,"cb",{enumerable:!0,get:function(){return Og.default}}),Object.defineProperty(yg,"coldarkCold",{enumerable:!0,get:function(){return Pg.default}}),Object.defineProperty(yg,"coldarkDark",{enumerable:!0,get:function(){return Ng.default}}),Object.defineProperty(yg,"coy",{enumerable:!0,get:function(){return Sg.default}}),Object.defineProperty(yg,"coyWithoutShadows",{enumerable:!0,get:function(){return Bg.default}}),Object.defineProperty(yg,"darcula",{enumerable:!0,get:function(){return Lg.default}}),Object.defineProperty(yg,"dark",{enumerable:!0,get:function(){return xg.default}}),Object.defineProperty(yg,"dracula",{enumerable:!0,get:function(){return Dg.default}}),Object.defineProperty(yg,"duotoneDark",{enumerable:!0,get:function(){return Ug.default}}),Object.defineProperty(yg,"duotoneEarth",{enumerable:!0,get:function(){return Fg.default}}),Object.defineProperty(yg,"duotoneForest",{enumerable:!0,get:function(){return zg.default}}),Object.defineProperty(yg,"duotoneLight",{enumerable:!0,get:function(){return jg.default}}),Object.defineProperty(yg,"duotoneSea",{enumerable:!0,get:function(){return Hg.default}}),Object.defineProperty(yg,"duotoneSpace",{enumerable:!0,get:function(){return Gg.default}}),Object.defineProperty(yg,"funky",{enumerable:!0,get:function(){return Mg.default}}),Object.defineProperty(yg,"ghcolors",{enumerable:!0,get:function(){return Vg.default}}),Object.defineProperty(yg,"gruvboxDark",{enumerable:!0,get:function(){return Wg.default}}),Object.defineProperty(yg,"gruvboxLight",{enumerable:!0,get:function(){return qg.default}}),Object.defineProperty(yg,"holiTheme",{enumerable:!0,get:function(){return Kg.default}}),Object.defineProperty(yg,"hopscotch",{enumerable:!0,get:function(){return Jg.default}}),Object.defineProperty(yg,"lucario",{enumerable:!0,get:function(){return Qg.default}}),Object.defineProperty(yg,"materialDark",{enumerable:!0,get:function(){return Xg.default}}),Object.defineProperty(yg,"materialLight",{enumerable:!0,get:function(){return Yg.default}}),Object.defineProperty(yg,"materialOceanic",{enumerable:!0,get:function(){return Zg.default}}),Object.defineProperty(yg,"nightOwl",{enumerable:!0,get:function(){return $g.default}}),Object.defineProperty(yg,"nord",{enumerable:!0,get:function(){return ev.default}}),Object.defineProperty(yg,"okaidia",{enumerable:!0,get:function(){return _g.default}}),Object.defineProperty(yg,"oneDark",{enumerable:!0,get:function(){return tv.default}}),Object.defineProperty(yg,"oneLight",{enumerable:!0,get:function(){return nv.default}}),Object.defineProperty(yg,"pojoaque",{enumerable:!0,get:function(){return rv.default}}),Object.defineProperty(yg,"prism",{enumerable:!0,get:function(){return Tg.default}}),Object.defineProperty(yg,"shadesOfPurple",{enumerable:!0,get:function(){return iv.default}}),Object.defineProperty(yg,"solarizedDarkAtom",{enumerable:!0,get:function(){return ov.default}}),Object.defineProperty(yg,"solarizedlight",{enumerable:!0,get:function(){return Ag.default}}),Object.defineProperty(yg,"synthwave84",{enumerable:!0,get:function(){return av.default}}),Object.defineProperty(yg,"tomorrow",{enumerable:!0,get:function(){return Eg.default}}),Object.defineProperty(yg,"twilight",{enumerable:!0,get:function(){return Cg.default}}),Object.defineProperty(yg,"vs",{enumerable:!0,get:function(){return sv.default}}),Object.defineProperty(yg,"vscDarkPlus",{enumerable:!0,get:function(){return lv.default}}),Object.defineProperty(yg,"xonokai",{enumerable:!0,get:function(){return cv.default}}),Object.defineProperty(yg,"zTouch",{enumerable:!0,get:function(){return uv.default}});var Sg=wg(o("jcF8U")),xg=wg(o("3Tppx")),Mg=wg(o("dBuK7")),_g=wg(o("eEjWK")),Ag=wg(o("awG2g")),Eg=wg(o("2oFzQ")),Cg=wg(o("4Au6Q")),Tg=wg(o("dAPqs")),Ig=wg(o("8eAql")),kg=wg(o("cv2QE")),Rg=wg(o("h5I9g")),Og=wg(o("i4C5w")),Pg=wg(o("3kFKo")),Ng=wg(o("17zK0")),Bg=wg(o("5Avqr")),Lg=wg(o("1jHMv")),Dg=wg(o("7Q8CE")),Ug=wg(o("jKUos")),Fg=wg(o("Uzm4J")),zg=wg(o("7yfkN")),jg=wg(o("lT2l1")),Hg=wg(o("fZ9um")),Gg=wg(o("1MoQL")),Vg=wg(o("4uys7")),Wg=wg(o("kaYsk")),qg=wg(o("kN6Vu")),Kg=wg(o("2Z6pG")),Jg=wg(o("4jQJK")),Qg=wg(o("bpXw0")),Xg=wg(o("i4S8s")),Yg=wg(o("5bNr4")),Zg=wg(o("5ZYWT")),$g=wg(o("ihJCU")),ev=wg(o("8iIbg")),tv=wg(o("424u7")),nv=wg(o("jPiNI")),rv=wg(o("OHVOA")),iv=wg(o("2OKTL")),ov=wg(o("2Mg8H")),av=wg(o("9Kud0")),sv=wg(o("eCrmR")),lv=wg(o("8UhcQ")),cv=wg(o("dtU9z")),uv=wg(o("4xtLO")),dv={};Object.defineProperty(dv,"__esModule",{value:!0}),dv.default=void 0;var hv=wg(o("7cTnl")).default;dv.default=hv;var fv={};Object.defineProperty(fv,"__esModule",{value:!0}),fv.default=void 0;var pv=wg(o("l1Rj1")).default;fv.default=pv;var mv={};Object.defineProperty(mv,"__esModule",{value:!0}),mv.default=void 0;var gv=wg(o("fU6a0")).default;mv.default=gv;var vv={};Object.defineProperty(vv,"__esModule",{value:!0}),vv.default=void 0;var bv=wg(o("3aDLI")).default;vv.default=bv;var yv={};Object.defineProperty(yv,"__esModule",{value:!0}),yv.default=void 0;var wv=wg(o("kiy5M")).default;yv.default=wv;var Sv={};Object.defineProperty(Sv,"__esModule",{value:!0}),Sv.default=void 0;var xv=wg(o("lR39A")).default;Sv.default=xv;var Mv={};Object.defineProperty(Mv,"__esModule",{value:!0}),Mv.default=void 0;var _v=wg(o("5li5P")).default;Mv.default=_v;var Av={};Object.defineProperty(Av,"__esModule",{value:!0}),Av.default=void 0;var Ev=wg(o("ch1PX")).default;Av.default=Ev;var Cv={};Object.defineProperty(Cv,"__esModule",{value:!0}),Cv.default=void 0;var Tv=wg(o("bnDV9")).default;Cv.default=Tv,bg.registerLanguage("tsx",n(dv)),bg.registerLanguage("json",n(fv)),bg.registerLanguage("scss",n(mv)),bg.registerLanguage("bash",n(vv)),bg.registerLanguage("python",n(yv)),bg.registerLanguage("cpp",n(Sv)),bg.registerLanguage("php",n(Mv)),bg.registerLanguage("ruby",n(Av)),bg.registerLanguage("sql",n(Cv));var Iv=({medium:e,className:t,preview:r=!1})=>{var i,o,a,s;const{t:l}=yo();return n(c).createElement("div",{className:"memori-snippet"},n(c).createElement("div",{className:"memori-snippet--content"},n(c).createElement(bg,{"aria-labelledby":`#snippet-${e.mediumID}`,className:t,style:yg.atomDark,showLineNumbers:!0,language:null!==(o=null===(i=vm.find((t=>e.mimeType===t.mimeType)))||void 0===i?void 0:i.lang)&&void 0!==o?o:"text"},(null===(a=e.content)||void 0===a?void 0:a.length)&&e.content.length>200&&r?`${e.content.slice(0,200)}\n...`:`${e.content}`),n(c).createElement(bd,{padded:!1,ghost:!0,className:"memori-snippet--copy-button",title:l("copy")||"Copy",icon:n(c).createElement(ym,null),onClick:()=>{var t;return navigator.clipboard.writeText(null!==(t=e.content)&&void 0!==t?t:"")}})),!!(null===(s=e.title)||void 0===s?void 0:s.length)&&n(c).createElement("p",{id:`snippet-${e.mediumID}`,className:"memori-snippet--caption"},e.title))};c=o("85Hg2");var kv=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"}));c=o("85Hg2");var Rv=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M531.3 574.4l.3-1.4c5.8-23.9 13.1-53.7 7.4-80.7-3.8-21.3-19.5-29.6-32.9-30.2-15.8-.7-29.9 8.3-33.4 21.4-6.6 24-.7 56.8 10.1 98.6-13.6 32.4-35.3 79.5-51.2 107.5-29.6 15.3-69.3 38.9-75.2 68.7-1.2 5.5.2 12.5 3.5 18.8 3.7 7 9.6 12.4 16.5 15 3 1.1 6.6 2 10.8 2 17.6 0 46.1-14.2 84.1-79.4 5.8-1.9 11.8-3.9 17.6-5.9 27.2-9.2 55.4-18.8 80.9-23.1 28.2 15.1 60.3 24.8 82.1 24.8 21.6 0 30.1-12.8 33.3-20.5 5.6-13.5 2.9-30.5-6.2-39.6-13.2-13-45.3-16.4-95.3-10.2-24.6-15-40.7-35.4-52.4-65.8zM421.6 726.3c-13.9 20.2-24.4 30.3-30.1 34.7 6.7-12.3 19.8-25.3 30.1-34.7zm87.6-235.5c5.2 8.9 4.5 35.8.5 49.4-4.9-19.9-5.6-48.1-2.7-51.4.8.1 1.5.7 2.2 2zm-1.6 120.5c10.7 18.5 24.2 34.4 39.1 46.2-21.6 4.9-41.3 13-58.9 20.2-4.2 1.7-8.3 3.4-12.3 5 13.3-24.1 24.4-51.4 32.1-71.4zm155.6 65.5c.1.2.2.5-.4.9h-.2l-.2.3c-.8.5-9 5.3-44.3-8.6 40.6-1.9 45 7.3 45.1 7.4zm191.4-388.2L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494z"}));c=o("85Hg2");var Ov=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM514.1 580.1l-61.8-102.4c-2.2-3.6-6.1-5.8-10.3-5.8h-38.4c-2.3 0-4.5.6-6.4 1.9-5.6 3.5-7.3 10.9-3.7 16.6l82.3 130.4-83.4 132.8a12.04 12.04 0 0 0 10.2 18.4h34.5c4.2 0 8-2.2 10.2-5.7L510 664.8l62.3 101.4c2.2 3.6 6.1 5.7 10.2 5.7H620c2.3 0 4.5-.7 6.5-1.9 5.6-3.6 7.2-11 3.6-16.6l-84-130.4 85.3-132.5a12.04 12.04 0 0 0-10.1-18.5h-35.7c-4.2 0-8.1 2.2-10.3 5.8l-61.2 102.3z"}));c=o("85Hg2");var Pv=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0 0 42 42h216v494zM528.1 472h-32.2c-5.5 0-10.3 3.7-11.6 9.1L434.6 680l-46.1-198.7c-1.3-5.4-6.1-9.3-11.7-9.3h-35.4a12.02 12.02 0 0 0-11.6 15.1l74.2 276c1.4 5.2 6.2 8.9 11.6 8.9h32c5.4 0 10.2-3.6 11.6-8.9l52.8-197 52.8 197c1.4 5.2 6.2 8.9 11.6 8.9h31.8c5.4 0 10.2-3.6 11.6-8.9l74.4-276a12.04 12.04 0 0 0-11.6-15.1H647c-5.6 0-10.4 3.9-11.7 9.3l-45.8 199.1-49.8-199.3c-1.3-5.4-6.1-9.1-11.6-9.1z"}));const Nv=({item:e,sessionID:t,tenantID:r,preview:i=!1})=>{switch(e.mimeType){case"image/jpeg":case"image/png":case"image/jpg":case"image/gif":return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,className:"memori-media-item--card memori-media-item--image",cover:n(c).createElement("picture",{className:"memori-media-item--figure"},!i&&n(c).createElement("source",{srcSet:[im({resourceURI:e.url,sessionID:t,tenantID:r}),im({resourceURI:e.content,sessionID:t,tenantID:r}),e.url,e.content].join(", "),type:e.mimeType}),n(c).createElement("img",{alt:e.title,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}),e.title&&n(c).createElement("figcaption",{className:"memori-media-item--figure-caption"},e.title))}));case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,cover:n(c).createElement(Pv,{className:"memori-media-item--icon"}),title:e.title}));case"application/vnd.ms-excel":case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,cover:n(c).createElement(Ov,{className:"memori-media-item--icon"}),title:e.title}));case"application/pdf":return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,cover:n(c).createElement(Rv,{className:"memori-media-item--icon"}),title:e.title}));case"video/mp4":case"video/avi":case"video/mpeg":return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,cover:n(c).createElement("video",{style:{width:"100%",height:"100%"},controls:!0,src:e.url,title:e.title}),title:e.title}));case"audio/mpeg3":case"audio/wav":case"audio/mpeg":return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,cover:n(c).createElement("audio",{style:{width:"100%",height:"100%"},controls:!0,src:e.url}),title:e.title}));case"model/gltf-binary":return n(c).createElement(bm,{src:e.url,alt:"",poster:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="});default:return n(c).createElement("a",{className:"memori-media-item--link",href:e.url,target:"_blank",rel:"noopener noreferrer",title:e.title},n(c).createElement(um,{hoverable:!0,cover:n(c).createElement(kv,{className:"memori-media-item--icon"}),title:e.title}))}};var Bv=({items:e,sessionID:t,tenantID:r,translateTo:i})=>{const[o,a]=(0,c.useState)(e),s=(0,c.useCallback)((async()=>{if(!i)return;const t=await Promise.all((null!=e?e:[]).map((async e=>{var t;if(!e.title)return e;try{const n=await pm(e.title,i);return{...e,title:null!==(t=n.text)&&void 0!==t?t:e.title}}catch(t){return console.error(t),e}})));a(t)}),[i,e]);return(0,c.useEffect)((()=>{i&&s()}),[i,s]),(0,c.useEffect)((()=>{e.filter((e=>{var t;return"text/javascript"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).forEach((e=>{var t;try{new Function(null!==(t=e.content)&&void 0!==t?t:"")()}catch(e){console.error(e)}}))}),[]),n(c).createElement(kf,{appear:!0,show:!0,as:"div",className:"memori-media-items"},n(c).createElement("div",{className:"memori-media-items--grid"},o.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&!vm.map((e=>e.mimeType)).includes(e.mimeType)})).sort(((e,t)=>e.creationTimestamp>t.creationTimestamp?1:e.creationTimestamp<t.creationTimestamp?-1:0)).map(((e,i)=>n(c).createElement(kf.Child,{as:"div",className:"memori-media-item",key:e.url+"&index="+i,enter:"ease-out duration-500 delay-"+100*i,enterFrom:"opacity-0 scale-95",enterTo:"opacity-1 scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-1 scale-100",leaveTo:"opacity-0 scale-95"},n(c).createElement(Nv,{sessionID:t,tenantID:r,item:{...e,title:e.title,url:e.url,content:e.content}}))))),o.filter((e=>{var t;return!(null===(t=e.properties)||void 0===t?void 0:t.executable)&&vm.map((e=>e.mimeType)).includes(e.mimeType)})).map((e=>n(c).createElement(kf.Child,{as:"div",className:"memori-media-item--snippet",key:e.mediumID,enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0"},n(c).createElement(Iv,{key:e.mediumID,medium:e})))),o.filter((e=>{var t;return"text/css"===e.mimeType&&!!(null===(t=e.properties)||void 0===t?void 0:t.executable)})).map((e=>n(c).createElement("style",{key:e.mediumID,dangerouslySetInnerHTML:{__html:e.content||""}}))))};var Lv=({hints:e=[],links:t=[],media:r=[],simulateUserPrompt:i=(()=>{}),sessionID:o,baseUrl:a,translateTo:s})=>{const[l,u]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{u(!0)}),[e]),n(c).createElement("div",{className:"memori-media-widget"},(null==r?void 0:r.length)>0&&n(c).createElement(Bv,{items:r,sessionID:o,translateTo:s}),(null==t?void 0:t.length)>0&&n(c).createElement(hm,{items:t,baseUrl:a}),(null==e?void 0:e.length)>0&&l&&n(c).createElement(kf,{appear:!0,show:!0,as:"ul",className:"memori-media--hints"},e.map(((e,t)=>n(c).createElement(kf.Child,{as:"li",key:e.text+t,enter:"ease-out duration-500",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-1 translate-y-0",leave:"ease-in duration-300",leaveFrom:"opacity-1",leaveTo:"opacity-0"},n(c).createElement(bd,{key:e.text+t,className:n(md)("memori-media--hint"),primary:!0,onClick:()=>{i(e.originalText,e.text),u(!1)},onTouchEnd:()=>{i(e.originalText,e.text),u(!1)}},e.text))))))};c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");var Dv=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Dv||{});function Uv(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=null!=r?r:-1,o=(()=>{switch(e.focus){case 0:return n.findIndex((e=>!t.resolveDisabled(e)));case 1:{let e=n.slice().reverse().findIndex(((e,n,r)=>!(-1!==i&&r.length-n-1>=i)&&!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 2:return n.findIndex(((e,n)=>!(n<=i)&&!t.resolveDisabled(e)));case 3:{let e=n.slice().reverse().findIndex((e=>!t.resolveDisabled(e)));return-1===e?e:n.length-1-e}case 4:return n.findIndex((n=>t.resolveId(n)===e.id));case 5:return null;default:!function(e){throw new Error("Unexpected object: "+e)}(e)}})();return-1===o?r:o}c=o("85Hg2");function Fv({container:e,accept:t,walk:n,enabled:r=!0}){let i=(0,c.useRef)(t),o=(0,c.useRef)(n);(0,c.useEffect)((()=>{i.current=t,o.current=n}),[t,n]),Rd((()=>{if(!e||!r)return;let t=Xd(e);if(!t)return;let n=i.current,a=o.current,s=Object.assign((e=>n(e)),{acceptNode:n}),l=t.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,s,!1);for(;l.nextNode();)a(l.currentNode)}),[e,r,i,o])}c=o("85Hg2");function zv(e){var t;if(e.type)return e.type;let n=null!=(t=e.as)?t:"button";return"string"==typeof n&&"button"===n.toLowerCase()?"button":void 0}function jv(e,t){let[n,r]=(0,c.useState)((()=>zv(e)));return Rd((()=>{r(zv(e))}),[e.type,e.as]),Rd((()=>{n||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")}),[n,t]),n}var Hv=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Hv||{}),Gv=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Gv||{}),Vv=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(Vv||{});function Wv(e,t=(e=>e)){let n=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=ch(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),i=n?r.indexOf(n):null;return-1===i&&(i=null),{items:r,activeItemIndex:i}}let qv={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,menuState:0},2:(e,t)=>{var n;let r=Wv(e),i=Uv(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:i,activationTrigger:null!=(n=t.trigger)?n:1}},3:(e,t)=>{let n=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),i=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),o=i?e.items.indexOf(i):-1;return-1===o||o===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:o,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let n=Wv(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...n}},6:(e,t)=>{let n=Wv(e,(e=>{let n=e.findIndex((e=>e.id===t.id));return-1!==n&&e.splice(n,1),e}));return{...e,...n,activationTrigger:1}}},Kv=(0,c.createContext)(null);function Jv(e){let t=(0,c.useContext)(Kv);if(null===t){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Jv),t}return t}function Qv(e,t){return yd(t.type,qv,e,t)}Kv.displayName="MenuContext";let Xv=c.Fragment,Yv=Cd((function(e,t){let r=(0,c.useReducer)(Qv,{menuState:1,buttonRef:(0,c.createRef)(),itemsRef:(0,c.createRef)(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:o,buttonRef:a},s]=r,l=Ld(t);Kh([a,o],((e,t)=>{var n;s({type:1}),oh(t,ih.Loose)||(e.preventDefault(),null==(n=a.current)||n.focus())}),0===i);let u=Pd((()=>{s({type:1})})),d=(0,c.useMemo)((()=>({open:0===i,close:u})),[i,u]),h=e,f={ref:l};return n(c).createElement(Kv.Provider,{value:r},n(c).createElement(Hh,{value:yd(i,{0:zh.Open,1:zh.Closed})},_d({ourProps:f,theirProps:h,slot:d,defaultTag:Xv,name:"Menu"})))})),Zv=Cd((function(e,t){var n;let[r,i]=Jv("Menu.Button"),o=Ld(r.buttonRef,t),a=`headlessui-menu-button-${Wd()}`,s=pf(),l=Pd((e=>{switch(e.key){case Ud.Space:case Ud.Enter:case Ud.ArrowDown:e.preventDefault(),e.stopPropagation(),i({type:0}),s.nextFrame((()=>i({type:2,focus:Dv.First})));break;case Ud.ArrowUp:e.preventDefault(),e.stopPropagation(),i({type:0}),s.nextFrame((()=>i({type:2,focus:Dv.Last})))}})),u=Pd((e=>{if(e.key===Ud.Space)e.preventDefault()})),d=Pd((t=>{if(Fd(t.currentTarget))return t.preventDefault();e.disabled||(0===r.menuState?(i({type:1}),s.nextFrame((()=>{var e;return null==(e=r.buttonRef.current)?void 0:e.focus({preventScroll:!0})}))):(t.preventDefault(),i({type:0})))})),h=(0,c.useMemo)((()=>({open:0===r.menuState})),[r]),f=e;return _d({ourProps:{ref:o,id:a,type:jv(e,r.buttonRef),"aria-haspopup":!0,"aria-controls":null==(n=r.itemsRef.current)?void 0:n.id,"aria-expanded":e.disabled?void 0:0===r.menuState,onKeyDown:l,onKeyUp:u,onClick:d},theirProps:f,slot:h,defaultTag:"button",name:"Menu.Button"})})),$v=xd.RenderStrategy|xd.Static,eb=Cd((function(e,t){var n,r;let[i,o]=Jv("Menu.Items"),a=Ld(i.itemsRef,t),s=gh(i.itemsRef),l=`headlessui-menu-items-${Wd()}`,u=pf(),d=jh(),h=null!==d?d===zh.Open:0===i.menuState;(0,c.useEffect)((()=>{let e=i.itemsRef.current;!e||0===i.menuState&&e!==(null==s?void 0:s.activeElement)&&e.focus({preventScroll:!0})}),[i.menuState,i.itemsRef,s]),Fv({container:i.itemsRef.current,enabled:0===i.menuState,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let f=Pd((e=>{var t,n;switch(u.dispose(),e.key){case Ud.Space:if(""!==i.searchQuery)return e.preventDefault(),e.stopPropagation(),o({type:3,value:e.key});case Ud.Enter:if(e.preventDefault(),e.stopPropagation(),o({type:1}),null!==i.activeItemIndex){let{dataRef:e}=i.items[i.activeItemIndex];null==(n=null==(t=e.current)?void 0:t.domRef.current)||n.click()}ah(i.buttonRef.current);break;case Ud.ArrowDown:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Dv.Next});case Ud.ArrowUp:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Dv.Previous});case Ud.Home:case Ud.PageUp:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Dv.First});case Ud.End:case Ud.PageDown:return e.preventDefault(),e.stopPropagation(),o({type:2,focus:Dv.Last});case Ud.Escape:e.preventDefault(),e.stopPropagation(),o({type:1}),Qd().nextFrame((()=>{var e;return null==(e=i.buttonRef.current)?void 0:e.focus({preventScroll:!0})}));break;case Ud.Tab:e.preventDefault(),e.stopPropagation(),o({type:1}),Qd().nextFrame((()=>{uh(i.buttonRef.current,e.shiftKey?eh.Previous:eh.Next)}));break;default:1===e.key.length&&(o({type:3,value:e.key}),u.setTimeout((()=>o({type:4})),350))}})),p=Pd((e=>{if(e.key===Ud.Space)e.preventDefault()})),m=(0,c.useMemo)((()=>({open:0===i.menuState})),[i]),g=e;return _d({ourProps:{"aria-activedescendant":null===i.activeItemIndex||null==(n=i.items[i.activeItemIndex])?void 0:n.id,"aria-labelledby":null==(r=i.buttonRef.current)?void 0:r.id,id:l,onKeyDown:f,onKeyUp:p,role:"menu",tabIndex:0,ref:a},theirProps:g,slot:m,defaultTag:"div",features:$v,visible:h,name:"Menu.Items"})})),tb=c.Fragment,nb=Cd((function(e,t){let{disabled:n=!1,...r}=e,[i,o]=Jv("Menu.Item"),a=`headlessui-menu-item-${Wd()}`,s=null!==i.activeItemIndex&&i.items[i.activeItemIndex].id===a,l=(0,c.useRef)(null),u=Ld(t,l);Rd((()=>{if(0!==i.menuState||!s||0===i.activationTrigger)return;let e=Qd();return e.requestAnimationFrame((()=>{var e,t;null==(t=null==(e=l.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})})),e.dispose}),[l,s,i.menuState,i.activationTrigger,i.activeItemIndex]);let d=(0,c.useRef)({disabled:n,domRef:l});Rd((()=>{d.current.disabled=n}),[d,n]),Rd((()=>{var e,t;d.current.textValue=null==(t=null==(e=l.current)?void 0:e.textContent)?void 0:t.toLowerCase()}),[d,l]),Rd((()=>(o({type:5,id:a,dataRef:d}),()=>o({type:6,id:a}))),[d,a]);let h=Pd((()=>{o({type:1})})),f=Pd((e=>{if(n)return e.preventDefault();o({type:1}),ah(i.buttonRef.current)})),p=Pd((()=>{if(n)return o({type:2,focus:Dv.Nothing});o({type:2,focus:Dv.Specific,id:a})})),m=Pd((()=>{n||s||o({type:2,focus:Dv.Specific,id:a,trigger:0})})),g=Pd((()=>{n||!s||o({type:2,focus:Dv.Nothing})})),v=(0,c.useMemo)((()=>({active:s,disabled:n,close:h})),[s,n,h]);return _d({ourProps:{id:a,ref:u,role:"menuitem",tabIndex:!0===n?void 0:-1,"aria-disabled":!0===n||void 0,disabled:void 0,onClick:f,onFocus:p,onPointerMove:m,onMouseMove:m,onPointerLeave:g,onMouseLeave:g},theirProps:r,slot:v,defaultTag:tb,name:"Menu.Item"})})),rb=Object.assign(Yv,{Button:Zv,Items:eb,Item:nb});c=o("85Hg2");var ib=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2zM304 456a88 88 0 1 0 0-176 88 88 0 0 0 0 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z"}));c=o("85Hg2");var ob=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0 0 12.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0 0 12.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 0 0 174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}));var ab=({attachmentsMenuOpen:e,setAttachmentsMenuOpen:t,disabled:r=!1})=>n(c).createElement(rb,{as:"div",className:"memori-upload-menu"},n(c).createElement(rb.Button,{disabled:r,className:n(md)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button")},n(c).createElement("div",{className:"memori-button--icon"},n(c).createElement(ob,null))),n(c).createElement(rb.Items,{as:"ul",className:"memori-menu--overlay"},n(c).createElement(rb.Item,{as:"li",className:"memori-menu--li"},n(c).createElement(bd,{className:"memori-menu--button",ghost:!0,icon:n(c).createElement(lm,null),outlined:"link"===e,onClick:()=>t("link")},"Link")),n(c).createElement(rb.Item,null,n(c).createElement(bd,{className:"memori-menu--button",ghost:!0,icon:n(c).createElement(ib,null),outlined:"media"===e,onClick:()=>t("media")},"Media"))));c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2");function sb(e=0){let[t,n]=(0,c.useState)(e),r=(0,c.useCallback)((e=>n((t=>t|e))),[t]),i=(0,c.useCallback)((e=>Boolean(t&e)),[t]),o=(0,c.useCallback)((e=>n((t=>t&~e))),[n]),a=(0,c.useCallback)((e=>n((t=>t^e))),[n]);return{addFlag:r,hasFlag:i,removeFlag:o,toggleFlag:a}}let lb=(0,(c=o("85Hg2")).createContext)(null);function cb(){let e=(0,c.useContext)(lb);if(null===e){let e=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,cb),e}return e}function ub(){let[e,t]=(0,c.useState)([]);return[e.length>0?e.join(" "):void 0,(0,c.useMemo)((()=>function(e){let r=Pd((e=>(t((t=>[...t,e])),()=>t((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,c.useMemo)((()=>({register:r,slot:e.slot,name:e.name,props:e.props})),[r,e.slot,e.name,e.props]);return n(c).createElement(lb.Provider,{value:i},e.children)}),[t])]}let db=Cd((function(e,t){let{passive:n=!1,...r}=e,i=cb(),o=`headlessui-label-${Wd()}`,a=Ld(t);Rd((()=>i.register(o)),[o,i.register]);let s={ref:a,...i.props,id:o};return n&&("onClick"in s&&delete s.onClick,"onClick"in r&&delete r.onClick),_d({ourProps:s,theirProps:r,slot:i.slot||{},defaultTag:"label",name:i.name||"Label"})}));function hb(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))pb(n,fb(t,r),i);return n}function fb(e,t){return e?e+"["+t+"]":t}function pb(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())pb(e,fb(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):"boolean"==typeof n?e.push([t,n?"1":"0"]):"string"==typeof n?e.push([t,n]):"number"==typeof n?e.push([t,`${n}`]):null==n?e.push([t,""]):hb(n,t,e)}function mb(e){var t;let n=null!=(t=null==e?void 0:e.form)?t:e.closest("form");if(n)for(let e of n.elements)if("INPUT"===e.tagName&&"submit"===e.type||"BUTTON"===e.tagName&&"submit"===e.type||"INPUT"===e.nodeName&&"image"===e.type)return void e.click()}c=o("85Hg2");function gb(e,t,n){let[r,i]=(0,c.useState)(n),o=void 0!==e,a=(0,c.useRef)(o),s=(0,c.useRef)(!1),l=(0,c.useRef)(!1);return!o||a.current||s.current?!o&&a.current&&!l.current&&(l.current=!0,a.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")):(s.current=!0,a.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")),[o?e:r,Pd((e=>(o||i(e),null==t?void 0:t(e))))]}var vb,bb=((vb=bb||{})[vb.RegisterOption=0]="RegisterOption",vb[vb.UnregisterOption=1]="UnregisterOption",vb);let yb={0(e,t){let n=[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}];return{...e,options:ch(n,(e=>e.element.current))}},1(e,t){let n=e.options.slice(),r=e.options.findIndex((e=>e.id===t.id));return-1===r?e:(n.splice(r,1),{...e,options:n})}},wb=(0,c.createContext)(null);function Sb(e){let t=(0,c.useContext)(wb);if(null===t){let t=new Error(`<${e} /> is missing a parent <RadioGroup /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Sb),t}return t}function xb(e,t){return yd(t.type,yb,e,t)}wb.displayName="RadioGroupContext";let Mb=Cd((function(e,t){let{value:r,defaultValue:i,name:o,onChange:a,by:s=((e,t)=>e===t),disabled:l=!1,...u}=e,d=Pd("string"==typeof s?(e,t)=>{let n=s;return(null==e?void 0:e[n])===(null==t?void 0:t[n])}:s),[h,f]=(0,c.useReducer)(xb,{options:[]}),p=h.options,[m,g]=ub(),[v,b]=Dh(),y=`headlessui-radiogroup-${Wd()}`,w=(0,c.useRef)(null),S=Ld(w,t),[x,M]=gb(r,a,i),_=(0,c.useMemo)((()=>p.find((e=>!e.propsRef.current.disabled))),[p]),A=(0,c.useMemo)((()=>p.some((e=>d(e.propsRef.current.value,x)))),[p,x]),E=Pd((e=>{var t;if(l||d(e,x))return!1;let n=null==(t=p.find((t=>d(t.propsRef.current.value,e))))?void 0:t.propsRef.current;return(null==n||!n.disabled)&&(null==M||M(e),!0)}));Fv({container:w.current,accept:e=>"radio"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let C=Pd((e=>{let t=w.current;if(!t)return;let n=Xd(t),r=p.filter((e=>!1===e.propsRef.current.disabled)).map((e=>e.element.current));switch(e.key){case Ud.Enter:mb(e.currentTarget);break;case Ud.ArrowLeft:case Ud.ArrowUp:if(e.preventDefault(),e.stopPropagation(),dh(r,eh.Previous|eh.WrapAround)===th.Success){let e=p.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&E(e.propsRef.current.value)}break;case Ud.ArrowRight:case Ud.ArrowDown:if(e.preventDefault(),e.stopPropagation(),dh(r,eh.Next|eh.WrapAround)===th.Success){let e=p.find((e=>e.element.current===(null==n?void 0:n.activeElement)));e&&E(e.propsRef.current.value)}break;case Ud.Space:{e.preventDefault(),e.stopPropagation();let t=p.find((e=>e.element.current===(null==n?void 0:n.activeElement)));t&&E(t.propsRef.current.value)}}})),T=Pd((e=>(f({type:0,...e}),()=>f({type:1,id:e.id})))),I=(0,c.useMemo)((()=>({registerOption:T,firstOption:_,containsCheckedOption:A,change:E,disabled:l,value:x,compare:d})),[T,_,A,E,l,x,d]),k={ref:S,id:y,role:"radiogroup","aria-labelledby":m,"aria-describedby":v,onKeyDown:C},R=(0,c.useMemo)((()=>({value:x})),[x]);return n(c).createElement(b,{name:"RadioGroup.Description"},n(c).createElement(g,{name:"RadioGroup.Label"},n(c).createElement(wb.Provider,{value:I},null!=o&&null!=x&&hb({[o]:x}).map((([e,t])=>n(c).createElement(Kd,{features:qd.Hidden,...Td({key:e,as:"input",type:"radio",checked:null!=t,hidden:!0,readOnly:!0,name:e,value:t})}))),_d({ourProps:k,theirProps:u,slot:R,defaultTag:"div",name:"RadioGroup"}))))}));var _b=(e=>(e[e.Empty=1]="Empty",e[e.Active=2]="Active",e))(_b||{});let Ab=Cd((function(e,t){let r=(0,c.useRef)(null),i=Ld(r,t),o=`headlessui-radiogroup-option-${Wd()}`,[a,s]=ub(),[l,u]=Dh(),{addFlag:d,removeFlag:h,hasFlag:f}=sb(1),{value:p,disabled:m=!1,...g}=e,v=(0,c.useRef)({value:p,disabled:m});Rd((()=>{v.current.value=p}),[p,v]),Rd((()=>{v.current.disabled=m}),[m,v]);let{registerOption:b,disabled:y,change:w,firstOption:S,containsCheckedOption:x,value:M,compare:_}=Sb("RadioGroup.Option");Rd((()=>b({id:o,element:r,propsRef:v})),[o,b,r,e]);let A=Pd((e=>{var t;if(Fd(e.currentTarget))return e.preventDefault();!w(p)||(d(2),null==(t=r.current)||t.focus())})),E=Pd((e=>{if(Fd(e.currentTarget))return e.preventDefault();d(2)})),C=Pd((()=>h(2))),T=(null==S?void 0:S.id)===o,I=y||m,k=_(M,p),R={ref:i,id:o,role:"radio","aria-checked":k?"true":"false","aria-labelledby":a,"aria-describedby":l,"aria-disabled":!!I||void 0,tabIndex:I?-1:k||!x&&T?0:-1,onClick:I?void 0:A,onFocus:I?void 0:E,onBlur:I?void 0:C},O=(0,c.useMemo)((()=>({checked:k,disabled:I,active:f(2)})),[k,I,f]);return n(c).createElement(u,{name:"RadioGroup.Description"},n(c).createElement(s,{name:"RadioGroup.Label"},_d({ourProps:R,theirProps:g,slot:O,defaultTag:"div",name:"RadioGroup.Option"})))})),Eb=Object.assign(Mb,{Option:Ab,Label:db,Description:Uh});var Cb=({sendOnEnter:e,setSendOnEnter:t})=>{const{t:r}=yo();return n(c).createElement(rb,{as:"div",className:"memori-send-on-enter-menu"},n(c).createElement(rb.Button,{className:n(md)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button","memori--conversation-button")},n(c).createElement("div",{className:"memori-button--icon"},"…")),n(c).createElement(rb.Items,{className:"memori-menu--overlay"},n(c).createElement(Eb,{value:e,onChange:t},n(c).createElement(Eb.Option,{value:"keypress",className:"memori-menu--option"},(({checked:e})=>n(c).createElement(rb.Item,null,n(c).createElement(bd,{className:"memori-menu--button",ghost:!0,outlined:e,icon:n(c).createElement("span",{className:"memori-menu--icon"},e?"✓":"")},r("widget.sendOnKeypress"))))),n(c).createElement(Eb.Option,{value:"click",className:"memori-menu--option"},(({checked:e})=>n(c).createElement(rb.Item,null,n(c).createElement(bd,{className:"memori-menu--button",ghost:!0,outlined:e,icon:n(c).createElement("span",{className:"memori-menu--icon"},e?"✓":"")},r("widget.sendOnClick"))))))))};c=o("85Hg2"),c=o("85Hg2");var Tb=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M855 160.1l-189.2 23.5c-6.6.8-9.3 8.8-4.7 13.5l54.7 54.7-153.5 153.5a8.03 8.03 0 0 0 0 11.3l45.1 45.1c3.1 3.1 8.2 3.1 11.3 0l153.6-153.6 54.7 54.7a7.94 7.94 0 0 0 13.5-4.7L863.9 169a7.9 7.9 0 0 0-8.9-8.9zM416.6 562.3a8.03 8.03 0 0 0-11.3 0L251.8 715.9l-54.7-54.7a7.94 7.94 0 0 0-13.5 4.7L160.1 855c-.6 5.2 3.7 9.5 8.9 8.9l189.2-23.5c6.6-.8 9.3-8.8 4.7-13.5l-54.7-54.7 153.6-153.6c3.1-3.1 3.1-8.2 0-11.3l-45.2-45z"}));c=o("85Hg2");var Ib=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M391 240.9c-.8-6.6-8.9-9.4-13.6-4.7l-43.7 43.7L200 146.3a8.03 8.03 0 0 0-11.3 0l-42.4 42.3a8.03 8.03 0 0 0 0 11.3L280 333.6l-43.9 43.9a8.01 8.01 0 0 0 4.7 13.6L401 410c5.1.6 9.5-3.7 8.9-8.9L391 240.9zm10.1 373.2L240.8 633c-6.6.8-9.4 8.9-4.7 13.6l43.9 43.9L146.3 824a8.03 8.03 0 0 0 0 11.3l42.4 42.3c3.1 3.1 8.2 3.1 11.3 0L333.7 744l43.7 43.7A8.01 8.01 0 0 0 391 783l18.9-160.1c.6-5.1-3.7-9.4-8.8-8.8zm221.8-204.2L783.2 391c6.6-.8 9.4-8.9 4.7-13.6L744 333.6 877.7 200c3.1-3.1 3.1-8.2 0-11.3l-42.4-42.3a8.03 8.03 0 0 0-11.3 0L690.3 279.9l-43.7-43.7a8.01 8.01 0 0 0-13.6 4.7L614.1 401c-.6 5.2 3.7 9.5 8.8 8.9zM744 690.4l43.9-43.9a8.01 8.01 0 0 0-4.7-13.6L623 614c-5.1-.6-9.5 3.7-8.9 8.9L633 783.1c.8 6.6 8.9 9.4 13.6 4.7l43.7-43.7L824 877.7c3.1 3.1 8.2 3.1 11.3 0l42.4-42.3c3.1-3.1 3.1-8.2 0-11.3L744 690.4z"}));var kb=({disabled:e=!1,value:t,onChange:r,onPressEnter:i,onFocus:o,onBlur:a})=>{const[s,l]=(0,c.useState)(!1);return n(c).createElement("div",{"data-testid":"chat-textarea",className:n(md)("memori-chat-textarea",{"memori-chat-textarea--expanded":s,"memori-chat-textarea--disabled":e})},n(c).createElement("div",{className:"memori-chat-textarea--inner"},n(c).createElement("textarea",{className:"memori-chat-textarea--input",disabled:e,value:t,onChange:e=>{r(e.target.value)},onKeyDownCapture:e=>{"Enter"===e.key&&!e.shiftKey&&i&&i(e)},onFocus:o,onBlur:a}),n(c).createElement("div",{className:"memori-chat-textarea--expand"},n(c).createElement(bd,{className:n(md)("memori-chat-textarea--expand-button"),onClick:()=>l(!s),padded:!1,ghost:!0,icon:s?n(c).createElement(Ib,null):n(c).createElement(Tb,null)}))))};c=o("85Hg2");var Rb=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M931.4 498.9L94.9 79.5c-3.4-1.7-7.3-2.1-11-1.2-8.5 2.1-13.8 10.7-11.7 19.3l86.2 352.2c1.3 5.3 5.2 9.6 10.4 11.3l147.7 50.7-147.6 50.7c-5.2 1.8-9.1 6-10.3 11.3L72.2 926.5c-.9 3.7-.5 7.6 1.2 10.9 3.9 7.9 13.5 11.1 21.5 7.2l836.5-417c3.1-1.5 5.6-4.1 7.2-7.1 3.9-8 .7-17.6-7.2-21.6zM170.8 826.3l50.3-205.6 295.2-101.3c2.3-.8 4.2-2.6 5-5 1.4-4.2-.8-8.7-5-10.2L221.1 403 171 198.2l628 314.9-628.2 313.2z"}));c=o("85Hg2");var Ob=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",focusable:"false",role:"img",className:e,"aria-label":t},n(c).createElement("path",{d:"M842 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 140.3-113.7 254-254 254S258 594.3 258 454c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8 0 168.7 126.6 307.9 290 327.6V884H326.7c-13.7 0-24.7 14.3-24.7 32v36c0 4.4 2.8 8 6.2 8h407.6c3.4 0 6.2-3.6 6.2-8v-36c0-17.7-11-32-24.7-32H548V782.1c165.3-18 294-158 294-328.1zM512 624c93.9 0 170-75.2 170-168V232c0-92.8-76.1-168-170-168s-170 75.2-170 168v224c0 92.8 76.1 168 170 168zm-94-392c0-50.6 41.9-92 94-92s94 41.4 94 92v224c0 50.6-41.9 92-94 92s-94-41.4-94-92V232z"}));c=o("85Hg2");var Pb=({content:e,className:t,alignLeft:r=!1,disabled:i=!1,visible:o=!1,children:a})=>n(c).createElement("div",{className:n(md)("memori-tooltip",t,{"memori-tooltip--align-left":r,"memori-tooltip--disabled":i,"memori-tooltip--visible":o})},n(c).createElement("div",{className:"memori-tooltip--content"},e),n(c).createElement("div",{className:"memori-tooltip--trigger"},a));var Nb=({dialogState:e,instruct:t=!1,sendOnEnter:r="click",setSendOnEnter:i,attachmentsMenuOpen:o,setAttachmentsMenuOpen:a,userMessage:s="",onChangeUserMessage:l,sendMessage:u,onTextareaFocus:d,onTextareaBlur:h,onTextareaPressEnter:f,showMicrophone:p=!1,listening:m=!1,isPlayingAudio:g=!1,stopAudio:v,startListening:b,stopListening:y})=>{const{t:w}=yo();return n(c).createElement("fieldset",{id:"chat-fieldset",className:"memori-chat-inputs",disabled:"X2a"===(null==e?void 0:e.state)||"X3"===(null==e?void 0:e.state)},t&&n(c).createElement(ab,{attachmentsMenuOpen:o,setAttachmentsMenuOpen:a,disabled:!(null==e?void 0:e.acceptsMedia)}),n(c).createElement(Cb,{sendOnEnter:r,setSendOnEnter:i}),n(c).createElement(kb,{value:s,onChange:l,onPressEnter:f,onFocus:d,onBlur:h,disabled:["R2","R3","R4","G3","X3"].includes((null==e?void 0:e.state)||"")}),n(c).createElement(bd,{shape:"circle",primary:!!(null==s?void 0:s.length),disabled:!s||0===s.length,className:"memori-chat-inputs--send",onClick:()=>u(s),title:w("send")||"Send",icon:n(c).createElement(Rb,null)}),p&&n(c).createElement(Pb,{alignLeft:!0,content:w(m?"write_and_speak.micButtonPopoverListening":"write_and_speak.micButtonPopover")},n(c).createElement(bd,{className:n(md)("memori-chat-inputs--mic",{"memori-chat-inputs--mic--listening":m}),disabled:g,onClick:()=>{m?y():(v(),b())},shape:"circle",icon:n(c).createElement(Ob,null)})))};var Bb=({memori:e,tenant:t,sessionID:r,baseUrl:i,translateTo:o,memoriTyping:a,history:s=[],dialogState:l,simulateUserPrompt:u,showDates:d=!1,showContextPerLine:h=!1,selectReceiverTag:f,preview:p=!1,instruct:m=!1,showInputs:g=!0,showMicrophone:v=!1,sendOnEnter:b,setSendOnEnter:y,attachmentsMenuOpen:w,setAttachmentsMenuOpen:S,userMessage:x="",onChangeUserMessage:M,sendMessage:_,listening:A,isPlayingAudio:E,stopAudio:C,startListening:T,stopListening:I,resetTranscript:k})=>{var R,O,P,N,B;const L=()=>{setTimeout((()=>{var e,t,n,r,i;document.body.classList.contains("chat-focused")?(null===(e=document.querySelector(".ant-tabs-nav"))||void 0===e||e.scrollIntoView(),null===(t=document.querySelector(".memori-chat--content"))||void 0===t||t.scrollTo(0,null!==(r=null===(n=document.querySelector(".memori-chat--content"))||void 0===n?void 0:n.scrollHeight)&&void 0!==r?r:0)):null===(i=document.querySelector("#end-messages-ref"))||void 0===i||i.scrollIntoView({behavior:"smooth"})}),200)};(0,c.useEffect)((()=>{!p&&L()}),[s,p]);return n(c).createElement("div",{className:n(md)("memori-chat--wrapper",{"memori-chat-wrapper--translate":o}),id:"chat-wrapper",lang:null==o?void 0:o.toUpperCase(),"data-memori-lang":null!==(N=null===(P=null===(O=null===(R=e.culture)||void 0===R?void 0:R.split("-"))||void 0===O?void 0:O[0])||void 0===P?void 0:P.toUpperCase())&&void 0!==N?N:"EN"},n(c).createElement("div",{className:n(md)("memori-chat--history",{"memori-chat--history-touch":nm()})},n(c).createElement("div",{className:n(md)("memori-chat--content",{"memori-chat--content-touch":nm()})},n(c).createElement("div",{className:n(md)("memori-chat--cover"),style:{backgroundImage:`url("${im({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:i})}"), url("${im({type:"cover",tenantID:null==t?void 0:t.id,baseURL:i||"https://app.twincreator.com"})}")`}}),s.map(((a,f)=>{var p,m,g,v;return n(c).createElement(n(c).Fragment,{key:f},n(c).createElement(am,{message:a,memori:e,tenant:t,baseUrl:i}),d&&!!a.timestamp&&n(c).createElement("small",{className:"memori-chat--timestamp "+(a.fromUser?"text-right":"text-left")},new Intl.DateTimeFormat("it",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date(a.timestamp.endsWith("Z")?a.timestamp:`${a.timestamp}Z`))),h&&!!Object.keys(null!==(p=a.contextVars)&&void 0!==p?p:{}).length&&n(c).createElement("div",{className:"memori-chat--context-vars"},Object.keys(null!==(m=a.contextVars)&&void 0!==m?m:{}).map((e=>{var t,r,i;return"-"===(null===(t=a.contextVars)||void 0===t?void 0:t[e])?n(c).createElement("div",{className:"memori-chat--context-tag memori-chat--context-tag-canceled",key:e},n(c).createElement("span",{className:"memori-chat--context-tag-text"},e)):"✔️"===(null===(r=a.contextVars)||void 0===r?void 0:r[e])?n(c).createElement("div",{className:"memori-chat--context-tag",key:e},n(c).createElement("span",{className:"memori-chat--context-tag-text"},e)):n(c).createElement("div",{className:"memori-chat--context-tag",key:e},n(c).createElement("span",{className:"memori-chat--context-tag-text"},e,": ",null===(i=a.contextVars)||void 0===i?void 0:i[e]))}))),f===s.length-1&&"R1"===(null==l?void 0:l.state)&&!!(null==l?void 0:l.lastMatchedMemoryID)&&"HIGH"===(null==l?void 0:l.confidenceLevel)&&n(c).createElement("div",{className:"memori-chat--feedback"},n(c).createElement(Pb,{content:"it-IT"===e.culture?"Non è quello che ti ho chiesto":"fr-FR"===e.culture?"Ce n'est pas ce que je t'ai demandé":"It's not what I asked"},n(c).createElement(bd,{ghost:!0,shape:"circle",onClick:()=>u("it-IT"===e.culture?"Non è quello che ti ho chiesto":"fr-FR"===e.culture?"Ce n'est pas ce que je t'ai demandé":"It's not what I asked"),icon:"🤔"}))),n(c).createElement(Lv,{simulateUserPrompt:u,media:null===(g=null==a?void 0:a.media)||void 0===g?void 0:g.filter((e=>"text/html"!==e.mimeType&&"text/plain"!==e.mimeType)),links:null===(v=null==a?void 0:a.media)||void 0===v?void 0:v.filter((e=>"text/html"===e.mimeType)),sessionID:r,baseUrl:i,translateTo:o}))})),a&&n(c).createElement("div",{className:"memori-chat--bubble"},n(c).createElement("div",{id:"wave"},n(c).createElement("span",{className:"dot"}),n(c).createElement("span",{className:"dot"}),n(c).createElement("span",{className:"dot"}))),(null==l?void 0:l.hints)&&l.hints.length>0&&n(c).createElement(Lv,{simulateUserPrompt:u,hints:l.translatedHints?l.translatedHints:l.hints.map((e=>({text:e,originalText:e})))}),n(c).createElement("div",{id:"end-messages-ref"}))),"X3"===(null==l?void 0:l.state)&&r&&n(c).createElement("div",{className:"memori-chat--known-tags"},Object.keys(null!==(B=l.knownTags)&&void 0!==B?B:{}).filter((t=>t!==e.giverTag)).map((e=>{var t;return n(c).createElement(bd,{key:e,icon:n(c).createElement("span",{className:"memori-chat--known-tag-icon"},e),className:"memori-chat--known-tag",onClick:()=>f(e)},null===(t=l.knownTags)||void 0===t?void 0:t[e])}))),g&&n(c).createElement(Nb,{userMessage:x,onChangeUserMessage:M,dialogState:l,instruct:m,sendMessage:_,sendOnEnter:b,setSendOnEnter:y,attachmentsMenuOpen:w,setAttachmentsMenuOpen:S,onTextareaPressEnter:()=>{"keypress"===b&&(null==x?void 0:x.length)>0&&(I(),_(x),M(""),k())},onTextareaFocus:()=>{var e,t;I(),nm()&&window.innerWidth<=768&&(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t||t.add("chat-focused"),setTimeout((()=>{L()}),300))},onTextareaBlur:()=>{var e,t,n;(null===(t=null===(e=document.getElementById("chat-wrapper"))||void 0===e?void 0:e.classList)||void 0===t?void 0:t.contains("chat-focused"))&&(null===(n=document.getElementById("chat-wrapper"))||void 0===n||n.classList.remove("chat-focused"),L())},startListening:T,stopListening:I,stopAudio:C,listening:A,isPlayingAudio:E,showMicrophone:v}))};c=o("85Hg2"),c=o("85Hg2");var Lb=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M140 188h584v164h76V144c0-17.7-14.3-32-32-32H96c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h544v-76H140V188z"}),n(c).createElement("path",{d:"M414.3 256h-60.6c-3.4 0-6.4 2.2-7.6 5.4L219 629.4c-.3.8-.4 1.7-.4 2.6 0 4.4 3.6 8 8 8h55.1c3.4 0 6.4-2.2 7.6-5.4L322 540h196.2L422 261.4c-1.3-3.2-4.3-5.4-7.7-5.4zm12.4 228h-85.5L384 360.2 426.7 484zM936 528H800v-93c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v93H592c-13.3 0-24 10.7-24 24v176c0 13.3 10.7 24 24 24h136v152c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V752h136c13.3 0 24-10.7 24-24V552c0-13.3-10.7-24-24-24zM728 680h-88v-80h88v80zm160 0h-88v-80h88v80z"}));c=o("85Hg2"),c=o("85Hg2");var Db=({className:e,title:t})=>n(c).createElement("svg",{...t?{}:{"aria-hidden":"true"},focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",className:e,"aria-label":t},n(c).createElement("path",{d:"M464 720a48 48 0 1096 0 48 48 0 10-96 0zm16-304v184c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V416c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8zm475.7 440l-416-720c-6.2-10.7-16.9-16-27.7-16s-21.6 5.3-27.7 16l-416 720C56 877.4 71.4 904 96 904h832c24.6 0 40-26.6 27.7-48zm-783.5-27.9L512 239.9l339.8 588.2H172.2z"}));var Ub=({memoriName:e,blockedUntil:t,showGiverInfo:r=!1,showTitle:i=!1,marginLeft:o=!1})=>{const{t:a}=yo(),s=new Date(t);return s>new Date?n(c).createElement(Pb,{className:"blocked-memori-badge--tooltip",content:n(c).createElement(n(c).Fragment,null,!r&&a("memoriBlockedAnon",{name:e,date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(s)}),r&&a("memoriBlockedUntil",{date:new Intl.DateTimeFormat("it",{day:"numeric",month:"long",year:"numeric"}).format(s)}),r&&` ${a("memoriBlockedReasonExceedChats")}`,r&&n(c).createElement("br",null),r&&`\n${a("memoriBlockedGiverHelper")}`)},n(c).createElement("div",{className:"blocked-memori-badge--wrapper"},n(c).createElement("div",{className:"blocked-memori-badge "+(o?" margin-left":"")},n(c).createElement(Db,{className:"blocked-memori-badge--icon"})),i&&n(c).createElement("span",{className:"blocked-memori-badge--title"},a("memoriBlockedTitle")))):null};var Fb=({memori:e,tenant:t,gamificationLevel:r,language:i,userLang:o,setUserLang:a,baseUrl:s,position:l,openPositionDrawer:u,integrationConfig:d,instruct:h=!1,clickedStart:f,onClickStart:p})=>{var m,g;const{t:v,i18n:b}=yo(),[y,w]=(0,c.useState)(e.description),[S,x]=(0,c.useState)(!0);return(0,c.useEffect)((()=>{var t,n,r,o,a,l;(null!==(n=null===(t=b.language)||void 0===t?void 0:t.toUpperCase())&&void 0!==n?n:"IT")!==(null!==(r=null==i?void 0:i.toUpperCase())&&void 0!==r?r:"IT")&&(null===(o=e.description)||void 0===o?void 0:o.length)&&pm(e.description,null!==(l=null===(a=b.language)||void 0===a?void 0:a.toUpperCase())&&void 0!==l?l:"IT",i,s).then((e=>{w(e.text)})).catch(console.error)}),[b.language,i,e.description,s]),n(c).createElement("div",{className:"memori--start-panel"},n(c).createElement("div",{className:"memori--cover",style:{backgroundImage:`url("${im({type:"cover",tenantID:null==t?void 0:t.id,resourceURI:e.coverURL,baseURL:s})}"), url("${im({type:"cover",tenantID:null==t?void 0:t.id,baseURL:s})}")`}},!!(null===(m=null==r?void 0:r.badge)||void 0===m?void 0:m.length)&&n(c).createElement("div",{className:"memori--gamification-badge"},n(c).createElement(Pb,{alignLeft:!0,content:`${v("gamification.level")} ${r.badge}, ${r.points} ${v("gamification.points")}`},n(c).createElement("span",{"aria-label":`${v("gamification.level")} ${r.badge}, ${r.points} ${v("gamification.points")}`},r.badge)))),n(c).createElement("picture",{className:"memori--avatar"},n(c).createElement("source",{src:null!==(g=e.avatarURL)&&void 0!==g?g:im({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:s})}),n(c).createElement("img",{alt:e.name,src:e.avatarURL&&e.avatarURL.length>0?im({type:"avatar",tenantID:null==t?void 0:t.id,resourceURI:e.avatarURL,baseURL:s}):im({type:"avatar",tenantID:null==t?void 0:t.id,baseURL:s})})),n(c).createElement("h2",{className:"memori--title"},e.name),e.needsPosition&&!l&&n(c).createElement("div",{className:"memori--needsPosition"},n(c).createElement("p",null,v("write_and_speak.requirePosition")),n(c).createElement(bd,{primary:!0,onClick:()=>u(),className:"memori--start-button"},v("widget.position"))),(e.needsPosition&&l||!e.needsPosition)&&n(c).createElement("div",{className:"memori--description"},n(c).createElement("p",null,n(c).createElement("span",{className:"memori--description-text"},y&&S?y:e.description),y!==e.description&&n(c).createElement(bd,{ghost:!0,className:"memori--translation-toggle",icon:n(c).createElement(Lb,null),onClick:()=>{x((e=>!e))}},v(S?"showOriginalText":"showTranslatedText"))),(null==d?void 0:d.multilanguage)&&!h&&n(c).createElement("div",{className:"memori--language-chooser"},n(c).createElement("label",{id:"user-lang-pref-label",htmlFor:"user-lang-pref"},v("write_and_speak.iWantToTalkToIn",{name:e.name})),n(c).createElement("select",{id:"user-lang-pref",value:(null!=o?o:b.language).toUpperCase(),"aria-labelledby":"user-lang-pref-label",onChange:e=>{a(e.target.value)}},mm.map((e=>n(c).createElement("option",{key:e.value,value:e.value,"aria-label":e.label},e.label))))),n(c).createElement(bd,{primary:!0,disabled:!!e.blockedUntil&&!e.isGiver,loading:f,onClick:()=>p&&p(),className:"memori--start-button"},v("write_and_speak."+(h?"instructButton":"tryMeButton"))),n(c).createElement("p",{className:"memori--start-description"},v(h?"write_and_speak.pageInstructExplanation":"write_and_speak.pageTryMeExplanation")),!!e.blockedUntil&&n(c).createElement(Ub,{memoriName:e.name,blockedUntil:e.blockedUntil,showGiverInfo:e.isGiver,showTitle:!0,marginLeft:!0})))},zb=(c=o("85Hg2"),c=o("85Hg2"),c=o("85Hg2"),Wi=o("hcaHr"),c=o("85Hg2"),["forwardedRef"]);function jb(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 Hb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jb(Object(r),!0).forEach((function(t){n(qi)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jb(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}class Gb extends c.Component{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:n(c).createElement("div",{style:{background:"rgba(255, 255, 255, 0.4)",color:"#000",padding:"2rem",borderRadius:"10px"}},n(c).createElement("h2",null,this.props.t("error.generic")),n(c).createElement(bd,{primary:!0,onClick:()=>this.setState({hasError:!1})},this.props.t("error.tryAgain")||"Try again")):this.props.children}}var Vb=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(r){function i(i){var o=i.forwardedRef,a=n(Nm)(i,zb),s=yo(e,Hb(Hb({},a),{},{keyPrefix:t.keyPrefix})),l=n(Wi)(s,3),u=l[0],d=l[1],h=l[2],f=Hb(Hb({},a),{},{t:u,i18n:d,tReady:h});return t.withRef&&o?f.ref=o:!t.withRef&&o&&(f.forwardedRef=o),(0,c.createElement)(r,f)}i.displayName="withI18nextTranslation(".concat(mo(r),")"),i.WrappedComponent=r;return t.withRef?(0,c.forwardRef)((function(e,t){return(0,c.createElement)(i,Object.assign({},e,{forwardedRef:t}))})):i}}(["common"])(Gb),Wb=(c=o("85Hg2"),c=o("85Hg2"),{});e(Wb,"REVISION",(()=>qb)),e(Wb,"MOUSE",(()=>Kb)),e(Wb,"TOUCH",(()=>Jb)),e(Wb,"CullFaceNone",(()=>Qb)),e(Wb,"CullFaceBack",(()=>Xb)),e(Wb,"CullFaceFront",(()=>Yb)),e(Wb,"CullFaceFrontBack",(()=>Zb)),e(Wb,"BasicShadowMap",(()=>$b)),e(Wb,"PCFShadowMap",(()=>ey)),e(Wb,"PCFSoftShadowMap",(()=>ty)),e(Wb,"VSMShadowMap",(()=>ny)),e(Wb,"FrontSide",(()=>ry)),e(Wb,"BackSide",(()=>iy)),e(Wb,"DoubleSide",(()=>oy)),e(Wb,"NoBlending",(()=>ay)),e(Wb,"NormalBlending",(()=>sy)),e(Wb,"AdditiveBlending",(()=>ly)),e(Wb,"SubtractiveBlending",(()=>cy)),e(Wb,"MultiplyBlending",(()=>uy)),e(Wb,"CustomBlending",(()=>dy)),e(Wb,"AddEquation",(()=>hy)),e(Wb,"SubtractEquation",(()=>fy)),e(Wb,"ReverseSubtractEquation",(()=>py)),e(Wb,"MinEquation",(()=>my)),e(Wb,"MaxEquation",(()=>gy)),e(Wb,"ZeroFactor",(()=>vy)),e(Wb,"OneFactor",(()=>by)),e(Wb,"SrcColorFactor",(()=>yy)),e(Wb,"OneMinusSrcColorFactor",(()=>wy)),e(Wb,"SrcAlphaFactor",(()=>Sy)),e(Wb,"OneMinusSrcAlphaFactor",(()=>xy)),e(Wb,"DstAlphaFactor",(()=>My)),e(Wb,"OneMinusDstAlphaFactor",(()=>_y)),e(Wb,"DstColorFactor",(()=>Ay)),e(Wb,"OneMinusDstColorFactor",(()=>Ey)),e(Wb,"SrcAlphaSaturateFactor",(()=>Cy)),e(Wb,"NeverDepth",(()=>Ty)),e(Wb,"AlwaysDepth",(()=>Iy)),e(Wb,"LessDepth",(()=>ky)),e(Wb,"LessEqualDepth",(()=>Ry)),e(Wb,"EqualDepth",(()=>Oy)),e(Wb,"GreaterEqualDepth",(()=>Py)),e(Wb,"GreaterDepth",(()=>Ny)),e(Wb,"NotEqualDepth",(()=>By)),e(Wb,"MultiplyOperation",(()=>Ly)),e(Wb,"MixOperation",(()=>Dy)),e(Wb,"AddOperation",(()=>Uy)),e(Wb,"NoToneMapping",(()=>Fy)),e(Wb,"LinearToneMapping",(()=>zy)),e(Wb,"ReinhardToneMapping",(()=>jy)),e(Wb,"CineonToneMapping",(()=>Hy)),e(Wb,"ACESFilmicToneMapping",(()=>Gy)),e(Wb,"CustomToneMapping",(()=>Vy)),e(Wb,"UVMapping",(()=>Wy)),e(Wb,"CubeReflectionMapping",(()=>qy)),e(Wb,"CubeRefractionMapping",(()=>Ky)),e(Wb,"EquirectangularReflectionMapping",(()=>Jy)),e(Wb,"EquirectangularRefractionMapping",(()=>Qy)),e(Wb,"CubeUVReflectionMapping",(()=>Xy)),e(Wb,"RepeatWrapping",(()=>Yy)),e(Wb,"ClampToEdgeWrapping",(()=>Zy)),e(Wb,"MirroredRepeatWrapping",(()=>$y)),e(Wb,"NearestFilter",(()=>ew)),e(Wb,"NearestMipmapNearestFilter",(()=>tw)),e(Wb,"NearestMipMapNearestFilter",(()=>nw)),e(Wb,"NearestMipmapLinearFilter",(()=>rw)),e(Wb,"NearestMipMapLinearFilter",(()=>iw)),e(Wb,"LinearFilter",(()=>ow)),e(Wb,"LinearMipmapNearestFilter",(()=>aw)),e(Wb,"LinearMipMapNearestFilter",(()=>sw)),e(Wb,"LinearMipmapLinearFilter",(()=>lw)),e(Wb,"LinearMipMapLinearFilter",(()=>cw)),e(Wb,"UnsignedByteType",(()=>uw)),e(Wb,"ByteType",(()=>dw)),e(Wb,"ShortType",(()=>hw)),e(Wb,"UnsignedShortType",(()=>fw)),e(Wb,"IntType",(()=>pw)),e(Wb,"UnsignedIntType",(()=>mw)),e(Wb,"FloatType",(()=>gw)),e(Wb,"HalfFloatType",(()=>vw)),e(Wb,"UnsignedShort4444Type",(()=>bw)),e(Wb,"UnsignedShort5551Type",(()=>yw)),e(Wb,"UnsignedInt248Type",(()=>ww)),e(Wb,"AlphaFormat",(()=>Sw)),e(Wb,"RGBFormat",(()=>xw)),e(Wb,"RGBAFormat",(()=>Mw)),e(Wb,"LuminanceFormat",(()=>_w)),e(Wb,"LuminanceAlphaFormat",(()=>Aw)),e(Wb,"DepthFormat",(()=>Ew)),e(Wb,"DepthStencilFormat",(()=>Cw)),e(Wb,"RedFormat",(()=>Tw)),e(Wb,"RedIntegerFormat",(()=>Iw)),e(Wb,"RGFormat",(()=>kw)),e(Wb,"RGIntegerFormat",(()=>Rw)),e(Wb,"RGBAIntegerFormat",(()=>Ow)),e(Wb,"RGB_S3TC_DXT1_Format",(()=>Pw)),e(Wb,"RGBA_S3TC_DXT1_Format",(()=>Nw)),e(Wb,"RGBA_S3TC_DXT3_Format",(()=>Bw)),e(Wb,"RGBA_S3TC_DXT5_Format",(()=>Lw)),e(Wb,"RGB_PVRTC_4BPPV1_Format",(()=>Dw)),e(Wb,"RGB_PVRTC_2BPPV1_Format",(()=>Uw)),e(Wb,"RGBA_PVRTC_4BPPV1_Format",(()=>Fw)),e(Wb,"RGBA_PVRTC_2BPPV1_Format",(()=>zw)),e(Wb,"RGB_ETC1_Format",(()=>jw)),e(Wb,"RGB_ETC2_Format",(()=>Hw)),e(Wb,"RGBA_ETC2_EAC_Format",(()=>Gw)),e(Wb,"RGBA_ASTC_4x4_Format",(()=>Vw)),e(Wb,"RGBA_ASTC_5x4_Format",(()=>Ww)),e(Wb,"RGBA_ASTC_5x5_Format",(()=>qw)),e(Wb,"RGBA_ASTC_6x5_Format",(()=>Kw)),e(Wb,"RGBA_ASTC_6x6_Format",(()=>Jw)),e(Wb,"RGBA_ASTC_8x5_Format",(()=>Qw)),e(Wb,"RGBA_ASTC_8x6_Format",(()=>Xw)),e(Wb,"RGBA_ASTC_8x8_Format",(()=>Yw)),e(Wb,"RGBA_ASTC_10x5_Format",(()=>Zw)),e(Wb,"RGBA_ASTC_10x6_Format",(()=>$w)),e(Wb,"RGBA_ASTC_10x8_Format",(()=>eS)),e(Wb,"RGBA_ASTC_10x10_Format",(()=>tS)),e(Wb,"RGBA_ASTC_12x10_Format",(()=>nS)),e(Wb,"RGBA_ASTC_12x12_Format",(()=>rS)),e(Wb,"RGBA_BPTC_Format",(()=>iS)),e(Wb,"LoopOnce",(()=>oS)),e(Wb,"LoopRepeat",(()=>aS)),e(Wb,"LoopPingPong",(()=>sS)),e(Wb,"InterpolateDiscrete",(()=>lS)),e(Wb,"InterpolateLinear",(()=>cS)),e(Wb,"InterpolateSmooth",(()=>uS)),e(Wb,"ZeroCurvatureEnding",(()=>dS)),e(Wb,"ZeroSlopeEnding",(()=>hS)),e(Wb,"WrapAroundEnding",(()=>fS)),e(Wb,"NormalAnimationBlendMode",(()=>pS)),e(Wb,"AdditiveAnimationBlendMode",(()=>mS)),e(Wb,"TrianglesDrawMode",(()=>gS)),e(Wb,"TriangleStripDrawMode",(()=>vS)),e(Wb,"TriangleFanDrawMode",(()=>bS)),e(Wb,"LinearEncoding",(()=>yS)),e(Wb,"sRGBEncoding",(()=>wS)),e(Wb,"BasicDepthPacking",(()=>SS)),e(Wb,"RGBADepthPacking",(()=>xS)),e(Wb,"TangentSpaceNormalMap",(()=>MS)),e(Wb,"ObjectSpaceNormalMap",(()=>_S)),e(Wb,"NoColorSpace",(()=>AS)),e(Wb,"SRGBColorSpace",(()=>ES)),e(Wb,"LinearSRGBColorSpace",(()=>CS)),e(Wb,"ZeroStencilOp",(()=>TS)),e(Wb,"KeepStencilOp",(()=>IS)),e(Wb,"ReplaceStencilOp",(()=>kS)),e(Wb,"IncrementStencilOp",(()=>RS)),e(Wb,"DecrementStencilOp",(()=>OS)),e(Wb,"IncrementWrapStencilOp",(()=>PS)),e(Wb,"DecrementWrapStencilOp",(()=>NS)),e(Wb,"InvertStencilOp",(()=>BS)),e(Wb,"NeverStencilFunc",(()=>LS)),e(Wb,"LessStencilFunc",(()=>DS)),e(Wb,"EqualStencilFunc",(()=>US)),e(Wb,"LessEqualStencilFunc",(()=>FS)),e(Wb,"GreaterStencilFunc",(()=>zS)),e(Wb,"NotEqualStencilFunc",(()=>jS)),e(Wb,"GreaterEqualStencilFunc",(()=>HS)),e(Wb,"AlwaysStencilFunc",(()=>GS)),e(Wb,"StaticDrawUsage",(()=>VS)),e(Wb,"DynamicDrawUsage",(()=>WS)),e(Wb,"StreamDrawUsage",(()=>qS)),e(Wb,"StaticReadUsage",(()=>KS)),e(Wb,"DynamicReadUsage",(()=>JS)),e(Wb,"StreamReadUsage",(()=>QS)),e(Wb,"StaticCopyUsage",(()=>XS)),e(Wb,"DynamicCopyUsage",(()=>YS)),e(Wb,"StreamCopyUsage",(()=>ZS)),e(Wb,"GLSL1",(()=>$S)),e(Wb,"GLSL3",(()=>ex)),e(Wb,"_SRGBAFormat",(()=>tx)),e(Wb,"EventDispatcher",(()=>nx)),e(Wb,"MathUtils",(()=>gx)),e(Wb,"Vector2",(()=>vx)),e(Wb,"Matrix3",(()=>bx)),e(Wb,"ColorManagement",(()=>Ex)),e(Wb,"Color",(()=>Px)),e(Wb,"ImageUtils",(()=>Bx)),e(Wb,"Source",(()=>Lx)),e(Wb,"Texture",(()=>Fx)),e(Wb,"Vector4",(()=>zx)),e(Wb,"WebGLRenderTarget",(()=>jx)),e(Wb,"DataArrayTexture",(()=>Hx)),e(Wb,"WebGLArrayRenderTarget",(()=>Gx)),e(Wb,"Data3DTexture",(()=>Vx)),e(Wb,"WebGL3DRenderTarget",(()=>Wx)),e(Wb,"WebGLMultipleRenderTargets",(()=>qx)),e(Wb,"Quaternion",(()=>Kx)),e(Wb,"Vector3",(()=>Jx)),e(Wb,"Box3",(()=>Yx)),e(Wb,"Sphere",(()=>gM)),e(Wb,"Ray",(()=>_M)),e(Wb,"Matrix4",(()=>AM)),e(Wb,"Euler",(()=>BM)),e(Wb,"Layers",(()=>LM)),e(Wb,"Object3D",(()=>XM)),e(Wb,"Triangle",(()=>s_)),e(Wb,"Material",(()=>c_)),e(Wb,"MeshBasicMaterial",(()=>u_)),e(Wb,"BufferAttribute",(()=>f_)),e(Wb,"Int8BufferAttribute",(()=>p_)),e(Wb,"Uint8BufferAttribute",(()=>m_)),e(Wb,"Uint8ClampedBufferAttribute",(()=>g_)),e(Wb,"Int16BufferAttribute",(()=>v_)),e(Wb,"Uint16BufferAttribute",(()=>b_)),e(Wb,"Int32BufferAttribute",(()=>y_)),e(Wb,"Uint32BufferAttribute",(()=>w_)),e(Wb,"Float16BufferAttribute",(()=>S_)),e(Wb,"Float32BufferAttribute",(()=>x_)),e(Wb,"Float64BufferAttribute",(()=>M_)),e(Wb,"BufferGeometry",(()=>R_)),e(Wb,"Mesh",(()=>Q_)),e(Wb,"BoxGeometry",(()=>Y_)),e(Wb,"UniformsUtils",(()=>eA)),e(Wb,"ShaderMaterial",(()=>tA)),e(Wb,"Camera",(()=>nA)),e(Wb,"PerspectiveCamera",(()=>rA)),e(Wb,"CubeCamera",(()=>oA)),e(Wb,"CubeTexture",(()=>aA)),e(Wb,"WebGLCubeRenderTarget",(()=>sA)),e(Wb,"Plane",(()=>dA)),e(Wb,"Frustum",(()=>pA)),e(Wb,"PlaneGeometry",(()=>vA)),e(Wb,"ShaderChunk",(()=>bA)),e(Wb,"UniformsLib",(()=>yA)),e(Wb,"ShaderLib",(()=>wA)),e(Wb,"OrthographicCamera",(()=>CA)),e(Wb,"PMREMGenerator",(()=>LA)),e(Wb,"MeshDepthMaterial",(()=>OC)),e(Wb,"MeshDistanceMaterial",(()=>PC)),e(Wb,"WebGLUtils",(()=>DC)),e(Wb,"ArrayCamera",(()=>UC)),e(Wb,"Group",(()=>FC)),e(Wb,"DepthTexture",(()=>HC)),e(Wb,"WebGLRenderer",(()=>qC)),e(Wb,"WebGL1Renderer",(()=>KC)),e(Wb,"FogExp2",(()=>JC)),e(Wb,"Fog",(()=>QC)),e(Wb,"Scene",(()=>XC)),e(Wb,"InterleavedBuffer",(()=>YC)),e(Wb,"InterleavedBufferAttribute",(()=>$C)),e(Wb,"SpriteMaterial",(()=>eT)),e(Wb,"Sprite",(()=>pT)),e(Wb,"LOD",(()=>bT)),e(Wb,"SkinnedMesh",(()=>_T)),e(Wb,"Bone",(()=>AT)),e(Wb,"DataTexture",(()=>ET)),e(Wb,"Skeleton",(()=>IT)),e(Wb,"InstancedBufferAttribute",(()=>kT)),e(Wb,"InstancedMesh",(()=>BT)),e(Wb,"LineBasicMaterial",(()=>LT)),e(Wb,"Line",(()=>HT)),e(Wb,"LineSegments",(()=>WT)),e(Wb,"LineLoop",(()=>qT)),e(Wb,"PointsMaterial",(()=>KT)),e(Wb,"Points",(()=>ZT)),e(Wb,"VideoTexture",(()=>eI)),e(Wb,"FramebufferTexture",(()=>tI)),e(Wb,"CompressedTexture",(()=>nI)),e(Wb,"CanvasTexture",(()=>rI)),e(Wb,"Curve",(()=>iI)),e(Wb,"EllipseCurve",(()=>oI)),e(Wb,"ArcCurve",(()=>aI)),e(Wb,"CatmullRomCurve3",(()=>hI)),e(Wb,"CubicBezierCurve",(()=>gI)),e(Wb,"CubicBezierCurve3",(()=>vI)),e(Wb,"LineCurve",(()=>bI)),e(Wb,"LineCurve3",(()=>yI)),e(Wb,"QuadraticBezierCurve",(()=>wI)),e(Wb,"QuadraticBezierCurve3",(()=>SI)),e(Wb,"SplineCurve",(()=>xI)),e(Wb,"CurvePath",(()=>_I)),e(Wb,"Path",(()=>AI)),e(Wb,"LatheGeometry",(()=>EI)),e(Wb,"CapsuleGeometry",(()=>CI)),e(Wb,"CircleGeometry",(()=>TI)),e(Wb,"CylinderGeometry",(()=>II)),e(Wb,"ConeGeometry",(()=>kI)),e(Wb,"PolyhedronGeometry",(()=>RI)),e(Wb,"DodecahedronGeometry",(()=>OI)),e(Wb,"EdgesGeometry",(()=>DI)),e(Wb,"Shape",(()=>UI)),e(Wb,"ShapeUtils",(()=>uk)),e(Wb,"ExtrudeGeometry",(()=>fk)),e(Wb,"IcosahedronGeometry",(()=>mk)),e(Wb,"OctahedronGeometry",(()=>gk)),e(Wb,"RingGeometry",(()=>vk)),e(Wb,"ShapeGeometry",(()=>bk)),e(Wb,"SphereGeometry",(()=>yk)),e(Wb,"TetrahedronGeometry",(()=>wk)),e(Wb,"TorusGeometry",(()=>Sk)),e(Wb,"TorusKnotGeometry",(()=>xk)),e(Wb,"TubeGeometry",(()=>Mk)),e(Wb,"WireframeGeometry",(()=>_k)),e(Wb,"ShadowMaterial",(()=>Ck)),e(Wb,"RawShaderMaterial",(()=>Tk)),e(Wb,"MeshStandardMaterial",(()=>Ik)),e(Wb,"MeshPhysicalMaterial",(()=>kk)),e(Wb,"MeshPhongMaterial",(()=>Rk)),e(Wb,"MeshToonMaterial",(()=>Ok)),e(Wb,"MeshNormalMaterial",(()=>Pk)),e(Wb,"MeshLambertMaterial",(()=>Nk)),e(Wb,"MeshMatcapMaterial",(()=>Bk)),e(Wb,"LineDashedMaterial",(()=>Lk)),e(Wb,"AnimationUtils",(()=>Gk)),e(Wb,"Interpolant",(()=>Vk)),e(Wb,"CubicInterpolant",(()=>Wk)),e(Wb,"LinearInterpolant",(()=>qk)),e(Wb,"DiscreteInterpolant",(()=>Kk)),e(Wb,"KeyframeTrack",(()=>Jk)),e(Wb,"BooleanKeyframeTrack",(()=>Qk)),e(Wb,"ColorKeyframeTrack",(()=>Xk)),e(Wb,"NumberKeyframeTrack",(()=>Yk)),e(Wb,"QuaternionLinearInterpolant",(()=>Zk)),e(Wb,"QuaternionKeyframeTrack",(()=>$k)),e(Wb,"StringKeyframeTrack",(()=>eR)),e(Wb,"VectorKeyframeTrack",(()=>tR)),e(Wb,"AnimationClip",(()=>nR)),e(Wb,"Cache",(()=>iR)),e(Wb,"LoadingManager",(()=>oR)),e(Wb,"DefaultLoadingManager",(()=>aR)),e(Wb,"Loader",(()=>sR)),e(Wb,"FileLoader",(()=>uR)),e(Wb,"AnimationLoader",(()=>dR)),e(Wb,"CompressedTextureLoader",(()=>hR)),e(Wb,"ImageLoader",(()=>fR)),e(Wb,"CubeTextureLoader",(()=>pR)),e(Wb,"DataTextureLoader",(()=>mR)),e(Wb,"TextureLoader",(()=>gR)),e(Wb,"Light",(()=>vR)),e(Wb,"HemisphereLight",(()=>bR)),e(Wb,"SpotLight",(()=>_R)),e(Wb,"PointLight",(()=>IR)),e(Wb,"DirectionalLight",(()=>RR)),e(Wb,"AmbientLight",(()=>OR)),e(Wb,"RectAreaLight",(()=>PR)),e(Wb,"SphericalHarmonics3",(()=>NR)),e(Wb,"LightProbe",(()=>BR)),e(Wb,"MaterialLoader",(()=>LR)),e(Wb,"LoaderUtils",(()=>DR)),e(Wb,"InstancedBufferGeometry",(()=>UR)),e(Wb,"BufferGeometryLoader",(()=>FR)),e(Wb,"ObjectLoader",(()=>zR)),e(Wb,"ImageBitmapLoader",(()=>VR)),e(Wb,"AudioContext",(()=>qR)),e(Wb,"AudioLoader",(()=>KR)),e(Wb,"HemisphereLightProbe",(()=>JR)),e(Wb,"AmbientLightProbe",(()=>QR)),e(Wb,"StereoCamera",(()=>$R)),e(Wb,"Clock",(()=>eO)),e(Wb,"AudioListener",(()=>aO)),e(Wb,"Audio",(()=>sO)),e(Wb,"PositionalAudio",(()=>hO)),e(Wb,"AudioAnalyser",(()=>fO)),e(Wb,"PropertyMixer",(()=>pO)),e(Wb,"PropertyBinding",(()=>SO)),e(Wb,"AnimationObjectGroup",(()=>xO)),e(Wb,"AnimationMixer",(()=>AO)),e(Wb,"Uniform",(()=>EO)),e(Wb,"UniformsGroup",(()=>TO)),e(Wb,"InstancedInterleavedBuffer",(()=>IO)),e(Wb,"GLBufferAttribute",(()=>kO)),e(Wb,"Raycaster",(()=>RO)),e(Wb,"Spherical",(()=>NO)),e(Wb,"Cylindrical",(()=>BO)),e(Wb,"Box2",(()=>DO)),e(Wb,"Line3",(()=>zO)),e(Wb,"SpotLightHelper",(()=>HO)),e(Wb,"SkeletonHelper",(()=>qO)),e(Wb,"PointLightHelper",(()=>JO)),e(Wb,"HemisphereLightHelper",(()=>ZO)),e(Wb,"GridHelper",(()=>$O)),e(Wb,"PolarGridHelper",(()=>eP)),e(Wb,"DirectionalLightHelper",(()=>iP)),e(Wb,"CameraHelper",(()=>sP)),e(Wb,"BoxHelper",(()=>uP)),e(Wb,"Box3Helper",(()=>dP)),e(Wb,"PlaneHelper",(()=>hP)),e(Wb,"ArrowHelper",(()=>gP)),e(Wb,"AxesHelper",(()=>vP)),e(Wb,"ShapePath",(()=>bP)),e(Wb,"DataUtils",(()=>SP)),e(Wb,"ImmediateRenderObject",(()=>xP)),e(Wb,"WebGLMultisampleRenderTarget",(()=>MP)),e(Wb,"DataTexture2DArray",(()=>_P)),e(Wb,"DataTexture3D",(()=>AP)),e(Wb,"BoxBufferGeometry",(()=>EP)),e(Wb,"CapsuleBufferGeometry",(()=>CP)),e(Wb,"CircleBufferGeometry",(()=>TP)),e(Wb,"ConeBufferGeometry",(()=>IP)),e(Wb,"CylinderBufferGeometry",(()=>kP)),e(Wb,"DodecahedronBufferGeometry",(()=>RP)),e(Wb,"ExtrudeBufferGeometry",(()=>OP)),e(Wb,"IcosahedronBufferGeometry",(()=>PP)),e(Wb,"LatheBufferGeometry",(()=>NP)),e(Wb,"OctahedronBufferGeometry",(()=>BP)),e(Wb,"PlaneBufferGeometry",(()=>LP)),e(Wb,"PolyhedronBufferGeometry",(()=>DP)),e(Wb,"RingBufferGeometry",(()=>UP)),e(Wb,"ShapeBufferGeometry",(()=>FP)),e(Wb,"SphereBufferGeometry",(()=>zP)),e(Wb,"TetrahedronBufferGeometry",(()=>jP)),e(Wb,"TorusBufferGeometry",(()=>HP)),e(Wb,"TorusKnotBufferGeometry",(()=>GP)),e(Wb,"TubeBufferGeometry",(()=>VP));
68
68
  /**
69
69
  * @license
70
70
  * Copyright 2010-2022 Three.js Authors
@@ -75,4 +75,4 @@ const qb="144",Kb={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Jb={ROTATE:0,
75
75
  * @license qrcode.react
76
76
  * Copyright (c) Paul O'Shannessy
77
77
  * SPDX-License-Identifier: ISC
78
- */function hU(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,a){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${a-i}v1H${i+t}z`),void(i=null);if(a!==e.length-1)o&&null===i&&(i=a);else{if(!o)return;null===i?n.push(`M${a+t},${r+t} h1v1H${a+t}z`):n.push(`M${i+t},${r+t} h${a+1-i}v1H${i+t}z`)}}))})),n.join("")}function fU(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function pU(e,t,n,r){if(null==r)return null;const i=n?4:0,o=e.length+2*i,a=Math.floor(.1*t),s=o/t,l=(r.width||a)*s,c=(r.height||a)*s,u=null==r.x?e.length/2-l/2:r.x*s,d=null==r.y?e.length/2-c/2:r.y*s;let h=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);h={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:h}}var mU=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function gU(e){const t=e,{value:r,size:i=sU,level:o=lU,bgColor:a=cU,fgColor:s=uU,includeMargin:l=dU,style:u,imageSettings:d}=t,h=iU(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),f=null==d?void 0:d.src,p=(0,c.useRef)(null),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1);(0,c.useEffect)((()=>{if(null!=p.current){const e=p.current,t=e.getContext("2d");if(!t)return;let n=oU.QrCode.encodeText(r,aU[o]).getModules();const c=l?4:0,u=n.length+2*c,h=pU(n,i,l,d),f=m.current,g=null!=h&&null!==f&&f.complete&&0!==f.naturalHeight&&0!==f.naturalWidth;g&&null!=h.excavation&&(n=fU(n,h.excavation));const v=window.devicePixelRatio||1;e.height=e.width=i*v;const b=i/u*v;t.scale(b,b),t.fillStyle=a,t.fillRect(0,0,u,u),t.fillStyle=s,mU?t.fill(new Path2D(hU(n,c))):n.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),g&&t.drawImage(f,h.x+c,h.y+c,h.w,h.h)}})),(0,c.useEffect)((()=>{v(!1)}),[f]);const b=rU({height:i,width:i},u);let y=null;return null!=f&&(y=n(c).createElement("img",{src:f,key:f,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),n(c).createElement(n(c).Fragment,null,n(c).createElement("canvas",rU({style:b,height:i,width:i,ref:p},h)),y)}var vU=({url:e,title:t="",className:r,baseUrl:i,primary:o=!0,showQrCode:a=!0,align:s="right"})=>{const{t:l}=yo(),[u,d]=(0,c.useState)(e);(0,c.useEffect)((()=>{e||d(window.location.href)}),[e]);const h=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${u}`,icon:GD},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${u}`,icon:VD},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${t}&url=${u}`,icon:WD},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${u}`,icon:qD},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${t}&url=${u}`,icon:YD},{id:"email",title:"Email",url:`mailto:?subject=${(null==t?void 0:t.length)>0?t:e}&body=${u}`,icon:KD}];return n(c).createElement(rb,{as:"div",className:n(md)("memori-share-button",{"memori-share-button--align-left":"left"===s})},n(c).createElement(rb.Button,{className:n(md)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",r,{"memori-button--primary":o}),title:l("widget.share")||void 0},n(c).createElement("div",{className:"memori-button--icon"},n(c).createElement(JD,null))),n(c).createElement(rb.Items,{className:"memori-share-button--overlay",as:"ul"},n(c).createElement(rb.Item,{key:"copy",as:"li",className:"memori-share-button--li"},n(c).createElement(bd,{className:"memori-share-button--link",ghost:!0,icon:n(c).createElement(lm,null),onClick:()=>{u&&navigator.clipboard.writeText(u)}},l("copyToClipboard")||void 0)),h.map((e=>{var t;return n(c).createElement(rb.Item,{key:e.id,as:"li",className:"memori-share-button--li"},n(c).createElement("a",{className:n(md)("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:null!==(t=e.url)&&void 0!==t?t:"",target:"_blank",rel:"noopener noreferrer"},n(c).createElement("div",{className:"memori-button--icon"},n(c).createElement(e.icon,null)),e.title))})),a&&n(c).createElement(rb.Item,{key:"qrcode",as:"li",className:"memori-share-button--li-qr-code"},n(c).createElement(gU,{id:"qr-canvas",value:null!=u?u:"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:`${i||"https://app.twincreator.com"}/images/memori_logo.png`,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),n(c).createElement("div",null,n(c).createElement(bd,{onClick:()=>{const e=document.getElementById("qr-canvas");if(console.log(),!e)return;const n=document.createElement("a");n.href=e.toDataURL(),n.download=`memori-${t}-share.png`,document.body.appendChild(n),n.click(),document.body.removeChild(n)},icon:n(c).createElement(QD,null),title:"Download QR"},"Download")))))};var bU=({className:e,memori:t,history:r,position:i,setShowPositionDrawer:o,setShowSettingsDrawer:a,speakerMuted:s,setSpeakerMuted:l,hasUserActivatedSpeak:u=!1,showShare:d=!0,showSettings:h=!0})=>{const{t:f}=yo();return n(c).createElement("div",{className:n(md)("memori-header",e)},t.needsPosition&&i&&n(c).createElement("div",{className:"memori-header--position"},n(c).createElement("span",{className:"memori-header--position-placeName"},i.placeName),n(c).createElement(bd,{icon:n(c).createElement(vD,null),shape:"circle",className:"memori-header--button",onClick:()=>o(!0)})),n(c).createElement(bd,{primary:!0,shape:"circle",className:"memori-header--button",icon:s?n(c).createElement(bD,null):n(c).createElement(wD,null),onClick:()=>l(!s),title:f("widget.sound")||"Sound"}),n(c).createElement(jD,{history:r,memori:t,className:"memori-header--button",disabled:!u||0===r.length}),h&&n(c).createElement(bd,{primary:!0,shape:"circle",className:"memori-header--button",icon:n(c).createElement(HD,null),onClick:()=>a(!0),title:f("widget.settings")||"Settings"}),d&&n(c).createElement(vU,{className:"memori-header--button",title:t.name,showQrCode:!0,align:"left"}))};c=o("85Hg2");var yU=({header:e,avatar:t,chat:r,startPanel:i,integrationStyle:o,integrationBackground:a,changeMode:s,sessionId:l,hasUserActivatedSpeak:u,showInstruct:d=!1,loading:h=!1})=>n(c).createElement(n(c).Fragment,null,o,a,n(c).createElement(Rf,{spinning:h},d&&s,e,n(c).createElement("div",{className:"memori--grid"},n(c).createElement("div",{className:"memori--grid-column memori--grid-column-left"},t),n(c).createElement("div",{className:"memori--grid-column memori--grid-column-right"},l&&u?r:i))));const wU={muteSpeaker:"@memori:muteSpeaker",continuousSpeech:"@memori:continuousSpeech",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter"},SU=(e,t)=>{var n;const r=window.localStorage.getItem(null!==(n=wU[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}},xU=(e,t)=>{var n;window.localStorage.setItem(null!==(n=wU[e])&&void 0!==n?n:e,t.toString())},MU=new Map(Object.entries({TENANT_NOT_FOUND:-1,TENANT_REGISTRATION_DISABLED:-2,TENANT_MISSING_NAME:-3,TENANT_MAX_USERS_REACHED:-4,TENANT_MAX_ADMINS_REACHED:-5,USER_NOT_CONFIRMED:-11,USER_NOT_FOUND:-12,USER_OR_PASSWORD_INVALID:-13,USER_MUST_CHANGE_PASSWORD:-14,USER_MUST_ENTER_VERIFICATION_CODE:-15,USER_MISSING_TENANT:-21,USER_MISSING_NAME:-22,USER_MISSING_PASSWORD:-23,USER_MISSING_EMAIL:-24,USER_MISSING_VERIFICATION_CODE:-25,USER_NAME_ALREADY_USED:-26,USER_PASSWORD_NOT_CONFORMING_TO_POLICY:-27,USER_EMAIL_ALREADY_USED:-28,USER_EMAIL_INVALID:-29,USER_VERIFICATION_CODE_INVALID:-30,USER_MISSING_NAME_OR_EMAIL:-31,USER_NAME_INVALID:-32,USER_HAS_ONE_OR_MORE_MEMORI:-33,USER_MISSING_NEW_PASSWORD:-34,USER_CANT_CREATE_MEMORI:-35,USER_MAX_MEMORI_REACHED:-36,USER_CANT_EDIT_INTEGRATIONS:-37,MEMORI_NOT_FOUND:-51,MEMORI_NOT_ACCESSIBLE:-52,MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN:-53,SESSION_NOT_FOUND:-101,SESSION_IS_NOT_ADMINISTRATIVE:-102,MEMORI_MISSING_CONFIGURATION:-201,MEMORI_CONFIGURATION_NOT_FOUND:-202,MEMORI_INVALID_PRIVACY_TYPE:-203,MEMORI_MISSING_PASSWORD:-204,MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS:-205,MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS:-206,MEMORI_INVALID_VOICE_TYPE:-207,MEMORI_MISSING_NAME:-208,MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS:-209,MEMORI_INVALID_ID:-210,MEMORI_NAME_ALREADY_USED:-211,MEMORI_INVALID_PIN:-212,MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION:-213,MEMORI_NO_PASSWORD_WHEN_PUBLIC:-214,MEMORI_TRANSFER_MISSING_DESTINATION_USER:-231,MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID:-232,MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT:-233,MEMORI_TRANSFER_NOTHING_TO_DO:-234,MEMORI_CONFIGURATION_CANT_BE_CHANGED:-251,MEMORI_MISSING_NEW_PASSWORD:-252,MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT:-261,MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT:-262,INTEGRATION_NOT_FOUND:-301,INTEGRATION_INVALID_TYPE:-401,INTEGRATION_ALREADY_EXISTS:-402,INTEGRATION_MEMORI_IS_NOT_PUBLIC:-403,INTEGRATION_MISSING_INVOCATION_TEXT:-404,INTEGRATION_MISSING_DEVICE_EMAILS:-405,INTEGRATION_MEMORI_IS_EMPTY:-406,INTEGRATION_MISSING_PRIVACY_POLICY:-407,INTEGRATION_MISSING_CATEGORY:-408,INTEGRATION_MISSING_DESCRIPTION:-409,INTEGRATION_INVALID_INVOCATION_TEXT:-410,INTEGRATION_GOOGLE_NO_MORE_AVAILABLE:-411,UPLOAD_REQUIRES_MULTIPART_ENCODING:-501,UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY:-502,UPLOAD_MAX_LENGTH_EXCEEDED:-503,UPLOAD_FILE_IS_EMPTY:-504,UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE:-505,UPLOAD_MISSING_FILE_NAME:-506,UPLOAD_INVALID_MEMORY_ID:-507,UPLOAD_MISSING_FILE_CONTENT:-508,ASSET_NOT_FOUND:-601,ASSET_NOT_ACCESSIBLE:-602,ASSET_MISSING_SESSION_ID:-603,ASSET_INVALID_FILE_NAME:-604,INVITATION_NOT_FOUND:-701,INVITATION_NOT_ACCESSIBLE:-702,INVITATION_ALREADY_ACCEPTED:-703,INVITATION_ALREADY_REJECTED:-704,INVITATION_MISSING_DESTINATION_EMAIL:-705,INVITATION_DESTINATION_EMAIL_INVALID:-706,INVITATION_MISSING_TAG:-707,INVITATION_MISSING_PIN:-708,INVITATION_INVALID_PIN:-709,INVITATION_INVALID_TYPE:-710,INVITATION_MISSING_DESTINATION_NAME:-711,INVITATION_TAG_PIN_CANT_BE_CHANGED:-712,INVITATION_CANT_BE_CHANGED:-713,ACTIONLOG_INVALID_USER_ID:-801,ACTIONLOG_INVALID_DATE_FROM_FORMAT:-802,ACTIONLOG_INVALID_DATE_TO_FORMAT:-803,ACTIONLOG_INVALID_MEMORI_ID:-804,CONSUMPTIONLOG_INVALID_TYPE:-901,CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT:-902,CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT:-903,CONSUMPTIONLOG_INVALID_USER_ID:-904,CONSUMPTIONLOG_INVALID_MEMORI_ID:-905}).map((([e,t])=>[t,e]))),_U=e=>{if(!e)return"error.generic";if(401===e||403===e)return"error.unauthorized";if(404===e)return"error.notFound";if(422===e)return"error.unprocessableEntity";if(500===e)return"internal server error";let t=MU.get(e);return t?`errors.${t}`:"error.generic"},{deleteSession:AU,getStatistics:EU,initSession:CU}=Vi(),TU=new Map([[0,"🆕"],[10,"🐹"],[20,"🐇"],[30,"🐰"],[40,"💡"],[50,"🏆"],[60,"🏅"],[70,"🥉"],[80,"🥈"],[90,"🥇"],[100,"🔥"],[110,"🎓"],[120,"🤖"],[130,"👾"],[150,"🌍"],[180,"💜"],[200,"💙"],[250,"🧡"],[300,"💚"],[350,"💛"],[400,"💖"],[450,"💝"],[500,"🖤"],[550,"❤️"],[600,"🧠"]]),IU=e=>{const t=Array.from(TU.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return TU.get(e)}return""},kU=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of TU){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},RU=e=>{let t=0;for(const[n,r]of TU)if(r===e){t=n;break}return t},OU=e=>{const t=Math.round(e),n=IU(t);return{points:t,badge:n,pointsForCurrentBadge:RU(n),nextBadge:kU(n)}};window.getMemoriState=e=>{var t,n,r,i,o;let a=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null===(i=null===(r=document.querySelector("memori-client"))||void 0===r?void 0:r.shadowRoot)||void 0===i?void 0:i.querySelector(".memori-widget"));if(!a)return null;let s=null===(o=a.dataset)||void 0===o?void 0:o.memoriEngineState;return s?JSON.parse(s):null},window.typeMessage=e=>{var t,n;let r=document.querySelector("fieldset#chat-fieldset textarea")||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector("fieldset#chat-fieldset textarea"));r&&(!function(e,t){var n,r,i,o;const a=null===(r=null===(n=null==Object?void 0:Object.getOwnPropertyDescriptor)||void 0===n?void 0:n.call(Object,e,"value"))||void 0===r?void 0:r.set,s=Object.getPrototypeOf(e),l=null===(o=null===(i=null==Object?void 0:Object.getOwnPropertyDescriptor)||void 0===i?void 0:i.call(Object,s,"value"))||void 0===o?void 0:o.set;l&&a&&a!==l?l.call(e,t):a&&a.call(e,t)}(r,e),r.dispatchEvent(new Event("input",{bubbles:!0})),setTimeout((()=>{var e,t;let n=document.querySelector("fieldset#chat-fieldset textarea + button")||(null===(t=null===(e=document.querySelector("memori-client"))||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("fieldset#chat-fieldset textarea + button"));n&&n.click()}),100))};let PU,NU,BU,LU;var DU=({memori:e,memoriConfigs:t,memoriLang:r,integration:i,showInstruct:o=!1,showShare:a=!0,preview:s=!1,embed:l=!1,showInputs:u=!0,showDates:d=!1,showContextPerLine:h=!1,showSettings:f=!1,height:p="100vh",secret:m,baseUrl:g="https://app.twincreator.com",apiUrl:v="https://backend.memori.ai",initialContextVars:b,initialQuestion:y,ogImage:w,sessionID:S,tenant:x,personification:M,AZURE_COGNITIVE_SERVICES_TTS_KEY:_,onStateChange:A})=>{var E,C,T,I,k,R,O,P,N,B,L,D,U,F,z,j,H,G;const{t:V,i18n:W}=yo(),[q,K]=(0,c.useState)(!1);(0,c.useEffect)((()=>{K(!0)}),[]);const J=Vi(v),{initSession:Q,postTextEnteredEvent:X,postPlaceChangedEvent:Y,postTimeoutEvent:Z,postTagChangedEvent:$,getSession:ee,getContentQualityIndexes:te}=J,[ne,re]=(0,c.useState)(!1),[ie,oe]=(0,c.useState)(!1),[ae,se]=(0,c.useState)(!1),le=null===(I=null===(T=null===(C=null===(E=null==t?void 0:t.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===E?void 0:E.culture)||void 0===C?void 0:C.split("-"))||void 0===T?void 0:T[0])||void 0===I?void 0:I.toUpperCase(),[ce,ue]=(0,c.useState)(null!==(N=null!==(P=null!==(O=null!=r?r:null===(R=null===(k=null==e?void 0:e.culture)||void 0===k?void 0:k.split("-"))||void 0===R?void 0:R[0])&&void 0!==O?O:le)&&void 0!==P?P:W.language)&&void 0!==N?N:"IT"),de=(null==i?void 0:i.customData)?JSON.parse(i.customData):null,he=!!(null==de?void 0:de.multilanguage),[fe,pe]=(0,c.useState)(!1),[me,ge]=(0,c.useState)(!1),[ve,be]=(0,c.useState)(!1),[ye,we]=(0,c.useState)(!1),[Se,xe]=(0,c.useState)(!1),[Me,_e]=(0,c.useState)(!1),[Ae,Ee]=(0,c.useState)(!1),[Ce,Te]=(0,c.useState)(!1),[Ie,ke]=(0,c.useState)(3),[Re,Oe]=(0,c.useState)(!1);(0,c.useEffect)((()=>{Oe(!!BU)}),[BU]),(0,c.useEffect)((()=>{Ee(SU("muteSpeaker",!1)),Te(SU("continuousSpeech",!1)),ke(SU("continuousSpeechTimeout",3))}),[]);const[Pe,Ne]=(0,c.useState)(m),[Be,Le]=(0,c.useState)(),[De,Ue]=(0,c.useState)(null),[Fe,ze]=(0,c.useState)(),je=async(e,t)=>{var n;const r=null!=t?t:Ze;if(e&&r){const{currentState:t,...i}=await Y({sessionId:r,placeName:e.placeName,latitude:e.latitude,longitude:e.longitude,uncertaintyKm:null!==(n=e.uncertainty)&&void 0!==n?n:0});t&&0===i.resultCode&&nt({...et,...t})}},[He,Ge]=(0,c.useState)(""),[Ve,We]=(0,c.useState)(!1),[qe,Je]=(0,c.useState)([]),Qe=e=>{Je((t=>[...t,{...e}]))},Xe=async(t,n,r,i=!0,o)=>{var a,s,l,c,u;if(!Ze||!(null==t?void 0:t.length))return;Qe({text:t,translatedText:o,fromUser:!0,media:null!=n?n:[],initial:!!r}),ge(!0);const d=null!==(c=null!==(l=null===(s=null===(a=e.culture)||void 0===a?void 0:a.split("-"))||void 0===s?void 0:s[0])&&void 0!==l?l:W.language)&&void 0!==c?c:"IT";let h=t;if(i&&!ne&&he&&ce.toUpperCase()!==d.toUpperCase()){h=(await pm(t,d,ce,g)).text}const{currentState:f,...p}=await X({sessionId:null!=r?r:Ze,text:h});if(0===p.resultCode&&f){const t=null!==(u=f.emission)&&void 0!==u?u:null==et?void 0:et.emission;if("X4"===f.state&&e.giverTag){const{currentState:t,...n}=await $(Ze,e.giverTag);0===n.resultCode?(nt(t),t.emission&&Qe({text:t.emission,media:t.media,fromUser:!1})):(console.error(p,n),gd.error(V(_U(n.resultCode),{ns:"common"})))}else if("X2d"===f.state&&e.giverTag){const{currentState:t,...n}=await X({sessionId:null!=r?r:Ze,text:Math.random().toString().substring(2,8)});if(0===n.resultCode){const{currentState:t,...n}=await $(Ze,e.giverTag);0===n.resultCode?(nt(t),t.emission&&Qe({text:t.emission,media:t.media,fromUser:!1})):(console.error(p,n),gd.error(V(_U(n.resultCode),{ns:"common"})))}else console.error(p,n),gd.error(V(_U(n.resultCode),{ns:"common"}))}else ce.toLowerCase()!==d.toLowerCase()&&t&&!ne&&he?Ye(f,ce):(nt({...f,emission:t}),t&&Qe({text:t,media:f.media,fromUser:!1}))}else Je((e=>[...e.slice(0,e.length-1)])),it(!1,Pe||e.secretToken,Be,ne&&e.giverTag?e.giverTag:void 0,ne&&e.giverPIN?e.giverPIN:void 0,b,y).then((e=>{console.info("session timeout"),e&&setTimeout((()=>{Xe(t,n,e)}),500)}));ge(!1)},Ye=async(t,n)=>{var r,i,o,a,s,l;const c=null!==(a=null!==(o=null===(i=null===(r=e.culture)||void 0===r?void 0:r.split("-"))||void 0===i?void 0:i[0])&&void 0!==o?o:W.language)&&void 0!==a?a:"IT",u=null!==(s=t.emission)&&void 0!==s?s:null==et?void 0:et.emission;let d={...t},h=null;if(u&&!ne&&c.toUpperCase()!==n.toUpperCase()&&he){const e=await pm(u,n,c,g);if(t.hints&&t.hints.length>0){const r=await Promise.all((null!==(l=t.hints)&&void 0!==l?l:[]).map((async e=>{var t;const r=await pm(e,n,c,g);return{text:null!==(t=null==r?void 0:r.text)&&void 0!==t?t:e,originalText:e}})));d={...t,emission:e.text,translatedHints:r}}else d={...t,emission:e.text};e.text.length>0&&(h={text:e.text,media:t.media,fromUser:!1})}else d={...t,emission:u},u&&(h={text:u,media:t.media,fromUser:!1});return nt(d),h&&Qe(h),d},[Ze,$e]=(0,c.useState)(S),[et,tt]=(0,c.useState)(),nt=e=>{tt(e),A&&A(e)},rt=async t=>{var n,r,i,o,a;if("PUBLIC"===e.privacyType||e.secretToken||Pe||Be){pe(!0);try{if(!e.giverTag&&(null===(n=e.receivedInvitations)||void 0===n?void 0:n.length)){let t=e.receivedInvitations.find((e=>"GIVER"===e.type&&"ACCEPTED"===e.state));t&&(e.giverTag=t.tag,e.giverPIN=t.pin)}const s=await Q(t);if((null==s?void 0:s.sessionID)&&(null==s?void 0:s.currentState)&&0===s.resultCode){$e(s.sessionID);const t=null!==(a=null!==(o=null===(i=null===(r=e.culture)||void 0===r?void 0:r.split("-"))||void 0===i?void 0:i[0])&&void 0!==o?o:W.language)&&void 0!==a?a:"IT";return!ne&&he&&ce.toLowerCase()!==t.toLowerCase()?Ye(s.currentState,ce).then((e=>{(null==e?void 0:e.emission)&&(qe.length<=1?Je([{text:e.emission,media:e.media,fromUser:!1,initial:!0}]):Qe({text:e.emission,media:e.media,fromUser:!1,initial:!0}))})):(nt(s.currentState),s.currentState.emission&&(qe.length<=1?Je([{text:s.currentState.emission,media:s.currentState.media,fromUser:!1,initial:!0}]):Qe({text:s.currentState.emission,media:s.currentState.media,fromUser:!1,initial:!0}))),Fe&&je(Fe,s.sessionID),pe(!1),{dialogState:s.currentState,sessionID:s.sessionID}}console.error(s),gd.error(V(_U(null==s?void 0:s.resultCode),{ns:"common"})),se(!0)}catch(e){console.error(e),new Error("Error fetching session")}}else Ue("password")},it=async(t=!1,n,r,i,o,a,s)=>{var l;pe(!0);try{const{sessionID:c,currentState:u,...d}=await Q({memoriID:null!==(l=e.engineMemoriID)&&void 0!==l?l:"",password:n,recoveryTokens:r,tag:i,pin:o,initialContextVars:a,initialQuestion:s});if(c&&u&&0===d.resultCode)return $e(c),t&&(nt(u),u.emission&&(qe.length<=1?Je([{text:u.emission,media:u.media,fromUser:!1}]):Qe({text:u.emission,media:u.media,fromUser:!1}))),Fe&&je(Fe,c),pe(!1),c;console.error(d),gd.error(V(_U(d.resultCode),{ns:"common"})),se(!0)}catch(e){console.error(e)}return pe(!1),null},ot=async(t,n,r,i)=>{var o;if(!t||!n)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState:t,resultCode:a}=await $(n,null!=r?r:gm);if(0===a){let s=0;if(r!==gm&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await X({sessionId:n,text:null!=i?i:""});s=e}if(0===s){const{currentState:e,...t}=await ee(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(a))console.warn("[APPCONTEXT/CHANGETAG]",a),rt({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:m||e.secretToken,tag:e.giverTag,pin:e.giverPIN,initialContextVars:b,initialQuestion:y});else if(t)return{currentState:t,sessionId:n,resultCode:a}}}catch(e){let t=e;return console.error("[APPCONTEXT/CHANGETAG]",t),Promise.reject(t)}return null};(0,c.useEffect)((()=>()=>{et&&(null==et?void 0:et.currentTag)===e.giverTag||(async()=>{Ze&&e.giverTag&&e.giverPIN&&(Je([]),await ot(e.engineMemoriID,Ze,e.giverTag,e.giverPIN))})()}),[]);const[at,st]=(0,c.useState)(),lt=(0,c.useRef)(),ct=()=>{at&&(clearTimeout(at),st(void 0)),(null==lt?void 0:lt.current)&&(clearTimeout(lt.current),lt.current=void 0)},ut=()=>{ct(),!(null==et?void 0:et.acceptsTimeout)||BU||Re||He.length||Ve||ht()},dt=async()=>{if(BU||Re||He.length||Ve)ut();else if(Ze&&ve&&(null==et?void 0:et.acceptsTimeout)){const{currentState:e,...t}=await Z(Ze);if(0===t.resultCode&&e){const t=e.emission;!ne&&he&&ce!==(null==W?void 0:W.language)&&t&&t.length>0?Ye({...e,emission:t},ce):t&&t.length>0?(Qe({text:t,media:e.media,fromUser:!1}),nt(e)):nt({...e})}}},ht=()=>{let e=null==et?void 0:et.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==et?void 0:et.emission){e+=et.emission.length/26.5}}let t=setTimeout(dt,1e3*e);st(t),lt.current=t};(0,c.useEffect)((()=>{(He.length||Re)&&ct(),Ze&&!He.length&&ut()}),[null==et?void 0:et.acceptsTimeout,null==et?void 0:et.timeout,null==et?void 0:et.state,Re,Ze,qe,He]),(0,c.useEffect)((()=>()=>{be(!1),oe(!1),ct(),lt.current=void 0}),[]);(0,c.useEffect)((()=>()=>{LU&&LU.pause(),BU&&(BU.close(),BU=null)}),[]);const ft=(0,c.useCallback)((t=>{var n,r,i,o;let a="";switch((null!==(o=null!==(i=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==i?i:W.language)&&void 0!==o?o:"IT").toUpperCase()){case"IT":a=""+("MALE"===e.voiceType?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":a=""+("MALE"===e.voiceType?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":a=""+("MALE"===e.voiceType?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":a=""+("MALE"===e.voiceType?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":a=""+("MALE"===e.voiceType?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":a=""+("MALE"===e.voiceType?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":a=""+("MALE"===e.voiceType?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":a=""+("MALE"===e.voiceType?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;default:a=""+("MALE"===e.voiceType?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return a}),[e.voiceType,W.language,e.culture]),pt=t=>{var n,r,i;let o="";switch((null!==(i=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==i||W.language,"IT").toUpperCase()){case"IT":default:o="it-IT";break;case"DE":o="de-DE";break;case"EN":o="en-GB";break;case"ES":o="es-ES";break;case"FR":o="fr-FR";break;case"PT":o="pt-PT";break;case"UK":o="uk-UK";break;case"RU":o="ru-RU"}return o},[mt,gt]=(0,c.useState)();(0,c.useEffect)((()=>{(async()=>{try{const e=await fetch(`${g||"https://app.twincreator.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{gt(e)}))}),[]);const vt=(e,t=!0)=>{if(!_)return;if(s||!ve)return;if(LU&&LU.pause(),BU&&(BU.close(),BU=null),Ae&&t)return void setTimeout((()=>{document.dispatchEvent(new Event("endSpeakStartListen"))}),3e3);if(Ae)return;LU=new jr.SpeakerAudioDestination;let n=qr.fromSpeakerOutput(LU);BU=new oi.SpeechSynthesizer(NU,n),LU.onAudioEnd=()=>{Oe(!1),t&&document.dispatchEvent(new Event("endSpeakStartListen"))},Oe(!0),BU.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${pt(ce)}"><voice name="${ft(ce)}"><s>${((e,t)=>{var n;if(!mt)return e;const r={...null!==(n=mt.common)&&void 0!==n?n:{},...(null==x?void 0:x.id)&&mt[x.id]?mt[x.id]:{}},i=Object.keys(r).map((e=>{var n;return{word:e,phoneme:null!==(n=r[e][t])&&void 0!==n?n:r[e].default}}));return i.reduce(((e,{word:t,phoneme:n})=>e.replace(new RegExp(t,"gi"),`<phoneme alphabet="ipa" ph="${n}">${t}</phoneme>`)),e)})(e,ce.toLowerCase())}</s></voice></speak>`,(t=>{if(t)try{BU&&(BU.close(),BU=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),Oe(!1)}else Oe(!1)}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),Oe(!1)}))};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==et?void 0:et.emission]);const[bt,wt]=(0,c.useState)(""),St=()=>wt(""),[xt,Mt]=(0,c.useState)(null),_t=()=>{xt&&(clearTimeout(xt),Mt(null))},At=()=>{_t(),Ce&&(()=>{let e=setTimeout((async()=>{Tt();const e=rm(bt);e.length>0?(Xe(e),St(),Ge("")):Ve&&ut()}),1e3*Ie);Mt(e)})()};(0,c.useEffect)((()=>{if(At(),ut(),(null==bt?void 0:bt.length)>0){const e=rm(bt);e.length>0&&Ge(e)}}),[bt]);const Et=()=>{if(_){Tt(),wt("");try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){we(!0),NU||(NU=hn.fromSubscription(_,"eastus"),NU.speechRecognitionLanguage=pt(ce));const t=qr.fromDefaultMicrophoneInput();PU=new Qr.SpeechRecognizer(NU,t),We(!0),PU.recognized=(e,t)=>{var n;t.result.reason===yt.RecognizedSpeech?wt(null!==(n=t.result.text)&&void 0!==n?n:""):t.result.reason===yt.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},PU.canceled=(e,t)=>{t.reason===Ke.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),Ct()},PU.sessionStopped=(e,t)=>{PU&&PU.stopContinuousRecognitionAsync()},PU.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},Ct=()=>{PU&&(PU.stopContinuousRecognitionAsync(),PU.close(),PU=null,We(!1))},Tt=()=>{we(!1),Ct(),_t()};(0,c.useEffect)((()=>()=>Tt()),[]),(0,c.useEffect)((()=>{"Z0"===(null==et?void 0:et.state)&&Tt()}),[null==et?void 0:et.state]),(0,c.useEffect)((()=>{ve&&!s&&!Ae&&qe.length>0&&(null==et?void 0:et.emission)&&vt(et.emission,"Z0"!==et.state)}),[et,ve]);const[It,kt]=(0,c.useState)(!1),Rt=(0,c.useCallback)((e=>{Re&&BU&&(BU.close(),BU=null),!Ce||!ye&&It||(kt(!0),Et())}),[Ce,ye]);(0,c.useEffect)((()=>{!Re&&Ce&&ye?Et():Re&&Ve&&Ct()}),[Re]),(0,c.useEffect)((()=>(document.addEventListener("endSpeakStartListen",Rt),()=>{document.removeEventListener("endSpeakStartListen",Rt)})),[Rt]),(0,c.useEffect)((()=>{Ve&&(Tt(),St(),Ge(""),Et())}),[le]);const[Ot,Pt]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=SU("sendOnEnter","keypress");Pt(e)}),[]),(0,c.useEffect)((()=>{xU("sendOnEnter",Ot)}),[Ot]);const[Nt,Bt]=(0,c.useState)(),Lt=null==de?void 0:de.globalBackground,Dt=Lt?`url(${Lt})`:null,Ut=i?{"--memori-chat-bubble-bg":"#fff",...de&&!o?{"--memori-text-color":null!==(B=de.textColor)&&void 0!==B?B:"#000"}:{},...(null==de?void 0:de.buttonBgColor)?{"--memori-button-bg":de.buttonBgColor,"--memori-primary":de.buttonBgColor}:{},...(null==de?void 0:de.buttonTextColor)?{"--memori-button-text":de.buttonTextColor}:{},...(null==de?void 0:de.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==de?void 0:de.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===de.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(L=de.innerBgAlpha)&&void 0!==L?L:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===de.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(D=null==de?void 0:de.innerBgAlpha)&&void 0!==D?D:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},Ft=`\n ${s?"#preview":":root"}, .memori-widget {\n ${Object.entries(Ut).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,[zt,jt]=(0,c.useState)(!0),[Ht,Gt]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...a}=await te(e);0===a.resultCode&&(t=r,n=o)}catch(e){let t=e;console.error("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",t)}return{points:null!=t?t:0,unansweredQuestions:null!=n?n:0}})(e.engineMemoriID).then((e=>{Gt(OU(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==de?void 0:de.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",de.seoTitle),document.head.append(e)}if(null==de?void 0:de.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",de.seoDescription),document.head.append(e)}if(null==de?void 0:de.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",de.seoUrl),document.head.append(e)}let t=w||e.avatarURL;if((null==de?void 0:de.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[de,e.avatarURL,w]);const Vt=async t=>{const n=(null==t?void 0:t.sessionID)||Ze,r=(null==t?void 0:t.dialogState)||et;if(oe(!0),(()=>{if(!_)return;NU=hn.fromSubscription(_,"eastus"),NU.speechSynthesisLanguage=pt(ce),NU.speechSynthesisVoiceName=ft(ce),nm()&&(NU.speechSynthesisOutputFormat=Zt.Audio16Khz32KBitRateMonoMp3);let e=document.getElementById("memori-audio");e&&window.navigator.userAgent.includes("Safari")&&(e.muted=!1,e.play().then((async()=>{try{const e=new Wu;let t=e.createBuffer(1,1,22050),n=e.createBufferSource();n.buffer=t,n.connect(e.destination)}catch(e){console.error(e)}})).catch((e=>{console.error("error playing intro audio",e)})))})(),!n&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!Pe&&!Be||!n&&ae)return Ue("password"),void oe(!1);if(n)if(S){const{currentState:t,...r}=await ee(n);if(0!==r.resultCode||!t)return console.debug("session expired, opening new session"),se(!0),$e(void 0),oe(!1),void Vt();if(Je([]),ne&&e.giverTag&&(null==et?void 0:et.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await ot(e.engineMemoriID,n,"-");const t=await ot(e.engineMemoriID,n,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Ye(t.currentState,ce).finally((()=>{be(!0)}))}catch(t){console.error("session #2",t),it(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,b,y).then((()=>{be(!0)}))}else if(!ne&&M&&(null==et?void 0:et.currentTag)!==M.tag)try{console.debug("change tag #3"),await ot(e.engineMemoriID,n,"-");const t=await ot(e.engineMemoriID,n,M.tag,M.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Ye(t.currentState,ce).finally((()=>{be(!0)}))}catch(t){console.error("session #5",t),it(!0,null==e?void 0:e.secretToken,void 0,M.tag,M.pin,b,y).then((()=>{be(!0)}))}else if(ne||M||(null==et?void 0:et.currentTag)===gm)Ye(t,ce).finally((()=>{be(!0)}));else try{console.debug("change tag #6"),await ot(e.engineMemoriID,n,"-");const t=await ot(e.engineMemoriID,n,gm);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Ye(t.currentState,ce).finally((()=>{be(!0)}))}catch(t){console.error("session #8",t),it(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,b,y).then((()=>{be(!0)}))}}else Je([]),Ye(r,ce).finally((()=>{be(!0)}));else{oe(!1),se(!1);const t=await rt({memoriID:e.engineMemoriID,password:m||e.secretToken,tag:null==M?void 0:M.tag,pin:null==M?void 0:M.pin,initialContextVars:b,initialQuestion:y});Vt(t||void 0)}},Wt=n(c).createElement(bU,{memori:e,history:qe,showShare:a,position:Fe,setShowPositionDrawer:xe,setShowSettingsDrawer:_e,speakerMuted:Ae,setSpeakerMuted:Ee,showSettings:f,hasUserActivatedSpeak:ve}),qt=n(c).createElement(mD,{memori:e,integration:i,integrationConfig:de,tenant:x,instruct:ne,avatar3dVisible:zt,setAvatar3dVisible:jt,hasUserActivatedSpeak:ve,isPlayingAudio:Re,baseUrl:g}),Kt=n(c).createElement(Fb,{memori:e,tenant:x,gamificationLevel:Ht,language:le,userLang:ce,setUserLang:ue,baseUrl:g,position:Fe,openPositionDrawer:()=>xe(!0),integrationConfig:de,instruct:ne,sessionId:Ze,clickedStart:ie,onClickStart:Vt}),Jt=Ze?n(c).createElement(Bb,{memori:e,sessionID:Ze,tenant:x,translateTo:he&&ce.toUpperCase()!==(null===(H=null!==(j=null!==(z=null===(F=null===(U=e.culture)||void 0===U?void 0:U.split("-"))||void 0===F?void 0:F[0])&&void 0!==z?z:W.language)&&void 0!==j?j:"IT")||void 0===H?void 0:H.toUpperCase())?ce:void 0,baseUrl:g,memoriTyping:me,history:qe,dialogState:et,setDialogState:nt,pushMessage:Qe,simulateUserPrompt:(e,t)=>{Ct(),Xe(e,void 0,void 0,!1,t)},showDates:d,showContextPerLine:h,client:J,selectReceiverTag:async t=>{var n;if(Ze)try{const{currentState:r,...i}=await $(Ze,t);if(0===i.resultCode)if(Qe({text:t,fromUser:!0}),"X4"===r.state&&e.giverTag){const{currentState:t,...n}=await J.postTagChangedEvent(Ze,e.giverTag);0===n.resultCode?(nt(t),t.emission&&Qe({text:t.emission,media:t.media,fromUser:!1})):(console.error(n),gd.error(V(_U(n.resultCode),{ns:"common"})))}else nt(r),r.emission&&Qe({text:r.emission,media:r.media,fromUser:!1});else console.error(i,t,null===(n=null==et?void 0:et.knownTags)||void 0===n?void 0:n[t]),gd.error(V(_U(i.resultCode),{ns:"common"}))}catch(e){let t=e;console.error(t),gd.error(t.message)}},preview:s,sendOnEnter:Ot,setSendOnEnter:Pt,attachmentsMenuOpen:Nt,setAttachmentsMenuOpen:Bt,instruct:ne,showInputs:u,showMicrophone:!!_,userMessage:He,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return Ge(""),void ut();Ge(e),ct()},sendMessage:e=>{Ct(),Xe(e),Ge(""),St()},stopListening:Tt,startListening:Et,stopAudio:()=>{BU&&(BU.close(),BU=null)},resetTranscript:St,listening:Ve,isPlayingAudio:Re}):null,Qt=i&&Dt?n(c).createElement("div",{className:"memori--global-background"},n(c).createElement("div",{className:"memori--global-background-image",style:{backgroundImage:Dt}})):null,Xt=i?n(c).createElement("style",{dangerouslySetInnerHTML:{__html:Ft}}):null,Yt=n(c).createElement(gD,{canInstruct:!!e.giverTag,instruct:ne,onChangeMode:e=>{re("instruct"===e),be(!1),oe(!1)}});return n(c).createElement("div",{className:n(md)("memori","memori-widget",{"memori--preview":s,"memori--embed":l,"memori--with-integration":i,"memori--active":ve}),"data-memori-name":null==e?void 0:e.name,"data-memori-id":null==e?void 0:e.engineMemoriID,"data-memori-secondary-id":null==e?void 0:e.memoriID,"data-memori-session-id":Ze,"data-memori-integration":null==i?void 0:i.integrationID,"data-memori-engine-state":JSON.stringify({...et,sessionID:Ze}),style:{height:p}},n(c).createElement(yU,{header:Wt,avatar:qt,chat:Jt,startPanel:Kt,integrationStyle:Xt,integrationBackground:Qt,changeMode:Yt,sessionId:Ze,hasUserActivatedSpeak:ve,showInstruct:o,loading:fe}),q&&n(c).createElement(tm,{withModal:!0,pwdOrTokens:De,openModal:!!De,setPwdOrTokens:Ue,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{t.password&&Ne(t.password),t.tokens&&Le(t.tokens),it(!Ze,t.password,t.tokens,ne?e.giverTag:void 0,ne?e.giverPIN:void 0,b,y).then((()=>{Ue(null),be(!0)})).catch((()=>{Ue(null),se(!0)}))},minimumNumberOfRecoveryTokens:null!==(G=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==G?G:1}))};function UU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tD(r.key),r)}}function zU(e,t,n){return t&&FU(e.prototype,t),n&&FU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jU(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HU(e,t){return HU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},HU(e,t)}function GU(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&HU(e,t)}function VU(e,t){if(t&&("object"===$L(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return jU(e)}function WU(e){return WU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},WU(e)}function qU(e){if(Array.isArray(e))return e}function KU(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function JU(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 QU(e,t){if(e){if("string"==typeof e)return JU(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?JU(e,t):void 0}}function XU(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function YU(e){return qU(e)||KU(e)||QU(e)||XU()}function ZU(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 $U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ZU(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZU(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var eF={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},tF=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};UU(this,e),this.init(t,n)}return zU(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||eF,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,$U($U({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),nF=new tF,rF=function(){function e(){UU(this,e),this.observers={}}return zU(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function iF(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function oF(e){return null==e?"":""+e}function aF(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function sF(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function lF(e,t,n){var r=sF(e,t,Object);r.obj[r.k]=n}function cF(e,t){var n=sF(e,t),r=n.obj,i=n.k;if(r)return r[i]}function uF(e,t,n){var r=cF(e,n);return void 0!==r?r:cF(t,n)}function dF(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):dF(e[r],t[r],n):e[r]=t[r]);return e}function hF(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var fF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function pF(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return fF[e]})):e}var mF="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,gF=[" ",",","?","!",";"];function vF(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 bF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vF(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yF(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return VU(this,n)}}function wF(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;o<r.length;++o){if(!i)return;if("string"==typeof i[r[o]]&&o+1<r.length)return;if(void 0===i[r[o]]){for(var a=2,s=r.slice(o,o+a).join(n),l=i[s];void 0===l&&r.length>o+a;)a++,l=i[s=r.slice(o,o+a).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(s)){if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s]}var c=r.slice(o+a).join(n);return c?wF(l,c,n):void 0}i=i[r[o]]}return i}}var SF=function(e){GU(n,e);var t=yF(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return UU(this,n),r=t.call(this),mF&&rF.call(jU(r)),r.data=e||{},r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return zU(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=cF(this.data,a);return s||!o||"string"!=typeof n?s:wF(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),lF(this.data,a,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=cF(this.data,a)||{};r?dF(s,n,i):s=bF(bF({},s),n),lF(this.data,a,s),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?bF(bF({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(rF),xF={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}};function MF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?MF(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function AF(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return VU(this,n)}}var EF={},CF=function(e){GU(n,e);var t=AF(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return UU(this,n),r=t.call(this),mF&&rF.call(jU(r)),aF(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,jU(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=nF.create("translator"),r}return zU(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=gF.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}(e,n,r));if(o&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:i};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==$L(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,c=s.namespaces,u=c[c.length-1],d=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(h){var f=t.nsSeparator||this.options.nsSeparator;return o?(p.res="".concat(u).concat(f).concat(l),p):"".concat(u).concat(f).concat(l)}return o?(p.res=l,p):l}var p=this.resolve(e,t),m=p&&p.res,g=p&&p.usedKey||l,v=p&&p.exactUsedKey||l,b=Object.prototype.toString.apply(m),y=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,x="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(S&&m&&x&&y.indexOf(b)<0&&("string"!=typeof w||"[object Array]"!==b)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,_F(_F({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(p.res=M,p):M}if(a){var _="[object Array]"===b,A=_?[]:{},E=_?v:g;for(var C in m)if(Object.prototype.hasOwnProperty.call(m,C)){var T="".concat(E).concat(a).concat(C);A[C]=this.translate(T,_F(_F({},t),{joinArrays:!1,ns:c})),A[C]===T&&(A[C]=m[C])}m=A}}else if(S&&"string"==typeof w&&"[object Array]"===b)(m=m.join(w))&&(m=this.extendTranslation(m,e,t,r));else{var I=!1,k=!1,R=void 0!==t.count&&"string"!=typeof t.count,O=n.hasDefaultValue(t),P=R?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(P)]||t.defaultValue;!this.isValidLookup(m)&&O&&(I=!0,m=N),this.isValidLookup(m)||(k=!0,m=l);var B=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,L=B&&k?void 0:m,D=O&&N!==m&&this.options.updateMissing;if(k||I||D){if(this.logger.log(D?"updateKey":"missingKey",d,u,l,D?N:m),a){var U=this.resolve(l,_F(_F({},t),{},{keySeparator:!1}));U&&U.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&z&&z[0])for(var j=0;j<z.length;j++)F.push(z[j]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var o=O&&r!==m?r:L;i.options.missingKeyHandler?i.options.missingKeyHandler(e,u,n,o,D,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,u,n,o,D,t),i.emit("missingKey",e,u,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,p,r),k&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(k||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(p.res=m,p):m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,_F(_F({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(_F(_F({},n),{interpolation:_F(_F({},this.options.interpolation),n.interpolation)}));var a,s="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var l=e.match(this.interpolator.nestingRegexp);a=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=_F(_F({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),s){var u=e.match(this.interpolator.nestingRegexp);a<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return i&&i[0]===r[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):o.translate.apply(o,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,h="string"==typeof d?[d]:d;return null!=e&&h&&h.length&&!1!==n.applyPostProcessor&&(e=xF.handle(h,e,t,this.options&&this.options.postProcessPassResolved?_F({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),c=l.key;n=c;var u=l.namespaces;a.options.fallbackNS&&(u=u.concat(a.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,h=d&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),f=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);u.forEach((function(e){a.isValidLookup(t)||(o=e,!EF["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(o)&&(EF["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){i=n;var o,l=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,c,n,e,s);else{var u;d&&(u=a.pluralResolver.getSuffix(n,s.count,s));var p="".concat(a.options.pluralSeparator,"zero");if(d&&(l.push(c+u),h&&l.push(c+p)),f){var m="".concat(c).concat(a.options.contextSeparator).concat(s.context);l.push(m),d&&(l.push(m+u),h&&l.push(m+p))}}for(;o=l.pop();)a.isValidLookup(t)||(r=o,t=a.getResource(n,e,o,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(rF);function TF(e){return e.charAt(0).toUpperCase()+e.slice(1)}var IF=function(){function e(t){UU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=nF.create("languageUtils")}return zU(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=TF(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=TF(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=TF(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),kF=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],RF={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},OF=["v1","v2","v3"],PF={zero:0,one:1,two:2,few:3,many:4,other:5};function NF(){var e={};return kF.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:RF[t.fc]}}))})),e}var BF=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};UU(this,e),this.languageUtils=t,this.options=n,this.logger=nF.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=NF()}return zU(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return PF[e]-PF[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!OF.includes(this.options.compatibilityJSON)}}]),e}();function LF(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 DF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LF(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var UF=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};UU(this,e),this.logger=nF.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return zU(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:pF,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?hF(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?hF(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?hF(t.nestingPrefix):t.nestingPrefixEscaped||hF("$t("),this.nestingSuffix=t.nestingSuffix?hF(t.nestingSuffix):t.nestingSuffixEscaped||hF(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(s.formatSeparator)<0){var i=uF(t,l,e);return s.alwaysFormat?s.format(i,void 0,n,DF(DF(DF({},r),t),{},{interpolationkey:e})):i}var o=e.split(s.formatSeparator),a=o.shift().trim(),c=o.join(s.formatSeparator).trim();return s.format(uF(t,l,a),c,n,DF(DF(DF({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach((function(t){for(a=0;i=t.regex.exec(e);){var n=i[1].trim();if(void 0===(o=u(n)))if("function"==typeof d){var l=d(e,i,r);o="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))o="";else{if(h){o=i[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o=""}else"string"==typeof o||s.useRawValueToEscape||(o=oF(o));var c=t.safeValue(o);if(e=e.replace(i[0],c),h?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=DF({},o);function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var o=(i=this.interpolate(i,a)).match(/'/g),s=i.match(/"/g);(o&&o.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{a=JSON.parse(i),t&&(a=DF(DF({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=oF(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,o.lng,DF(DF({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function FF(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 zF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?FF(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jF(e){var t={};return function(n,r,i){var o=r+JSON.stringify(i),a=t[o];return a||(a=e(r,i),t[o]=a),a(n)}}var HF=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};UU(this,e),this.logger=nF.create("formatter"),this.options=t,this.formats={number:jF((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:jF((function(e,t){var n=new Intl.NumberFormat(e,zF(zF({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:jF((function(e,t){var n=new Intl.DateTimeFormat(e,zF({},t));return function(e){return n.format(e)}})),relativetime:jF((function(e,t){var n=new Intl.RelativeTimeFormat(e,zF({},t));return function(e){return n.format(e,t.range||"day")}})),list:jF((function(e,t){var n=new Intl.ListFormat(e,zF({},t));return function(e){return n.format(e)}}))},this.init(t)}return zU(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=jF(t)}},{key:"format",value:function(e,t,n,r){var i=this,o=t.split(this.formatSeparator).reduce((function(e,t){var o=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=YU(e.split(":")),r=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=i),"false"===i&&(n[r.trim()]=!1),"true"===i&&(n[r.trim()]=!0),isNaN(i)||(n[r.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}}(t),a=o.formatName,s=o.formatOptions;if(i.formats[a]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=i.formats[a](e,u,zF(zF(zF({},s),r),c))}catch(e){i.logger.warn(e)}return l}return i.logger.warn("there was no format function for ".concat(a)),e}),e);return o}}]),e}();function GF(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 VF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GF(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function WF(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return VU(this,n)}}var qF=function(e){GU(n,e);var t=WF(n);function n(e,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return UU(this,n),o=t.call(this),mF&&rF.call(jU(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=a,o.logger=nF.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=a.maxParallelReads||10,o.readingCalls=0,o.maxRetries=a.maxRetries>=0?a.maxRetries:5,o.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,a.backend,a),o}return zU(n,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o={},a={},s={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?void 0===a[s]&&(a[s]=!0):(i.state[s]=1,r=!1,void 0===a[s]&&(a[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){var r,s,l,c,u,d;r=n.loaded,s=o,c=sF(r,[i],Object),u=c.obj,d=c.k,u[d]=u[d]||[],l&&(u[d]=u[d].concat(s)),l||u[d].push(s),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:o,callback:a}):(this.readingCalls++,this.backend[n](e,t,(function(s,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}s&&l&&i<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,a)}),o):a(s,l)}))):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,VF(VF({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(rF);function KF(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===$L(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===$L(e[2])||"object"===$L(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function JF(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function QF(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 XF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?QF(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function YF(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return VU(this,n)}}function ZF(){}function $F(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var ez=function(e){GU(n,e);var t=YF(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(UU(this,n),e=t.call(this),mF&&rF.call(jU(e)),e.options=JF(r),e.services={},e.logger=nF,e.modules={external:[]},$F(jU(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),VU(e,jU(e));setTimeout((function(){e.init(r,i)}),0)}return e}return zU(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=KF();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=XF(XF(XF({},r),this.options),JF(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=XF(XF({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var o;this.modules.logger?nF.init(i(this.modules.logger),this.options):nF.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=HF);var a=new IF(this.options);this.store=new SF(this.options.resources,this.options);var s=this.services;s.logger=nF,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new BF(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=i(o),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new UF(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new qF(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(s.languageDetector=i(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=i(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new CF(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=ZF),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=iF(),h=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ZF,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)a(i);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=iF();return e||(e=this.languages),t||(t=this.options.ns),n||(n=ZF),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&xF.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=iF();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var a="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);a&&(n.language||i(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,o){o?(i(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var o;if("object"!==$L(i)){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l<a;l++)s[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([t,i].concat(s))}else o=XF({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",u=o.keyPrefix?"".concat(o.keyPrefix).concat(c).concat(t):t;return r.t(u,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||i&&!a(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=iF();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=iF();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ZF,i=XF(XF(XF({},this.options),t),{isClone:!0}),o=new n(i);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));var a=["store","services","language"];return a.forEach((function(t){o[t]=e[t]})),o.services=XF({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new CF(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(rF);nD(ez,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ez(e,t)}));var tz=ez.createInstance();tz.createInstance=ez.createInstance;tz.createInstance,tz.init,tz.loadResources,tz.reloadResources,tz.use,tz.changeLanguage,tz.getFixedT,tz.t,tz.exists,tz.setDefaultNamespace,tz.hasLoadedNamespace,tz.loadNamespaces,tz.loadLanguages;var nz,rz=tz;nz=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","loading":"Caricamento","copy":"Copia","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Memori bloccato fino al {{date}}","memoriBlockedAnon":"Attualmente \\"{{name}}\\" non può rispondere, torna qui il {{date}}","memoriBlockedReasonExceedChats":"perchè ha superato la soglia mensile di chat ammesse.","memoriBlockedGiverHelper":"Puoi sempre gestirlo in qualità di amministratore, ma altri utenti non potranno interrogarlo.","auth":{"useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","position":"Posizione","settings":"Impostazioni","share":"Condividi","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca sul bottone di invio","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica"},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per parlare con me clicca sul pulsante INIZIAMO per cominciare","instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","chatHistory":"Cronologia chat","exportChatHistory":"Esporta la cronologia chat","exportChatHistoryMessage":"Vuoi esportare la cronologia chat?","chatBotButtonText":"CLICCA QUI PER APRIRE LA CHAT","conversationStartedLabel":"Conversazione avvenuta il","settingsHeaderLabel":"Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","secondsLabel":"Secondi","tryMeHeaderLabel":"PROVA","unknownPosition":"Posizione sconosciuta","fieldPlace":"Indica la posizione (es \'Milano\')","showMapLinkFor":"Visualizza sulla mappa la posizione","useMyPosition":"Usa la mia posizione","myPosition":"Posizione corrente","updatingPosition":"Aggiorno la posizione...","placeNotFound":"Luogo sconosciuto!","requirePosition":"Inserisci la posizione prima di iniziare","attachmentsLabel":"Arricchisci il tuo messaggio","iWantToTalkToIn":"Voglio parlare con {{name}} in"},"gamification":{"level":"Livello","points":"punti","memoriReachedLevel":"è diventato più evoluto ed ha raggiunto il livello","levelGoToStatistics":"{{memori}} è al livello {{level}} con {{points}} punti. Clicca per andare alle statistiche.","congratulationsNewLevel":"Congratulazioni, hai raggiunto un nuovo livello!","congratulationsNewLevelDescription":"Il tuo Memori è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_CANT_EDIT_INTEGRATIONS":"Utente non abilitato a gestire integrazioni","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","INTEGRATION_NOT_FOUND":"Integrazione non trovata","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido"}}');const iz={en:{translation:n(JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","loading":"Loading","copy":"Copy","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Memori blocked until {{date}}","memoriBlockedAnon":"Currently \\"{{name}}\\" can\'t answer, come back here on {{date}}","memoriBlockedReasonExceedChats":"because it has exceeded the monthly threshold of allowed chats.","memoriBlockedGiverHelper":"You can still manage it as administrator, but other users will not be able to interact with it.","auth":{"useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Sound","position":"Position","settings":"Settings","share":"Share","sendOnKeypress":"Hit Enter to send","sendOnClick":"Click on Submit","goToIntegrationsToCustomizeAvatar":"To customize the avatar, go to Share and customize the public page"},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To talk to me click on the START button to get started","instructButton":"INSTRUCT ME","tryMeButton":"START","chatHistory":"Chat history","exportChatHistory":"Export chat history","exportChatHistoryMessage":"Do you want to export chat history?","chatBotButtonText":"CLICK HERE TO OPEN CHATBOT","conversationStartedLabel":"Conversation started on","settingsHeaderLabel":"Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","secondsLabel":"Set seconds","tryMeHeaderLabel":"TRY","unknownPosition":"Unknown position","fieldPlace":"Write the place (eg \'Milano\')","showMapLinkFor":"Show the position on the map","useMyPosition":"Use my position","myPosition":"Your position","updatingPosition":"Updating position...","placeNotFound":"Place not found!","requirePosition":"Insert your position before start","attachmentsLabel":"Enrich your message","iWantToTalkToIn":"I want to talk to {{name}} in"},"gamification":{"level":"Level","points":"points","memoriReachedLevel":"became more evolved and reached level","levelGoToStatistics":"{{memori}} is at level {{level}} with {{points}} points. Click to go to statistics.","congratulationsNewLevel":"Congratulations, you have reached a new level!","congratulationsNewLevelDescription":"Your Memori became more evolved with {{points}} points, look at the","statistics":"statistics"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_CANT_EDIT_INTEGRATIONS":"User not allowed to manage integrations","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID"}}'))},it:{translation:n(nz)}};rz.use(so).init({resources:iz,lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});var oz=rz;const az=({ownerUserName:e,ownerUserID:t,memoriName:r,memoriID:i,integrationID:o,tenantID:a,secretToken:s,sessionID:l,showShare:u=!0,showSettings:d=!1,showInstruct:h=!1,height:f="100%",baseURL:p,apiURL:m="https://backend.memori.ai",tag:g,pin:v,context:b,initialQuestion:y,uiLang:w,spokenLang:S,AZURE_COGNITIVE_SERVICES_TTS_KEY:x,onStateChange:M})=>{var _,A,E;const[C,T]=(0,c.useState)(),{t:I}=yo();if(!(i&&t||r&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const k=Vi(m),R=(0,c.useCallback)((async()=>{if(i&&t){const{memori:e,...n}=await k.backend.getMemoriByUserAndId(a,t,i);0===n.resultCode&&e?T(e):console.error("[MEMORI]",n,e)}else if(r&&e){const{memori:t,...n}=await k.backend.getMemori(a,e,r);0===n.resultCode&&t?T(t):console.error("[MEMORI]",n,t)}}),[i,t,r,e,a]);return(0,c.useEffect)((()=>{R()}),[R,a]),(0,c.useEffect)((()=>{if(w)oz.changeLanguage(w.toLowerCase());else{const{lng:e,fallbackLng:t}=(()=>{const e=navigator.language;if(e){let t=e.split("-")[0];if(["en","it"].includes(t))return{lng:t,fallbackLng:"en"===t?"it":"en"}}return{lng:"en",fallbackLng:"it"}})();oz.changeLanguage(e).catch((()=>{oz.changeLanguage(t)}))}}),[w]),C?n(c).createElement(DU,{height:f,baseUrl:p||(a.startsWith("https://")?a:`https://${a}`),apiUrl:m,memori:{...C,secretToken:s},memoriLang:null!=S?S:null===(A=null===(_=C.culture)||void 0===_?void 0:_.split("-"))||void 0===A?void 0:A[0],tenant:{id:a,theme:"twincreator",config:{name:a,showNewUser:!1,requirePosition:!!C.needsPosition}},secret:s,sessionID:l,showShare:u,showSettings:d,showInstruct:h,integration:null===(E=null==C?void 0:C.integrations)||void 0===E?void 0:E.find((e=>o?e.integrationID===o:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:b,initialQuestion:y,AZURE_COGNITIVE_SERVICES_TTS_KEY:x,onStateChange:M,...g&&v?{personification:{tag:g,pin:v}}:{}}):n(c).createElement("div",null,n(c).createElement("p",{style:{textAlign:"center",margin:"2rem auto"}},I("loading"),"..."))};az.propTypes={memoriName:n(l).string,memoriID:n(l).string,ownerUserName:n(l).string,ownerUserID:n(l).string,integrationID:n(l).string,tenantID:n(l).string.isRequired,secretToken:n(l).string,showShare:n(l).bool,showSettings:n(l).bool,baseURL:n(l).string,apiURL:n(l).string,tag:n(l).string,pin:n(l).string,showInstruct:n(l).bool,context:n(l).objectOf(n(l).any),initialQuestion:n(l).string,uiLang:n(l).oneOf(["en","it"]),spokenLang:n(l).string,AZURE_COGNITIVE_SERVICES_TTS_KEY:n(l).string,onStateChange:n(l).func};var sz=az;class lz extends HTMLElement{connectedCallback(){const e=document.createElement("div"),t=document.createElement("div");t.setAttribute("id","memori-root");const r=document.createElement("style");r.innerHTML="\n @import url('https://unpkg.com/@memori.ai/memori-webcomponent/dist/memori-webcomponent.css');\n ",e.appendChild(r),e.appendChild(t),this.appendChild(e);const i=Object.keys(sz.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t)),e)),{}),o=this.getAttribute("tenantId");o?n(s).render((0,a.jsx)(sz,{...i,tenantID:o}),t):console.error("No tenantId attribute found")}}customElements.define("memori-client",lz)})();
78
+ */function hU(e,t=0){const n=[];return e.forEach((function(e,r){let i=null;e.forEach((function(o,a){if(!o&&null!==i)return n.push(`M${i+t} ${r+t}h${a-i}v1H${i+t}z`),void(i=null);if(a!==e.length-1)o&&null===i&&(i=a);else{if(!o)return;null===i?n.push(`M${a+t},${r+t} h1v1H${a+t}z`):n.push(`M${i+t},${r+t} h${a+1-i}v1H${i+t}z`)}}))})),n.join("")}function fU(e,t){return e.slice().map(((e,n)=>n<t.y||n>=t.y+t.h?e:e.map(((e,n)=>(n<t.x||n>=t.x+t.w)&&e))))}function pU(e,t,n,r){if(null==r)return null;const i=n?4:0,o=e.length+2*i,a=Math.floor(.1*t),s=o/t,l=(r.width||a)*s,c=(r.height||a)*s,u=null==r.x?e.length/2-l/2:r.x*s,d=null==r.y?e.length/2-c/2:r.y*s;let h=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);h={x:e,y:t,w:Math.ceil(l+u-e),h:Math.ceil(c+d-t)}}return{x:u,y:d,h:c,w:l,excavation:h}}var mU=function(){try{(new Path2D).addPath(new Path2D)}catch(e){return!1}return!0}();function gU(e){const t=e,{value:r,size:i=sU,level:o=lU,bgColor:a=cU,fgColor:s=uU,includeMargin:l=dU,style:u,imageSettings:d}=t,h=iU(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),f=null==d?void 0:d.src,p=(0,c.useRef)(null),m=(0,c.useRef)(null),[g,v]=(0,c.useState)(!1);(0,c.useEffect)((()=>{if(null!=p.current){const e=p.current,t=e.getContext("2d");if(!t)return;let n=oU.QrCode.encodeText(r,aU[o]).getModules();const c=l?4:0,u=n.length+2*c,h=pU(n,i,l,d),f=m.current,g=null!=h&&null!==f&&f.complete&&0!==f.naturalHeight&&0!==f.naturalWidth;g&&null!=h.excavation&&(n=fU(n,h.excavation));const v=window.devicePixelRatio||1;e.height=e.width=i*v;const b=i/u*v;t.scale(b,b),t.fillStyle=a,t.fillRect(0,0,u,u),t.fillStyle=s,mU?t.fill(new Path2D(hU(n,c))):n.forEach((function(e,n){e.forEach((function(e,r){e&&t.fillRect(r+c,n+c,1,1)}))})),g&&t.drawImage(f,h.x+c,h.y+c,h.w,h.h)}})),(0,c.useEffect)((()=>{v(!1)}),[f]);const b=rU({height:i,width:i},u);let y=null;return null!=f&&(y=n(c).createElement("img",{src:f,key:f,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),n(c).createElement(n(c).Fragment,null,n(c).createElement("canvas",rU({style:b,height:i,width:i,ref:p},h)),y)}var vU=({url:e,title:t="",className:r,baseUrl:i,primary:o=!0,showQrCode:a=!0,align:s="right"})=>{const{t:l}=yo(),[u,d]=(0,c.useState)(e);(0,c.useEffect)((()=>{e||d(window.location.href)}),[e]);const h=[{id:"facebook",title:"Facebook",url:`https://www.facebook.com/sharer/sharer.php?u=${u}`,icon:GD},{id:"twitter",title:"Twitter",url:`https://twitter.com/intent/tweet?url=${u}`,icon:VD},{id:"linkedin",title:"LinkedIn",url:`https://www.linkedin.com/shareArticle?mini=true&title=${t}&url=${u}`,icon:WD},{id:"whatsapp",title:"Whatsapp",url:`https://api.whatsapp.com/send?phone=&text=${u}`,icon:qD},{id:"telegram",title:"Telegram",url:`https://t.me/share/url?text=${t}&url=${u}`,icon:YD},{id:"email",title:"Email",url:`mailto:?subject=${(null==t?void 0:t.length)>0?t:e}&body=${u}`,icon:KD}];return n(c).createElement(rb,{as:"div",className:n(md)("memori-share-button",{"memori-share-button--align-left":"left"===s})},n(c).createElement(rb.Button,{className:n(md)("memori-button","memori-button--circle","memori-button--icon-only","memori-share-button--button",r,{"memori-button--primary":o}),title:l("widget.share")||void 0},n(c).createElement("div",{className:"memori-button--icon"},n(c).createElement(JD,null))),n(c).createElement(rb.Items,{className:"memori-share-button--overlay",as:"ul"},n(c).createElement(rb.Item,{key:"copy",as:"li",className:"memori-share-button--li"},n(c).createElement(bd,{className:"memori-share-button--link",ghost:!0,icon:n(c).createElement(lm,null),onClick:()=>{u&&navigator.clipboard.writeText(u)}},l("copyToClipboard")||void 0)),h.map((e=>{var t;return n(c).createElement(rb.Item,{key:e.id,as:"li",className:"memori-share-button--li"},n(c).createElement("a",{className:n(md)("memori-button","memori-button--with-icon","memori-button--ghost","memori-button--padded","memori-share-button--link"),href:null!==(t=e.url)&&void 0!==t?t:"",target:"_blank",rel:"noopener noreferrer"},n(c).createElement("div",{className:"memori-button--icon"},n(c).createElement(e.icon,null)),e.title))})),a&&n(c).createElement(rb.Item,{key:"qrcode",as:"li",className:"memori-share-button--li-qr-code"},n(c).createElement(gU,{id:"qr-canvas",value:null!=u?u:"",size:128,bgColor:"#ffffff",fgColor:"#000000",level:"H",includeMargin:!1,imageSettings:{src:`${i||"https://app.twincreator.com"}/images/memori_logo.png`,x:void 0,y:void 0,height:32,width:32,excavate:!0}}),n(c).createElement("div",null,n(c).createElement(bd,{onClick:()=>{const e=document.getElementById("qr-canvas");if(console.log(),!e)return;const n=document.createElement("a");n.href=e.toDataURL(),n.download=`memori-${t}-share.png`,document.body.appendChild(n),n.click(),document.body.removeChild(n)},icon:n(c).createElement(QD,null),title:"Download QR"},"Download")))))};var bU=({className:e,memori:t,history:r,position:i,setShowPositionDrawer:o,setShowSettingsDrawer:a,speakerMuted:s,setSpeakerMuted:l,hasUserActivatedSpeak:u=!1,showShare:d=!0,showSettings:h=!0})=>{const{t:f}=yo();return n(c).createElement("div",{className:n(md)("memori-header",e)},t.needsPosition&&i&&n(c).createElement("div",{className:"memori-header--position"},n(c).createElement("span",{className:"memori-header--position-placeName"},i.placeName),n(c).createElement(bd,{icon:n(c).createElement(vD,null),shape:"circle",className:"memori-header--button",onClick:()=>o(!0)})),n(c).createElement(bd,{primary:!0,shape:"circle",className:"memori-header--button",icon:s?n(c).createElement(bD,null):n(c).createElement(wD,null),onClick:()=>l(!s),title:f("widget.sound")||"Sound"}),n(c).createElement(jD,{history:r,memori:t,className:"memori-header--button",disabled:!u||0===r.length}),h&&n(c).createElement(bd,{primary:!0,shape:"circle",className:"memori-header--button",icon:n(c).createElement(HD,null),onClick:()=>a(!0),title:f("widget.settings")||"Settings"}),d&&n(c).createElement(vU,{className:"memori-header--button",title:t.name,showQrCode:!0,align:"left"}))};c=o("85Hg2");var yU=({header:e,avatar:t,chat:r,startPanel:i,integrationStyle:o,integrationBackground:a,changeMode:s,sessionId:l,hasUserActivatedSpeak:u,showInstruct:d=!1,loading:h=!1})=>n(c).createElement(n(c).Fragment,null,o,a,n(c).createElement(Rf,{spinning:h},d&&s,e,n(c).createElement("div",{className:"memori--grid"},n(c).createElement("div",{className:"memori--grid-column memori--grid-column-left"},t),n(c).createElement("div",{className:"memori--grid-column memori--grid-column-right"},l&&u?r:i))));const wU={muteSpeaker:"@memori:muteSpeaker",continuousSpeech:"@memori:continuousSpeech",continuousSpeechTimeout:"@memori:continuousSpeechTimeout",sendOnEnter:"@memori:sendOnEnter"},SU=(e,t)=>{var n;const r=window.localStorage.getItem(null!==(n=wU[e])&&void 0!==n?n:e);if(!r)return t;try{return JSON.parse(r)}catch(e){return r}},xU=(e,t)=>{var n;window.localStorage.setItem(null!==(n=wU[e])&&void 0!==n?n:e,t.toString())},MU=new Map(Object.entries({TENANT_NOT_FOUND:-1,TENANT_REGISTRATION_DISABLED:-2,TENANT_MISSING_NAME:-3,TENANT_MAX_USERS_REACHED:-4,TENANT_MAX_ADMINS_REACHED:-5,USER_NOT_CONFIRMED:-11,USER_NOT_FOUND:-12,USER_OR_PASSWORD_INVALID:-13,USER_MUST_CHANGE_PASSWORD:-14,USER_MUST_ENTER_VERIFICATION_CODE:-15,USER_MISSING_TENANT:-21,USER_MISSING_NAME:-22,USER_MISSING_PASSWORD:-23,USER_MISSING_EMAIL:-24,USER_MISSING_VERIFICATION_CODE:-25,USER_NAME_ALREADY_USED:-26,USER_PASSWORD_NOT_CONFORMING_TO_POLICY:-27,USER_EMAIL_ALREADY_USED:-28,USER_EMAIL_INVALID:-29,USER_VERIFICATION_CODE_INVALID:-30,USER_MISSING_NAME_OR_EMAIL:-31,USER_NAME_INVALID:-32,USER_HAS_ONE_OR_MORE_MEMORI:-33,USER_MISSING_NEW_PASSWORD:-34,USER_CANT_CREATE_MEMORI:-35,USER_MAX_MEMORI_REACHED:-36,USER_CANT_EDIT_INTEGRATIONS:-37,MEMORI_NOT_FOUND:-51,MEMORI_NOT_ACCESSIBLE:-52,MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN:-53,SESSION_NOT_FOUND:-101,SESSION_IS_NOT_ADMINISTRATIVE:-102,MEMORI_MISSING_CONFIGURATION:-201,MEMORI_CONFIGURATION_NOT_FOUND:-202,MEMORI_INVALID_PRIVACY_TYPE:-203,MEMORI_MISSING_PASSWORD:-204,MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS:-205,MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS:-206,MEMORI_INVALID_VOICE_TYPE:-207,MEMORI_MISSING_NAME:-208,MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS:-209,MEMORI_INVALID_ID:-210,MEMORI_NAME_ALREADY_USED:-211,MEMORI_INVALID_PIN:-212,MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION:-213,MEMORI_NO_PASSWORD_WHEN_PUBLIC:-214,MEMORI_TRANSFER_MISSING_DESTINATION_USER:-231,MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID:-232,MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT:-233,MEMORI_TRANSFER_NOTHING_TO_DO:-234,MEMORI_CONFIGURATION_CANT_BE_CHANGED:-251,MEMORI_MISSING_NEW_PASSWORD:-252,MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT:-261,MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT:-262,INTEGRATION_NOT_FOUND:-301,INTEGRATION_INVALID_TYPE:-401,INTEGRATION_ALREADY_EXISTS:-402,INTEGRATION_MEMORI_IS_NOT_PUBLIC:-403,INTEGRATION_MISSING_INVOCATION_TEXT:-404,INTEGRATION_MISSING_DEVICE_EMAILS:-405,INTEGRATION_MEMORI_IS_EMPTY:-406,INTEGRATION_MISSING_PRIVACY_POLICY:-407,INTEGRATION_MISSING_CATEGORY:-408,INTEGRATION_MISSING_DESCRIPTION:-409,INTEGRATION_INVALID_INVOCATION_TEXT:-410,INTEGRATION_GOOGLE_NO_MORE_AVAILABLE:-411,UPLOAD_REQUIRES_MULTIPART_ENCODING:-501,UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY:-502,UPLOAD_MAX_LENGTH_EXCEEDED:-503,UPLOAD_FILE_IS_EMPTY:-504,UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE:-505,UPLOAD_MISSING_FILE_NAME:-506,UPLOAD_INVALID_MEMORY_ID:-507,UPLOAD_MISSING_FILE_CONTENT:-508,ASSET_NOT_FOUND:-601,ASSET_NOT_ACCESSIBLE:-602,ASSET_MISSING_SESSION_ID:-603,ASSET_INVALID_FILE_NAME:-604,INVITATION_NOT_FOUND:-701,INVITATION_NOT_ACCESSIBLE:-702,INVITATION_ALREADY_ACCEPTED:-703,INVITATION_ALREADY_REJECTED:-704,INVITATION_MISSING_DESTINATION_EMAIL:-705,INVITATION_DESTINATION_EMAIL_INVALID:-706,INVITATION_MISSING_TAG:-707,INVITATION_MISSING_PIN:-708,INVITATION_INVALID_PIN:-709,INVITATION_INVALID_TYPE:-710,INVITATION_MISSING_DESTINATION_NAME:-711,INVITATION_TAG_PIN_CANT_BE_CHANGED:-712,INVITATION_CANT_BE_CHANGED:-713,ACTIONLOG_INVALID_USER_ID:-801,ACTIONLOG_INVALID_DATE_FROM_FORMAT:-802,ACTIONLOG_INVALID_DATE_TO_FORMAT:-803,ACTIONLOG_INVALID_MEMORI_ID:-804,CONSUMPTIONLOG_INVALID_TYPE:-901,CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT:-902,CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT:-903,CONSUMPTIONLOG_INVALID_USER_ID:-904,CONSUMPTIONLOG_INVALID_MEMORI_ID:-905}).map((([e,t])=>[t,e]))),_U=e=>{if(!e)return"error.generic";if(401===e||403===e)return"error.unauthorized";if(404===e)return"error.notFound";if(422===e)return"error.unprocessableEntity";if(500===e)return"internal server error";let t=MU.get(e);return t?`errors.${t}`:"error.generic"},{deleteSession:AU,getStatistics:EU,initSession:CU}=Vi(),TU=new Map([[0,"🆕"],[10,"🐹"],[20,"🐇"],[30,"🐰"],[40,"💡"],[50,"🏆"],[60,"🏅"],[70,"🥉"],[80,"🥈"],[90,"🥇"],[100,"🔥"],[110,"🎓"],[120,"🤖"],[130,"👾"],[150,"🌍"],[180,"💜"],[200,"💙"],[250,"🧡"],[300,"💚"],[350,"💛"],[400,"💖"],[450,"💝"],[500,"🖤"],[550,"❤️"],[600,"🧠"]]),IU=e=>{const t=Array.from(TU.keys()).filter((t=>t<=e));if(t.length>0){const e=t[t.length-1];return TU.get(e)}return""},kU=e=>{if("🆕"===e)return{points:10,badge:"🐹"};let t,n,r=!1;for(const[i,o]of TU){if(r){t=i,n=o;break}o===e&&(r=!0)}return n&&t?{points:t,badge:n}:void 0},RU=e=>{let t=0;for(const[n,r]of TU)if(r===e){t=n;break}return t},OU=e=>{const t=Math.round(e),n=IU(t);return{points:t,badge:n,pointsForCurrentBadge:RU(n),nextBadge:kU(n)}};window.getMemoriState=e=>{var t,n,r,i,o;let a=e?document.querySelector(`.memori-widget[data-memori-integration="${e}"]`)||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector(".memori-widget[data-memori-integration]")):document.querySelector(".memori-widget")||(null===(i=null===(r=document.querySelector("memori-client"))||void 0===r?void 0:r.shadowRoot)||void 0===i?void 0:i.querySelector(".memori-widget"));if(!a)return null;let s=null===(o=a.dataset)||void 0===o?void 0:o.memoriEngineState;return s?JSON.parse(s):null},window.typeMessage=e=>{var t,n;let r=document.querySelector("fieldset#chat-fieldset textarea")||(null===(n=null===(t=document.querySelector("memori-client"))||void 0===t?void 0:t.shadowRoot)||void 0===n?void 0:n.querySelector("fieldset#chat-fieldset textarea"));r&&(!function(e,t){var n,r,i,o;const a=null===(r=null===(n=null==Object?void 0:Object.getOwnPropertyDescriptor)||void 0===n?void 0:n.call(Object,e,"value"))||void 0===r?void 0:r.set,s=Object.getPrototypeOf(e),l=null===(o=null===(i=null==Object?void 0:Object.getOwnPropertyDescriptor)||void 0===i?void 0:i.call(Object,s,"value"))||void 0===o?void 0:o.set;l&&a&&a!==l?l.call(e,t):a&&a.call(e,t)}(r,e),r.dispatchEvent(new Event("input",{bubbles:!0})),setTimeout((()=>{var e,t;let n=document.querySelector("fieldset#chat-fieldset textarea + button")||(null===(t=null===(e=document.querySelector("memori-client"))||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("fieldset#chat-fieldset textarea + button"));n&&n.click()}),100))};let PU,NU,BU,LU;var DU=({memori:e,memoriConfigs:t,memoriLang:r,integration:i,showInstruct:o=!1,showShare:a=!0,preview:s=!1,embed:l=!1,showInputs:u=!0,showDates:d=!1,showContextPerLine:h=!1,showSettings:f=!1,height:p="100vh",secret:m,baseUrl:g="https://app.twincreator.com",apiUrl:v="https://backend.memori.ai",initialContextVars:b,initialQuestion:y,ogImage:w,sessionID:S,tenant:x,personification:M,AZURE_COGNITIVE_SERVICES_TTS_KEY:_,onStateChange:A})=>{var E,C,T,I,k,R,O,P,N,B,L,D,U,F,z,j,H,G;const{t:V,i18n:W}=yo(),[q,K]=(0,c.useState)(!1);(0,c.useEffect)((()=>{K(!0)}),[]);const J=Vi(v),{initSession:Q,postTextEnteredEvent:X,postPlaceChangedEvent:Y,postTimeoutEvent:Z,postTagChangedEvent:$,getSession:ee,getContentQualityIndexes:te}=J,[ne,re]=(0,c.useState)(!1),[ie,oe]=(0,c.useState)(!1),[ae,se]=(0,c.useState)(!1),le=null===(I=null===(T=null===(C=null===(E=null==t?void 0:t.find((t=>t.memoriConfigID===e.memoriConfigurationID)))||void 0===E?void 0:E.culture)||void 0===C?void 0:C.split("-"))||void 0===T?void 0:T[0])||void 0===I?void 0:I.toUpperCase(),[ce,ue]=(0,c.useState)(null!==(N=null!==(P=null!==(O=null!=r?r:null===(R=null===(k=null==e?void 0:e.culture)||void 0===k?void 0:k.split("-"))||void 0===R?void 0:R[0])&&void 0!==O?O:le)&&void 0!==P?P:W.language)&&void 0!==N?N:"IT"),de=(null==i?void 0:i.customData)?JSON.parse(i.customData):null,he=!!(null==de?void 0:de.multilanguage),[fe,pe]=(0,c.useState)(!1),[me,ge]=(0,c.useState)(!1),[ve,be]=(0,c.useState)(!1),[ye,we]=(0,c.useState)(!1),[Se,xe]=(0,c.useState)(!1),[Me,_e]=(0,c.useState)(!1),[Ae,Ee]=(0,c.useState)(!1),[Ce,Te]=(0,c.useState)(!1),[Ie,ke]=(0,c.useState)(3),[Re,Oe]=(0,c.useState)(!1);(0,c.useEffect)((()=>{Oe(!!BU)}),[BU]),(0,c.useEffect)((()=>{Ee(SU("muteSpeaker",!1)),Te(SU("continuousSpeech",!1)),ke(SU("continuousSpeechTimeout",3))}),[]);const[Pe,Ne]=(0,c.useState)(m),[Be,Le]=(0,c.useState)(),[De,Ue]=(0,c.useState)(null),[Fe,ze]=(0,c.useState)(),je=async(e,t)=>{var n;const r=null!=t?t:Ze;if(e&&r){const{currentState:t,...i}=await Y({sessionId:r,placeName:e.placeName,latitude:e.latitude,longitude:e.longitude,uncertaintyKm:null!==(n=e.uncertainty)&&void 0!==n?n:0});t&&0===i.resultCode&&nt({...et,...t})}},[He,Ge]=(0,c.useState)(""),[Ve,We]=(0,c.useState)(!1),[qe,Je]=(0,c.useState)([]),Qe=e=>{Je((t=>[...t,{...e}]))},Xe=async(t,n,r,i=!0,o)=>{var a,s,l,c,u;if(!Ze||!(null==t?void 0:t.length))return;Qe({text:t,translatedText:o,fromUser:!0,media:null!=n?n:[],initial:!!r}),ge(!0);const d=null!==(c=null!==(l=null===(s=null===(a=e.culture)||void 0===a?void 0:a.split("-"))||void 0===s?void 0:s[0])&&void 0!==l?l:W.language)&&void 0!==c?c:"IT";let h=t;if(i&&!ne&&he&&ce.toUpperCase()!==d.toUpperCase()){h=(await pm(t,d,ce,g)).text}const{currentState:f,...p}=await X({sessionId:null!=r?r:Ze,text:h});if(0===p.resultCode&&f){const t=null!==(u=f.emission)&&void 0!==u?u:null==et?void 0:et.emission;if("X4"===f.state&&e.giverTag){const{currentState:t,...n}=await $(Ze,e.giverTag);0===n.resultCode?(nt(t),t.emission&&Qe({text:t.emission,media:t.media,fromUser:!1})):(console.error(p,n),gd.error(V(_U(n.resultCode),{ns:"common"})))}else if("X2d"===f.state&&e.giverTag){const{currentState:t,...n}=await X({sessionId:null!=r?r:Ze,text:Math.random().toString().substring(2,8)});if(0===n.resultCode){const{currentState:t,...n}=await $(Ze,e.giverTag);0===n.resultCode?(nt(t),t.emission&&Qe({text:t.emission,media:t.media,fromUser:!1})):(console.error(p,n),gd.error(V(_U(n.resultCode),{ns:"common"})))}else console.error(p,n),gd.error(V(_U(n.resultCode),{ns:"common"}))}else ce.toLowerCase()!==d.toLowerCase()&&t&&!ne&&he?Ye(f,ce):(nt({...f,emission:t}),t&&Qe({text:t,media:f.media,fromUser:!1}))}else Je((e=>[...e.slice(0,e.length-1)])),it(!1,Pe||e.secretToken,Be,ne&&e.giverTag?e.giverTag:void 0,ne&&e.giverPIN?e.giverPIN:void 0,b,y).then((e=>{console.info("session timeout"),e&&setTimeout((()=>{Xe(t,n,e)}),500)}));ge(!1)},Ye=async(t,n)=>{var r,i,o,a,s,l;const c=null!==(a=null!==(o=null===(i=null===(r=e.culture)||void 0===r?void 0:r.split("-"))||void 0===i?void 0:i[0])&&void 0!==o?o:W.language)&&void 0!==a?a:"IT",u=null!==(s=t.emission)&&void 0!==s?s:null==et?void 0:et.emission;let d={...t},h=null;if(u&&!ne&&c.toUpperCase()!==n.toUpperCase()&&he){const e=await pm(u,n,c,g);if(t.hints&&t.hints.length>0){const r=await Promise.all((null!==(l=t.hints)&&void 0!==l?l:[]).map((async e=>{var t;const r=await pm(e,n,c,g);return{text:null!==(t=null==r?void 0:r.text)&&void 0!==t?t:e,originalText:e}})));d={...t,emission:e.text,translatedHints:r}}else d={...t,emission:e.text};e.text.length>0&&(h={text:e.text,media:t.media,fromUser:!1})}else d={...t,emission:u},u&&(h={text:u,media:t.media,fromUser:!1});return nt(d),h&&Qe(h),d},[Ze,$e]=(0,c.useState)(S),[et,tt]=(0,c.useState)(),nt=e=>{tt(e),A&&A(e)},rt=async t=>{var n,r,i,o,a;if("PUBLIC"===e.privacyType||e.secretToken||Pe||Be){pe(!0);try{if(!e.giverTag&&(null===(n=e.receivedInvitations)||void 0===n?void 0:n.length)){let t=e.receivedInvitations.find((e=>"GIVER"===e.type&&"ACCEPTED"===e.state));t&&(e.giverTag=t.tag,e.giverPIN=t.pin)}const s=await Q(t);if((null==s?void 0:s.sessionID)&&(null==s?void 0:s.currentState)&&0===s.resultCode){$e(s.sessionID);const t=null!==(a=null!==(o=null===(i=null===(r=e.culture)||void 0===r?void 0:r.split("-"))||void 0===i?void 0:i[0])&&void 0!==o?o:W.language)&&void 0!==a?a:"IT";return!ne&&he&&ce.toLowerCase()!==t.toLowerCase()?Ye(s.currentState,ce).then((e=>{(null==e?void 0:e.emission)&&(qe.length<=1?Je([{text:e.emission,media:e.media,fromUser:!1,initial:!0}]):Qe({text:e.emission,media:e.media,fromUser:!1,initial:!0}))})):(nt(s.currentState),s.currentState.emission&&(qe.length<=1?Je([{text:s.currentState.emission,media:s.currentState.media,fromUser:!1,initial:!0}]):Qe({text:s.currentState.emission,media:s.currentState.media,fromUser:!1,initial:!0}))),Fe&&je(Fe,s.sessionID),pe(!1),{dialogState:s.currentState,sessionID:s.sessionID}}console.error(s),gd.error(V(_U(null==s?void 0:s.resultCode),{ns:"common"})),se(!0)}catch(e){console.error(e),new Error("Error fetching session")}}else Ue("password")},it=async(t=!1,n,r,i,o,a,s)=>{var l;pe(!0);try{const{sessionID:c,currentState:u,...d}=await Q({memoriID:null!==(l=e.engineMemoriID)&&void 0!==l?l:"",password:n,recoveryTokens:r,tag:i,pin:o,initialContextVars:a,initialQuestion:s});if(c&&u&&0===d.resultCode)return $e(c),t&&(nt(u),u.emission&&(qe.length<=1?Je([{text:u.emission,media:u.media,fromUser:!1}]):Qe({text:u.emission,media:u.media,fromUser:!1}))),Fe&&je(Fe,c),pe(!1),c;console.error(d),gd.error(V(_U(d.resultCode),{ns:"common"})),se(!0)}catch(e){console.error(e)}return pe(!1),null},ot=async(t,n,r,i)=>{var o;if(!t||!n)return console.error("CHANGETAG/Session not found"),Promise.reject("Session not found");try{const{currentState:t,resultCode:a}=await $(n,null!=r?r:gm);if(0===a){let s=0;if(r!==gm&&i&&("X1a"===t.state||"X1b"===t.state)){const{resultCode:e}=await X({sessionId:n,text:null!=i?i:""});s=e}if(0===s){const{currentState:e,...t}=await ee(n);if(0===t.resultCode&&e)return{currentState:e,sessionId:n,...t}}else if([400,401,403,404,500].includes(a))console.warn("[APPCONTEXT/CHANGETAG]",a),rt({memoriID:null!==(o=e.engineMemoriID)&&void 0!==o?o:"",password:m||e.secretToken,tag:e.giverTag,pin:e.giverPIN,initialContextVars:b,initialQuestion:y});else if(t)return{currentState:t,sessionId:n,resultCode:a}}}catch(e){let t=e;return console.error("[APPCONTEXT/CHANGETAG]",t),Promise.reject(t)}return null};(0,c.useEffect)((()=>()=>{et&&(null==et?void 0:et.currentTag)===e.giverTag||(async()=>{Ze&&e.giverTag&&e.giverPIN&&(Je([]),await ot(e.engineMemoriID,Ze,e.giverTag,e.giverPIN))})()}),[]);const[at,st]=(0,c.useState)(),lt=(0,c.useRef)(),ct=()=>{at&&(clearTimeout(at),st(void 0)),(null==lt?void 0:lt.current)&&(clearTimeout(lt.current),lt.current=void 0)},ut=()=>{ct(),!(null==et?void 0:et.acceptsTimeout)||BU||Re||He.length||Ve||ht()},dt=async()=>{if(BU||Re||He.length||Ve)ut();else if(Ze&&ve&&(null==et?void 0:et.acceptsTimeout)){const{currentState:e,...t}=await Z(Ze);if(0===t.resultCode&&e){const t=e.emission;!ne&&he&&ce!==(null==W?void 0:W.language)&&t&&t.length>0?Ye({...e,emission:t},ce):t&&t.length>0?(Qe({text:t,media:e.media,fromUser:!1}),nt(e)):nt({...e})}}},ht=()=>{let e=null==et?void 0:et.timeout;if(!e){let t=40,n=25;if(e=Math.floor(Math.random()*(t-n))+n,null==et?void 0:et.emission){e+=et.emission.length/26.5}}let t=setTimeout(dt,1e3*e);st(t),lt.current=t};(0,c.useEffect)((()=>{(He.length||Re)&&ct(),Ze&&!He.length&&ut()}),[null==et?void 0:et.acceptsTimeout,null==et?void 0:et.timeout,null==et?void 0:et.state,Re,Ze,qe,He]),(0,c.useEffect)((()=>()=>{be(!1),oe(!1),ct(),lt.current=void 0}),[]);(0,c.useEffect)((()=>()=>{LU&&LU.pause(),BU&&(BU.close(),BU=null)}),[]);const ft=(0,c.useCallback)((t=>{var n,r,i,o;let a="";switch((null!==(o=null!==(i=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==i?i:W.language)&&void 0!==o?o:"IT").toUpperCase()){case"IT":a=""+("MALE"===e.voiceType?"it-IT-DiegoNeural":"it-IT-ElsaNeural");break;case"DE":a=""+("MALE"===e.voiceType?"de-DE-ConradNeural":"de-DE-KatjaNeural");break;case"EN":a=""+("MALE"===e.voiceType?"en-GB-RyanNeural":"en-GB-SoniaNeural");break;case"ES":a=""+("MALE"===e.voiceType?"es-ES-AlvaroNeural":"es-ES-ElviraNeural");break;case"FR":a=""+("MALE"===e.voiceType?"fr-FR-HenriNeural":"fr-FR-DeniseNeural");break;case"PT":a=""+("MALE"===e.voiceType?"pt-PT-DuarteNeural":"pt-PT-RaquelNeural");break;case"UK":a=""+("MALE"===e.voiceType?"uk-UA-OstapNeural":"uk-UA-PolinaNeural");break;case"RU":a=""+("MALE"===e.voiceType?"ru-RU-DmitryNeural":"ru-RU-SvetlanaNeural");break;default:a=""+("MALE"===e.voiceType?"it-IT-DiegoNeural":"it-IT-IsabellaNeural")}return a}),[e.voiceType,W.language,e.culture]),pt=t=>{var n,r,i;let o="";switch((null!==(i=null!=t?t:null===(r=null===(n=e.culture)||void 0===n?void 0:n.split("-"))||void 0===r?void 0:r[0])&&void 0!==i||W.language,"IT").toUpperCase()){case"IT":default:o="it-IT";break;case"DE":o="de-DE";break;case"EN":o="en-GB";break;case"ES":o="es-ES";break;case"FR":o="fr-FR";break;case"PT":o="pt-PT";break;case"UK":o="uk-UK";break;case"RU":o="ru-RU"}return o},[mt,gt]=(0,c.useState)();(0,c.useEffect)((()=>{(async()=>{try{const e=await fetch(`${g||"https://app.twincreator.com"}/api/lexiconmap`);return await e.json()}catch(e){console.error(e)}})().then((e=>{gt(e)}))}),[]);const vt=(e,t=!0)=>{if(!_)return;if(s||!ve)return;if(LU&&LU.pause(),BU&&(BU.close(),BU=null),Ae&&t)return void setTimeout((()=>{document.dispatchEvent(new Event("endSpeakStartListen"))}),3e3);if(Ae)return;LU=new jr.SpeakerAudioDestination;let n=qr.fromSpeakerOutput(LU);BU=new oi.SpeechSynthesizer(NU,n),LU.onAudioEnd=()=>{Oe(!1),t&&document.dispatchEvent(new Event("endSpeakStartListen"))},Oe(!0),BU.speakSsmlAsync(`<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis" xmlns:mstts="https://www.w3.org/2001/mstts" xmlns:emo="http://www.w3.org/2009/10/emotionml" xml:lang="${pt(ce)}"><voice name="${ft(ce)}"><s>${((e,t)=>{var n;if(!mt)return e;const r={...null!==(n=mt.common)&&void 0!==n?n:{},...(null==x?void 0:x.id)&&mt[x.id]?mt[x.id]:{}},i=Object.keys(r).map((e=>{var n;return{word:e,phoneme:null!==(n=r[e][t])&&void 0!==n?n:r[e].default}}));return i.reduce(((e,{word:t,phoneme:n})=>e.replace(new RegExp(t,"gi"),`<phoneme alphabet="ipa" ph="${n}">${t}</phoneme>`)),e)})(e,ce.toLowerCase())}</s></voice></speak>`,(t=>{if(t)try{BU&&(BU.close(),BU=null)}catch(t){console.error("speak error: ",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),Oe(!1)}else Oe(!1)}),(t=>{console.error("speak:",t),window.speechSynthesis.speak(new SpeechSynthesisUtterance(e)),Oe(!1)}))};(0,c.useEffect)((()=>{let e=document.querySelector("#chat-fieldset textarea");e&&e.focus()}),[null==et?void 0:et.emission]);const[bt,wt]=(0,c.useState)(""),St=()=>wt(""),[xt,Mt]=(0,c.useState)(null),_t=()=>{xt&&(clearTimeout(xt),Mt(null))},At=()=>{_t(),Ce&&(()=>{let e=setTimeout((async()=>{Tt();const e=rm(bt);e.length>0?(Xe(e),St(),Ge("")):Ve&&ut()}),1e3*Ie);Mt(e)})()};(0,c.useEffect)((()=>{if(At(),ut(),(null==bt?void 0:bt.length)>0){const e=rm(bt);e.length>0&&Ge(e)}}),[bt]);const Et=()=>{if(_){Tt(),wt("");try{navigator.mediaDevices.getUserMedia({audio:!0}).then((function(e){we(!0),NU||(NU=hn.fromSubscription(_,"eastus"),NU.speechRecognitionLanguage=pt(ce));const t=qr.fromDefaultMicrophoneInput();PU=new Qr.SpeechRecognizer(NU,t),We(!0),PU.recognized=(e,t)=>{var n;t.result.reason===yt.RecognizedSpeech?wt(null!==(n=t.result.text)&&void 0!==n?n:""):t.result.reason===yt.NoMatch&&console.debug("NOMATCH: Speech could not be recognized.")},PU.canceled=(e,t)=>{t.reason===Ke.Error&&(console.debug(`"CANCELED: ErrorCode=${t.errorCode}`),console.debug(`"CANCELED: ErrorDetails=${t.errorDetails}`),console.debug("CANCELED: Did you set the speech resource key and region values?")),Ct()},PU.sessionStopped=(e,t)=>{PU&&PU.stopContinuousRecognitionAsync()},PU.startContinuousRecognitionAsync()})).catch(console.error)}catch(e){console.error(e)}}},Ct=()=>{PU&&(PU.stopContinuousRecognitionAsync(),PU.close(),PU=null,We(!1))},Tt=()=>{we(!1),Ct(),_t()};(0,c.useEffect)((()=>()=>Tt()),[]),(0,c.useEffect)((()=>{"Z0"===(null==et?void 0:et.state)&&Tt()}),[null==et?void 0:et.state]),(0,c.useEffect)((()=>{ve&&!s&&!Ae&&qe.length>0&&(null==et?void 0:et.emission)&&vt(et.emission,"Z0"!==et.state)}),[et,ve]);const[It,kt]=(0,c.useState)(!1),Rt=(0,c.useCallback)((e=>{Re&&BU&&(BU.close(),BU=null),!Ce||!ye&&It||(kt(!0),Et())}),[Ce,ye]);(0,c.useEffect)((()=>{!Re&&Ce&&ye?Et():Re&&Ve&&Ct()}),[Re]),(0,c.useEffect)((()=>(document.addEventListener("endSpeakStartListen",Rt),()=>{document.removeEventListener("endSpeakStartListen",Rt)})),[Rt]),(0,c.useEffect)((()=>{Ve&&(Tt(),St(),Ge(""),Et())}),[le]);const[Ot,Pt]=(0,c.useState)("keypress");(0,c.useEffect)((()=>{const e=SU("sendOnEnter","keypress");Pt(e)}),[]),(0,c.useEffect)((()=>{xU("sendOnEnter",Ot)}),[Ot]);const[Nt,Bt]=(0,c.useState)(),Lt=null==de?void 0:de.globalBackground,Dt=Lt?`url(${Lt})`:null,Ut=i?{"--memori-chat-bubble-bg":"#fff",...de&&!o?{"--memori-text-color":null!==(B=de.textColor)&&void 0!==B?B:"#000"}:{},...(null==de?void 0:de.buttonBgColor)?{"--memori-button-bg":de.buttonBgColor,"--memori-primary":de.buttonBgColor}:{},...(null==de?void 0:de.buttonTextColor)?{"--memori-button-text":de.buttonTextColor}:{},...(null==de?void 0:de.blurBackground)?{"--memori-blur-background":"5px"}:{"--memori-blur-background":"0px"},...(null==de?void 0:de.innerBgColor)?{"--memori-inner-bg":`rgba(${"dark"===de.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(L=de.innerBgAlpha)&&void 0!==L?L:.4})`,"--memori-inner-content-pad":"1.5rem","--memori-nav-bg-image":"none","--memori-nav-bg":`rgba(${"dark"===de.innerBgColor?"0, 0, 0":"255, 255, 255"}, ${null!==(D=null==de?void 0:de.innerBgAlpha)&&void 0!==D?D:.4})`}:{"--memori-inner-content-pad":"0px"}}:{},Ft=`\n ${s?"#preview":":root"}, .memori-widget {\n ${Object.entries(Ut).map((([e,t])=>`${e}: ${t};`)).join("\n")}\n }\n `,[zt,jt]=(0,c.useState)(!0),[Ht,Gt]=(0,c.useState)();(0,c.useEffect)((()=>{e.engineMemoriID&&(async e=>{let t,n;try{const{contentQualityIndex:r,answerQualityIndex:i,unansweredQuestions:o,...a}=await te(e);0===a.resultCode&&(t=r,n=o)}catch(e){let t=e;console.error("[APPCONTEXT/QUERYGAMIFICATIONPOINTS]",t)}return{points:null!=t?t:0,unansweredQuestions:null!=n?n:0}})(e.engineMemoriID).then((e=>{Gt(OU(e.points))})).catch(console.error)}),[e.engineMemoriID]),(0,c.useEffect)((()=>{if(null==de?void 0:de.seoTitle){let e=document.createElement("meta");e.setAttribute("property","og:title"),e.setAttribute("content",de.seoTitle),document.head.append(e)}if(null==de?void 0:de.seoDescription){let e=document.createElement("meta");e.setAttribute("property","og:description"),e.setAttribute("content",de.seoDescription),document.head.append(e)}if(null==de?void 0:de.seoUrl){let e=document.createElement("meta");e.setAttribute("property","og:url"),e.setAttribute("content",de.seoUrl),document.head.append(e)}let t=w||e.avatarURL;if((null==de?void 0:de.seoImageShowAvatar)&&t){let e=document.createElement("meta");e.setAttribute("property","og:image"),e.setAttribute("content",t),document.head.append(e)}}),[de,e.avatarURL,w]);const Vt=async t=>{const n=(null==t?void 0:t.sessionID)||Ze,r=(null==t?void 0:t.dialogState)||et;if(oe(!0),(()=>{if(!_)return;NU=hn.fromSubscription(_,"eastus"),NU.speechSynthesisLanguage=pt(ce),NU.speechSynthesisVoiceName=ft(ce),nm()&&(NU.speechSynthesisOutputFormat=Zt.Audio16Khz32KBitRateMonoMp3);let e=document.getElementById("memori-audio");e&&window.navigator.userAgent.includes("Safari")&&(e.muted=!1,e.play().then((async()=>{try{const e=new Wu;let t=e.createBuffer(1,1,22050),n=e.createBufferSource();n.buffer=t,n.connect(e.destination)}catch(e){console.error(e)}})).catch((e=>{console.error("error playing intro audio",e)})))})(),!n&&"PUBLIC"!==e.privacyType&&!e.secretToken&&!Pe&&!Be||!n&&ae)return Ue("password"),void oe(!1);if(n)if(S){const{currentState:t,...r}=await ee(n);if(0!==r.resultCode||!t)return console.debug("session expired, opening new session"),se(!0),$e(void 0),oe(!1),void Vt();if(Je([]),ne&&e.giverTag&&(null==et?void 0:et.currentTag)!==e.giverTag)try{console.debug("change tag #0"),await ot(e.engineMemoriID,n,"-");const t=await ot(e.engineMemoriID,n,e.giverTag,e.giverPIN);if(!t||0!==t.resultCode)throw console.error("session #1",t),new Error("No session");Ye(t.currentState,ce).finally((()=>{be(!0)}))}catch(t){console.error("session #2",t),it(!0,null==e?void 0:e.secretToken,void 0,null==e?void 0:e.giverTag,null==e?void 0:e.giverPIN,b,y).then((()=>{be(!0)}))}else if(!ne&&M&&(null==et?void 0:et.currentTag)!==M.tag)try{console.debug("change tag #3"),await ot(e.engineMemoriID,n,"-");const t=await ot(e.engineMemoriID,n,M.tag,M.pin);if(!t||0!==t.resultCode)throw console.error("session #4",t),new Error("No session");Ye(t.currentState,ce).finally((()=>{be(!0)}))}catch(t){console.error("session #5",t),it(!0,null==e?void 0:e.secretToken,void 0,M.tag,M.pin,b,y).then((()=>{be(!0)}))}else if(ne||M||(null==et?void 0:et.currentTag)===gm)Ye(t,ce).finally((()=>{be(!0)}));else try{console.debug("change tag #6"),await ot(e.engineMemoriID,n,"-");const t=await ot(e.engineMemoriID,n,gm);if(!t||0!==t.resultCode)throw console.error("session #7",t),new Error("No session");Ye(t.currentState,ce).finally((()=>{be(!0)}))}catch(t){console.error("session #8",t),it(!0,null==e?void 0:e.secretToken,void 0,void 0,void 0,b,y).then((()=>{be(!0)}))}}else Je([]),Ye(r,ce).finally((()=>{be(!0)}));else{oe(!1),se(!1);const t=await rt({memoriID:e.engineMemoriID,password:m||e.secretToken,tag:null==M?void 0:M.tag,pin:null==M?void 0:M.pin,initialContextVars:b,initialQuestion:y});Vt(t||void 0)}},Wt=n(c).createElement(bU,{memori:e,history:qe,showShare:a,position:Fe,setShowPositionDrawer:xe,setShowSettingsDrawer:_e,speakerMuted:Ae,setSpeakerMuted:Ee,showSettings:f,hasUserActivatedSpeak:ve}),qt=n(c).createElement(mD,{memori:e,integration:i,integrationConfig:de,tenant:x,instruct:ne,avatar3dVisible:zt,setAvatar3dVisible:jt,hasUserActivatedSpeak:ve,isPlayingAudio:Re,baseUrl:g}),Kt=n(c).createElement(Fb,{memori:e,tenant:x,gamificationLevel:Ht,language:le,userLang:ce,setUserLang:ue,baseUrl:g,position:Fe,openPositionDrawer:()=>xe(!0),integrationConfig:de,instruct:ne,sessionId:Ze,clickedStart:ie,onClickStart:Vt}),Jt=Ze?n(c).createElement(Bb,{memori:e,sessionID:Ze,tenant:x,translateTo:he&&ce.toUpperCase()!==(null===(H=null!==(j=null!==(z=null===(F=null===(U=e.culture)||void 0===U?void 0:U.split("-"))||void 0===F?void 0:F[0])&&void 0!==z?z:W.language)&&void 0!==j?j:"IT")||void 0===H?void 0:H.toUpperCase())?ce:void 0,baseUrl:g,memoriTyping:me,history:qe,dialogState:et,setDialogState:nt,pushMessage:Qe,simulateUserPrompt:(e,t)=>{Ct(),Xe(e,void 0,void 0,!1,t)},showDates:d,showContextPerLine:h,client:J,selectReceiverTag:async t=>{var n;if(Ze)try{const{currentState:r,...i}=await $(Ze,t);if(0===i.resultCode)if(Qe({text:t,fromUser:!0}),"X4"===r.state&&e.giverTag){const{currentState:t,...n}=await J.postTagChangedEvent(Ze,e.giverTag);0===n.resultCode?(nt(t),t.emission&&Qe({text:t.emission,media:t.media,fromUser:!1})):(console.error(n),gd.error(V(_U(n.resultCode),{ns:"common"})))}else nt(r),r.emission&&Qe({text:r.emission,media:r.media,fromUser:!1});else console.error(i,t,null===(n=null==et?void 0:et.knownTags)||void 0===n?void 0:n[t]),gd.error(V(_U(i.resultCode),{ns:"common"}))}catch(e){let t=e;console.error(t),gd.error(t.message)}},preview:s,sendOnEnter:Ot,setSendOnEnter:Pt,attachmentsMenuOpen:Nt,setAttachmentsMenuOpen:Bt,instruct:ne,showInputs:u,showMicrophone:!!_,userMessage:He,onChangeUserMessage:e=>{if(!e||"\n"===e||""===e.trim())return Ge(""),void ut();Ge(e),ct()},sendMessage:e=>{Ct(),Xe(e),Ge(""),St()},stopListening:Tt,startListening:Et,stopAudio:()=>{BU&&(BU.close(),BU=null)},resetTranscript:St,listening:Ve,isPlayingAudio:Re}):null,Qt=i&&Dt?n(c).createElement("div",{className:"memori--global-background"},n(c).createElement("div",{className:"memori--global-background-image",style:{backgroundImage:Dt}})):null,Xt=i?n(c).createElement("style",{dangerouslySetInnerHTML:{__html:Ft}}):null,Yt=n(c).createElement(gD,{canInstruct:!!e.giverTag,instruct:ne,onChangeMode:e=>{re("instruct"===e),be(!1),oe(!1)}});return n(c).createElement("div",{className:n(md)("memori","memori-widget",{"memori--preview":s,"memori--embed":l,"memori--with-integration":i,"memori--active":ve}),"data-memori-name":null==e?void 0:e.name,"data-memori-id":null==e?void 0:e.engineMemoriID,"data-memori-secondary-id":null==e?void 0:e.memoriID,"data-memori-session-id":Ze,"data-memori-integration":null==i?void 0:i.integrationID,"data-memori-engine-state":JSON.stringify({...et,sessionID:Ze}),style:{height:p}},n(c).createElement(yU,{header:Wt,avatar:qt,chat:Jt,startPanel:Kt,integrationStyle:Xt,integrationBackground:Qt,changeMode:Yt,sessionId:Ze,hasUserActivatedSpeak:ve,showInstruct:o,loading:fe}),q&&n(c).createElement(tm,{withModal:!0,pwdOrTokens:De,openModal:!!De,setPwdOrTokens:Ue,showTokens:"SECRET"===e.privacyType,onFinish:async t=>{t.password&&Ne(t.password),t.tokens&&Le(t.tokens),it(!Ze,t.password,t.tokens,ne?e.giverTag:void 0,ne?e.giverPIN:void 0,b,y).then((()=>{Ue(null),be(!0)})).catch((()=>{Ue(null),se(!0)}))},minimumNumberOfRecoveryTokens:null!==(G=null==e?void 0:e.minimumNumberOfRecoveryTokens)&&void 0!==G?G:1}))};function UU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FU(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tD(r.key),r)}}function zU(e,t,n){return t&&FU(e.prototype,t),n&&FU(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function jU(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HU(e,t){return HU=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},HU(e,t)}function GU(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&HU(e,t)}function VU(e,t){if(t&&("object"===$L(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return jU(e)}function WU(e){return WU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},WU(e)}function qU(e){if(Array.isArray(e))return e}function KU(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function JU(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 QU(e,t){if(e){if("string"==typeof e)return JU(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?JU(e,t):void 0}}function XU(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function YU(e){return qU(e)||KU(e)||QU(e)||XU()}function ZU(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 $U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ZU(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZU(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var eF={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},tF=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};UU(this,e),this.init(t,n)}return zU(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||eF,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,$U($U({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),nF=new tF,rF=function(){function e(){UU(this,e),this.observers={}}return zU(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(this.observers[e]){var i=[].concat(this.observers[e]);i.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function iF(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function oF(e){return null==e?"":""+e}function aF(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function sF(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var a=r(o.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function lF(e,t,n){var r=sF(e,t,Object);r.obj[r.k]=n}function cF(e,t){var n=sF(e,t),r=n.obj,i=n.k;if(r)return r[i]}function uF(e,t,n){var r=cF(e,n);return void 0!==r?r:cF(t,n)}function dF(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):dF(e[r],t[r],n):e[r]=t[r]);return e}function hF(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var fF={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function pF(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return fF[e]})):e}var mF="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,gF=[" ",",","?","!",";"];function vF(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 bF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vF(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yF(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return VU(this,n)}}function wF(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),i=e,o=0;o<r.length;++o){if(!i)return;if("string"==typeof i[r[o]]&&o+1<r.length)return;if(void 0===i[r[o]]){for(var a=2,s=r.slice(o,o+a).join(n),l=i[s];void 0===l&&r.length>o+a;)a++,l=i[s=r.slice(o,o+a).join(n)];if(void 0===l)return;if(null===l)return null;if(t.endsWith(s)){if("string"==typeof l)return l;if(s&&"string"==typeof l[s])return l[s]}var c=r.slice(o+a).join(n);return c?wF(l,c,n):void 0}i=i[r[o]]}return i}}var SF=function(e){GU(n,e);var t=yF(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return UU(this,n),r=t.call(this),mF&&rF.call(jU(r)),r.data=e||{},r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),void 0===r.options.ignoreJSONStructure&&(r.options.ignoreJSONStructure=!0),r}return zU(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."));var s=cF(this.data,a);return s||!o||"string"!=typeof n?s:wF(this.data&&this.data[e]&&this.data[e][t],n,i)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var a=[e,t];n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),lF(this.data,a,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var s=cF(this.data,a)||{};r?dF(s,n,i):s=bF(bF({},s),n),lF(this.data,a,s),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?bF(bF({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(rF),xF={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}};function MF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _F(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?MF(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function AF(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return VU(this,n)}}var EF={},CF=function(e){GU(n,e);var t=AF(n);function n(e){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return UU(this,n),r=t.call(this),mF&&rF.call(jU(r)),aF(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,jU(r)),r.options=i,void 0===r.options.keySeparator&&(r.options.keySeparator="."),r.logger=nF.create("translator"),r}return zU(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=gF.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var i=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!i.test(e);if(!o){var a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o}(e,n,r));if(o&&!a){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:i};var l=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(l[0])>-1)&&(i=l.shift()),e=l.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,t,r){var i=this;if("object"!==$L(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),l=s.key,c=s.namespaces,u=c[c.length-1],d=t.lng||this.language,h=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&"cimode"===d.toLowerCase()){if(h){var f=t.nsSeparator||this.options.nsSeparator;return o?(p.res="".concat(u).concat(f).concat(l),p):"".concat(u).concat(f).concat(l)}return o?(p.res=l,p):l}var p=this.resolve(e,t),m=p&&p.res,g=p&&p.usedKey||l,v=p&&p.exactUsedKey||l,b=Object.prototype.toString.apply(m),y=["[object Number]","[object Function]","[object RegExp]"],w=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,x="string"!=typeof m&&"boolean"!=typeof m&&"number"!=typeof m;if(S&&m&&x&&y.indexOf(b)<0&&("string"!=typeof w||"[object Array]"!==b)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,m,_F(_F({},t),{},{ns:c})):"key '".concat(l," (").concat(this.language,")' returned an object instead of string.");return o?(p.res=M,p):M}if(a){var _="[object Array]"===b,A=_?[]:{},E=_?v:g;for(var C in m)if(Object.prototype.hasOwnProperty.call(m,C)){var T="".concat(E).concat(a).concat(C);A[C]=this.translate(T,_F(_F({},t),{joinArrays:!1,ns:c})),A[C]===T&&(A[C]=m[C])}m=A}}else if(S&&"string"==typeof w&&"[object Array]"===b)(m=m.join(w))&&(m=this.extendTranslation(m,e,t,r));else{var I=!1,k=!1,R=void 0!==t.count&&"string"!=typeof t.count,O=n.hasDefaultValue(t),P=R?this.pluralResolver.getSuffix(d,t.count,t):"",N=t["defaultValue".concat(P)]||t.defaultValue;!this.isValidLookup(m)&&O&&(I=!0,m=N),this.isValidLookup(m)||(k=!0,m=l);var B=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,L=B&&k?void 0:m,D=O&&N!==m&&this.options.updateMissing;if(k||I||D){if(this.logger.log(D?"updateKey":"missingKey",d,u,l,D?N:m),a){var U=this.resolve(l,_F(_F({},t),{},{keySeparator:!1}));U&&U.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var F=[],z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&z&&z[0])for(var j=0;j<z.length;j++)F.push(z[j]);else"all"===this.options.saveMissingTo?F=this.languageUtils.toResolveHierarchy(t.lng||this.language):F.push(t.lng||this.language);var H=function(e,n,r){var o=O&&r!==m?r:L;i.options.missingKeyHandler?i.options.missingKeyHandler(e,u,n,o,D,t):i.backendConnector&&i.backendConnector.saveMissing&&i.backendConnector.saveMissing(e,u,n,o,D,t),i.emit("missingKey",e,u,n,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?F.forEach((function(e){i.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],l+n,t["defaultValue".concat(n)]||N)}))})):H(F,l,N))}m=this.extendTranslation(m,e,t,p,r),k&&m===l&&this.options.appendNamespaceToMissingKey&&(m="".concat(u,":").concat(l)),(k||I)&&this.options.parseMissingKeyHandler&&(m="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(l):l,I?m:void 0):this.options.parseMissingKeyHandler(m))}return o?(p.res=m,p):m}},{key:"extendTranslation",value:function(e,t,n,r,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,_F(_F({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(_F(_F({},n),{interpolation:_F(_F({},this.options.interpolation),n.interpolation)}));var a,s="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var l=e.match(this.interpolator.nestingRegexp);a=l&&l.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=_F(_F({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),s){var u=e.match(this.interpolator.nestingRegexp);a<(u&&u.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return i&&i[0]===r[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):o.translate.apply(o,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var d=n.postProcess||this.options.postProcess,h="string"==typeof d?[d]:d;return null!=e&&h&&h.length&&!1!==n.applyPostProcessor&&(e=xF.handle(h,e,t,this.options&&this.options.postProcessPassResolved?_F({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,a=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var l=a.extractFromKey(e,s),c=l.key;n=c;var u=l.namespaces;a.options.fallbackNS&&(u=u.concat(a.options.fallbackNS));var d=void 0!==s.count&&"string"!=typeof s.count,h=d&&!s.ordinal&&0===s.count&&a.pluralResolver.shouldUseIntlApi(),f=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,p=s.lngs?s.lngs:a.languageUtils.toResolveHierarchy(s.lng||a.language,s.fallbackLng);u.forEach((function(e){a.isValidLookup(t)||(o=e,!EF["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(o)&&(EF["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){i=n;var o,l=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(l,c,n,e,s);else{var u;d&&(u=a.pluralResolver.getSuffix(n,s.count,s));var p="".concat(a.options.pluralSeparator,"zero");if(d&&(l.push(c+u),h&&l.push(c+p)),f){var m="".concat(c).concat(a.options.contextSeparator).concat(s.context);l.push(m),d&&(l.push(m+u),h&&l.push(m+p))}}for(;o=l.pop();)a.isValidLookup(t)||(r=o,t=a.getResource(n,e,o,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}(rF);function TF(e){return e.charAt(0).toUpperCase()+e.slice(1)}var IF=function(){function e(t){UU(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=nF.create("languageUtils")}return zU(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=TF(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=TF(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=TF(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),kF=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],RF={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},OF=["v1","v2","v3"],PF={zero:0,one:1,two:2,few:3,many:4,other:5};function NF(){var e={};return kF.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:RF[t.fc]}}))})),e}var BF=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};UU(this,e),this.languageUtils=t,this.options=n,this.logger=nF.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=NF()}return zU(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return PF[e]-PF[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),i=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===i?i="plural":1===i&&(i=""));var o=function(){return n.options.prepend&&i.toString()?n.options.prepend+i.toString():i.toString()};return"v1"===this.options.compatibilityJSON?1===i?"":"number"==typeof i?"_plural_".concat(i.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!OF.includes(this.options.compatibilityJSON)}}]),e}();function LF(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 DF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?LF(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var UF=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};UU(this,e),this.logger=nF.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return zU(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:pF,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?hF(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?hF(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?hF(t.nestingPrefix):t.nestingPrefixEscaped||hF("$t("),this.nestingSuffix=t.nestingSuffix?hF(t.nestingSuffix):t.nestingSuffixEscaped||hF(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,a,s=this,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var u=function(e){if(e.indexOf(s.formatSeparator)<0){var i=uF(t,l,e);return s.alwaysFormat?s.format(i,void 0,n,DF(DF(DF({},r),t),{},{interpolationkey:e})):i}var o=e.split(s.formatSeparator),a=o.shift().trim(),c=o.join(s.formatSeparator).trim();return s.format(uF(t,l,a),c,n,DF(DF(DF({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var d=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach((function(t){for(a=0;i=t.regex.exec(e);){var n=i[1].trim();if(void 0===(o=u(n)))if("function"==typeof d){var l=d(e,i,r);o="string"==typeof l?l:""}else if(r&&r.hasOwnProperty(n))o="";else{if(h){o=i[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o=""}else"string"==typeof o||s.useRawValueToEscape||(o=oF(o));var c=t.safeValue(o);if(e=e.replace(i[0],c),h?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=i[0].length):t.regex.lastIndex=0,++a>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=DF({},o);function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0];var o=(i=this.interpolate(i,a)).match(/'/g),s=i.match(/"/g);(o&&o.length%2==0&&!s||s.length%2!=0)&&(i=i.replace(/'/g,'"'));try{a=JSON.parse(i),t&&(a=DF(DF({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var l=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var u=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=u.shift(),l=u,c=!0}if((r=t(s.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=oF(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=l.reduce((function(e,t){return i.format(e,t,o.lng,DF(DF({},o),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}();function FF(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 zF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?FF(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jF(e){var t={};return function(n,r,i){var o=r+JSON.stringify(i),a=t[o];return a||(a=e(r,i),t[o]=a),a(n)}}var HF=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};UU(this,e),this.logger=nF.create("formatter"),this.options=t,this.formats={number:jF((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:jF((function(e,t){var n=new Intl.NumberFormat(e,zF(zF({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:jF((function(e,t){var n=new Intl.DateTimeFormat(e,zF({},t));return function(e){return n.format(e)}})),relativetime:jF((function(e,t){var n=new Intl.RelativeTimeFormat(e,zF({},t));return function(e){return n.format(e,t.range||"day")}})),list:jF((function(e,t){var n=new Intl.ListFormat(e,zF({},t));return function(e){return n.format(e)}}))},this.init(t)}return zU(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=jF(t)}},{key:"format",value:function(e,t,n,r){var i=this,o=t.split(this.formatSeparator).reduce((function(e,t){var o=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);"currency"===t&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===t&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((function(e){if(e){var t=YU(e.split(":")),r=t[0],i=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=i),"false"===i&&(n[r.trim()]=!1),"true"===i&&(n[r.trim()]=!0),isNaN(i)||(n[r.trim()]=parseInt(i,10))}}))}return{formatName:t,formatOptions:n}}(t),a=o.formatName,s=o.formatOptions;if(i.formats[a]){var l=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=c.locale||c.lng||r.locale||r.lng||n;l=i.formats[a](e,u,zF(zF(zF({},s),r),c))}catch(e){i.logger.warn(e)}return l}return i.logger.warn("there was no format function for ".concat(a)),e}),e);return o}}]),e}();function GF(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 VF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GF(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function WF(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return VU(this,n)}}var qF=function(e){GU(n,e);var t=WF(n);function n(e,r,i){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return UU(this,n),o=t.call(this),mF&&rF.call(jU(o)),o.backend=e,o.store=r,o.services=i,o.languageUtils=i.languageUtils,o.options=a,o.logger=nF.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=a.maxParallelReads||10,o.readingCalls=0,o.maxRetries=a.maxRetries>=0?a.maxRetries:5,o.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(i,a.backend,a),o}return zU(n,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o={},a={},s={},l={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[s]=2:i.state[s]<0||(1===i.state[s]?void 0===a[s]&&(a[s]=!0):(i.state[s]=1,r=!1,void 0===a[s]&&(a[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===l[t]&&(l[t]=!0)))})),r||(s[e]=!0)})),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){var r,s,l,c,u,d;r=n.loaded,s=o,c=sF(r,[i],Object),u=c.obj,d=c.k,u[d]=u[d]||[],l&&(u[d]=u[d].concat(s)),l||u[d].push(s),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:i,wait:o,callback:a}):(this.readingCalls++,this.backend[n](e,t,(function(s,l){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}s&&l&&i<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,a)}),o):a(s,l)}))):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,VF(VF({},o),{},{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),n}(rF);function KF(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===$L(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===$L(e[2])||"object"===$L(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function JF(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function QF(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 XF(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?QF(Object(n),!0).forEach((function(t){nD(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):QF(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function YF(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=WU(e);if(t){var i=WU(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return VU(this,n)}}function ZF(){}function $F(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var ez=function(e){GU(n,e);var t=YF(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(UU(this,n),e=t.call(this),mF&&rF.call(jU(e)),e.options=JF(r),e.services={},e.logger=nF,e.modules={external:[]},$F(jU(e)),i&&!e.isInitialized&&!r.isClone){if(!e.options.initImmediate)return e.init(r,i),VU(e,jU(e));setTimeout((function(){e.init(r,i)}),0)}return e}return zU(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r=KF();function i(e){return e?"function"==typeof e?new e:e:null}if(this.options=XF(XF(XF({},r),this.options),JF(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=XF(XF({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var o;this.modules.logger?nF.init(i(this.modules.logger),this.options):nF.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=HF);var a=new IF(this.options);this.store=new SF(this.options.resources,this.options);var s=this.services;s.logger=nF,s.resourceStore=this.store,s.languageUtils=a,s.pluralResolver=new BF(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(s.formatter=i(o),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new UF(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new qF(i(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(s.languageDetector=i(this.modules.languageDetector),s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=i(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new CF(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=ZF),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&"dev"!==l[0]&&(this.options.lng=l[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var u=["addResource","addResources","addResourceBundle","removeResourceBundle"];u.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var d=iF(),h=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),d.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?h():setTimeout(h,0),d}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ZF,r=n,i="string"==typeof e?e:this.language;if("function"==typeof e&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i&&"cimode"===i.toLowerCase())return r();var o=[],a=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(i)a(i);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return a(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return a(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),r(e)}))}else r(null)}},{key:"reloadResources",value:function(e,t,n){var r=iF();return e||(e=this.languages),t||(t=this.options.ns),n||(n=ZF),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&xF.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=iF();this.emit("languageChanging",e);var i=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var a="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);a&&(n.language||i(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,o){o?(i(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,i=function e(t,i){var o;if("object"!==$L(i)){for(var a=arguments.length,s=new Array(a>2?a-2:0),l=2;l<a;l++)s[l-2]=arguments[l];o=r.options.overloadTranslationOptionHandler([t,i].concat(s))}else o=XF({},i);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",u=o.keyPrefix?"".concat(o.keyPrefix).concat(c).concat(t):t;return r.t(u,o)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i.keyPrefix=n,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var s=n.precheck(this,a);if(void 0!==s)return s}return!!this.hasResourceBundle(r,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(r,e)||i&&!a(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=iF();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=iF();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ZF,i=XF(XF(XF({},this.options),t),{isClone:!0}),o=new n(i);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));var a=["store","services","language"];return a.forEach((function(t){o[t]=e[t]})),o.services=XF({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new CF(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit.apply(o,[e].concat(n))})),o.init(i,r),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(rF);nD(ez,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ez(e,t)}));var tz=ez.createInstance();tz.createInstance=ez.createInstance;tz.createInstance,tz.init,tz.loadResources,tz.reloadResources,tz.use,tz.changeLanguage,tz.getFixedT,tz.t,tz.exists,tz.setDefaultNamespace,tz.hasLoadedNamespace,tz.loadNamespaces,tz.loadLanguages;var nz,rz=tz;nz=JSON.parse('{"yes":"Si","no":"No","confirm":"Conferma","cancel":"Annulla","show":"Mostra","hide":"Nascondi","send":"Invia","loading":"Caricamento","copy":"Copia","copyToClipboard":"Copia negli appunti","showOriginalText":"Mostra originale","showTranslatedText":"Mostra traduzione","memoriBlockedTitle":"Bloccato","memoriBlockedUntil":"Memori bloccato fino al {{date}}","memoriBlockedAnon":"Attualmente \\"{{name}}\\" non può rispondere, torna qui il {{date}}","memoriBlockedReasonExceedChats":"perchè ha superato la soglia mensile di chat ammesse.","memoriBlockedGiverHelper":"Puoi sempre gestirlo in qualità di amministratore, ma altri utenti non potranno interrogarlo.","auth":{"useRecoveryTokens":"Utilizza i token di recupero","tokens":"Token","addToken":"Aggiungi token","usePassword":"Utilizza la password","atLeast":"Almeno"},"widget":{"instruct":"Istruisci","test":"Prova","sound":"Audio","position":"Posizione","settings":"Impostazioni","share":"Condividi","sendOnKeypress":"Premi Invio per inviare","sendOnClick":"Clicca sul bottone di invio","goToIntegrationsToCustomizeAvatar":"Per personalizzare l\'avatar, vai a Condividimi e configura la pagina pubblica"},"write_and_speak":{"micButtonPopover":"Premi il pulsante per parlare","micButtonPopoverListening":"Premi il pulsante per smettere di parlare","pageInstructExplanation":"Per insegnarmi nuove cose clicca sul pulsante ISTRUISCIMI per cominciare","pageTryMeExplanation":"Per parlare con me clicca sul pulsante INIZIAMO per cominciare","instructButton":"ISTRUISCIMI","tryMeButton":"INIZIAMO","chatHistory":"Cronologia chat","exportChatHistory":"Esporta la cronologia chat","exportChatHistoryMessage":"Vuoi esportare la cronologia chat?","chatBotButtonText":"CLICCA QUI PER APRIRE LA CHAT","conversationStartedLabel":"Conversazione avvenuta il","settingsHeaderLabel":"Configura qui il memori se vuoi impostare una conversazione continua. Setta i secondi di silenzio prima dell\'invio.","continuousSpeechLabel":"Conversazione continua","secondsLabel":"Secondi","tryMeHeaderLabel":"PROVA","unknownPosition":"Posizione sconosciuta","fieldPlace":"Indica la posizione (es \'Milano\')","showMapLinkFor":"Visualizza sulla mappa la posizione","useMyPosition":"Usa la mia posizione","myPosition":"Posizione corrente","updatingPosition":"Aggiorno la posizione...","placeNotFound":"Luogo sconosciuto!","requirePosition":"Inserisci la posizione prima di iniziare","attachmentsLabel":"Arricchisci il tuo messaggio","iWantToTalkToIn":"Voglio parlare con {{name}} in"},"gamification":{"level":"Livello","points":"punti","memoriReachedLevel":"è diventato più evoluto ed ha raggiunto il livello","levelGoToStatistics":"{{memori}} è al livello {{level}} con {{points}} punti. Clicca per andare alle statistiche.","congratulationsNewLevel":"Congratulazioni, hai raggiunto un nuovo livello!","congratulationsNewLevelDescription":"Il tuo Memori è diventato più evoluto con {{points}} punti, guarda le","statistics":"statistiche"},"success":"Operazione andata a buon fine","Error":"Errore","internal server error":"Ops, scusa... qualcosa è andato storto nel server","error":"Errore","error.loading":"Errore durante il caricamento dei contenuti.","error.notFound":"Ops, non abbiamo trovato ciò che cercavi.","error.generic":"Ops, qualcosa è andato storto.","error.serverNotResponding":"Stiamo facendo manutenzione o rilasciando aggiornamenti. Riprova più tardi.","error.unprocessableEntity":"Errore durante il salvataggio dei dati. Ricontrolla i dati inseriti.","error.goBackTo":"Prova a tornare alla","error.reloadPage":"Ricarica la pagina","error.tryAgain":"Riprova","error.unauthorized":"Non sei autorizzato a visualizzare questo contenuto.","errors":{"TENANT_NOT_FOUND":"Tenant non trovato","TENANT_REGISTRATION_DISABLED":"La registrazione su questa piattaforma è disabilitata","TENANT_MISSING_NAME":"Tenant: nome mancante","TENANT_MAX_USERS_REACHED":"Numero massimo di utenti raggiunto","TENANT_MAX_ADMINS_REACHED":"Numero massimo di utenti amministratori raggiunto","USER_NOT_CONFIRMED":"Utente ancora non confermato","USER_NOT_FOUND":"Utente non trovato","USER_OR_PASSWORD_INVALID":"Utente o password non validi","USER_MUST_CHANGE_PASSWORD":"Devi cambiare la password","USER_MUST_ENTER_VERIFICATION_CODE":"Devi inserire il codice di verifica","USER_MISSING_TENANT":"Utente: tenant mancante","USER_MISSING_NAME":"Utente: nome mancante","USER_MISSING_PASSWORD":"Utente: password mancante","USER_MISSING_EMAIL":"Utente: email mancante","USER_MISSING_VERIFICATION_CODE":"Utente: codice di verifica mancante","USER_NAME_ALREADY_USED":"Nome utente già in uso","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"La password non rispetta le regole di sicurezza","USER_EMAIL_ALREADY_USED":"Email già in uso","USER_EMAIL_INVALID":"Email non valida","USER_VERIFICATION_CODE_INVALID":"Codice di verifica non valido","USER_MISSING_NAME_OR_EMAIL":"Nome utente o email mancante","USER_NAME_INVALID":"Nome utente non valido","USER_HAS_ONE_OR_MORE_MEMORI":"L\'utente ha uno o più memori","USER_MISSING_NEW_PASSWORD":"Utente: nuova password mancante","USER_NOTHING_TO_DO":"Niente da fare","USER_CANT_CREATE_MEMORI":"Utente non abilitato a creare Memori","USER_MAX_MEMORI_REACHED":"Massimo numero di Memori raggiunto","USER_CANT_EDIT_INTEGRATIONS":"Utente non abilitato a gestire integrazioni","MEMORI_NOT_FOUND":"Memori non trovato","MEMORI_NOT_ACCESSIBLE":"Memori non accessibile","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Solo il proprietario può cambiare il tag e il pin","SESSION_NOT_FOUND":"Sessione non trovata","SESSION_IS_NOT_ADMINISTRATIVE":"Sessione non amministrativa","MEMORI_MISSING_CONFIGURATION":"Memori: configurazione mancante","MEMORI_CONFIGURATION_NOT_FOUND":"Memori: configurazione non trovata","MEMORI_INVALID_PRIVACY_TYPE":"Memori: tipo di privacy non valido","MEMORI_MISSING_PASSWORD":"Memori: password mancante","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero totale di token di recupero non valido","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memori: numero minimo di token di recupero non valido","MEMORI_INVALID_VOICE_TYPE":"Memori: tipo di voce non valido","MEMORI_MISSING_NAME":"Memori: nome mancante","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memori: password o token di recupero mancanti","MEMORI_INVALID_ID":"Memori: ID non valido","MEMORI_NAME_ALREADY_USED":"Nome memori già in uso","MEMORI_INVALID_PIN":"Memori: PIN non valido","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memori: cambio TAG e PIN richiedono operazioni separate","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memori: password non richiesta su Memori pubblico","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Trasferimento: utente di destinazione mancante","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Trasferimento: ID utente di destinazione non valido","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Trasferimento: dati utente di destinazione non validi","MEMORI_TRANSFER_NOTHING_TO_DO":"Trasferimento: alcuna operazione da fare","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memori: la configurazione non può essere modificata","MEMORI_MISSING_NEW_PASSWORD":"Memori: nuova password mancante","INTEGRATION_NOT_FOUND":"Integrazione non trovata","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Formato non valido data a partire da","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Formato non valido data fino a","INTEGRATION_INVALID_TYPE":"Tipo integrazione non valido","INTEGRATION_ALREADY_EXISTS":"Integrazione già esistente","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Memori non pubblici non possono essere integrati","INTEGRATION_MISSING_INVOCATION_TEXT":"Integrazione: testo di invocazione mancante","INTEGRATION_MISSING_DEVICE_EMAILS":"Integrazione: email del dispositivo mancante","INTEGRATION_MEMORI_IS_EMPTY":"Memori vuoti non possono essere integrati","INTEGRATION_MISSING_PRIVACY_POLICY":"Integrazione: privacy policy mancante","INTEGRATION_MISSING_CATEGORY":"Categoria integrazione mancante","INTEGRATION_MISSING_DESCRIPTION":"Descrizione integrazione mancante","INTEGRATION_INVALID_INVOCATION_TEXT":"Testo di invocazione non valido","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home non più disponibile","UPLOAD_REQUIRES_MULTIPART_ENCODING":"L\'upload richiede l\'encoding multipart","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: manca il content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: dimensione massima superata","UPLOAD_FILE_IS_EMPTY":"Upload: file vuoto","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: tipo di file o firma non validi","UPLOAD_MISSING_FILE_NAME":"Upload: nome file mancante","UPLOAD_INVALID_MEMORY_ID":"Upload: ID contenuto non valido","UPLOAD_MISSING_FILE_CONTENT":"Upload: contenuto file mancante","ASSET_NOT_FOUND":"Asset non trovato","ASSET_NOT_ACCESSIBLE":"Asset non accessibile","ASSET_MISSING_SESSION_ID":"Asset: ID sessione mancante","ASSET_INVALID_FILE_NAME":"Asset: nome file non valido","INVITATION_NOT_FOUND":"Invito non trovato","INVITATION_NOT_ACCESSIBLE":"Invito non accessibile","INVITATION_ALREADY_ACCEPTED":"Invito già accettato","INVITATION_ALREADY_REJECTED":"Invito già rifiutato","INVITATION_MISSING_DESTINATION_EMAIL":"Invito: email di destinazione mancante","INVITATION_DESTINATION_EMAIL_INVALID":"Invito: email di destinazione non valida","INVITATION_MISSING_TAG":"Invito: tag mancante","INVITATION_MISSING_PIN":"Invito: PIN mancante","INVITATION_INVALID_PIN":"Invito: PIN non valido","INVITATION_INVALID_TYPE":"Invito: tipo non valido","INVITATION_MISSING_DESTINATION_NAME":"Invito: nome destinatario mancante","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invito: tag e pin non possono essere cambiati","INVITATION_CANT_BE_CHANGED":"Invito: non può essere modificato","ACTIONLOG_INVALID_USER_ID":"ID utente non valido","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","ACTIONLOG_INVALID_MEMORI_ID":"ID Memori non valido","CONSUMPTIONLOG_INVALID_TYPE":"Tipo di log non valido","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Data a partire da: formato non valido","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Data fino a: formato non valido","CONSUMPTIONLOG_INVALID_USER_ID":"ID utente non valido","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Memori ID non valido"}}');const iz={en:{translation:n(JSON.parse('{"yes":"Yes","no":"No","confirm":"Confirm","cancel":"Cancel","show":"Show","hide":"Hide","send":"Send","loading":"Loading","copy":"Copy","copyToClipboard":"Copy to clipboard","showOriginalText":"Show original","showTranslatedText":"Show translation","memoriBlockedTitle":"Blocked","memoriBlockedUntil":"Memori blocked until {{date}}","memoriBlockedAnon":"Currently \\"{{name}}\\" can\'t answer, come back here on {{date}}","memoriBlockedReasonExceedChats":"because it has exceeded the monthly threshold of allowed chats.","memoriBlockedGiverHelper":"You can still manage it as administrator, but other users will not be able to interact with it.","auth":{"useRecoveryTokens":"Use recovery tokens","tokens":"Tokens","addToken":"Add token","usePassword":"Use password","atLeast":"At least"},"widget":{"instruct":"Instruct","test":"Test","sound":"Sound","position":"Position","settings":"Settings","share":"Share","sendOnKeypress":"Hit Enter to send","sendOnClick":"Click on Submit","goToIntegrationsToCustomizeAvatar":"To customize the avatar, go to Share and customize the public page"},"write_and_speak":{"micButtonPopover":"Click the button to speak","micButtonPopoverListening":"Click the button to stop speak","pageInstructExplanation":"To teach me new things click on the INSTRUCT ME button to get started","pageTryMeExplanation":"To talk to me click on the START button to get started","instructButton":"INSTRUCT ME","tryMeButton":"START","chatHistory":"Chat history","exportChatHistory":"Export chat history","exportChatHistoryMessage":"Do you want to export chat history?","chatBotButtonText":"CLICK HERE TO OPEN CHATBOT","conversationStartedLabel":"Conversation started on","settingsHeaderLabel":"Setup here if you want to set the memori as continuous speech, and change the silence seconds if you want to customize them.","continuousSpeechLabel":"Continuous speech","secondsLabel":"Set seconds","tryMeHeaderLabel":"TRY","unknownPosition":"Unknown position","fieldPlace":"Write the place (eg \'Milano\')","showMapLinkFor":"Show the position on the map","useMyPosition":"Use my position","myPosition":"Your position","updatingPosition":"Updating position...","placeNotFound":"Place not found!","requirePosition":"Insert your position before start","attachmentsLabel":"Enrich your message","iWantToTalkToIn":"I want to talk to {{name}} in"},"gamification":{"level":"Level","points":"points","memoriReachedLevel":"became more evolved and reached level","levelGoToStatistics":"{{memori}} is at level {{level}} with {{points}} points. Click to go to statistics.","congratulationsNewLevel":"Congratulations, you have reached a new level!","congratulationsNewLevelDescription":"Your Memori became more evolved with {{points}} points, look at the","statistics":"statistics"},"success":"Success","Error":"Error","internal server error":"Oupsie, sorry... Something went wrong on the server","error":"Error","error.loading":"Error while loading content.","error.generic":"Oupsie, sorry... something went wrong.","error.serverNotResponding":"We are doing maintenance or releasing updates. Please try again later.","error.notFound":"Oupsie, we didn\'t find the page you were looking for.","error.goBackTo":"You can try to go back to the","error.reloadPage":"Reload the page","error.tryAgain":"Try again","error.unauthorized":"You are unauthorized to view this content.","error.unprocessableEntity":"Error while processing the request. Check the data you entered.","errors":{"TENANT_NOT_FOUND":"Tenant not found","TENANT_REGISTRATION_DISABLED":"Registration on this platform is disabled","TENANT_MISSING_NAME":"Tenant: name missing","TENANT_MAX_USERS_REACHED":"Maximum number of users reached","TENANT_MAX_ADMINS_REACHED":"Maximum number of admin users reached","USER_NOT_CONFIRMED":"User still not confirmed","USER_NOT_FOUND":"User not found","USER_OR_PASSWORD_INVALID":"Invalid user or password","USER_MUST_CHANGE_PASSWORD":"You must change your password","USER_MUST_ENTER_VERIFICATION_CODE":"You must enter the verification code","USER_MISSING_TENANT":"User: missing tenant","USER_MISSING_NAME":"User: name is missing","USER_MISSING_PASSWORD":"User: password missing","USER_MISSING_EMAIL":"User: Missing email","USER_MISSING_VERIFICATION_CODE":"User: Missing verification code","USER_NAME_ALREADY_USED":"User name already in use","USER_PASSWORD_NOT_CONFORMING_TO_POLICY":"The password does not meet the security rules","USER_EMAIL_ALREADY_USED":"Email already in use","USER_EMAIL_INVALID":"Invalid email","USER_VERIFICATION_CODE_INVALID":"Invalid verification code","USER_MISSING_NAME_OR_EMAIL":"Missing username or email","USER_NAME_INVALID":"Invalid user name","USER_HAS_ONE_OR_MORE_MEMORI":"The user has one or more memories","USER_MISSING_NEW_PASSWORD":"User: new password missing","USER_NOTHING_TO_DO":"Nothing to do","USER_CANT_CREATE_MEMORI":"User not allowed to create Memori","USER_MAX_MEMORI_REACHED":"Maximum number of Memori reached","USER_CANT_EDIT_INTEGRATIONS":"User not allowed to manage integrations","MEMORI_NOT_FOUND":"Memori not found","MEMORI_NOT_ACCESSIBLE":"Memori not accessible","MEMORI_ONLY_OWNER_CAN_CHANGE_GIVER_TAG_AND_PIN":"Only owner can change tag or pin","SESSION_NOT_FOUND":"Session not found","SESSION_IS_NOT_ADMINISTRATIVE":"Non-administrative session","MEMORI_MISSING_CONFIGURATION":"Memori: missing configuration","MEMORI_CONFIGURATION_NOT_FOUND":"Memories: configuration not found","MEMORI_INVALID_PRIVACY_TYPE":"Memories: invalid privacy type","MEMORI_MISSING_PASSWORD":"Memori: missing password","MEMORI_INVALID_TOTAL_NUMBER_OF_RECOVERY_TOKENS":"Memories: total number of invalid recovery tokens","MEMORI_INVALID_MINIMUM_NUMBER_OF_RECOVERY_TOKENS":"Memories: minimum number of invalid recovery tokens","MEMORI_INVALID_VOICE_TYPE":"Memories: invalid voice type","MEMORI_MISSING_NAME":"Memories: missing name","MEMORI_MISSING_PASSWORD_OR_RECOVERY_TOKENS":"Memories: missing password or recovery token","MEMORI_INVALID_ID":"Memories: invalid ID","MEMORI_NAME_ALREADY_USED":"Memory name already in use","MEMORI_INVALID_PIN":"Memories: Invalid PIN","MEMORI_GIVER_TAG_PIN_CHANGE_REQUIRES_SEPARATE_OPERATION":"Memories: TAG and PIN change require separate operations","MEMORI_NO_PASSWORD_WHEN_PUBLIC":"Memories: no password required when public","MEMORI_TRANSFER_MISSING_DESTINATION_USER":"Transfer: missing destination user","MEMORI_TRANSFER_INVALID_DESTINATION_USER_ID":"Transfer: invalid destination user ID","MEMORI_TRANSFER_DESTINATION_USER_DATA_INCONSISTENT":"Transfer: invalid destination user data","MEMORI_TRANSFER_NOTHING_TO_DO":"Transfer: nothing to do","MEMORI_CONFIGURATION_CANT_BE_CHANGED":"Memories: configuration cannot be changed","MEMORI_MISSING_NEW_PASSWORD":"Memories: new password missing","INTEGRATION_NOT_FOUND":"Integration not found","MEMORI_SESSIONS_INVALID_DATE_FROM_FORMAT":"Invalid date from format","MEMORI_SESSIONS_INVALID_DATE_TO_FORMAT":"Invalid date to format","INTEGRATION_INVALID_TYPE":"Invalid integration type","INTEGRATION_ALREADY_EXISTS":"Integration already exists","INTEGRATION_MEMORI_IS_NOT_PUBLIC":"Non-public memories cannot be integrated","INTEGRATION_MISSING_INVOCATION_TEXT":"Integration: missing invocation text","INTEGRATION_MISSING_DEVICE_EMAILS":"Integration: missing device email","INTEGRATION_MEMORI_IS_EMPTY":"Empty memories cannot be integrated","INTEGRATION_MISSING_PRIVACY_POLICY":"Integration: privacy policy missing","INTEGRATION_MISSING_CATEGORY":"Integration category missing","INTEGRATION_MISSING_DESCRIPTION":"Missing integration description","INTEGRATION_INVALID_INVOCATION_TEXT":"Invalid invocation text","INTEGRATION_GOOGLE_NO_MORE_AVAILABLE":"Google Home no more available","UPLOAD_REQUIRES_MULTIPART_ENCODING":"Upload requires multipart encoding","UPLOAD_MISSING_CONTENT_TYPE_BOUNDARY":"Upload: missing content type boundary","UPLOAD_MAX_LENGTH_EXCEEDED":"Upload: maximum size exceeded","UPLOAD_FILE_IS_EMPTY":"Upload: empty file","UPLOAD_INVALID_FILE_TYPE_OR_SIGNATURE":"Upload: invalid file type or signature","UPLOAD_MISSING_FILE_NAME":"Upload: missing file name","UPLOAD_INVALID_MEMORY_ID":"Upload: Invalid content ID","UPLOAD_MISSING_FILE_CONTENT":"Upload: Missing file content","ASSET_NOT_FOUND":"Asset not found","ASSET_NOT_ACCESSIBLE":"Asset not accessible","ASSET_MISSING_SESSION_ID":"Asset: missing session ID","ASSET_INVALID_FILE_NAME":"Asset: invalid file name","INVITATION_NOT_FOUND":"Invitation not found","INVITATION_NOT_ACCESSIBLE":"Invitation not accessible","INVITATION_ALREADY_ACCEPTED":"Invitation already accepted","INVITATION_ALREADY_REJECTED":"Invitation already rejected","INVITATION_MISSING_DESTINATION_EMAIL":"Invitation: missing destination email","INVITATION_DESTINATION_EMAIL_INVALID":"Invitation: destination email invalid","INVITATION_MISSING_TAG":"Invitation: missing tag","INVITATION_MISSING_PIN":"Invitation: PIN missing","INVITATION_INVALID_PIN":"Invitation: invalid PIN","INVITATION_INVALID_TYPE":"Invitation: invalid type","INVITATION_MISSING_DESTINATION_NAME":"Invitation: destination name missing","INVITATION_TAG_PIN_CANT_BE_CHANGED":"Invitation: tag and pin can\'t be changed","INVITATION_CANT_BE_CHANGED":"Intation: can\'t be changed","ACTIONLOG_INVALID_USER_ID":"Invalid user ID","ACTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","ACTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","ACTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID","CONSUMPTIONLOG_INVALID_TYPE":"Invalid log type","CONSUMPTIONLOG_INVALID_DATE_FROM_FORMAT":"Date from: invalid format","CONSUMPTIONLOG_INVALID_DATE_TO_FORMAT":"Date to: invalid format","CONSUMPTIONLOG_INVALID_USER_ID":"Invalid user ID","CONSUMPTIONLOG_INVALID_MEMORI_ID":"Invalid Memori ID"}}'))},it:{translation:n(nz)}};rz.use(so).init({resources:iz,lng:"en",fallbackLng:"it",supportedLngs:["en","it"],nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1}});var oz=rz;const az=({ownerUserName:e,ownerUserID:t,memoriName:r,memoriID:i,integrationID:o,tenantID:a,secretToken:s,sessionID:l,showShare:u=!0,showSettings:d=!1,showInstruct:h=!1,height:f="100%",baseURL:p,apiURL:m="https://backend.memori.ai",tag:g,pin:v,context:b,initialQuestion:y,uiLang:w,spokenLang:S,AZURE_COGNITIVE_SERVICES_TTS_KEY:x,onStateChange:M})=>{var _,A,E;const[C,T]=(0,c.useState)(),{t:I}=yo();if(!(i&&t||r&&e))throw new Error("Identifier pair required: please provide either memoriID and ownerUserID or memoriName and ownerUserName");const k=Vi(m),R=(0,c.useCallback)((async()=>{if(i&&t){const{memori:e,...n}=await k.backend.getMemoriByUserAndId(a,t,i);0===n.resultCode&&e?T(e):console.error("[MEMORI]",n,e)}else if(r&&e){const{memori:t,...n}=await k.backend.getMemori(a,e,r);0===n.resultCode&&t?T(t):console.error("[MEMORI]",n,t)}}),[i,t,r,e,a]);return(0,c.useEffect)((()=>{R()}),[R,a]),(0,c.useEffect)((()=>{if(w)oz.changeLanguage(w.toLowerCase());else{const{lng:e,fallbackLng:t}=(()=>{const e=navigator.language;if(e){let t=e.split("-")[0];if(["en","it"].includes(t))return{lng:t,fallbackLng:"en"===t?"it":"en"}}return{lng:"en",fallbackLng:"it"}})();oz.changeLanguage(e).catch((()=>{oz.changeLanguage(t)}))}}),[w]),C?n(c).createElement(DU,{height:f,baseUrl:p||(a.startsWith("https://")?a:`https://${a}`),apiUrl:m,memori:{...C,secretToken:s},memoriLang:null!=S?S:null===(A=null===(_=C.culture)||void 0===_?void 0:_.split("-"))||void 0===A?void 0:A[0],tenant:{id:a,theme:"twincreator",config:{name:a,showNewUser:!1,requirePosition:!!C.needsPosition}},secret:s,sessionID:l,showShare:u,showSettings:d,showInstruct:h,integration:null===(E=null==C?void 0:C.integrations)||void 0===E?void 0:E.find((e=>o?e.integrationID===o:!!e.publish&&"LANDING_EXPERIENCE"===e.type)),initialContextVars:b,initialQuestion:y,AZURE_COGNITIVE_SERVICES_TTS_KEY:x,onStateChange:M,...g&&v?{personification:{tag:g,pin:v}}:{}}):n(c).createElement("div",null,n(c).createElement("p",{style:{textAlign:"center",margin:"2rem auto"}},I("loading"),"..."))};az.propTypes={memoriName:n(l).string,memoriID:n(l).string,ownerUserName:n(l).string,ownerUserID:n(l).string,integrationID:n(l).string,tenantID:n(l).string.isRequired,secretToken:n(l).string,showShare:n(l).bool,showSettings:n(l).bool,baseURL:n(l).string,apiURL:n(l).string,tag:n(l).string,pin:n(l).string,showInstruct:n(l).bool,context:n(l).objectOf(n(l).any),initialQuestion:n(l).string,uiLang:n(l).oneOf(["en","it"]),spokenLang:n(l).string,AZURE_COGNITIVE_SERVICES_TTS_KEY:n(l).string,onStateChange:n(l).func};var sz=az;class lz extends HTMLElement{connectedCallback(){const e=document.createElement("div"),t=document.createElement("div");t.setAttribute("id","memori-root");const r=document.createElement("style");r.innerHTML="\n @import url('https://unpkg.com/@memori.ai/memori-webcomponent/dist/memori-webcomponent.css');\n ",e.appendChild(r),e.appendChild(t),this.appendChild(e);const i=Object.keys(sz.propTypes).reduce(((e,t)=>(this.hasAttribute(t)&&(e[t]=this.getAttribute(t)),e)),{}),o=this.getAttribute("tenantId"),l=this.getAttribute("context")?.split(",")?.reduce(((e,t)=>{const[n,r]=t.split(":").map((e=>e.trim()));return{...e,[n]:r}}),{});o?n(s).render((0,a.jsx)(sz,{...i,context:l,tenantID:o}),t):console.error("No tenantId attribute found")}}customElements.define("memori-client",lz)})();