sykpcomposer 0.0.65 → 0.0.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1590 -1617
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +19 -19
- package/dist/index.umd.js.map +1 -1
- package/dist/src/components/Editor.d.ts +2 -2
- package/dist/src/components/plugins/ToolbarPlugin.d.ts +1 -1
- package/dist/src/components/plugins/fontSize.d.ts +2 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
(function(Mr,Ce){typeof exports=="object"&&typeof module<"u"?Ce(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],Ce):(Mr=typeof globalThis<"u"?globalThis:Mr||self,Ce(Mr.ViteButton={},Mr.React,Mr.ReactDOM))})(this,function(Mr,Ce,$r){"use strict";var
|
|
1
|
+
(function(Mr,Ce){typeof exports=="object"&&typeof module<"u"?Ce(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],Ce):(Mr=typeof globalThis<"u"?globalThis:Mr||self,Ce(Mr.ViteButton={},Mr.React,Mr.ReactDOM))})(this,function(Mr,Ce,$r){"use strict";var wC=Object.defineProperty;var SC=(Mr,Ce,$r)=>Ce in Mr?wC(Mr,Ce,{enumerable:!0,configurable:!0,writable:!0,value:$r}):Mr[Ce]=$r;var wc=(Mr,Ce,$r)=>(SC(Mr,typeof Ce!="symbol"?Ce+"":Ce,$r),$r);function hh(y){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(y){for(const g in y)if(g!=="default"){const t=Object.getOwnPropertyDescriptor(y,g);Object.defineProperty(d,g,t.get?t:{enumerable:!0,get:()=>y[g]})}}return d.default=y,Object.freeze(d)}const Qn=hh(Ce),Yb=hh($r);var vd={exports:{}},Ya={};/*
|
|
2
2
|
object-assign
|
|
3
3
|
(c) Sindre Sorhus
|
|
4
4
|
@license MIT
|
|
5
|
-
*/var _d,
|
|
5
|
+
*/var _d,gh;function mh(){if(gh)return _d;gh=1;var y=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable;function t(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function f(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var n={},e=0;e<10;e++)n["_"+String.fromCharCode(e)]=e;var s=Object.getOwnPropertyNames(n).map(function(l){return n[l]});if(s.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(l){i[l]=l}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return _d=f()?Object.assign:function(r,n){for(var e,s=t(r),i,l=1;l<arguments.length;l++){e=Object(arguments[l]);for(var o in e)d.call(e,o)&&(s[o]=e[o]);if(y){i=y(e);for(var a=0;a<i.length;a++)g.call(e,i[a])&&(s[i[a]]=e[i[a]])}}return s},_d}/** @license React v17.0.2
|
|
6
6
|
* react-jsx-runtime.production.min.js
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/var
|
|
12
|
+
*/var yh;function Zb(){if(yh)return Ya;yh=1,mh();var y=Ce,d=60103;if(Ya.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var g=Symbol.for;d=g("react.element"),Ya.Fragment=g("react.fragment")}var t=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f=Object.prototype.hasOwnProperty,r={key:!0,ref:!0,__self:!0,__source:!0};function n(e,s,i){var l,o={},a=null,c=null;i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),s.ref!==void 0&&(c=s.ref);for(l in s)f.call(s,l)&&!r.hasOwnProperty(l)&&(o[l]=s[l]);if(e&&e.defaultProps)for(l in s=e.defaultProps,s)o[l]===void 0&&(o[l]=s[l]);return{$$typeof:d,type:e,key:a,ref:c,props:o,_owner:t.current}}return Ya.jsx=n,Ya.jsxs=n,Ya}var xd={};/** @license React v17.0.2
|
|
13
13
|
* react-jsx-runtime.development.js
|
|
14
14
|
*
|
|
15
15
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
16
16
|
*
|
|
17
17
|
* This source code is licensed under the MIT license found in the
|
|
18
18
|
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/var
|
|
19
|
+
*/var bh;function Qb(){return bh||(bh=1,function(y){process.env.NODE_ENV!=="production"&&function(){var d=Ce,g=mh(),t=60103,f=60106;y.Fragment=60107;var r=60108,n=60114,e=60109,s=60110,i=60112,l=60113,o=60120,a=60115,c=60116,u=60121,h=60122,p=60117,m=60129,b=60131;if(typeof Symbol=="function"&&Symbol.for){var _=Symbol.for;t=_("react.element"),f=_("react.portal"),y.Fragment=_("react.fragment"),r=_("react.strict_mode"),n=_("react.profiler"),e=_("react.provider"),s=_("react.context"),i=_("react.forward_ref"),l=_("react.suspense"),o=_("react.suspense_list"),a=_("react.memo"),c=_("react.lazy"),u=_("react.block"),h=_("react.server.block"),p=_("react.fundamental"),_("react.scope"),_("react.opaque.id"),m=_("react.debug_trace_mode"),_("react.offscreen"),b=_("react.legacy_hidden")}var v=typeof Symbol=="function"&&Symbol.iterator,w="@@iterator";function x(Tt){if(Tt===null||typeof Tt!="object")return null;var ae=v&&Tt[v]||Tt[w];return typeof ae=="function"?ae:null}var S=d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(Tt){{for(var ae=arguments.length,de=new Array(ae>1?ae-1:0),Se=1;Se<ae;Se++)de[Se-1]=arguments[Se];k("error",Tt,de)}}function k(Tt,ae,de){{var Se=S.ReactDebugCurrentFrame,je=Se.getStackAddendum();je!==""&&(ae+="%s",de=de.concat([je]));var Rt=de.map(function(Ut){return""+Ut});Rt.unshift("Warning: "+ae),Function.prototype.apply.call(console[Tt],console,Rt)}}var D=!1;function P(Tt){return!!(typeof Tt=="string"||typeof Tt=="function"||Tt===y.Fragment||Tt===n||Tt===m||Tt===r||Tt===l||Tt===o||Tt===b||D||typeof Tt=="object"&&Tt!==null&&(Tt.$$typeof===c||Tt.$$typeof===a||Tt.$$typeof===e||Tt.$$typeof===s||Tt.$$typeof===i||Tt.$$typeof===p||Tt.$$typeof===u||Tt[0]===h))}function O(Tt,ae,de){var Se=ae.displayName||ae.name||"";return Tt.displayName||(Se!==""?de+"("+Se+")":de)}function R(Tt){return Tt.displayName||"Context"}function A(Tt){if(Tt==null)return null;if(typeof Tt.tag=="number"&&E("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),typeof Tt=="function")return Tt.displayName||Tt.name||null;if(typeof Tt=="string")return Tt;switch(Tt){case y.Fragment:return"Fragment";case f:return"Portal";case n:return"Profiler";case r:return"StrictMode";case l:return"Suspense";case o:return"SuspenseList"}if(typeof Tt=="object")switch(Tt.$$typeof){case s:var ae=Tt;return R(ae)+".Consumer";case e:var de=Tt;return R(de._context)+".Provider";case i:return O(Tt,Tt.render,"ForwardRef");case a:return A(Tt.type);case u:return A(Tt._render);case c:{var Se=Tt,je=Se._payload,Rt=Se._init;try{return A(Rt(je))}catch{return null}}}return null}var z=0,H,$,M,J,K,N,U;function W(){}W.__reactDisabledLog=!0;function G(){{if(z===0){H=console.log,$=console.info,M=console.warn,J=console.error,K=console.group,N=console.groupCollapsed,U=console.groupEnd;var Tt={configurable:!0,enumerable:!0,value:W,writable:!0};Object.defineProperties(console,{info:Tt,log:Tt,warn:Tt,error:Tt,group:Tt,groupCollapsed:Tt,groupEnd:Tt})}z++}}function F(){{if(z--,z===0){var Tt={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:g({},Tt,{value:H}),info:g({},Tt,{value:$}),warn:g({},Tt,{value:M}),error:g({},Tt,{value:J}),group:g({},Tt,{value:K}),groupCollapsed:g({},Tt,{value:N}),groupEnd:g({},Tt,{value:U})})}z<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var q=S.ReactCurrentDispatcher,T;function I(Tt,ae,de){{if(T===void 0)try{throw Error()}catch(je){var Se=je.stack.trim().match(/\n( *(at )?)/);T=Se&&Se[1]||""}return`
|
|
20
20
|
`+T+Tt}}var L=!1,B;{var Y=typeof WeakMap=="function"?WeakMap:Map;B=new Y}function Z(Tt,ae){if(!Tt||L)return"";{var de=B.get(Tt);if(de!==void 0)return de}var Se;L=!0;var je=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Rt;Rt=q.current,q.current=null,G();try{if(ae){var Ut=function(){throw Error()};if(Object.defineProperty(Ut.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ut,[])}catch(Ae){Se=Ae}Reflect.construct(Tt,[],Ut)}else{try{Ut.call()}catch(Ae){Se=Ae}Tt.call(Ut.prototype)}}else{try{throw Error()}catch(Ae){Se=Ae}Tt()}}catch(Ae){if(Ae&&Se&&typeof Ae.stack=="string"){for(var se=Ae.stack.split(`
|
|
21
21
|
`),bt=Se.stack.split(`
|
|
22
22
|
`),ft=se.length-1,xt=bt.length-1;ft>=1&&xt>=0&&se[ft]!==bt[xt];)xt--;for(;ft>=1&&xt>=0;ft--,xt--)if(se[ft]!==bt[xt]){if(ft!==1||xt!==1)do if(ft--,xt--,xt<0||se[ft]!==bt[xt]){var Bt=`
|
|
@@ -26,20 +26,20 @@ Check the render method of \``+Tt+"`."}return""}}function Qt(Tt){{if(Tt!==void 0
|
|
|
26
26
|
|
|
27
27
|
Check your code at `+ae+":"+de+"."}return""}}var _e={};function kt(Tt){{var ae=Xt();if(!ae){var de=typeof Tt=="string"?Tt:Tt.displayName||Tt.name;de&&(ae=`
|
|
28
28
|
|
|
29
|
-
Check the top-level render call using <`+de+">.")}return ae}}function ee(Tt,ae){{if(!Tt._store||Tt._store.validated||Tt.key!=null)return;Tt._store.validated=!0;var de=kt(ae);if(_e[de])return;_e[de]=!0;var Se="";Tt&&Tt._owner&&Tt._owner!==Pt.current&&(Se=" It was passed a child from "+A(Tt._owner.type)+"."),dt(Tt),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',de,Se),dt(null)}}function pe(Tt,ae){{if(typeof Tt!="object")return;if(Array.isArray(Tt))for(var de=0;de<Tt.length;de++){var Se=Tt[de];Jt(Se)&&ee(Se,ae)}else if(Jt(Tt))Tt._store&&(Tt._store.validated=!0);else if(Tt){var je=x(Tt);if(typeof je=="function"&&je!==Tt.entries)for(var Rt=je.call(Tt),Ut;!(Ut=Rt.next()).done;)Jt(Ut.value)&&ee(Ut.value,ae)}}}function Be(Tt){{var ae=Tt.type;if(ae==null||typeof ae=="string")return;var de;if(typeof ae=="function")de=ae.propTypes;else if(typeof ae=="object"&&(ae.$$typeof===i||ae.$$typeof===a))de=ae.propTypes;else return;if(de){var Se=A(ae);ct(de,Tt.props,"prop",Se,Tt)}else if(ae.PropTypes!==void 0&&!Ft){Ft=!0;var je=A(ae);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",je||"Unknown")}typeof ae.getDefaultProps=="function"&&!ae.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Fe(Tt){{for(var ae=Object.keys(Tt.props),de=0;de<ae.length;de++){var Se=ae[de];if(Se!=="children"&&Se!=="key"){dt(Tt),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Se),dt(null);break}}Tt.ref!==null&&(dt(Tt),E("Invalid attribute `ref` supplied to `React.Fragment`."),dt(null))}}function qe(Tt,ae,de,Se,je,Rt){{var Ut=P(Tt);if(!Ut){var se="";(Tt===void 0||typeof Tt=="object"&&Tt!==null&&Object.keys(Tt).length===0)&&(se+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var bt=Qt(je);bt?se+=bt:se+=Xt();var ft;Tt===null?ft="null":Array.isArray(Tt)?ft="array":Tt!==void 0&&Tt.$$typeof===t?(ft="<"+(A(Tt.type)||"Unknown")+" />",se=" Did you accidentally export a JSX literal instead of a component?"):ft=typeof Tt,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ft,se)}var xt=Ct(Tt,ae,de,je,Rt);if(xt==null)return xt;if(Ut){var Bt=ae.children;if(Bt!==void 0)if(Se)if(Array.isArray(Bt)){for(var ce=0;ce<Bt.length;ce++)pe(Bt[ce],Tt);Object.freeze&&Object.freeze(Bt)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else pe(Bt,Tt)}return Tt===y.Fragment?Fe(xt):Be(xt),xt}}function ze(Tt,ae,de){return qe(Tt,ae,de,!0)}function Re(Tt,ae,de){return qe(Tt,ae,de,!1)}var He=Re,hn=ze;y.jsx=He,y.jsxs=hn}()}(xd)),xd}process.env.NODE_ENV==="production"?vd.exports=
|
|
29
|
+
Check the top-level render call using <`+de+">.")}return ae}}function ee(Tt,ae){{if(!Tt._store||Tt._store.validated||Tt.key!=null)return;Tt._store.validated=!0;var de=kt(ae);if(_e[de])return;_e[de]=!0;var Se="";Tt&&Tt._owner&&Tt._owner!==Pt.current&&(Se=" It was passed a child from "+A(Tt._owner.type)+"."),dt(Tt),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',de,Se),dt(null)}}function pe(Tt,ae){{if(typeof Tt!="object")return;if(Array.isArray(Tt))for(var de=0;de<Tt.length;de++){var Se=Tt[de];Jt(Se)&&ee(Se,ae)}else if(Jt(Tt))Tt._store&&(Tt._store.validated=!0);else if(Tt){var je=x(Tt);if(typeof je=="function"&&je!==Tt.entries)for(var Rt=je.call(Tt),Ut;!(Ut=Rt.next()).done;)Jt(Ut.value)&&ee(Ut.value,ae)}}}function Be(Tt){{var ae=Tt.type;if(ae==null||typeof ae=="string")return;var de;if(typeof ae=="function")de=ae.propTypes;else if(typeof ae=="object"&&(ae.$$typeof===i||ae.$$typeof===a))de=ae.propTypes;else return;if(de){var Se=A(ae);ct(de,Tt.props,"prop",Se,Tt)}else if(ae.PropTypes!==void 0&&!Ft){Ft=!0;var je=A(ae);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",je||"Unknown")}typeof ae.getDefaultProps=="function"&&!ae.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Fe(Tt){{for(var ae=Object.keys(Tt.props),de=0;de<ae.length;de++){var Se=ae[de];if(Se!=="children"&&Se!=="key"){dt(Tt),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Se),dt(null);break}}Tt.ref!==null&&(dt(Tt),E("Invalid attribute `ref` supplied to `React.Fragment`."),dt(null))}}function qe(Tt,ae,de,Se,je,Rt){{var Ut=P(Tt);if(!Ut){var se="";(Tt===void 0||typeof Tt=="object"&&Tt!==null&&Object.keys(Tt).length===0)&&(se+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var bt=Qt(je);bt?se+=bt:se+=Xt();var ft;Tt===null?ft="null":Array.isArray(Tt)?ft="array":Tt!==void 0&&Tt.$$typeof===t?(ft="<"+(A(Tt.type)||"Unknown")+" />",se=" Did you accidentally export a JSX literal instead of a component?"):ft=typeof Tt,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ft,se)}var xt=Ct(Tt,ae,de,je,Rt);if(xt==null)return xt;if(Ut){var Bt=ae.children;if(Bt!==void 0)if(Se)if(Array.isArray(Bt)){for(var ce=0;ce<Bt.length;ce++)pe(Bt[ce],Tt);Object.freeze&&Object.freeze(Bt)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else pe(Bt,Tt)}return Tt===y.Fragment?Fe(xt):Be(xt),xt}}function ze(Tt,ae,de){return qe(Tt,ae,de,!0)}function Re(Tt,ae,de){return qe(Tt,ae,de,!1)}var He=Re,hn=ze;y.jsx=He,y.jsxs=hn}()}(xd)),xd}process.env.NODE_ENV==="production"?vd.exports=Zb():vd.exports=Qb();var he=vd.exports;function wd(y){return{}}const Wo={},vh={},_h={},uo={},wi={},Za={},Si={},ll={},Sc={},ca={},Ci={},Er={},cl={},ul={},Xb={},Cc={},tv={},Ec={},ev={},Sd={},Cd={},dl={},nv={},fl={},kc={},pl={},xh={},rv={},ov={},wh={},Ed={},Qa={},kd={},Sh={},iv={},hl={},gl={},Oc={},Od={},av={},Xa={},ts={},Ch={},sv={},lv={},fo=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,cv=fo&&"documentMode"in document?document.documentMode:null,po=fo&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ei=fo&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Tc=!(!fo||!("InputEvent"in window)||cv)&&"getTargetRanges"in new window.InputEvent("input"),Td=fo&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),jc=fo&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,uv=fo&&/Android/.test(navigator.userAgent),Eh=fo&&/^(?=.*Chrome).*/i.test(navigator.userAgent),dv=fo&&uv&&Eh,jd=fo&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Eh,ml=1,ki=3,ua=0,kh=1,es=2,fv=0,pv=1,hv=2,Ac=4,Pc=8,Ad=128,gv=112|(3|Ac|Pc)|Ad,Pd=1,Nd=2,Id=3,Rd=4,Md=5,Dd=6,Nc=Td||jc||jd?" ":"",Ko=`
|
|
30
30
|
|
|
31
|
-
`,bv=Ei?" ":Nc,Th="֑-߿יִ-﷽ﹰ-ﻼ",jh="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",vv=new RegExp("^[^"+jh+"]*["+Th+"]"),_v=new RegExp("^[^"+Th+"]*["+jh+"]"),Go={bold:1,code:16,highlight:Ad,italic:2,strikethrough:Ac,subscript:32,superscript:64,underline:Pc},xv={directionless:1,unmergeable:2},Ah={center:Nd,end:Dd,justify:Rd,left:Pd,right:Id,start:Md},wv={[Nd]:"center",[Dd]:"end",[Rd]:"justify",[Pd]:"left",[Id]:"right",[Md]:"start"},Sv={normal:0,segmented:2,token:1},Cv={[hv]:"normal",[mv]:"segmented",[gv]:"token"};function Ev(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var Je=Ev(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Ic(...y){const d=[];for(const g of y)if(g&&typeof g=="string")for(const[t]of g.matchAll(/\S+/g))d.push(t);return d}const kv=100;let Ld=!1,Bd=0;function Ov(y){Bd=y.timeStamp}function Fd(y,d,g){return d.__lexicalLineBreak===y||y[`__lexicalKey_${g._key}`]!==void 0}function Tv(y,d,g){const t=Oo(g._window);let f=null,r=null;t!==null&&t.anchorNode===y&&(f=t.anchorOffset,r=t.focusOffset);const n=y.nodeValue;n!==null&&Jd(d,n,f,r,!1)}function jv(y,d,g){if(xe(y)){const t=y.anchor.getNode();if(t.is(g)&&y.format!==t.getFormat())return!1}return d.nodeType===ki&&g.isAttached()}function Ph(y,d,g){Ld=!0;const t=performance.now()-Bd>kv;try{Hr(y,()=>{const f=Oe()||function(a){return a.getEditorState().read(()=>{const c=Oe();return c!==null?c.clone():null})}(y),r=new Map,n=y.getRootElement(),e=y._editorState,s=y._blockCursorElement;let i=!1,l="";for(let a=0;a<d.length;a++){const c=d[a],u=c.type,h=c.target;let p=rr(h,e);if(!(p===null&&h!==n||Tn(p))){if(u==="characterData")t&&Ne(p)&&jv(f,h,p)&&Tv(h,p,y);else if(u==="childList"){i=!0;const m=c.addedNodes;for(let v=0;v<m.length;v++){const w=m[v],x=zh(w),S=w.parentNode;if(S!=null&&w!==s&&x===null&&(w.nodeName!=="BR"||!Fd(w,S,y))){if(Ei){const E=w.innerText||w.nodeValue;E&&(l+=E)}S.removeChild(w)}}const b=c.removedNodes,_=b.length;if(_>0){let v=0;for(let w=0;w<_;w++){const x=b[w];(x.nodeName==="BR"&&Fd(x,h,y)||s===x)&&(h.appendChild(x),v++)}_!==v&&(h===n&&(p=Hh(e)),r.set(h,p))}}}}if(r.size>0)for(const[a,c]of r)if(ge(c)){const u=c.getChildrenKeys();let h=a.firstChild;for(let p=0;p<u.length;p++){const m=u[p],b=y.getElementByKey(m);b!==null&&(h==null?(a.appendChild(b),h=b):h!==b&&a.replaceChild(b,h),h=h.nextSibling)}}else Ne(c)&&c.markDirty();const o=g.takeRecords();if(o.length>0){for(let a=0;a<o.length;a++){const c=o[a],u=c.addedNodes,h=c.target;for(let p=0;p<u.length;p++){const m=u[p],b=m.parentNode;b==null||m.nodeName!=="BR"||Fd(m,h,y)||b.removeChild(m)}}g.takeRecords()}f!==null&&(i&&(f.dirty=!0,or(f)),Ei&&eg(y)&&f.insertRawText(l))})}finally{Ld=!1}}function Nh(y){const d=y._observer;d!==null&&Ph(y,d.takeRecords(),d)}function Ih(y){(function(d){Bd===0&&Fc(d).addEventListener("textInput",Ov,!0)})(y),y._observer=new MutationObserver((d,g)=>{Ph(y,d,g)})}function Rh(y,d){const g=y.__mode,t=y.__format,f=y.__style,r=d.__mode,n=d.__format,e=d.__style;return!(g!==null&&g!==r||t!==null&&t!==n||f!==null&&f!==e)}function Mh(y,d){const g=y.mergeWithSibling(d),t=Wn()._normalizedNodes;return t.add(y.__key),t.add(d.__key),g}function Dh(y){let d,g,t=y;if(t.__text!==""||!t.isSimpleText()||t.isUnmergeable()){for(;(d=t.getPreviousSibling())!==null&&Ne(d)&&d.isSimpleText()&&!d.isUnmergeable();){if(d.__text!==""){if(Rh(d,t)){t=Mh(d,t);break}break}d.remove()}for(;(g=t.getNextSibling())!==null&&Ne(g)&&g.isSimpleText()&&!g.isUnmergeable();){if(g.__text!==""){if(Rh(t,g)){t=Mh(t,g);break}break}g.remove()}}else t.remove()}function zd(y){return Lh(y.anchor),Lh(y.focus),y}function Lh(y){for(;y.type==="element";){const d=y.getNode(),g=y.offset;let t,f;if(g===d.getChildrenSize()?(t=d.getChildAtIndex(g-1),f=!0):(t=d.getChildAtIndex(g),f=!1),Ne(t)){y.set(t.__key,f?t.getTextContentSize():0,"text");break}if(!ge(t))break;y.set(t.__key,f?t.getChildrenSize():0,"element")}}let Av=1;const Pv=typeof queueMicrotask=="function"?queueMicrotask:y=>{Promise.resolve().then(y)};function Ud(y){const d=document.activeElement;if(d===null)return!1;const g=d.nodeName;return Tn(rr(y))&&(g==="INPUT"||g==="TEXTAREA"||d.contentEditable==="true"&&d.__lexicalEditor==null)}function yl(y,d,g){const t=y.getRootElement();try{return t!==null&&t.contains(d)&&t.contains(g)&&d!==null&&!Ud(d)&&Bh(d)===y}catch{return!1}}function Bh(y){let d=y;for(;d!=null;){const g=d.__lexicalEditor;if(g!=null)return g;d=Bc(d)}return null}function ns(y){return y.isToken()||y.isSegmented()}function Nv(y){return y.nodeType===ki}function Rc(y){let d=y;for(;d!=null;){if(Nv(d))return d;d=d.firstChild}return null}function $d(y,d,g){const t=Go[d];if(g!==null&&(y&t)==(g&t))return y;let f=y^t;return d==="subscript"?f&=~Go.superscript:d==="superscript"&&(f&=~Go.subscript),f}function Fh(y,d){if(d!=null)return void(y.__key=d);Tr(),Bg();const g=Wn(),t=To(),f=""+Av++;t._nodeMap.set(f,y),ge(y)?g._dirtyElements.set(f,!0):g._dirtyLeaves.add(f),g._cloneNotNeeded.add(f),g._dirtyType=Oh,y.__key=f}function da(y){const d=y.getParent();if(d!==null){const g=y.getWritable(),t=d.getWritable(),f=y.getPreviousSibling(),r=y.getNextSibling();if(f===null)if(r!==null){const n=r.getWritable();t.__first=r.__key,n.__prev=null}else t.__first=null;else{const n=f.getWritable();if(r!==null){const e=r.getWritable();e.__prev=n.__key,n.__next=e.__key}else n.__next=null;g.__prev=null}if(r===null)if(f!==null){const n=f.getWritable();t.__last=f.__key,n.__next=null}else t.__last=null;else{const n=r.getWritable();if(f!==null){const e=f.getWritable();e.__next=n.__key,n.__prev=e.__key}else n.__prev=null;g.__next=null}t.__size--,g.__parent=null}}function Mc(y){Bg();const d=y.getLatest(),g=d.__parent,t=To(),f=Wn(),r=t._nodeMap,n=f._dirtyElements;g!==null&&function(s,i,l){let o=s;for(;o!==null;){if(l.has(o))return;const a=i.get(o);if(a===void 0)break;l.set(o,!1),o=a.__parent}}(g,r,n);const e=d.__key;f._dirtyType=Oh,ge(y)?n.set(e,!0):f._dirtyLeaves.add(e)}function hr(y){Tr();const d=Wn(),g=d._compositionKey;if(y!==g){if(d._compositionKey=y,g!==null){const t=Vn(g);t!==null&&t.getWritable()}if(y!==null){const t=Vn(y);t!==null&&t.getWritable()}}}function Oi(){return cs()?null:Wn()._compositionKey}function Vn(y,d){const g=(d||To())._nodeMap.get(y);return g===void 0?null:g}function zh(y,d){const g=y[`__lexicalKey_${Wn()._key}`];return g!==void 0?Vn(g,d):null}function rr(y,d){let g=y;for(;g!=null;){const t=zh(g,d);if(t!==null)return t;g=Bc(g)}return null}function Uh(y){const d=y._decorators,g=Object.assign({},d);return y._pendingDecorators=g,g}function $h(y){return y.read(()=>Ln().getTextContent())}function Ln(){return Hh(To())}function Hh(y){return y._nodeMap.get("root")}function or(y){Tr();const d=To();y!==null&&(y.dirty=!0,y.setCachedNodes(null)),d._selection=y}function rs(y){const d=Wn(),g=function(t,f){let r=t;for(;r!=null;){const n=r[`__lexicalKey_${f._key}`];if(n!==void 0)return n;r=Bc(r)}return null}(y,d);return g===null?y===d.getRootElement()?Vn("root"):null:Vn(g)}function qh(y,d){return d?y.getTextContentSize():0}function Jh(y){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(y)}function Hd(y){const d=[];let g=y;for(;g!==null;)d.push(g),g=g._parentEditor;return d}function Vh(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Wh(y){return y.nodeType===ki?y.nodeValue:null}function qd(y,d,g){const t=Oo(d._window);if(t===null)return;const f=t.anchorNode;let{anchorOffset:r,focusOffset:n}=t;if(f!==null){let e=Wh(f);const s=rr(f);if(e!==null&&Ne(s)){if(e===Nc&&g){const i=g.length;e=g,r=i,n=i}e!==null&&Jd(s,e,r,n,y)}}}function Jd(y,d,g,t,f){let r=y;if(r.isAttached()&&(f||!r.isDirty())){const n=r.isComposing();let e=d;(n||f)&&d[d.length-1]===Nc&&(e=d.slice(0,-1));const s=r.getTextContent();if(f||e!==s){if(e===""){if(hr(null),Td||jc||jd)r.remove();else{const h=Wn();setTimeout(()=>{h.update(()=>{r.isAttached()&&r.remove()})},20)}return}const i=r.getParent(),l=ma(),o=r.getTextContentSize(),a=Oi(),c=r.getKey();if(r.isToken()||a!==null&&c===a&&!n||xe(l)&&(i!==null&&!i.canInsertTextBefore()&&l.anchor.offset===0||l.anchor.key===y.__key&&l.anchor.offset===0&&!r.canInsertTextBefore()&&!n||l.focus.key===y.__key&&l.focus.offset===o&&!r.canInsertTextAfter()&&!n))return void r.markDirty();const u=Oe();if(!xe(u)||g===null||t===null)return void r.setTextContent(e);if(u.setTextNodeRange(r,g,r,t),r.isSegmented()){const h=ar(r.getTextContent());r.replace(h),r=h}r.setTextContent(e)}}}function Iv(y,d){if(d.isSegmented())return!0;if(!y.isCollapsed())return!1;const g=y.anchor.offset,t=d.getParentOrThrow(),f=d.isToken();return g===0?!d.canInsertTextBefore()||!t.canInsertTextBefore()&&!d.isComposing()||f||function(r){const n=r.getPreviousSibling();return(Ne(n)||ge(n)&&n.isInline())&&!n.canInsertTextAfter()}(d):g===d.getTextContentSize()&&(!d.canInsertTextAfter()||!t.canInsertTextAfter()&&!d.isComposing()||f)}function Kh(y){return y==="ArrowLeft"}function Gh(y){return y==="ArrowRight"}function bl(y,d){return po?y:d}function Yh(y){return y==="Enter"}function vl(y){return y==="Backspace"}function _l(y){return y==="Delete"}function Zh(y,d,g){return y.toLowerCase()==="a"&&bl(d,g)}function Qh(){const y=Ln();or(zd(y.select(0,y.getChildrenSize())))}function xl(y,d){y.__lexicalClassNameCache===void 0&&(y.__lexicalClassNameCache={});const g=y.__lexicalClassNameCache,t=g[d];if(t!==void 0)return t;const f=y[d];if(typeof f=="string"){const r=Ic(f);return g[d]=r,r}return f}function Vd(y,d,g,t,f){if(g.size===0)return;const r=t.__type,n=t.__key,e=d.get(r);e===void 0&&Je(33,r);const s=e.klass;let i=y.get(s);i===void 0&&(i=new Map,y.set(s,i));const l=i.get(n),o=l==="destroyed"&&f==="created";(l===void 0||o)&&i.set(n,o?"updated":f)}function Xh(y){const d=To(),g=d._readOnly,t=y.getType(),f=d._nodeMap,r=[];for(const[,n]of f)n instanceof y&&n.__type===t&&(g||n.isAttached())&&r.push(n);return r}function tg(y,d,g){const t=y.getParent();let f=g,r=y;return t!==null&&(d&&g===0?(f=r.getIndexWithinParent(),r=t):d||g!==r.getChildrenSize()||(f=r.getIndexWithinParent()+1,r=t)),r.getChildAtIndex(d?f-1:f)}function wl(y,d){const g=y.offset;if(y.type==="element")return tg(y.getNode(),d,g);{const t=y.getNode();if(d&&g===0||!d&&g===t.getTextContentSize()){const f=d?t.getPreviousSibling():t.getNextSibling();return f===null?tg(t.getParentOrThrow(),d,t.getIndexWithinParent()+(d?0:1)):f}}return null}function eg(y){const d=Fc(y).event,g=d&&d.inputType;return g==="insertFromPaste"||g==="insertFromPasteAsQuotation"}function Ke(y,d,g){return $g(y,d,g)}function Dc(y){return!vr(y)&&!y.isLastChild()&&!y.isInline()}function Lc(y,d){const g=y._keyToDOMMap.get(d);return g===void 0&&Je(75,d),g}function Bc(y){const d=y.assignedSlot||y.parentElement;return d!==null&&d.nodeType===11?d.host:d}function Rv(y){Tr(),Wn()._updateTags.add(y)}function Wd(y,d){let g=y.getParent();for(;g!==null;){if(g.is(d))return!0;g=g.getParent()}return!1}function Fc(y){const d=y._window;return d===null&&Je(78),d}function Mv(y){let d=y.getParentOrThrow();for(;d!==null;){if(ko(d))return d;d=d.getParentOrThrow()}return d}function ko(y){return vr(y)||ge(y)&&y.isShadowRoot()}function Dv(y){const d=y.constructor.clone(y);return Fh(d,null),d}function Yo(y){const d=Wn(),g=y.constructor.getType(),t=d._nodes.get(g);t===void 0&&Je(97);const f=t.replace;if(f!==null){const r=f(y);return r instanceof y.constructor||Je(98),r}return y}function Kd(y,d){!vr(y.getParent())||ge(d)||Tn(d)||Je(99)}function Gd(y){return(Tn(y)||ge(y)&&!y.canBeEmpty())&&!y.isInline()}function Yd(y,d,g){g.style.removeProperty("caret-color"),d._blockCursorElement=null;const t=y.parentElement;t!==null&&t.removeChild(y)}function Lv(y,d,g){let t=y._blockCursorElement;if(xe(g)&&g.isCollapsed()&&g.anchor.type==="element"&&d.contains(document.activeElement)){const f=g.anchor,r=f.getNode(),n=f.offset;let e=!1,s=null;if(n===r.getChildrenSize())Gd(r.getChildAtIndex(n-1))&&(e=!0);else{const i=r.getChildAtIndex(n);if(Gd(i)){const l=i.getPreviousSibling();(l===null||Gd(l))&&(e=!0,s=y.getElementByKey(i.__key))}}if(e){const i=y.getElementByKey(r.__key);return t===null&&(y._blockCursorElement=t=function(l){const o=l.theme,a=document.createElement("div");a.contentEditable="false",a.setAttribute("data-lexical-cursor","true");let c=o.blockCursor;if(c!==void 0){if(typeof c=="string"){const u=Ic(c);c=o.blockCursor=u}c!==void 0&&a.classList.add(...c)}return a}(y._config)),d.style.caretColor="transparent",void(s===null?i.appendChild(t):i.insertBefore(t,s))}}t!==null&&Yd(t,y,d)}function Oo(y){return fo?(y||window).getSelection():null}function Bv(y,d){let g=y.getChildAtIndex(d);g==null&&(g=y),ko(y)&&Je(102);const t=n=>{const e=n.getParentOrThrow(),s=ko(e),i=n!==g||s?Dv(n):n;if(s)return ge(n)&&ge(i)||Je(133),n.insertAfter(i),[n,i,i];{const[l,o,a]=t(e),c=n.getNextSiblings();return a.append(i,...c),[l,o,i]}},[f,r]=t(g);return[f,r]}function Fv(y){return Sl(y)&&y.tagName==="A"}function Sl(y){return y.nodeType===1}function zv(y){const d=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return y.nodeName.match(d)!==null}function Uv(y){const d=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return y.nodeName.match(d)!==null}function os(y){if(vr(y)||Tn(y)&&!y.isInline())return!0;if(!ge(y)||ko(y))return!1;const d=y.getFirstChild(),g=d===null||ha(d)||Ne(d)||d.isInline();return!y.isInline()&&y.canBeEmpty()!==!1&&g}function Zd(y,d){let g=y;for(;g!==null&&g.getParent()!==null&&!d(g);)g=g.getParentOrThrow();return d(g)?g:null}function ng(y,d,g,t,f,r){let n=y.getFirstChild();for(;n!==null;){const e=n.__key;n.__parent===d&&(ge(n)&&ng(n,e,g,t,f,r),g.has(e)||r.delete(e),f.push(e)),n=n.getNextSibling()}}let Ti,kr,Cl,zc,Qd,Xd,fa,ho,tf,El,ir="",Or="",go=null,Zo="",rg=!1,Uc=!1,$c=null;function Hc(y,d){const g=fa.get(y);if(d!==null){const t=of(y);t.parentNode===d&&d.removeChild(t)}if(ho.has(y)||kr._keyToDOMMap.delete(y),ge(g)){const t=Jc(g,fa);ef(t,0,t.length-1,null)}g!==void 0&&Vd(El,Cl,zc,g,"destroyed")}function ef(y,d,g,t){let f=d;for(;f<=g;++f){const r=y[f];r!==void 0&&Hc(r,t)}}function pa(y,d){y.setProperty("text-align",d)}const $v="40px";function og(y,d){const g=Ti.theme.indent;if(typeof g=="string"){const f=y.classList.contains(g);d>0&&!f?y.classList.add(g):d<1&&f&&y.classList.remove(g)}const t=getComputedStyle(y).getPropertyValue("--lexical-indent-base-value")||$v;y.style.setProperty("padding-inline-start",d===0?"":`calc(${d} * ${t})`)}function ig(y,d){const g=y.style;d===0?pa(g,""):d===Pd?pa(g,"left"):d===Nd?pa(g,"center"):d===Id?pa(g,"right"):d===Rd?pa(g,"justify"):d===Md?pa(g,"start"):d===Dd&&pa(g,"end")}function qc(y,d,g){const t=ho.get(y);t===void 0&&Je(60);const f=t.createDOM(Ti,kr);if(function(r,n,e){const s=e._keyToDOMMap;n["__lexicalKey_"+e._key]=r,s.set(r,n)}(y,f,kr),Ne(t)?f.setAttribute("data-lexical-text","true"):Tn(t)&&f.setAttribute("data-lexical-decorator","true"),ge(t)){const r=t.__indent,n=t.__size;if(r!==0&&og(f,r),n!==0){const s=n-1;(function(i,l,o,a){const c=Or;Or="",nf(i,o,0,l,a,null),lg(o,a),Or=c})(Jc(t,ho),s,t,f)}const e=t.__format;e!==0&&ig(f,e),t.isInline()||sg(null,t,f),Dc(t)&&(ir+=Ko,Zo+=Ko)}else{const r=t.getTextContent();if(Tn(t)){const n=t.decorate(kr,Ti);n!==null&&cg(y,n),f.contentEditable="false"}else Ne(t)&&(t.isDirectionless()||(Or+=r));ir+=r,Zo+=r}if(d!==null)if(g!=null)d.insertBefore(f,g);else{const r=d.__lexicalLineBreak;r!=null?d.insertBefore(f,r):d.appendChild(f)}return Vd(El,Cl,zc,t,"created"),f}function nf(y,d,g,t,f,r){const n=ir;ir="";let e=g;for(;e<=t;++e){qc(y[e],f,r);const s=ho.get(y[e]);s!==null&&go===null&&Ne(s)&&(go=s.getFormat())}Dc(d)&&(ir+=Ko),f.__lexicalTextContent=ir,ir=n+ir}function ag(y,d){const g=d.get(y);return ha(g)||Tn(g)&&g.isInline()}function sg(y,d,g){const t=y!==null&&(y.__size===0||ag(y.__last,fa)),f=d.__size===0||ag(d.__last,ho);if(t){if(!f){const r=g.__lexicalLineBreak;r!=null&&g.removeChild(r),g.__lexicalLineBreak=null}}else if(f){const r=document.createElement("br");g.__lexicalLineBreak=r,g.appendChild(r)}}function lg(y,d){const g=d.__lexicalDirTextContent,t=d.__lexicalDir;if(g!==Or||t!==$c){const r=Or==="",n=r?$c:(f=Or,vv.test(f)?"rtl":_v.test(f)?"ltr":null);if(n!==t){const e=d.classList,s=Ti.theme;let i=t!==null?s[t]:void 0,l=n!==null?s[n]:void 0;if(i!==void 0){if(typeof i=="string"){const o=Ic(i);i=s[t]=o}e.remove(...i)}if(n===null||r&&n==="ltr")d.removeAttribute("dir");else{if(l!==void 0){if(typeof l=="string"){const o=Ic(l);l=s[n]=o}l!==void 0&&e.add(...l)}d.dir=n}Uc||(y.getWritable().__dir=n)}$c=n,d.__lexicalDirTextContent=Or,d.__lexicalDir=n}var f}function Hv(y,d,g){const t=Or;var f;Or="",go=null,function(r,n,e){const s=ir,i=r.__size,l=n.__size;if(ir="",i===1&&l===1){const o=r.__first,a=n.__first;if(o===a)kl(o,e);else{const u=of(o),h=qc(a,null,null);e.replaceChild(h,u),Hc(o,null)}const c=ho.get(a);go===null&&Ne(c)&&(go=c.getFormat())}else{const o=Jc(r,fa),a=Jc(n,ho);if(i===0)l!==0&&nf(a,n,0,l-1,e,null);else if(l===0){if(i!==0){const c=e.__lexicalLineBreak==null;ef(o,0,i-1,c?null:e),c&&(e.textContent="")}}else(function(c,u,h,p,m,b){const _=p-1,v=m-1;let w,x,S=(D=b,D.firstChild),E=0,k=0;for(var D;E<=_&&k<=v;){const R=u[E],A=h[k];if(R===A)S=rf(kl(A,b)),E++,k++;else{w===void 0&&(w=new Set(u)),x===void 0&&(x=new Set(h));const H=x.has(R),$=w.has(A);if(H)if($){const M=Lc(kr,A);M===S?S=rf(kl(A,b)):(S!=null?b.insertBefore(M,S):b.appendChild(M),kl(A,b)),E++,k++}else qc(A,b,S),k++;else S=rf(of(R)),Hc(R,b),E++}const z=ho.get(A);z!==null&&go===null&&Ne(z)&&(go=z.getFormat())}const P=E>_,O=k>v;if(P&&!O){const R=h[v+1];nf(h,c,k,v,b,R===void 0?null:kr.getElementByKey(R))}else O&&!P&&ef(u,E,_,b)})(n,o,a,i,l,e)}Dc(n)&&(ir+=Ko),e.__lexicalTextContent=ir,ir=s+ir}(y,d,g),lg(d,g),va(f=d)&&go!=null&&go!==f.__textFormat&&!Uc&&f.setTextFormat(go),Or=t,go=null}function Jc(y,d){const g=[];let t=y.__first;for(;t!==null;){const f=d.get(t);f===void 0&&Je(101),g.push(t),t=f.__next}return g}function kl(y,d){const g=fa.get(y);let t=ho.get(y);g!==void 0&&t!==void 0||Je(61);const f=rg||Xd.has(y)||Qd.has(y),r=Lc(kr,y);if(g===t&&!f){if(ge(g)){const n=r.__lexicalTextContent;n!==void 0&&(ir+=n,Zo+=n);const e=r.__lexicalDirTextContent;e!==void 0&&(Or+=e)}else{const n=g.getTextContent();Ne(g)&&!g.isDirectionless()&&(Or+=n),Zo+=n,ir+=n}return r}if(g!==t&&f&&Vd(El,Cl,zc,t,"updated"),t.updateDOM(g,r,Ti)){const n=qc(y,null,null);return d===null&&Je(62),d.replaceChild(n,r),Hc(y,null),n}if(ge(g)&&ge(t)){const n=t.__indent;n!==g.__indent&&og(r,n);const e=t.__format;e!==g.__format&&ig(r,e),f&&(Hv(g,t,r),vr(t)||t.isInline()||sg(g,t,r)),Dc(t)&&(ir+=Ko,Zo+=Ko)}else{const n=t.getTextContent();if(Tn(t)){const e=t.decorate(kr,Ti);e!==null&&cg(y,e)}else Ne(t)&&!t.isDirectionless()&&(Or+=n);ir+=n,Zo+=n}if(!Uc&&vr(t)&&t.__cachedText!==Zo){const n=t.getWritable();n.__cachedText=Zo,t=n}return r}function cg(y,d){let g=kr._pendingDecorators;const t=kr._decorators;if(g===null){if(t[y]===d)return;g=Uh(kr)}g[y]=d}function rf(y){let d=y.nextSibling;return d!==null&&d===kr._blockCursorElement&&(d=d.nextSibling),d}function qv(y,d,g,t,f,r){ir="",Zo="",Or="",rg=t===es,$c=null,kr=g,Ti=g._config,Cl=g._nodes,zc=kr._listeners.mutation,Qd=f,Xd=r,fa=y._nodeMap,ho=d._nodeMap,Uc=d._readOnly,tf=new Map(g._keyToDOMMap);const n=new Map;return El=n,kl("root",null),kr=void 0,Cl=void 0,Qd=void 0,Xd=void 0,fa=void 0,ho=void 0,Ti=void 0,tf=void 0,El=void 0,n}function of(y){const d=tf.get(y);return d===void 0&&Je(75,y),d}const Qo=Object.freeze({}),af=30,sf=[["keydown",function(y,d){if(Ol=y.timeStamp,ug=y.key,d.isComposing())return;const{key:g,shiftKey:t,ctrlKey:f,metaKey:r,altKey:n}=y;Ke(d,ev,y)||g!=null&&(function(e,s,i,l){return Gh(e)&&!s&&!l&&!i}(g,f,n,r)?Ke(d,Cc,y):function(e,s,i,l,o){return Gh(e)&&!l&&!i&&(s||o)}(g,f,t,n,r)?Ke(d,nv,y):function(e,s,i,l){return Kh(e)&&!s&&!l&&!i}(g,f,n,r)?Ke(d,Ec,y):function(e,s,i,l,o){return Kh(e)&&!l&&!i&&(s||o)}(g,f,t,n,r)?Ke(d,rv,y):function(e,s,i){return function(l){return l==="ArrowUp"}(e)&&!s&&!i}(g,f,r)?Ke(d,Sd,y):function(e,s,i){return function(l){return l==="ArrowDown"}(e)&&!s&&!i}(g,f,r)?Ke(d,Cd,y):function(e,s){return Yh(e)&&s}(g,t)?(Tl=!0,Ke(d,dl,y)):function(e){return e===" "}(g)?Ke(d,ov,y):function(e,s){return po&&s&&e.toLowerCase()==="o"}(g,f)?(y.preventDefault(),Tl=!0,Ke(d,wi,!0)):function(e,s){return Yh(e)&&!s}(g,t)?(Tl=!1,Ke(d,dl,y)):function(e,s,i,l){return po?!s&&!i&&(vl(e)||e.toLowerCase()==="h"&&l):!(l||s||i)&&vl(e)}(g,n,r,f)?vl(g)?Ke(d,fl,y):(y.preventDefault(),Ke(d,uo,!0)):function(e){return e==="Escape"}(g)?Ke(d,kc,y):function(e,s,i,l,o){return po?!(i||l||o)&&(_l(e)||e.toLowerCase()==="d"&&s):!(s||l||o)&&_l(e)}(g,f,t,n,r)?_l(g)?Ke(d,pl,y):(y.preventDefault(),Ke(d,uo,!1)):function(e,s,i){return vl(e)&&(po?s:i)}(g,n,f)?(y.preventDefault(),Ke(d,ca,!0)):function(e,s,i){return _l(e)&&(po?s:i)}(g,n,f)?(y.preventDefault(),Ke(d,ca,!1)):function(e,s){return po&&s&&vl(e)}(g,r)?(y.preventDefault(),Ke(d,Ci,!0)):function(e,s){return po&&s&&_l(e)}(g,r)?(y.preventDefault(),Ke(d,Ci,!1)):function(e,s,i,l){return e.toLowerCase()==="b"&&!s&&bl(i,l)}(g,n,r,f)?(y.preventDefault(),Ke(d,Er,"bold")):function(e,s,i,l){return e.toLowerCase()==="u"&&!s&&bl(i,l)}(g,n,r,f)?(y.preventDefault(),Ke(d,Er,"underline")):function(e,s,i,l){return e.toLowerCase()==="i"&&!s&&bl(i,l)}(g,n,r,f)?(y.preventDefault(),Ke(d,Er,"italic")):function(e,s,i,l){return e==="Tab"&&!s&&!i&&!l}(g,n,f,r)?Ke(d,wh,y):function(e,s,i,l){return e.toLowerCase()==="z"&&!s&&bl(i,l)}(g,t,r,f)?(y.preventDefault(),Ke(d,cl,void 0)):function(e,s,i,l){return po?e.toLowerCase()==="z"&&i&&s:e.toLowerCase()==="y"&&l||e.toLowerCase()==="z"&&l&&s}(g,t,r,f)?(y.preventDefault(),Ke(d,ul,void 0)):Xr(d._editorState._selection)?function(e,s,i,l){return!s&&e.toLowerCase()==="c"&&(po?i:l)}(g,t,r,f)?(y.preventDefault(),Ke(d,hl,y)):function(e,s,i,l){return!s&&e.toLowerCase()==="x"&&(po?i:l)}(g,t,r,f)?(y.preventDefault(),Ke(d,gl,y)):Zh(g,r,f)&&(y.preventDefault(),Ke(d,Oc,y)):!Ei&&Zh(g,r,f)&&(y.preventDefault(),Ke(d,Oc,y)),function(e,s,i,l){return e||s||i||l}(f,t,n,r)&&Ke(d,uv,y))}],["pointerdown",function(y,d){const g=y.target,t=y.pointerType;g instanceof Node&&t!=="touch"&&Hr(d,()=>{Tn(rr(g))||(cf=!0)})}],["compositionstart",function(y,d){Hr(d,()=>{const g=Oe();if(xe(g)&&!d.isComposing()){const t=g.anchor,f=g.anchor.getNode();hr(t.key),(y.timeStamp<Ol+af||t.type==="element"||!g.isCollapsed()||f.getFormat()!==g.format||Ne(f)&&f.getStyle()!==g.style)&&Ke(d,Si,bv)}})}],["compositionend",function(y,d){Ei?jl=!0:Hr(d,()=>{uf(d,y.data)})}],["input",function(y,d){y.stopPropagation(),Hr(d,()=>{const g=Oe(),t=y.data,f=mg(y);if(t!=null&&xe(g)&&pg(g,f,t,y.timeStamp,!1)){jl&&(uf(d,t),jl=!1);const r=g.anchor.getNode(),n=Oo(d._window);if(n===null)return;const e=g.isBackward(),s=e?g.anchor.offset:g.focus.offset,i=e?g.focus.offset:g.anchor.offset;Tc&&!g.isCollapsed()&&Ne(r)&&n.anchorNode!==null&&r.getTextContent().slice(0,s)+t+r.getTextContent().slice(s+i)===Wh(n.anchorNode)||Ke(d,Si,t);const l=t.length;Ei&&l>1&&y.inputType==="insertCompositionText"&&!d.isComposing()&&(g.anchor.offset-=l),Td||jc||jd||!d.isComposing()||(Ol=0,hr(null))}else qd(!1,d,t!==null?t:void 0),jl&&(uf(d,t||void 0),jl=!1);Tr(),Nh(Wn())}),is=null}],["click",function(y,d){Hr(d,()=>{const g=Oe(),t=Oo(d._window),f=ma();if(t){if(xe(g)){const r=g.anchor,n=r.getNode();r.type==="element"&&r.offset===0&&g.isCollapsed()&&!vr(n)&&Ln().getChildrenSize()===1&&n.getTopLevelElementOrThrow().isEmpty()&&f!==null&&g.is(f)?(t.removeAllRanges(),g.dirty=!0):y.detail===3&&!g.isCollapsed()&&n!==g.focus.getNode()&&(ge(n)?n.select(0):n.getParentOrThrow().select(0))}else if(y.pointerType==="touch"){const r=t.anchorNode;if(r!==null){const n=r.nodeType;(n===ml||n===ki)&&or(Yc(f,t,d,y))}}}Ke(d,xh,y)})}],["cut",Qo],["copy",Qo],["dragstart",Qo],["dragover",Qo],["dragend",Qo],["paste",Qo],["focus",Qo],["blur",Qo],["drop",Qo]];Tc&&sf.push(["beforeinput",(y,d)=>function(g,t){const f=g.inputType,r=mg(g);f==="deleteCompositionText"||Ei&&eg(t)||f!=="insertCompositionText"&&Hr(t,()=>{const n=Oe();if(f==="deleteContentBackward"){if(n===null){const c=ma();if(!xe(c))return;or(c.clone())}if(xe(n)){const c=n.anchor.key===n.focus.key;if(e=g.timeStamp,ug==="MediaLast"&&e<Ol+af&&t.isComposing()&&c){if(hr(null),Ol=0,setTimeout(()=>{Hr(t,()=>{hr(null)})},af),xe(n)){const u=n.anchor.getNode();u.markDirty(),n.format=u.getFormat(),Ne(u)||Je(142),n.style=u.getStyle()}}else{hr(null),g.preventDefault();const u=n.anchor.getNode().getTextContent(),h=n.anchor.offset===0&&n.focus.offset===u.length;pv&&c&&!h||Ke(t,uo,!0)}return}}var e;if(!xe(n))return;const s=g.data;is!==null&&qd(!1,t,is),n.dirty&&is===null||!n.isCollapsed()||vr(n.anchor.getNode())||r===null||n.applyDOMRange(r),is=null;const i=n.anchor,l=n.focus,o=i.getNode(),a=l.getNode();if(f!=="insertText"&&f!=="insertTranspose")switch(g.preventDefault(),f){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Ke(t,Si,g);break;case"insertFromComposition":hr(null),Ke(t,Si,g);break;case"insertLineBreak":hr(null),Ke(t,wi,!1);break;case"insertParagraph":hr(null),Tl&&!jc?(Tl=!1,Ke(t,wi,!1)):Ke(t,Za,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Ke(t,ll,g);break;case"deleteByComposition":(function(c,u){return c!==u||ge(c)||ge(u)||!c.isToken()||!u.isToken()})(o,a)&&Ke(t,Sc,g);break;case"deleteByDrag":case"deleteByCut":Ke(t,Sc,g);break;case"deleteContent":Ke(t,uo,!1);break;case"deleteWordBackward":Ke(t,ca,!0);break;case"deleteWordForward":Ke(t,ca,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Ke(t,Ci,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Ke(t,Ci,!1);break;case"formatStrikeThrough":Ke(t,Er,"strikethrough");break;case"formatBold":Ke(t,Er,"bold");break;case"formatItalic":Ke(t,Er,"italic");break;case"formatUnderline":Ke(t,Er,"underline");break;case"historyUndo":Ke(t,cl,void 0);break;case"historyRedo":Ke(t,ul,void 0)}else{if(s===`
|
|
32
|
-
`)g.preventDefault(),Ke(t,wi,!1);else if(s===Ko)g.preventDefault(),Ke(t,Za,void 0);else if(s==null&&g.dataTransfer){const c=g.dataTransfer.getData("text/plain");g.preventDefault(),n.insertRawText(c)}else s!=null&&
|
|
33
|
-
`){const t=Oe();if(xe(t)){const f=t.focus;return t.anchor.set(f.key,f.offset,f.type),void Ke(y,dl,null)}}}qd(!0,y,d)}function
|
|
34
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:d=>function(g){const t=g.parentElement;if(t!==null){const f=t.firstChild;if(f===g||f.nextSibling===g&&
|
|
31
|
+
`,mv=Ei?" ":Nc,Oh="֑-߿יִ-﷽ﹰ-ﻼ",Th="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",yv=new RegExp("^[^"+Th+"]*["+Oh+"]"),bv=new RegExp("^[^"+Oh+"]*["+Th+"]"),Go={bold:1,code:16,highlight:Ad,italic:2,strikethrough:Ac,subscript:32,superscript:64,underline:Pc},vv={directionless:1,unmergeable:2},jh={center:Nd,end:Dd,justify:Rd,left:Pd,right:Id,start:Md},_v={[Nd]:"center",[Dd]:"end",[Rd]:"justify",[Pd]:"left",[Id]:"right",[Md]:"start"},xv={normal:0,segmented:2,token:1},wv={[fv]:"normal",[hv]:"segmented",[pv]:"token"};function Sv(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var Je=Sv(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function Ic(...y){const d=[];for(const g of y)if(g&&typeof g=="string")for(const[t]of g.matchAll(/\S+/g))d.push(t);return d}const Cv=100;let Ld=!1,Bd=0;function Ev(y){Bd=y.timeStamp}function Fd(y,d,g){return d.__lexicalLineBreak===y||y[`__lexicalKey_${g._key}`]!==void 0}function kv(y,d,g){const t=Oo(g._window);let f=null,r=null;t!==null&&t.anchorNode===y&&(f=t.anchorOffset,r=t.focusOffset);const n=y.nodeValue;n!==null&&Jd(d,n,f,r,!1)}function Ov(y,d,g){if(xe(y)){const t=y.anchor.getNode();if(t.is(g)&&y.format!==t.getFormat())return!1}return d.nodeType===ki&&g.isAttached()}function Ah(y,d,g){Ld=!0;const t=performance.now()-Bd>Cv;try{Hr(y,()=>{const f=Oe()||function(a){return a.getEditorState().read(()=>{const c=Oe();return c!==null?c.clone():null})}(y),r=new Map,n=y.getRootElement(),e=y._editorState,s=y._blockCursorElement;let i=!1,l="";for(let a=0;a<d.length;a++){const c=d[a],u=c.type,h=c.target;let p=rr(h,e);if(!(p===null&&h!==n||Tn(p))){if(u==="characterData")t&&Ne(p)&&Ov(f,h,p)&&kv(h,p,y);else if(u==="childList"){i=!0;const m=c.addedNodes;for(let v=0;v<m.length;v++){const w=m[v],x=Fh(w),S=w.parentNode;if(S!=null&&w!==s&&x===null&&(w.nodeName!=="BR"||!Fd(w,S,y))){if(Ei){const E=w.innerText||w.nodeValue;E&&(l+=E)}S.removeChild(w)}}const b=c.removedNodes,_=b.length;if(_>0){let v=0;for(let w=0;w<_;w++){const x=b[w];(x.nodeName==="BR"&&Fd(x,h,y)||s===x)&&(h.appendChild(x),v++)}_!==v&&(h===n&&(p=$h(e)),r.set(h,p))}}}}if(r.size>0)for(const[a,c]of r)if(ge(c)){const u=c.getChildrenKeys();let h=a.firstChild;for(let p=0;p<u.length;p++){const m=u[p],b=y.getElementByKey(m);b!==null&&(h==null?(a.appendChild(b),h=b):h!==b&&a.replaceChild(b,h),h=h.nextSibling)}}else Ne(c)&&c.markDirty();const o=g.takeRecords();if(o.length>0){for(let a=0;a<o.length;a++){const c=o[a],u=c.addedNodes,h=c.target;for(let p=0;p<u.length;p++){const m=u[p],b=m.parentNode;b==null||m.nodeName!=="BR"||Fd(m,h,y)||b.removeChild(m)}}g.takeRecords()}f!==null&&(i&&(f.dirty=!0,or(f)),Ei&&tg(y)&&f.insertRawText(l))})}finally{Ld=!1}}function Ph(y){const d=y._observer;d!==null&&Ah(y,d.takeRecords(),d)}function Nh(y){(function(d){Bd===0&&Fc(d).addEventListener("textInput",Ev,!0)})(y),y._observer=new MutationObserver((d,g)=>{Ah(y,d,g)})}function Ih(y,d){const g=y.__mode,t=y.__format,f=y.__style,r=d.__mode,n=d.__format,e=d.__style;return!(g!==null&&g!==r||t!==null&&t!==n||f!==null&&f!==e)}function Rh(y,d){const g=y.mergeWithSibling(d),t=Wn()._normalizedNodes;return t.add(y.__key),t.add(d.__key),g}function Mh(y){let d,g,t=y;if(t.__text!==""||!t.isSimpleText()||t.isUnmergeable()){for(;(d=t.getPreviousSibling())!==null&&Ne(d)&&d.isSimpleText()&&!d.isUnmergeable();){if(d.__text!==""){if(Ih(d,t)){t=Rh(d,t);break}break}d.remove()}for(;(g=t.getNextSibling())!==null&&Ne(g)&&g.isSimpleText()&&!g.isUnmergeable();){if(g.__text!==""){if(Ih(t,g)){t=Rh(t,g);break}break}g.remove()}}else t.remove()}function zd(y){return Dh(y.anchor),Dh(y.focus),y}function Dh(y){for(;y.type==="element";){const d=y.getNode(),g=y.offset;let t,f;if(g===d.getChildrenSize()?(t=d.getChildAtIndex(g-1),f=!0):(t=d.getChildAtIndex(g),f=!1),Ne(t)){y.set(t.__key,f?t.getTextContentSize():0,"text");break}if(!ge(t))break;y.set(t.__key,f?t.getChildrenSize():0,"element")}}let Tv=1;const jv=typeof queueMicrotask=="function"?queueMicrotask:y=>{Promise.resolve().then(y)};function Ud(y){const d=document.activeElement;if(d===null)return!1;const g=d.nodeName;return Tn(rr(y))&&(g==="INPUT"||g==="TEXTAREA"||d.contentEditable==="true"&&d.__lexicalEditor==null)}function yl(y,d,g){const t=y.getRootElement();try{return t!==null&&t.contains(d)&&t.contains(g)&&d!==null&&!Ud(d)&&Lh(d)===y}catch{return!1}}function Lh(y){let d=y;for(;d!=null;){const g=d.__lexicalEditor;if(g!=null)return g;d=Bc(d)}return null}function ns(y){return y.isToken()||y.isSegmented()}function Av(y){return y.nodeType===ki}function Rc(y){let d=y;for(;d!=null;){if(Av(d))return d;d=d.firstChild}return null}function $d(y,d,g){const t=Go[d];if(g!==null&&(y&t)==(g&t))return y;let f=y^t;return d==="subscript"?f&=~Go.superscript:d==="superscript"&&(f&=~Go.subscript),f}function Bh(y,d){if(d!=null)return void(y.__key=d);Tr(),Lg();const g=Wn(),t=To(),f=""+Tv++;t._nodeMap.set(f,y),ge(y)?g._dirtyElements.set(f,!0):g._dirtyLeaves.add(f),g._cloneNotNeeded.add(f),g._dirtyType=kh,y.__key=f}function da(y){const d=y.getParent();if(d!==null){const g=y.getWritable(),t=d.getWritable(),f=y.getPreviousSibling(),r=y.getNextSibling();if(f===null)if(r!==null){const n=r.getWritable();t.__first=r.__key,n.__prev=null}else t.__first=null;else{const n=f.getWritable();if(r!==null){const e=r.getWritable();e.__prev=n.__key,n.__next=e.__key}else n.__next=null;g.__prev=null}if(r===null)if(f!==null){const n=f.getWritable();t.__last=f.__key,n.__next=null}else t.__last=null;else{const n=r.getWritable();if(f!==null){const e=f.getWritable();e.__next=n.__key,n.__prev=e.__key}else n.__prev=null;g.__next=null}t.__size--,g.__parent=null}}function Mc(y){Lg();const d=y.getLatest(),g=d.__parent,t=To(),f=Wn(),r=t._nodeMap,n=f._dirtyElements;g!==null&&function(s,i,l){let o=s;for(;o!==null;){if(l.has(o))return;const a=i.get(o);if(a===void 0)break;l.set(o,!1),o=a.__parent}}(g,r,n);const e=d.__key;f._dirtyType=kh,ge(y)?n.set(e,!0):f._dirtyLeaves.add(e)}function hr(y){Tr();const d=Wn(),g=d._compositionKey;if(y!==g){if(d._compositionKey=y,g!==null){const t=Vn(g);t!==null&&t.getWritable()}if(y!==null){const t=Vn(y);t!==null&&t.getWritable()}}}function Oi(){return cs()?null:Wn()._compositionKey}function Vn(y,d){const g=(d||To())._nodeMap.get(y);return g===void 0?null:g}function Fh(y,d){const g=y[`__lexicalKey_${Wn()._key}`];return g!==void 0?Vn(g,d):null}function rr(y,d){let g=y;for(;g!=null;){const t=Fh(g,d);if(t!==null)return t;g=Bc(g)}return null}function zh(y){const d=y._decorators,g=Object.assign({},d);return y._pendingDecorators=g,g}function Uh(y){return y.read(()=>Ln().getTextContent())}function Ln(){return $h(To())}function $h(y){return y._nodeMap.get("root")}function or(y){Tr();const d=To();y!==null&&(y.dirty=!0,y.setCachedNodes(null)),d._selection=y}function rs(y){const d=Wn(),g=function(t,f){let r=t;for(;r!=null;){const n=r[`__lexicalKey_${f._key}`];if(n!==void 0)return n;r=Bc(r)}return null}(y,d);return g===null?y===d.getRootElement()?Vn("root"):null:Vn(g)}function Hh(y,d){return d?y.getTextContentSize():0}function qh(y){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(y)}function Hd(y){const d=[];let g=y;for(;g!==null;)d.push(g),g=g._parentEditor;return d}function Jh(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function Vh(y){return y.nodeType===ki?y.nodeValue:null}function qd(y,d,g){const t=Oo(d._window);if(t===null)return;const f=t.anchorNode;let{anchorOffset:r,focusOffset:n}=t;if(f!==null){let e=Vh(f);const s=rr(f);if(e!==null&&Ne(s)){if(e===Nc&&g){const i=g.length;e=g,r=i,n=i}e!==null&&Jd(s,e,r,n,y)}}}function Jd(y,d,g,t,f){let r=y;if(r.isAttached()&&(f||!r.isDirty())){const n=r.isComposing();let e=d;(n||f)&&d[d.length-1]===Nc&&(e=d.slice(0,-1));const s=r.getTextContent();if(f||e!==s){if(e===""){if(hr(null),Td||jc||jd)r.remove();else{const h=Wn();setTimeout(()=>{h.update(()=>{r.isAttached()&&r.remove()})},20)}return}const i=r.getParent(),l=ma(),o=r.getTextContentSize(),a=Oi(),c=r.getKey();if(r.isToken()||a!==null&&c===a&&!n||xe(l)&&(i!==null&&!i.canInsertTextBefore()&&l.anchor.offset===0||l.anchor.key===y.__key&&l.anchor.offset===0&&!r.canInsertTextBefore()&&!n||l.focus.key===y.__key&&l.focus.offset===o&&!r.canInsertTextAfter()&&!n))return void r.markDirty();const u=Oe();if(!xe(u)||g===null||t===null)return void r.setTextContent(e);if(u.setTextNodeRange(r,g,r,t),r.isSegmented()){const h=ar(r.getTextContent());r.replace(h),r=h}r.setTextContent(e)}}}function Pv(y,d){if(d.isSegmented())return!0;if(!y.isCollapsed())return!1;const g=y.anchor.offset,t=d.getParentOrThrow(),f=d.isToken();return g===0?!d.canInsertTextBefore()||!t.canInsertTextBefore()&&!d.isComposing()||f||function(r){const n=r.getPreviousSibling();return(Ne(n)||ge(n)&&n.isInline())&&!n.canInsertTextAfter()}(d):g===d.getTextContentSize()&&(!d.canInsertTextAfter()||!t.canInsertTextAfter()&&!d.isComposing()||f)}function Wh(y){return y==="ArrowLeft"}function Kh(y){return y==="ArrowRight"}function bl(y,d){return po?y:d}function Gh(y){return y==="Enter"}function vl(y){return y==="Backspace"}function _l(y){return y==="Delete"}function Yh(y,d,g){return y.toLowerCase()==="a"&&bl(d,g)}function Zh(){const y=Ln();or(zd(y.select(0,y.getChildrenSize())))}function xl(y,d){y.__lexicalClassNameCache===void 0&&(y.__lexicalClassNameCache={});const g=y.__lexicalClassNameCache,t=g[d];if(t!==void 0)return t;const f=y[d];if(typeof f=="string"){const r=Ic(f);return g[d]=r,r}return f}function Vd(y,d,g,t,f){if(g.size===0)return;const r=t.__type,n=t.__key,e=d.get(r);e===void 0&&Je(33,r);const s=e.klass;let i=y.get(s);i===void 0&&(i=new Map,y.set(s,i));const l=i.get(n),o=l==="destroyed"&&f==="created";(l===void 0||o)&&i.set(n,o?"updated":f)}function Qh(y){const d=To(),g=d._readOnly,t=y.getType(),f=d._nodeMap,r=[];for(const[,n]of f)n instanceof y&&n.__type===t&&(g||n.isAttached())&&r.push(n);return r}function Xh(y,d,g){const t=y.getParent();let f=g,r=y;return t!==null&&(d&&g===0?(f=r.getIndexWithinParent(),r=t):d||g!==r.getChildrenSize()||(f=r.getIndexWithinParent()+1,r=t)),r.getChildAtIndex(d?f-1:f)}function wl(y,d){const g=y.offset;if(y.type==="element")return Xh(y.getNode(),d,g);{const t=y.getNode();if(d&&g===0||!d&&g===t.getTextContentSize()){const f=d?t.getPreviousSibling():t.getNextSibling();return f===null?Xh(t.getParentOrThrow(),d,t.getIndexWithinParent()+(d?0:1)):f}}return null}function tg(y){const d=Fc(y).event,g=d&&d.inputType;return g==="insertFromPaste"||g==="insertFromPasteAsQuotation"}function Ke(y,d,g){return Ug(y,d,g)}function Dc(y){return!vr(y)&&!y.isLastChild()&&!y.isInline()}function Lc(y,d){const g=y._keyToDOMMap.get(d);return g===void 0&&Je(75,d),g}function Bc(y){const d=y.assignedSlot||y.parentElement;return d!==null&&d.nodeType===11?d.host:d}function Nv(y){Tr(),Wn()._updateTags.add(y)}function Wd(y,d){let g=y.getParent();for(;g!==null;){if(g.is(d))return!0;g=g.getParent()}return!1}function Fc(y){const d=y._window;return d===null&&Je(78),d}function Iv(y){let d=y.getParentOrThrow();for(;d!==null;){if(ko(d))return d;d=d.getParentOrThrow()}return d}function ko(y){return vr(y)||ge(y)&&y.isShadowRoot()}function Rv(y){const d=y.constructor.clone(y);return Bh(d,null),d}function Yo(y){const d=Wn(),g=y.constructor.getType(),t=d._nodes.get(g);t===void 0&&Je(97);const f=t.replace;if(f!==null){const r=f(y);return r instanceof y.constructor||Je(98),r}return y}function Kd(y,d){!vr(y.getParent())||ge(d)||Tn(d)||Je(99)}function Gd(y){return(Tn(y)||ge(y)&&!y.canBeEmpty())&&!y.isInline()}function Yd(y,d,g){g.style.removeProperty("caret-color"),d._blockCursorElement=null;const t=y.parentElement;t!==null&&t.removeChild(y)}function Mv(y,d,g){let t=y._blockCursorElement;if(xe(g)&&g.isCollapsed()&&g.anchor.type==="element"&&d.contains(document.activeElement)){const f=g.anchor,r=f.getNode(),n=f.offset;let e=!1,s=null;if(n===r.getChildrenSize())Gd(r.getChildAtIndex(n-1))&&(e=!0);else{const i=r.getChildAtIndex(n);if(Gd(i)){const l=i.getPreviousSibling();(l===null||Gd(l))&&(e=!0,s=y.getElementByKey(i.__key))}}if(e){const i=y.getElementByKey(r.__key);return t===null&&(y._blockCursorElement=t=function(l){const o=l.theme,a=document.createElement("div");a.contentEditable="false",a.setAttribute("data-lexical-cursor","true");let c=o.blockCursor;if(c!==void 0){if(typeof c=="string"){const u=Ic(c);c=o.blockCursor=u}c!==void 0&&a.classList.add(...c)}return a}(y._config)),d.style.caretColor="transparent",void(s===null?i.appendChild(t):i.insertBefore(t,s))}}t!==null&&Yd(t,y,d)}function Oo(y){return fo?(y||window).getSelection():null}function Dv(y,d){let g=y.getChildAtIndex(d);g==null&&(g=y),ko(y)&&Je(102);const t=n=>{const e=n.getParentOrThrow(),s=ko(e),i=n!==g||s?Rv(n):n;if(s)return ge(n)&&ge(i)||Je(133),n.insertAfter(i),[n,i,i];{const[l,o,a]=t(e),c=n.getNextSiblings();return a.append(i,...c),[l,o,i]}},[f,r]=t(g);return[f,r]}function Lv(y){return Sl(y)&&y.tagName==="A"}function Sl(y){return y.nodeType===1}function Bv(y){const d=new RegExp(/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var|#text)$/,"i");return y.nodeName.match(d)!==null}function Fv(y){const d=new RegExp(/^(address|article|aside|blockquote|canvas|dd|div|dl|dt|fieldset|figcaption|figure|footer|form|h1|h2|h3|h4|h5|h6|header|hr|li|main|nav|noscript|ol|p|pre|section|table|td|tfoot|ul|video)$/,"i");return y.nodeName.match(d)!==null}function os(y){if(vr(y)||Tn(y)&&!y.isInline())return!0;if(!ge(y)||ko(y))return!1;const d=y.getFirstChild(),g=d===null||ha(d)||Ne(d)||d.isInline();return!y.isInline()&&y.canBeEmpty()!==!1&&g}function Zd(y,d){let g=y;for(;g!==null&&g.getParent()!==null&&!d(g);)g=g.getParentOrThrow();return d(g)?g:null}function eg(y,d,g,t,f,r){let n=y.getFirstChild();for(;n!==null;){const e=n.__key;n.__parent===d&&(ge(n)&&eg(n,e,g,t,f,r),g.has(e)||r.delete(e),f.push(e)),n=n.getNextSibling()}}let Ti,kr,Cl,zc,Qd,Xd,fa,ho,tf,El,ir="",Or="",go=null,Zo="",ng=!1,Uc=!1,$c=null;function Hc(y,d){const g=fa.get(y);if(d!==null){const t=of(y);t.parentNode===d&&d.removeChild(t)}if(ho.has(y)||kr._keyToDOMMap.delete(y),ge(g)){const t=Jc(g,fa);ef(t,0,t.length-1,null)}g!==void 0&&Vd(El,Cl,zc,g,"destroyed")}function ef(y,d,g,t){let f=d;for(;f<=g;++f){const r=y[f];r!==void 0&&Hc(r,t)}}function pa(y,d){y.setProperty("text-align",d)}const zv="40px";function rg(y,d){const g=Ti.theme.indent;if(typeof g=="string"){const f=y.classList.contains(g);d>0&&!f?y.classList.add(g):d<1&&f&&y.classList.remove(g)}const t=getComputedStyle(y).getPropertyValue("--lexical-indent-base-value")||zv;y.style.setProperty("padding-inline-start",d===0?"":`calc(${d} * ${t})`)}function og(y,d){const g=y.style;d===0?pa(g,""):d===Pd?pa(g,"left"):d===Nd?pa(g,"center"):d===Id?pa(g,"right"):d===Rd?pa(g,"justify"):d===Md?pa(g,"start"):d===Dd&&pa(g,"end")}function qc(y,d,g){const t=ho.get(y);t===void 0&&Je(60);const f=t.createDOM(Ti,kr);if(function(r,n,e){const s=e._keyToDOMMap;n["__lexicalKey_"+e._key]=r,s.set(r,n)}(y,f,kr),Ne(t)?f.setAttribute("data-lexical-text","true"):Tn(t)&&f.setAttribute("data-lexical-decorator","true"),ge(t)){const r=t.__indent,n=t.__size;if(r!==0&&rg(f,r),n!==0){const s=n-1;(function(i,l,o,a){const c=Or;Or="",nf(i,o,0,l,a,null),sg(o,a),Or=c})(Jc(t,ho),s,t,f)}const e=t.__format;e!==0&&og(f,e),t.isInline()||ag(null,t,f),Dc(t)&&(ir+=Ko,Zo+=Ko)}else{const r=t.getTextContent();if(Tn(t)){const n=t.decorate(kr,Ti);n!==null&&lg(y,n),f.contentEditable="false"}else Ne(t)&&(t.isDirectionless()||(Or+=r));ir+=r,Zo+=r}if(d!==null)if(g!=null)d.insertBefore(f,g);else{const r=d.__lexicalLineBreak;r!=null?d.insertBefore(f,r):d.appendChild(f)}return Vd(El,Cl,zc,t,"created"),f}function nf(y,d,g,t,f,r){const n=ir;ir="";let e=g;for(;e<=t;++e){qc(y[e],f,r);const s=ho.get(y[e]);s!==null&&go===null&&Ne(s)&&(go=s.getFormat())}Dc(d)&&(ir+=Ko),f.__lexicalTextContent=ir,ir=n+ir}function ig(y,d){const g=d.get(y);return ha(g)||Tn(g)&&g.isInline()}function ag(y,d,g){const t=y!==null&&(y.__size===0||ig(y.__last,fa)),f=d.__size===0||ig(d.__last,ho);if(t){if(!f){const r=g.__lexicalLineBreak;r!=null&&g.removeChild(r),g.__lexicalLineBreak=null}}else if(f){const r=document.createElement("br");g.__lexicalLineBreak=r,g.appendChild(r)}}function sg(y,d){const g=d.__lexicalDirTextContent,t=d.__lexicalDir;if(g!==Or||t!==$c){const r=Or==="",n=r?$c:(f=Or,yv.test(f)?"rtl":bv.test(f)?"ltr":null);if(n!==t){const e=d.classList,s=Ti.theme;let i=t!==null?s[t]:void 0,l=n!==null?s[n]:void 0;if(i!==void 0){if(typeof i=="string"){const o=Ic(i);i=s[t]=o}e.remove(...i)}if(n===null||r&&n==="ltr")d.removeAttribute("dir");else{if(l!==void 0){if(typeof l=="string"){const o=Ic(l);l=s[n]=o}l!==void 0&&e.add(...l)}d.dir=n}Uc||(y.getWritable().__dir=n)}$c=n,d.__lexicalDirTextContent=Or,d.__lexicalDir=n}var f}function Uv(y,d,g){const t=Or;var f;Or="",go=null,function(r,n,e){const s=ir,i=r.__size,l=n.__size;if(ir="",i===1&&l===1){const o=r.__first,a=n.__first;if(o===a)kl(o,e);else{const u=of(o),h=qc(a,null,null);e.replaceChild(h,u),Hc(o,null)}const c=ho.get(a);go===null&&Ne(c)&&(go=c.getFormat())}else{const o=Jc(r,fa),a=Jc(n,ho);if(i===0)l!==0&&nf(a,n,0,l-1,e,null);else if(l===0){if(i!==0){const c=e.__lexicalLineBreak==null;ef(o,0,i-1,c?null:e),c&&(e.textContent="")}}else(function(c,u,h,p,m,b){const _=p-1,v=m-1;let w,x,S=(D=b,D.firstChild),E=0,k=0;for(var D;E<=_&&k<=v;){const R=u[E],A=h[k];if(R===A)S=rf(kl(A,b)),E++,k++;else{w===void 0&&(w=new Set(u)),x===void 0&&(x=new Set(h));const H=x.has(R),$=w.has(A);if(H)if($){const M=Lc(kr,A);M===S?S=rf(kl(A,b)):(S!=null?b.insertBefore(M,S):b.appendChild(M),kl(A,b)),E++,k++}else qc(A,b,S),k++;else S=rf(of(R)),Hc(R,b),E++}const z=ho.get(A);z!==null&&go===null&&Ne(z)&&(go=z.getFormat())}const P=E>_,O=k>v;if(P&&!O){const R=h[v+1];nf(h,c,k,v,b,R===void 0?null:kr.getElementByKey(R))}else O&&!P&&ef(u,E,_,b)})(n,o,a,i,l,e)}Dc(n)&&(ir+=Ko),e.__lexicalTextContent=ir,ir=s+ir}(y,d,g),sg(d,g),va(f=d)&&go!=null&&go!==f.__textFormat&&!Uc&&f.setTextFormat(go),Or=t,go=null}function Jc(y,d){const g=[];let t=y.__first;for(;t!==null;){const f=d.get(t);f===void 0&&Je(101),g.push(t),t=f.__next}return g}function kl(y,d){const g=fa.get(y);let t=ho.get(y);g!==void 0&&t!==void 0||Je(61);const f=ng||Xd.has(y)||Qd.has(y),r=Lc(kr,y);if(g===t&&!f){if(ge(g)){const n=r.__lexicalTextContent;n!==void 0&&(ir+=n,Zo+=n);const e=r.__lexicalDirTextContent;e!==void 0&&(Or+=e)}else{const n=g.getTextContent();Ne(g)&&!g.isDirectionless()&&(Or+=n),Zo+=n,ir+=n}return r}if(g!==t&&f&&Vd(El,Cl,zc,t,"updated"),t.updateDOM(g,r,Ti)){const n=qc(y,null,null);return d===null&&Je(62),d.replaceChild(n,r),Hc(y,null),n}if(ge(g)&&ge(t)){const n=t.__indent;n!==g.__indent&&rg(r,n);const e=t.__format;e!==g.__format&&og(r,e),f&&(Uv(g,t,r),vr(t)||t.isInline()||ag(g,t,r)),Dc(t)&&(ir+=Ko,Zo+=Ko)}else{const n=t.getTextContent();if(Tn(t)){const e=t.decorate(kr,Ti);e!==null&&lg(y,e)}else Ne(t)&&!t.isDirectionless()&&(Or+=n);ir+=n,Zo+=n}if(!Uc&&vr(t)&&t.__cachedText!==Zo){const n=t.getWritable();n.__cachedText=Zo,t=n}return r}function lg(y,d){let g=kr._pendingDecorators;const t=kr._decorators;if(g===null){if(t[y]===d)return;g=zh(kr)}g[y]=d}function rf(y){let d=y.nextSibling;return d!==null&&d===kr._blockCursorElement&&(d=d.nextSibling),d}function $v(y,d,g,t,f,r){ir="",Zo="",Or="",ng=t===es,$c=null,kr=g,Ti=g._config,Cl=g._nodes,zc=kr._listeners.mutation,Qd=f,Xd=r,fa=y._nodeMap,ho=d._nodeMap,Uc=d._readOnly,tf=new Map(g._keyToDOMMap);const n=new Map;return El=n,kl("root",null),kr=void 0,Cl=void 0,Qd=void 0,Xd=void 0,fa=void 0,ho=void 0,Ti=void 0,tf=void 0,El=void 0,n}function of(y){const d=tf.get(y);return d===void 0&&Je(75,y),d}const Qo=Object.freeze({}),af=30,sf=[["keydown",function(y,d){if(Ol=y.timeStamp,cg=y.key,d.isComposing())return;const{key:g,shiftKey:t,ctrlKey:f,metaKey:r,altKey:n}=y;Ke(d,Xb,y)||g!=null&&(function(e,s,i,l){return Kh(e)&&!s&&!l&&!i}(g,f,n,r)?Ke(d,Cc,y):function(e,s,i,l,o){return Kh(e)&&!l&&!i&&(s||o)}(g,f,t,n,r)?Ke(d,tv,y):function(e,s,i,l){return Wh(e)&&!s&&!l&&!i}(g,f,n,r)?Ke(d,Ec,y):function(e,s,i,l,o){return Wh(e)&&!l&&!i&&(s||o)}(g,f,t,n,r)?Ke(d,ev,y):function(e,s,i){return function(l){return l==="ArrowUp"}(e)&&!s&&!i}(g,f,r)?Ke(d,Sd,y):function(e,s,i){return function(l){return l==="ArrowDown"}(e)&&!s&&!i}(g,f,r)?Ke(d,Cd,y):function(e,s){return Gh(e)&&s}(g,t)?(Tl=!0,Ke(d,dl,y)):function(e){return e===" "}(g)?Ke(d,nv,y):function(e,s){return po&&s&&e.toLowerCase()==="o"}(g,f)?(y.preventDefault(),Tl=!0,Ke(d,wi,!0)):function(e,s){return Gh(e)&&!s}(g,t)?(Tl=!1,Ke(d,dl,y)):function(e,s,i,l){return po?!s&&!i&&(vl(e)||e.toLowerCase()==="h"&&l):!(l||s||i)&&vl(e)}(g,n,r,f)?vl(g)?Ke(d,fl,y):(y.preventDefault(),Ke(d,uo,!0)):function(e){return e==="Escape"}(g)?Ke(d,kc,y):function(e,s,i,l,o){return po?!(i||l||o)&&(_l(e)||e.toLowerCase()==="d"&&s):!(s||l||o)&&_l(e)}(g,f,t,n,r)?_l(g)?Ke(d,pl,y):(y.preventDefault(),Ke(d,uo,!1)):function(e,s,i){return vl(e)&&(po?s:i)}(g,n,f)?(y.preventDefault(),Ke(d,ca,!0)):function(e,s,i){return _l(e)&&(po?s:i)}(g,n,f)?(y.preventDefault(),Ke(d,ca,!1)):function(e,s){return po&&s&&vl(e)}(g,r)?(y.preventDefault(),Ke(d,Ci,!0)):function(e,s){return po&&s&&_l(e)}(g,r)?(y.preventDefault(),Ke(d,Ci,!1)):function(e,s,i,l){return e.toLowerCase()==="b"&&!s&&bl(i,l)}(g,n,r,f)?(y.preventDefault(),Ke(d,Er,"bold")):function(e,s,i,l){return e.toLowerCase()==="u"&&!s&&bl(i,l)}(g,n,r,f)?(y.preventDefault(),Ke(d,Er,"underline")):function(e,s,i,l){return e.toLowerCase()==="i"&&!s&&bl(i,l)}(g,n,r,f)?(y.preventDefault(),Ke(d,Er,"italic")):function(e,s,i,l){return e==="Tab"&&!s&&!i&&!l}(g,n,f,r)?Ke(d,xh,y):function(e,s,i,l){return e.toLowerCase()==="z"&&!s&&bl(i,l)}(g,t,r,f)?(y.preventDefault(),Ke(d,cl,void 0)):function(e,s,i,l){return po?e.toLowerCase()==="z"&&i&&s:e.toLowerCase()==="y"&&l||e.toLowerCase()==="z"&&l&&s}(g,t,r,f)?(y.preventDefault(),Ke(d,ul,void 0)):Xr(d._editorState._selection)?function(e,s,i,l){return!s&&e.toLowerCase()==="c"&&(po?i:l)}(g,t,r,f)?(y.preventDefault(),Ke(d,hl,y)):function(e,s,i,l){return!s&&e.toLowerCase()==="x"&&(po?i:l)}(g,t,r,f)?(y.preventDefault(),Ke(d,gl,y)):Yh(g,r,f)&&(y.preventDefault(),Ke(d,Oc,y)):!Ei&&Yh(g,r,f)&&(y.preventDefault(),Ke(d,Oc,y)),function(e,s,i,l){return e||s||i||l}(f,t,n,r)&&Ke(d,lv,y))}],["pointerdown",function(y,d){const g=y.target,t=y.pointerType;g instanceof Node&&t!=="touch"&&Hr(d,()=>{Tn(rr(g))||(cf=!0)})}],["compositionstart",function(y,d){Hr(d,()=>{const g=Oe();if(xe(g)&&!d.isComposing()){const t=g.anchor,f=g.anchor.getNode();hr(t.key),(y.timeStamp<Ol+af||t.type==="element"||!g.isCollapsed()||f.getFormat()!==g.format||Ne(f)&&f.getStyle()!==g.style)&&Ke(d,Si,mv)}})}],["compositionend",function(y,d){Ei?jl=!0:Hr(d,()=>{uf(d,y.data)})}],["input",function(y,d){y.stopPropagation(),Hr(d,()=>{const g=Oe(),t=y.data,f=gg(y);if(t!=null&&xe(g)&&fg(g,f,t,y.timeStamp,!1)){jl&&(uf(d,t),jl=!1);const r=g.anchor.getNode(),n=Oo(d._window);if(n===null)return;const e=g.isBackward(),s=e?g.anchor.offset:g.focus.offset,i=e?g.focus.offset:g.anchor.offset;Tc&&!g.isCollapsed()&&Ne(r)&&n.anchorNode!==null&&r.getTextContent().slice(0,s)+t+r.getTextContent().slice(s+i)===Vh(n.anchorNode)||Ke(d,Si,t);const l=t.length;Ei&&l>1&&y.inputType==="insertCompositionText"&&!d.isComposing()&&(g.anchor.offset-=l),Td||jc||jd||!d.isComposing()||(Ol=0,hr(null))}else qd(!1,d,t!==null?t:void 0),jl&&(uf(d,t||void 0),jl=!1);Tr(),Ph(Wn())}),is=null}],["click",function(y,d){Hr(d,()=>{const g=Oe(),t=Oo(d._window),f=ma();if(t){if(xe(g)){const r=g.anchor,n=r.getNode();r.type==="element"&&r.offset===0&&g.isCollapsed()&&!vr(n)&&Ln().getChildrenSize()===1&&n.getTopLevelElementOrThrow().isEmpty()&&f!==null&&g.is(f)?(t.removeAllRanges(),g.dirty=!0):y.detail===3&&!g.isCollapsed()&&n!==g.focus.getNode()&&(ge(n)?n.select(0):n.getParentOrThrow().select(0))}else if(y.pointerType==="touch"){const r=t.anchorNode;if(r!==null){const n=r.nodeType;(n===ml||n===ki)&&or(Yc(f,t,d,y))}}}Ke(d,_h,y)})}],["cut",Qo],["copy",Qo],["dragstart",Qo],["dragover",Qo],["dragend",Qo],["paste",Qo],["focus",Qo],["blur",Qo],["drop",Qo]];Tc&&sf.push(["beforeinput",(y,d)=>function(g,t){const f=g.inputType,r=gg(g);f==="deleteCompositionText"||Ei&&tg(t)||f!=="insertCompositionText"&&Hr(t,()=>{const n=Oe();if(f==="deleteContentBackward"){if(n===null){const c=ma();if(!xe(c))return;or(c.clone())}if(xe(n)){const c=n.anchor.key===n.focus.key;if(e=g.timeStamp,cg==="MediaLast"&&e<Ol+af&&t.isComposing()&&c){if(hr(null),Ol=0,setTimeout(()=>{Hr(t,()=>{hr(null)})},af),xe(n)){const u=n.anchor.getNode();u.markDirty(),n.format=u.getFormat(),Ne(u)||Je(142),n.style=u.getStyle()}}else{hr(null),g.preventDefault();const u=n.anchor.getNode().getTextContent(),h=n.anchor.offset===0&&n.focus.offset===u.length;dv&&c&&!h||Ke(t,uo,!0)}return}}var e;if(!xe(n))return;const s=g.data;is!==null&&qd(!1,t,is),n.dirty&&is===null||!n.isCollapsed()||vr(n.anchor.getNode())||r===null||n.applyDOMRange(r),is=null;const i=n.anchor,l=n.focus,o=i.getNode(),a=l.getNode();if(f!=="insertText"&&f!=="insertTranspose")switch(g.preventDefault(),f){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":Ke(t,Si,g);break;case"insertFromComposition":hr(null),Ke(t,Si,g);break;case"insertLineBreak":hr(null),Ke(t,wi,!1);break;case"insertParagraph":hr(null),Tl&&!jc?(Tl=!1,Ke(t,wi,!1)):Ke(t,Za,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":Ke(t,ll,g);break;case"deleteByComposition":(function(c,u){return c!==u||ge(c)||ge(u)||!c.isToken()||!u.isToken()})(o,a)&&Ke(t,Sc,g);break;case"deleteByDrag":case"deleteByCut":Ke(t,Sc,g);break;case"deleteContent":Ke(t,uo,!1);break;case"deleteWordBackward":Ke(t,ca,!0);break;case"deleteWordForward":Ke(t,ca,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":Ke(t,Ci,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":Ke(t,Ci,!1);break;case"formatStrikeThrough":Ke(t,Er,"strikethrough");break;case"formatBold":Ke(t,Er,"bold");break;case"formatItalic":Ke(t,Er,"italic");break;case"formatUnderline":Ke(t,Er,"underline");break;case"historyUndo":Ke(t,cl,void 0);break;case"historyRedo":Ke(t,ul,void 0)}else{if(s===`
|
|
32
|
+
`)g.preventDefault(),Ke(t,wi,!1);else if(s===Ko)g.preventDefault(),Ke(t,Za,void 0);else if(s==null&&g.dataTransfer){const c=g.dataTransfer.getData("text/plain");g.preventDefault(),n.insertRawText(c)}else s!=null&&fg(n,r,s,g.timeStamp,!0)?(g.preventDefault(),Ke(t,Si,s)):is=s;ug=g.timeStamp}})}(y,d)]);let Ol=0,cg=null,ug=0,is=null;const Vc=new WeakMap;let lf=!1,cf=!1,Tl=!1,jl=!1,dg=[0,"",0,"root",0];function fg(y,d,g,t,f){const r=y.anchor,n=y.focus,e=r.getNode(),s=Wn(),i=Oo(s._window),l=i!==null?i.anchorNode:null,o=r.key,a=s.getElementByKey(o),c=g.length;return o!==n.key||!Ne(e)||(!f&&(!Tc||ug<t+50)||e.isDirty()&&c<2||qh(g))&&r.offset!==n.offset&&!e.isComposing()||ns(e)||e.isDirty()&&c>1||(f||!Tc)&&a!==null&&!e.isComposing()&&l!==Rc(a)||i!==null&&d!==null&&(!d.collapsed||d.startContainer!==i.anchorNode||d.startOffset!==i.anchorOffset)||e.getFormat()!==y.format||e.getStyle()!==y.style||Pv(y,e)}function pg(y,d){return y!==null&&y.nodeValue!==null&&y.nodeType===ki&&d!==0&&d!==y.nodeValue.length}function hg(y,d,g){const{anchorNode:t,anchorOffset:f,focusNode:r,focusOffset:n}=y;lf&&(lf=!1,pg(t,f)&&pg(r,n))||Hr(d,()=>{if(!g)return void or(null);if(!yl(d,t,r))return;const e=Oe();if(xe(e)){const s=e.anchor,i=s.getNode();if(e.isCollapsed()){y.type==="Range"&&y.anchorNode===y.focusNode&&(e.dirty=!0);const l=Fc(d).event,o=l?l.timeStamp:performance.now(),[a,c,u,h,p]=dg,m=Ln(),b=d.isComposing()===!1&&m.getTextContent()==="";if(o<p+200&&s.offset===u&&s.key===h)e.format=a,e.style=c;else if(s.type==="text")Ne(i)||Je(141),e.format=i.getFormat(),e.style=i.getStyle();else if(s.type==="element"&&!b){const _=s.getNode();_ instanceof ba&&_.getChildrenSize()===0?e.format=_.getTextFormat():e.format=0,e.style=""}}else{const l=s.key,o=e.focus.key,a=e.getNodes(),c=a.length,u=e.isBackward(),h=u?n:f,p=u?f:n,m=u?o:l,b=u?l:o;let _=gv,v=!1;for(let w=0;w<c;w++){const x=a[w],S=x.getTextContentSize();if(Ne(x)&&S!==0&&!(w===0&&x.__key===m&&h===S||w===c-1&&x.__key===b&&p===0)&&(v=!0,_&=x.getFormat(),_===0))break}e.format=v?_:0}}Ke(d,Wo,void 0)})}function gg(y){if(!y.getTargetRanges)return null;const d=y.getTargetRanges();return d.length===0?null:d[0]}function uf(y,d){const g=y._compositionKey;if(hr(null),g!==null&&d!=null){if(d===""){const t=Vn(g),f=Rc(y.getElementByKey(g));return void(f!==null&&f.nodeValue!==null&&Ne(t)&&Jd(t,f.nodeValue,null,null,!0))}if(d[d.length-1]===`
|
|
33
|
+
`){const t=Oe();if(xe(t)){const f=t.focus;return t.anchor.set(f.key,f.offset,f.type),void Ke(y,dl,null)}}}qd(!0,y,d)}function mg(y){let d=y.__lexicalEventHandles;return d===void 0&&(d=[],y.__lexicalEventHandles=d),d}const as=new Map;function yg(y){const d=y.target,g=Oo(d==null?null:d.nodeType===9?d.defaultView:d.ownerDocument.defaultView);if(g===null)return;const t=Lh(g.anchorNode);if(t===null)return;cf&&(cf=!1,Hr(t,()=>{const i=ma(),l=g.anchorNode;if(l===null)return;const o=l.nodeType;o!==ml&&o!==ki||or(Yc(i,g,t,y))}));const f=Hd(t),r=f[f.length-1],n=r._key,e=as.get(n),s=e||r;s!==t&&hg(g,s,!1),hg(g,t,!0),t!==r?as.set(n,t):e&&as.delete(n)}function bg(y){y._lexicalHandled=!0}function vg(y){return y._lexicalHandled===!0}function Hv(y){const d=y.ownerDocument,g=Vc.get(d);g===void 0&&Je(162);const t=g-1;t>=0||Je(164),Vc.set(d,t),t===0&&d.removeEventListener("selectionchange",yg);const f=y.__lexicalEditor;f!=null&&(function(n){if(n._parentEditor!==null){const e=Hd(n),s=e[e.length-1]._key;as.get(s)===n&&as.delete(s)}else as.delete(n._key)}(f),y.__lexicalEditor=null);const r=mg(y);for(let n=0;n<r.length;n++)r[n]();y.__lexicalEventHandles=[]}function df(y,d,g){Tr();const t=y.__key,f=y.getParent();if(f===null)return;const r=function(e){const s=Oe();if(!xe(s)||!ge(e))return s;const{anchor:i,focus:l}=s,o=i.getNode(),a=l.getNode();return Wd(o,e)&&i.set(e.__key,0,"element"),Wd(a,e)&&l.set(e.__key,0,"element"),s}(y);let n=!1;if(xe(r)&&d){const e=r.anchor,s=r.focus;e.key===t&&(Qc(e,y,f,y.getPreviousSibling(),y.getNextSibling()),n=!0),s.key===t&&(Qc(s,y,f,y.getPreviousSibling(),y.getNextSibling()),n=!0)}else Xr(r)&&d&&y.isSelected()&&y.selectPrevious();if(xe(r)&&d&&!n){const e=y.getIndexWithinParent();da(y),Zc(r,f,e,-1)}else da(y);g||ko(f)||f.canBeEmpty()||!f.isEmpty()||df(f,d),d&&vr(f)&&f.isEmpty()&&f.selectEnd()}class Wc{static getType(){Je(64,this.name)}static clone(d){Je(65,this.name)}constructor(d){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,Bh(this,d)}getType(){return this.__type}isInline(){Je(137,this.constructor.name)}isAttached(){let d=this.__key;for(;d!==null;){if(d==="root")return!0;const g=Vn(d);if(g===null)break;d=g.__parent}return!1}isSelected(d){const g=d||Oe();if(g==null)return!1;const t=g.getNodes().some(f=>f.__key===this.__key);return(Ne(this)||!xe(g)||g.anchor.type!=="element"||g.focus.type!=="element"||g.anchor.key!==g.focus.key||g.anchor.offset!==g.focus.offset)&&t}getKey(){return this.__key}getIndexWithinParent(){const d=this.getParent();if(d===null)return-1;let g=d.getFirstChild(),t=0;for(;g!==null;){if(this.is(g))return t;t++,g=g.getNextSibling()}return-1}getParent(){const d=this.getLatest().__parent;return d===null?null:Vn(d)}getParentOrThrow(){const d=this.getParent();return d===null&&Je(66,this.__key),d}getTopLevelElement(){let d=this;for(;d!==null;){const g=d.getParent();if(ko(g))return ge(d)||Je(138),d;d=g}return null}getTopLevelElementOrThrow(){const d=this.getTopLevelElement();return d===null&&Je(67,this.__key),d}getParents(){const d=[];let g=this.getParent();for(;g!==null;)d.push(g),g=g.getParent();return d}getParentKeys(){const d=[];let g=this.getParent();for(;g!==null;)d.push(g.__key),g=g.getParent();return d}getPreviousSibling(){const d=this.getLatest().__prev;return d===null?null:Vn(d)}getPreviousSiblings(){const d=[],g=this.getParent();if(g===null)return d;let t=g.getFirstChild();for(;t!==null&&!t.is(this);)d.push(t),t=t.getNextSibling();return d}getNextSibling(){const d=this.getLatest().__next;return d===null?null:Vn(d)}getNextSiblings(){const d=[];let g=this.getNextSibling();for(;g!==null;)d.push(g),g=g.getNextSibling();return d}getCommonAncestor(d){const g=this.getParents(),t=d.getParents();ge(this)&&g.unshift(this),ge(d)&&t.unshift(d);const f=g.length,r=t.length;if(f===0||r===0||g[f-1]!==t[r-1])return null;const n=new Set(t);for(let e=0;e<f;e++){const s=g[e];if(n.has(s))return s}return null}is(d){return d!=null&&this.__key===d.__key}isBefore(d){if(this===d)return!1;if(d.isParentOf(this))return!0;if(this.isParentOf(d))return!1;const g=this.getCommonAncestor(d);let t=0,f=0,r=this;for(;;){const n=r.getParentOrThrow();if(n===g){t=r.getIndexWithinParent();break}r=n}for(r=d;;){const n=r.getParentOrThrow();if(n===g){f=r.getIndexWithinParent();break}r=n}return t<f}isParentOf(d){const g=this.__key;if(g===d.__key)return!1;let t=d;for(;t!==null;){if(t.__key===g)return!0;t=t.getParent()}return!1}getNodesBetween(d){const g=this.isBefore(d),t=[],f=new Set;let r=this;for(;r!==null;){const n=r.__key;if(f.has(n)||(f.add(n),t.push(r)),r===d)break;const e=ge(r)?g?r.getFirstChild():r.getLastChild():null;if(e!==null){r=e;continue}const s=g?r.getNextSibling():r.getPreviousSibling();if(s!==null){r=s;continue}const i=r.getParentOrThrow();if(f.has(i.__key)||t.push(i),i===d)break;let l=null,o=i;do{if(o===null&&Je(68),l=g?o.getNextSibling():o.getPreviousSibling(),o=o.getParent(),o===null)break;l!==null||f.has(o.__key)||t.push(o)}while(l===null);r=l}return g||t.reverse(),t}isDirty(){const d=Wn()._dirtyLeaves;return d!==null&&d.has(this.__key)}getLatest(){const d=Vn(this.__key);return d===null&&Je(113),d}getWritable(){Tr();const d=To(),g=Wn(),t=d._nodeMap,f=this.__key,r=this.getLatest(),n=r.__parent,e=g._cloneNotNeeded,s=Oe();if(s!==null&&s.setCachedNodes(null),e.has(f))return Mc(r),r;const i=r.constructor.clone(r);return i.__parent=n,i.__next=r.__next,i.__prev=r.__prev,ge(r)&&ge(i)?(va(r)&&va(i)&&(i.__textFormat=r.__textFormat),i.__first=r.__first,i.__last=r.__last,i.__size=r.__size,i.__indent=r.__indent,i.__format=r.__format,i.__dir=r.__dir):Ne(r)&&Ne(i)&&(i.__format=r.__format,i.__style=r.__style,i.__mode=r.__mode,i.__detail=r.__detail),e.add(f),i.__key=f,Mc(i),t.set(f,i),i}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(d,g){Je(70)}updateDOM(d,g,t){Je(71)}exportDOM(d){return{element:this.createDOM(d._config,d)}}exportJSON(){Je(72)}static importJSON(d){Je(18,this.name)}static transform(){return null}remove(d){df(this,!0,d)}replace(d,g){Tr();let t=Oe();t!==null&&(t=t.clone()),Kd(this,d);const f=this.getLatest(),r=this.__key,n=d.__key,e=d.getWritable(),s=this.getParentOrThrow().getWritable(),i=s.__size;da(e);const l=f.getPreviousSibling(),o=f.getNextSibling(),a=f.__prev,c=f.__next,u=f.__parent;if(df(f,!1,!0),l===null?s.__first=n:l.getWritable().__next=n,e.__prev=a,o===null?s.__last=n:o.getWritable().__prev=n,e.__next=c,e.__parent=u,s.__size=i,g&&(ge(this)&&ge(e)||Je(139),this.getChildren().forEach(h=>{e.append(h)})),xe(t)){or(t);const h=t.anchor,p=t.focus;h.key===r&&kg(h,e),p.key===r&&kg(p,e)}return Oi()===r&&hr(n),e}insertAfter(d,g=!0){Tr(),Kd(this,d);const t=this.getWritable(),f=d.getWritable(),r=f.getParent(),n=Oe();let e=!1,s=!1;if(r!==null){const c=d.getIndexWithinParent();if(da(f),xe(n)){const u=r.__key,h=n.anchor,p=n.focus;e=h.type==="element"&&h.key===u&&h.offset===c+1,s=p.type==="element"&&p.key===u&&p.offset===c+1}}const i=this.getNextSibling(),l=this.getParentOrThrow().getWritable(),o=f.__key,a=t.__next;if(i===null?l.__last=o:i.getWritable().__prev=o,l.__size++,t.__next=o,f.__next=a,f.__prev=t.__key,f.__parent=t.__parent,g&&xe(n)){const c=this.getIndexWithinParent();Zc(n,l,c+1);const u=l.__key;e&&n.anchor.set(u,c+2,"element"),s&&n.focus.set(u,c+2,"element")}return d}insertBefore(d,g=!0){Tr(),Kd(this,d);const t=this.getWritable(),f=d.getWritable(),r=f.__key;da(f);const n=this.getPreviousSibling(),e=this.getParentOrThrow().getWritable(),s=t.__prev,i=this.getIndexWithinParent();n===null?e.__first=r:n.getWritable().__next=r,e.__size++,t.__prev=r,f.__prev=s,f.__next=t.__key,f.__parent=t.__parent;const l=Oe();return g&&xe(l)&&Zc(l,this.getParentOrThrow(),i),d}isParentRequired(){return!1}createParentElementNode(){return Un()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(d,g){Tr();const t=this.getPreviousSibling(),f=this.getParentOrThrow();if(t===null)return f.select(0,0);if(ge(t))return t.select();if(!Ne(t)){const r=t.getIndexWithinParent()+1;return f.select(r,r)}return t.select(d,g)}selectNext(d,g){Tr();const t=this.getNextSibling(),f=this.getParentOrThrow();if(t===null)return f.select();if(ge(t))return t.select(0,0);if(!Ne(t)){const r=t.getIndexWithinParent();return f.select(r,r)}return t.select(d,g)}markDirty(){this.getWritable()}}class ss extends Wc{static getType(){return"linebreak"}static clone(d){return new ss(d.__key)}constructor(d){super(d)}getTextContent(){return`
|
|
34
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:d=>function(g){const t=g.parentElement;if(t!==null){const f=t.firstChild;if(f===g||f.nextSibling===g&&_g(f)){const r=t.lastChild;if(r===g||r.previousSibling===g&&_g(r))return!0}}return!1}(d)?null:{conversion:qv,priority:0}}}static importJSON(d){return ls()}exportJSON(){return{type:"linebreak",version:1}}}function qv(y){return{node:ls()}}function ls(){return Yo(new ss)}function ha(y){return y instanceof ss}function _g(y){return y.nodeType===ki&&/^( |\t|\r?\n)+$/.test(y.textContent||"")}function ff(y,d){return 16&d?"code":d&Ad?"mark":32&d?"sub":64&d?"sup":null}function pf(y,d){return 1&d?"strong":2&d?"em":"span"}function xg(y,d,g,t,f){const r=t.classList;let n=xl(f,"base");n!==void 0&&r.add(...n),n=xl(f,"underlineStrikethrough");let e=!1;const s=d&Pc&&d&Ac;n!==void 0&&(g&Pc&&g&Ac?(e=!0,s||r.add(...n)):s&&r.remove(...n));for(const i in Go){const l=Go[i];if(n=xl(f,i),n!==void 0)if(g&l){if(e&&(i==="underline"||i==="strikethrough")){d&l&&r.remove(...n);continue}d&l&&(!s||i!=="underline")&&i!=="strikethrough"||r.add(...n)}else d&l&&r.remove(...n)}}function wg(y,d,g){const t=d.firstChild,f=g.isComposing(),r=y+(f?Nc:"");if(t==null)d.textContent=r;else{const n=t.nodeValue;if(n!==r)if(f||Ei){const[e,s,i]=function(l,o){const a=l.length,c=o.length;let u=0,h=0;for(;u<a&&u<c&&l[u]===o[u];)u++;for(;h+u<a&&h+u<c&&l[a-h-1]===o[c-h-1];)h++;return[u,a-u-h,o.slice(u,c-h)]}(n,r);s!==0&&t.deleteData(e,s),t.insertData(e,i)}else t.nodeValue=r}}function Sg(y,d,g,t,f,r){wg(f,y,d);const n=r.theme.text;n!==void 0&&xg(0,0,t,y,n)}function Kc(y,d){const g=document.createElement(d);return g.appendChild(y),g}class ga extends Wc{static getType(){return"text"}static clone(d){return new ga(d.__text,d.__key)}constructor(d,g){super(g),this.__text=d,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const d=this.getLatest();return wv[d.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===Oi()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return!!(1&this.getLatest().__detail)}isUnmergeable(){return!!(2&this.getLatest().__detail)}hasFormat(d){const g=Go[d];return!!(this.getFormat()&g)}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(d,g){return $d(this.getLatest().__format,d,g)}canHaveFormat(){return!0}createDOM(d,g){const t=this.__format,f=ff(0,t),r=pf(0,t),n=f===null?r:f,e=document.createElement(n);let s=e;this.hasFormat("code")&&e.setAttribute("spellcheck","false"),f!==null&&(s=document.createElement(r),e.appendChild(s)),Sg(s,this,0,t,this.__text,d);const i=this.__style;return i!==""&&(e.style.cssText=i),e}updateDOM(d,g,t){const f=this.__text,r=d.__format,n=this.__format,e=ff(0,r),s=ff(0,n),i=pf(0,r),l=pf(0,n);if((e===null?i:e)!==(s===null?l:s))return!0;if(e===s&&i!==l){const h=g.firstChild;h==null&&Je(48);const p=document.createElement(l);return Sg(p,this,0,n,f,t),g.replaceChild(p,h),!1}let o=g;s!==null&&e!==null&&(o=g.firstChild,o==null&&Je(49)),wg(f,o,this);const a=t.theme.text;a!==void 0&&r!==n&&xg(0,r,n,o,a);const c=d.__style,u=this.__style;return c!==u&&(g.style.cssText=u),!1}static importDOM(){return{"#text":()=>({conversion:Kv,priority:0}),b:()=>({conversion:Vv,priority:0}),code:()=>({conversion:ji,priority:0}),em:()=>({conversion:ji,priority:0}),i:()=>({conversion:ji,priority:0}),s:()=>({conversion:ji,priority:0}),span:()=>({conversion:Jv,priority:0}),strong:()=>({conversion:ji,priority:0}),sub:()=>({conversion:ji,priority:0}),sup:()=>({conversion:ji,priority:0}),u:()=>({conversion:ji,priority:0})}}static importJSON(d){const g=ar(d.text);return g.setFormat(d.format),g.setDetail(d.detail),g.setMode(d.mode),g.setStyle(d.style),g}exportDOM(d){let{element:g}=super.exportDOM(d);return g!==null&&Sl(g)||Je(132),g.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(g=Kc(g,"b")),this.hasFormat("italic")&&(g=Kc(g,"i")),this.hasFormat("strikethrough")&&(g=Kc(g,"s")),this.hasFormat("underline")&&(g=Kc(g,"u")),{element:g}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(d,g){}setFormat(d){const g=this.getWritable();return g.__format=typeof d=="string"?Go[d]:d,g}setDetail(d){const g=this.getWritable();return g.__detail=typeof d=="string"?vv[d]:d,g}setStyle(d){const g=this.getWritable();return g.__style=d,g}toggleFormat(d){const g=$d(this.getFormat(),d,null);return this.setFormat(g)}toggleDirectionless(){const d=this.getWritable();return d.__detail^=1,d}toggleUnmergeable(){const d=this.getWritable();return d.__detail^=2,d}setMode(d){const g=xv[d];if(this.__mode===g)return this;const t=this.getWritable();return t.__mode=g,t}setTextContent(d){if(this.__text===d)return this;const g=this.getWritable();return g.__text=d,g}select(d,g){Tr();let t=d,f=g;const r=Oe(),n=this.getTextContent(),e=this.__key;if(typeof n=="string"){const s=n.length;t===void 0&&(t=s),f===void 0&&(f=s)}else t=0,f=0;if(!xe(r))return Ig(e,t,e,f,"text","text");{const s=Oi();s!==r.anchor.key&&s!==r.focus.key||hr(e),r.setTextNodeRange(this,t,this,f)}return r}selectStart(){return this.select(0,0)}selectEnd(){const d=this.getTextContentSize();return this.select(d,d)}spliceText(d,g,t,f){const r=this.getWritable(),n=r.__text,e=t.length;let s=d;s<0&&(s=e+s,s<0&&(s=0));const i=Oe();if(f&&xe(i)){const o=d+e;i.setTextNodeRange(r,o,r,o)}const l=n.slice(0,s)+t+n.slice(s+g);return r.__text=l,r}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...d){Tr();const g=this.getLatest(),t=g.getTextContent(),f=g.__key,r=Oi(),n=new Set(d),e=[],s=t.length;let i="";for(let S=0;S<s;S++)i!==""&&n.has(S)&&(e.push(i),i=""),i+=t[S];i!==""&&e.push(i);const l=e.length;if(l===0)return[];if(e[0]===t)return[g];const o=e[0],a=g.getParentOrThrow();let c;const u=g.getFormat(),h=g.getStyle(),p=g.__detail;let m=!1;g.isSegmented()?(c=ar(o),c.__format=u,c.__style=h,c.__detail=p,m=!0):(c=g.getWritable(),c.__text=o);const b=Oe(),_=[c];let v=o.length;for(let S=1;S<l;S++){const E=e[S],k=E.length,D=ar(E).getWritable();D.__format=u,D.__style=h,D.__detail=p;const P=D.__key,O=v+k;if(xe(b)){const R=b.anchor,A=b.focus;R.key===f&&R.type==="text"&&R.offset>v&&R.offset<=O&&(R.key=P,R.offset-=v,b.dirty=!0),A.key===f&&A.type==="text"&&A.offset>v&&A.offset<=O&&(A.key=P,A.offset-=v,b.dirty=!0)}r===f&&hr(P),v=O,_.push(D)}(function(S){const E=S.getPreviousSibling(),k=S.getNextSibling();E!==null&&Mc(E),k!==null&&Mc(k)})(this);const w=a.getWritable(),x=this.getIndexWithinParent();return m?(w.splice(x,0,_),this.remove()):w.splice(x,1,_),xe(b)&&Zc(b,a,x,l-1),_}mergeWithSibling(d){const g=d===this.getPreviousSibling();g||d===this.getNextSibling()||Je(50);const t=this.__key,f=d.__key,r=this.__text,n=r.length;Oi()===f&&hr(t);const e=Oe();if(xe(e)){const o=e.anchor,a=e.focus;o!==null&&o.key===f&&(Mg(o,g,t,d,n),e.dirty=!0),a!==null&&a.key===f&&(Mg(a,g,t,d,n),e.dirty=!0)}const s=d.__text,i=g?s+r:r+s;this.setTextContent(i);const l=this.getWritable();return d.remove(),l}isTextEntity(){return!1}}function Jv(y){return{forChild:hf(y.style),node:null}}function Vv(y){const d=y,g=d.style.fontWeight==="normal";return{forChild:hf(d.style,g?void 0:"bold"),node:null}}const Cg=new WeakMap;function Wv(y){return y.nodeName==="PRE"||y.nodeType===ml&&y.style!==void 0&&y.style.whiteSpace!==void 0&&y.style.whiteSpace.startsWith("pre")}function Kv(y){const d=y;y.parentElement===null&&Je(129);let g=d.textContent||"";if(function(t){let f,r=t.parentNode;const n=[t];for(;r!==null&&(f=Cg.get(r))===void 0&&!Wv(r);)n.push(r),r=r.parentNode;const e=f===void 0?r:f;for(let s=0;s<n.length;s++)Cg.set(n[s],e);return e}(d)!==null){const t=g.split(/(\r?\n|\t)/),f=[],r=t.length;for(let n=0;n<r;n++){const e=t[n];e===`
|
|
35
35
|
`||e===`\r
|
|
36
|
-
`?f.push(ls()):e===" "?f.push(Pl()):e!==""&&f.push(ar(e))}return{node:f}}if(g=g.replace(/\r/g,"").replace(/[ \t\n]+/g," "),g==="")return{node:null};if(g[0]===" "){let t=d,f=!0;for(;t!==null&&(t=
|
|
37
|
-
`),l=!a.isEmpty();else if(l=!1,Ne(a)){let c=a.getTextContent();a===g?a===t?f.type==="element"&&r.type==="element"&&r.offset!==f.offset||(c=e<s?c.slice(e,s):c.slice(s,e)):c=n?c.slice(e):c.slice(s):a===t&&(c=n?c.slice(0,s):c.slice(0,e)),i+=c}else!Tn(a)&&!ha(a)||a===t&&this.isCollapsed()||(i+=a.getTextContent())}return i}applyDOMRange(d){const g=Wn(),t=g.getEditorState()._selection,f=
|
|
36
|
+
`?f.push(ls()):e===" "?f.push(Pl()):e!==""&&f.push(ar(e))}return{node:f}}if(g=g.replace(/\r/g,"").replace(/[ \t\n]+/g," "),g==="")return{node:null};if(g[0]===" "){let t=d,f=!0;for(;t!==null&&(t=Eg(t,!1))!==null;){const r=t.textContent||"";if(r.length>0){/[ \t\n]$/.test(r)&&(g=g.slice(1)),f=!1;break}}f&&(g=g.slice(1))}if(g[g.length-1]===" "){let t=d,f=!0;for(;t!==null&&(t=Eg(t,!0))!==null;)if((t.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){f=!1;break}f&&(g=g.slice(0,g.length-1))}return g===""?{node:null}:{node:ar(g)}}function Eg(y,d){let g=y;for(;;){let t;for(;(t=d?g.nextSibling:g.previousSibling)===null;){const r=g.parentElement;if(r===null)return null;g=r}if(g=t,g.nodeType===ml){const r=g.style.display;if(r===""&&!Bv(g)||r!==""&&!r.startsWith("inline"))return null}let f=g;for(;(f=d?g.firstChild:g.lastChild)!==null;)g=f;if(g.nodeType===ki)return g;if(g.nodeName==="BR")return null}}const Gv={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function ji(y){const d=Gv[y.nodeName.toLowerCase()];return d===void 0?{node:null}:{forChild:hf(y.style,d),node:null}}function ar(y=""){return Yo(new ga(y))}function Ne(y){return y instanceof ga}function hf(y,d){const g=y.fontWeight,t=y.textDecoration.split(" "),f=g==="700"||g==="bold",r=t.includes("line-through"),n=y.fontStyle==="italic",e=t.includes("underline"),s=y.verticalAlign;return i=>(Ne(i)&&(f&&!i.hasFormat("bold")&&i.toggleFormat("bold"),r&&!i.hasFormat("strikethrough")&&i.toggleFormat("strikethrough"),n&&!i.hasFormat("italic")&&i.toggleFormat("italic"),e&&!i.hasFormat("underline")&&i.toggleFormat("underline"),s!=="sub"||i.hasFormat("subscript")||i.toggleFormat("subscript"),s!=="super"||i.hasFormat("superscript")||i.toggleFormat("superscript"),d&&!i.hasFormat(d)&&i.toggleFormat(d)),i)}class Al extends ga{static getType(){return"tab"}static clone(d){const g=new Al(d.__key);return g.__text=d.__text,g.__format=d.__format,g.__style=d.__style,g}constructor(d){super(" ",d),this.__detail=2}static importDOM(){return null}static importJSON(d){const g=Pl();return g.setFormat(d.format),g.setStyle(d.style),g}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(d){Je(126)}setDetail(d){Je(127)}setMode(d){Je(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Pl(){return Yo(new Al)}function Yv(y){return y instanceof Al}class Zv{constructor(d,g,t){this._selection=null,this.key=d,this.offset=g,this.type=t}is(d){return this.key===d.key&&this.offset===d.offset&&this.type===d.type}isBefore(d){let g=this.getNode(),t=d.getNode();const f=this.offset,r=d.offset;if(ge(g)){const n=g.getDescendantByIndex(f);g=n??g}if(ge(t)){const n=t.getDescendantByIndex(r);t=n??t}return g===t?f<r:g.isBefore(t)}getNode(){const d=Vn(this.key);return d===null&&Je(20),d}set(d,g,t){const f=this._selection,r=this.key;this.key=d,this.offset=g,this.type=t,cs()||(Oi()===r&&hr(d),f!==null&&(f.setCachedNodes(null),f.dirty=!0))}}function Qr(y,d,g){return new Zv(y,d,g)}function gf(y,d){let g=d.__key,t=y.offset,f="element";if(Ne(d)){f="text";const r=d.getTextContentSize();t>r&&(t=r)}else if(!ge(d)){const r=d.getNextSibling();if(Ne(r))g=r.__key,t=0,f="text";else{const n=d.getParent();n&&(g=n.__key,t=d.getIndexWithinParent()+1)}}y.set(g,t,f)}function kg(y,d){if(ge(d)){const g=d.getLastDescendant();ge(g)||Ne(g)?gf(y,g):gf(y,d)}else gf(y,d)}function Ai(y,d,g,t){y.key=d,y.offset=g,y.type=t}class Gc{constructor(d){this._cachedNodes=null,this._nodes=d,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(d){this._cachedNodes=d}is(d){if(!Xr(d))return!1;const g=this._nodes,t=d._nodes;return g.size===t.size&&Array.from(g).every(f=>t.has(f))}isCollapsed(){return!1}isBackward(){return!1}getStartEndPoints(){return null}add(d){this.dirty=!0,this._nodes.add(d),this._cachedNodes=null}delete(d){this.dirty=!0,this._nodes.delete(d),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(d){return this._nodes.has(d)}clone(){return new Gc(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(d){}insertText(){}insertNodes(d){const g=this.getNodes(),t=g.length,f=g[t-1];let r;if(Ne(f))r=f.select();else{const n=f.getIndexWithinParent()+1;r=f.getParentOrThrow().select(n,n)}r.insertNodes(d);for(let n=0;n<t;n++)g[n].remove()}getNodes(){const d=this._cachedNodes;if(d!==null)return d;const g=this._nodes,t=[];for(const f of g){const r=Vn(f);r!==null&&t.push(r)}return cs()||(this._cachedNodes=t),t}getTextContent(){const d=this.getNodes();let g="";for(let t=0;t<d.length;t++)g+=d[t].getTextContent();return g}}function xe(y){return y instanceof Pi}class Pi{constructor(d,g,t,f){this.anchor=d,this.focus=g,d._selection=this,g._selection=this,this._cachedNodes=null,this.format=t,this.style=f,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(d){this._cachedNodes=d}is(d){return!!xe(d)&&this.anchor.is(d.anchor)&&this.focus.is(d.focus)&&this.format===d.format&&this.style===d.style}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const d=this._cachedNodes;if(d!==null)return d;const g=this.anchor,t=this.focus,f=g.isBefore(t),r=f?g:t,n=f?t:g;let e=r.getNode(),s=n.getNode();const i=r.offset,l=n.offset;if(ge(e)){const a=e.getDescendantByIndex(i);e=a??e}if(ge(s)){let a=s.getDescendantByIndex(l);a!==null&&a!==e&&s.getChildAtIndex(l)===a&&(a=a.getPreviousSibling()),s=a??s}let o;return o=e.is(s)?ge(e)&&e.getChildrenSize()>0?[]:[e]:e.getNodesBetween(s),cs()||(this._cachedNodes=o),o}setTextNodeRange(d,g,t,f){Ai(this.anchor,d.__key,g,"text"),Ai(this.focus,t.__key,f,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const d=this.getNodes();if(d.length===0)return"";const g=d[0],t=d[d.length-1],f=this.anchor,r=this.focus,n=f.isBefore(r),[e,s]=mf(this);let i="",l=!0;for(let o=0;o<d.length;o++){const a=d[o];if(ge(a)&&!a.isInline())l||(i+=`
|
|
37
|
+
`),l=!a.isEmpty();else if(l=!1,Ne(a)){let c=a.getTextContent();a===g?a===t?f.type==="element"&&r.type==="element"&&r.offset!==f.offset||(c=e<s?c.slice(e,s):c.slice(s,e)):c=n?c.slice(e):c.slice(s):a===t&&(c=n?c.slice(0,s):c.slice(0,e)),i+=c}else!Tn(a)&&!ha(a)||a===t&&this.isCollapsed()||(i+=a.getTextContent())}return i}applyDOMRange(d){const g=Wn(),t=g.getEditorState()._selection,f=Ng(d.startContainer,d.startOffset,d.endContainer,d.endOffset,g,t);if(f===null)return;const[r,n]=f;Ai(this.anchor,r.key,r.offset,r.type),Ai(this.focus,n.key,n.offset,n.type),this._cachedNodes=null}clone(){const d=this.anchor,g=this.focus;return new Pi(Qr(d.key,d.offset,d.type),Qr(g.key,g.offset,g.type),this.format,this.style)}toggleFormat(d){this.format=$d(this.format,d,null),this.dirty=!0}setStyle(d){this.style=d,this.dirty=!0}hasFormat(d){const g=Go[d];return!!(this.format&g)}insertRawText(d){const g=d.split(/(\r?\n|\t)/),t=[],f=g.length;for(let r=0;r<f;r++){const n=g[r];n===`
|
|
38
38
|
`||n===`\r
|
|
39
|
-
`?t.push(ls()):n===" "?t.push(Pl()):t.push(ar(n))}this.insertNodes(t)}insertText(d){const g=this.anchor,t=this.focus,f=this.format,r=this.style;let n=g,e=t;!this.isCollapsed()&&t.isBefore(g)&&(n=t,e=g),n.type==="element"&&function(p,m,b,_){const v=p.getNode(),w=v.getChildAtIndex(p.offset),x=ar(),S=vr(v)?Un().append(x):x;x.setFormat(b),x.setStyle(_),w===null?v.append(S):w.insertBefore(S),p.is(m)&&m.set(x.__key,0,"text"),p.set(x.__key,0,"text")}(n,e,f,r);const s=n.offset;let i=e.offset;const l=this.getNodes(),o=l.length;let a=l[0];Ne(a)||Je(26);const c=a.getTextContent().length,u=a.getParentOrThrow();let h=l[o-1];if(o===1&&e.type==="element"&&(i=c,e.set(n.key,i,"text")),this.isCollapsed()&&s===c&&(a.isSegmented()||a.isToken()||!a.canInsertTextAfter()||!u.canInsertTextAfter()&&a.getNextSibling()===null)){let p=a.getNextSibling();if(Ne(p)&&p.canInsertTextBefore()&&!ns(p)||(p=ar(),p.setFormat(f),p.setStyle(r),u.canInsertTextAfter()?a.insertAfter(p):u.insertAfter(p)),p.select(0,0),a=p,d!=="")return void this.insertText(d)}else if(this.isCollapsed()&&s===0&&(a.isSegmented()||a.isToken()||!a.canInsertTextBefore()||!u.canInsertTextBefore()&&a.getPreviousSibling()===null)){let p=a.getPreviousSibling();if(Ne(p)&&!ns(p)||(p=ar(),p.setFormat(f),u.canInsertTextBefore()?a.insertBefore(p):u.insertBefore(p)),p.select(),a=p,d!=="")return void this.insertText(d)}else if(a.isSegmented()&&s!==c){const p=ar(a.getTextContent());p.setFormat(f),a.replace(p),a=p}else if(!this.isCollapsed()&&d!==""){const p=h.getParent();if(!u.canInsertTextBefore()||!u.canInsertTextAfter()||ge(p)&&(!p.canInsertTextBefore()||!p.canInsertTextAfter()))return this.insertText(""),Ng(this.anchor,this.focus,null),void this.insertText(d)}if(o===1){if(a.isToken()){const _=ar(d);return _.select(),void a.replace(_)}const p=a.getFormat(),m=a.getStyle();if(s!==i||p===f&&m===r){if(Qv(a)){const _=ar(d);return _.setFormat(f),_.setStyle(r),_.select(),void a.replace(_)}}else{if(a.getTextContent()!==""){const _=ar(d);if(_.setFormat(f),_.setStyle(r),_.select(),s===0)a.insertBefore(_,!1);else{const[v]=a.splitText(s);v.insertAfter(_,!1)}return void(_.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=d.length))}a.setFormat(f),a.setStyle(r)}const b=i-s;a=a.spliceText(s,b,d,!0),a.getTextContent()===""?a.remove():this.anchor.type==="text"&&(a.isComposing()?this.anchor.offset-=d.length:(this.format=p,this.style=m))}else{const p=new Set([...a.getParentKeys(),...h.getParentKeys()]),m=ge(a)?a:a.getParentOrThrow();let b=ge(h)?h:h.getParentOrThrow(),_=h;if(!m.is(b)&&b.isInline())do _=b,b=b.getParentOrThrow();while(b.isInline());if(e.type==="text"&&(i!==0||h.getTextContent()==="")||e.type==="element"&&h.getIndexWithinParent()<i)if(Ne(h)&&!h.isToken()&&i!==h.getTextContentSize()){if(h.isSegmented()){const E=ar(h.getTextContent());h.replace(E),h=E}vr(e.getNode())||e.type!=="text"||(h=h.spliceText(0,i,"")),p.add(h.__key)}else{const E=h.getParentOrThrow();E.canBeEmpty()||E.getChildrenSize()!==1?h.remove():E.remove()}else p.add(h.__key);const v=b.getChildren(),w=new Set(l),x=m.is(b),S=m.isInline()&&a.getNextSibling()===null?m:a;for(let E=v.length-1;E>=0;E--){const k=v[E];if(k.is(a)||ge(k)&&k.isParentOf(a))break;k.isAttached()&&(!w.has(k)||k.is(_)?x||S.insertAfter(k,!1):k.remove())}if(!x){let E=b,k=null;for(;E!==null;){const D=E.getChildren(),P=D.length;(P===0||D[P-1].is(k))&&(p.delete(E.__key),k=E),E=E.getParent()}}if(a.isToken())if(s===c)a.select();else{const E=ar(d);E.select(),a.replace(E)}else a=a.spliceText(s,c-s,d,!0),a.getTextContent()===""?a.remove():a.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=d.length);for(let E=1;E<o;E++){const k=l[E],D=k.__key;p.has(D)||k.remove()}}}removeText(){this.insertText("")}formatText(d){if(this.isCollapsed())return this.toggleFormat(d),void hr(null);const g=this.getNodes(),t=[];for(const b of g)Ne(b)&&t.push(b);const f=t.length;if(f===0)return this.toggleFormat(d),void hr(null);const r=this.anchor,n=this.focus,e=this.isBackward(),s=e?n:r,i=e?r:n;let l=0,o=t[0],a=s.type==="element"?0:s.offset;if(s.type==="text"&&a===o.getTextContentSize()&&(l=1,o=t[1],a=0),o==null)return;const c=o.getFormatFlags(d,null),u=f-1;let h=t[u];const p=i.type==="text"?i.offset:h.getTextContentSize();if(o.is(h)){if(a===p)return;if(ns(o)||a===0&&p===o.getTextContentSize())o.setFormat(c);else{const b=o.splitText(a,p),_=a===0?b[0]:b[1];_.setFormat(c),s.type==="text"&&s.set(_.__key,0,"text"),i.type==="text"&&i.set(_.__key,p-a,"text")}return void(this.format=c)}a===0||ns(o)||([,o]=o.splitText(a),a=0),o.setFormat(c);const m=h.getFormatFlags(d,c);p>0&&(p===h.getTextContentSize()||ns(h)||([h]=h.splitText(p)),h.setFormat(m));for(let b=l+1;b<u;b++){const _=t[b],v=_.getFormatFlags(d,m);_.setFormat(v)}s.type==="text"&&s.set(o.__key,a,"text"),i.type==="text"&&i.set(h.__key,p,"text"),this.format=c|m}insertNodes(d){if(d.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const u=Oe();return xe(u)||Je(134),u.insertNodes(d)}const g=Zd((this.isBackward()?this.focus:this.anchor).getNode(),os),t=d[d.length-1];if("__language"in g&&ge(g)){if("__language"in d[0])this.insertText(d[0].getTextContent());else{const u=_f(this);g.splice(u,0,d),t.selectEnd()}return}if(!d.some(u=>(ge(u)||Tn(u))&&!u.isInline())){ge(g)||Je(135);const u=_f(this);return g.splice(u,0,d),void t.selectEnd()}const f=function(u){const h=Un();let p=null;for(let m=0;m<u.length;m++){const b=u[m],_=ha(b);if(_||Tn(b)&&b.isInline()||ge(b)&&b.isInline()||Ne(b)||b.isParentRequired()){if(p===null&&(p=b.createParentElementNode(),h.append(p),_))continue;p!==null&&p.append(b)}else h.append(b),p=null}return h}(d),r=f.getLastDescendant(),n=f.getChildren(),e=u=>"__value"in u&&"__checked"in u,s=!ge(g)||!g.isEmpty()?this.insertParagraph():null,i=n[n.length-1];let l=n[0];var o;ge(o=l)&&os(o)&&!o.isEmpty()&&ge(g)&&(!g.isEmpty()||e(g))&&(ge(g)||Je(135),g.append(...l.getChildren()),l=n[1]),l&&function(u,h,p){const m=h.getParentOrThrow().getLastChild();let b=h;const _=[h];for(;b!==m;)b.getNextSibling()||Je(140),b=b.getNextSibling(),_.push(b);let v=u;for(const w of _)v=v.insertAfter(w)}(g,l);const a=Zd(r,os);s&&ge(a)&&(e(s)||os(i))&&(a.append(...s.getChildren()),s.remove()),ge(g)&&g.isEmpty()&&g.remove(),r.selectEnd();const c=ge(g)?g.getLastChild():null;ha(c)&&a!==g&&c.remove()}insertParagraph(){if(this.anchor.key==="root"){const n=Un();return Ln().splice(this.anchor.offset,0,[n]),n.select(),n}const d=_f(this),g=Zd(this.anchor.getNode(),os);ge(g)||Je(136);const t=g.getChildAtIndex(d),f=t?[t,...t.getNextSiblings()]:[],r=g.insertNewAfter(this,!1);return r?(r.append(...f),r.selectStart(),r):null}insertLineBreak(d){const g=ls();if(this.insertNodes([g]),d){const t=g.getParentOrThrow(),f=g.getIndexWithinParent();t.select(f,f)}}extract(){const d=this.getNodes(),g=d.length,t=g-1,f=this.anchor,r=this.focus;let n=d[0],e=d[t];const[s,i]=mf(this);if(g===0)return[];if(g===1){if(Ne(n)&&!this.isCollapsed()){const o=s>i?i:s,a=s>i?s:i,c=n.splitText(o,a),u=o===0?c[0]:c[1];return u!=null?[u]:[]}return[n]}const l=f.isBefore(r);if(Ne(n)){const o=l?s:i;o===n.getTextContentSize()?d.shift():o!==0&&([,n]=n.splitText(o),d[0]=n)}if(Ne(e)){const o=e.getTextContent().length,a=l?i:s;a===0?d.pop():a!==o&&([e]=e.splitText(a),d[t]=e)}return d}modify(d,g,t){const f=this.focus,r=this.anchor,n=d==="move",e=wl(f,g);if(Tn(e)&&!e.isIsolated()){if(n&&e.isKeyboardSelectable()){const c=vf();return c.add(e.__key),void or(c)}const a=g?e.getPreviousSibling():e.getNextSibling();if(Ne(a)){const c=a.__key,u=g?a.getTextContent().length:0;return f.set(c,u,"text"),void(n&&r.set(c,u,"text"))}{const c=e.getParentOrThrow();let u,h;return ge(a)?(h=a.__key,u=g?a.getChildrenSize():0):(u=e.getIndexWithinParent(),h=c.__key,g||u++),f.set(h,u,"element"),void(n&&r.set(h,u,"element"))}}const s=Wn(),i=Oo(s._window);if(!i)return;const l=s._blockCursorElement,o=s._rootElement;if(o===null||l===null||!ge(e)||e.isInline()||e.canBeEmpty()||Yd(l,s,o),function(a,c,u,h){a.modify(c,u,h)}(i,d,g?"backward":"forward",t),i.rangeCount>0){const a=i.getRangeAt(0),c=this.anchor.getNode(),u=vr(c)?c:Mv(c);if(this.applyDOMRange(a),this.dirty=!0,!n){const h=this.getNodes(),p=[];let m=!1;for(let b=0;b<h.length;b++){const _=h[b];Wd(_,u)?p.push(_):m=!0}if(m&&p.length>0)if(g){const b=p[0];ge(b)?b.selectStart():b.getParentOrThrow().selectStart()}else{const b=p[p.length-1];ge(b)?b.selectEnd():b.getParentOrThrow().selectEnd()}i.anchorNode===a.startContainer&&i.anchorOffset===a.startOffset||function(b){const _=b.focus,v=b.anchor,w=v.key,x=v.offset,S=v.type;Ai(v,_.key,_.offset,_.type),Ai(_,w,x,S),b._cachedNodes=null}(this)}}}forwardDeletion(d,g,t){if(!t&&(d.type==="element"&&ge(g)&&d.offset===g.getChildrenSize()||d.type==="text"&&d.offset===g.getTextContentSize())){const f=g.getParent(),r=g.getNextSibling()||(f===null?null:f.getNextSibling());if(ge(r)&&r.isShadowRoot())return!0}return!1}deleteCharacter(d){const g=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let f=t.getNode();if(this.forwardDeletion(t,f,d))return;const r=this.focus,n=wl(r,d);if(Tn(n)&&!n.isIsolated()){if(n.isKeyboardSelectable()&&ge(f)&&f.getChildrenSize()===0){f.remove();const e=vf();e.add(n.__key),or(e)}else n.remove(),Wn().dispatchCommand(Wo,void 0);return}if(!d&&ge(n)&&ge(f)&&f.isEmpty())return f.remove(),void n.selectStart();if(this.modify("extend",d,"character"),this.isCollapsed()){if(d&&t.offset===0&&(t.type==="element"?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const e=r.type==="text"?r.getNode():null;if(f=t.type==="text"?t.getNode():null,e!==null&&e.isSegmented()){const s=r.offset,i=e.getTextContentSize();if(e.is(f)||d&&s!==i||!d&&s!==0)return void jg(e,d,s)}else if(f!==null&&f.isSegmented()){const s=t.offset,i=f.getTextContentSize();if(f.is(e)||d&&s!==0||!d&&s!==i)return void jg(f,d,s)}(function(s,i){const l=s.anchor,o=s.focus,a=l.getNode(),c=o.getNode();if(a===c&&l.type==="text"&&o.type==="text"){const u=l.offset,h=o.offset,p=u<h,m=p?u:h,b=p?h:u,_=b-1;m!==_&&(Jh(a.getTextContent().slice(m,b))||(i?o.offset=_:l.offset=_))}})(this,d)}}if(this.removeText(),d&&!g&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const t=this.anchor.getNode();t.isEmpty()&&vr(t.getParent())&&t.getIndexWithinParent()===0&&t.collapseAtStart(this)}}deleteLine(d){if(this.isCollapsed()){const g=this.anchor.type==="element";if(g&&this.insertText(" "),this.modify("extend",d,"lineboundary"),(d?this.focus:this.anchor).offset===0&&this.modify("extend",d,"character"),g){const t=d?this.anchor:this.focus;t.set(t.key,t.offset+1,t.type)}}this.removeText()}deleteWord(d){if(this.isCollapsed()){const g=this.anchor,t=g.getNode();if(this.forwardDeletion(g,t,d))return;this.modify("extend",d,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Xr(y){return y instanceof Gc}function Tg(y){const d=y.offset;if(y.type==="text")return d;const g=y.getNode();return d===g.getChildrenSize()?g.getTextContent().length:0}function mf(y){const d=y.getStartEndPoints();if(d===null)return[0,0];const[g,t]=d;return g.type==="element"&&t.type==="element"&&g.key===t.key&&g.offset===t.offset?[0,0]:[Tg(g),Tg(t)]}function jg(y,d,g){const t=y,f=t.getTextContent().split(/(?=\s)/g),r=f.length;let n=0,e=0;for(let i=0;i<r;i++){const l=i===r-1;if(e=n,n+=f[i].length,d&&n===g||n>g||l){f.splice(i,1),l&&(e=void 0);break}}const s=f.join("").trim();s===""?t.remove():(t.setTextContent(s),t.select(e,e))}function Ag(y,d,g,t){let f,r=d;if(y.nodeType===ml){let n=!1;const e=y.childNodes,s=e.length,i=t._blockCursorElement;r===s&&(n=!0,r=s-1);let l=e[r],o=!1;if(l===i)l=e[r+1],o=!0;else if(i!==null){const a=i.parentNode;y===a&&d>Array.prototype.indexOf.call(a.children,i)&&r--}if(f=rs(l),Ne(f))r=qh(f,n);else{let a=rs(y);if(a===null)return null;if(ge(a)){r=Math.min(a.getChildrenSize(),r);let c=a.getChildAtIndex(r);if(ge(c)&&function(u,h,p){const m=u.getParent();return p===null||m===null||!m.canBeEmpty()||m!==p.getNode()}(c,0,g)){const u=n?c.getLastDescendant():c.getFirstDescendant();u===null?a=c:(c=u,a=ge(c)?c:c.getParentOrThrow()),r=0}Ne(c)?(f=c,a=null,r=qh(c,n)):c!==a&&n&&!o&&r++}else{const c=a.getIndexWithinParent();r=d===0&&Tn(a)&&rs(y)===a?c:c+1,a=a.getParentOrThrow()}if(ge(a))return Qr(a.__key,r,"element")}}else f=rs(y);return Ne(f)?Qr(f.__key,r,"text"):null}function Pg(y,d,g){const t=y.offset,f=y.getNode();if(t===0){const r=f.getPreviousSibling(),n=f.getParent();if(d){if((g||!d)&&r===null&&ge(n)&&n.isInline()){const e=n.getPreviousSibling();Ne(e)&&(y.key=e.__key,y.offset=e.getTextContent().length)}}else ge(r)&&!g&&r.isInline()?(y.key=r.__key,y.offset=r.getChildrenSize(),y.type="element"):Ne(r)&&(y.key=r.__key,y.offset=r.getTextContent().length)}else if(t===f.getTextContent().length){const r=f.getNextSibling(),n=f.getParent();if(d&&ge(r)&&r.isInline())y.key=r.__key,y.offset=0,y.type="element";else if((g||d)&&r===null&&ge(n)&&n.isInline()&&!n.canInsertTextAfter()){const e=n.getNextSibling();Ne(e)&&(y.key=e.__key,y.offset=0)}}}function Ng(y,d,g){if(y.type==="text"&&d.type==="text"){const t=y.isBefore(d),f=y.is(d);Pg(y,t,f),Pg(d,!t,f),f&&(d.key=y.key,d.offset=y.offset,d.type=y.type);const r=Wn();if(r.isComposing()&&r._compositionKey!==y.key&&xe(g)){const n=g.anchor,e=g.focus;Ai(y,n.key,n.offset,n.type),Ai(d,e.key,e.offset,e.type)}}}function Ig(y,d,g,t,f,r){if(y===null||g===null||!yl(f,y,g))return null;const n=Ag(y,d,xe(r)?r.anchor:null,f);if(n===null)return null;const e=Ag(g,t,xe(r)?r.focus:null,f);if(e===null)return null;if(n.type==="element"&&e.type==="element"){const s=rs(y),i=rs(g);if(Tn(s)&&Tn(i))return null}return Ng(n,e,r),[n,e]}function yf(y){return ge(y)&&!y.isInline()}function Rg(y,d,g,t,f,r){const n=To(),e=new Pi(Qr(y,d,f),Qr(g,t,r),0,"");return e.dirty=!0,n._selection=e,e}function bf(){const y=Qr("root",0,"element"),d=Qr("root",0,"element");return new Pi(y,d,0,"")}function vf(){return new Gc(new Set)}function t1(y,d){return Yc(null,y,d,null)}function Yc(y,d,g,t){const f=g._window;if(f===null)return null;const r=t||f.event,n=r?r.type:void 0,e=n==="selectionchange",s=!Ld&&(e||n==="beforeinput"||n==="compositionstart"||n==="compositionend"||n==="click"&&r&&r.detail===3||n==="drop"||n===void 0);let i,l,o,a;if(xe(y)&&!s)return y.clone();if(d===null)return null;if(i=d.anchorNode,l=d.focusNode,o=d.anchorOffset,a=d.focusOffset,e&&xe(y)&&!yl(g,i,l))return y.clone();const c=Ig(i,o,l,a,g,y);if(c===null)return null;const[u,h]=c;return new Pi(u,h,xe(y)?y.format:0,xe(y)?y.style:"")}function Oe(){return To()._selection}function ma(){return Wn()._editorState._selection}function Zc(y,d,g,t=1){const f=y.anchor,r=y.focus,n=f.getNode(),e=r.getNode();if(!d.is(n)&&!d.is(e))return;const s=d.__key;if(y.isCollapsed()){const i=f.offset;if(g<=i&&t>0||g<i&&t<0){const l=Math.max(0,i+t);f.set(s,l,"element"),r.set(s,l,"element"),Mg(y)}}else{const i=y.isBackward(),l=i?r:f,o=l.getNode(),a=i?f:r,c=a.getNode();if(d.is(o)){const u=l.offset;(g<=u&&t>0||g<u&&t<0)&&l.set(s,Math.max(0,u+t),"element")}if(d.is(c)){const u=a.offset;(g<=u&&t>0||g<u&&t<0)&&a.set(s,Math.max(0,u+t),"element")}}Mg(y)}function Mg(y){const d=y.anchor,g=d.offset,t=y.focus,f=t.offset,r=d.getNode(),n=t.getNode();if(y.isCollapsed()){if(!ge(r))return;const e=r.getChildrenSize(),s=g>=e,i=s?r.getChildAtIndex(e-1):r.getChildAtIndex(g);if(Ne(i)){let l=0;s&&(l=i.getTextContentSize()),d.set(i.__key,l,"text"),t.set(i.__key,l,"text")}}else{if(ge(r)){const e=r.getChildrenSize(),s=g>=e,i=s?r.getChildAtIndex(e-1):r.getChildAtIndex(g);if(Ne(i)){let l=0;s&&(l=i.getTextContentSize()),d.set(i.__key,l,"text")}}if(ge(n)){const e=n.getChildrenSize(),s=f>=e,i=s?n.getChildAtIndex(e-1):n.getChildAtIndex(f);if(Ne(i)){let l=0;s&&(l=i.getTextContentSize()),t.set(i.__key,l,"text")}}}}function Qc(y,d,g,t,f){let r=null,n=0,e=null;t!==null?(r=t.__key,Ne(t)?(n=t.getTextContentSize(),e="text"):ge(t)&&(n=t.getChildrenSize(),e="element")):f!==null&&(r=f.__key,Ne(f)?e="text":ge(f)&&(e="element")),r!==null&&e!==null?y.set(r,n,e):(n=d.getIndexWithinParent(),n===-1&&(n=g.getChildrenSize()),y.set(g.__key,n,"element"))}function Dg(y,d,g,t,f){y.type==="text"?(y.key=g,d||(y.offset+=f)):y.offset>t.getIndexWithinParent()&&(y.offset-=1)}function e1(y,d,g,t,f,r,n){const e=t.anchorNode,s=t.focusNode,i=t.anchorOffset,l=t.focusOffset,o=document.activeElement;if(f.has("collaboration")&&o!==r||o!==null&&Ud(o))return;if(!xe(d))return void(y!==null&&yl(g,e,s)&&t.removeAllRanges());const a=d.anchor,c=d.focus,u=a.key,h=c.key,p=Lc(g,u),m=Lc(g,h),b=a.offset,_=c.offset,v=d.format,w=d.style,x=d.isCollapsed();let S=p,E=m,k=!1;if(a.type==="text"){S=Rc(p);const z=a.getNode();k=z.getFormat()!==v||z.getStyle()!==w}else xe(y)&&y.anchor.type==="text"&&(k=!0);var D,P,O,R,A;if(c.type==="text"&&(E=Rc(m)),S!==null&&E!==null&&(x&&(y===null||k||xe(y)&&(y.format!==v||y.style!==w))&&(D=v,P=w,O=b,R=u,A=performance.now(),fg=[D,P,O,R,A]),i!==b||l!==_||e!==S||s!==E||t.type==="Range"&&x||(o!==null&&r.contains(o)||r.focus({preventScroll:!0}),a.type==="element"))){try{t.setBaseAndExtent(S,b,E,_)}catch{}if(!f.has("skip-scroll-into-view")&&d.isCollapsed()&&r!==null&&r===document.activeElement){const z=d instanceof Pi&&d.anchor.type==="element"?S.childNodes[b]||null:t.rangeCount>0?t.getRangeAt(0):null;if(z!==null){let H;if(z instanceof Text){const $=document.createRange();$.selectNode(z),H=$.getBoundingClientRect()}else H=z.getBoundingClientRect();(function($,M,J){const K=J.ownerDocument,N=K.defaultView;if(N===null)return;let{top:U,bottom:W}=M,G=0,F=0,q=J;for(;q!==null;){const T=q===K.body;if(T)G=0,F=Fc($).innerHeight;else{const L=q.getBoundingClientRect();G=L.top,F=L.bottom}let I=0;if(U<G?I=-(G-U):W>F&&(I=W-F),I!==0)if(T)N.scrollBy(0,I);else{const L=q.scrollTop;q.scrollTop+=I;const B=q.scrollTop-L;U-=B,W-=B}if(T)break;q=Bc(q)}})(g,H,r)}}lf=!0}}function n1(y){let d=Oe()||ma();d===null&&(d=Ln().selectEnd()),d.insertNodes(y)}function _f(y){let d=y;y.isCollapsed()||d.removeText();const g=Oe();xe(g)&&(d=g),xe(d)||Je(161);const t=d.anchor;let f=t.getNode(),r=t.offset;for(;!os(f);)[f,r]=r1(f,r);return r}function r1(y,d){const g=y.getParent();if(!g){const f=Un();return Ln().append(f),f.select(),[Ln(),0]}if(Ne(y)){const f=y.splitText(d);if(f.length===0)return[g,y.getIndexWithinParent()];const r=d===0?0:1;return[g,f[0].getIndexWithinParent()+r]}if(!ge(y)||d===0)return[g,y.getIndexWithinParent()];const t=y.getChildAtIndex(d);if(t){const f=new Pi(Qr(y.__key,d,"element"),Qr(y.__key,d,"element"),0,""),r=y.insertNewAfter(f);r&&r.append(t,...t.getNextSiblings())}return[g,y.getIndexWithinParent()+1]}let ur=null,dr=null,Dr=!1,xf=!1,Xc=0;const Lg={characterData:!0,childList:!0,subtree:!0};function cs(){return Dr||ur!==null&&ur._readOnly}function Tr(){Dr&&Je(13)}function Bg(){Xc>99&&Je(14)}function To(){return ur===null&&Je(15),ur}function Wn(){return dr===null&&Je(16),dr}function o1(){return dr}function Fg(y,d,g){const t=d.__type,f=function(e,s){const i=e._nodes.get(s);return i===void 0&&Je(30,s),i}(y,t);let r=g.get(t);r===void 0&&(r=Array.from(f.transforms),g.set(t,r));const n=r.length;for(let e=0;e<n&&(r[e](d),d.isAttached());e++);}function zg(y,d){return y!==void 0&&y.__key!==d&&y.isAttached()}function i1(y){return wf(y,Wn()._nodes)}function wf(y,d){const g=y.type,t=d.get(g);t===void 0&&Je(17,g);const f=t.klass;y.type!==f.getType()&&Je(18,f.name);const r=f.importJSON(y),n=y.children;if(ge(r)&&Array.isArray(n))for(let e=0;e<n.length;e++){const s=wf(n[e],d);r.append(s)}return r}function Ug(y,d){const g=ur,t=Dr,f=dr;ur=y,Dr=!0,dr=null;try{return d()}finally{ur=g,Dr=t,dr=f}}function ya(y,d){const g=y._pendingEditorState,t=y._rootElement,f=y._headless||t===null;if(g===null)return;const r=y._editorState,n=r._selection,e=g._selection,s=y._dirtyType!==ua,i=ur,l=Dr,o=dr,a=y._updating,c=y._observer;let u=null;if(y._pendingEditorState=null,y._editorState=g,!f&&s&&c!==null){dr=y,ur=g,Dr=!1,y._updating=!0;try{const x=y._dirtyType,S=y._dirtyElements,E=y._dirtyLeaves;c.disconnect(),u=qv(r,g,y,x,S,E)}catch(x){if(x instanceof Error&&y._onError(x),xf)throw x;return Kg(y,null,t,g),Ih(y),y._dirtyType=es,xf=!0,ya(y,r),void(xf=!1)}finally{c.observe(t,Lg),y._updating=a,ur=i,Dr=l,dr=o}}g._readOnly||(g._readOnly=!0);const h=y._dirtyLeaves,p=y._dirtyElements,m=y._normalizedNodes,b=y._updateTags,_=y._deferred;s&&(y._dirtyType=ua,y._cloneNotNeeded.clear(),y._dirtyLeaves=new Set,y._dirtyElements=new Map,y._normalizedNodes=new Set,y._updateTags=new Set),function(x,S){const E=x._decorators;let k=x._pendingDecorators||E;const D=S._nodeMap;let P;for(P in k)D.has(P)||(k===E&&(k=Uh(x)),delete k[P])}(y,g);const v=f?null:Oo(y._window);if(y._editable&&v!==null&&(s||e===null||e.dirty)){dr=y,ur=g;try{if(c!==null&&c.disconnect(),s||e===null||e.dirty){const x=y._blockCursorElement;x!==null&&Yd(x,y,t),e1(n,e,y,v,b,t)}Lv(y,t,e),c!==null&&c.observe(t,Lg)}finally{dr=o,ur=i}}u!==null&&function(x,S,E,k,D){const P=Array.from(x._listeners.mutation),O=P.length;for(let R=0;R<O;R++){const[A,z]=P[R],H=S.get(z);H!==void 0&&A(H,{dirtyLeaves:k,prevEditorState:D,updateTags:E})}}(y,u,b,h,r),xe(e)||e===null||n!==null&&n.is(e)||y.dispatchCommand(Wo,void 0);const w=y._pendingDecorators;w!==null&&(y._decorators=w,y._pendingDecorators=null,Nl("decorator",y,!0,w)),function(x,S,E){const k=$h(S),D=$h(E);k!==D&&Nl("textcontent",x,!0,D)}(y,d||r,g),Nl("update",y,!0,{dirtyElements:p,dirtyLeaves:h,editorState:g,normalizedNodes:m,prevEditorState:d||r,tags:b}),function(x,S){if(x._deferred=[],S.length!==0){const E=x._updating;x._updating=!0;try{for(let k=0;k<S.length;k++)S[k]()}finally{x._updating=E}}}(y,_),function(x){const S=x._updates;if(S.length!==0){const E=S.shift();if(E){const[k,D]=E;qg(x,k,D)}}}(y)}function Nl(y,d,g,...t){const f=d._updating;d._updating=g;try{const r=Array.from(d._listeners[y]);for(let n=0;n<r.length;n++)r[n].apply(null,t)}finally{d._updating=f}}function $g(y,d,g){if(y._updating===!1||dr!==y){let f=!1;return y.update(()=>{f=$g(y,d,g)}),f}const t=Hd(y);for(let f=4;f>=0;f--)for(let r=0;r<t.length;r++){const n=t[r]._commands.get(d);if(n!==void 0){const e=n[f];if(e!==void 0){const s=Array.from(e),i=s.length;for(let l=0;l<i;l++)if(s[l](g,y)===!0)return!0}}}return!1}function Hg(y,d){const g=y._updates;let t=d||!1;for(;g.length!==0;){const f=g.shift();if(f){const[r,n]=f;let e,s;n!==void 0&&(e=n.onUpdate,s=n.tag,n.skipTransforms&&(t=!0),e&&y._deferred.push(e),s&&y._updateTags.add(s)),r()}}return t}function qg(y,d,g){const t=y._updateTags;let f,r,n=!1,e=!1;g!==void 0&&(f=g.onUpdate,r=g.tag,r!=null&&t.add(r),n=g.skipTransforms||!1,e=g.discrete||!1),f&&y._deferred.push(f);const s=y._editorState;let i=y._pendingEditorState,l=!1;(i===null||i._readOnly)&&(i=y._pendingEditorState=new tu(new Map((i||s)._nodeMap)),l=!0),i._flushSync=e;const o=ur,a=Dr,c=dr,u=y._updating;ur=i,Dr=!1,y._updating=!0,dr=y;try{l&&(y._headless?s._selection!==null&&(i._selection=s._selection.clone()):i._selection=function(b){const _=b.getEditorState()._selection,v=Oo(b._window);return xe(_)||_==null?Yc(_,v,b,null):_.clone()}(y));const p=y._compositionKey;d(),n=Hg(y,n),function(b,_){const v=_.getEditorState()._selection,w=b._selection;if(xe(w)){const x=w.anchor,S=w.focus;let E;if(x.type==="text"&&(E=x.getNode(),E.selectionTransform(v,w)),S.type==="text"){const k=S.getNode();E!==k&&k.selectionTransform(v,w)}}}(i,y),y._dirtyType!==ua&&(n?function(b,_){const v=_._dirtyLeaves,w=b._nodeMap;for(const x of v){const S=w.get(x);Ne(S)&&S.isAttached()&&S.isSimpleText()&&!S.isUnmergeable()&&Dh(S)}}(i,y):function(b,_){const v=_._dirtyLeaves,w=_._dirtyElements,x=b._nodeMap,S=Oi(),E=new Map;let k=v,D=k.size,P=w,O=P.size;for(;D>0||O>0;){if(D>0){_._dirtyLeaves=new Set;for(const R of k){const A=x.get(R);Ne(A)&&A.isAttached()&&A.isSimpleText()&&!A.isUnmergeable()&&Dh(A),A!==void 0&&zg(A,S)&&Fg(_,A,E),v.add(R)}if(k=_._dirtyLeaves,D=k.size,D>0){Xc++;continue}}_._dirtyLeaves=new Set,_._dirtyElements=new Map;for(const R of P){const A=R[0],z=R[1];if(A!=="root"&&!z)continue;const H=x.get(A);H!==void 0&&zg(H,S)&&Fg(_,H,E),w.set(A,z)}k=_._dirtyLeaves,D=k.size,P=_._dirtyElements,O=P.size,Xc++}_._dirtyLeaves=v,_._dirtyElements=w}(i,y),Hg(y),function(b,_,v,w){const x=b._nodeMap,S=_._nodeMap,E=[];for(const[k]of w){const D=S.get(k);D!==void 0&&(D.isAttached()||(ge(D)&&ng(D,k,x,S,E,w),x.has(k)||w.delete(k),E.push(k)))}for(const k of E)S.delete(k);for(const k of v){const D=S.get(k);D===void 0||D.isAttached()||(x.has(k)||v.delete(k),S.delete(k))}}(s,i,y._dirtyLeaves,y._dirtyElements)),p!==y._compositionKey&&(i._flushSync=!0);const m=i._selection;if(xe(m)){const b=i._nodeMap,_=m.anchor.key,v=m.focus.key;b.get(_)!==void 0&&b.get(v)!==void 0||Je(19)}else Xr(m)&&m._nodes.size===0&&(i._selection=null)}catch(p){return p instanceof Error&&y._onError(p),y._pendingEditorState=s,y._dirtyType=es,y._cloneNotNeeded.clear(),y._dirtyLeaves=new Set,y._dirtyElements.clear(),void ya(y)}finally{ur=o,Dr=a,dr=c,y._updating=u,Xc=0}y._dirtyType!==ua||function(p,m){const b=m.getEditorState()._selection,_=p._selection;if(_!==null){if(_.dirty||!_.is(b))return!0}else if(b!==null)return!0;return!1}(i,y)?i._flushSync?(i._flushSync=!1,ya(y)):l&&Pv(()=>{ya(y)}):(i._flushSync=!1,l&&(t.clear(),y._deferred=[],y._pendingEditorState=null))}function Hr(y,d,g){y._updating?y._updates.push([d,g]):qg(y,d,g)}class jo extends Wc{constructor(d){super(d),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const d=this.getFormat();return wv[d]||""}getIndent(){return this.getLatest().__indent}getChildren(){const d=[];let g=this.getFirstChild();for(;g!==null;)d.push(g),g=g.getNextSibling();return d}getChildrenKeys(){const d=[];let g=this.getFirstChild();for(;g!==null;)d.push(g.__key),g=g.getNextSibling();return d}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const d=Wn()._dirtyElements;return d!==null&&d.has(this.__key)}isLastChild(){const d=this.getLatest(),g=this.getParentOrThrow().getLastChild();return g!==null&&g.is(d)}getAllTextNodes(){const d=[];let g=this.getFirstChild();for(;g!==null;){if(Ne(g)&&d.push(g),ge(g)){const t=g.getAllTextNodes();d.push(...t)}g=g.getNextSibling()}return d}getFirstDescendant(){let d=this.getFirstChild();for(;ge(d);){const g=d.getFirstChild();if(g===null)break;d=g}return d}getLastDescendant(){let d=this.getLastChild();for(;ge(d);){const g=d.getLastChild();if(g===null)break;d=g}return d}getDescendantByIndex(d){const g=this.getChildren(),t=g.length;if(d>=t){const r=g[t-1];return ge(r)&&r.getLastDescendant()||r||null}const f=g[d];return ge(f)&&f.getFirstDescendant()||f||null}getFirstChild(){const d=this.getLatest().__first;return d===null?null:Vn(d)}getFirstChildOrThrow(){const d=this.getFirstChild();return d===null&&Je(45,this.__key),d}getLastChild(){const d=this.getLatest().__last;return d===null?null:Vn(d)}getLastChildOrThrow(){const d=this.getLastChild();return d===null&&Je(96,this.__key),d}getChildAtIndex(d){const g=this.getChildrenSize();let t,f;if(d<g/2){for(t=this.getFirstChild(),f=0;t!==null&&f<=d;){if(f===d)return t;t=t.getNextSibling(),f++}return null}for(t=this.getLastChild(),f=g-1;t!==null&&f>=d;){if(f===d)return t;t=t.getPreviousSibling(),f--}return null}getTextContent(){let d="";const g=this.getChildren(),t=g.length;for(let f=0;f<t;f++){const r=g[f];d+=r.getTextContent(),ge(r)&&f!==t-1&&!r.isInline()&&(d+=Ko)}return d}getTextContentSize(){let d=0;const g=this.getChildren(),t=g.length;for(let f=0;f<t;f++){const r=g[f];d+=r.getTextContentSize(),ge(r)&&f!==t-1&&!r.isInline()&&(d+=Ko.length)}return d}getDirection(){return this.getLatest().__dir}hasFormat(d){if(d!==""){const g=Ah[d];return!!(this.getFormat()&g)}return!1}select(d,g){Tr();const t=Oe();let f=d,r=g;const n=this.getChildrenSize();if(!this.canBeEmpty()){if(d===0&&g===0){const s=this.getFirstChild();if(Ne(s)||ge(s))return s.select(0,0)}else if(!(d!==void 0&&d!==n||g!==void 0&&g!==n)){const s=this.getLastChild();if(Ne(s)||ge(s))return s.select()}}f===void 0&&(f=n),r===void 0&&(r=n);const e=this.__key;return xe(t)?(t.anchor.set(e,f,"element"),t.focus.set(e,r,"element"),t.dirty=!0,t):Rg(e,f,e,r,"element","element")}selectStart(){const d=this.getFirstDescendant();return d?d.selectStart():this.select()}selectEnd(){const d=this.getLastDescendant();return d?d.selectEnd():this.select()}clear(){const d=this.getWritable();return this.getChildren().forEach(g=>g.remove()),d}append(...d){return this.splice(this.getChildrenSize(),0,d)}setDirection(d){const g=this.getWritable();return g.__dir=d,g}setFormat(d){return this.getWritable().__format=d!==""?Ah[d]:0,this}setIndent(d){return this.getWritable().__indent=d,this}splice(d,g,t){const f=t.length,r=this.getChildrenSize(),n=this.getWritable(),e=n.__key,s=[],i=[],l=this.getChildAtIndex(d+g);let o=null,a=r-g+f;if(d!==0)if(d===r)o=this.getLastChild();else{const u=this.getChildAtIndex(d);u!==null&&(o=u.getPreviousSibling())}if(g>0){let u=o===null?this.getFirstChild():o.getNextSibling();for(let h=0;h<g;h++){u===null&&Je(100);const p=u.getNextSibling(),m=u.__key;da(u.getWritable()),i.push(m),u=p}}let c=o;for(let u=0;u<f;u++){const h=t[u];c!==null&&h.is(c)&&(o=c=c.getPreviousSibling());const p=h.getWritable();p.__parent===e&&a--,da(p);const m=h.__key;if(c===null)n.__first=m,p.__prev=null;else{const b=c.getWritable();b.__next=m,p.__prev=b.__key}h.__key===e&&Je(76),p.__parent=e,s.push(m),c=h}if(d+g===r)c!==null&&(c.getWritable().__next=null,n.__last=c.__key);else if(l!==null){const u=l.getWritable();if(c!==null){const h=c.getWritable();u.__prev=c.__key,h.__next=l.__key}else u.__prev=null}if(n.__size=a,i.length){const u=Oe();if(xe(u)){const h=new Set(i),p=new Set(s),{anchor:m,focus:b}=u;Jg(m,h,p)&&Qc(m,m.getNode(),this,o,l),Jg(b,h,p)&&Qc(b,b.getNode(),this,o,l),a!==0||this.canBeEmpty()||ko(this)||this.remove()}}return n}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(d,g){return null}canIndent(){return!0}collapseAtStart(d){return!1}excludeFromCopy(d){return!1}canReplaceWith(d){return!0}canInsertAfter(d){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(d){return!1}extractWithChild(d,g,t){return!1}}function ge(y){return y instanceof jo}function Jg(y,d,g){let t=y.getNode();for(;t;){const f=t.__key;if(d.has(f)&&!g.has(f))return!0;t=t.getParent()}return!1}class Vg extends Wc{constructor(d){super(d)}decorate(d,g){Je(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Tn(y){return y instanceof Vg}class us extends jo{static getType(){return"root"}static clone(){return new us}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Je(51)}getTextContent(){const d=this.__cachedText;return!cs()&&Wn()._dirtyType!==ua||d===null?super.getTextContent():d}remove(){Je(52)}replace(d){Je(53)}insertBefore(d){Je(54)}insertAfter(d){Je(55)}updateDOM(d,g){return!1}append(...d){for(let g=0;g<d.length;g++){const t=d[g];ge(t)||Tn(t)||Je(56)}return super.append(...d)}static importJSON(d){const g=Ln();return g.setFormat(d.format),g.setIndent(d.indent),g.setDirection(d.direction),g}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function vr(y){return y instanceof us}function Sf(){return new tu(new Map([["root",new us]]))}function Wg(y){const d=y.exportJSON(),g=y.constructor;if(d.type!==g.getType()&&Je(130,g.name),ge(y)){const t=d.children;Array.isArray(t)||Je(59,g.name);const f=y.getChildren();for(let r=0;r<f.length;r++){const n=Wg(f[r]);t.push(n)}}return d}class tu{constructor(d,g){this._nodeMap=d,this._selection=g||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(d){return Ug(this,d)}clone(d){const g=new tu(this._nodeMap,d===void 0?this._selection:d);return g._readOnly=!0,g}toJSON(){return Ug(this,()=>({root:Wg(Ln())}))}}class Cf extends jo{static getType(){return"artificial"}createDOM(d){return document.createElement("div")}}class ba extends jo{constructor(d){super(d),this.__textFormat=0}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(d){const g=this.getWritable();return g.__textFormat=d,g}hasTextFormat(d){const g=Go[d];return!!(this.getTextFormat()&g)}static clone(d){return new ba(d.__key)}createDOM(d){const g=document.createElement("p"),t=xl(d.theme,"paragraph");return t!==void 0&&g.classList.add(...t),g}updateDOM(d,g,t){return!1}static importDOM(){return{p:d=>({conversion:a1,priority:0})}}exportDOM(d){const{element:g}=super.exportDOM(d);if(g&&Sl(g)){this.isEmpty()&&g.append(document.createElement("br"));const t=this.getFormatType();g.style.textAlign=t;const f=this.getDirection();f&&(g.dir=f);const r=this.getIndent();r>0&&(g.style.textIndent=20*r+"px")}return{element:g}}static importJSON(d){const g=Un();return g.setFormat(d.format),g.setIndent(d.indent),g.setDirection(d.direction),g.setTextFormat(d.textFormat),g}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),type:"paragraph",version:1}}insertNewAfter(d,g){const t=Un();t.setTextFormat(d.format);const f=this.getDirection();return t.setDirection(f),t.setFormat(this.getFormatType()),this.insertAfter(t,g),t}collapseAtStart(){const d=this.getChildren();if(d.length===0||Ne(d[0])&&d[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function a1(y){const d=Un();if(y.style){d.setFormat(y.style.textAlign);const g=parseInt(y.style.textIndent,10)/20;g>0&&d.setIndent(g)}return{node:d}}function Un(){return Yo(new ba)}function va(y){return y instanceof ba}const an=0,ds=3,to=4;function Kg(y,d,g,t){const f=y._keyToDOMMap;f.clear(),y._editorState=Sf(),y._pendingEditorState=t,y._compositionKey=null,y._dirtyType=ua,y._cloneNotNeeded.clear(),y._dirtyLeaves=new Set,y._dirtyElements.clear(),y._normalizedNodes=new Set,y._updateTags=new Set,y._updates=[],y._blockCursorElement=null;const r=y._observer;r!==null&&(r.disconnect(),y._observer=null),d!==null&&(d.textContent=""),g!==null&&(g.textContent="",f.set("root",g))}function Gg(y){const d=y||{},g=o1(),t=d.theme||{},f=y===void 0?g:d.parentEditor||null,r=d.disableEvents||!1,n=Sf(),e=d.namespace||(f!==null?f._config.namespace:Vh()),s=d.editorState,i=[us,ga,ss,Al,ba,Cf,...d.nodes||[]],{onError:l,html:o}=d,a=d.editable===void 0||d.editable;let c;if(y===void 0&&g!==null)c=g._nodes;else{c=new Map;for(let h=0;h<i.length;h++){let p=i[h],m=null,b=null;if(typeof p!="function"){const x=p;p=x.replace,m=x.with,b=x.withKlass||null}const _=p.getType(),v=p.transform(),w=new Set;v!==null&&w.add(v),c.set(_,{exportDOM:o&&o.export?o.export.get(p):void 0,klass:p,replace:m,replaceWithKlass:b,transforms:w})}}const u=new s1(n,f,c,{disableEvents:r,namespace:e,theme:t},l||console.error,function(h,p){const m=new Map,b=new Set,_=v=>{Object.keys(v).forEach(w=>{let x=m.get(w);x===void 0&&(x=[],m.set(w,x)),x.push(v[w])})};return h.forEach(v=>{const w=v.klass.importDOM;if(w==null||b.has(w))return;b.add(w);const x=w.call(v.klass);x!==null&&_(x)}),p&&_(p),m}(c,o?o.import:void 0),a);return s!==void 0&&(u._pendingEditorState=s,u._dirtyType=es),u}class s1{constructor(d,g,t,f,r,n,e){this._parentEditor=g,this._rootElement=null,this._editorState=d,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=f,this._nodes=t,this._decorators={},this._pendingDecorators=null,this._dirtyType=ua,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Vh(),this._onError=r,this._htmlConversions=n,this._editable=e,this._headless=g!==null&&g._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(d){const g=this._listeners.update;return g.add(d),()=>{g.delete(d)}}registerEditableListener(d){const g=this._listeners.editable;return g.add(d),()=>{g.delete(d)}}registerDecoratorListener(d){const g=this._listeners.decorator;return g.add(d),()=>{g.delete(d)}}registerTextContentListener(d){const g=this._listeners.textcontent;return g.add(d),()=>{g.delete(d)}}registerRootListener(d){const g=this._listeners.root;return d(this._rootElement,null),g.add(d),()=>{d(null,this._rootElement),g.delete(d)}}registerCommand(d,g,t){t===void 0&&Je(35);const f=this._commands;f.has(d)||f.set(d,[new Set,new Set,new Set,new Set,new Set]);const r=f.get(d);r===void 0&&Je(36,String(d));const n=r[t];return n.add(g),()=>{n.delete(g),r.every(e=>e.size===0)&&f.delete(d)}}registerMutationListener(d,g){let t=this._nodes.get(d.getType());t===void 0&&Je(37,d.name);let f=d,r=null;for(;r=t.replaceWithKlass;)f=r,t=this._nodes.get(r.getType()),t===void 0&&Je(37,r.name);const n=this._listeners.mutation;return n.set(g,f),()=>{n.delete(g)}}registerNodeTransformToKlass(d,g){const t=d.getType(),f=this._nodes.get(t);return f===void 0&&Je(37,d.name),f.transforms.add(g),f}registerNodeTransform(d,g){const t=this.registerNodeTransformToKlass(d,g),f=[t],r=t.replaceWithKlass;if(r!=null){const s=this.registerNodeTransformToKlass(r,g);f.push(s)}var n,e;return n=this,e=d.getType(),Hr(n,()=>{const s=To();if(s.isEmpty())return;if(e==="root")return void Ln().markDirty();const i=s._nodeMap;for(const[,l]of i)l.markDirty()},n._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{f.forEach(s=>s.transforms.delete(g))}}hasNode(d){return this._nodes.has(d.getType())}hasNodes(d){return d.every(this.hasNode.bind(this))}dispatchCommand(d,g){return Ke(this,d,g)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(d){const g=this._rootElement;if(d!==g){const t=xl(this._config.theme,"root"),f=this._pendingEditorState||this._editorState;if(this._rootElement=d,Kg(this,g,d,f),g!==null&&(this._config.disableEvents||Jv(g),t!=null&&g.classList.remove(...t)),d!==null){const r=function(e){const s=e.ownerDocument;return s&&s.defaultView||null}(d),n=d.style;n.userSelect="text",n.whiteSpace="pre-wrap",n.wordBreak="break-word",d.setAttribute("data-lexical-editor","true"),this._window=r,this._dirtyType=es,Ih(this),this._updateTags.add("history-merge"),ya(this),this._config.disableEvents||function(e,s){const i=e.ownerDocument,l=Vc.get(i);(l===void 0||l<1)&&i.addEventListener("selectionchange",bg),Vc.set(i,(l||0)+1),e.__lexicalEditor=s;const o=yg(e);for(let a=0;a<sf.length;a++){const[c,u]=sf[a],h=typeof u=="function"?p=>{_g(p)||(vg(p),(s.isEditable()||c==="click")&&u(p,s))}:p=>{if(_g(p))return;vg(p);const m=s.isEditable();switch(c){case"cut":return m&&Ke(s,gl,p);case"copy":return Ke(s,hl,p);case"paste":return m&&Ke(s,ll,p);case"dragstart":return m&&Ke(s,kd,p);case"dragover":return m&&Ke(s,Ch,p);case"dragend":return m&&Ke(s,sv,p);case"focus":return m&&Ke(s,Eh,p);case"blur":return m&&Ke(s,cv,p);case"drop":return m&&Ke(s,Ed,p)}};e.addEventListener(c,h),o.push(()=>{e.removeEventListener(c,h)})}}(d,this),t!=null&&d.classList.add(...t)}else this._editorState=f,this._pendingEditorState=null,this._window=null;Nl("root",this,!1,d,g)}}getElementByKey(d){return this._keyToDOMMap.get(d)||null}getEditorState(){return this._editorState}setEditorState(d,g){d.isEmpty()&&Je(38),Nh(this);const t=this._pendingEditorState,f=this._updateTags,r=g!==void 0?g.tag:null;t===null||t.isEmpty()||(r!=null&&f.add(r),ya(this)),this._pendingEditorState=d,this._dirtyType=es,this._dirtyElements.set("root",!1),this._compositionKey=null,r!=null&&f.add(r),ya(this)}parseEditorState(d,g){return function(t,f,r){const n=Sf(),e=ur,s=Dr,i=dr,l=f._dirtyElements,o=f._dirtyLeaves,a=f._cloneNotNeeded,c=f._dirtyType;f._dirtyElements=new Map,f._dirtyLeaves=new Set,f._cloneNotNeeded=new Set,f._dirtyType=0,ur=n,Dr=!1,dr=f;try{const u=f._nodes;wf(t.root,u),r&&r(),n._readOnly=!0}catch(u){u instanceof Error&&f._onError(u)}finally{f._dirtyElements=l,f._dirtyLeaves=o,f._cloneNotNeeded=a,f._dirtyType=c,ur=e,Dr=s,dr=i}return n}(typeof d=="string"?JSON.parse(d):d,this,g)}update(d,g){Hr(this,d,g)}focus(d,g={}){const t=this._rootElement;t!==null&&(t.setAttribute("autocapitalize","off"),Hr(this,()=>{const f=Oe(),r=Ln();f!==null?f.dirty=!0:r.getChildrenSize()!==0&&(g.defaultSelection==="rootStart"?r.selectStart():r.selectEnd())},{onUpdate:()=>{t.removeAttribute("autocapitalize"),d&&d()},tag:"focus"}),this._pendingEditorState===null&&t.removeAttribute("autocapitalize"))}blur(){const d=this._rootElement;d!==null&&d.blur();const g=Oo(this._window);g!==null&&g.removeAllRanges()}isEditable(){return this._editable}setEditable(d){this._editable!==d&&(this._editable=d,Nl("editable",this,!0,d))}toJSON(){return{editorState:this._editorState.toJSON()}}}const kC="";function l1(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var c1=l1(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Ef=Ce.createContext(null);function u1(y,d){let g=null;return y!=null&&(g=y[1]),{getTheme:function(){return d??(g!=null?g.getTheme():null)}}}function jr(){const y=Ce.useContext(Ef);return y==null&&c1(8),y}const Yg=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,d1=Yg?Ce.useLayoutEffect:Ce.useEffect,eu={tag:"history-merge"};function Zg({initialConfig:y,children:d}){const g=Ce.useMemo(()=>{const{theme:t,namespace:f,editor__DEPRECATED:r,nodes:n,onError:e,editorState:s,html:i}=y,l=u1(null,t);let o=r||null;if(o===null){const a=Gg({editable:y.editable,html:i,namespace:f,nodes:n,onError:c=>e(c,a),theme:t});(function(c,u){if(u!==null){if(u===void 0)c.update(()=>{const h=Ln();if(h.isEmpty()){const p=Un();h.append(p);const m=Yg?document.activeElement:null;(Oe()!==null||m!==null&&m===c.getRootElement())&&p.select()}},eu);else if(u!==null)switch(typeof u){case"string":{const h=c.parseEditorState(u);c.setEditorState(h,eu);break}case"object":c.setEditorState(u,eu);break;case"function":c.update(()=>{Ln().isEmpty()&&u(c)},eu)}}})(a,s),o=a}return[o,l]},[]);return d1(()=>{const t=y.editable,[f]=g;f.setEditable(t===void 0||t)},[]),he.jsx(Ef.Provider,{value:g,children:d})}function Qg({defaultSelection:y}){const[d]=jr();return Ce.useEffect(()=>{d.focus(()=>{const g=document.activeElement,t=d.getRootElement();t===null||g!==null&&t.contains(g)||t.focus({preventScroll:!0})},{defaultSelection:y})},[y,d]),null}const f1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ce.useLayoutEffect:Ce.useEffect;function Xg({ariaActiveDescendant:y,ariaAutoComplete:d,ariaControls:g,ariaDescribedBy:t,ariaExpanded:f,ariaLabel:r,ariaLabelledBy:n,ariaMultiline:e,ariaOwns:s,ariaRequired:i,autoCapitalize:l,className:o,id:a,role:c="textbox",spellCheck:u=!0,style:h,tabIndex:p,"data-testid":m,...b}){const[_]=jr(),[v,w]=Ce.useState(!1),x=Ce.useCallback(S=>{S&&S.ownerDocument&&S.ownerDocument.defaultView&&_.setRootElement(S)},[_]);return f1(()=>(w(_.isEditable()),_.registerEditableListener(S=>{w(S)})),[_]),he.jsx("div",{...b,"aria-activedescendant":v?y:void 0,"aria-autocomplete":v?d:"none","aria-controls":v?g:void 0,"aria-describedby":t,"aria-expanded":v&&c==="combobox"?!!f:void 0,"aria-label":r,"aria-labelledby":n,"aria-multiline":e,"aria-owns":v?s:void 0,"aria-readonly":!v||void 0,"aria-required":i,autoCapitalize:l,className:o,contentEditable:v,"data-testid":m,id:a,ref:x,role:c,spellCheck:u,style:h,tabIndex:p})}function p1(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}p1(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const nu=new Map;function tm(y){let d=y;for(;d!=null;){if(d.nodeType===Node.TEXT_NODE)return d;d=d.firstChild}return null}function em(y){const d=y.parentNode;if(d==null)throw new Error("Should never happen");return[d,Array.from(d.childNodes).indexOf(y)]}function h1(y,d,g,t,f){const r=d.getKey(),n=t.getKey(),e=document.createRange();let s=y.getElementByKey(r),i=y.getElementByKey(n),l=g,o=f;if(Ne(d)&&(s=tm(s)),Ne(t)&&(i=tm(i)),d===void 0||t===void 0||s===null||i===null)return null;s.nodeName==="BR"&&([s,l]=em(s)),i.nodeName==="BR"&&([i,o]=em(i));const a=s.firstChild;s===i&&a!=null&&a.nodeName==="BR"&&l===0&&o===0&&(o=1);try{e.setStart(s,l),e.setEnd(i,o)}catch{return null}return!e.collapsed||l===o&&r===n||(e.setStart(i,o),e.setEnd(s,l)),e}function g1(y,d){const g=y.getRootElement();if(g===null)return[];const t=g.getBoundingClientRect(),f=getComputedStyle(g),r=parseFloat(f.paddingLeft)+parseFloat(f.paddingRight),n=Array.from(d.getClientRects());let e,s=n.length;n.sort((i,l)=>{const o=i.top-l.top;return Math.abs(o)<=3?i.left-l.left:o});for(let i=0;i<s;i++){const l=n[i],o=e&&e.top<=l.top&&e.top+e.height>l.top&&e.left+e.width>l.left,a=l.width+r===t.width;o||a?(n.splice(i--,1),s--):e=l}return n}function nm(y){const d={},g=y.split(";");for(const t of g)if(t!==""){const[f,r]=t.split(/:([^]+)/);f&&r&&(d[f.trim()]=r.trim())}return d}function kf(y){let d=nu.get(y);return d===void 0&&(d=nm(y),nu.set(y,d)),d}function rm(y){const d=y.constructor.clone(y);return d.__parent=y.__parent,d.__next=y.__next,d.__prev=y.__prev,ge(y)&&ge(d)?(t=y,(g=d).__first=t.__first,g.__last=t.__last,g.__size=t.__size,g.__format=t.__format,g.__indent=t.__indent,g.__dir=t.__dir,g):Ne(y)&&Ne(d)?function(f,r){return f.__format=r.__format,f.__style=r.__style,f.__mode=r.__mode,f.__detail=r.__detail,f}(d,y):va(y)&&va(d)?function(f,r){return f.__textFormat=r.__textFormat,f}(d,y):d;var g,t}function om(y,d){const g=y.getStartEndPoints();if(d.isSelected(y)&&!d.isSegmented()&&!d.isToken()&&g!==null){const[t,f]=g,r=y.isBackward(),n=t.getNode(),e=f.getNode(),s=d.is(n),i=d.is(e);if(s||i){const[l,o]=mf(y),a=n.is(e),c=d.is(r?e:n),u=d.is(r?n:e);let h,p=0;return a?(p=l>o?o:l,h=l>o?l:o):c?(p=r?o:l,h=void 0):u&&(p=0,h=r?l:o),d.__text=d.__text.slice(p,h),d}}return d}function m1(y){const d=y.getStyle(),g=nm(d);nu.set(d,g)}function fs(y,d){const g=kf("getStyle"in y?y.getStyle():y.style),t=Object.entries(d).reduce((r,[n,e])=>(e instanceof Function?r[n]=e(g[n]):e===null?delete r[n]:r[n]=e,r),{...g}),f=function(r){let n="";for(const e in r)e&&(n+=`${e}: ${r[e]};`);return n}(t);y.setStyle(f),nu.set(f,t)}function im(y,d){const g=y.getNodes(),t=g.length,f=y.getStartEndPoints();if(f===null)return;const[r,n]=f,e=t-1;let s=g[0],i=g[e];if(y.isCollapsed()&&xe(y))return void fs(y,d);const l=s.getTextContent().length,o=n.offset;let a=r.offset;const c=r.isBefore(n);let u=c?a:o,h=c?o:a;const p=c?r.type:n.type,m=c?n.type:r.type,b=c?n.key:r.key;if(Ne(s)&&u===l){const _=s.getNextSibling();Ne(_)&&(a=0,u=0,s=_)}if(g.length===1){if(Ne(s)&&s.canHaveFormat()){if(u=p==="element"?0:a>o?o:a,h=m==="element"?l:a>o?a:o,u===h)return;if(u===0&&h===l)fs(s,d),s.select(u,h);else{const _=s.splitText(u,h),v=u===0?_[0]:_[1];fs(v,d),v.select(0,h-u)}}}else{if(Ne(s)&&u<s.getTextContentSize()&&s.canHaveFormat()&&(u!==0&&(s=s.splitText(u)[1],u=0,c?r.set(s.getKey(),u,"text"):n.set(s.getKey(),u,"text")),fs(s,d)),Ne(i)&&i.canHaveFormat()){const _=i.getTextContent().length;i.__key!==b&&h!==0&&(h=_),h!==_&&([i]=i.splitText(h)),h===0&&m!=="element"||fs(i,d)}for(let _=1;_<e;_++){const v=g[_],w=v.getKey();Ne(v)&&v.canHaveFormat()&&w!==s.getKey()&&w!==i.getKey()&&!v.isToken()&&fs(v,d)}}}function ru(y,d){const g=wl(y.focus,d);return Tn(g)&&!g.isIsolated()||ge(g)&&!g.isInline()&&!g.canBeEmpty()}function y1(y,d,g,t){y.modify(d?"extend":"move",g,t)}function b1(y){const d=y.anchor.getNode();return(vr(d)?d:d.getParentOrThrow()).getDirection()==="rtl"}function ou(y,d,g){const t=b1(y);y1(y,d,g?!t:t,"character")}function v1(y,d,g){const t=kf(y.getStyle());return t!==null&&t[d]||g}function am(y,d,g=""){let t=null;const f=y.getNodes(),r=y.anchor,n=y.focus,e=y.isBackward(),s=e?n.offset:r.offset,i=e?n.getNode():r.getNode();if(xe(y)&&y.isCollapsed()&&y.style!==""){const l=kf(y.style);if(l!==null&&d in l)return l[d]}for(let l=0;l<f.length;l++){const o=f[l];if((l===0||s!==0||!o.is(i))&&Ne(o)){const a=v1(o,d,g);if(t===null)t=a;else if(t!==a){t="";break}}}return t===null?g:t}function _1(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var x1=_1(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const sm=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,w1=sm&&"documentMode"in document?document.documentMode:null;!(!sm||!("InputEvent"in window)||w1)&&"getTargetRanges"in new window.InputEvent("input");function lm(...y){const d=[];for(const g of y)if(g&&typeof g=="string")for(const[t]of g.matchAll(/\S+/g))d.push(t);return d}function mo(...y){return()=>{for(let d=y.length-1;d>=0;d--)y[d]();y.length=0}}function Ni(y,...d){const g=lm(...d);g.length>0&&y.classList.add(...g)}function cm(y,...d){const g=lm(...d);g.length>0&&y.classList.remove(...g)}function S1(y){const d=vn(y,g=>ge(g)&&!g.isInline());return ge(d)||x1(4,y.__key),d}const vn=(y,d)=>{let g=y;for(;g!==Ln()&&g!=null;){if(d(g))return g;g=g.getParent()}return null};function C1(y,d,g,t){const f=r=>r instanceof d;return y.registerNodeTransform(d,r=>{const n=(e=>{const s=e.getChildren();for(let o=0;o<s.length;o++){const a=s[o];if(f(a))return null}let i=e,l=e;for(;i!==null;)if(l=i,i=i.getParent(),f(i))return{child:l,parent:i};return null})(r);if(n!==null){const{child:e,parent:s}=n;if(e.is(r)){t(s,r);const i=e.getNextSiblings(),l=i.length;if(s.insertAfter(e),l!==0){const o=g(s);e.insertAfter(o);for(let a=0;a<l;a++)o.append(i[a])}s.canBeEmpty()||s.getChildrenSize()!==0||s.remove()}}})}function um(y){const d=Oe()||ma();if(xe(d)){const{focus:g}=d,t=g.getNode(),f=g.offset;if(ko(t)){const r=t.getChildAtIndex(f);r==null?t.append(y):r.insertBefore(y),y.selectNext()}else{let r,n;Ne(t)?(r=t.getParentOrThrow(),n=t.getIndexWithinParent(),f>0&&(n+=1,t.splitText(f))):(r=t,n=f);const[,e]=Bv(r,n);e.insertBefore(y),e.selectStart()}}else{if(d!=null){const t=d.getNodes();t[t.length-1].getTopLevelElementOrThrow().insertAfter(y)}else Ln().append(y);const g=Un();y.insertAfter(g),g.select()}return y.getLatest()}function Ii(y,d){return y!==null&&Object.getPrototypeOf(y).constructor.name===d.name}function dm(y,d){const g=y.getFirstChild();g!==null?g.insertBefore(d):y.append(d)}const iu=0,Of=1,Tf=2,yo=0,E1=1,fm=2,k1=3,O1=4;function T1(y,d,g,t,f){if(y===null||g.size===0&&t.size===0&&!f)return yo;const r=d._selection,n=y._selection;if(f)return E1;if(!(xe(r)&&xe(n)&&n.isCollapsed()&&r.isCollapsed()))return yo;const e=function(m,b,_){const v=m._nodeMap,w=[];for(const x of b){const S=v.get(x);S!==void 0&&w.push(S)}for(const[x,S]of _){if(!S)continue;const E=v.get(x);E===void 0||vr(E)||w.push(E)}return w}(d,g,t);if(e.length===0)return yo;if(e.length>1){const m=d._nodeMap,b=m.get(r.anchor.key),_=m.get(n.anchor.key);return b&&_&&!y._nodeMap.has(b.__key)&&Ne(b)&&b.__text.length===1&&r.anchor.offset===1?fm:yo}const s=e[0],i=y._nodeMap.get(s.__key);if(!Ne(i)||!Ne(s)||i.__mode!==s.__mode)return yo;const l=i.__text,o=s.__text;if(l===o)return yo;const a=r.anchor,c=n.anchor;if(a.key!==c.key||a.type!=="text")return yo;const u=a.offset,h=c.offset,p=o.length-l.length;return p===1&&h===u-1?fm:p===-1&&h===u+1?k1:p===-1&&h===u?O1:yo}function j1(y,d){let g=Date.now(),t=yo;return(f,r,n,e,s,i)=>{const l=Date.now();if(i.has("historic"))return t=yo,g=l,Tf;const o=T1(f,r,e,s,y.isComposing()),a=(()=>{const c=n===null||n.editor===y,u=i.has("history-push");if(!u&&c&&i.has("history-merge"))return iu;if(f===null)return Of;const h=r._selection;return e.size>0||s.size>0?u===!1&&o!==yo&&o===t&&l<g+d&&c||e.size===1&&function(p,m,b){const _=m._nodeMap.get(p),v=b._nodeMap.get(p),w=m._selection,x=b._selection;let S=!1;return xe(w)&&xe(x)&&(S=w.anchor.type==="element"&&w.focus.type==="element"&&x.anchor.type==="text"&&x.focus.type==="text"),!(S||!Ne(_)||!Ne(v))&&_.__type===v.__type&&_.__text===v.__text&&_.__mode===v.__mode&&_.__detail===v.__detail&&_.__style===v.__style&&_.__format===v.__format&&_.__parent===v.__parent}(Array.from(e)[0],f,r)?iu:Of:h!==null?iu:Tf})();return g=l,t=o,a}}function pm(y){y.undoStack=[],y.redoStack=[],y.current=null}function A1(y,d,g){const t=j1(y,g);return mo(y.registerCommand(cl,()=>(function(r,n){const e=n.redoStack,s=n.undoStack;if(s.length!==0){const i=n.current,l=s.pop();i!==null&&(e.push(i),r.dispatchCommand(Xa,!0)),s.length===0&&r.dispatchCommand(ts,!1),n.current=l||null,l&&l.editor.setEditorState(l.editorState,{tag:"historic"})}}(y,d),!0),an),y.registerCommand(ul,()=>(function(r,n){const e=n.redoStack,s=n.undoStack;if(e.length!==0){const i=n.current;i!==null&&(s.push(i),r.dispatchCommand(ts,!0));const l=e.pop();e.length===0&&r.dispatchCommand(Xa,!1),n.current=l||null,l&&l.editor.setEditorState(l.editorState,{tag:"historic"})}}(y,d),!0),an),y.registerCommand(Od,()=>(pm(d),!1),an),y.registerCommand(lv,()=>(pm(d),y.dispatchCommand(Xa,!1),y.dispatchCommand(ts,!1),!0),an),y.registerUpdateListener(({editorState:r,prevEditorState:n,dirtyLeaves:e,dirtyElements:s,tags:i})=>{const l=d.current,o=d.redoStack,a=d.undoStack,c=l===null?null:l.editorState;if(l!==null&&r===c)return;const u=t(n,r,l,e,s,i);if(u===Of)o.length!==0&&(d.redoStack=[],y.dispatchCommand(Xa,!1)),l!==null&&(a.push({...l}),y.dispatchCommand(ts,!0));else if(u===Tf)return;d.current={editor:y,editorState:r}}))}function P1(){return{current:null,redoStack:[],undoStack:[]}}function hm({externalHistoryState:y}){const[d]=jr();return function(g,t,f=1e3){const r=Ce.useMemo(()=>t||P1(),[t]);Ce.useEffect(()=>A1(g,r,f),[f,g,r])}(d,y),null}const N1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ce.useLayoutEffect:Ce.useEffect;function I1(y){return{initialValueFn:()=>y.isEditable(),subscribe:d=>y.registerEditableListener(d)}}function au(){return function(y){const[d]=jr(),g=Ce.useMemo(()=>y(d),[d,y]),t=Ce.useRef(g.initialValueFn()),[f,r]=Ce.useState(t.current);return N1(()=>{const{initialValueFn:n,subscribe:e}=g,s=n();return t.current!==s&&(t.current=s,r(s)),e(i=>{t.current=i,r(i)})},[g,y]),f}(I1)}function gm(){return Ln().getTextContent()}function mm(y,d=!0){if(y)return!1;let g=gm();return d&&(g=g.trim()),g===""}function R1(y){if(!mm(y,!1))return!1;const d=Ln().getChildren(),g=d.length;if(g>1)return!1;for(let t=0;t<g;t++){const f=d[t];if(Tn(f))return!1;if(ge(f)){if(!va(f)||f.__indent!==0)return!1;const r=f.getChildren(),n=r.length;for(let e=0;e<n;e++){const s=r[t];if(!Ne(s))return!1}}}return!0}function ym(y){return()=>R1(y)}function M1(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}M1(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function bm(y){const d=window.location.origin,g=t=>{if(t.origin!==d)return;const f=y.getRootElement();if(document.activeElement!==f)return;const r=t.data;if(typeof r=="string"){let n;try{n=JSON.parse(r)}catch{return}if(n&&n.protocol==="nuanria_messaging"&&n.type==="request"){const e=n.payload;if(e&&e.functionId==="makeChanges"){const s=e.args;if(s){const[i,l,o,a,c,u]=s;y.update(()=>{const h=Oe();if(xe(h)){const p=h.anchor;let m=p.getNode(),b=0,_=0;if(Ne(m)&&i>=0&&l>=0&&(b=i,_=i+l,h.setTextNodeRange(m,b,m,_)),b===_&&o===""||(h.insertRawText(o),m=p.getNode()),Ne(m)){b=a,_=a+c;const v=m.getTextContentSize();b=b>v?v:b,_=_>v?v:_,h.setTextNodeRange(m,b,m,_)}t.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",g,!0),()=>{window.removeEventListener("message",g,!0)}}function D1(y,d){const g=d.body?d.body.childNodes:[];let t=[];const f=[];for(let r=0;r<g.length;r++){const n=g[r];if(!_m.has(n.nodeName)){const e=xm(n,y,f,!1);e!==null&&(t=t.concat(e))}}return function(r){for(const n of r)n.getNextSibling()instanceof Cf&&n.insertAfter(ls());for(const n of r){const e=n.getChildren();for(const s of e)n.insertBefore(s);n.remove()}}(f),t}function L1(y,d){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const g=document.createElement("div"),t=Ln().getChildren();for(let f=0;f<t.length;f++)vm(y,t[f],g,d);return g.innerHTML}function vm(y,d,g,t=null){let f=t===null||d.isSelected(t);const r=ge(d)&&d.excludeFromCopy("html");let n=d;if(t!==null){let c=rm(d);c=Ne(c)&&t!==null?om(t,c):c,n=c}const e=ge(n)?n.getChildren():[],s=y._nodes.get(n.getType());let i;i=s&&s.exportDOM!==void 0?s.exportDOM(y,n):n.exportDOM(y);const{element:l,after:o}=i;if(!l)return!1;const a=document.createDocumentFragment();for(let c=0;c<e.length;c++){const u=e[c],h=vm(y,u,a,t);!f&&ge(d)&&h&&d.extractWithChild(u,t,"html")&&(f=!0)}if(f&&!r){if(Sl(l)&&l.append(a),g.append(l),o){const c=o.call(n,l);c&&l.replaceWith(c)}}else g.append(a);return f}const _m=new Set(["STYLE","SCRIPT"]);function xm(y,d,g,t,f=new Map,r){let n=[];if(_m.has(y.nodeName))return n;let e=null;const s=function(u,h){const{nodeName:p}=u,m=h._htmlConversions.get(p.toLowerCase());let b=null;if(m!==void 0)for(const _ of m){const v=_(u);v!==null&&(b===null||(b.priority||0)<(v.priority||0))&&(b=v)}return b!==null?b.conversion:null}(y,d),i=s?s(y):null;let l=null;if(i!==null){l=i.after;const u=i.node;if(e=Array.isArray(u)?u[u.length-1]:u,e!==null){for(const[,h]of f)if(e=h(e,r),!e)break;e&&n.push(...Array.isArray(u)?u:[e])}i.forChild!=null&&f.set(y.nodeName,i.forChild)}const o=y.childNodes;let a=[];const c=(e==null||!ko(e))&&(e!=null&&yf(e)||t);for(let u=0;u<o.length;u++)a.push(...xm(o[u],d,g,c,new Map(f),e));return l!=null&&(a=l(a)),Uv(y)&&(a=B1(y,a,c?()=>{const u=new Cf;return g.push(u),u}:Un)),e==null?n=n.concat(a):ge(e)&&e.append(...a),n}function B1(y,d,g){const t=y.style.textAlign,f=[];let r=[];for(let n=0;n<d.length;n++){const e=d[n];if(yf(e))t&&!e.getFormat()&&e.setFormat(t),f.push(e);else if(r.push(e),n===d.length-1||n<d.length-1&&yf(d[n+1])){const s=g();s.setFormat(t),s.append(...r),f.push(s),r=[]}}return f}function F1(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var su=F1(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const z1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,wm=y=>z1?(y||window).getSelection():null;function Sm(y){const d=Oe();return d==null&&su(166),xe(d)&&d.isCollapsed()||d.getNodes().length===0?"":L1(y,d)}function U1(y){const d=Oe();return d==null&&su(166),xe(d)&&d.isCollapsed()||d.getNodes().length===0?null:JSON.stringify($1(y,d))}function Cm(y,d){const g=y.getData("text/plain")||y.getData("text/uri-list");g!=null&&d.insertRawText(g)}function Em(y,d,g){const t=y.getData("application/x-lexical-editor");if(t)try{const n=JSON.parse(t);if(n.namespace===g._config.namespace&&Array.isArray(n.nodes))return km(g,H1(n.nodes),d)}catch{}const f=y.getData("text/html");if(f)try{const n=new DOMParser().parseFromString(f,"text/html");return km(g,D1(g,n),d)}catch{}const r=y.getData("text/plain")||y.getData("text/uri-list");if(r!=null)if(xe(d)){const n=r.split(/(\r?\n|\t)/);n[n.length-1]===""&&n.pop();for(let e=0;e<n.length;e++){const s=Oe();if(xe(s)){const i=n[e];i===`
|
|
39
|
+
`?t.push(ls()):n===" "?t.push(Pl()):t.push(ar(n))}this.insertNodes(t)}insertText(d){const g=this.anchor,t=this.focus,f=this.format,r=this.style;let n=g,e=t;!this.isCollapsed()&&t.isBefore(g)&&(n=t,e=g),n.type==="element"&&function(p,m,b,_){const v=p.getNode(),w=v.getChildAtIndex(p.offset),x=ar(),S=vr(v)?Un().append(x):x;x.setFormat(b),x.setStyle(_),w===null?v.append(S):w.insertBefore(S),p.is(m)&&m.set(x.__key,0,"text"),p.set(x.__key,0,"text")}(n,e,f,r);const s=n.offset;let i=e.offset;const l=this.getNodes(),o=l.length;let a=l[0];Ne(a)||Je(26);const c=a.getTextContent().length,u=a.getParentOrThrow();let h=l[o-1];if(o===1&&e.type==="element"&&(i=c,e.set(n.key,i,"text")),this.isCollapsed()&&s===c&&(a.isSegmented()||a.isToken()||!a.canInsertTextAfter()||!u.canInsertTextAfter()&&a.getNextSibling()===null)){let p=a.getNextSibling();if(Ne(p)&&p.canInsertTextBefore()&&!ns(p)||(p=ar(),p.setFormat(f),p.setStyle(r),u.canInsertTextAfter()?a.insertAfter(p):u.insertAfter(p)),p.select(0,0),a=p,d!=="")return void this.insertText(d)}else if(this.isCollapsed()&&s===0&&(a.isSegmented()||a.isToken()||!a.canInsertTextBefore()||!u.canInsertTextBefore()&&a.getPreviousSibling()===null)){let p=a.getPreviousSibling();if(Ne(p)&&!ns(p)||(p=ar(),p.setFormat(f),u.canInsertTextBefore()?a.insertBefore(p):u.insertBefore(p)),p.select(),a=p,d!=="")return void this.insertText(d)}else if(a.isSegmented()&&s!==c){const p=ar(a.getTextContent());p.setFormat(f),a.replace(p),a=p}else if(!this.isCollapsed()&&d!==""){const p=h.getParent();if(!u.canInsertTextBefore()||!u.canInsertTextAfter()||ge(p)&&(!p.canInsertTextBefore()||!p.canInsertTextAfter()))return this.insertText(""),Pg(this.anchor,this.focus,null),void this.insertText(d)}if(o===1){if(a.isToken()){const _=ar(d);return _.select(),void a.replace(_)}const p=a.getFormat(),m=a.getStyle();if(s!==i||p===f&&m===r){if(Yv(a)){const _=ar(d);return _.setFormat(f),_.setStyle(r),_.select(),void a.replace(_)}}else{if(a.getTextContent()!==""){const _=ar(d);if(_.setFormat(f),_.setStyle(r),_.select(),s===0)a.insertBefore(_,!1);else{const[v]=a.splitText(s);v.insertAfter(_,!1)}return void(_.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=d.length))}a.setFormat(f),a.setStyle(r)}const b=i-s;a=a.spliceText(s,b,d,!0),a.getTextContent()===""?a.remove():this.anchor.type==="text"&&(a.isComposing()?this.anchor.offset-=d.length:(this.format=p,this.style=m))}else{const p=new Set([...a.getParentKeys(),...h.getParentKeys()]),m=ge(a)?a:a.getParentOrThrow();let b=ge(h)?h:h.getParentOrThrow(),_=h;if(!m.is(b)&&b.isInline())do _=b,b=b.getParentOrThrow();while(b.isInline());if(e.type==="text"&&(i!==0||h.getTextContent()==="")||e.type==="element"&&h.getIndexWithinParent()<i)if(Ne(h)&&!h.isToken()&&i!==h.getTextContentSize()){if(h.isSegmented()){const E=ar(h.getTextContent());h.replace(E),h=E}vr(e.getNode())||e.type!=="text"||(h=h.spliceText(0,i,"")),p.add(h.__key)}else{const E=h.getParentOrThrow();E.canBeEmpty()||E.getChildrenSize()!==1?h.remove():E.remove()}else p.add(h.__key);const v=b.getChildren(),w=new Set(l),x=m.is(b),S=m.isInline()&&a.getNextSibling()===null?m:a;for(let E=v.length-1;E>=0;E--){const k=v[E];if(k.is(a)||ge(k)&&k.isParentOf(a))break;k.isAttached()&&(!w.has(k)||k.is(_)?x||S.insertAfter(k,!1):k.remove())}if(!x){let E=b,k=null;for(;E!==null;){const D=E.getChildren(),P=D.length;(P===0||D[P-1].is(k))&&(p.delete(E.__key),k=E),E=E.getParent()}}if(a.isToken())if(s===c)a.select();else{const E=ar(d);E.select(),a.replace(E)}else a=a.spliceText(s,c-s,d,!0),a.getTextContent()===""?a.remove():a.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=d.length);for(let E=1;E<o;E++){const k=l[E],D=k.__key;p.has(D)||k.remove()}}}removeText(){this.insertText("")}formatText(d){if(this.isCollapsed())return this.toggleFormat(d),void hr(null);const g=this.getNodes(),t=[];for(const b of g)Ne(b)&&t.push(b);const f=t.length;if(f===0)return this.toggleFormat(d),void hr(null);const r=this.anchor,n=this.focus,e=this.isBackward(),s=e?n:r,i=e?r:n;let l=0,o=t[0],a=s.type==="element"?0:s.offset;if(s.type==="text"&&a===o.getTextContentSize()&&(l=1,o=t[1],a=0),o==null)return;const c=o.getFormatFlags(d,null),u=f-1;let h=t[u];const p=i.type==="text"?i.offset:h.getTextContentSize();if(o.is(h)){if(a===p)return;if(ns(o)||a===0&&p===o.getTextContentSize())o.setFormat(c);else{const b=o.splitText(a,p),_=a===0?b[0]:b[1];_.setFormat(c),s.type==="text"&&s.set(_.__key,0,"text"),i.type==="text"&&i.set(_.__key,p-a,"text")}return void(this.format=c)}a===0||ns(o)||([,o]=o.splitText(a),a=0),o.setFormat(c);const m=h.getFormatFlags(d,c);p>0&&(p===h.getTextContentSize()||ns(h)||([h]=h.splitText(p)),h.setFormat(m));for(let b=l+1;b<u;b++){const _=t[b],v=_.getFormatFlags(d,m);_.setFormat(v)}s.type==="text"&&s.set(o.__key,a,"text"),i.type==="text"&&i.set(h.__key,p,"text"),this.format=c|m}insertNodes(d){if(d.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const u=Oe();return xe(u)||Je(134),u.insertNodes(d)}const g=Zd((this.isBackward()?this.focus:this.anchor).getNode(),os),t=d[d.length-1];if("__language"in g&&ge(g)){if("__language"in d[0])this.insertText(d[0].getTextContent());else{const u=_f(this);g.splice(u,0,d),t.selectEnd()}return}if(!d.some(u=>(ge(u)||Tn(u))&&!u.isInline())){ge(g)||Je(135);const u=_f(this);return g.splice(u,0,d),void t.selectEnd()}const f=function(u){const h=Un();let p=null;for(let m=0;m<u.length;m++){const b=u[m],_=ha(b);if(_||Tn(b)&&b.isInline()||ge(b)&&b.isInline()||Ne(b)||b.isParentRequired()){if(p===null&&(p=b.createParentElementNode(),h.append(p),_))continue;p!==null&&p.append(b)}else h.append(b),p=null}return h}(d),r=f.getLastDescendant(),n=f.getChildren(),e=u=>"__value"in u&&"__checked"in u,s=!ge(g)||!g.isEmpty()?this.insertParagraph():null,i=n[n.length-1];let l=n[0];var o;ge(o=l)&&os(o)&&!o.isEmpty()&&ge(g)&&(!g.isEmpty()||e(g))&&(ge(g)||Je(135),g.append(...l.getChildren()),l=n[1]),l&&function(u,h,p){const m=h.getParentOrThrow().getLastChild();let b=h;const _=[h];for(;b!==m;)b.getNextSibling()||Je(140),b=b.getNextSibling(),_.push(b);let v=u;for(const w of _)v=v.insertAfter(w)}(g,l);const a=Zd(r,os);s&&ge(a)&&(e(s)||os(i))&&(a.append(...s.getChildren()),s.remove()),ge(g)&&g.isEmpty()&&g.remove(),r.selectEnd();const c=ge(g)?g.getLastChild():null;ha(c)&&a!==g&&c.remove()}insertParagraph(){if(this.anchor.key==="root"){const n=Un();return Ln().splice(this.anchor.offset,0,[n]),n.select(),n}const d=_f(this),g=Zd(this.anchor.getNode(),os);ge(g)||Je(136);const t=g.getChildAtIndex(d),f=t?[t,...t.getNextSiblings()]:[],r=g.insertNewAfter(this,!1);return r?(r.append(...f),r.selectStart(),r):null}insertLineBreak(d){const g=ls();if(this.insertNodes([g]),d){const t=g.getParentOrThrow(),f=g.getIndexWithinParent();t.select(f,f)}}extract(){const d=this.getNodes(),g=d.length,t=g-1,f=this.anchor,r=this.focus;let n=d[0],e=d[t];const[s,i]=mf(this);if(g===0)return[];if(g===1){if(Ne(n)&&!this.isCollapsed()){const o=s>i?i:s,a=s>i?s:i,c=n.splitText(o,a),u=o===0?c[0]:c[1];return u!=null?[u]:[]}return[n]}const l=f.isBefore(r);if(Ne(n)){const o=l?s:i;o===n.getTextContentSize()?d.shift():o!==0&&([,n]=n.splitText(o),d[0]=n)}if(Ne(e)){const o=e.getTextContent().length,a=l?i:s;a===0?d.pop():a!==o&&([e]=e.splitText(a),d[t]=e)}return d}modify(d,g,t){const f=this.focus,r=this.anchor,n=d==="move",e=wl(f,g);if(Tn(e)&&!e.isIsolated()){if(n&&e.isKeyboardSelectable()){const c=vf();return c.add(e.__key),void or(c)}const a=g?e.getPreviousSibling():e.getNextSibling();if(Ne(a)){const c=a.__key,u=g?a.getTextContent().length:0;return f.set(c,u,"text"),void(n&&r.set(c,u,"text"))}{const c=e.getParentOrThrow();let u,h;return ge(a)?(h=a.__key,u=g?a.getChildrenSize():0):(u=e.getIndexWithinParent(),h=c.__key,g||u++),f.set(h,u,"element"),void(n&&r.set(h,u,"element"))}}const s=Wn(),i=Oo(s._window);if(!i)return;const l=s._blockCursorElement,o=s._rootElement;if(o===null||l===null||!ge(e)||e.isInline()||e.canBeEmpty()||Yd(l,s,o),function(a,c,u,h){a.modify(c,u,h)}(i,d,g?"backward":"forward",t),i.rangeCount>0){const a=i.getRangeAt(0),c=this.anchor.getNode(),u=vr(c)?c:Iv(c);if(this.applyDOMRange(a),this.dirty=!0,!n){const h=this.getNodes(),p=[];let m=!1;for(let b=0;b<h.length;b++){const _=h[b];Wd(_,u)?p.push(_):m=!0}if(m&&p.length>0)if(g){const b=p[0];ge(b)?b.selectStart():b.getParentOrThrow().selectStart()}else{const b=p[p.length-1];ge(b)?b.selectEnd():b.getParentOrThrow().selectEnd()}i.anchorNode===a.startContainer&&i.anchorOffset===a.startOffset||function(b){const _=b.focus,v=b.anchor,w=v.key,x=v.offset,S=v.type;Ai(v,_.key,_.offset,_.type),Ai(_,w,x,S),b._cachedNodes=null}(this)}}}forwardDeletion(d,g,t){if(!t&&(d.type==="element"&&ge(g)&&d.offset===g.getChildrenSize()||d.type==="text"&&d.offset===g.getTextContentSize())){const f=g.getParent(),r=g.getNextSibling()||(f===null?null:f.getNextSibling());if(ge(r)&&r.isShadowRoot())return!0}return!1}deleteCharacter(d){const g=this.isCollapsed();if(this.isCollapsed()){const t=this.anchor;let f=t.getNode();if(this.forwardDeletion(t,f,d))return;const r=this.focus,n=wl(r,d);if(Tn(n)&&!n.isIsolated()){if(n.isKeyboardSelectable()&&ge(f)&&f.getChildrenSize()===0){f.remove();const e=vf();e.add(n.__key),or(e)}else n.remove(),Wn().dispatchCommand(Wo,void 0);return}if(!d&&ge(n)&&ge(f)&&f.isEmpty())return f.remove(),void n.selectStart();if(this.modify("extend",d,"character"),this.isCollapsed()){if(d&&t.offset===0&&(t.type==="element"?t.getNode():t.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const e=r.type==="text"?r.getNode():null;if(f=t.type==="text"?t.getNode():null,e!==null&&e.isSegmented()){const s=r.offset,i=e.getTextContentSize();if(e.is(f)||d&&s!==i||!d&&s!==0)return void Tg(e,d,s)}else if(f!==null&&f.isSegmented()){const s=t.offset,i=f.getTextContentSize();if(f.is(e)||d&&s!==0||!d&&s!==i)return void Tg(f,d,s)}(function(s,i){const l=s.anchor,o=s.focus,a=l.getNode(),c=o.getNode();if(a===c&&l.type==="text"&&o.type==="text"){const u=l.offset,h=o.offset,p=u<h,m=p?u:h,b=p?h:u,_=b-1;m!==_&&(qh(a.getTextContent().slice(m,b))||(i?o.offset=_:l.offset=_))}})(this,d)}}if(this.removeText(),d&&!g&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const t=this.anchor.getNode();t.isEmpty()&&vr(t.getParent())&&t.getIndexWithinParent()===0&&t.collapseAtStart(this)}}deleteLine(d){if(this.isCollapsed()){const g=this.anchor.type==="element";if(g&&this.insertText(" "),this.modify("extend",d,"lineboundary"),(d?this.focus:this.anchor).offset===0&&this.modify("extend",d,"character"),g){const t=d?this.anchor:this.focus;t.set(t.key,t.offset+1,t.type)}}this.removeText()}deleteWord(d){if(this.isCollapsed()){const g=this.anchor,t=g.getNode();if(this.forwardDeletion(g,t,d))return;this.modify("extend",d,"word")}this.removeText()}isBackward(){return this.focus.isBefore(this.anchor)}getStartEndPoints(){return[this.anchor,this.focus]}}function Xr(y){return y instanceof Gc}function Og(y){const d=y.offset;if(y.type==="text")return d;const g=y.getNode();return d===g.getChildrenSize()?g.getTextContent().length:0}function mf(y){const d=y.getStartEndPoints();if(d===null)return[0,0];const[g,t]=d;return g.type==="element"&&t.type==="element"&&g.key===t.key&&g.offset===t.offset?[0,0]:[Og(g),Og(t)]}function Tg(y,d,g){const t=y,f=t.getTextContent().split(/(?=\s)/g),r=f.length;let n=0,e=0;for(let i=0;i<r;i++){const l=i===r-1;if(e=n,n+=f[i].length,d&&n===g||n>g||l){f.splice(i,1),l&&(e=void 0);break}}const s=f.join("").trim();s===""?t.remove():(t.setTextContent(s),t.select(e,e))}function jg(y,d,g,t){let f,r=d;if(y.nodeType===ml){let n=!1;const e=y.childNodes,s=e.length,i=t._blockCursorElement;r===s&&(n=!0,r=s-1);let l=e[r],o=!1;if(l===i)l=e[r+1],o=!0;else if(i!==null){const a=i.parentNode;y===a&&d>Array.prototype.indexOf.call(a.children,i)&&r--}if(f=rs(l),Ne(f))r=Hh(f,n);else{let a=rs(y);if(a===null)return null;if(ge(a)){r=Math.min(a.getChildrenSize(),r);let c=a.getChildAtIndex(r);if(ge(c)&&function(u,h,p){const m=u.getParent();return p===null||m===null||!m.canBeEmpty()||m!==p.getNode()}(c,0,g)){const u=n?c.getLastDescendant():c.getFirstDescendant();u===null?a=c:(c=u,a=ge(c)?c:c.getParentOrThrow()),r=0}Ne(c)?(f=c,a=null,r=Hh(c,n)):c!==a&&n&&!o&&r++}else{const c=a.getIndexWithinParent();r=d===0&&Tn(a)&&rs(y)===a?c:c+1,a=a.getParentOrThrow()}if(ge(a))return Qr(a.__key,r,"element")}}else f=rs(y);return Ne(f)?Qr(f.__key,r,"text"):null}function Ag(y,d,g){const t=y.offset,f=y.getNode();if(t===0){const r=f.getPreviousSibling(),n=f.getParent();if(d){if((g||!d)&&r===null&&ge(n)&&n.isInline()){const e=n.getPreviousSibling();Ne(e)&&(y.key=e.__key,y.offset=e.getTextContent().length)}}else ge(r)&&!g&&r.isInline()?(y.key=r.__key,y.offset=r.getChildrenSize(),y.type="element"):Ne(r)&&(y.key=r.__key,y.offset=r.getTextContent().length)}else if(t===f.getTextContent().length){const r=f.getNextSibling(),n=f.getParent();if(d&&ge(r)&&r.isInline())y.key=r.__key,y.offset=0,y.type="element";else if((g||d)&&r===null&&ge(n)&&n.isInline()&&!n.canInsertTextAfter()){const e=n.getNextSibling();Ne(e)&&(y.key=e.__key,y.offset=0)}}}function Pg(y,d,g){if(y.type==="text"&&d.type==="text"){const t=y.isBefore(d),f=y.is(d);Ag(y,t,f),Ag(d,!t,f),f&&(d.key=y.key,d.offset=y.offset,d.type=y.type);const r=Wn();if(r.isComposing()&&r._compositionKey!==y.key&&xe(g)){const n=g.anchor,e=g.focus;Ai(y,n.key,n.offset,n.type),Ai(d,e.key,e.offset,e.type)}}}function Ng(y,d,g,t,f,r){if(y===null||g===null||!yl(f,y,g))return null;const n=jg(y,d,xe(r)?r.anchor:null,f);if(n===null)return null;const e=jg(g,t,xe(r)?r.focus:null,f);if(e===null)return null;if(n.type==="element"&&e.type==="element"){const s=rs(y),i=rs(g);if(Tn(s)&&Tn(i))return null}return Pg(n,e,r),[n,e]}function yf(y){return ge(y)&&!y.isInline()}function Ig(y,d,g,t,f,r){const n=To(),e=new Pi(Qr(y,d,f),Qr(g,t,r),0,"");return e.dirty=!0,n._selection=e,e}function bf(){const y=Qr("root",0,"element"),d=Qr("root",0,"element");return new Pi(y,d,0,"")}function vf(){return new Gc(new Set)}function Qv(y,d){return Yc(null,y,d,null)}function Yc(y,d,g,t){const f=g._window;if(f===null)return null;const r=t||f.event,n=r?r.type:void 0,e=n==="selectionchange",s=!Ld&&(e||n==="beforeinput"||n==="compositionstart"||n==="compositionend"||n==="click"&&r&&r.detail===3||n==="drop"||n===void 0);let i,l,o,a;if(xe(y)&&!s)return y.clone();if(d===null)return null;if(i=d.anchorNode,l=d.focusNode,o=d.anchorOffset,a=d.focusOffset,e&&xe(y)&&!yl(g,i,l))return y.clone();const c=Ng(i,o,l,a,g,y);if(c===null)return null;const[u,h]=c;return new Pi(u,h,xe(y)?y.format:0,xe(y)?y.style:"")}function Oe(){return To()._selection}function ma(){return Wn()._editorState._selection}function Zc(y,d,g,t=1){const f=y.anchor,r=y.focus,n=f.getNode(),e=r.getNode();if(!d.is(n)&&!d.is(e))return;const s=d.__key;if(y.isCollapsed()){const i=f.offset;if(g<=i&&t>0||g<i&&t<0){const l=Math.max(0,i+t);f.set(s,l,"element"),r.set(s,l,"element"),Rg(y)}}else{const i=y.isBackward(),l=i?r:f,o=l.getNode(),a=i?f:r,c=a.getNode();if(d.is(o)){const u=l.offset;(g<=u&&t>0||g<u&&t<0)&&l.set(s,Math.max(0,u+t),"element")}if(d.is(c)){const u=a.offset;(g<=u&&t>0||g<u&&t<0)&&a.set(s,Math.max(0,u+t),"element")}}Rg(y)}function Rg(y){const d=y.anchor,g=d.offset,t=y.focus,f=t.offset,r=d.getNode(),n=t.getNode();if(y.isCollapsed()){if(!ge(r))return;const e=r.getChildrenSize(),s=g>=e,i=s?r.getChildAtIndex(e-1):r.getChildAtIndex(g);if(Ne(i)){let l=0;s&&(l=i.getTextContentSize()),d.set(i.__key,l,"text"),t.set(i.__key,l,"text")}}else{if(ge(r)){const e=r.getChildrenSize(),s=g>=e,i=s?r.getChildAtIndex(e-1):r.getChildAtIndex(g);if(Ne(i)){let l=0;s&&(l=i.getTextContentSize()),d.set(i.__key,l,"text")}}if(ge(n)){const e=n.getChildrenSize(),s=f>=e,i=s?n.getChildAtIndex(e-1):n.getChildAtIndex(f);if(Ne(i)){let l=0;s&&(l=i.getTextContentSize()),t.set(i.__key,l,"text")}}}}function Qc(y,d,g,t,f){let r=null,n=0,e=null;t!==null?(r=t.__key,Ne(t)?(n=t.getTextContentSize(),e="text"):ge(t)&&(n=t.getChildrenSize(),e="element")):f!==null&&(r=f.__key,Ne(f)?e="text":ge(f)&&(e="element")),r!==null&&e!==null?y.set(r,n,e):(n=d.getIndexWithinParent(),n===-1&&(n=g.getChildrenSize()),y.set(g.__key,n,"element"))}function Mg(y,d,g,t,f){y.type==="text"?(y.key=g,d||(y.offset+=f)):y.offset>t.getIndexWithinParent()&&(y.offset-=1)}function Xv(y,d,g,t,f,r,n){const e=t.anchorNode,s=t.focusNode,i=t.anchorOffset,l=t.focusOffset,o=document.activeElement;if(f.has("collaboration")&&o!==r||o!==null&&Ud(o))return;if(!xe(d))return void(y!==null&&yl(g,e,s)&&t.removeAllRanges());const a=d.anchor,c=d.focus,u=a.key,h=c.key,p=Lc(g,u),m=Lc(g,h),b=a.offset,_=c.offset,v=d.format,w=d.style,x=d.isCollapsed();let S=p,E=m,k=!1;if(a.type==="text"){S=Rc(p);const z=a.getNode();k=z.getFormat()!==v||z.getStyle()!==w}else xe(y)&&y.anchor.type==="text"&&(k=!0);var D,P,O,R,A;if(c.type==="text"&&(E=Rc(m)),S!==null&&E!==null&&(x&&(y===null||k||xe(y)&&(y.format!==v||y.style!==w))&&(D=v,P=w,O=b,R=u,A=performance.now(),dg=[D,P,O,R,A]),i!==b||l!==_||e!==S||s!==E||t.type==="Range"&&x||(o!==null&&r.contains(o)||r.focus({preventScroll:!0}),a.type==="element"))){try{t.setBaseAndExtent(S,b,E,_)}catch{}if(!f.has("skip-scroll-into-view")&&d.isCollapsed()&&r!==null&&r===document.activeElement){const z=d instanceof Pi&&d.anchor.type==="element"?S.childNodes[b]||null:t.rangeCount>0?t.getRangeAt(0):null;if(z!==null){let H;if(z instanceof Text){const $=document.createRange();$.selectNode(z),H=$.getBoundingClientRect()}else H=z.getBoundingClientRect();(function($,M,J){const K=J.ownerDocument,N=K.defaultView;if(N===null)return;let{top:U,bottom:W}=M,G=0,F=0,q=J;for(;q!==null;){const T=q===K.body;if(T)G=0,F=Fc($).innerHeight;else{const L=q.getBoundingClientRect();G=L.top,F=L.bottom}let I=0;if(U<G?I=-(G-U):W>F&&(I=W-F),I!==0)if(T)N.scrollBy(0,I);else{const L=q.scrollTop;q.scrollTop+=I;const B=q.scrollTop-L;U-=B,W-=B}if(T)break;q=Bc(q)}})(g,H,r)}}lf=!0}}function t1(y){let d=Oe()||ma();d===null&&(d=Ln().selectEnd()),d.insertNodes(y)}function _f(y){let d=y;y.isCollapsed()||d.removeText();const g=Oe();xe(g)&&(d=g),xe(d)||Je(161);const t=d.anchor;let f=t.getNode(),r=t.offset;for(;!os(f);)[f,r]=e1(f,r);return r}function e1(y,d){const g=y.getParent();if(!g){const f=Un();return Ln().append(f),f.select(),[Ln(),0]}if(Ne(y)){const f=y.splitText(d);if(f.length===0)return[g,y.getIndexWithinParent()];const r=d===0?0:1;return[g,f[0].getIndexWithinParent()+r]}if(!ge(y)||d===0)return[g,y.getIndexWithinParent()];const t=y.getChildAtIndex(d);if(t){const f=new Pi(Qr(y.__key,d,"element"),Qr(y.__key,d,"element"),0,""),r=y.insertNewAfter(f);r&&r.append(t,...t.getNextSiblings())}return[g,y.getIndexWithinParent()+1]}let ur=null,dr=null,Dr=!1,xf=!1,Xc=0;const Dg={characterData:!0,childList:!0,subtree:!0};function cs(){return Dr||ur!==null&&ur._readOnly}function Tr(){Dr&&Je(13)}function Lg(){Xc>99&&Je(14)}function To(){return ur===null&&Je(15),ur}function Wn(){return dr===null&&Je(16),dr}function n1(){return dr}function Bg(y,d,g){const t=d.__type,f=function(e,s){const i=e._nodes.get(s);return i===void 0&&Je(30,s),i}(y,t);let r=g.get(t);r===void 0&&(r=Array.from(f.transforms),g.set(t,r));const n=r.length;for(let e=0;e<n&&(r[e](d),d.isAttached());e++);}function Fg(y,d){return y!==void 0&&y.__key!==d&&y.isAttached()}function r1(y){return wf(y,Wn()._nodes)}function wf(y,d){const g=y.type,t=d.get(g);t===void 0&&Je(17,g);const f=t.klass;y.type!==f.getType()&&Je(18,f.name);const r=f.importJSON(y),n=y.children;if(ge(r)&&Array.isArray(n))for(let e=0;e<n.length;e++){const s=wf(n[e],d);r.append(s)}return r}function zg(y,d){const g=ur,t=Dr,f=dr;ur=y,Dr=!0,dr=null;try{return d()}finally{ur=g,Dr=t,dr=f}}function ya(y,d){const g=y._pendingEditorState,t=y._rootElement,f=y._headless||t===null;if(g===null)return;const r=y._editorState,n=r._selection,e=g._selection,s=y._dirtyType!==ua,i=ur,l=Dr,o=dr,a=y._updating,c=y._observer;let u=null;if(y._pendingEditorState=null,y._editorState=g,!f&&s&&c!==null){dr=y,ur=g,Dr=!1,y._updating=!0;try{const x=y._dirtyType,S=y._dirtyElements,E=y._dirtyLeaves;c.disconnect(),u=$v(r,g,y,x,S,E)}catch(x){if(x instanceof Error&&y._onError(x),xf)throw x;return Wg(y,null,t,g),Nh(y),y._dirtyType=es,xf=!0,ya(y,r),void(xf=!1)}finally{c.observe(t,Dg),y._updating=a,ur=i,Dr=l,dr=o}}g._readOnly||(g._readOnly=!0);const h=y._dirtyLeaves,p=y._dirtyElements,m=y._normalizedNodes,b=y._updateTags,_=y._deferred;s&&(y._dirtyType=ua,y._cloneNotNeeded.clear(),y._dirtyLeaves=new Set,y._dirtyElements=new Map,y._normalizedNodes=new Set,y._updateTags=new Set),function(x,S){const E=x._decorators;let k=x._pendingDecorators||E;const D=S._nodeMap;let P;for(P in k)D.has(P)||(k===E&&(k=zh(x)),delete k[P])}(y,g);const v=f?null:Oo(y._window);if(y._editable&&v!==null&&(s||e===null||e.dirty)){dr=y,ur=g;try{if(c!==null&&c.disconnect(),s||e===null||e.dirty){const x=y._blockCursorElement;x!==null&&Yd(x,y,t),Xv(n,e,y,v,b,t)}Mv(y,t,e),c!==null&&c.observe(t,Dg)}finally{dr=o,ur=i}}u!==null&&function(x,S,E,k,D){const P=Array.from(x._listeners.mutation),O=P.length;for(let R=0;R<O;R++){const[A,z]=P[R],H=S.get(z);H!==void 0&&A(H,{dirtyLeaves:k,prevEditorState:D,updateTags:E})}}(y,u,b,h,r),xe(e)||e===null||n!==null&&n.is(e)||y.dispatchCommand(Wo,void 0);const w=y._pendingDecorators;w!==null&&(y._decorators=w,y._pendingDecorators=null,Nl("decorator",y,!0,w)),function(x,S,E){const k=Uh(S),D=Uh(E);k!==D&&Nl("textcontent",x,!0,D)}(y,d||r,g),Nl("update",y,!0,{dirtyElements:p,dirtyLeaves:h,editorState:g,normalizedNodes:m,prevEditorState:d||r,tags:b}),function(x,S){if(x._deferred=[],S.length!==0){const E=x._updating;x._updating=!0;try{for(let k=0;k<S.length;k++)S[k]()}finally{x._updating=E}}}(y,_),function(x){const S=x._updates;if(S.length!==0){const E=S.shift();if(E){const[k,D]=E;Hg(x,k,D)}}}(y)}function Nl(y,d,g,...t){const f=d._updating;d._updating=g;try{const r=Array.from(d._listeners[y]);for(let n=0;n<r.length;n++)r[n].apply(null,t)}finally{d._updating=f}}function Ug(y,d,g){if(y._updating===!1||dr!==y){let f=!1;return y.update(()=>{f=Ug(y,d,g)}),f}const t=Hd(y);for(let f=4;f>=0;f--)for(let r=0;r<t.length;r++){const n=t[r]._commands.get(d);if(n!==void 0){const e=n[f];if(e!==void 0){const s=Array.from(e),i=s.length;for(let l=0;l<i;l++)if(s[l](g,y)===!0)return!0}}}return!1}function $g(y,d){const g=y._updates;let t=d||!1;for(;g.length!==0;){const f=g.shift();if(f){const[r,n]=f;let e,s;n!==void 0&&(e=n.onUpdate,s=n.tag,n.skipTransforms&&(t=!0),e&&y._deferred.push(e),s&&y._updateTags.add(s)),r()}}return t}function Hg(y,d,g){const t=y._updateTags;let f,r,n=!1,e=!1;g!==void 0&&(f=g.onUpdate,r=g.tag,r!=null&&t.add(r),n=g.skipTransforms||!1,e=g.discrete||!1),f&&y._deferred.push(f);const s=y._editorState;let i=y._pendingEditorState,l=!1;(i===null||i._readOnly)&&(i=y._pendingEditorState=new tu(new Map((i||s)._nodeMap)),l=!0),i._flushSync=e;const o=ur,a=Dr,c=dr,u=y._updating;ur=i,Dr=!1,y._updating=!0,dr=y;try{l&&(y._headless?s._selection!==null&&(i._selection=s._selection.clone()):i._selection=function(b){const _=b.getEditorState()._selection,v=Oo(b._window);return xe(_)||_==null?Yc(_,v,b,null):_.clone()}(y));const p=y._compositionKey;d(),n=$g(y,n),function(b,_){const v=_.getEditorState()._selection,w=b._selection;if(xe(w)){const x=w.anchor,S=w.focus;let E;if(x.type==="text"&&(E=x.getNode(),E.selectionTransform(v,w)),S.type==="text"){const k=S.getNode();E!==k&&k.selectionTransform(v,w)}}}(i,y),y._dirtyType!==ua&&(n?function(b,_){const v=_._dirtyLeaves,w=b._nodeMap;for(const x of v){const S=w.get(x);Ne(S)&&S.isAttached()&&S.isSimpleText()&&!S.isUnmergeable()&&Mh(S)}}(i,y):function(b,_){const v=_._dirtyLeaves,w=_._dirtyElements,x=b._nodeMap,S=Oi(),E=new Map;let k=v,D=k.size,P=w,O=P.size;for(;D>0||O>0;){if(D>0){_._dirtyLeaves=new Set;for(const R of k){const A=x.get(R);Ne(A)&&A.isAttached()&&A.isSimpleText()&&!A.isUnmergeable()&&Mh(A),A!==void 0&&Fg(A,S)&&Bg(_,A,E),v.add(R)}if(k=_._dirtyLeaves,D=k.size,D>0){Xc++;continue}}_._dirtyLeaves=new Set,_._dirtyElements=new Map;for(const R of P){const A=R[0],z=R[1];if(A!=="root"&&!z)continue;const H=x.get(A);H!==void 0&&Fg(H,S)&&Bg(_,H,E),w.set(A,z)}k=_._dirtyLeaves,D=k.size,P=_._dirtyElements,O=P.size,Xc++}_._dirtyLeaves=v,_._dirtyElements=w}(i,y),$g(y),function(b,_,v,w){const x=b._nodeMap,S=_._nodeMap,E=[];for(const[k]of w){const D=S.get(k);D!==void 0&&(D.isAttached()||(ge(D)&&eg(D,k,x,S,E,w),x.has(k)||w.delete(k),E.push(k)))}for(const k of E)S.delete(k);for(const k of v){const D=S.get(k);D===void 0||D.isAttached()||(x.has(k)||v.delete(k),S.delete(k))}}(s,i,y._dirtyLeaves,y._dirtyElements)),p!==y._compositionKey&&(i._flushSync=!0);const m=i._selection;if(xe(m)){const b=i._nodeMap,_=m.anchor.key,v=m.focus.key;b.get(_)!==void 0&&b.get(v)!==void 0||Je(19)}else Xr(m)&&m._nodes.size===0&&(i._selection=null)}catch(p){return p instanceof Error&&y._onError(p),y._pendingEditorState=s,y._dirtyType=es,y._cloneNotNeeded.clear(),y._dirtyLeaves=new Set,y._dirtyElements.clear(),void ya(y)}finally{ur=o,Dr=a,dr=c,y._updating=u,Xc=0}y._dirtyType!==ua||function(p,m){const b=m.getEditorState()._selection,_=p._selection;if(_!==null){if(_.dirty||!_.is(b))return!0}else if(b!==null)return!0;return!1}(i,y)?i._flushSync?(i._flushSync=!1,ya(y)):l&&jv(()=>{ya(y)}):(i._flushSync=!1,l&&(t.clear(),y._deferred=[],y._pendingEditorState=null))}function Hr(y,d,g){y._updating?y._updates.push([d,g]):Hg(y,d,g)}class jo extends Wc{constructor(d){super(d),this.__first=null,this.__last=null,this.__size=0,this.__format=0,this.__indent=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){const d=this.getFormat();return _v[d]||""}getIndent(){return this.getLatest().__indent}getChildren(){const d=[];let g=this.getFirstChild();for(;g!==null;)d.push(g),g=g.getNextSibling();return d}getChildrenKeys(){const d=[];let g=this.getFirstChild();for(;g!==null;)d.push(g.__key),g=g.getNextSibling();return d}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const d=Wn()._dirtyElements;return d!==null&&d.has(this.__key)}isLastChild(){const d=this.getLatest(),g=this.getParentOrThrow().getLastChild();return g!==null&&g.is(d)}getAllTextNodes(){const d=[];let g=this.getFirstChild();for(;g!==null;){if(Ne(g)&&d.push(g),ge(g)){const t=g.getAllTextNodes();d.push(...t)}g=g.getNextSibling()}return d}getFirstDescendant(){let d=this.getFirstChild();for(;ge(d);){const g=d.getFirstChild();if(g===null)break;d=g}return d}getLastDescendant(){let d=this.getLastChild();for(;ge(d);){const g=d.getLastChild();if(g===null)break;d=g}return d}getDescendantByIndex(d){const g=this.getChildren(),t=g.length;if(d>=t){const r=g[t-1];return ge(r)&&r.getLastDescendant()||r||null}const f=g[d];return ge(f)&&f.getFirstDescendant()||f||null}getFirstChild(){const d=this.getLatest().__first;return d===null?null:Vn(d)}getFirstChildOrThrow(){const d=this.getFirstChild();return d===null&&Je(45,this.__key),d}getLastChild(){const d=this.getLatest().__last;return d===null?null:Vn(d)}getLastChildOrThrow(){const d=this.getLastChild();return d===null&&Je(96,this.__key),d}getChildAtIndex(d){const g=this.getChildrenSize();let t,f;if(d<g/2){for(t=this.getFirstChild(),f=0;t!==null&&f<=d;){if(f===d)return t;t=t.getNextSibling(),f++}return null}for(t=this.getLastChild(),f=g-1;t!==null&&f>=d;){if(f===d)return t;t=t.getPreviousSibling(),f--}return null}getTextContent(){let d="";const g=this.getChildren(),t=g.length;for(let f=0;f<t;f++){const r=g[f];d+=r.getTextContent(),ge(r)&&f!==t-1&&!r.isInline()&&(d+=Ko)}return d}getTextContentSize(){let d=0;const g=this.getChildren(),t=g.length;for(let f=0;f<t;f++){const r=g[f];d+=r.getTextContentSize(),ge(r)&&f!==t-1&&!r.isInline()&&(d+=Ko.length)}return d}getDirection(){return this.getLatest().__dir}hasFormat(d){if(d!==""){const g=jh[d];return!!(this.getFormat()&g)}return!1}select(d,g){Tr();const t=Oe();let f=d,r=g;const n=this.getChildrenSize();if(!this.canBeEmpty()){if(d===0&&g===0){const s=this.getFirstChild();if(Ne(s)||ge(s))return s.select(0,0)}else if(!(d!==void 0&&d!==n||g!==void 0&&g!==n)){const s=this.getLastChild();if(Ne(s)||ge(s))return s.select()}}f===void 0&&(f=n),r===void 0&&(r=n);const e=this.__key;return xe(t)?(t.anchor.set(e,f,"element"),t.focus.set(e,r,"element"),t.dirty=!0,t):Ig(e,f,e,r,"element","element")}selectStart(){const d=this.getFirstDescendant();return d?d.selectStart():this.select()}selectEnd(){const d=this.getLastDescendant();return d?d.selectEnd():this.select()}clear(){const d=this.getWritable();return this.getChildren().forEach(g=>g.remove()),d}append(...d){return this.splice(this.getChildrenSize(),0,d)}setDirection(d){const g=this.getWritable();return g.__dir=d,g}setFormat(d){return this.getWritable().__format=d!==""?jh[d]:0,this}setIndent(d){return this.getWritable().__indent=d,this}splice(d,g,t){const f=t.length,r=this.getChildrenSize(),n=this.getWritable(),e=n.__key,s=[],i=[],l=this.getChildAtIndex(d+g);let o=null,a=r-g+f;if(d!==0)if(d===r)o=this.getLastChild();else{const u=this.getChildAtIndex(d);u!==null&&(o=u.getPreviousSibling())}if(g>0){let u=o===null?this.getFirstChild():o.getNextSibling();for(let h=0;h<g;h++){u===null&&Je(100);const p=u.getNextSibling(),m=u.__key;da(u.getWritable()),i.push(m),u=p}}let c=o;for(let u=0;u<f;u++){const h=t[u];c!==null&&h.is(c)&&(o=c=c.getPreviousSibling());const p=h.getWritable();p.__parent===e&&a--,da(p);const m=h.__key;if(c===null)n.__first=m,p.__prev=null;else{const b=c.getWritable();b.__next=m,p.__prev=b.__key}h.__key===e&&Je(76),p.__parent=e,s.push(m),c=h}if(d+g===r)c!==null&&(c.getWritable().__next=null,n.__last=c.__key);else if(l!==null){const u=l.getWritable();if(c!==null){const h=c.getWritable();u.__prev=c.__key,h.__next=l.__key}else u.__prev=null}if(n.__size=a,i.length){const u=Oe();if(xe(u)){const h=new Set(i),p=new Set(s),{anchor:m,focus:b}=u;qg(m,h,p)&&Qc(m,m.getNode(),this,o,l),qg(b,h,p)&&Qc(b,b.getNode(),this,o,l),a!==0||this.canBeEmpty()||ko(this)||this.remove()}}return n}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(d,g){return null}canIndent(){return!0}collapseAtStart(d){return!1}excludeFromCopy(d){return!1}canReplaceWith(d){return!0}canInsertAfter(d){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(d){return!1}extractWithChild(d,g,t){return!1}}function ge(y){return y instanceof jo}function qg(y,d,g){let t=y.getNode();for(;t;){const f=t.__key;if(d.has(f)&&!g.has(f))return!0;t=t.getParent()}return!1}class Jg extends Wc{constructor(d){super(d)}decorate(d,g){Je(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function Tn(y){return y instanceof Jg}class us extends jo{static getType(){return"root"}static clone(){return new us}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Je(51)}getTextContent(){const d=this.__cachedText;return!cs()&&Wn()._dirtyType!==ua||d===null?super.getTextContent():d}remove(){Je(52)}replace(d){Je(53)}insertBefore(d){Je(54)}insertAfter(d){Je(55)}updateDOM(d,g){return!1}append(...d){for(let g=0;g<d.length;g++){const t=d[g];ge(t)||Tn(t)||Je(56)}return super.append(...d)}static importJSON(d){const g=Ln();return g.setFormat(d.format),g.setIndent(d.indent),g.setDirection(d.direction),g}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function vr(y){return y instanceof us}function Sf(){return new tu(new Map([["root",new us]]))}function Vg(y){const d=y.exportJSON(),g=y.constructor;if(d.type!==g.getType()&&Je(130,g.name),ge(y)){const t=d.children;Array.isArray(t)||Je(59,g.name);const f=y.getChildren();for(let r=0;r<f.length;r++){const n=Vg(f[r]);t.push(n)}}return d}class tu{constructor(d,g){this._nodeMap=d,this._selection=g||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(d){return zg(this,d)}clone(d){const g=new tu(this._nodeMap,d===void 0?this._selection:d);return g._readOnly=!0,g}toJSON(){return zg(this,()=>({root:Vg(Ln())}))}}class Cf extends jo{static getType(){return"artificial"}createDOM(d){return document.createElement("div")}}class ba extends jo{constructor(d){super(d),this.__textFormat=0}static getType(){return"paragraph"}getTextFormat(){return this.getLatest().__textFormat}setTextFormat(d){const g=this.getWritable();return g.__textFormat=d,g}hasTextFormat(d){const g=Go[d];return!!(this.getTextFormat()&g)}static clone(d){return new ba(d.__key)}createDOM(d){const g=document.createElement("p"),t=xl(d.theme,"paragraph");return t!==void 0&&g.classList.add(...t),g}updateDOM(d,g,t){return!1}static importDOM(){return{p:d=>({conversion:o1,priority:0})}}exportDOM(d){const{element:g}=super.exportDOM(d);if(g&&Sl(g)){this.isEmpty()&&g.append(document.createElement("br"));const t=this.getFormatType();g.style.textAlign=t;const f=this.getDirection();f&&(g.dir=f);const r=this.getIndent();r>0&&(g.style.textIndent=20*r+"px")}return{element:g}}static importJSON(d){const g=Un();return g.setFormat(d.format),g.setIndent(d.indent),g.setDirection(d.direction),g.setTextFormat(d.textFormat),g}exportJSON(){return{...super.exportJSON(),textFormat:this.getTextFormat(),type:"paragraph",version:1}}insertNewAfter(d,g){const t=Un();t.setTextFormat(d.format);const f=this.getDirection();return t.setDirection(f),t.setFormat(this.getFormatType()),this.insertAfter(t,g),t}collapseAtStart(){const d=this.getChildren();if(d.length===0||Ne(d[0])&&d[0].getTextContent().trim()===""){if(this.getNextSibling()!==null)return this.selectNext(),this.remove(),!0;if(this.getPreviousSibling()!==null)return this.selectPrevious(),this.remove(),!0}return!1}}function o1(y){const d=Un();if(y.style){d.setFormat(y.style.textAlign);const g=parseInt(y.style.textIndent,10)/20;g>0&&d.setIndent(g)}return{node:d}}function Un(){return Yo(new ba)}function va(y){return y instanceof ba}const an=0,ds=3,to=4;function Wg(y,d,g,t){const f=y._keyToDOMMap;f.clear(),y._editorState=Sf(),y._pendingEditorState=t,y._compositionKey=null,y._dirtyType=ua,y._cloneNotNeeded.clear(),y._dirtyLeaves=new Set,y._dirtyElements.clear(),y._normalizedNodes=new Set,y._updateTags=new Set,y._updates=[],y._blockCursorElement=null;const r=y._observer;r!==null&&(r.disconnect(),y._observer=null),d!==null&&(d.textContent=""),g!==null&&(g.textContent="",f.set("root",g))}function Kg(y){const d=y||{},g=n1(),t=d.theme||{},f=y===void 0?g:d.parentEditor||null,r=d.disableEvents||!1,n=Sf(),e=d.namespace||(f!==null?f._config.namespace:Jh()),s=d.editorState,i=[us,ga,ss,Al,ba,Cf,...d.nodes||[]],{onError:l,html:o}=d,a=d.editable===void 0||d.editable;let c;if(y===void 0&&g!==null)c=g._nodes;else{c=new Map;for(let h=0;h<i.length;h++){let p=i[h],m=null,b=null;if(typeof p!="function"){const x=p;p=x.replace,m=x.with,b=x.withKlass||null}const _=p.getType(),v=p.transform(),w=new Set;v!==null&&w.add(v),c.set(_,{exportDOM:o&&o.export?o.export.get(p):void 0,klass:p,replace:m,replaceWithKlass:b,transforms:w})}}const u=new i1(n,f,c,{disableEvents:r,namespace:e,theme:t},l||console.error,function(h,p){const m=new Map,b=new Set,_=v=>{Object.keys(v).forEach(w=>{let x=m.get(w);x===void 0&&(x=[],m.set(w,x)),x.push(v[w])})};return h.forEach(v=>{const w=v.klass.importDOM;if(w==null||b.has(w))return;b.add(w);const x=w.call(v.klass);x!==null&&_(x)}),p&&_(p),m}(c,o?o.import:void 0),a);return s!==void 0&&(u._pendingEditorState=s,u._dirtyType=es),u}class i1{constructor(d,g,t,f,r,n,e){this._parentEditor=g,this._rootElement=null,this._editorState=d,this._pendingEditorState=null,this._compositionKey=null,this._deferred=[],this._keyToDOMMap=new Map,this._updates=[],this._updating=!1,this._listeners={decorator:new Set,editable:new Set,mutation:new Map,root:new Set,textcontent:new Set,update:new Set},this._commands=new Map,this._config=f,this._nodes=t,this._decorators={},this._pendingDecorators=null,this._dirtyType=ua,this._cloneNotNeeded=new Set,this._dirtyLeaves=new Set,this._dirtyElements=new Map,this._normalizedNodes=new Set,this._updateTags=new Set,this._observer=null,this._key=Jh(),this._onError=r,this._htmlConversions=n,this._editable=e,this._headless=g!==null&&g._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(d){const g=this._listeners.update;return g.add(d),()=>{g.delete(d)}}registerEditableListener(d){const g=this._listeners.editable;return g.add(d),()=>{g.delete(d)}}registerDecoratorListener(d){const g=this._listeners.decorator;return g.add(d),()=>{g.delete(d)}}registerTextContentListener(d){const g=this._listeners.textcontent;return g.add(d),()=>{g.delete(d)}}registerRootListener(d){const g=this._listeners.root;return d(this._rootElement,null),g.add(d),()=>{d(null,this._rootElement),g.delete(d)}}registerCommand(d,g,t){t===void 0&&Je(35);const f=this._commands;f.has(d)||f.set(d,[new Set,new Set,new Set,new Set,new Set]);const r=f.get(d);r===void 0&&Je(36,String(d));const n=r[t];return n.add(g),()=>{n.delete(g),r.every(e=>e.size===0)&&f.delete(d)}}registerMutationListener(d,g){let t=this._nodes.get(d.getType());t===void 0&&Je(37,d.name);let f=d,r=null;for(;r=t.replaceWithKlass;)f=r,t=this._nodes.get(r.getType()),t===void 0&&Je(37,r.name);const n=this._listeners.mutation;return n.set(g,f),()=>{n.delete(g)}}registerNodeTransformToKlass(d,g){const t=d.getType(),f=this._nodes.get(t);return f===void 0&&Je(37,d.name),f.transforms.add(g),f}registerNodeTransform(d,g){const t=this.registerNodeTransformToKlass(d,g),f=[t],r=t.replaceWithKlass;if(r!=null){const s=this.registerNodeTransformToKlass(r,g);f.push(s)}var n,e;return n=this,e=d.getType(),Hr(n,()=>{const s=To();if(s.isEmpty())return;if(e==="root")return void Ln().markDirty();const i=s._nodeMap;for(const[,l]of i)l.markDirty()},n._pendingEditorState===null?{tag:"history-merge"}:void 0),()=>{f.forEach(s=>s.transforms.delete(g))}}hasNode(d){return this._nodes.has(d.getType())}hasNodes(d){return d.every(this.hasNode.bind(this))}dispatchCommand(d,g){return Ke(this,d,g)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(d){const g=this._rootElement;if(d!==g){const t=xl(this._config.theme,"root"),f=this._pendingEditorState||this._editorState;if(this._rootElement=d,Wg(this,g,d,f),g!==null&&(this._config.disableEvents||Hv(g),t!=null&&g.classList.remove(...t)),d!==null){const r=function(e){const s=e.ownerDocument;return s&&s.defaultView||null}(d),n=d.style;n.userSelect="text",n.whiteSpace="pre-wrap",n.wordBreak="break-word",d.setAttribute("data-lexical-editor","true"),this._window=r,this._dirtyType=es,Nh(this),this._updateTags.add("history-merge"),ya(this),this._config.disableEvents||function(e,s){const i=e.ownerDocument,l=Vc.get(i);(l===void 0||l<1)&&i.addEventListener("selectionchange",yg),Vc.set(i,(l||0)+1),e.__lexicalEditor=s;const o=mg(e);for(let a=0;a<sf.length;a++){const[c,u]=sf[a],h=typeof u=="function"?p=>{vg(p)||(bg(p),(s.isEditable()||c==="click")&&u(p,s))}:p=>{if(vg(p))return;bg(p);const m=s.isEditable();switch(c){case"cut":return m&&Ke(s,gl,p);case"copy":return Ke(s,hl,p);case"paste":return m&&Ke(s,ll,p);case"dragstart":return m&&Ke(s,kd,p);case"dragover":return m&&Ke(s,Sh,p);case"dragend":return m&&Ke(s,iv,p);case"focus":return m&&Ke(s,Ch,p);case"blur":return m&&Ke(s,sv,p);case"drop":return m&&Ke(s,Ed,p)}};e.addEventListener(c,h),o.push(()=>{e.removeEventListener(c,h)})}}(d,this),t!=null&&d.classList.add(...t)}else this._editorState=f,this._pendingEditorState=null,this._window=null;Nl("root",this,!1,d,g)}}getElementByKey(d){return this._keyToDOMMap.get(d)||null}getEditorState(){return this._editorState}setEditorState(d,g){d.isEmpty()&&Je(38),Ph(this);const t=this._pendingEditorState,f=this._updateTags,r=g!==void 0?g.tag:null;t===null||t.isEmpty()||(r!=null&&f.add(r),ya(this)),this._pendingEditorState=d,this._dirtyType=es,this._dirtyElements.set("root",!1),this._compositionKey=null,r!=null&&f.add(r),ya(this)}parseEditorState(d,g){return function(t,f,r){const n=Sf(),e=ur,s=Dr,i=dr,l=f._dirtyElements,o=f._dirtyLeaves,a=f._cloneNotNeeded,c=f._dirtyType;f._dirtyElements=new Map,f._dirtyLeaves=new Set,f._cloneNotNeeded=new Set,f._dirtyType=0,ur=n,Dr=!1,dr=f;try{const u=f._nodes;wf(t.root,u),r&&r(),n._readOnly=!0}catch(u){u instanceof Error&&f._onError(u)}finally{f._dirtyElements=l,f._dirtyLeaves=o,f._cloneNotNeeded=a,f._dirtyType=c,ur=e,Dr=s,dr=i}return n}(typeof d=="string"?JSON.parse(d):d,this,g)}update(d,g){Hr(this,d,g)}focus(d,g={}){const t=this._rootElement;t!==null&&(t.setAttribute("autocapitalize","off"),Hr(this,()=>{const f=Oe(),r=Ln();f!==null?f.dirty=!0:r.getChildrenSize()!==0&&(g.defaultSelection==="rootStart"?r.selectStart():r.selectEnd())},{onUpdate:()=>{t.removeAttribute("autocapitalize"),d&&d()},tag:"focus"}),this._pendingEditorState===null&&t.removeAttribute("autocapitalize"))}blur(){const d=this._rootElement;d!==null&&d.blur();const g=Oo(this._window);g!==null&&g.removeAllRanges()}isEditable(){return this._editable}setEditable(d){this._editable!==d&&(this._editable=d,Nl("editable",this,!0,d))}toJSON(){return{editorState:this._editorState.toJSON()}}}const CC="";function a1(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var s1=a1(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const Ef=Ce.createContext(null);function l1(y,d){let g=null;return y!=null&&(g=y[1]),{getTheme:function(){return d??(g!=null?g.getTheme():null)}}}function jr(){const y=Ce.useContext(Ef);return y==null&&s1(8),y}const Gg=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,c1=Gg?Ce.useLayoutEffect:Ce.useEffect,eu={tag:"history-merge"};function Yg({initialConfig:y,children:d}){const g=Ce.useMemo(()=>{const{theme:t,namespace:f,editor__DEPRECATED:r,nodes:n,onError:e,editorState:s,html:i}=y,l=l1(null,t);let o=r||null;if(o===null){const a=Kg({editable:y.editable,html:i,namespace:f,nodes:n,onError:c=>e(c,a),theme:t});(function(c,u){if(u!==null){if(u===void 0)c.update(()=>{const h=Ln();if(h.isEmpty()){const p=Un();h.append(p);const m=Gg?document.activeElement:null;(Oe()!==null||m!==null&&m===c.getRootElement())&&p.select()}},eu);else if(u!==null)switch(typeof u){case"string":{const h=c.parseEditorState(u);c.setEditorState(h,eu);break}case"object":c.setEditorState(u,eu);break;case"function":c.update(()=>{Ln().isEmpty()&&u(c)},eu)}}})(a,s),o=a}return[o,l]},[]);return c1(()=>{const t=y.editable,[f]=g;f.setEditable(t===void 0||t)},[]),he.jsx(Ef.Provider,{value:g,children:d})}function Zg({defaultSelection:y}){const[d]=jr();return Ce.useEffect(()=>{d.focus(()=>{const g=document.activeElement,t=d.getRootElement();t===null||g!==null&&t.contains(g)||t.focus({preventScroll:!0})},{defaultSelection:y})},[y,d]),null}const u1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ce.useLayoutEffect:Ce.useEffect;function Qg({ariaActiveDescendant:y,ariaAutoComplete:d,ariaControls:g,ariaDescribedBy:t,ariaExpanded:f,ariaLabel:r,ariaLabelledBy:n,ariaMultiline:e,ariaOwns:s,ariaRequired:i,autoCapitalize:l,className:o,id:a,role:c="textbox",spellCheck:u=!0,style:h,tabIndex:p,"data-testid":m,...b}){const[_]=jr(),[v,w]=Ce.useState(!1),x=Ce.useCallback(S=>{S&&S.ownerDocument&&S.ownerDocument.defaultView&&_.setRootElement(S)},[_]);return u1(()=>(w(_.isEditable()),_.registerEditableListener(S=>{w(S)})),[_]),he.jsx("div",{...b,"aria-activedescendant":v?y:void 0,"aria-autocomplete":v?d:"none","aria-controls":v?g:void 0,"aria-describedby":t,"aria-expanded":v&&c==="combobox"?!!f:void 0,"aria-label":r,"aria-labelledby":n,"aria-multiline":e,"aria-owns":v?s:void 0,"aria-readonly":!v||void 0,"aria-required":i,autoCapitalize:l,className:o,contentEditable:v,"data-testid":m,id:a,ref:x,role:c,spellCheck:u,style:h,tabIndex:p})}function d1(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}d1(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const nu=new Map;function Xg(y){let d=y;for(;d!=null;){if(d.nodeType===Node.TEXT_NODE)return d;d=d.firstChild}return null}function tm(y){const d=y.parentNode;if(d==null)throw new Error("Should never happen");return[d,Array.from(d.childNodes).indexOf(y)]}function f1(y,d,g,t,f){const r=d.getKey(),n=t.getKey(),e=document.createRange();let s=y.getElementByKey(r),i=y.getElementByKey(n),l=g,o=f;if(Ne(d)&&(s=Xg(s)),Ne(t)&&(i=Xg(i)),d===void 0||t===void 0||s===null||i===null)return null;s.nodeName==="BR"&&([s,l]=tm(s)),i.nodeName==="BR"&&([i,o]=tm(i));const a=s.firstChild;s===i&&a!=null&&a.nodeName==="BR"&&l===0&&o===0&&(o=1);try{e.setStart(s,l),e.setEnd(i,o)}catch{return null}return!e.collapsed||l===o&&r===n||(e.setStart(i,o),e.setEnd(s,l)),e}function p1(y,d){const g=y.getRootElement();if(g===null)return[];const t=g.getBoundingClientRect(),f=getComputedStyle(g),r=parseFloat(f.paddingLeft)+parseFloat(f.paddingRight),n=Array.from(d.getClientRects());let e,s=n.length;n.sort((i,l)=>{const o=i.top-l.top;return Math.abs(o)<=3?i.left-l.left:o});for(let i=0;i<s;i++){const l=n[i],o=e&&e.top<=l.top&&e.top+e.height>l.top&&e.left+e.width>l.left,a=l.width+r===t.width;o||a?(n.splice(i--,1),s--):e=l}return n}function em(y){const d={},g=y.split(";");for(const t of g)if(t!==""){const[f,r]=t.split(/:([^]+)/);f&&r&&(d[f.trim()]=r.trim())}return d}function kf(y){let d=nu.get(y);return d===void 0&&(d=em(y),nu.set(y,d)),d}function nm(y){const d=y.constructor.clone(y);return d.__parent=y.__parent,d.__next=y.__next,d.__prev=y.__prev,ge(y)&&ge(d)?(t=y,(g=d).__first=t.__first,g.__last=t.__last,g.__size=t.__size,g.__format=t.__format,g.__indent=t.__indent,g.__dir=t.__dir,g):Ne(y)&&Ne(d)?function(f,r){return f.__format=r.__format,f.__style=r.__style,f.__mode=r.__mode,f.__detail=r.__detail,f}(d,y):va(y)&&va(d)?function(f,r){return f.__textFormat=r.__textFormat,f}(d,y):d;var g,t}function rm(y,d){const g=y.getStartEndPoints();if(d.isSelected(y)&&!d.isSegmented()&&!d.isToken()&&g!==null){const[t,f]=g,r=y.isBackward(),n=t.getNode(),e=f.getNode(),s=d.is(n),i=d.is(e);if(s||i){const[l,o]=mf(y),a=n.is(e),c=d.is(r?e:n),u=d.is(r?n:e);let h,p=0;return a?(p=l>o?o:l,h=l>o?l:o):c?(p=r?o:l,h=void 0):u&&(p=0,h=r?l:o),d.__text=d.__text.slice(p,h),d}}return d}function h1(y){const d=y.getStyle(),g=em(d);nu.set(d,g)}function fs(y,d){const g=kf("getStyle"in y?y.getStyle():y.style),t=Object.entries(d).reduce((r,[n,e])=>(e instanceof Function?r[n]=e(g[n]):e===null?delete r[n]:r[n]=e,r),{...g}),f=function(r){let n="";for(const e in r)e&&(n+=`${e}: ${r[e]};`);return n}(t);y.setStyle(f),nu.set(f,t)}function om(y,d){const g=y.getNodes(),t=g.length,f=y.getStartEndPoints();if(f===null)return;const[r,n]=f,e=t-1;let s=g[0],i=g[e];if(y.isCollapsed()&&xe(y))return void fs(y,d);const l=s.getTextContent().length,o=n.offset;let a=r.offset;const c=r.isBefore(n);let u=c?a:o,h=c?o:a;const p=c?r.type:n.type,m=c?n.type:r.type,b=c?n.key:r.key;if(Ne(s)&&u===l){const _=s.getNextSibling();Ne(_)&&(a=0,u=0,s=_)}if(g.length===1){if(Ne(s)&&s.canHaveFormat()){if(u=p==="element"?0:a>o?o:a,h=m==="element"?l:a>o?a:o,u===h)return;if(u===0&&h===l)fs(s,d),s.select(u,h);else{const _=s.splitText(u,h),v=u===0?_[0]:_[1];fs(v,d),v.select(0,h-u)}}}else{if(Ne(s)&&u<s.getTextContentSize()&&s.canHaveFormat()&&(u!==0&&(s=s.splitText(u)[1],u=0,c?r.set(s.getKey(),u,"text"):n.set(s.getKey(),u,"text")),fs(s,d)),Ne(i)&&i.canHaveFormat()){const _=i.getTextContent().length;i.__key!==b&&h!==0&&(h=_),h!==_&&([i]=i.splitText(h)),h===0&&m!=="element"||fs(i,d)}for(let _=1;_<e;_++){const v=g[_],w=v.getKey();Ne(v)&&v.canHaveFormat()&&w!==s.getKey()&&w!==i.getKey()&&!v.isToken()&&fs(v,d)}}}function ru(y,d){const g=wl(y.focus,d);return Tn(g)&&!g.isIsolated()||ge(g)&&!g.isInline()&&!g.canBeEmpty()}function g1(y,d,g,t){y.modify(d?"extend":"move",g,t)}function m1(y){const d=y.anchor.getNode();return(vr(d)?d:d.getParentOrThrow()).getDirection()==="rtl"}function ou(y,d,g){const t=m1(y);g1(y,d,g?!t:t,"character")}function y1(y,d,g){const t=kf(y.getStyle());return t!==null&&t[d]||g}function im(y,d,g=""){let t=null;const f=y.getNodes(),r=y.anchor,n=y.focus,e=y.isBackward(),s=e?n.offset:r.offset,i=e?n.getNode():r.getNode();if(xe(y)&&y.isCollapsed()&&y.style!==""){const l=kf(y.style);if(l!==null&&d in l)return l[d]}for(let l=0;l<f.length;l++){const o=f[l];if((l===0||s!==0||!o.is(i))&&Ne(o)){const a=y1(o,d,g);if(t===null)t=a;else if(t!==a){t="";break}}}return t===null?g:t}function b1(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var v1=b1(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const am=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,_1=am&&"documentMode"in document?document.documentMode:null;!(!am||!("InputEvent"in window)||_1)&&"getTargetRanges"in new window.InputEvent("input");function sm(...y){const d=[];for(const g of y)if(g&&typeof g=="string")for(const[t]of g.matchAll(/\S+/g))d.push(t);return d}function mo(...y){return()=>{for(let d=y.length-1;d>=0;d--)y[d]();y.length=0}}function Ni(y,...d){const g=sm(...d);g.length>0&&y.classList.add(...g)}function lm(y,...d){const g=sm(...d);g.length>0&&y.classList.remove(...g)}function x1(y){const d=vn(y,g=>ge(g)&&!g.isInline());return ge(d)||v1(4,y.__key),d}const vn=(y,d)=>{let g=y;for(;g!==Ln()&&g!=null;){if(d(g))return g;g=g.getParent()}return null};function w1(y,d,g,t){const f=r=>r instanceof d;return y.registerNodeTransform(d,r=>{const n=(e=>{const s=e.getChildren();for(let o=0;o<s.length;o++){const a=s[o];if(f(a))return null}let i=e,l=e;for(;i!==null;)if(l=i,i=i.getParent(),f(i))return{child:l,parent:i};return null})(r);if(n!==null){const{child:e,parent:s}=n;if(e.is(r)){t(s,r);const i=e.getNextSiblings(),l=i.length;if(s.insertAfter(e),l!==0){const o=g(s);e.insertAfter(o);for(let a=0;a<l;a++)o.append(i[a])}s.canBeEmpty()||s.getChildrenSize()!==0||s.remove()}}})}function cm(y){const d=Oe()||ma();if(xe(d)){const{focus:g}=d,t=g.getNode(),f=g.offset;if(ko(t)){const r=t.getChildAtIndex(f);r==null?t.append(y):r.insertBefore(y),y.selectNext()}else{let r,n;Ne(t)?(r=t.getParentOrThrow(),n=t.getIndexWithinParent(),f>0&&(n+=1,t.splitText(f))):(r=t,n=f);const[,e]=Dv(r,n);e.insertBefore(y),e.selectStart()}}else{if(d!=null){const t=d.getNodes();t[t.length-1].getTopLevelElementOrThrow().insertAfter(y)}else Ln().append(y);const g=Un();y.insertAfter(g),g.select()}return y.getLatest()}function Ii(y,d){return y!==null&&Object.getPrototypeOf(y).constructor.name===d.name}function um(y,d){const g=y.getFirstChild();g!==null?g.insertBefore(d):y.append(d)}const iu=0,Of=1,Tf=2,yo=0,S1=1,dm=2,C1=3,E1=4;function k1(y,d,g,t,f){if(y===null||g.size===0&&t.size===0&&!f)return yo;const r=d._selection,n=y._selection;if(f)return S1;if(!(xe(r)&&xe(n)&&n.isCollapsed()&&r.isCollapsed()))return yo;const e=function(m,b,_){const v=m._nodeMap,w=[];for(const x of b){const S=v.get(x);S!==void 0&&w.push(S)}for(const[x,S]of _){if(!S)continue;const E=v.get(x);E===void 0||vr(E)||w.push(E)}return w}(d,g,t);if(e.length===0)return yo;if(e.length>1){const m=d._nodeMap,b=m.get(r.anchor.key),_=m.get(n.anchor.key);return b&&_&&!y._nodeMap.has(b.__key)&&Ne(b)&&b.__text.length===1&&r.anchor.offset===1?dm:yo}const s=e[0],i=y._nodeMap.get(s.__key);if(!Ne(i)||!Ne(s)||i.__mode!==s.__mode)return yo;const l=i.__text,o=s.__text;if(l===o)return yo;const a=r.anchor,c=n.anchor;if(a.key!==c.key||a.type!=="text")return yo;const u=a.offset,h=c.offset,p=o.length-l.length;return p===1&&h===u-1?dm:p===-1&&h===u+1?C1:p===-1&&h===u?E1:yo}function O1(y,d){let g=Date.now(),t=yo;return(f,r,n,e,s,i)=>{const l=Date.now();if(i.has("historic"))return t=yo,g=l,Tf;const o=k1(f,r,e,s,y.isComposing()),a=(()=>{const c=n===null||n.editor===y,u=i.has("history-push");if(!u&&c&&i.has("history-merge"))return iu;if(f===null)return Of;const h=r._selection;return e.size>0||s.size>0?u===!1&&o!==yo&&o===t&&l<g+d&&c||e.size===1&&function(p,m,b){const _=m._nodeMap.get(p),v=b._nodeMap.get(p),w=m._selection,x=b._selection;let S=!1;return xe(w)&&xe(x)&&(S=w.anchor.type==="element"&&w.focus.type==="element"&&x.anchor.type==="text"&&x.focus.type==="text"),!(S||!Ne(_)||!Ne(v))&&_.__type===v.__type&&_.__text===v.__text&&_.__mode===v.__mode&&_.__detail===v.__detail&&_.__style===v.__style&&_.__format===v.__format&&_.__parent===v.__parent}(Array.from(e)[0],f,r)?iu:Of:h!==null?iu:Tf})();return g=l,t=o,a}}function fm(y){y.undoStack=[],y.redoStack=[],y.current=null}function T1(y,d,g){const t=O1(y,g);return mo(y.registerCommand(cl,()=>(function(r,n){const e=n.redoStack,s=n.undoStack;if(s.length!==0){const i=n.current,l=s.pop();i!==null&&(e.push(i),r.dispatchCommand(Xa,!0)),s.length===0&&r.dispatchCommand(ts,!1),n.current=l||null,l&&l.editor.setEditorState(l.editorState,{tag:"historic"})}}(y,d),!0),an),y.registerCommand(ul,()=>(function(r,n){const e=n.redoStack,s=n.undoStack;if(e.length!==0){const i=n.current;i!==null&&(s.push(i),r.dispatchCommand(ts,!0));const l=e.pop();e.length===0&&r.dispatchCommand(Xa,!1),n.current=l||null,l&&l.editor.setEditorState(l.editorState,{tag:"historic"})}}(y,d),!0),an),y.registerCommand(Od,()=>(fm(d),!1),an),y.registerCommand(av,()=>(fm(d),y.dispatchCommand(Xa,!1),y.dispatchCommand(ts,!1),!0),an),y.registerUpdateListener(({editorState:r,prevEditorState:n,dirtyLeaves:e,dirtyElements:s,tags:i})=>{const l=d.current,o=d.redoStack,a=d.undoStack,c=l===null?null:l.editorState;if(l!==null&&r===c)return;const u=t(n,r,l,e,s,i);if(u===Of)o.length!==0&&(d.redoStack=[],y.dispatchCommand(Xa,!1)),l!==null&&(a.push({...l}),y.dispatchCommand(ts,!0));else if(u===Tf)return;d.current={editor:y,editorState:r}}))}function j1(){return{current:null,redoStack:[],undoStack:[]}}function pm({externalHistoryState:y}){const[d]=jr();return function(g,t,f=1e3){const r=Ce.useMemo(()=>t||j1(),[t]);Ce.useEffect(()=>T1(g,r,f),[f,g,r])}(d,y),null}const A1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ce.useLayoutEffect:Ce.useEffect;function P1(y){return{initialValueFn:()=>y.isEditable(),subscribe:d=>y.registerEditableListener(d)}}function au(){return function(y){const[d]=jr(),g=Ce.useMemo(()=>y(d),[d,y]),t=Ce.useRef(g.initialValueFn()),[f,r]=Ce.useState(t.current);return A1(()=>{const{initialValueFn:n,subscribe:e}=g,s=n();return t.current!==s&&(t.current=s,r(s)),e(i=>{t.current=i,r(i)})},[g,y]),f}(P1)}function hm(){return Ln().getTextContent()}function gm(y,d=!0){if(y)return!1;let g=hm();return d&&(g=g.trim()),g===""}function N1(y){if(!gm(y,!1))return!1;const d=Ln().getChildren(),g=d.length;if(g>1)return!1;for(let t=0;t<g;t++){const f=d[t];if(Tn(f))return!1;if(ge(f)){if(!va(f)||f.__indent!==0)return!1;const r=f.getChildren(),n=r.length;for(let e=0;e<n;e++){const s=r[t];if(!Ne(s))return!1}}}return!0}function mm(y){return()=>N1(y)}function I1(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}I1(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function ym(y){const d=window.location.origin,g=t=>{if(t.origin!==d)return;const f=y.getRootElement();if(document.activeElement!==f)return;const r=t.data;if(typeof r=="string"){let n;try{n=JSON.parse(r)}catch{return}if(n&&n.protocol==="nuanria_messaging"&&n.type==="request"){const e=n.payload;if(e&&e.functionId==="makeChanges"){const s=e.args;if(s){const[i,l,o,a,c,u]=s;y.update(()=>{const h=Oe();if(xe(h)){const p=h.anchor;let m=p.getNode(),b=0,_=0;if(Ne(m)&&i>=0&&l>=0&&(b=i,_=i+l,h.setTextNodeRange(m,b,m,_)),b===_&&o===""||(h.insertRawText(o),m=p.getNode()),Ne(m)){b=a,_=a+c;const v=m.getTextContentSize();b=b>v?v:b,_=_>v?v:_,h.setTextNodeRange(m,b,m,_)}t.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",g,!0),()=>{window.removeEventListener("message",g,!0)}}function R1(y,d){const g=d.body?d.body.childNodes:[];let t=[];const f=[];for(let r=0;r<g.length;r++){const n=g[r];if(!vm.has(n.nodeName)){const e=_m(n,y,f,!1);e!==null&&(t=t.concat(e))}}return function(r){for(const n of r)n.getNextSibling()instanceof Cf&&n.insertAfter(ls());for(const n of r){const e=n.getChildren();for(const s of e)n.insertBefore(s);n.remove()}}(f),t}function M1(y,d){if(typeof document>"u"||typeof window>"u"&&global.window===void 0)throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const g=document.createElement("div"),t=Ln().getChildren();for(let f=0;f<t.length;f++)bm(y,t[f],g,d);return g.innerHTML}function bm(y,d,g,t=null){let f=t===null||d.isSelected(t);const r=ge(d)&&d.excludeFromCopy("html");let n=d;if(t!==null){let c=nm(d);c=Ne(c)&&t!==null?rm(t,c):c,n=c}const e=ge(n)?n.getChildren():[],s=y._nodes.get(n.getType());let i;i=s&&s.exportDOM!==void 0?s.exportDOM(y,n):n.exportDOM(y);const{element:l,after:o}=i;if(!l)return!1;const a=document.createDocumentFragment();for(let c=0;c<e.length;c++){const u=e[c],h=bm(y,u,a,t);!f&&ge(d)&&h&&d.extractWithChild(u,t,"html")&&(f=!0)}if(f&&!r){if(Sl(l)&&l.append(a),g.append(l),o){const c=o.call(n,l);c&&l.replaceWith(c)}}else g.append(a);return f}const vm=new Set(["STYLE","SCRIPT"]);function _m(y,d,g,t,f=new Map,r){let n=[];if(vm.has(y.nodeName))return n;let e=null;const s=function(u,h){const{nodeName:p}=u,m=h._htmlConversions.get(p.toLowerCase());let b=null;if(m!==void 0)for(const _ of m){const v=_(u);v!==null&&(b===null||(b.priority||0)<(v.priority||0))&&(b=v)}return b!==null?b.conversion:null}(y,d),i=s?s(y):null;let l=null;if(i!==null){l=i.after;const u=i.node;if(e=Array.isArray(u)?u[u.length-1]:u,e!==null){for(const[,h]of f)if(e=h(e,r),!e)break;e&&n.push(...Array.isArray(u)?u:[e])}i.forChild!=null&&f.set(y.nodeName,i.forChild)}const o=y.childNodes;let a=[];const c=(e==null||!ko(e))&&(e!=null&&yf(e)||t);for(let u=0;u<o.length;u++)a.push(..._m(o[u],d,g,c,new Map(f),e));return l!=null&&(a=l(a)),Fv(y)&&(a=D1(y,a,c?()=>{const u=new Cf;return g.push(u),u}:Un)),e==null?n=n.concat(a):ge(e)&&e.append(...a),n}function D1(y,d,g){const t=y.style.textAlign,f=[];let r=[];for(let n=0;n<d.length;n++){const e=d[n];if(yf(e))t&&!e.getFormat()&&e.setFormat(t),f.push(e);else if(r.push(e),n===d.length-1||n<d.length-1&&yf(d[n+1])){const s=g();s.setFormat(t),s.append(...r),f.push(s),r=[]}}return f}function L1(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var su=L1(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const B1=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,xm=y=>B1?(y||window).getSelection():null;function wm(y){const d=Oe();return d==null&&su(166),xe(d)&&d.isCollapsed()||d.getNodes().length===0?"":M1(y,d)}function F1(y){const d=Oe();return d==null&&su(166),xe(d)&&d.isCollapsed()||d.getNodes().length===0?null:JSON.stringify(z1(y,d))}function Sm(y,d){const g=y.getData("text/plain")||y.getData("text/uri-list");g!=null&&d.insertRawText(g)}function Cm(y,d,g){const t=y.getData("application/x-lexical-editor");if(t)try{const n=JSON.parse(t);if(n.namespace===g._config.namespace&&Array.isArray(n.nodes))return Em(g,U1(n.nodes),d)}catch{}const f=y.getData("text/html");if(f)try{const n=new DOMParser().parseFromString(f,"text/html");return Em(g,R1(g,n),d)}catch{}const r=y.getData("text/plain")||y.getData("text/uri-list");if(r!=null)if(xe(d)){const n=r.split(/(\r?\n|\t)/);n[n.length-1]===""&&n.pop();for(let e=0;e<n.length;e++){const s=Oe();if(xe(s)){const i=n[e];i===`
|
|
40
40
|
`||i===`\r
|
|
41
|
-
`?s.insertParagraph():i===" "?s.insertNodes([Pl()]):s.insertText(i)}}}else d.insertRawText(r)}function km(y,d,g){y.dispatchCommand(_h,{nodes:d,selection:g})||g.insertNodes(d)}function Om(y,d,g,t=[]){let f=d===null||g.isSelected(d);const r=ge(g)&&g.excludeFromCopy("html");let n=g;if(d!==null){let i=rm(g);i=Ne(i)&&d!==null?om(d,i):i,n=i}const e=ge(n)?n.getChildren():[],s=function(i){const l=i.exportJSON(),o=i.constructor;if(l.type!==o.getType()&&su(58,o.name),ge(i)){const a=l.children;Array.isArray(a)||su(59,o.name)}return l}(n);if(Ne(n)){const i=n.__text;i.length>0?s.text=i:f=!1}for(let i=0;i<e.length;i++){const l=e[i],o=Om(y,d,l,s.children);!f&&ge(g)&&o&&g.extractWithChild(l,d,"clone")&&(f=!0)}if(f&&!r)t.push(s);else if(Array.isArray(s.children))for(let i=0;i<s.children.length;i++){const l=s.children[i];t.push(l)}return f}function $1(y,d){const g=[],t=Ln().getChildren();for(let f=0;f<t.length;f++)Om(y,d,t[f],g);return{namespace:y._config.namespace,nodes:g}}function H1(y){const d=[];for(let g=0;g<y.length;g++){const t=y[g],f=i1(t);Ne(f)&&m1(f),d.push(f)}return d}let ps=null;async function Tm(y,d){if(ps!==null)return!1;if(d!==null)return new Promise((e,s)=>{y.update(()=>{e(jm(y,d))})});const g=y.getRootElement(),t=y._window==null?window.document:y._window.document,f=wm(y._window);if(g===null||f===null)return!1;const r=t.createElement("span");r.style.cssText="position: fixed; top: -1000px;",r.append(t.createTextNode("#")),g.append(r);const n=new Range;return n.setStart(r,0),n.setEnd(r,1),f.removeAllRanges(),f.addRange(n),new Promise((e,s)=>{const i=y.registerCommand(hl,l=>(Ii(l,ClipboardEvent)&&(i(),ps!==null&&(window.clearTimeout(ps),ps=null),e(jm(y,l))),!0),to);ps=window.setTimeout(()=>{i(),ps=null,e(!1)},50),t.execCommand("copy"),r.remove()})}function jm(y,d){const g=wm(y._window);if(!g)return!1;const t=g.anchorNode,f=g.focusNode;if(t!==null&&f!==null&&!yl(y,t,f))return!1;d.preventDefault();const r=d.clipboardData,n=Oe();if(r===null||n===null)return!1;const e=Sm(y),s=U1(y);let i="";return n!==null&&(i=n.getTextContent()),e!==null&&r.setData("text/html",e),s!==null&&r.setData("application/x-lexical-editor",s),r.setData("text/plain",i),!0}function Am(y,d){if(document.caretRangeFromPoint!==void 0){const g=document.caretRangeFromPoint(y,d);return g===null?null:{node:g.startContainer,offset:g.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const g=document.caretPositionFromPoint(y,d);return g===null?null:{node:g.offsetNode,offset:g.offset}}return null}const hs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,q1=hs&&"documentMode"in document?document.documentMode:null,J1=!(!hs||!("InputEvent"in window)||q1)&&"getTargetRanges"in new window.InputEvent("input"),V1=hs&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),W1=hs&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,K1=hs&&/^(?=.*Chrome).*/i.test(navigator.userAgent),G1=hs&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!K1,Pm=wd();function lu(y){let d=null;if(Ii(y,DragEvent)?d=y.dataTransfer:Ii(y,ClipboardEvent)&&(d=y.clipboardData),d===null)return[!1,[],!1];const g=d.types,t=g.includes("Files"),f=g.includes("text/html")||g.includes("text/plain");return[t,Array.from(d.files),f]}function Nm(y){const d=Oe();if(!xe(d))return!1;const g=new Set,t=d.getNodes();for(let f=0;f<t.length;f++){const r=t[f],n=r.getKey();if(g.has(n))continue;const e=vn(r,i=>ge(i)&&!i.isInline());if(e===null)continue;const s=e.getKey();e.canIndent()&&!g.has(s)&&(g.add(s),y(e))}return g.size>0}function cu(y){const d=rr(y);return Tn(d)}function Y1(y){return mo(y.registerCommand(xh,d=>{const g=Oe();return!!Xr(g)&&(g.clear(),!0)},0),y.registerCommand(uo,d=>{const g=Oe();return!!xe(g)&&(g.deleteCharacter(d),!0)},an),y.registerCommand(ca,d=>{const g=Oe();return!!xe(g)&&(g.deleteWord(d),!0)},an),y.registerCommand(Ci,d=>{const g=Oe();return!!xe(g)&&(g.deleteLine(d),!0)},an),y.registerCommand(Si,d=>{const g=Oe();if(typeof d=="string")g!==null&&g.insertText(d);else{if(g===null)return!1;const t=d.dataTransfer;if(t!=null)Em(t,g,y);else if(xe(g)){const f=d.data;return f&&g.insertText(f),!0}}return!0},an),y.registerCommand(Sc,()=>{const d=Oe();return!!xe(d)&&(d.removeText(),!0)},an),y.registerCommand(Er,d=>{const g=Oe();return!!xe(g)&&(g.formatText(d),!0)},an),y.registerCommand(Qa,d=>{const g=Oe();if(!xe(g)&&!Xr(g))return!1;const t=g.getNodes();for(const f of t){const r=vn(f,n=>ge(n)&&!n.isInline());r!==null&&r.setFormat(d)}return!0},an),y.registerCommand(wi,d=>{const g=Oe();return!!xe(g)&&(g.insertLineBreak(d),!0)},an),y.registerCommand(Za,()=>{const d=Oe();return!!xe(d)&&(d.insertParagraph(),!0)},an),y.registerCommand(iv,()=>(n1([Pl()]),!0),an),y.registerCommand(av,()=>Nm(d=>{const g=d.getIndent();d.setIndent(g+1)}),an),y.registerCommand(Sh,()=>Nm(d=>{const g=d.getIndent();g>0&&d.setIndent(g-1)}),an),y.registerCommand(Sd,d=>{const g=Oe();if(Xr(g)&&!cu(d.target)){const t=g.getNodes();if(t.length>0)return t[0].selectPrevious(),!0}else if(xe(g)){const t=wl(g.focus,!0);if(!d.shiftKey&&Tn(t)&&!t.isIsolated()&&!t.isInline())return t.selectPrevious(),d.preventDefault(),!0}return!1},an),y.registerCommand(Cd,d=>{const g=Oe();if(Xr(g)){const t=g.getNodes();if(t.length>0)return t[0].selectNext(0,0),!0}else if(xe(g)){if(function(f){const r=f.focus;return r.key==="root"&&r.offset===Ln().getChildrenSize()}(g))return d.preventDefault(),!0;const t=wl(g.focus,!1);if(!d.shiftKey&&Tn(t)&&!t.isIsolated()&&!t.isInline())return t.selectNext(),d.preventDefault(),!0}return!1},an),y.registerCommand(Ec,d=>{const g=Oe();if(Xr(g)){const t=g.getNodes();if(t.length>0)return d.preventDefault(),t[0].selectPrevious(),!0}if(!xe(g))return!1;if(ru(g,!0)){const t=d.shiftKey;return d.preventDefault(),ou(g,t,!0),!0}return!1},an),y.registerCommand(Cc,d=>{const g=Oe();if(Xr(g)&&!cu(d.target)){const f=g.getNodes();if(f.length>0)return d.preventDefault(),f[0].selectNext(0,0),!0}if(!xe(g))return!1;const t=d.shiftKey;return!!ru(g,!1)&&(d.preventDefault(),ou(g,t,!1),!0)},an),y.registerCommand(fl,d=>{if(cu(d.target))return!1;const g=Oe();if(!xe(g))return!1;d.preventDefault();const{anchor:t}=g,f=t.getNode();return g.isCollapsed()&&t.offset===0&&!vr(f)&&S1(f).getIndent()>0?y.dispatchCommand(Sh,void 0):y.dispatchCommand(uo,!0)},an),y.registerCommand(pl,d=>{if(cu(d.target))return!1;const g=Oe();return!!xe(g)&&(d.preventDefault(),y.dispatchCommand(uo,!1))},an),y.registerCommand(dl,d=>{const g=Oe();if(!xe(g))return!1;if(d!==null){if((W1||V1||G1)&&J1)return!1;if(d.preventDefault(),d.shiftKey)return y.dispatchCommand(wi,!1)}return y.dispatchCommand(Za,void 0)},an),y.registerCommand(kc,()=>{const d=Oe();return!!xe(d)&&(y.blur(),!0)},an),y.registerCommand(Ed,d=>{const[,g]=lu(d);if(g.length>0){const f=Am(d.clientX,d.clientY);if(f!==null){const{offset:r,node:n}=f,e=rr(n);if(e!==null){const s=bf();if(Ne(e))s.anchor.set(e.getKey(),r,"text"),s.focus.set(e.getKey(),r,"text");else{const l=e.getParentOrThrow().getKey(),o=e.getIndexWithinParent()+1;s.anchor.set(l,o,"element"),s.focus.set(l,o,"element")}const i=zd(s);or(i)}y.dispatchCommand(Pm,g)}return d.preventDefault(),!0}const t=Oe();return!!xe(t)},an),y.registerCommand(kd,d=>{const[g]=lu(d),t=Oe();return!(g&&!xe(t))},an),y.registerCommand(Ch,d=>{const[g]=lu(d),t=Oe();if(g&&!xe(t))return!1;const f=Am(d.clientX,d.clientY);if(f!==null){const r=rr(f.node);Tn(r)&&d.preventDefault()}return!0},an),y.registerCommand(Oc,()=>(Qh(),!0),an),y.registerCommand(hl,d=>(Tm(y,Ii(d,ClipboardEvent)?d:null),!0),an),y.registerCommand(gl,d=>(async function(g,t){await Tm(t,Ii(g,ClipboardEvent)?g:null),t.update(()=>{const f=Oe();xe(f)?f.removeText():Xr(f)&&f.getNodes().forEach(r=>r.remove())})}(d,y),!0),an),y.registerCommand(ll,d=>{const[,g,t]=lu(d);return g.length>0&&!t?(y.dispatchCommand(Pm,g),!0):Ud(d.target)?!1:Oe()!==null&&(function(f,r){f.preventDefault(),r.update(()=>{const n=Oe(),e=Ii(f,InputEvent)||Ii(f,KeyboardEvent)?null:f.clipboardData;e!=null&&n!==null&&Em(e,n,r)},{tag:"paste"})}(d,y),!0)},an))}const jf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ce.useLayoutEffect:Ce.useEffect;function Im(y){return y.getEditorState().read(ym(y.isComposing()))}function Z1({contentEditable:y,placeholder:d,ErrorBoundary:g}){const[t]=jr(),f=function(r,n){const[e,s]=Ce.useState(()=>r.getDecorators());return jf(()=>r.registerDecoratorListener(i=>{$r.flushSync(()=>{s(i)})}),[r]),Ce.useEffect(()=>{s(r.getDecorators())},[r]),Ce.useMemo(()=>{const i=[],l=Object.keys(e);for(let o=0;o<l.length;o++){const a=l[o],c=he.jsx(n,{onError:h=>r._onError(h),children:he.jsx(Ce.Suspense,{fallback:null,children:e[a]})}),u=r.getElementByKey(a);u!==null&&i.push($r.createPortal(c,u,a))}return i},[n,e,r])}(t,g);return function(r){jf(()=>mo(Y1(r),bm(r)),[r])}(t),he.jsxs(he.Fragment,{children:[y,he.jsx(Q1,{content:d}),f]})}function Q1({content:y}){const[d]=jr(),g=function(f){const[r,n]=Ce.useState(()=>Im(f));return jf(()=>{function e(){const s=Im(f);n(s)}return e(),mo(f.registerUpdateListener(()=>{e()}),f.registerEditableListener(()=>{e()}))},[f]),r}(d),t=au();return g?typeof y=="function"?y(t):y:null}const X1=new Set(["http:","https:","mailto:","sms:","tel:"]);let Rm=class Yb extends jo{static getType(){return"link"}static clone(d){return new Yb(d.__url,{rel:d.__rel,target:d.__target,title:d.__title},d.__key)}constructor(d,g={},t){super(t);const{target:f=null,rel:r=null,title:n=null}=g;this.__url=d,this.__target=f,this.__rel=r,this.__title=n}createDOM(d){const g=document.createElement("a");return g.href=this.sanitizeUrl(this.__url),this.__target!==null&&(g.target=this.__target),this.__rel!==null&&(g.rel=this.__rel),this.__title!==null&&(g.title=this.__title),Ni(g,d.theme.link),g}updateDOM(d,g,t){if(g instanceof HTMLAnchorElement){const f=this.__url,r=this.__target,n=this.__rel,e=this.__title;f!==d.__url&&(g.href=f),r!==d.__target&&(r?g.target=r:g.removeAttribute("target")),n!==d.__rel&&(n?g.rel=n:g.removeAttribute("rel")),e!==d.__title&&(e?g.title=e:g.removeAttribute("title"))}return!1}static importDOM(){return{a:d=>({conversion:t_,priority:1})}}static importJSON(d){const g=Af(d.url,{rel:d.rel,target:d.target,title:d.title});return g.setFormat(d.format),g.setIndent(d.indent),g.setDirection(d.direction),g}sanitizeUrl(d){try{const g=new URL(d);if(!X1.has(g.protocol))return"about:blank"}catch{return d}return d}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(d){this.getWritable().__url=d}getTarget(){return this.getLatest().__target}setTarget(d){this.getWritable().__target=d}getRel(){return this.getLatest().__rel}setRel(d){this.getWritable().__rel=d}getTitle(){return this.getLatest().__title}setTitle(d){this.getWritable().__title=d}insertNewAfter(d,g=!0){const t=Af(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(t,g),t}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(d,g,t){if(!xe(g))return!1;const f=g.anchor.getNode(),r=g.focus.getNode();return this.isParentOf(f)&&this.isParentOf(r)&&g.getTextContent().length>0}};function t_(y){let d=null;if(Fv(y)){const g=y.textContent;(g!==null&&g!==""||y.children.length>0)&&(d=Af(y.getAttribute("href")||"",{rel:y.getAttribute("rel"),target:y.getAttribute("target"),title:y.getAttribute("title")}))}return{node:d}}function Af(y,d){return Yo(new Rm(y,d))}function e_(y){return y instanceof Rm}let Pf=class Zb extends jo{static getType(){return"mark"}static clone(d){return new Zb(Array.from(d.__ids),d.__key)}static importDOM(){return null}static importJSON(d){const g=uu(d.ids);return g.setFormat(d.format),g.setIndent(d.indent),g.setDirection(d.direction),g}exportJSON(){return{...super.exportJSON(),ids:this.getIDs(),type:"mark",version:1}}constructor(d,g){super(g),this.__ids=d||[]}createDOM(d){const g=document.createElement("mark");return Ni(g,d.theme.mark),this.__ids.length>1&&Ni(g,d.theme.markOverlap),g}updateDOM(d,g,t){const f=d.__ids,r=this.__ids,n=f.length,e=r.length,s=t.theme.markOverlap;return n!==e&&(n===1?e===2&&Ni(g,s):e===1&&cm(g,s)),!1}hasID(d){const g=this.getIDs();for(let t=0;t<g.length;t++)if(d===g[t])return!0;return!1}getIDs(){const d=this.getLatest();return _a(d)?d.__ids:[]}addID(d){const g=this.getWritable();if(_a(g)){const t=g.__ids;g.__ids=t;for(let f=0;f<t.length;f++)if(d===t[f])return;t.push(d)}}deleteID(d){const g=this.getWritable();if(_a(g)){const t=g.__ids;g.__ids=t;for(let f=0;f<t.length;f++)if(d===t[f])return void t.splice(f,1)}}insertNewAfter(d,g=!0){const t=uu(this.__ids);return this.insertAfter(t,g),t}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(d,g,t){if(!xe(g)||t==="html")return!1;const f=g.anchor,r=g.focus,n=f.getNode(),e=r.getNode(),s=g.isBackward()?f.offset-r.offset:r.offset-f.offset;return this.isParentOf(n)&&this.isParentOf(e)&&this.getTextContent().length===s}excludeFromCopy(d){return d!=="clone"}};function uu(y){return Yo(new Pf(y))}function _a(y){return y instanceof Pf}function n_(y){const d=y.getChildren();let g=null;for(let t=0;t<d.length;t++){const f=d[t];g===null?y.insertBefore(f):g.insertAfter(f),g=f}y.remove()}function r_(y,d,g,t){const f=y.getNodes(),r=y.anchor.offset,n=y.focus.offset,e=f.length,s=d?n:r,i=d?r:n;let l,o;for(let a=0;a<e;a++){const c=f[a];if(ge(o)&&o.isParentOf(c))continue;const u=a===0,h=a===e-1;let p=null;if(Ne(c)){const m=c.getTextContentSize(),b=u?s:0,_=h?i:m;if(b===0&&_===0)continue;const v=c.splitText(b,_);p=v.length>1&&(v.length===3||u&&!h||_===m)?v[1]:v[0]}else{if(_a(c))continue;ge(c)&&c.isInline()&&(p=c)}if(p!==null){if(p&&p.is(l))continue;const m=p.getParent();m!=null&&m.is(l)||(o=void 0),l=m,o===void 0&&(o=(t||uu)([g]),p.insertBefore(o)),o.append(p)}else l=void 0,o=void 0}ge(o)&&(d?o.selectStart():o.selectEnd())}function o_(y,d){let g=y;for(;g!==null;){if(_a(g))return g.getIDs();if(Ne(g)&&d===g.getTextContentSize()){const t=g.getNextSibling();if(_a(t))return t.getIDs()}g=g.getParent()}return null}const Mm=/^(\d+(?:\.\d+)?)px$/,Ar={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Ao extends jo{static getType(){return"tablecell"}static clone(d){const g=new Ao(d.__headerState,d.__colSpan,d.__width,d.__key);return g.__rowSpan=d.__rowSpan,g.__backgroundColor=d.__backgroundColor,g}static importDOM(){return{td:d=>({conversion:Dm,priority:0}),th:d=>({conversion:Dm,priority:0})}}static importJSON(d){const g=d.colSpan||1,t=d.rowSpan||1,f=Xo(d.headerState,g,d.width||void 0);return f.__rowSpan=t,f.__backgroundColor=d.backgroundColor||null,f}constructor(d=Ar.NO_STATUS,g=1,t,f){super(f),this.__colSpan=g,this.__rowSpan=1,this.__headerState=d,this.__width=t,this.__backgroundColor=null}createDOM(d){const g=document.createElement(this.getTag());return this.__width&&(g.style.width=`${this.__width}px`),this.__colSpan>1&&(g.colSpan=this.__colSpan),this.__rowSpan>1&&(g.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(g.style.backgroundColor=this.__backgroundColor),Ni(g,d.theme.tableCell,this.hasHeader()&&d.theme.tableCellHeader),g}exportDOM(d){const{element:g}=super.exportDOM(d);if(g){const t=g;t.style.border="1px solid black",this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),t.style.width=`${this.getWidth()||75}px`,t.style.verticalAlign="top",t.style.textAlign="start";const f=this.getBackgroundColor();f!==null?t.style.backgroundColor=f:this.hasHeader()&&(t.style.backgroundColor="#f2f3f5")}return{element:g}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth()}}getColSpan(){return this.__colSpan}setColSpan(d){return this.getWritable().__colSpan=d,this}getRowSpan(){return this.__rowSpan}setRowSpan(d){return this.getWritable().__rowSpan=d,this}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(d){return this.getWritable().__headerState=d,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(d){return this.getWritable().__width=d,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(d){this.getWritable().__backgroundColor=d}toggleHeaderStyle(d){const g=this.getWritable();return(g.__headerState&d)===d?g.__headerState-=d:g.__headerState+=d,g}hasHeaderState(d){return(this.getHeaderStyles()&d)===d}hasHeader(){return this.getLatest().__headerState!==Ar.NO_STATUS}updateDOM(d){return d.__headerState!==this.__headerState||d.__width!==this.__width||d.__colSpan!==this.__colSpan||d.__rowSpan!==this.__rowSpan||d.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function Dm(y){const d=y,g=y.nodeName.toLowerCase();let t;Mm.test(d.style.width)&&(t=parseFloat(d.style.width));const f=Xo(g==="th"?Ar.ROW:Ar.NO_STATUS,d.colSpan,t);f.__rowSpan=d.rowSpan;const r=d.style.backgroundColor;r!==""&&(f.__backgroundColor=r);const n=d.style,e=n.textDecoration.split(" "),s=n.fontWeight==="700"||n.fontWeight==="bold",i=e.includes("line-through"),l=n.fontStyle==="italic",o=e.includes("underline");return{after:a=>(a.length===0&&a.push(Un()),a),forChild:(a,c)=>{if(rn(c)&&!ge(a)){const u=Un();return ha(a)&&a.getTextContent()===`
|
|
42
|
-
`?null:(Ne(a)&&(s&&a.toggleFormat("bold"),i&&a.toggleFormat("strikethrough"),l&&a.toggleFormat("italic"),o&&a.toggleFormat("underline")),u.append(a),u)}return a},node:f}}function Xo(y,d=1,g){return Yo(new Ao(y,d,g))}function rn(y){return y instanceof Ao}const i_=wd();class xa extends jo{static getType(){return"tablerow"}static clone(d){return new xa(d.__height,d.__key)}static importDOM(){return{tr:d=>({conversion:a_,priority:0})}}static importJSON(d){return gs(d.height)}constructor(d,g){super(g),this.__height=d}exportJSON(){return{...super.exportJSON(),...this.getHeight()&&{height:this.getHeight()},type:"tablerow",version:1}}createDOM(d){const g=document.createElement("tr");return this.__height&&(g.style.height=`${this.__height}px`),Ni(g,d.theme.tableRow),g}isShadowRoot(){return!0}setHeight(d){return this.getWritable().__height=d,this.__height}getHeight(){return this.getLatest().__height}updateDOM(d){return d.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function a_(y){const d=y;let g;return Mm.test(d.style.height)&&(g=parseFloat(d.style.height)),{node:gs(g)}}function gs(y){return Yo(new xa(y))}function sr(y){return y instanceof xa}function s_(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var xn=s_(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const l_=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Lm(y,d,g=!0){const t=Df();for(let f=0;f<y;f++){const r=gs();for(let n=0;n<d;n++){let e=Ar.NO_STATUS;typeof g=="object"?(f===0&&g.rows&&(e|=Ar.ROW),n===0&&g.columns&&(e|=Ar.COLUMN)):g&&(f===0&&(e|=Ar.ROW),n===0&&(e|=Ar.COLUMN));const s=Xo(e),i=Un();i.append(ar()),s.append(i),r.append(s)}t.append(r)}return t}function Bm(y){const d=vn(y,g=>sr(g));if(sr(d))return d;throw new Error("Expected table cell to be inside of table row.")}function c_(y){const d=vn(y,g=>Pn(g));if(Pn(d))return d;throw new Error("Expected table cell to be inside of table.")}function u_(y){const d=Bm(y);return c_(d).getChildren().findIndex(g=>g.is(d))}function Fm(y){return Bm(y).getChildren().findIndex(d=>d.is(y))}const Nf=(y,d)=>y===Ar.BOTH||y===d?d:Ar.NO_STATUS;function d_(y=!0){const d=Oe();xe(d)||Bn(d)||xn(118);const g=d.focus.getNode(),[t,,f]=qr(g),[r,n]=Po(f,t,t),e=r[0].length,{startRow:s}=n;if(y){const i=s+t.__rowSpan-1,l=r[i],o=gs();for(let c=0;c<e;c++){const{cell:u,startRow:h}=l[c];if(h+u.__rowSpan-1<=i){const p=l[c].cell.__headerState,m=Nf(p,Ar.COLUMN);o.append(Xo(m).append(Un()))}else u.setRowSpan(u.__rowSpan+1)}const a=f.getChildAtIndex(i);sr(a)||xn(145),a.insertAfter(o)}else{const i=r[s],l=gs();for(let a=0;a<e;a++){const{cell:c,startRow:u}=i[a];if(u===s){const h=i[a].cell.__headerState,p=Nf(h,Ar.COLUMN);l.append(Xo(p).append(Un()))}else c.setRowSpan(c.__rowSpan+1)}const o=f.getChildAtIndex(s);sr(o)||xn(145),o.insertBefore(l)}}function f_(y=!0){const d=Oe();xe(d)||Bn(d)||xn(118);const g=d.anchor.getNode(),t=d.focus.getNode(),[f]=qr(g),[r,,n]=qr(t),[e,s,i]=Po(n,r,f),l=e.length,o=y?Math.max(s.startColumn,i.startColumn):Math.min(s.startColumn,i.startColumn),a=y?o+r.__colSpan-1:o-1,c=n.getFirstChild();sr(c)||xn(120);let u=null;function h(m=Ar.NO_STATUS){const b=Xo(m).append(Un());return u===null&&(u=b),b}let p=c;t:for(let m=0;m<l;m++){if(m!==0){const E=p.getNextSibling();sr(E)||xn(121),p=E}const b=e[m],_=b[a<0?0:a].cell.__headerState,v=Nf(_,Ar.ROW);if(a<0){zm(p,h(v));continue}const{cell:w,startColumn:x,startRow:S}=b[a];if(x+w.__colSpan-1<=a){let E=w,k=S,D=a;for(;k!==m&&E.__rowSpan>1;){if(D-=w.__colSpan,!(D>=0)){p.append(h(v));continue t}{const{cell:P,startRow:O}=b[D];E=P,k=O}}E.insertAfter(h(v))}else w.setColSpan(w.__colSpan+1)}u!==null&&Il(u)}function p_(){const y=Oe();xe(y)||Bn(y)||xn(118);const d=y.anchor.getNode(),g=y.focus.getNode(),[t,,f]=qr(d),[r]=qr(g),[n,e,s]=Po(f,t,r),{startRow:i}=e,{startRow:l}=s,o=l+r.__rowSpan-1;if(n.length===o-i+1)return void f.remove();const a=n[0].length,c=n[o+1],u=f.getChildAtIndex(o+1);for(let h=o;h>=i;h--){for(let m=a-1;m>=0;m--){const{cell:b,startRow:_,startColumn:v}=n[h][m];if(v===m&&(h===i&&_<i&&b.setRowSpan(b.__rowSpan-(_-i)),_>=i&&_+b.__rowSpan-1>o))if(b.setRowSpan(b.__rowSpan-(o-_+1)),u===null&&xn(122),m===0)zm(u,b);else{const{cell:w}=c[m-1];w.insertAfter(b)}}const p=f.getChildAtIndex(h);sr(p)||xn(123,String(h)),p.remove()}if(c!==void 0){const{cell:h}=c[0];Il(h)}else{const h=n[i-1],{cell:p}=h[0];Il(p)}}function h_(){const y=Oe();xe(y)||Bn(y)||xn(118);const d=y.anchor.getNode(),g=y.focus.getNode(),[t,,f]=qr(d),[r]=qr(g),[n,e,s]=Po(f,t,r),{startColumn:i}=e,{startRow:l,startColumn:o}=s,a=Math.min(i,o),c=Math.max(i+t.__colSpan-1,o+r.__colSpan-1),u=c-a+1;if(n[0].length===c-a+1)return f.selectPrevious(),void f.remove();const h=n.length;for(let b=0;b<h;b++)for(let _=a;_<=c;_++){const{cell:v,startColumn:w}=n[b][_];if(w<a){if(_===a){const x=a-w;v.setColSpan(v.__colSpan-Math.min(u,v.__colSpan-x))}}else if(w+v.__colSpan-1>c){if(_===c){const x=c-w+1;v.setColSpan(v.__colSpan-x)}}else v.remove()}const p=n[l],m=i>o?p[i+t.__colSpan]:p[o+r.__colSpan];if(m!==void 0){const{cell:b}=m;Il(b)}else{const b=o<i?p[o-1]:p[i-1],{cell:_}=b;Il(_)}}function Il(y){const d=y.getFirstDescendant();d==null?y.selectStart():d.getParentOrThrow().selectStart()}function zm(y,d){const g=y.getFirstChild();g!==null?g.insertBefore(d):y.append(d)}function Po(y,d,g){const[t,f,r]=Um(y,d,g);return f===null&&xn(110),r===null&&xn(111),[t,f,r]}function Um(y,d,g){const t=[];let f=null,r=null;function n(i,l,o){const a={cell:o,startColumn:l,startRow:i},c=o.__rowSpan,u=o.__colSpan;for(let h=0;h<c;h++){t[i+h]===void 0&&(t[i+h]=[]);for(let p=0;p<u;p++)t[i+h][l+p]=a}d!==null&&d.is(o)&&(f=a),g!==null&&g.is(o)&&(r=a)}function e(i,l){return t[i]===void 0||t[i][l]===void 0}const s=y.getChildren();for(let i=0;i<s.length;i++){const l=s[i];sr(l)||xn(146);const o=l.getChildren();let a=0;for(const c of o){for(rn(c)||xn(147);!e(i,a);)a++;n(i,a,c),a+=c.__colSpan}}return[t,f,r]}function qr(y){let d;if(y instanceof Ao)d=y;else if("__type"in y){const f=vn(y,rn);rn(f)||xn(148),d=f}else{const f=vn(y.getNode(),rn);rn(f)||xn(148),d=f}const g=d.getParent();sr(g)||xn(149);const t=g.getParent();return Pn(t)||xn(150),[d,g,t]}function $m(y){const[d,,g]=qr(y),t=g.getChildren(),f=t.length,r=t[0].getChildren().length,n=new Array(f);for(let e=0;e<f;e++)n[e]=new Array(r);for(let e=0;e<f;e++){const s=t[e].getChildren();let i=0;for(let l=0;l<s.length;l++){for(;n[e][i];)i++;const o=s[l],a=o.__rowSpan||1,c=o.__colSpan||1;for(let u=0;u<a;u++)for(let h=0;h<c;h++)n[e+u][i+h]=o;if(d===o)return{colSpan:c,columnIndex:i,rowIndex:e,rowSpan:a};i+=c}}return null}class du{constructor(d,g,t){this.anchor=g,this.focus=t,g._selection=this,t._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=d}getStartEndPoints(){return[this.anchor,this.focus]}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(d){this._cachedNodes=d}is(d){return!!Bn(d)&&this.tableKey===d.tableKey&&this.anchor.is(d.anchor)&&this.focus.is(d.focus)}set(d,g,t){this.dirty=!0,this.tableKey=d,this.anchor.key=g,this.focus.key=t,this._cachedNodes=null}clone(){return new du(this.tableKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(d){}insertText(){}insertNodes(d){const g=this.focus.getNode();ge(g)||xn(151),zd(g.select(0,g.getChildrenSize())).insertNodes(d)}getShape(){const d=Vn(this.anchor.key);rn(d)||xn(152);const g=$m(d);g===null&&xn(153);const t=Vn(this.focus.key);rn(t)||xn(154);const f=$m(t);f===null&&xn(155);const r=Math.min(g.columnIndex,f.columnIndex),n=Math.max(g.columnIndex,f.columnIndex),e=Math.min(g.rowIndex,f.rowIndex),s=Math.max(g.rowIndex,f.rowIndex);return{fromX:Math.min(r,n),fromY:Math.min(e,s),toX:Math.max(r,n),toY:Math.max(e,s)}}getNodes(){const d=this._cachedNodes;if(d!==null)return d;const g=this.anchor.getNode(),t=this.focus.getNode(),f=vn(g,rn),r=vn(t,rn);rn(f)||xn(152),rn(r)||xn(154);const n=f.getParent();sr(n)||xn(156);const e=n.getParent();Pn(e)||xn(157);const s=r.getParents()[1];if(s!==e){if(e.isParentOf(r)){const S=s.getParent();S==null&&xn(159),this.set(this.tableKey,r.getKey(),S.getKey())}else{const S=e.getParent();S==null&&xn(158),this.set(this.tableKey,S.getKey(),r.getKey())}return this.getNodes()}const[i,l,o]=Po(e,f,r);let a=Math.min(l.startColumn,o.startColumn),c=Math.min(l.startRow,o.startRow),u=Math.max(l.startColumn+l.cell.__colSpan-1,o.startColumn+o.cell.__colSpan-1),h=Math.max(l.startRow+l.cell.__rowSpan-1,o.startRow+o.cell.__rowSpan-1),p=a,m=c,b=a,_=c;function v(S){const{cell:E,startColumn:k,startRow:D}=S;a=Math.min(a,k),c=Math.min(c,D),u=Math.max(u,k+E.__colSpan-1),h=Math.max(h,D+E.__rowSpan-1)}for(;a<p||c<m||u>b||h>_;){if(a<p){const S=_-m,E=p-1;for(let k=0;k<=S;k++)v(i[m+k][E]);p=E}if(c<m){const S=b-p,E=m-1;for(let k=0;k<=S;k++)v(i[E][p+k]);m=E}if(u>b){const S=_-m,E=b+1;for(let k=0;k<=S;k++)v(i[m+k][E]);b=E}if(h>_){const S=b-p,E=_+1;for(let k=0;k<=S;k++)v(i[E][p+k]);_=E}}const w=[e];let x=null;for(let S=c;S<=h;S++)for(let E=a;E<=u;E++){const{cell:k}=i[S][E],D=k.getParent();sr(D)||xn(160),D!==x&&w.push(D),w.push(k,...g_(k)),x=D}return cs()||(this._cachedNodes=w),w}getTextContent(){const d=this.getNodes();let g="";for(let t=0;t<d.length;t++)g+=d[t].getTextContent();return g}}function Bn(y){return y instanceof du}function fu(){const y=Qr("root",0,"element"),d=Qr("root",0,"element");return new du("root",y,d)}function g_(y){const d=[],g=[y];for(;g.length>0;){const t=g.pop();t===void 0&&xn(112),ge(t)&&g.unshift(...t.getChildren()),t!==y&&d.push(t)}return d}class m_{constructor(d,g){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=g,this.editor=d,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTable(),this.isSelecting=!1}getTable(){return this.table}removeListeners(){Array.from(this.listenersToRemove).forEach(d=>d())}trackTable(){const d=new MutationObserver(g=>{this.editor.update(()=>{let t=!1;for(let r=0;r<g.length;r++){const n=g[r].target.nodeName;if(n==="TABLE"||n==="TBODY"||n==="THEAD"||n==="TR"){t=!0;break}}if(!t)return;const f=this.editor.getElementByKey(this.tableNodeKey);if(!f)throw new Error("Expected to find TableElement in DOM");this.table=Rl(f)})});this.editor.update(()=>{const g=this.editor.getElementByKey(this.tableNodeKey);if(!g)throw new Error("Expected to find TableElement in DOM");this.table=Rl(g),d.observe(g,{childList:!0,subtree:!0})})}clearHighlight(){const d=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),d.update(()=>{if(!Pn(Vn(this.tableNodeKey)))throw new Error("Expected TableNode.");const g=d.getElementByKey(this.tableNodeKey);if(!g)throw new Error("Expected to find TableElement in DOM");const t=Rl(g);pu(d,t,null),or(null),d.dispatchCommand(Wo,void 0)})}enableHighlightStyle(){const d=this.editor;d.update(()=>{const g=d.getElementByKey(this.tableNodeKey);if(!g)throw new Error("Expected to find TableElement in DOM");cm(g,d._config.theme.tableSelection),g.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const d=this.editor;d.update(()=>{const g=d.getElementByKey(this.tableNodeKey);if(!g)throw new Error("Expected to find TableElement in DOM");Ni(g,d._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableTableSelection(d){if(d!==null&&d.tableKey===this.tableNodeKey){const g=this.editor;this.tableSelection=d,this.isHighlightingCells=!0,this.disableHighlightStyle(),pu(g,this.table,this.tableSelection)}else d==null?this.clearHighlight():(this.tableNodeKey=d.tableKey,this.updateTableTableSelection(d))}setFocusCellForSelection(d,g=!1){const t=this.editor;t.update(()=>{const f=Vn(this.tableNodeKey);if(!Pn(f))throw new Error("Expected TableNode.");if(!t.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const r=d.x,n=d.y;if(this.focusCell=d,this.anchorCell!==null){const e=Hm(t._window);e&&e.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(this.isHighlightingCells||this.anchorX===r&&this.anchorY===n&&!g){if(r===this.focusX&&n===this.focusY)return}else this.isHighlightingCells=!0,this.disableHighlightStyle();if(this.focusX=r,this.focusY=n,this.isHighlightingCells){const e=rr(d.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&rn(e)&&f.is(ms(e))){const s=e.getKey();this.tableSelection=this.tableSelection.clone()||fu(),this.focusCellNodeKey=s,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),or(this.tableSelection),t.dispatchCommand(Wo,void 0),pu(t,this.table,this.tableSelection)}}})}setAnchorCellForSelection(d){this.isHighlightingCells=!1,this.anchorCell=d,this.anchorX=d.x,this.anchorY=d.y,this.editor.update(()=>{const g=rr(d.elem);if(rn(g)){const t=g.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():fu(),this.anchorCellNodeKey=t}})}formatCells(d){this.editor.update(()=>{const g=Oe();Bn(g)||xn(11);const t=bf(),f=t.anchor,r=t.focus;g.getNodes().forEach(n=>{rn(n)&&n.getTextContentSize()!==0&&(f.set(n.getKey(),0,"element"),r.set(n.getKey(),n.getChildrenSize(),"element"),t.formatText(d))}),or(g),this.editor.dispatchCommand(Wo,void 0)})}clearText(){const d=this.editor;d.update(()=>{const g=Vn(this.tableNodeKey);if(!Pn(g))throw new Error("Expected TableNode.");const t=Oe();Bn(t)||xn(11);const f=t.getNodes().filter(rn);f.length!==this.table.columns*this.table.rows?(f.forEach(r=>{if(ge(r)){const n=Un(),e=ar();n.append(e),r.append(n),r.getChildren().forEach(s=>{s!==n&&s.remove()})}}),pu(d,this.table,null),or(null),d.dispatchCommand(Wo,void 0)):(g.selectPrevious(),g.remove(),Ln().selectStart())})}}const y_="__lexicalTableSelection",Hm=y=>l_?(y||window).getSelection():null;function b_(y,d,g,t){const f=g.getRootElement();if(f===null)throw new Error("No root element.");const r=new m_(g,y.getKey()),n=g._window||window;(function(o,a){o[y_]=a})(d,r);const e=()=>{const o=()=>{r.isSelecting=!1,n.removeEventListener("mouseup",o),n.removeEventListener("mousemove",a)},a=c=>{setTimeout(()=>{if(1&~c.buttons&&r.isSelecting)return r.isSelecting=!1,n.removeEventListener("mouseup",o),void n.removeEventListener("mousemove",a);const u=qm(c.target);u===null||r.anchorX===u.x&&r.anchorY===u.y||(c.preventDefault(),r.setFocusCellForSelection(u))},0)};return{onMouseMove:a,onMouseUp:o}};d.addEventListener("mousedown",o=>{setTimeout(()=>{if(o.button!==0||!n)return;const a=qm(o.target);a!==null&&(wa(o),r.setAnchorCellForSelection(a));const{onMouseUp:c,onMouseMove:u}=e();r.isSelecting=!0,n.addEventListener("mouseup",c),n.addEventListener("mousemove",u)},0)});const s=o=>{o.button===0&&g.update(()=>{const a=Oe(),c=o.target;Bn(a)&&a.tableKey===r.tableNodeKey&&f.contains(c)&&r.clearHighlight()})};n.addEventListener("mousedown",s),r.listenersToRemove.add(()=>n.removeEventListener("mousedown",s)),r.listenersToRemove.add(g.registerCommand(Cd,o=>Ml(g,o,"down",y,r),ds)),r.listenersToRemove.add(g.registerCommand(Sd,o=>Ml(g,o,"up",y,r),ds)),r.listenersToRemove.add(g.registerCommand(Ec,o=>Ml(g,o,"backward",y,r),ds)),r.listenersToRemove.add(g.registerCommand(Cc,o=>Ml(g,o,"forward",y,r),ds)),r.listenersToRemove.add(g.registerCommand(kc,o=>{const a=Oe();if(Bn(a)){const c=vn(a.focus.getNode(),rn);if(rn(c))return wa(o),c.selectEnd(),!0}return!1},ds)),[ca,Ci,uo].forEach(o=>{r.listenersToRemove.add(g.registerCommand(o,(a=>()=>{const c=Oe();if(!Ri(c,y))return!1;if(Bn(c))return r.clearText(),!0;if(xe(c)){const u=vn(c.anchor.getNode(),w=>rn(w));if(!rn(u))return!1;const h=c.anchor.getNode(),p=c.focus.getNode(),m=y.isParentOf(h),b=y.isParentOf(p);if(m&&!b||b&&!m)return r.clearText(),!0;const _=vn(c.anchor.getNode(),w=>ge(w)),v=_&&vn(_,w=>ge(w)&&rn(w.getParent()));if(!ge(v)||!ge(_))return!1;if(a===Ci&&v.getPreviousSibling()===null)return!0}return!1})(o),to))});const i=o=>{const a=Oe();if(!Ri(a,y)){const c=a?a.getNodes():null;if(c){const u=c.find(h=>Pn(h)&&h.getKey()===r.tableNodeKey);if(Pn(u)){const h=u.getParent();if(!h)return!1;const p=u.getNextSibling()||u.getPreviousSibling();u.remove(),p?p.selectStart():h.selectStart()}}return!0}if(Bn(a))return o.preventDefault(),o.stopPropagation(),r.clearText(),!0;if(xe(a)){const c=vn(a.anchor.getNode(),u=>rn(u));if(!rn(c))return!1}return!1};function l(o){const a=y.getCordsFromCellNode(o,r.table);return y.getDOMCellFromCordsOrThrow(a.x,a.y,r.table)}return r.listenersToRemove.add(g.registerCommand(fl,i,to)),r.listenersToRemove.add(g.registerCommand(pl,i,to)),r.listenersToRemove.add(g.registerCommand(Er,o=>{const a=Oe();if(!Ri(a,y))return!1;if(Bn(a))return r.formatCells(o),!0;if(xe(a)){const c=vn(a.anchor.getNode(),u=>rn(u));if(!rn(c))return!1}return!1},to)),r.listenersToRemove.add(g.registerCommand(Qa,o=>{const a=Oe();if(!Bn(a)||!Ri(a,y))return!1;const c=a.anchor.getNode(),u=a.focus.getNode();if(!rn(c)||!rn(u))return!1;const[h,p,m]=Po(y,c,u),b=Math.max(p.startRow,m.startRow),_=Math.max(p.startColumn,m.startColumn),v=Math.min(p.startRow,m.startRow),w=Math.min(p.startColumn,m.startColumn);for(let x=v;x<=b;x++)for(let S=w;S<=_;S++){const E=h[x][S].cell;E.setFormat(o);const k=E.getChildren();for(let D=0;D<k.length;D++){const P=k[D];ge(P)&&!P.isInline()&&P.setFormat(o)}}return!0},to)),r.listenersToRemove.add(g.registerCommand(Si,o=>{const a=Oe();if(!Ri(a,y))return!1;if(Bn(a))return r.clearHighlight(),!1;if(xe(a)){const c=vn(a.anchor.getNode(),u=>rn(u));if(!rn(c))return!1;if(typeof o=="string"){const u=Ym(g,a,y);if(u)return Gm(u,y,[ar(o)]),!0}}return!1},to)),t&&r.listenersToRemove.add(g.registerCommand(wh,o=>{const a=Oe();if(!xe(a)||!a.isCollapsed()||!Ri(a,y))return!1;const c=Mf(a.anchor.getNode());if(c===null)return!1;wa(o);const u=y.getCordsFromCellNode(c,r.table);return Vm(r,y,u.x,u.y,o.shiftKey?"backward":"forward"),!0},to)),r.listenersToRemove.add(g.registerCommand(Eh,o=>y.isSelected(),ds)),r.listenersToRemove.add(g.registerCommand(_h,o=>{const{nodes:a,selection:c}=o,u=c.getStartEndPoints(),h=Bn(c),p=xe(c)&&vn(c.anchor.getNode(),N=>rn(N))!==null&&vn(c.focus.getNode(),N=>rn(N))!==null||h;if(a.length!==1||!Pn(a[0])||!p||u===null)return!1;const[m]=u,b=a[0],_=b.getChildren(),v=b.getFirstChildOrThrow().getChildrenSize(),w=b.getChildrenSize(),x=vn(m.getNode(),N=>rn(N)),S=x&&vn(x,N=>sr(N)),E=S&&vn(S,N=>Pn(N));if(!rn(x)||!sr(S)||!Pn(E))return!1;const k=S.getIndexWithinParent(),D=Math.min(E.getChildrenSize()-1,k+w-1),P=x.getIndexWithinParent(),O=Math.min(S.getChildrenSize()-1,P+v-1),R=Math.min(P,O),A=Math.min(k,D),z=Math.max(P,O),H=Math.max(k,D),$=E.getChildren();let M,J,K=0;for(let N=A;N<=H;N++){const U=$[N];if(!sr(U))return!1;const W=_[K];if(!sr(W))return!1;const G=U.getChildren(),F=W.getChildren();let q=0;for(let T=R;T<=z;T++){const I=G[T];if(!rn(I))return!1;const L=F[q];if(!rn(L))return!1;N===A&&T===R?M=I.getKey():N===H&&T===z&&(J=I.getKey());const B=I.getChildren();L.getChildren().forEach(Y=>{Ne(Y)&&Un().append(Y),I.append(Y)}),B.forEach(Y=>Y.remove()),q++}K++}if(M&&J){const N=fu();N.set(a[0].getKey(),M,J),or(N)}return!0},to)),r.listenersToRemove.add(g.registerCommand(Wo,()=>{const o=Oe(),a=ma();if(xe(o)){const{anchor:c,focus:u}=o,h=c.getNode(),p=u.getNode(),m=Mf(h),b=Mf(p),_=!(!m||!y.is(ms(m))),v=!(!b||!y.is(ms(b))),w=_!==v,x=_&&v,S=o.isBackward();if(w){const E=o.clone();if(v){const[k]=Po(y,b,b),D=k[0][0].cell,P=k[k.length-1].at(-1).cell;E.focus.set(S?D.getKey():P.getKey(),S?D.getChildrenSize():P.getChildrenSize(),"element")}else E.anchor.set(y.getParentOrThrow().getKey(),S?y.getIndexWithinParent()+1:y.getIndexWithinParent(),"element");or(E),Jm(g,r)}else x&&(m.is(b)||(r.setAnchorCellForSelection(l(m)),r.setFocusCellForSelection(l(b),!0),r.isSelecting||setTimeout(()=>{const{onMouseUp:E,onMouseMove:k}=e();r.isSelecting=!0,n.addEventListener("mouseup",E),n.addEventListener("mousemove",k)},0)))}else if(o&&Bn(o)&&o.is(a)&&o.tableKey===y.getKey()){const c=Hm(g._window);if(c&&c.anchorNode&&c.focusNode){const u=rr(c.focusNode),h=u&&!y.is(ms(u)),p=rr(c.anchorNode),m=p&&y.is(ms(p));if(h&&m&&c.rangeCount>0){const b=t1(c,g);b&&(b.anchor.set(y.getKey(),o.isBackward()?y.getChildrenSize():0,"element"),c.removeAllRanges(),or(b))}}}return o&&!o.is(a)&&(Bn(o)||Bn(a))&&r.tableSelection&&!r.tableSelection.is(a)?(Bn(o)&&o.tableKey===r.tableNodeKey?r.updateTableTableSelection(o):!Bn(o)&&Bn(a)&&a.tableKey===r.tableNodeKey&&r.updateTableTableSelection(null),!1):(r.hasHijackedSelectionStyles&&!y.isSelected()?function(c,u){u.enableHighlightStyle(),If(u.table,h=>{const p=h.elem;h.highlighted=!1,Km(c,h),p.getAttribute("style")||p.removeAttribute("style")})}(g,r):!r.hasHijackedSelectionStyles&&y.isSelected()&&Jm(g,r),!1)},to)),r.listenersToRemove.add(g.registerCommand(Za,()=>{const o=Oe();if(!xe(o)||!o.isCollapsed()||!Ri(o,y))return!1;const a=Ym(g,o,y);return!!a&&(Gm(a,y),!0)},to)),r}function qm(y){let d=y;for(;d!=null;){const g=d.nodeName;if(g==="TD"||g==="TH"){const t=d._cell;return t===void 0?null:t}d=d.parentNode}return null}function Rl(y){const d=[],g={columns:0,domRows:d,rows:0};let t=y.firstChild,f=0,r=0;for(d.length=0;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const i={elem:t,hasBackgroundColor:t.style.backgroundColor!=="",highlighted:!1,x:f,y:r};t._cell=i;let l=d[r];l===void 0&&(l=d[r]=[]),l[f]=i}else{const i=t.firstChild;if(i!=null){t=i;continue}}const e=t.nextSibling;if(e!=null){f++,t=e;continue}const s=t.parentNode;if(s!=null){const i=s.nextSibling;if(i==null)break;r++,f=0,t=i}}return g.columns=f+1,g.rows=r+1,g}function pu(y,d,g){const t=new Set(g?g.getNodes():[]);If(d,(f,r)=>{const n=f.elem;t.has(r)?(f.highlighted=!0,Wm(y,f)):(f.highlighted=!1,Km(y,f),n.getAttribute("style")||n.removeAttribute("style"))})}function If(y,d){const{domRows:g}=y;for(let t=0;t<g.length;t++){const f=g[t];if(f)for(let r=0;r<f.length;r++){const n=f[r];if(!n)continue;const e=rr(n.elem);e!==null&&d(n,e,{x:r,y:t})}}}function Jm(y,d){d.disableHighlightStyle(),If(d.table,g=>{g.highlighted=!0,Wm(y,g)})}const Vm=(y,d,g,t,f)=>{const r=f==="forward";switch(f){case"backward":case"forward":return g!==(r?y.table.columns-1:0)?hu(d.getCellNodeFromCordsOrThrow(g+(r?1:-1),t,y.table),r):t!==(r?y.table.rows-1:0)?hu(d.getCellNodeFromCordsOrThrow(r?0:y.table.columns-1,t+(r?1:-1),y.table),r):r?d.selectNext():d.selectPrevious(),!0;case"up":return t!==0?hu(d.getCellNodeFromCordsOrThrow(g,t-1,y.table),!1):d.selectPrevious(),!0;case"down":return t!==y.table.rows-1?hu(d.getCellNodeFromCordsOrThrow(g,t+1,y.table),!0):d.selectNext(),!0;default:return!1}},v_=(y,d,g,t,f)=>{const r=f==="forward";switch(f){case"backward":case"forward":return g!==(r?y.table.columns-1:0)&&y.setFocusCellForSelection(d.getDOMCellFromCordsOrThrow(g+(r?1:-1),t,y.table)),!0;case"up":return t!==0&&(y.setFocusCellForSelection(d.getDOMCellFromCordsOrThrow(g,t-1,y.table)),!0);case"down":return t!==y.table.rows-1&&(y.setFocusCellForSelection(d.getDOMCellFromCordsOrThrow(g,t+1,y.table)),!0);default:return!1}};function Ri(y,d){if(xe(y)||Bn(y)){const g=d.isParentOf(y.anchor.getNode()),t=d.isParentOf(y.focus.getNode());return g&&t}return!1}function hu(y,d){d?y.selectStart():y.selectEnd()}const Rf="172,206,247";function Wm(y,d){const g=d.elem,t=rr(g);rn(t)||xn(131),t.getBackgroundColor()===null?g.style.setProperty("background-color",`rgb(${Rf})`):g.style.setProperty("background-image",`linear-gradient(to right, rgba(${Rf},0.85), rgba(${Rf},0.85))`),g.style.setProperty("caret-color","transparent")}function Km(y,d){const g=d.elem,t=rr(g);rn(t)||xn(131),t.getBackgroundColor()===null&&g.style.removeProperty("background-color"),g.style.removeProperty("background-image"),g.style.removeProperty("caret-color")}function Mf(y){const d=vn(y,rn);return rn(d)?d:null}function ms(y){const d=vn(y,Pn);return Pn(d)?d:null}function Ml(y,d,g,t,f){if((g==="up"||g==="down")&&function(n){const e=n.getRootElement();return e?e.hasAttribute("aria-controls")&&e.getAttribute("aria-controls")==="typeahead-menu":!1}(y))return!1;const r=Oe();if(!Ri(r,t)){if(xe(r)){if(r.isCollapsed()&&g==="backward"){const n=r.anchor.type,e=r.anchor.offset;if(n!=="element"&&(n!=="text"||e!==0))return!1;const s=r.anchor.getNode();if(!s)return!1;const i=vn(s,o=>ge(o)&&!o.isInline());if(!i)return!1;const l=i.getPreviousSibling();return!(!l||!Pn(l))&&(wa(d),l.selectEnd(),!0)}if(d.shiftKey&&(g==="up"||g==="down")){const n=r.anchor.getNode();if(ko(n)){const e=r.getNodes()[0];if(e){const s=vn(e,rn);if(s&&t.isParentOf(s)){const i=t.getFirstDescendant(),l=t.getLastDescendant();if(!i||!l)return!1;const[o]=qr(i),[a]=qr(l),c=t.getCordsFromCellNode(o,f.table),u=t.getCordsFromCellNode(a,f.table),h=t.getDOMCellFromCordsOrThrow(c.x,c.y,f.table),p=t.getDOMCellFromCordsOrThrow(u.x,u.y,f.table);return f.setAnchorCellForSelection(h),f.setFocusCellForSelection(p,!0),!0}}return!1}{const e=vn(n,i=>ge(i)&&!i.isInline());if(!e)return!1;const s=g==="down"?e.getNextSibling():e.getPreviousSibling();if(Pn(s)&&f.tableNodeKey===s.getKey()){const i=s.getFirstDescendant(),l=s.getLastDescendant();if(!i||!l)return!1;const[o]=qr(i),[a]=qr(l),c=r.clone();return c.focus.set((g==="up"?o:a).getKey(),g==="up"?0:a.getChildrenSize(),"element"),or(c),!0}}}}return!1}if(xe(r)&&r.isCollapsed()){const{anchor:n,focus:e}=r,s=vn(n.getNode(),rn),i=vn(e.getNode(),rn);if(!rn(s)||!s.is(i))return!1;const l=ms(s);if(l!==t&&l!=null){const m=y.getElementByKey(l.getKey());if(m!=null)return f.table=Rl(m),Ml(y,d,g,l,f)}if(g==="backward"||g==="forward"){const m=n.type,b=n.offset,_=n.getNode();if(!_)return!1;const v=r.getNodes();return(v.length!==1||!Tn(v[0]))&&!!function(w,x,S,E){return function(k,D,P){return k==="element"&&(P==="backward"?D.getPreviousSibling()===null:D.getNextSibling()===null)}(w,S,E)||function(k,D,P,O){const R=vn(P,z=>ge(z)&&!z.isInline());if(!R)return!1;const A=O==="backward"?D===0:D===P.getTextContentSize();return k==="text"&&A&&(O==="backward"?R.getPreviousSibling()===null:R.getNextSibling()===null)}(w,x,S,E)}(m,b,_,g)&&function(w,x,S,E){const k=vn(x,rn);if(!rn(k))return!1;const[D,P]=Po(S,k,k);if(!function(R,A,z){const H=R[0][0],$=R[R.length-1][R[0].length-1],{startColumn:M,startRow:J}=A;return z==="backward"?M===H.startColumn&&J===H.startRow:M===$.startColumn&&J===$.startRow}(D,P,E))return!1;const O=function(R,A,z){const H=vn(R,M=>ge(M)&&!M.isInline());if(!H)return;const $=A==="backward"?H.getPreviousSibling():H.getNextSibling();return $&&Pn($)?$:A==="backward"?z.getPreviousSibling():z.getNextSibling()}(x,E,S);return!O||Pn(O)?!1:(wa(w),E==="backward"?O.selectEnd():O.selectStart(),!0)}(d,_,t,g)}const o=y.getElementByKey(s.__key),a=y.getElementByKey(n.key);if(a==null||o==null)return!1;let c;if(n.type==="element")c=a.getBoundingClientRect();else{const m=window.getSelection();if(m===null||m.rangeCount===0)return!1;c=m.getRangeAt(0).getBoundingClientRect()}const u=g==="up"?s.getFirstChild():s.getLastChild();if(u==null)return!1;const h=y.getElementByKey(u.__key);if(h==null)return!1;const p=h.getBoundingClientRect();if(g==="up"?p.top>c.top-c.height:c.bottom+c.height>p.bottom){wa(d);const m=t.getCordsFromCellNode(s,f.table);if(!d.shiftKey)return Vm(f,t,m.x,m.y,g);{const b=t.getDOMCellFromCordsOrThrow(m.x,m.y,f.table);f.setAnchorCellForSelection(b),f.setFocusCellForSelection(b,!0)}return!0}}else if(Bn(r)){const{anchor:n,focus:e}=r,s=vn(n.getNode(),rn),i=vn(e.getNode(),rn),[l]=r.getNodes(),o=y.getElementByKey(l.getKey());if(!rn(s)||!rn(i)||!Pn(l)||o==null)return!1;f.updateTableTableSelection(r);const a=Rl(o),c=t.getCordsFromCellNode(s,a),u=t.getDOMCellFromCordsOrThrow(c.x,c.y,a);if(f.setAnchorCellForSelection(u),wa(d),d.shiftKey){const h=t.getCordsFromCellNode(i,a);return v_(f,l,h.x,h.y,g)}return i.selectEnd(),!0}return!1}function wa(y){y.preventDefault(),y.stopImmediatePropagation(),y.stopPropagation()}function Gm(y,d,g){const t=Un();y==="first"?d.insertBefore(t):d.insertAfter(t),t.append(...g||[]),t.selectEnd()}function Ym(y,d,g){const t=g.getParent();if(!t)return;const f=y.getElementByKey(t.getKey());if(!f)return;const r=window.getSelection();if(!r||r.anchorNode!==f)return;const n=vn(d.anchor.getNode(),p=>rn(p));if(!n)return;const e=vn(n,p=>Pn(p));if(!Pn(e)||!e.is(g))return;const[s,i]=Po(g,n,n),l=s[0][0],o=s[s.length-1][s[0].length-1],{startRow:a,startColumn:c}=i,u=a===l.startRow&&c===l.startColumn,h=a===o.startRow&&c===o.startColumn;return u?"first":h?"last":void 0}class bo extends jo{static getType(){return"table"}static clone(d){return new bo(d.__key)}static importDOM(){return{table:d=>({conversion:__,priority:1})}}static importJSON(d){return Df()}constructor(d){super(d)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(d,g){const t=document.createElement("table");return Ni(t,d.theme.table),t}updateDOM(){return!1}exportDOM(d){return{...super.exportDOM(d),after:g=>{if(g){const t=g.cloneNode(),f=document.createElement("colgroup"),r=document.createElement("tbody");Sl(g)&&r.append(...g.children);const n=this.getFirstChildOrThrow();if(!sr(n))throw new Error("Expected to find row node.");const e=n.getChildrenSize();for(let s=0;s<e;s++){const i=document.createElement("col");f.append(i)}return t.replaceChildren(f,r),t}}}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(d,g){const{rows:t,domRows:f}=g;for(let r=0;r<t;r++){const n=f[r];if(n==null)continue;const e=n.findIndex(s=>{if(!s)return;const{elem:i}=s;return rr(i)===d});if(e!==-1)return{x:e,y:r}}throw new Error("Cell not found in table.")}getDOMCellFromCords(d,g,t){const{domRows:f}=t,r=f[g];if(r==null)return null;const n=r[d];return n??null}getDOMCellFromCordsOrThrow(d,g,t){const f=this.getDOMCellFromCords(d,g,t);if(!f)throw new Error("Cell not found at cords.");return f}getCellNodeFromCords(d,g,t){const f=this.getDOMCellFromCords(d,g,t);if(f==null)return null;const r=rr(f.elem);return rn(r)?r:null}getCellNodeFromCordsOrThrow(d,g,t){const f=this.getCellNodeFromCords(d,g,t);if(!f)throw new Error("Node at cords not TableCellNode.");return f}canSelectBefore(){return!0}canIndent(){return!1}}function __(y){return{node:Df()}}function Df(){return Yo(new bo)}function Pn(y){return y instanceof bo}const Zm=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],Qm=Zm[Math.floor(Math.random()*Zm.length)],x_=Ce.createContext({clientID:0,color:Qm[1],isCollabActive:!1,name:Qm[0],yjsDocMap:new Map});function w_(y,d){const g=Ce.useContext(x_);return y!=null&&(g.name=y),d!=null&&(g.color=d),g}const S_=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ce.useLayoutEffect:Ce.useEffect;function C_({onClear:y}){const[d]=jr();return S_(()=>d.registerCommand(Od,g=>(d.update(()=>{if(y==null){const t=Ln(),f=Oe(),r=Un();t.clear(),t.append(r),f!==null&&r.select(),xe(f)&&(f.format=0)}else y()}),!0),an),[d,y]),null}function Lf(y,d){return Lf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,t){return g.__proto__=t,g},Lf(y,d)}var Xm={error:null},E_=function(y){var d,g;function t(){for(var r,n=arguments.length,e=new Array(n),s=0;s<n;s++)e[s]=arguments[s];return(r=y.call.apply(y,[this].concat(e))||this).state=Xm,r.resetErrorBoundary=function(){for(var i,l=arguments.length,o=new Array(l),a=0;a<l;a++)o[a]=arguments[a];r.props.onReset==null||(i=r.props).onReset.apply(i,o),r.reset()},r}g=y,(d=t).prototype=Object.create(g.prototype),d.prototype.constructor=d,Lf(d,g),t.getDerivedStateFromError=function(r){return{error:r}};var f=t.prototype;return f.reset=function(){this.setState(Xm)},f.componentDidCatch=function(r,n){var e,s;(e=(s=this.props).onError)==null||e.call(s,r,n)},f.componentDidUpdate=function(r,n){var e,s,i,l,o=this.state.error,a=this.props.resetKeys;o!==null&&n.error!==null&&((i=r.resetKeys)===void 0&&(i=[]),(l=a)===void 0&&(l=[]),i.length!==l.length||i.some(function(c,u){return!Object.is(c,l[u])}))&&((e=(s=this.props).onResetKeysChange)==null||e.call(s,r.resetKeys,a),this.reset())},f.render=function(){var r=this.state.error,n=this.props,e=n.fallbackRender,s=n.FallbackComponent,i=n.fallback;if(r!==null){var l={error:r,resetErrorBoundary:this.resetErrorBoundary};if(Qn.isValidElement(i))return i;if(typeof e=="function")return e(l);if(s)return Qn.createElement(s,l);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(Qn.Component);function k_({children:y,onError:d}){return he.jsx(E_,{fallback:he.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:d,children:y})}const O_=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ce.useLayoutEffect:Ce.useEffect;function T_({ignoreHistoryMergeTagChange:y=!0,ignoreSelectionChange:d=!1,onChange:g}){const[t]=jr();return O_(()=>{if(g)return t.registerUpdateListener(({editorState:f,dirtyElements:r,dirtyLeaves:n,prevEditorState:e,tags:s})=>{d&&r.size===0&&n.size===0||y&&s.has("history-merge")||e.isEmpty()||g(f,t,s)})},[t,y,d,g]),null}const ys=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,j_=ys&&"documentMode"in document?document.documentMode:null,A_=!(!ys||!("InputEvent"in window)||j_)&&"getTargetRanges"in new window.InputEvent("input"),P_=ys&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),N_=ys&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,I_=ys&&/^(?=.*Chrome).*/i.test(navigator.userAgent),R_=ys&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!I_;function t0(y,d){d.update(()=>{if(y!==null){const g=Ii(y,KeyboardEvent)?null:y.clipboardData,t=Oe();if(t!==null&&g!=null){y.preventDefault();const f=Sm(d);f!==null&&g.setData("text/html",f),g.setData("text/plain",t.getTextContent())}}})}function M_(y){return mo(y.registerCommand(uo,d=>{const g=Oe();return!!xe(g)&&(g.deleteCharacter(d),!0)},an),y.registerCommand(ca,d=>{const g=Oe();return!!xe(g)&&(g.deleteWord(d),!0)},an),y.registerCommand(Ci,d=>{const g=Oe();return!!xe(g)&&(g.deleteLine(d),!0)},an),y.registerCommand(Si,d=>{const g=Oe();if(!xe(g))return!1;if(typeof d=="string")g.insertText(d);else{const t=d.dataTransfer;if(t!=null)Cm(t,g);else{const f=d.data;f&&g.insertText(f)}}return!0},an),y.registerCommand(Sc,()=>{const d=Oe();return!!xe(d)&&(d.removeText(),!0)},an),y.registerCommand(wi,d=>{const g=Oe();return!!xe(g)&&(g.insertLineBreak(d),!0)},an),y.registerCommand(Za,()=>{const d=Oe();return!!xe(d)&&(d.insertLineBreak(),!0)},an),y.registerCommand(Ec,d=>{const g=Oe();if(!xe(g))return!1;const t=d,f=t.shiftKey;return!!ru(g,!0)&&(t.preventDefault(),ou(g,f,!0),!0)},an),y.registerCommand(Cc,d=>{const g=Oe();if(!xe(g))return!1;const t=d,f=t.shiftKey;return!!ru(g,!1)&&(t.preventDefault(),ou(g,f,!1),!0)},an),y.registerCommand(fl,d=>{const g=Oe();return!!xe(g)&&(d.preventDefault(),y.dispatchCommand(uo,!0))},an),y.registerCommand(pl,d=>{const g=Oe();return!!xe(g)&&(d.preventDefault(),y.dispatchCommand(uo,!1))},an),y.registerCommand(dl,d=>{const g=Oe();if(!xe(g))return!1;if(d!==null){if((N_||P_||R_)&&A_)return!1;d.preventDefault()}return y.dispatchCommand(wi,!1)},an),y.registerCommand(Oc,()=>(Qh(),!0),an),y.registerCommand(hl,d=>{const g=Oe();return!!xe(g)&&(t0(d,y),!0)},an),y.registerCommand(gl,d=>{const g=Oe();return!!xe(g)&&(function(t,f){t0(t,f),f.update(()=>{const r=Oe();xe(r)&&r.removeText()})}(d,y),!0)},an),y.registerCommand(ll,d=>{const g=Oe();return!!xe(g)&&(function(t,f){t.preventDefault(),f.update(()=>{const r=Oe(),{clipboardData:n}=t;n!=null&&xe(r)&&Cm(n,r)},{tag:"paste"})}(d,y),!0)},an),y.registerCommand(Ed,d=>{const g=Oe();return!!xe(g)&&(d.preventDefault(),!0)},an),y.registerCommand(kd,d=>{const g=Oe();return!!xe(g)&&(d.preventDefault(),!0)},an))}const Bf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ce.useLayoutEffect:Ce.useEffect;function e0(y){return y.getEditorState().read(ym(y.isComposing()))}function D_({contentEditable:y,placeholder:d,ErrorBoundary:g}){const[t]=jr(),f=function(r,n){const[e,s]=Ce.useState(()=>r.getDecorators());return Bf(()=>r.registerDecoratorListener(i=>{$r.flushSync(()=>{s(i)})}),[r]),Ce.useEffect(()=>{s(r.getDecorators())},[r]),Ce.useMemo(()=>{const i=[],l=Object.keys(e);for(let o=0;o<l.length;o++){const a=l[o],c=he.jsx(n,{onError:h=>r._onError(h),children:he.jsx(Ce.Suspense,{fallback:null,children:e[a]})}),u=r.getElementByKey(a);u!==null&&i.push($r.createPortal(c,u,a))}return i},[n,e,r])}(t,g);return function(r){Bf(()=>mo(M_(r),bm(r)),[r])}(t),he.jsxs(he.Fragment,{children:[y,he.jsx(L_,{content:d}),f]})}function L_({content:y}){const[d]=jr(),g=function(f){const[r,n]=Ce.useState(()=>e0(f));return Bf(()=>{function e(){const s=e0(f);n(s)}return e(),mo(f.registerUpdateListener(()=>{e()}),f.registerEditableListener(()=>{e()}))},[f]),r}(d),t=au();return g?typeof y=="function"?y(t):y:null}var B_={967:(y,d,g)=>{const t=["docId","username","apiKey","domain","hooks","editorInstanceHooks","appServer","demo"];function f(c,u){var h=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(c,m).enumerable})),h.push.apply(h,p)}return h}function r(c){for(var u=1;u<arguments.length;u++){var h=arguments[u]!=null?arguments[u]:{};u%2?f(Object(h),!0).forEach(function(p){n(c,p,h[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(h)):f(Object(h)).forEach(function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(h,p))})}return c}function n(c,u,h){return(u=function(p){var m=function(b,_){if(typeof b!="object"||!b)return b;var v=b[Symbol.toPrimitive];if(v!==void 0){var w=v.call(b,"string");if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(b)}(p);return typeof m=="symbol"?m:m+""}(u))in c?Object.defineProperty(c,u,{value:h,enumerable:!0,configurable:!0,writable:!0}):c[u]=h,c}let e;e=g(668);let s=null;d.conf=function(c){c.autoStart=!1,s&&s.init(c)};const i=async function(c){if(s)return s.start(c)};d.start=i;const l=function(c){s&&(s.stop(),s=null)};d.stop=l;const o=function(c,u){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(s)return s.diff({state1:c,state2:u,config:h})};d.diff=o;const a=function(){if(s)return s.sync(...arguments)};d.sync=a,d.initSync=function(c){return s?s.initSync(c):c},y.exports={start:i,sync:a,diff:o,stop:l,createConfig:c=>{let{docId:u,username:h,apiKey:p,domain:m,hooks:b,editorInstanceHooks:_,appServer:v={},demo:w=!1}=c;return r(r({},function(x,S){if(x==null)return{};var E,k,D=function(O,R){if(O==null)return{};var A={};for(var z in O)if({}.hasOwnProperty.call(O,z)){if(R.indexOf(z)>=0)continue;A[z]=O[z]}return A}(x,S);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(x);for(k=0;k<P.length;k++)E=P[k],S.indexOf(E)>=0||{}.propertyIsEnumerable.call(x,E)&&(D[E]=x[E])}return D}(c,t)),{},{docId:u,username:h,apiKey:p,autoStart:!0,demo:w,domain:m,hooks:b,editorInstance:r({type:"lexical"},_),app:"json",json:{keyNames:{default:"codoxId"},filters:{version:!0},appServer:v,semantics:{paths:{"state.root.children.children.text":"MERGE","state.root.children.children.children.text":"MERGE"},string:"MERGE"}}})},get instance(){return s},createNewInstance:()=>{s=new e}}},668:(y,d,g)=>{y.exports=function t(f,r,n){function e(l,o){if(!r[l]){if(!f[l]){var a=void 0;if(!o&&a)return require(l,!0);if(s)return s(l,!0);throw(o=new Error("Cannot find module '"+l+"'")).code="MODULE_NOT_FOUND",o}a=r[l]={exports:{}},f[l][0].call(a.exports,function(c){return e(f[l][1][c]||c)},a,a.exports,t,f,r,n)}return r[l].exports}for(var s=void 0,i=0;i<n.length;i++)e(n[i]);return e}({1:[function(t,f,r){f.exports=function(n,e){(e==null||e>n.length)&&(e=n.length);for(var s=0,i=new Array(e);s<e;s++)i[s]=n[s];return i},f.exports.__esModule=!0,f.exports.default=f.exports},{}],2:[function(t,f,r){f.exports=function(n){if(Array.isArray(n))return n},f.exports.__esModule=!0,f.exports.default=f.exports},{}],3:[function(t,f,r){var n=t("./arrayLikeToArray.js");f.exports=function(e){if(Array.isArray(e))return n(e)},f.exports.__esModule=!0,f.exports.default=f.exports},{"./arrayLikeToArray.js":1}],4:[function(t,f,r){f.exports=function(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n},f.exports.__esModule=!0,f.exports.default=f.exports},{}],5:[function(t,f,r){f.exports=function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")},f.exports.__esModule=!0,f.exports.default=f.exports},{}],6:[function(t,f,r){var n=t("./setPrototypeOf.js"),e=t("./isNativeReflectConstruct.js");function s(i,l,o){return e()?f.exports=s=Reflect.construct.bind():f.exports=s=function(a,c,u){var h=[null];return h.push.apply(h,c),c=new(Function.bind.apply(a,h)),u&&n(c,u.prototype),c},f.exports.__esModule=!0,f.exports.default=f.exports,s.apply(null,arguments)}f.exports=s,f.exports.__esModule=!0,f.exports.default=f.exports},{"./isNativeReflectConstruct.js":13,"./setPrototypeOf.js":19}],7:[function(t,f,r){function n(e,s){for(var i=0;i<s.length;i++){var l=s[i];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}f.exports=function(e,s,i){return s&&n(e.prototype,s),i&&n(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e},f.exports.__esModule=!0,f.exports.default=f.exports},{}],8:[function(t,f,r){f.exports=function(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n},f.exports.__esModule=!0,f.exports.default=f.exports},{}],9:[function(t,f,r){function n(e){return f.exports=n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(s){return s.__proto__||Object.getPrototypeOf(s)},f.exports.__esModule=!0,f.exports.default=f.exports,n(e)}f.exports=n,f.exports.__esModule=!0,f.exports.default=f.exports},{}],10:[function(t,f,r){var n=t("./setPrototypeOf.js");f.exports=function(e,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(s&&s.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),s&&n(e,s)},f.exports.__esModule=!0,f.exports.default=f.exports},{"./setPrototypeOf.js":19}],11:[function(t,f,r){f.exports=function(n){return n&&n.__esModule?n:{default:n}},f.exports.__esModule=!0,f.exports.default=f.exports},{}],12:[function(t,f,r){f.exports=function(n){return Function.toString.call(n).indexOf("[native code]")!==-1},f.exports.__esModule=!0,f.exports.default=f.exports},{}],13:[function(t,f,r){f.exports=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}},f.exports.__esModule=!0,f.exports.default=f.exports},{}],14:[function(t,f,r){f.exports=function(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)},f.exports.__esModule=!0,f.exports.default=f.exports},{}],15:[function(t,f,r){f.exports=function(n,e){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var i,l,o=[],a=!0,c=!1;try{for(s=s.call(n);!(a=(i=s.next()).done)&&(o.push(i.value),!e||o.length!==e);a=!0);}catch(u){c=!0,l=u}finally{try{a||s.return==null||s.return()}finally{if(c)throw l}}return o}},f.exports.__esModule=!0,f.exports.default=f.exports},{}],16:[function(t,f,r){f.exports=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
41
|
+
`?s.insertParagraph():i===" "?s.insertNodes([Pl()]):s.insertText(i)}}}else d.insertRawText(r)}function Em(y,d,g){y.dispatchCommand(vh,{nodes:d,selection:g})||g.insertNodes(d)}function km(y,d,g,t=[]){let f=d===null||g.isSelected(d);const r=ge(g)&&g.excludeFromCopy("html");let n=g;if(d!==null){let i=nm(g);i=Ne(i)&&d!==null?rm(d,i):i,n=i}const e=ge(n)?n.getChildren():[],s=function(i){const l=i.exportJSON(),o=i.constructor;if(l.type!==o.getType()&&su(58,o.name),ge(i)){const a=l.children;Array.isArray(a)||su(59,o.name)}return l}(n);if(Ne(n)){const i=n.__text;i.length>0?s.text=i:f=!1}for(let i=0;i<e.length;i++){const l=e[i],o=km(y,d,l,s.children);!f&&ge(g)&&o&&g.extractWithChild(l,d,"clone")&&(f=!0)}if(f&&!r)t.push(s);else if(Array.isArray(s.children))for(let i=0;i<s.children.length;i++){const l=s.children[i];t.push(l)}return f}function z1(y,d){const g=[],t=Ln().getChildren();for(let f=0;f<t.length;f++)km(y,d,t[f],g);return{namespace:y._config.namespace,nodes:g}}function U1(y){const d=[];for(let g=0;g<y.length;g++){const t=y[g],f=r1(t);Ne(f)&&h1(f),d.push(f)}return d}let ps=null;async function Om(y,d){if(ps!==null)return!1;if(d!==null)return new Promise((e,s)=>{y.update(()=>{e(Tm(y,d))})});const g=y.getRootElement(),t=y._window==null?window.document:y._window.document,f=xm(y._window);if(g===null||f===null)return!1;const r=t.createElement("span");r.style.cssText="position: fixed; top: -1000px;",r.append(t.createTextNode("#")),g.append(r);const n=new Range;return n.setStart(r,0),n.setEnd(r,1),f.removeAllRanges(),f.addRange(n),new Promise((e,s)=>{const i=y.registerCommand(hl,l=>(Ii(l,ClipboardEvent)&&(i(),ps!==null&&(window.clearTimeout(ps),ps=null),e(Tm(y,l))),!0),to);ps=window.setTimeout(()=>{i(),ps=null,e(!1)},50),t.execCommand("copy"),r.remove()})}function Tm(y,d){const g=xm(y._window);if(!g)return!1;const t=g.anchorNode,f=g.focusNode;if(t!==null&&f!==null&&!yl(y,t,f))return!1;d.preventDefault();const r=d.clipboardData,n=Oe();if(r===null||n===null)return!1;const e=wm(y),s=F1(y);let i="";return n!==null&&(i=n.getTextContent()),e!==null&&r.setData("text/html",e),s!==null&&r.setData("application/x-lexical-editor",s),r.setData("text/plain",i),!0}function jm(y,d){if(document.caretRangeFromPoint!==void 0){const g=document.caretRangeFromPoint(y,d);return g===null?null:{node:g.startContainer,offset:g.startOffset}}if(document.caretPositionFromPoint!=="undefined"){const g=document.caretPositionFromPoint(y,d);return g===null?null:{node:g.offsetNode,offset:g.offset}}return null}const hs=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,$1=hs&&"documentMode"in document?document.documentMode:null,H1=!(!hs||!("InputEvent"in window)||$1)&&"getTargetRanges"in new window.InputEvent("input"),q1=hs&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),J1=hs&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,V1=hs&&/^(?=.*Chrome).*/i.test(navigator.userAgent),W1=hs&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!V1,Am=wd();function lu(y){let d=null;if(Ii(y,DragEvent)?d=y.dataTransfer:Ii(y,ClipboardEvent)&&(d=y.clipboardData),d===null)return[!1,[],!1];const g=d.types,t=g.includes("Files"),f=g.includes("text/html")||g.includes("text/plain");return[t,Array.from(d.files),f]}function Pm(y){const d=Oe();if(!xe(d))return!1;const g=new Set,t=d.getNodes();for(let f=0;f<t.length;f++){const r=t[f],n=r.getKey();if(g.has(n))continue;const e=vn(r,i=>ge(i)&&!i.isInline());if(e===null)continue;const s=e.getKey();e.canIndent()&&!g.has(s)&&(g.add(s),y(e))}return g.size>0}function cu(y){const d=rr(y);return Tn(d)}function K1(y){return mo(y.registerCommand(_h,d=>{const g=Oe();return!!Xr(g)&&(g.clear(),!0)},0),y.registerCommand(uo,d=>{const g=Oe();return!!xe(g)&&(g.deleteCharacter(d),!0)},an),y.registerCommand(ca,d=>{const g=Oe();return!!xe(g)&&(g.deleteWord(d),!0)},an),y.registerCommand(Ci,d=>{const g=Oe();return!!xe(g)&&(g.deleteLine(d),!0)},an),y.registerCommand(Si,d=>{const g=Oe();if(typeof d=="string")g!==null&&g.insertText(d);else{if(g===null)return!1;const t=d.dataTransfer;if(t!=null)Cm(t,g,y);else if(xe(g)){const f=d.data;return f&&g.insertText(f),!0}}return!0},an),y.registerCommand(Sc,()=>{const d=Oe();return!!xe(d)&&(d.removeText(),!0)},an),y.registerCommand(Er,d=>{const g=Oe();return!!xe(g)&&(g.formatText(d),!0)},an),y.registerCommand(Qa,d=>{const g=Oe();if(!xe(g)&&!Xr(g))return!1;const t=g.getNodes();for(const f of t){const r=vn(f,n=>ge(n)&&!n.isInline());r!==null&&r.setFormat(d)}return!0},an),y.registerCommand(wi,d=>{const g=Oe();return!!xe(g)&&(g.insertLineBreak(d),!0)},an),y.registerCommand(Za,()=>{const d=Oe();return!!xe(d)&&(d.insertParagraph(),!0)},an),y.registerCommand(rv,()=>(t1([Pl()]),!0),an),y.registerCommand(ov,()=>Pm(d=>{const g=d.getIndent();d.setIndent(g+1)}),an),y.registerCommand(wh,()=>Pm(d=>{const g=d.getIndent();g>0&&d.setIndent(g-1)}),an),y.registerCommand(Sd,d=>{const g=Oe();if(Xr(g)&&!cu(d.target)){const t=g.getNodes();if(t.length>0)return t[0].selectPrevious(),!0}else if(xe(g)){const t=wl(g.focus,!0);if(!d.shiftKey&&Tn(t)&&!t.isIsolated()&&!t.isInline())return t.selectPrevious(),d.preventDefault(),!0}return!1},an),y.registerCommand(Cd,d=>{const g=Oe();if(Xr(g)){const t=g.getNodes();if(t.length>0)return t[0].selectNext(0,0),!0}else if(xe(g)){if(function(f){const r=f.focus;return r.key==="root"&&r.offset===Ln().getChildrenSize()}(g))return d.preventDefault(),!0;const t=wl(g.focus,!1);if(!d.shiftKey&&Tn(t)&&!t.isIsolated()&&!t.isInline())return t.selectNext(),d.preventDefault(),!0}return!1},an),y.registerCommand(Ec,d=>{const g=Oe();if(Xr(g)){const t=g.getNodes();if(t.length>0)return d.preventDefault(),t[0].selectPrevious(),!0}if(!xe(g))return!1;if(ru(g,!0)){const t=d.shiftKey;return d.preventDefault(),ou(g,t,!0),!0}return!1},an),y.registerCommand(Cc,d=>{const g=Oe();if(Xr(g)&&!cu(d.target)){const f=g.getNodes();if(f.length>0)return d.preventDefault(),f[0].selectNext(0,0),!0}if(!xe(g))return!1;const t=d.shiftKey;return!!ru(g,!1)&&(d.preventDefault(),ou(g,t,!1),!0)},an),y.registerCommand(fl,d=>{if(cu(d.target))return!1;const g=Oe();if(!xe(g))return!1;d.preventDefault();const{anchor:t}=g,f=t.getNode();return g.isCollapsed()&&t.offset===0&&!vr(f)&&x1(f).getIndent()>0?y.dispatchCommand(wh,void 0):y.dispatchCommand(uo,!0)},an),y.registerCommand(pl,d=>{if(cu(d.target))return!1;const g=Oe();return!!xe(g)&&(d.preventDefault(),y.dispatchCommand(uo,!1))},an),y.registerCommand(dl,d=>{const g=Oe();if(!xe(g))return!1;if(d!==null){if((J1||q1||W1)&&H1)return!1;if(d.preventDefault(),d.shiftKey)return y.dispatchCommand(wi,!1)}return y.dispatchCommand(Za,void 0)},an),y.registerCommand(kc,()=>{const d=Oe();return!!xe(d)&&(y.blur(),!0)},an),y.registerCommand(Ed,d=>{const[,g]=lu(d);if(g.length>0){const f=jm(d.clientX,d.clientY);if(f!==null){const{offset:r,node:n}=f,e=rr(n);if(e!==null){const s=bf();if(Ne(e))s.anchor.set(e.getKey(),r,"text"),s.focus.set(e.getKey(),r,"text");else{const l=e.getParentOrThrow().getKey(),o=e.getIndexWithinParent()+1;s.anchor.set(l,o,"element"),s.focus.set(l,o,"element")}const i=zd(s);or(i)}y.dispatchCommand(Am,g)}return d.preventDefault(),!0}const t=Oe();return!!xe(t)},an),y.registerCommand(kd,d=>{const[g]=lu(d),t=Oe();return!(g&&!xe(t))},an),y.registerCommand(Sh,d=>{const[g]=lu(d),t=Oe();if(g&&!xe(t))return!1;const f=jm(d.clientX,d.clientY);if(f!==null){const r=rr(f.node);Tn(r)&&d.preventDefault()}return!0},an),y.registerCommand(Oc,()=>(Zh(),!0),an),y.registerCommand(hl,d=>(Om(y,Ii(d,ClipboardEvent)?d:null),!0),an),y.registerCommand(gl,d=>(async function(g,t){await Om(t,Ii(g,ClipboardEvent)?g:null),t.update(()=>{const f=Oe();xe(f)?f.removeText():Xr(f)&&f.getNodes().forEach(r=>r.remove())})}(d,y),!0),an),y.registerCommand(ll,d=>{const[,g,t]=lu(d);return g.length>0&&!t?(y.dispatchCommand(Am,g),!0):Ud(d.target)?!1:Oe()!==null&&(function(f,r){f.preventDefault(),r.update(()=>{const n=Oe(),e=Ii(f,InputEvent)||Ii(f,KeyboardEvent)?null:f.clipboardData;e!=null&&n!==null&&Cm(e,n,r)},{tag:"paste"})}(d,y),!0)},an))}const jf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ce.useLayoutEffect:Ce.useEffect;function Nm(y){return y.getEditorState().read(mm(y.isComposing()))}function G1({contentEditable:y,placeholder:d,ErrorBoundary:g}){const[t]=jr(),f=function(r,n){const[e,s]=Ce.useState(()=>r.getDecorators());return jf(()=>r.registerDecoratorListener(i=>{$r.flushSync(()=>{s(i)})}),[r]),Ce.useEffect(()=>{s(r.getDecorators())},[r]),Ce.useMemo(()=>{const i=[],l=Object.keys(e);for(let o=0;o<l.length;o++){const a=l[o],c=he.jsx(n,{onError:h=>r._onError(h),children:he.jsx(Ce.Suspense,{fallback:null,children:e[a]})}),u=r.getElementByKey(a);u!==null&&i.push($r.createPortal(c,u,a))}return i},[n,e,r])}(t,g);return function(r){jf(()=>mo(K1(r),ym(r)),[r])}(t),he.jsxs(he.Fragment,{children:[y,he.jsx(Y1,{content:d}),f]})}function Y1({content:y}){const[d]=jr(),g=function(f){const[r,n]=Ce.useState(()=>Nm(f));return jf(()=>{function e(){const s=Nm(f);n(s)}return e(),mo(f.registerUpdateListener(()=>{e()}),f.registerEditableListener(()=>{e()}))},[f]),r}(d),t=au();return g?typeof y=="function"?y(t):y:null}const Z1=new Set(["http:","https:","mailto:","sms:","tel:"]);let Im=class Kb extends jo{static getType(){return"link"}static clone(d){return new Kb(d.__url,{rel:d.__rel,target:d.__target,title:d.__title},d.__key)}constructor(d,g={},t){super(t);const{target:f=null,rel:r=null,title:n=null}=g;this.__url=d,this.__target=f,this.__rel=r,this.__title=n}createDOM(d){const g=document.createElement("a");return g.href=this.sanitizeUrl(this.__url),this.__target!==null&&(g.target=this.__target),this.__rel!==null&&(g.rel=this.__rel),this.__title!==null&&(g.title=this.__title),Ni(g,d.theme.link),g}updateDOM(d,g,t){if(g instanceof HTMLAnchorElement){const f=this.__url,r=this.__target,n=this.__rel,e=this.__title;f!==d.__url&&(g.href=f),r!==d.__target&&(r?g.target=r:g.removeAttribute("target")),n!==d.__rel&&(n?g.rel=n:g.removeAttribute("rel")),e!==d.__title&&(e?g.title=e:g.removeAttribute("title"))}return!1}static importDOM(){return{a:d=>({conversion:Q1,priority:1})}}static importJSON(d){const g=Af(d.url,{rel:d.rel,target:d.target,title:d.title});return g.setFormat(d.format),g.setIndent(d.indent),g.setDirection(d.direction),g}sanitizeUrl(d){try{const g=new URL(d);if(!Z1.has(g.protocol))return"about:blank"}catch{return d}return d}exportJSON(){return{...super.exportJSON(),rel:this.getRel(),target:this.getTarget(),title:this.getTitle(),type:"link",url:this.getURL(),version:1}}getURL(){return this.getLatest().__url}setURL(d){this.getWritable().__url=d}getTarget(){return this.getLatest().__target}setTarget(d){this.getWritable().__target=d}getRel(){return this.getLatest().__rel}setRel(d){this.getWritable().__rel=d}getTitle(){return this.getLatest().__title}setTitle(d){this.getWritable().__title=d}insertNewAfter(d,g=!0){const t=Af(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(t,g),t}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(d,g,t){if(!xe(g))return!1;const f=g.anchor.getNode(),r=g.focus.getNode();return this.isParentOf(f)&&this.isParentOf(r)&&g.getTextContent().length>0}};function Q1(y){let d=null;if(Lv(y)){const g=y.textContent;(g!==null&&g!==""||y.children.length>0)&&(d=Af(y.getAttribute("href")||"",{rel:y.getAttribute("rel"),target:y.getAttribute("target"),title:y.getAttribute("title")}))}return{node:d}}function Af(y,d){return Yo(new Im(y,d))}function X1(y){return y instanceof Im}let Pf=class Gb extends jo{static getType(){return"mark"}static clone(d){return new Gb(Array.from(d.__ids),d.__key)}static importDOM(){return null}static importJSON(d){const g=uu(d.ids);return g.setFormat(d.format),g.setIndent(d.indent),g.setDirection(d.direction),g}exportJSON(){return{...super.exportJSON(),ids:this.getIDs(),type:"mark",version:1}}constructor(d,g){super(g),this.__ids=d||[]}createDOM(d){const g=document.createElement("mark");return Ni(g,d.theme.mark),this.__ids.length>1&&Ni(g,d.theme.markOverlap),g}updateDOM(d,g,t){const f=d.__ids,r=this.__ids,n=f.length,e=r.length,s=t.theme.markOverlap;return n!==e&&(n===1?e===2&&Ni(g,s):e===1&&lm(g,s)),!1}hasID(d){const g=this.getIDs();for(let t=0;t<g.length;t++)if(d===g[t])return!0;return!1}getIDs(){const d=this.getLatest();return _a(d)?d.__ids:[]}addID(d){const g=this.getWritable();if(_a(g)){const t=g.__ids;g.__ids=t;for(let f=0;f<t.length;f++)if(d===t[f])return;t.push(d)}}deleteID(d){const g=this.getWritable();if(_a(g)){const t=g.__ids;g.__ids=t;for(let f=0;f<t.length;f++)if(d===t[f])return void t.splice(f,1)}}insertNewAfter(d,g=!0){const t=uu(this.__ids);return this.insertAfter(t,g),t}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(d,g,t){if(!xe(g)||t==="html")return!1;const f=g.anchor,r=g.focus,n=f.getNode(),e=r.getNode(),s=g.isBackward()?f.offset-r.offset:r.offset-f.offset;return this.isParentOf(n)&&this.isParentOf(e)&&this.getTextContent().length===s}excludeFromCopy(d){return d!=="clone"}};function uu(y){return Yo(new Pf(y))}function _a(y){return y instanceof Pf}function t_(y){const d=y.getChildren();let g=null;for(let t=0;t<d.length;t++){const f=d[t];g===null?y.insertBefore(f):g.insertAfter(f),g=f}y.remove()}function e_(y,d,g,t){const f=y.getNodes(),r=y.anchor.offset,n=y.focus.offset,e=f.length,s=d?n:r,i=d?r:n;let l,o;for(let a=0;a<e;a++){const c=f[a];if(ge(o)&&o.isParentOf(c))continue;const u=a===0,h=a===e-1;let p=null;if(Ne(c)){const m=c.getTextContentSize(),b=u?s:0,_=h?i:m;if(b===0&&_===0)continue;const v=c.splitText(b,_);p=v.length>1&&(v.length===3||u&&!h||_===m)?v[1]:v[0]}else{if(_a(c))continue;ge(c)&&c.isInline()&&(p=c)}if(p!==null){if(p&&p.is(l))continue;const m=p.getParent();m!=null&&m.is(l)||(o=void 0),l=m,o===void 0&&(o=(t||uu)([g]),p.insertBefore(o)),o.append(p)}else l=void 0,o=void 0}ge(o)&&(d?o.selectStart():o.selectEnd())}function n_(y,d){let g=y;for(;g!==null;){if(_a(g))return g.getIDs();if(Ne(g)&&d===g.getTextContentSize()){const t=g.getNextSibling();if(_a(t))return t.getIDs()}g=g.getParent()}return null}const Rm=/^(\d+(?:\.\d+)?)px$/,Ar={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class Ao extends jo{static getType(){return"tablecell"}static clone(d){const g=new Ao(d.__headerState,d.__colSpan,d.__width,d.__key);return g.__rowSpan=d.__rowSpan,g.__backgroundColor=d.__backgroundColor,g}static importDOM(){return{td:d=>({conversion:Mm,priority:0}),th:d=>({conversion:Mm,priority:0})}}static importJSON(d){const g=d.colSpan||1,t=d.rowSpan||1,f=Xo(d.headerState,g,d.width||void 0);return f.__rowSpan=t,f.__backgroundColor=d.backgroundColor||null,f}constructor(d=Ar.NO_STATUS,g=1,t,f){super(f),this.__colSpan=g,this.__rowSpan=1,this.__headerState=d,this.__width=t,this.__backgroundColor=null}createDOM(d){const g=document.createElement(this.getTag());return this.__width&&(g.style.width=`${this.__width}px`),this.__colSpan>1&&(g.colSpan=this.__colSpan),this.__rowSpan>1&&(g.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(g.style.backgroundColor=this.__backgroundColor),Ni(g,d.theme.tableCell,this.hasHeader()&&d.theme.tableCellHeader),g}exportDOM(d){const{element:g}=super.exportDOM(d);if(g){const t=g;t.style.border="1px solid black",this.__colSpan>1&&(t.colSpan=this.__colSpan),this.__rowSpan>1&&(t.rowSpan=this.__rowSpan),t.style.width=`${this.getWidth()||75}px`,t.style.verticalAlign="top",t.style.textAlign="start";const f=this.getBackgroundColor();f!==null?t.style.backgroundColor=f:this.hasHeader()&&(t.style.backgroundColor="#f2f3f5")}return{element:g}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),colSpan:this.__colSpan,headerState:this.__headerState,rowSpan:this.__rowSpan,type:"tablecell",width:this.getWidth()}}getColSpan(){return this.__colSpan}setColSpan(d){return this.getWritable().__colSpan=d,this}getRowSpan(){return this.__rowSpan}setRowSpan(d){return this.getWritable().__rowSpan=d,this}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(d){return this.getWritable().__headerState=d,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(d){return this.getWritable().__width=d,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(d){this.getWritable().__backgroundColor=d}toggleHeaderStyle(d){const g=this.getWritable();return(g.__headerState&d)===d?g.__headerState-=d:g.__headerState+=d,g}hasHeaderState(d){return(this.getHeaderStyles()&d)===d}hasHeader(){return this.getLatest().__headerState!==Ar.NO_STATUS}updateDOM(d){return d.__headerState!==this.__headerState||d.__width!==this.__width||d.__colSpan!==this.__colSpan||d.__rowSpan!==this.__rowSpan||d.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function Mm(y){const d=y,g=y.nodeName.toLowerCase();let t;Rm.test(d.style.width)&&(t=parseFloat(d.style.width));const f=Xo(g==="th"?Ar.ROW:Ar.NO_STATUS,d.colSpan,t);f.__rowSpan=d.rowSpan;const r=d.style.backgroundColor;r!==""&&(f.__backgroundColor=r);const n=d.style,e=n.textDecoration.split(" "),s=n.fontWeight==="700"||n.fontWeight==="bold",i=e.includes("line-through"),l=n.fontStyle==="italic",o=e.includes("underline");return{after:a=>(a.length===0&&a.push(Un()),a),forChild:(a,c)=>{if(rn(c)&&!ge(a)){const u=Un();return ha(a)&&a.getTextContent()===`
|
|
42
|
+
`?null:(Ne(a)&&(s&&a.toggleFormat("bold"),i&&a.toggleFormat("strikethrough"),l&&a.toggleFormat("italic"),o&&a.toggleFormat("underline")),u.append(a),u)}return a},node:f}}function Xo(y,d=1,g){return Yo(new Ao(y,d,g))}function rn(y){return y instanceof Ao}const r_=wd();class xa extends jo{static getType(){return"tablerow"}static clone(d){return new xa(d.__height,d.__key)}static importDOM(){return{tr:d=>({conversion:o_,priority:0})}}static importJSON(d){return gs(d.height)}constructor(d,g){super(g),this.__height=d}exportJSON(){return{...super.exportJSON(),...this.getHeight()&&{height:this.getHeight()},type:"tablerow",version:1}}createDOM(d){const g=document.createElement("tr");return this.__height&&(g.style.height=`${this.__height}px`),Ni(g,d.theme.tableRow),g}isShadowRoot(){return!0}setHeight(d){return this.getWritable().__height=d,this.__height}getHeight(){return this.getLatest().__height}updateDOM(d){return d.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function o_(y){const d=y;let g;return Rm.test(d.style.height)&&(g=parseFloat(d.style.height)),{node:gs(g)}}function gs(y){return Yo(new xa(y))}function sr(y){return y instanceof xa}function i_(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var xn=i_(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});const a_=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0;function Dm(y,d,g=!0){const t=Df();for(let f=0;f<y;f++){const r=gs();for(let n=0;n<d;n++){let e=Ar.NO_STATUS;typeof g=="object"?(f===0&&g.rows&&(e|=Ar.ROW),n===0&&g.columns&&(e|=Ar.COLUMN)):g&&(f===0&&(e|=Ar.ROW),n===0&&(e|=Ar.COLUMN));const s=Xo(e),i=Un();i.append(ar()),s.append(i),r.append(s)}t.append(r)}return t}function Lm(y){const d=vn(y,g=>sr(g));if(sr(d))return d;throw new Error("Expected table cell to be inside of table row.")}function s_(y){const d=vn(y,g=>Pn(g));if(Pn(d))return d;throw new Error("Expected table cell to be inside of table.")}function l_(y){const d=Lm(y);return s_(d).getChildren().findIndex(g=>g.is(d))}function Bm(y){return Lm(y).getChildren().findIndex(d=>d.is(y))}const Nf=(y,d)=>y===Ar.BOTH||y===d?d:Ar.NO_STATUS;function c_(y=!0){const d=Oe();xe(d)||Bn(d)||xn(118);const g=d.focus.getNode(),[t,,f]=qr(g),[r,n]=Po(f,t,t),e=r[0].length,{startRow:s}=n;if(y){const i=s+t.__rowSpan-1,l=r[i],o=gs();for(let c=0;c<e;c++){const{cell:u,startRow:h}=l[c];if(h+u.__rowSpan-1<=i){const p=l[c].cell.__headerState,m=Nf(p,Ar.COLUMN);o.append(Xo(m).append(Un()))}else u.setRowSpan(u.__rowSpan+1)}const a=f.getChildAtIndex(i);sr(a)||xn(145),a.insertAfter(o)}else{const i=r[s],l=gs();for(let a=0;a<e;a++){const{cell:c,startRow:u}=i[a];if(u===s){const h=i[a].cell.__headerState,p=Nf(h,Ar.COLUMN);l.append(Xo(p).append(Un()))}else c.setRowSpan(c.__rowSpan+1)}const o=f.getChildAtIndex(s);sr(o)||xn(145),o.insertBefore(l)}}function u_(y=!0){const d=Oe();xe(d)||Bn(d)||xn(118);const g=d.anchor.getNode(),t=d.focus.getNode(),[f]=qr(g),[r,,n]=qr(t),[e,s,i]=Po(n,r,f),l=e.length,o=y?Math.max(s.startColumn,i.startColumn):Math.min(s.startColumn,i.startColumn),a=y?o+r.__colSpan-1:o-1,c=n.getFirstChild();sr(c)||xn(120);let u=null;function h(m=Ar.NO_STATUS){const b=Xo(m).append(Un());return u===null&&(u=b),b}let p=c;t:for(let m=0;m<l;m++){if(m!==0){const E=p.getNextSibling();sr(E)||xn(121),p=E}const b=e[m],_=b[a<0?0:a].cell.__headerState,v=Nf(_,Ar.ROW);if(a<0){Fm(p,h(v));continue}const{cell:w,startColumn:x,startRow:S}=b[a];if(x+w.__colSpan-1<=a){let E=w,k=S,D=a;for(;k!==m&&E.__rowSpan>1;){if(D-=w.__colSpan,!(D>=0)){p.append(h(v));continue t}{const{cell:P,startRow:O}=b[D];E=P,k=O}}E.insertAfter(h(v))}else w.setColSpan(w.__colSpan+1)}u!==null&&Il(u)}function d_(){const y=Oe();xe(y)||Bn(y)||xn(118);const d=y.anchor.getNode(),g=y.focus.getNode(),[t,,f]=qr(d),[r]=qr(g),[n,e,s]=Po(f,t,r),{startRow:i}=e,{startRow:l}=s,o=l+r.__rowSpan-1;if(n.length===o-i+1)return void f.remove();const a=n[0].length,c=n[o+1],u=f.getChildAtIndex(o+1);for(let h=o;h>=i;h--){for(let m=a-1;m>=0;m--){const{cell:b,startRow:_,startColumn:v}=n[h][m];if(v===m&&(h===i&&_<i&&b.setRowSpan(b.__rowSpan-(_-i)),_>=i&&_+b.__rowSpan-1>o))if(b.setRowSpan(b.__rowSpan-(o-_+1)),u===null&&xn(122),m===0)Fm(u,b);else{const{cell:w}=c[m-1];w.insertAfter(b)}}const p=f.getChildAtIndex(h);sr(p)||xn(123,String(h)),p.remove()}if(c!==void 0){const{cell:h}=c[0];Il(h)}else{const h=n[i-1],{cell:p}=h[0];Il(p)}}function f_(){const y=Oe();xe(y)||Bn(y)||xn(118);const d=y.anchor.getNode(),g=y.focus.getNode(),[t,,f]=qr(d),[r]=qr(g),[n,e,s]=Po(f,t,r),{startColumn:i}=e,{startRow:l,startColumn:o}=s,a=Math.min(i,o),c=Math.max(i+t.__colSpan-1,o+r.__colSpan-1),u=c-a+1;if(n[0].length===c-a+1)return f.selectPrevious(),void f.remove();const h=n.length;for(let b=0;b<h;b++)for(let _=a;_<=c;_++){const{cell:v,startColumn:w}=n[b][_];if(w<a){if(_===a){const x=a-w;v.setColSpan(v.__colSpan-Math.min(u,v.__colSpan-x))}}else if(w+v.__colSpan-1>c){if(_===c){const x=c-w+1;v.setColSpan(v.__colSpan-x)}}else v.remove()}const p=n[l],m=i>o?p[i+t.__colSpan]:p[o+r.__colSpan];if(m!==void 0){const{cell:b}=m;Il(b)}else{const b=o<i?p[o-1]:p[i-1],{cell:_}=b;Il(_)}}function Il(y){const d=y.getFirstDescendant();d==null?y.selectStart():d.getParentOrThrow().selectStart()}function Fm(y,d){const g=y.getFirstChild();g!==null?g.insertBefore(d):y.append(d)}function Po(y,d,g){const[t,f,r]=zm(y,d,g);return f===null&&xn(110),r===null&&xn(111),[t,f,r]}function zm(y,d,g){const t=[];let f=null,r=null;function n(i,l,o){const a={cell:o,startColumn:l,startRow:i},c=o.__rowSpan,u=o.__colSpan;for(let h=0;h<c;h++){t[i+h]===void 0&&(t[i+h]=[]);for(let p=0;p<u;p++)t[i+h][l+p]=a}d!==null&&d.is(o)&&(f=a),g!==null&&g.is(o)&&(r=a)}function e(i,l){return t[i]===void 0||t[i][l]===void 0}const s=y.getChildren();for(let i=0;i<s.length;i++){const l=s[i];sr(l)||xn(146);const o=l.getChildren();let a=0;for(const c of o){for(rn(c)||xn(147);!e(i,a);)a++;n(i,a,c),a+=c.__colSpan}}return[t,f,r]}function qr(y){let d;if(y instanceof Ao)d=y;else if("__type"in y){const f=vn(y,rn);rn(f)||xn(148),d=f}else{const f=vn(y.getNode(),rn);rn(f)||xn(148),d=f}const g=d.getParent();sr(g)||xn(149);const t=g.getParent();return Pn(t)||xn(150),[d,g,t]}function Um(y){const[d,,g]=qr(y),t=g.getChildren(),f=t.length,r=t[0].getChildren().length,n=new Array(f);for(let e=0;e<f;e++)n[e]=new Array(r);for(let e=0;e<f;e++){const s=t[e].getChildren();let i=0;for(let l=0;l<s.length;l++){for(;n[e][i];)i++;const o=s[l],a=o.__rowSpan||1,c=o.__colSpan||1;for(let u=0;u<a;u++)for(let h=0;h<c;h++)n[e+u][i+h]=o;if(d===o)return{colSpan:c,columnIndex:i,rowIndex:e,rowSpan:a};i+=c}}return null}class du{constructor(d,g,t){this.anchor=g,this.focus=t,g._selection=this,t._selection=this,this._cachedNodes=null,this.dirty=!1,this.tableKey=d}getStartEndPoints(){return[this.anchor,this.focus]}isBackward(){return this.focus.isBefore(this.anchor)}getCachedNodes(){return this._cachedNodes}setCachedNodes(d){this._cachedNodes=d}is(d){return!!Bn(d)&&this.tableKey===d.tableKey&&this.anchor.is(d.anchor)&&this.focus.is(d.focus)}set(d,g,t){this.dirty=!0,this.tableKey=d,this.anchor.key=g,this.focus.key=t,this._cachedNodes=null}clone(){return new du(this.tableKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(d){}insertText(){}insertNodes(d){const g=this.focus.getNode();ge(g)||xn(151),zd(g.select(0,g.getChildrenSize())).insertNodes(d)}getShape(){const d=Vn(this.anchor.key);rn(d)||xn(152);const g=Um(d);g===null&&xn(153);const t=Vn(this.focus.key);rn(t)||xn(154);const f=Um(t);f===null&&xn(155);const r=Math.min(g.columnIndex,f.columnIndex),n=Math.max(g.columnIndex,f.columnIndex),e=Math.min(g.rowIndex,f.rowIndex),s=Math.max(g.rowIndex,f.rowIndex);return{fromX:Math.min(r,n),fromY:Math.min(e,s),toX:Math.max(r,n),toY:Math.max(e,s)}}getNodes(){const d=this._cachedNodes;if(d!==null)return d;const g=this.anchor.getNode(),t=this.focus.getNode(),f=vn(g,rn),r=vn(t,rn);rn(f)||xn(152),rn(r)||xn(154);const n=f.getParent();sr(n)||xn(156);const e=n.getParent();Pn(e)||xn(157);const s=r.getParents()[1];if(s!==e){if(e.isParentOf(r)){const S=s.getParent();S==null&&xn(159),this.set(this.tableKey,r.getKey(),S.getKey())}else{const S=e.getParent();S==null&&xn(158),this.set(this.tableKey,S.getKey(),r.getKey())}return this.getNodes()}const[i,l,o]=Po(e,f,r);let a=Math.min(l.startColumn,o.startColumn),c=Math.min(l.startRow,o.startRow),u=Math.max(l.startColumn+l.cell.__colSpan-1,o.startColumn+o.cell.__colSpan-1),h=Math.max(l.startRow+l.cell.__rowSpan-1,o.startRow+o.cell.__rowSpan-1),p=a,m=c,b=a,_=c;function v(S){const{cell:E,startColumn:k,startRow:D}=S;a=Math.min(a,k),c=Math.min(c,D),u=Math.max(u,k+E.__colSpan-1),h=Math.max(h,D+E.__rowSpan-1)}for(;a<p||c<m||u>b||h>_;){if(a<p){const S=_-m,E=p-1;for(let k=0;k<=S;k++)v(i[m+k][E]);p=E}if(c<m){const S=b-p,E=m-1;for(let k=0;k<=S;k++)v(i[E][p+k]);m=E}if(u>b){const S=_-m,E=b+1;for(let k=0;k<=S;k++)v(i[m+k][E]);b=E}if(h>_){const S=b-p,E=_+1;for(let k=0;k<=S;k++)v(i[E][p+k]);_=E}}const w=[e];let x=null;for(let S=c;S<=h;S++)for(let E=a;E<=u;E++){const{cell:k}=i[S][E],D=k.getParent();sr(D)||xn(160),D!==x&&w.push(D),w.push(k,...p_(k)),x=D}return cs()||(this._cachedNodes=w),w}getTextContent(){const d=this.getNodes();let g="";for(let t=0;t<d.length;t++)g+=d[t].getTextContent();return g}}function Bn(y){return y instanceof du}function fu(){const y=Qr("root",0,"element"),d=Qr("root",0,"element");return new du("root",y,d)}function p_(y){const d=[],g=[y];for(;g.length>0;){const t=g.pop();t===void 0&&xn(112),ge(t)&&g.unshift(...t.getChildren()),t!==y&&d.push(t)}return d}class h_{constructor(d,g){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=g,this.editor=d,this.table={columns:0,domRows:[],rows:0},this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTable(),this.isSelecting=!1}getTable(){return this.table}removeListeners(){Array.from(this.listenersToRemove).forEach(d=>d())}trackTable(){const d=new MutationObserver(g=>{this.editor.update(()=>{let t=!1;for(let r=0;r<g.length;r++){const n=g[r].target.nodeName;if(n==="TABLE"||n==="TBODY"||n==="THEAD"||n==="TR"){t=!0;break}}if(!t)return;const f=this.editor.getElementByKey(this.tableNodeKey);if(!f)throw new Error("Expected to find TableElement in DOM");this.table=Rl(f)})});this.editor.update(()=>{const g=this.editor.getElementByKey(this.tableNodeKey);if(!g)throw new Error("Expected to find TableElement in DOM");this.table=Rl(g),d.observe(g,{childList:!0,subtree:!0})})}clearHighlight(){const d=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.tableSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),d.update(()=>{if(!Pn(Vn(this.tableNodeKey)))throw new Error("Expected TableNode.");const g=d.getElementByKey(this.tableNodeKey);if(!g)throw new Error("Expected to find TableElement in DOM");const t=Rl(g);pu(d,t,null),or(null),d.dispatchCommand(Wo,void 0)})}enableHighlightStyle(){const d=this.editor;d.update(()=>{const g=d.getElementByKey(this.tableNodeKey);if(!g)throw new Error("Expected to find TableElement in DOM");lm(g,d._config.theme.tableSelection),g.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const d=this.editor;d.update(()=>{const g=d.getElementByKey(this.tableNodeKey);if(!g)throw new Error("Expected to find TableElement in DOM");Ni(g,d._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableTableSelection(d){if(d!==null&&d.tableKey===this.tableNodeKey){const g=this.editor;this.tableSelection=d,this.isHighlightingCells=!0,this.disableHighlightStyle(),pu(g,this.table,this.tableSelection)}else d==null?this.clearHighlight():(this.tableNodeKey=d.tableKey,this.updateTableTableSelection(d))}setFocusCellForSelection(d,g=!1){const t=this.editor;t.update(()=>{const f=Vn(this.tableNodeKey);if(!Pn(f))throw new Error("Expected TableNode.");if(!t.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const r=d.x,n=d.y;if(this.focusCell=d,this.anchorCell!==null){const e=$m(t._window);e&&e.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(this.isHighlightingCells||this.anchorX===r&&this.anchorY===n&&!g){if(r===this.focusX&&n===this.focusY)return}else this.isHighlightingCells=!0,this.disableHighlightStyle();if(this.focusX=r,this.focusY=n,this.isHighlightingCells){const e=rr(d.elem);if(this.tableSelection!=null&&this.anchorCellNodeKey!=null&&rn(e)&&f.is(ms(e))){const s=e.getKey();this.tableSelection=this.tableSelection.clone()||fu(),this.focusCellNodeKey=s,this.tableSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),or(this.tableSelection),t.dispatchCommand(Wo,void 0),pu(t,this.table,this.tableSelection)}}})}setAnchorCellForSelection(d){this.isHighlightingCells=!1,this.anchorCell=d,this.anchorX=d.x,this.anchorY=d.y,this.editor.update(()=>{const g=rr(d.elem);if(rn(g)){const t=g.getKey();this.tableSelection=this.tableSelection!=null?this.tableSelection.clone():fu(),this.anchorCellNodeKey=t}})}formatCells(d){this.editor.update(()=>{const g=Oe();Bn(g)||xn(11);const t=bf(),f=t.anchor,r=t.focus;g.getNodes().forEach(n=>{rn(n)&&n.getTextContentSize()!==0&&(f.set(n.getKey(),0,"element"),r.set(n.getKey(),n.getChildrenSize(),"element"),t.formatText(d))}),or(g),this.editor.dispatchCommand(Wo,void 0)})}clearText(){const d=this.editor;d.update(()=>{const g=Vn(this.tableNodeKey);if(!Pn(g))throw new Error("Expected TableNode.");const t=Oe();Bn(t)||xn(11);const f=t.getNodes().filter(rn);f.length!==this.table.columns*this.table.rows?(f.forEach(r=>{if(ge(r)){const n=Un(),e=ar();n.append(e),r.append(n),r.getChildren().forEach(s=>{s!==n&&s.remove()})}}),pu(d,this.table,null),or(null),d.dispatchCommand(Wo,void 0)):(g.selectPrevious(),g.remove(),Ln().selectStart())})}}const g_="__lexicalTableSelection",$m=y=>a_?(y||window).getSelection():null;function m_(y,d,g,t){const f=g.getRootElement();if(f===null)throw new Error("No root element.");const r=new h_(g,y.getKey()),n=g._window||window;(function(o,a){o[g_]=a})(d,r);const e=()=>{const o=()=>{r.isSelecting=!1,n.removeEventListener("mouseup",o),n.removeEventListener("mousemove",a)},a=c=>{setTimeout(()=>{if(1&~c.buttons&&r.isSelecting)return r.isSelecting=!1,n.removeEventListener("mouseup",o),void n.removeEventListener("mousemove",a);const u=Hm(c.target);u===null||r.anchorX===u.x&&r.anchorY===u.y||(c.preventDefault(),r.setFocusCellForSelection(u))},0)};return{onMouseMove:a,onMouseUp:o}};d.addEventListener("mousedown",o=>{setTimeout(()=>{if(o.button!==0||!n)return;const a=Hm(o.target);a!==null&&(wa(o),r.setAnchorCellForSelection(a));const{onMouseUp:c,onMouseMove:u}=e();r.isSelecting=!0,n.addEventListener("mouseup",c),n.addEventListener("mousemove",u)},0)});const s=o=>{o.button===0&&g.update(()=>{const a=Oe(),c=o.target;Bn(a)&&a.tableKey===r.tableNodeKey&&f.contains(c)&&r.clearHighlight()})};n.addEventListener("mousedown",s),r.listenersToRemove.add(()=>n.removeEventListener("mousedown",s)),r.listenersToRemove.add(g.registerCommand(Cd,o=>Ml(g,o,"down",y,r),ds)),r.listenersToRemove.add(g.registerCommand(Sd,o=>Ml(g,o,"up",y,r),ds)),r.listenersToRemove.add(g.registerCommand(Ec,o=>Ml(g,o,"backward",y,r),ds)),r.listenersToRemove.add(g.registerCommand(Cc,o=>Ml(g,o,"forward",y,r),ds)),r.listenersToRemove.add(g.registerCommand(kc,o=>{const a=Oe();if(Bn(a)){const c=vn(a.focus.getNode(),rn);if(rn(c))return wa(o),c.selectEnd(),!0}return!1},ds)),[ca,Ci,uo].forEach(o=>{r.listenersToRemove.add(g.registerCommand(o,(a=>()=>{const c=Oe();if(!Ri(c,y))return!1;if(Bn(c))return r.clearText(),!0;if(xe(c)){const u=vn(c.anchor.getNode(),w=>rn(w));if(!rn(u))return!1;const h=c.anchor.getNode(),p=c.focus.getNode(),m=y.isParentOf(h),b=y.isParentOf(p);if(m&&!b||b&&!m)return r.clearText(),!0;const _=vn(c.anchor.getNode(),w=>ge(w)),v=_&&vn(_,w=>ge(w)&&rn(w.getParent()));if(!ge(v)||!ge(_))return!1;if(a===Ci&&v.getPreviousSibling()===null)return!0}return!1})(o),to))});const i=o=>{const a=Oe();if(!Ri(a,y)){const c=a?a.getNodes():null;if(c){const u=c.find(h=>Pn(h)&&h.getKey()===r.tableNodeKey);if(Pn(u)){const h=u.getParent();if(!h)return!1;const p=u.getNextSibling()||u.getPreviousSibling();u.remove(),p?p.selectStart():h.selectStart()}}return!0}if(Bn(a))return o.preventDefault(),o.stopPropagation(),r.clearText(),!0;if(xe(a)){const c=vn(a.anchor.getNode(),u=>rn(u));if(!rn(c))return!1}return!1};function l(o){const a=y.getCordsFromCellNode(o,r.table);return y.getDOMCellFromCordsOrThrow(a.x,a.y,r.table)}return r.listenersToRemove.add(g.registerCommand(fl,i,to)),r.listenersToRemove.add(g.registerCommand(pl,i,to)),r.listenersToRemove.add(g.registerCommand(Er,o=>{const a=Oe();if(!Ri(a,y))return!1;if(Bn(a))return r.formatCells(o),!0;if(xe(a)){const c=vn(a.anchor.getNode(),u=>rn(u));if(!rn(c))return!1}return!1},to)),r.listenersToRemove.add(g.registerCommand(Qa,o=>{const a=Oe();if(!Bn(a)||!Ri(a,y))return!1;const c=a.anchor.getNode(),u=a.focus.getNode();if(!rn(c)||!rn(u))return!1;const[h,p,m]=Po(y,c,u),b=Math.max(p.startRow,m.startRow),_=Math.max(p.startColumn,m.startColumn),v=Math.min(p.startRow,m.startRow),w=Math.min(p.startColumn,m.startColumn);for(let x=v;x<=b;x++)for(let S=w;S<=_;S++){const E=h[x][S].cell;E.setFormat(o);const k=E.getChildren();for(let D=0;D<k.length;D++){const P=k[D];ge(P)&&!P.isInline()&&P.setFormat(o)}}return!0},to)),r.listenersToRemove.add(g.registerCommand(Si,o=>{const a=Oe();if(!Ri(a,y))return!1;if(Bn(a))return r.clearHighlight(),!1;if(xe(a)){const c=vn(a.anchor.getNode(),u=>rn(u));if(!rn(c))return!1;if(typeof o=="string"){const u=Gm(g,a,y);if(u)return Km(u,y,[ar(o)]),!0}}return!1},to)),t&&r.listenersToRemove.add(g.registerCommand(xh,o=>{const a=Oe();if(!xe(a)||!a.isCollapsed()||!Ri(a,y))return!1;const c=Mf(a.anchor.getNode());if(c===null)return!1;wa(o);const u=y.getCordsFromCellNode(c,r.table);return Jm(r,y,u.x,u.y,o.shiftKey?"backward":"forward"),!0},to)),r.listenersToRemove.add(g.registerCommand(Ch,o=>y.isSelected(),ds)),r.listenersToRemove.add(g.registerCommand(vh,o=>{const{nodes:a,selection:c}=o,u=c.getStartEndPoints(),h=Bn(c),p=xe(c)&&vn(c.anchor.getNode(),N=>rn(N))!==null&&vn(c.focus.getNode(),N=>rn(N))!==null||h;if(a.length!==1||!Pn(a[0])||!p||u===null)return!1;const[m]=u,b=a[0],_=b.getChildren(),v=b.getFirstChildOrThrow().getChildrenSize(),w=b.getChildrenSize(),x=vn(m.getNode(),N=>rn(N)),S=x&&vn(x,N=>sr(N)),E=S&&vn(S,N=>Pn(N));if(!rn(x)||!sr(S)||!Pn(E))return!1;const k=S.getIndexWithinParent(),D=Math.min(E.getChildrenSize()-1,k+w-1),P=x.getIndexWithinParent(),O=Math.min(S.getChildrenSize()-1,P+v-1),R=Math.min(P,O),A=Math.min(k,D),z=Math.max(P,O),H=Math.max(k,D),$=E.getChildren();let M,J,K=0;for(let N=A;N<=H;N++){const U=$[N];if(!sr(U))return!1;const W=_[K];if(!sr(W))return!1;const G=U.getChildren(),F=W.getChildren();let q=0;for(let T=R;T<=z;T++){const I=G[T];if(!rn(I))return!1;const L=F[q];if(!rn(L))return!1;N===A&&T===R?M=I.getKey():N===H&&T===z&&(J=I.getKey());const B=I.getChildren();L.getChildren().forEach(Y=>{Ne(Y)&&Un().append(Y),I.append(Y)}),B.forEach(Y=>Y.remove()),q++}K++}if(M&&J){const N=fu();N.set(a[0].getKey(),M,J),or(N)}return!0},to)),r.listenersToRemove.add(g.registerCommand(Wo,()=>{const o=Oe(),a=ma();if(xe(o)){const{anchor:c,focus:u}=o,h=c.getNode(),p=u.getNode(),m=Mf(h),b=Mf(p),_=!(!m||!y.is(ms(m))),v=!(!b||!y.is(ms(b))),w=_!==v,x=_&&v,S=o.isBackward();if(w){const E=o.clone();if(v){const[k]=Po(y,b,b),D=k[0][0].cell,P=k[k.length-1].at(-1).cell;E.focus.set(S?D.getKey():P.getKey(),S?D.getChildrenSize():P.getChildrenSize(),"element")}else E.anchor.set(y.getParentOrThrow().getKey(),S?y.getIndexWithinParent()+1:y.getIndexWithinParent(),"element");or(E),qm(g,r)}else x&&(m.is(b)||(r.setAnchorCellForSelection(l(m)),r.setFocusCellForSelection(l(b),!0),r.isSelecting||setTimeout(()=>{const{onMouseUp:E,onMouseMove:k}=e();r.isSelecting=!0,n.addEventListener("mouseup",E),n.addEventListener("mousemove",k)},0)))}else if(o&&Bn(o)&&o.is(a)&&o.tableKey===y.getKey()){const c=$m(g._window);if(c&&c.anchorNode&&c.focusNode){const u=rr(c.focusNode),h=u&&!y.is(ms(u)),p=rr(c.anchorNode),m=p&&y.is(ms(p));if(h&&m&&c.rangeCount>0){const b=Qv(c,g);b&&(b.anchor.set(y.getKey(),o.isBackward()?y.getChildrenSize():0,"element"),c.removeAllRanges(),or(b))}}}return o&&!o.is(a)&&(Bn(o)||Bn(a))&&r.tableSelection&&!r.tableSelection.is(a)?(Bn(o)&&o.tableKey===r.tableNodeKey?r.updateTableTableSelection(o):!Bn(o)&&Bn(a)&&a.tableKey===r.tableNodeKey&&r.updateTableTableSelection(null),!1):(r.hasHijackedSelectionStyles&&!y.isSelected()?function(c,u){u.enableHighlightStyle(),If(u.table,h=>{const p=h.elem;h.highlighted=!1,Wm(c,h),p.getAttribute("style")||p.removeAttribute("style")})}(g,r):!r.hasHijackedSelectionStyles&&y.isSelected()&&qm(g,r),!1)},to)),r.listenersToRemove.add(g.registerCommand(Za,()=>{const o=Oe();if(!xe(o)||!o.isCollapsed()||!Ri(o,y))return!1;const a=Gm(g,o,y);return!!a&&(Km(a,y),!0)},to)),r}function Hm(y){let d=y;for(;d!=null;){const g=d.nodeName;if(g==="TD"||g==="TH"){const t=d._cell;return t===void 0?null:t}d=d.parentNode}return null}function Rl(y){const d=[],g={columns:0,domRows:d,rows:0};let t=y.firstChild,f=0,r=0;for(d.length=0;t!=null;){const n=t.nodeName;if(n==="TD"||n==="TH"){const i={elem:t,hasBackgroundColor:t.style.backgroundColor!=="",highlighted:!1,x:f,y:r};t._cell=i;let l=d[r];l===void 0&&(l=d[r]=[]),l[f]=i}else{const i=t.firstChild;if(i!=null){t=i;continue}}const e=t.nextSibling;if(e!=null){f++,t=e;continue}const s=t.parentNode;if(s!=null){const i=s.nextSibling;if(i==null)break;r++,f=0,t=i}}return g.columns=f+1,g.rows=r+1,g}function pu(y,d,g){const t=new Set(g?g.getNodes():[]);If(d,(f,r)=>{const n=f.elem;t.has(r)?(f.highlighted=!0,Vm(y,f)):(f.highlighted=!1,Wm(y,f),n.getAttribute("style")||n.removeAttribute("style"))})}function If(y,d){const{domRows:g}=y;for(let t=0;t<g.length;t++){const f=g[t];if(f)for(let r=0;r<f.length;r++){const n=f[r];if(!n)continue;const e=rr(n.elem);e!==null&&d(n,e,{x:r,y:t})}}}function qm(y,d){d.disableHighlightStyle(),If(d.table,g=>{g.highlighted=!0,Vm(y,g)})}const Jm=(y,d,g,t,f)=>{const r=f==="forward";switch(f){case"backward":case"forward":return g!==(r?y.table.columns-1:0)?hu(d.getCellNodeFromCordsOrThrow(g+(r?1:-1),t,y.table),r):t!==(r?y.table.rows-1:0)?hu(d.getCellNodeFromCordsOrThrow(r?0:y.table.columns-1,t+(r?1:-1),y.table),r):r?d.selectNext():d.selectPrevious(),!0;case"up":return t!==0?hu(d.getCellNodeFromCordsOrThrow(g,t-1,y.table),!1):d.selectPrevious(),!0;case"down":return t!==y.table.rows-1?hu(d.getCellNodeFromCordsOrThrow(g,t+1,y.table),!0):d.selectNext(),!0;default:return!1}},y_=(y,d,g,t,f)=>{const r=f==="forward";switch(f){case"backward":case"forward":return g!==(r?y.table.columns-1:0)&&y.setFocusCellForSelection(d.getDOMCellFromCordsOrThrow(g+(r?1:-1),t,y.table)),!0;case"up":return t!==0&&(y.setFocusCellForSelection(d.getDOMCellFromCordsOrThrow(g,t-1,y.table)),!0);case"down":return t!==y.table.rows-1&&(y.setFocusCellForSelection(d.getDOMCellFromCordsOrThrow(g,t+1,y.table)),!0);default:return!1}};function Ri(y,d){if(xe(y)||Bn(y)){const g=d.isParentOf(y.anchor.getNode()),t=d.isParentOf(y.focus.getNode());return g&&t}return!1}function hu(y,d){d?y.selectStart():y.selectEnd()}const Rf="172,206,247";function Vm(y,d){const g=d.elem,t=rr(g);rn(t)||xn(131),t.getBackgroundColor()===null?g.style.setProperty("background-color",`rgb(${Rf})`):g.style.setProperty("background-image",`linear-gradient(to right, rgba(${Rf},0.85), rgba(${Rf},0.85))`),g.style.setProperty("caret-color","transparent")}function Wm(y,d){const g=d.elem,t=rr(g);rn(t)||xn(131),t.getBackgroundColor()===null&&g.style.removeProperty("background-color"),g.style.removeProperty("background-image"),g.style.removeProperty("caret-color")}function Mf(y){const d=vn(y,rn);return rn(d)?d:null}function ms(y){const d=vn(y,Pn);return Pn(d)?d:null}function Ml(y,d,g,t,f){if((g==="up"||g==="down")&&function(n){const e=n.getRootElement();return e?e.hasAttribute("aria-controls")&&e.getAttribute("aria-controls")==="typeahead-menu":!1}(y))return!1;const r=Oe();if(!Ri(r,t)){if(xe(r)){if(r.isCollapsed()&&g==="backward"){const n=r.anchor.type,e=r.anchor.offset;if(n!=="element"&&(n!=="text"||e!==0))return!1;const s=r.anchor.getNode();if(!s)return!1;const i=vn(s,o=>ge(o)&&!o.isInline());if(!i)return!1;const l=i.getPreviousSibling();return!(!l||!Pn(l))&&(wa(d),l.selectEnd(),!0)}if(d.shiftKey&&(g==="up"||g==="down")){const n=r.anchor.getNode();if(ko(n)){const e=r.getNodes()[0];if(e){const s=vn(e,rn);if(s&&t.isParentOf(s)){const i=t.getFirstDescendant(),l=t.getLastDescendant();if(!i||!l)return!1;const[o]=qr(i),[a]=qr(l),c=t.getCordsFromCellNode(o,f.table),u=t.getCordsFromCellNode(a,f.table),h=t.getDOMCellFromCordsOrThrow(c.x,c.y,f.table),p=t.getDOMCellFromCordsOrThrow(u.x,u.y,f.table);return f.setAnchorCellForSelection(h),f.setFocusCellForSelection(p,!0),!0}}return!1}{const e=vn(n,i=>ge(i)&&!i.isInline());if(!e)return!1;const s=g==="down"?e.getNextSibling():e.getPreviousSibling();if(Pn(s)&&f.tableNodeKey===s.getKey()){const i=s.getFirstDescendant(),l=s.getLastDescendant();if(!i||!l)return!1;const[o]=qr(i),[a]=qr(l),c=r.clone();return c.focus.set((g==="up"?o:a).getKey(),g==="up"?0:a.getChildrenSize(),"element"),or(c),!0}}}}return!1}if(xe(r)&&r.isCollapsed()){const{anchor:n,focus:e}=r,s=vn(n.getNode(),rn),i=vn(e.getNode(),rn);if(!rn(s)||!s.is(i))return!1;const l=ms(s);if(l!==t&&l!=null){const m=y.getElementByKey(l.getKey());if(m!=null)return f.table=Rl(m),Ml(y,d,g,l,f)}if(g==="backward"||g==="forward"){const m=n.type,b=n.offset,_=n.getNode();if(!_)return!1;const v=r.getNodes();return(v.length!==1||!Tn(v[0]))&&!!function(w,x,S,E){return function(k,D,P){return k==="element"&&(P==="backward"?D.getPreviousSibling()===null:D.getNextSibling()===null)}(w,S,E)||function(k,D,P,O){const R=vn(P,z=>ge(z)&&!z.isInline());if(!R)return!1;const A=O==="backward"?D===0:D===P.getTextContentSize();return k==="text"&&A&&(O==="backward"?R.getPreviousSibling()===null:R.getNextSibling()===null)}(w,x,S,E)}(m,b,_,g)&&function(w,x,S,E){const k=vn(x,rn);if(!rn(k))return!1;const[D,P]=Po(S,k,k);if(!function(R,A,z){const H=R[0][0],$=R[R.length-1][R[0].length-1],{startColumn:M,startRow:J}=A;return z==="backward"?M===H.startColumn&&J===H.startRow:M===$.startColumn&&J===$.startRow}(D,P,E))return!1;const O=function(R,A,z){const H=vn(R,M=>ge(M)&&!M.isInline());if(!H)return;const $=A==="backward"?H.getPreviousSibling():H.getNextSibling();return $&&Pn($)?$:A==="backward"?z.getPreviousSibling():z.getNextSibling()}(x,E,S);return!O||Pn(O)?!1:(wa(w),E==="backward"?O.selectEnd():O.selectStart(),!0)}(d,_,t,g)}const o=y.getElementByKey(s.__key),a=y.getElementByKey(n.key);if(a==null||o==null)return!1;let c;if(n.type==="element")c=a.getBoundingClientRect();else{const m=window.getSelection();if(m===null||m.rangeCount===0)return!1;c=m.getRangeAt(0).getBoundingClientRect()}const u=g==="up"?s.getFirstChild():s.getLastChild();if(u==null)return!1;const h=y.getElementByKey(u.__key);if(h==null)return!1;const p=h.getBoundingClientRect();if(g==="up"?p.top>c.top-c.height:c.bottom+c.height>p.bottom){wa(d);const m=t.getCordsFromCellNode(s,f.table);if(!d.shiftKey)return Jm(f,t,m.x,m.y,g);{const b=t.getDOMCellFromCordsOrThrow(m.x,m.y,f.table);f.setAnchorCellForSelection(b),f.setFocusCellForSelection(b,!0)}return!0}}else if(Bn(r)){const{anchor:n,focus:e}=r,s=vn(n.getNode(),rn),i=vn(e.getNode(),rn),[l]=r.getNodes(),o=y.getElementByKey(l.getKey());if(!rn(s)||!rn(i)||!Pn(l)||o==null)return!1;f.updateTableTableSelection(r);const a=Rl(o),c=t.getCordsFromCellNode(s,a),u=t.getDOMCellFromCordsOrThrow(c.x,c.y,a);if(f.setAnchorCellForSelection(u),wa(d),d.shiftKey){const h=t.getCordsFromCellNode(i,a);return y_(f,l,h.x,h.y,g)}return i.selectEnd(),!0}return!1}function wa(y){y.preventDefault(),y.stopImmediatePropagation(),y.stopPropagation()}function Km(y,d,g){const t=Un();y==="first"?d.insertBefore(t):d.insertAfter(t),t.append(...g||[]),t.selectEnd()}function Gm(y,d,g){const t=g.getParent();if(!t)return;const f=y.getElementByKey(t.getKey());if(!f)return;const r=window.getSelection();if(!r||r.anchorNode!==f)return;const n=vn(d.anchor.getNode(),p=>rn(p));if(!n)return;const e=vn(n,p=>Pn(p));if(!Pn(e)||!e.is(g))return;const[s,i]=Po(g,n,n),l=s[0][0],o=s[s.length-1][s[0].length-1],{startRow:a,startColumn:c}=i,u=a===l.startRow&&c===l.startColumn,h=a===o.startRow&&c===o.startColumn;return u?"first":h?"last":void 0}class bo extends jo{static getType(){return"table"}static clone(d){return new bo(d.__key)}static importDOM(){return{table:d=>({conversion:b_,priority:1})}}static importJSON(d){return Df()}constructor(d){super(d)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(d,g){const t=document.createElement("table");return Ni(t,d.theme.table),t}updateDOM(){return!1}exportDOM(d){return{...super.exportDOM(d),after:g=>{if(g){const t=g.cloneNode(),f=document.createElement("colgroup"),r=document.createElement("tbody");Sl(g)&&r.append(...g.children);const n=this.getFirstChildOrThrow();if(!sr(n))throw new Error("Expected to find row node.");const e=n.getChildrenSize();for(let s=0;s<e;s++){const i=document.createElement("col");f.append(i)}return t.replaceChildren(f,r),t}}}}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(d,g){const{rows:t,domRows:f}=g;for(let r=0;r<t;r++){const n=f[r];if(n==null)continue;const e=n.findIndex(s=>{if(!s)return;const{elem:i}=s;return rr(i)===d});if(e!==-1)return{x:e,y:r}}throw new Error("Cell not found in table.")}getDOMCellFromCords(d,g,t){const{domRows:f}=t,r=f[g];if(r==null)return null;const n=r[d];return n??null}getDOMCellFromCordsOrThrow(d,g,t){const f=this.getDOMCellFromCords(d,g,t);if(!f)throw new Error("Cell not found at cords.");return f}getCellNodeFromCords(d,g,t){const f=this.getDOMCellFromCords(d,g,t);if(f==null)return null;const r=rr(f.elem);return rn(r)?r:null}getCellNodeFromCordsOrThrow(d,g,t){const f=this.getCellNodeFromCords(d,g,t);if(!f)throw new Error("Node at cords not TableCellNode.");return f}canSelectBefore(){return!0}canIndent(){return!1}}function b_(y){return{node:Df()}}function Df(){return Yo(new bo)}function Pn(y){return y instanceof bo}const Ym=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],Zm=Ym[Math.floor(Math.random()*Ym.length)],v_=Ce.createContext({clientID:0,color:Zm[1],isCollabActive:!1,name:Zm[0],yjsDocMap:new Map});function __(y,d){const g=Ce.useContext(v_);return y!=null&&(g.name=y),d!=null&&(g.color=d),g}const x_=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ce.useLayoutEffect:Ce.useEffect;function w_({onClear:y}){const[d]=jr();return x_(()=>d.registerCommand(Od,g=>(d.update(()=>{if(y==null){const t=Ln(),f=Oe(),r=Un();t.clear(),t.append(r),f!==null&&r.select(),xe(f)&&(f.format=0)}else y()}),!0),an),[d,y]),null}function Lf(y,d){return Lf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(g,t){return g.__proto__=t,g},Lf(y,d)}var Qm={error:null},S_=function(y){var d,g;function t(){for(var r,n=arguments.length,e=new Array(n),s=0;s<n;s++)e[s]=arguments[s];return(r=y.call.apply(y,[this].concat(e))||this).state=Qm,r.resetErrorBoundary=function(){for(var i,l=arguments.length,o=new Array(l),a=0;a<l;a++)o[a]=arguments[a];r.props.onReset==null||(i=r.props).onReset.apply(i,o),r.reset()},r}g=y,(d=t).prototype=Object.create(g.prototype),d.prototype.constructor=d,Lf(d,g),t.getDerivedStateFromError=function(r){return{error:r}};var f=t.prototype;return f.reset=function(){this.setState(Qm)},f.componentDidCatch=function(r,n){var e,s;(e=(s=this.props).onError)==null||e.call(s,r,n)},f.componentDidUpdate=function(r,n){var e,s,i,l,o=this.state.error,a=this.props.resetKeys;o!==null&&n.error!==null&&((i=r.resetKeys)===void 0&&(i=[]),(l=a)===void 0&&(l=[]),i.length!==l.length||i.some(function(c,u){return!Object.is(c,l[u])}))&&((e=(s=this.props).onResetKeysChange)==null||e.call(s,r.resetKeys,a),this.reset())},f.render=function(){var r=this.state.error,n=this.props,e=n.fallbackRender,s=n.FallbackComponent,i=n.fallback;if(r!==null){var l={error:r,resetErrorBoundary:this.resetErrorBoundary};if(Qn.isValidElement(i))return i;if(typeof e=="function")return e(l);if(s)return Qn.createElement(s,l);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},t}(Qn.Component);function C_({children:y,onError:d}){return he.jsx(S_,{fallback:he.jsx("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"},children:"An error was thrown."}),onError:d,children:y})}const E_=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ce.useLayoutEffect:Ce.useEffect;function k_({ignoreHistoryMergeTagChange:y=!0,ignoreSelectionChange:d=!1,onChange:g}){const[t]=jr();return E_(()=>{if(g)return t.registerUpdateListener(({editorState:f,dirtyElements:r,dirtyLeaves:n,prevEditorState:e,tags:s})=>{d&&r.size===0&&n.size===0||y&&s.has("history-merge")||e.isEmpty()||g(f,t,s)})},[t,y,d,g]),null}const ys=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,O_=ys&&"documentMode"in document?document.documentMode:null,T_=!(!ys||!("InputEvent"in window)||O_)&&"getTargetRanges"in new window.InputEvent("input"),j_=ys&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),A_=ys&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,P_=ys&&/^(?=.*Chrome).*/i.test(navigator.userAgent),N_=ys&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!P_;function Xm(y,d){d.update(()=>{if(y!==null){const g=Ii(y,KeyboardEvent)?null:y.clipboardData,t=Oe();if(t!==null&&g!=null){y.preventDefault();const f=wm(d);f!==null&&g.setData("text/html",f),g.setData("text/plain",t.getTextContent())}}})}function I_(y){return mo(y.registerCommand(uo,d=>{const g=Oe();return!!xe(g)&&(g.deleteCharacter(d),!0)},an),y.registerCommand(ca,d=>{const g=Oe();return!!xe(g)&&(g.deleteWord(d),!0)},an),y.registerCommand(Ci,d=>{const g=Oe();return!!xe(g)&&(g.deleteLine(d),!0)},an),y.registerCommand(Si,d=>{const g=Oe();if(!xe(g))return!1;if(typeof d=="string")g.insertText(d);else{const t=d.dataTransfer;if(t!=null)Sm(t,g);else{const f=d.data;f&&g.insertText(f)}}return!0},an),y.registerCommand(Sc,()=>{const d=Oe();return!!xe(d)&&(d.removeText(),!0)},an),y.registerCommand(wi,d=>{const g=Oe();return!!xe(g)&&(g.insertLineBreak(d),!0)},an),y.registerCommand(Za,()=>{const d=Oe();return!!xe(d)&&(d.insertLineBreak(),!0)},an),y.registerCommand(Ec,d=>{const g=Oe();if(!xe(g))return!1;const t=d,f=t.shiftKey;return!!ru(g,!0)&&(t.preventDefault(),ou(g,f,!0),!0)},an),y.registerCommand(Cc,d=>{const g=Oe();if(!xe(g))return!1;const t=d,f=t.shiftKey;return!!ru(g,!1)&&(t.preventDefault(),ou(g,f,!1),!0)},an),y.registerCommand(fl,d=>{const g=Oe();return!!xe(g)&&(d.preventDefault(),y.dispatchCommand(uo,!0))},an),y.registerCommand(pl,d=>{const g=Oe();return!!xe(g)&&(d.preventDefault(),y.dispatchCommand(uo,!1))},an),y.registerCommand(dl,d=>{const g=Oe();if(!xe(g))return!1;if(d!==null){if((A_||j_||N_)&&T_)return!1;d.preventDefault()}return y.dispatchCommand(wi,!1)},an),y.registerCommand(Oc,()=>(Zh(),!0),an),y.registerCommand(hl,d=>{const g=Oe();return!!xe(g)&&(Xm(d,y),!0)},an),y.registerCommand(gl,d=>{const g=Oe();return!!xe(g)&&(function(t,f){Xm(t,f),f.update(()=>{const r=Oe();xe(r)&&r.removeText()})}(d,y),!0)},an),y.registerCommand(ll,d=>{const g=Oe();return!!xe(g)&&(function(t,f){t.preventDefault(),f.update(()=>{const r=Oe(),{clipboardData:n}=t;n!=null&&xe(r)&&Sm(n,r)},{tag:"paste"})}(d,y),!0)},an),y.registerCommand(Ed,d=>{const g=Oe();return!!xe(g)&&(d.preventDefault(),!0)},an),y.registerCommand(kd,d=>{const g=Oe();return!!xe(g)&&(d.preventDefault(),!0)},an))}const Bf=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0?Ce.useLayoutEffect:Ce.useEffect;function t0(y){return y.getEditorState().read(mm(y.isComposing()))}function R_({contentEditable:y,placeholder:d,ErrorBoundary:g}){const[t]=jr(),f=function(r,n){const[e,s]=Ce.useState(()=>r.getDecorators());return Bf(()=>r.registerDecoratorListener(i=>{$r.flushSync(()=>{s(i)})}),[r]),Ce.useEffect(()=>{s(r.getDecorators())},[r]),Ce.useMemo(()=>{const i=[],l=Object.keys(e);for(let o=0;o<l.length;o++){const a=l[o],c=he.jsx(n,{onError:h=>r._onError(h),children:he.jsx(Ce.Suspense,{fallback:null,children:e[a]})}),u=r.getElementByKey(a);u!==null&&i.push($r.createPortal(c,u,a))}return i},[n,e,r])}(t,g);return function(r){Bf(()=>mo(I_(r),ym(r)),[r])}(t),he.jsxs(he.Fragment,{children:[y,he.jsx(M_,{content:d}),f]})}function M_({content:y}){const[d]=jr(),g=function(f){const[r,n]=Ce.useState(()=>t0(f));return Bf(()=>{function e(){const s=t0(f);n(s)}return e(),mo(f.registerUpdateListener(()=>{e()}),f.registerEditableListener(()=>{e()}))},[f]),r}(d),t=au();return g?typeof y=="function"?y(t):y:null}var D_={967:(y,d,g)=>{const t=["docId","username","apiKey","domain","hooks","editorInstanceHooks","appServer","demo"];function f(c,u){var h=Object.keys(c);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(c);u&&(p=p.filter(function(m){return Object.getOwnPropertyDescriptor(c,m).enumerable})),h.push.apply(h,p)}return h}function r(c){for(var u=1;u<arguments.length;u++){var h=arguments[u]!=null?arguments[u]:{};u%2?f(Object(h),!0).forEach(function(p){n(c,p,h[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(h)):f(Object(h)).forEach(function(p){Object.defineProperty(c,p,Object.getOwnPropertyDescriptor(h,p))})}return c}function n(c,u,h){return(u=function(p){var m=function(b,_){if(typeof b!="object"||!b)return b;var v=b[Symbol.toPrimitive];if(v!==void 0){var w=v.call(b,"string");if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(b)}(p);return typeof m=="symbol"?m:m+""}(u))in c?Object.defineProperty(c,u,{value:h,enumerable:!0,configurable:!0,writable:!0}):c[u]=h,c}let e;e=g(668);let s=null;d.conf=function(c){c.autoStart=!1,s&&s.init(c)};const i=async function(c){if(s)return s.start(c)};d.start=i;const l=function(c){s&&(s.stop(),s=null)};d.stop=l;const o=function(c,u){let h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(s)return s.diff({state1:c,state2:u,config:h})};d.diff=o;const a=function(){if(s)return s.sync(...arguments)};d.sync=a,d.initSync=function(c){return s?s.initSync(c):c},y.exports={start:i,sync:a,diff:o,stop:l,createConfig:c=>{let{docId:u,username:h,apiKey:p,domain:m,hooks:b,editorInstanceHooks:_,appServer:v={},demo:w=!1}=c;return r(r({},function(x,S){if(x==null)return{};var E,k,D=function(O,R){if(O==null)return{};var A={};for(var z in O)if({}.hasOwnProperty.call(O,z)){if(R.indexOf(z)>=0)continue;A[z]=O[z]}return A}(x,S);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(x);for(k=0;k<P.length;k++)E=P[k],S.indexOf(E)>=0||{}.propertyIsEnumerable.call(x,E)&&(D[E]=x[E])}return D}(c,t)),{},{docId:u,username:h,apiKey:p,autoStart:!0,demo:w,domain:m,hooks:b,editorInstance:r({type:"lexical"},_),app:"json",json:{keyNames:{default:"codoxId"},filters:{version:!0},appServer:v,semantics:{paths:{"state.root.children.children.text":"MERGE","state.root.children.children.children.text":"MERGE"},string:"MERGE"}}})},get instance(){return s},createNewInstance:()=>{s=new e}}},668:(y,d,g)=>{y.exports=function t(f,r,n){function e(l,o){if(!r[l]){if(!f[l]){var a=void 0;if(!o&&a)return require(l,!0);if(s)return s(l,!0);throw(o=new Error("Cannot find module '"+l+"'")).code="MODULE_NOT_FOUND",o}a=r[l]={exports:{}},f[l][0].call(a.exports,function(c){return e(f[l][1][c]||c)},a,a.exports,t,f,r,n)}return r[l].exports}for(var s=void 0,i=0;i<n.length;i++)e(n[i]);return e}({1:[function(t,f,r){f.exports=function(n,e){(e==null||e>n.length)&&(e=n.length);for(var s=0,i=new Array(e);s<e;s++)i[s]=n[s];return i},f.exports.__esModule=!0,f.exports.default=f.exports},{}],2:[function(t,f,r){f.exports=function(n){if(Array.isArray(n))return n},f.exports.__esModule=!0,f.exports.default=f.exports},{}],3:[function(t,f,r){var n=t("./arrayLikeToArray.js");f.exports=function(e){if(Array.isArray(e))return n(e)},f.exports.__esModule=!0,f.exports.default=f.exports},{"./arrayLikeToArray.js":1}],4:[function(t,f,r){f.exports=function(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n},f.exports.__esModule=!0,f.exports.default=f.exports},{}],5:[function(t,f,r){f.exports=function(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")},f.exports.__esModule=!0,f.exports.default=f.exports},{}],6:[function(t,f,r){var n=t("./setPrototypeOf.js"),e=t("./isNativeReflectConstruct.js");function s(i,l,o){return e()?f.exports=s=Reflect.construct.bind():f.exports=s=function(a,c,u){var h=[null];return h.push.apply(h,c),c=new(Function.bind.apply(a,h)),u&&n(c,u.prototype),c},f.exports.__esModule=!0,f.exports.default=f.exports,s.apply(null,arguments)}f.exports=s,f.exports.__esModule=!0,f.exports.default=f.exports},{"./isNativeReflectConstruct.js":13,"./setPrototypeOf.js":19}],7:[function(t,f,r){function n(e,s){for(var i=0;i<s.length;i++){var l=s[i];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}f.exports=function(e,s,i){return s&&n(e.prototype,s),i&&n(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e},f.exports.__esModule=!0,f.exports.default=f.exports},{}],8:[function(t,f,r){f.exports=function(n,e,s){return e in n?Object.defineProperty(n,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):n[e]=s,n},f.exports.__esModule=!0,f.exports.default=f.exports},{}],9:[function(t,f,r){function n(e){return f.exports=n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(s){return s.__proto__||Object.getPrototypeOf(s)},f.exports.__esModule=!0,f.exports.default=f.exports,n(e)}f.exports=n,f.exports.__esModule=!0,f.exports.default=f.exports},{}],10:[function(t,f,r){var n=t("./setPrototypeOf.js");f.exports=function(e,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(s&&s.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),s&&n(e,s)},f.exports.__esModule=!0,f.exports.default=f.exports},{"./setPrototypeOf.js":19}],11:[function(t,f,r){f.exports=function(n){return n&&n.__esModule?n:{default:n}},f.exports.__esModule=!0,f.exports.default=f.exports},{}],12:[function(t,f,r){f.exports=function(n){return Function.toString.call(n).indexOf("[native code]")!==-1},f.exports.__esModule=!0,f.exports.default=f.exports},{}],13:[function(t,f,r){f.exports=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}},f.exports.__esModule=!0,f.exports.default=f.exports},{}],14:[function(t,f,r){f.exports=function(n){if(typeof Symbol<"u"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)},f.exports.__esModule=!0,f.exports.default=f.exports},{}],15:[function(t,f,r){f.exports=function(n,e){var s=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(s!=null){var i,l,o=[],a=!0,c=!1;try{for(s=s.call(n);!(a=(i=s.next()).done)&&(o.push(i.value),!e||o.length!==e);a=!0);}catch(u){c=!0,l=u}finally{try{a||s.return==null||s.return()}finally{if(c)throw l}}return o}},f.exports.__esModule=!0,f.exports.default=f.exports},{}],16:[function(t,f,r){f.exports=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
43
43
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},f.exports.__esModule=!0,f.exports.default=f.exports},{}],17:[function(t,f,r){f.exports=function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
44
44
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},f.exports.__esModule=!0,f.exports.default=f.exports},{}],18:[function(t,f,r){var n=t("./typeof.js").default,e=t("./assertThisInitialized.js");f.exports=function(s,i){if(i&&(n(i)==="object"||typeof i=="function"))return i;if(i!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return e(s)},f.exports.__esModule=!0,f.exports.default=f.exports},{"./assertThisInitialized.js":4,"./typeof.js":22}],19:[function(t,f,r){function n(e,s){return f.exports=n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},f.exports.__esModule=!0,f.exports.default=f.exports,n(e,s)}f.exports=n,f.exports.__esModule=!0,f.exports.default=f.exports},{}],20:[function(t,f,r){var n=t("./arrayWithHoles.js"),e=t("./iterableToArrayLimit.js"),s=t("./unsupportedIterableToArray.js"),i=t("./nonIterableRest.js");f.exports=function(l,o){return n(l)||e(l,o)||s(l,o)||i()},f.exports.__esModule=!0,f.exports.default=f.exports},{"./arrayWithHoles.js":2,"./iterableToArrayLimit.js":15,"./nonIterableRest.js":16,"./unsupportedIterableToArray.js":23}],21:[function(t,f,r){var n=t("./arrayWithoutHoles.js"),e=t("./iterableToArray.js"),s=t("./unsupportedIterableToArray.js"),i=t("./nonIterableSpread.js");f.exports=function(l){return n(l)||e(l)||s(l)||i()},f.exports.__esModule=!0,f.exports.default=f.exports},{"./arrayWithoutHoles.js":3,"./iterableToArray.js":14,"./nonIterableSpread.js":17,"./unsupportedIterableToArray.js":23}],22:[function(t,f,r){function n(e){return f.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},f.exports.__esModule=!0,f.exports.default=f.exports,n(e)}f.exports=n,f.exports.__esModule=!0,f.exports.default=f.exports},{}],23:[function(t,f,r){var n=t("./arrayLikeToArray.js");f.exports=function(e,s){if(e){if(typeof e=="string")return n(e,s);var i=Object.prototype.toString.call(e).slice(8,-1);return(i=i==="Object"&&e.constructor?e.constructor.name:i)==="Map"||i==="Set"?Array.from(e):i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,s):void 0}},f.exports.__esModule=!0,f.exports.default=f.exports},{"./arrayLikeToArray.js":1}],24:[function(t,f,r){var n=t("./getPrototypeOf.js"),e=t("./setPrototypeOf.js"),s=t("./isNativeFunction.js"),i=t("./construct.js");function l(o){var a=typeof Map=="function"?new Map:void 0;return f.exports=l=function(c){if(c===null||!s(c))return c;if(typeof c!="function")throw new TypeError("Super expression must either be null or a function");if(a!==void 0){if(a.has(c))return a.get(c);a.set(c,u)}function u(){return i(c,arguments,n(this).constructor)}return u.prototype=Object.create(c.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),e(u,c)},f.exports.__esModule=!0,f.exports.default=f.exports,l(o)}f.exports=l,f.exports.__esModule=!0,f.exports.default=f.exports},{"./construct.js":6,"./getPrototypeOf.js":9,"./isNativeFunction.js":12,"./setPrototypeOf.js":19}],25:[function(t,f,r){f.exports=function n(e,s){if(e===s)return!0;if(e&&s&&typeof e=="object"&&typeof s=="object"){if(e.constructor!==s.constructor)return!1;var i,l,o;if(Array.isArray(e)){if((i=e.length)!=s.length)return!1;for(l=i;l--!=0;)if(!n(e[l],s[l]))return!1;return!0}if(e.constructor===RegExp)return e.source===s.source&&e.flags===s.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===s.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===s.toString();if((i=(o=Object.keys(e)).length)!==Object.keys(s).length)return!1;for(l=i;l--!=0;)if(!Object.prototype.hasOwnProperty.call(s,o[l]))return!1;for(l=i;l--!=0;){var a=o[l];if(!n(e[a],s[a]))return!1}return!0}return e!=e&&s!=s}},{}],26:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return u.default}});var n=h(t("./v1.js")),e=h(t("./v3.js")),s=h(t("./v4.js")),i=h(t("./v5.js")),l=h(t("./nil.js")),o=h(t("./version.js")),a=h(t("./validate.js")),c=h(t("./stringify.js")),u=h(t("./parse.js"));function h(p){return p&&p.__esModule?p:{default:p}}},{"./nil.js":28,"./parse.js":29,"./stringify.js":33,"./v1.js":34,"./v3.js":35,"./v4.js":37,"./v5.js":38,"./validate.js":39,"./version.js":40}],27:[function(t,f,r){function n(c){return 14+(c+64>>>9<<4)+1}function e(c,u){var h=(65535&c)+(65535&u);return(c>>16)+(u>>16)+(h>>16)<<16|65535&h}function s(c,u,h,p,m,b){return e((u=e(e(u,c),e(p,b)))<<m|u>>>32-m,h)}function i(c,u,h,p,m,b,_){return s(u&h|~u&p,c,u,m,b,_)}function l(c,u,h,p,m,b,_){return s(u&p|h&~p,c,u,m,b,_)}function o(c,u,h,p,m,b,_){return s(u^h^p,c,u,m,b,_)}function a(c,u,h,p,m,b,_){return s(h^(u|~p),c,u,m,b,_)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default=function(c){if(typeof c=="string"){const p=unescape(encodeURIComponent(c));c=new Uint8Array(p.length);for(let m=0;m<p.length;++m)c[m]=p.charCodeAt(m)}{var u=function(_,v){_[v>>5]|=128<<v%32,_[n(v)-1]=v;let w=1732584193,x=-271733879,S=-1732584194,E=271733878;for(let R=0;R<_.length;R+=16){var k=w,D=x,P=S,O=E;w=i(w,x,S,E,_[R],7,-680876936),E=i(E,w,x,S,_[R+1],12,-389564586),S=i(S,E,w,x,_[R+2],17,606105819),x=i(x,S,E,w,_[R+3],22,-1044525330),w=i(w,x,S,E,_[R+4],7,-176418897),E=i(E,w,x,S,_[R+5],12,1200080426),S=i(S,E,w,x,_[R+6],17,-1473231341),x=i(x,S,E,w,_[R+7],22,-45705983),w=i(w,x,S,E,_[R+8],7,1770035416),E=i(E,w,x,S,_[R+9],12,-1958414417),S=i(S,E,w,x,_[R+10],17,-42063),x=i(x,S,E,w,_[R+11],22,-1990404162),w=i(w,x,S,E,_[R+12],7,1804603682),E=i(E,w,x,S,_[R+13],12,-40341101),S=i(S,E,w,x,_[R+14],17,-1502002290),x=i(x,S,E,w,_[R+15],22,1236535329),w=l(w,x,S,E,_[R+1],5,-165796510),E=l(E,w,x,S,_[R+6],9,-1069501632),S=l(S,E,w,x,_[R+11],14,643717713),x=l(x,S,E,w,_[R],20,-373897302),w=l(w,x,S,E,_[R+5],5,-701558691),E=l(E,w,x,S,_[R+10],9,38016083),S=l(S,E,w,x,_[R+15],14,-660478335),x=l(x,S,E,w,_[R+4],20,-405537848),w=l(w,x,S,E,_[R+9],5,568446438),E=l(E,w,x,S,_[R+14],9,-1019803690),S=l(S,E,w,x,_[R+3],14,-187363961),x=l(x,S,E,w,_[R+8],20,1163531501),w=l(w,x,S,E,_[R+13],5,-1444681467),E=l(E,w,x,S,_[R+2],9,-51403784),S=l(S,E,w,x,_[R+7],14,1735328473),x=l(x,S,E,w,_[R+12],20,-1926607734),w=o(w,x,S,E,_[R+5],4,-378558),E=o(E,w,x,S,_[R+8],11,-2022574463),S=o(S,E,w,x,_[R+11],16,1839030562),x=o(x,S,E,w,_[R+14],23,-35309556),w=o(w,x,S,E,_[R+1],4,-1530992060),E=o(E,w,x,S,_[R+4],11,1272893353),S=o(S,E,w,x,_[R+7],16,-155497632),x=o(x,S,E,w,_[R+10],23,-1094730640),w=o(w,x,S,E,_[R+13],4,681279174),E=o(E,w,x,S,_[R],11,-358537222),S=o(S,E,w,x,_[R+3],16,-722521979),x=o(x,S,E,w,_[R+6],23,76029189),w=o(w,x,S,E,_[R+9],4,-640364487),E=o(E,w,x,S,_[R+12],11,-421815835),S=o(S,E,w,x,_[R+15],16,530742520),x=o(x,S,E,w,_[R+2],23,-995338651),w=a(w,x,S,E,_[R],6,-198630844),E=a(E,w,x,S,_[R+7],10,1126891415),S=a(S,E,w,x,_[R+14],15,-1416354905),x=a(x,S,E,w,_[R+5],21,-57434055),w=a(w,x,S,E,_[R+12],6,1700485571),E=a(E,w,x,S,_[R+3],10,-1894986606),S=a(S,E,w,x,_[R+10],15,-1051523),x=a(x,S,E,w,_[R+1],21,-2054922799),w=a(w,x,S,E,_[R+8],6,1873313359),E=a(E,w,x,S,_[R+15],10,-30611744),S=a(S,E,w,x,_[R+6],15,-1560198380),x=a(x,S,E,w,_[R+13],21,1309151649),w=a(w,x,S,E,_[R+4],6,-145523070),E=a(E,w,x,S,_[R+11],10,-1120210379),S=a(S,E,w,x,_[R+2],15,718787259),x=a(x,S,E,w,_[R+9],21,-343485551),w=e(w,k),x=e(x,D),S=e(S,P),E=e(E,O)}return[w,x,S,E]}(function(_){if(_.length===0)return[];const v=8*_.length,w=new Uint32Array(n(v));for(let x=0;x<v;x+=8)w[x>>5]|=(255&_[x/8])<<x%32;return w}(c),8*c.length);const p=[],m=32*u.length,b="0123456789abcdef";for(let _=0;_<m;_+=8){var h=u[_>>5]>>>_%32&255;h=parseInt(b.charAt(h>>>4&15)+b.charAt(15&h),16),p.push(h)}return p}}},{}],28:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default="00000000-0000-0000-0000-000000000000"},{}],29:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(t=t("./validate.js"))&&t.__esModule?t:{default:t};r.default=function(e){if(!(0,n.default)(e))throw TypeError("Invalid UUID");var s;const i=new Uint8Array(16);return i[0]=(s=parseInt(e.slice(0,8),16))>>>24,i[1]=s>>>16&255,i[2]=s>>>8&255,i[3]=255&s,i[4]=(s=parseInt(e.slice(9,13),16))>>>8,i[5]=255&s,i[6]=(s=parseInt(e.slice(14,18),16))>>>8,i[7]=255&s,i[8]=(s=parseInt(e.slice(19,23),16))>>>8,i[9]=255&s,i[10]=(s=parseInt(e.slice(24,36),16))/1099511627776&255,i[11]=s/4294967296&255,i[12]=s>>>24&255,i[13]=s>>>16&255,i[14]=s>>>8&255,i[15]=255&s,i}},{"./validate.js":39}],30:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default=/^(?:[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},{}],31:[function(t,f,r){let n;Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){if(!n&&!(n=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(e)};const e=new Uint8Array(16)},{}],32:[function(t,f,r){function n(e,s){return e<<s|e>>>32-s}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.default=function(e){var s=[1518500249,1859775393,2400959708,3395469782];const i=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof e=="string"){const u=unescape(encodeURIComponent(e));e=[];for(let h=0;h<u.length;++h)e.push(u.charCodeAt(h))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);var l=e.length/4+2,o=Math.ceil(l/16);const a=new Array(o);for(let u=0;u<o;++u){const h=new Uint32Array(16);for(let p=0;p<16;++p)h[p]=e[64*u+4*p]<<24|e[64*u+4*p+1]<<16|e[64*u+4*p+2]<<8|e[64*u+4*p+3];a[u]=h}a[o-1][14]=8*(e.length-1)/Math.pow(2,32),a[o-1][14]=Math.floor(a[o-1][14]),a[o-1][15]=8*(e.length-1)&4294967295;for(let u=0;u<o;++u){const h=new Uint32Array(80);for(let w=0;w<16;++w)h[w]=a[u][w];for(let w=16;w<80;++w)h[w]=n(h[w-3]^h[w-8]^h[w-14]^h[w-16],1);let p=i[0],m=i[1],b=i[2],_=i[3],v=i[4];for(let w=0;w<80;++w){var c=Math.floor(w/20);c=n(p,5)+function(x,S,E,k){switch(x){case 0:return S&E^~S&k;case 1:case 3:return S^E^k;case 2:return S&E^S&k^E&k}}(c,m,b,_)+v+s[c]+h[w]>>>0,v=_,_=b,b=n(m,30)>>>0,m=p,p=c}i[0]=i[0]+p>>>0,i[1]=i[1]+m>>>0,i[2]=i[2]+b>>>0,i[3]=i[3]+_>>>0,i[4]=i[4]+v>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}},{}],33:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(t=t("./validate.js"))&&t.__esModule?t:{default:t};const e=[];for(let s=0;s<256;++s)e.push((s+256).toString(16).substr(1));r.default=function(s){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(s=(e[s[i+0]]+e[s[i+1]]+e[s[i+2]]+e[s[i+3]]+"-"+e[s[i+4]]+e[s[i+5]]+"-"+e[s[i+6]]+e[s[i+7]]+"-"+e[s[i+8]]+e[s[i+9]]+"-"+e[s[i+10]]+e[s[i+11]]+e[s[i+12]]+e[s[i+13]]+e[s[i+14]]+e[s[i+15]]).toLowerCase(),(0,n.default)(s))return s;throw TypeError("Stringified UUID is invalid")}},{"./validate.js":39}],34:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=s(t("./rng.js")),e=s(t("./stringify.js"));function s(c){return c&&c.__esModule?c:{default:c}}let i,l,o=0,a=0;r.default=function(c,u,h){var p=u&&h||0;const m=u||new Array(16);let b=(c=c||{}).node||i,_=c.clockseq!==void 0?c.clockseq:l,v=(b!=null&&_!=null||(h=c.random||(c.rng||n.default)(),b==null&&(b=i=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),_==null&&(_=l=16383&(h[6]<<8|h[7]))),c.msecs!==void 0?c.msecs:Date.now()),w=c.nsecs!==void 0?c.nsecs:a+1;if((h=v-o+(w-a)/1e4)<0&&c.clockseq===void 0&&(_=_+1&16383),1e4<=(w=(h<0||v>o)&&c.nsecs===void 0?0:w))throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");o=v,a=w,l=_,h=(1e4*(268435455&(v+=122192928e5))+w)%4294967296,m[p++]=h>>>24&255,m[p++]=h>>>16&255,m[p++]=h>>>8&255,m[p++]=255&h,c=v/4294967296*1e4&268435455,m[p++]=c>>>8&255,m[p++]=255&c,m[p++]=c>>>24&15|16,m[p++]=c>>>16&255,m[p++]=_>>>8|128,m[p++]=255&_;for(let x=0;x<6;++x)m[p+x]=b[x];return u||(0,e.default)(m)}},{"./rng.js":31,"./stringify.js":33}],35:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e(t("./v35.js"));function e(s){return s&&s.__esModule?s:{default:s}}t=e(t("./md5.js")),n=(0,n.default)("v3",48,t.default),r.default=n},{"./md5.js":27,"./v35.js":36}],36:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(o,a,c){function u(h,p,m,b){if(typeof h=="string"&&(h=function(v){v=unescape(encodeURIComponent(v));const w=[];for(let x=0;x<v.length;++x)w.push(v.charCodeAt(x));return w}(h)),(p=typeof p=="string"?(0,e.default)(p):p).length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let _=new Uint8Array(16+h.length);if(_.set(p),_.set(h,p.length),(_=c(_))[6]=15&_[6]|a,_[8]=63&_[8]|128,m){b=b||0;for(let v=0;v<16;++v)m[b+v]=_[v];return m}return(0,n.default)(_)}try{u.name=o}catch{}return u.DNS=i,u.URL=l,u},r.URL=r.DNS=void 0;var n=s(t("./stringify.js")),e=s(t("./parse.js"));function s(o){return o&&o.__esModule?o:{default:o}}const i="6ba7b810-9dad-11d1-80b4-00c04fd430c8",l=(r.DNS=i,"6ba7b811-9dad-11d1-80b4-00c04fd430c8");r.URL=l},{"./parse.js":29,"./stringify.js":33}],37:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=s(t("./rng.js")),e=s(t("./stringify.js"));function s(i){return i&&i.__esModule?i:{default:i}}r.default=function(i,l,o){const a=(i=i||{}).random||(i.rng||n.default)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,l){o=o||0;for(let c=0;c<16;++c)l[o+c]=a[c];return l}return(0,e.default)(a)}},{"./rng.js":31,"./stringify.js":33}],38:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e(t("./v35.js"));function e(s){return s&&s.__esModule?s:{default:s}}t=e(t("./sha1.js")),n=(0,n.default)("v5",80,t.default),r.default=n},{"./sha1.js":32,"./v35.js":36}],39:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(t=t("./regex.js"))&&t.__esModule?t:{default:t};r.default=function(e){return typeof e=="string"&&n.default.test(e)}},{"./regex.js":30}],40:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=(t=t("./validate.js"))&&t.__esModule?t:{default:t};r.default=function(e){if((0,n.default)(e))return parseInt(e.substr(14,1),16);throw TypeError("Invalid UUID")}},{"./validate.js":39}],41:[function(t,f,r){var n=(s=t("@babel/runtime/helpers/interopRequireDefault"))(t("@babel/runtime/helpers/toConsumableArray")),e=s(t("@babel/runtime/helpers/classCallCheck")),s=s(t("@babel/runtime/helpers/createClass")),i=t("./logger").log4,l=(b=t("./type")).isRealObject,o=b.isObjectId,a=b.isDefined,c=b.isPrimitiveArray,u=b.getType,h=t("./utils"),p=t("./path").samePath,m=t("./errors").OperationError,b=((0,s.default)(_,[{key:"isMatchingObjects",value:function(v,w,x){return w=(v=this._utils.getObjectIdentifiers({input:v,output:w,path:x})).inputId,x=v.outputId,v=v.sameId,o(w)&&o(x)&&v}},{key:"haveObjectIds",value:function(v,w,x){return!!(v.li&&w.ld||v.ld&&w.li)&&(!!(Array.isArray(v.ld)&&Array.isArray(w.li)||Array.isArray(w.ld)&&Array.isArray(v.li))||(v=this._utils.getOpTargetObject(v),w=this._utils.getOpTargetObject(w),w=(v=this._utils.getObjectIdentifiers({input:v,output:w,path:x})).inputId,x=v.outputId,v.sameId,o(w)&&o(x)))}},{key:"isMatchingOpPair",value:function(v,w,x){return!!((v.li&&w.ld||v.ld&&w.li)&&(Array.isArray(v.ld)&&Array.isArray(w.li)&&this.sameTargetArray(v.ld,w.li)||Array.isArray(w.ld)&&Array.isArray(v.li)&&this.sameTargetArray(w.ld,v.li)||this.isMatchingObjects(this._utils.getOpTargetObject(v),this._utils.getOpTargetObject(w),x)))}},{key:"isObjReplace",value:function(v,w){return!(!v||!w||v.oi!=null||v.od===void 0||w.od!=null||w.oi===void 0||!p(v.p,w.p))}},{key:"isReplace",value:function(v,w){var x,S=["list","code","table"];return!(!v||!w||!((v.li&&w.ld||v.ld&&w.li)&&p(v.p,w.p)&&this.haveObjectIds(v,w,v.p))||(x=(v.ld!==void 0?v:w).ld,v=(v.li!==void 0?v:w).li,x.type=="paragraph"&&x.children!==void 0&&x.children.length==0&&v.type=="paragraph"&&v.children!==void 0&&0<v.children.length||!S.includes(x.type)&&S.includes(v.type)||S.includes(x.type)&&!S.includes(v.type)))}},{key:"isMove",value:function(v,w){return!(!v||!w||p(v.p,w.p)||!this.isMatchingOpPair(v,w,v.p))}},{key:"isIdentity",value:function(v,w){return i("isIdentity",v,w,!0),!(!v||!w)&&p(v.p,w.p)&&this.isMatchingOpPair(v,w,v.p)}},{key:"arrayDiff",value:function(v,w){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:[],S=3<arguments.length?arguments[3]:void 0;if(i("Start performing arrayDiff: beforeState = ",v,!0),i("Start performing arrayDiff: afterState",w,!0),!Array.isArray(v))throw new m("beforeState snapshot is not an array");if(!Array.isArray(w))throw new m("afterState snapshot is not an array");var E=[],k=0,D=0,P=0,O=0;for(k=0,D=0;D<w.length&&k<v.length;k++){i("arrayDiff: loop at",{i:k,j:D},!0);var R,A=v[k],z=k-P;z=[].concat((0,n.default)(x),[z]),this.isMatchingObjects(v[k],w[D],x)?(R=S(A,w[D],z),i("arrayDiff: same target object (id) -> recursively diff result = ",{r:R},!0),E=E.concat(R),D++):(R={p:z,ld:this._utils.deLabel(A)},E.push(R),i("arrayDiff: different target object (id) -> create a ld op = ",{op:R,i:k,dCount:++P},!0))}for(var H=k;H<v.length;H++){var $=v[H],M=H-P;M={p:[].concat((0,n.default)(x),[M]),ld:deLabel($)},E.push(M),i("arrayDiff: handle beforeState tail, create a ld op",{op:M,pos:H},!0),P++}for(var J=D;J<w.length;J++){var K=w[J],N=J;N={p:[].concat((0,n.default)(x),[N]),li:deLabel(K)},E.push(N),i("arrayDiff: handle afterState tail, create a li op",{op:N,pos:J},!0),O++}return{ops:E,dCount:P,iCount:O}}},{key:"arrayOfArrayDiff",value:function(){var v,w,x=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},S=x.before,E=x.after,k=x.path,D=x.commonHeaderLen,P=x.diff,O=x.isObjectArray,R=x.isInternal,A=[],z=0,H=0,$=0;for(z=0,H=0;H<E.length&&z<S.length;z++)!O&&(this.sameTargetArray(S[z],E[H])||c(S[z])&&c(E[H])||u(S[z])=="array"&&u(E[H]=="array"))||O&&this.isMatchingObjects(S[z],E[H],k)?(i(`
|
|
45
45
|
arrayOfArrayDiff: the same array -> recursive invocation of diff: i = `+z+"; j = "+H),i("before[i] = ",S[z]),i("after[j] = ",E[H]),v=P(S[z],E[H],[].concat((0,n.default)(k),[z+D-$]),R),A=A.concat(v),i("arrayOfArrayDiff: the same array -> recursively generate r = ",v),i("arrayOfArrayDiff: the same array -> ops = ",A),H++):(v=z-$+D,w={p:[].concat((0,n.default)(k),[v]),ld:S[z]},A.push(w),i(`
|
|
@@ -104,11 +104,11 @@ Valid keys: `+JSON.stringify(Object.keys(E),null," "));if($=$(z,A,P,O,R+"."+A,s
|
|
|
104
104
|
`+S+C}var L=!1;function B(C,j){if(!C||L)return"";L=!0;var V=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(j)if(j=function(){throw Error()},Object.defineProperty(j.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(j,[])}catch(mt){var it=mt}Reflect.construct(C,[],j)}else{try{j.call()}catch(mt){it=mt}C.call(j.prototype)}else{try{throw Error()}catch(mt){it=mt}C()}}catch(mt){if(mt&&it&&typeof mt.stack=="string"){for(var ot=mt.stack.split(`
|
|
105
105
|
`),st=it.stack.split(`
|
|
106
106
|
`),ut=ot.length-1,_t=st.length-1;1<=ut&&0<=_t&&ot[ut]!==st[_t];)_t--;for(;1<=ut&&0<=_t;ut--,_t--)if(ot[ut]!==st[_t]){if(ut!==1||_t!==1)do if(ut--,--_t<0||ot[ut]!==st[_t])return`
|
|
107
|
-
`+ot[ut].replace(" at new "," at ");while(1<=ut&&0<=_t);break}}}finally{L=!1,Error.prepareStackTrace=V}return(C=C?C.displayName||C.name:"")?I(C):""}function Y(C){if(C==null)return null;if(typeof C=="function")return C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case P:return"Fragment";case D:return"Portal";case R:return"Profiler";case O:return"StrictMode";case $:return"Suspense";case M:return"SuspenseList"}if(typeof C=="object")switch(C.$$typeof){case z:return(C.displayName||"Context")+".Consumer";case A:return(C._context.displayName||"Context")+".Provider";case H:var j=(j=C.render).displayName||j.name||"";return C.displayName||(j!==""?"ForwardRef("+j+")":"ForwardRef");case J:return Y(C.type);case N:return Y(C._render);case K:j=C._payload,C=C._init;try{return Y(C(j))}catch{}}return null}function Z(C){switch(typeof C){case"boolean":case"number":case"object":case"string":case"undefined":return C;default:return""}}function rt(C){var j=C.type;return(C=C.nodeName)&&C.toLowerCase()==="input"&&(j==="checkbox"||j==="radio")}function Q(C){C._valueTracker||(C._valueTracker=function(j){var V,it,ot=rt(j)?"checked":"value",st=Object.getOwnPropertyDescriptor(j.constructor.prototype,ot),ut=""+j[ot];if(!j.hasOwnProperty(ot)&&st!==void 0&&typeof st.get=="function"&&typeof st.set=="function")return V=st.get,it=st.set,Object.defineProperty(j,ot,{configurable:!0,get:function(){return V.call(this)},set:function(_t){ut=""+_t,it.call(this,_t)}}),Object.defineProperty(j,ot,{enumerable:st.enumerable}),{getValue:function(){return ut},setValue:function(_t){ut=""+_t},stopTracking:function(){j._valueTracker=null,delete j[ot]}}}(C))}function tt(C){if(C){var j=C._valueTracker;if(!j)return 1;var V=j.getValue(),it="";return(C=it=C?rt(C)?C.checked?"true":"false":C.value:it)!==V&&(j.setValue(C),1)}}function nt(C){if((C=C||(typeof document<"u"?document:void 0))===void 0)return null;try{return C.activeElement||C.body}catch{return C.body}}function et(C,j){var V=j.checked;return e({},j,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:V??C._wrapperState.initialChecked})}function at(C,j){var V=j.defaultValue==null?"":j.defaultValue,it=j.checked!=null?j.checked:j.defaultChecked;V=Z(j.value!=null?j.value:V),C._wrapperState={initialChecked:it,initialValue:V,controlled:j.type==="checkbox"||j.type==="radio"?j.checked!=null:j.value!=null}}function ct(C,j){(j=j.checked)!=null&&x(C,"checked",j,!1)}function gt(C,j){ct(C,j);var V=Z(j.value),it=j.type;if(V!=null)it==="number"?(V===0&&C.value===""||C.value!=V)&&(C.value=""+V):C.value!==""+V&&(C.value=""+V);else if(it==="submit"||it==="reset")return void C.removeAttribute("value");j.hasOwnProperty("value")?St(C,j.type,V):j.hasOwnProperty("defaultValue")&&St(C,j.type,Z(j.defaultValue)),j.checked==null&&j.defaultChecked!=null&&(C.defaultChecked=!!j.defaultChecked)}function wt(C,j,V){if(j.hasOwnProperty("value")||j.hasOwnProperty("defaultValue")){var it=j.type;if(!(it!=="submit"&&it!=="reset"||j.value!==void 0&&j.value!==null))return;j=""+C._wrapperState.initialValue,V||j===C.value||(C.value=j),C.defaultValue=j}(V=C.name)!==""&&(C.name=""),C.defaultChecked=!!C._wrapperState.initialChecked,V!==""&&(C.name=V)}function St(C,j,V){j==="number"&&nt(C.ownerDocument)===C||(V==null?C.defaultValue=""+C._wrapperState.initialValue:C.defaultValue!==""+V&&(C.defaultValue=""+V))}function Mt(C,j){var V,it;return C=e({children:void 0},j),V=j.children,it="",n.Children.forEach(V,function(ot){ot!=null&&(it+=ot)}),(j=it)&&(C.children=j),C}function Lt(C,j,V,it){if(C=C.options,j){j={};for(var ot=0;ot<V.length;ot++)j["$"+V[ot]]=!0;for(V=0;V<C.length;V++)ot=j.hasOwnProperty("$"+C[V].value),C[V].selected!==ot&&(C[V].selected=ot),ot&&it&&(C[V].defaultSelected=!0)}else{for(V=""+Z(V),j=null,ot=0;ot<C.length;ot++){if(C[ot].value===V)return C[ot].selected=!0,void(it&&(C[ot].defaultSelected=!0));j!==null||C[ot].disabled||(j=C[ot])}j!==null&&(j.selected=!0)}}function Nt(C,j){if(j.dangerouslySetInnerHTML!=null)throw Error(i(91));return e({},j,{value:void 0,defaultValue:void 0,children:""+C._wrapperState.initialValue})}function yt(C,j){var V=j.value;if(V==null){if(V=j.children,j=j.defaultValue,V!=null){if(j!=null)throw Error(i(92));if(Array.isArray(V)){if(!(V.length<=1))throw Error(i(93));V=V[0]}j=V}V=j=j??""}C._wrapperState={initialValue:Z(V)}}function jt(C,j){var V=Z(j.value),it=Z(j.defaultValue);V!=null&&((V=""+V)!==C.value&&(C.value=V),j.defaultValue==null&&C.defaultValue!==V&&(C.defaultValue=V)),it!=null&&(C.defaultValue=""+it)}function At(C){var j=C.textContent;j===C._wrapperState.initialValue&&j!==""&&j!==null&&(C.value=j)}var It="http://www.w3.org/1999/xhtml";function Ot(C){switch(C){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Et(C,j){return C==null||C==="http://www.w3.org/1999/xhtml"?Ot(j):C==="http://www.w3.org/2000/svg"&&j==="foreignObject"?"http://www.w3.org/1999/xhtml":C}Pt=function(C,j){if(C.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in C)C.innerHTML=j;else{for((Ct=Ct||document.createElement("div")).innerHTML="<svg>"+j.valueOf().toString()+"</svg>",j=Ct.firstChild;C.firstChild;)C.removeChild(C.firstChild);for(;j.firstChild;)C.appendChild(j.firstChild)}};var Ct,Pt,ht=typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(C,j,V,it){MSApp.execUnsafeLocalFunction(function(){return Pt(C,j)})}:Pt;function dt(C,j){if(j){var V=C.firstChild;if(V&&V===C.lastChild&&V.nodeType===3)return void(V.nodeValue=j)}C.textContent=j}var Ft={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Jt=["Webkit","ms","Moz","O"];function Xt(C,j,V){return j==null||typeof j=="boolean"||j===""?"":V||typeof j!="number"||j===0||Ft.hasOwnProperty(C)&&Ft[C]?(""+j).trim():j+"px"}function Qt(C,j){for(var V in C=C.style,j){var it,ot;j.hasOwnProperty(V)&&(it=V.indexOf("--")===0,ot=Xt(V,j[V],it),V==="float"&&(V="cssFloat"),it?C.setProperty(V,ot):C[V]=ot)}}Object.keys(Ft).forEach(function(C){Jt.forEach(function(j){j=j+C.charAt(0).toUpperCase()+C.substring(1),Ft[j]=Ft[C]})});var _e=e({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function kt(C,j){if(j){if(_e[C]&&(j.children!=null||j.dangerouslySetInnerHTML!=null))throw Error(i(137,C));if(j.dangerouslySetInnerHTML!=null){if(j.children!=null)throw Error(i(60));if(typeof j.dangerouslySetInnerHTML!="object"||!("__html"in j.dangerouslySetInnerHTML))throw Error(i(61))}if(j.style!=null&&typeof j.style!="object")throw Error(i(62))}}function ee(C,j){if(C.indexOf("-")===-1)return typeof j.is=="string";switch(C){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function pe(C){return(C=(C=C.target||C.srcElement||window).correspondingUseElement?C.correspondingUseElement:C).nodeType===3?C.parentNode:C}var Be=null,Fe=null,qe=null;function ze(C){if(C=tc(C)){if(typeof Be!="function")throw Error(i(280));var j=C.stateNode;j&&(j=$u(j),Be(C.stateNode,C.type,j))}}function Re(C){Fe?qe?qe.push(C):qe=[C]:Fe=C}function He(){if(Fe){var C=Fe,j=qe;if(qe=Fe=null,ze(C),j)for(C=0;C<j.length;C++)ze(j[C])}}function hn(C,j){return C(j)}function Tt(C,j,V,it,ot){return C(j,V,it,ot)}function ae(){}var de=!1,Se=!1;function je(){Fe===null&&qe===null||(ae(),He())}function Rt(C,j){var V=C.stateNode;if(V===null)return null;var it=$u(V);if(it===null)return null;switch(V=it[j],j){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":C=!(it=(it=!it.disabled)?it:!((C=C.type)==="button"||C==="input"||C==="select"||C==="textarea"));break;default:C=!1}if(C)return null;if(V&&typeof V!="function")throw Error(i(231,j,typeof V));return V}var Ut=!1;if(t)try{var se={};Object.defineProperty(se,"passive",{get:function(){Ut=!0}}),window.addEventListener("test",se,se),window.removeEventListener("test",se,se)}catch{Ut=!1}var bt=!1,ft=null,xt=!1,Bt=null,ce={onError:function(C){bt=!0,ft=C}};function Ee(C,j,V,it,ot,st,ut,_t,mt){bt=!1,ft=null,(function(Ht,ie,ue,De,mn,Kt,re,me,Le){var Me=Array.prototype.slice.call(arguments,3);try{ie.apply(ue,Me)}catch(Ze){this.onError(Ze)}}).apply(ce,arguments)}function Ae(C){var j=C,V=C;if(C.alternate)for(;j.return;)j=j.return;else for(C=j;1026&(j=C).flags&&(V=j.return),C=j.return;);return j.tag===3?V:null}function Ie(C){if(C.tag===13){var j=C.memoizedState;if(j===null&&(C=C.alternate)!==null&&(j=C.memoizedState),j!==null)return j.dehydrated}return null}function Ge(C){if(Ae(C)!==C)throw Error(i(188))}function ve(C){if(!(C=function(V){var it=V.alternate;if(!it){if((it=Ae(V))===null)throw Error(i(188));return it!==V?null:V}for(var ot=V,st=it;;){var ut=ot.return;if(ut===null)break;var _t=ut.alternate;if(_t===null){if((st=ut.return)===null)break;ot=st}else{if(ut.child===_t.child){for(_t=ut.child;_t;){if(_t===ot)return Ge(ut),V;if(_t===st)return Ge(ut),it;_t=_t.sibling}throw Error(i(188))}if(ot.return!==st.return)ot=ut,st=_t;else{for(var mt=!1,Ht=ut.child;Ht;){if(Ht===ot){mt=!0,ot=ut,st=_t;break}if(Ht===st){mt=!0,st=ut,ot=_t;break}Ht=Ht.sibling}if(!mt){for(Ht=_t.child;Ht;){if(Ht===ot){mt=!0,ot=_t,st=ut;break}if(Ht===st){mt=!0,st=_t,ot=ut;break}Ht=Ht.sibling}if(!mt)throw Error(i(189))}}if(ot.alternate!==st)throw Error(i(190))}}if(ot.tag!==3)throw Error(i(188));return ot.stateNode.current===ot?V:it}(C)))return null;for(var j=C;;){if(j.tag===5||j.tag===6)return j;if(j.child)j=(j.child.return=j).child;else{if(j===C)break;for(;!j.sibling;){if(!j.return||j.return===C)return null;j=j.return}j.sibling.return=j.return,j=j.sibling}}return null}function pt(C,j){for(var V=C.alternate;j!==null;){if(j===C||j===V)return 1;j=j.return}}var Dt,$t,qt,Vt=!1,oe=[],X=null,lt=null,vt=null,Wt=new Map,te=new Map,Zt=[],Yt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ye(C,j,V,it,ot){return{blockedOn:C,domEventName:j,eventSystemFlags:16|V,nativeEvent:ot,targetContainers:[it]}}function ke(C,j){switch(C){case"focusin":case"focusout":X=null;break;case"dragenter":case"dragleave":lt=null;break;case"mouseover":case"mouseout":vt=null;break;case"pointerover":case"pointerout":Wt.delete(j.pointerId);break;case"gotpointercapture":case"lostpointercapture":te.delete(j.pointerId)}}function Ue(C,j,V,it,ot,st){return C===null||C.nativeEvent!==st?(C=ye(j,V,it,ot,st),j===null||(j=tc(j))!==null&&$t(j)):(C.eventSystemFlags|=it,j=C.targetContainers,ot!==null&&j.indexOf(ot)===-1&&j.push(ot)),C}function Pe(C){if(C.blockedOn===null){for(var j=C.targetContainers;0<j.length;){var V=Ro(C.domEventName,C.eventSystemFlags,j[0],C.nativeEvent);if(V!==null)return(j=tc(V))!==null&&$t(j),C.blockedOn=V,0;j.shift()}return 1}}function Ve(C,j,V){Pe(C)&&V.delete(j)}function nn(){for(Vt=!1;0<oe.length;){var C=oe[0];if(C.blockedOn!==null){(C=tc(C.blockedOn))!==null&&Dt(C);break}for(var j=C.targetContainers;0<j.length;){var V=Ro(C.domEventName,C.eventSystemFlags,j[0],C.nativeEvent);if(V!==null){C.blockedOn=V;break}j.shift()}C.blockedOn===null&&oe.shift()}X!==null&&Pe(X)&&(X=null),lt!==null&&Pe(lt)&&(lt=null),vt!==null&&Pe(vt)&&(vt=null),Wt.forEach(Ve),te.forEach(Ve)}function cn(C,j){C.blockedOn===j&&(C.blockedOn=null,Vt||(Vt=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,nn)))}function Nn(C){function j(ot){return cn(ot,C)}if(0<oe.length){cn(oe[0],C);for(var V=1;V<oe.length;V++){var it=oe[V];it.blockedOn===C&&(it.blockedOn=null)}}for(X!==null&&cn(X,C),lt!==null&&cn(lt,C),vt!==null&&cn(vt,C),Wt.forEach(j),te.forEach(j),V=0;V<Zt.length;V++)(it=Zt[V]).blockedOn===C&&(it.blockedOn=null);for(;0<Zt.length&&(V=Zt[0]).blockedOn===null;)(function(ot){var st=$a(ot.target);if(st!==null){var ut=Ae(st);if(ut!==null){if((st=ut.tag)===13){if((st=Ie(ut))!==null)return ot.blockedOn=st,ot.lanePriority,s.unstable_runWithPriority(ot.priority,function(){qt(ut)})}else if(st===3&&ut.stateNode.hydrate)return ot.blockedOn=ut.tag===3?ut.stateNode.containerInfo:null}}ot.blockedOn=null})(V),V.blockedOn===null&&Zt.shift()}function un(C,j){var V={};return V[C.toLowerCase()]=j.toLowerCase(),V["Webkit"+C]="webkit"+j,V["Moz"+C]="moz"+j,V}var bn={animationend:un("Animation","AnimationEnd"),animationiteration:un("Animation","AnimationIteration"),animationstart:un("Animation","AnimationStart"),transitionend:un("Transition","TransitionEnd")},In={},Fn={};function tr(C){if(In[C])return In[C];if(!bn[C])return C;var j,V=bn[C];for(j in V)if(V.hasOwnProperty(j)&&j in Fn)return In[C]=V[j];return C}t&&(Fn=document.createElement("div").style,"AnimationEvent"in window||(delete bn.animationend.animation,delete bn.animationiteration.animation,delete bn.animationstart.animation),"TransitionEvent"in window||delete bn.transitionend.transition);var er=tr("animationend"),Oa=tr("animationiteration"),Hi=tr("animationstart"),ro=tr("transitionend"),Br=new Map,Vr=new Map,Sn=["abort","abort",er,"animationEnd",Oa,"animationIteration",Hi,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",ro,"transitionEnd","waiting","waiting"];function qi(C,j){for(var V=0;V<C.length;V+=2){var it=C[V],ot="on"+((ot=C[V+1])[0].toUpperCase()+ot.slice(1));Vr.set(it,j),Br.set(it,ot),a(ot,[it])}}(0,s.unstable_now)();var gn=8;function Rn(C){if(1&C)return gn=15,1;if(2&C)return gn=14,2;if(4&C)return gn=13,4;var j=24&C;return j!==0?(gn=12,j):32&C?(gn=11,32):(j=192&C)!=0?(gn=10,j):256&C?(gn=9,256):(j=3584&C)!=0?(gn=8,j):4096&C?(gn=7,4096):(j=4186112&C)!=0?(gn=6,j):(j=62914560&C)!=0?(gn=5,j):67108864&C?(gn=4,67108864):134217728&C?(gn=3,134217728):(j=805306368&C)!=0?(gn=2,j):1073741824&C?(gn=1,1073741824):(gn=8,C)}function Io(C,j){var V=C.pendingLanes;if(V===0)return gn=0;var it,ot=0,st=0,ut=C.expiredLanes,_t=C.suspendedLanes,mt=C.pingedLanes;if(ut!==0?(ot=ut,st=gn=15):(ut=134217727&V)!=0?(it=ut&~_t)!=0?(ot=Rn(it),st=gn):(mt&=ut)!=0&&(ot=Rn(mt),st=gn):(ut=V&~_t)!=0?(ot=Rn(ut),st=gn):mt!==0&&(ot=Rn(mt),st=gn),ot===0)return 0;if(ot=V&(((ot=31-xo(ot))<0?0:1<<ot)<<1)-1,j!==0&&j!==ot&&!(j&_t)){if(Rn(j),st<=gn)return j;gn=st}if((j=C.entangledLanes)!==0)for(C=C.entanglements,j&=ot;0<j;)ot|=C[V=31-xo(j)],j&=~(st=1<<V);return ot}function Pr(C){return(C=-1073741825&C.pendingLanes)!=0?C:1073741824&C?1073741824:0}function oo(C,j){switch(C){case 15:return 1;case 14:return 2;case 12:return(C=Fr(24&~j))===0?oo(10,j):C;case 10:return(C=Fr(192&~j))===0?oo(8,j):C;case 8:return(C=Fr(3584&~j))===0&&(C=Fr(4186112&~j))===0&&(C=512),C;case 2:return(j=Fr(805306368&~j))===0?268435456:j}throw Error(i(358,C))}function Fr(C){return C&-C}function xr(C){for(var j=[],V=0;V<31;V++)j.push(C);return j}function Ta(C,j,V){C.pendingLanes|=j;var it=j-1;C.suspendedLanes&=it,C.pingedLanes&=it,(C=C.eventTimes)[j=31-xo(j)]=V}var xo=Math.clz32||function(C){return C===0?32:31-(Wr(C)/_n|0)|0},Wr=Math.log,_n=Math.LN2,Mu=s.unstable_UserBlockingPriority,Jl=s.unstable_runWithPriority,Kr=!0;function Du(C,j,V,it){de||ae();var ot=ja,st=de;de=!0;try{Tt(ot,C,j,V,it)}finally{(de=st)||je()}}function Vl(C,j,V,it){Jl(Mu,ja.bind(null,C,j,V,it))}function ja(C,j,V,it){var ot;if(Kr)if((ot=!(4&j))&&0<oe.length&&-1<Yt.indexOf(C))C=ye(null,C,j,V,it),oe.push(C);else{var st=Ro(C,j,V,it);if(st===null)ot&&ke(C,it);else{if(ot){if(-1<Yt.indexOf(C))return C=ye(st,C,j,V,it),void oe.push(C);if(function(ut,_t,mt,Ht,ie){switch(_t){case"focusin":return X=Ue(X,ut,_t,mt,Ht,ie),1;case"dragenter":return lt=Ue(lt,ut,_t,mt,Ht,ie),1;case"mouseover":return vt=Ue(vt,ut,_t,mt,Ht,ie),1;case"pointerover":var ue=ie.pointerId;return Wt.set(ue,Ue(Wt.get(ue)||null,ut,_t,mt,Ht,ie)),1;case"gotpointercapture":return ue=ie.pointerId,te.set(ue,Ue(te.get(ue)||null,ut,_t,mt,Ht,ie)),1}}(st,C,j,V,it))return;ke(C,it)}Ay(C,j,it,null,V)}}}function Ro(C,j,V,it){var ot=pe(it);if((ot=$a(ot))!==null){var st=Ae(ot);if(st===null)ot=null;else{var ut=st.tag;if(ut===13){if((ot=Ie(st))!==null)return ot;ot=null}else if(ut===3){if(st.stateNode.hydrate)return st.tag===3?st.stateNode.containerInfo:null;ot=null}else st!==ot&&(ot=null)}}return Ay(C,j,it,ot,V),null}var Mo=null,Do=null,ci=null;function Ls(){if(ci)return ci;for(var C=Do,j=C.length,V=("value"in Mo)?Mo.value:Mo.textContent,it=V.length,ot=0;ot<j&&C[ot]===V[ot];ot++);for(var st=j-ot,ut=1;ut<=st&&C[j-ut]===V[it-ut];ut++);return ci=V.slice(ot,1<ut?1-ut:void 0)}function Bs(C){var j=C.keyCode;return"charCode"in C?(C=C.charCode)===0&&j===13&&(C=13):C=j,32<=(C=C===10?13:C)||C===13?C:0}function Aa(){return!0}function Pa(){return!1}function mr(C){function j(V,it,ot,st,ut){for(var _t in this._reactName=V,this._targetInst=ot,this.type=it,this.nativeEvent=st,this.target=ut,this.currentTarget=null,C)C.hasOwnProperty(_t)&&(V=C[_t],this[_t]=V?V(st):st[_t]);return this.isDefaultPrevented=(st.defaultPrevented!=null?st.defaultPrevented:st.returnValue===!1)?Aa:Pa,this.isPropagationStopped=Pa,this}return e(j.prototype,{preventDefault:function(){this.defaultPrevented=!0;var V=this.nativeEvent;V&&(V.preventDefault?V.preventDefault():typeof V.returnValue!="unknown"&&(V.returnValue=!1),this.isDefaultPrevented=Aa)},stopPropagation:function(){var V=this.nativeEvent;V&&(V.stopPropagation?V.stopPropagation():typeof V.cancelBubble!="unknown"&&(V.cancelBubble=!0),this.isPropagationStopped=Aa)},persist:function(){},isPersistent:Aa}),j}se={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(C){return C.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0};var Na,Ia,ui,di=mr(se),Fs=mr(fr=e({},se,{view:0,detail:0})),Hn=e({},fr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ji,button:0,buttons:0,relatedTarget:function(C){return C.relatedTarget===void 0?C.fromElement===C.srcElement?C.toElement:C.fromElement:C.relatedTarget},movementX:function(C){return"movementX"in C?C.movementX:(C!==ui&&(Ia=ui&&C.type==="mousemove"?(Na=C.screenX-ui.screenX,C.screenY-ui.screenY):Na=0,ui=C),Na)},movementY:function(C){return"movementY"in C?C.movementY:Ia}}),fi=mr(Hn),Ra=mr(e({},Hn,{dataTransfer:0})),Nr=mr(e({},fr,{relatedTarget:0})),Ma=mr(e({},se,{animationName:0,elapsedTime:0,pseudoElement:0})),Lo=mr(e({},se,{clipboardData:function(C){return("clipboardData"in C?C:window).clipboardData}})),wo=mr(e({},se,{data:0})),Bo={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Da={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},So={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fo(C){var j=this.nativeEvent;return j.getModifierState?j.getModifierState(C):!!(C=So[C])&&!!j[C]}function Ji(){return Fo}var Vi=mr(e({},fr,{key:function(C){if(C.key){var j=Bo[C.key]||C.key;if(j!=="Unidentified")return j}return C.type==="keypress"?(C=Bs(C))===13?"Enter":String.fromCharCode(C):C.type==="keydown"||C.type==="keyup"?Da[C.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ji,charCode:function(C){return C.type==="keypress"?Bs(C):0},keyCode:function(C){return C.type==="keydown"||C.type==="keyup"?C.keyCode:0},which:function(C){return C.type==="keypress"?Bs(C):C.type==="keydown"||C.type==="keyup"?C.keyCode:0}})),La=mr(e({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),zs=mr(e({},fr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ji})),pi=mr(e({},se,{propertyName:0,elapsedTime:0,pseudoElement:0})),Us=mr(e({},Hn,{deltaX:function(C){return"deltaX"in C?C.deltaX:"wheelDeltaX"in C?-C.wheelDeltaX:0},deltaY:function(C){return"deltaY"in C?C.deltaY:"wheelDeltaY"in C?-C.wheelDeltaY:"wheelDelta"in C?-C.wheelDelta:0},deltaZ:0,deltaMode:0})),Lu=[9,13,27,32],Ba=t&&"CompositionEvent"in window,fr=null,Fa=(t&&"documentMode"in document&&(fr=document.documentMode),t&&"TextEvent"in window&&!fr),Wi=t&&(!Ba||fr&&8<fr&&fr<=11),za=String.fromCharCode(32),Wl=!1;function Kl(C,j){switch(C){case"keyup":return Lu.indexOf(j.keyCode)!==-1;case"keydown":return j.keyCode!==229;case"keypress":case"mousedown":case"focusout":return 1;default:return}}function zo(C){return typeof(C=C.detail)=="object"&&"data"in C?C.data:null}var hi=!1,Ki={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $s(C){var j=C&&C.nodeName&&C.nodeName.toLowerCase();return j==="input"?Ki[C.type]:j==="textarea"}function Ua(C,j,V,it){Re(it),0<(j=Fu(j,"onChange")).length&&(V=new di("onChange","change",null,V,it),C.push({event:V,listeners:j}))}var zt=null,ne=null;function fe(C){Ey(C,0)}function Te(C){if(tt(Ws(C)))return C}function sn(C,j){if(C==="change")return j}var tn=!1;function en(){zt&&(zt.detachEvent("onpropertychange",We),ne=zt=null)}function We(C){if(C.propertyName==="value"&&Te(ne)){var j=[];if(Ua(j,ne,C,pe(C)),C=fe,de)C(j);else{de=!0;try{hn(C,j)}finally{de=!1,je()}}}}function qn(C,j,V){C==="focusin"?(en(),ne=V,(zt=j).attachEvent("onpropertychange",We)):C==="focusout"&&en()}function lr(C){if(C==="selectionchange"||C==="keyup"||C==="keydown")return Te(ne)}function Gl(C,j){if(C==="click")return Te(j)}function Bu(C,j){if(C==="input"||C==="change")return Te(j)}t&&(fr=t&&((se="oninput"in document)||((Hn=document.createElement("div")).setAttribute("oninput","return;"),se=typeof Hn.oninput=="function"),se),tn=fr&&(!document.documentMode||9<document.documentMode));var nr=typeof Object.is=="function"?Object.is:function(C,j){return C===j&&(C!==0||1/C==1/j)||C!=C&&j!=j},tC=Object.prototype.hasOwnProperty;function Yl(C,j){if(nr(C,j))return!0;if(typeof C!="object"||C===null||typeof j!="object"||j===null)return!1;var V=Object.keys(C),it=Object.keys(j);if(V.length!==it.length)return!1;for(it=0;it<V.length;it++)if(!tC.call(j,V[it])||!nr(C[V[it]],j[V[it]]))return!1;return!0}function by(C){for(;C&&C.firstChild;)C=C.firstChild;return C}function vy(C,j){var V,it=by(C);for(C=0;it;){if(it.nodeType===3){if(V=C+it.textContent.length,C<=j&&j<=V)return{node:it,offset:j-C};C=V}t:{for(;it;){if(it.nextSibling){it=it.nextSibling;break t}it=it.parentNode}it=void 0}it=by(it)}}function _y(){for(var C=window,j=nt();j instanceof C.HTMLIFrameElement;){try{var V=typeof j.contentWindow.location.href=="string"}catch{V=!1}if(!V)break;j=nt((C=j.contentWindow).document)}return j}function cp(C){var j=C&&C.nodeName&&C.nodeName.toLowerCase();return j&&(j==="input"&&(C.type==="text"||C.type==="search"||C.type==="tel"||C.type==="url"||C.type==="password")||j==="textarea"||C.contentEditable==="true")}var eC=t&&"documentMode"in document&&document.documentMode<=11,Hs=null,up=null,Zl=null,dp=!1;function xy(C,j,V){var it=V.window===V?V.document:V.nodeType===9?V:V.ownerDocument;dp||Hs==null||Hs!==nt(it)||(it="selectionStart"in(it=Hs)&&cp(it)?{start:it.selectionStart,end:it.selectionEnd}:{anchorNode:(it=(it.ownerDocument&&it.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:it.anchorOffset,focusNode:it.focusNode,focusOffset:it.focusOffset},Zl&&Yl(Zl,it)||(Zl=it,0<(it=Fu(up,"onSelect")).length&&(j=new di("onSelect","select",null,j,V),C.push({event:j,listeners:it}),j.target=Hs)))}qi("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),qi("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),qi(Sn,2);for(var wy="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),fp=0;fp<wy.length;fp++)Vr.set(wy[fp],0);c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ql="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Sy=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ql));function Cy(C,j,V){var it=C.type||"unknown-event";C.currentTarget=V,function(){var ot;Ee.apply(this,arguments),bt&&(ot=ft,bt=!1,ft=null,xt||(xt=!0,Bt=ot))}(it,j,void 0,C),C.currentTarget=null}function Ey(C,j){j=!!(4&j);for(var V=0;V<C.length;V++){var it=(ot=C[V]).event,ot=ot.listeners;t:{var st=void 0;if(j)for(var ut=ot.length-1;0<=ut;ut--){var _t=(Ht=ot[ut]).instance,mt=Ht.currentTarget,Ht=Ht.listener;if(_t!==st&&it.isPropagationStopped())break t;Cy(it,Ht,mt),st=_t}else for(ut=0;ut<ot.length;ut++){if(_t=(Ht=ot[ut]).instance,mt=Ht.currentTarget,Ht=Ht.listener,_t!==st&&it.isPropagationStopped())break t;Cy(it,Ht,mt),st=_t}}}if(xt)throw C=Bt,xt=!1,Bt=null,C}function Mn(C,j){var V=Dy(j),it=C+"__bubble";V.has(it)||(jy(j,C,2,!1),V.add(it))}var ky="_reactListening"+Math.random().toString(36).slice(2);function Oy(C){C[ky]||(C[ky]=!0,l.forEach(function(j){Sy.has(j)||Ty(j,!1,C,null),Ty(j,!0,C,null)}))}function Ty(C,j,V,it,ot){ot=4<arguments.length&&ot!==void 0?ot:0;var st=V;if(C==="selectionchange"&&V.nodeType!==9&&(st=V.ownerDocument),it!==null&&!j&&Sy.has(C)){if(C!=="scroll")return;ot|=2,st=it}it=C+"__"+(j?"capture":"bubble"),(V=Dy(st)).has(it)||(j&&(ot|=4),jy(st,C,ot,j),V.add(it))}function jy(C,j,V,it){var ot=Vr.get(j);switch(ot===void 0?2:ot){case 0:ot=Du;break;case 1:ot=Vl;break;default:ot=ja}V=ot.bind(null,j,V,C),ot=!(!Ut||j!=="touchstart"&&j!=="touchmove"&&j!=="wheel")||void 0,it?ot!==void 0?C.addEventListener(j,V,{capture:!0,passive:ot}):C.addEventListener(j,V,!0):ot!==void 0?C.addEventListener(j,V,{passive:ot}):C.addEventListener(j,V,!1)}function Ay(C,j,V,it,ot){var st=it;if(!(1&j||2&j||it===null))t:for(;;){if(it===null)return;var ut=it.tag;if(ut===3||ut===4){var _t=it.stateNode.containerInfo;if(_t===ot||_t.nodeType===8&&_t.parentNode===ot)break;if(ut===4)for(ut=it.return;ut!==null;){var mt=ut.tag;if((mt===3||mt===4)&&((mt=ut.stateNode.containerInfo)===ot||mt.nodeType===8&&mt.parentNode===ot))return;ut=ut.return}for(;_t!==null;){if((ut=$a(_t))===null)return;if((mt=ut.tag)===5||mt===6){it=st=ut;continue t}_t=_t.parentNode}}it=it.return}var Ht=function(){var ue,De,mn,Kt=st,re=pe(V),me=[];t:{var Le=Br.get(C);if(Le!==void 0){var Me=di,Ze=C;switch(C){case"keypress":if(Bs(V)===0)break t;case"keydown":case"keyup":Me=Vi;break;case"focusin":Ze="focus",Me=Nr;break;case"focusout":Ze="blur",Me=Nr;break;case"beforeblur":case"afterblur":Me=Nr;break;case"click":if(V.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Me=fi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Me=Ra;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Me=zs;break;case er:case Oa:case Hi:Me=Ma;break;case ro:Me=pi;break;case"scroll":Me=Fs;break;case"wheel":Me=Us;break;case"copy":case"cut":case"paste":Me=Lo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Me=La}for(var ln=!(Qe=!!(4&j))&&C==="scroll",Xe=Qe?Le!==null?Le+"Capture":null:Le,Qe=[],wn=Kt;wn!==null;){var On,An=(On=wn).stateNode;if(On.tag===5&&An!==null&&(On=An,Xe!==null&&(An=Rt(wn,Xe))!=null&&Qe.push(Xl(wn,An,On))),ln)break;wn=wn.return}0<Qe.length&&(Le=new Me(Le,Ze,null,V,re),me.push({event:Le,listeners:Qe}))}}if(!(7&j)){if(Me=C==="mouseout"||C==="pointerout",(!(Le=C==="mouseover"||C==="pointerover")||16&j||!(Ze=V.relatedTarget||V.fromElement)||!$a(Ze)&&!Ze[Vs])&&(Me||Le)&&(Le=re.window===re?re:(Le=re.ownerDocument)?Le.defaultView||Le.parentWindow:window,Me?(Me=Kt,(Ze=(Ze=V.relatedTarget||V.toElement)?$a(Ze):null)!==null&&(Ze!==(ln=Ae(Ze))||Ze.tag!==5&&Ze.tag!==6)&&(Ze=null)):(Me=null,Ze=Kt),Me!==Ze)){if(Qe=fi,An="onMouseLeave",Xe="onMouseEnter",wn="mouse",C!=="pointerout"&&C!=="pointerover"||(Qe=La,An="onPointerLeave",Xe="onPointerEnter",wn="pointer"),ln=Me==null?Le:Ws(Me),On=Ze==null?Le:Ws(Ze),(Le=new Qe(An,wn+"leave",Me,V,re)).target=ln,Le.relatedTarget=On,An=null,$a(re)===Kt&&((Qe=new Qe(Xe,wn+"enter",Ze,V,re)).target=On,Qe.relatedTarget=ln,An=Qe),ln=An,Me&&Ze)t:{for(Xe=Ze,wn=0,On=Qe=Me;On;On=qs(On))wn++;for(On=0,An=Xe;An;An=qs(An))On++;for(;0<wn-On;)Qe=qs(Qe),wn--;for(;0<On-wn;)Xe=qs(Xe),On--;for(;wn--;){if(Qe===Xe||Xe!==null&&Qe===Xe.alternate)break t;Qe=qs(Qe),Xe=qs(Xe)}Qe=null}else Qe=null;Me!==null&&Py(me,Le,Me,Qe,!1),Ze!==null&&ln!==null&&Py(me,ln,Ze,Qe,!0)}switch((Me=(Le=Kt?Ws(Kt):window).nodeName&&Le.nodeName.toLowerCase())==="select"||Me==="input"&&Le.type==="file"?ue=sn:$s(Le)?tn?ue=Bu:(ue=lr,De=qn):!(Me=Le.nodeName)||Me.toLowerCase()!=="input"||Le.type!=="checkbox"&&Le.type!=="radio"||(ue=Gl),(ue=ue&&ue(C,Kt))?Ua(me,ue,V,re):(De&&De(C,Le,Kt),C==="focusout"&&(De=Le._wrapperState)&&De.controlled&&Le.type==="number"&&St(Le,"number",Le.value)),De=Kt?Ws(Kt):window,C){case"focusin":!$s(De)&&De.contentEditable!=="true"||(Hs=De,up=Kt,Zl=null);break;case"focusout":Zl=up=Hs=null;break;case"mousedown":dp=!0;break;case"contextmenu":case"mouseup":case"dragend":dp=!1,xy(me,V,re);break;case"selectionchange":if(eC)break;case"keydown":case"keyup":xy(me,V,re)}if(Ba)t:{switch(C){case"compositionstart":var pn="onCompositionStart";break t;case"compositionend":pn="onCompositionEnd";break t;case"compositionupdate":pn="onCompositionUpdate";break t}pn=void 0}else hi?Kl(C,V)&&(pn="onCompositionEnd"):C==="keydown"&&V.keyCode===229&&(pn="onCompositionStart");pn&&(Wi&&V.locale!=="ko"&&(hi||pn!=="onCompositionStart"?pn==="onCompositionEnd"&&hi&&(mn=Ls()):(Do="value"in(Mo=re)?Mo.value:Mo.textContent,hi=!0)),0<(De=Fu(Kt,pn)).length&&(pn=new wo(pn,C,null,V,re),me.push({event:pn,listeners:De}),(mn||(mn=zo(V))!==null)&&(pn.data=mn))),(mn=(Fa?function(yn,dn){switch(yn){case"compositionend":return zo(dn);case"keypress":return dn.which!==32?null:(Wl=!0,za);case"textInput":return(yn=dn.data)===za&&Wl?null:yn;default:return null}}:function(yn,dn){if(hi)return yn==="compositionend"||!Ba&&Kl(yn,dn)?(yn=Ls(),ci=Do=Mo=null,hi=!1,yn):null;switch(yn){case"paste":default:return null;case"keypress":if(!(dn.ctrlKey||dn.altKey||dn.metaKey)||dn.ctrlKey&&dn.altKey){if(dn.char&&1<dn.char.length)return dn.char;if(dn.which)return String.fromCharCode(dn.which)}return null;case"compositionend":return Wi&&dn.locale!=="ko"?null:dn.data}})(C,V))&&0<(Kt=Fu(Kt,"onBeforeInput")).length&&(re=new wo("onBeforeInput","beforeinput",null,V,re),me.push({event:re,listeners:Kt}),re.data=mn)}Ey(me,j)},ie=void 0;if(Se)Ht();else{Se=!0;try{SC(Ht,ie)}finally{Se=!1,je()}}}function Xl(C,j,V){return{instance:C,listener:j,currentTarget:V}}function Fu(C,j){for(var V=j+"Capture",it=[];C!==null;){var ot=C,st=ot.stateNode;ot.tag===5&&st!==null&&(ot=st,(st=Rt(C,V))!=null&&it.unshift(Xl(C,st,ot)),(st=Rt(C,j))!=null&&it.push(Xl(C,st,ot))),C=C.return}return it}function qs(C){if(C===null)return null;for(;(C=C.return)&&C.tag!==5;);return C||null}function Py(C,j,V,it,ot){for(var st=j._reactName,ut=[];V!==null&&V!==it;){var _t=V,mt=_t.alternate,Ht=_t.stateNode;if(mt!==null&&mt===it)break;_t.tag===5&&Ht!==null&&(_t=Ht,ot?(mt=Rt(V,st))!=null&&ut.unshift(Xl(V,mt,_t)):(mt=Rt(V,st))!=null&&ut.push(Xl(V,mt,_t))),V=V.return}ut.length!==0&&C.push({event:j,listeners:ut})}function zu(){}var pp=null,hp=null;function Ny(C,j){switch(C){case"button":case"input":case"select":case"textarea":return j.autoFocus}}function gp(C,j){return C==="textarea"||C==="option"||C==="noscript"||typeof j.children=="string"||typeof j.children=="number"||typeof j.dangerouslySetInnerHTML=="object"&&j.dangerouslySetInnerHTML!==null&&j.dangerouslySetInnerHTML.__html!=null}var Iy=typeof setTimeout=="function"?setTimeout:void 0,nC=typeof clearTimeout=="function"?clearTimeout:void 0;function mp(C){(C.nodeType===1||C.nodeType===9&&(C=C.body)!=null)&&(C.textContent="")}function Js(C){for(;C!=null;C=C.nextSibling){var j=C.nodeType;if(j===1||j===3)break}return C}function Ry(C){C=C.previousSibling;for(var j=0;C;){if(C.nodeType===8){var V=C.data;if(V==="$"||V==="$!"||V==="$?"){if(j===0)return C;j--}else V==="/$"&&j++}C=C.previousSibling}return null}var yp=0,Gi="__reactFiber$"+(Hn=Math.random().toString(36).slice(2)),Uu="__reactProps$"+Hn,Vs="__reactContainer$"+Hn,My="__reactEvents$"+Hn;function $a(C){var j=C[Gi];if(j)return j;for(var V=C.parentNode;V;){if(j=V[Vs]||V[Gi]){if(V=j.alternate,j.child!==null||V!==null&&V.child!==null)for(C=Ry(C);C!==null;){if(V=C[Gi])return V;C=Ry(C)}return j}V=(C=V).parentNode}return null}function tc(C){return!(C=C[Gi]||C[Vs])||C.tag!==5&&C.tag!==6&&C.tag!==13&&C.tag!==3?null:C}function Ws(C){if(C.tag===5||C.tag===6)return C.stateNode;throw Error(i(33))}function $u(C){return C[Uu]||null}function Dy(C){var j=C[My];return j===void 0?C[My]=new Set:j}var bp=[],ec=-1;function Yi(C){return{current:C}}function zn(C){ec<0||(C.current=bp[ec],bp[ec]=null,ec--)}function Kn(C,j){bp[++ec]=C.current,C.current=j}var Zi={},wr=Yi(Zi),zr=Yi(!1),Ha=Zi;function Ks(C,j){var V=C.type.contextTypes;if(!V)return Zi;var it=C.stateNode;if(it&&it.__reactInternalMemoizedUnmaskedChildContext===j)return it.__reactInternalMemoizedMaskedChildContext;var ot,st={};for(ot in V)st[ot]=j[ot];return it&&((C=C.stateNode).__reactInternalMemoizedUnmaskedChildContext=j,C.__reactInternalMemoizedMaskedChildContext=st),st}function Gr(C){return C.childContextTypes!=null}function vp(){zn(zr),zn(wr)}function Ly(C,j,V){if(wr.current!==Zi)throw Error(i(168));Kn(wr,j),Kn(zr,V)}function By(C,j,V){var it,ot=C.stateNode;if(C=j.childContextTypes,typeof ot.getChildContext!="function")return V;for(it in ot=ot.getChildContext())if(!(it in C))throw Error(i(108,Y(j)||"Unknown",it));return e({},V,ot)}function Hu(C){C=(C=C.stateNode)&&C.__reactInternalMemoizedMergedChildContext||Zi,Ha=wr.current,Kn(wr,C),Kn(zr,zr.current)}function Fy(C,j,V){var it=C.stateNode;if(!it)throw Error(i(169));V?(C=By(C,j,Ha),it.__reactInternalMemoizedMergedChildContext=C,zn(zr),zn(wr),Kn(wr,C)):zn(zr),Kn(zr,V)}var _p=null,qa=null,rC=s.unstable_runWithPriority,xp=s.unstable_scheduleCallback,wp=s.unstable_cancelCallback,oC=s.unstable_shouldYield,Sp=(se=s.unstable_requestPaint,s.unstable_now),iC=s.unstable_getCurrentPriorityLevel,qu=s.unstable_ImmediatePriority,zy=s.unstable_UserBlockingPriority,Uy=s.unstable_NormalPriority,$y=s.unstable_LowPriority,Hy=s.unstable_IdlePriority,Cp={},aC=se!==void 0?se:function(){},gi=null,Ju=null,Ep=!1,qy=Sp(),Sr=qy<1e4?Sp:function(){return Sp()-qy};function Gs(){switch(iC()){case qu:return 99;case zy:return 98;case Uy:return 97;case $y:return 96;case Hy:return 95;default:throw Error(i(332))}}function Jy(C){switch(C){case 99:return qu;case 98:return zy;case 97:return Uy;case 96:return $y;case 95:return Hy;default:throw Error(i(332))}}function Ja(C,j){return C=Jy(C),rC(C,j)}function nc(C,j,V){return C=Jy(C),xp(C,j,V)}function Uo(){var C;Ju!==null&&(C=Ju,Ju=null,wp(C)),Vy()}function Vy(){if(!Ep&&gi!==null){Ep=!0;var C=0;try{var j=gi;Ja(99,function(){for(;C<j.length;C++)for(var V=j[C];(V=V(!0))!==null;);}),gi=null}catch(V){throw gi!==null&&(gi=gi.slice(C+1)),xp(qu,Uo),V}finally{Ep=!1}}}var sC=E.ReactCurrentBatchConfig;function Co(C,j){if(C&&C.defaultProps){for(var V in j=e({},j),C=C.defaultProps)j[V]===void 0&&(j[V]=C[V]);return j}return j}var Vu=Yi(null),Wu=null,Ys=null,Ku=null;function kp(){Ku=Ys=Wu=null}function Op(C){var j=Vu.current;zn(Vu),C.type._context._currentValue=j}function Wy(C,j){for(;C!==null;){var V=C.alternate;if((C.childLanes&j)===j){if(V===null||(V.childLanes&j)===j)break;V.childLanes|=j}else C.childLanes|=j,V!==null&&(V.childLanes|=j);C=C.return}}function Zs(C,j){(Ku=Ys=null)!==(C=(Wu=C).dependencies)&&C.firstContext!==null&&(C.lanes&j&&(Eo=!0),C.firstContext=null)}function io(C,j){if(Ku!==C&&j!==!1&&j!==0)if(typeof j=="number"&&j!==1073741823||(Ku=C,j=1073741823),j={context:C,observedBits:j,next:null},Ys===null){if(Wu===null)throw Error(i(308));Ys=j,Wu.dependencies={lanes:0,firstContext:j,responders:null}}else Ys=Ys.next=j;return C._currentValue}var Qi=!1;function Tp(C){C.updateQueue={baseState:C.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function Ky(C,j){C=C.updateQueue,j.updateQueue===C&&(j.updateQueue={baseState:C.baseState,firstBaseUpdate:C.firstBaseUpdate,lastBaseUpdate:C.lastBaseUpdate,shared:C.shared,effects:C.effects})}function Xi(C,j){return{eventTime:C,lane:j,tag:0,payload:null,callback:null,next:null}}function ta(C,j){var V;(C=C.updateQueue)!==null&&((V=(C=C.shared).pending)===null?j.next=j:(j.next=V.next,V.next=j),C.pending=j)}function Gy(C,j){var V=C.updateQueue,it=C.alternate;if(it!==null&&V===(it=it.updateQueue)){var ot=null,st=null;if((V=V.firstBaseUpdate)!==null){do var ut={eventTime:V.eventTime,lane:V.lane,tag:V.tag,payload:V.payload,callback:V.callback,next:null};while(st===null?ot=st=ut:st=st.next=ut,(V=V.next)!==null);st===null?ot=st=j:st=st.next=j}else ot=st=j;return V={baseState:it.baseState,firstBaseUpdate:ot,lastBaseUpdate:st,shared:it.shared,effects:it.effects},void(C.updateQueue=V)}(C=V.lastBaseUpdate)===null?V.firstBaseUpdate=j:C.next=j,V.lastBaseUpdate=j}function rc(C,j,V,it){var ot,st,ut,_t,mt=C.updateQueue,Ht=(Qi=!1,mt.firstBaseUpdate),ie=mt.lastBaseUpdate;if((Kt=mt.shared.pending)!==null&&(mt.shared.pending=null,st=(ot=Kt).next,(ot.next=null)===ie?Ht=st:ie.next=st,ie=ot,(ut=C.alternate)!==null&&(_t=(ut=ut.updateQueue).lastBaseUpdate)!==ie&&(_t===null?ut.firstBaseUpdate=st:_t.next=st,ut.lastBaseUpdate=ot)),Ht!==null){for(_t=mt.baseState,ie=0,ut=st=ot=null;;){Kt=Ht.lane;var ue=Ht.eventTime;if((it&Kt)===Kt){ut!==null&&(ut=ut.next={eventTime:ue,lane:0,tag:Ht.tag,payload:Ht.payload,callback:Ht.callback,next:null});t:{var De=C,mn=Ht,Kt=j;switch(ue=V,mn.tag){case 1:if(typeof(De=mn.payload)=="function"){_t=De.call(ue,_t,Kt);break t}_t=De;break t;case 3:De.flags=-4097&De.flags|64;case 0:if((Kt=typeof(De=mn.payload)=="function"?De.call(ue,_t,Kt):De)==null)break t;_t=e({},_t,Kt);break t;case 2:Qi=!0}}Ht.callback!==null&&(C.flags|=32,(Kt=mt.effects)===null?mt.effects=[Ht]:Kt.push(Ht))}else ue={eventTime:ue,lane:Kt,tag:Ht.tag,payload:Ht.payload,callback:Ht.callback,next:null},ut===null?(st=ut=ue,ot=_t):ut=ut.next=ue,ie|=Kt;if((Ht=Ht.next)===null){if((Kt=mt.shared.pending)===null)break;Ht=Kt.next,Kt.next=null,mt.lastBaseUpdate=Kt,mt.shared.pending=null}}ut===null&&(ot=_t),mt.baseState=ot,mt.firstBaseUpdate=st,mt.lastBaseUpdate=ut,gc|=ie,C.lanes=ie,C.memoizedState=_t}}function Yy(C,j,V){if(C=j.effects,(j.effects=null)!==C)for(j=0;j<C.length;j++){var it=C[j],ot=it.callback;if(ot!==null){if(it.callback=null,it=V,typeof ot!="function")throw Error(i(191,ot));ot.call(it)}}}var Zy=new n.Component().refs;function Gu(C,j,V,it){V=(V=V(it,j=C.memoizedState))==null?j:e({},j,V),C.memoizedState=V,C.lanes===0&&(C.updateQueue.baseState=V)}var Yu={isMounted:function(C){return!!(C=C._reactInternals)&&Ae(C)===C},enqueueSetState:function(C,j,V){C=C._reactInternals;var it=Zr(),ot=oa(C),st=Xi(it,ot);st.payload=j,V!=null&&(st.callback=V),ta(C,st),ia(C,ot,it)},enqueueReplaceState:function(C,j,V){C=C._reactInternals;var it=Zr(),ot=oa(C),st=Xi(it,ot);st.tag=1,st.payload=j,V!=null&&(st.callback=V),ta(C,st),ia(C,ot,it)},enqueueForceUpdate:function(C,j){C=C._reactInternals;var V=Zr(),it=oa(C),ot=Xi(V,it);ot.tag=2,j!=null&&(ot.callback=j),ta(C,ot),ia(C,it,V)}};function Qy(C,j,V,it,ot,st,ut){return typeof(C=C.stateNode).shouldComponentUpdate=="function"?C.shouldComponentUpdate(it,st,ut):!(j.prototype&&j.prototype.isPureReactComponent&&Yl(V,it)&&Yl(ot,st))}function Xy(C,j,V){var it=!1,ot=Zi,st=j.contextType;j=new j(V,st=typeof st=="object"&&st!==null?io(st):(ot=Gr(j)?Ha:wr.current,(it=(it=j.contextTypes)!=null)?Ks(C,ot):Zi)),C.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,j.updater=Yu,(C.stateNode=j)._reactInternals=C,it&&((C=C.stateNode).__reactInternalMemoizedUnmaskedChildContext=ot,C.__reactInternalMemoizedMaskedChildContext=st)}function tb(C,j,V,it){C=j.state,typeof j.componentWillReceiveProps=="function"&&j.componentWillReceiveProps(V,it),typeof j.UNSAFE_componentWillReceiveProps=="function"&&j.UNSAFE_componentWillReceiveProps(V,it),j.state!==C&&Yu.enqueueReplaceState(j,j.state,null)}function jp(C,j,V,it){var ot=C.stateNode,st=(ot.props=V,ot.state=C.memoizedState,ot.refs=Zy,Tp(C),j.contextType);typeof st=="object"&&st!==null?ot.context=io(st):(st=Gr(j)?Ha:wr.current,ot.context=Ks(C,st)),rc(C,V,ot,it),ot.state=C.memoizedState,typeof(st=j.getDerivedStateFromProps)=="function"&&(Gu(C,0,st,V),ot.state=C.memoizedState),typeof j.getDerivedStateFromProps=="function"||typeof ot.getSnapshotBeforeUpdate=="function"||typeof ot.UNSAFE_componentWillMount!="function"&&typeof ot.componentWillMount!="function"||(j=ot.state,typeof ot.componentWillMount=="function"&&ot.componentWillMount(),typeof ot.UNSAFE_componentWillMount=="function"&&ot.UNSAFE_componentWillMount(),j!==ot.state&&Yu.enqueueReplaceState(ot,ot.state,null),rc(C,V,ot,it),ot.state=C.memoizedState),typeof ot.componentDidMount=="function"&&(C.flags|=4)}var Zu=Array.isArray;function oc(C,j,V){if((C=V.ref)!==null&&typeof C!="function"&&typeof C!="object"){if(V._owner){if(V=V._owner){if(V.tag!==1)throw Error(i(309));var it=V.stateNode}if(!it)throw Error(i(147,C));var ot=""+C;return j!==null&&j.ref!==null&&typeof j.ref=="function"&&j.ref._stringRef===ot?j.ref:((j=function(st){var ut=it.refs;ut===Zy&&(ut=it.refs={}),st===null?delete ut[ot]:ut[ot]=st})._stringRef=ot,j)}if(typeof C!="string")throw Error(i(284));if(!V._owner)throw Error(i(290,C))}return C}function Qu(C,j){if(C.type!=="textarea")throw Error(i(31,Object.prototype.toString.call(j)==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":j))}function eb(C){function j(Kt,re){var me;C&&((me=Kt.lastEffect)!==null?(me.nextEffect=re,Kt.lastEffect=re):Kt.firstEffect=Kt.lastEffect=re,re.nextEffect=null,re.flags=8)}function V(Kt,re){if(!C)return null;for(;re!==null;)j(Kt,re),re=re.sibling;return null}function it(Kt,re){for(Kt=new Map;re!==null;)re.key!==null?Kt.set(re.key,re):Kt.set(re.index,re),re=re.sibling;return Kt}function ot(Kt,re){return(Kt=la(Kt,re)).index=0,Kt.sibling=null,Kt}function st(Kt,re,me){return Kt.index=me,C?(me=Kt.alternate)===null||(me=me.index)<re?(Kt.flags=2,re):me:re}function ut(Kt){return C&&Kt.alternate===null&&(Kt.flags=2),Kt}function _t(Kt,re,me,Le){return re===null||re.tag!==6?(re=lh(me,Kt.mode,Le)).return=Kt:(re=ot(re,me)).return=Kt,re}function mt(Kt,re,me,Le){return re!==null&&re.elementType===me.type?(Le=ot(re,me.props)).ref=oc(0,re,me):(Le=gd(me.type,me.key,me.props,null,Kt.mode,Le)).ref=oc(0,re,me),Le.return=Kt,Le}function Ht(Kt,re,me,Le){return re===null||re.tag!==4||re.stateNode.containerInfo!==me.containerInfo||re.stateNode.implementation!==me.implementation?(re=ch(me,Kt.mode,Le)).return=Kt:(re=ot(re,me.children||[])).return=Kt,re}function ie(Kt,re,me,Le,Me){return re===null||re.tag!==7?(re=al(me,Kt.mode,Le,Me)).return=Kt:(re=ot(re,me)).return=Kt,re}function ue(Kt,re,me){if(typeof re=="string"||typeof re=="number")return(re=lh(""+re,Kt.mode,me)).return=Kt,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case k:return(me=gd(re.type,re.key,re.props,null,Kt.mode,me)).ref=oc(0,null,re),me.return=Kt,me;case D:return(re=ch(re,Kt.mode,me)).return=Kt,re}if(Zu(re)||T(re))return(re=al(re,Kt.mode,me,null)).return=Kt,re;Qu(Kt,re)}return null}function De(Kt,re,me,Le){var Me=re!==null?re.key:null;if(typeof me=="string"||typeof me=="number")return Me!==null?null:_t(Kt,re,""+me,Le);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case k:return me.key===Me?me.type===P?ie(Kt,re,me.props.children,Le,Me):mt(Kt,re,me,Le):null;case D:return me.key===Me?Ht(Kt,re,me,Le):null}if(Zu(me)||T(me))return Me!==null?null:ie(Kt,re,me,Le,null);Qu(Kt,me)}return null}function mn(Kt,re,me,Le,Me){if(typeof Le=="string"||typeof Le=="number")return _t(re,Kt=Kt.get(me)||null,""+Le,Me);if(typeof Le=="object"&&Le!==null){switch(Le.$$typeof){case k:return Kt=Kt.get(Le.key===null?me:Le.key)||null,Le.type===P?ie(re,Kt,Le.props.children,Me,Le.key):mt(re,Kt,Le,Me);case D:return Ht(re,Kt=Kt.get(Le.key===null?me:Le.key)||null,Le,Me)}if(Zu(Le)||T(Le))return ie(re,Kt=Kt.get(me)||null,Le,Me,null);Qu(re,Le)}return null}return function(Kt,re,me,Le){var Me=typeof me=="object"&&me!==null&&me.type===P&&me.key===null,Ze=typeof(me=Me?me.props.children:me)=="object"&&me!==null;if(Ze)switch(me.$$typeof){case k:t:{for(Ze=me.key,Me=re;Me!==null;){if(Me.key===Ze){switch(Me.tag){case 7:if(me.type!==P)break;V(Kt,Me.sibling),(re=ot(Me,me.props.children)).return=Kt,Kt=re;break t;default:if(Me.elementType===me.type){V(Kt,Me.sibling),(re=ot(Me,me.props)).ref=oc(0,Me,me),re.return=Kt,Kt=re;break t}}V(Kt,Me);break}j(Kt,Me),Me=Me.sibling}Kt=me.type===P?((re=al(me.props.children,Kt.mode,Le,me.key)).return=Kt,re):((Le=gd(me.type,me.key,me.props,null,Kt.mode,Le)).ref=oc(0,re,me),Le.return=Kt,Le)}return ut(Kt);case D:t:{for(Me=me.key;re!==null;){if(re.key===Me){if(re.tag===4&&re.stateNode.containerInfo===me.containerInfo&&re.stateNode.implementation===me.implementation){V(Kt,re.sibling),(re=ot(re,me.children||[])).return=Kt,Kt=re;break t}V(Kt,re);break}j(Kt,re),re=re.sibling}(re=ch(me,Kt.mode,Le)).return=Kt,Kt=re}return ut(Kt)}if(typeof me=="string"||typeof me=="number")return me=""+me,(re=re!==null&&re.tag===6?(V(Kt,re.sibling),ot(re,me)):(V(Kt,re),lh(me,Kt.mode,Le))).return=Kt,ut(Kt=re);if(Zu(me)){for(var ln=Kt,Xe=re,Qe=me,wn=Le,On=null,An=null,pn=Xe,yn=Xe=0,dn=null;pn!==null&&yn<Qe.length;yn++){pn.index>yn?(dn=pn,pn=null):dn=pn.sibling;var Dn=De(ln,pn,Qe[yn],wn);if(Dn===null){pn===null&&(pn=dn);break}C&&pn&&Dn.alternate===null&&j(ln,pn),Xe=st(Dn,Xe,yn),An===null?On=Dn:An.sibling=Dn,An=Dn,pn=dn}if(yn===Qe.length)return V(ln,pn),On;if(pn===null){for(;yn<Qe.length;yn++)(pn=ue(ln,Qe[yn],wn))!==null&&(Xe=st(pn,Xe,yn),An===null?On=pn:An.sibling=pn,An=pn);return On}for(pn=it(ln,pn);yn<Qe.length;yn++)(dn=mn(pn,ln,yn,Qe[yn],wn))!==null&&(C&&dn.alternate!==null&&pn.delete(dn.key===null?yn:dn.key),Xe=st(dn,Xe,yn),An===null?On=dn:An.sibling=dn,An=dn);return C&&pn.forEach(function(hh){return j(ln,hh)}),On}if(T(me)){var Gn=Kt,co=re,Vo=me,ph=Le,vi=T(Vo);if(typeof vi!="function")throw Error(i(150));if((Vo=vi.call(Vo))==null)throw Error(i(151));for(var _i=vi=null,pr=co,xi=co=0,bd=null,Jn=Vo.next();pr!==null&&!Jn.done;xi++,Jn=Vo.next()){pr.index>xi?(bd=pr,pr=null):bd=pr.sibling;var sl=De(Gn,pr,Jn.value,ph);if(sl===null){pr===null&&(pr=bd);break}C&&pr&&sl.alternate===null&&j(Gn,pr),co=st(sl,co,xi),_i===null?vi=sl:_i.sibling=sl,_i=sl,pr=bd}if(Jn.done)return V(Gn,pr),vi;if(pr===null){for(;!Jn.done;xi++,Jn=Vo.next())(Jn=ue(Gn,Jn.value,ph))!==null&&(co=st(Jn,co,xi),_i===null?vi=Jn:_i.sibling=Jn,_i=Jn);return vi}for(pr=it(Gn,pr);!Jn.done;xi++,Jn=Vo.next())(Jn=mn(pr,Gn,xi,Jn.value,ph))!==null&&(C&&Jn.alternate!==null&&pr.delete(Jn.key===null?xi:Jn.key),co=st(Jn,co,xi),_i===null?vi=Jn:_i.sibling=Jn,_i=Jn);return C&&pr.forEach(function(hh){return j(Gn,hh)}),vi}if(Ze&&Qu(Kt,me),me===void 0&&!Me)switch(Kt.tag){case 1:case 22:case 0:case 11:case 15:throw Error(i(152,Y(Kt.type)||"Component"))}return V(Kt,re)}}var Xu=eb(!0),nb=eb(!1),ic={},$o=Yi(ic),ac=Yi(ic),sc=Yi(ic);function Va(C){if(C===ic)throw Error(i(174));return C}function Ap(C,j){switch(Kn(sc,j),Kn(ac,C),Kn($o,ic),C=j.nodeType){case 9:case 11:j=(j=j.documentElement)?j.namespaceURI:Et(null,"");break;default:j=Et(j=(C=C===8?j.parentNode:j).namespaceURI||null,C=C.tagName)}zn($o),Kn($o,j)}function Qs(){zn($o),zn(ac),zn(sc)}function rb(C){Va(sc.current);var j=Va($o.current),V=Et(j,C.type);j!==V&&(Kn(ac,C),Kn($o,V))}function Pp(C){ac.current===C&&(zn($o),zn(ac))}var Yn=Yi(0);function td(C){for(var j=C;j!==null;){if(j.tag===13){var V=j.memoizedState;if(V!==null&&((V=V.dehydrated)===null||V.data==="$?"||V.data==="$!"))return j}else if(j.tag===19&&j.memoizedProps.revealOrder!==void 0){if(64&j.flags)return j}else if(j.child!==null){j=(j.child.return=j).child;continue}if(j===C)break;for(;j.sibling===null;){if(j.return===null||j.return===C)return null;j=j.return}j.sibling.return=j.return,j=j.sibling}return null}var mi=null,ea=null,Ho=!1;function ob(C,j){var V=lo(5,null,null,0);V.elementType="DELETED",V.type="DELETED",V.stateNode=j,V.return=C,V.flags=8,C.lastEffect!==null?(C.lastEffect.nextEffect=V,C.lastEffect=V):C.firstEffect=C.lastEffect=V}function ib(C,j){switch(C.tag){case 5:var V=C.type;return(j=j.nodeType!==1||V.toLowerCase()!==j.nodeName.toLowerCase()?null:j)!==null&&(C.stateNode=j,1);case 6:return(j=C.pendingProps===""||j.nodeType!==3?null:j)!==null&&(C.stateNode=j,1);default:return}}function Np(C){if(Ho){var j=ea;if(j){var V=j;if(!ib(C,j)){if(!(j=Js(V.nextSibling))||!ib(C,j))return C.flags=-1025&C.flags|2,Ho=!1,void(mi=C);ob(mi,V)}mi=C,ea=Js(j.firstChild)}else C.flags=-1025&C.flags|2,Ho=!1,mi=C}}function ab(C){for(C=C.return;C!==null&&C.tag!==5&&C.tag!==3&&C.tag!==13;)C=C.return;mi=C}function ed(C){if(C===mi){if(!Ho)return ab(C),Ho=!0,0;var j=C.type;if(C.tag!==5||j!=="head"&&j!=="body"&&!gp(j,C.memoizedProps))for(j=ea;j;)ob(C,j),j=Js(j.nextSibling);if(ab(C),C.tag===13){if(!(C=(C=C.memoizedState)!==null?C.dehydrated:null))throw Error(i(317));t:{for(C=C.nextSibling,j=0;C;){if(C.nodeType===8){var V=C.data;if(V==="/$"){if(j===0){ea=Js(C.nextSibling);break t}j--}else V!=="$"&&V!=="$!"&&V!=="$?"||j++}C=C.nextSibling}ea=null}}else ea=mi?Js(C.stateNode.nextSibling):null;return 1}}function Ip(){ea=mi=null,Ho=!1}var Xs=[];function Rp(){for(var C=0;C<Xs.length;C++)Xs[C]._workInProgressVersionPrimary=null;Xs.length=0}var lc=E.ReactCurrentDispatcher,ao=E.ReactCurrentBatchConfig,cc=0,Zn=null,Ir=null,yr=null,nd=!1,uc=!1;function Ur(){throw Error(i(321))}function Mp(C,j){if(j!==null){for(var V=0;V<j.length&&V<C.length;V++)if(!nr(C[V],j[V]))return;return 1}}function Dp(C,j,V,it,ot,st){if(cc=st,(Zn=j).memoizedState=null,j.updateQueue=null,j.lanes=0,lc.current=C===null||C.memoizedState===null?lC:cC,C=V(it,ot),uc){st=0;do if(uc=!1,!(st<25))throw Error(i(301));while(st+=1,yr=Ir=null,j.updateQueue=null,lc.current=uC,C=V(it,ot),uc)}if(lc.current=ad,j=Ir!==null&&Ir.next!==null,cc=0,yr=Ir=Zn=null,nd=!1,j)throw Error(i(300));return C}function Wa(){var C={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yr===null?Zn.memoizedState=yr=C:yr=yr.next=C,yr}function Ka(){C=Ir===null?(C=Zn.alternate)!==null?C.memoizedState:null:Ir.next;var C,j=yr===null?Zn.memoizedState:yr.next;if(j!==null)yr=j,Ir=C;else{if(C===null)throw Error(i(310));C={memoizedState:(Ir=C).memoizedState,baseState:Ir.baseState,baseQueue:Ir.baseQueue,queue:Ir.queue,next:null},yr===null?Zn.memoizedState=yr=C:yr=yr.next=C}return yr}function qo(C,j){return typeof j=="function"?j(C):j}function dc(C){var j=Ka(),V=j.queue;if(V===null)throw Error(i(311));V.lastRenderedReducer=C;var it,ot=(ut=Ir).baseQueue,st=V.pending;if(st!==null&&(ot!==null&&(it=ot.next,ot.next=st.next,st.next=it),ut.baseQueue=ot=st,V.pending=null),ot!==null){ot=ot.next;var ut=ut.baseState,_t=it=st=null,mt=ot;do var Ht,ie=mt.lane;while((cc&ie)===ie?(_t!==null&&(_t=_t.next={lane:0,action:mt.action,eagerReducer:mt.eagerReducer,eagerState:mt.eagerState,next:null}),ut=mt.eagerReducer===C?mt.eagerState:C(ut,mt.action)):(Ht={lane:ie,action:mt.action,eagerReducer:mt.eagerReducer,eagerState:mt.eagerState,next:null},_t===null?(it=_t=Ht,st=ut):_t=_t.next=Ht,Zn.lanes|=ie,gc|=ie),(mt=mt.next)!==null&&mt!==ot);_t===null?st=ut:_t.next=it,nr(ut,j.memoizedState)||(Eo=!0),j.memoizedState=ut,j.baseState=st,j.baseQueue=_t,V.lastRenderedState=ut}return[j.memoizedState,V.dispatch]}function fc(C){var j=Ka(),V=j.queue;if(V===null)throw Error(i(311));V.lastRenderedReducer=C;var it=V.dispatch,ot=V.pending,st=j.memoizedState;if(ot!==null){V.pending=null;for(var ut=ot=ot.next;st=C(st,ut.action),(ut=ut.next)!==ot;);nr(st,j.memoizedState)||(Eo=!0),j.memoizedState=st,j.baseQueue===null&&(j.baseState=st),V.lastRenderedState=st}return[st,it]}function sb(C,j,V){var it=(it=j._getVersion)(j._source),ot=j._workInProgressVersionPrimary;if(ot!==null?C=ot===it:(C=C.mutableReadLanes,(C=(cc&C)===C)&&(j._workInProgressVersionPrimary=it,Xs.push(j))),C)return V(j._source);throw Xs.push(j),Error(i(350))}function lb(C,j,V,it){var ot=Rr;if(ot===null)throw Error(i(349));var st=j._getVersion,ut=st(j._source),_t=lc.current,mt=(ie=_t.useState(function(){return sb(ot,j,V)}))[1],Ht=ie[0],ie=yr,ue=(Kt=C.memoizedState).refs,De=ue.getSnapshot,mn=Kt.source,Kt=Kt.subscribe,re=Zn;return C.memoizedState={refs:ue,source:j,subscribe:it},_t.useEffect(function(){ue.getSnapshot=V,ue.setSnapshot=mt;var me=st(j._source);if(!nr(ut,me)){me=V(j._source),nr(Ht,me)||(mt(me),me=oa(re),ot.mutableReadLanes|=me&ot.pendingLanes),me=ot.mutableReadLanes,ot.entangledLanes|=me;for(var Le=ot.entanglements,Me=me;0<Me;){var Ze=31-xo(Me),ln=1<<Ze;Le[Ze]|=me,Me&=~ln}}},[V,j,it]),_t.useEffect(function(){return it(j._source,function(){var me=ue.getSnapshot,Le=ue.setSnapshot;try{Le(me(j._source));var Me=oa(re);ot.mutableReadLanes|=Me&ot.pendingLanes}catch(Ze){Le(function(){throw Ze})}})},[j,it]),nr(De,V)&&nr(mn,j)&&nr(Kt,it)||((C={pending:null,dispatch:null,lastRenderedReducer:qo,lastRenderedState:Ht}).dispatch=mt=zp.bind(null,Zn,C),ie.queue=C,ie.baseQueue=null,Ht=sb(ot,j,V),ie.memoizedState=ie.baseState=Ht),Ht}function cb(C,j,V){return lb(Ka(),C,j,V)}function pc(C){var j=Wa();return typeof C=="function"&&(C=C()),j.memoizedState=j.baseState=C,C=(C=j.queue={pending:null,dispatch:null,lastRenderedReducer:qo,lastRenderedState:C}).dispatch=zp.bind(null,Zn,C),[j.memoizedState,C]}function rd(C,j,V,it){return C={tag:C,create:j,destroy:V,deps:it,next:null},(j=Zn.updateQueue)===null?(Zn.updateQueue=j={lastEffect:null}).lastEffect=C.next=C:(V=j.lastEffect)===null?j.lastEffect=C.next=C:(it=V.next,(V.next=C).next=it,j.lastEffect=C),C}function ub(C){return Wa().memoizedState={current:C}}function od(){return Ka().memoizedState}function Lp(C,j,V,it){var ot=Wa();Zn.flags|=C,ot.memoizedState=rd(1|j,V,void 0,it===void 0?null:it)}function Bp(C,j,V,it){var ot=Ka(),st=void(it=it===void 0?null:it);if(Ir!==null){var ut=Ir.memoizedState;if(st=ut.destroy,it!==null&&Mp(it,ut.deps))return void rd(j,V,st,it)}Zn.flags|=C,ot.memoizedState=rd(1|j,V,st,it)}function db(C,j){return Lp(516,4,C,j)}function id(C,j){return Bp(516,4,C,j)}function fb(C,j){return Bp(4,2,C,j)}function pb(C,j){return typeof j=="function"?(C=C(),j(C),function(){j(null)}):j!=null?(C=C(),j.current=C,function(){j.current=null}):void 0}function hb(C,j,V){return V=V!=null?V.concat([C]):null,Bp(4,2,pb.bind(null,j,C),V)}function Fp(){}function gb(C,j){var V=Ka(),it=(j=j===void 0?null:j,V.memoizedState);return it!==null&&j!==null&&Mp(j,it[1])?it[0]:(V.memoizedState=[C,j],C)}function mb(C,j){var V=Ka(),it=(j=j===void 0?null:j,V.memoizedState);return it!==null&&j!==null&&Mp(j,it[1])?it[0]:(C=C(),V.memoizedState=[C,j],C)}function zp(C,j,V){var it=Zr(),ot=oa(C),st={lane:ot,action:V,eagerReducer:null,eagerState:null,next:null},ut=j.pending;if(ut===null?st.next=st:(st.next=ut.next,ut.next=st),j.pending=st,ut=C.alternate,C===Zn||ut!==null&&ut===Zn)uc=nd=!0;else{if(C.lanes===0&&(ut===null||ut.lanes===0)&&(ut=j.lastRenderedReducer)!==null)try{var _t=j.lastRenderedState,mt=ut(_t,V);if(st.eagerReducer=ut,st.eagerState=mt,nr(mt,_t))return}catch{}ia(C,ot,it)}}var ad={readContext:io,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},lC={readContext:io,useCallback:function(C,j){return Wa().memoizedState=[C,j===void 0?null:j],C},useContext:io,useEffect:db,useImperativeHandle:function(C,j,V){return V=V!=null?V.concat([C]):null,Lp(4,2,pb.bind(null,j,C),V)},useLayoutEffect:function(C,j){return Lp(4,2,C,j)},useMemo:function(C,j){var V=Wa();return j=j===void 0?null:j,C=C(),V.memoizedState=[C,j],C},useReducer:function(C,j,V){var it=Wa();return j=V!==void 0?V(j):j,it.memoizedState=it.baseState=j,C=(C=it.queue={pending:null,dispatch:null,lastRenderedReducer:C,lastRenderedState:j}).dispatch=zp.bind(null,Zn,C),[it.memoizedState,C]},useRef:ub,useState:pc,useDebugValue:Fp,useDeferredValue:function(C){var j=pc(C),V=j[0],it=j[1];return db(function(){var ot=ao.transition;ao.transition=1;try{it(C)}finally{ao.transition=ot}},[C]),V},useTransition:function(){var C=pc(!1),j=C[0];return ub(C=(function(V,it){var ot=Gs();Ja(ot<98?98:ot,function(){V(!0)}),Ja(97<ot?97:ot,function(){var st=ao.transition;ao.transition=1;try{V(!1),it()}finally{ao.transition=st}})}).bind(null,C[1])),[C,j]},useMutableSource:function(C,j,V){var it=Wa();return it.memoizedState={refs:{getSnapshot:j,setSnapshot:null},source:C,subscribe:V},lb(it,C,j,V)},useOpaqueIdentifier:function(){var C,j,V;return Ho?(C=!1,V={$$typeof:U,toString:V=function(){throw C||(C=!0,j("r:"+(yp++).toString(36))),Error(i(355))},valueOf:V},j=pc(V)[1],!(2&Zn.mode)&&(Zn.flags|=516,rd(5,function(){j("r:"+(yp++).toString(36))},void 0,null))):pc(V="r:"+(yp++).toString(36)),V},unstable_isNewReconciler:!1},cC={readContext:io,useCallback:gb,useContext:io,useEffect:id,useImperativeHandle:hb,useLayoutEffect:fb,useMemo:mb,useReducer:dc,useRef:od,useState:function(){return dc(qo)},useDebugValue:Fp,useDeferredValue:function(C){var j=dc(qo),V=j[0],it=j[1];return id(function(){var ot=ao.transition;ao.transition=1;try{it(C)}finally{ao.transition=ot}},[C]),V},useTransition:function(){var C=dc(qo)[0];return[od().current,C]},useMutableSource:cb,useOpaqueIdentifier:function(){return dc(qo)[0]},unstable_isNewReconciler:!1},uC={readContext:io,useCallback:gb,useContext:io,useEffect:id,useImperativeHandle:hb,useLayoutEffect:fb,useMemo:mb,useReducer:fc,useRef:od,useState:function(){return fc(qo)},useDebugValue:Fp,useDeferredValue:function(C){var j=fc(qo),V=j[0],it=j[1];return id(function(){var ot=ao.transition;ao.transition=1;try{it(C)}finally{ao.transition=ot}},[C]),V},useTransition:function(){var C=fc(qo)[0];return[od().current,C]},useMutableSource:cb,useOpaqueIdentifier:function(){return fc(qo)[0]},unstable_isNewReconciler:!1},dC=E.ReactCurrentOwner,Eo=!1;function Yr(C,j,V,it){j.child=C===null?nb(j,null,V,it):Xu(j,C.child,V,it)}function yb(C,j,V,it,ot){V=V.render;var st=j.ref;return Zs(j,ot),it=Dp(C,j,V,it,st,ot),C===null||Eo?(j.flags|=1,Yr(C,j,it,ot),j.child):(j.updateQueue=C.updateQueue,j.flags&=-517,C.lanes&=~ot,yi(C,j,ot))}function bb(C,j,V,it,ot,st){var ut;return C===null?typeof(ut=V.type)!="function"||ah(ut)||ut.defaultProps!==void 0||V.compare!==null||V.defaultProps!==void 0?((C=gd(V.type,null,it,j,j.mode,st)).ref=j.ref,(C.return=j).child=C):(j.tag=15,j.type=ut,vb(C,j,ut,it,ot,st)):(ut=C.child,ot&st||(ot=ut.memoizedProps,!(V=(V=V.compare)!==null?V:Yl)(ot,it)||C.ref!==j.ref)?(j.flags|=1,(C=la(ut,it)).ref=j.ref,(C.return=j).child=C):yi(C,j,st))}function vb(C,j,V,it,ot,st){if(C!==null&&Yl(C.memoizedProps,it)&&C.ref===j.ref){if(Eo=!1,!(st&ot))return j.lanes=C.lanes,yi(C,j,st);16384&C.flags&&(Eo=!0)}return Up(C,j,V,it,st)}function _b(C,j,V){var it=j.pendingProps,ot=it.children,st=C!==null?C.memoizedState:null;if(it.mode==="hidden"||it.mode==="unstable-defer-without-hiding")if(4&j.mode){if(!(1073741824&V))return C=st!==null?st.baseLanes|V:V,j.lanes=j.childLanes=1073741824,j.memoizedState={baseLanes:C},hd(0,C),null;j.memoizedState={baseLanes:0},hd(0,st!==null?st.baseLanes:V)}else j.memoizedState={baseLanes:0},hd(0,V);else st!==null?(it=st.baseLanes|V,j.memoizedState=null):it=V,hd(0,it);return Yr(C,j,ot,V),j.child}function xb(C,j){var V=j.ref;(C===null&&V!==null||C!==null&&C.ref!==V)&&(j.flags|=128)}function Up(C,j,V,it,ot){var st=Ks(j,Gr(V)?Ha:wr.current);return Zs(j,ot),V=Dp(C,j,V,it,st,ot),C===null||Eo?(j.flags|=1,Yr(C,j,V,ot),j.child):(j.updateQueue=C.updateQueue,j.flags&=-517,C.lanes&=~ot,yi(C,j,ot))}function wb(C,j,V,it,ot){var st,ut,_t,mt,Ht,ie,ue,De,mn,Kt;return Gr(V)?(st=!0,Hu(j)):st=!1,Zs(j,ot),it=j.stateNode===null?(C!==null&&(C.alternate=null,j.alternate=null,j.flags|=2),Xy(j,V,it),jp(j,V,it,ot),!0):C===null?(ut=j.stateNode,_t=j.memoizedProps,ut.props=_t,De=ut.context,mt=typeof(mt=V.contextType)=="object"&&mt!==null?io(mt):Ks(j,mt=Gr(V)?Ha:wr.current),(ie=typeof(Ht=V.getDerivedStateFromProps)=="function"||typeof ut.getSnapshotBeforeUpdate=="function")||typeof ut.UNSAFE_componentWillReceiveProps!="function"&&typeof ut.componentWillReceiveProps!="function"||_t===it&&De===mt||tb(0,ut,it,mt),Qi=!1,ue=j.memoizedState,ut.state=ue,rc(j,it,ut,ot),De=j.memoizedState,_t!==it||ue!==De||zr.current||Qi?(typeof Ht=="function"&&(Gu(j,0,Ht,it),De=j.memoizedState),(_t=Qi||Qy(j,V,_t,it,ue,De,mt))?(ie||typeof ut.UNSAFE_componentWillMount!="function"&&typeof ut.componentWillMount!="function"||(typeof ut.componentWillMount=="function"&&ut.componentWillMount(),typeof ut.UNSAFE_componentWillMount=="function"&&ut.UNSAFE_componentWillMount()),typeof ut.componentDidMount=="function"&&(j.flags|=4)):(typeof ut.componentDidMount=="function"&&(j.flags|=4),j.memoizedProps=it,j.memoizedState=De),ut.props=it,ut.state=De,ut.context=mt,_t):(typeof ut.componentDidMount=="function"&&(j.flags|=4),!1)):(ut=j.stateNode,Ky(C,j),_t=j.memoizedProps,mt=j.type===j.elementType?_t:Co(j.type,_t),ut.props=mt,ie=j.pendingProps,ue=ut.context,De=typeof(De=V.contextType)=="object"&&De!==null?io(De):Ks(j,De=Gr(V)?Ha:wr.current),(Ht=typeof(mn=V.getDerivedStateFromProps)=="function"||typeof ut.getSnapshotBeforeUpdate=="function")||typeof ut.UNSAFE_componentWillReceiveProps!="function"&&typeof ut.componentWillReceiveProps!="function"||_t===ie&&ue===De||tb(0,ut,it,De),Qi=!1,ue=j.memoizedState,ut.state=ue,rc(j,it,ut,ot),Kt=j.memoizedState,_t!==ie||ue!==Kt||zr.current||Qi?(typeof mn=="function"&&(Gu(j,0,mn,it),Kt=j.memoizedState),(mt=Qi||Qy(j,V,mt,it,ue,Kt,De))?(Ht||typeof ut.UNSAFE_componentWillUpdate!="function"&&typeof ut.componentWillUpdate!="function"||(typeof ut.componentWillUpdate=="function"&&ut.componentWillUpdate(it,Kt,De),typeof ut.UNSAFE_componentWillUpdate=="function"&&ut.UNSAFE_componentWillUpdate(it,Kt,De)),typeof ut.componentDidUpdate=="function"&&(j.flags|=4),typeof ut.getSnapshotBeforeUpdate=="function"&&(j.flags|=256)):(typeof ut.componentDidUpdate!="function"||_t===C.memoizedProps&&ue===C.memoizedState||(j.flags|=4),typeof ut.getSnapshotBeforeUpdate!="function"||_t===C.memoizedProps&&ue===C.memoizedState||(j.flags|=256),j.memoizedProps=it,j.memoizedState=Kt),ut.props=it,ut.state=Kt,ut.context=De,mt):(typeof ut.componentDidUpdate!="function"||_t===C.memoizedProps&&ue===C.memoizedState||(j.flags|=4),typeof ut.getSnapshotBeforeUpdate!="function"||_t===C.memoizedProps&&ue===C.memoizedState||(j.flags|=256),!1)),$p(C,j,V,it,st,ot)}function $p(C,j,V,it,ot,st){xb(C,j);var ut=!!(64&j.flags);if(!it&&!ut)return ot&&Fy(j,V,!1),yi(C,j,st);it=j.stateNode,dC.current=j;var _t=ut&&typeof V.getDerivedStateFromError!="function"?null:it.render();return j.flags|=1,C!==null&&ut?(j.child=Xu(j,C.child,null,st),j.child=Xu(j,null,_t,st)):Yr(C,j,_t,st),j.memoizedState=it.state,ot&&Fy(j,V,!0),j.child}function Sb(C){var j=C.stateNode;j.pendingContext?Ly(0,j.pendingContext,j.pendingContext!==j.context):j.context&&Ly(0,j.context,!1),Ap(C,j.containerInfo)}var Hp={dehydrated:null,retryLane:0};function Cb(C,j,V){var it,ot=j.pendingProps,st=Yn.current,ut=!1;return(it=(it=!!(64&j.flags))?it:(C===null||C.memoizedState!==null)&&!!(2&st))?(ut=!0,j.flags&=-65):C!==null&&C.memoizedState===null||ot.fallback===void 0||ot.unstable_avoidThisFallback===!0||(st|=1),Kn(Yn,1&st),C===null?(ot.fallback!==void 0&&Np(j),C=ot.children,st=ot.fallback,ut?(C=Eb(j,C,st,V),j.child.memoizedState={baseLanes:V},j.memoizedState=Hp,C):typeof ot.unstable_expectedLoadTime=="number"?(C=Eb(j,C,st,V),j.child.memoizedState={baseLanes:V},j.memoizedState=Hp,j.lanes=33554432,C):((V=sh({mode:"visible",children:C},j.mode,V,null)).return=j).child=V):(C.memoizedState,ut?(ot=function(_t,mt,Ht,ie,ue){var De=mt.mode,mn=_t.child,Kt=(_t=mn.sibling,{mode:"hidden",children:Ht});return 2&De||mt.child===mn?Ht=la(mn,Kt):((Ht=mt.child).childLanes=0,Ht.pendingProps=Kt,(mn=Ht.lastEffect)!==null?(mt.firstEffect=Ht.firstEffect,(mt.lastEffect=mn).nextEffect=null):mt.firstEffect=mt.lastEffect=null),_t!==null?ie=la(_t,ie):(ie=al(ie,De,ue,null)).flags|=2,ie.return=mt,Ht.return=mt,Ht.sibling=ie,mt.child=Ht,ie}(C,j,ot.children,ot.fallback,V),ut=j.child,st=C.child.memoizedState,ut.memoizedState=st===null?{baseLanes:V}:{baseLanes:st.baseLanes|V},ut.childLanes=C.childLanes&~V,j.memoizedState=Hp,ot):(V=function(_t,mt,Ht,ie){var ue=_t.child;return _t=ue.sibling,Ht=la(ue,{mode:"visible",children:Ht}),!(2&mt.mode)&&(Ht.lanes=ie),Ht.return=mt,(Ht.sibling=null)!==_t&&(_t.nextEffect=null,_t.flags=8,mt.firstEffect=mt.lastEffect=_t),mt.child=Ht}(C,j,ot.children,V),j.memoizedState=null,V))}function Eb(C,j,V,it){var ot=C.mode,st=C.child;return j={mode:"hidden",children:j},2&ot||st===null?st=sh(j,ot,0,null):(st.childLanes=0,st.pendingProps=j),V=al(V,ot,it,null),st.return=C,V.return=C,st.sibling=V,C.child=st,V}function kb(C,j){C.lanes|=j;var V=C.alternate;V!==null&&(V.lanes|=j),Wy(C.return,j)}function qp(C,j,V,it,ot,st){var ut=C.memoizedState;ut===null?C.memoizedState={isBackwards:j,rendering:null,renderingStartTime:0,last:it,tail:V,tailMode:ot,lastEffect:st}:(ut.isBackwards=j,ut.rendering=null,ut.renderingStartTime=0,ut.last=it,ut.tail=V,ut.tailMode=ot,ut.lastEffect=st)}function Ob(C,j,V){var it=j.pendingProps,ot=it.revealOrder,st=it.tail;if(Yr(C,j,it.children,V),2&(it=Yn.current))it=1&it|2,j.flags|=64;else{if(C!==null&&64&C.flags)t:for(C=j.child;C!==null;){if(C.tag===13)C.memoizedState!==null&&kb(C,V);else if(C.tag===19)kb(C,V);else if(C.child!==null){C=(C.child.return=C).child;continue}if(C===j)break;for(;C.sibling===null;){if(C.return===null||C.return===j)break t;C=C.return}C.sibling.return=C.return,C=C.sibling}it&=1}if(Kn(Yn,it),2&j.mode)switch(ot){case"forwards":for(V=j.child,ot=null;V!==null;)(C=V.alternate)!==null&&td(C)===null&&(ot=V),V=V.sibling;(V=ot)===null?(ot=j.child,j.child=null):(ot=V.sibling,V.sibling=null),qp(j,!1,ot,V,st,j.lastEffect);break;case"backwards":for(ot=j.child,j.child=V=null;ot!==null;){if((C=ot.alternate)!==null&&td(C)===null){j.child=ot;break}C=ot.sibling,ot.sibling=V,V=ot,ot=C}qp(j,!0,V,null,st,j.lastEffect);break;case"together":qp(j,!1,null,null,void 0,j.lastEffect);break;default:j.memoizedState=null}else j.memoizedState=null;return j.child}function yi(C,j,V){if(C!==null&&(j.dependencies=C.dependencies),gc|=j.lanes,!(V&j.childLanes))return null;if(C!==null&&j.child!==C.child)throw Error(i(153));if(j.child!==null){for(V=la(C=j.child,C.pendingProps),(j.child=V).return=j;C.sibling!==null;)C=C.sibling,(V=V.sibling=la(C,C.pendingProps)).return=j;V.sibling=null}return j.child}function hc(C,j){if(!Ho)switch(C.tailMode){case"hidden":j=C.tail;for(var V=null;j!==null;)j.alternate!==null&&(V=j),j=j.sibling;V===null?C.tail=null:V.sibling=null;break;case"collapsed":V=C.tail;for(var it=null;V!==null;)V.alternate!==null&&(it=V),V=V.sibling;it===null?j||C.tail===null?C.tail=null:C.tail.sibling=null:it.sibling=null}}function Jp(C,j){try{for(var V="",it=j;V+=function(st){switch(st.tag){case 5:return I(st.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return B(st.type,!1);case 11:return B(st.type.render,!1);case 22:return B(st.type._render,!1);case 1:return B(st.type,!0);default:return""}}(it),it=it.return;);var ot=V}catch(st){ot=`
|
|
107
|
+
`+ot[ut].replace(" at new "," at ");while(1<=ut&&0<=_t);break}}}finally{L=!1,Error.prepareStackTrace=V}return(C=C?C.displayName||C.name:"")?I(C):""}function Y(C){if(C==null)return null;if(typeof C=="function")return C.displayName||C.name||null;if(typeof C=="string")return C;switch(C){case P:return"Fragment";case D:return"Portal";case R:return"Profiler";case O:return"StrictMode";case $:return"Suspense";case M:return"SuspenseList"}if(typeof C=="object")switch(C.$$typeof){case z:return(C.displayName||"Context")+".Consumer";case A:return(C._context.displayName||"Context")+".Provider";case H:var j=(j=C.render).displayName||j.name||"";return C.displayName||(j!==""?"ForwardRef("+j+")":"ForwardRef");case J:return Y(C.type);case N:return Y(C._render);case K:j=C._payload,C=C._init;try{return Y(C(j))}catch{}}return null}function Z(C){switch(typeof C){case"boolean":case"number":case"object":case"string":case"undefined":return C;default:return""}}function rt(C){var j=C.type;return(C=C.nodeName)&&C.toLowerCase()==="input"&&(j==="checkbox"||j==="radio")}function Q(C){C._valueTracker||(C._valueTracker=function(j){var V,it,ot=rt(j)?"checked":"value",st=Object.getOwnPropertyDescriptor(j.constructor.prototype,ot),ut=""+j[ot];if(!j.hasOwnProperty(ot)&&st!==void 0&&typeof st.get=="function"&&typeof st.set=="function")return V=st.get,it=st.set,Object.defineProperty(j,ot,{configurable:!0,get:function(){return V.call(this)},set:function(_t){ut=""+_t,it.call(this,_t)}}),Object.defineProperty(j,ot,{enumerable:st.enumerable}),{getValue:function(){return ut},setValue:function(_t){ut=""+_t},stopTracking:function(){j._valueTracker=null,delete j[ot]}}}(C))}function tt(C){if(C){var j=C._valueTracker;if(!j)return 1;var V=j.getValue(),it="";return(C=it=C?rt(C)?C.checked?"true":"false":C.value:it)!==V&&(j.setValue(C),1)}}function nt(C){if((C=C||(typeof document<"u"?document:void 0))===void 0)return null;try{return C.activeElement||C.body}catch{return C.body}}function et(C,j){var V=j.checked;return e({},j,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:V??C._wrapperState.initialChecked})}function at(C,j){var V=j.defaultValue==null?"":j.defaultValue,it=j.checked!=null?j.checked:j.defaultChecked;V=Z(j.value!=null?j.value:V),C._wrapperState={initialChecked:it,initialValue:V,controlled:j.type==="checkbox"||j.type==="radio"?j.checked!=null:j.value!=null}}function ct(C,j){(j=j.checked)!=null&&x(C,"checked",j,!1)}function gt(C,j){ct(C,j);var V=Z(j.value),it=j.type;if(V!=null)it==="number"?(V===0&&C.value===""||C.value!=V)&&(C.value=""+V):C.value!==""+V&&(C.value=""+V);else if(it==="submit"||it==="reset")return void C.removeAttribute("value");j.hasOwnProperty("value")?St(C,j.type,V):j.hasOwnProperty("defaultValue")&&St(C,j.type,Z(j.defaultValue)),j.checked==null&&j.defaultChecked!=null&&(C.defaultChecked=!!j.defaultChecked)}function wt(C,j,V){if(j.hasOwnProperty("value")||j.hasOwnProperty("defaultValue")){var it=j.type;if(!(it!=="submit"&&it!=="reset"||j.value!==void 0&&j.value!==null))return;j=""+C._wrapperState.initialValue,V||j===C.value||(C.value=j),C.defaultValue=j}(V=C.name)!==""&&(C.name=""),C.defaultChecked=!!C._wrapperState.initialChecked,V!==""&&(C.name=V)}function St(C,j,V){j==="number"&&nt(C.ownerDocument)===C||(V==null?C.defaultValue=""+C._wrapperState.initialValue:C.defaultValue!==""+V&&(C.defaultValue=""+V))}function Mt(C,j){var V,it;return C=e({children:void 0},j),V=j.children,it="",n.Children.forEach(V,function(ot){ot!=null&&(it+=ot)}),(j=it)&&(C.children=j),C}function Lt(C,j,V,it){if(C=C.options,j){j={};for(var ot=0;ot<V.length;ot++)j["$"+V[ot]]=!0;for(V=0;V<C.length;V++)ot=j.hasOwnProperty("$"+C[V].value),C[V].selected!==ot&&(C[V].selected=ot),ot&&it&&(C[V].defaultSelected=!0)}else{for(V=""+Z(V),j=null,ot=0;ot<C.length;ot++){if(C[ot].value===V)return C[ot].selected=!0,void(it&&(C[ot].defaultSelected=!0));j!==null||C[ot].disabled||(j=C[ot])}j!==null&&(j.selected=!0)}}function Nt(C,j){if(j.dangerouslySetInnerHTML!=null)throw Error(i(91));return e({},j,{value:void 0,defaultValue:void 0,children:""+C._wrapperState.initialValue})}function yt(C,j){var V=j.value;if(V==null){if(V=j.children,j=j.defaultValue,V!=null){if(j!=null)throw Error(i(92));if(Array.isArray(V)){if(!(V.length<=1))throw Error(i(93));V=V[0]}j=V}V=j=j??""}C._wrapperState={initialValue:Z(V)}}function jt(C,j){var V=Z(j.value),it=Z(j.defaultValue);V!=null&&((V=""+V)!==C.value&&(C.value=V),j.defaultValue==null&&C.defaultValue!==V&&(C.defaultValue=V)),it!=null&&(C.defaultValue=""+it)}function At(C){var j=C.textContent;j===C._wrapperState.initialValue&&j!==""&&j!==null&&(C.value=j)}var It="http://www.w3.org/1999/xhtml";function Ot(C){switch(C){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Et(C,j){return C==null||C==="http://www.w3.org/1999/xhtml"?Ot(j):C==="http://www.w3.org/2000/svg"&&j==="foreignObject"?"http://www.w3.org/1999/xhtml":C}Pt=function(C,j){if(C.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in C)C.innerHTML=j;else{for((Ct=Ct||document.createElement("div")).innerHTML="<svg>"+j.valueOf().toString()+"</svg>",j=Ct.firstChild;C.firstChild;)C.removeChild(C.firstChild);for(;j.firstChild;)C.appendChild(j.firstChild)}};var Ct,Pt,ht=typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(C,j,V,it){MSApp.execUnsafeLocalFunction(function(){return Pt(C,j)})}:Pt;function dt(C,j){if(j){var V=C.firstChild;if(V&&V===C.lastChild&&V.nodeType===3)return void(V.nodeValue=j)}C.textContent=j}var Ft={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Jt=["Webkit","ms","Moz","O"];function Xt(C,j,V){return j==null||typeof j=="boolean"||j===""?"":V||typeof j!="number"||j===0||Ft.hasOwnProperty(C)&&Ft[C]?(""+j).trim():j+"px"}function Qt(C,j){for(var V in C=C.style,j){var it,ot;j.hasOwnProperty(V)&&(it=V.indexOf("--")===0,ot=Xt(V,j[V],it),V==="float"&&(V="cssFloat"),it?C.setProperty(V,ot):C[V]=ot)}}Object.keys(Ft).forEach(function(C){Jt.forEach(function(j){j=j+C.charAt(0).toUpperCase()+C.substring(1),Ft[j]=Ft[C]})});var _e=e({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function kt(C,j){if(j){if(_e[C]&&(j.children!=null||j.dangerouslySetInnerHTML!=null))throw Error(i(137,C));if(j.dangerouslySetInnerHTML!=null){if(j.children!=null)throw Error(i(60));if(typeof j.dangerouslySetInnerHTML!="object"||!("__html"in j.dangerouslySetInnerHTML))throw Error(i(61))}if(j.style!=null&&typeof j.style!="object")throw Error(i(62))}}function ee(C,j){if(C.indexOf("-")===-1)return typeof j.is=="string";switch(C){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function pe(C){return(C=(C=C.target||C.srcElement||window).correspondingUseElement?C.correspondingUseElement:C).nodeType===3?C.parentNode:C}var Be=null,Fe=null,qe=null;function ze(C){if(C=tc(C)){if(typeof Be!="function")throw Error(i(280));var j=C.stateNode;j&&(j=$u(j),Be(C.stateNode,C.type,j))}}function Re(C){Fe?qe?qe.push(C):qe=[C]:Fe=C}function He(){if(Fe){var C=Fe,j=qe;if(qe=Fe=null,ze(C),j)for(C=0;C<j.length;C++)ze(j[C])}}function hn(C,j){return C(j)}function Tt(C,j,V,it,ot){return C(j,V,it,ot)}function ae(){}var de=!1,Se=!1;function je(){Fe===null&&qe===null||(ae(),He())}function Rt(C,j){var V=C.stateNode;if(V===null)return null;var it=$u(V);if(it===null)return null;switch(V=it[j],j){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":C=!(it=(it=!it.disabled)?it:!((C=C.type)==="button"||C==="input"||C==="select"||C==="textarea"));break;default:C=!1}if(C)return null;if(V&&typeof V!="function")throw Error(i(231,j,typeof V));return V}var Ut=!1;if(t)try{var se={};Object.defineProperty(se,"passive",{get:function(){Ut=!0}}),window.addEventListener("test",se,se),window.removeEventListener("test",se,se)}catch{Ut=!1}var bt=!1,ft=null,xt=!1,Bt=null,ce={onError:function(C){bt=!0,ft=C}};function Ee(C,j,V,it,ot,st,ut,_t,mt){bt=!1,ft=null,(function(Ht,ie,ue,De,mn,Kt,re,me,Le){var Me=Array.prototype.slice.call(arguments,3);try{ie.apply(ue,Me)}catch(Ze){this.onError(Ze)}}).apply(ce,arguments)}function Ae(C){var j=C,V=C;if(C.alternate)for(;j.return;)j=j.return;else for(C=j;1026&(j=C).flags&&(V=j.return),C=j.return;);return j.tag===3?V:null}function Ie(C){if(C.tag===13){var j=C.memoizedState;if(j===null&&(C=C.alternate)!==null&&(j=C.memoizedState),j!==null)return j.dehydrated}return null}function Ge(C){if(Ae(C)!==C)throw Error(i(188))}function ve(C){if(!(C=function(V){var it=V.alternate;if(!it){if((it=Ae(V))===null)throw Error(i(188));return it!==V?null:V}for(var ot=V,st=it;;){var ut=ot.return;if(ut===null)break;var _t=ut.alternate;if(_t===null){if((st=ut.return)===null)break;ot=st}else{if(ut.child===_t.child){for(_t=ut.child;_t;){if(_t===ot)return Ge(ut),V;if(_t===st)return Ge(ut),it;_t=_t.sibling}throw Error(i(188))}if(ot.return!==st.return)ot=ut,st=_t;else{for(var mt=!1,Ht=ut.child;Ht;){if(Ht===ot){mt=!0,ot=ut,st=_t;break}if(Ht===st){mt=!0,st=ut,ot=_t;break}Ht=Ht.sibling}if(!mt){for(Ht=_t.child;Ht;){if(Ht===ot){mt=!0,ot=_t,st=ut;break}if(Ht===st){mt=!0,st=_t,ot=ut;break}Ht=Ht.sibling}if(!mt)throw Error(i(189))}}if(ot.alternate!==st)throw Error(i(190))}}if(ot.tag!==3)throw Error(i(188));return ot.stateNode.current===ot?V:it}(C)))return null;for(var j=C;;){if(j.tag===5||j.tag===6)return j;if(j.child)j=(j.child.return=j).child;else{if(j===C)break;for(;!j.sibling;){if(!j.return||j.return===C)return null;j=j.return}j.sibling.return=j.return,j=j.sibling}}return null}function pt(C,j){for(var V=C.alternate;j!==null;){if(j===C||j===V)return 1;j=j.return}}var Dt,$t,qt,Vt=!1,oe=[],X=null,lt=null,vt=null,Wt=new Map,te=new Map,Zt=[],Yt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function ye(C,j,V,it,ot){return{blockedOn:C,domEventName:j,eventSystemFlags:16|V,nativeEvent:ot,targetContainers:[it]}}function ke(C,j){switch(C){case"focusin":case"focusout":X=null;break;case"dragenter":case"dragleave":lt=null;break;case"mouseover":case"mouseout":vt=null;break;case"pointerover":case"pointerout":Wt.delete(j.pointerId);break;case"gotpointercapture":case"lostpointercapture":te.delete(j.pointerId)}}function Ue(C,j,V,it,ot,st){return C===null||C.nativeEvent!==st?(C=ye(j,V,it,ot,st),j===null||(j=tc(j))!==null&&$t(j)):(C.eventSystemFlags|=it,j=C.targetContainers,ot!==null&&j.indexOf(ot)===-1&&j.push(ot)),C}function Pe(C){if(C.blockedOn===null){for(var j=C.targetContainers;0<j.length;){var V=Ro(C.domEventName,C.eventSystemFlags,j[0],C.nativeEvent);if(V!==null)return(j=tc(V))!==null&&$t(j),C.blockedOn=V,0;j.shift()}return 1}}function Ve(C,j,V){Pe(C)&&V.delete(j)}function nn(){for(Vt=!1;0<oe.length;){var C=oe[0];if(C.blockedOn!==null){(C=tc(C.blockedOn))!==null&&Dt(C);break}for(var j=C.targetContainers;0<j.length;){var V=Ro(C.domEventName,C.eventSystemFlags,j[0],C.nativeEvent);if(V!==null){C.blockedOn=V;break}j.shift()}C.blockedOn===null&&oe.shift()}X!==null&&Pe(X)&&(X=null),lt!==null&&Pe(lt)&&(lt=null),vt!==null&&Pe(vt)&&(vt=null),Wt.forEach(Ve),te.forEach(Ve)}function cn(C,j){C.blockedOn===j&&(C.blockedOn=null,Vt||(Vt=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,nn)))}function Nn(C){function j(ot){return cn(ot,C)}if(0<oe.length){cn(oe[0],C);for(var V=1;V<oe.length;V++){var it=oe[V];it.blockedOn===C&&(it.blockedOn=null)}}for(X!==null&&cn(X,C),lt!==null&&cn(lt,C),vt!==null&&cn(vt,C),Wt.forEach(j),te.forEach(j),V=0;V<Zt.length;V++)(it=Zt[V]).blockedOn===C&&(it.blockedOn=null);for(;0<Zt.length&&(V=Zt[0]).blockedOn===null;)(function(ot){var st=$a(ot.target);if(st!==null){var ut=Ae(st);if(ut!==null){if((st=ut.tag)===13){if((st=Ie(ut))!==null)return ot.blockedOn=st,ot.lanePriority,s.unstable_runWithPriority(ot.priority,function(){qt(ut)})}else if(st===3&&ut.stateNode.hydrate)return ot.blockedOn=ut.tag===3?ut.stateNode.containerInfo:null}}ot.blockedOn=null})(V),V.blockedOn===null&&Zt.shift()}function un(C,j){var V={};return V[C.toLowerCase()]=j.toLowerCase(),V["Webkit"+C]="webkit"+j,V["Moz"+C]="moz"+j,V}var bn={animationend:un("Animation","AnimationEnd"),animationiteration:un("Animation","AnimationIteration"),animationstart:un("Animation","AnimationStart"),transitionend:un("Transition","TransitionEnd")},In={},Fn={};function tr(C){if(In[C])return In[C];if(!bn[C])return C;var j,V=bn[C];for(j in V)if(V.hasOwnProperty(j)&&j in Fn)return In[C]=V[j];return C}t&&(Fn=document.createElement("div").style,"AnimationEvent"in window||(delete bn.animationend.animation,delete bn.animationiteration.animation,delete bn.animationstart.animation),"TransitionEvent"in window||delete bn.transitionend.transition);var er=tr("animationend"),Oa=tr("animationiteration"),Hi=tr("animationstart"),ro=tr("transitionend"),Br=new Map,Vr=new Map,Sn=["abort","abort",er,"animationEnd",Oa,"animationIteration",Hi,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",ro,"transitionEnd","waiting","waiting"];function qi(C,j){for(var V=0;V<C.length;V+=2){var it=C[V],ot="on"+((ot=C[V+1])[0].toUpperCase()+ot.slice(1));Vr.set(it,j),Br.set(it,ot),a(ot,[it])}}(0,s.unstable_now)();var gn=8;function Rn(C){if(1&C)return gn=15,1;if(2&C)return gn=14,2;if(4&C)return gn=13,4;var j=24&C;return j!==0?(gn=12,j):32&C?(gn=11,32):(j=192&C)!=0?(gn=10,j):256&C?(gn=9,256):(j=3584&C)!=0?(gn=8,j):4096&C?(gn=7,4096):(j=4186112&C)!=0?(gn=6,j):(j=62914560&C)!=0?(gn=5,j):67108864&C?(gn=4,67108864):134217728&C?(gn=3,134217728):(j=805306368&C)!=0?(gn=2,j):1073741824&C?(gn=1,1073741824):(gn=8,C)}function Io(C,j){var V=C.pendingLanes;if(V===0)return gn=0;var it,ot=0,st=0,ut=C.expiredLanes,_t=C.suspendedLanes,mt=C.pingedLanes;if(ut!==0?(ot=ut,st=gn=15):(ut=134217727&V)!=0?(it=ut&~_t)!=0?(ot=Rn(it),st=gn):(mt&=ut)!=0&&(ot=Rn(mt),st=gn):(ut=V&~_t)!=0?(ot=Rn(ut),st=gn):mt!==0&&(ot=Rn(mt),st=gn),ot===0)return 0;if(ot=V&(((ot=31-xo(ot))<0?0:1<<ot)<<1)-1,j!==0&&j!==ot&&!(j&_t)){if(Rn(j),st<=gn)return j;gn=st}if((j=C.entangledLanes)!==0)for(C=C.entanglements,j&=ot;0<j;)ot|=C[V=31-xo(j)],j&=~(st=1<<V);return ot}function Pr(C){return(C=-1073741825&C.pendingLanes)!=0?C:1073741824&C?1073741824:0}function oo(C,j){switch(C){case 15:return 1;case 14:return 2;case 12:return(C=Fr(24&~j))===0?oo(10,j):C;case 10:return(C=Fr(192&~j))===0?oo(8,j):C;case 8:return(C=Fr(3584&~j))===0&&(C=Fr(4186112&~j))===0&&(C=512),C;case 2:return(j=Fr(805306368&~j))===0?268435456:j}throw Error(i(358,C))}function Fr(C){return C&-C}function xr(C){for(var j=[],V=0;V<31;V++)j.push(C);return j}function Ta(C,j,V){C.pendingLanes|=j;var it=j-1;C.suspendedLanes&=it,C.pingedLanes&=it,(C=C.eventTimes)[j=31-xo(j)]=V}var xo=Math.clz32||function(C){return C===0?32:31-(Wr(C)/_n|0)|0},Wr=Math.log,_n=Math.LN2,Mu=s.unstable_UserBlockingPriority,Jl=s.unstable_runWithPriority,Kr=!0;function Du(C,j,V,it){de||ae();var ot=ja,st=de;de=!0;try{Tt(ot,C,j,V,it)}finally{(de=st)||je()}}function Vl(C,j,V,it){Jl(Mu,ja.bind(null,C,j,V,it))}function ja(C,j,V,it){var ot;if(Kr)if((ot=!(4&j))&&0<oe.length&&-1<Yt.indexOf(C))C=ye(null,C,j,V,it),oe.push(C);else{var st=Ro(C,j,V,it);if(st===null)ot&&ke(C,it);else{if(ot){if(-1<Yt.indexOf(C))return C=ye(st,C,j,V,it),void oe.push(C);if(function(ut,_t,mt,Ht,ie){switch(_t){case"focusin":return X=Ue(X,ut,_t,mt,Ht,ie),1;case"dragenter":return lt=Ue(lt,ut,_t,mt,Ht,ie),1;case"mouseover":return vt=Ue(vt,ut,_t,mt,Ht,ie),1;case"pointerover":var ue=ie.pointerId;return Wt.set(ue,Ue(Wt.get(ue)||null,ut,_t,mt,Ht,ie)),1;case"gotpointercapture":return ue=ie.pointerId,te.set(ue,Ue(te.get(ue)||null,ut,_t,mt,Ht,ie)),1}}(st,C,j,V,it))return;ke(C,it)}Ty(C,j,it,null,V)}}}function Ro(C,j,V,it){var ot=pe(it);if((ot=$a(ot))!==null){var st=Ae(ot);if(st===null)ot=null;else{var ut=st.tag;if(ut===13){if((ot=Ie(st))!==null)return ot;ot=null}else if(ut===3){if(st.stateNode.hydrate)return st.tag===3?st.stateNode.containerInfo:null;ot=null}else st!==ot&&(ot=null)}}return Ty(C,j,it,ot,V),null}var Mo=null,Do=null,ci=null;function Ls(){if(ci)return ci;for(var C=Do,j=C.length,V=("value"in Mo)?Mo.value:Mo.textContent,it=V.length,ot=0;ot<j&&C[ot]===V[ot];ot++);for(var st=j-ot,ut=1;ut<=st&&C[j-ut]===V[it-ut];ut++);return ci=V.slice(ot,1<ut?1-ut:void 0)}function Bs(C){var j=C.keyCode;return"charCode"in C?(C=C.charCode)===0&&j===13&&(C=13):C=j,32<=(C=C===10?13:C)||C===13?C:0}function Aa(){return!0}function Pa(){return!1}function mr(C){function j(V,it,ot,st,ut){for(var _t in this._reactName=V,this._targetInst=ot,this.type=it,this.nativeEvent=st,this.target=ut,this.currentTarget=null,C)C.hasOwnProperty(_t)&&(V=C[_t],this[_t]=V?V(st):st[_t]);return this.isDefaultPrevented=(st.defaultPrevented!=null?st.defaultPrevented:st.returnValue===!1)?Aa:Pa,this.isPropagationStopped=Pa,this}return e(j.prototype,{preventDefault:function(){this.defaultPrevented=!0;var V=this.nativeEvent;V&&(V.preventDefault?V.preventDefault():typeof V.returnValue!="unknown"&&(V.returnValue=!1),this.isDefaultPrevented=Aa)},stopPropagation:function(){var V=this.nativeEvent;V&&(V.stopPropagation?V.stopPropagation():typeof V.cancelBubble!="unknown"&&(V.cancelBubble=!0),this.isPropagationStopped=Aa)},persist:function(){},isPersistent:Aa}),j}se={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(C){return C.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0};var Na,Ia,ui,di=mr(se),Fs=mr(fr=e({},se,{view:0,detail:0})),Hn=e({},fr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ji,button:0,buttons:0,relatedTarget:function(C){return C.relatedTarget===void 0?C.fromElement===C.srcElement?C.toElement:C.fromElement:C.relatedTarget},movementX:function(C){return"movementX"in C?C.movementX:(C!==ui&&(Ia=ui&&C.type==="mousemove"?(Na=C.screenX-ui.screenX,C.screenY-ui.screenY):Na=0,ui=C),Na)},movementY:function(C){return"movementY"in C?C.movementY:Ia}}),fi=mr(Hn),Ra=mr(e({},Hn,{dataTransfer:0})),Nr=mr(e({},fr,{relatedTarget:0})),Ma=mr(e({},se,{animationName:0,elapsedTime:0,pseudoElement:0})),Lo=mr(e({},se,{clipboardData:function(C){return("clipboardData"in C?C:window).clipboardData}})),wo=mr(e({},se,{data:0})),Bo={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Da={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},So={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fo(C){var j=this.nativeEvent;return j.getModifierState?j.getModifierState(C):!!(C=So[C])&&!!j[C]}function Ji(){return Fo}var Vi=mr(e({},fr,{key:function(C){if(C.key){var j=Bo[C.key]||C.key;if(j!=="Unidentified")return j}return C.type==="keypress"?(C=Bs(C))===13?"Enter":String.fromCharCode(C):C.type==="keydown"||C.type==="keyup"?Da[C.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ji,charCode:function(C){return C.type==="keypress"?Bs(C):0},keyCode:function(C){return C.type==="keydown"||C.type==="keyup"?C.keyCode:0},which:function(C){return C.type==="keypress"?Bs(C):C.type==="keydown"||C.type==="keyup"?C.keyCode:0}})),La=mr(e({},Hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),zs=mr(e({},fr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ji})),pi=mr(e({},se,{propertyName:0,elapsedTime:0,pseudoElement:0})),Us=mr(e({},Hn,{deltaX:function(C){return"deltaX"in C?C.deltaX:"wheelDeltaX"in C?-C.wheelDeltaX:0},deltaY:function(C){return"deltaY"in C?C.deltaY:"wheelDeltaY"in C?-C.wheelDeltaY:"wheelDelta"in C?-C.wheelDelta:0},deltaZ:0,deltaMode:0})),Lu=[9,13,27,32],Ba=t&&"CompositionEvent"in window,fr=null,Fa=(t&&"documentMode"in document&&(fr=document.documentMode),t&&"TextEvent"in window&&!fr),Wi=t&&(!Ba||fr&&8<fr&&fr<=11),za=String.fromCharCode(32),Wl=!1;function Kl(C,j){switch(C){case"keyup":return Lu.indexOf(j.keyCode)!==-1;case"keydown":return j.keyCode!==229;case"keypress":case"mousedown":case"focusout":return 1;default:return}}function zo(C){return typeof(C=C.detail)=="object"&&"data"in C?C.data:null}var hi=!1,Ki={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function $s(C){var j=C&&C.nodeName&&C.nodeName.toLowerCase();return j==="input"?Ki[C.type]:j==="textarea"}function Ua(C,j,V,it){Re(it),0<(j=Fu(j,"onChange")).length&&(V=new di("onChange","change",null,V,it),C.push({event:V,listeners:j}))}var zt=null,ne=null;function fe(C){Sy(C,0)}function Te(C){if(tt(Ws(C)))return C}function sn(C,j){if(C==="change")return j}var tn=!1;function en(){zt&&(zt.detachEvent("onpropertychange",We),ne=zt=null)}function We(C){if(C.propertyName==="value"&&Te(ne)){var j=[];if(Ua(j,ne,C,pe(C)),C=fe,de)C(j);else{de=!0;try{hn(C,j)}finally{de=!1,je()}}}}function qn(C,j,V){C==="focusin"?(en(),ne=V,(zt=j).attachEvent("onpropertychange",We)):C==="focusout"&&en()}function lr(C){if(C==="selectionchange"||C==="keyup"||C==="keydown")return Te(ne)}function Gl(C,j){if(C==="click")return Te(j)}function Bu(C,j){if(C==="input"||C==="change")return Te(j)}t&&(fr=t&&((se="oninput"in document)||((Hn=document.createElement("div")).setAttribute("oninput","return;"),se=typeof Hn.oninput=="function"),se),tn=fr&&(!document.documentMode||9<document.documentMode));var nr=typeof Object.is=="function"?Object.is:function(C,j){return C===j&&(C!==0||1/C==1/j)||C!=C&&j!=j},Q2=Object.prototype.hasOwnProperty;function Yl(C,j){if(nr(C,j))return!0;if(typeof C!="object"||C===null||typeof j!="object"||j===null)return!1;var V=Object.keys(C),it=Object.keys(j);if(V.length!==it.length)return!1;for(it=0;it<V.length;it++)if(!Q2.call(j,V[it])||!nr(C[V[it]],j[V[it]]))return!1;return!0}function my(C){for(;C&&C.firstChild;)C=C.firstChild;return C}function yy(C,j){var V,it=my(C);for(C=0;it;){if(it.nodeType===3){if(V=C+it.textContent.length,C<=j&&j<=V)return{node:it,offset:j-C};C=V}t:{for(;it;){if(it.nextSibling){it=it.nextSibling;break t}it=it.parentNode}it=void 0}it=my(it)}}function by(){for(var C=window,j=nt();j instanceof C.HTMLIFrameElement;){try{var V=typeof j.contentWindow.location.href=="string"}catch{V=!1}if(!V)break;j=nt((C=j.contentWindow).document)}return j}function lp(C){var j=C&&C.nodeName&&C.nodeName.toLowerCase();return j&&(j==="input"&&(C.type==="text"||C.type==="search"||C.type==="tel"||C.type==="url"||C.type==="password")||j==="textarea"||C.contentEditable==="true")}var X2=t&&"documentMode"in document&&document.documentMode<=11,Hs=null,cp=null,Zl=null,up=!1;function vy(C,j,V){var it=V.window===V?V.document:V.nodeType===9?V:V.ownerDocument;up||Hs==null||Hs!==nt(it)||(it="selectionStart"in(it=Hs)&&lp(it)?{start:it.selectionStart,end:it.selectionEnd}:{anchorNode:(it=(it.ownerDocument&&it.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:it.anchorOffset,focusNode:it.focusNode,focusOffset:it.focusOffset},Zl&&Yl(Zl,it)||(Zl=it,0<(it=Fu(cp,"onSelect")).length&&(j=new di("onSelect","select",null,j,V),C.push({event:j,listeners:it}),j.target=Hs)))}qi("cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focusin focus focusout blur input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),qi("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),qi(Sn,2);for(var _y="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),dp=0;dp<_y.length;dp++)Vr.set(_y[dp],0);c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),a("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),a("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),a("onBeforeInput",["compositionend","keypress","textInput","paste"]),a("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),a("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ql="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),xy=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ql));function wy(C,j,V){var it=C.type||"unknown-event";C.currentTarget=V,function(){var ot;Ee.apply(this,arguments),bt&&(ot=ft,bt=!1,ft=null,xt||(xt=!0,Bt=ot))}(it,j,void 0,C),C.currentTarget=null}function Sy(C,j){j=!!(4&j);for(var V=0;V<C.length;V++){var it=(ot=C[V]).event,ot=ot.listeners;t:{var st=void 0;if(j)for(var ut=ot.length-1;0<=ut;ut--){var _t=(Ht=ot[ut]).instance,mt=Ht.currentTarget,Ht=Ht.listener;if(_t!==st&&it.isPropagationStopped())break t;wy(it,Ht,mt),st=_t}else for(ut=0;ut<ot.length;ut++){if(_t=(Ht=ot[ut]).instance,mt=Ht.currentTarget,Ht=Ht.listener,_t!==st&&it.isPropagationStopped())break t;wy(it,Ht,mt),st=_t}}}if(xt)throw C=Bt,xt=!1,Bt=null,C}function Mn(C,j){var V=Ry(j),it=C+"__bubble";V.has(it)||(Oy(j,C,2,!1),V.add(it))}var Cy="_reactListening"+Math.random().toString(36).slice(2);function Ey(C){C[Cy]||(C[Cy]=!0,l.forEach(function(j){xy.has(j)||ky(j,!1,C,null),ky(j,!0,C,null)}))}function ky(C,j,V,it,ot){ot=4<arguments.length&&ot!==void 0?ot:0;var st=V;if(C==="selectionchange"&&V.nodeType!==9&&(st=V.ownerDocument),it!==null&&!j&&xy.has(C)){if(C!=="scroll")return;ot|=2,st=it}it=C+"__"+(j?"capture":"bubble"),(V=Ry(st)).has(it)||(j&&(ot|=4),Oy(st,C,ot,j),V.add(it))}function Oy(C,j,V,it){var ot=Vr.get(j);switch(ot===void 0?2:ot){case 0:ot=Du;break;case 1:ot=Vl;break;default:ot=ja}V=ot.bind(null,j,V,C),ot=!(!Ut||j!=="touchstart"&&j!=="touchmove"&&j!=="wheel")||void 0,it?ot!==void 0?C.addEventListener(j,V,{capture:!0,passive:ot}):C.addEventListener(j,V,!0):ot!==void 0?C.addEventListener(j,V,{passive:ot}):C.addEventListener(j,V,!1)}function Ty(C,j,V,it,ot){var st=it;if(!(1&j||2&j||it===null))t:for(;;){if(it===null)return;var ut=it.tag;if(ut===3||ut===4){var _t=it.stateNode.containerInfo;if(_t===ot||_t.nodeType===8&&_t.parentNode===ot)break;if(ut===4)for(ut=it.return;ut!==null;){var mt=ut.tag;if((mt===3||mt===4)&&((mt=ut.stateNode.containerInfo)===ot||mt.nodeType===8&&mt.parentNode===ot))return;ut=ut.return}for(;_t!==null;){if((ut=$a(_t))===null)return;if((mt=ut.tag)===5||mt===6){it=st=ut;continue t}_t=_t.parentNode}}it=it.return}var Ht=function(){var ue,De,mn,Kt=st,re=pe(V),me=[];t:{var Le=Br.get(C);if(Le!==void 0){var Me=di,Ze=C;switch(C){case"keypress":if(Bs(V)===0)break t;case"keydown":case"keyup":Me=Vi;break;case"focusin":Ze="focus",Me=Nr;break;case"focusout":Ze="blur",Me=Nr;break;case"beforeblur":case"afterblur":Me=Nr;break;case"click":if(V.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Me=fi;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Me=Ra;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Me=zs;break;case er:case Oa:case Hi:Me=Ma;break;case ro:Me=pi;break;case"scroll":Me=Fs;break;case"wheel":Me=Us;break;case"copy":case"cut":case"paste":Me=Lo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Me=La}for(var ln=!(Qe=!!(4&j))&&C==="scroll",Xe=Qe?Le!==null?Le+"Capture":null:Le,Qe=[],wn=Kt;wn!==null;){var On,An=(On=wn).stateNode;if(On.tag===5&&An!==null&&(On=An,Xe!==null&&(An=Rt(wn,Xe))!=null&&Qe.push(Xl(wn,An,On))),ln)break;wn=wn.return}0<Qe.length&&(Le=new Me(Le,Ze,null,V,re),me.push({event:Le,listeners:Qe}))}}if(!(7&j)){if(Me=C==="mouseout"||C==="pointerout",(!(Le=C==="mouseover"||C==="pointerover")||16&j||!(Ze=V.relatedTarget||V.fromElement)||!$a(Ze)&&!Ze[Vs])&&(Me||Le)&&(Le=re.window===re?re:(Le=re.ownerDocument)?Le.defaultView||Le.parentWindow:window,Me?(Me=Kt,(Ze=(Ze=V.relatedTarget||V.toElement)?$a(Ze):null)!==null&&(Ze!==(ln=Ae(Ze))||Ze.tag!==5&&Ze.tag!==6)&&(Ze=null)):(Me=null,Ze=Kt),Me!==Ze)){if(Qe=fi,An="onMouseLeave",Xe="onMouseEnter",wn="mouse",C!=="pointerout"&&C!=="pointerover"||(Qe=La,An="onPointerLeave",Xe="onPointerEnter",wn="pointer"),ln=Me==null?Le:Ws(Me),On=Ze==null?Le:Ws(Ze),(Le=new Qe(An,wn+"leave",Me,V,re)).target=ln,Le.relatedTarget=On,An=null,$a(re)===Kt&&((Qe=new Qe(Xe,wn+"enter",Ze,V,re)).target=On,Qe.relatedTarget=ln,An=Qe),ln=An,Me&&Ze)t:{for(Xe=Ze,wn=0,On=Qe=Me;On;On=qs(On))wn++;for(On=0,An=Xe;An;An=qs(An))On++;for(;0<wn-On;)Qe=qs(Qe),wn--;for(;0<On-wn;)Xe=qs(Xe),On--;for(;wn--;){if(Qe===Xe||Xe!==null&&Qe===Xe.alternate)break t;Qe=qs(Qe),Xe=qs(Xe)}Qe=null}else Qe=null;Me!==null&&jy(me,Le,Me,Qe,!1),Ze!==null&&ln!==null&&jy(me,ln,Ze,Qe,!0)}switch((Me=(Le=Kt?Ws(Kt):window).nodeName&&Le.nodeName.toLowerCase())==="select"||Me==="input"&&Le.type==="file"?ue=sn:$s(Le)?tn?ue=Bu:(ue=lr,De=qn):!(Me=Le.nodeName)||Me.toLowerCase()!=="input"||Le.type!=="checkbox"&&Le.type!=="radio"||(ue=Gl),(ue=ue&&ue(C,Kt))?Ua(me,ue,V,re):(De&&De(C,Le,Kt),C==="focusout"&&(De=Le._wrapperState)&&De.controlled&&Le.type==="number"&&St(Le,"number",Le.value)),De=Kt?Ws(Kt):window,C){case"focusin":!$s(De)&&De.contentEditable!=="true"||(Hs=De,cp=Kt,Zl=null);break;case"focusout":Zl=cp=Hs=null;break;case"mousedown":up=!0;break;case"contextmenu":case"mouseup":case"dragend":up=!1,vy(me,V,re);break;case"selectionchange":if(X2)break;case"keydown":case"keyup":vy(me,V,re)}if(Ba)t:{switch(C){case"compositionstart":var pn="onCompositionStart";break t;case"compositionend":pn="onCompositionEnd";break t;case"compositionupdate":pn="onCompositionUpdate";break t}pn=void 0}else hi?Kl(C,V)&&(pn="onCompositionEnd"):C==="keydown"&&V.keyCode===229&&(pn="onCompositionStart");pn&&(Wi&&V.locale!=="ko"&&(hi||pn!=="onCompositionStart"?pn==="onCompositionEnd"&&hi&&(mn=Ls()):(Do="value"in(Mo=re)?Mo.value:Mo.textContent,hi=!0)),0<(De=Fu(Kt,pn)).length&&(pn=new wo(pn,C,null,V,re),me.push({event:pn,listeners:De}),(mn||(mn=zo(V))!==null)&&(pn.data=mn))),(mn=(Fa?function(yn,dn){switch(yn){case"compositionend":return zo(dn);case"keypress":return dn.which!==32?null:(Wl=!0,za);case"textInput":return(yn=dn.data)===za&&Wl?null:yn;default:return null}}:function(yn,dn){if(hi)return yn==="compositionend"||!Ba&&Kl(yn,dn)?(yn=Ls(),ci=Do=Mo=null,hi=!1,yn):null;switch(yn){case"paste":default:return null;case"keypress":if(!(dn.ctrlKey||dn.altKey||dn.metaKey)||dn.ctrlKey&&dn.altKey){if(dn.char&&1<dn.char.length)return dn.char;if(dn.which)return String.fromCharCode(dn.which)}return null;case"compositionend":return Wi&&dn.locale!=="ko"?null:dn.data}})(C,V))&&0<(Kt=Fu(Kt,"onBeforeInput")).length&&(re=new wo("onBeforeInput","beforeinput",null,V,re),me.push({event:re,listeners:Kt}),re.data=mn)}Sy(me,j)},ie=void 0;if(Se)Ht();else{Se=!0;try{xC(Ht,ie)}finally{Se=!1,je()}}}function Xl(C,j,V){return{instance:C,listener:j,currentTarget:V}}function Fu(C,j){for(var V=j+"Capture",it=[];C!==null;){var ot=C,st=ot.stateNode;ot.tag===5&&st!==null&&(ot=st,(st=Rt(C,V))!=null&&it.unshift(Xl(C,st,ot)),(st=Rt(C,j))!=null&&it.push(Xl(C,st,ot))),C=C.return}return it}function qs(C){if(C===null)return null;for(;(C=C.return)&&C.tag!==5;);return C||null}function jy(C,j,V,it,ot){for(var st=j._reactName,ut=[];V!==null&&V!==it;){var _t=V,mt=_t.alternate,Ht=_t.stateNode;if(mt!==null&&mt===it)break;_t.tag===5&&Ht!==null&&(_t=Ht,ot?(mt=Rt(V,st))!=null&&ut.unshift(Xl(V,mt,_t)):(mt=Rt(V,st))!=null&&ut.push(Xl(V,mt,_t))),V=V.return}ut.length!==0&&C.push({event:j,listeners:ut})}function zu(){}var fp=null,pp=null;function Ay(C,j){switch(C){case"button":case"input":case"select":case"textarea":return j.autoFocus}}function hp(C,j){return C==="textarea"||C==="option"||C==="noscript"||typeof j.children=="string"||typeof j.children=="number"||typeof j.dangerouslySetInnerHTML=="object"&&j.dangerouslySetInnerHTML!==null&&j.dangerouslySetInnerHTML.__html!=null}var Py=typeof setTimeout=="function"?setTimeout:void 0,tC=typeof clearTimeout=="function"?clearTimeout:void 0;function gp(C){(C.nodeType===1||C.nodeType===9&&(C=C.body)!=null)&&(C.textContent="")}function Js(C){for(;C!=null;C=C.nextSibling){var j=C.nodeType;if(j===1||j===3)break}return C}function Ny(C){C=C.previousSibling;for(var j=0;C;){if(C.nodeType===8){var V=C.data;if(V==="$"||V==="$!"||V==="$?"){if(j===0)return C;j--}else V==="/$"&&j++}C=C.previousSibling}return null}var mp=0,Gi="__reactFiber$"+(Hn=Math.random().toString(36).slice(2)),Uu="__reactProps$"+Hn,Vs="__reactContainer$"+Hn,Iy="__reactEvents$"+Hn;function $a(C){var j=C[Gi];if(j)return j;for(var V=C.parentNode;V;){if(j=V[Vs]||V[Gi]){if(V=j.alternate,j.child!==null||V!==null&&V.child!==null)for(C=Ny(C);C!==null;){if(V=C[Gi])return V;C=Ny(C)}return j}V=(C=V).parentNode}return null}function tc(C){return!(C=C[Gi]||C[Vs])||C.tag!==5&&C.tag!==6&&C.tag!==13&&C.tag!==3?null:C}function Ws(C){if(C.tag===5||C.tag===6)return C.stateNode;throw Error(i(33))}function $u(C){return C[Uu]||null}function Ry(C){var j=C[Iy];return j===void 0?C[Iy]=new Set:j}var yp=[],ec=-1;function Yi(C){return{current:C}}function zn(C){ec<0||(C.current=yp[ec],yp[ec]=null,ec--)}function Kn(C,j){yp[++ec]=C.current,C.current=j}var Zi={},wr=Yi(Zi),zr=Yi(!1),Ha=Zi;function Ks(C,j){var V=C.type.contextTypes;if(!V)return Zi;var it=C.stateNode;if(it&&it.__reactInternalMemoizedUnmaskedChildContext===j)return it.__reactInternalMemoizedMaskedChildContext;var ot,st={};for(ot in V)st[ot]=j[ot];return it&&((C=C.stateNode).__reactInternalMemoizedUnmaskedChildContext=j,C.__reactInternalMemoizedMaskedChildContext=st),st}function Gr(C){return C.childContextTypes!=null}function bp(){zn(zr),zn(wr)}function My(C,j,V){if(wr.current!==Zi)throw Error(i(168));Kn(wr,j),Kn(zr,V)}function Dy(C,j,V){var it,ot=C.stateNode;if(C=j.childContextTypes,typeof ot.getChildContext!="function")return V;for(it in ot=ot.getChildContext())if(!(it in C))throw Error(i(108,Y(j)||"Unknown",it));return e({},V,ot)}function Hu(C){C=(C=C.stateNode)&&C.__reactInternalMemoizedMergedChildContext||Zi,Ha=wr.current,Kn(wr,C),Kn(zr,zr.current)}function Ly(C,j,V){var it=C.stateNode;if(!it)throw Error(i(169));V?(C=Dy(C,j,Ha),it.__reactInternalMemoizedMergedChildContext=C,zn(zr),zn(wr),Kn(wr,C)):zn(zr),Kn(zr,V)}var vp=null,qa=null,eC=s.unstable_runWithPriority,_p=s.unstable_scheduleCallback,xp=s.unstable_cancelCallback,nC=s.unstable_shouldYield,wp=(se=s.unstable_requestPaint,s.unstable_now),rC=s.unstable_getCurrentPriorityLevel,qu=s.unstable_ImmediatePriority,By=s.unstable_UserBlockingPriority,Fy=s.unstable_NormalPriority,zy=s.unstable_LowPriority,Uy=s.unstable_IdlePriority,Sp={},oC=se!==void 0?se:function(){},gi=null,Ju=null,Cp=!1,$y=wp(),Sr=$y<1e4?wp:function(){return wp()-$y};function Gs(){switch(rC()){case qu:return 99;case By:return 98;case Fy:return 97;case zy:return 96;case Uy:return 95;default:throw Error(i(332))}}function Hy(C){switch(C){case 99:return qu;case 98:return By;case 97:return Fy;case 96:return zy;case 95:return Uy;default:throw Error(i(332))}}function Ja(C,j){return C=Hy(C),eC(C,j)}function nc(C,j,V){return C=Hy(C),_p(C,j,V)}function Uo(){var C;Ju!==null&&(C=Ju,Ju=null,xp(C)),qy()}function qy(){if(!Cp&&gi!==null){Cp=!0;var C=0;try{var j=gi;Ja(99,function(){for(;C<j.length;C++)for(var V=j[C];(V=V(!0))!==null;);}),gi=null}catch(V){throw gi!==null&&(gi=gi.slice(C+1)),_p(qu,Uo),V}finally{Cp=!1}}}var iC=E.ReactCurrentBatchConfig;function Co(C,j){if(C&&C.defaultProps){for(var V in j=e({},j),C=C.defaultProps)j[V]===void 0&&(j[V]=C[V]);return j}return j}var Vu=Yi(null),Wu=null,Ys=null,Ku=null;function Ep(){Ku=Ys=Wu=null}function kp(C){var j=Vu.current;zn(Vu),C.type._context._currentValue=j}function Jy(C,j){for(;C!==null;){var V=C.alternate;if((C.childLanes&j)===j){if(V===null||(V.childLanes&j)===j)break;V.childLanes|=j}else C.childLanes|=j,V!==null&&(V.childLanes|=j);C=C.return}}function Zs(C,j){(Ku=Ys=null)!==(C=(Wu=C).dependencies)&&C.firstContext!==null&&(C.lanes&j&&(Eo=!0),C.firstContext=null)}function io(C,j){if(Ku!==C&&j!==!1&&j!==0)if(typeof j=="number"&&j!==1073741823||(Ku=C,j=1073741823),j={context:C,observedBits:j,next:null},Ys===null){if(Wu===null)throw Error(i(308));Ys=j,Wu.dependencies={lanes:0,firstContext:j,responders:null}}else Ys=Ys.next=j;return C._currentValue}var Qi=!1;function Op(C){C.updateQueue={baseState:C.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null},effects:null}}function Vy(C,j){C=C.updateQueue,j.updateQueue===C&&(j.updateQueue={baseState:C.baseState,firstBaseUpdate:C.firstBaseUpdate,lastBaseUpdate:C.lastBaseUpdate,shared:C.shared,effects:C.effects})}function Xi(C,j){return{eventTime:C,lane:j,tag:0,payload:null,callback:null,next:null}}function ta(C,j){var V;(C=C.updateQueue)!==null&&((V=(C=C.shared).pending)===null?j.next=j:(j.next=V.next,V.next=j),C.pending=j)}function Wy(C,j){var V=C.updateQueue,it=C.alternate;if(it!==null&&V===(it=it.updateQueue)){var ot=null,st=null;if((V=V.firstBaseUpdate)!==null){do var ut={eventTime:V.eventTime,lane:V.lane,tag:V.tag,payload:V.payload,callback:V.callback,next:null};while(st===null?ot=st=ut:st=st.next=ut,(V=V.next)!==null);st===null?ot=st=j:st=st.next=j}else ot=st=j;return V={baseState:it.baseState,firstBaseUpdate:ot,lastBaseUpdate:st,shared:it.shared,effects:it.effects},void(C.updateQueue=V)}(C=V.lastBaseUpdate)===null?V.firstBaseUpdate=j:C.next=j,V.lastBaseUpdate=j}function rc(C,j,V,it){var ot,st,ut,_t,mt=C.updateQueue,Ht=(Qi=!1,mt.firstBaseUpdate),ie=mt.lastBaseUpdate;if((Kt=mt.shared.pending)!==null&&(mt.shared.pending=null,st=(ot=Kt).next,(ot.next=null)===ie?Ht=st:ie.next=st,ie=ot,(ut=C.alternate)!==null&&(_t=(ut=ut.updateQueue).lastBaseUpdate)!==ie&&(_t===null?ut.firstBaseUpdate=st:_t.next=st,ut.lastBaseUpdate=ot)),Ht!==null){for(_t=mt.baseState,ie=0,ut=st=ot=null;;){Kt=Ht.lane;var ue=Ht.eventTime;if((it&Kt)===Kt){ut!==null&&(ut=ut.next={eventTime:ue,lane:0,tag:Ht.tag,payload:Ht.payload,callback:Ht.callback,next:null});t:{var De=C,mn=Ht,Kt=j;switch(ue=V,mn.tag){case 1:if(typeof(De=mn.payload)=="function"){_t=De.call(ue,_t,Kt);break t}_t=De;break t;case 3:De.flags=-4097&De.flags|64;case 0:if((Kt=typeof(De=mn.payload)=="function"?De.call(ue,_t,Kt):De)==null)break t;_t=e({},_t,Kt);break t;case 2:Qi=!0}}Ht.callback!==null&&(C.flags|=32,(Kt=mt.effects)===null?mt.effects=[Ht]:Kt.push(Ht))}else ue={eventTime:ue,lane:Kt,tag:Ht.tag,payload:Ht.payload,callback:Ht.callback,next:null},ut===null?(st=ut=ue,ot=_t):ut=ut.next=ue,ie|=Kt;if((Ht=Ht.next)===null){if((Kt=mt.shared.pending)===null)break;Ht=Kt.next,Kt.next=null,mt.lastBaseUpdate=Kt,mt.shared.pending=null}}ut===null&&(ot=_t),mt.baseState=ot,mt.firstBaseUpdate=st,mt.lastBaseUpdate=ut,gc|=ie,C.lanes=ie,C.memoizedState=_t}}function Ky(C,j,V){if(C=j.effects,(j.effects=null)!==C)for(j=0;j<C.length;j++){var it=C[j],ot=it.callback;if(ot!==null){if(it.callback=null,it=V,typeof ot!="function")throw Error(i(191,ot));ot.call(it)}}}var Gy=new n.Component().refs;function Gu(C,j,V,it){V=(V=V(it,j=C.memoizedState))==null?j:e({},j,V),C.memoizedState=V,C.lanes===0&&(C.updateQueue.baseState=V)}var Yu={isMounted:function(C){return!!(C=C._reactInternals)&&Ae(C)===C},enqueueSetState:function(C,j,V){C=C._reactInternals;var it=Zr(),ot=oa(C),st=Xi(it,ot);st.payload=j,V!=null&&(st.callback=V),ta(C,st),ia(C,ot,it)},enqueueReplaceState:function(C,j,V){C=C._reactInternals;var it=Zr(),ot=oa(C),st=Xi(it,ot);st.tag=1,st.payload=j,V!=null&&(st.callback=V),ta(C,st),ia(C,ot,it)},enqueueForceUpdate:function(C,j){C=C._reactInternals;var V=Zr(),it=oa(C),ot=Xi(V,it);ot.tag=2,j!=null&&(ot.callback=j),ta(C,ot),ia(C,it,V)}};function Yy(C,j,V,it,ot,st,ut){return typeof(C=C.stateNode).shouldComponentUpdate=="function"?C.shouldComponentUpdate(it,st,ut):!(j.prototype&&j.prototype.isPureReactComponent&&Yl(V,it)&&Yl(ot,st))}function Zy(C,j,V){var it=!1,ot=Zi,st=j.contextType;j=new j(V,st=typeof st=="object"&&st!==null?io(st):(ot=Gr(j)?Ha:wr.current,(it=(it=j.contextTypes)!=null)?Ks(C,ot):Zi)),C.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,j.updater=Yu,(C.stateNode=j)._reactInternals=C,it&&((C=C.stateNode).__reactInternalMemoizedUnmaskedChildContext=ot,C.__reactInternalMemoizedMaskedChildContext=st)}function Qy(C,j,V,it){C=j.state,typeof j.componentWillReceiveProps=="function"&&j.componentWillReceiveProps(V,it),typeof j.UNSAFE_componentWillReceiveProps=="function"&&j.UNSAFE_componentWillReceiveProps(V,it),j.state!==C&&Yu.enqueueReplaceState(j,j.state,null)}function Tp(C,j,V,it){var ot=C.stateNode,st=(ot.props=V,ot.state=C.memoizedState,ot.refs=Gy,Op(C),j.contextType);typeof st=="object"&&st!==null?ot.context=io(st):(st=Gr(j)?Ha:wr.current,ot.context=Ks(C,st)),rc(C,V,ot,it),ot.state=C.memoizedState,typeof(st=j.getDerivedStateFromProps)=="function"&&(Gu(C,0,st,V),ot.state=C.memoizedState),typeof j.getDerivedStateFromProps=="function"||typeof ot.getSnapshotBeforeUpdate=="function"||typeof ot.UNSAFE_componentWillMount!="function"&&typeof ot.componentWillMount!="function"||(j=ot.state,typeof ot.componentWillMount=="function"&&ot.componentWillMount(),typeof ot.UNSAFE_componentWillMount=="function"&&ot.UNSAFE_componentWillMount(),j!==ot.state&&Yu.enqueueReplaceState(ot,ot.state,null),rc(C,V,ot,it),ot.state=C.memoizedState),typeof ot.componentDidMount=="function"&&(C.flags|=4)}var Zu=Array.isArray;function oc(C,j,V){if((C=V.ref)!==null&&typeof C!="function"&&typeof C!="object"){if(V._owner){if(V=V._owner){if(V.tag!==1)throw Error(i(309));var it=V.stateNode}if(!it)throw Error(i(147,C));var ot=""+C;return j!==null&&j.ref!==null&&typeof j.ref=="function"&&j.ref._stringRef===ot?j.ref:((j=function(st){var ut=it.refs;ut===Gy&&(ut=it.refs={}),st===null?delete ut[ot]:ut[ot]=st})._stringRef=ot,j)}if(typeof C!="string")throw Error(i(284));if(!V._owner)throw Error(i(290,C))}return C}function Qu(C,j){if(C.type!=="textarea")throw Error(i(31,Object.prototype.toString.call(j)==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":j))}function Xy(C){function j(Kt,re){var me;C&&((me=Kt.lastEffect)!==null?(me.nextEffect=re,Kt.lastEffect=re):Kt.firstEffect=Kt.lastEffect=re,re.nextEffect=null,re.flags=8)}function V(Kt,re){if(!C)return null;for(;re!==null;)j(Kt,re),re=re.sibling;return null}function it(Kt,re){for(Kt=new Map;re!==null;)re.key!==null?Kt.set(re.key,re):Kt.set(re.index,re),re=re.sibling;return Kt}function ot(Kt,re){return(Kt=la(Kt,re)).index=0,Kt.sibling=null,Kt}function st(Kt,re,me){return Kt.index=me,C?(me=Kt.alternate)===null||(me=me.index)<re?(Kt.flags=2,re):me:re}function ut(Kt){return C&&Kt.alternate===null&&(Kt.flags=2),Kt}function _t(Kt,re,me,Le){return re===null||re.tag!==6?(re=sh(me,Kt.mode,Le)).return=Kt:(re=ot(re,me)).return=Kt,re}function mt(Kt,re,me,Le){return re!==null&&re.elementType===me.type?(Le=ot(re,me.props)).ref=oc(0,re,me):(Le=gd(me.type,me.key,me.props,null,Kt.mode,Le)).ref=oc(0,re,me),Le.return=Kt,Le}function Ht(Kt,re,me,Le){return re===null||re.tag!==4||re.stateNode.containerInfo!==me.containerInfo||re.stateNode.implementation!==me.implementation?(re=lh(me,Kt.mode,Le)).return=Kt:(re=ot(re,me.children||[])).return=Kt,re}function ie(Kt,re,me,Le,Me){return re===null||re.tag!==7?(re=al(me,Kt.mode,Le,Me)).return=Kt:(re=ot(re,me)).return=Kt,re}function ue(Kt,re,me){if(typeof re=="string"||typeof re=="number")return(re=sh(""+re,Kt.mode,me)).return=Kt,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case k:return(me=gd(re.type,re.key,re.props,null,Kt.mode,me)).ref=oc(0,null,re),me.return=Kt,me;case D:return(re=lh(re,Kt.mode,me)).return=Kt,re}if(Zu(re)||T(re))return(re=al(re,Kt.mode,me,null)).return=Kt,re;Qu(Kt,re)}return null}function De(Kt,re,me,Le){var Me=re!==null?re.key:null;if(typeof me=="string"||typeof me=="number")return Me!==null?null:_t(Kt,re,""+me,Le);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case k:return me.key===Me?me.type===P?ie(Kt,re,me.props.children,Le,Me):mt(Kt,re,me,Le):null;case D:return me.key===Me?Ht(Kt,re,me,Le):null}if(Zu(me)||T(me))return Me!==null?null:ie(Kt,re,me,Le,null);Qu(Kt,me)}return null}function mn(Kt,re,me,Le,Me){if(typeof Le=="string"||typeof Le=="number")return _t(re,Kt=Kt.get(me)||null,""+Le,Me);if(typeof Le=="object"&&Le!==null){switch(Le.$$typeof){case k:return Kt=Kt.get(Le.key===null?me:Le.key)||null,Le.type===P?ie(re,Kt,Le.props.children,Me,Le.key):mt(re,Kt,Le,Me);case D:return Ht(re,Kt=Kt.get(Le.key===null?me:Le.key)||null,Le,Me)}if(Zu(Le)||T(Le))return ie(re,Kt=Kt.get(me)||null,Le,Me,null);Qu(re,Le)}return null}return function(Kt,re,me,Le){var Me=typeof me=="object"&&me!==null&&me.type===P&&me.key===null,Ze=typeof(me=Me?me.props.children:me)=="object"&&me!==null;if(Ze)switch(me.$$typeof){case k:t:{for(Ze=me.key,Me=re;Me!==null;){if(Me.key===Ze){switch(Me.tag){case 7:if(me.type!==P)break;V(Kt,Me.sibling),(re=ot(Me,me.props.children)).return=Kt,Kt=re;break t;default:if(Me.elementType===me.type){V(Kt,Me.sibling),(re=ot(Me,me.props)).ref=oc(0,Me,me),re.return=Kt,Kt=re;break t}}V(Kt,Me);break}j(Kt,Me),Me=Me.sibling}Kt=me.type===P?((re=al(me.props.children,Kt.mode,Le,me.key)).return=Kt,re):((Le=gd(me.type,me.key,me.props,null,Kt.mode,Le)).ref=oc(0,re,me),Le.return=Kt,Le)}return ut(Kt);case D:t:{for(Me=me.key;re!==null;){if(re.key===Me){if(re.tag===4&&re.stateNode.containerInfo===me.containerInfo&&re.stateNode.implementation===me.implementation){V(Kt,re.sibling),(re=ot(re,me.children||[])).return=Kt,Kt=re;break t}V(Kt,re);break}j(Kt,re),re=re.sibling}(re=lh(me,Kt.mode,Le)).return=Kt,Kt=re}return ut(Kt)}if(typeof me=="string"||typeof me=="number")return me=""+me,(re=re!==null&&re.tag===6?(V(Kt,re.sibling),ot(re,me)):(V(Kt,re),sh(me,Kt.mode,Le))).return=Kt,ut(Kt=re);if(Zu(me)){for(var ln=Kt,Xe=re,Qe=me,wn=Le,On=null,An=null,pn=Xe,yn=Xe=0,dn=null;pn!==null&&yn<Qe.length;yn++){pn.index>yn?(dn=pn,pn=null):dn=pn.sibling;var Dn=De(ln,pn,Qe[yn],wn);if(Dn===null){pn===null&&(pn=dn);break}C&&pn&&Dn.alternate===null&&j(ln,pn),Xe=st(Dn,Xe,yn),An===null?On=Dn:An.sibling=Dn,An=Dn,pn=dn}if(yn===Qe.length)return V(ln,pn),On;if(pn===null){for(;yn<Qe.length;yn++)(pn=ue(ln,Qe[yn],wn))!==null&&(Xe=st(pn,Xe,yn),An===null?On=pn:An.sibling=pn,An=pn);return On}for(pn=it(ln,pn);yn<Qe.length;yn++)(dn=mn(pn,ln,yn,Qe[yn],wn))!==null&&(C&&dn.alternate!==null&&pn.delete(dn.key===null?yn:dn.key),Xe=st(dn,Xe,yn),An===null?On=dn:An.sibling=dn,An=dn);return C&&pn.forEach(function(ph){return j(ln,ph)}),On}if(T(me)){var Gn=Kt,co=re,Vo=me,fh=Le,vi=T(Vo);if(typeof vi!="function")throw Error(i(150));if((Vo=vi.call(Vo))==null)throw Error(i(151));for(var _i=vi=null,pr=co,xi=co=0,bd=null,Jn=Vo.next();pr!==null&&!Jn.done;xi++,Jn=Vo.next()){pr.index>xi?(bd=pr,pr=null):bd=pr.sibling;var sl=De(Gn,pr,Jn.value,fh);if(sl===null){pr===null&&(pr=bd);break}C&&pr&&sl.alternate===null&&j(Gn,pr),co=st(sl,co,xi),_i===null?vi=sl:_i.sibling=sl,_i=sl,pr=bd}if(Jn.done)return V(Gn,pr),vi;if(pr===null){for(;!Jn.done;xi++,Jn=Vo.next())(Jn=ue(Gn,Jn.value,fh))!==null&&(co=st(Jn,co,xi),_i===null?vi=Jn:_i.sibling=Jn,_i=Jn);return vi}for(pr=it(Gn,pr);!Jn.done;xi++,Jn=Vo.next())(Jn=mn(pr,Gn,xi,Jn.value,fh))!==null&&(C&&Jn.alternate!==null&&pr.delete(Jn.key===null?xi:Jn.key),co=st(Jn,co,xi),_i===null?vi=Jn:_i.sibling=Jn,_i=Jn);return C&&pr.forEach(function(ph){return j(Gn,ph)}),vi}if(Ze&&Qu(Kt,me),me===void 0&&!Me)switch(Kt.tag){case 1:case 22:case 0:case 11:case 15:throw Error(i(152,Y(Kt.type)||"Component"))}return V(Kt,re)}}var Xu=Xy(!0),tb=Xy(!1),ic={},$o=Yi(ic),ac=Yi(ic),sc=Yi(ic);function Va(C){if(C===ic)throw Error(i(174));return C}function jp(C,j){switch(Kn(sc,j),Kn(ac,C),Kn($o,ic),C=j.nodeType){case 9:case 11:j=(j=j.documentElement)?j.namespaceURI:Et(null,"");break;default:j=Et(j=(C=C===8?j.parentNode:j).namespaceURI||null,C=C.tagName)}zn($o),Kn($o,j)}function Qs(){zn($o),zn(ac),zn(sc)}function eb(C){Va(sc.current);var j=Va($o.current),V=Et(j,C.type);j!==V&&(Kn(ac,C),Kn($o,V))}function Ap(C){ac.current===C&&(zn($o),zn(ac))}var Yn=Yi(0);function td(C){for(var j=C;j!==null;){if(j.tag===13){var V=j.memoizedState;if(V!==null&&((V=V.dehydrated)===null||V.data==="$?"||V.data==="$!"))return j}else if(j.tag===19&&j.memoizedProps.revealOrder!==void 0){if(64&j.flags)return j}else if(j.child!==null){j=(j.child.return=j).child;continue}if(j===C)break;for(;j.sibling===null;){if(j.return===null||j.return===C)return null;j=j.return}j.sibling.return=j.return,j=j.sibling}return null}var mi=null,ea=null,Ho=!1;function nb(C,j){var V=lo(5,null,null,0);V.elementType="DELETED",V.type="DELETED",V.stateNode=j,V.return=C,V.flags=8,C.lastEffect!==null?(C.lastEffect.nextEffect=V,C.lastEffect=V):C.firstEffect=C.lastEffect=V}function rb(C,j){switch(C.tag){case 5:var V=C.type;return(j=j.nodeType!==1||V.toLowerCase()!==j.nodeName.toLowerCase()?null:j)!==null&&(C.stateNode=j,1);case 6:return(j=C.pendingProps===""||j.nodeType!==3?null:j)!==null&&(C.stateNode=j,1);default:return}}function Pp(C){if(Ho){var j=ea;if(j){var V=j;if(!rb(C,j)){if(!(j=Js(V.nextSibling))||!rb(C,j))return C.flags=-1025&C.flags|2,Ho=!1,void(mi=C);nb(mi,V)}mi=C,ea=Js(j.firstChild)}else C.flags=-1025&C.flags|2,Ho=!1,mi=C}}function ob(C){for(C=C.return;C!==null&&C.tag!==5&&C.tag!==3&&C.tag!==13;)C=C.return;mi=C}function ed(C){if(C===mi){if(!Ho)return ob(C),Ho=!0,0;var j=C.type;if(C.tag!==5||j!=="head"&&j!=="body"&&!hp(j,C.memoizedProps))for(j=ea;j;)nb(C,j),j=Js(j.nextSibling);if(ob(C),C.tag===13){if(!(C=(C=C.memoizedState)!==null?C.dehydrated:null))throw Error(i(317));t:{for(C=C.nextSibling,j=0;C;){if(C.nodeType===8){var V=C.data;if(V==="/$"){if(j===0){ea=Js(C.nextSibling);break t}j--}else V!=="$"&&V!=="$!"&&V!=="$?"||j++}C=C.nextSibling}ea=null}}else ea=mi?Js(C.stateNode.nextSibling):null;return 1}}function Np(){ea=mi=null,Ho=!1}var Xs=[];function Ip(){for(var C=0;C<Xs.length;C++)Xs[C]._workInProgressVersionPrimary=null;Xs.length=0}var lc=E.ReactCurrentDispatcher,ao=E.ReactCurrentBatchConfig,cc=0,Zn=null,Ir=null,yr=null,nd=!1,uc=!1;function Ur(){throw Error(i(321))}function Rp(C,j){if(j!==null){for(var V=0;V<j.length&&V<C.length;V++)if(!nr(C[V],j[V]))return;return 1}}function Mp(C,j,V,it,ot,st){if(cc=st,(Zn=j).memoizedState=null,j.updateQueue=null,j.lanes=0,lc.current=C===null||C.memoizedState===null?aC:sC,C=V(it,ot),uc){st=0;do if(uc=!1,!(st<25))throw Error(i(301));while(st+=1,yr=Ir=null,j.updateQueue=null,lc.current=lC,C=V(it,ot),uc)}if(lc.current=ad,j=Ir!==null&&Ir.next!==null,cc=0,yr=Ir=Zn=null,nd=!1,j)throw Error(i(300));return C}function Wa(){var C={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yr===null?Zn.memoizedState=yr=C:yr=yr.next=C,yr}function Ka(){C=Ir===null?(C=Zn.alternate)!==null?C.memoizedState:null:Ir.next;var C,j=yr===null?Zn.memoizedState:yr.next;if(j!==null)yr=j,Ir=C;else{if(C===null)throw Error(i(310));C={memoizedState:(Ir=C).memoizedState,baseState:Ir.baseState,baseQueue:Ir.baseQueue,queue:Ir.queue,next:null},yr===null?Zn.memoizedState=yr=C:yr=yr.next=C}return yr}function qo(C,j){return typeof j=="function"?j(C):j}function dc(C){var j=Ka(),V=j.queue;if(V===null)throw Error(i(311));V.lastRenderedReducer=C;var it,ot=(ut=Ir).baseQueue,st=V.pending;if(st!==null&&(ot!==null&&(it=ot.next,ot.next=st.next,st.next=it),ut.baseQueue=ot=st,V.pending=null),ot!==null){ot=ot.next;var ut=ut.baseState,_t=it=st=null,mt=ot;do var Ht,ie=mt.lane;while((cc&ie)===ie?(_t!==null&&(_t=_t.next={lane:0,action:mt.action,eagerReducer:mt.eagerReducer,eagerState:mt.eagerState,next:null}),ut=mt.eagerReducer===C?mt.eagerState:C(ut,mt.action)):(Ht={lane:ie,action:mt.action,eagerReducer:mt.eagerReducer,eagerState:mt.eagerState,next:null},_t===null?(it=_t=Ht,st=ut):_t=_t.next=Ht,Zn.lanes|=ie,gc|=ie),(mt=mt.next)!==null&&mt!==ot);_t===null?st=ut:_t.next=it,nr(ut,j.memoizedState)||(Eo=!0),j.memoizedState=ut,j.baseState=st,j.baseQueue=_t,V.lastRenderedState=ut}return[j.memoizedState,V.dispatch]}function fc(C){var j=Ka(),V=j.queue;if(V===null)throw Error(i(311));V.lastRenderedReducer=C;var it=V.dispatch,ot=V.pending,st=j.memoizedState;if(ot!==null){V.pending=null;for(var ut=ot=ot.next;st=C(st,ut.action),(ut=ut.next)!==ot;);nr(st,j.memoizedState)||(Eo=!0),j.memoizedState=st,j.baseQueue===null&&(j.baseState=st),V.lastRenderedState=st}return[st,it]}function ib(C,j,V){var it=(it=j._getVersion)(j._source),ot=j._workInProgressVersionPrimary;if(ot!==null?C=ot===it:(C=C.mutableReadLanes,(C=(cc&C)===C)&&(j._workInProgressVersionPrimary=it,Xs.push(j))),C)return V(j._source);throw Xs.push(j),Error(i(350))}function ab(C,j,V,it){var ot=Rr;if(ot===null)throw Error(i(349));var st=j._getVersion,ut=st(j._source),_t=lc.current,mt=(ie=_t.useState(function(){return ib(ot,j,V)}))[1],Ht=ie[0],ie=yr,ue=(Kt=C.memoizedState).refs,De=ue.getSnapshot,mn=Kt.source,Kt=Kt.subscribe,re=Zn;return C.memoizedState={refs:ue,source:j,subscribe:it},_t.useEffect(function(){ue.getSnapshot=V,ue.setSnapshot=mt;var me=st(j._source);if(!nr(ut,me)){me=V(j._source),nr(Ht,me)||(mt(me),me=oa(re),ot.mutableReadLanes|=me&ot.pendingLanes),me=ot.mutableReadLanes,ot.entangledLanes|=me;for(var Le=ot.entanglements,Me=me;0<Me;){var Ze=31-xo(Me),ln=1<<Ze;Le[Ze]|=me,Me&=~ln}}},[V,j,it]),_t.useEffect(function(){return it(j._source,function(){var me=ue.getSnapshot,Le=ue.setSnapshot;try{Le(me(j._source));var Me=oa(re);ot.mutableReadLanes|=Me&ot.pendingLanes}catch(Ze){Le(function(){throw Ze})}})},[j,it]),nr(De,V)&&nr(mn,j)&&nr(Kt,it)||((C={pending:null,dispatch:null,lastRenderedReducer:qo,lastRenderedState:Ht}).dispatch=mt=Fp.bind(null,Zn,C),ie.queue=C,ie.baseQueue=null,Ht=ib(ot,j,V),ie.memoizedState=ie.baseState=Ht),Ht}function sb(C,j,V){return ab(Ka(),C,j,V)}function pc(C){var j=Wa();return typeof C=="function"&&(C=C()),j.memoizedState=j.baseState=C,C=(C=j.queue={pending:null,dispatch:null,lastRenderedReducer:qo,lastRenderedState:C}).dispatch=Fp.bind(null,Zn,C),[j.memoizedState,C]}function rd(C,j,V,it){return C={tag:C,create:j,destroy:V,deps:it,next:null},(j=Zn.updateQueue)===null?(Zn.updateQueue=j={lastEffect:null}).lastEffect=C.next=C:(V=j.lastEffect)===null?j.lastEffect=C.next=C:(it=V.next,(V.next=C).next=it,j.lastEffect=C),C}function lb(C){return Wa().memoizedState={current:C}}function od(){return Ka().memoizedState}function Dp(C,j,V,it){var ot=Wa();Zn.flags|=C,ot.memoizedState=rd(1|j,V,void 0,it===void 0?null:it)}function Lp(C,j,V,it){var ot=Ka(),st=void(it=it===void 0?null:it);if(Ir!==null){var ut=Ir.memoizedState;if(st=ut.destroy,it!==null&&Rp(it,ut.deps))return void rd(j,V,st,it)}Zn.flags|=C,ot.memoizedState=rd(1|j,V,st,it)}function cb(C,j){return Dp(516,4,C,j)}function id(C,j){return Lp(516,4,C,j)}function ub(C,j){return Lp(4,2,C,j)}function db(C,j){return typeof j=="function"?(C=C(),j(C),function(){j(null)}):j!=null?(C=C(),j.current=C,function(){j.current=null}):void 0}function fb(C,j,V){return V=V!=null?V.concat([C]):null,Lp(4,2,db.bind(null,j,C),V)}function Bp(){}function pb(C,j){var V=Ka(),it=(j=j===void 0?null:j,V.memoizedState);return it!==null&&j!==null&&Rp(j,it[1])?it[0]:(V.memoizedState=[C,j],C)}function hb(C,j){var V=Ka(),it=(j=j===void 0?null:j,V.memoizedState);return it!==null&&j!==null&&Rp(j,it[1])?it[0]:(C=C(),V.memoizedState=[C,j],C)}function Fp(C,j,V){var it=Zr(),ot=oa(C),st={lane:ot,action:V,eagerReducer:null,eagerState:null,next:null},ut=j.pending;if(ut===null?st.next=st:(st.next=ut.next,ut.next=st),j.pending=st,ut=C.alternate,C===Zn||ut!==null&&ut===Zn)uc=nd=!0;else{if(C.lanes===0&&(ut===null||ut.lanes===0)&&(ut=j.lastRenderedReducer)!==null)try{var _t=j.lastRenderedState,mt=ut(_t,V);if(st.eagerReducer=ut,st.eagerState=mt,nr(mt,_t))return}catch{}ia(C,ot,it)}}var ad={readContext:io,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},aC={readContext:io,useCallback:function(C,j){return Wa().memoizedState=[C,j===void 0?null:j],C},useContext:io,useEffect:cb,useImperativeHandle:function(C,j,V){return V=V!=null?V.concat([C]):null,Dp(4,2,db.bind(null,j,C),V)},useLayoutEffect:function(C,j){return Dp(4,2,C,j)},useMemo:function(C,j){var V=Wa();return j=j===void 0?null:j,C=C(),V.memoizedState=[C,j],C},useReducer:function(C,j,V){var it=Wa();return j=V!==void 0?V(j):j,it.memoizedState=it.baseState=j,C=(C=it.queue={pending:null,dispatch:null,lastRenderedReducer:C,lastRenderedState:j}).dispatch=Fp.bind(null,Zn,C),[it.memoizedState,C]},useRef:lb,useState:pc,useDebugValue:Bp,useDeferredValue:function(C){var j=pc(C),V=j[0],it=j[1];return cb(function(){var ot=ao.transition;ao.transition=1;try{it(C)}finally{ao.transition=ot}},[C]),V},useTransition:function(){var C=pc(!1),j=C[0];return lb(C=(function(V,it){var ot=Gs();Ja(ot<98?98:ot,function(){V(!0)}),Ja(97<ot?97:ot,function(){var st=ao.transition;ao.transition=1;try{V(!1),it()}finally{ao.transition=st}})}).bind(null,C[1])),[C,j]},useMutableSource:function(C,j,V){var it=Wa();return it.memoizedState={refs:{getSnapshot:j,setSnapshot:null},source:C,subscribe:V},ab(it,C,j,V)},useOpaqueIdentifier:function(){var C,j,V;return Ho?(C=!1,V={$$typeof:U,toString:V=function(){throw C||(C=!0,j("r:"+(mp++).toString(36))),Error(i(355))},valueOf:V},j=pc(V)[1],!(2&Zn.mode)&&(Zn.flags|=516,rd(5,function(){j("r:"+(mp++).toString(36))},void 0,null))):pc(V="r:"+(mp++).toString(36)),V},unstable_isNewReconciler:!1},sC={readContext:io,useCallback:pb,useContext:io,useEffect:id,useImperativeHandle:fb,useLayoutEffect:ub,useMemo:hb,useReducer:dc,useRef:od,useState:function(){return dc(qo)},useDebugValue:Bp,useDeferredValue:function(C){var j=dc(qo),V=j[0],it=j[1];return id(function(){var ot=ao.transition;ao.transition=1;try{it(C)}finally{ao.transition=ot}},[C]),V},useTransition:function(){var C=dc(qo)[0];return[od().current,C]},useMutableSource:sb,useOpaqueIdentifier:function(){return dc(qo)[0]},unstable_isNewReconciler:!1},lC={readContext:io,useCallback:pb,useContext:io,useEffect:id,useImperativeHandle:fb,useLayoutEffect:ub,useMemo:hb,useReducer:fc,useRef:od,useState:function(){return fc(qo)},useDebugValue:Bp,useDeferredValue:function(C){var j=fc(qo),V=j[0],it=j[1];return id(function(){var ot=ao.transition;ao.transition=1;try{it(C)}finally{ao.transition=ot}},[C]),V},useTransition:function(){var C=fc(qo)[0];return[od().current,C]},useMutableSource:sb,useOpaqueIdentifier:function(){return fc(qo)[0]},unstable_isNewReconciler:!1},cC=E.ReactCurrentOwner,Eo=!1;function Yr(C,j,V,it){j.child=C===null?tb(j,null,V,it):Xu(j,C.child,V,it)}function gb(C,j,V,it,ot){V=V.render;var st=j.ref;return Zs(j,ot),it=Mp(C,j,V,it,st,ot),C===null||Eo?(j.flags|=1,Yr(C,j,it,ot),j.child):(j.updateQueue=C.updateQueue,j.flags&=-517,C.lanes&=~ot,yi(C,j,ot))}function mb(C,j,V,it,ot,st){var ut;return C===null?typeof(ut=V.type)!="function"||ih(ut)||ut.defaultProps!==void 0||V.compare!==null||V.defaultProps!==void 0?((C=gd(V.type,null,it,j,j.mode,st)).ref=j.ref,(C.return=j).child=C):(j.tag=15,j.type=ut,yb(C,j,ut,it,ot,st)):(ut=C.child,ot&st||(ot=ut.memoizedProps,!(V=(V=V.compare)!==null?V:Yl)(ot,it)||C.ref!==j.ref)?(j.flags|=1,(C=la(ut,it)).ref=j.ref,(C.return=j).child=C):yi(C,j,st))}function yb(C,j,V,it,ot,st){if(C!==null&&Yl(C.memoizedProps,it)&&C.ref===j.ref){if(Eo=!1,!(st&ot))return j.lanes=C.lanes,yi(C,j,st);16384&C.flags&&(Eo=!0)}return zp(C,j,V,it,st)}function bb(C,j,V){var it=j.pendingProps,ot=it.children,st=C!==null?C.memoizedState:null;if(it.mode==="hidden"||it.mode==="unstable-defer-without-hiding")if(4&j.mode){if(!(1073741824&V))return C=st!==null?st.baseLanes|V:V,j.lanes=j.childLanes=1073741824,j.memoizedState={baseLanes:C},hd(0,C),null;j.memoizedState={baseLanes:0},hd(0,st!==null?st.baseLanes:V)}else j.memoizedState={baseLanes:0},hd(0,V);else st!==null?(it=st.baseLanes|V,j.memoizedState=null):it=V,hd(0,it);return Yr(C,j,ot,V),j.child}function vb(C,j){var V=j.ref;(C===null&&V!==null||C!==null&&C.ref!==V)&&(j.flags|=128)}function zp(C,j,V,it,ot){var st=Ks(j,Gr(V)?Ha:wr.current);return Zs(j,ot),V=Mp(C,j,V,it,st,ot),C===null||Eo?(j.flags|=1,Yr(C,j,V,ot),j.child):(j.updateQueue=C.updateQueue,j.flags&=-517,C.lanes&=~ot,yi(C,j,ot))}function _b(C,j,V,it,ot){var st,ut,_t,mt,Ht,ie,ue,De,mn,Kt;return Gr(V)?(st=!0,Hu(j)):st=!1,Zs(j,ot),it=j.stateNode===null?(C!==null&&(C.alternate=null,j.alternate=null,j.flags|=2),Zy(j,V,it),Tp(j,V,it,ot),!0):C===null?(ut=j.stateNode,_t=j.memoizedProps,ut.props=_t,De=ut.context,mt=typeof(mt=V.contextType)=="object"&&mt!==null?io(mt):Ks(j,mt=Gr(V)?Ha:wr.current),(ie=typeof(Ht=V.getDerivedStateFromProps)=="function"||typeof ut.getSnapshotBeforeUpdate=="function")||typeof ut.UNSAFE_componentWillReceiveProps!="function"&&typeof ut.componentWillReceiveProps!="function"||_t===it&&De===mt||Qy(0,ut,it,mt),Qi=!1,ue=j.memoizedState,ut.state=ue,rc(j,it,ut,ot),De=j.memoizedState,_t!==it||ue!==De||zr.current||Qi?(typeof Ht=="function"&&(Gu(j,0,Ht,it),De=j.memoizedState),(_t=Qi||Yy(j,V,_t,it,ue,De,mt))?(ie||typeof ut.UNSAFE_componentWillMount!="function"&&typeof ut.componentWillMount!="function"||(typeof ut.componentWillMount=="function"&&ut.componentWillMount(),typeof ut.UNSAFE_componentWillMount=="function"&&ut.UNSAFE_componentWillMount()),typeof ut.componentDidMount=="function"&&(j.flags|=4)):(typeof ut.componentDidMount=="function"&&(j.flags|=4),j.memoizedProps=it,j.memoizedState=De),ut.props=it,ut.state=De,ut.context=mt,_t):(typeof ut.componentDidMount=="function"&&(j.flags|=4),!1)):(ut=j.stateNode,Vy(C,j),_t=j.memoizedProps,mt=j.type===j.elementType?_t:Co(j.type,_t),ut.props=mt,ie=j.pendingProps,ue=ut.context,De=typeof(De=V.contextType)=="object"&&De!==null?io(De):Ks(j,De=Gr(V)?Ha:wr.current),(Ht=typeof(mn=V.getDerivedStateFromProps)=="function"||typeof ut.getSnapshotBeforeUpdate=="function")||typeof ut.UNSAFE_componentWillReceiveProps!="function"&&typeof ut.componentWillReceiveProps!="function"||_t===ie&&ue===De||Qy(0,ut,it,De),Qi=!1,ue=j.memoizedState,ut.state=ue,rc(j,it,ut,ot),Kt=j.memoizedState,_t!==ie||ue!==Kt||zr.current||Qi?(typeof mn=="function"&&(Gu(j,0,mn,it),Kt=j.memoizedState),(mt=Qi||Yy(j,V,mt,it,ue,Kt,De))?(Ht||typeof ut.UNSAFE_componentWillUpdate!="function"&&typeof ut.componentWillUpdate!="function"||(typeof ut.componentWillUpdate=="function"&&ut.componentWillUpdate(it,Kt,De),typeof ut.UNSAFE_componentWillUpdate=="function"&&ut.UNSAFE_componentWillUpdate(it,Kt,De)),typeof ut.componentDidUpdate=="function"&&(j.flags|=4),typeof ut.getSnapshotBeforeUpdate=="function"&&(j.flags|=256)):(typeof ut.componentDidUpdate!="function"||_t===C.memoizedProps&&ue===C.memoizedState||(j.flags|=4),typeof ut.getSnapshotBeforeUpdate!="function"||_t===C.memoizedProps&&ue===C.memoizedState||(j.flags|=256),j.memoizedProps=it,j.memoizedState=Kt),ut.props=it,ut.state=Kt,ut.context=De,mt):(typeof ut.componentDidUpdate!="function"||_t===C.memoizedProps&&ue===C.memoizedState||(j.flags|=4),typeof ut.getSnapshotBeforeUpdate!="function"||_t===C.memoizedProps&&ue===C.memoizedState||(j.flags|=256),!1)),Up(C,j,V,it,st,ot)}function Up(C,j,V,it,ot,st){vb(C,j);var ut=!!(64&j.flags);if(!it&&!ut)return ot&&Ly(j,V,!1),yi(C,j,st);it=j.stateNode,cC.current=j;var _t=ut&&typeof V.getDerivedStateFromError!="function"?null:it.render();return j.flags|=1,C!==null&&ut?(j.child=Xu(j,C.child,null,st),j.child=Xu(j,null,_t,st)):Yr(C,j,_t,st),j.memoizedState=it.state,ot&&Ly(j,V,!0),j.child}function xb(C){var j=C.stateNode;j.pendingContext?My(0,j.pendingContext,j.pendingContext!==j.context):j.context&&My(0,j.context,!1),jp(C,j.containerInfo)}var $p={dehydrated:null,retryLane:0};function wb(C,j,V){var it,ot=j.pendingProps,st=Yn.current,ut=!1;return(it=(it=!!(64&j.flags))?it:(C===null||C.memoizedState!==null)&&!!(2&st))?(ut=!0,j.flags&=-65):C!==null&&C.memoizedState===null||ot.fallback===void 0||ot.unstable_avoidThisFallback===!0||(st|=1),Kn(Yn,1&st),C===null?(ot.fallback!==void 0&&Pp(j),C=ot.children,st=ot.fallback,ut?(C=Sb(j,C,st,V),j.child.memoizedState={baseLanes:V},j.memoizedState=$p,C):typeof ot.unstable_expectedLoadTime=="number"?(C=Sb(j,C,st,V),j.child.memoizedState={baseLanes:V},j.memoizedState=$p,j.lanes=33554432,C):((V=ah({mode:"visible",children:C},j.mode,V,null)).return=j).child=V):(C.memoizedState,ut?(ot=function(_t,mt,Ht,ie,ue){var De=mt.mode,mn=_t.child,Kt=(_t=mn.sibling,{mode:"hidden",children:Ht});return 2&De||mt.child===mn?Ht=la(mn,Kt):((Ht=mt.child).childLanes=0,Ht.pendingProps=Kt,(mn=Ht.lastEffect)!==null?(mt.firstEffect=Ht.firstEffect,(mt.lastEffect=mn).nextEffect=null):mt.firstEffect=mt.lastEffect=null),_t!==null?ie=la(_t,ie):(ie=al(ie,De,ue,null)).flags|=2,ie.return=mt,Ht.return=mt,Ht.sibling=ie,mt.child=Ht,ie}(C,j,ot.children,ot.fallback,V),ut=j.child,st=C.child.memoizedState,ut.memoizedState=st===null?{baseLanes:V}:{baseLanes:st.baseLanes|V},ut.childLanes=C.childLanes&~V,j.memoizedState=$p,ot):(V=function(_t,mt,Ht,ie){var ue=_t.child;return _t=ue.sibling,Ht=la(ue,{mode:"visible",children:Ht}),!(2&mt.mode)&&(Ht.lanes=ie),Ht.return=mt,(Ht.sibling=null)!==_t&&(_t.nextEffect=null,_t.flags=8,mt.firstEffect=mt.lastEffect=_t),mt.child=Ht}(C,j,ot.children,V),j.memoizedState=null,V))}function Sb(C,j,V,it){var ot=C.mode,st=C.child;return j={mode:"hidden",children:j},2&ot||st===null?st=ah(j,ot,0,null):(st.childLanes=0,st.pendingProps=j),V=al(V,ot,it,null),st.return=C,V.return=C,st.sibling=V,C.child=st,V}function Cb(C,j){C.lanes|=j;var V=C.alternate;V!==null&&(V.lanes|=j),Jy(C.return,j)}function Hp(C,j,V,it,ot,st){var ut=C.memoizedState;ut===null?C.memoizedState={isBackwards:j,rendering:null,renderingStartTime:0,last:it,tail:V,tailMode:ot,lastEffect:st}:(ut.isBackwards=j,ut.rendering=null,ut.renderingStartTime=0,ut.last=it,ut.tail=V,ut.tailMode=ot,ut.lastEffect=st)}function Eb(C,j,V){var it=j.pendingProps,ot=it.revealOrder,st=it.tail;if(Yr(C,j,it.children,V),2&(it=Yn.current))it=1&it|2,j.flags|=64;else{if(C!==null&&64&C.flags)t:for(C=j.child;C!==null;){if(C.tag===13)C.memoizedState!==null&&Cb(C,V);else if(C.tag===19)Cb(C,V);else if(C.child!==null){C=(C.child.return=C).child;continue}if(C===j)break;for(;C.sibling===null;){if(C.return===null||C.return===j)break t;C=C.return}C.sibling.return=C.return,C=C.sibling}it&=1}if(Kn(Yn,it),2&j.mode)switch(ot){case"forwards":for(V=j.child,ot=null;V!==null;)(C=V.alternate)!==null&&td(C)===null&&(ot=V),V=V.sibling;(V=ot)===null?(ot=j.child,j.child=null):(ot=V.sibling,V.sibling=null),Hp(j,!1,ot,V,st,j.lastEffect);break;case"backwards":for(ot=j.child,j.child=V=null;ot!==null;){if((C=ot.alternate)!==null&&td(C)===null){j.child=ot;break}C=ot.sibling,ot.sibling=V,V=ot,ot=C}Hp(j,!0,V,null,st,j.lastEffect);break;case"together":Hp(j,!1,null,null,void 0,j.lastEffect);break;default:j.memoizedState=null}else j.memoizedState=null;return j.child}function yi(C,j,V){if(C!==null&&(j.dependencies=C.dependencies),gc|=j.lanes,!(V&j.childLanes))return null;if(C!==null&&j.child!==C.child)throw Error(i(153));if(j.child!==null){for(V=la(C=j.child,C.pendingProps),(j.child=V).return=j;C.sibling!==null;)C=C.sibling,(V=V.sibling=la(C,C.pendingProps)).return=j;V.sibling=null}return j.child}function hc(C,j){if(!Ho)switch(C.tailMode){case"hidden":j=C.tail;for(var V=null;j!==null;)j.alternate!==null&&(V=j),j=j.sibling;V===null?C.tail=null:V.sibling=null;break;case"collapsed":V=C.tail;for(var it=null;V!==null;)V.alternate!==null&&(it=V),V=V.sibling;it===null?j||C.tail===null?C.tail=null:C.tail.sibling=null:it.sibling=null}}function qp(C,j){try{for(var V="",it=j;V+=function(st){switch(st.tag){case 5:return I(st.type);case 16:return I("Lazy");case 13:return I("Suspense");case 19:return I("SuspenseList");case 0:case 2:case 15:return B(st.type,!1);case 11:return B(st.type.render,!1);case 22:return B(st.type._render,!1);case 1:return B(st.type,!0);default:return""}}(it),it=it.return;);var ot=V}catch(st){ot=`
|
|
108
108
|
Error generating stack: `+st.message+`
|
|
109
|
-
`+st.stack}return{value:C,source:j,stack:ot}}function Vp(C,j){try{console.error(j.value)}catch(V){setTimeout(function(){throw V})}}var fC=function(C,j){for(var V=j.child;V!==null;){if(V.tag===5||V.tag===6)C.appendChild(V.stateNode);else if(V.tag!==4&&V.child!==null){V=(V.child.return=V).child;continue}if(V===j)break;for(;V.sibling===null;){if(V.return===null||V.return===j)return;V=V.return}V.sibling.return=V.return,V=V.sibling}},pC=function(C,j,V,it){var ot=C.memoizedProps;if(ot!==it){C=j.stateNode,Va($o.current);var st,ut=null;switch(V){case"input":ot=et(C,ot),it=et(C,it),ut=[];break;case"option":ot=Mt(C,ot),it=Mt(C,it),ut=[];break;case"select":ot=e({},ot,{value:void 0}),it=e({},it,{value:void 0}),ut=[];break;case"textarea":ot=Nt(C,ot),it=Nt(C,it),ut=[];break;default:typeof ot.onClick!="function"&&typeof it.onClick=="function"&&(C.onclick=zu)}for(Ht in kt(V,it),V=null,ot)if(!it.hasOwnProperty(Ht)&&ot.hasOwnProperty(Ht)&&ot[Ht]!=null)if(Ht==="style"){var _t=ot[Ht];for(st in _t)_t.hasOwnProperty(st)&&((V=V||{})[st]="")}else Ht!=="dangerouslySetInnerHTML"&&Ht!=="children"&&Ht!=="suppressContentEditableWarning"&&Ht!=="suppressHydrationWarning"&&Ht!=="autoFocus"&&(o.hasOwnProperty(Ht)?ut=ut||[]:(ut=ut||[]).push(Ht,null));for(Ht in it){var mt=it[Ht];if(_t=ot!=null?ot[Ht]:void 0,it.hasOwnProperty(Ht)&&mt!==_t&&(mt!=null||_t!=null))if(Ht==="style")if(_t){for(st in _t)!_t.hasOwnProperty(st)||mt&&mt.hasOwnProperty(st)||((V=V||{})[st]="");for(st in mt)mt.hasOwnProperty(st)&&_t[st]!==mt[st]&&((V=V||{})[st]=mt[st])}else V||(ut=ut||[]).push(Ht,V),V=mt;else Ht==="dangerouslySetInnerHTML"?(mt=mt?mt.__html:void 0,_t=_t?_t.__html:void 0,mt!=null&&_t!==mt&&(ut=ut||[]).push(Ht,mt)):Ht==="children"?typeof mt!="string"&&typeof mt!="number"||(ut=ut||[]).push(Ht,""+mt):Ht!=="suppressContentEditableWarning"&&Ht!=="suppressHydrationWarning"&&(o.hasOwnProperty(Ht)?(mt!=null&&Ht==="onScroll"&&Mn("scroll",C),ut||_t===mt||(ut=[])):typeof mt=="object"&&mt!==null&&mt.$$typeof===U?mt.toString():(ut=ut||[]).push(Ht,mt))}V&&(ut=ut||[]).push("style",V);var Ht=ut;(j.updateQueue=Ht)&&(j.flags|=4)}},hC=function(C,j,V,it){V!==it&&(j.flags|=4)},gC=typeof WeakMap=="function"?WeakMap:Map;function Tb(C,j,V){(V=Xi(-1,V)).tag=3,V.payload={element:null};var it=j.value;return V.callback=function(){cd||(cd=!0,th=it),Vp(0,j)},V}function jb(C,j,V){(V=Xi(-1,V)).tag=3;var it,ot=C.type.getDerivedStateFromError;return typeof ot=="function"&&(it=j.value,V.payload=function(){return Vp(0,j),ot(it)}),(C=C.stateNode)!==null&&typeof C.componentDidCatch=="function"&&(V.callback=function(){typeof ot!="function"&&(Jo===null?Jo=new Set([this]):Jo.add(this),Vp(0,j));var st=j.stack;this.componentDidCatch(j.value,{componentStack:st!==null?st:""})}),V}var mC=typeof WeakSet=="function"?WeakSet:Set;function Ab(C){var j=C.ref;if(j!==null)if(typeof j=="function")try{j(null)}catch(V){sa(C,V)}else j.current=null}function yC(C,j,V){switch(V.tag){case 0:case 11:case 15:case 22:if((j=(j=V.updateQueue)!==null?j.lastEffect:null)!==null){C=j=j.next;do;while(!(3&~C.tag)&&(ot=C.create,C.destroy=ot()),(C=C.next)!==j)}if((j=(j=V.updateQueue)!==null?j.lastEffect:null)!==null){C=j=j.next;do{var it=C,ot=it.next;4&(it=it.tag)&&1&it&&(Vb(V,C),it=V,st=C,eh.push(st,it),na||(na=!0,nc(97,function(){return aa(),null}))),C=ot}while(C!==j)}return;case 1:return C=V.stateNode,4&V.flags&&(j===null?C.componentDidMount():(ot=V.elementType===V.type?j.memoizedProps:Co(V.type,j.memoizedProps),C.componentDidUpdate(ot,j.memoizedState,C.__reactInternalSnapshotBeforeUpdate))),void((j=V.updateQueue)!==null&&Yy(0,j,C));case 3:if((j=V.updateQueue)!==null){if((C=null)!==V.child)switch(V.child.tag){case 5:case 1:C=V.child.stateNode}Yy(0,j,C)}return;case 5:return C=V.stateNode,void(j===null&&4&V.flags&&Ny(V.type,V.memoizedProps)&&C.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(V.memoizedState===null&&(V=V.alternate)!==null&&(V=V.memoizedState)!==null&&(V=V.dehydrated)!==null&&Nn(V))}var st;throw Error(i(163))}function Pb(C,j){for(var V=C;;){if(V.tag===5){var it,ot=V.stateNode;j?typeof(ot=ot.style).setProperty=="function"?ot.setProperty("display","none","important"):ot.display="none":(ot=V.stateNode,it=(it=V.memoizedProps.style)!=null&&it.hasOwnProperty("display")?it.display:null,ot.style.display=Xt("display",it))}else if(V.tag===6)V.stateNode.nodeValue=j?"":V.memoizedProps;else if((V.tag!==23&&V.tag!==24||V.memoizedState===null||V===C)&&V.child!==null){V=(V.child.return=V).child;continue}if(V===C)break;for(;V.sibling===null;){if(V.return===null||V.return===C)return;V=V.return}V.sibling.return=V.return,V=V.sibling}}function Nb(C,j){if(qa&&typeof qa.onCommitFiberUnmount=="function")try{qa.onCommitFiberUnmount(_p,j)}catch{}switch(j.tag){case 0:case 11:case 14:case 15:case 22:if((C=j.updateQueue)!==null&&(C=C.lastEffect)!==null){var V=C=C.next;do{var it=(ot=V).destroy,ot=ot.tag;if(it!==void 0)if(4&ot)Vb(j,V);else{ot=j;try{it()}catch(st){sa(ot,st)}}}while((V=V.next)!==C)}break;case 1:if(Ab(j),typeof(C=j.stateNode).componentWillUnmount=="function")try{C.props=j.memoizedProps,C.state=j.memoizedState,C.componentWillUnmount()}catch(st){sa(j,st)}break;case 5:Ab(j);break;case 4:Db(C,j)}}function Ib(C){C.alternate=null,C.child=null,C.dependencies=null,C.firstEffect=null,C.lastEffect=null,C.memoizedProps=null,C.memoizedState=null,C.pendingProps=null,C.return=null,C.updateQueue=null}function Rb(C){return C.tag===5||C.tag===3||C.tag===4}function Mb(C){t:{for(var j=C.return;j!==null;){if(Rb(j))break t;j=j.return}throw Error(i(160))}var V=j;switch(j=V.stateNode,V.tag){case 5:var it=!1;break;case 3:case 4:j=j.containerInfo,it=!0;break;default:throw Error(i(161))}16&V.flags&&(dt(j,""),V.flags&=-17);t:e:for(V=C;;){for(;V.sibling===null;){if(V.return===null||Rb(V.return)){V=null;break t}V=V.return}for(V.sibling.return=V.return,V=V.sibling;V.tag!==5&&V.tag!==6&&V.tag!==18;){if(2&V.flags||V.child===null||V.tag===4)continue e;V=(V.child.return=V).child}if(!(2&V.flags)){V=V.stateNode;break t}}(it?function ot(st,ut,_t){var mt=st.tag,Ht=mt===5||mt===6;if(Ht)st=Ht?st.stateNode:st.stateNode.instance,ut?(_t.nodeType===8?_t.parentNode:_t).insertBefore(st,ut):(_t.nodeType===8?(ut=_t.parentNode).insertBefore(st,_t):(ut=_t).appendChild(st),(_t=_t._reactRootContainer)==null&&ut.onclick===null&&(ut.onclick=zu));else if(mt!==4&&(st=st.child)!==null)for(ot(st,ut,_t),st=st.sibling;st!==null;)ot(st,ut,_t),st=st.sibling}:function ot(st,ut,_t){var mt=st.tag,Ht=mt===5||mt===6;if(Ht)st=Ht?st.stateNode:st.stateNode.instance,ut?_t.insertBefore(st,ut):_t.appendChild(st);else if(mt!==4&&(st=st.child)!==null)for(ot(st,ut,_t),st=st.sibling;st!==null;)ot(st,ut,_t),st=st.sibling})(C,V,j)}function Db(C,j){for(var V,it,ot=j,st=!1;;){if(!st){st=ot.return;t:for(;;){if(st===null)throw Error(i(160));switch(V=st.stateNode,st.tag){case 5:it=!1;break t;case 3:case 4:V=V.containerInfo,it=!0;break t}st=st.return}st=!0}if(ot.tag===5||ot.tag===6){t:for(var ut=C,_t=ot,mt=_t;;)if(Nb(ut,mt),mt.child!==null&&mt.tag!==4)mt.child.return=mt,mt=mt.child;else{if(mt===_t)break;for(;mt.sibling===null;){if(mt.return===null||mt.return===_t)break t;mt=mt.return}mt.sibling.return=mt.return,mt=mt.sibling}it?(ut=V,_t=ot.stateNode,(ut.nodeType===8?ut.parentNode:ut).removeChild(_t)):V.removeChild(ot.stateNode)}else if(ot.tag===4){if(ot.child!==null){V=ot.stateNode.containerInfo,it=!0,ot=(ot.child.return=ot).child;continue}}else if(Nb(C,ot),ot.child!==null){ot=(ot.child.return=ot).child;continue}if(ot===j)break;for(;ot.sibling===null;){if(ot.return===null||ot.return===j)return;(ot=ot.return).tag===4&&(st=!1)}ot.sibling.return=ot.return,ot=ot.sibling}}function Wp(C,j){switch(j.tag){case 0:case 11:case 14:case 15:case 22:var V=j.updateQueue;if((V=V!==null?V.lastEffect:null)!==null)for(var it=V=V.next;!(3&~it.tag)&&(C=it.destroy,(it.destroy=void 0)!==C&&C()),(it=it.next)!==V;);return;case 1:case 12:case 17:return;case 5:if((V=j.stateNode)!=null){it=j.memoizedProps;var ot=C!==null?C.memoizedProps:it,st=(C=j.type,j.updateQueue);if((j.updateQueue=null)!==st){for(V[Uu]=it,C==="input"&&it.type==="radio"&&it.name!=null&&ct(V,it),ee(C,ot),j=ee(C,it),ot=0;ot<st.length;ot+=2){var ut=st[ot],_t=st[ot+1];ut==="style"?Qt(V,_t):ut==="dangerouslySetInnerHTML"?ht(V,_t):ut==="children"?dt(V,_t):x(V,ut,_t,j)}switch(C){case"input":gt(V,it);break;case"textarea":jt(V,it);break;case"select":C=V._wrapperState.wasMultiple,V._wrapperState.wasMultiple=!!it.multiple,(st=it.value)!=null?Lt(V,!!it.multiple,st,!1):C!==!!it.multiple&&(it.defaultValue!=null?Lt(V,!!it.multiple,it.defaultValue,!0):Lt(V,!!it.multiple,it.multiple?[]:"",!1))}}}return;case 6:if(j.stateNode===null)throw Error(i(162));return void(j.stateNode.nodeValue=j.memoizedProps);case 3:return void((V=j.stateNode).hydrate&&(V.hydrate=!1,Nn(V.containerInfo)));case 13:return j.memoizedState!==null&&(Qp=Sr(),Pb(j.child,!0)),void Lb(j);case 19:return void Lb(j);case 23:case 24:return void Pb(j,j.memoizedState!==null)}throw Error(i(163))}function Lb(C){var j,V=C.updateQueue;V!==null&&((C.updateQueue=null)===(j=C.stateNode)&&(j=C.stateNode=new mC),V.forEach(function(it){var ot=(function(st,ut){var _t=st.stateNode;_t!==null&&_t.delete(ut),(ut=0)===ut&&(2&(ut=st.mode)?4&ut?(ut=Fr(62914560&~(ra=ra===0?tl:ra)))===0&&(ut=4194304):ut=Gs()===99?1:2:ut=1),_t=Zr(),(st=pd(st,ut))!==null&&(Ta(st,ut,_t),so(st,_t))}).bind(null,C,it);j.has(it)||(j.add(it),it.then(ot,ot))}))}var bC=Math.ceil,sd=E.ReactCurrentDispatcher,Kp=E.ReactCurrentOwner,fn=0,Rr=null,cr=null,Cr=0,Ga=0,Gp=Yi(0),br=0,ld=null,tl=0,gc=0,el=0,Yp=0,Zp=null,Qp=0,Xp=1/0;function nl(){Xp=Sr()+500}var Bb,Ye=null,cd=!1,th=null,Jo=null,na=!1,mc=null,yc=90,eh=[],nh=[],bi=null,bc=0,rh=null,ud=-1,ra=0,dd=0,vc=null,fd=!1;function Zr(){return 48&fn?Sr():ud!==-1?ud:ud=Sr()}function oa(C){return 2&(C=C.mode)?4&C?(ra===0&&(ra=tl),sC.transition!==0?(dd!==0&&(dd=Zp!==null?Zp.pendingLanes:0),C=ra,j=4186112&~dd,(j&=-j)!=0||(j=(C=4186112&~C)&-C)==0&&(j=8192),j):(C=Gs(),oo(4&fn&&C===98?12:C=function(V){switch(V){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(C),ra))):Gs()===99?1:2:1;var j}function ia(C,j,V){if(50<bc)throw bc=0,rh=null,Error(i(185));var it;(C=pd(C,j))!==null&&(Ta(C,j,V),C===Rr&&(el|=j,br===4&&rl(C,Cr)),it=Gs(),j===1?8&fn&&!(48&fn)?oh(C):(so(C,V),fn===0&&(nl(),Uo())):(!(4&fn)||it!==98&&it!==99||(bi===null?bi=new Set([C]):bi.add(C)),so(C,V)),Zp=C)}function pd(C,j){C.lanes|=j;var V=C.alternate;for(V!==null&&(V.lanes|=j),C=(V=C).return;C!==null;)C.childLanes|=j,(V=C.alternate)!==null&&(V.childLanes|=j),C=(V=C).return;return V.tag===3?V.stateNode:null}function so(C,j){for(var V=C.callbackNode,it=C.suspendedLanes,ot=C.pingedLanes,st=C.expirationTimes,ut=C.pendingLanes;0<ut;){var _t,mt=31-xo(ut),Ht=1<<mt,ie=st[mt];ie===-1?Ht&it&&!(Ht&ot)||(ie=j,Rn(Ht),_t=gn,st[mt]=10<=_t?ie+250:6<=_t?ie+5e3:-1):ie<=j&&(C.expiredLanes|=Ht),ut&=~Ht}if(it=Io(C,C===Rr?Cr:0),j=gn,it===0)V!==null&&(V!==Cp&&wp(V),C.callbackNode=null,C.callbackPriority=0);else{if(V!==null){if(C.callbackPriority===j)return;V!==Cp&&wp(V)}V=j===15?(V=oh.bind(null,C),gi===null?(gi=[V],Ju=xp(qu,Vy)):gi.push(V),Cp):j===14?nc(99,oh.bind(null,C)):nc(V=function(ue){switch(ue){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(i(358,ue))}}(j),Fb.bind(null,C)),C.callbackPriority=j,C.callbackNode=V}}function Fb(C){if(ud=-1,(dd=ra=0)!=(48&fn))throw Error(i(327));var j=C.callbackNode;if(aa()&&C.callbackNode!==j)return null;var V=Io(C,C===Rr?Cr:0);if(V===0)return null;var it=V,ot=fn,st=(fn|=16,Hb());for(Rr===C&&Cr===it||(nl(),ol(C,it));;)try{for(;cr!==null&&!oC();)qb(cr);break}catch(_t){$b(C,_t)}if(kp(),sd.current=st,fn=ot,it=cr!==null?0:(Rr=null,Cr=0,br),tl&el)ol(C,0);else if(it!==0){if(it===2&&(fn|=64,C.hydrate&&(C.hydrate=!1,mp(C.containerInfo)),(V=Pr(C))!==0&&(it=_c(C,V))),it===1)throw j=ld,ol(C,0),rl(C,V),so(C,Sr()),j;switch(C.finishedWork=C.current.alternate,C.finishedLanes=V,it){case 0:case 1:throw Error(i(345));case 2:case 5:il(C);break;case 3:if(rl(C,V),(62914560&V)===V&&10<(it=Qp+500-Sr())){if(Io(C,0)!==0)break;if(((ot=C.suspendedLanes)&V)!==V){Zr(),C.pingedLanes|=C.suspendedLanes&ot;break}C.timeoutHandle=Iy(il.bind(null,C),it);break}il(C);break;case 4:if(rl(C,V),(4186112&V)===V)break;for(it=C.eventTimes,ot=-1;0<V;){var ut=31-xo(V);st=1<<ut,ot<(ut=it[ut])&&(ot=ut),V&=~st}if(V=ot,10<(V=((V=Sr()-V)<120?120:V<480?480:V<1080?1080:V<1920?1920:V<3e3?3e3:V<4320?4320:1960*bC(V/1960))-V)){C.timeoutHandle=Iy(il.bind(null,C),V);break}il(C);break;default:throw Error(i(329))}}return so(C,Sr()),C.callbackNode===j?Fb.bind(null,C):null}function rl(C,j){for(j=j&~Yp&~el,C.suspendedLanes|=j,C.pingedLanes&=~j,C=C.expirationTimes;0<j;){var V=31-xo(j),it=1<<V;C[V]=-1,j&=~it}}function oh(C){if(48&fn)throw Error(i(327));var j,V;if(aa(),C===Rr&&C.expiredLanes&Cr?(V=_c(C,j=Cr),tl&el&&(V=_c(C,j=Io(C,j)))):V=_c(C,j=Io(C,0)),C.tag!==0&&V===2&&(fn|=64,C.hydrate&&(C.hydrate=!1,mp(C.containerInfo)),(j=Pr(C))!==0&&(V=_c(C,j))),V===1)throw V=ld,ol(C,0),rl(C,j),so(C,Sr()),V;return C.finishedWork=C.current.alternate,C.finishedLanes=j,il(C),so(C,Sr()),null}function zb(C,j){var V=fn;fn|=1;try{return C(j)}finally{(fn=V)===0&&(nl(),Uo())}}function Ub(C,j){var V=fn;fn=-2&fn|8;try{C(j)}finally{(fn=V)===0&&(nl(),Uo())}}function hd(C,j){Kn(Gp,Ga),Ga|=j,tl|=j}function ih(){Ga=Gp.current,zn(Gp)}function ol(C,j){C.finishedWork=null,C.finishedLanes=0;var V=C.timeoutHandle;if(V!==-1&&(C.timeoutHandle=-1,nC(V)),cr!==null)for(V=cr.return;V!==null;){var it=V;switch(it.tag){case 1:(it=it.type.childContextTypes)!=null&&vp();break;case 3:Qs(),zn(zr),zn(wr),Rp();break;case 5:Pp(it);break;case 4:Qs();break;case 13:case 19:zn(Yn);break;case 10:Op(it);break;case 23:case 24:ih()}V=V.return}cr=la((Rr=C).current,null),Cr=Ga=tl=j,ld=null,Yp=el=gc=br=0}function $b(C,j){for(;;){var V=cr;try{if(kp(),lc.current=ad,nd){for(var it=Zn.memoizedState;it!==null;){var ot=it.queue;ot!==null&&(ot.pending=null),it=it.next}nd=!1}if(cc=0,yr=Ir=Zn=null,uc=!1,(Kp.current=null)===V||V.return===null){br=1,ld=j,cr=null;break}t:{var st=C,ut=V.return,_t=j;if(j=Cr,(Ze=V).flags|=2048,(Ze.firstEffect=Ze.lastEffect=null)!==_t&&typeof _t=="object"&&typeof _t.then=="function"){var mt,Ht,ie,ue,De=_t,mn=(!(2&Ze.mode)&&((mt=Ze.alternate)?(Ze.updateQueue=mt.updateQueue,Ze.memoizedState=mt.memoizedState,Ze.lanes=mt.lanes):(Ze.updateQueue=null,Ze.memoizedState=null)),!!(1&Yn.current)),Kt=ut;do if(ue=(ue=Kt.tag===13)?(Ht=Kt.memoizedState)!==null?Ht.dehydrated!==null:(ie=Kt.memoizedProps).fallback!==void 0&&(ie.unstable_avoidThisFallback!==!0||!mn):ue){var re,me,Le=Kt.updateQueue;if(Le===null?((re=new Set).add(De),Kt.updateQueue=re):Le.add(De),!(2&Kt.mode)){Kt.flags|=64,Ze.flags|=16384,Ze.flags&=-2981,Ze.tag===1&&(Ze.alternate===null?Ze.tag=17:((me=Xi(-1,1)).tag=2,ta(Ze,me))),Ze.lanes|=1;break t}_t=void 0;var Me,Ze=j,ln=st.pingCache;ln===null?(ln=st.pingCache=new gC,_t=new Set,ln.set(De,_t)):(_t=ln.get(De))===void 0&&(_t=new Set,ln.set(De,_t)),_t.has(Ze)||(_t.add(Ze),Me=_C.bind(null,st,De,Ze),De.then(Me,Me)),Kt.flags|=4096,Kt.lanes=j;break t}while((Kt=Kt.return)!==null);_t=Error((Y(Ze.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
|
109
|
+
`+st.stack}return{value:C,source:j,stack:ot}}function Jp(C,j){try{console.error(j.value)}catch(V){setTimeout(function(){throw V})}}var uC=function(C,j){for(var V=j.child;V!==null;){if(V.tag===5||V.tag===6)C.appendChild(V.stateNode);else if(V.tag!==4&&V.child!==null){V=(V.child.return=V).child;continue}if(V===j)break;for(;V.sibling===null;){if(V.return===null||V.return===j)return;V=V.return}V.sibling.return=V.return,V=V.sibling}},dC=function(C,j,V,it){var ot=C.memoizedProps;if(ot!==it){C=j.stateNode,Va($o.current);var st,ut=null;switch(V){case"input":ot=et(C,ot),it=et(C,it),ut=[];break;case"option":ot=Mt(C,ot),it=Mt(C,it),ut=[];break;case"select":ot=e({},ot,{value:void 0}),it=e({},it,{value:void 0}),ut=[];break;case"textarea":ot=Nt(C,ot),it=Nt(C,it),ut=[];break;default:typeof ot.onClick!="function"&&typeof it.onClick=="function"&&(C.onclick=zu)}for(Ht in kt(V,it),V=null,ot)if(!it.hasOwnProperty(Ht)&&ot.hasOwnProperty(Ht)&&ot[Ht]!=null)if(Ht==="style"){var _t=ot[Ht];for(st in _t)_t.hasOwnProperty(st)&&((V=V||{})[st]="")}else Ht!=="dangerouslySetInnerHTML"&&Ht!=="children"&&Ht!=="suppressContentEditableWarning"&&Ht!=="suppressHydrationWarning"&&Ht!=="autoFocus"&&(o.hasOwnProperty(Ht)?ut=ut||[]:(ut=ut||[]).push(Ht,null));for(Ht in it){var mt=it[Ht];if(_t=ot!=null?ot[Ht]:void 0,it.hasOwnProperty(Ht)&&mt!==_t&&(mt!=null||_t!=null))if(Ht==="style")if(_t){for(st in _t)!_t.hasOwnProperty(st)||mt&&mt.hasOwnProperty(st)||((V=V||{})[st]="");for(st in mt)mt.hasOwnProperty(st)&&_t[st]!==mt[st]&&((V=V||{})[st]=mt[st])}else V||(ut=ut||[]).push(Ht,V),V=mt;else Ht==="dangerouslySetInnerHTML"?(mt=mt?mt.__html:void 0,_t=_t?_t.__html:void 0,mt!=null&&_t!==mt&&(ut=ut||[]).push(Ht,mt)):Ht==="children"?typeof mt!="string"&&typeof mt!="number"||(ut=ut||[]).push(Ht,""+mt):Ht!=="suppressContentEditableWarning"&&Ht!=="suppressHydrationWarning"&&(o.hasOwnProperty(Ht)?(mt!=null&&Ht==="onScroll"&&Mn("scroll",C),ut||_t===mt||(ut=[])):typeof mt=="object"&&mt!==null&&mt.$$typeof===U?mt.toString():(ut=ut||[]).push(Ht,mt))}V&&(ut=ut||[]).push("style",V);var Ht=ut;(j.updateQueue=Ht)&&(j.flags|=4)}},fC=function(C,j,V,it){V!==it&&(j.flags|=4)},pC=typeof WeakMap=="function"?WeakMap:Map;function kb(C,j,V){(V=Xi(-1,V)).tag=3,V.payload={element:null};var it=j.value;return V.callback=function(){cd||(cd=!0,Xp=it),Jp(0,j)},V}function Ob(C,j,V){(V=Xi(-1,V)).tag=3;var it,ot=C.type.getDerivedStateFromError;return typeof ot=="function"&&(it=j.value,V.payload=function(){return Jp(0,j),ot(it)}),(C=C.stateNode)!==null&&typeof C.componentDidCatch=="function"&&(V.callback=function(){typeof ot!="function"&&(Jo===null?Jo=new Set([this]):Jo.add(this),Jp(0,j));var st=j.stack;this.componentDidCatch(j.value,{componentStack:st!==null?st:""})}),V}var hC=typeof WeakSet=="function"?WeakSet:Set;function Tb(C){var j=C.ref;if(j!==null)if(typeof j=="function")try{j(null)}catch(V){sa(C,V)}else j.current=null}function gC(C,j,V){switch(V.tag){case 0:case 11:case 15:case 22:if((j=(j=V.updateQueue)!==null?j.lastEffect:null)!==null){C=j=j.next;do;while(!(3&~C.tag)&&(ot=C.create,C.destroy=ot()),(C=C.next)!==j)}if((j=(j=V.updateQueue)!==null?j.lastEffect:null)!==null){C=j=j.next;do{var it=C,ot=it.next;4&(it=it.tag)&&1&it&&(qb(V,C),it=V,st=C,th.push(st,it),na||(na=!0,nc(97,function(){return aa(),null}))),C=ot}while(C!==j)}return;case 1:return C=V.stateNode,4&V.flags&&(j===null?C.componentDidMount():(ot=V.elementType===V.type?j.memoizedProps:Co(V.type,j.memoizedProps),C.componentDidUpdate(ot,j.memoizedState,C.__reactInternalSnapshotBeforeUpdate))),void((j=V.updateQueue)!==null&&Ky(0,j,C));case 3:if((j=V.updateQueue)!==null){if((C=null)!==V.child)switch(V.child.tag){case 5:case 1:C=V.child.stateNode}Ky(0,j,C)}return;case 5:return C=V.stateNode,void(j===null&&4&V.flags&&Ay(V.type,V.memoizedProps)&&C.focus());case 6:case 4:case 12:case 19:case 17:case 20:case 21:case 23:case 24:return;case 13:return void(V.memoizedState===null&&(V=V.alternate)!==null&&(V=V.memoizedState)!==null&&(V=V.dehydrated)!==null&&Nn(V))}var st;throw Error(i(163))}function jb(C,j){for(var V=C;;){if(V.tag===5){var it,ot=V.stateNode;j?typeof(ot=ot.style).setProperty=="function"?ot.setProperty("display","none","important"):ot.display="none":(ot=V.stateNode,it=(it=V.memoizedProps.style)!=null&&it.hasOwnProperty("display")?it.display:null,ot.style.display=Xt("display",it))}else if(V.tag===6)V.stateNode.nodeValue=j?"":V.memoizedProps;else if((V.tag!==23&&V.tag!==24||V.memoizedState===null||V===C)&&V.child!==null){V=(V.child.return=V).child;continue}if(V===C)break;for(;V.sibling===null;){if(V.return===null||V.return===C)return;V=V.return}V.sibling.return=V.return,V=V.sibling}}function Ab(C,j){if(qa&&typeof qa.onCommitFiberUnmount=="function")try{qa.onCommitFiberUnmount(vp,j)}catch{}switch(j.tag){case 0:case 11:case 14:case 15:case 22:if((C=j.updateQueue)!==null&&(C=C.lastEffect)!==null){var V=C=C.next;do{var it=(ot=V).destroy,ot=ot.tag;if(it!==void 0)if(4&ot)qb(j,V);else{ot=j;try{it()}catch(st){sa(ot,st)}}}while((V=V.next)!==C)}break;case 1:if(Tb(j),typeof(C=j.stateNode).componentWillUnmount=="function")try{C.props=j.memoizedProps,C.state=j.memoizedState,C.componentWillUnmount()}catch(st){sa(j,st)}break;case 5:Tb(j);break;case 4:Rb(C,j)}}function Pb(C){C.alternate=null,C.child=null,C.dependencies=null,C.firstEffect=null,C.lastEffect=null,C.memoizedProps=null,C.memoizedState=null,C.pendingProps=null,C.return=null,C.updateQueue=null}function Nb(C){return C.tag===5||C.tag===3||C.tag===4}function Ib(C){t:{for(var j=C.return;j!==null;){if(Nb(j))break t;j=j.return}throw Error(i(160))}var V=j;switch(j=V.stateNode,V.tag){case 5:var it=!1;break;case 3:case 4:j=j.containerInfo,it=!0;break;default:throw Error(i(161))}16&V.flags&&(dt(j,""),V.flags&=-17);t:e:for(V=C;;){for(;V.sibling===null;){if(V.return===null||Nb(V.return)){V=null;break t}V=V.return}for(V.sibling.return=V.return,V=V.sibling;V.tag!==5&&V.tag!==6&&V.tag!==18;){if(2&V.flags||V.child===null||V.tag===4)continue e;V=(V.child.return=V).child}if(!(2&V.flags)){V=V.stateNode;break t}}(it?function ot(st,ut,_t){var mt=st.tag,Ht=mt===5||mt===6;if(Ht)st=Ht?st.stateNode:st.stateNode.instance,ut?(_t.nodeType===8?_t.parentNode:_t).insertBefore(st,ut):(_t.nodeType===8?(ut=_t.parentNode).insertBefore(st,_t):(ut=_t).appendChild(st),(_t=_t._reactRootContainer)==null&&ut.onclick===null&&(ut.onclick=zu));else if(mt!==4&&(st=st.child)!==null)for(ot(st,ut,_t),st=st.sibling;st!==null;)ot(st,ut,_t),st=st.sibling}:function ot(st,ut,_t){var mt=st.tag,Ht=mt===5||mt===6;if(Ht)st=Ht?st.stateNode:st.stateNode.instance,ut?_t.insertBefore(st,ut):_t.appendChild(st);else if(mt!==4&&(st=st.child)!==null)for(ot(st,ut,_t),st=st.sibling;st!==null;)ot(st,ut,_t),st=st.sibling})(C,V,j)}function Rb(C,j){for(var V,it,ot=j,st=!1;;){if(!st){st=ot.return;t:for(;;){if(st===null)throw Error(i(160));switch(V=st.stateNode,st.tag){case 5:it=!1;break t;case 3:case 4:V=V.containerInfo,it=!0;break t}st=st.return}st=!0}if(ot.tag===5||ot.tag===6){t:for(var ut=C,_t=ot,mt=_t;;)if(Ab(ut,mt),mt.child!==null&&mt.tag!==4)mt.child.return=mt,mt=mt.child;else{if(mt===_t)break;for(;mt.sibling===null;){if(mt.return===null||mt.return===_t)break t;mt=mt.return}mt.sibling.return=mt.return,mt=mt.sibling}it?(ut=V,_t=ot.stateNode,(ut.nodeType===8?ut.parentNode:ut).removeChild(_t)):V.removeChild(ot.stateNode)}else if(ot.tag===4){if(ot.child!==null){V=ot.stateNode.containerInfo,it=!0,ot=(ot.child.return=ot).child;continue}}else if(Ab(C,ot),ot.child!==null){ot=(ot.child.return=ot).child;continue}if(ot===j)break;for(;ot.sibling===null;){if(ot.return===null||ot.return===j)return;(ot=ot.return).tag===4&&(st=!1)}ot.sibling.return=ot.return,ot=ot.sibling}}function Vp(C,j){switch(j.tag){case 0:case 11:case 14:case 15:case 22:var V=j.updateQueue;if((V=V!==null?V.lastEffect:null)!==null)for(var it=V=V.next;!(3&~it.tag)&&(C=it.destroy,(it.destroy=void 0)!==C&&C()),(it=it.next)!==V;);return;case 1:case 12:case 17:return;case 5:if((V=j.stateNode)!=null){it=j.memoizedProps;var ot=C!==null?C.memoizedProps:it,st=(C=j.type,j.updateQueue);if((j.updateQueue=null)!==st){for(V[Uu]=it,C==="input"&&it.type==="radio"&&it.name!=null&&ct(V,it),ee(C,ot),j=ee(C,it),ot=0;ot<st.length;ot+=2){var ut=st[ot],_t=st[ot+1];ut==="style"?Qt(V,_t):ut==="dangerouslySetInnerHTML"?ht(V,_t):ut==="children"?dt(V,_t):x(V,ut,_t,j)}switch(C){case"input":gt(V,it);break;case"textarea":jt(V,it);break;case"select":C=V._wrapperState.wasMultiple,V._wrapperState.wasMultiple=!!it.multiple,(st=it.value)!=null?Lt(V,!!it.multiple,st,!1):C!==!!it.multiple&&(it.defaultValue!=null?Lt(V,!!it.multiple,it.defaultValue,!0):Lt(V,!!it.multiple,it.multiple?[]:"",!1))}}}return;case 6:if(j.stateNode===null)throw Error(i(162));return void(j.stateNode.nodeValue=j.memoizedProps);case 3:return void((V=j.stateNode).hydrate&&(V.hydrate=!1,Nn(V.containerInfo)));case 13:return j.memoizedState!==null&&(Zp=Sr(),jb(j.child,!0)),void Mb(j);case 19:return void Mb(j);case 23:case 24:return void jb(j,j.memoizedState!==null)}throw Error(i(163))}function Mb(C){var j,V=C.updateQueue;V!==null&&((C.updateQueue=null)===(j=C.stateNode)&&(j=C.stateNode=new hC),V.forEach(function(it){var ot=(function(st,ut){var _t=st.stateNode;_t!==null&&_t.delete(ut),(ut=0)===ut&&(2&(ut=st.mode)?4&ut?(ut=Fr(62914560&~(ra=ra===0?tl:ra)))===0&&(ut=4194304):ut=Gs()===99?1:2:ut=1),_t=Zr(),(st=pd(st,ut))!==null&&(Ta(st,ut,_t),so(st,_t))}).bind(null,C,it);j.has(it)||(j.add(it),it.then(ot,ot))}))}var mC=Math.ceil,sd=E.ReactCurrentDispatcher,Wp=E.ReactCurrentOwner,fn=0,Rr=null,cr=null,Cr=0,Ga=0,Kp=Yi(0),br=0,ld=null,tl=0,gc=0,el=0,Gp=0,Yp=null,Zp=0,Qp=1/0;function nl(){Qp=Sr()+500}var Db,Ye=null,cd=!1,Xp=null,Jo=null,na=!1,mc=null,yc=90,th=[],eh=[],bi=null,bc=0,nh=null,ud=-1,ra=0,dd=0,vc=null,fd=!1;function Zr(){return 48&fn?Sr():ud!==-1?ud:ud=Sr()}function oa(C){return 2&(C=C.mode)?4&C?(ra===0&&(ra=tl),iC.transition!==0?(dd!==0&&(dd=Yp!==null?Yp.pendingLanes:0),C=ra,j=4186112&~dd,(j&=-j)!=0||(j=(C=4186112&~C)&-C)==0&&(j=8192),j):(C=Gs(),oo(4&fn&&C===98?12:C=function(V){switch(V){case 99:return 15;case 98:return 10;case 97:case 96:return 8;case 95:return 2;default:return 0}}(C),ra))):Gs()===99?1:2:1;var j}function ia(C,j,V){if(50<bc)throw bc=0,nh=null,Error(i(185));var it;(C=pd(C,j))!==null&&(Ta(C,j,V),C===Rr&&(el|=j,br===4&&rl(C,Cr)),it=Gs(),j===1?8&fn&&!(48&fn)?rh(C):(so(C,V),fn===0&&(nl(),Uo())):(!(4&fn)||it!==98&&it!==99||(bi===null?bi=new Set([C]):bi.add(C)),so(C,V)),Yp=C)}function pd(C,j){C.lanes|=j;var V=C.alternate;for(V!==null&&(V.lanes|=j),C=(V=C).return;C!==null;)C.childLanes|=j,(V=C.alternate)!==null&&(V.childLanes|=j),C=(V=C).return;return V.tag===3?V.stateNode:null}function so(C,j){for(var V=C.callbackNode,it=C.suspendedLanes,ot=C.pingedLanes,st=C.expirationTimes,ut=C.pendingLanes;0<ut;){var _t,mt=31-xo(ut),Ht=1<<mt,ie=st[mt];ie===-1?Ht&it&&!(Ht&ot)||(ie=j,Rn(Ht),_t=gn,st[mt]=10<=_t?ie+250:6<=_t?ie+5e3:-1):ie<=j&&(C.expiredLanes|=Ht),ut&=~Ht}if(it=Io(C,C===Rr?Cr:0),j=gn,it===0)V!==null&&(V!==Sp&&xp(V),C.callbackNode=null,C.callbackPriority=0);else{if(V!==null){if(C.callbackPriority===j)return;V!==Sp&&xp(V)}V=j===15?(V=rh.bind(null,C),gi===null?(gi=[V],Ju=_p(qu,qy)):gi.push(V),Sp):j===14?nc(99,rh.bind(null,C)):nc(V=function(ue){switch(ue){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(i(358,ue))}}(j),Lb.bind(null,C)),C.callbackPriority=j,C.callbackNode=V}}function Lb(C){if(ud=-1,(dd=ra=0)!=(48&fn))throw Error(i(327));var j=C.callbackNode;if(aa()&&C.callbackNode!==j)return null;var V=Io(C,C===Rr?Cr:0);if(V===0)return null;var it=V,ot=fn,st=(fn|=16,Ub());for(Rr===C&&Cr===it||(nl(),ol(C,it));;)try{for(;cr!==null&&!nC();)$b(cr);break}catch(_t){zb(C,_t)}if(Ep(),sd.current=st,fn=ot,it=cr!==null?0:(Rr=null,Cr=0,br),tl&el)ol(C,0);else if(it!==0){if(it===2&&(fn|=64,C.hydrate&&(C.hydrate=!1,gp(C.containerInfo)),(V=Pr(C))!==0&&(it=_c(C,V))),it===1)throw j=ld,ol(C,0),rl(C,V),so(C,Sr()),j;switch(C.finishedWork=C.current.alternate,C.finishedLanes=V,it){case 0:case 1:throw Error(i(345));case 2:case 5:il(C);break;case 3:if(rl(C,V),(62914560&V)===V&&10<(it=Zp+500-Sr())){if(Io(C,0)!==0)break;if(((ot=C.suspendedLanes)&V)!==V){Zr(),C.pingedLanes|=C.suspendedLanes&ot;break}C.timeoutHandle=Py(il.bind(null,C),it);break}il(C);break;case 4:if(rl(C,V),(4186112&V)===V)break;for(it=C.eventTimes,ot=-1;0<V;){var ut=31-xo(V);st=1<<ut,ot<(ut=it[ut])&&(ot=ut),V&=~st}if(V=ot,10<(V=((V=Sr()-V)<120?120:V<480?480:V<1080?1080:V<1920?1920:V<3e3?3e3:V<4320?4320:1960*mC(V/1960))-V)){C.timeoutHandle=Py(il.bind(null,C),V);break}il(C);break;default:throw Error(i(329))}}return so(C,Sr()),C.callbackNode===j?Lb.bind(null,C):null}function rl(C,j){for(j=j&~Gp&~el,C.suspendedLanes|=j,C.pingedLanes&=~j,C=C.expirationTimes;0<j;){var V=31-xo(j),it=1<<V;C[V]=-1,j&=~it}}function rh(C){if(48&fn)throw Error(i(327));var j,V;if(aa(),C===Rr&&C.expiredLanes&Cr?(V=_c(C,j=Cr),tl&el&&(V=_c(C,j=Io(C,j)))):V=_c(C,j=Io(C,0)),C.tag!==0&&V===2&&(fn|=64,C.hydrate&&(C.hydrate=!1,gp(C.containerInfo)),(j=Pr(C))!==0&&(V=_c(C,j))),V===1)throw V=ld,ol(C,0),rl(C,j),so(C,Sr()),V;return C.finishedWork=C.current.alternate,C.finishedLanes=j,il(C),so(C,Sr()),null}function Bb(C,j){var V=fn;fn|=1;try{return C(j)}finally{(fn=V)===0&&(nl(),Uo())}}function Fb(C,j){var V=fn;fn=-2&fn|8;try{C(j)}finally{(fn=V)===0&&(nl(),Uo())}}function hd(C,j){Kn(Kp,Ga),Ga|=j,tl|=j}function oh(){Ga=Kp.current,zn(Kp)}function ol(C,j){C.finishedWork=null,C.finishedLanes=0;var V=C.timeoutHandle;if(V!==-1&&(C.timeoutHandle=-1,tC(V)),cr!==null)for(V=cr.return;V!==null;){var it=V;switch(it.tag){case 1:(it=it.type.childContextTypes)!=null&&bp();break;case 3:Qs(),zn(zr),zn(wr),Ip();break;case 5:Ap(it);break;case 4:Qs();break;case 13:case 19:zn(Yn);break;case 10:kp(it);break;case 23:case 24:oh()}V=V.return}cr=la((Rr=C).current,null),Cr=Ga=tl=j,ld=null,Gp=el=gc=br=0}function zb(C,j){for(;;){var V=cr;try{if(Ep(),lc.current=ad,nd){for(var it=Zn.memoizedState;it!==null;){var ot=it.queue;ot!==null&&(ot.pending=null),it=it.next}nd=!1}if(cc=0,yr=Ir=Zn=null,uc=!1,(Wp.current=null)===V||V.return===null){br=1,ld=j,cr=null;break}t:{var st=C,ut=V.return,_t=j;if(j=Cr,(Ze=V).flags|=2048,(Ze.firstEffect=Ze.lastEffect=null)!==_t&&typeof _t=="object"&&typeof _t.then=="function"){var mt,Ht,ie,ue,De=_t,mn=(!(2&Ze.mode)&&((mt=Ze.alternate)?(Ze.updateQueue=mt.updateQueue,Ze.memoizedState=mt.memoizedState,Ze.lanes=mt.lanes):(Ze.updateQueue=null,Ze.memoizedState=null)),!!(1&Yn.current)),Kt=ut;do if(ue=(ue=Kt.tag===13)?(Ht=Kt.memoizedState)!==null?Ht.dehydrated!==null:(ie=Kt.memoizedProps).fallback!==void 0&&(ie.unstable_avoidThisFallback!==!0||!mn):ue){var re,me,Le=Kt.updateQueue;if(Le===null?((re=new Set).add(De),Kt.updateQueue=re):Le.add(De),!(2&Kt.mode)){Kt.flags|=64,Ze.flags|=16384,Ze.flags&=-2981,Ze.tag===1&&(Ze.alternate===null?Ze.tag=17:((me=Xi(-1,1)).tag=2,ta(Ze,me))),Ze.lanes|=1;break t}_t=void 0;var Me,Ze=j,ln=st.pingCache;ln===null?(ln=st.pingCache=new pC,_t=new Set,ln.set(De,_t)):(_t=ln.get(De))===void 0&&(_t=new Set,ln.set(De,_t)),_t.has(Ze)||(_t.add(Ze),Me=bC.bind(null,st,De,Ze),De.then(Me,Me)),Kt.flags|=4096,Kt.lanes=j;break t}while((Kt=Kt.return)!==null);_t=Error((Y(Ze.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
|
110
110
|
|
|
111
|
-
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}br!==5&&(br=2),_t=Jp(_t,Ze),Kt=ut;do switch(Kt.tag){case 3:st=_t,Kt.flags|=4096,j&=-j,Kt.lanes|=j,Gy(Kt,Tb(0,st,j));break t;case 1:st=_t;var Xe=Kt.type,Qe=Kt.stateNode;if(!(64&Kt.flags||typeof Xe.getDerivedStateFromError!="function"&&(Qe===null||typeof Qe.componentDidCatch!="function"||Jo!==null&&Jo.has(Qe)))){Kt.flags|=4096,j&=-j,Kt.lanes|=j,Gy(Kt,jb(Kt,st,j));break t}}while((Kt=Kt.return)!==null)}Jb(V)}catch(wn){j=wn,cr===V&&V!==null&&(cr=V=V.return);continue}break}}function Hb(){var C=sd.current;return sd.current=ad,C===null?ad:C}function _c(C,j){var V=fn,it=(fn|=16,Hb());for(Rr===C&&Cr===j||ol(C,j);;)try{for(;cr!==null;)qb(cr);break}catch(ot){$b(C,ot)}if(kp(),fn=V,sd.current=it,cr!==null)throw Error(i(261));return Rr=null,Cr=0,br}function qb(C){var j=Bb(C.alternate,C,Ga);C.memoizedProps=C.pendingProps,j===null?Jb(C):cr=j,Kp.current=null}function Jb(C){var j=C;do{var V=j.alternate;if(C=j.return,2048&j.flags){if((V=function(st){switch(st.tag){case 1:Gr(st.type)&&vp();var ut=st.flags;return 4096&ut?(st.flags=-4097&ut|64,st):null;case 3:if(Qs(),zn(zr),zn(wr),Rp(),64&(ut=st.flags))throw Error(i(285));return st.flags=-4097&ut|64,st;case 5:return Pp(st),null;case 13:return zn(Yn),4096&(ut=st.flags)?(st.flags=-4097&ut|64,st):null;case 19:return zn(Yn),null;case 4:return Qs(),null;case 10:return Op(st),null;case 23:case 24:return ih(),null;default:return null}}(j))!==null)return V.flags&=2047,void(cr=V);C!==null&&(C.firstEffect=C.lastEffect=null,C.flags|=2048)}else{if((V=function(st,ut,_t){var mt=ut.pendingProps;switch(ut.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 Gr(ut.type)&&vp(),null;case 3:return Qs(),zn(zr),zn(wr),Rp(),(mt=ut.stateNode).pendingContext&&(mt.context=mt.pendingContext,mt.pendingContext=null),st!==null&&st.child!==null||(ed(ut)?ut.flags|=4:mt.hydrate||(ut.flags|=256)),null;case 5:Pp(ut);var Ht=Va(sc.current);if(_t=ut.type,st!==null&&ut.stateNode!=null)pC(st,ut,_t,mt),st.ref!==ut.ref&&(ut.flags|=128);else{if(!mt){if(ut.stateNode===null)throw Error(i(166));return null}if(st=Va($o.current),ed(ut)){mt=ut.stateNode,_t=ut.type;var ie,ue=ut.memoizedProps;switch(mt[Gi]=ut,mt[Uu]=ue,_t){case"dialog":Mn("cancel",mt),Mn("close",mt);break;case"iframe":case"object":case"embed":Mn("load",mt);break;case"video":case"audio":for(st=0;st<Ql.length;st++)Mn(Ql[st],mt);break;case"source":Mn("error",mt);break;case"img":case"image":case"link":Mn("error",mt),Mn("load",mt);break;case"details":Mn("toggle",mt);break;case"input":at(mt,ue),Mn("invalid",mt);break;case"select":mt._wrapperState={wasMultiple:!!ue.multiple},Mn("invalid",mt);break;case"textarea":yt(mt,ue),Mn("invalid",mt)}for(ie in kt(_t,ue),st=null,ue)ue.hasOwnProperty(ie)&&(Ht=ue[ie],ie==="children"?typeof Ht=="string"?mt.textContent!==Ht&&(st=["children",Ht]):typeof Ht=="number"&&mt.textContent!==""+Ht&&(st=["children",""+Ht]):o.hasOwnProperty(ie)&&Ht!=null&&ie==="onScroll"&&Mn("scroll",mt));switch(_t){case"input":Q(mt),wt(mt,ue,!0);break;case"textarea":Q(mt),At(mt);break;case"select":case"option":break;default:typeof ue.onClick=="function"&&(mt.onclick=zu)}mt=st,(ut.updateQueue=mt)!==null&&(ut.flags|=4)}else{switch(ie=Ht.nodeType===9?Ht:Ht.ownerDocument,(st=st===It?Ot(_t):st)===It?_t==="script"?((st=ie.createElement("div")).innerHTML="<script><\/script>",st=st.removeChild(st.firstChild)):typeof mt.is=="string"?st=ie.createElement(_t,{is:mt.is}):(st=ie.createElement(_t),_t==="select"&&(ie=st,mt.multiple?ie.multiple=!0:mt.size&&(ie.size=mt.size))):st=ie.createElementNS(st,_t),st[Gi]=ut,st[Uu]=mt,fC(st,ut),ut.stateNode=st,ie=ee(_t,mt),_t){case"dialog":Mn("cancel",st),Mn("close",st),Ht=mt;break;case"iframe":case"object":case"embed":Mn("load",st),Ht=mt;break;case"video":case"audio":for(Ht=0;Ht<Ql.length;Ht++)Mn(Ql[Ht],st);Ht=mt;break;case"source":Mn("error",st),Ht=mt;break;case"img":case"image":case"link":Mn("error",st),Mn("load",st),Ht=mt;break;case"details":Mn("toggle",st),Ht=mt;break;case"input":at(st,mt),Ht=et(st,mt),Mn("invalid",st);break;case"option":Ht=Mt(st,mt);break;case"select":st._wrapperState={wasMultiple:!!mt.multiple},Ht=e({},mt,{value:void 0}),Mn("invalid",st);break;case"textarea":yt(st,mt),Ht=Nt(st,mt),Mn("invalid",st);break;default:Ht=mt}kt(_t,Ht);var De,mn=Ht;for(ue in mn)mn.hasOwnProperty(ue)&&(De=mn[ue],ue==="style"?Qt(st,De):ue==="dangerouslySetInnerHTML"?(De=De?De.__html:void 0)!=null&&ht(st,De):ue==="children"?typeof De=="string"?_t==="textarea"&&De===""||dt(st,De):typeof De=="number"&&dt(st,""+De):ue!=="suppressContentEditableWarning"&&ue!=="suppressHydrationWarning"&&ue!=="autoFocus"&&(o.hasOwnProperty(ue)?De!=null&&ue==="onScroll"&&Mn("scroll",st):De!=null&&x(st,ue,De,ie)));switch(_t){case"input":Q(st),wt(st,mt,!1);break;case"textarea":Q(st),At(st);break;case"option":mt.value!=null&&st.setAttribute("value",""+Z(mt.value));break;case"select":st.multiple=!!mt.multiple,(ue=mt.value)!=null?Lt(st,!!mt.multiple,ue,!1):mt.defaultValue!=null&&Lt(st,!!mt.multiple,mt.defaultValue,!0);break;default:typeof Ht.onClick=="function"&&(st.onclick=zu)}Ny(_t,mt)&&(ut.flags|=4)}ut.ref!==null&&(ut.flags|=128)}return null;case 6:if(st&&ut.stateNode!=null)hC(0,ut,st.memoizedProps,mt);else{if(typeof mt!="string"&&ut.stateNode===null)throw Error(i(166));_t=Va(sc.current),Va($o.current),ed(ut)?(mt=ut.stateNode,_t=ut.memoizedProps,mt[Gi]=ut,mt.nodeValue!==_t&&(ut.flags|=4)):((mt=(_t.nodeType===9?_t:_t.ownerDocument).createTextNode(mt))[Gi]=ut).stateNode=mt}return null;case 13:return zn(Yn),mt=ut.memoizedState,64&ut.flags?(ut.lanes=_t,ut):(mt=mt!==null,_t=!1,st===null?ut.memoizedProps.fallback!==void 0&&ed(ut):_t=st.memoizedState!==null,mt&&!_t&&2&ut.mode&&(st===null&&ut.memoizedProps.unstable_avoidThisFallback!==!0||1&Yn.current?br===0&&(br=3):(br!==0&&br!==3||(br=4),Rr===null||!(134217727&gc)&&!(134217727&el)||rl(Rr,Cr))),(mt||_t)&&(ut.flags|=4),null);case 4:return Qs(),st===null&&Oy(ut.stateNode.containerInfo),null;case 10:return Op(ut),null;case 19:if(zn(Yn),(mt=ut.memoizedState)===null)return null;if(ue=!!(64&ut.flags),(ie=mt.rendering)===null)if(ue)hc(mt,!1);else{if(br!==0||st!==null&&64&st.flags)for(st=ut.child;st!==null;){if((ie=td(st))!==null){for(ut.flags|=64,hc(mt,!1),(ue=ie.updateQueue)!==null&&(ut.updateQueue=ue,ut.flags|=4),mt.lastEffect===null&&(ut.firstEffect=null),ut.lastEffect=mt.lastEffect,mt=_t,_t=ut.child;_t!==null;)st=mt,(ue=_t).flags&=2,ue.nextEffect=null,ue.firstEffect=null,(ue.lastEffect=null)===(ie=ue.alternate)?(ue.childLanes=0,ue.lanes=st,ue.child=null,ue.memoizedProps=null,ue.memoizedState=null,ue.updateQueue=null,ue.dependencies=null,ue.stateNode=null):(ue.childLanes=ie.childLanes,ue.lanes=ie.lanes,ue.child=ie.child,ue.memoizedProps=ie.memoizedProps,ue.memoizedState=ie.memoizedState,ue.updateQueue=ie.updateQueue,ue.type=ie.type,st=ie.dependencies,ue.dependencies=st===null?null:{lanes:st.lanes,firstContext:st.firstContext}),_t=_t.sibling;return Kn(Yn,1&Yn.current|2),ut.child}st=st.sibling}mt.tail!==null&&Sr()>Xp&&(ut.flags|=64,hc(mt,!(ue=!0)),ut.lanes=33554432)}else{if(!ue)if((st=td(ie))!==null){if(ut.flags|=64,ue=!0,(_t=st.updateQueue)!==null&&(ut.updateQueue=_t,ut.flags|=4),hc(mt,!0),mt.tail===null&&mt.tailMode==="hidden"&&!ie.alternate&&!Ho)return(ut=ut.lastEffect=mt.lastEffect)!==null&&(ut.nextEffect=null),null}else 2*Sr()-mt.renderingStartTime>Xp&&_t!==1073741824&&(ut.flags|=64,hc(mt,!(ue=!0)),ut.lanes=33554432);mt.isBackwards?(ie.sibling=ut.child,ut.child=ie):((_t=mt.last)!==null?_t.sibling=ie:ut.child=ie,mt.last=ie)}return mt.tail!==null?(_t=mt.tail,mt.rendering=_t,mt.tail=_t.sibling,mt.lastEffect=ut.lastEffect,mt.renderingStartTime=Sr(),_t.sibling=null,ut=Yn.current,Kn(Yn,ue?1&ut|2:1&ut),_t):null;case 23:case 24:return ih(),st!==null&&st.memoizedState!==null!=(ut.memoizedState!==null)&&mt.mode!=="unstable-defer-without-hiding"&&(ut.flags|=4),null}throw Error(i(156,ut.tag))}(V,j,Ga))!==null)return void(cr=V);if((V=j).tag!==24&&V.tag!==23||V.memoizedState===null||1073741824&Ga||!(4&V.mode)){for(var it=0,ot=V.child;ot!==null;)it|=ot.lanes|ot.childLanes,ot=ot.sibling;V.childLanes=it}C!==null&&!(2048&C.flags)&&(C.firstEffect===null&&(C.firstEffect=j.firstEffect),j.lastEffect!==null&&(C.lastEffect!==null&&(C.lastEffect.nextEffect=j.firstEffect),C.lastEffect=j.lastEffect),1<j.flags&&(C.lastEffect!==null?C.lastEffect.nextEffect=j:C.firstEffect=j,C.lastEffect=j))}if((j=j.sibling)!==null)return void(cr=j)}while(cr=j=C,j!==null);br===0&&(br=5)}function il(C){var j=Gs();return Ja(99,(function(V,it){for(;aa(),mc!==null;);if(48&fn)throw Error(i(327));var ot=V.finishedWork;if(ot===null)return null;if(V.finishedWork=null,V.finishedLanes=0,ot===V.current)throw Error(i(177));V.callbackNode=null;var st=ot.lanes|ot.childLanes,ut=st,_t=V.pendingLanes&~ut;V.pendingLanes=ut,V.suspendedLanes=0,V.pingedLanes=0,V.expiredLanes&=ut,V.mutableReadLanes&=ut,V.entangledLanes&=ut,ut=V.entanglements;for(var mt,Ht=V.eventTimes,ie=V.expirationTimes;0<_t;){var ue=31-xo(_t),De=1<<ue;ut[ue]=0,Ht[ue]=-1,ie[ue]=-1,_t&=~De}if(bi!==null&&!(24&st)&&bi.has(V)&&bi.delete(V),V===Rr&&(cr=Rr=null,Cr=0),(st=1<ot.flags?ot.lastEffect!==null?(ot.lastEffect.nextEffect=ot,ot.firstEffect):ot:ot.firstEffect)!==null){if(ut=fn,fn|=32,Kp.current=null,pp=Kr,cp(Ht=_y())){if("selectionStart"in Ht)ie={start:Ht.selectionStart,end:Ht.selectionEnd};else t:if(ie=(ie=Ht.ownerDocument)&&ie.defaultView||window,(De=ie.getSelection&&ie.getSelection())&&De.rangeCount!==0){ie=De.anchorNode,_t=De.anchorOffset,ue=De.focusNode,De=De.focusOffset;try{ie.nodeType,ue.nodeType}catch{ie=null;break t}var mn=0,Kt=-1,re=-1,me=0,Le=0,Me=Ht,Ze=null;e:for(;;){for(;Me!==ie||_t!==0&&Me.nodeType!==3||(Kt=mn+_t),Me!==ue||De!==0&&Me.nodeType!==3||(re=mn+De),Me.nodeType===3&&(mn+=Me.nodeValue.length),(mt=Me.firstChild)!==null;)Ze=Me,Me=mt;for(;;){if(Me===Ht)break e;if(Ze===ie&&++me===_t&&(Kt=mn),Ze===ue&&++Le===De&&(re=mn),(mt=Me.nextSibling)!==null)break;Ze=(Me=Ze).parentNode}Me=mt}ie=Kt===-1||re===-1?null:{start:Kt,end:re}}else ie=null;ie=ie||{start:0,end:0}}else ie=null;vc=null,fd=Kr=!(hp={focusedElem:Ht,selectionRange:ie}),Ye=st;do try{(function(){for(;Ye!==null;){var yn=Ye.alternate,dn=(fd||vc===null||(8&Ye.flags?pt(Ye,vc)&&(fd=!0):Ye.tag===13&&function(Dn,Gn){return Dn!==null&&((Dn=Dn.memoizedState)===null||Dn.dehydrated!==null)&&(Gn=Gn.memoizedState)!==null&&Gn.dehydrated===null}(yn,Ye)&&pt(Ye,vc)&&(fd=!0)),Ye.flags);256&dn&&function(Dn,Gn){switch(Gn.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:var co,Vo;return 256&Gn.flags&&Dn!==null&&(co=Dn.memoizedProps,Vo=Dn.memoizedState,Gn=(Dn=Gn.stateNode).getSnapshotBeforeUpdate(Gn.elementType===Gn.type?co:Co(Gn.type,co),Vo),Dn.__reactInternalSnapshotBeforeUpdate=Gn);case 3:return 256&Gn.flags&&mp(Gn.stateNode.containerInfo)}throw Error(i(163))}(yn,Ye),!(512&dn)||na||(na=!0,nc(97,function(){return aa(),null})),Ye=Ye.nextEffect}})()}catch(yn){if(Ye===null)throw Error(i(330));sa(Ye,yn),Ye=Ye.nextEffect}while(Ye!==null);vc=null,Ye=st;do try{for(Ht=V;Ye!==null;){var ln,Xe,Qe=Ye.flags;switch(16&Qe&&dt(Ye.stateNode,""),128&Qe&&(ln=Ye.alternate)!==null&&(Xe=ln.ref)!==null&&(typeof Xe=="function"?Xe(null):Xe.current=null),1038&Qe){case 2:Mb(Ye),Ye.flags&=-3;break;case 6:Mb(Ye),Ye.flags&=-3,Wp(Ye.alternate,Ye);break;case 1024:Ye.flags&=-1025;break;case 1028:Ye.flags&=-1025,Wp(Ye.alternate,Ye);break;case 4:Wp(Ye.alternate,Ye);break;case 8:Db(Ht,ie=Ye);var wn=ie.alternate;Ib(ie),wn!==null&&Ib(wn)}Ye=Ye.nextEffect}}catch(yn){if(Ye===null)throw Error(i(330));sa(Ye,yn),Ye=Ye.nextEffect}while(Ye!==null);if(Xe=hp,ln=_y(),Qe=Xe.focusedElem,Ht=Xe.selectionRange,ln!==Qe&&Qe&&Qe.ownerDocument&&function yn(dn,Dn){return!(!dn||!Dn)&&(dn===Dn||(!dn||dn.nodeType!==3)&&(Dn&&Dn.nodeType===3?yn(dn,Dn.parentNode):"contains"in dn?dn.contains(Dn):!!dn.compareDocumentPosition&&!!(16&dn.compareDocumentPosition(Dn))))}(Qe.ownerDocument.documentElement,Qe)){for(Ht!==null&&cp(Qe)&&(ln=Ht.start,(Xe=Ht.end)===void 0&&(Xe=ln),"selectionStart"in Qe?(Qe.selectionStart=ln,Qe.selectionEnd=Math.min(Xe,Qe.value.length)):(Xe=(ln=Qe.ownerDocument||document)&&ln.defaultView||window).getSelection&&(Xe=Xe.getSelection(),ie=Qe.textContent.length,wn=Math.min(Ht.start,ie),Ht=Ht.end===void 0?wn:Math.min(Ht.end,ie),!Xe.extend&&Ht<wn&&(ie=Ht,Ht=wn,wn=ie),ie=vy(Qe,wn),_t=vy(Qe,Ht),ie&&_t&&(Xe.rangeCount!==1||Xe.anchorNode!==ie.node||Xe.anchorOffset!==ie.offset||Xe.focusNode!==_t.node||Xe.focusOffset!==_t.offset)&&((ln=ln.createRange()).setStart(ie.node,ie.offset),Xe.removeAllRanges(),Ht<wn?(Xe.addRange(ln),Xe.extend(_t.node,_t.offset)):(ln.setEnd(_t.node,_t.offset),Xe.addRange(ln))))),ln=[],Xe=Qe;Xe=Xe.parentNode;)Xe.nodeType===1&&ln.push({element:Xe,left:Xe.scrollLeft,top:Xe.scrollTop});for(typeof Qe.focus=="function"&&Qe.focus(),Qe=0;Qe<ln.length;Qe++)(Xe=ln[Qe]).element.scrollLeft=Xe.left,Xe.element.scrollTop=Xe.top}Kr=!!pp,hp=pp=null,V.current=ot,Ye=st;do try{for(Qe=V;Ye!==null;){var On,An,pn=Ye.flags;36&pn&&yC(Qe,Ye.alternate,Ye),128&pn&&(ln=void 0,(On=Ye.ref)!==null&&(An=Ye.stateNode,Ye.tag,ln=An,typeof On=="function"?On(ln):On.current=ln)),Ye=Ye.nextEffect}}catch(yn){if(Ye===null)throw Error(i(330));sa(Ye,yn),Ye=Ye.nextEffect}while(Ye!==null);Ye=null,aC(),fn=ut}else V.current=ot;if(na)na=!1,mc=V,yc=it;else for(Ye=st;Ye!==null;)it=Ye.nextEffect,Ye.nextEffect=null,8&Ye.flags&&((pn=Ye).sibling=null,pn.stateNode=null),Ye=it;if((st=V.pendingLanes)===0&&(Jo=null),st===1?V===rh?bc++:(bc=0,rh=V):bc=0,ot=ot.stateNode,qa&&typeof qa.onCommitFiberRoot=="function")try{qa.onCommitFiberRoot(_p,ot,void 0,!(64&~ot.current.flags))}catch{}if(so(V,Sr()),cd)throw cd=!1,V=th,th=null,V;return 8&fn||Uo(),null}).bind(null,C,j)),null}function aa(){var C;return yc!==90&&(C=97<yc?97:yc,yc=90,Ja(C,vC))}function Vb(C,j){nh.push(j,C),na||(na=!0,nc(97,function(){return aa(),null}))}function vC(){if(mc===null)return!1;var C=mc;if(mc=null,48&fn)throw Error(i(331));var j=fn,V=(fn|=32,nh);nh=[];for(var it=0;it<V.length;it+=2){var ot=V[it],st=V[it+1],ut=ot.destroy;if(ot.destroy=void 0,typeof ut=="function")try{ut()}catch(mt){if(st===null)throw Error(i(330));sa(st,mt)}}for(V=eh,eh=[],it=0;it<V.length;it+=2){ot=V[it],st=V[it+1];try{var _t=ot.create;ot.destroy=_t()}catch(mt){if(st===null)throw Error(i(330));sa(st,mt)}}for(_t=C.current.firstEffect;_t!==null;)C=_t.nextEffect,_t.nextEffect=null,8&_t.flags&&(_t.sibling=null,_t.stateNode=null),_t=C;return fn=j,Uo(),!0}function Wb(C,j,V){ta(C,j=Tb(0,j=Jp(V,j),1)),j=Zr(),(C=pd(C,1))!==null&&(Ta(C,1,j),so(C,j))}function sa(C,j){if(C.tag===3)Wb(C,C,j);else for(var V=C.return;V!==null;){if(V.tag===3){Wb(V,C,j);break}if(V.tag===1){var it,ot=V.stateNode;if(typeof V.type.getDerivedStateFromError=="function"||typeof ot.componentDidCatch=="function"&&(Jo===null||!Jo.has(ot))){if(ta(V,jb(V,C=Jp(j,C),1)),it=Zr(),(V=pd(V,1))!==null)Ta(V,1,it),so(V,it);else if(typeof ot.componentDidCatch=="function"&&(Jo===null||!Jo.has(ot)))try{ot.componentDidCatch(j,C)}catch{}break}}V=V.return}}function _C(C,j,V){var it=C.pingCache;it!==null&&it.delete(j),j=Zr(),C.pingedLanes|=C.suspendedLanes&V,Rr===C&&(Cr&V)===V&&(br===4||br===3&&(62914560&Cr)===Cr&&Sr()-Qp<500?ol(C,0):Yp|=V),so(C,j)}function xC(C,j,V,it){this.tag=C,this.key=V,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=j,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=it,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function lo(C,j,V,it){return new xC(C,j,V,it)}function ah(C){return(C=C.prototype)&&C.isReactComponent}function la(C,j){var V=C.alternate;return V===null?((V=lo(C.tag,j,C.key,C.mode)).elementType=C.elementType,V.type=C.type,V.stateNode=C.stateNode,(V.alternate=C).alternate=V):(V.pendingProps=j,V.type=C.type,V.flags=0,V.nextEffect=null,V.firstEffect=null,V.lastEffect=null),V.childLanes=C.childLanes,V.lanes=C.lanes,V.child=C.child,V.memoizedProps=C.memoizedProps,V.memoizedState=C.memoizedState,V.updateQueue=C.updateQueue,j=C.dependencies,V.dependencies=j===null?null:{lanes:j.lanes,firstContext:j.firstContext},V.sibling=C.sibling,V.index=C.index,V.ref=C.ref,V}function gd(C,j,V,it,ot,st){var ut=2;if(typeof(it=C)=="function")ah(C)&&(ut=1);else if(typeof C=="string")ut=5;else t:switch(C){case P:return al(V.children,ot,st,j);case W:ut=8,ot|=16;break;case O:ut=8,ot|=1;break;case R:return(C=lo(12,V,j,8|ot)).elementType=R,C.type=R,C.lanes=st,C;case $:return(C=lo(13,V,j,ot)).type=$,C.elementType=$,C.lanes=st,C;case M:return(C=lo(19,V,j,ot)).elementType=M,C.lanes=st,C;case G:return sh(V,ot,st,j);case F:return(C=lo(24,V,j,ot)).elementType=F,C.lanes=st,C;default:if(typeof C=="object"&&C!==null)switch(C.$$typeof){case A:ut=10;break t;case z:ut=9;break t;case H:ut=11;break t;case J:ut=14;break t;case K:ut=16,it=null;break t;case N:ut=22;break t}throw Error(i(130,C==null?C:typeof C,""))}return(j=lo(ut,V,j,ot)).elementType=C,j.type=it,j.lanes=st,j}function al(C,j,V,it){return(C=lo(7,C,it,j)).lanes=V,C}function sh(C,j,V,it){return(C=lo(23,C,it,j)).elementType=G,C.lanes=V,C}function lh(C,j,V){return(C=lo(6,C,null,j)).lanes=V,C}function ch(C,j,V){return(j=lo(4,C.children!==null?C.children:[],C.key,j)).lanes=V,j.stateNode={containerInfo:C.containerInfo,pendingChildren:null,implementation:C.implementation},j}function wC(C,j,V){this.tag=j,this.containerInfo=C,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=V,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=xr(0),this.expirationTimes=xr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xr(0),this.mutableSourceEagerHydrationData=null}function md(C,j,V,it){var ot=j.current,st=Zr(),ut=oa(ot);t:if(V){e:{if(Ae(V=V._reactInternals)!==V||V.tag!==1)throw Error(i(170));var _t=V;do switch(_t.tag){case 3:_t=_t.stateNode.context;break e;case 1:if(Gr(_t.type)){_t=_t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}while((_t=_t.return)!==null);throw Error(i(171))}if(V.tag===1){var mt=V.type;if(Gr(mt)){V=By(V,mt,_t);break t}}V=_t}else V=Zi;j.context===null?j.context=V:j.pendingContext=V,(j=Xi(st,ut)).payload={element:C},(it=it===void 0?null:it)!==null&&(j.callback=it),ta(ot,j),ia(ot,ut,st)}function uh(C){return(C=C.current).child?(C.child.tag,C.child.stateNode):null}function Kb(C,j){var V;(C=C.memoizedState)!==null&&C.dehydrated!==null&&(V=C.retryLane,C.retryLane=V!==0&&V<j?V:j)}function dh(C,j){Kb(C,j),(C=C.alternate)&&Kb(C,j)}function fh(C,j,V){var it=V!=null&&V.hydrationOptions!=null&&V.hydrationOptions.mutableSources||null;if(V=new wC(C,j,V!=null&&V.hydrate===!0),j=lo(3,null,null,j===2?7:j===1?3:0),(V.current=j).stateNode=V,Tp(j),C[Vs]=V.current,Oy(C.nodeType===8?C.parentNode:C),it)for(C=0;C<it.length;C++){var ot=(ot=(j=it[C])._getVersion)(j._source);V.mutableSourceEagerHydrationData==null?V.mutableSourceEagerHydrationData=[j,ot]:V.mutableSourceEagerHydrationData.push(j,ot)}this._internalRoot=V}function xc(C){return C&&(C.nodeType===1||C.nodeType===9||C.nodeType===11||C.nodeType===8&&C.nodeValue===" react-mount-point-unstable ")}function yd(C,j,V,it,ot){var st,ut,_t,mt=V._reactRootContainer;return mt?(_t=mt._internalRoot,typeof ot=="function"&&(st=ot,ot=function(){var Ht=uh(_t);st.call(Ht)}),md(j,_t,C,ot)):(_t=(mt=V._reactRootContainer=function(Ht,ie){if(!(ie=ie||!(!(ie=Ht?Ht.nodeType===9?Ht.documentElement:Ht.firstChild:null)||ie.nodeType!==1||!ie.hasAttribute("data-reactroot"))))for(var ue;ue=Ht.lastChild;)Ht.removeChild(ue);return new fh(Ht,0,ie?{hydrate:!0}:void 0)}(V,it))._internalRoot,typeof ot=="function"&&(ut=ot,ot=function(){var Ht=uh(_t);ut.call(Ht)}),Ub(function(){md(j,_t,C,ot)})),uh(_t)}function Gb(C,j){if(xc(j))return function(V,it,ot,st){return{$$typeof:D,key:(st=3<arguments.length&&st!==void 0?st:null)==null?null:""+st,children:V,containerInfo:it,implementation:ot}}(C,j,null,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null);throw Error(i(200))}Bb=function(C,j,V){var it=j.lanes;if(C!==null)if(C.memoizedProps!==j.pendingProps||zr.current)Eo=!0;else{if(!(V&it)){switch(Eo=!1,j.tag){case 3:Sb(j),Ip();break;case 5:rb(j);break;case 1:Gr(j.type)&&Hu(j);break;case 4:Ap(j,j.stateNode.containerInfo);break;case 10:it=j.memoizedProps.value;var ot=j.type._context;Kn(Vu,ot._currentValue),ot._currentValue=it;break;case 13:if(j.memoizedState!==null)return V&j.child.childLanes?Cb(C,j,V):(Kn(Yn,1&Yn.current),(j=yi(C,j,V))!==null?j.sibling:null);Kn(Yn,1&Yn.current);break;case 19:if(it=!!(V&j.childLanes),64&C.flags){if(it)return Ob(C,j,V);j.flags|=64}if((ot=j.memoizedState)!==null&&(ot.rendering=null,ot.tail=null,ot.lastEffect=null),Kn(Yn,Yn.current),it)break;return null;case 23:case 24:return j.lanes=0,_b(C,j,V)}return yi(C,j,V)}Eo=!!(16384&C.flags)}else Eo=!1;switch(j.lanes=0,j.tag){case 2:return it=j.type,C!==null&&(C.alternate=null,j.alternate=null,j.flags|=2),C=j.pendingProps,ot=Ks(j,wr.current),Zs(j,V),ot=Dp(null,j,it,C,ot,V),j.flags|=1,typeof ot=="object"&&ot!==null&&typeof ot.render=="function"&&ot.$$typeof===void 0?(j.tag=1,j.memoizedState=null,j.updateQueue=null,Gr(it)?(st=!0,Hu(j)):st=!1,j.memoizedState=ot.state!==null&&ot.state!==void 0?ot.state:null,Tp(j),typeof(mt=it.getDerivedStateFromProps)=="function"&&Gu(j,0,mt,C),ot.updater=Yu,jp((j.stateNode=ot)._reactInternals=j,it,C,V),$p(null,j,it,!0,st,V)):(j.tag=0,Yr(null,j,ot,V),j.child);case 16:ot=j.elementType;t:{switch(C!==null&&(C.alternate=null,j.alternate=null,j.flags|=2),C=j.pendingProps,ot=(st=ot._init)(ot._payload),j.type=ot,st=j.tag=function(ie){if(typeof ie=="function")return ah(ie)?1:0;if(ie!=null){if((ie=ie.$$typeof)===H)return 11;if(ie===J)return 14}return 2}(ot),C=Co(ot,C),st){case 0:j=Up(null,j,ot,C,V);break t;case 1:j=wb(null,j,ot,C,V);break t;case 11:j=yb(null,j,ot,C,V);break t;case 14:j=bb(null,j,ot,Co(ot.type,C),it,V);break t}throw Error(i(306,ot,""))}return j;case 0:return it=j.type,ot=j.pendingProps,Up(C,j,it,ot=j.elementType===it?ot:Co(it,ot),V);case 1:return it=j.type,ot=j.pendingProps,wb(C,j,it,ot=j.elementType===it?ot:Co(it,ot),V);case 3:if(Sb(j),it=j.updateQueue,C===null||it===null)throw Error(i(282));if(it=j.pendingProps,ot=(ot=j.memoizedState)!==null?ot.element:null,Ky(C,j),rc(j,it,null,V),(it=j.memoizedState.element)===ot)Ip(),j=yi(C,j,V);else{if((st=(ot=j.stateNode).hydrate)&&(ea=Js(j.stateNode.containerInfo.firstChild),mi=j,st=Ho=!0),st){if((C=ot.mutableSourceEagerHydrationData)!=null)for(ot=0;ot<C.length;ot+=2)(st=C[ot])._workInProgressVersionPrimary=C[ot+1],Xs.push(st);for(V=nb(j,null,it,V),j.child=V;V;)V.flags=-3&V.flags|1024,V=V.sibling}else Yr(C,j,it,V),Ip();j=j.child}return j;case 5:return rb(j),C===null&&Np(j),it=j.type,ot=j.pendingProps,st=C!==null?C.memoizedProps:null,mt=ot.children,gp(it,ot)?mt=null:st!==null&&gp(it,st)&&(j.flags|=16),xb(C,j),Yr(C,j,mt,V),j.child;case 6:return C===null&&Np(j),null;case 13:return Cb(C,j,V);case 4:return Ap(j,j.stateNode.containerInfo),it=j.pendingProps,C===null?j.child=Xu(j,null,it,V):Yr(C,j,it,V),j.child;case 11:return it=j.type,ot=j.pendingProps,yb(C,j,it,ot=j.elementType===it?ot:Co(it,ot),V);case 7:return Yr(C,j,j.pendingProps,V),j.child;case 8:case 12:return Yr(C,j,j.pendingProps.children,V),j.child;case 10:t:{it=j.type._context,ot=j.pendingProps,mt=j.memoizedProps;var st=ot.value,ut=j.type._context;if(Kn(Vu,ut._currentValue),ut._currentValue=st,mt!==null)if(ut=mt.value,(st=nr(ut,st)?0:0|(typeof it._calculateChangedBits=="function"?it._calculateChangedBits(ut,st):1073741823))==0){if(mt.children===ot.children&&!zr.current){j=yi(C,j,V);break t}}else for((ut=j.child)!==null&&(ut.return=j);ut!==null;){var _t=ut.dependencies;if(_t!==null)for(var mt=ut.child,Ht=_t.firstContext;Ht!==null;){if(Ht.context===it&&Ht.observedBits&st){ut.tag===1&&((Ht=Xi(-1,V&-V)).tag=2,ta(ut,Ht)),ut.lanes|=V,(Ht=ut.alternate)!==null&&(Ht.lanes|=V),Wy(ut.return,V),_t.lanes|=V;break}Ht=Ht.next}else mt=ut.tag===10&&ut.type===j.type?null:ut.child;if(mt!==null)mt.return=ut;else for(mt=ut;mt!==null;){if(mt===j){mt=null;break}if((ut=mt.sibling)!==null){ut.return=mt.return,mt=ut;break}mt=mt.return}ut=mt}Yr(C,j,ot.children,V),j=j.child}return j;case 9:return ot=j.type,it=(st=j.pendingProps).children,Zs(j,V),it=it(ot=io(ot,st.unstable_observedBits)),j.flags|=1,Yr(C,j,it,V),j.child;case 14:return st=Co(ot=j.type,j.pendingProps),bb(C,j,ot,st=Co(ot.type,st),it,V);case 15:return vb(C,j,j.type,j.pendingProps,it,V);case 17:return it=j.type,ot=j.pendingProps,ot=j.elementType===it?ot:Co(it,ot),C!==null&&(C.alternate=null,j.alternate=null,j.flags|=2),j.tag=1,Gr(it)?(C=!0,Hu(j)):C=!1,Zs(j,V),Xy(j,it,ot),jp(j,it,ot,V),$p(null,j,it,!0,C,V);case 19:return Ob(C,j,V);case 23:case 24:return _b(C,j,V)}throw Error(i(156,j.tag))},fh.prototype.render=function(C){md(C,this._internalRoot,null,null)},fh.prototype.unmount=function(){var C=this._internalRoot,j=C.containerInfo;md(null,C,null,function(){j[Vs]=null})},Dt=function(C){C.tag===13&&(ia(C,4,Zr()),dh(C,4))},$t=function(C){C.tag===13&&(ia(C,67108864,Zr()),dh(C,67108864))},qt=function(C){var j,V;C.tag===13&&(j=Zr(),ia(C,V=oa(C),j),dh(C,V))},Be=function(C,j,V){switch(j){case"input":if(gt(C,V),j=V.name,V.type==="radio"&&j!=null){for(V=C;V.parentNode;)V=V.parentNode;for(V=V.querySelectorAll("input[name="+JSON.stringify(""+j)+'][type="radio"]'),j=0;j<V.length;j++){var it=V[j];if(it!==C&&it.form===C.form){var ot=$u(it);if(!ot)throw Error(i(90));tt(it),gt(it,ot)}}}break;case"textarea":jt(C,V);break;case"select":(j=V.value)!=null&&Lt(C,!!V.multiple,j,!1)}},hn=zb,Tt=function(C,j,V,it,ot){var st=fn;fn|=4;try{return Ja(98,C.bind(null,j,V,it,ot))}finally{(fn=st)===0&&(nl(),Uo())}};var SC=function(C,j){var V=fn;fn|=2;try{return C(j)}finally{(fn=V)===0&&(nl(),Uo())}};if(fr={Events:[tc,Ws,$u,Re,He,aa,{current:!(ae=function(){var C;!(49&fn)&&(bi!==null&&(C=bi,bi=null,C.forEach(function(j){j.expiredLanes|=24&j.pendingLanes,so(j,Sr())})),Uo(),aa())})}]},Sn={bundleType:(t={findFiberByHostInstance:$a,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"}).bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(C){return(C=ve(C))===null?null:C.stateNode},findFiberByHostInstance:t.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&!(Hn=__REACT_DEVTOOLS_GLOBAL_HOOK__).isDisabled&&Hn.supportsFiber)try{_p=Hn.inject(Sn),qa=Hn}catch{}r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fr,r.createPortal=Gb,r.findDOMNode=function(C){if(C==null)return null;if(C.nodeType===1)return C;var j=C._reactInternals;if(j!==void 0)return(C=ve(j))===null?null:C.stateNode;throw typeof C.render=="function"?Error(i(188)):Error(i(268,Object.keys(C)))},r.flushSync=function(C,j){var V=fn;if(48&V)return C(j);fn|=1;try{if(C)return Ja(99,C.bind(null,j))}finally{fn=V,Uo()}},r.hydrate=function(C,j,V){if(xc(j))return yd(null,C,j,!0,V);throw Error(i(200))},r.render=function(C,j,V){if(xc(j))return yd(null,C,j,!1,V);throw Error(i(200))},r.unmountComponentAtNode=function(C){if(xc(C))return!!C._reactRootContainer&&(Ub(function(){yd(null,null,C,!1,function(){C._reactRootContainer=null,C[Vs]=null})}),!0);throw Error(i(40))},r.unstable_batchedUpdates=zb,r.unstable_createPortal=function(C,j){return Gb(C,j,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)},r.unstable_renderSubtreeIntoContainer=function(C,j,V,it){if(!xc(V))throw Error(i(200));if(C==null||C._reactInternals===void 0)throw Error(i(38));return yd(C,j,V,!1,it)},r.version="17.0.2"},{"object-assign":385,react:408,scheduler:414}],401:[function(t,f,r){(function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE=="function")try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}})(),f.exports=t("./cjs/react-dom.production.min.js")},{"./cjs/react-dom.development.js":399,"./cjs/react-dom.production.min.js":400}],402:[function(t,f,r){(function(n){(function(){function e(K){if(typeof K=="object"&&K!==null){var N=K.$$typeof;switch(N){case s:var U=K.type;switch(U){case l:case a:case o:case p:case m:return U;default:var W=U&&U.$$typeof;switch(W){case u:case h:case _:case b:case c:return W;default:return N}}case i:return N}}}var s,i,l,o,a,c,u,h,p,m,b,_,v,w,x,S,E,k,D,P,O,R,A,z,H,$,M,J;n.env.NODE_ENV!=="production"&&(s=60103,i=60106,l=60107,o=60108,a=60114,c=60109,u=60110,h=60112,p=60113,m=60120,b=60115,_=60116,v=60121,w=60122,x=60117,S=60129,E=60131,typeof Symbol=="function"&&Symbol.for&&(s=(k=Symbol.for)("react.element"),i=k("react.portal"),l=k("react.fragment"),o=k("react.strict_mode"),a=k("react.profiler"),c=k("react.provider"),u=k("react.context"),h=k("react.forward_ref"),p=k("react.suspense"),m=k("react.suspense_list"),b=k("react.memo"),_=k("react.lazy"),v=k("react.block"),w=k("react.server.block"),x=k("react.fundamental"),k("react.scope"),k("react.opaque.id"),S=k("react.debug_trace_mode"),k("react.offscreen"),E=k("react.legacy_hidden")),k=u,D=c,P=s,O=h,R=l,A=_,z=b,H=i,$=a,M=o,J=p,r.ContextConsumer=k,r.ContextProvider=D,r.Element=P,r.ForwardRef=O,r.Fragment=R,r.Lazy=A,r.Memo=z,r.Portal=H,r.Profiler=$,r.StrictMode=M,r.Suspense=J,r.isAsyncMode=function(K){return!1},r.isConcurrentMode=function(K){return!1},r.isContextConsumer=function(K){return e(K)===u},r.isContextProvider=function(K){return e(K)===c},r.isElement=function(K){return typeof K=="object"&&K!==null&&K.$$typeof===s},r.isForwardRef=function(K){return e(K)===h},r.isFragment=function(K){return e(K)===l},r.isLazy=function(K){return e(K)===_},r.isMemo=function(K){return e(K)===b},r.isPortal=function(K){return e(K)===i},r.isProfiler=function(K){return e(K)===a},r.isStrictMode=function(K){return e(K)===o},r.isSuspense=function(K){return e(K)===p},r.isValidElementType=function(K){return typeof K=="string"||typeof K=="function"||K===l||K===a||K===S||K===o||K===p||K===m||K===E||typeof K=="object"&&K!==null&&(K.$$typeof===_||K.$$typeof===b||K.$$typeof===c||K.$$typeof===u||K.$$typeof===h||K.$$typeof===x||K.$$typeof===v||K[0]===w)},r.typeOf=e)}).call(this)}).call(this,t("_process"))},{_process:386}],403:[function(t,f,r){var n=60103,e=60106,s=60107,i=60108,l=60114,o=60109,a=60110,c=60112,u=60113,h=60120,p=60115,m=60116,b=60121,_=60122,v=60117,w=60129,x=60131;function S(M){if(typeof M=="object"&&M!==null){var J=M.$$typeof;switch(J){case n:switch(M=M.type){case s:case l:case i:case u:case h:return M;default:switch(M=M&&M.$$typeof){case a:case c:case m:case p:case o:return M;default:return J}}case e:return J}}}typeof Symbol=="function"&&Symbol.for&&(n=(E=Symbol.for)("react.element"),e=E("react.portal"),s=E("react.fragment"),i=E("react.strict_mode"),l=E("react.profiler"),o=E("react.provider"),a=E("react.context"),c=E("react.forward_ref"),u=E("react.suspense"),h=E("react.suspense_list"),p=E("react.memo"),m=E("react.lazy"),b=E("react.block"),_=E("react.server.block"),v=E("react.fundamental"),w=E("react.debug_trace_mode"),x=E("react.legacy_hidden"));var E=o,k=n,D=c,P=s,O=m,R=p,A=e,z=l,H=i,$=u;r.ContextConsumer=a,r.ContextProvider=E,r.Element=k,r.ForwardRef=D,r.Fragment=P,r.Lazy=O,r.Memo=R,r.Portal=A,r.Profiler=z,r.StrictMode=H,r.Suspense=$,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(M){return S(M)===a},r.isContextProvider=function(M){return S(M)===o},r.isElement=function(M){return typeof M=="object"&&M!==null&&M.$$typeof===n},r.isForwardRef=function(M){return S(M)===c},r.isFragment=function(M){return S(M)===s},r.isLazy=function(M){return S(M)===m},r.isMemo=function(M){return S(M)===p},r.isPortal=function(M){return S(M)===e},r.isProfiler=function(M){return S(M)===l},r.isStrictMode=function(M){return S(M)===i},r.isSuspense=function(M){return S(M)===u},r.isValidElementType=function(M){return typeof M=="string"||typeof M=="function"||M===s||M===l||M===w||M===i||M===u||M===h||M===x||typeof M=="object"&&M!==null&&(M.$$typeof===m||M.$$typeof===p||M.$$typeof===o||M.$$typeof===a||M.$$typeof===c||M.$$typeof===v||M.$$typeof===b||M[0]===_)},r.typeOf=S},{}],404:[function(t,f,r){arguments[4][381][0].apply(r,arguments)},{"./cjs/react-is.development.js":402,"./cjs/react-is.production.min.js":403,_process:386,dup:381}],405:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0});var n=Object.assign||function(l){for(var o=1;o<arguments.length;o++){var a,c=arguments[o];for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(l[a]=c[a])}return l},e=s(t("react"));function s(l){return l&&l.__esModule?l:{default:l}}t=s(t("localized-strings"));var i=/(\{[\d|\w]+\})/;t.default.prototype.formatString=function(l){for(var o=arguments.length,a=Array(1<o?o-1:0),c=1;c<o;c++)a[c-1]=arguments[c];var u=!1;return l=(l||"").split(i).filter(function(h){return!!h}).map(function(h,p){if(h.match(i)){var m=h.slice(1,-1),b=a[m];if(b==null){if((m=a[0][m])===void 0)return b;b=m}return e.default.isValidElement(b)?(u=!0,e.default.Children.toArray(b).map(function(_){return n({},_,{key:p.toString()})})):b}return h}),u?l:l.join("")},r.default=t.default},{"localized-strings":383,react:408}],406:[function(t,f,r){},{"object-assign":385}],407:[function(t,f,r){var n=t("object-assign"),e=60103,s=60106,i=(r.Fragment=60107,r.StrictMode=60108,r.Profiler=60114,60109),l=60110,o=60112,a=(r.Suspense=60113,60115),c=60116,u=(typeof Symbol=="function"&&Symbol.for&&(e=(t=Symbol.for)("react.element"),s=t("react.portal"),r.Fragment=t("react.fragment"),r.StrictMode=t("react.strict_mode"),r.Profiler=t("react.profiler"),i=t("react.provider"),l=t("react.context"),o=t("react.forward_ref"),r.Suspense=t("react.suspense"),a=t("react.memo"),c=t("react.lazy")),typeof Symbol=="function"&&Symbol.iterator);function h($){for(var M="https://reactjs.org/docs/error-decoder.html?invariant="+$,J=1;J<arguments.length;J++)M+="&args[]="+encodeURIComponent(arguments[J]);return"Minified React error #"+$+"; visit "+M+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m={};function b($,M,J){this.props=$,this.context=M,this.refs=m,this.updater=J||p}function _(){}function v($,M,J){this.props=$,this.context=M,this.refs=m,this.updater=J||p}b.prototype.isReactComponent={},b.prototype.setState=function($,M){if(typeof $!="object"&&typeof $!="function"&&$!=null)throw Error(h(85));this.updater.enqueueSetState(this,$,M,"setState")},b.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")},_.prototype=b.prototype;var w=((t=v.prototype=new _).constructor=v,n(t,b.prototype),t.isPureReactComponent=!0,{current:null}),x=Object.prototype.hasOwnProperty,S={key:!0,ref:!0,__self:!0,__source:!0};function E($,M,J){var K,N={},U=null,W=null;if(M!=null)for(K in M.ref!==void 0&&(W=M.ref),M.key!==void 0&&(U=""+M.key),M)x.call(M,K)&&!S.hasOwnProperty(K)&&(N[K]=M[K]);var G=arguments.length-2;if(G===1)N.children=J;else if(1<G){for(var F=Array(G),q=0;q<G;q++)F[q]=arguments[q+2];N.children=F}if($&&$.defaultProps)for(K in G=$.defaultProps)N[K]===void 0&&(N[K]=G[K]);return{$$typeof:e,type:$,key:U,ref:W,props:N,_owner:w.current}}function k($){return typeof $=="object"&&$!==null&&$.$$typeof===e}var D=/\/+/g;function P($,M){return typeof $=="object"&&$!==null&&$.key!=null?($=""+$.key,J={"=":"=0",":":"=2"},"$"+$.replace(/[=:]/g,function(K){return J[K]})):M.toString(36);var J}function O($,M,J,K,N){var U,W,G=!1;if(($=(q=typeof $)!="undefined"&&q!=="boolean"?$:null)===null)G=!0;else switch(q){case"string":case"number":G=!0;break;case"object":switch($.$$typeof){case e:case s:G=!0}}if(G)return N=N(G=$),$=K===""?"."+P(G,0):K,Array.isArray(N)?(J="",O(N,M,J=$!=null?$.replace(D,"$&/")+"/":J,"",function(I){return I})):N!=null&&(k(N)&&(W=J+(!(U=N).key||G&&G.key===N.key?"":(""+N.key).replace(D,"$&/")+"/")+$,N={$$typeof:e,type:U.type,key:W,ref:U.ref,props:U.props,_owner:U._owner}),M.push(N)),1;if(G=0,K=K===""?".":K+":",Array.isArray($))for(var F=0;F<$.length;F++){var q,T=K+P(q=$[F],F);G+=O(q,M,J,T,N)}else if(typeof(T=(W=$)!==null&&typeof W=="object"&&typeof(W=u&&W[u]||W["@@iterator"])=="function"?W:null)=="function")for($=T.call($),F=0;!(q=$.next()).done;)G+=O(q=q.value,M,J,T=K+P(q,F++),N);else if(q==="object")throw M=""+$,Error(h(31,M==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":M));return G}function R($,M,J){if($==null)return $;var K=[],N=0;return O($,K,"","",function(U){return M.call(J,U,N++)}),K}function A($){var M;if($._status===-1&&(M=(M=$._result)(),$._status=0,($._result=M).then(function(J){$._status===0&&(J=J.default,$._status=1,$._result=J)},function(J){$._status===0&&($._status=2,$._result=J)})),$._status===1)return $._result;throw $._result}var z={current:null};function H(){var $=z.current;if($===null)throw Error(h(321));return $}t={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:n},r.Children={map:R,forEach:function($,M,J){R($,function(){M.apply(this,arguments)},J)},count:function($){var M=0;return R($,function(){M++}),M},toArray:function($){return R($,function(M){return M})||[]},only:function($){if(k($))return $;throw Error(h(143))}},r.Component=b,r.PureComponent=v,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t,r.cloneElement=function($,M,J){if($==null)throw Error(h(267,$));var K=n({},$.props),N=$.key,U=$.ref,W=$._owner;if(M!=null)for(G in M.ref!==void 0&&(U=M.ref,W=w.current),M.key!==void 0&&(N=""+M.key),$.type&&$.type.defaultProps&&(F=$.type.defaultProps),M)x.call(M,G)&&!S.hasOwnProperty(G)&&(K[G]=(M[G]===void 0&&F!==void 0?F:M)[G]);var G=arguments.length-2;if(G===1)K.children=J;else if(1<G){for(var F=Array(G),q=0;q<G;q++)F[q]=arguments[q+2];K.children=F}return{$$typeof:e,type:$.type,key:N,ref:U,props:K,_owner:W}},r.createContext=function($,M){return($={$$typeof:l,_calculateChangedBits:M=M===void 0?null:M,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:i,_context:$},$.Consumer=$},r.createElement=E,r.createFactory=function($){var M=E.bind(null,$);return M.type=$,M},r.createRef=function(){return{current:null}},r.forwardRef=function($){return{$$typeof:o,render:$}},r.isValidElement=k,r.lazy=function($){return{$$typeof:c,_payload:{_status:-1,_result:$},_init:A}},r.memo=function($,M){return{$$typeof:a,type:$,compare:M===void 0?null:M}},r.useCallback=function($,M){return H().useCallback($,M)},r.useContext=function($,M){return H().useContext($,M)},r.useDebugValue=function(){},r.useEffect=function($,M){return H().useEffect($,M)},r.useImperativeHandle=function($,M,J){return H().useImperativeHandle($,M,J)},r.useLayoutEffect=function($,M){return H().useLayoutEffect($,M)},r.useMemo=function($,M){return H().useMemo($,M)},r.useReducer=function($,M,J){return H().useReducer($,M,J)},r.useRef=function($){return H().useRef($)},r.useState=function($){return H().useState($)},r.version="17.0.2"},{"object-assign":385}],408:[function(t,f,r){f.exports=t("./cjs/react.production.min.js")},{"./cjs/react.development.js":406,"./cjs/react.production.min.js":407}],409:[function(t,f,r){f=function(n){var e,s=Object.prototype,i=s.hasOwnProperty,l=(E=typeof Symbol=="function"?Symbol:{}).iterator||"@@iterator",o=E.asyncIterator||"@@asyncIterator",a=E.toStringTag||"@@toStringTag";function c(M,J,K){return Object.defineProperty(M,J,{value:K,enumerable:!0,configurable:!0,writable:!0}),M[J]}try{c({},"")}catch{c=function(J,K,N){return J[K]=N}}function u(M,J,K,N){var U,W,G,F;return J=J&&J.prototype instanceof w?J:w,J=Object.create(J.prototype),N=new z(N||[]),J._invoke=(U=M,W=K,G=N,F=p,function(q,T){if(F===b)throw new Error("Generator is already running");if(F===_){if(q==="throw")throw T;return $()}for(G.method=q,G.arg=T;;){var I=G.delegate;if(I&&(I=function L(B,Y){var Z=B.iterator[Y.method];if(Z===e){if(Y.delegate=null,Y.method==="throw"){if(B.iterator.return&&(Y.method="return",Y.arg=e,L(B,Y),Y.method==="throw"))return v;Y.method="throw",Y.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}return(Z=h(Z,B.iterator,Y.arg)).type==="throw"?(Y.method="throw",Y.arg=Z.arg,Y.delegate=null,v):(Z=Z.arg)?Z.done?(Y[B.resultName]=Z.value,Y.next=B.nextLoc,Y.method!=="return"&&(Y.method="next",Y.arg=e),Y.delegate=null,v):Z:(Y.method="throw",Y.arg=new TypeError("iterator result is not an object"),Y.delegate=null,v)}(I,G),I)){if(I===v)continue;return I}if(G.method==="next")G.sent=G._sent=G.arg;else if(G.method==="throw"){if(F===p)throw F=_,G.arg;G.dispatchException(G.arg)}else G.method==="return"&&G.abrupt("return",G.arg);if(F=b,(I=h(U,W,G)).type==="normal"){if(F=G.done?_:m,I.arg!==v)return{value:I.arg,done:G.done}}else I.type==="throw"&&(F=_,G.method="throw",G.arg=I.arg)}}),J}function h(M,J,K){try{return{type:"normal",arg:M.call(J,K)}}catch(N){return{type:"throw",arg:N}}}n.wrap=u;var p="suspendedStart",m="suspendedYield",b="executing",_="completed",v={};function w(){}function x(){}function S(){}var E,k,D=(c(E={},l,function(){return this}),(k=(k=Object.getPrototypeOf)&&k(k(H([]))))&&k!==s&&i.call(k,l)&&(E=k),S.prototype=w.prototype=Object.create(E));function P(M){["next","throw","return"].forEach(function(J){c(M,J,function(K){return this._invoke(J,K)})})}function O(M,J){var K;this._invoke=function(N,U){function W(){return new J(function(G,F){(function q(T,I,L,B){var Y;if((T=h(M[T],M,I)).type!=="throw")return(I=(Y=T.arg).value)&&typeof I=="object"&&i.call(I,"__await")?J.resolve(I.__await).then(function(Z){q("next",Z,L,B)},function(Z){q("throw",Z,L,B)}):J.resolve(I).then(function(Z){Y.value=Z,L(Y)},function(Z){return q("throw",Z,L,B)});B(T.arg)})(N,U,G,F)})}return K=K?K.then(W,W):W()}}function R(M){var J={tryLoc:M[0]};1 in M&&(J.catchLoc=M[1]),2 in M&&(J.finallyLoc=M[2],J.afterLoc=M[3]),this.tryEntries.push(J)}function A(M){var J=M.completion||{};J.type="normal",delete J.arg,M.completion=J}function z(M){this.tryEntries=[{tryLoc:"root"}],M.forEach(R,this),this.reset(!0)}function H(M){if(M){var J,K=M[l];if(K)return K.call(M);if(typeof M.next=="function")return M;if(!isNaN(M.length))return J=-1,(K=function N(){for(;++J<M.length;)if(i.call(M,J))return N.value=M[J],N.done=!1,N;return N.value=e,N.done=!0,N}).next=K}return{next:$}}function $(){return{value:e,done:!0}}return c(D,"constructor",x.prototype=S),c(S,"constructor",x),x.displayName=c(S,a,"GeneratorFunction"),n.isGeneratorFunction=function(M){return!!(M=typeof M=="function"&&M.constructor)&&(M===x||(M.displayName||M.name)==="GeneratorFunction")},n.mark=function(M){return Object.setPrototypeOf?Object.setPrototypeOf(M,S):(M.__proto__=S,c(M,a,"GeneratorFunction")),M.prototype=Object.create(D),M},n.awrap=function(M){return{__await:M}},P(O.prototype),c(O.prototype,o,function(){return this}),n.AsyncIterator=O,n.async=function(M,J,K,N,U){U===void 0&&(U=Promise);var W=new O(u(M,J,K,N),U);return n.isGeneratorFunction(J)?W:W.next().then(function(G){return G.done?G.value:W.next()})},P(D),c(D,a,"Generator"),c(D,l,function(){return this}),c(D,"toString",function(){return"[object Generator]"}),n.keys=function(M){var J,K=[];for(J in M)K.push(J);return K.reverse(),function N(){for(;K.length;){var U=K.pop();if(U in M)return N.value=U,N.done=!1,N}return N.done=!0,N}},n.values=H,z.prototype={constructor:z,reset:function(M){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!M)for(var J in this)J.charAt(0)==="t"&&i.call(this,J)&&!isNaN(+J.slice(1))&&(this[J]=e)},stop:function(){this.done=!0;var M=this.tryEntries[0].completion;if(M.type==="throw")throw M.arg;return this.rval},dispatchException:function(M){if(this.done)throw M;var J=this;function K(q,T){return W.type="throw",W.arg=M,J.next=q,T&&(J.method="next",J.arg=e),!!T}for(var N=this.tryEntries.length-1;0<=N;--N){var U=this.tryEntries[N],W=U.completion;if(U.tryLoc==="root")return K("end");if(U.tryLoc<=this.prev){var G=i.call(U,"catchLoc"),F=i.call(U,"finallyLoc");if(G&&F){if(this.prev<U.catchLoc)return K(U.catchLoc,!0);if(this.prev<U.finallyLoc)return K(U.finallyLoc)}else if(G){if(this.prev<U.catchLoc)return K(U.catchLoc,!0)}else{if(!F)throw new Error("try statement without catch or finally");if(this.prev<U.finallyLoc)return K(U.finallyLoc)}}}},abrupt:function(M,J){for(var K=this.tryEntries.length-1;0<=K;--K){var N=this.tryEntries[K];if(N.tryLoc<=this.prev&&i.call(N,"finallyLoc")&&this.prev<N.finallyLoc){var U=N;break}}var W=(U=U&&(M==="break"||M==="continue")&&U.tryLoc<=J&&J<=U.finallyLoc?null:U)?U.completion:{};return W.type=M,W.arg=J,U?(this.method="next",this.next=U.finallyLoc,v):this.complete(W)},complete:function(M,J){if(M.type==="throw")throw M.arg;return M.type==="break"||M.type==="continue"?this.next=M.arg:M.type==="return"?(this.rval=this.arg=M.arg,this.method="return",this.next="end"):M.type==="normal"&&J&&(this.next=J),v},finish:function(M){for(var J=this.tryEntries.length-1;0<=J;--J){var K=this.tryEntries[J];if(K.finallyLoc===M)return this.complete(K.completion,K.afterLoc),A(K),v}},catch:function(M){for(var J=this.tryEntries.length-1;0<=J;--J){var K,N,U=this.tryEntries[J];if(U.tryLoc===M)return(K=U.completion).type==="throw"&&(N=K.arg,A(U)),N}throw new Error("illegal catch attempt")},delegateYield:function(M,J,K){return this.delegate={iterator:H(M),resultName:J,nextLoc:K},this.method==="next"&&(this.arg=e),v}},n}(typeof f=="object"?f.exports:{});try{regeneratorRuntime=f}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=f:Function("r","regeneratorRuntime = r")(f)}},{}],410:[function(t,f,r){},{}],411:[function(t,f,r){var n=0;r.__interactionsRef=null,r.__subscriberRef=null,r.unstable_clear=function(e){return e()},r.unstable_getCurrent=function(){return null},r.unstable_getThreadID=function(){return++n},r.unstable_subscribe=function(){},r.unstable_trace=function(e,s,i){return i()},r.unstable_unsubscribe=function(){},r.unstable_wrap=function(e){return e}},{}],412:[function(t,f,r){},{}],413:[function(t,f,r){var n,e,s,i,l,o,a,c,u,h,p,m,b,_,v,w,x,S;function E(G,F){var q=G.length;for(G.push(F);;){var T=q-1>>>1,I=G[T];if(!(I!==void 0&&0<P(I,F)))break;G[T]=F,G[q]=I,q=T}}function k(G){return(G=G[0])===void 0?null:G}function D(G){var F=G[0];if(F!==void 0){var q=G.pop();if(q!==F){G[0]=q;for(var T=0,I=G.length;T<I;){var L=2*(T+1)-1,B=G[L],Y=1+L,Z=G[Y];if(B!==void 0&&P(B,q)<0)T=Z!==void 0&&P(Z,B)<0?(G[T]=Z,G[Y]=q,Y):(G[T]=B,G[L]=q,L);else{if(!(Z!==void 0&&P(Z,q)<0))break;G[T]=Z,G[Y]=q,T=Y}}}}}function P(G,F){var q=G.sortIndex-F.sortIndex;return q!=0?q:G.id-F.id}typeof performance=="object"&&typeof performance.now=="function"?(e=performance,r.unstable_now=function(){return e.now()}):(s=Date,i=s.now(),r.unstable_now=function(){return s.now()-i}),typeof window>"u"||typeof MessageChannel!="function"?(o=l=null,a=function(){if(l!==null)try{var G=r.unstable_now();l(!0,G),l=null}catch(F){throw setTimeout(a,0),F}},c=function(G){l!==null?setTimeout(c,0,G):(l=G,setTimeout(a,0))},u=function(G,F){o=setTimeout(G,F)},h=function(){clearTimeout(o)},r.unstable_shouldYield=function(){return!1},n=r.unstable_forceFrameRate=function(){}):(p=window.setTimeout,m=window.clearTimeout,typeof console<"u"&&(W=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof W!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),b=!1,_=null,v=-1,w=5,x=0,r.unstable_shouldYield=function(){return r.unstable_now()>=x},n=function(){},r.unstable_forceFrameRate=function(G){G<0||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<G?Math.floor(1e3/G):5},W=new MessageChannel,S=W.port2,W.port1.onmessage=function(){if(_!==null){var G=r.unstable_now();x=G+w;try{_(!0,G)?S.postMessage(null):(b=!1,_=null)}catch(F){throw S.postMessage(null),F}}else b=!1},c=function(G){_=G,b||(b=!0,S.postMessage(null))},u=function(G,F){v=p(function(){G(r.unstable_now())},F)},h=function(){m(v),v=-1});var O=[],R=[],A=1,z=null,H=3,$=!1,M=!1,J=!1;function K(G){for(var F=k(R);F!==null;){if(F.callback===null)D(R);else{if(!(F.startTime<=G))break;D(R),F.sortIndex=F.expirationTime,E(O,F)}F=k(R)}}function N(G){var F;J=!1,K(G),M||(k(O)!==null?(M=!0,c(U)):(F=k(R))!==null&&u(N,F.startTime-G))}function U(G,F){M=!1,J&&(J=!1,h()),$=!0;var q=H;try{for(K(F),z=k(O);z!==null&&(!(z.expirationTime>F)||G&&!r.unstable_shouldYield());){var T,I=z.callback;typeof I=="function"?(z.callback=null,H=z.priorityLevel,T=I(z.expirationTime<=F),F=r.unstable_now(),typeof T=="function"?z.callback=T:z===k(O)&&D(O),K(F)):D(O),z=k(O)}var L;return z!==null||((L=k(R))!==null&&u(N,L.startTime-F),!1)}finally{z=null,H=q,$=!1}}var W=n;r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(G){G.callback=null},r.unstable_continueExecution=function(){M||$||(M=!0,c(U))},r.unstable_getCurrentPriorityLevel=function(){return H},r.unstable_getFirstCallbackNode=function(){return k(O)},r.unstable_next=function(G){switch(H){case 1:case 2:case 3:var F=3;break;default:F=H}var q=H;H=F;try{return G()}finally{H=q}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=W,r.unstable_runWithPriority=function(G,F){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var q=H;H=G;try{return F()}finally{H=q}},r.unstable_scheduleCallback=function(G,F,q){var T=r.unstable_now();switch(q=typeof q=="object"&&q!==null&&typeof(q=q.delay)=="number"&&0<q?T+q:T,G){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return G={id:A++,callback:F,priorityLevel:G,startTime:q,expirationTime:I=q+I,sortIndex:-1},T<q?(G.sortIndex=q,E(R,G),k(O)===null&&G===k(R)&&(J?h():J=!0,u(N,q-T))):(G.sortIndex=I,E(O,G),M||$||(M=!0,c(U))),G},r.unstable_wrapCallback=function(G){var F=H;return function(){var q=H;H=F;try{return G.apply(this,arguments)}finally{H=q}}}},{}],414:[function(t,f,r){f.exports=t("./cjs/scheduler.production.min.js")},{"./cjs/scheduler.development.js":412,"./cjs/scheduler.production.min.js":413}],415:[function(t,f,r){f.exports=t("./cjs/scheduler-tracing.production.min.js")},{"./cjs/scheduler-tracing.development.js":410,"./cjs/scheduler-tracing.production.min.js":411}],416:[function(t,f,r){f.exports=function(n,e,s,i){if((h=s?s.call(i,n,e):void 0)!==void 0)return!!h;if(n===e)return!0;if(typeof n!="object"||!n||typeof e!="object"||!e)return!1;var l=Object.keys(n),o=Object.keys(e);if(l.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(e),c=0;c<l.length;c++){var u=l[c];if(!a(u))return!1;var h,p=n[u],m=e[u];if((h=s?s.call(i,p,m,u):void 0)===!1||h===void 0&&p!==m)return!1}return!0}},{}],417:[function(t,f,r){(function(n){(function(){function e(pt){return pt&&typeof pt=="object"&&"default"in pt?pt.default:pt}Object.defineProperty(r,"__esModule",{value:!0});var s=t("react-is"),i=t("react"),l=e(i),o=e(t("shallowequal")),a=e(t("@emotion/stylis")),c=e(t("@emotion/unitless")),u=e(t("@emotion/is-prop-valid")),h=e(t("hoist-non-react-statics"));function p(){return(p=Object.assign||function(pt){for(var Dt=1;Dt<arguments.length;Dt++){var $t,qt=arguments[Dt];for($t in qt)Object.prototype.hasOwnProperty.call(qt,$t)&&(pt[$t]=qt[$t])}return pt}).apply(this,arguments)}var m=function(pt,Dt){for(var $t=[pt[0]],qt=0,Vt=Dt.length;qt<Vt;qt+=1)$t.push(Dt[qt],pt[qt+1]);return $t},b=function(pt){return pt!==null&&typeof pt=="object"&&(pt.toString?pt.toString():Object.prototype.toString.call(pt))==="[object Object]"&&!s.typeOf(pt)},_=Object.freeze([]),v=Object.freeze({});function w(pt){return typeof pt=="function"}function x(pt){return n.env.NODE_ENV!=="production"&&typeof pt=="string"&&pt||pt.displayName||pt.name||"Component"}function S(pt){return pt&&typeof pt.styledComponentId=="string"}var E=n!==void 0&&(n.env.REACT_APP_SC_ATTR||n.env.SC_ATTR)||"data-styled",k=typeof window<"u"&&"HTMLElement"in window,D=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:n!==void 0&&n.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&n.env.REACT_APP_SC_DISABLE_SPEEDY!==""?n.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&n.env.REACT_APP_SC_DISABLE_SPEEDY:n!==void 0&&n.env.SC_DISABLE_SPEEDY!==void 0&&n.env.SC_DISABLE_SPEEDY!==""?n.env.SC_DISABLE_SPEEDY!=="false"&&n.env.SC_DISABLE_SPEEDY:n.env.NODE_ENV!=="production"),P={},O=n.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
|
|
111
|
+
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}br!==5&&(br=2),_t=qp(_t,Ze),Kt=ut;do switch(Kt.tag){case 3:st=_t,Kt.flags|=4096,j&=-j,Kt.lanes|=j,Wy(Kt,kb(0,st,j));break t;case 1:st=_t;var Xe=Kt.type,Qe=Kt.stateNode;if(!(64&Kt.flags||typeof Xe.getDerivedStateFromError!="function"&&(Qe===null||typeof Qe.componentDidCatch!="function"||Jo!==null&&Jo.has(Qe)))){Kt.flags|=4096,j&=-j,Kt.lanes|=j,Wy(Kt,Ob(Kt,st,j));break t}}while((Kt=Kt.return)!==null)}Hb(V)}catch(wn){j=wn,cr===V&&V!==null&&(cr=V=V.return);continue}break}}function Ub(){var C=sd.current;return sd.current=ad,C===null?ad:C}function _c(C,j){var V=fn,it=(fn|=16,Ub());for(Rr===C&&Cr===j||ol(C,j);;)try{for(;cr!==null;)$b(cr);break}catch(ot){zb(C,ot)}if(Ep(),fn=V,sd.current=it,cr!==null)throw Error(i(261));return Rr=null,Cr=0,br}function $b(C){var j=Db(C.alternate,C,Ga);C.memoizedProps=C.pendingProps,j===null?Hb(C):cr=j,Wp.current=null}function Hb(C){var j=C;do{var V=j.alternate;if(C=j.return,2048&j.flags){if((V=function(st){switch(st.tag){case 1:Gr(st.type)&&bp();var ut=st.flags;return 4096&ut?(st.flags=-4097&ut|64,st):null;case 3:if(Qs(),zn(zr),zn(wr),Ip(),64&(ut=st.flags))throw Error(i(285));return st.flags=-4097&ut|64,st;case 5:return Ap(st),null;case 13:return zn(Yn),4096&(ut=st.flags)?(st.flags=-4097&ut|64,st):null;case 19:return zn(Yn),null;case 4:return Qs(),null;case 10:return kp(st),null;case 23:case 24:return oh(),null;default:return null}}(j))!==null)return V.flags&=2047,void(cr=V);C!==null&&(C.firstEffect=C.lastEffect=null,C.flags|=2048)}else{if((V=function(st,ut,_t){var mt=ut.pendingProps;switch(ut.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 Gr(ut.type)&&bp(),null;case 3:return Qs(),zn(zr),zn(wr),Ip(),(mt=ut.stateNode).pendingContext&&(mt.context=mt.pendingContext,mt.pendingContext=null),st!==null&&st.child!==null||(ed(ut)?ut.flags|=4:mt.hydrate||(ut.flags|=256)),null;case 5:Ap(ut);var Ht=Va(sc.current);if(_t=ut.type,st!==null&&ut.stateNode!=null)dC(st,ut,_t,mt),st.ref!==ut.ref&&(ut.flags|=128);else{if(!mt){if(ut.stateNode===null)throw Error(i(166));return null}if(st=Va($o.current),ed(ut)){mt=ut.stateNode,_t=ut.type;var ie,ue=ut.memoizedProps;switch(mt[Gi]=ut,mt[Uu]=ue,_t){case"dialog":Mn("cancel",mt),Mn("close",mt);break;case"iframe":case"object":case"embed":Mn("load",mt);break;case"video":case"audio":for(st=0;st<Ql.length;st++)Mn(Ql[st],mt);break;case"source":Mn("error",mt);break;case"img":case"image":case"link":Mn("error",mt),Mn("load",mt);break;case"details":Mn("toggle",mt);break;case"input":at(mt,ue),Mn("invalid",mt);break;case"select":mt._wrapperState={wasMultiple:!!ue.multiple},Mn("invalid",mt);break;case"textarea":yt(mt,ue),Mn("invalid",mt)}for(ie in kt(_t,ue),st=null,ue)ue.hasOwnProperty(ie)&&(Ht=ue[ie],ie==="children"?typeof Ht=="string"?mt.textContent!==Ht&&(st=["children",Ht]):typeof Ht=="number"&&mt.textContent!==""+Ht&&(st=["children",""+Ht]):o.hasOwnProperty(ie)&&Ht!=null&&ie==="onScroll"&&Mn("scroll",mt));switch(_t){case"input":Q(mt),wt(mt,ue,!0);break;case"textarea":Q(mt),At(mt);break;case"select":case"option":break;default:typeof ue.onClick=="function"&&(mt.onclick=zu)}mt=st,(ut.updateQueue=mt)!==null&&(ut.flags|=4)}else{switch(ie=Ht.nodeType===9?Ht:Ht.ownerDocument,(st=st===It?Ot(_t):st)===It?_t==="script"?((st=ie.createElement("div")).innerHTML="<script><\/script>",st=st.removeChild(st.firstChild)):typeof mt.is=="string"?st=ie.createElement(_t,{is:mt.is}):(st=ie.createElement(_t),_t==="select"&&(ie=st,mt.multiple?ie.multiple=!0:mt.size&&(ie.size=mt.size))):st=ie.createElementNS(st,_t),st[Gi]=ut,st[Uu]=mt,uC(st,ut),ut.stateNode=st,ie=ee(_t,mt),_t){case"dialog":Mn("cancel",st),Mn("close",st),Ht=mt;break;case"iframe":case"object":case"embed":Mn("load",st),Ht=mt;break;case"video":case"audio":for(Ht=0;Ht<Ql.length;Ht++)Mn(Ql[Ht],st);Ht=mt;break;case"source":Mn("error",st),Ht=mt;break;case"img":case"image":case"link":Mn("error",st),Mn("load",st),Ht=mt;break;case"details":Mn("toggle",st),Ht=mt;break;case"input":at(st,mt),Ht=et(st,mt),Mn("invalid",st);break;case"option":Ht=Mt(st,mt);break;case"select":st._wrapperState={wasMultiple:!!mt.multiple},Ht=e({},mt,{value:void 0}),Mn("invalid",st);break;case"textarea":yt(st,mt),Ht=Nt(st,mt),Mn("invalid",st);break;default:Ht=mt}kt(_t,Ht);var De,mn=Ht;for(ue in mn)mn.hasOwnProperty(ue)&&(De=mn[ue],ue==="style"?Qt(st,De):ue==="dangerouslySetInnerHTML"?(De=De?De.__html:void 0)!=null&&ht(st,De):ue==="children"?typeof De=="string"?_t==="textarea"&&De===""||dt(st,De):typeof De=="number"&&dt(st,""+De):ue!=="suppressContentEditableWarning"&&ue!=="suppressHydrationWarning"&&ue!=="autoFocus"&&(o.hasOwnProperty(ue)?De!=null&&ue==="onScroll"&&Mn("scroll",st):De!=null&&x(st,ue,De,ie)));switch(_t){case"input":Q(st),wt(st,mt,!1);break;case"textarea":Q(st),At(st);break;case"option":mt.value!=null&&st.setAttribute("value",""+Z(mt.value));break;case"select":st.multiple=!!mt.multiple,(ue=mt.value)!=null?Lt(st,!!mt.multiple,ue,!1):mt.defaultValue!=null&&Lt(st,!!mt.multiple,mt.defaultValue,!0);break;default:typeof Ht.onClick=="function"&&(st.onclick=zu)}Ay(_t,mt)&&(ut.flags|=4)}ut.ref!==null&&(ut.flags|=128)}return null;case 6:if(st&&ut.stateNode!=null)fC(0,ut,st.memoizedProps,mt);else{if(typeof mt!="string"&&ut.stateNode===null)throw Error(i(166));_t=Va(sc.current),Va($o.current),ed(ut)?(mt=ut.stateNode,_t=ut.memoizedProps,mt[Gi]=ut,mt.nodeValue!==_t&&(ut.flags|=4)):((mt=(_t.nodeType===9?_t:_t.ownerDocument).createTextNode(mt))[Gi]=ut).stateNode=mt}return null;case 13:return zn(Yn),mt=ut.memoizedState,64&ut.flags?(ut.lanes=_t,ut):(mt=mt!==null,_t=!1,st===null?ut.memoizedProps.fallback!==void 0&&ed(ut):_t=st.memoizedState!==null,mt&&!_t&&2&ut.mode&&(st===null&&ut.memoizedProps.unstable_avoidThisFallback!==!0||1&Yn.current?br===0&&(br=3):(br!==0&&br!==3||(br=4),Rr===null||!(134217727&gc)&&!(134217727&el)||rl(Rr,Cr))),(mt||_t)&&(ut.flags|=4),null);case 4:return Qs(),st===null&&Ey(ut.stateNode.containerInfo),null;case 10:return kp(ut),null;case 19:if(zn(Yn),(mt=ut.memoizedState)===null)return null;if(ue=!!(64&ut.flags),(ie=mt.rendering)===null)if(ue)hc(mt,!1);else{if(br!==0||st!==null&&64&st.flags)for(st=ut.child;st!==null;){if((ie=td(st))!==null){for(ut.flags|=64,hc(mt,!1),(ue=ie.updateQueue)!==null&&(ut.updateQueue=ue,ut.flags|=4),mt.lastEffect===null&&(ut.firstEffect=null),ut.lastEffect=mt.lastEffect,mt=_t,_t=ut.child;_t!==null;)st=mt,(ue=_t).flags&=2,ue.nextEffect=null,ue.firstEffect=null,(ue.lastEffect=null)===(ie=ue.alternate)?(ue.childLanes=0,ue.lanes=st,ue.child=null,ue.memoizedProps=null,ue.memoizedState=null,ue.updateQueue=null,ue.dependencies=null,ue.stateNode=null):(ue.childLanes=ie.childLanes,ue.lanes=ie.lanes,ue.child=ie.child,ue.memoizedProps=ie.memoizedProps,ue.memoizedState=ie.memoizedState,ue.updateQueue=ie.updateQueue,ue.type=ie.type,st=ie.dependencies,ue.dependencies=st===null?null:{lanes:st.lanes,firstContext:st.firstContext}),_t=_t.sibling;return Kn(Yn,1&Yn.current|2),ut.child}st=st.sibling}mt.tail!==null&&Sr()>Qp&&(ut.flags|=64,hc(mt,!(ue=!0)),ut.lanes=33554432)}else{if(!ue)if((st=td(ie))!==null){if(ut.flags|=64,ue=!0,(_t=st.updateQueue)!==null&&(ut.updateQueue=_t,ut.flags|=4),hc(mt,!0),mt.tail===null&&mt.tailMode==="hidden"&&!ie.alternate&&!Ho)return(ut=ut.lastEffect=mt.lastEffect)!==null&&(ut.nextEffect=null),null}else 2*Sr()-mt.renderingStartTime>Qp&&_t!==1073741824&&(ut.flags|=64,hc(mt,!(ue=!0)),ut.lanes=33554432);mt.isBackwards?(ie.sibling=ut.child,ut.child=ie):((_t=mt.last)!==null?_t.sibling=ie:ut.child=ie,mt.last=ie)}return mt.tail!==null?(_t=mt.tail,mt.rendering=_t,mt.tail=_t.sibling,mt.lastEffect=ut.lastEffect,mt.renderingStartTime=Sr(),_t.sibling=null,ut=Yn.current,Kn(Yn,ue?1&ut|2:1&ut),_t):null;case 23:case 24:return oh(),st!==null&&st.memoizedState!==null!=(ut.memoizedState!==null)&&mt.mode!=="unstable-defer-without-hiding"&&(ut.flags|=4),null}throw Error(i(156,ut.tag))}(V,j,Ga))!==null)return void(cr=V);if((V=j).tag!==24&&V.tag!==23||V.memoizedState===null||1073741824&Ga||!(4&V.mode)){for(var it=0,ot=V.child;ot!==null;)it|=ot.lanes|ot.childLanes,ot=ot.sibling;V.childLanes=it}C!==null&&!(2048&C.flags)&&(C.firstEffect===null&&(C.firstEffect=j.firstEffect),j.lastEffect!==null&&(C.lastEffect!==null&&(C.lastEffect.nextEffect=j.firstEffect),C.lastEffect=j.lastEffect),1<j.flags&&(C.lastEffect!==null?C.lastEffect.nextEffect=j:C.firstEffect=j,C.lastEffect=j))}if((j=j.sibling)!==null)return void(cr=j)}while(cr=j=C,j!==null);br===0&&(br=5)}function il(C){var j=Gs();return Ja(99,(function(V,it){for(;aa(),mc!==null;);if(48&fn)throw Error(i(327));var ot=V.finishedWork;if(ot===null)return null;if(V.finishedWork=null,V.finishedLanes=0,ot===V.current)throw Error(i(177));V.callbackNode=null;var st=ot.lanes|ot.childLanes,ut=st,_t=V.pendingLanes&~ut;V.pendingLanes=ut,V.suspendedLanes=0,V.pingedLanes=0,V.expiredLanes&=ut,V.mutableReadLanes&=ut,V.entangledLanes&=ut,ut=V.entanglements;for(var mt,Ht=V.eventTimes,ie=V.expirationTimes;0<_t;){var ue=31-xo(_t),De=1<<ue;ut[ue]=0,Ht[ue]=-1,ie[ue]=-1,_t&=~De}if(bi!==null&&!(24&st)&&bi.has(V)&&bi.delete(V),V===Rr&&(cr=Rr=null,Cr=0),(st=1<ot.flags?ot.lastEffect!==null?(ot.lastEffect.nextEffect=ot,ot.firstEffect):ot:ot.firstEffect)!==null){if(ut=fn,fn|=32,Wp.current=null,fp=Kr,lp(Ht=by())){if("selectionStart"in Ht)ie={start:Ht.selectionStart,end:Ht.selectionEnd};else t:if(ie=(ie=Ht.ownerDocument)&&ie.defaultView||window,(De=ie.getSelection&&ie.getSelection())&&De.rangeCount!==0){ie=De.anchorNode,_t=De.anchorOffset,ue=De.focusNode,De=De.focusOffset;try{ie.nodeType,ue.nodeType}catch{ie=null;break t}var mn=0,Kt=-1,re=-1,me=0,Le=0,Me=Ht,Ze=null;e:for(;;){for(;Me!==ie||_t!==0&&Me.nodeType!==3||(Kt=mn+_t),Me!==ue||De!==0&&Me.nodeType!==3||(re=mn+De),Me.nodeType===3&&(mn+=Me.nodeValue.length),(mt=Me.firstChild)!==null;)Ze=Me,Me=mt;for(;;){if(Me===Ht)break e;if(Ze===ie&&++me===_t&&(Kt=mn),Ze===ue&&++Le===De&&(re=mn),(mt=Me.nextSibling)!==null)break;Ze=(Me=Ze).parentNode}Me=mt}ie=Kt===-1||re===-1?null:{start:Kt,end:re}}else ie=null;ie=ie||{start:0,end:0}}else ie=null;vc=null,fd=Kr=!(pp={focusedElem:Ht,selectionRange:ie}),Ye=st;do try{(function(){for(;Ye!==null;){var yn=Ye.alternate,dn=(fd||vc===null||(8&Ye.flags?pt(Ye,vc)&&(fd=!0):Ye.tag===13&&function(Dn,Gn){return Dn!==null&&((Dn=Dn.memoizedState)===null||Dn.dehydrated!==null)&&(Gn=Gn.memoizedState)!==null&&Gn.dehydrated===null}(yn,Ye)&&pt(Ye,vc)&&(fd=!0)),Ye.flags);256&dn&&function(Dn,Gn){switch(Gn.tag){case 0:case 11:case 15:case 22:case 5:case 6:case 4:case 17:return;case 1:var co,Vo;return 256&Gn.flags&&Dn!==null&&(co=Dn.memoizedProps,Vo=Dn.memoizedState,Gn=(Dn=Gn.stateNode).getSnapshotBeforeUpdate(Gn.elementType===Gn.type?co:Co(Gn.type,co),Vo),Dn.__reactInternalSnapshotBeforeUpdate=Gn);case 3:return 256&Gn.flags&&gp(Gn.stateNode.containerInfo)}throw Error(i(163))}(yn,Ye),!(512&dn)||na||(na=!0,nc(97,function(){return aa(),null})),Ye=Ye.nextEffect}})()}catch(yn){if(Ye===null)throw Error(i(330));sa(Ye,yn),Ye=Ye.nextEffect}while(Ye!==null);vc=null,Ye=st;do try{for(Ht=V;Ye!==null;){var ln,Xe,Qe=Ye.flags;switch(16&Qe&&dt(Ye.stateNode,""),128&Qe&&(ln=Ye.alternate)!==null&&(Xe=ln.ref)!==null&&(typeof Xe=="function"?Xe(null):Xe.current=null),1038&Qe){case 2:Ib(Ye),Ye.flags&=-3;break;case 6:Ib(Ye),Ye.flags&=-3,Vp(Ye.alternate,Ye);break;case 1024:Ye.flags&=-1025;break;case 1028:Ye.flags&=-1025,Vp(Ye.alternate,Ye);break;case 4:Vp(Ye.alternate,Ye);break;case 8:Rb(Ht,ie=Ye);var wn=ie.alternate;Pb(ie),wn!==null&&Pb(wn)}Ye=Ye.nextEffect}}catch(yn){if(Ye===null)throw Error(i(330));sa(Ye,yn),Ye=Ye.nextEffect}while(Ye!==null);if(Xe=pp,ln=by(),Qe=Xe.focusedElem,Ht=Xe.selectionRange,ln!==Qe&&Qe&&Qe.ownerDocument&&function yn(dn,Dn){return!(!dn||!Dn)&&(dn===Dn||(!dn||dn.nodeType!==3)&&(Dn&&Dn.nodeType===3?yn(dn,Dn.parentNode):"contains"in dn?dn.contains(Dn):!!dn.compareDocumentPosition&&!!(16&dn.compareDocumentPosition(Dn))))}(Qe.ownerDocument.documentElement,Qe)){for(Ht!==null&&lp(Qe)&&(ln=Ht.start,(Xe=Ht.end)===void 0&&(Xe=ln),"selectionStart"in Qe?(Qe.selectionStart=ln,Qe.selectionEnd=Math.min(Xe,Qe.value.length)):(Xe=(ln=Qe.ownerDocument||document)&&ln.defaultView||window).getSelection&&(Xe=Xe.getSelection(),ie=Qe.textContent.length,wn=Math.min(Ht.start,ie),Ht=Ht.end===void 0?wn:Math.min(Ht.end,ie),!Xe.extend&&Ht<wn&&(ie=Ht,Ht=wn,wn=ie),ie=yy(Qe,wn),_t=yy(Qe,Ht),ie&&_t&&(Xe.rangeCount!==1||Xe.anchorNode!==ie.node||Xe.anchorOffset!==ie.offset||Xe.focusNode!==_t.node||Xe.focusOffset!==_t.offset)&&((ln=ln.createRange()).setStart(ie.node,ie.offset),Xe.removeAllRanges(),Ht<wn?(Xe.addRange(ln),Xe.extend(_t.node,_t.offset)):(ln.setEnd(_t.node,_t.offset),Xe.addRange(ln))))),ln=[],Xe=Qe;Xe=Xe.parentNode;)Xe.nodeType===1&&ln.push({element:Xe,left:Xe.scrollLeft,top:Xe.scrollTop});for(typeof Qe.focus=="function"&&Qe.focus(),Qe=0;Qe<ln.length;Qe++)(Xe=ln[Qe]).element.scrollLeft=Xe.left,Xe.element.scrollTop=Xe.top}Kr=!!fp,pp=fp=null,V.current=ot,Ye=st;do try{for(Qe=V;Ye!==null;){var On,An,pn=Ye.flags;36&pn&&gC(Qe,Ye.alternate,Ye),128&pn&&(ln=void 0,(On=Ye.ref)!==null&&(An=Ye.stateNode,Ye.tag,ln=An,typeof On=="function"?On(ln):On.current=ln)),Ye=Ye.nextEffect}}catch(yn){if(Ye===null)throw Error(i(330));sa(Ye,yn),Ye=Ye.nextEffect}while(Ye!==null);Ye=null,oC(),fn=ut}else V.current=ot;if(na)na=!1,mc=V,yc=it;else for(Ye=st;Ye!==null;)it=Ye.nextEffect,Ye.nextEffect=null,8&Ye.flags&&((pn=Ye).sibling=null,pn.stateNode=null),Ye=it;if((st=V.pendingLanes)===0&&(Jo=null),st===1?V===nh?bc++:(bc=0,nh=V):bc=0,ot=ot.stateNode,qa&&typeof qa.onCommitFiberRoot=="function")try{qa.onCommitFiberRoot(vp,ot,void 0,!(64&~ot.current.flags))}catch{}if(so(V,Sr()),cd)throw cd=!1,V=Xp,Xp=null,V;return 8&fn||Uo(),null}).bind(null,C,j)),null}function aa(){var C;return yc!==90&&(C=97<yc?97:yc,yc=90,Ja(C,yC))}function qb(C,j){eh.push(j,C),na||(na=!0,nc(97,function(){return aa(),null}))}function yC(){if(mc===null)return!1;var C=mc;if(mc=null,48&fn)throw Error(i(331));var j=fn,V=(fn|=32,eh);eh=[];for(var it=0;it<V.length;it+=2){var ot=V[it],st=V[it+1],ut=ot.destroy;if(ot.destroy=void 0,typeof ut=="function")try{ut()}catch(mt){if(st===null)throw Error(i(330));sa(st,mt)}}for(V=th,th=[],it=0;it<V.length;it+=2){ot=V[it],st=V[it+1];try{var _t=ot.create;ot.destroy=_t()}catch(mt){if(st===null)throw Error(i(330));sa(st,mt)}}for(_t=C.current.firstEffect;_t!==null;)C=_t.nextEffect,_t.nextEffect=null,8&_t.flags&&(_t.sibling=null,_t.stateNode=null),_t=C;return fn=j,Uo(),!0}function Jb(C,j,V){ta(C,j=kb(0,j=qp(V,j),1)),j=Zr(),(C=pd(C,1))!==null&&(Ta(C,1,j),so(C,j))}function sa(C,j){if(C.tag===3)Jb(C,C,j);else for(var V=C.return;V!==null;){if(V.tag===3){Jb(V,C,j);break}if(V.tag===1){var it,ot=V.stateNode;if(typeof V.type.getDerivedStateFromError=="function"||typeof ot.componentDidCatch=="function"&&(Jo===null||!Jo.has(ot))){if(ta(V,Ob(V,C=qp(j,C),1)),it=Zr(),(V=pd(V,1))!==null)Ta(V,1,it),so(V,it);else if(typeof ot.componentDidCatch=="function"&&(Jo===null||!Jo.has(ot)))try{ot.componentDidCatch(j,C)}catch{}break}}V=V.return}}function bC(C,j,V){var it=C.pingCache;it!==null&&it.delete(j),j=Zr(),C.pingedLanes|=C.suspendedLanes&V,Rr===C&&(Cr&V)===V&&(br===4||br===3&&(62914560&Cr)===Cr&&Sr()-Zp<500?ol(C,0):Gp|=V),so(C,j)}function vC(C,j,V,it){this.tag=C,this.key=V,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=j,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=it,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function lo(C,j,V,it){return new vC(C,j,V,it)}function ih(C){return(C=C.prototype)&&C.isReactComponent}function la(C,j){var V=C.alternate;return V===null?((V=lo(C.tag,j,C.key,C.mode)).elementType=C.elementType,V.type=C.type,V.stateNode=C.stateNode,(V.alternate=C).alternate=V):(V.pendingProps=j,V.type=C.type,V.flags=0,V.nextEffect=null,V.firstEffect=null,V.lastEffect=null),V.childLanes=C.childLanes,V.lanes=C.lanes,V.child=C.child,V.memoizedProps=C.memoizedProps,V.memoizedState=C.memoizedState,V.updateQueue=C.updateQueue,j=C.dependencies,V.dependencies=j===null?null:{lanes:j.lanes,firstContext:j.firstContext},V.sibling=C.sibling,V.index=C.index,V.ref=C.ref,V}function gd(C,j,V,it,ot,st){var ut=2;if(typeof(it=C)=="function")ih(C)&&(ut=1);else if(typeof C=="string")ut=5;else t:switch(C){case P:return al(V.children,ot,st,j);case W:ut=8,ot|=16;break;case O:ut=8,ot|=1;break;case R:return(C=lo(12,V,j,8|ot)).elementType=R,C.type=R,C.lanes=st,C;case $:return(C=lo(13,V,j,ot)).type=$,C.elementType=$,C.lanes=st,C;case M:return(C=lo(19,V,j,ot)).elementType=M,C.lanes=st,C;case G:return ah(V,ot,st,j);case F:return(C=lo(24,V,j,ot)).elementType=F,C.lanes=st,C;default:if(typeof C=="object"&&C!==null)switch(C.$$typeof){case A:ut=10;break t;case z:ut=9;break t;case H:ut=11;break t;case J:ut=14;break t;case K:ut=16,it=null;break t;case N:ut=22;break t}throw Error(i(130,C==null?C:typeof C,""))}return(j=lo(ut,V,j,ot)).elementType=C,j.type=it,j.lanes=st,j}function al(C,j,V,it){return(C=lo(7,C,it,j)).lanes=V,C}function ah(C,j,V,it){return(C=lo(23,C,it,j)).elementType=G,C.lanes=V,C}function sh(C,j,V){return(C=lo(6,C,null,j)).lanes=V,C}function lh(C,j,V){return(j=lo(4,C.children!==null?C.children:[],C.key,j)).lanes=V,j.stateNode={containerInfo:C.containerInfo,pendingChildren:null,implementation:C.implementation},j}function _C(C,j,V){this.tag=j,this.containerInfo=C,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=V,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=xr(0),this.expirationTimes=xr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xr(0),this.mutableSourceEagerHydrationData=null}function md(C,j,V,it){var ot=j.current,st=Zr(),ut=oa(ot);t:if(V){e:{if(Ae(V=V._reactInternals)!==V||V.tag!==1)throw Error(i(170));var _t=V;do switch(_t.tag){case 3:_t=_t.stateNode.context;break e;case 1:if(Gr(_t.type)){_t=_t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}while((_t=_t.return)!==null);throw Error(i(171))}if(V.tag===1){var mt=V.type;if(Gr(mt)){V=Dy(V,mt,_t);break t}}V=_t}else V=Zi;j.context===null?j.context=V:j.pendingContext=V,(j=Xi(st,ut)).payload={element:C},(it=it===void 0?null:it)!==null&&(j.callback=it),ta(ot,j),ia(ot,ut,st)}function ch(C){return(C=C.current).child?(C.child.tag,C.child.stateNode):null}function Vb(C,j){var V;(C=C.memoizedState)!==null&&C.dehydrated!==null&&(V=C.retryLane,C.retryLane=V!==0&&V<j?V:j)}function uh(C,j){Vb(C,j),(C=C.alternate)&&Vb(C,j)}function dh(C,j,V){var it=V!=null&&V.hydrationOptions!=null&&V.hydrationOptions.mutableSources||null;if(V=new _C(C,j,V!=null&&V.hydrate===!0),j=lo(3,null,null,j===2?7:j===1?3:0),(V.current=j).stateNode=V,Op(j),C[Vs]=V.current,Ey(C.nodeType===8?C.parentNode:C),it)for(C=0;C<it.length;C++){var ot=(ot=(j=it[C])._getVersion)(j._source);V.mutableSourceEagerHydrationData==null?V.mutableSourceEagerHydrationData=[j,ot]:V.mutableSourceEagerHydrationData.push(j,ot)}this._internalRoot=V}function xc(C){return C&&(C.nodeType===1||C.nodeType===9||C.nodeType===11||C.nodeType===8&&C.nodeValue===" react-mount-point-unstable ")}function yd(C,j,V,it,ot){var st,ut,_t,mt=V._reactRootContainer;return mt?(_t=mt._internalRoot,typeof ot=="function"&&(st=ot,ot=function(){var Ht=ch(_t);st.call(Ht)}),md(j,_t,C,ot)):(_t=(mt=V._reactRootContainer=function(Ht,ie){if(!(ie=ie||!(!(ie=Ht?Ht.nodeType===9?Ht.documentElement:Ht.firstChild:null)||ie.nodeType!==1||!ie.hasAttribute("data-reactroot"))))for(var ue;ue=Ht.lastChild;)Ht.removeChild(ue);return new dh(Ht,0,ie?{hydrate:!0}:void 0)}(V,it))._internalRoot,typeof ot=="function"&&(ut=ot,ot=function(){var Ht=ch(_t);ut.call(Ht)}),Fb(function(){md(j,_t,C,ot)})),ch(_t)}function Wb(C,j){if(xc(j))return function(V,it,ot,st){return{$$typeof:D,key:(st=3<arguments.length&&st!==void 0?st:null)==null?null:""+st,children:V,containerInfo:it,implementation:ot}}(C,j,null,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null);throw Error(i(200))}Db=function(C,j,V){var it=j.lanes;if(C!==null)if(C.memoizedProps!==j.pendingProps||zr.current)Eo=!0;else{if(!(V&it)){switch(Eo=!1,j.tag){case 3:xb(j),Np();break;case 5:eb(j);break;case 1:Gr(j.type)&&Hu(j);break;case 4:jp(j,j.stateNode.containerInfo);break;case 10:it=j.memoizedProps.value;var ot=j.type._context;Kn(Vu,ot._currentValue),ot._currentValue=it;break;case 13:if(j.memoizedState!==null)return V&j.child.childLanes?wb(C,j,V):(Kn(Yn,1&Yn.current),(j=yi(C,j,V))!==null?j.sibling:null);Kn(Yn,1&Yn.current);break;case 19:if(it=!!(V&j.childLanes),64&C.flags){if(it)return Eb(C,j,V);j.flags|=64}if((ot=j.memoizedState)!==null&&(ot.rendering=null,ot.tail=null,ot.lastEffect=null),Kn(Yn,Yn.current),it)break;return null;case 23:case 24:return j.lanes=0,bb(C,j,V)}return yi(C,j,V)}Eo=!!(16384&C.flags)}else Eo=!1;switch(j.lanes=0,j.tag){case 2:return it=j.type,C!==null&&(C.alternate=null,j.alternate=null,j.flags|=2),C=j.pendingProps,ot=Ks(j,wr.current),Zs(j,V),ot=Mp(null,j,it,C,ot,V),j.flags|=1,typeof ot=="object"&&ot!==null&&typeof ot.render=="function"&&ot.$$typeof===void 0?(j.tag=1,j.memoizedState=null,j.updateQueue=null,Gr(it)?(st=!0,Hu(j)):st=!1,j.memoizedState=ot.state!==null&&ot.state!==void 0?ot.state:null,Op(j),typeof(mt=it.getDerivedStateFromProps)=="function"&&Gu(j,0,mt,C),ot.updater=Yu,Tp((j.stateNode=ot)._reactInternals=j,it,C,V),Up(null,j,it,!0,st,V)):(j.tag=0,Yr(null,j,ot,V),j.child);case 16:ot=j.elementType;t:{switch(C!==null&&(C.alternate=null,j.alternate=null,j.flags|=2),C=j.pendingProps,ot=(st=ot._init)(ot._payload),j.type=ot,st=j.tag=function(ie){if(typeof ie=="function")return ih(ie)?1:0;if(ie!=null){if((ie=ie.$$typeof)===H)return 11;if(ie===J)return 14}return 2}(ot),C=Co(ot,C),st){case 0:j=zp(null,j,ot,C,V);break t;case 1:j=_b(null,j,ot,C,V);break t;case 11:j=gb(null,j,ot,C,V);break t;case 14:j=mb(null,j,ot,Co(ot.type,C),it,V);break t}throw Error(i(306,ot,""))}return j;case 0:return it=j.type,ot=j.pendingProps,zp(C,j,it,ot=j.elementType===it?ot:Co(it,ot),V);case 1:return it=j.type,ot=j.pendingProps,_b(C,j,it,ot=j.elementType===it?ot:Co(it,ot),V);case 3:if(xb(j),it=j.updateQueue,C===null||it===null)throw Error(i(282));if(it=j.pendingProps,ot=(ot=j.memoizedState)!==null?ot.element:null,Vy(C,j),rc(j,it,null,V),(it=j.memoizedState.element)===ot)Np(),j=yi(C,j,V);else{if((st=(ot=j.stateNode).hydrate)&&(ea=Js(j.stateNode.containerInfo.firstChild),mi=j,st=Ho=!0),st){if((C=ot.mutableSourceEagerHydrationData)!=null)for(ot=0;ot<C.length;ot+=2)(st=C[ot])._workInProgressVersionPrimary=C[ot+1],Xs.push(st);for(V=tb(j,null,it,V),j.child=V;V;)V.flags=-3&V.flags|1024,V=V.sibling}else Yr(C,j,it,V),Np();j=j.child}return j;case 5:return eb(j),C===null&&Pp(j),it=j.type,ot=j.pendingProps,st=C!==null?C.memoizedProps:null,mt=ot.children,hp(it,ot)?mt=null:st!==null&&hp(it,st)&&(j.flags|=16),vb(C,j),Yr(C,j,mt,V),j.child;case 6:return C===null&&Pp(j),null;case 13:return wb(C,j,V);case 4:return jp(j,j.stateNode.containerInfo),it=j.pendingProps,C===null?j.child=Xu(j,null,it,V):Yr(C,j,it,V),j.child;case 11:return it=j.type,ot=j.pendingProps,gb(C,j,it,ot=j.elementType===it?ot:Co(it,ot),V);case 7:return Yr(C,j,j.pendingProps,V),j.child;case 8:case 12:return Yr(C,j,j.pendingProps.children,V),j.child;case 10:t:{it=j.type._context,ot=j.pendingProps,mt=j.memoizedProps;var st=ot.value,ut=j.type._context;if(Kn(Vu,ut._currentValue),ut._currentValue=st,mt!==null)if(ut=mt.value,(st=nr(ut,st)?0:0|(typeof it._calculateChangedBits=="function"?it._calculateChangedBits(ut,st):1073741823))==0){if(mt.children===ot.children&&!zr.current){j=yi(C,j,V);break t}}else for((ut=j.child)!==null&&(ut.return=j);ut!==null;){var _t=ut.dependencies;if(_t!==null)for(var mt=ut.child,Ht=_t.firstContext;Ht!==null;){if(Ht.context===it&&Ht.observedBits&st){ut.tag===1&&((Ht=Xi(-1,V&-V)).tag=2,ta(ut,Ht)),ut.lanes|=V,(Ht=ut.alternate)!==null&&(Ht.lanes|=V),Jy(ut.return,V),_t.lanes|=V;break}Ht=Ht.next}else mt=ut.tag===10&&ut.type===j.type?null:ut.child;if(mt!==null)mt.return=ut;else for(mt=ut;mt!==null;){if(mt===j){mt=null;break}if((ut=mt.sibling)!==null){ut.return=mt.return,mt=ut;break}mt=mt.return}ut=mt}Yr(C,j,ot.children,V),j=j.child}return j;case 9:return ot=j.type,it=(st=j.pendingProps).children,Zs(j,V),it=it(ot=io(ot,st.unstable_observedBits)),j.flags|=1,Yr(C,j,it,V),j.child;case 14:return st=Co(ot=j.type,j.pendingProps),mb(C,j,ot,st=Co(ot.type,st),it,V);case 15:return yb(C,j,j.type,j.pendingProps,it,V);case 17:return it=j.type,ot=j.pendingProps,ot=j.elementType===it?ot:Co(it,ot),C!==null&&(C.alternate=null,j.alternate=null,j.flags|=2),j.tag=1,Gr(it)?(C=!0,Hu(j)):C=!1,Zs(j,V),Zy(j,it,ot),Tp(j,it,ot,V),Up(null,j,it,!0,C,V);case 19:return Eb(C,j,V);case 23:case 24:return bb(C,j,V)}throw Error(i(156,j.tag))},dh.prototype.render=function(C){md(C,this._internalRoot,null,null)},dh.prototype.unmount=function(){var C=this._internalRoot,j=C.containerInfo;md(null,C,null,function(){j[Vs]=null})},Dt=function(C){C.tag===13&&(ia(C,4,Zr()),uh(C,4))},$t=function(C){C.tag===13&&(ia(C,67108864,Zr()),uh(C,67108864))},qt=function(C){var j,V;C.tag===13&&(j=Zr(),ia(C,V=oa(C),j),uh(C,V))},Be=function(C,j,V){switch(j){case"input":if(gt(C,V),j=V.name,V.type==="radio"&&j!=null){for(V=C;V.parentNode;)V=V.parentNode;for(V=V.querySelectorAll("input[name="+JSON.stringify(""+j)+'][type="radio"]'),j=0;j<V.length;j++){var it=V[j];if(it!==C&&it.form===C.form){var ot=$u(it);if(!ot)throw Error(i(90));tt(it),gt(it,ot)}}}break;case"textarea":jt(C,V);break;case"select":(j=V.value)!=null&&Lt(C,!!V.multiple,j,!1)}},hn=Bb,Tt=function(C,j,V,it,ot){var st=fn;fn|=4;try{return Ja(98,C.bind(null,j,V,it,ot))}finally{(fn=st)===0&&(nl(),Uo())}};var xC=function(C,j){var V=fn;fn|=2;try{return C(j)}finally{(fn=V)===0&&(nl(),Uo())}};if(fr={Events:[tc,Ws,$u,Re,He,aa,{current:!(ae=function(){var C;!(49&fn)&&(bi!==null&&(C=bi,bi=null,C.forEach(function(j){j.expiredLanes|=24&j.pendingLanes,so(j,Sr())})),Uo(),aa())})}]},Sn={bundleType:(t={findFiberByHostInstance:$a,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"}).bundleType,version:t.version,rendererPackageName:t.rendererPackageName,rendererConfig:t.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:E.ReactCurrentDispatcher,findHostInstanceByFiber:function(C){return(C=ve(C))===null?null:C.stateNode},findFiberByHostInstance:t.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&!(Hn=__REACT_DEVTOOLS_GLOBAL_HOOK__).isDisabled&&Hn.supportsFiber)try{vp=Hn.inject(Sn),qa=Hn}catch{}r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fr,r.createPortal=Wb,r.findDOMNode=function(C){if(C==null)return null;if(C.nodeType===1)return C;var j=C._reactInternals;if(j!==void 0)return(C=ve(j))===null?null:C.stateNode;throw typeof C.render=="function"?Error(i(188)):Error(i(268,Object.keys(C)))},r.flushSync=function(C,j){var V=fn;if(48&V)return C(j);fn|=1;try{if(C)return Ja(99,C.bind(null,j))}finally{fn=V,Uo()}},r.hydrate=function(C,j,V){if(xc(j))return yd(null,C,j,!0,V);throw Error(i(200))},r.render=function(C,j,V){if(xc(j))return yd(null,C,j,!1,V);throw Error(i(200))},r.unmountComponentAtNode=function(C){if(xc(C))return!!C._reactRootContainer&&(Fb(function(){yd(null,null,C,!1,function(){C._reactRootContainer=null,C[Vs]=null})}),!0);throw Error(i(40))},r.unstable_batchedUpdates=Bb,r.unstable_createPortal=function(C,j){return Wb(C,j,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)},r.unstable_renderSubtreeIntoContainer=function(C,j,V,it){if(!xc(V))throw Error(i(200));if(C==null||C._reactInternals===void 0)throw Error(i(38));return yd(C,j,V,!1,it)},r.version="17.0.2"},{"object-assign":385,react:408,scheduler:414}],401:[function(t,f,r){(function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE=="function")try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}})(),f.exports=t("./cjs/react-dom.production.min.js")},{"./cjs/react-dom.development.js":399,"./cjs/react-dom.production.min.js":400}],402:[function(t,f,r){(function(n){(function(){function e(K){if(typeof K=="object"&&K!==null){var N=K.$$typeof;switch(N){case s:var U=K.type;switch(U){case l:case a:case o:case p:case m:return U;default:var W=U&&U.$$typeof;switch(W){case u:case h:case _:case b:case c:return W;default:return N}}case i:return N}}}var s,i,l,o,a,c,u,h,p,m,b,_,v,w,x,S,E,k,D,P,O,R,A,z,H,$,M,J;n.env.NODE_ENV!=="production"&&(s=60103,i=60106,l=60107,o=60108,a=60114,c=60109,u=60110,h=60112,p=60113,m=60120,b=60115,_=60116,v=60121,w=60122,x=60117,S=60129,E=60131,typeof Symbol=="function"&&Symbol.for&&(s=(k=Symbol.for)("react.element"),i=k("react.portal"),l=k("react.fragment"),o=k("react.strict_mode"),a=k("react.profiler"),c=k("react.provider"),u=k("react.context"),h=k("react.forward_ref"),p=k("react.suspense"),m=k("react.suspense_list"),b=k("react.memo"),_=k("react.lazy"),v=k("react.block"),w=k("react.server.block"),x=k("react.fundamental"),k("react.scope"),k("react.opaque.id"),S=k("react.debug_trace_mode"),k("react.offscreen"),E=k("react.legacy_hidden")),k=u,D=c,P=s,O=h,R=l,A=_,z=b,H=i,$=a,M=o,J=p,r.ContextConsumer=k,r.ContextProvider=D,r.Element=P,r.ForwardRef=O,r.Fragment=R,r.Lazy=A,r.Memo=z,r.Portal=H,r.Profiler=$,r.StrictMode=M,r.Suspense=J,r.isAsyncMode=function(K){return!1},r.isConcurrentMode=function(K){return!1},r.isContextConsumer=function(K){return e(K)===u},r.isContextProvider=function(K){return e(K)===c},r.isElement=function(K){return typeof K=="object"&&K!==null&&K.$$typeof===s},r.isForwardRef=function(K){return e(K)===h},r.isFragment=function(K){return e(K)===l},r.isLazy=function(K){return e(K)===_},r.isMemo=function(K){return e(K)===b},r.isPortal=function(K){return e(K)===i},r.isProfiler=function(K){return e(K)===a},r.isStrictMode=function(K){return e(K)===o},r.isSuspense=function(K){return e(K)===p},r.isValidElementType=function(K){return typeof K=="string"||typeof K=="function"||K===l||K===a||K===S||K===o||K===p||K===m||K===E||typeof K=="object"&&K!==null&&(K.$$typeof===_||K.$$typeof===b||K.$$typeof===c||K.$$typeof===u||K.$$typeof===h||K.$$typeof===x||K.$$typeof===v||K[0]===w)},r.typeOf=e)}).call(this)}).call(this,t("_process"))},{_process:386}],403:[function(t,f,r){var n=60103,e=60106,s=60107,i=60108,l=60114,o=60109,a=60110,c=60112,u=60113,h=60120,p=60115,m=60116,b=60121,_=60122,v=60117,w=60129,x=60131;function S(M){if(typeof M=="object"&&M!==null){var J=M.$$typeof;switch(J){case n:switch(M=M.type){case s:case l:case i:case u:case h:return M;default:switch(M=M&&M.$$typeof){case a:case c:case m:case p:case o:return M;default:return J}}case e:return J}}}typeof Symbol=="function"&&Symbol.for&&(n=(E=Symbol.for)("react.element"),e=E("react.portal"),s=E("react.fragment"),i=E("react.strict_mode"),l=E("react.profiler"),o=E("react.provider"),a=E("react.context"),c=E("react.forward_ref"),u=E("react.suspense"),h=E("react.suspense_list"),p=E("react.memo"),m=E("react.lazy"),b=E("react.block"),_=E("react.server.block"),v=E("react.fundamental"),w=E("react.debug_trace_mode"),x=E("react.legacy_hidden"));var E=o,k=n,D=c,P=s,O=m,R=p,A=e,z=l,H=i,$=u;r.ContextConsumer=a,r.ContextProvider=E,r.Element=k,r.ForwardRef=D,r.Fragment=P,r.Lazy=O,r.Memo=R,r.Portal=A,r.Profiler=z,r.StrictMode=H,r.Suspense=$,r.isAsyncMode=function(){return!1},r.isConcurrentMode=function(){return!1},r.isContextConsumer=function(M){return S(M)===a},r.isContextProvider=function(M){return S(M)===o},r.isElement=function(M){return typeof M=="object"&&M!==null&&M.$$typeof===n},r.isForwardRef=function(M){return S(M)===c},r.isFragment=function(M){return S(M)===s},r.isLazy=function(M){return S(M)===m},r.isMemo=function(M){return S(M)===p},r.isPortal=function(M){return S(M)===e},r.isProfiler=function(M){return S(M)===l},r.isStrictMode=function(M){return S(M)===i},r.isSuspense=function(M){return S(M)===u},r.isValidElementType=function(M){return typeof M=="string"||typeof M=="function"||M===s||M===l||M===w||M===i||M===u||M===h||M===x||typeof M=="object"&&M!==null&&(M.$$typeof===m||M.$$typeof===p||M.$$typeof===o||M.$$typeof===a||M.$$typeof===c||M.$$typeof===v||M.$$typeof===b||M[0]===_)},r.typeOf=S},{}],404:[function(t,f,r){arguments[4][381][0].apply(r,arguments)},{"./cjs/react-is.development.js":402,"./cjs/react-is.production.min.js":403,_process:386,dup:381}],405:[function(t,f,r){Object.defineProperty(r,"__esModule",{value:!0});var n=Object.assign||function(l){for(var o=1;o<arguments.length;o++){var a,c=arguments[o];for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(l[a]=c[a])}return l},e=s(t("react"));function s(l){return l&&l.__esModule?l:{default:l}}t=s(t("localized-strings"));var i=/(\{[\d|\w]+\})/;t.default.prototype.formatString=function(l){for(var o=arguments.length,a=Array(1<o?o-1:0),c=1;c<o;c++)a[c-1]=arguments[c];var u=!1;return l=(l||"").split(i).filter(function(h){return!!h}).map(function(h,p){if(h.match(i)){var m=h.slice(1,-1),b=a[m];if(b==null){if((m=a[0][m])===void 0)return b;b=m}return e.default.isValidElement(b)?(u=!0,e.default.Children.toArray(b).map(function(_){return n({},_,{key:p.toString()})})):b}return h}),u?l:l.join("")},r.default=t.default},{"localized-strings":383,react:408}],406:[function(t,f,r){},{"object-assign":385}],407:[function(t,f,r){var n=t("object-assign"),e=60103,s=60106,i=(r.Fragment=60107,r.StrictMode=60108,r.Profiler=60114,60109),l=60110,o=60112,a=(r.Suspense=60113,60115),c=60116,u=(typeof Symbol=="function"&&Symbol.for&&(e=(t=Symbol.for)("react.element"),s=t("react.portal"),r.Fragment=t("react.fragment"),r.StrictMode=t("react.strict_mode"),r.Profiler=t("react.profiler"),i=t("react.provider"),l=t("react.context"),o=t("react.forward_ref"),r.Suspense=t("react.suspense"),a=t("react.memo"),c=t("react.lazy")),typeof Symbol=="function"&&Symbol.iterator);function h($){for(var M="https://reactjs.org/docs/error-decoder.html?invariant="+$,J=1;J<arguments.length;J++)M+="&args[]="+encodeURIComponent(arguments[J]);return"Minified React error #"+$+"; visit "+M+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m={};function b($,M,J){this.props=$,this.context=M,this.refs=m,this.updater=J||p}function _(){}function v($,M,J){this.props=$,this.context=M,this.refs=m,this.updater=J||p}b.prototype.isReactComponent={},b.prototype.setState=function($,M){if(typeof $!="object"&&typeof $!="function"&&$!=null)throw Error(h(85));this.updater.enqueueSetState(this,$,M,"setState")},b.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")},_.prototype=b.prototype;var w=((t=v.prototype=new _).constructor=v,n(t,b.prototype),t.isPureReactComponent=!0,{current:null}),x=Object.prototype.hasOwnProperty,S={key:!0,ref:!0,__self:!0,__source:!0};function E($,M,J){var K,N={},U=null,W=null;if(M!=null)for(K in M.ref!==void 0&&(W=M.ref),M.key!==void 0&&(U=""+M.key),M)x.call(M,K)&&!S.hasOwnProperty(K)&&(N[K]=M[K]);var G=arguments.length-2;if(G===1)N.children=J;else if(1<G){for(var F=Array(G),q=0;q<G;q++)F[q]=arguments[q+2];N.children=F}if($&&$.defaultProps)for(K in G=$.defaultProps)N[K]===void 0&&(N[K]=G[K]);return{$$typeof:e,type:$,key:U,ref:W,props:N,_owner:w.current}}function k($){return typeof $=="object"&&$!==null&&$.$$typeof===e}var D=/\/+/g;function P($,M){return typeof $=="object"&&$!==null&&$.key!=null?($=""+$.key,J={"=":"=0",":":"=2"},"$"+$.replace(/[=:]/g,function(K){return J[K]})):M.toString(36);var J}function O($,M,J,K,N){var U,W,G=!1;if(($=(q=typeof $)!="undefined"&&q!=="boolean"?$:null)===null)G=!0;else switch(q){case"string":case"number":G=!0;break;case"object":switch($.$$typeof){case e:case s:G=!0}}if(G)return N=N(G=$),$=K===""?"."+P(G,0):K,Array.isArray(N)?(J="",O(N,M,J=$!=null?$.replace(D,"$&/")+"/":J,"",function(I){return I})):N!=null&&(k(N)&&(W=J+(!(U=N).key||G&&G.key===N.key?"":(""+N.key).replace(D,"$&/")+"/")+$,N={$$typeof:e,type:U.type,key:W,ref:U.ref,props:U.props,_owner:U._owner}),M.push(N)),1;if(G=0,K=K===""?".":K+":",Array.isArray($))for(var F=0;F<$.length;F++){var q,T=K+P(q=$[F],F);G+=O(q,M,J,T,N)}else if(typeof(T=(W=$)!==null&&typeof W=="object"&&typeof(W=u&&W[u]||W["@@iterator"])=="function"?W:null)=="function")for($=T.call($),F=0;!(q=$.next()).done;)G+=O(q=q.value,M,J,T=K+P(q,F++),N);else if(q==="object")throw M=""+$,Error(h(31,M==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":M));return G}function R($,M,J){if($==null)return $;var K=[],N=0;return O($,K,"","",function(U){return M.call(J,U,N++)}),K}function A($){var M;if($._status===-1&&(M=(M=$._result)(),$._status=0,($._result=M).then(function(J){$._status===0&&(J=J.default,$._status=1,$._result=J)},function(J){$._status===0&&($._status=2,$._result=J)})),$._status===1)return $._result;throw $._result}var z={current:null};function H(){var $=z.current;if($===null)throw Error(h(321));return $}t={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:n},r.Children={map:R,forEach:function($,M,J){R($,function(){M.apply(this,arguments)},J)},count:function($){var M=0;return R($,function(){M++}),M},toArray:function($){return R($,function(M){return M})||[]},only:function($){if(k($))return $;throw Error(h(143))}},r.Component=b,r.PureComponent=v,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t,r.cloneElement=function($,M,J){if($==null)throw Error(h(267,$));var K=n({},$.props),N=$.key,U=$.ref,W=$._owner;if(M!=null)for(G in M.ref!==void 0&&(U=M.ref,W=w.current),M.key!==void 0&&(N=""+M.key),$.type&&$.type.defaultProps&&(F=$.type.defaultProps),M)x.call(M,G)&&!S.hasOwnProperty(G)&&(K[G]=(M[G]===void 0&&F!==void 0?F:M)[G]);var G=arguments.length-2;if(G===1)K.children=J;else if(1<G){for(var F=Array(G),q=0;q<G;q++)F[q]=arguments[q+2];K.children=F}return{$$typeof:e,type:$.type,key:N,ref:U,props:K,_owner:W}},r.createContext=function($,M){return($={$$typeof:l,_calculateChangedBits:M=M===void 0?null:M,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:i,_context:$},$.Consumer=$},r.createElement=E,r.createFactory=function($){var M=E.bind(null,$);return M.type=$,M},r.createRef=function(){return{current:null}},r.forwardRef=function($){return{$$typeof:o,render:$}},r.isValidElement=k,r.lazy=function($){return{$$typeof:c,_payload:{_status:-1,_result:$},_init:A}},r.memo=function($,M){return{$$typeof:a,type:$,compare:M===void 0?null:M}},r.useCallback=function($,M){return H().useCallback($,M)},r.useContext=function($,M){return H().useContext($,M)},r.useDebugValue=function(){},r.useEffect=function($,M){return H().useEffect($,M)},r.useImperativeHandle=function($,M,J){return H().useImperativeHandle($,M,J)},r.useLayoutEffect=function($,M){return H().useLayoutEffect($,M)},r.useMemo=function($,M){return H().useMemo($,M)},r.useReducer=function($,M,J){return H().useReducer($,M,J)},r.useRef=function($){return H().useRef($)},r.useState=function($){return H().useState($)},r.version="17.0.2"},{"object-assign":385}],408:[function(t,f,r){f.exports=t("./cjs/react.production.min.js")},{"./cjs/react.development.js":406,"./cjs/react.production.min.js":407}],409:[function(t,f,r){f=function(n){var e,s=Object.prototype,i=s.hasOwnProperty,l=(E=typeof Symbol=="function"?Symbol:{}).iterator||"@@iterator",o=E.asyncIterator||"@@asyncIterator",a=E.toStringTag||"@@toStringTag";function c(M,J,K){return Object.defineProperty(M,J,{value:K,enumerable:!0,configurable:!0,writable:!0}),M[J]}try{c({},"")}catch{c=function(J,K,N){return J[K]=N}}function u(M,J,K,N){var U,W,G,F;return J=J&&J.prototype instanceof w?J:w,J=Object.create(J.prototype),N=new z(N||[]),J._invoke=(U=M,W=K,G=N,F=p,function(q,T){if(F===b)throw new Error("Generator is already running");if(F===_){if(q==="throw")throw T;return $()}for(G.method=q,G.arg=T;;){var I=G.delegate;if(I&&(I=function L(B,Y){var Z=B.iterator[Y.method];if(Z===e){if(Y.delegate=null,Y.method==="throw"){if(B.iterator.return&&(Y.method="return",Y.arg=e,L(B,Y),Y.method==="throw"))return v;Y.method="throw",Y.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}return(Z=h(Z,B.iterator,Y.arg)).type==="throw"?(Y.method="throw",Y.arg=Z.arg,Y.delegate=null,v):(Z=Z.arg)?Z.done?(Y[B.resultName]=Z.value,Y.next=B.nextLoc,Y.method!=="return"&&(Y.method="next",Y.arg=e),Y.delegate=null,v):Z:(Y.method="throw",Y.arg=new TypeError("iterator result is not an object"),Y.delegate=null,v)}(I,G),I)){if(I===v)continue;return I}if(G.method==="next")G.sent=G._sent=G.arg;else if(G.method==="throw"){if(F===p)throw F=_,G.arg;G.dispatchException(G.arg)}else G.method==="return"&&G.abrupt("return",G.arg);if(F=b,(I=h(U,W,G)).type==="normal"){if(F=G.done?_:m,I.arg!==v)return{value:I.arg,done:G.done}}else I.type==="throw"&&(F=_,G.method="throw",G.arg=I.arg)}}),J}function h(M,J,K){try{return{type:"normal",arg:M.call(J,K)}}catch(N){return{type:"throw",arg:N}}}n.wrap=u;var p="suspendedStart",m="suspendedYield",b="executing",_="completed",v={};function w(){}function x(){}function S(){}var E,k,D=(c(E={},l,function(){return this}),(k=(k=Object.getPrototypeOf)&&k(k(H([]))))&&k!==s&&i.call(k,l)&&(E=k),S.prototype=w.prototype=Object.create(E));function P(M){["next","throw","return"].forEach(function(J){c(M,J,function(K){return this._invoke(J,K)})})}function O(M,J){var K;this._invoke=function(N,U){function W(){return new J(function(G,F){(function q(T,I,L,B){var Y;if((T=h(M[T],M,I)).type!=="throw")return(I=(Y=T.arg).value)&&typeof I=="object"&&i.call(I,"__await")?J.resolve(I.__await).then(function(Z){q("next",Z,L,B)},function(Z){q("throw",Z,L,B)}):J.resolve(I).then(function(Z){Y.value=Z,L(Y)},function(Z){return q("throw",Z,L,B)});B(T.arg)})(N,U,G,F)})}return K=K?K.then(W,W):W()}}function R(M){var J={tryLoc:M[0]};1 in M&&(J.catchLoc=M[1]),2 in M&&(J.finallyLoc=M[2],J.afterLoc=M[3]),this.tryEntries.push(J)}function A(M){var J=M.completion||{};J.type="normal",delete J.arg,M.completion=J}function z(M){this.tryEntries=[{tryLoc:"root"}],M.forEach(R,this),this.reset(!0)}function H(M){if(M){var J,K=M[l];if(K)return K.call(M);if(typeof M.next=="function")return M;if(!isNaN(M.length))return J=-1,(K=function N(){for(;++J<M.length;)if(i.call(M,J))return N.value=M[J],N.done=!1,N;return N.value=e,N.done=!0,N}).next=K}return{next:$}}function $(){return{value:e,done:!0}}return c(D,"constructor",x.prototype=S),c(S,"constructor",x),x.displayName=c(S,a,"GeneratorFunction"),n.isGeneratorFunction=function(M){return!!(M=typeof M=="function"&&M.constructor)&&(M===x||(M.displayName||M.name)==="GeneratorFunction")},n.mark=function(M){return Object.setPrototypeOf?Object.setPrototypeOf(M,S):(M.__proto__=S,c(M,a,"GeneratorFunction")),M.prototype=Object.create(D),M},n.awrap=function(M){return{__await:M}},P(O.prototype),c(O.prototype,o,function(){return this}),n.AsyncIterator=O,n.async=function(M,J,K,N,U){U===void 0&&(U=Promise);var W=new O(u(M,J,K,N),U);return n.isGeneratorFunction(J)?W:W.next().then(function(G){return G.done?G.value:W.next()})},P(D),c(D,a,"Generator"),c(D,l,function(){return this}),c(D,"toString",function(){return"[object Generator]"}),n.keys=function(M){var J,K=[];for(J in M)K.push(J);return K.reverse(),function N(){for(;K.length;){var U=K.pop();if(U in M)return N.value=U,N.done=!1,N}return N.done=!0,N}},n.values=H,z.prototype={constructor:z,reset:function(M){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!M)for(var J in this)J.charAt(0)==="t"&&i.call(this,J)&&!isNaN(+J.slice(1))&&(this[J]=e)},stop:function(){this.done=!0;var M=this.tryEntries[0].completion;if(M.type==="throw")throw M.arg;return this.rval},dispatchException:function(M){if(this.done)throw M;var J=this;function K(q,T){return W.type="throw",W.arg=M,J.next=q,T&&(J.method="next",J.arg=e),!!T}for(var N=this.tryEntries.length-1;0<=N;--N){var U=this.tryEntries[N],W=U.completion;if(U.tryLoc==="root")return K("end");if(U.tryLoc<=this.prev){var G=i.call(U,"catchLoc"),F=i.call(U,"finallyLoc");if(G&&F){if(this.prev<U.catchLoc)return K(U.catchLoc,!0);if(this.prev<U.finallyLoc)return K(U.finallyLoc)}else if(G){if(this.prev<U.catchLoc)return K(U.catchLoc,!0)}else{if(!F)throw new Error("try statement without catch or finally");if(this.prev<U.finallyLoc)return K(U.finallyLoc)}}}},abrupt:function(M,J){for(var K=this.tryEntries.length-1;0<=K;--K){var N=this.tryEntries[K];if(N.tryLoc<=this.prev&&i.call(N,"finallyLoc")&&this.prev<N.finallyLoc){var U=N;break}}var W=(U=U&&(M==="break"||M==="continue")&&U.tryLoc<=J&&J<=U.finallyLoc?null:U)?U.completion:{};return W.type=M,W.arg=J,U?(this.method="next",this.next=U.finallyLoc,v):this.complete(W)},complete:function(M,J){if(M.type==="throw")throw M.arg;return M.type==="break"||M.type==="continue"?this.next=M.arg:M.type==="return"?(this.rval=this.arg=M.arg,this.method="return",this.next="end"):M.type==="normal"&&J&&(this.next=J),v},finish:function(M){for(var J=this.tryEntries.length-1;0<=J;--J){var K=this.tryEntries[J];if(K.finallyLoc===M)return this.complete(K.completion,K.afterLoc),A(K),v}},catch:function(M){for(var J=this.tryEntries.length-1;0<=J;--J){var K,N,U=this.tryEntries[J];if(U.tryLoc===M)return(K=U.completion).type==="throw"&&(N=K.arg,A(U)),N}throw new Error("illegal catch attempt")},delegateYield:function(M,J,K){return this.delegate={iterator:H(M),resultName:J,nextLoc:K},this.method==="next"&&(this.arg=e),v}},n}(typeof f=="object"?f.exports:{});try{regeneratorRuntime=f}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=f:Function("r","regeneratorRuntime = r")(f)}},{}],410:[function(t,f,r){},{}],411:[function(t,f,r){var n=0;r.__interactionsRef=null,r.__subscriberRef=null,r.unstable_clear=function(e){return e()},r.unstable_getCurrent=function(){return null},r.unstable_getThreadID=function(){return++n},r.unstable_subscribe=function(){},r.unstable_trace=function(e,s,i){return i()},r.unstable_unsubscribe=function(){},r.unstable_wrap=function(e){return e}},{}],412:[function(t,f,r){},{}],413:[function(t,f,r){var n,e,s,i,l,o,a,c,u,h,p,m,b,_,v,w,x,S;function E(G,F){var q=G.length;for(G.push(F);;){var T=q-1>>>1,I=G[T];if(!(I!==void 0&&0<P(I,F)))break;G[T]=F,G[q]=I,q=T}}function k(G){return(G=G[0])===void 0?null:G}function D(G){var F=G[0];if(F!==void 0){var q=G.pop();if(q!==F){G[0]=q;for(var T=0,I=G.length;T<I;){var L=2*(T+1)-1,B=G[L],Y=1+L,Z=G[Y];if(B!==void 0&&P(B,q)<0)T=Z!==void 0&&P(Z,B)<0?(G[T]=Z,G[Y]=q,Y):(G[T]=B,G[L]=q,L);else{if(!(Z!==void 0&&P(Z,q)<0))break;G[T]=Z,G[Y]=q,T=Y}}}}}function P(G,F){var q=G.sortIndex-F.sortIndex;return q!=0?q:G.id-F.id}typeof performance=="object"&&typeof performance.now=="function"?(e=performance,r.unstable_now=function(){return e.now()}):(s=Date,i=s.now(),r.unstable_now=function(){return s.now()-i}),typeof window>"u"||typeof MessageChannel!="function"?(o=l=null,a=function(){if(l!==null)try{var G=r.unstable_now();l(!0,G),l=null}catch(F){throw setTimeout(a,0),F}},c=function(G){l!==null?setTimeout(c,0,G):(l=G,setTimeout(a,0))},u=function(G,F){o=setTimeout(G,F)},h=function(){clearTimeout(o)},r.unstable_shouldYield=function(){return!1},n=r.unstable_forceFrameRate=function(){}):(p=window.setTimeout,m=window.clearTimeout,typeof console<"u"&&(W=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof W!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),b=!1,_=null,v=-1,w=5,x=0,r.unstable_shouldYield=function(){return r.unstable_now()>=x},n=function(){},r.unstable_forceFrameRate=function(G){G<0||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):w=0<G?Math.floor(1e3/G):5},W=new MessageChannel,S=W.port2,W.port1.onmessage=function(){if(_!==null){var G=r.unstable_now();x=G+w;try{_(!0,G)?S.postMessage(null):(b=!1,_=null)}catch(F){throw S.postMessage(null),F}}else b=!1},c=function(G){_=G,b||(b=!0,S.postMessage(null))},u=function(G,F){v=p(function(){G(r.unstable_now())},F)},h=function(){m(v),v=-1});var O=[],R=[],A=1,z=null,H=3,$=!1,M=!1,J=!1;function K(G){for(var F=k(R);F!==null;){if(F.callback===null)D(R);else{if(!(F.startTime<=G))break;D(R),F.sortIndex=F.expirationTime,E(O,F)}F=k(R)}}function N(G){var F;J=!1,K(G),M||(k(O)!==null?(M=!0,c(U)):(F=k(R))!==null&&u(N,F.startTime-G))}function U(G,F){M=!1,J&&(J=!1,h()),$=!0;var q=H;try{for(K(F),z=k(O);z!==null&&(!(z.expirationTime>F)||G&&!r.unstable_shouldYield());){var T,I=z.callback;typeof I=="function"?(z.callback=null,H=z.priorityLevel,T=I(z.expirationTime<=F),F=r.unstable_now(),typeof T=="function"?z.callback=T:z===k(O)&&D(O),K(F)):D(O),z=k(O)}var L;return z!==null||((L=k(R))!==null&&u(N,L.startTime-F),!1)}finally{z=null,H=q,$=!1}}var W=n;r.unstable_IdlePriority=5,r.unstable_ImmediatePriority=1,r.unstable_LowPriority=4,r.unstable_NormalPriority=3,r.unstable_Profiling=null,r.unstable_UserBlockingPriority=2,r.unstable_cancelCallback=function(G){G.callback=null},r.unstable_continueExecution=function(){M||$||(M=!0,c(U))},r.unstable_getCurrentPriorityLevel=function(){return H},r.unstable_getFirstCallbackNode=function(){return k(O)},r.unstable_next=function(G){switch(H){case 1:case 2:case 3:var F=3;break;default:F=H}var q=H;H=F;try{return G()}finally{H=q}},r.unstable_pauseExecution=function(){},r.unstable_requestPaint=W,r.unstable_runWithPriority=function(G,F){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var q=H;H=G;try{return F()}finally{H=q}},r.unstable_scheduleCallback=function(G,F,q){var T=r.unstable_now();switch(q=typeof q=="object"&&q!==null&&typeof(q=q.delay)=="number"&&0<q?T+q:T,G){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return G={id:A++,callback:F,priorityLevel:G,startTime:q,expirationTime:I=q+I,sortIndex:-1},T<q?(G.sortIndex=q,E(R,G),k(O)===null&&G===k(R)&&(J?h():J=!0,u(N,q-T))):(G.sortIndex=I,E(O,G),M||$||(M=!0,c(U))),G},r.unstable_wrapCallback=function(G){var F=H;return function(){var q=H;H=F;try{return G.apply(this,arguments)}finally{H=q}}}},{}],414:[function(t,f,r){f.exports=t("./cjs/scheduler.production.min.js")},{"./cjs/scheduler.development.js":412,"./cjs/scheduler.production.min.js":413}],415:[function(t,f,r){f.exports=t("./cjs/scheduler-tracing.production.min.js")},{"./cjs/scheduler-tracing.development.js":410,"./cjs/scheduler-tracing.production.min.js":411}],416:[function(t,f,r){f.exports=function(n,e,s,i){if((h=s?s.call(i,n,e):void 0)!==void 0)return!!h;if(n===e)return!0;if(typeof n!="object"||!n||typeof e!="object"||!e)return!1;var l=Object.keys(n),o=Object.keys(e);if(l.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(e),c=0;c<l.length;c++){var u=l[c];if(!a(u))return!1;var h,p=n[u],m=e[u];if((h=s?s.call(i,p,m,u):void 0)===!1||h===void 0&&p!==m)return!1}return!0}},{}],417:[function(t,f,r){(function(n){(function(){function e(pt){return pt&&typeof pt=="object"&&"default"in pt?pt.default:pt}Object.defineProperty(r,"__esModule",{value:!0});var s=t("react-is"),i=t("react"),l=e(i),o=e(t("shallowequal")),a=e(t("@emotion/stylis")),c=e(t("@emotion/unitless")),u=e(t("@emotion/is-prop-valid")),h=e(t("hoist-non-react-statics"));function p(){return(p=Object.assign||function(pt){for(var Dt=1;Dt<arguments.length;Dt++){var $t,qt=arguments[Dt];for($t in qt)Object.prototype.hasOwnProperty.call(qt,$t)&&(pt[$t]=qt[$t])}return pt}).apply(this,arguments)}var m=function(pt,Dt){for(var $t=[pt[0]],qt=0,Vt=Dt.length;qt<Vt;qt+=1)$t.push(Dt[qt],pt[qt+1]);return $t},b=function(pt){return pt!==null&&typeof pt=="object"&&(pt.toString?pt.toString():Object.prototype.toString.call(pt))==="[object Object]"&&!s.typeOf(pt)},_=Object.freeze([]),v=Object.freeze({});function w(pt){return typeof pt=="function"}function x(pt){return n.env.NODE_ENV!=="production"&&typeof pt=="string"&&pt||pt.displayName||pt.name||"Component"}function S(pt){return pt&&typeof pt.styledComponentId=="string"}var E=n!==void 0&&(n.env.REACT_APP_SC_ATTR||n.env.SC_ATTR)||"data-styled",k=typeof window<"u"&&"HTMLElement"in window,D=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:n!==void 0&&n.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&n.env.REACT_APP_SC_DISABLE_SPEEDY!==""?n.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&n.env.REACT_APP_SC_DISABLE_SPEEDY:n!==void 0&&n.env.SC_DISABLE_SPEEDY!==void 0&&n.env.SC_DISABLE_SPEEDY!==""?n.env.SC_DISABLE_SPEEDY!=="false"&&n.env.SC_DISABLE_SPEEDY:n.env.NODE_ENV!=="production"),P={},O=n.env.NODE_ENV!=="production"?{1:`Cannot create styled-component for component: %s.
|
|
112
112
|
|
|
113
113
|
`,2:`Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
|
|
114
114
|
|
|
@@ -1389,7 +1389,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1389
1389
|
display: none !important;
|
|
1390
1390
|
}
|
|
1391
1391
|
`,""]);const e=n},269:(y,d,g)=>{const t=g(962),f={};for(const e of Object.keys(t))f[t[e]]=e;const r={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};y.exports=r;for(const e of Object.keys(r)){if(!("channels"in r[e]))throw new Error("missing channels property: "+e);if(!("labels"in r[e]))throw new Error("missing channel labels property: "+e);if(r[e].labels.length!==r[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:s,labels:i}=r[e];delete r[e].channels,delete r[e].labels,Object.defineProperty(r[e],"channels",{value:s}),Object.defineProperty(r[e],"labels",{value:i})}function n(e,s){return(e[0]-s[0])**2+(e[1]-s[1])**2+(e[2]-s[2])**2}r.rgb.hsl=function(e){const s=e[0]/255,i=e[1]/255,l=e[2]/255,o=Math.min(s,i,l),a=Math.max(s,i,l),c=a-o;let u,h;a===o?u=0:s===a?u=(i-l)/c:i===a?u=2+(l-s)/c:l===a&&(u=4+(s-i)/c),u=Math.min(60*u,360),u<0&&(u+=360);const p=(o+a)/2;return h=a===o?0:p<=.5?c/(a+o):c/(2-a-o),[u,100*h,100*p]},r.rgb.hsv=function(e){let s,i,l,o,a;const c=e[0]/255,u=e[1]/255,h=e[2]/255,p=Math.max(c,u,h),m=p-Math.min(c,u,h),b=function(_){return(p-_)/6/m+.5};return m===0?(o=0,a=0):(a=m/p,s=b(c),i=b(u),l=b(h),c===p?o=l-i:u===p?o=1/3+s-l:h===p&&(o=2/3+i-s),o<0?o+=1:o>1&&(o-=1)),[360*o,100*a,100*p]},r.rgb.hwb=function(e){const s=e[0],i=e[1];let l=e[2];const o=r.rgb.hsl(e)[0],a=1/255*Math.min(s,Math.min(i,l));return l=1-1/255*Math.max(s,Math.max(i,l)),[o,100*a,100*l]},r.rgb.cmyk=function(e){const s=e[0]/255,i=e[1]/255,l=e[2]/255,o=Math.min(1-s,1-i,1-l);return[100*((1-s-o)/(1-o)||0),100*((1-i-o)/(1-o)||0),100*((1-l-o)/(1-o)||0),100*o]},r.rgb.keyword=function(e){const s=f[e];if(s)return s;let i,l=1/0;for(const o of Object.keys(t)){const a=n(e,t[o]);a<l&&(l=a,i=o)}return i},r.keyword.rgb=function(e){return t[e]},r.rgb.xyz=function(e){let s=e[0]/255,i=e[1]/255,l=e[2]/255;return s=s>.04045?((s+.055)/1.055)**2.4:s/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92,l=l>.04045?((l+.055)/1.055)**2.4:l/12.92,[100*(.4124*s+.3576*i+.1805*l),100*(.2126*s+.7152*i+.0722*l),100*(.0193*s+.1192*i+.9505*l)]},r.rgb.lab=function(e){const s=r.rgb.xyz(e);let i=s[0],l=s[1],o=s[2];return i/=95.047,l/=100,o/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,l=l>.008856?l**(1/3):7.787*l+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,[116*l-16,500*(i-l),200*(l-o)]},r.hsl.rgb=function(e){const s=e[0]/360,i=e[1]/100,l=e[2]/100;let o,a,c;if(i===0)return c=255*l,[c,c,c];o=l<.5?l*(1+i):l+i-l*i;const u=2*l-o,h=[0,0,0];for(let p=0;p<3;p++)a=s+1/3*-(p-1),a<0&&a++,a>1&&a--,c=6*a<1?u+6*(o-u)*a:2*a<1?o:3*a<2?u+(o-u)*(2/3-a)*6:u,h[p]=255*c;return h},r.hsl.hsv=function(e){const s=e[0];let i=e[1]/100,l=e[2]/100,o=i;const a=Math.max(l,.01);return l*=2,i*=l<=1?l:2-l,o*=a<=1?a:2-a,[s,100*(l===0?2*o/(a+o):2*i/(l+i)),(l+i)/2*100]},r.hsv.rgb=function(e){const s=e[0]/60,i=e[1]/100;let l=e[2]/100;const o=Math.floor(s)%6,a=s-Math.floor(s),c=255*l*(1-i),u=255*l*(1-i*a),h=255*l*(1-i*(1-a));switch(l*=255,o){case 0:return[l,h,c];case 1:return[u,l,c];case 2:return[c,l,h];case 3:return[c,u,l];case 4:return[h,c,l];case 5:return[l,c,u]}},r.hsv.hsl=function(e){const s=e[0],i=e[1]/100,l=e[2]/100,o=Math.max(l,.01);let a,c;c=(2-i)*l;const u=(2-i)*o;return a=i*o,a/=u<=1?u:2-u,a=a||0,c/=2,[s,100*a,100*c]},r.hwb.rgb=function(e){const s=e[0]/360;let i=e[1]/100,l=e[2]/100;const o=i+l;let a;o>1&&(i/=o,l/=o);const c=Math.floor(6*s),u=1-l;a=6*s-c,1&c&&(a=1-a);const h=i+a*(u-i);let p,m,b;switch(c){default:case 6:case 0:p=u,m=h,b=i;break;case 1:p=h,m=u,b=i;break;case 2:p=i,m=u,b=h;break;case 3:p=i,m=h,b=u;break;case 4:p=h,m=i,b=u;break;case 5:p=u,m=i,b=h}return[255*p,255*m,255*b]},r.cmyk.rgb=function(e){const s=e[0]/100,i=e[1]/100,l=e[2]/100,o=e[3]/100;return[255*(1-Math.min(1,s*(1-o)+o)),255*(1-Math.min(1,i*(1-o)+o)),255*(1-Math.min(1,l*(1-o)+o))]},r.xyz.rgb=function(e){const s=e[0]/100,i=e[1]/100,l=e[2]/100;let o,a,c;return o=3.2406*s+-1.5372*i+-.4986*l,a=-.9689*s+1.8758*i+.0415*l,c=.0557*s+-.204*i+1.057*l,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,c=c>.0031308?1.055*c**(1/2.4)-.055:12.92*c,o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),c=Math.min(Math.max(0,c),1),[255*o,255*a,255*c]},r.xyz.lab=function(e){let s=e[0],i=e[1],l=e[2];return s/=95.047,i/=100,l/=108.883,s=s>.008856?s**(1/3):7.787*s+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,l=l>.008856?l**(1/3):7.787*l+16/116,[116*i-16,500*(s-i),200*(i-l)]},r.lab.xyz=function(e){let s,i,l;i=(e[0]+16)/116,s=e[1]/500+i,l=i-e[2]/200;const o=i**3,a=s**3,c=l**3;return i=o>.008856?o:(i-16/116)/7.787,s=a>.008856?a:(s-16/116)/7.787,l=c>.008856?c:(l-16/116)/7.787,s*=95.047,i*=100,l*=108.883,[s,i,l]},r.lab.lch=function(e){const s=e[0],i=e[1],l=e[2];let o;return o=360*Math.atan2(l,i)/2/Math.PI,o<0&&(o+=360),[s,Math.sqrt(i*i+l*l),o]},r.lch.lab=function(e){const s=e[0],i=e[1],l=e[2]/360*2*Math.PI;return[s,i*Math.cos(l),i*Math.sin(l)]},r.rgb.ansi16=function(e,s=null){const[i,l,o]=e;let a=s===null?r.rgb.hsv(e)[2]:s;if(a=Math.round(a/50),a===0)return 30;let c=30+(Math.round(o/255)<<2|Math.round(l/255)<<1|Math.round(i/255));return a===2&&(c+=60),c},r.hsv.ansi16=function(e){return r.rgb.ansi16(r.hsv.rgb(e),e[2])},r.rgb.ansi256=function(e){const s=e[0],i=e[1],l=e[2];return s===i&&i===l?s<8?16:s>248?231:Math.round((s-8)/247*24)+232:16+36*Math.round(s/255*5)+6*Math.round(i/255*5)+Math.round(l/255*5)},r.ansi16.rgb=function(e){let s=e%10;if(s===0||s===7)return e>50&&(s+=3.5),s=s/10.5*255,[s,s,s];const i=.5*(1+~~(e>50));return[(1&s)*i*255,(s>>1&1)*i*255,(s>>2&1)*i*255]},r.ansi256.rgb=function(e){if(e>=232){const i=10*(e-232)+8;return[i,i,i]}let s;return e-=16,[Math.floor(e/36)/5*255,Math.floor((s=e%36)/6)/5*255,s%6/5*255]},r.rgb.hex=function(e){const s=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(s.length)+s},r.hex.rgb=function(e){const s=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!s)return[0,0,0];let i=s[0];s[0].length===3&&(i=i.split("").map(o=>o+o).join(""));const l=parseInt(i,16);return[l>>16&255,l>>8&255,255&l]},r.rgb.hcg=function(e){const s=e[0]/255,i=e[1]/255,l=e[2]/255,o=Math.max(Math.max(s,i),l),a=Math.min(Math.min(s,i),l),c=o-a;let u,h;return u=c<1?a/(1-c):0,h=c<=0?0:o===s?(i-l)/c%6:o===i?2+(l-s)/c:4+(s-i)/c,h/=6,h%=1,[360*h,100*c,100*u]},r.hsl.hcg=function(e){const s=e[1]/100,i=e[2]/100,l=i<.5?2*s*i:2*s*(1-i);let o=0;return l<1&&(o=(i-.5*l)/(1-l)),[e[0],100*l,100*o]},r.hsv.hcg=function(e){const s=e[1]/100,i=e[2]/100,l=s*i;let o=0;return l<1&&(o=(i-l)/(1-l)),[e[0],100*l,100*o]},r.hcg.rgb=function(e){const s=e[0]/360,i=e[1]/100,l=e[2]/100;if(i===0)return[255*l,255*l,255*l];const o=[0,0,0],a=s%1*6,c=a%1,u=1-c;let h=0;switch(Math.floor(a)){case 0:o[0]=1,o[1]=c,o[2]=0;break;case 1:o[0]=u,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=c;break;case 3:o[0]=0,o[1]=u,o[2]=1;break;case 4:o[0]=c,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=u}return h=(1-i)*l,[255*(i*o[0]+h),255*(i*o[1]+h),255*(i*o[2]+h)]},r.hcg.hsv=function(e){const s=e[1]/100,i=s+e[2]/100*(1-s);let l=0;return i>0&&(l=s/i),[e[0],100*l,100*i]},r.hcg.hsl=function(e){const s=e[1]/100,i=e[2]/100*(1-s)+.5*s;let l=0;return i>0&&i<.5?l=s/(2*i):i>=.5&&i<1&&(l=s/(2*(1-i))),[e[0],100*l,100*i]},r.hcg.hwb=function(e){const s=e[1]/100,i=s+e[2]/100*(1-s);return[e[0],100*(i-s),100*(1-i)]},r.hwb.hcg=function(e){const s=e[1]/100,i=1-e[2]/100,l=i-s;let o=0;return l<1&&(o=(i-l)/(1-l)),[e[0],100*l,100*o]},r.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},r.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},r.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},r.gray.hsl=function(e){return[0,0,e[0]]},r.gray.hsv=r.gray.hsl,r.gray.hwb=function(e){return[0,100,e[0]]},r.gray.cmyk=function(e){return[0,0,0,e[0]]},r.gray.lab=function(e){return[e[0],0,0]},r.gray.hex=function(e){const s=255&Math.round(e[0]/100*255),i=((s<<16)+(s<<8)+s).toString(16).toUpperCase();return"000000".substring(i.length)+i},r.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},256:(y,d,g)=>{const t=g(269),f=g(273),r={};Object.keys(t).forEach(n=>{r[n]={},Object.defineProperty(r[n],"channels",{value:t[n].channels}),Object.defineProperty(r[n],"labels",{value:t[n].labels});const e=f(n);Object.keys(e).forEach(s=>{const i=e[s];r[n][s]=function(l){const o=function(...a){const c=a[0];if(c==null)return c;c.length>1&&(a=c);const u=l(a);if(typeof u=="object")for(let h=u.length,p=0;p<h;p++)u[p]=Math.round(u[p]);return u};return"conversion"in l&&(o.conversion=l.conversion),o}(i),r[n][s].raw=function(l){const o=function(...a){const c=a[0];return c==null?c:(c.length>1&&(a=c),l(a))};return"conversion"in l&&(o.conversion=l.conversion),o}(i)})}),y.exports=r},273:(y,d,g)=>{const t=g(269);function f(n,e){return function(s){return e(n(s))}}function r(n,e){const s=[e[n].parent,n];let i=t[e[n].parent][n],l=e[n].parent;for(;e[l].parent;)s.unshift(e[l].parent),i=f(t[e[l].parent][l],i),l=e[l].parent;return i.conversion=s,i}y.exports=function(n){const e=function(l){const o=function(){const c={},u=Object.keys(t);for(let h=u.length,p=0;p<h;p++)c[u[p]]={distance:-1,parent:null};return c}(),a=[l];for(o[l].distance=0;a.length;){const c=a.pop(),u=Object.keys(t[c]);for(let h=u.length,p=0;p<h;p++){const m=u[p],b=o[m];b.distance===-1&&(b.distance=o[c].distance+1,b.parent=c,a.unshift(m))}}return o}(n),s={},i=Object.keys(e);for(let l=i.length,o=0;o<l;o++){const a=i[o];e[a].parent!==null&&(s[a]=r(a,e))}return s}},962:y=>{y.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},364:y=>{y.exports=function(d){var g=[];return g.toString=function(){return this.map(function(t){var f="",r=t[5]!==void 0;return t[4]&&(f+="@supports (".concat(t[4],") {")),t[2]&&(f+="@media ".concat(t[2]," {")),r&&(f+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),f+=d(t),r&&(f+="}"),t[2]&&(f+="}"),t[4]&&(f+="}"),f}).join("")},g.i=function(t,f,r,n,e){typeof t=="string"&&(t=[[null,t,void 0]]);var s={};if(r)for(var i=0;i<this.length;i++){var l=this[i][0];l!=null&&(s[l]=!0)}for(var o=0;o<t.length;o++){var a=[].concat(t[o]);r&&s[a[0]]||(e!==void 0&&(a[5]===void 0||(a[1]="@layer".concat(a[5].length>0?" ".concat(a[5]):""," {").concat(a[1],"}")),a[5]=e),f&&(a[2]&&(a[1]="@media ".concat(a[2]," {").concat(a[1],"}")),a[2]=f),n&&(a[4]?(a[1]="@supports (".concat(a[4],") {").concat(a[1],"}"),a[4]=n):a[4]="".concat(n)),g.push(a))}},g}},379:y=>{y.exports=function(d){return d[1]}},186:y=>{var d=[];function g(r){for(var n=-1,e=0;e<d.length;e++)if(d[e].identifier===r){n=e;break}return n}function t(r,n){for(var e={},s=[],i=0;i<r.length;i++){var l=r[i],o=n.base?l[0]+n.base:l[0],a=e[o]||0,c="".concat(o," ").concat(a);e[o]=a+1;var u=g(c),h={css:l[1],media:l[2],sourceMap:l[3],supports:l[4],layer:l[5]};if(u!==-1)d[u].references++,d[u].updater(h);else{var p=f(h,n);n.byIndex=i,d.splice(i,0,{identifier:c,updater:p,references:1})}s.push(c)}return s}function f(r,n){var e=n.domAPI(n);return e.update(r),function(s){if(s){if(s.css===r.css&&s.media===r.media&&s.sourceMap===r.sourceMap&&s.supports===r.supports&&s.layer===r.layer)return;e.update(r=s)}else e.remove()}}y.exports=function(r,n){var e=t(r=r||[],n=n||{});return function(s){s=s||[];for(var i=0;i<e.length;i++){var l=g(e[i]);d[l].references--}for(var o=t(s,n),a=0;a<e.length;a++){var c=g(e[a]);d[c].references===0&&(d[c].updater(),d.splice(c,1))}e=o}}},433:y=>{var d={};y.exports=function(g,t){var f=function(r){if(d[r]===void 0){var n=document.querySelector(r);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch{n=null}d[r]=n}return d[r]}(g);if(!f)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");f.appendChild(t)}},990:y=>{y.exports=function(d){var g=document.createElement("style");return d.setAttributes(g,d.attributes),d.insert(g,d.options),g}},626:(y,d,g)=>{y.exports=function(t){var f=g.nc;f&&t.setAttribute("nonce",f)}},155:y=>{y.exports=function(d){if(typeof document>"u")return{update:function(){},remove:function(){}};var g=d.insertStyleElement(d);return{update:function(t){(function(f,r,n){var e="";n.supports&&(e+="@supports (".concat(n.supports,") {")),n.media&&(e+="@media ".concat(n.media," {"));var s=n.layer!==void 0;s&&(e+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),e+=n.css,s&&(e+="}"),n.media&&(e+="}"),n.supports&&(e+="}");var i=n.sourceMap;i&&typeof btoa<"u"&&(e+=`
|
|
1392
|
-
/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),r.styleTagTransform(e,f,r.options)})(g,d,t)},remove:function(){(function(t){if(t.parentNode===null)return!1;t.parentNode.removeChild(t)})(g)}}}},827:y=>{y.exports=function(d,g){if(g.styleSheet)g.styleSheet.cssText=d;else{for(;g.firstChild;)g.removeChild(g.firstChild);g.appendChild(document.createTextNode(d))}}}},n0={};function on(y){var d=n0[y];if(d!==void 0)return d.exports;var g=n0[y]={id:y,exports:{}};return B_[y](g,g.exports,on),g.exports}on.n=y=>{var d=y&&y.__esModule?()=>y.default:()=>y;return on.d(d,{a:d}),d},on.d=(y,d)=>{for(var g in d)on.o(d,g)&&!on.o(y,g)&&Object.defineProperty(y,g,{enumerable:!0,get:d[g]})},on.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),on.o=(y,d)=>Object.prototype.hasOwnProperty.call(y,d),on.nc=void 0;var Mi={};on.d(Mi,{yy:()=>Tw,_U:()=>LS,a8:()=>t2,Vs:()=>QS,Cn:()=>$f,gK:()=>Qw,vv:()=>bw});var F_=y=>{var d={};return on.d(d,y),d};const be=F_({$addUpdateTag:()=>Rv,$createNodeSelection:()=>vf,$createParagraphNode:()=>Un,$createRangeSelection:()=>bf,$getNodeByKey:()=>Vn,$getRoot:()=>Ln,$getSelection:()=>Oe,$isDecoratorNode:()=>Tn,$isElementNode:()=>ge,$isLineBreakNode:()=>ha,$isNodeSelection:()=>Xr,$isParagraphNode:()=>va,$isRangeSelection:()=>xe,$isTextNode:()=>Ne,$nodesOfType:()=>Xh,$setSelection:()=>or,CAN_REDO_COMMAND:()=>Xa,CAN_UNDO_COMMAND:()=>ts,CLEAR_EDITOR_COMMAND:()=>Od,COMMAND_PRIORITY_CRITICAL:()=>to,COMMAND_PRIORITY_EDITOR:()=>an,CUT_COMMAND:()=>gl,DecoratorNode:()=>Vg,ElementNode:()=>jo,KEY_BACKSPACE_COMMAND:()=>fl,KEY_DELETE_COMMAND:()=>pl,KEY_ESCAPE_COMMAND:()=>kc,LineBreakNode:()=>ss,PASTE_COMMAND:()=>ll,ParagraphNode:()=>ba,REDO_COMMAND:()=>ul,RootNode:()=>us,TextNode:()=>ga,UNDO_COMMAND:()=>cl,createCommand:()=>wd,createEditor:()=>Gg});var z_=y=>{var d={};return on.d(d,y),d};const U_=z_({$isLinkNode:()=>e_});var $_=y=>{var d={};return on.d(d,y),d};const eo=$_({$createMarkNode:()=>uu,$getMarkIDs:()=>o_,$isMarkNode:()=>_a,$unwrapMarkNode:()=>n_,$wrapSelectionInMarkNode:()=>r_,MarkNode:()=>Pf});var H_=y=>{var d={};return on.d(d,y),d};const kn=H_({$createTableCellNode:()=>Xo,$createTableRowNode:()=>gs,$createTableSelection:()=>fu,$getTableColumnIndexFromTableCellNode:()=>Fm,$isTableCellNode:()=>rn,$isTableNode:()=>Pn,$isTableRowNode:()=>sr,$isTableSelection:()=>Bn,TableCellNode:()=>Ao,TableNode:()=>bo,TableRowNode:()=>xa}),q_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),r0={randomUUID:q_};let gu;const J_=new Uint8Array(16);function V_(){if(!gu&&(gu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gu(J_)}const gr=[];for(let y=0;y<256;++y)gr.push((y+256).toString(16).slice(1));function W_(y,d=0){return gr[y[d+0]]+gr[y[d+1]]+gr[y[d+2]]+gr[y[d+3]]+"-"+gr[y[d+4]]+gr[y[d+5]]+"-"+gr[y[d+6]]+gr[y[d+7]]+"-"+gr[y[d+8]]+gr[y[d+9]]+"-"+gr[y[d+10]]+gr[y[d+11]]+gr[y[d+12]]+gr[y[d+13]]+gr[y[d+14]]+gr[y[d+15]]}function K_(y,d,g){if(r0.randomUUID&&!d&&!y)return r0.randomUUID();const t=(y=y||{}).random||(y.rng||V_)();if(t[6]=15&t[6]|64,t[8]=63&t[8]|128,d){g=g||0;for(let f=0;f<16;++f)d[g+f]=t[f];return d}return W_(t)}const G_=K_;let Y_=()=>{},Dl=function(){return Y_};const Z_=Dl(),Q_=Dl(),X_=Dl(),tx=Dl(),ex=Dl(),nx={log:Z_,info:Q_,warn:tx,debug:X_,error:ex},le=nx,rx=[y=>y.hasFormat("bold")&&"bold",y=>y.hasFormat("code")&&"code",y=>y.hasFormat("italic")&&"italic",y=>y.hasFormat("strikethrough")&&"strikethrough",y=>y.hasFormat("subscript")&&"subscript",y=>y.hasFormat("superscript")&&"superscript",y=>y.hasFormat("underline")&&"underline"],o0={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},ox={center:2,end:6,justify:4,left:1,right:3,start:5};function ix(y){if(!y||!y.length)return 0;let d=y.split(",");if(d=d.map(t=>t.trim()),d.length===1&&!o0[d[0]])return y;let g=0;for(const t of d){const f=o0[t];f&&(g^=f)}return g}function ax(y){return y?rx.map(d=>d(y)).filter(Boolean).join(","):""}function sx(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return y&&ox[y]||0}function Ll(y){return`__${y}`}function Ff(y){return y.split("__")[1]||""}class lx{constructor(){this.subscribers={}}on(d,g){d&&g&&(this.subscribers[d]||(this.subscribers[d]=[]),this.subscribers[d].push(g))}emit(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.subscribers[d]&&this.subscribers[d].length)for(const t of this.subscribers[d])typeof t=="function"&&t(g)}clear(){this.subscribers={}}}const i0=lx,no={historic:"historic",historyMerge:"history-merge",historyPush:"history-push"},cx={paste:"application/x-lexical-editor",drag:"application/x-lexical-drag",dragBlock:"application/x-lexical-drag-block",plainText:"text/plain"},Jr={created:"created",updated:"updated",destroyed:"destroyed"},Di={text:"text",element:"element",whitelist:["text","element"]},_r={mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",keypress:"keypress",keyup:"keyup",resize:"resize",scroll:"scroll"},a0=[_r.mousemove,_r.mouseover,_r.mouseout],mu={text:"text",linebreak:"linebreak",horizontalrule:"horizontalrule"},zf={local:"local",remote:"remote"},Sa={editorState:"editorState",root:"root"},Li={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},Bl="codox_comments_change",s0={horizontalrule:["table","image","inline-image","sticky"],"page-break":["image","inline-image","table","sticky"],"collapsible-container":["table","image","inline-image","collapsible-container","sticky"],"layout-container":["table","image","inline-image","layout-container","sticky"],image:["image","inline-image","sticky"],"inline-image":["image","inline-image","sticky"],table:["image","inline-image","table","sticky"],poll:["image","inline-image","sticky"],excalidraw:["image","inline-image","sticky"]},ux="Invalid state - forbidden content nesting found",l0={local:"local",remote:"remote"};function c0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function u0(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?c0(Object(g),!0).forEach(function(t){dx(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):c0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function dx(y,d,g){return(d=fx(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function fx(y){var d=px(y,"string");return typeof d=="symbol"?d:d+""}function px(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}class $e{static equalSelectionsJSON(d,g){return!((d||g)&&(d&&!g||g&&!d||d.anchor.codoxId.toString()!==g.anchor.codoxId.toString()||d.anchor.offset!==g.anchor.offset||d.focus.codoxId.toString()!==g.focus.codoxId.toString()||d.focus.offset!==g.focus.offset))}static getNodeAncestorsList(d){return d.getParents()}static getAllNodeLeaves(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if($w(d))return g.push(d),g;let t=d.getChildren();if(!t.length)return g;for(const f of t)g=$e.getAllNodeLeaves(f,g);return g}static splitCodoxIdPathIntoMainAndNested(d){let g=d.findIndex(f=>f===Sa.editorState),t=g+1;return{mainPath:d.slice(0,g),nestedPath:d.slice(t+1)}}static getCodoxIdAndOffsetFromRootNode(d,g){let t=d.getChildren()[g];return{codoxIdArray:t&&t.codoxId?[t.codoxId]:[],offset:0}}static isNestedSelectionJSON(d){return!!d&&!(!d.anchor.codoxId.includes(Sa.editorState)||!d.focus.codoxId.includes(Sa.editorState))}static lexicalToJSONNested(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],f=$e.lexicalToJSON(d);if(!f)return null;let r=[...t,g,Sa.editorState,Sa.root];return f.anchor.codoxId=[...r,...f.anchor.codoxId],f.focus.codoxId=[...r,...f.focus.codoxId],f}static getNestedSelectionJSONFromMainSelectionJSON(d){let g={nestedSelectionJSON:null,nestedEditor:null},{mainPath:t,nestedPath:f}=$e.splitCodoxIdPathIntoMainAndNested(d.anchor.codoxId),{mainPath:r,nestedPath:n}=$e.splitCodoxIdPathIntoMainAndNested(d.focus.codoxId);t.toString()===r.toString()||le.debug("[getNestedSelectionJSONFromMainSelectionJSON]: Nested selection main path part must point to same node in main editor: ",{anchorCodoxIds:d.anchor.codoxId,mainAnchorPath:t,nestedAnchorPath:f,focusCodoxIds:d.focus.codoxId,mainFocusPath:r,nestedFocusPath:n});let e=t,s=e[e.length-1],i=e[e.length-2],l=jn.get(i);if(!l){let c=e[e.length-3];if(c){let u=jn.get(c);u&&(l=u.getChildren().find(h=>h.codoxDId===i))}}if(!l)return le.debug("[getNestedSelectionJSONFromMainSelectionJSON]: Lexical node with nested editor not found in codox nodes map - selection will be dropped",{jsonSelection:d,targetNodeCodoxId:i}),g;let o=Ll(s),a=l[o];return we.isLexicalEditorInstance(a)?(g.nestedSelectionJSON=u0(u0({},d),{},{anchor:{codoxId:f,offset:d.anchor.offset},focus:{codoxId:n,offset:d.focus.offset}}),g.nestedEditor=a,g):(le.debug("[getNestedSelectionJSONFromMainSelectionJSON]: Found nested editor is not LexicalEditor instance",{jsonSelection:d,targetLexicalNode:l,targetLexicalNodeAttrName:o,nestedEditorCandidate:a}),g)}static getNodeAncestorsCodoxIds(d){let g=[],t=$e.getNodeAncestorsList(d);if(t.length===1&&t[0].__type==="root")return g.push(d.codoxId),g;for(let f=t.length-2;f>=0;f--){let r=t[f];r.codoxId&&g.push(r.codoxId)}return d.codoxId&&d.getChildren&&g.push(d.codoxId),g}static getParentOffsetOutOfNodeOffset(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(arguments.length>2&&arguments[2]!==void 0&&arguments[2]){if(d.getChildrenSize&&d.getChildrenSize()===0||g===0&&d.codoxId)return g;let n=g,e=[];if(d.codoxId)e=d.getChildren();else{const i=d.getParents().find(o=>!!o.codoxId);let l=!1;for(const o of i.getChildren()){if(o.__key===d.__key&&(l=!!g&&(Ul(o)||zl(o)),!l))break;if(Ui(o))e.push(o),n+=o.getTextContentSize();else if(En(o))e.push(o),n++;else{let a=$e.getAllNodeLeaves(o),c=a.reduce((u,h)=>(Ui(h)?u+=h.getTextContentSize():En(h)&&u++,u),0);e.push(...a),n+=c}if(l)break}}let s=0;for(const i of e){if(n<=0)break;let l=0;l=En(i)?1:i.getTextContentSize(),s+=l,En(i)?n--:n-=l}return s}let t=d.getParents().find(n=>!!n.codoxId);if(!t)return g;let f=[];for(const n of t.getChildren())if(Ui(n)||En(n))f.push(n);else{let e=$e.getAllNodeLeaves(n);f.push(...e)}if(f.length===1&&f[0].__key===d.__key)return g;let r=0;for(const n of f){if(n.__key===d.__key){r+=g;break}let e=0;e=En(n)?1:n.getTextContentSize(),r+=e}return r}static lexicalToJSON(d){if(!d)return null;let g=[],t=0,f=[],r=0,n="",e=0,s=!0;if((0,be.$isRangeSelection)(d)){let i=(0,be.$getNodeByKey)(d.anchor.key);if(ka(i)){let{codoxIdArray:o,offset:a}=$e.getCodoxIdAndOffsetFromRootNode(i,d.anchor.offset);g=o,t=a}else{if((0,kn.$isTableCellNode)(i)){let c=i.getFirstChild();c&&Ss(c)&&(i=c)}g=$e.getNodeAncestorsCodoxIds(i);const o=d.anchor.offset,a=d.anchor.type===Di.element;t=$e.getParentOffsetOutOfNodeOffset(i,o,a,"anchor")}let l=(0,be.$getNodeByKey)(d.focus.key);if(ka(l)){let{codoxIdArray:o,offset:a}=$e.getCodoxIdAndOffsetFromRootNode(l,d.focus.offset);f=o,r=a}else{if((0,kn.$isTableCellNode)(l)){let c=l.getFirstChild();c&&Ss(c)&&(l=c)}f=$e.getNodeAncestorsCodoxIds(l);const o=d.focus.offset,a=d.focus.type===Di.element;r=$e.getParentOffsetOutOfNodeOffset(l,o,a,"focus")}n=d.style,e=d.format,s=d.dirty}else if((0,be.$isNodeSelection)(d)){let i=d.getNodes();if(!i.length)return null;let l=i[0],o=i[i.length-1],a=(0,be.$createRangeSelection)();a.anchor.set(l.getKey(),0,Di.element),a.focus.set(o.getKey(),0,Di.element);let c=a.isBackward();g=$e.getNodeAncestorsCodoxIds(l),f=$e.getNodeAncestorsCodoxIds(o);let u=c?1:0,h=c?0:1;t=$e.getParentOffsetOutOfNodeOffset(l,u),r=$e.getParentOffsetOutOfNodeOffset(o,h)}else if((0,kn.$isTableSelection)(d)){t=r=null;let i=(0,be.$getNodeByKey)(d.anchor.key),l=(0,be.$getNodeByKey)(d.focus.key);g=$e.getNodeAncestorsCodoxIds(i),f=$e.getNodeAncestorsCodoxIds(l)}return{anchor:{codoxId:g,offset:t},focus:{codoxId:f,offset:r},style:n,format:e,dirty:s}}static createTableSelection(d,g){if(!Cs(d)||!Cs(g))return le.warn("[createTableSelection] invalid anchor/focus nodes - must be one of table nodes: ",{anchorNode:d,focusNode:g}),null;let t=(0,kn.$isTableNode)(d)?d:d.getParents().find(r=>(0,kn.$isTableNode)(r)),f=(0,kn.$createTableSelection)();return f.set(t.getKey(),d.getKey(),g.getKey()),f}static createNodeSelection(d,g){if(g||(g=d),!En(d)||!En(g))return le.warn("[createNodeSelection] invalid anchor/focus - must be decorators: ",{anchorNode:d,focusNode:g}),null;let t=(0,be.$createNodeSelection)(),f=d.getNodesBetween(g),r=f.filter(n=>En(n));return f.length!==r.length?(le.warn("[createNodeSelection] nodes list contains unexpected nodes: ",{allNodes:f,decoratorNodes:r}),null):(r.forEach(n=>{t.add(n.__key)}),t)}static findClosestParentElementNode(d){if(!d)return null;let g=d.getParent();return g?Ss(g)?g:$e.findClosestParentElementNode(g):null}static createRangeSelection(d,g,t,f,r,n){if(!(arguments.length>6&&arguments[6]!==void 0&&arguments[6])){if(!($n(d)||Ss(d)||(le.warn("[createRangeSelection] anchor node is not text or element node - finding closest parent element node "),d=$e.findClosestParentElementNode(d))))return le.warn("[createRangeSelection] unable to find anchor closest parent element node - dropping to null"),null;if(!($n(g)||Ss(g)||(le.warn("[createRangeSelection] focus node is not text or element node - finding closest parent element node "),g=$e.findClosestParentElementNode(g))))return le.warn("[createRangeSelection] unable to find focus closest parent element node - dropping to null"),null}let e=(0,be.$createRangeSelection)();e.format=r,e.setStyle(n);let s=$n(d)?Di.text:Di.element,i=$n(g)?Di.text:Di.element;return e.anchor.set(d.getKey(),t,s),e.focus.set(g.getKey(),f,i),e.dirty=!1,e}static getSelectedCandidateFromParentChildren(d,g){let t=arguments.length>2&&arguments[2]!==void 0&&arguments[2],f=null,r=g;if(g===0){const n=d.getFirstChild();f=$n(n)?n:d}else{let n=d.getChildren(),e=[];for(let i of n)if(Ui(i)||En(i))e.push(i);else{let l=$e.getAllNodeLeaves(i);e.push(...l)}let s=g;for(let i of e)if(Ui(i)||En(i)){let l=En(i)?1:i.getTextContentSize();if(s<=l){if(Yf(i)){let o=i.getNextSibling();o&&$n(o)?(f=o,r=0):(f=d,r=i.getPreviousSiblings().length+1);break}En(i)&&(t||(s=0)),f=i,r=s;break}s-=l}if(!f){const i=d.getLastChild();$n(i)?(f=i,r=i.getTextContentSize()):(f=d,r=d.getChildrenSize())}}return{candidate:f,candidateOffset:r}}static getSelectedParentAndOffset(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=d.getParent(),f=d.getPreviousSiblings().length+1;return(Cs(t)||!En(d)&&ka(t))&&(t=d,f=g),{parent:t,parentOffset:f}}static JSONToLexical(d){if(le.debug("[JSONToLexical]: ",{selectionJson:d}),!d)return null;let{anchor:{codoxId:g,offset:t},focus:{codoxId:f,offset:r},format:n,style:e}=d,s=!g.length,i=null;if(s)i=(0,be.$getRoot)();else{let M=g[g.length-1];i=M?jn.get(M):null}let l=!f.length,o=null;if(l)o=(0,be.$getRoot)();else{let M=f[f.length-1];o=M?jn.get(M):null}if(!i||!o)return le.debug(" [JSONToLexical] anchorNode or focusNode not found in lexical nodes - selection will be dropped to null: ",{anchorParentNode:i,focusParentNode:o,anchorOffset:t,focusOffset:r,selectionJson:d}),null;if(i&&!i.isAttached()||o&&!o.isAttached())return le.debug("[JSONToLexical] anchorNode or focusNode is no longer attached to editor - marked for GC: ",{anchorParentNode:i,focusParentNode:o,isAnchorNodeAttached:i.isAttached(),isFocusParentNodeAttached:o.isAttached()}),null;if(Cs(i)&&Cs(o)&&t===null&&r===null)return $e.createTableSelection(i,o);if(En(i)&&En(o)&&t!==r)return $e.createNodeSelection(i,o);if(En(i)&&En(o)&&t===r&&M0(i)&&M0(o)){let M=(0,be.$getRoot)(),J=M.getChildren(),K=J.findIndex(U=>U.getKey()===i.getKey()),N=J.findIndex(U=>U.getKey()===o.getKey());return $e.createRangeSelection(M,M,K,N,n,e)}let a,c,u,h,p=!!i.getChildrenSize,m=!!o.getChildrenSize,b=p&&i.getChildrenSize()===0,_=m&&o.getChildrenSize()===0;if(b&&_)return $e.createRangeSelection(i,o,t,r,n,e);let v=p&&i.getChildrenSize()>0,w=m&&o.getChildrenSize()>0;if(v){let{candidate:M,candidateOffset:J}=$e.getSelectedCandidateFromParentChildren(i,t);a=M,u=J}else{let{parent:M,parentOffset:J}=$e.getSelectedParentAndOffset(i,t);a=M,u=J}if(w){let{candidate:M,candidateOffset:J}=$e.getSelectedCandidateFromParentChildren(o,r,!0);c=M,h=J}else{let{parent:M,parentOffset:J}=$e.getSelectedParentAndOffset(o,r);c=M,h=J}if(!a||!c)return null;let x=$n(a),S=$n(c),E=En(a),k=En(c),D=i.getKey()===o.getKey(),P=D&&r-t==1,O=D&&r===t&&a.getKey()===c.getKey(),R=t!==r,A=a.getKey()===c.getKey();if(E&&k&&O){let M=a.getNextSibling();if(M&&$n(M))return $e.createRangeSelection(M,M,0,0,n,e);if(M&&(0,be.$isParagraphNode)(M))return $e.createNodeSelection(a,c);let{parent:J,parentOffset:K}=$e.getSelectedParentAndOffset(a);return $e.createRangeSelection(J,J,K,K,n,e)}let z=$e.createRangeSelection(a,c,u,h,n,e,!0),H=z.isBackward(),$=z.getNodes();if(E&&k&&!A){if(P)return $e.createNodeSelection(c);if($.every(M=>En(M)))return $e.createNodeSelection(a,c);{let M,J,K,N,U=a.getNextSibling();if(U&&$n(U))M=U,K=0;else{let{parent:G,parentOffset:F}=$e.getSelectedParentAndOffset(a);M=G,K=F}let W=c.getNextSibling();if(W&&$n(W))J=W,N=0;else{let{parent:G,parentOffset:F}=$e.getSelectedParentAndOffset(c);J=G,N=F}return $e.createRangeSelection(M,J,K,N,n,e)}}if(x&&S&&R)if(H){let M=h===c.getTextContentSize(),J=c.getNextSibling();if(M&&J&&$n(J))return $e.createRangeSelection(a,J,u,0,n,e)}else{let M=u===a.getTextContentSize(),J=a.getNextSibling();if(M&&J&&$n(J))return $e.createRangeSelection(J,c,0,h,n,e)}if(R&&!E&&k){if(P)return $e.createNodeSelection(c);let[M,...J]=$,K=J.every(U=>En(U));if($n(M)&&u===M.getTextContentSize()&&K)return $e.createNodeSelection(J[0],c);let N=c.getNextSibling();if($n(a)&&a.getTextContentSize()===u&&!H){let U=a.getNextSibling();U&&$n(U)&&(a=U,u=0)}if(N&&$n(N))return $e.createRangeSelection(a,N,u,0,n,e);{let{parent:U,parentOffset:W}=$e.getSelectedParentAndOffset(c);return $e.createRangeSelection(a,U,u,W,n,e)}}if(R&&E&&!k){let[M,...J]=$,K=J.every(U=>En(U));if($n(M)&&h===M.getTextContentSize()&&K)return $e.createNodeSelection(a,J[0]);let N=a.getNextSibling();if(N&&$n(N))return $e.createRangeSelection(N,c,0,h,n,e);{let{parent:U,parentOffset:W}=$e.getSelectedParentAndOffset(a);return $e.createRangeSelection(U,c,W,h,n,e)}}return $e.createRangeSelection(a,c,u,h,n,e)}}var hx=y=>{var d={};return on.d(d,y),d};const Gt=hx({Fragment:()=>Qn.Fragment,createContext:()=>Qn.createContext,createElement:()=>Qn.createElement,forwardRef:()=>Qn.forwardRef,useCallback:()=>Qn.useCallback,useContext:()=>Qn.useContext,useEffect:()=>Qn.useEffect,useImperativeHandle:()=>Qn.useImperativeHandle,useLayoutEffect:()=>Qn.useLayoutEffect,useMemo:()=>Qn.useMemo,useRef:()=>Qn.useRef,useState:()=>Qn.useState});function d0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function f0(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?d0(Object(g),!0).forEach(function(t){gx(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):d0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function gx(y,d,g){return(d=mx(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function mx(y){var d=yx(y,"string");return typeof d=="symbol"?d:d+""}function yx(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}const Uf="comments_change";class bx extends i0{constructor(){super(),this.initialCommentThreads=[],this.commentThreads=[],this.dataTypes={comment:"comment",thread:"thread"},this.ID_PREFIX="codox",this.relatedNodeKeys={},this.activeThreadIds={},this._uiRefreshTriggered=!1}_triggerUIRefresh(){this._uiRefreshTriggered||(this._uiRefreshTriggered=!0,Promise.resolve().then(()=>{le.debug("[_triggerUIRefresh] emitted"),this.emit(Uf),this._uiRefreshTriggered=!1}))}_copyThreads(d){return[...d]}_getActiveCommentThreads(){return this.commentThreads.filter(d=>!!this.activeThreadIds[d.codoxId])}_setCommentThreads(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];this.commentThreads=[...d],[...d],this._triggerUIRefresh()}clear(){this.resetComments(),super.clear()}gcInternalStates(){this.relatedNodeKeys={},this.activeThreadIds={}}resetComments(){this.gcInternalStates(),this._setCommentThreads([])}getAllComments(){return this.commentThreads}setAllComments(d){Array.isArray(d)?this._setCommentThreads(d):le.warn("[setAllComments]: incomming comments are not array: ",{newCommentThreads:d})}addRelatedNodeKey(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!Array.isArray(g)||!g.length)return;let f=g.filter(r=>typeof r=="string"&&r.startsWith(this.ID_PREFIX));if(f.length){if(t)for(let r of f)this.activeThreadIds[r]?this.activeThreadIds[r].add(d):this.activeThreadIds[r]=new Set([d]);else if(this.relatedNodeKeys[d]){let r=[...this.relatedNodeKeys[d]],n=f,e=n.length>r.length,s=r.length>n.length;e?n.filter(i=>!r.includes(i)).forEach(i=>{this.activeThreadIds[i].add(d)}):s&&r.filter(i=>!n.includes(i)).forEach(i=>{this.activeThreadIds[i].size>1?this.activeThreadIds[i].delete(d):delete this.activeThreadIds[i]})}this.relatedNodeKeys[d]=f,this._triggerUIRefresh()}}removeRelatedNodeKey(d){if(this.relatedNodeKeys[d]){let g=this.relatedNodeKeys[d];le.debug("[CodoxComments][removeRelatedNodeKey]: ",{nodeKey:d,threadIds:g,activeThreads:this.activeThreadIds}),g.forEach(t=>{this.activeThreadIds[t]&&(this.activeThreadIds[t].size>1?this.activeThreadIds[t].delete(d):delete this.activeThreadIds[t])}),delete this.relatedNodeKeys[d],this._triggerUIRefresh()}}createCommentId(){return`${this.ID_PREFIX}-${Gf()}`}createNewCommentObj(d){let{content:g,author:t,codoxId:f,timeStamp:r}=d;return{author:t,content:g,codoxId:f||this.createCommentId(),timeStamp:r,type:this.dataTypes.comment}}createNewThreadObj(d){let{quote:g,comments:t,codoxId:f}=d;return{comments:t,codoxId:f||this.createCommentId(),quote:g,type:this.dataTypes.thread}}addCommentThread(d){let g=[...this.commentThreads,d];this._setCommentThreads(g)}addComment(d,g){let t=this.commentThreads.map(f=>{if(f.codoxId===d){let r=f0({},f);return r.comments=[...r.comments,g],r}return f});this._setCommentThreads(t)}removeCommentThread(d){}removeComment(d,g){le.debug("[CodoxComments][removeCommentFromPlugin]: ",{commentId:g,threadId:d});let t=this.commentThreads.map(f=>{if(f.codoxId===d){let r=f0({},f);return r.comments=r.comments.filter(n=>n.codoxId!==g),r}return f});this._setCommentThreads(t)}gcAbandonedNodeKeys(d){let g=Object.keys(this.relatedNodeKeys);for(let t of g)d.has(t)||this.removeRelatedNodeKey(t)}refreshComments(){this._triggerUIRefresh()}setInitialComments(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Array.isArray(d)&&(le.debug("[CodoxComments][setInitialComments]: ",[...d]),this.initialCommentThreads=[...d])}activateInitialComments(d){this.setAllComments(this.initialCommentThreads),console.log("COMMENTS: ",{initComments:[...this.initialCommentThreads]}),d.getEditorState().read(()=>{let g=(0,be.$nodesOfType)(eo.MarkNode);for(let t of g)console.log("COMMENTS: ",{node:t}),this.addRelatedNodeKey(t.__key,t.__ids,!0)}),console.log("IVAN: ",{self:this}),this.initialCommentThreads=[]}initialCommentsExist(){return!!this.initialCommentThreads.length}}const Cn=new bx;function vx(){let y=Cn._getActiveCommentThreads.bind(Cn);const[d,g]=(0,Gt.useState)(y());return(0,Gt.useEffect)(()=>{Cn.on(Uf,()=>{let t=y();le.log(`[useCodoxComments] "${Uf}" event: `,t),g(t)})},[]),d}const $f=(0,be.createCommand)("INSERT_COMMENT");var _x=y=>{var d={};return on.d(d,y),d};const bs=_x({mergeRegister:()=>mo,registerNestedElementResolver:()=>C1});var xx=on(967),ti=on.n(xx),wx=Object.getOwnPropertyNames,Sx=Object.getOwnPropertySymbols,Cx=Object.prototype.hasOwnProperty;function p0(y,d){return function(g,t,f){return y(g,t,f)&&d(g,t,f)}}function yu(y){return function(d,g,t){if(!d||!g||typeof d!="object"||typeof g!="object")return y(d,g,t);var f=t.cache,r=f.get(d),n=f.get(g);if(r&&n)return r===g&&n===d;f.set(d,g),f.set(g,d);var e=y(d,g,t);return f.delete(d),f.delete(g),e}}function h0(y){return wx(y).concat(Sx(y))}var g0=Object.hasOwn||function(y,d){return Cx.call(y,d)};function vs(y,d){return y||d?y===d:y===d||y!=y&&d!=d}var m0="_owner",y0=Object.getOwnPropertyDescriptor,b0=Object.keys;function Ex(y,d,g){var t=y.length;if(d.length!==t)return!1;for(;t-- >0;)if(!g.equals(y[t],d[t],t,t,y,d,g))return!1;return!0}function kx(y,d){return vs(y.getTime(),d.getTime())}function v0(y,d,g){if(y.size!==d.size)return!1;for(var t,f,r={},n=y.entries(),e=0;(t=n.next())&&!t.done;){for(var s=d.entries(),i=!1,l=0;(f=s.next())&&!f.done;){var o=t.value,a=o[0],c=o[1],u=f.value,h=u[0],p=u[1];i||r[l]||!(i=g.equals(a,h,e,l,y,d,g)&&g.equals(c,p,a,h,y,d,g))||(r[l]=!0),l++}if(!i)return!1;e++}return!0}function Ox(y,d,g){var t,f=b0(y),r=f.length;if(b0(d).length!==r)return!1;for(;r-- >0;)if((t=f[r])===m0&&(y.$$typeof||d.$$typeof)&&y.$$typeof!==d.$$typeof||!g0(d,t)||!g.equals(y[t],d[t],t,t,y,d,g))return!1;return!0}function Fl(y,d,g){var t,f,r,n=h0(y),e=n.length;if(h0(d).length!==e)return!1;for(;e-- >0;)if((t=n[e])===m0&&(y.$$typeof||d.$$typeof)&&y.$$typeof!==d.$$typeof||!g0(d,t)||!g.equals(y[t],d[t],t,t,y,d,g)||(f=y0(y,t),r=y0(d,t),(f||r)&&(!f||!r||f.configurable!==r.configurable||f.enumerable!==r.enumerable||f.writable!==r.writable)))return!1;return!0}function Tx(y,d){return vs(y.valueOf(),d.valueOf())}function jx(y,d){return y.source===d.source&&y.flags===d.flags}function _0(y,d,g){if(y.size!==d.size)return!1;for(var t,f,r={},n=y.values();(t=n.next())&&!t.done;){for(var e=d.values(),s=!1,i=0;(f=e.next())&&!f.done;)s||r[i]||!(s=g.equals(t.value,f.value,t.value,f.value,y,d,g))||(r[i]=!0),i++;if(!s)return!1}return!0}function Ax(y,d){var g=y.length;if(d.length!==g)return!1;for(;g-- >0;)if(y[g]!==d[g])return!1;return!0}var Px="[object Arguments]",Nx="[object Boolean]",Ix="[object Date]",Rx="[object Map]",Mx="[object Number]",Dx="[object Object]",Lx="[object RegExp]",Bx="[object Set]",Fx="[object String]",zx=Array.isArray,x0=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,w0=Object.assign,Ux=Object.prototype.toString.call.bind(Object.prototype.toString);function $x(y){var d=y.areArraysEqual,g=y.areDatesEqual,t=y.areMapsEqual,f=y.areObjectsEqual,r=y.arePrimitiveWrappersEqual,n=y.areRegExpsEqual,e=y.areSetsEqual,s=y.areTypedArraysEqual;return function(i,l,o){if(i===l)return!0;if(i==null||l==null||typeof i!="object"||typeof l!="object")return i!=i&&l!=l;var a=i.constructor;if(a!==l.constructor)return!1;if(a===Object)return f(i,l,o);if(zx(i))return d(i,l,o);if(x0!=null&&x0(i))return s(i,l,o);if(a===Date)return g(i,l,o);if(a===RegExp)return n(i,l,o);if(a===Map)return t(i,l,o);if(a===Set)return e(i,l,o);var c=Ux(i);return c===Ix?g(i,l,o):c===Lx?n(i,l,o):c===Rx?t(i,l,o):c===Bx?e(i,l,o):c===Dx?typeof i.then!="function"&&typeof l.then!="function"&&f(i,l,o):c===Px?f(i,l,o):(c===Nx||c===Mx||c===Fx)&&r(i,l,o)}}function Hx(y){var d=y.circular,g=y.createCustomConfig,t=y.strict,f={areArraysEqual:t?Fl:Ex,areDatesEqual:kx,areMapsEqual:t?p0(v0,Fl):v0,areObjectsEqual:t?Fl:Ox,arePrimitiveWrappersEqual:Tx,areRegExpsEqual:jx,areSetsEqual:t?p0(_0,Fl):_0,areTypedArraysEqual:t?Fl:Ax};if(g&&(f=w0({},f,g(f))),d){var r=yu(f.areArraysEqual),n=yu(f.areMapsEqual),e=yu(f.areObjectsEqual),s=yu(f.areSetsEqual);f=w0({},f,{areArraysEqual:r,areMapsEqual:n,areObjectsEqual:e,areSetsEqual:s})}return f}function qx(y){return function(d,g,t,f,r,n,e){return y(d,g,e)}}function Jx(y){var d=y.circular,g=y.comparator,t=y.createState,f=y.equals,r=y.strict;if(t)return function(e,s){var i=t(),l=i.cache,o=l===void 0?d?new WeakMap:void 0:l,a=i.meta;return g(e,s,{cache:o,equals:f,meta:a,strict:r})};if(d)return function(e,s){return g(e,s,{cache:new WeakMap,equals:f,meta:void 0,strict:r})};var n={cache:void 0,equals:f,meta:void 0,strict:r};return function(e,s){return g(e,s,n)}}var Hf=Bi();Bi({strict:!0}),Bi({circular:!0}),Bi({circular:!0,strict:!0}),Bi({createInternalComparator:function(){return vs}}),Bi({strict:!0,createInternalComparator:function(){return vs}}),Bi({circular:!0,createInternalComparator:function(){return vs}}),Bi({circular:!0,createInternalComparator:function(){return vs},strict:!0});function Bi(y){y===void 0&&(y={});var d=y.circular,g=d!==void 0&&d,t=y.createInternalComparator,f=y.createState,r=y.strict,n=r!==void 0&&r,e=$x(Hx(y));return Jx({circular:g,comparator:e,createState:f,equals:t?t(e):qx(e),strict:n})}var Vx=on(256),Wx=on.n(Vx),Kx=y=>{var d={};return on.d(d,y),d};const Ca=Kx({$getSelectionStyleValueForProperty:()=>am,$patchStyleText:()=>im,createDOMRange:()=>h1,createRectsFromDOMRange:()=>g1});class bu{static composeLexicalDOMNodeKeyAttrName(d){return`__lexicalKey_${d._key}`}static extractLexicalKeyFromLexicalDOMNodeKeyAttr(d){return d.split("__lexicalKey_")[1]||""}static extractSelectionUserId(d){return d.meta.author.id}static createRemoteSelectionColors(d){const g={caretColor:d,highlightColor:"",tooltipBGColor:""};if(d.startsWith("rgb")){let t=d,[f]=t.split(")");g.highlightColor=`${f},0.3)`,g.tooltipBGColor=`${f},0.85)`}else if(d.startsWith("#"))g.highlightColor=`${d}${Math.floor(76.5).toString(16).padStart(2,0)}`,g.tooltipBGColor=`${d}${Math.floor(216.75).toString(16).padStart(2,0)}`;else{const[t,f,r]=Wx().keyword.rgb(d);g.highlightColor=`rgb(${t},${f}, ${r},0.3)`,g.tooltipBGColor=`rgb(${t},${f}, ${r},0.85)`}return g}static formatRemoteSelectionUsername(d){let g=d;return g=g.trim(),g.length>=17?`${g.substring(0,14)}...`:g}static isMousePositionWithinElementCords(d,g){return d.clientX>=g.x-5&&d.clientX<=g.x+g.width+5&&d.clientY>=g.y-5&&d.clientY<=g.y+g.height+5}static createDOMRange(d,g,t,f,r){return(0,Ca.createDOMRange)(d,g,t,f,r)}static createRectsFromDOMRange(d,g){let{keepFullWidthRects:t=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const f=d.getRootElement();if(f===null)return[];const r=f.getBoundingClientRect(),n=getComputedStyle(f),e=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),s=Array.from(g.getClientRects());let i=a=>s.splice(a,1),l=new Set;for(let a=0;a<s.length;a++){let c=s[a],u=s[a-1];if(!c||!u)continue;let h=`${(o=c).top}_${o.left}_${o.width}_${o.height}`;if(l.has(h))i(a--);else if(l.add(h),c.top===u.top&&c.height===u.height&&c.left-(u.left+u.width)<5){let p=DOMRect.fromRect({x:u.x,y:u.y,width:u.width+c.width,height:u.height});s[a-1]=p,i(a--)}else c.width+e!==r.width||t?u.top<=c.top&&u.bottom>=c.bottom&&u.left<=c.left&&u.right>=c.right&&i(a--):i(a--)}var o;return s}static getEmptyRootRect(d){let g=d.getRootElement(),t=g.getBoundingClientRect();const f=getComputedStyle(g),r=parseFloat(f.paddingLeft),n=parseFloat(f.paddingTop),e=parseFloat(f.paddingBottom);return[new DOMRect(t.x+r,t.y+n,0,t.height-e-n)]}}wc(bu,"remoteSelectionClassName","codox_remote_selection"),wc(bu,"remoteSelectionRect","codox_remote_selection_rect"),wc(bu,"tooltipAnimations",{hideAtOnce:"codox_hide_tooltip 0s linear 0s forwards",hideWithDelay:"codox_hide_tooltip 0s linear 2s forwards",showAtOnce:"codox_show_tooltip 0s linear 0s forwards",unset:"unset"});const Xn=bu;function S0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function Gx(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?S0(Object(g),!0).forEach(function(t){Yx(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):S0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function Yx(y,d,g){return(d=Zx(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function Zx(y){var d=Qx(y,"string");return typeof d=="symbol"?d:d+""}function Qx(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}class Lr{static _logInvalid(d,g,t){for(var f=arguments.length,r=new Array(f>3?f-3:0),n=3;n<f;n++)r[n-3]=arguments[n];le.warn("[JSON SELECTION VALIDATION]: ",Gx({selectBelongsTo:d||"not provided",reason:g,jsonSelection:t},r))}static _isObject(d){return typeof d=="object"&&!Array.isArray(d)}static _validateSelectionSide(d){let{type:g,side:t,sideName:f,fullSelection:r}=d;if(!Lr._isObject(t))return Lr._logInvalid(g,`selection.${f} must be object`,r),!1;let n=t.codoxId;if(!Array.isArray(n))return Lr._logInvalid(g,`selection.${f}.codoxId must be array`,r),!1;if(n.length){let s=n.findIndex(l=>l===Sa.editorState),i=s!==-1;for(let l=0;l<n.length;l++){if(i){if(l===s||l===s+2)continue;if(l===s+1&&n[l]!=="root")return Lr._logInvalid(g,`selection.${f}.codoxId path invalid: nested selection must include "editorState" and "root": [..."editorState", "root"...]`,r,jn),!1;continue}let o=n[l];if(!jn.has(o))return Lr._logInvalid(g,`selection.${f}.codoxId path invalid: node for id ${o} does not exist`,r,jn),!1}}let e=t.offset;return typeof e=="number"||e===null?e>=0||e===null||(Lr._logInvalid(g,`selection.${f}.offset must be gte 0 or -1`,r),!1):(Lr._logInvalid(g,`selection.${f}.offset must be number or null`,r),!1)}static validateJSONSelection(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(d===null)return!0;if(!d)return Lr._logInvalid(g,"invalid json selection data type",d),!1;if(!Lr._isObject(d))return Lr._logInvalid(g,"json selection must be object",d),!1;let{anchor:t,focus:f}=d;return!!Lr._validateSelectionSide({type:g,side:t,sideName:"anchor",fullSelection:d})&&!!Lr._validateSelectionSide({type:g,side:f,sideName:"focus",fullSelection:d})}}const qf=Lr;var Xx=on(186),ei=on.n(Xx),tw=on(155),ni=on.n(tw),ew=on(433),ri=on.n(ew),nw=on(626),oi=on.n(nw),rw=on(990),ii=on.n(rw),ow=on(827),ai=on.n(ow),vu=on(500),_s={};_s.styleTagTransform=ai(),_s.setAttributes=oi(),_s.insert=ri().bind(null,"head"),_s.domAPI=ni(),_s.insertStyleElement=ii(),ei()(vu.A,_s),vu.A&&vu.A.locals&&vu.A.locals;class iw{constructor(){wc(this,"paintSingleRemoteSelection",d=>{let{editor:g,selectionJSON:t,lexicalSelection:f,selectedNodes:r,isBackward:n}=d;this.activeEditorsKeys[g._key]||(this.activeEditorsKeys[g._key]=g._key);const e=Xn.extractSelectionUserId(t),s=Xn.formatRemoteSelectionUsername(t.meta.author.name),i=Xn.createRemoteSelectionColors(t.meta.color);let l=null,o=null,a=0,c=0;(0,be.$isNodeSelection)(f)?(l=r[0],o=r[r.length-1],a=0,c=1):(l=g._editorState._nodeMap.get(f.anchor.key),o=g._editorState._nodeMap.get(f.focus.key),a=f.anchor.offset,c=f.focus.offset);let u=(0,kn.$isTableSelection)(f),h=(0,be.$isNodeSelection)(f),p=(0,be.$isRangeSelection)(f);for(let w of r)this.trackedNodesKeys.add(`${w.getKey()}__${g._key}`);r.length===1&&Yf(r[0])&&a===c&&c++;let m=null,b=[];if(u&&(0,kn.$isTableCellNode)(l)&&(0,kn.$isTableCellNode)(o)){let w=r.filter(x=>(0,kn.$isTableCellNode)(x));for(let x of w)if(a=(0,kn.$getTableColumnIndexFromTableCellNode)(x),c=(0,kn.$getTableColumnIndexFromTableCellNode)(x)+1,l=x.getParent(),o=x.getParent(),m=Xn.createDOMRange(g,l,a,o,c),m){let[S]=Xn.createRectsFromDOMRange(g,m);b.push(S)}}else if(h){let w=f.getNodes();for(let x of w)if(m=Xn.createDOMRange(g,x,0,x,1),m){let[S]=Xn.createRectsFromDOMRange(g,m);b.push(S)}}else p&&(ka(l)&&ka(o)&&a===0&&c===0?b=Xn.getEmptyRootRect(g):(m=Xn.createDOMRange(g,l,a,o,c),m&&(b=Xn.createRectsFromDOMRange(g,m,{keepFullWidthRects:!0}))));let _=null,v=document.createElement("span");v.classList.add(Xn.remoteSelectionClassName),v.setAttribute("codox_remote_user",e),document.body.append(v),this.remoteSelectionDOMsMap[e]=v;for(let w=0;w<b.length;w++){let x=b[w];if(!x)continue;let S=w===0,E=w===b.length-1,k=x.width,D=x.height,P=x.top,O=x.left,R=n&&S||!n&&E,A=document.createElement("span");if(v.append(A),A.classList.add(Xn.remoteSelectionRect),A.style.cssText=`
|
|
1392
|
+
/*# sourceMappingURL=data:application/json;base64,`.concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),r.styleTagTransform(e,f,r.options)})(g,d,t)},remove:function(){(function(t){if(t.parentNode===null)return!1;t.parentNode.removeChild(t)})(g)}}}},827:y=>{y.exports=function(d,g){if(g.styleSheet)g.styleSheet.cssText=d;else{for(;g.firstChild;)g.removeChild(g.firstChild);g.appendChild(document.createTextNode(d))}}}},e0={};function on(y){var d=e0[y];if(d!==void 0)return d.exports;var g=e0[y]={id:y,exports:{}};return D_[y](g,g.exports,on),g.exports}on.n=y=>{var d=y&&y.__esModule?()=>y.default:()=>y;return on.d(d,{a:d}),d},on.d=(y,d)=>{for(var g in d)on.o(d,g)&&!on.o(y,g)&&Object.defineProperty(y,g,{enumerable:!0,get:d[g]})},on.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),on.o=(y,d)=>Object.prototype.hasOwnProperty.call(y,d),on.nc=void 0;var Mi={};on.d(Mi,{yy:()=>kw,_U:()=>MS,a8:()=>QS,Vs:()=>YS,Cn:()=>$f,gK:()=>Yw,vv:()=>mw});var L_=y=>{var d={};return on.d(d,y),d};const be=L_({$addUpdateTag:()=>Nv,$createNodeSelection:()=>vf,$createParagraphNode:()=>Un,$createRangeSelection:()=>bf,$getNodeByKey:()=>Vn,$getRoot:()=>Ln,$getSelection:()=>Oe,$isDecoratorNode:()=>Tn,$isElementNode:()=>ge,$isLineBreakNode:()=>ha,$isNodeSelection:()=>Xr,$isParagraphNode:()=>va,$isRangeSelection:()=>xe,$isTextNode:()=>Ne,$nodesOfType:()=>Qh,$setSelection:()=>or,CAN_REDO_COMMAND:()=>Xa,CAN_UNDO_COMMAND:()=>ts,CLEAR_EDITOR_COMMAND:()=>Od,COMMAND_PRIORITY_CRITICAL:()=>to,COMMAND_PRIORITY_EDITOR:()=>an,CUT_COMMAND:()=>gl,DecoratorNode:()=>Jg,ElementNode:()=>jo,KEY_BACKSPACE_COMMAND:()=>fl,KEY_DELETE_COMMAND:()=>pl,KEY_ESCAPE_COMMAND:()=>kc,LineBreakNode:()=>ss,PASTE_COMMAND:()=>ll,ParagraphNode:()=>ba,REDO_COMMAND:()=>ul,RootNode:()=>us,TextNode:()=>ga,UNDO_COMMAND:()=>cl,createCommand:()=>wd,createEditor:()=>Kg});var B_=y=>{var d={};return on.d(d,y),d};const F_=B_({$isLinkNode:()=>X1});var z_=y=>{var d={};return on.d(d,y),d};const eo=z_({$createMarkNode:()=>uu,$getMarkIDs:()=>n_,$isMarkNode:()=>_a,$unwrapMarkNode:()=>t_,$wrapSelectionInMarkNode:()=>e_,MarkNode:()=>Pf});var U_=y=>{var d={};return on.d(d,y),d};const kn=U_({$createTableCellNode:()=>Xo,$createTableRowNode:()=>gs,$createTableSelection:()=>fu,$getTableColumnIndexFromTableCellNode:()=>Bm,$isTableCellNode:()=>rn,$isTableNode:()=>Pn,$isTableRowNode:()=>sr,$isTableSelection:()=>Bn,TableCellNode:()=>Ao,TableNode:()=>bo,TableRowNode:()=>xa}),$_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),n0={randomUUID:$_};let gu;const H_=new Uint8Array(16);function q_(){if(!gu&&(gu=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gu))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gu(H_)}const gr=[];for(let y=0;y<256;++y)gr.push((y+256).toString(16).slice(1));function J_(y,d=0){return gr[y[d+0]]+gr[y[d+1]]+gr[y[d+2]]+gr[y[d+3]]+"-"+gr[y[d+4]]+gr[y[d+5]]+"-"+gr[y[d+6]]+gr[y[d+7]]+"-"+gr[y[d+8]]+gr[y[d+9]]+"-"+gr[y[d+10]]+gr[y[d+11]]+gr[y[d+12]]+gr[y[d+13]]+gr[y[d+14]]+gr[y[d+15]]}function V_(y,d,g){if(n0.randomUUID&&!d&&!y)return n0.randomUUID();const t=(y=y||{}).random||(y.rng||q_)();if(t[6]=15&t[6]|64,t[8]=63&t[8]|128,d){g=g||0;for(let f=0;f<16;++f)d[g+f]=t[f];return d}return J_(t)}const W_=V_;let K_=()=>{},Dl=function(){return K_};const G_=Dl(),Y_=Dl(),Z_=Dl(),Q_=Dl(),X_=Dl(),tx={log:G_,info:Y_,warn:Q_,debug:Z_,error:X_},le=tx,ex=[y=>y.hasFormat("bold")&&"bold",y=>y.hasFormat("code")&&"code",y=>y.hasFormat("italic")&&"italic",y=>y.hasFormat("strikethrough")&&"strikethrough",y=>y.hasFormat("subscript")&&"subscript",y=>y.hasFormat("superscript")&&"superscript",y=>y.hasFormat("underline")&&"underline"],r0={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},nx={center:2,end:6,justify:4,left:1,right:3,start:5};function rx(y){if(!y||!y.length)return 0;let d=y.split(",");if(d=d.map(t=>t.trim()),d.length===1&&!r0[d[0]])return y;let g=0;for(const t of d){const f=r0[t];f&&(g^=f)}return g}function ox(y){return y?ex.map(d=>d(y)).filter(Boolean).join(","):""}function ix(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return y&&nx[y]||0}function Ll(y){return`__${y}`}function Ff(y){return y.split("__")[1]||""}class ax{constructor(){this.subscribers={}}on(d,g){d&&g&&(this.subscribers[d]||(this.subscribers[d]=[]),this.subscribers[d].push(g))}emit(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.subscribers[d]&&this.subscribers[d].length)for(const t of this.subscribers[d])typeof t=="function"&&t(g)}clear(){this.subscribers={}}}const o0=ax,no={historic:"historic",historyMerge:"history-merge",historyPush:"history-push"},sx={paste:"application/x-lexical-editor",drag:"application/x-lexical-drag",dragBlock:"application/x-lexical-drag-block",plainText:"text/plain"},Jr={created:"created",updated:"updated",destroyed:"destroyed"},Di={text:"text",element:"element",whitelist:["text","element"]},_r={mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",keypress:"keypress",keyup:"keyup",resize:"resize",scroll:"scroll"},i0=[_r.mousemove,_r.mouseover,_r.mouseout],mu={text:"text",linebreak:"linebreak",horizontalrule:"horizontalrule"},zf={local:"local",remote:"remote"},Sa={editorState:"editorState",root:"root"},Li={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1},Bl="codox_comments_change",a0={horizontalrule:["table","image","inline-image","sticky"],"page-break":["image","inline-image","table","sticky"],"collapsible-container":["table","image","inline-image","collapsible-container","sticky"],"layout-container":["table","image","inline-image","layout-container","sticky"],image:["image","inline-image","sticky"],"inline-image":["image","inline-image","sticky"],table:["image","inline-image","table","sticky"],poll:["image","inline-image","sticky"],excalidraw:["image","inline-image","sticky"]},lx="Invalid state - forbidden content nesting found",s0={local:"local",remote:"remote"};function l0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function c0(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?l0(Object(g),!0).forEach(function(t){cx(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):l0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function cx(y,d,g){return(d=ux(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function ux(y){var d=dx(y,"string");return typeof d=="symbol"?d:d+""}function dx(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}class $e{static equalSelectionsJSON(d,g){return!((d||g)&&(d&&!g||g&&!d||d.anchor.codoxId.toString()!==g.anchor.codoxId.toString()||d.anchor.offset!==g.anchor.offset||d.focus.codoxId.toString()!==g.focus.codoxId.toString()||d.focus.offset!==g.focus.offset))}static getNodeAncestorsList(d){return d.getParents()}static getAllNodeLeaves(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(zw(d))return g.push(d),g;let t=d.getChildren();if(!t.length)return g;for(const f of t)g=$e.getAllNodeLeaves(f,g);return g}static splitCodoxIdPathIntoMainAndNested(d){let g=d.findIndex(f=>f===Sa.editorState),t=g+1;return{mainPath:d.slice(0,g),nestedPath:d.slice(t+1)}}static getCodoxIdAndOffsetFromRootNode(d,g){let t=d.getChildren()[g];return{codoxIdArray:t&&t.codoxId?[t.codoxId]:[],offset:0}}static isNestedSelectionJSON(d){return!!d&&!(!d.anchor.codoxId.includes(Sa.editorState)||!d.focus.codoxId.includes(Sa.editorState))}static lexicalToJSONNested(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],f=$e.lexicalToJSON(d);if(!f)return null;let r=[...t,g,Sa.editorState,Sa.root];return f.anchor.codoxId=[...r,...f.anchor.codoxId],f.focus.codoxId=[...r,...f.focus.codoxId],f}static getNestedSelectionJSONFromMainSelectionJSON(d){let g={nestedSelectionJSON:null,nestedEditor:null},{mainPath:t,nestedPath:f}=$e.splitCodoxIdPathIntoMainAndNested(d.anchor.codoxId),{mainPath:r,nestedPath:n}=$e.splitCodoxIdPathIntoMainAndNested(d.focus.codoxId);t.toString()===r.toString()||le.debug("[getNestedSelectionJSONFromMainSelectionJSON]: Nested selection main path part must point to same node in main editor: ",{anchorCodoxIds:d.anchor.codoxId,mainAnchorPath:t,nestedAnchorPath:f,focusCodoxIds:d.focus.codoxId,mainFocusPath:r,nestedFocusPath:n});let e=t,s=e[e.length-1],i=e[e.length-2],l=jn.get(i);if(!l){let c=e[e.length-3];if(c){let u=jn.get(c);u&&(l=u.getChildren().find(h=>h.codoxDId===i))}}if(!l)return le.debug("[getNestedSelectionJSONFromMainSelectionJSON]: Lexical node with nested editor not found in codox nodes map - selection will be dropped",{jsonSelection:d,targetNodeCodoxId:i}),g;let o=Ll(s),a=l[o];return we.isLexicalEditorInstance(a)?(g.nestedSelectionJSON=c0(c0({},d),{},{anchor:{codoxId:f,offset:d.anchor.offset},focus:{codoxId:n,offset:d.focus.offset}}),g.nestedEditor=a,g):(le.debug("[getNestedSelectionJSONFromMainSelectionJSON]: Found nested editor is not LexicalEditor instance",{jsonSelection:d,targetLexicalNode:l,targetLexicalNodeAttrName:o,nestedEditorCandidate:a}),g)}static getNodeAncestorsCodoxIds(d){let g=[],t=$e.getNodeAncestorsList(d);if(t.length===1&&t[0].__type==="root")return g.push(d.codoxId),g;for(let f=t.length-2;f>=0;f--){let r=t[f];r.codoxId&&g.push(r.codoxId)}return d.codoxId&&d.getChildren&&g.push(d.codoxId),g}static getParentOffsetOutOfNodeOffset(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(arguments.length>2&&arguments[2]!==void 0&&arguments[2]){if(d.getChildrenSize&&d.getChildrenSize()===0||g===0&&d.codoxId)return g;let n=g,e=[];if(d.codoxId)e=d.getChildren();else{const i=d.getParents().find(o=>!!o.codoxId);let l=!1;for(const o of i.getChildren()){if(o.__key===d.__key&&(l=!!g&&(Ul(o)||zl(o)),!l))break;if(Ui(o))e.push(o),n+=o.getTextContentSize();else if(En(o))e.push(o),n++;else{let a=$e.getAllNodeLeaves(o),c=a.reduce((u,h)=>(Ui(h)?u+=h.getTextContentSize():En(h)&&u++,u),0);e.push(...a),n+=c}if(l)break}}let s=0;for(const i of e){if(n<=0)break;let l=0;l=En(i)?1:i.getTextContentSize(),s+=l,En(i)?n--:n-=l}return s}let t=d.getParents().find(n=>!!n.codoxId);if(!t)return g;let f=[];for(const n of t.getChildren())if(Ui(n)||En(n))f.push(n);else{let e=$e.getAllNodeLeaves(n);f.push(...e)}if(f.length===1&&f[0].__key===d.__key)return g;let r=0;for(const n of f){if(n.__key===d.__key){r+=g;break}let e=0;e=En(n)?1:n.getTextContentSize(),r+=e}return r}static lexicalToJSON(d){if(!d)return null;let g=[],t=0,f=[],r=0,n="",e=0,s=!0;if((0,be.$isRangeSelection)(d)){let i=(0,be.$getNodeByKey)(d.anchor.key);if(ka(i)){let{codoxIdArray:o,offset:a}=$e.getCodoxIdAndOffsetFromRootNode(i,d.anchor.offset);g=o,t=a}else{if((0,kn.$isTableCellNode)(i)){let c=i.getFirstChild();c&&Ss(c)&&(i=c)}g=$e.getNodeAncestorsCodoxIds(i);const o=d.anchor.offset,a=d.anchor.type===Di.element;t=$e.getParentOffsetOutOfNodeOffset(i,o,a,"anchor")}let l=(0,be.$getNodeByKey)(d.focus.key);if(ka(l)){let{codoxIdArray:o,offset:a}=$e.getCodoxIdAndOffsetFromRootNode(l,d.focus.offset);f=o,r=a}else{if((0,kn.$isTableCellNode)(l)){let c=l.getFirstChild();c&&Ss(c)&&(l=c)}f=$e.getNodeAncestorsCodoxIds(l);const o=d.focus.offset,a=d.focus.type===Di.element;r=$e.getParentOffsetOutOfNodeOffset(l,o,a,"focus")}n=d.style,e=d.format,s=d.dirty}else if((0,be.$isNodeSelection)(d)){let i=d.getNodes();if(!i.length)return null;let l=i[0],o=i[i.length-1],a=(0,be.$createRangeSelection)();a.anchor.set(l.getKey(),0,Di.element),a.focus.set(o.getKey(),0,Di.element);let c=a.isBackward();g=$e.getNodeAncestorsCodoxIds(l),f=$e.getNodeAncestorsCodoxIds(o);let u=c?1:0,h=c?0:1;t=$e.getParentOffsetOutOfNodeOffset(l,u),r=$e.getParentOffsetOutOfNodeOffset(o,h)}else if((0,kn.$isTableSelection)(d)){t=r=null;let i=(0,be.$getNodeByKey)(d.anchor.key),l=(0,be.$getNodeByKey)(d.focus.key);g=$e.getNodeAncestorsCodoxIds(i),f=$e.getNodeAncestorsCodoxIds(l)}return{anchor:{codoxId:g,offset:t},focus:{codoxId:f,offset:r},style:n,format:e,dirty:s}}static createTableSelection(d,g){if(!Cs(d)||!Cs(g))return le.warn("[createTableSelection] invalid anchor/focus nodes - must be one of table nodes: ",{anchorNode:d,focusNode:g}),null;let t=(0,kn.$isTableNode)(d)?d:d.getParents().find(r=>(0,kn.$isTableNode)(r)),f=(0,kn.$createTableSelection)();return f.set(t.getKey(),d.getKey(),g.getKey()),f}static createNodeSelection(d,g){if(g||(g=d),!En(d)||!En(g))return le.warn("[createNodeSelection] invalid anchor/focus - must be decorators: ",{anchorNode:d,focusNode:g}),null;let t=(0,be.$createNodeSelection)(),f=d.getNodesBetween(g),r=f.filter(n=>En(n));return f.length!==r.length?(le.warn("[createNodeSelection] nodes list contains unexpected nodes: ",{allNodes:f,decoratorNodes:r}),null):(r.forEach(n=>{t.add(n.__key)}),t)}static findClosestParentElementNode(d){if(!d)return null;let g=d.getParent();return g?Ss(g)?g:$e.findClosestParentElementNode(g):null}static createRangeSelection(d,g,t,f,r,n){if(!(arguments.length>6&&arguments[6]!==void 0&&arguments[6])){if(!($n(d)||Ss(d)||(le.warn("[createRangeSelection] anchor node is not text or element node - finding closest parent element node "),d=$e.findClosestParentElementNode(d))))return le.warn("[createRangeSelection] unable to find anchor closest parent element node - dropping to null"),null;if(!($n(g)||Ss(g)||(le.warn("[createRangeSelection] focus node is not text or element node - finding closest parent element node "),g=$e.findClosestParentElementNode(g))))return le.warn("[createRangeSelection] unable to find focus closest parent element node - dropping to null"),null}let e=(0,be.$createRangeSelection)();e.format=r,e.setStyle(n);let s=$n(d)?Di.text:Di.element,i=$n(g)?Di.text:Di.element;return e.anchor.set(d.getKey(),t,s),e.focus.set(g.getKey(),f,i),e.dirty=!1,e}static getSelectedCandidateFromParentChildren(d,g){let t=arguments.length>2&&arguments[2]!==void 0&&arguments[2],f=null,r=g;if(g===0){const n=d.getFirstChild();f=$n(n)?n:d}else{let n=d.getChildren(),e=[];for(let i of n)if(Ui(i)||En(i))e.push(i);else{let l=$e.getAllNodeLeaves(i);e.push(...l)}let s=g;for(let i of e)if(Ui(i)||En(i)){let l=En(i)?1:i.getTextContentSize();if(s<=l){if(Yf(i)){let o=i.getNextSibling();o&&$n(o)?(f=o,r=0):(f=d,r=i.getPreviousSiblings().length+1);break}En(i)&&(t||(s=0)),f=i,r=s;break}s-=l}if(!f){const i=d.getLastChild();$n(i)?(f=i,r=i.getTextContentSize()):(f=d,r=d.getChildrenSize())}}return{candidate:f,candidateOffset:r}}static getSelectedParentAndOffset(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=d.getParent(),f=d.getPreviousSiblings().length+1;return(Cs(t)||!En(d)&&ka(t))&&(t=d,f=g),{parent:t,parentOffset:f}}static JSONToLexical(d){if(le.debug("[JSONToLexical]: ",{selectionJson:d}),!d)return null;let{anchor:{codoxId:g,offset:t},focus:{codoxId:f,offset:r},format:n,style:e}=d,s=!g.length,i=null;if(s)i=(0,be.$getRoot)();else{let M=g[g.length-1];i=M?jn.get(M):null}let l=!f.length,o=null;if(l)o=(0,be.$getRoot)();else{let M=f[f.length-1];o=M?jn.get(M):null}if(!i||!o)return le.debug(" [JSONToLexical] anchorNode or focusNode not found in lexical nodes - selection will be dropped to null: ",{anchorParentNode:i,focusParentNode:o,anchorOffset:t,focusOffset:r,selectionJson:d}),null;if(i&&!i.isAttached()||o&&!o.isAttached())return le.debug("[JSONToLexical] anchorNode or focusNode is no longer attached to editor - marked for GC: ",{anchorParentNode:i,focusParentNode:o,isAnchorNodeAttached:i.isAttached(),isFocusParentNodeAttached:o.isAttached()}),null;if(Cs(i)&&Cs(o)&&t===null&&r===null)return $e.createTableSelection(i,o);if(En(i)&&En(o)&&t!==r)return $e.createNodeSelection(i,o);if(En(i)&&En(o)&&t===r&&R0(i)&&R0(o)){let M=(0,be.$getRoot)(),J=M.getChildren(),K=J.findIndex(U=>U.getKey()===i.getKey()),N=J.findIndex(U=>U.getKey()===o.getKey());return $e.createRangeSelection(M,M,K,N,n,e)}let a,c,u,h,p=!!i.getChildrenSize,m=!!o.getChildrenSize,b=p&&i.getChildrenSize()===0,_=m&&o.getChildrenSize()===0;if(b&&_)return $e.createRangeSelection(i,o,t,r,n,e);let v=p&&i.getChildrenSize()>0,w=m&&o.getChildrenSize()>0;if(v){let{candidate:M,candidateOffset:J}=$e.getSelectedCandidateFromParentChildren(i,t);a=M,u=J}else{let{parent:M,parentOffset:J}=$e.getSelectedParentAndOffset(i,t);a=M,u=J}if(w){let{candidate:M,candidateOffset:J}=$e.getSelectedCandidateFromParentChildren(o,r,!0);c=M,h=J}else{let{parent:M,parentOffset:J}=$e.getSelectedParentAndOffset(o,r);c=M,h=J}if(!a||!c)return null;let x=$n(a),S=$n(c),E=En(a),k=En(c),D=i.getKey()===o.getKey(),P=D&&r-t==1,O=D&&r===t&&a.getKey()===c.getKey(),R=t!==r,A=a.getKey()===c.getKey();if(E&&k&&O){let M=a.getNextSibling();if(M&&$n(M))return $e.createRangeSelection(M,M,0,0,n,e);if(M&&(0,be.$isParagraphNode)(M))return $e.createNodeSelection(a,c);let{parent:J,parentOffset:K}=$e.getSelectedParentAndOffset(a);return $e.createRangeSelection(J,J,K,K,n,e)}let z=$e.createRangeSelection(a,c,u,h,n,e,!0),H=z.isBackward(),$=z.getNodes();if(E&&k&&!A){if(P)return $e.createNodeSelection(c);if($.every(M=>En(M)))return $e.createNodeSelection(a,c);{let M,J,K,N,U=a.getNextSibling();if(U&&$n(U))M=U,K=0;else{let{parent:G,parentOffset:F}=$e.getSelectedParentAndOffset(a);M=G,K=F}let W=c.getNextSibling();if(W&&$n(W))J=W,N=0;else{let{parent:G,parentOffset:F}=$e.getSelectedParentAndOffset(c);J=G,N=F}return $e.createRangeSelection(M,J,K,N,n,e)}}if(x&&S&&R)if(H){let M=h===c.getTextContentSize(),J=c.getNextSibling();if(M&&J&&$n(J))return $e.createRangeSelection(a,J,u,0,n,e)}else{let M=u===a.getTextContentSize(),J=a.getNextSibling();if(M&&J&&$n(J))return $e.createRangeSelection(J,c,0,h,n,e)}if(R&&!E&&k){if(P)return $e.createNodeSelection(c);let[M,...J]=$,K=J.every(U=>En(U));if($n(M)&&u===M.getTextContentSize()&&K)return $e.createNodeSelection(J[0],c);let N=c.getNextSibling();if($n(a)&&a.getTextContentSize()===u&&!H){let U=a.getNextSibling();U&&$n(U)&&(a=U,u=0)}if(N&&$n(N))return $e.createRangeSelection(a,N,u,0,n,e);{let{parent:U,parentOffset:W}=$e.getSelectedParentAndOffset(c);return $e.createRangeSelection(a,U,u,W,n,e)}}if(R&&E&&!k){let[M,...J]=$,K=J.every(U=>En(U));if($n(M)&&h===M.getTextContentSize()&&K)return $e.createNodeSelection(a,J[0]);let N=a.getNextSibling();if(N&&$n(N))return $e.createRangeSelection(N,c,0,h,n,e);{let{parent:U,parentOffset:W}=$e.getSelectedParentAndOffset(a);return $e.createRangeSelection(U,c,W,h,n,e)}}return $e.createRangeSelection(a,c,u,h,n,e)}}var fx=y=>{var d={};return on.d(d,y),d};const Gt=fx({Fragment:()=>Qn.Fragment,createContext:()=>Qn.createContext,createElement:()=>Qn.createElement,forwardRef:()=>Qn.forwardRef,useCallback:()=>Qn.useCallback,useContext:()=>Qn.useContext,useEffect:()=>Qn.useEffect,useImperativeHandle:()=>Qn.useImperativeHandle,useLayoutEffect:()=>Qn.useLayoutEffect,useMemo:()=>Qn.useMemo,useRef:()=>Qn.useRef,useState:()=>Qn.useState});function u0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function d0(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?u0(Object(g),!0).forEach(function(t){px(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):u0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function px(y,d,g){return(d=hx(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function hx(y){var d=gx(y,"string");return typeof d=="symbol"?d:d+""}function gx(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}const Uf="comments_change";class mx extends o0{constructor(){super(),this.initialCommentThreads=[],this.commentThreads=[],this.dataTypes={comment:"comment",thread:"thread"},this.ID_PREFIX="codox",this.relatedNodeKeys={},this.activeThreadIds={},this._uiRefreshTriggered=!1}_triggerUIRefresh(){this._uiRefreshTriggered||(this._uiRefreshTriggered=!0,Promise.resolve().then(()=>{le.debug("[_triggerUIRefresh] emitted"),this.emit(Uf),this._uiRefreshTriggered=!1}))}_copyThreads(d){return[...d]}_getActiveCommentThreads(){return this.commentThreads.filter(d=>!!this.activeThreadIds[d.codoxId])}_setCommentThreads(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];this.commentThreads=[...d],[...d],this._triggerUIRefresh()}clear(){this.resetComments(),super.clear()}gcInternalStates(){this.relatedNodeKeys={},this.activeThreadIds={}}resetComments(){this.gcInternalStates(),this._setCommentThreads([])}getAllComments(){return this.commentThreads}setAllComments(d){Array.isArray(d)?this._setCommentThreads(d):le.warn("[setAllComments]: incomming comments are not array: ",{newCommentThreads:d})}addRelatedNodeKey(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],t=arguments.length>2&&arguments[2]!==void 0&&arguments[2];if(!Array.isArray(g)||!g.length)return;let f=g.filter(r=>typeof r=="string"&&r.startsWith(this.ID_PREFIX));if(f.length){if(t)for(let r of f)this.activeThreadIds[r]?this.activeThreadIds[r].add(d):this.activeThreadIds[r]=new Set([d]);else if(this.relatedNodeKeys[d]){let r=[...this.relatedNodeKeys[d]],n=f,e=n.length>r.length,s=r.length>n.length;e?n.filter(i=>!r.includes(i)).forEach(i=>{this.activeThreadIds[i].add(d)}):s&&r.filter(i=>!n.includes(i)).forEach(i=>{this.activeThreadIds[i].size>1?this.activeThreadIds[i].delete(d):delete this.activeThreadIds[i]})}this.relatedNodeKeys[d]=f,this._triggerUIRefresh()}}removeRelatedNodeKey(d){if(this.relatedNodeKeys[d]){let g=this.relatedNodeKeys[d];le.debug("[CodoxComments][removeRelatedNodeKey]: ",{nodeKey:d,threadIds:g,activeThreads:this.activeThreadIds}),g.forEach(t=>{this.activeThreadIds[t]&&(this.activeThreadIds[t].size>1?this.activeThreadIds[t].delete(d):delete this.activeThreadIds[t])}),delete this.relatedNodeKeys[d],this._triggerUIRefresh()}}createCommentId(){return`${this.ID_PREFIX}-${Gf()}`}createNewCommentObj(d){let{content:g,author:t,codoxId:f,timeStamp:r}=d;return{author:t,content:g,codoxId:f||this.createCommentId(),timeStamp:r,type:this.dataTypes.comment}}createNewThreadObj(d){let{quote:g,comments:t,codoxId:f}=d;return{comments:t,codoxId:f||this.createCommentId(),quote:g,type:this.dataTypes.thread}}addCommentThread(d){let g=[...this.commentThreads,d];this._setCommentThreads(g)}addComment(d,g){let t=this.commentThreads.map(f=>{if(f.codoxId===d){let r=d0({},f);return r.comments=[...r.comments,g],r}return f});this._setCommentThreads(t)}removeCommentThread(d){}removeComment(d,g){le.debug("[CodoxComments][removeCommentFromPlugin]: ",{commentId:g,threadId:d});let t=this.commentThreads.map(f=>{if(f.codoxId===d){let r=d0({},f);return r.comments=r.comments.filter(n=>n.codoxId!==g),r}return f});this._setCommentThreads(t)}gcAbandonedNodeKeys(d){let g=Object.keys(this.relatedNodeKeys);for(let t of g)d.has(t)||this.removeRelatedNodeKey(t)}refreshComments(){this._triggerUIRefresh()}setInitialComments(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];Array.isArray(d)&&(le.debug("[CodoxComments][setInitialComments]: ",[...d]),this.initialCommentThreads=[...d])}activateInitialComments(d){this.setAllComments(this.initialCommentThreads),console.log("COMMENTS: ",{initComments:[...this.initialCommentThreads]}),d.getEditorState().read(()=>{let g=(0,be.$nodesOfType)(eo.MarkNode);for(let t of g)console.log("COMMENTS: ",{node:t}),this.addRelatedNodeKey(t.__key,t.__ids,!0)}),console.log("IVAN: ",{self:this}),this.initialCommentThreads=[]}initialCommentsExist(){return!!this.initialCommentThreads.length}}const Cn=new mx;function yx(){let y=Cn._getActiveCommentThreads.bind(Cn);const[d,g]=(0,Gt.useState)(y());return(0,Gt.useEffect)(()=>{Cn.on(Uf,()=>{let t=y();le.log(`[useCodoxComments] "${Uf}" event: `,t),g(t)})},[]),d}const $f=(0,be.createCommand)("INSERT_COMMENT");var bx=y=>{var d={};return on.d(d,y),d};const bs=bx({mergeRegister:()=>mo,registerNestedElementResolver:()=>w1});var vx=on(967),ti=on.n(vx),_x=Object.getOwnPropertyNames,xx=Object.getOwnPropertySymbols,wx=Object.prototype.hasOwnProperty;function f0(y,d){return function(g,t,f){return y(g,t,f)&&d(g,t,f)}}function yu(y){return function(d,g,t){if(!d||!g||typeof d!="object"||typeof g!="object")return y(d,g,t);var f=t.cache,r=f.get(d),n=f.get(g);if(r&&n)return r===g&&n===d;f.set(d,g),f.set(g,d);var e=y(d,g,t);return f.delete(d),f.delete(g),e}}function p0(y){return _x(y).concat(xx(y))}var h0=Object.hasOwn||function(y,d){return wx.call(y,d)};function vs(y,d){return y||d?y===d:y===d||y!=y&&d!=d}var g0="_owner",m0=Object.getOwnPropertyDescriptor,y0=Object.keys;function Sx(y,d,g){var t=y.length;if(d.length!==t)return!1;for(;t-- >0;)if(!g.equals(y[t],d[t],t,t,y,d,g))return!1;return!0}function Cx(y,d){return vs(y.getTime(),d.getTime())}function b0(y,d,g){if(y.size!==d.size)return!1;for(var t,f,r={},n=y.entries(),e=0;(t=n.next())&&!t.done;){for(var s=d.entries(),i=!1,l=0;(f=s.next())&&!f.done;){var o=t.value,a=o[0],c=o[1],u=f.value,h=u[0],p=u[1];i||r[l]||!(i=g.equals(a,h,e,l,y,d,g)&&g.equals(c,p,a,h,y,d,g))||(r[l]=!0),l++}if(!i)return!1;e++}return!0}function Ex(y,d,g){var t,f=y0(y),r=f.length;if(y0(d).length!==r)return!1;for(;r-- >0;)if((t=f[r])===g0&&(y.$$typeof||d.$$typeof)&&y.$$typeof!==d.$$typeof||!h0(d,t)||!g.equals(y[t],d[t],t,t,y,d,g))return!1;return!0}function Fl(y,d,g){var t,f,r,n=p0(y),e=n.length;if(p0(d).length!==e)return!1;for(;e-- >0;)if((t=n[e])===g0&&(y.$$typeof||d.$$typeof)&&y.$$typeof!==d.$$typeof||!h0(d,t)||!g.equals(y[t],d[t],t,t,y,d,g)||(f=m0(y,t),r=m0(d,t),(f||r)&&(!f||!r||f.configurable!==r.configurable||f.enumerable!==r.enumerable||f.writable!==r.writable)))return!1;return!0}function kx(y,d){return vs(y.valueOf(),d.valueOf())}function Ox(y,d){return y.source===d.source&&y.flags===d.flags}function v0(y,d,g){if(y.size!==d.size)return!1;for(var t,f,r={},n=y.values();(t=n.next())&&!t.done;){for(var e=d.values(),s=!1,i=0;(f=e.next())&&!f.done;)s||r[i]||!(s=g.equals(t.value,f.value,t.value,f.value,y,d,g))||(r[i]=!0),i++;if(!s)return!1}return!0}function Tx(y,d){var g=y.length;if(d.length!==g)return!1;for(;g-- >0;)if(y[g]!==d[g])return!1;return!0}var jx="[object Arguments]",Ax="[object Boolean]",Px="[object Date]",Nx="[object Map]",Ix="[object Number]",Rx="[object Object]",Mx="[object RegExp]",Dx="[object Set]",Lx="[object String]",Bx=Array.isArray,_0=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,x0=Object.assign,Fx=Object.prototype.toString.call.bind(Object.prototype.toString);function zx(y){var d=y.areArraysEqual,g=y.areDatesEqual,t=y.areMapsEqual,f=y.areObjectsEqual,r=y.arePrimitiveWrappersEqual,n=y.areRegExpsEqual,e=y.areSetsEqual,s=y.areTypedArraysEqual;return function(i,l,o){if(i===l)return!0;if(i==null||l==null||typeof i!="object"||typeof l!="object")return i!=i&&l!=l;var a=i.constructor;if(a!==l.constructor)return!1;if(a===Object)return f(i,l,o);if(Bx(i))return d(i,l,o);if(_0!=null&&_0(i))return s(i,l,o);if(a===Date)return g(i,l,o);if(a===RegExp)return n(i,l,o);if(a===Map)return t(i,l,o);if(a===Set)return e(i,l,o);var c=Fx(i);return c===Px?g(i,l,o):c===Mx?n(i,l,o):c===Nx?t(i,l,o):c===Dx?e(i,l,o):c===Rx?typeof i.then!="function"&&typeof l.then!="function"&&f(i,l,o):c===jx?f(i,l,o):(c===Ax||c===Ix||c===Lx)&&r(i,l,o)}}function Ux(y){var d=y.circular,g=y.createCustomConfig,t=y.strict,f={areArraysEqual:t?Fl:Sx,areDatesEqual:Cx,areMapsEqual:t?f0(b0,Fl):b0,areObjectsEqual:t?Fl:Ex,arePrimitiveWrappersEqual:kx,areRegExpsEqual:Ox,areSetsEqual:t?f0(v0,Fl):v0,areTypedArraysEqual:t?Fl:Tx};if(g&&(f=x0({},f,g(f))),d){var r=yu(f.areArraysEqual),n=yu(f.areMapsEqual),e=yu(f.areObjectsEqual),s=yu(f.areSetsEqual);f=x0({},f,{areArraysEqual:r,areMapsEqual:n,areObjectsEqual:e,areSetsEqual:s})}return f}function $x(y){return function(d,g,t,f,r,n,e){return y(d,g,e)}}function Hx(y){var d=y.circular,g=y.comparator,t=y.createState,f=y.equals,r=y.strict;if(t)return function(e,s){var i=t(),l=i.cache,o=l===void 0?d?new WeakMap:void 0:l,a=i.meta;return g(e,s,{cache:o,equals:f,meta:a,strict:r})};if(d)return function(e,s){return g(e,s,{cache:new WeakMap,equals:f,meta:void 0,strict:r})};var n={cache:void 0,equals:f,meta:void 0,strict:r};return function(e,s){return g(e,s,n)}}var Hf=Bi();Bi({strict:!0}),Bi({circular:!0}),Bi({circular:!0,strict:!0}),Bi({createInternalComparator:function(){return vs}}),Bi({strict:!0,createInternalComparator:function(){return vs}}),Bi({circular:!0,createInternalComparator:function(){return vs}}),Bi({circular:!0,createInternalComparator:function(){return vs},strict:!0});function Bi(y){y===void 0&&(y={});var d=y.circular,g=d!==void 0&&d,t=y.createInternalComparator,f=y.createState,r=y.strict,n=r!==void 0&&r,e=zx(Ux(y));return Hx({circular:g,comparator:e,createState:f,equals:t?t(e):$x(e),strict:n})}var qx=on(256),Jx=on.n(qx),Vx=y=>{var d={};return on.d(d,y),d};const Ca=Vx({$getSelectionStyleValueForProperty:()=>im,$patchStyleText:()=>om,createDOMRange:()=>f1,createRectsFromDOMRange:()=>p1});class bu{static composeLexicalDOMNodeKeyAttrName(d){return`__lexicalKey_${d._key}`}static extractLexicalKeyFromLexicalDOMNodeKeyAttr(d){return d.split("__lexicalKey_")[1]||""}static extractSelectionUserId(d){return d.meta.author.id}static createRemoteSelectionColors(d){const g={caretColor:d,highlightColor:"",tooltipBGColor:""};if(d.startsWith("rgb")){let t=d,[f]=t.split(")");g.highlightColor=`${f},0.3)`,g.tooltipBGColor=`${f},0.85)`}else if(d.startsWith("#"))g.highlightColor=`${d}${Math.floor(76.5).toString(16).padStart(2,0)}`,g.tooltipBGColor=`${d}${Math.floor(216.75).toString(16).padStart(2,0)}`;else{const[t,f,r]=Jx().keyword.rgb(d);g.highlightColor=`rgb(${t},${f}, ${r},0.3)`,g.tooltipBGColor=`rgb(${t},${f}, ${r},0.85)`}return g}static formatRemoteSelectionUsername(d){let g=d;return g=g.trim(),g.length>=17?`${g.substring(0,14)}...`:g}static isMousePositionWithinElementCords(d,g){return d.clientX>=g.x-5&&d.clientX<=g.x+g.width+5&&d.clientY>=g.y-5&&d.clientY<=g.y+g.height+5}static createDOMRange(d,g,t,f,r){return(0,Ca.createDOMRange)(d,g,t,f,r)}static createRectsFromDOMRange(d,g){let{keepFullWidthRects:t=!1}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const f=d.getRootElement();if(f===null)return[];const r=f.getBoundingClientRect(),n=getComputedStyle(f),e=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),s=Array.from(g.getClientRects());let i=a=>s.splice(a,1),l=new Set;for(let a=0;a<s.length;a++){let c=s[a],u=s[a-1];if(!c||!u)continue;let h=`${(o=c).top}_${o.left}_${o.width}_${o.height}`;if(l.has(h))i(a--);else if(l.add(h),c.top===u.top&&c.height===u.height&&c.left-(u.left+u.width)<5){let p=DOMRect.fromRect({x:u.x,y:u.y,width:u.width+c.width,height:u.height});s[a-1]=p,i(a--)}else c.width+e!==r.width||t?u.top<=c.top&&u.bottom>=c.bottom&&u.left<=c.left&&u.right>=c.right&&i(a--):i(a--)}var o;return s}static getEmptyRootRect(d){let g=d.getRootElement(),t=g.getBoundingClientRect();const f=getComputedStyle(g),r=parseFloat(f.paddingLeft),n=parseFloat(f.paddingTop),e=parseFloat(f.paddingBottom);return[new DOMRect(t.x+r,t.y+n,0,t.height-e-n)]}}wc(bu,"remoteSelectionClassName","codox_remote_selection"),wc(bu,"remoteSelectionRect","codox_remote_selection_rect"),wc(bu,"tooltipAnimations",{hideAtOnce:"codox_hide_tooltip 0s linear 0s forwards",hideWithDelay:"codox_hide_tooltip 0s linear 2s forwards",showAtOnce:"codox_show_tooltip 0s linear 0s forwards",unset:"unset"});const Xn=bu;function w0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function Wx(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?w0(Object(g),!0).forEach(function(t){Kx(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):w0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function Kx(y,d,g){return(d=Gx(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function Gx(y){var d=Yx(y,"string");return typeof d=="symbol"?d:d+""}function Yx(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}class Lr{static _logInvalid(d,g,t){for(var f=arguments.length,r=new Array(f>3?f-3:0),n=3;n<f;n++)r[n-3]=arguments[n];le.warn("[JSON SELECTION VALIDATION]: ",Wx({selectBelongsTo:d||"not provided",reason:g,jsonSelection:t},r))}static _isObject(d){return typeof d=="object"&&!Array.isArray(d)}static _validateSelectionSide(d){let{type:g,side:t,sideName:f,fullSelection:r}=d;if(!Lr._isObject(t))return Lr._logInvalid(g,`selection.${f} must be object`,r),!1;let n=t.codoxId;if(!Array.isArray(n))return Lr._logInvalid(g,`selection.${f}.codoxId must be array`,r),!1;if(n.length){let s=n.findIndex(l=>l===Sa.editorState),i=s!==-1;for(let l=0;l<n.length;l++){if(i){if(l===s||l===s+2)continue;if(l===s+1&&n[l]!=="root")return Lr._logInvalid(g,`selection.${f}.codoxId path invalid: nested selection must include "editorState" and "root": [..."editorState", "root"...]`,r,jn),!1;continue}let o=n[l];if(!jn.has(o))return Lr._logInvalid(g,`selection.${f}.codoxId path invalid: node for id ${o} does not exist`,r,jn),!1}}let e=t.offset;return typeof e=="number"||e===null?e>=0||e===null||(Lr._logInvalid(g,`selection.${f}.offset must be gte 0 or -1`,r),!1):(Lr._logInvalid(g,`selection.${f}.offset must be number or null`,r),!1)}static validateJSONSelection(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(d===null)return!0;if(!d)return Lr._logInvalid(g,"invalid json selection data type",d),!1;if(!Lr._isObject(d))return Lr._logInvalid(g,"json selection must be object",d),!1;let{anchor:t,focus:f}=d;return!!Lr._validateSelectionSide({type:g,side:t,sideName:"anchor",fullSelection:d})&&!!Lr._validateSelectionSide({type:g,side:f,sideName:"focus",fullSelection:d})}}const qf=Lr;var Zx=on(186),ei=on.n(Zx),Qx=on(155),ni=on.n(Qx),Xx=on(433),ri=on.n(Xx),tw=on(626),oi=on.n(tw),ew=on(990),ii=on.n(ew),nw=on(827),ai=on.n(nw),vu=on(500),_s={};_s.styleTagTransform=ai(),_s.setAttributes=oi(),_s.insert=ri().bind(null,"head"),_s.domAPI=ni(),_s.insertStyleElement=ii(),ei()(vu.A,_s),vu.A&&vu.A.locals&&vu.A.locals;class rw{constructor(){wc(this,"paintSingleRemoteSelection",d=>{let{editor:g,selectionJSON:t,lexicalSelection:f,selectedNodes:r,isBackward:n}=d;this.activeEditorsKeys[g._key]||(this.activeEditorsKeys[g._key]=g._key);const e=Xn.extractSelectionUserId(t),s=Xn.formatRemoteSelectionUsername(t.meta.author.name),i=Xn.createRemoteSelectionColors(t.meta.color);let l=null,o=null,a=0,c=0;(0,be.$isNodeSelection)(f)?(l=r[0],o=r[r.length-1],a=0,c=1):(l=g._editorState._nodeMap.get(f.anchor.key),o=g._editorState._nodeMap.get(f.focus.key),a=f.anchor.offset,c=f.focus.offset);let u=(0,kn.$isTableSelection)(f),h=(0,be.$isNodeSelection)(f),p=(0,be.$isRangeSelection)(f);for(let w of r)this.trackedNodesKeys.add(`${w.getKey()}__${g._key}`);r.length===1&&Yf(r[0])&&a===c&&c++;let m=null,b=[];if(u&&(0,kn.$isTableCellNode)(l)&&(0,kn.$isTableCellNode)(o)){let w=r.filter(x=>(0,kn.$isTableCellNode)(x));for(let x of w)if(a=(0,kn.$getTableColumnIndexFromTableCellNode)(x),c=(0,kn.$getTableColumnIndexFromTableCellNode)(x)+1,l=x.getParent(),o=x.getParent(),m=Xn.createDOMRange(g,l,a,o,c),m){let[S]=Xn.createRectsFromDOMRange(g,m);b.push(S)}}else if(h){let w=f.getNodes();for(let x of w)if(m=Xn.createDOMRange(g,x,0,x,1),m){let[S]=Xn.createRectsFromDOMRange(g,m);b.push(S)}}else p&&(ka(l)&&ka(o)&&a===0&&c===0?b=Xn.getEmptyRootRect(g):(m=Xn.createDOMRange(g,l,a,o,c),m&&(b=Xn.createRectsFromDOMRange(g,m,{keepFullWidthRects:!0}))));let _=null,v=document.createElement("span");v.classList.add(Xn.remoteSelectionClassName),v.setAttribute("codox_remote_user",e),document.body.append(v),this.remoteSelectionDOMsMap[e]=v;for(let w=0;w<b.length;w++){let x=b[w];if(!x)continue;let S=w===0,E=w===b.length-1,k=x.width,D=x.height,P=x.top,O=x.left,R=n&&S||!n&&E,A=document.createElement("span");if(v.append(A),A.classList.add(Xn.remoteSelectionRect),A.style.cssText=`
|
|
1393
1393
|
display: block;
|
|
1394
1394
|
pointer-events: none;
|
|
1395
1395
|
user-select: none;
|
|
@@ -1426,5 +1426,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1426
1426
|
animation: ${this.isEditingInProgress?Xn.tooltipAnimations.hideAtOnce:Xn.tooltipAnimations.hideWithDelay};
|
|
1427
1427
|
left: ${n?"0px":"100%"};
|
|
1428
1428
|
z-index: 10;
|
|
1429
|
-
`,A.append(H),_=H}!R&&x.width<1&&r.length>1&&(A.style.width="3px")}b.forEach(w=>{this.hoverList.push([w,_,e])})});this.remoteSelections=[],this.isEditingInProgress=!1,this.hoverList=[],this.trackedNodesKeys=new Set,this.remoteSelectionDOMsMap={},this.activeEditorsKeys={},this.keyboardBindedListener=this._keyboardEventsListener.bind(this),this.mouseBindedListener=this._mouseEventsListener.bind(this),this.resizeBindedListener=this._resizeEventListener.bind(this),this.hideInUI=!1}_mouseEventsListener(d){let g=!1,t=d.target,f=!1,r=3;for(;r&&t;){if(t.__codox_track){g=!0;break}if(t.__lexicalEditor){g=!0,f=!0;break}t=t.parentNode,r--}if(!g)return;let n=null;for(let i in this.activeEditorsKeys){if(t[`__lexicalKey_${i}`]){n=i;break}t.__lexicalEditor&&(n=t.__lexicalEditor._key)}if(!n)return;let e=f?"root":t[`__lexicalKey_${n}`];if(!e||!this.trackedNodesKeys.has(`${e}__${n}`))return;let s=new Set;for(let i=0;i<this.hoverList.length;i++){let l=this.hoverList[i],[o,a,c]=l;if(s.has(c))continue;let u=Xn.isMousePositionWithinElementCords(d,o);d.type===_r.mouseover&&u&&(a.style.animation=this.isEditingInProgress?Xn.tooltipAnimations.hideAtOnce:Xn.tooltipAnimations.showAtOnce,s.add(c)),d.type===_r.mouseout&&(a.style.animation=Xn.tooltipAnimations.hideWithDelay,s.add(c)),d.type===_r.mousemove&&u&&(a.style.animation=this.isEditingInProgress?Xn.tooltipAnimations.hideAtOnce:Xn.tooltipAnimations.showAtOnce,s.add(c))}}_keyboardEventsListener(d){d.type===_r.keypress&&(this.isEditingInProgress||(this.isEditingInProgress=!0)),d.type===_r.keyup&&this.isEditingInProgress&&(this.isEditingInProgress=!1)}_resizeEventListener(d){we.mainEditorExists()&&this.paintRemoteSelections(this.remoteSelections)}mount(){window.addEventListener(_r.keypress,this.keyboardBindedListener),window.addEventListener(_r.keyup,this.keyboardBindedListener),window.addEventListener(_r.resize,this.resizeBindedListener),window.addEventListener(_r.scroll,this.resizeBindedListener);for(const d of a0)window.addEventListener(d,this.mouseBindedListener)}unmount(){window.removeEventListener(_r.keypress,this.keyboardBindedListener),window.removeEventListener(_r.keyup,this.keyboardBindedListener),window.removeEventListener(_r.resize,this.resizeBindedListener),window.removeEventListener(_r.scroll,this.resizeBindedListener);for(const d of a0)window.removeEventListener(d,this.mouseBindedListener);this.gcPrevPaintedRemoteSelections()}shouldUpdateRemoteSelections(){return!0}gcPrevPaintedRemoteSelections(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];for(let g in this.remoteSelectionDOMsMap)this.remoteSelectionDOMsMap[g].remove();this.hoverList=[],this.trackedNodesKeys=new Set,this.remoteSelections=d||[],this.remoteSelectionDOMsMap={},this.activeEditorsKeys={}}paintRemoteSelections(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];this.gcPrevPaintedRemoteSelections(d);let g=we.getMainEditorState();g.read&&g.read(()=>{for(let t of this.remoteSelections)if(qf.validateJSONSelection(t,zf.remote))if($e.isNestedSelectionJSON(t)){let{nestedSelectionJSON:f,nestedEditor:r}=$e.getNestedSelectionJSONFromMainSelectionJSON(t);if(!r)continue;r.getEditorState().read(()=>{let n=$e.JSONToLexical(f);if(n)try{this.paintSingleRemoteSelection({editor:r,selectionJSON:t,lexicalSelection:n,selectedNodes:n.getNodes(),isBackward:n.isBackward()})}catch(e){le.warn("[PAINT REMOTE SELECTION] failed for nested editor - ",{error:e,nestedSelectionJSON:f,fullSelection:t,lexicalSelection:n})}else le.error("DEBUGGER: [paintRemoteSelections] nested selection from json to lexical is null: ",{selection:t,nestedSelectionJSON:f,lexicalSelection:n})})}else{let f=$e.JSONToLexical(t);if(!f){le.error("DEBUGGER: [paintRemoteSelections] selection from json to lexical is null: ",{selection:t,lexicalSelection:f});continue}try{this.paintSingleRemoteSelection({editor:we.getMainEditor(),selectionJSON:t,lexicalSelection:f,selectedNodes:f.getNodes(),isBackward:f.isBackward()})}catch(r){le.warn("[PAINT REMOTE SELECTION] failed - ",{error:r,fullSelection:t,lexicalSelection:f})}}})}updateRemoteSelections(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";this.shouldUpdateRemoteSelections(d)&&(le.log("[updateRemoteSelections] "+g,{newRemoteSelections:d}),Promise.resolve().then(()=>{this.paintRemoteSelections(d),this.hideInUI&&this.hideRemoteSelectionsFromUI()}))}clear(){this.gcPrevPaintedRemoteSelections()}getCurrentRemoteSelections(){return this.remoteSelections}hideRemoteSelectionsFromUI(){this.hideInUI||(this.hideInUI=!0);const d=document.querySelectorAll(".codox_remote_selection");for(let g of d)g.classList.add("hidden_codox_remote_selection")}showHiddenRemoteSelectionsInUI(){this.hideInUI=!1;const d=document.querySelectorAll(".hidden_codox_remote_selection");for(let g of d)g.classList.remove("hidden_codox_remote_selection")}}const vo=new iw;function aw(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).findIndex(y=>y===Sa.editorState)}function _u(y){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,g=we.getMainEditorNodesClassesMap();const{klass:t}=g.get(y.type)||{};if(!t)return;const f=t.importJSON(y);if(y.children&&y.children.length)for(const r of y.children)_u(r,f);return d&&d.getChildrenSize&&d.splice(d.getChildrenSize(),0,[f]),f}function xu(y){if(y.getChildren)for(let d of y.getChildren())xu(d);y.remove()}function C0(y){y.__parent=null,y.__next=null,y.__prev=null}function E0(y,d){return!!we.isLexicalEditorInstance(y)&&!(typeof d!="object"||!d.editorState||(y.update(()=>{try{let g=(0,be.$getSelection)();const t=y.parseEditorState(d.editorState);if(t.isEmpty())return(0,be.$getRoot)().clear(),!0;(0,be.$setSelection)(g),y.setEditorState(t)}catch(g){le.error("[stateUpdates][updateNestedEditorState] update nested state and selection error: ",g)}}),0))}function sw(y,d){let g=d;for(const t of y)g=g[t];return g}function Ea(y){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,g=arguments.length>2&&arguments[2]!==void 0&&arguments[2],t=null,f=sw(y,g?d:we.getMainEditorState().toJSON());return f&&(t=ka(f)?(0,be.$getRoot)():jn.get(f.codoxId)),t||le.debug("[WARNING][getLexicalNodeByPathOutOfJSONState] lexical node not found: ",{jsonNode:f,lexicalNode:t,pathArray:y,currentStateJSON:we.getMainEditorState().toJSON(),newStateJSON:d,codoxNodes:jn.nodesToArray(),searchInNewState:g}),t||(g?t:Ea(y,d,!0))}function k0(y){le.log("[applyFullLexicalStateReplace] clear current state and apply new");const d=(0,be.$getRoot)();d.clear();let g=we.getMainEditorNodesClassesMap();function t(f){const r=g.get(f.type).klass.importJSON(f);if(f.children)for(const n of f.children)r.append(t(n));return r}for(const f of y.root.children)d.append(t(f))}function lw(y){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(d.length){le.log("[applyDeltasToLexicalState] Original Deltas: ",{newStateJSON:y,deltas:JSON.parse(JSON.stringify(d))});for(const g of d){let{p:t}=g;const f=t[t.length-1],r=f==="children",n=typeof f=="number",e=!n&&!r,s=aw(t),i=s!==-1,l=g.hasOwnProperty("lm")&&typeof g.lm=="number";if(t.length)if(i){let o=s-1,a=Ea(t.slice(0,o),y);if(a){let c=t.slice(0,s),u=y;for(const p of c)u=u[p];let h=Ll(t[o]);E0(a.getWritable()[h],u)}}else{if(r){let o=g.oi;if(!o){le.warn("[applyDeltasToLexicalState][====WARNING====] SKIPPED. Delta oi attr expected for path",{delta:g});continue}if(o.some(c=>!(!c.hasOwnProperty("text")||typeof c.text=="string"))){le.warn("[applyDeltasToLexicalState][====WARNING====] SKIPPED. Delta oi children contain invalid text value",{delta:g});continue}t.length=t.length-1;let a=Ea(t,y);if(!a)continue;if(o.some(c=>!!c.codoxDId)){try{a=a.getWritable()}catch(p){le.debug("[applyDeltasToLexicalState][shouldUpdateLeaves] getWritable error: ",{err:p,delta:g,fullStateJSON:y});continue}let c={};for(let p of a.getChildren())p.codoxDId?c[p.codoxDId]=p:xu(p);let u=[],h=["codoxDId","codoxId","__key","__parent","__prev","__next"];for(let p=0;p<o.length;p++){let m=o[p],b=p===0,_=p===o.length-1,v=null,w=p>=0?u[p-1]:null;if(m.codoxDId){let x=c[m.codoxDId];if(x){x=x.getWritable();let S=_u(m);if(le.debug("[DELTA_DECORATOR_UPDATE]: ",{exisingDecorator:x,tmpDecorator:S}),!S){le.debug("[DELTA_DECORATOR_UPDATE] UPADATE SKIPPED: ",{exisingDecorator:x,tmpDecorator:S});continue}for(let E in S)if(S.hasOwnProperty(E)&&!h.includes(E))if(we.isLexicalEditorInstance(S[E])){let k={editorState:S[E].getEditorState().toJSON()};E0(x[E],k)}else{let k=Ff(E),D=m[k];if(D===x[E]||!m.hasOwnProperty(k))continue;let P=D!==void 0&&S[E]!==D?D:S[E];k!=="height"&&k!=="width"||S[E]==="inherit"&&D===0&&(P=S[E]),x[E]=P}S.remove(),C0(x),v=x,delete c[m.codoxDId]}}v||(v=_u(m),v.codoxDId&&v.__type==="excalidraw"&&v.__data==="[]"&&(v.__data="{}")),v=v.getWritable(),u.push(v),v.__parent=a.__key,b?(a.__first=v.__key,v.__prev=null,_&&(a.__last=v.__key)):_?(a.__last=v.__key,v.__next=null,v.__prev=w.__key,w.__next=v.__key):(v.__prev=w.__key,w.__next=v.__key),a.__size=u.length}for(let p in c){let m=c[p];m=m.getWritable(),C0(m),xu(m),delete c[p]}}else{let c=o.map(u=>_u(u));a.splice(0,a.getChildrenSize(),c)}}if(n){if(g.ld){const o=g.ld,a=jn.get(o.codoxId);a.getChildrenSize&&a.getChildrenSize()?xu(a):a.remove()}if(g.li){let o=we.getMainEditorNodesClassesMap();const a=g.li,c=o.get(a.type).klass.importJSON(a);if(t.length===1&&t[0]==="root")(0,be.$getRoot)().splice(0,0,[c]);else{const u=t[t.length-1];t.length=t.length-2;let h=Ea(t,y);h&&h.splice(u,0,[c])}if(a.children&&a.children.length){let u=function(h,p){const m=o.get(h.type).klass.importJSON(h);if(p.splice(p.getChildrenSize(),0,[m]),h.children&&h.children.length)for(const b of h.children)u(b,m)};for(const h of a.children)u(h,c)}}if(g.oi||g.od){let{p:o,oi:a,od:c}=g,u=Ea(o,y);if(u)try{let h=u.getWritable();if(a){let p=Object.keys(a);for(let m of p)h[Ll(m)]=a[m]}if(c){let p=Object.keys(c);for(let m of p)delete h[Ll(m)]}}catch(h){le.debug("[applyDeltasToLexicalState][delta oi/od] getWritable error: ",{err:h,delta:g})}}if(l){let{p:o,lm:a}=g,c=o[o.length-1],u=a,h=u<c,p=Ea(o,y);if(p){let m=p.getParent().getChildren(),b=m[c],_=m[u];h?_.insertBefore(b):_.insertAfter(b)}}}if(e){const o=t[t.length-1];let a=Ll(o);t.length=t.length-1;let c,u=Ea(t,y);if(!u){le.error("Missing node when update node attr from delta: ",{path:t,delta:g,fullStateJSON:y,currentEditorState:we.getMainEditorState().toJSON()});continue}try{c=u.getWritable()}catch(p){le.debug("[applyDeltasToLexicalState][shouldUpdateBlockAttr] getWritable error: ",{err:p,delta:g})}if(!c)continue;let h=g.oi;if(o==="format"&&(h=sx(h)),o==="direction"&&(u.hasOwnProperty(a)||(a="__dir")),!c.hasOwnProperty(a)){let p=Object.keys(c);for(let m of p){let b=Ff(m);if(o.startsWith(b)){a=m;break}}}c[a]=h}}else if(g.oi&&g.oi.root)return k0(g.oi)}}else le.log("[applyDeltasToLexicalState] stop, no deltas: ",d)}function cw(y){let d=y.clipboardData.getData(cx.paste),g=!1;try{d=JSON.parse(d),typeof d=="object"&&d.nodes&&Array.isArray(d.nodes)&&(g=!0)}catch{return!1}if(!g)return!1;if(g){jn.clearPastedIds();const t=f=>{if(f.codoxId&&jn.addPastedId(f.codoxId),f.children&&f.children.length)for(const r of f.children)t(r)};for(const f of d.nodes)t(f)}return!1}var uw=y=>{var d={};return on.d(d,y),d};const O0=uw({useCollaborationContext:()=>w_});var dw=y=>{var d={};return on.d(d,y),d};const Fi=dw({LexicalComposerContext:()=>Ef,useLexicalComposerContext:()=>jr});class T0{constructor(){this.blacklist=Object.keys(s0).reduce((d,g)=>{let t=s0[g];return d[g]=t.reduce((f,r)=>(f[r]=r,f),{}),d},{}),this._isBlacklistedFound=!1,this._clientCallback=null}_shouldSkipNode(d){return d instanceof be.TextNode||d instanceof be.ParagraphNode||d instanceof be.RootNode}setClientCallback(d){this._clientCallback=d}removeClientCallback(){this._clientCallback=null}invokeClientCallback(){this._clientCallback&&this._clientCallback()}trackBlacklisted(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2?arguments[2]:void 0;if(Jf||g!==Jr.created||this._isBlacklistedFound||!d||!d.__type||this._shouldSkipNode(d))return;let f=t||we.getMainEditorState(),r=d.__type,n=this.blacklist[r];n&&f.read(()=>{let e=d.getParent();for(;e!==null;){let s=e?e.__type:null;if(!s)return;if(n[s])return le.warn("[ContentNestingsWatcher][trackBlacklisted] FOUND: ",{targetNode:d,targetType:r,parent:e,parentType:s,mutationType:g}),void(this._isBlacklistedFound=!0);e=e.getParent()}})}trackBlacklistedInNestedEditor(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>3?arguments[3]:void 0;if(g!==Jr.created||this._isBlacklistedFound||this._shouldSkipNode(d))return;let f=t.__type,r=d.__type;if(!f||!r)return;let n=this.blacklist[r];n&&n[f]&&(this._isBlacklistedFound=!0,le.warn("[ContentNestingsWatcher][trackBlacklistedInNestedEditor] FOUND: ",{targetNode:d,targetType:r,rootNode:t,rootType:f,mutationType:g}))}isBlacklistedFound(){let d=this._isBlacklistedFound;return d&&(this._isBlacklistedFound=!1),d}}const fw=new T0,zi=fw,pw=["editorState","prevEditorState","dirtyElements","dirtyLeaves"];function hw(y,d){if(y==null)return{};var g,t,f=gw(y,d);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(y);for(t=0;t<r.length;t++)g=r[t],d.indexOf(g)>=0||{}.propertyIsEnumerable.call(y,g)&&(f[g]=y[g])}return f}function gw(y,d){if(y==null)return{};var g={};for(var t in y)if({}.hasOwnProperty.call(y,t)){if(d.indexOf(t)>=0)continue;g[t]=y[t]}return g}class mw{constructor(){this.nestedEditorsListenersMap={}}_createNestedEditorUpdatesListener(d,g){let t=!1;return function(f){let{editorState:r,prevEditorState:n,dirtyElements:e,dirtyLeaves:s}=f,i=(hw(f,pw),we.getMainEditor()),l=we.getMainEditorState(),o=r.toJSON(),a=n.toJSON(),c=Hf(o,a),u=r._selection,h=n._selection,p=!1,m=null,b=we.isOnlySelectionChanged(e,s),_=d[g];if(le.debug("[NESTED EDITOR LISTENER] invoked: ",{lexicalNode:d,key:d.__key,onlySelectionChanged:b,newEditorStateJSON:o,prevEditorStateJSON:a,isSameState:c,lexicalSelection:u,prevLexicalSelection:h,mainDirtyLeaves:i._dirtyLeaves.size,mainDirtyElements:i._dirtyElements.size,nestedDirtyLeaves:_._dirtyLeaves.size,nestedDirtyElements:_._dirtyElements.size,nestedEditorKey:_._key}),zi.isBlacklistedFound())return t=!0,le.debug("[NESTED EDITOR LISTENER] BLACKLISTED FOUND - revert to prev state"),we.scanLexicalNodeForNestedEditorAttribute(d)?(_.update(()=>{try{const v=_.parseEditorState(a);if(v.isEmpty())return(0,be.$getRoot)().clear(),!0;_.setEditorState(v)}catch(v){le.error("[NESTED EDITOR LISTENER] BLACKLISTED FOUND - ROLLBACK ERROR: ",v)}}),void zi.invokeClientCallback()):void 0;if(t)t=!1;else{if(d.codoxId||d.codoxDId){let v=null;l.read(()=>{v=$e.getNodeAncestorsCodoxIds(d),!d.codoxId&&d.codoxDId&&v.push(d.codoxDId)}),r.read(()=>{let w=Ff(g),x=$e.lexicalToJSONNested(u,w,v);m=we.getCurrentNestedSelectionJSON(),p=$e.equalSelectionsJSON(m,x),p||we.setNestedSelectionJSON(x)})}c&&p||i.update(()=>{try{le.debug("[NESTED EDITOR LISTENER] MARKING DIRTY TO TRIGGER UPDATE",{mainTags:i._updateTags,nestedTags:_&&_._updateTags,isSameState:c,isSameSelection:p,onlyNestedSelectionChanged:b,mainDirtyLeaves:i._dirtyLeaves.size,mainDirtyElements:i._dirtyElements.size,nestedDirtyLeaves:_._dirtyLeaves.size,nestedDirtyElements:_._dirtyElements.size,lexicalNode:d,lexicalSelection:u,prevLexicalSelection:h,mainEditorTags:i._updateTags,mainEditorTagsSize:i._updateTags.size}),we.addUpdateTag({fromNestedEditor:!0}),d.markDirty()}catch(v){le.error("[NESTED EDITOR LISTENER] MARKING DIRTY TO TRIGGER UPDATE - ERROR: ",v)}})}}}_isNestedEditorManaged(d){return!!this.nestedEditorsListenersMap[d]}gc(){for(let d in this.nestedEditorsListenersMap)if(!we.getLexicalNodeByKey(d)){let g=this.nestedEditorsListenersMap[d];g&&g(),delete this.nestedEditorsListenersMap[d]}}manageNestedEditorInLexicalNode(d){if(this._isNestedEditorManaged(d.getKey()))return;let g=we.scanLexicalNodeForNestedEditorAttribute(d);if(g){let t=d[g],f=this._createNestedEditorUpdatesListener(d,g),r=[];t._nodes.forEach((s,i,l)=>{let{klass:o}=s,a=t.registerMutationListener(o,c=>{for(let[u,h]of c)if(h===Jr.created){let p=t.getEditorState()._nodeMap.get(u);p&&zi.trackBlacklistedInNestedEditor(p,h,t.getEditorState(),d)}});r.push(a)});let n=(0,bs.mergeRegister)(t.registerUpdateListener(f),...r),e=d.getKey();this.nestedEditorsListenersMap[e]=n}}gcNestedEditorListenerInLexicalNode(d){let g=d.getKey(),t=this.nestedEditorsListenersMap[g];t&&(t(),delete this.nestedEditorsListenersMap[g])}manageNestedEditorInClonedLexicalNode(d,g){let t=d.getKey();t!==g.getKey()&&this._isNestedEditorManaged(t)&&(this.gcNestedEditorListenerInLexicalNode(d),this.manageNestedEditorInLexicalNode(g))}setNestedEditorSelection(d){let{nestedSelectionJSON:g,nestedEditor:t}=$e.getNestedSelectionJSONFromMainSelectionJSON(d);if(!t)return!1;let f=!0;return t.update(()=>{try{let r=$e.JSONToLexical(g);(0,be.$setSelection)(r),le.debug("[setNestedEditorSelection]: lexical nested selection: ",r)}catch(r){le.error("[setNestedEditorSelection] set nested selection error: ",r),f=!1}}),f}clearListeners(){for(let d in this.nestedEditorsListenersMap){let g=this.nestedEditorsListenersMap[d];g&&g(),delete this.nestedEditorsListenersMap[d]}}}const yw=new mw,si=yw,bw=function(y){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];try{let g=(0,be.createEditor)({namespace:"validation",nodes:[...d],onError:e=>{throw e},parentEditor:null});const t=new T0,f=g.parseEditorState(y);if(f.isEmpty())return;g.setEditorState(f);let r=g.getEditorState();const n=r._nodeMap[Symbol.iterator]();for(const e of n){let[s,i]=e;if(i&&(t.trackBlacklisted(i,Jr.created,r),t.isBlacklistedFound()))throw new Error(ux)}}catch(g){throw g}};class vw{constructor(){this.removeCandidateTableKeys=new Set,this.validateTableCandidateKeys=new Set,this.tableFixActions=[]}_scanForCellHeaderState(d,g,t,f){if(g.length<f)return null;let r,n=g.some(s=>s.__headerState===Li.BOTH||s.__headerState===Li.ROW),e=d.some((s,i)=>{if(s.__size<f)return!1;let l=s.getChildAtIndex(t);return!(!l||l.__headerState!==Li.BOTH&&l.__headerState!==Li.COLUMN)});return n&&e?r=Li.BOTH:n&&!e?r=Li.ROW:e&&!n&&(r=Li.COLUMN),r}_isValidCellChildren(d){for(let g of d)if(Cs(g)||!Ss(g)&&En(g))return!1;return!0}_createEmptyCell(){let d=(0,kn.$createTableCellNode)();return d.append((0,be.$createParagraphNode)()),d}_wrapInvalidCellChildrenIntoParagraph(d){let g=(0,be.$createParagraphNode)().getWritable(),t=d.getChildren();(d=d.getWritable()).__first=g.__key,d.__last=g.__key,d.__size=1,g.__parent=d.__key,t.forEach((f,r)=>{(f=f.getWritable()).__parent=null,g.append(f)})}_createFixAction_APPEND_CELLS_TO_ROW(d,g){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - APPEND_CELLS_TO_ROW] invoked: ",{rowKey:d,numOfCellsToAppend:g});let t=(0,be.$getNodeByKey)(d);for(;g;){let f=(0,kn.$createTableCellNode)().append((0,be.$createParagraphNode)());f.setRowSpan(1).setColSpan(1),t.append(f),g--}}}_createFixAction_ADD_PARAGRAPH_TO_EMPTY_CELL(d){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - ADD_PARAGRAPH_TO_EMPTY_CELL] invoked: ",{cellKey:d}),(0,be.$getNodeByKey)(d).append((0,be.$createParagraphNode)())}}_createFixAction_WRAP_CELL_CHILDREN_IN_PARAGRAPH(d){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - WRAP_CELL_CHILDREN_IN_PARAGRAPH] invoked: ",{cellKey:d});let g=(0,be.$getNodeByKey)(d);this._wrapInvalidCellChildrenIntoParagraph(g)}}_createFixAction_ADD_ROW_CELL_TO_TABLE_NODE(d){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - ADD_ROW_CELL_TO_EMPTY_TABLE_NODE] invoked: ",{tableKey:d});let g=(0,be.$getNodeByKey)(d),t=(0,kn.$createTableRowNode)();t.append(this._createEmptyCell()),g.append(t)}}_createFixAction_ADD_CELL_TO_EMPTY_ROW_NODE(d,g){return()=>{for(g||(g=1);g;)(0,be.$getNodeByKey)(d).append(this._createEmptyCell()),g--}}_createFixAction_WRAP_INVALID_ROW_NODE(d,g){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - WRAP_INVALID_ROW_NODE] invoked: ",{tableKey:d,rowKey:g});let t=(0,be.$getNodeByKey)(d);if(!t)return;let f=(0,be.$getNodeByKey)(g);if(!f)return;t=t.getWritable(),f=f.getWritable();let r=f.getPreviousSibling(),n=f.getNextSibling();f.__parent=null,f.__prev=null,f.__next=null;let e=(0,kn.$createTableRowNode)();if((0,kn.$isTableCellNode)(f))f.getChildren().length?this._isValidCellChildren()||this._wrapInvalidCellChildrenIntoParagraph(f):f.append((0,be.$createParagraphNode)()),e.append(f);else{let s=this._isValidCellChildren([f]),i=(0,kn.$createTableCellNode)();if(e.append(i),s)i.append(f);else{let l=(0,be.$createParagraphNode)();l.append(f),i.append(l)}}e.__parent=t.__key,t.__first===f.__key&&(t.__first=e.__key),t.__last===f.__key&&(t.__last=e.__key),r&&(r=r.getWritable(),r.__next=e.__key,e.__prev=r.__key),n&&(n=n.getWritable(),n.__prev=e.__key,e.__next=n.__key)}}_createFixAction_WRAP_INVALID_CELL_NODE(d,g){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - WRAP_INVALID_CELL_NODE] invoked: ",{rowKey:d,cellKey:g});let t=(0,be.$getNodeByKey)(d);if(!t)return;let f=(0,be.$getNodeByKey)(g);if(f.remove(),f=(0,be.$createParagraphNode)(),!f)return;t=t.getWritable(),f=f.getWritable();let r=f.getPreviousSibling(),n=f.getNextSibling(),e=(0,kn.$createTableCellNode)();if(e.__parent=t.__key,t.__first===f.__key&&(t.__first=e.__key),t.__last===f.__key&&(t.__last=e.__key),r&&(r=r.getWritable(),r.__next=e.__key,e.__prev=r.__key),n&&(n=n.getWritable(),n.__prev=e.__key,e.__next=n.__key),f.__parent=null,f.__prev=null,f.__next=null,this._isValidCellChildren([f]))e.append(f);else{let s=(0,be.$createParagraphNode)();s.append(f),e.append(s)}}}_createFixAction_APPLY_HEADER_STATE_TO_CELL(d,g){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - APPLY_HEADER_STATE_TO_CELL] invoked: ",{cellKey:d,headerStateToApply:g});let t=(0,be.$getNodeByKey)(d);t&&(t=t.getWritable(),t.__headerState=g)}}clear(){this.removeCandidateTableKeys=new Set,this.validateTableCandidateKeys=new Set,this.tableFixActions=[]}tableRemoveEventListener(d){let g=we.getMainEditorState()._selection;if(le.debug(`[${d}]`,{selection:g}),!(0,be.$isRangeSelection)(g))return;let t=[];try{let f=we.getLexicalNodeByKey(g.anchor.key),r=we.getLexicalNodeByKey(g.focus.key);f&&r&&(t=g.isBackward()?r.getNodesBetween(f):f.getNodesBetween(r))}catch(f){le.warn("[TablesValidator][tableRemoveEventListener] get range selection nodes internal lexical error: ",f)}t.forEach(f=>{(0,kn.$isTableNode)(f)&&this.removeCandidateTableKeys.add(f.__key)})}tableNodeRemoveListener(d){this.removeCandidateTableKeys.has(d)&&this.removeCandidateTableKeys.delete(d)}shouldGCRemovedTables(){return!!this.removeCandidateTableKeys.size}gcRemovedTables(){le.debug("[TablesValidator][gcRemovedTable] candidate table keys ",{tableKeys:this.removeCandidateTableKeys}),we.getMainEditor().update(()=>{Array.from(this.removeCandidateTableKeys).forEach(d=>{let g=(0,be.$getNodeByKey)(d);g&&g.remove()}),this.removeCandidateTableKeys.clear(),(0,be.$addUpdateTag)(no.historic)})}tableUpdateListener(d){this.validateTableCandidateKeys.add(d)}tableRowNodeChangesListener(d){let g=arguments.length>1&&arguments[1]!==void 0&&arguments[1],t=we.getLexicalNodeByKey(d);if(!t)return void(g&&le.debug("[TablesValidator][tableRowNodeChangesListener] no row node found in lexical: ",{tableRowNodeKey:d}));let f=t.__parent;f?this.validateTableCandidateKeys.add(f):le.debug("[tableRowNodeChangesListener] no parent table for row node found in lexical: ",{rowNode:t})}tableCellNodeChangesListener(d){let g=we.getLexicalNodeByKey(d);if(!g||!g.__parent)return;let t=we.getLexicalNodeByKey(g.__parent);t&&t.__parent&&this.validateTableCandidateKeys.add(t.__parent)}shouldValidateUpdatedTables(){return!!this.validateTableCandidateKeys.size}validateUpdatedTables(){let d=Array.from(this.validateTableCandidateKeys);return we.getMainEditorState().read(()=>{for(let g of d){let t=we.getLexicalNodeByKey(g);if(!t)continue;let f=t.getChildren();if(!f.length){this.tableFixActions.push(this._createFixAction_ADD_ROW_CELL_TO_TABLE_NODE(g));continue}let r=0;f.forEach(i=>{i.__size>r&&(r=i.__size)});let n=[],e=f.map((i,l)=>{if(!(0,kn.$isTableRowNode)(i))return this.tableFixActions.push(this._createFixAction_WRAP_INVALID_ROW_NODE(g,i.__key)),"invalid_row_node";let o=i.getChildren();if(!o.length&&!n.length)return this.tableFixActions.push(this._createFixAction_ADD_CELL_TO_EMPTY_ROW_NODE(i.__key,r)),"empty_row_should_add_cell";if(!o.length&&n.length)return n=[],"empty_row_should_be_empty";let a=0;if(n.length){let u=[];n.forEach(h=>{let[p,m]=h;a+=m,p--,p&&u.push([p,m])}),n=[...u]}let c=o.map((u,h)=>{if(!(0,kn.$isTableCellNode)(u))return this.tableFixActions.push(this._createFixAction_WRAP_INVALID_CELL_NODE(i.__key,u.__key)),a++,"invalid_cell_node_should_wrap_in_cell";let p,m=u.getChildren(),b=!m.length;if(b?this.tableFixActions.push(this._createFixAction_ADD_PARAGRAPH_TO_EMPTY_CELL(u.__key)):(p=this._isValidCellChildren(m),p||this.tableFixActions.push(this._createFixAction_WRAP_CELL_CHILDREN_IN_PARAGRAPH(u.__key))),u.__rowSpan>1){let _=u.__rowSpan,v=u.__colSpan;n.push([_-1,v])}if(a+=u.__colSpan,u.__headerState===Li.NO_STATUS){let _=this._scanForCellHeaderState(f,o,h,r);_&&this.tableFixActions.push(this._createFixAction_APPLY_HEADER_STATE_TO_CELL(u.__key,_))}return{cellKey:u.__key,rowKey:i.__key,tableKey:g,colSpan:u.__colSpan,rowSpan:u.__rowSpan,headerState:u.__headerState,childrenAreValid:p,isEmptyCell:b}});if(a<r){let u=r-a;this.tableFixActions.push(this._createFixAction_APPEND_CELLS_TO_ROW(i.__key,u))}return{realRowLength:a,rowKey:i.__key,tableKey:g,cells:c}}),s=!this.tableFixActions.length;le[s?"debug":"warn"](`[TablesValidator][validateUpdatedTables] IS TABLE VALID: ${s}`,{tableNodeKey:g,tableValidationMatrix:e,requiredRowLength:r}),this.validateTableCandidateKeys.delete(g)}}),!this.tableFixActions.length}shouldFixTablesStructure(){return!!this.tableFixActions.length}fixTablesStructure(){if(!this.tableFixActions.length)return;let d=we.getMainEditor();le.log("[TablesValidator][fixTablesStructure]: fix actions to apply - count: ",this.tableFixActions.length),d.update(()=>{for(let g of this.tableFixActions)g();this.tableFixActions=[],(0,be.$addUpdateTag)(no.historic)})}ensureDocTablesAreValid(d){return this.shouldGCRemovedTables()?(le.warn("[TablesValidator][GARBAGE COLLECT TABLE NODES AFTER TABLE REMOVAL ATTEMPT]"),this.gcRemovedTables(),!1):!(this.shouldValidateUpdatedTables()&&(le.debug("[TablesValidator][shouldValidateUpdatedTables] invoked"),!this.validateUpdatedTables()))||(le.warn("[TablesValidator][shouldValidateUpdatedTables] INVALID LEXICAL TABLE(S) STRUCTURE FOUND - FIXING",{state:JSON.parse(JSON.stringify(d.toJSON()))}),this.fixTablesStructure(),!1)}}const No=new vw,_w=["contentChanged"],xw=["state","remoteSelection"];function j0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function xs(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?j0(Object(g),!0).forEach(function(t){ww(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):j0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function ww(y,d,g){return(d=Sw(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function Sw(y){var d=Cw(y,"string");return typeof d=="symbol"?d:d+""}function Cw(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}function A0(y,d){if(y==null)return{};var g,t,f=Ew(y,d);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(y);for(t=0;t<r.length;t++)g=r[t],d.indexOf(g)>=0||{}.propertyIsEnumerable.call(y,g)&&(f[g]=y[g])}return f}function Ew(y,d){if(y==null)return{};var g={};for(var t in y)if({}.hasOwnProperty.call(y,t)){if(d.indexOf(t)>=0)continue;g[t]=y[t]}return g}const Jf={DEBUG:!1,VERSION:"1.0.2",NAME:"@codoxhq/lexical-provider",SDKUI_SOURCE_PATH:"../../../sdkui/dist-production2/codox.bundle.js"}.LOCAL==="true";le.info("MODE: ","production");const kw=y=>async()=>{const{state:d,timestamp:g}=await y();if(!we.isValidJSONState(d))throw new Error("Invalid state received from fetchDocOnNetworkReconnect hook");const{commentThreads:t,root:f}=d,r={content:{comments:t,root:f},timestamp:g};return le.info("[decorateFetchOnReconnctHook] hook invoked: ",{returnObj:r}),r};let wu=0,li=null,Vf=!1,_o={},Wf={};const Ow=(0,Gt.forwardRef)((y,d)=>{let{onBlacklistedInsert:g}=y;const t=(0,Gt.useContext)(Fi.LexicalComposerContext);if(!t)throw new Error("[CodoxCollabPlugin] CodoxCollabPlugin must be inited inside <LexicalComposer> component - LexicalComposerContext is missing");const[f]=(0,Fi.useLexicalComposerContext)(),r=(0,O0.useCollaborationContext)();(0,Gt.useEffect)(()=>{if(le.debug("[INIT] lexical context check: ",{lexicalContext:t,editor:f}),!f)return;le.log("[useEffect][editor] Editor instance changed: ",{editor:f,key:f._key}),we.setMainEditor(f),jn.gcAbandonedNodes(),si.gc(),No.clear(),le.log("[useEffect][editor] subscribe to editor changes");const b=(0,bs.mergeRegister)(f.registerUpdateListener(h),f.registerCommand(be.PASTE_COMMAND,cw,be.COMMAND_PRIORITY_CRITICAL),f.registerCommand(be.UNDO_COMMAND,()=>{we.setUndoInvoked(!0)},be.COMMAND_PRIORITY_CRITICAL),f.registerCommand(be.REDO_COMMAND,()=>{we.setRedoInvoked(!0)},be.COMMAND_PRIORITY_CRITICAL),f.registerCommand(be.KEY_DELETE_COMMAND,(v,w)=>{No.tableRemoveEventListener("KEY_DELETE_COMMAND")},be.COMMAND_PRIORITY_CRITICAL),f.registerCommand(be.KEY_BACKSPACE_COMMAND,(v,w)=>{No.tableRemoveEventListener("KEY_BACKSPACE_COMMAND")},be.COMMAND_PRIORITY_CRITICAL),f.registerCommand(be.CUT_COMMAND,(v,w)=>{No.tableRemoveEventListener("CUT_COMMAND")},be.COMMAND_PRIORITY_CRITICAL),...p());vo.mount(),we.alignStateSelectionJSONsFromLatestEditor(),le.debug("New editor mounted: ",{isCodoxStarted:we.isCodoxStarted,codoxLexicalEditorManager:we,nestedEditorsProcessor:si});let _=f._onError;return f._onError=v=>{le.error("[ERROR HANDLER WRAPPER] error from editor: ",v),_&&_(v),u()},g&&zi.setClientCallback(g),()=>{we.getMainEditorKey()&&(le.debug("Unmount prev editor"),b(),we.removeMainEditor(),vo.unmount(),we.clearJSONs(),Cn.clear(),No.clear(),we.isCodoxStarted&&(le.debug("EDITOR USE_EFFECT stopping codox"),n(),we.setIsCodoxStarted(!1)),zi.removeClientCallback())}},[f]);const n=()=>{we.isCodoxStarted&&(le.log("[stopCodoxInstance] stopping codox"),we.setIsCodoxStarted(!1),Jf||ti().stop(),we.clearJSONs(),jn.clearAll(),vo.clear(),Cn.resetComments(),si.clearListeners())},e=async b=>{le.debug("[startCodoxInstance] invoked"),ti().createNewInstance(),le.debug("[startCodoxInstance] instance created");for(let O in Wf)ti().instance.on(O,Wf[O]);if(le.debug("[startCodoxInstance] events subscribed"),_o=b,li=_o.docId,!li)return le.error("[startCodoxInstance] - start codox skipped - docId is missing",{docId:li});let _=Cn.initialCommentsExist();le.debug("[startCodoxInstance] initCommentsExist: ",_),_&&(Cn.activateInitialComments(f,jn),le.log("[activateInitialComments] "));let v=we.getMainEditorState().toJSON();if(!we.isValidJSONState(v))throw le.error("[startCodoxInstance] - start codox skipped - invalid init state",{docId:li,initJSONState:v}),new Error("start codox skipped - invalid init state");le.log("[startCodoxInstance] starting codox with: ",{docId:li,initJSONState:v,config:_o,codoxComments:Cn}),we.currentContentStateJSON||we.setCurrentContentStateJSON(v),we.isCodoxStarted&&n();let{username:w,apiKey:x,getServerState:S,domain:E="",demo:k=!1,hooks:D}=_o;D&&D.fetchDocOnNetworkReconnect&&(D.fetchDocOnNetworkReconnect=kw(D.fetchDocOnNetworkReconnect));const P=A0(D,_w);await ti().start(ti().createConfig(xs(xs({},_o),{},{docId:li,username:w,apiKey:x,domain:E,hooks:xs({syncState:l,getState:i,getServerState:async()=>await S(li)},P),editorInstanceHooks:{getSelection:()=>we.getCurrentActiveSelectionJSON(),setSelection:O=>o(O),getState:i,setState:O=>{const{root:R,comments:A}=O;le.info("DEBUG: EDITOR INSTANCE setState:",{fullState:O}),a({state:{root:R},selection:we.getCurrentActiveSelectionJSON()},vo.getCurrentRemoteSelections()),Cn.setAllComments(A)},enableEditor:()=>{we.disableEditorReadOnlyMode()},disableEditor:()=>{we.enableEditorReadOnlyMode(),vo.updateRemoteSelections([])},getContent:()=>{let O=we.composeFullStateWithRootAndComments();return le.info("[getContent]: ",O),{state:O}}},appServer:_o.appServer,demo:k}))),le.log("[startCodoxInstance] codox started - first sync invoking"),we.setIsCodoxStarted(!0),r.clientID=_o.username,r.name=_o.username,c()},s=()=>{let b=we.composeFullStateWithRootAndComments({directlyFromEditor:!0});e(b)},i=()=>({state:xs(xs({},we.getMainEditorState().toJSON()),{},{comments:Cn.getAllComments()}),docId:li}),l=b=>{if(!we.isCodoxStarted)return;le.log("[SYNC_STATE]: Before sync payload = ",b);const _=ti().sync({meta:b}),{state:v,remoteSelection:w=[]}=_,x=A0(_,xw);if(le.log("[SYNC_STATE]: After sync",{state:v,remoteSelection:w,rest:x}),!v)return le.error("[SYNC_STATE] abort apply - synced state is not valid - restarting codox"),s();const S=v.state;le.log("[SYNC_STATE] synced state: ",{synced:JSON.parse(JSON.stringify(S))});let{stateFromSync:E,commentsFromSync:k}=we.extractStateAndCommentsFromSynced(S);if(!we.isValidJSONState(E.state))return le.error("[SYNC_STATE] - invalid state from sync - local update skipped - restarting codox",{contentState:E.state}),s();a(E,w),Cn.setAllComments(k)},o=b=>{if(!we.isCodoxStarted||(le.log("[setLocalSelectionFromSync] synced selection: ",{syncedSelectionJSON:b}),!qf.validateJSONSelection(b,zf.local)))return;let _=we.getCurrentActiveSelectionJSON();if($e.equalSelectionsJSON(_,b))return void le.log("[setLocalSelectionFromSync] STOP - local and synced selections are equal");let v=$e.isNestedSelectionJSON(b);f.update(()=>{le.log("[setLocalSelectionFromSync] json selection to apply: ",{syncedSelectionJSON:b});const w=$e.JSONToLexical(b);if(le.log("[setLocalSelectionFromSync] lexical selection to apply: ",w),v){let x=si.setNestedEditorSelection(b);we.setNestedSelectionJSON(x?b:null)}else(0,be.$setSelection)(w),we.setMainSelectionJSON(b);le.log("[setLocalSelectionFromSync] selection updated. latest selection: ",{latestSelectionJSON:we.getCurrentActiveSelectionJSON()})})},a=function(){let{state:b,selection:_,stateReplace:v}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",S=we.getCurrentContentStateJSON();le.log("[updateEditor] invoked: ",{currentContentStateJSON:JSON.parse(JSON.stringify(S)),newStateJSON:JSON.parse(JSON.stringify(b)),newSelectionJSON:_,remoteSelection:w,stateReplace:v,editor:f}),_===void 0&&le.error("SELECTION FROm SYNC IS UNDEFINED - will default prev selection",_);const E=Hf(S,b),k=$e.equalSelectionsJSON(we.getCurrentActiveSelectionJSON(),_);f.update(()=>{if(we.addUpdateTag({isSameState:E,isSameSelection:k,updateTag:x}),v)le.log("[updateEditor] invoke full stateReplace after sync"),k0(b),S=we.setCurrentContentStateJSON(b),(0,be.$addUpdateTag)("codox_sync_state_changes"),le.log("[updateEditor] state updated: ",S);else{le.log("[updateEditor] invoke deltas diff");let P=ti().diff(S,b,{keyNames:{default:"codoxId"}});le.log("JSON_DIFF_ANALYSIS: ",{currentContentStateJSON:JSON.parse(JSON.stringify(S)),newStateJSON:b,deltas:P&&JSON.parse(JSON.stringify(P))}),P&&P.length&&(le.log("[updateEditor] apply deltas to lexical state"),lw(b,P),S=we.setCurrentContentStateJSON(b),(0,be.$addUpdateTag)("codox_sync_state_changes"),le.log("[updateEditor] state updated: ",S))}let D=$e.isNestedSelectionJSON(_);if(qf.validateJSONSelection(_,zf.local)||(_=we.getCurrentActiveSelectionJSON()),D){let P=si.setNestedEditorSelection(_);we.setNestedSelectionJSON(P?_:null),le.log("[updateEditor] nested selection updated",P?_:null)}else if(_!==void 0){const P=$e.JSONToLexical(_);le.log("[updateEditor] updated selection to apply: ",{isSameSelection:k,newSelectionJSON:_,lexicalSelection:P}),(0,be.$setSelection)(P),we.setMainSelectionJSON(_),le.log("[updateEditor] selection updated",_)}},{onUpdate:()=>{E||vo.updateRemoteSelections(w,"from onUpdate hook")}}),E&&vo.updateRemoteSelections(w,"from direct updateEditor")},c=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(!we.isCodoxStarted)return;le.log("[invokeSync] SYNC INVOKED ",{upd_call_counter:b});let _=we.composeFullStateWithRootAndComments();const v={docId:li,state:{state:_,selection:we.getCurrentActiveSelectionJSON()}};le.log("[codoxSync]: Before sync",{local:v,upd_call_counter:b}),le.log("[codoxSync]: Before sync state",JSON.parse(JSON.stringify(v.state)));let{state:w,remoteSelection:x=[],changes:S}=ti().sync({state:v,meta:{}});if(le.log("[codoxSync]: After sync",{afterSyncState:JSON.parse(JSON.stringify(w)),remoteSelection:x,changes:S}),!w)return le.error("[codoxSync] abort apply - synced state is not valid - restarting codox "),s();const E=w.state;le.log("[codoxSync]: synced state: ",JSON.parse(JSON.stringify(E)),b);let{stateFromSync:k,commentsFromSync:D}=we.extractStateAndCommentsFromSynced(E);if(!we.isValidJSONState(k.state))return le.error("[invokeSync] - invalid state from sync - local update skipped - restarting codox",{contentState:k.state}),s();a(k,x),Cn.setAllComments(D)},u=()=>{le.warn("[rollbackStateDuringUpdateError] rollback invoked"),le.log("[rollbackStateDuringUpdateError] values: ",{prevState:we.getPrevContentStateJSON(),currentState:we.getCurrentContentStateJSON(),prevSelection:we.getPrevMainSelectionJSON(),currentSelection:we.getCurrentActiveSelectionJSON(),codoxComments:Cn});let b=we.getPrevContentStateJSON(),_=we.getPrevMainSelectionJSON();a({state:b,selection:_},vo.getCurrentRemoteSelections(),no.historic);let v=we.undoInvoked(),w=we.redoInvoked();Cn.gcAbandonedNodeKeys(we.getMainEditorState()._nodeMap),v&&f.dispatchCommand(be.CAN_REDO_COMMAND,!1),w&&f.dispatchCommand(be.CAN_UNDO_COMMAND,!1)},h=b=>{let{editorState:_,prevEditorState:v,tags:w,dirtyElements:x,dirtyLeaves:S}=b;if(Vf)return Vf=!1,void le.debug("[editorUpdatesListener] invoked blacklisted queued selection change - stop");if(zi.isBlacklistedFound())return Vf=!0,le.warn("[editorUpdatesListener] BLACKLISTED CHANGES FOUND - revert back to prev state"),((W,G)=>{let F=null,q=null;G.read(()=>{F=$e.lexicalToJSON(G._selection),q=G.toJSON()});let T=null,I=null;W.read(()=>{let L=(0,be.$getSelection)();I=$e.lexicalToJSON(L),T=W.toJSON()}),we.setCurrentContentStateJSON(T),we.setMainSelectionJSON(I),a({state:q,selection:F},vo.getCurrentRemoteSelections(),no.historic),f.dispatchCommand(be.CAN_REDO_COMMAND,!1),f.dispatchCommand(be.CAN_UNDO_COMMAND,!1)})(_,v),void zi.invokeClientCallback();if(!No.ensureDocTablesAreValid(_))return;wu++,le.log("[editorUpdatesListener] invoked by lexical. call counter: ",{upd_call_counter:wu,isCodoxStarted:we.isCodoxStarted});let E=we.isOnlySelectionChanged(x,S),k=null,D=null,P=null,O=null,R=we.getCurrentContentStateJSON(),A=w.has("codox_sync_state_changes"),z=w.has(Bl),H=we.undoInvoked(),$=we.redoInvoked(),M=we.canUndo(),J=we.canRedo();k=_.toJSON(),D=v.toJSON(),v.read(()=>{O=$e.lexicalToJSON(v._selection)}),_.read(()=>{let W=(0,be.$getSelection)();P=$e.lexicalToJSON(W);let G=$e.JSONToLexical(P),F=W===null&&G===null||W.is(G);le.log("[editorUpdatesListener] new values: ",{newContentStateJSON:k,currentContentStateJSON:JSON.parse(JSON.stringify(R)),prevContentStateJSON:JSON.parse(JSON.stringify(D)),currentCommentsJSON:JSON.parse(JSON.stringify(Cn.getAllComments())),newSelectionJSON:JSON.parse(JSON.stringify(P)),currentMainSelectionJSON:JSON.parse(JSON.stringify(we.getCurrentMainSelectionJSON())),currentNestedSelectionJSON:JSON.parse(JSON.stringify(we.getCurrentNestedSelectionJSON())),currentActiveSelectionJSON:JSON.parse(JSON.stringify(we.getCurrentActiveSelectionJSON())),lexicalSelection:W,convertedBackMainSelection:G,isMainSelectionConvertionCorrect:F,nodes:f._editorState._nodeMap,fullEditor:f,codoxNodesMap:jn.toArray(),codoxComments:Cn,isUpdateFromSync:A,isUpdateFromComments:z,tags:w,onlySelectionChanged:E,undoInvoked:H,redoInvoked:$,canUndo:M,canRedo:J})});let K=Hf(R,k),N=$e.equalSelectionsJSON(we.getCurrentActiveSelectionJSON(),P);le.log("[editorUpdatesListener] compares: ",{isStateSame:K,isSelectionSame:N});let U=K&&N&&!z;if(!K||z||A){let W=xs({},K?R:k),G=Cn.getAllComments();G.length&&(W.commentThreads=G);let F={source:A?l0.remote:l0.local,content:W};_o.hooks&&_o.hooks.contentChanged&&_o.hooks.contentChanged(F),ti().instance.emit("content_changed",F)}if(U)le.log("[editorUpdatesListener] STOP - state and selection and comments are same ",wu);else if(we.undoInvoked()&&we.setUndoInvoked(!1),we.redoInvoked()&&we.setRedoInvoked(!1),we.setCurrentContentStateJSON(k),we.setPrevContentStateJSON(D),we.setMainSelectionJSON(P),we.setPrevMainSelectionJSON(O),Jf){let W=we.getCurrentActiveSelectionJSON();a({state:we.getCurrentContentStateJSON(),selection:W},[])}else c(wu)},p=()=>{let b=[];return we.getMainEditorNodesClassesMap().forEach((_,v,w)=>{let{klass:x}=_,S=f.registerMutationListener(x,E=>{for(let[k,D]of E){if(!Jr[D])continue;const P=we.getLexicalNodeByKey(k);if(D===Jr.created&&P&&zi.trackBlacklisted(P,D),x.name===kn.TableNode.name&&(D===Jr.destroyed?No.tableNodeRemoveListener(k):No.tableUpdateListener(k)),x.name===kn.TableRowNode.name&&D!==Jr.destroyed&&No.tableRowNodeChangesListener(k,D===Jr.updated),x.name===kn.TableCellNode.name&&D===Jr.updated&&No.tableCellNodeChangesListener(k),x.name===eo.MarkNode.name&&(le.debug("[MUTATION LISTENER] MARK node: ",{nodeKey:k,node:P,mutationType:D,codoxComments:Cn}),D===Jr.destroyed?Cn.removeRelatedNodeKey(k):P&&Cn.addRelatedNodeKey(P.__key,P.__ids,D===Jr.created)),P&&P.codoxId){if(D===Jr.destroyed)return void(P.codoxId&&jn.remove(P.codoxId));B0(P)||le.warn("[MutationListener Error] duplicating codoxId detected - such codoxId already exists in codoxNodesMap - updating node ref to latest: ",{mutationType:D,node:P}),jn.add(P.codoxId,P)}}b.push(S)})}),b},m={start:e,stop:n,on:(b,_)=>{le.info(`Subscribing client to codox ${b} event`),Wf[b]=_},cursor:{hide:()=>{vo.hideRemoteSelectionsFromUI()},show:()=>{vo.showHiddenRemoteSelectionsInUI()}},initComments:b=>{Cn.setInitialComments(b)}};return(0,Gt.useImperativeHandle)(d,()=>m),null}),Tw=Ow,jw=["comments"];function P0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function Kf(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?P0(Object(g),!0).forEach(function(t){Aw(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):P0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function Aw(y,d,g){return(d=Pw(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function Pw(y){var d=Nw(y,"string");return typeof d=="symbol"?d:d+""}function Nw(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}function Iw(y,d){if(y==null)return{};var g,t,f=Rw(y,d);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(y);for(t=0;t<r.length;t++)g=r[t],d.indexOf(g)>=0||{}.propertyIsEnumerable.call(y,g)&&(f[g]=y[g])}return f}function Rw(y,d){if(y==null)return{};var g={};for(var t in y)if({}.hasOwnProperty.call(y,t)){if(d.indexOf(t)>=0)continue;g[t]=y[t]}return g}class Mw extends i0{constructor(){super(),this.mainEditor=null,this.mainEditorKey=null,this.currentContentStateJSON=null,this.currentMainSelectionJSON=null,this.currentNestedSelectionJSON=null,this._isCodoxStarted=!1,this.prevContentStateJSON=null,this.prevMainSelectionJSON=null,this._undoInvoked=!1,this._redoInvoked=!1,this._canUndo=!1,this._canRedo=!1}setCanUndo(d){this._canUndo=d}setCanRedo(d){this._canRedo=d}canUndo(){return this._canUndo}canRedo(){return this._canRedo}setUndoInvoked(d){this._undoInvoked=d}setRedoInvoked(d){this._redoInvoked=d}undoInvoked(){return this._undoInvoked}redoInvoked(){return this._redoInvoked}setIsCodoxStarted(){let d=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this._isCodoxStarted=d}get isCodoxStarted(){return this._isCodoxStarted}getMainEditorKey(){return this.mainEditorKey}setMainEditor(d){this.mainEditor=d,this.mainEditorKey=d._key}clearJSONs(){le.debug("[CodoxLexicalEditorManager][clearJSONs] invoked"),this.currentContentStateJSON=null,this.currentMainSelectionJSON=null,this.currentNestedSelectionJSON=null,this.prevContentStateJSON=null,this.prevMainSelectionJSON=null}removeMainEditor(){this.mainEditor=null,this.mainEditorKey=null,this._undoInvoked=!1,this._redoInvoked=!1,this._canUndo=!1,this._canRedo=!1,super.clear()}getMainEditor(){return this.mainEditor}alignStateSelectionJSONsFromLatestEditor(){this.getMainEditorState().read(()=>{this.setCurrentContentStateJSON(this.getMainEditorState().toJSON()),this.setMainSelectionJSON($e.lexicalToJSON((0,be.$getSelection)()))})}mainEditorExists(){return!!this.mainEditor}getMainEditorState(){return this.mainEditor?this.mainEditor.getEditorState():{}}getMainEditorNodesClassesMap(){return this.mainEditor?this.mainEditor._nodes:new Map}getLexicalNodeByKey(d){return this.mainEditor?this.getMainEditorState()._nodeMap.get(d):null}isLexicalEditorInstance(d){return d&&typeof d=="object"&&!!d.setEditorState}setCurrentContentStateJSON(d){return this.currentContentStateJSON=d,this.currentContentStateJSON}getCurrentContentStateJSON(){return this.currentContentStateJSON}setPrevContentStateJSON(d){this.prevContentStateJSON=d}getPrevContentStateJSON(){return this.prevContentStateJSON}setMainSelectionJSON(d){this.currentMainSelectionJSON=d,this.currentMainSelectionJSON&&this.currentNestedSelectionJSON&&(this.currentNestedSelectionJSON=null)}setNestedSelectionJSON(d){this.currentNestedSelectionJSON=d,this.currentNestedSelectionJSON&&this.currentMainSelectionJSON&&(this.currentMainSelectionJSON=null)}getCurrentMainSelectionJSON(){return this.currentMainSelectionJSON}getCurrentNestedSelectionJSON(){return this.currentNestedSelectionJSON}getCurrentActiveSelectionJSON(){return!this.currentMainSelectionJSON&&this.currentNestedSelectionJSON?this.currentNestedSelectionJSON:this.currentMainSelectionJSON}clearSelectionJSON(){this.currentMainSelectionJSON=null,this.currentNestedSelectionJSON=null}setPrevMainSelectionJSON(d){this.prevMainSelectionJSON=d}getPrevMainSelectionJSON(){return this.prevMainSelectionJSON}extractStateAndCommentsFromSynced(d){let{state:{comments:g},selection:t,stateReplace:f}=d;return{stateFromSync:{state:Kf({},Iw(d.state,jw)),selection:t,stateReplace:f},commentsFromSync:g}}composeFullStateWithRootAndComments(){let{directlyFromEditor:d=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Kf(Kf({},d?this.getMainEditorState().toJSON():this.currentContentStateJSON),{},{comments:Cn.getAllComments()})}isValidJSONState(d){let g=!1;try{if(!d)throw new Error("State is undefined");if(!d.root)throw new Error("State 'root' node is missing");let t=this.getMainEditorNodesClassesMap(),f=function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",e=r,s=t.get(e.type);if(!s)throw new Error(`Node with type "${e.type}" is not registered in editor`);let{klass:i}=s;if(n==="root"){let l=i.prototype instanceof be.ElementNode,o=i.prototype instanceof be.DecoratorNode;if(!l&&!o)throw new Error("State root node can have only element nodes as children")}if(e.children)for(let l of e.children)f(l,e.type)};f(d.root),g=!0}catch(t){le.error("[isValidJSONState] invalid state found: ",t.message),g=!1}return g}scanLexicalNodeForNestedEditorAttribute(d){for(let g in d){let t=d[g];if(this.isLexicalEditorInstance(t))return g}return""}isOnlySelectionChanged(d,g){return d.size===0&&g.size===0}addUpdateTag(){let{isSameState:d,isSameSelection:g,fromNestedEditor:t=!1,updateTag:f=""}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return f?(le.log(`[addUpdateTag] explicit add of tag "${f}" `),void(0,be.$addUpdateTag)(f)):t?(le.log(`[addUpdateTag] add "${no.historic}" tag - change invoked by nested editor`),void(0,be.$addUpdateTag)(no.historic)):void(d?(le.log(`[addUpdateTag] add "${no.historic}" tag - state is same`),(0,be.$addUpdateTag)(no.historic)):(le.log(`[addUpdateTag] add "${no.historyMerge}" tag - state is different`),(0,be.$addUpdateTag)(no.historyMerge)))}enableEditorReadOnlyMode(){this.mainEditor&&this.mainEditor.isEditable()&&this.mainEditor.setEditable(!1)}disableEditorReadOnlyMode(){this.mainEditor&&(this.mainEditor.isEditable()||this.mainEditor.setEditable(!0))}}const Dw=new Mw,we=Dw;class Lw{constructor(){this._nodesMap=new Map,this._pastedNodesCodoxIds=new Set}get size(){return this._nodesMap.size}add(d,g){this._nodesMap.set(d,g)}get(d){return this._nodesMap.get(d)||null}remove(d){this._nodesMap.delete(d)}has(d){return this._nodesMap.has(d)}nodesToArray(){return Array.from(this._nodesMap.values())}keysToArray(){return Array.from(this._nodesMap.keys())}toArray(){return Array.from(this._nodesMap.entries())}addPastedId(d){this._pastedNodesCodoxIds.add(d)}removePastedId(d){this._pastedNodesCodoxIds.delete(d)}hasPastedId(d){return this._pastedNodesCodoxIds.has(d)}clearPastedIds(){this._pastedNodesCodoxIds.size>0&&this._pastedNodesCodoxIds.clear()}isEmptyPastedIds(){return this._pastedNodesCodoxIds.size===0}getPastedIdsSize(){return this._pastedNodesCodoxIds.size}clearAll(){this._nodesMap.clear(),this._pastedNodesCodoxIds.clear()}gcAbandonedNodes(){let d=we.getMainEditorState();if(!d._nodeMap)return;let g=this.nodesToArray();for(let t of g)d._nodeMap.has(t.__key)||this.remove(t.codoxId)}}const Bw=new Lw,jn=Bw;function N0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function I0(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?N0(Object(g),!0).forEach(function(t){Fw(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):N0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function Fw(y,d,g){return(d=zw(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function zw(y){var d=Uw(y,"string");return typeof d=="symbol"?d:d+""}function Uw(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}const Gf=()=>G_(),R0=y=>typeof y=="number";function ws(y){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const g=function(){for(var t=arguments.length,f=new Array(t),r=0;r<t;r++)f[r]=arguments[r];return y.apply(this,f)};return Object.defineProperty(g,"name",{value:d,writable:!0}),g}const ka=y=>y.__type==="root"||y.type==="root",M0=y=>ka(y.getParent()),$n=y=>y.__type===mu.text||y.type===mu.text||y.hasOwnProperty("__text")||y.hasOwnProperty("text"),Ss=y=>(0,be.$isElementNode)(y),Cs=y=>(0,kn.$isTableNode)(y)||(0,kn.$isTableRowNode)(y)||(0,kn.$isTableCellNode)(y),$w=y=>!y.getChildren,D0=y=>!!y.getChildren,En=y=>(0,be.$isDecoratorNode)(y),zl=y=>(0,U_.$isLinkNode)(y),Ul=y=>y.__type==="mark"||y.type==="mark",Yf=y=>(0,be.$isLineBreakNode)(y),Ui=y=>$n(y)||Yf(y),Zf=y=>y.__type===mu.horizontalrule||y.type===mu.horizontalrule,L0=y=>{if(Ui(y)||zl(y)||Ul(y))return!1;if(!y.__parent||y.__parent==="root"||(0,be.$isParagraphNode)(y))return!0;let d=y.getParent().getChildren();return d.length===1&&d[0].__key===y.__key?!((En(y)||zl(y)||Ul(y))&&!Zf(y)):!d.some(g=>{let t=Zf(g);return g.__key!==y.__key&&(Ui(g)||En(g)&&!t||zl(g)||Ul(g))})},B0=y=>{const d=jn.get(y.codoxId);return!d||y.__key===d.__key},Es=function(y){const d=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||Gf();y.codoxId=d,jn.add(d,y)},F0=y=>{jn.remove(y.codoxId),delete y.codoxId},Hw=y=>{if(!D0(y)||!y.getChildrenSize())return;const d=y.getChildren();if(d.some(f=>!!(0,be.$isParagraphNode)(f)))return;let g=!1,t=[];for(let f of d)(Ui(f)||En(f)||zl(f)||Ul(f))&&!g&&(Zf(f)||(g=!0)),(D0(f)||En(f))&&t.push(f);for(let f of t)g||f.codoxId?g&&f.codoxId&&(f=f.getWritable(),F0(f)):(f=f.getWritable(),Es(f))},qw=y=>{const d=I0({},y);for(const g in y)y[g]===void 0&&y.hasOwnProperty(g)&&delete d[g];return d},Jw=y=>{const d=`__nativeCreateDOM_${y.name}`;y.prototype[d]=ws(y.prototype.createDOM,d),y.prototype.createDOM=function(g,t){if(L0(this))if(this.codoxId){if(!B0(this)){let r=jn.get(this.codoxId);r.__type===this.__type&&this.isAttached()&&!r.isAttached()?(le.warn("[createDOM][Non-unique codoxId] overwrite abandoned existing node with latest: ",{latestNode:this,existingNode:r}),jn.add(this.codoxId,this)):Es(this)}}else Es(this);else this.codoxId&&F0(this);En(this)&&!this.codoxDId&&(this.codoxDId=Gf()),si.manageNestedEditorInLexicalNode(this);let f=this[d](g,t);return f.__codox_track=!0,f}},Vw=y=>{const d=`__nativeUpdateDOM_${y.name}`;return y.prototype[d]=ws(y.prototype.updateDOM,d),y.prototype.updateDOM=function(){const g=this[d](...arguments);return Hw(this),g},y},Ww=y=>{const d=`__nativeRemove_${y.name}`;return y.prototype[d]=ws(y.prototype.remove,d),y.prototype.remove=function(){const g=this.codoxId;return g&&jn.remove(g),si.gcNestedEditorListenerInLexicalNode(this),this[d](...arguments)},y},Kw=y=>{const d=`__nativeExportJSON_${y.name}`;y.prototype[d]=ws(y.prototype.exportJSON,d),y.prototype.exportJSON=function(){const g=this[d]();return this.codoxId&&(g.codoxId=this.codoxId),this.codoxDId&&(g.codoxDId=this.codoxDId),$n(this)&&R0(g.format)&&this.hasFormat&&(g.format=ax(this)),qw(g)}},Gw=y=>{const d="__nativeImportJSON";y[d]=ws(y.importJSON,d),y.importJSON=function(g){const t=I0({},g);$n(t)&&!R0(t.format)&&(t.format=ix(t.format));const f=y[d](t);si.manageNestedEditorInLexicalNode(f);const r=L0(f);return r&&t.codoxId&&(jn.hasPastedId(t.codoxId)&&jn.has(t.codoxId)?(jn.removePastedId(t.codoxId),Es(f)):Es(f,t.codoxId)),r&&!f.codoxId&&Es(f),t.codoxDId&&(f.codoxDId=t.codoxDId),f}},Yw=y=>{const d="__nativeClone";y[d]=ws(y.clone,d),y.clone=function(g){const t=y[d](g);return g.codoxId&&(t.codoxId=g.codoxId),g.codoxDId&&(t.codoxDId=g.codoxDId),si.manageNestedEditorInClonedLexicalNode(g,t),t}},Zw=y=>{let d=!1,g=!1,t=!1,f=!1;y.forEach(n=>{n.name===be.TextNode.name?d=!0:n.name===be.ParagraphNode.name?g=!0:n.name===be.LineBreakNode.name?t=!0:n.name===eo.MarkNode.name&&(f=!0)});let r=[];return d||r.push(be.TextNode),g||r.push(be.ParagraphNode),t||r.push(be.LineBreakNode),f||r.push(eo.MarkNode),r.length?[...r,...y]:y},Qw=function(){return Zw(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(y=>(y.hasOwnProperty("__isCodoxExtended")||(Jw(y),Vw(y),Kw(y),Ww(y),Gw(y),Yw(y),Object.defineProperty(y,"__isCodoxExtended",{value:!0,writable:!1})),y))};var Su=on(777),ks={};ks.styleTagTransform=ai(),ks.setAttributes=oi(),ks.insert=ri().bind(null,"head"),ks.domAPI=ni(),ks.insertStyleElement=ii(),ei()(Su.A,ks),Su.A&&Su.A.locals&&Su.A.locals;var Xw=y=>{var d={};return on.d(d,y),d};const tS=Xw({AutoFocusPlugin:()=>Qg});var eS=y=>{var d={};return on.d(d,y),d};const nS=eS({ClearEditorPlugin:()=>C_});var rS=y=>{var d={};return on.d(d,y),d};const oS=rS({LexicalComposer:()=>Zg});var iS=y=>{var d={};return on.d(d,y),d};const z0=iS({default:()=>k_});var aS=y=>{var d={};return on.d(d,y),d};const sS=aS({HistoryPlugin:()=>hm});var lS=y=>{var d={};return on.d(d,y),d};const cS=lS({OnChangePlugin:()=>T_});var uS=y=>{var d={};return on.d(d,y),d};const dS=uS({PlainTextPlugin:()=>D_});var fS=y=>{var d={};return on.d(d,y),d};const U0=fS({$isRootTextContentEmpty:()=>mm,$rootTextContent:()=>gm});var pS=y=>{var d={};return on.d(d,y),d};const Os=pS({createPortal:()=>Qb.createPortal}),hS=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,gS=hS?Gt.useLayoutEffect:Gt.useEffect,$0=gS;var Cu=on(253),Ts={};Ts.styleTagTransform=ai(),Ts.setAttributes=oi(),Ts.insert=ri().bind(null,"head"),Ts.domAPI=ni(),Ts.insertStyleElement=ii(),ei()(Cu.A,Ts),Cu.A&&Cu.A.locals&&Cu.A.locals;function mS(y){let{onClose:d,children:g,title:t,closeOnClickOutside:f}=y;const r=(0,Gt.useRef)(null);return(0,Gt.useEffect)(()=>{r.current!==null&&r.current.focus()},[]),(0,Gt.useEffect)(()=>{let n=null;const e=l=>{l.key==="Escape"&&d()},s=l=>{const o=l.target;r.current!==null&&!r.current.contains(o)&&f&&d()},i=r.current;return i!==null&&(n=i.parentElement,n!==null&&n.addEventListener("click",s)),window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e),n!==null&&(n==null||n.removeEventListener("click",s))}},[f,d]),Gt.createElement("div",{className:"Modal__overlay",role:"dialog"},Gt.createElement("div",{className:"Modal__modal",tabIndex:-1,ref:r},Gt.createElement("h2",{className:"Modal__title"},t),Gt.createElement("button",{className:"Modal__closeButton","aria-label":"Close modal",type:"button",onClick:d},"X"),Gt.createElement("div",{className:"Modal__content"},g)))}function yS(y){let{onClose:d,children:g,title:t,closeOnClickOutside:f=!1}=y;return(0,Os.createPortal)(Gt.createElement(mS,{onClose:d,title:t,closeOnClickOutside:f},g),document.body)}function H0(){const[y,d]=(0,Gt.useState)(null),g=(0,Gt.useCallback)(()=>{d(null)},[]),t=(0,Gt.useMemo)(()=>{if(y===null)return null;const{title:r,content:n,closeOnClickOutside:e}=y;return Gt.createElement(yS,{onClose:g,title:r,closeOnClickOutside:e},n)},[y,g]),f=(0,Gt.useCallback)(function(r,n){d({closeOnClickOutside:arguments.length>2&&arguments[2]!==void 0&&arguments[2],content:n(g),title:r})},[g]);return[t,f]}var Eu=on(191),js={};js.styleTagTransform=ai(),js.setAttributes=oi(),js.insert=ri().bind(null,"head"),js.domAPI=ni(),js.insertStyleElement=ii(),ei()(Eu.A,js),Eu.A&&Eu.A.locals&&Eu.A.locals;const bS={blockCursor:"CommentEditorTheme__blockCursor",characterLimit:"CommentEditorTheme__characterLimit",code:"CommentEditorTheme__code",codeHighlight:{atrule:"CommentEditorTheme__tokenAttr",attr:"CommentEditorTheme__tokenAttr",boolean:"CommentEditorTheme__tokenProperty",builtin:"CommentEditorTheme__tokenSelector",cdata:"CommentEditorTheme__tokenComment",char:"CommentEditorTheme__tokenSelector",class:"CommentEditorTheme__tokenFunction","class-name":"CommentEditorTheme__tokenFunction",comment:"CommentEditorTheme__tokenComment",constant:"CommentEditorTheme__tokenProperty",deleted:"CommentEditorTheme__tokenProperty",doctype:"CommentEditorTheme__tokenComment",entity:"CommentEditorTheme__tokenOperator",function:"CommentEditorTheme__tokenFunction",important:"CommentEditorTheme__tokenVariable",inserted:"CommentEditorTheme__tokenSelector",keyword:"CommentEditorTheme__tokenAttr",namespace:"CommentEditorTheme__tokenVariable",number:"CommentEditorTheme__tokenProperty",operator:"CommentEditorTheme__tokenOperator",prolog:"CommentEditorTheme__tokenComment",property:"CommentEditorTheme__tokenProperty",punctuation:"CommentEditorTheme__tokenPunctuation",regex:"CommentEditorTheme__tokenVariable",selector:"CommentEditorTheme__tokenSelector",string:"CommentEditorTheme__tokenSelector",symbol:"CommentEditorTheme__tokenProperty",tag:"CommentEditorTheme__tokenProperty",url:"CommentEditorTheme__tokenOperator",variable:"CommentEditorTheme__tokenVariable"},embedBlock:{base:"CommentEditorTheme__embedBlock",focus:"CommentEditorTheme__embedBlockFocus"},hashtag:"CommentEditorTheme__hashtag",heading:{h1:"CommentEditorTheme__h1",h2:"CommentEditorTheme__h2",h3:"CommentEditorTheme__h3",h4:"CommentEditorTheme__h4",h5:"CommentEditorTheme__h5",h6:"CommentEditorTheme__h6"},image:"editor-image",indent:"CommentEditorTheme__indent",inlineImage:"inline-editor-image",layoutContainer:"CommentEditorTheme__layoutContainer",layoutItem:"CommentEditorTheme__layoutItem",link:"CommentEditorTheme__link",list:{checklist:"CommentEditorTheme__checklist",listitem:"CommentEditorTheme__listItem",listitemChecked:"CommentEditorTheme__listItemChecked",listitemUnchecked:"CommentEditorTheme__listItemUnchecked",nested:{listitem:"CommentEditorTheme__nestedListItem"},olDepth:["CommentEditorTheme__ol1","CommentEditorTheme__ol2","CommentEditorTheme__ol3","CommentEditorTheme__ol4","CommentEditorTheme__ol5"],ul:"CommentEditorTheme__ul"},ltr:"CommentEditorTheme__ltr",mark:"CommentEditorTheme__mark",markOverlap:"CommentEditorTheme__markOverlap",paragraph:"CommentEditorTheme__paragraph",quote:"CommentEditorTheme__quote",rtl:"CommentEditorTheme__rtl",table:"CommentEditorTheme__table",tableCell:"CommentEditorTheme__tableCell",tableCellActionButton:"CommentEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"CommentEditorTheme__tableCellActionButtonContainer",tableCellEditing:"CommentEditorTheme__tableCellEditing",tableCellHeader:"CommentEditorTheme__tableCellHeader",tableCellPrimarySelected:"CommentEditorTheme__tableCellPrimarySelected",tableCellResizer:"CommentEditorTheme__tableCellResizer",tableCellSelected:"CommentEditorTheme__tableCellSelected",tableCellSortedIndicator:"CommentEditorTheme__tableCellSortedIndicator",tableResizeRuler:"CommentEditorTheme__tableCellResizeRuler",tableSelected:"CommentEditorTheme__tableSelected",tableSelection:"CommentEditorTheme__tableSelection",text:{bold:"CommentEditorTheme__textBold",code:"CommentEditorTheme__textCode",italic:"CommentEditorTheme__textItalic",strikethrough:"CommentEditorTheme__textStrikethrough",subscript:"CommentEditorTheme__textSubscript",superscript:"CommentEditorTheme__textSuperscript",underline:"CommentEditorTheme__textUnderline",underlineStrikethrough:"CommentEditorTheme__textUnderlineStrikethrough"}},vS=bS;var ku=on(72),As={};As.styleTagTransform=ai(),As.setAttributes=oi(),As.insert=ri().bind(null,"head"),As.domAPI=ni(),As.insertStyleElement=ii(),ei()(ku.A,As),ku.A&&ku.A.locals&&ku.A.locals;function _S(){for(var y=arguments.length,d=new Array(y),g=0;g<y;g++)d[g]=arguments[g];return d.filter(Boolean).join(" ")}function Qf(){return Qf=Object.assign?Object.assign.bind():function(y){for(var d=1;d<arguments.length;d++){var g=arguments[d];for(var t in g)({}).hasOwnProperty.call(g,t)&&(y[t]=g[t])}return y},Qf.apply(null,arguments)}function $i(y){let{"data-test-id":d,children:g,className:t,onClick:f,disabled:r,small:n,title:e}=y;return Gt.createElement("button",Qf({disabled:r,className:_S("Button__root",r&&"Button__disabled",n&&"Button__small",t),onClick:f,title:e,"aria-label":e},d&&{"data-test-id":d}),g)}var Ou=on(129),Ps={};Ps.styleTagTransform=ai(),Ps.setAttributes=oi(),Ps.insert=ri().bind(null,"head"),Ps.domAPI=ni(),Ps.insertStyleElement=ii(),ei()(Ou.A,Ps),Ou.A&&Ou.A.locals&&Ou.A.locals;var xS=y=>{var d={};return on.d(d,y),d};const wS=xS({ContentEditable:()=>Xg});function SS(y){let{className:d}=y;return Gt.createElement(wS.ContentEditable,{className:d||"ContentEditable__root"})}var Tu=on(457),Ns={};Ns.styleTagTransform=ai(),Ns.setAttributes=oi(),Ns.insert=ri().bind(null,"head"),Ns.domAPI=ni(),Ns.insertStyleElement=ii(),ei()(Tu.A,Ns),Tu.A&&Tu.A.locals&&Tu.A.locals;function CS(y){let{children:d,className:g}=y;return Gt.createElement("div",{className:g||"Placeholder__root"},d)}const ES=z0.default.LexicalErrorBoundary||z0.default,kS=()=>Gt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#050505",className:"codox-add-comment-right"},Gt.createElement("path",{d:"M14 1a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4.414A2 2 0 0 0 3 11.586l-2 2V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12.793a.5.5 0 0 0 .854.353l2.853-2.853A1 1 0 0 1 4.414 12H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"}),Gt.createElement("path",{d:"M3 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM3 6a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9A.5.5 0 0 1 3 6zm0 2.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5z"})),q0=()=>Gt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",className:"codox-remove-comment"},Gt.createElement("path",{d:"M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z"})),OS=()=>Gt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",className:"codox-add-comment"},Gt.createElement("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"})),TS=()=>Gt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"#0000008c",className:"codox-hide-show-comments"},Gt.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 5.885v1.166a3.95 3.95 0 0 1-3.949 3.95H6.917a.748.748 0 0 0-.45.15l-1.345 1.007a.752.752 0 0 0-.032 1.181A2.933 2.933 0 0 0 6.95 14h2.716l2.534 1.901a.506.506 0 0 0 .524.047A.501.501 0 0 0 13 15.5V14h.051a2.949 2.949 0 0 0 2.95-2.949v-3.05a3.002 3.002 0 0 0-2.002-2.83.756.756 0 0 0-.999.714"}),Gt.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.05 1H2.95A2.952 2.952 0 0 0 0 3.949v3.102A2.952 2.952 0 0 0 2.949 10H3v1.5a.502.502 0 0 0 .8.4L6.334 10H9.05A2.952 2.952 0 0 0 12 7.05V3.95A2.952 2.952 0 0 0 9.05 1"}));function J0(y,d,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:performance.now(),f=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return Cn.createNewCommentObj({content:y,author:d,codoxId:g,timeStamp:t,deleted:f})}function jS(y,d,g){return Cn.createNewThreadObj({quote:y,comments:d,codoxId:g})}function AS(y){let{anchorKey:d,editor:g,onAddComment:t}=y;const f=(0,Gt.useRef)(null),r=(0,Gt.useCallback)(()=>{const n=f.current,e=g.getRootElement(),s=g.getElementByKey(d);if(n!==null&&e!==null&&s!==null){const{right:i}=e.getBoundingClientRect(),{top:l}=s.getBoundingClientRect();n.style.left=i-20+"px",n.style.top=l-30+"px"}},[d,g]);return(0,Gt.useEffect)(()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}),[g,r]),$0(()=>{r()},[d,g,r]),Gt.createElement("div",{className:"CodoxCommentPlugin_AddCommentBox",ref:f},Gt.createElement("button",{className:"CodoxCommentPlugin_AddCommentBox_button",onClick:t},Gt.createElement(kS,null)))}function PS(y){let{onEscape:d}=y;const[g]=(0,Fi.useLexicalComposerContext)();return(0,Gt.useEffect)(()=>g.registerCommand(be.KEY_ESCAPE_COMMAND,t=>d(t),2),[g,d]),null}function NS(y){let{editorRef:d}=y;const[g]=(0,Fi.useLexicalComposerContext)();return typeof d=="function"?d(g):typeof d=="object"&&(d.current=g),null}function V0(y){let{className:d,autoFocus:g,onEscape:t,onChange:f,editorRef:r,placeholder:n="Type a comment...",onEditorClick:e=()=>{}}=y;const s={namespace:"Commenting",nodes:[],onError:i=>{throw i},theme:vS};return Gt.createElement(oS.LexicalComposer,{initialConfig:s},Gt.createElement("div",{className:"CodoxCommentPlugin_CommentInputBox_EditorContainer",onClick:e},Gt.createElement(dS.PlainTextPlugin,{contentEditable:Gt.createElement(SS,{className:d}),placeholder:Gt.createElement(CS,null,n),ErrorBoundary:ES}),Gt.createElement(cS.OnChangePlugin,{onChange:f}),Gt.createElement(sS.HistoryPlugin,null),g!==!1&&Gt.createElement(tS.AutoFocusPlugin,null),Gt.createElement(PS,{onEscape:t}),Gt.createElement(nS.ClearEditorPlugin,null),r!==void 0&&Gt.createElement(NS,{editorRef:r})))}function W0(y,d){return(0,Gt.useCallback)((g,t)=>{g.read(()=>{y((0,U0.$rootTextContent)()),d(!(0,U0.$isRootTextContentEmpty)(t.isComposing(),!0))})},[d,y])}function IS(y){let{editor:d,cancelAddComment:g,submitAddComment:t}=y;const[f,r]=(0,Gt.useState)(""),[n,e]=(0,Gt.useState)(!1),s=(0,Gt.useRef)(null),i=(0,Gt.useMemo)(()=>({container:document.createElement("div"),elements:[]}),[]),l=(0,Gt.useRef)(null),o=Y0(),a=(0,Gt.useCallback)(()=>{d.getEditorState().read(()=>{const u=(0,be.$getSelection)();if((0,be.$isRangeSelection)(u)){l.current=u.clone();const h=u.anchor,p=u.focus,m=(0,Ca.createDOMRange)(d,h.getNode(),h.offset,p.getNode(),p.offset),b=s.current;if(m!==null&&b!==null){const{left:_,bottom:v,width:w}=m.getBoundingClientRect(),x=(0,Ca.createRectsFromDOMRange)(d,m);let S=x.length===1?_+w/2-125:_-125;S<10&&(S=10),b.style.left=`${S}px`,b.style.top=`${v+20+(window.pageYOffset||document.documentElement.scrollTop)}px`;const E=x.length,{container:k}=i,D=i.elements,P=D.length;for(let O=0;O<E;O++){const R=x[O];let A=D[O];A===void 0&&(A=document.createElement("span"),D[O]=A,k.appendChild(A));const z="255, 212, 0",H=`position:absolute;top:${R.top+(window.pageYOffset||document.documentElement.scrollTop)}px;left:${R.left}px;height:${R.height}px;width:${R.width}px;background-color:rgba(${z}, 0.3);pointer-events:none;z-index:5;`;A.style.cssText=H}for(let O=P-1;O>=E;O--){const R=D[O];k.removeChild(R),D.pop()}}}})},[d,i]);$0(()=>{a();const u=i.container,h=document.body;if(h!==null)return h.appendChild(u),()=>{h.removeChild(u)}},[i.container,a]),(0,Gt.useEffect)(()=>(window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}),[a]);const c=W0(r,e);return Gt.createElement("div",{className:"CodoxCommentPlugin_CommentInputBox",ref:s},Gt.createElement(V0,{className:"CodoxCommentPlugin_CommentInputBox_Editor",onEscape:u=>(u.preventDefault(),g(),!0),onChange:c}),Gt.createElement("div",{className:"CodoxCommentPlugin_CommentInputBox_Buttons"},Gt.createElement($i,{onClick:g,className:"CodoxCommentPlugin_CommentInputBox_Button"},"Cancel"),Gt.createElement($i,{onClick:()=>{if(n){let u=d.getEditorState().read(()=>{const h=l.current;return h?h.getTextContent():""});u.length>100&&(u=u.slice(0,99)+"…"),t(jS(u,[J0(f,o)]),!0,void 0,l.current),l.current=null}},disabled:!n,className:"CodoxCommentPlugin_CommentInputBox_Button primary"},"Comment")))}function RS(y){let{submitAddComment:d,thread:g,placeholder:t}=y;const[f,r]=(0,Gt.useState)(""),[n,e]=(0,Gt.useState)(!1),s=(0,Gt.useRef)(null),i=Y0(),l=W0(r,e);return Gt.createElement(Gt.Fragment,null,Gt.createElement(V0,{className:"CodoxCommentPlugin_CommentsPanel_Editor",autoFocus:!1,onEscape:()=>!0,onChange:l,editorRef:s,placeholder:t}),Gt.createElement($i,{className:"CodoxCommentPlugin_CommentsPanel_SendButton",onClick:()=>{if(n){d(J0(f,i),!1,g);const o=s.current;o!==null&&o.dispatchCommand(be.CLEAR_EDITOR_COMMAND,void 0)}},disabled:!n},Gt.createElement(OS,null)))}function K0(y){let{commentOrThread:d,deleteCommentOrThread:g,onClose:t,thread:f}=y;return Gt.createElement(Gt.Fragment,null,"Are you sure you want to delete this ",d.type,"?",Gt.createElement("div",{className:"Modal__content"},Gt.createElement($i,{onClick:()=>{g(d,f),t()}},"Delete")," ",Gt.createElement($i,{onClick:()=>{t()}},"Cancel")))}function G0(y){let{comment:d,deleteComment:g,thread:t,rtf:f}=y;const r=Math.round((d.timeStamp-performance.now())/1e3),n=Math.round(r/60),[e,s]=H0();return Gt.createElement("li",{className:"CodoxCommentPlugin_CommentsPanel_List_Comment"},Gt.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_List_Details"},Gt.createElement("span",{className:"CodoxCommentPlugin_CommentsPanel_List_Comment_Author"},d.author),Gt.createElement("span",{className:"CodoxCommentPlugin_CommentsPanel_List_Comment_Time"},"· ",r>-10?"Just now":f.format(n,"minute"))),Gt.createElement("p",{className:d.deleted?"CodoxCommentPlugin_CommentsPanel_DeletedComment":""},d.content),!d.deleted&&Gt.createElement(Gt.Fragment,null,Gt.createElement($i,{onClick:()=>{s("Delete Comment",i=>Gt.createElement(K0,{commentOrThread:d,deleteCommentOrThread:g,thread:t,onClose:i}))},className:"CodoxCommentPlugin_CommentsPanel_List_DeleteButton"},Gt.createElement(q0,null)),e))}function MS(y){let{activeIDs:d,comments:g,deleteCommentOrThread:t,listRef:f,submitAddComment:r,markNodeMap:n}=y;const[e]=(0,Fi.useLexicalComposerContext)(),[s,i]=(0,Gt.useState)(0),[l,o]=H0(),a=(0,Gt.useMemo)(()=>new Intl.RelativeTimeFormat("en",{localeMatcher:"best fit",numeric:"auto",style:"short"}),[]);return(0,Gt.useEffect)(()=>{const c=setTimeout(()=>{i(s+1)},1e4);return()=>{clearTimeout(c)}},[s]),Gt.createElement("ul",{className:"CodoxCommentPlugin_CommentsPanel_List",ref:f},g.map(c=>{const u=c.codoxId;if(!u)return null;if(c.type==="thread"){const h=()=>{if(n.get(u)!==void 0&&(d===null||d.indexOf(u)===-1)){const p=document.activeElement;e.update(()=>{(0,be.$setSelection)(null)},{onUpdate(){p!==null&&p.focus()}})}};return Gt.createElement("li",{key:u,onClick:h,className:`CodoxCommentPlugin_CommentsPanel_List_Thread ${n.has(u)?"interactive":""} ${d.indexOf(u)===-1?"":"active"}`},Gt.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_QuoteBox"},Gt.createElement("blockquote",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_Quote"},"> ",Gt.createElement("span",null,c.quote)),Gt.createElement($i,{onClick:()=>{o("Delete Thread",p=>Gt.createElement(K0,{commentOrThread:c,deleteCommentOrThread:t,onClose:p}))},className:"CodoxCommentPlugin_CommentsPanel_List_DeleteButton"},Gt.createElement(q0,null)),l),Gt.createElement("ul",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_Comments"},c.comments.map(p=>Gt.createElement(G0,{key:p.codoxId,comment:p,deleteComment:t,thread:c,rtf:a}))),Gt.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_Editor"},Gt.createElement(RS,{submitAddComment:r,thread:c,placeholder:"Reply to comment..."})))}return Gt.createElement(G0,{key:u,comment:c,deleteComment:t,rtf:a})}))}function DS(y){let{activeIDs:d,deleteCommentOrThread:g,comments:t,submitAddComment:f,markNodeMap:r}=y;const n=(0,Gt.useRef)(null),e=t.length===0;return Gt.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel"},Gt.createElement("h2",{className:"CodoxCommentPlugin_CommentsPanel_Heading"},"Comments"),e?Gt.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_Empty"},"No Comments"):Gt.createElement(MS,{activeIDs:d,comments:t,deleteCommentOrThread:g,listRef:n,submitAddComment:f,markNodeMap:r}))}function Y0(){const y=(0,O0.useCollaborationContext)(),{yjsDocMap:d,name:g}=y;return g||"Playground User"}function LS(y){const[d]=(0,Fi.useLexicalComposerContext)(),g=vx(),t=(0,Gt.useMemo)(()=>new Map,[]),[f,r]=(0,Gt.useState)(),[n,e]=(0,Gt.useState)([]),[s,i]=(0,Gt.useState)(!1),[l,o]=(0,Gt.useState)(!1);(0,Gt.useEffect)(()=>{!g.length&&l?o(!1):g.length},[g]);const a=(0,Gt.useCallback)(()=>{d.update(()=>{const h=(0,be.$getSelection)();h!==null&&(h.dirty=!0)}),i(!1)},[d]),c=(0,Gt.useCallback)((h,p)=>{if(h.type==="comment"){if(le.log("[deleteCommentOrThread]: type comment new values",{comment:h,thread:p,markNodeMap:t}),Cn.removeComment(p.codoxId,h.codoxId),!p)return;const m=p.codoxId,b=t.get(m);d.update(()=>{b?b.forEach((_,v)=>{const w=(0,be.$getNodeByKey)(v);le.log("[deleteCommentOrThread]: type comment new values",{lexicalNode:w}),w&&w.markDirty()}):(0,be.$getRoot)().markDirty(),(0,be.$addUpdateTag)(no.historic),(0,be.$addUpdateTag)(Bl)})}else{le.log("[deleteCommentOrThread]: type thread new values",{comment:h,markNodeMap:t});const m=p!==void 0?p.codoxId:h.codoxId,b=t.get(m);setTimeout(()=>{d.update(()=>{if(b)for(const _ of b){const v=(0,be.$getNodeByKey)(_);le.log("[deleteCommentOrThread]: type thread new values",{node:v}),(0,eo.$isMarkNode)(v)&&(v.deleteID(m),v.getIDs().length===0&&(0,eo.$unwrapMarkNode)(v))}else(0,be.$getRoot)().markDirty(),le.debug("[deleteCommentOrThread][refreshComments]");Cn.refreshComments(!0),(0,be.$addUpdateTag)(Bl)})})}},[d,t]),u=(0,Gt.useCallback)((h,p,m,b)=>{if(le.log("[submitAddComment]: new values",{commentOrThread:h,isInlineComment:p,thread:m,markNodeMap:t}),m?Cn.addComment(m.codoxId,h):Cn.addCommentThread(h),p)d.update(()=>{if((0,be.$isRangeSelection)(b)){const _=b.isBackward(),v=h.codoxId;(0,eo.$wrapSelectionInMarkNode)(b,_,v),(0,be.$addUpdateTag)(Bl)}}),i(!1);else if(!p&&m){const _=m.codoxId,v=t.get(_);if(!v)return void Cn.removeComment(m.codoxId,h.codoxId);d.update(()=>{v.forEach((w,x)=>{let S=(0,be.$getNodeByKey)(x);S&&S.markDirty()}),(0,be.$addUpdateTag)(no.historic),(0,be.$addUpdateTag)(Bl)})}},[d]);return(0,Gt.useEffect)(()=>{const h=[];for(let p=0;p<n.length;p++){const m=n[p],b=t.get(m);if(b!==void 0)for(const _ of b){const v=d.getElementByKey(_);v!==null&&(v.classList.add("selected"),h.push(v),o(!0))}}return()=>{for(let p=0;p<h.length;p++)h[p].classList.remove("selected")}},[n,d,t]),(0,Gt.useEffect)(()=>{const h=new Map;return(0,bs.mergeRegister)((0,bs.registerNestedElementResolver)(d,eo.MarkNode,p=>(0,eo.$createMarkNode)(p.getIDs()),(p,m)=>{p.getIDs().forEach(b=>{m.addID(b)})}),d.registerMutationListener(eo.MarkNode,p=>{d.getEditorState().read(()=>{for(const[m,b]of p){const _=(0,be.$getNodeByKey)(m);let v=[];b==="destroyed"?v=h.get(m)||[]:(0,eo.$isMarkNode)(_)&&(v=_.getIDs());for(let w=0;w<v.length;w++){const x=v[w];let S=t.get(x);h.set(m,v),b==="destroyed"?S!==void 0&&(S.delete(m),S.size===0&&t.delete(x)):(S===void 0&&(S=new Set,t.set(x,S)),S.has(m)||S.add(m))}}})}),d.registerUpdateListener(p=>{let{editorState:m,tags:b}=p;m.read(()=>{const _=(0,be.$getSelection)();let v=!1,w=!1;if((0,be.$isRangeSelection)(_)){const x=_.anchor.getNode();if((0,be.$isTextNode)(x)){const S=(0,eo.$getMarkIDs)(x,_.anchor.offset);S!==null&&(e(S),v=!0),_.isCollapsed()||(r(x.getKey()),w=!0)}}v||e(x=>x.length===0?x:[]),w||r(null),(0,be.$isRangeSelection)(_)&&i(!1)})}),d.registerCommand($f,()=>{const p=window.getSelection();return p!==null&&p.removeAllRanges(),i(!0),!0},be.COMMAND_PRIORITY_EDITOR))},[d,t]),Gt.createElement(Gt.Fragment,null,s&&(0,Os.createPortal)(Gt.createElement(IS,{editor:d,cancelAddComment:a,submitAddComment:u}),document.body),f!=null&&!s&&(0,Os.createPortal)(Gt.createElement(AS,{anchorKey:f,editor:d,onAddComment:()=>{d.dispatchCommand($f,void 0)}}),document.body),(0,Os.createPortal)(Gt.createElement($i,{className:"CodoxCommentPlugin_ShowCommentsButton "+(l?"active":""),onClick:()=>o(!l),title:l?"Hide Comments":"Show Comments"},Gt.createElement(TS,null)),document.body),l&&(0,Os.createPortal)(Gt.createElement(DS,{comments:g,submitAddComment:u,deleteCommentOrThread:c,activeIDs:n,markNodeMap:t}),document.body))}var ju=on(766),Is={};Is.styleTagTransform=ai(),Is.setAttributes=oi(),Is.insert=ri().bind(null,"head"),Is.domAPI=ni(),Is.insertStyleElement=ii(),ei()(ju.A,Is),ju.A&&ju.A.locals&&ju.A.locals;var Au=on(225),Rs={};Rs.styleTagTransform=ai(),Rs.setAttributes=oi(),Rs.insert=ri().bind(null,"head"),Rs.domAPI=ni(),Rs.insertStyleElement=ii(),ei()(Au.A,Rs),Au.A&&Au.A.locals&&Au.A.locals;function BS(y){let{label:d,value:g,onChange:t,placeholder:f="","data-test-id":r,type:n="text"}=y;return Gt.createElement("div",{className:"CodoxInput__wrapper"},Gt.createElement("label",{className:"CodoxInput__label"},d),Gt.createElement("input",{type:n,className:"CodoxInput__input",placeholder:f,value:g,onChange:e=>{t(e.target.value)},"data-test-id":r}))}function Z0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function Pu(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?Z0(Object(g),!0).forEach(function(t){FS(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):Z0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function FS(y,d,g){return(d=zS(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function zS(y){var d=US(y,"string");return typeof d=="symbol"?d:d+""}function US(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}let $l=!1;const $S=["#d0021b","#f5a623","#f8e71c","#8b572a","#7ed321","#417505","#bd10e0","#9013fe","#4a90e2","#50e3c2","#b8e986","#000000","#4a4a4a","#9b9b9b","#ffffff"],Hl=214,Q0=150;function HS(y){let{color:d,onChange:g}=y;const[t,f]=(0,Gt.useState)(Ms("hex",d)),[r,n]=(0,Gt.useState)(d),e=(0,Gt.useRef)(null),s=(0,Gt.useMemo)(()=>({x:t.hsv.s/100*Hl,y:(100-t.hsv.v)/100*Q0}),[t.hsv.s,t.hsv.v]),i=(0,Gt.useMemo)(()=>({x:t.hsv.h/360*Hl}),[t.hsv]);return(0,Gt.useEffect)(()=>{e.current!==null&&g&&n(t.hex)},[t,g]),(0,Gt.useEffect)(()=>{if(d===void 0)return;const l=Ms("hex",d);f(l),n(l.hex)},[d]),Gt.createElement("div",{className:"codox-color-picker-wrapper",style:{width:Hl},ref:e},Gt.createElement(BS,{label:"Hex",onChange:l=>{if(n(l),/^#[0-9A-Fa-f]{6}$/i.test(l)){const o=Ms("hex",l);f(o)}},value:r}),Gt.createElement("div",{className:"codox-color-picker-basic-color"},$S.map(l=>Gt.createElement("button",{className:l===t.hex?" active":"",key:l,style:{backgroundColor:l},onClick:()=>(o=>{n(o);let a=Ms("hex",o);f(a),g(a.hex,$l)})(l)}))),Gt.createElement(X0,{className:"codox-color-picker-saturation",style:{backgroundColor:`hsl(${t.hsv.h}, 100%, 50%)`},onChange:l=>{let{x:o,y:a}=l;const c=Ms("hsv",Pu(Pu({},t.hsv),{},{s:o/Hl*100,v:100-a/Q0*100}));f(c),n(c.hex),g(c.hex,$l)}},Gt.createElement("div",{className:"codox-color-picker-saturation_cursor",style:{backgroundColor:t.hex,left:s.x,top:s.y}})),Gt.createElement(X0,{className:"codox-color-picker-hue",onChange:l=>{let{x:o}=l;const a=Ms("hsv",Pu(Pu({},t.hsv),{},{h:o/Hl*360}));f(a),n(a.hex),g(a.hex,$l)}},Gt.createElement("div",{className:"codox-color-picker-hue_cursor",style:{backgroundColor:`hsl(${t.hsv.h}, 100%, 50%)`,left:i.x}})),Gt.createElement("div",{className:"codox-color-picker-color",style:{backgroundColor:t.hex}}))}function X0(y){let{className:d,style:g,onChange:t,children:f}=y;const r=(0,Gt.useRef)(null),n=(0,Gt.useRef)(!1),e=s=>{if(r.current){const{current:i}=r,{width:l,height:o,left:a,top:c}=i.getBoundingClientRect(),u=ty(s.clientX-a,l,0),h=ty(s.clientY-c,o,0);t({x:u,y:h})}};return Gt.createElement("div",{ref:r,className:d,style:g,onMouseDown:s=>{if(s.button!==0)return;e(s);const i=o=>{n.current=!0,$l=!0,e(o)},l=o=>{n.current&&($l=!1),document.removeEventListener("mousemove",i,!1),document.removeEventListener("mouseup",l,!1),e(o),n.current=!1};document.addEventListener("mousemove",i,!1),document.addEventListener("mouseup",l,!1)}},f)}function ty(y,d,g){return y>d?d:y<g?g:y}function ey(y){if(!y.startsWith("#")){const d=document.createElement("canvas").getContext("2d");if(!d)throw new Error("2d context not supported or canvas already initialized");return d.fillStyle=y,d.fillStyle}return y.length===4||y.length===5?y=y.split("").map((d,g)=>g?d+d:"#").join(""):y.length===7||y.length===9?y:"#000000"}function ny(y){const d=(y.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(g,t,f,r)=>"#"+t+t+f+f+r+r).substring(1).match(/.{2}/g)||[]).map(g=>parseInt(g,16));return{b:d[2],g:d[1],r:d[0]}}function Xf(y){let{r:d,g,b:t}=y;d/=255,g/=255,t/=255;const f=Math.max(d,g,t),r=f-Math.min(d,g,t);return{h:r?60*(f===d?(g-t)/r+(g<t?6:0):f===g?2+(t-d)/r:4+(d-g)/r):0,s:f?r/f*100:0,v:100*f}}function qS(y){let{h:d,s:g,v:t}=y;g/=100,t/=100;const f=~~(d/60),r=d/60-f,n=t*(1-g),e=t*(1-g*r),s=t*(1-g*(1-r)),i=f%6,l=Math.round(255*[t,e,n,n,s,t][i]),o=Math.round(255*[s,t,t,e,n,n][i]);return{b:Math.round(255*[n,n,s,t,t,e][i]),g:o,r:l}}function ry(y){let{b:d,g,r:t}=y;return"#"+[t,g,d].map(f=>f.toString(16).padStart(2,"0")).join("")}function Ms(y,d){let g=ey("#121212"),t=ny(g),f=Xf(t);return y==="hex"?(g=ey(d),t=ny(g),f=Xf(t)):y==="rgb"?(t=d,g=ry(t),f=Xf(t)):y==="hsv"&&(f=d,t=qS(f),g=ry(t)),{hex:g,hsv:f,rgb:t}}const JS=Gt.createContext(null),oy=4;function VS(y){let{children:d,dropDownRef:g,onClose:t,dropdownClassName:f}=y;const[r,n]=(0,Gt.useState)(),[e,s]=(0,Gt.useState)(),i=(0,Gt.useCallback)(o=>{n(a=>a?[...a,o]:[o])},[n]),l=(0,Gt.useMemo)(()=>({registerItem:i}),[i]);return(0,Gt.useEffect)(()=>{r&&!e&&s(r[0]),e&&e.current&&e.current.focus()},[r,e]),Gt.createElement(JS.Provider,{value:l},Gt.createElement("div",{className:f,ref:g,onKeyDown:o=>{if(!r)return;const a=o.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(a)&&o.preventDefault(),a==="Escape"||a==="Tab"?t():a==="ArrowUp"?s(c=>{if(!c)return r[0];const u=r.indexOf(c)-1;return r[u===-1?r.length-1:u]}):a==="ArrowDown"&&s(c=>c?r[r.indexOf(c)+1]:r[0])}},d))}function WS(y){let{disabled:d=!1,buttonLabel:g,buttonAriaLabel:t,buttonClassName:f,buttonIconClassName:r,children:n,stopCloseOnClickSelf:e,dropdownClassName:s,buttonLabelClassName:i,dropdownChevronClassName:l}=y;const o=(0,Gt.useRef)(null),a=(0,Gt.useRef)(null),[c,u]=(0,Gt.useState)(!1);return(0,Gt.useEffect)(()=>{const h=a.current,p=o.current;if(c&&h!==null&&p!==null){const{top:m,left:b}=h.getBoundingClientRect();p.style.top=`${m+h.offsetHeight+oy}px`,p.style.left=`${Math.min(b,window.innerWidth-p.offsetWidth-20)}px`}},[o,a,c]),(0,Gt.useEffect)(()=>{const h=a.current;if(h!==null&&c){const p=m=>{const b=m.target;e&&o.current&&o.current.contains(b)||h.contains(b)||u(!1)};return document.addEventListener("click",p),()=>{document.removeEventListener("click",p)}}},[o,a,c,e]),(0,Gt.useEffect)(()=>{const h=()=>{if(c){const p=a.current,m=o.current;if(p!==null&&m!==null){const{top:b}=p.getBoundingClientRect(),_=b+p.offsetHeight+oy;_!==m.getBoundingClientRect().top&&(m.style.top=`${_}px`)}}};return document.addEventListener("scroll",h),()=>{document.removeEventListener("scroll",h)}},[a,o,c]),Gt.createElement(Gt.Fragment,null,Gt.createElement("button",{type:"button",disabled:d,"aria-label":t||g,className:f,onClick:()=>u(!c),ref:a},r&&Gt.createElement("span",{className:r}),g&&Gt.createElement("span",{className:i},g),Gt.createElement("i",{className:l})),c&&(0,Os.createPortal)(Gt.createElement(VS,{dropDownRef:o,onClose:()=>{u(!1),a&&a.current&&a.current.focus()},dropdownClassName:s},n),document.body))}const KS=["disabled","stopCloseOnClickSelf","color","onChange"];function tp(){return tp=Object.assign?Object.assign.bind():function(y){for(var d=1;d<arguments.length;d++){var g=arguments[d];for(var t in g)({}).hasOwnProperty.call(g,t)&&(y[t]=g[t])}return y},tp.apply(null,arguments)}function GS(y,d){if(y==null)return{};var g,t,f=YS(y,d);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(y);for(t=0;t<r.length;t++)g=r[t],d.indexOf(g)>=0||{}.propertyIsEnumerable.call(y,g)&&(f[g]=y[g])}return f}function YS(y,d){if(y==null)return{};var g={};for(var t in y)if({}.hasOwnProperty.call(y,t)){if(d.indexOf(t)>=0)continue;g[t]=y[t]}return g}function iy(y){let{disabled:d=!1,stopCloseOnClickSelf:g=!0,color:t,onChange:f}=y,r=GS(y,KS);return Gt.createElement(WS,tp({},r,{disabled:d,stopCloseOnClickSelf:g}),Gt.createElement(HS,{color:t,onChange:f}))}const ZS=y=>{let{onColorChange:d,buttonClassName:g,buttonIconClassName:t,buttonAriaLabel:f,buttonLabel:r,dropdownClassName:n,buttonLabelClassName:e,dropdownChevronClassName:s}=y;const[i]=(0,Fi.useLexicalComposerContext)(),[l,o]=(0,Gt.useState)(()=>i.isEditable()),[a,c]=(0,Gt.useState)("");(0,Gt.useEffect)(()=>(0,bs.mergeRegister)(i.registerEditableListener(h=>{o(h)}),i.registerUpdateListener(h=>{let{editorState:p}=h;p.read(()=>{const m=(0,be.$getSelection)();if((0,be.$isRangeSelection)(m)){let b=(0,Ca.$getSelectionStyleValueForProperty)(m,"color");b!==a&&(c(b||""),d(b))}})})),[i]);const u=(0,Gt.useCallback)((h,p)=>{i.update(()=>{const m=(0,be.$getSelection)();m!==null&&(0,Ca.$patchStyleText)(m,{color:h})})},[i]);return Gt.createElement(iy,{disabled:!l,color:a,onChange:u,buttonClassName:g||"",buttonIconClassName:t||"",buttonAriaLabel:f||"",buttonLabel:r||"",dropdownClassName:n||"",buttonLabelClassName:e||"",dropdownChevronClassName:s||""})},QS=ZS,XS=y=>{let{onColorChange:d,buttonClassName:g,buttonIconClassName:t,buttonAriaLabel:f,buttonLabel:r,dropdownClassName:n,buttonLabelClassName:e,dropdownChevronClassName:s}=y;const[i]=(0,Fi.useLexicalComposerContext)(),[l,o]=(0,Gt.useState)(()=>i.isEditable()),[a,c]=(0,Gt.useState)("#fff");(0,Gt.useEffect)(()=>(0,bs.mergeRegister)(i.registerEditableListener(h=>{o(h)}),i.registerUpdateListener(h=>{let{editorState:p}=h;p.read(()=>{const m=(0,be.$getSelection)();if((0,be.$isRangeSelection)(m)){let b=(0,Ca.$getSelectionStyleValueForProperty)(m,"background-color");b!==a&&(c(b||""),d(b))}})})),[i]);const u=(0,Gt.useCallback)((h,p)=>{i.update(()=>{const m=(0,be.$getSelection)();m!==null&&(0,Ca.$patchStyleText)(m,{"background-color":h})})},[i]);return Gt.createElement(iy,{disabled:!l,color:a,onChange:u,buttonClassName:g||"",buttonIconClassName:t||"",buttonAriaLabel:f||"",buttonLabel:r||"",dropdownClassName:n||"",buttonLabelClassName:e||"",dropdownChevronClassName:s||""})},t2=XS;var e2=Mi.yy;Mi._U,Mi.a8,Mi.Vs,Mi.Cn;var n2=Mi.gK,r2=Mi.vv;function o2(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var Nu=o2(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function i2({hasCellMerge:y=!0,hasCellBackgroundColor:d=!0,hasTabHandler:g=!0}){const[t]=jr();return Ce.useEffect(()=>(t.hasNodes([bo,Ao,xa])||Nu(10),mo(t.registerCommand(i_,({columns:f,rows:r,includeHeaders:n})=>{const e=Lm(Number(r),Number(f),n);um(e);const s=e.getFirstDescendant();return Ne(s)&&s.select(),!0},an),t.registerNodeTransform(bo,f=>{const[r]=Um(f,null,null),n=r.reduce((e,s)=>Math.max(e,s.length),0);for(let e=0;e<r.length;++e){const s=r[e].length;if(s===n)continue;const i=r[e][s-1].cell;for(let l=s;l<n;++l){const o=Xo(0);o.append(Un()),i!==null?i.insertAfter(o):dm(i,o)}}}))),[t]),Ce.useEffect(()=>{const f=new Map,r=e=>{const s=e.getKey(),i=t.getElementByKey(s);if(i&&!f.has(s)){const l=b_(e,i,t,g);f.set(s,l)}};t.getEditorState().read(()=>{const e=Xh(bo);for(const s of e)Pn(s)&&r(s)});const n=t.registerMutationListener(bo,e=>{for(const[s,i]of e)if(i==="created")t.getEditorState().read(()=>{const l=Vn(s);Pn(l)&&r(l)});else if(i==="destroyed"){const l=f.get(s);l!==void 0&&(l.removeListeners(),f.delete(s))}});return()=>{n();for(const[,e]of f)e.removeListeners()}},[t,g]),Ce.useEffect(()=>{if(!y)return t.registerNodeTransform(Ao,f=>{if(f.getColSpan()>1||f.getRowSpan()>1){const[,,r]=qr(f),[n]=Po(r,f,f),e=n.length,s=n[0].length;let i=r.getFirstChild();sr(i)||Nu(175);const l=[];for(let o=0;o<e;o++){o!==0&&(i=i.getNextSibling(),sr(i)||Nu(175));let a=null;for(let c=0;c<s;c++){const u=n[o][c],h=u.cell;if(u.startRow===o&&u.startColumn===c)a=h,l.push(h);else if(h.getColSpan()>1||h.getRowSpan()>1){rn(h)||Nu(176);const p=Xo(h.__headerState);a!==null?a.insertAfter(p):dm(i,p)}}}for(const o of l)o.setColSpan(1),o.setRowSpan(1)}})},[t,y]),Ce.useEffect(()=>{if(!d)return t.registerNodeTransform(Ao,f=>{f.getBackgroundColor()!==null&&f.setBackgroundColor(null)})},[t,d,y]),null}const a2={code:"editor-code",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough",underline:"editor-text-underline",underlineStrikethrough:"editor-text-underlineStrikethrough"},table:"PlaygroundEditorTheme__table",tableAddColumns:"PlaygroundEditorTheme__tableAddColumns",tableAddRows:"PlaygroundEditorTheme__tableAddRows",tableCell:"PlaygroundEditorTheme__tableCell",tableCellActionButton:"PlaygroundEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"PlaygroundEditorTheme__tableCellActionButtonContainer",tableCellEditing:"PlaygroundEditorTheme__tableCellEditing",tableCellHeader:"PlaygroundEditorTheme__tableCellHeader",tableCellPrimarySelected:"PlaygroundEditorTheme__tableCellPrimarySelected",tableCellResizer:"PlaygroundEditorTheme__tableCellResizer",tableCellSelected:"PlaygroundEditorTheme__tableCellSelected",tableCellSortedIndicator:"PlaygroundEditorTheme__tableCellSortedIndicator",tableResizeRuler:"PlaygroundEditorTheme__tableCellResizeRuler",tableSelected:"PlaygroundEditorTheme__tableSelected",tableSelection:"PlaygroundEditorTheme__tableSelection"},s2="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDE1IDE1IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMDAwMDEgOC4zMzMzM0wxLjkwMDAxIDEzLjhMMS4xMDAwMSAxMy4yTDUuMzc1MDEgNy41TDEuMTAwMDEgMS44TDEuOTAwMDEgMS4yTDYuMDAwMDEgNi42NjY2N0wxMC4xIDEuMkwxMC45IDEuOEw2LjYyNTAxIDcuNUwxMC45IDEzLjJMMTAuMSAxMy44TDYuMDAwMDEgOC4zMzMzM1pNMTIgMTIuNUMxMiAxMS42NzE2IDEyLjY3MTYgMTEgMTMuNSAxMUgxMy43OTI5QzE0LjQ1OTYgMTEgMTUgMTEuNTQwNCAxNSAxMi4yMDcxQzE1IDEyLjUyNzMgMTQuODcyOCAxMi44MzQzIDE0LjY0NjUgMTMuMDYwN0wxMy43MDcxIDE0SDE1VjE1SDEyLjVDMTIuMjk3OCAxNSAxMi4xMTU1IDE0Ljg3ODIgMTIuMDM4MSAxNC42OTEzQzExLjk2MDcgMTQuNTA0NSAxMi4wMDM1IDE0LjI4OTQgMTIuMTQ2NSAxNC4xNDY0TDEzLjkzOTMgMTIuMzUzNkMxMy45NzgyIDEyLjMxNDcgMTQgMTIuMjYyIDE0IDEyLjIwNzFDMTQgMTIuMDkyNyAxMy45MDczIDEyIDEzLjc5MjkgMTJIMTMuNUMxMy4yMjM5IDEyIDEzIDEyLjIyMzkgMTMgMTIuNUgxMloiIGZpbGw9IiMwMDAwMDAiLz4KPC9zdmc+",l2="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiBpbWFnZS1yZW5kZXJpbmc9Im9wdGltaXplUXVhbGl0eSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCA1MDQgNTEyLjM2Ij48cGF0aCBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik00OTkuNDMgMjMxLjM2SDM2OC40Yy0yLjUzIDAtNC41OC0yLjA1LTQuNTgtNC41N3YtOC4xMWMwLTEuMjYuNTItMi40IDEuMzQtMy4yMmw3MS41Ny04Mi41M2M2LjczLTcuNzUgMTIuNTctMTQuOTcgMTcuNDgtMjEuNjggNC44OC02LjY0IDguODMtMTIuNzQgMTEuODUtMTguMjggMi45Ny01LjQzIDUuMTgtMTAuNjEgNi42NC0xNS41NSAxLjQyLTQuODUgMi4xMy05LjUzIDIuMTMtMTQgMC0xNC42OC0zLjk4LTI2LjA1LTExLjkyLTM0LjA5LTMuOTItMy45Ni04Ljc1LTYuOTMtMTQuNDktOC45Mi01Ljk1LTIuMDMtMTIuOTEtMy4wNS0yMC44Ny0zLjA1LTguNDUgMC0xNS44OCAxLjIxLTIyLjI5IDMuNjItNi4yNyAyLjM2LTExLjYzIDUuOTItMTYuMDcgMTAuNjNhNDcuODg0IDQ3Ljg4NCAwIDAgMC0xMC4xNCAxNi42Yy0yLjI3IDYuMjktMy40MSAxMy4zOS0zLjQxIDIxLjI2IDAgMi41Mi0yLjA1IDQuNTctNC41NyA0LjU3aC02Ljg5Yy0yLjA1IDAtMy44LTEuMzYtNC4zNy0zLjI0bC0uMjctLjgyYy0uMTgtLjU2LS4yNS0xLjEzLS4yMi0xLjY3LS4yMy05LjMyIDEuMTQtMTcuOTkgNC4xMi0yNS45NyAzLjAyLTguMTMgNy42OC0xNS41NCAxMy45NC0yMi4xOSA2LjI2LTYuNyAxMy42My0xMS43NiAyMi4xLTE1LjEzQzQwNy44NCAxLjY4IDQxNy4yIDAgNDI3LjU1IDBjOS41OSAwIDE4LjI2IDEuMzggMjYuMDMgNC4xMyA3Ljg2IDIuNzkgMTQuNzcgNyAyMC43MiAxMi42MSA2LjAyIDUuNjMgMTAuNTUgMTIuNCAxMy41NSAyMC4yOCAyLjk2IDcuNzUgNC40NSAxNi41NiA0LjQ1IDI2LjQgMCA2LjUtMS4wNyAxMy4wOC0zLjE3IDE5LjY5bC0uMTQuMzhjLTIuMDkgNi40Ni01LjE3IDEyLjk3LTkuMiAxOS40OWwtLjE0LjIxYy00LjA4IDYuNTEtOC45IDEzLjQzLTE0LjQzIDIwLjc0LTUuNTYgNy4zMy0xMS45NiAxNS4yMy0xOS4yMiAyMy42N2wtNTYuOTEgNjYuNTFoMTEwLjM0YzIuNTIgMCA0LjU3IDIuMDUgNC41NyA0LjU3djguMTFjMCAyLjUyLTIuMDUgNC41Ny00LjU3IDQuNTd6bS0zMjcuMjUgNjguNzUgMTM3Ljk2LTE2Ny43NmMuODktMS4wNyAyLjMtMS42NSAzLjc0LTEuNjVsMjAuMTMtLjAyYzIuNTIgMCA0LjU3IDEuNzQgNC41NyAzLjg4IDAgLjkxLS4zNyAxLjc1LS45OCAyLjQxTDE4OC4zMiAzMTcuNjYgMzQ0LjEgNTA2LjI0YzEuNDUgMS43NS45NSA0LjE3LTEuMSA1LjQtLjguNDgtMS43Mi43MS0yLjYzLjcxbC0yMC4xMy4wMWMtMS43IDAtMy4xOC0uNzktMy45Ny0xLjk2bC0xNDQuMS0xNzUuMkwyOC4yMyA1MTAuNjljLS44OCAxLjA3LTIuMyAxLjY0LTMuNzMgMS42NWwtMTkuOTMuMDJjLTIuNTIgMC00LjU3LTEuNzQtNC41Ny0zLjg5IDAtLjkuMzctMS43NC45OC0yLjRsMTU1LjY1LTE4OC40TDYuOSAxMzYuOGMtMS40NS0xLjc1LS45NS00LjE4IDEuMTEtNS40MS43OS0uNDcgMS43MS0uNyAyLjYyLS43bDIwLjQ0LS4wMWMxLjYzIDAgMy4wNi43MiAzLjg3IDEuODFsMTM3LjI0IDE2Ny42MnoiLz48L3N2Zz4=",ay=Qn.createContext(null),sy=4;function Iu({children:y,className:d,onClick:g,title:t}){const f=Ce.useRef(null),r=Qn.useContext(ay);if(r===null)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:n}=r;return Ce.useEffect(()=>{f&&f.current&&n(f)},[f,n]),he.jsx("button",{className:d,onClick:g,ref:f,title:t,type:"button",children:y})}function c2({children:y,dropDownRef:d,onClose:g}){const[t,f]=Ce.useState(),[r,n]=Ce.useState(),e=Ce.useCallback(l=>{f(o=>o?[...o,l]:[l])},[f]),s=l=>{if(!t)return;const o=l.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(o)&&l.preventDefault(),o==="Escape"||o==="Tab"?g():o==="ArrowUp"?n(a=>{if(!a)return t[0];const c=t.indexOf(a)-1;return t[c===-1?t.length-1:c]}):o==="ArrowDown"&&n(a=>a?t[t.indexOf(a)+1]:t[0])},i=Ce.useMemo(()=>({registerItem:e}),[e]);return Ce.useEffect(()=>{t&&!r&&n(t[0]),r&&r.current&&r.current.focus()},[t,r]),he.jsx(ay.Provider,{value:i,children:he.jsx("div",{className:"dropdown",ref:d,onKeyDown:s,children:y})})}function u2({disabled:y=!1,buttonLabel:d,buttonAriaLabel:g,buttonClassName:t,buttonIconClassName:f,children:r,stopCloseOnClickSelf:n}){const e=Ce.useRef(null),s=Ce.useRef(null),[i,l]=Ce.useState(!1),o=()=>{l(!1),s&&s.current&&s.current.focus()};return Ce.useEffect(()=>{const a=s.current,c=e.current;if(i&&a!==null&&c!==null){const{top:u,left:h}=a.getBoundingClientRect();c.style.top=`${u+a.offsetHeight+sy}px`,c.style.left=`${Math.min(h,window.innerWidth-c.offsetWidth-20)}px`}},[e,s,i]),Ce.useEffect(()=>{const a=s.current;if(a!==null&&i){const c=u=>{const h=u.target;n&&e.current&&e.current.contains(h)||a.contains(h)||l(!1)};return document.addEventListener("click",c),()=>{document.removeEventListener("click",c)}}},[e,s,i,n]),Ce.useEffect(()=>{const a=()=>{if(i){const c=s.current,u=e.current;if(c!==null&&u!==null){const{top:h}=c.getBoundingClientRect(),p=h+c.offsetHeight+sy;p!==u.getBoundingClientRect().top&&(u.style.top=`${p}px`)}}};return document.addEventListener("scroll",a),()=>{document.removeEventListener("scroll",a)}},[s,e,i]),he.jsxs(he.Fragment,{children:[he.jsxs("button",{type:"button",disabled:y,"aria-label":g||d,className:t,onClick:()=>l(!i),ref:s,children:[f&&he.jsx("span",{className:f}),d&&he.jsx("span",{className:"text dropdown-button-text",children:d}),he.jsx("i",{className:"chevron-down"})]}),i&&$r.createPortal(he.jsx(c2,{dropDownRef:e,onClose:o,children:r}),document.body)]})}function ly(){return he.jsx("div",{className:"divider"})}const ep=8,np=72,Ds={h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",paragraph:"Normal"},rp={h1:{fontFamily:"Arial",fontSize:25,fontColor:"#000000",leadingSpace:.5,trailingSpace:.5},h2:{fontFamily:"Verdana",fontSize:20,fontColor:"#111111",leadingSpace:.3,trailingSpace:.4},h3:{fontFamily:"Arial",fontSize:16,fontColor:"#222222",leadingSpace:.2,trailingSpace:.3},paragraph:{fontFamily:"Arial",fontSize:11,fontColor:"#333333",leadingSpace:.1,trailingSpace:.2}};function d2({selectionFontSize:y,disabled:d,editor:g,blockType:t}){const[f,r]=Qn.useState(y),[n,e]=Qn.useState(t),s=c=>{g.update(()=>{if(g.isEditable()){const u=Oe();u!==null&&im(u,c)}})},i=c=>{r(c.target.value)},l=()=>{const c=Number(f);if(!isNaN(c)){const u=Math.min(Math.max(c,ep),np);r(String(u)),s({"font-size":`${u}px`})}},o=c=>{const u=rp[n].fontSize,h=c?Math.min(u+2,np):Math.max(u-2,ep);r(String(h)),s({"font-size":`${h}px`})},a=c=>{if(e(c),c==="paragraph"){const u=rp.paragraph;cy(),r(String(u.fontSize)),s({"font-size":`${u.fontSize}px`,color:u.fontColor,"font-family":u.fontFamily,"line-height":`${1+u.leadingSpace}em`,"margin-bottom":`${u.trailingSpace}em`})}else{const{fontSize:u,fontColor:h,fontFamily:p,leadingSpace:m,trailingSpace:b}=rp[c];cy(),r(String(u)),s({"font-size":`${u}px`,color:h,"font-family":p,"line-height":`${1+m}em`,"margin-bottom":`${b}em`})}};return Qn.useEffect(()=>{const c=()=>{g.update(()=>{const u=Oe();if(u!==null){const p=u.getNodes()[0];if(!Ne(p)){const m=p.getType();m in Ds&&e(m)}}})};return g.registerUpdateListener(c),()=>{g.registerUpdateListener(c)}},[g]),he.jsxs(he.Fragment,{children:[he.jsx("button",{type:"button",disabled:d,onClick:()=>o(!1),className:"toolbar-item font-decrement"}),he.jsx("input",{type:"number",value:f,disabled:d,readOnly:!0,className:"toolbar-item font-size-input",min:ep,max:np,onChange:i,onBlur:l}),he.jsx("button",{type:"button",disabled:d,onClick:()=>o(!0),className:"toolbar-item font-increment"}),he.jsx(ly,{}),he.jsxs("div",{className:"symbol-dropdown cust-head-dropDown",children:[he.jsxs(u2,{disabled:d,buttonClassName:"toolbar-item block-controls",buttonAriaLabel:"Formatting options for text style",buttonIconClassName:"icon block-type "+n,buttonLabel:Ds[n],children:[he.jsxs(Iu,{className:`item ${n==="paragraph"?"active":""}`,onClick:()=>a("paragraph"),children:[he.jsx("i",{className:"icon paragraph"}),he.jsx("span",{className:"text",children:Ds.paragraph})]}),he.jsxs(Iu,{className:`item ${n==="h1"?"active":""}`,onClick:()=>a("h1"),children:[he.jsx("i",{className:"icon h1"}),he.jsx("span",{className:"text",children:Ds.h1})]}),he.jsxs(Iu,{className:`item ${n==="h2"?"active":""}`,onClick:()=>a("h2"),children:[he.jsx("i",{className:"icon h2"}),he.jsx("span",{className:"text",children:Ds.h2})]}),he.jsxs(Iu,{className:`item ${n==="h3"?"active":""}`,onClick:()=>a("h3"),children:[he.jsx("i",{className:"icon h3"}),he.jsx("span",{className:"text",children:Ds.h3})]})]}),he.jsx(ly,{})]})]})}function cy(y){throw new Error("Function not implemented.")}const f2="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuMS4xIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIyIEZvbnRpY29ucywgSW5jLi0tPjxwYXRoIGQ9Ik0wIDI1NkMwIDExNC42IDExNC42IDAgMjU2IDBzMjU2IDExNC42IDI1NiAyNTYtMTE0LjYgMjU2LTI1NiAyNTZTMCAzOTcuNCAwIDI1NnptMTc1LTQ3LjkgNDcuMSA0N0wxNzUgMzAzYy05LjMgOS40LTkuMyAyNC42IDAgMzMuMSA5LjQgMTAuMiAyNC42IDEwLjIgMzMuMSAwbDQ3LTQ2LjIgNDcuOSA0Ni4yYzkuNCAxMC4yIDI0LjYgMTAuMiAzMy4xIDAgMTAuMi04LjUgMTAuMi0yMy43IDAtMzMuMWwtNDYuMi00Ny45IDQ2LjItNDdjMTAuMi04LjUgMTAuMi0yMy43IDAtMzMuMS04LjUtOS4zLTIzLjctOS4zLTMzLjEgMGwtNDcuOSA0Ny4xLTQ3LTQ3LjFjLTguNS05LjMtMjMuNy05LjMtMzMuMSAwLTkuMyA5LjQtOS4zIDI0LjYgMCAzMy4xeiIvPjwvc3ZnPg==",p2="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iY3VycmVudENvbG9yIiBjbGFzcz0iYmkgYmktdGFibGUiPjxwYXRoIGQ9Ik0wIDJhMiAyIDAgMCAxIDItMmgxMmEyIDIgMCAwIDEgMiAydjEyYTIgMiAwIDAgMS0yIDJIMmEyIDIgMCAwIDEtMi0yVjJ6bTE1IDJoLTR2M2g0VjR6bTAgNGgtNHYzaDRWOHptMCA0aC00djNoM2ExIDEgMCAwIDAgMS0xdi0yem0tNSAzdi0zSDZ2M2g0em0tNSAwdi0zSDF2MmExIDEgMCAwIDAgMSAxaDN6bS00LTRoNFY4SDF2M3ptMC00aDRWNEgxdjN6bTUtM3YzaDRWNEg2em00IDRINnYzaDRWOHoiLz48L3N2Zz4=";function h2(){const[y,d]=Ce.useState("4"),[g,t]=Ce.useState("4"),[f,r]=Ce.useState(!1),[n,e]=Ce.useState(),[s]=jr(),i=()=>{!y||!g||(s.update(()=>{const l=Lm(y,g,!0),o=um(l);e(o)}),r(!1))};return he.jsxs(he.Fragment,{children:[he.jsx("button",{className:"toolbar-item ",onClick:()=>r(!0),children:he.jsx("img",{className:"add-toolbar-table-icon",src:p2,alt:"Add Table"})}),f&&he.jsx("div",{className:"modal-overlay",children:he.jsxs("div",{className:"modal-content",children:[he.jsx("h3",{children:"Select Table Dimensions"}),he.jsx("button",{className:"modal-buttons-close",onClick:()=>r(!1),children:he.jsx("img",{src:f2,height:16,width:16,style:{margin:"0 0 29px 10px"}})}),he.jsxs("div",{className:"select-table-container",children:[he.jsx("label",{children:"Rows"}),he.jsx("input",{type:"number",value:y,onChange:l=>d(Number(l.target.value))})]}),he.jsxs("div",{className:"select-table-container",children:[he.jsx("label",{children:"Column"}),he.jsx("input",{type:"number",value:g,onChange:l=>t(Number(l.target.value))})]}),he.jsx("div",{children:he.jsx("div",{className:"modal-buttons",children:he.jsx("button",{className:"toolbar-item",onClick:i,children:"Confirm"})})})]})})]})}const uy="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNNCAxMkgyME0xMiA0VjIwIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPg==",dy="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNNiAxMkwxOCAxMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4=";var g2=typeof global=="object"&&global&&global.Object===Object&&global;const m2=g2;var y2=typeof self=="object"&&self&&self.Object===Object&&self,b2=m2||y2||Function("return this")();const fy=b2;var v2=fy.Symbol;const Ru=v2;var py=Object.prototype,_2=py.hasOwnProperty,x2=py.toString,ql=Ru?Ru.toStringTag:void 0;function w2(y){var d=_2.call(y,ql),g=y[ql];try{y[ql]=void 0;var t=!0}catch{}var f=x2.call(y);return t&&(d?y[ql]=g:delete y[ql]),f}var S2=Object.prototype,C2=S2.toString;function E2(y){return C2.call(y)}var k2="[object Null]",O2="[object Undefined]",hy=Ru?Ru.toStringTag:void 0;function T2(y){return y==null?y===void 0?O2:k2:hy&&hy in Object(y)?w2(y):E2(y)}function j2(y){return y!=null&&typeof y=="object"}var A2="[object Symbol]";function P2(y){return typeof y=="symbol"||j2(y)&&T2(y)==A2}var N2=/\s/;function I2(y){for(var d=y.length;d--&&N2.test(y.charAt(d)););return d}var R2=/^\s+/;function M2(y){return y&&y.slice(0,I2(y)+1).replace(R2,"")}function op(y){var d=typeof y;return y!=null&&(d=="object"||d=="function")}var gy=0/0,D2=/^[-+]0x[0-9a-f]+$/i,L2=/^0b[01]+$/i,B2=/^0o[0-7]+$/i,F2=parseInt;function my(y){if(typeof y=="number")return y;if(P2(y))return gy;if(op(y)){var d=typeof y.valueOf=="function"?y.valueOf():y;y=op(d)?d+"":d}if(typeof y!="string")return y===0?y:+y;y=M2(y);var g=L2.test(y);return g||B2.test(y)?F2(y.slice(2),g?2:8):D2.test(y)?gy:+y}var z2=function(){return fy.Date.now()};const ip=z2;var U2="Expected a function",$2=Math.max,H2=Math.min;function q2(y,d,g){var t,f,r,n,e,s,i=0,l=!1,o=!1,a=!0;if(typeof y!="function")throw new TypeError(U2);d=my(d)||0,op(g)&&(l=!!g.leading,o="maxWait"in g,r=o?$2(my(g.maxWait)||0,d):r,a="trailing"in g?!!g.trailing:a);function c(x){var S=t,E=f;return t=f=void 0,i=x,n=y.apply(E,S),n}function u(x){return i=x,e=setTimeout(m,d),l?c(x):n}function h(x){var S=x-s,E=x-i,k=d-S;return o?H2(k,r-E):k}function p(x){var S=x-s,E=x-i;return s===void 0||S>=d||S<0||o&&E>=r}function m(){var x=ip();if(p(x))return b(x);e=setTimeout(m,h(x))}function b(x){return e=void 0,a&&t?c(x):(t=f=void 0,n)}function _(){e!==void 0&&clearTimeout(e),i=0,t=s=f=e=void 0}function v(){return e===void 0?n:b(ip())}function w(){var x=ip(),S=p(x);if(t=arguments,f=this,s=x,S){if(e===void 0)return u(s);if(o)return clearTimeout(e),e=setTimeout(m,d),c(s)}return e===void 0&&(e=setTimeout(m,d)),n}return w.cancel=_,w.flush=v,w}function J2(y,d,g){const t=Ce.useRef(null);return t.current=y,Ce.useMemo(()=>q2((...f)=>{t.current&&t.current(...f)},d,{maxWait:g}),[d,g])}const yy=20;function V2({anchorElem:y}){const[d]=jr(),g=au(),[t,f]=Ce.useState(!1),[r,n]=Ce.useState(!1),[e,s]=Ce.useState(!1),[i,l]=Ce.useState({}),o=Ce.useRef(new Set),a=Ce.useRef(null),c=J2(m=>{const{isOutside:b,tableDOMNode:_}=W2(m);if(b){f(!1),n(!1);return}if(!_)return;a.current=_;let v=null,w=null,x=null;if(d.update(()=>{var E;const S=rr(_);if(rn(S)){const k=vn(S,D=>Pn(D));if(!Pn(k))return;if(x=d.getElementByKey(k==null?void 0:k.getKey()),x){const D=k.getChildrenSize(),P=(E=k.getChildAtIndex(0))==null?void 0:E.getChildrenSize(),O=u_(S),R=Fm(S);O===D-1?v=S:R===P-1&&(w=S)}}}),x){const{width:S,y:E,right:k,left:D,bottom:P,height:O}=x.getBoundingClientRect(),{y:R,left:A}=y.getBoundingClientRect();v?(n(!1),f(!0),l({height:yy,left:D-A,top:P-R+5,width:S})):w&&(n(!0),f(!1),l({height:O,left:k-A+5,top:E-R,width:yy}))}},50,250),u=Ce.useMemo(()=>new ResizeObserver(()=>{f(!1),n(!1)}),[]);Ce.useEffect(()=>{if(e)return document.addEventListener("mousemove",c),()=>{f(!1),n(!1),c.cancel(),document.removeEventListener("mousemove",c)}},[e,c]),Ce.useEffect(()=>mo(d.registerMutationListener(bo,m=>{d.getEditorState().read(()=>{for(const[b,_]of m){const v=d.getElementByKey(b);switch(_){case"created":o.current.add(b),s(o.current.size>0),v&&u.observe(v);break;case"destroyed":o.current.delete(b),s(o.current.size>0),u.disconnect(),o.current.forEach(w=>{const x=d.getElementByKey(w);x&&u.observe(x)});break}}})})),[d,u]);const h=m=>{d.update(()=>{if(a.current){const b=rr(a.current);b==null||b.selectEnd(),m?(d_(),f(!1)):(f_(),n(!1))}})},p=m=>{d.update(()=>{if(a.current){const b=rr(a.current);b==null||b.selectEnd(),m?(p_(),f(!1)):(h_(),n(!1))}})};return g?he.jsxs(he.Fragment,{children:[t&&he.jsxs("div",{children:[he.jsx("button",{className:"PlaygroundEditorTheme__tableAddRows",style:{...i,flex:"50%",padding:"20px"},onClick:()=>h(!0),children:he.jsx("img",{src:uy,height:14,width:14,style:{color:"grey",marginLeft:"-3px"}})}),he.jsx("button",{className:"PlaygroundEditorTheme__tableAddRows",style:{...i,flex:"50%"},onClick:()=>p(!0),children:he.jsx("img",{src:dy,height:14,width:14,style:{color:"grey",marginLeft:"-3px"}})})]}),r&&he.jsxs("div",{className:"table-add-row-flex-container",children:[he.jsx("button",{className:"PlaygroundEditorTheme__tableAddColumns table-add-row-flex-children",style:{...i,flex:"50%",padding:"20px"},onClick:()=>h(!1),children:he.jsx("img",{src:uy,height:14,width:14,style:{color:"grey",marginLeft:"-3px"}})}),he.jsx("button",{className:"PlaygroundEditorTheme__tableAddColumns table-add-row-flex-children",style:{...i,flex:"50%"},onClick:()=>p(!1),children:he.jsx("img",{src:dy,height:14,width:14,style:{color:"grey",marginLeft:"-3px"}})})]})]}):null}function W2(y){const d=y.target;if(d&&d instanceof HTMLElement){const g=d.closest("td.PlaygroundEditorTheme__tableCell, th.PlaygroundEditorTheme__tableCell");return{isOutside:!(g||d.closest("button.PlaygroundEditorTheme__tableAddRows")||d.closest("button.PlaygroundEditorTheme__tableAddColumns")||d.closest("div.TableCellResizer__resizer")),tableDOMNode:g}}else return{isOutside:!0,tableDOMNode:null}}function K2({anchorElem:y=document.body}){return au()?$r.createPortal(he.jsx(V2,{anchorElem:y}),y):null}const ap=1;function sp(){return he.jsx("div",{className:"divider"})}function G2({renderOnlineUsers:y}){const[d]=jr(),g=Ce.useRef(null),[t,f]=Ce.useState(!1),[r,n]=Ce.useState(!1),[e,s]=Ce.useState(!1),[i,l]=Ce.useState(!1),[o,a]=Ce.useState(!1),[c,u]=Ce.useState(!1),[h,p]=Ce.useState(!1),[m,b]=Ce.useState(!1),[_,v]=Ce.useState("11px"),[w,x]=Ce.useState(()=>d.isEditable()),S=Ce.useCallback(()=>{const E=Oe();xe(E)&&(s(E.hasFormat("bold")),l(E.hasFormat("italic")),a(E.hasFormat("underline")),u(E.hasFormat("strikethrough")),p(E.hasFormat("subscript")),b(E.hasFormat("superscript")),v(am(E,"font-size","11px")))},[]);return Ce.useEffect(()=>mo(d.registerUpdateListener(({editorState:E})=>{E.read(()=>{S()})}),d.registerCommand(Wo,(E,k)=>(S(),!1),ap),d.registerCommand(ts,E=>(f(E),!1),ap),d.registerCommand(Xa,E=>(n(E),!1),ap)),[d,S]),he.jsxs("div",{className:"toolbar",ref:g,children:[he.jsx("button",{disabled:!t,onClick:()=>{d.dispatchCommand(cl,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:he.jsx("i",{className:"format undo"})}),he.jsx("button",{disabled:!r,onClick:()=>{d.dispatchCommand(ul,void 0)},className:"toolbar-item","aria-label":"Redo",children:he.jsx("i",{className:"format redo"})}),he.jsx(sp,{}),he.jsx(d2,{selectionFontSize:_.slice(0,-2),editor:d,disabled:!w,blockType:"paragraph"}),he.jsx(sp,{}),he.jsx("button",{onClick:()=>{d.dispatchCommand(Er,"bold")},className:"toolbar-item spaced "+(e?"active":""),"aria-label":"Format Bold",children:he.jsx("i",{className:"format bold"})}),he.jsx("button",{onClick:()=>{d.dispatchCommand(Er,"italic")},className:"toolbar-item spaced "+(i?"active":""),"aria-label":"Format Italics",children:he.jsx("i",{className:"format italic"})}),he.jsx("button",{onClick:()=>{d.dispatchCommand(Er,"underline")},className:"toolbar-item spaced "+(o?"active":""),"aria-label":"Format Underline",children:he.jsx("i",{className:"format underline"})}),he.jsx("button",{onClick:()=>{d.dispatchCommand(Er,"strikethrough")},className:"toolbar-item spaced "+(c?"active":""),"aria-label":"Format Strikethrough",children:he.jsx("i",{className:"format strikethrough"})}),he.jsx("button",{onClick:()=>{d.dispatchCommand(Er,"superscript")},className:"toolbar-item spaced "+(m?"active":""),"aria-label":"Format SuperScript",children:he.jsx("img",{src:l2,height:16,width:16,style:{marginTop:"1px"}})}),he.jsx("button",{onClick:()=>{d.dispatchCommand(Er,"subscript")},className:"toolbar-item spaced "+(h?"active":""),"aria-label":"Format SubScript",children:he.jsx("img",{src:s2,height:16,width:16,style:{marginTop:"1px"}})}),he.jsx(sp,{}),he.jsx("button",{onClick:()=>{d.dispatchCommand(Qa,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:he.jsx("i",{className:"format left-align"})}),he.jsx("button",{onClick:()=>{d.dispatchCommand(Qa,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:he.jsx("i",{className:"format center-align"})}),he.jsx("button",{onClick:()=>{d.dispatchCommand(Qa,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:he.jsx("i",{className:"format right-align"})}),he.jsx("button",{onClick:()=>{d.dispatchCommand(Qa,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:he.jsx("i",{className:"format justify-align"})}),he.jsx(h2,{}),he.jsx(K2,{}),he.jsx("div",{className:"avtar-outer-div",children:y()})]})}const lp=n2([...[bo,xa,Ao]]);function Y2(){return he.jsx("div",{className:"editor-placeholder"})}const Z2={namespace:"React.js Demo",nodes:lp,onError(y){throw y},theme:a2},Q2=()=>he.jsx(he.Fragment,{children:"hello"});function X2({collabApiKey:y,spfList:d,userObj:g}){const[t,f]=Ce.useState(!1),[r,n]=Ce.useState([]),[e,s]=Ce.useState("demo_docId_1"),[i,l]=Ce.useState({root:null}),{userId:o,userName:a,userEmail:c}=g,u=Ce.useRef(),p={docId:e,apiKey:y,user:{name:a,id:o,email:c},hooks:{contentChanged:({source:w,content:x})=>{},usersUpdate:w=>{n(w)}}},m=()=>{u.current&&u.current.start(p).then(()=>{console.log("[Lexical Demo][codox.start] success"),f(!0)}).catch(w=>console.log("[Lexical Demo][codox.start] error",w))};Ce.useEffect(()=>()=>{b()},[]);const b=()=>{u.current&&(console.log("i am stop"),u.current.stop()),f(!1)};let _={root:{children:[{children:[],direction:"ltr",format:"",indent:0,type:"paragraph",version:1,textFormat:0,showUI:!0}],direction:"ltr",format:"",indent:0,type:"root",version:1}};Ce.useEffect(()=>{(async()=>{if(!e)return;t&&b();let w=_;if(w)try{r2(w,lp),console.log("afsjdjs"),l(w)}catch(x){console.error("[APP] error: ",x)}})()},[e]),Ce.useEffect(()=>{i&&e&&!t&&m()},[i,e,t]),Ce.useMemo(()=>({editorState:i?JSON.stringify({root:i.root}):null,namespace:"Playground",nodes:lp,onError:w=>{throw w},theme:{}}),[i]);const v=()=>{let w=[],x=[];return r&&r.length>0&&r.map((S,E)=>{x.includes(S.name)||(x.push(S.name),w.push(he.jsxs("div",{title:S.email,className:`avatarStyle avatar-color-${E+1}`,children:[" ",S.name&&S.name[0],S.name&&S.name[4]]},E)))}),he.jsx("div",{className:"flexContainer",children:w})};return he.jsx("div",{children:he.jsx(Zg,{initialConfig:Z2,children:he.jsxs("div",{className:"editor-container",children:[he.jsx(G2,{renderOnlineUsers:v}),he.jsxs("div",{className:"editor-inner",children:[he.jsx(Z1,{contentEditable:he.jsx(Xg,{className:"editor-input"}),placeholder:he.jsx(Y2,{}),ErrorBoundary:Q2}),he.jsx(e2,{ref:u}),he.jsx(hm,{}),he.jsx(i2,{}),he.jsx(Qg,{})]})]})})})}Mr.Editor=X2,Object.defineProperty(Mr,Symbol.toStringTag,{value:"Module"})});
|
|
1429
|
+
`,A.append(H),_=H}!R&&x.width<1&&r.length>1&&(A.style.width="3px")}b.forEach(w=>{this.hoverList.push([w,_,e])})});this.remoteSelections=[],this.isEditingInProgress=!1,this.hoverList=[],this.trackedNodesKeys=new Set,this.remoteSelectionDOMsMap={},this.activeEditorsKeys={},this.keyboardBindedListener=this._keyboardEventsListener.bind(this),this.mouseBindedListener=this._mouseEventsListener.bind(this),this.resizeBindedListener=this._resizeEventListener.bind(this),this.hideInUI=!1}_mouseEventsListener(d){let g=!1,t=d.target,f=!1,r=3;for(;r&&t;){if(t.__codox_track){g=!0;break}if(t.__lexicalEditor){g=!0,f=!0;break}t=t.parentNode,r--}if(!g)return;let n=null;for(let i in this.activeEditorsKeys){if(t[`__lexicalKey_${i}`]){n=i;break}t.__lexicalEditor&&(n=t.__lexicalEditor._key)}if(!n)return;let e=f?"root":t[`__lexicalKey_${n}`];if(!e||!this.trackedNodesKeys.has(`${e}__${n}`))return;let s=new Set;for(let i=0;i<this.hoverList.length;i++){let l=this.hoverList[i],[o,a,c]=l;if(s.has(c))continue;let u=Xn.isMousePositionWithinElementCords(d,o);d.type===_r.mouseover&&u&&(a.style.animation=this.isEditingInProgress?Xn.tooltipAnimations.hideAtOnce:Xn.tooltipAnimations.showAtOnce,s.add(c)),d.type===_r.mouseout&&(a.style.animation=Xn.tooltipAnimations.hideWithDelay,s.add(c)),d.type===_r.mousemove&&u&&(a.style.animation=this.isEditingInProgress?Xn.tooltipAnimations.hideAtOnce:Xn.tooltipAnimations.showAtOnce,s.add(c))}}_keyboardEventsListener(d){d.type===_r.keypress&&(this.isEditingInProgress||(this.isEditingInProgress=!0)),d.type===_r.keyup&&this.isEditingInProgress&&(this.isEditingInProgress=!1)}_resizeEventListener(d){we.mainEditorExists()&&this.paintRemoteSelections(this.remoteSelections)}mount(){window.addEventListener(_r.keypress,this.keyboardBindedListener),window.addEventListener(_r.keyup,this.keyboardBindedListener),window.addEventListener(_r.resize,this.resizeBindedListener),window.addEventListener(_r.scroll,this.resizeBindedListener);for(const d of i0)window.addEventListener(d,this.mouseBindedListener)}unmount(){window.removeEventListener(_r.keypress,this.keyboardBindedListener),window.removeEventListener(_r.keyup,this.keyboardBindedListener),window.removeEventListener(_r.resize,this.resizeBindedListener),window.removeEventListener(_r.scroll,this.resizeBindedListener);for(const d of i0)window.removeEventListener(d,this.mouseBindedListener);this.gcPrevPaintedRemoteSelections()}shouldUpdateRemoteSelections(){return!0}gcPrevPaintedRemoteSelections(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];for(let g in this.remoteSelectionDOMsMap)this.remoteSelectionDOMsMap[g].remove();this.hoverList=[],this.trackedNodesKeys=new Set,this.remoteSelections=d||[],this.remoteSelectionDOMsMap={},this.activeEditorsKeys={}}paintRemoteSelections(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];this.gcPrevPaintedRemoteSelections(d);let g=we.getMainEditorState();g.read&&g.read(()=>{for(let t of this.remoteSelections)if(qf.validateJSONSelection(t,zf.remote))if($e.isNestedSelectionJSON(t)){let{nestedSelectionJSON:f,nestedEditor:r}=$e.getNestedSelectionJSONFromMainSelectionJSON(t);if(!r)continue;r.getEditorState().read(()=>{let n=$e.JSONToLexical(f);if(n)try{this.paintSingleRemoteSelection({editor:r,selectionJSON:t,lexicalSelection:n,selectedNodes:n.getNodes(),isBackward:n.isBackward()})}catch(e){le.warn("[PAINT REMOTE SELECTION] failed for nested editor - ",{error:e,nestedSelectionJSON:f,fullSelection:t,lexicalSelection:n})}else le.error("DEBUGGER: [paintRemoteSelections] nested selection from json to lexical is null: ",{selection:t,nestedSelectionJSON:f,lexicalSelection:n})})}else{let f=$e.JSONToLexical(t);if(!f){le.error("DEBUGGER: [paintRemoteSelections] selection from json to lexical is null: ",{selection:t,lexicalSelection:f});continue}try{this.paintSingleRemoteSelection({editor:we.getMainEditor(),selectionJSON:t,lexicalSelection:f,selectedNodes:f.getNodes(),isBackward:f.isBackward()})}catch(r){le.warn("[PAINT REMOTE SELECTION] failed - ",{error:r,fullSelection:t,lexicalSelection:f})}}})}updateRemoteSelections(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";this.shouldUpdateRemoteSelections(d)&&(le.log("[updateRemoteSelections] "+g,{newRemoteSelections:d}),Promise.resolve().then(()=>{this.paintRemoteSelections(d),this.hideInUI&&this.hideRemoteSelectionsFromUI()}))}clear(){this.gcPrevPaintedRemoteSelections()}getCurrentRemoteSelections(){return this.remoteSelections}hideRemoteSelectionsFromUI(){this.hideInUI||(this.hideInUI=!0);const d=document.querySelectorAll(".codox_remote_selection");for(let g of d)g.classList.add("hidden_codox_remote_selection")}showHiddenRemoteSelectionsInUI(){this.hideInUI=!1;const d=document.querySelectorAll(".hidden_codox_remote_selection");for(let g of d)g.classList.remove("hidden_codox_remote_selection")}}const vo=new rw;function ow(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).findIndex(y=>y===Sa.editorState)}function _u(y){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,g=we.getMainEditorNodesClassesMap();const{klass:t}=g.get(y.type)||{};if(!t)return;const f=t.importJSON(y);if(y.children&&y.children.length)for(const r of y.children)_u(r,f);return d&&d.getChildrenSize&&d.splice(d.getChildrenSize(),0,[f]),f}function xu(y){if(y.getChildren)for(let d of y.getChildren())xu(d);y.remove()}function S0(y){y.__parent=null,y.__next=null,y.__prev=null}function C0(y,d){return!!we.isLexicalEditorInstance(y)&&!(typeof d!="object"||!d.editorState||(y.update(()=>{try{let g=(0,be.$getSelection)();const t=y.parseEditorState(d.editorState);if(t.isEmpty())return(0,be.$getRoot)().clear(),!0;(0,be.$setSelection)(g),y.setEditorState(t)}catch(g){le.error("[stateUpdates][updateNestedEditorState] update nested state and selection error: ",g)}}),0))}function iw(y,d){let g=d;for(const t of y)g=g[t];return g}function Ea(y){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,g=arguments.length>2&&arguments[2]!==void 0&&arguments[2],t=null,f=iw(y,g?d:we.getMainEditorState().toJSON());return f&&(t=ka(f)?(0,be.$getRoot)():jn.get(f.codoxId)),t||le.debug("[WARNING][getLexicalNodeByPathOutOfJSONState] lexical node not found: ",{jsonNode:f,lexicalNode:t,pathArray:y,currentStateJSON:we.getMainEditorState().toJSON(),newStateJSON:d,codoxNodes:jn.nodesToArray(),searchInNewState:g}),t||(g?t:Ea(y,d,!0))}function E0(y){le.log("[applyFullLexicalStateReplace] clear current state and apply new");const d=(0,be.$getRoot)();d.clear();let g=we.getMainEditorNodesClassesMap();function t(f){const r=g.get(f.type).klass.importJSON(f);if(f.children)for(const n of f.children)r.append(t(n));return r}for(const f of y.root.children)d.append(t(f))}function aw(y){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];if(d.length){le.log("[applyDeltasToLexicalState] Original Deltas: ",{newStateJSON:y,deltas:JSON.parse(JSON.stringify(d))});for(const g of d){let{p:t}=g;const f=t[t.length-1],r=f==="children",n=typeof f=="number",e=!n&&!r,s=ow(t),i=s!==-1,l=g.hasOwnProperty("lm")&&typeof g.lm=="number";if(t.length)if(i){let o=s-1,a=Ea(t.slice(0,o),y);if(a){let c=t.slice(0,s),u=y;for(const p of c)u=u[p];let h=Ll(t[o]);C0(a.getWritable()[h],u)}}else{if(r){let o=g.oi;if(!o){le.warn("[applyDeltasToLexicalState][====WARNING====] SKIPPED. Delta oi attr expected for path",{delta:g});continue}if(o.some(c=>!(!c.hasOwnProperty("text")||typeof c.text=="string"))){le.warn("[applyDeltasToLexicalState][====WARNING====] SKIPPED. Delta oi children contain invalid text value",{delta:g});continue}t.length=t.length-1;let a=Ea(t,y);if(!a)continue;if(o.some(c=>!!c.codoxDId)){try{a=a.getWritable()}catch(p){le.debug("[applyDeltasToLexicalState][shouldUpdateLeaves] getWritable error: ",{err:p,delta:g,fullStateJSON:y});continue}let c={};for(let p of a.getChildren())p.codoxDId?c[p.codoxDId]=p:xu(p);let u=[],h=["codoxDId","codoxId","__key","__parent","__prev","__next"];for(let p=0;p<o.length;p++){let m=o[p],b=p===0,_=p===o.length-1,v=null,w=p>=0?u[p-1]:null;if(m.codoxDId){let x=c[m.codoxDId];if(x){x=x.getWritable();let S=_u(m);if(le.debug("[DELTA_DECORATOR_UPDATE]: ",{exisingDecorator:x,tmpDecorator:S}),!S){le.debug("[DELTA_DECORATOR_UPDATE] UPADATE SKIPPED: ",{exisingDecorator:x,tmpDecorator:S});continue}for(let E in S)if(S.hasOwnProperty(E)&&!h.includes(E))if(we.isLexicalEditorInstance(S[E])){let k={editorState:S[E].getEditorState().toJSON()};C0(x[E],k)}else{let k=Ff(E),D=m[k];if(D===x[E]||!m.hasOwnProperty(k))continue;let P=D!==void 0&&S[E]!==D?D:S[E];k!=="height"&&k!=="width"||S[E]==="inherit"&&D===0&&(P=S[E]),x[E]=P}S.remove(),S0(x),v=x,delete c[m.codoxDId]}}v||(v=_u(m),v.codoxDId&&v.__type==="excalidraw"&&v.__data==="[]"&&(v.__data="{}")),v=v.getWritable(),u.push(v),v.__parent=a.__key,b?(a.__first=v.__key,v.__prev=null,_&&(a.__last=v.__key)):_?(a.__last=v.__key,v.__next=null,v.__prev=w.__key,w.__next=v.__key):(v.__prev=w.__key,w.__next=v.__key),a.__size=u.length}for(let p in c){let m=c[p];m=m.getWritable(),S0(m),xu(m),delete c[p]}}else{let c=o.map(u=>_u(u));a.splice(0,a.getChildrenSize(),c)}}if(n){if(g.ld){const o=g.ld,a=jn.get(o.codoxId);a.getChildrenSize&&a.getChildrenSize()?xu(a):a.remove()}if(g.li){let o=we.getMainEditorNodesClassesMap();const a=g.li,c=o.get(a.type).klass.importJSON(a);if(t.length===1&&t[0]==="root")(0,be.$getRoot)().splice(0,0,[c]);else{const u=t[t.length-1];t.length=t.length-2;let h=Ea(t,y);h&&h.splice(u,0,[c])}if(a.children&&a.children.length){let u=function(h,p){const m=o.get(h.type).klass.importJSON(h);if(p.splice(p.getChildrenSize(),0,[m]),h.children&&h.children.length)for(const b of h.children)u(b,m)};for(const h of a.children)u(h,c)}}if(g.oi||g.od){let{p:o,oi:a,od:c}=g,u=Ea(o,y);if(u)try{let h=u.getWritable();if(a){let p=Object.keys(a);for(let m of p)h[Ll(m)]=a[m]}if(c){let p=Object.keys(c);for(let m of p)delete h[Ll(m)]}}catch(h){le.debug("[applyDeltasToLexicalState][delta oi/od] getWritable error: ",{err:h,delta:g})}}if(l){let{p:o,lm:a}=g,c=o[o.length-1],u=a,h=u<c,p=Ea(o,y);if(p){let m=p.getParent().getChildren(),b=m[c],_=m[u];h?_.insertBefore(b):_.insertAfter(b)}}}if(e){const o=t[t.length-1];let a=Ll(o);t.length=t.length-1;let c,u=Ea(t,y);if(!u){le.error("Missing node when update node attr from delta: ",{path:t,delta:g,fullStateJSON:y,currentEditorState:we.getMainEditorState().toJSON()});continue}try{c=u.getWritable()}catch(p){le.debug("[applyDeltasToLexicalState][shouldUpdateBlockAttr] getWritable error: ",{err:p,delta:g})}if(!c)continue;let h=g.oi;if(o==="format"&&(h=ix(h)),o==="direction"&&(u.hasOwnProperty(a)||(a="__dir")),!c.hasOwnProperty(a)){let p=Object.keys(c);for(let m of p){let b=Ff(m);if(o.startsWith(b)){a=m;break}}}c[a]=h}}else if(g.oi&&g.oi.root)return E0(g.oi)}}else le.log("[applyDeltasToLexicalState] stop, no deltas: ",d)}function sw(y){let d=y.clipboardData.getData(sx.paste),g=!1;try{d=JSON.parse(d),typeof d=="object"&&d.nodes&&Array.isArray(d.nodes)&&(g=!0)}catch{return!1}if(!g)return!1;if(g){jn.clearPastedIds();const t=f=>{if(f.codoxId&&jn.addPastedId(f.codoxId),f.children&&f.children.length)for(const r of f.children)t(r)};for(const f of d.nodes)t(f)}return!1}var lw=y=>{var d={};return on.d(d,y),d};const k0=lw({useCollaborationContext:()=>__});var cw=y=>{var d={};return on.d(d,y),d};const Fi=cw({LexicalComposerContext:()=>Ef,useLexicalComposerContext:()=>jr});class O0{constructor(){this.blacklist=Object.keys(a0).reduce((d,g)=>{let t=a0[g];return d[g]=t.reduce((f,r)=>(f[r]=r,f),{}),d},{}),this._isBlacklistedFound=!1,this._clientCallback=null}_shouldSkipNode(d){return d instanceof be.TextNode||d instanceof be.ParagraphNode||d instanceof be.RootNode}setClientCallback(d){this._clientCallback=d}removeClientCallback(){this._clientCallback=null}invokeClientCallback(){this._clientCallback&&this._clientCallback()}trackBlacklisted(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2?arguments[2]:void 0;if(Jf||g!==Jr.created||this._isBlacklistedFound||!d||!d.__type||this._shouldSkipNode(d))return;let f=t||we.getMainEditorState(),r=d.__type,n=this.blacklist[r];n&&f.read(()=>{let e=d.getParent();for(;e!==null;){let s=e?e.__type:null;if(!s)return;if(n[s])return le.warn("[ContentNestingsWatcher][trackBlacklisted] FOUND: ",{targetNode:d,targetType:r,parent:e,parentType:s,mutationType:g}),void(this._isBlacklistedFound=!0);e=e.getParent()}})}trackBlacklistedInNestedEditor(d){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>3?arguments[3]:void 0;if(g!==Jr.created||this._isBlacklistedFound||this._shouldSkipNode(d))return;let f=t.__type,r=d.__type;if(!f||!r)return;let n=this.blacklist[r];n&&n[f]&&(this._isBlacklistedFound=!0,le.warn("[ContentNestingsWatcher][trackBlacklistedInNestedEditor] FOUND: ",{targetNode:d,targetType:r,rootNode:t,rootType:f,mutationType:g}))}isBlacklistedFound(){let d=this._isBlacklistedFound;return d&&(this._isBlacklistedFound=!1),d}}const uw=new O0,zi=uw,dw=["editorState","prevEditorState","dirtyElements","dirtyLeaves"];function fw(y,d){if(y==null)return{};var g,t,f=pw(y,d);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(y);for(t=0;t<r.length;t++)g=r[t],d.indexOf(g)>=0||{}.propertyIsEnumerable.call(y,g)&&(f[g]=y[g])}return f}function pw(y,d){if(y==null)return{};var g={};for(var t in y)if({}.hasOwnProperty.call(y,t)){if(d.indexOf(t)>=0)continue;g[t]=y[t]}return g}class hw{constructor(){this.nestedEditorsListenersMap={}}_createNestedEditorUpdatesListener(d,g){let t=!1;return function(f){let{editorState:r,prevEditorState:n,dirtyElements:e,dirtyLeaves:s}=f,i=(fw(f,dw),we.getMainEditor()),l=we.getMainEditorState(),o=r.toJSON(),a=n.toJSON(),c=Hf(o,a),u=r._selection,h=n._selection,p=!1,m=null,b=we.isOnlySelectionChanged(e,s),_=d[g];if(le.debug("[NESTED EDITOR LISTENER] invoked: ",{lexicalNode:d,key:d.__key,onlySelectionChanged:b,newEditorStateJSON:o,prevEditorStateJSON:a,isSameState:c,lexicalSelection:u,prevLexicalSelection:h,mainDirtyLeaves:i._dirtyLeaves.size,mainDirtyElements:i._dirtyElements.size,nestedDirtyLeaves:_._dirtyLeaves.size,nestedDirtyElements:_._dirtyElements.size,nestedEditorKey:_._key}),zi.isBlacklistedFound())return t=!0,le.debug("[NESTED EDITOR LISTENER] BLACKLISTED FOUND - revert to prev state"),we.scanLexicalNodeForNestedEditorAttribute(d)?(_.update(()=>{try{const v=_.parseEditorState(a);if(v.isEmpty())return(0,be.$getRoot)().clear(),!0;_.setEditorState(v)}catch(v){le.error("[NESTED EDITOR LISTENER] BLACKLISTED FOUND - ROLLBACK ERROR: ",v)}}),void zi.invokeClientCallback()):void 0;if(t)t=!1;else{if(d.codoxId||d.codoxDId){let v=null;l.read(()=>{v=$e.getNodeAncestorsCodoxIds(d),!d.codoxId&&d.codoxDId&&v.push(d.codoxDId)}),r.read(()=>{let w=Ff(g),x=$e.lexicalToJSONNested(u,w,v);m=we.getCurrentNestedSelectionJSON(),p=$e.equalSelectionsJSON(m,x),p||we.setNestedSelectionJSON(x)})}c&&p||i.update(()=>{try{le.debug("[NESTED EDITOR LISTENER] MARKING DIRTY TO TRIGGER UPDATE",{mainTags:i._updateTags,nestedTags:_&&_._updateTags,isSameState:c,isSameSelection:p,onlyNestedSelectionChanged:b,mainDirtyLeaves:i._dirtyLeaves.size,mainDirtyElements:i._dirtyElements.size,nestedDirtyLeaves:_._dirtyLeaves.size,nestedDirtyElements:_._dirtyElements.size,lexicalNode:d,lexicalSelection:u,prevLexicalSelection:h,mainEditorTags:i._updateTags,mainEditorTagsSize:i._updateTags.size}),we.addUpdateTag({fromNestedEditor:!0}),d.markDirty()}catch(v){le.error("[NESTED EDITOR LISTENER] MARKING DIRTY TO TRIGGER UPDATE - ERROR: ",v)}})}}}_isNestedEditorManaged(d){return!!this.nestedEditorsListenersMap[d]}gc(){for(let d in this.nestedEditorsListenersMap)if(!we.getLexicalNodeByKey(d)){let g=this.nestedEditorsListenersMap[d];g&&g(),delete this.nestedEditorsListenersMap[d]}}manageNestedEditorInLexicalNode(d){if(this._isNestedEditorManaged(d.getKey()))return;let g=we.scanLexicalNodeForNestedEditorAttribute(d);if(g){let t=d[g],f=this._createNestedEditorUpdatesListener(d,g),r=[];t._nodes.forEach((s,i,l)=>{let{klass:o}=s,a=t.registerMutationListener(o,c=>{for(let[u,h]of c)if(h===Jr.created){let p=t.getEditorState()._nodeMap.get(u);p&&zi.trackBlacklistedInNestedEditor(p,h,t.getEditorState(),d)}});r.push(a)});let n=(0,bs.mergeRegister)(t.registerUpdateListener(f),...r),e=d.getKey();this.nestedEditorsListenersMap[e]=n}}gcNestedEditorListenerInLexicalNode(d){let g=d.getKey(),t=this.nestedEditorsListenersMap[g];t&&(t(),delete this.nestedEditorsListenersMap[g])}manageNestedEditorInClonedLexicalNode(d,g){let t=d.getKey();t!==g.getKey()&&this._isNestedEditorManaged(t)&&(this.gcNestedEditorListenerInLexicalNode(d),this.manageNestedEditorInLexicalNode(g))}setNestedEditorSelection(d){let{nestedSelectionJSON:g,nestedEditor:t}=$e.getNestedSelectionJSONFromMainSelectionJSON(d);if(!t)return!1;let f=!0;return t.update(()=>{try{let r=$e.JSONToLexical(g);(0,be.$setSelection)(r),le.debug("[setNestedEditorSelection]: lexical nested selection: ",r)}catch(r){le.error("[setNestedEditorSelection] set nested selection error: ",r),f=!1}}),f}clearListeners(){for(let d in this.nestedEditorsListenersMap){let g=this.nestedEditorsListenersMap[d];g&&g(),delete this.nestedEditorsListenersMap[d]}}}const gw=new hw,si=gw,mw=function(y){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];try{let g=(0,be.createEditor)({namespace:"validation",nodes:[...d],onError:e=>{throw e},parentEditor:null});const t=new O0,f=g.parseEditorState(y);if(f.isEmpty())return;g.setEditorState(f);let r=g.getEditorState();const n=r._nodeMap[Symbol.iterator]();for(const e of n){let[s,i]=e;if(i&&(t.trackBlacklisted(i,Jr.created,r),t.isBlacklistedFound()))throw new Error(lx)}}catch(g){throw g}};class yw{constructor(){this.removeCandidateTableKeys=new Set,this.validateTableCandidateKeys=new Set,this.tableFixActions=[]}_scanForCellHeaderState(d,g,t,f){if(g.length<f)return null;let r,n=g.some(s=>s.__headerState===Li.BOTH||s.__headerState===Li.ROW),e=d.some((s,i)=>{if(s.__size<f)return!1;let l=s.getChildAtIndex(t);return!(!l||l.__headerState!==Li.BOTH&&l.__headerState!==Li.COLUMN)});return n&&e?r=Li.BOTH:n&&!e?r=Li.ROW:e&&!n&&(r=Li.COLUMN),r}_isValidCellChildren(d){for(let g of d)if(Cs(g)||!Ss(g)&&En(g))return!1;return!0}_createEmptyCell(){let d=(0,kn.$createTableCellNode)();return d.append((0,be.$createParagraphNode)()),d}_wrapInvalidCellChildrenIntoParagraph(d){let g=(0,be.$createParagraphNode)().getWritable(),t=d.getChildren();(d=d.getWritable()).__first=g.__key,d.__last=g.__key,d.__size=1,g.__parent=d.__key,t.forEach((f,r)=>{(f=f.getWritable()).__parent=null,g.append(f)})}_createFixAction_APPEND_CELLS_TO_ROW(d,g){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - APPEND_CELLS_TO_ROW] invoked: ",{rowKey:d,numOfCellsToAppend:g});let t=(0,be.$getNodeByKey)(d);for(;g;){let f=(0,kn.$createTableCellNode)().append((0,be.$createParagraphNode)());f.setRowSpan(1).setColSpan(1),t.append(f),g--}}}_createFixAction_ADD_PARAGRAPH_TO_EMPTY_CELL(d){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - ADD_PARAGRAPH_TO_EMPTY_CELL] invoked: ",{cellKey:d}),(0,be.$getNodeByKey)(d).append((0,be.$createParagraphNode)())}}_createFixAction_WRAP_CELL_CHILDREN_IN_PARAGRAPH(d){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - WRAP_CELL_CHILDREN_IN_PARAGRAPH] invoked: ",{cellKey:d});let g=(0,be.$getNodeByKey)(d);this._wrapInvalidCellChildrenIntoParagraph(g)}}_createFixAction_ADD_ROW_CELL_TO_TABLE_NODE(d){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - ADD_ROW_CELL_TO_EMPTY_TABLE_NODE] invoked: ",{tableKey:d});let g=(0,be.$getNodeByKey)(d),t=(0,kn.$createTableRowNode)();t.append(this._createEmptyCell()),g.append(t)}}_createFixAction_ADD_CELL_TO_EMPTY_ROW_NODE(d,g){return()=>{for(g||(g=1);g;)(0,be.$getNodeByKey)(d).append(this._createEmptyCell()),g--}}_createFixAction_WRAP_INVALID_ROW_NODE(d,g){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - WRAP_INVALID_ROW_NODE] invoked: ",{tableKey:d,rowKey:g});let t=(0,be.$getNodeByKey)(d);if(!t)return;let f=(0,be.$getNodeByKey)(g);if(!f)return;t=t.getWritable(),f=f.getWritable();let r=f.getPreviousSibling(),n=f.getNextSibling();f.__parent=null,f.__prev=null,f.__next=null;let e=(0,kn.$createTableRowNode)();if((0,kn.$isTableCellNode)(f))f.getChildren().length?this._isValidCellChildren()||this._wrapInvalidCellChildrenIntoParagraph(f):f.append((0,be.$createParagraphNode)()),e.append(f);else{let s=this._isValidCellChildren([f]),i=(0,kn.$createTableCellNode)();if(e.append(i),s)i.append(f);else{let l=(0,be.$createParagraphNode)();l.append(f),i.append(l)}}e.__parent=t.__key,t.__first===f.__key&&(t.__first=e.__key),t.__last===f.__key&&(t.__last=e.__key),r&&(r=r.getWritable(),r.__next=e.__key,e.__prev=r.__key),n&&(n=n.getWritable(),n.__prev=e.__key,e.__next=n.__key)}}_createFixAction_WRAP_INVALID_CELL_NODE(d,g){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - WRAP_INVALID_CELL_NODE] invoked: ",{rowKey:d,cellKey:g});let t=(0,be.$getNodeByKey)(d);if(!t)return;let f=(0,be.$getNodeByKey)(g);if(f.remove(),f=(0,be.$createParagraphNode)(),!f)return;t=t.getWritable(),f=f.getWritable();let r=f.getPreviousSibling(),n=f.getNextSibling(),e=(0,kn.$createTableCellNode)();if(e.__parent=t.__key,t.__first===f.__key&&(t.__first=e.__key),t.__last===f.__key&&(t.__last=e.__key),r&&(r=r.getWritable(),r.__next=e.__key,e.__prev=r.__key),n&&(n=n.getWritable(),n.__prev=e.__key,e.__next=n.__key),f.__parent=null,f.__prev=null,f.__next=null,this._isValidCellChildren([f]))e.append(f);else{let s=(0,be.$createParagraphNode)();s.append(f),e.append(s)}}}_createFixAction_APPLY_HEADER_STATE_TO_CELL(d,g){return()=>{le.debug("[TablesValidator][FIX TABLE ACTION - APPLY_HEADER_STATE_TO_CELL] invoked: ",{cellKey:d,headerStateToApply:g});let t=(0,be.$getNodeByKey)(d);t&&(t=t.getWritable(),t.__headerState=g)}}clear(){this.removeCandidateTableKeys=new Set,this.validateTableCandidateKeys=new Set,this.tableFixActions=[]}tableRemoveEventListener(d){let g=we.getMainEditorState()._selection;if(le.debug(`[${d}]`,{selection:g}),!(0,be.$isRangeSelection)(g))return;let t=[];try{let f=we.getLexicalNodeByKey(g.anchor.key),r=we.getLexicalNodeByKey(g.focus.key);f&&r&&(t=g.isBackward()?r.getNodesBetween(f):f.getNodesBetween(r))}catch(f){le.warn("[TablesValidator][tableRemoveEventListener] get range selection nodes internal lexical error: ",f)}t.forEach(f=>{(0,kn.$isTableNode)(f)&&this.removeCandidateTableKeys.add(f.__key)})}tableNodeRemoveListener(d){this.removeCandidateTableKeys.has(d)&&this.removeCandidateTableKeys.delete(d)}shouldGCRemovedTables(){return!!this.removeCandidateTableKeys.size}gcRemovedTables(){le.debug("[TablesValidator][gcRemovedTable] candidate table keys ",{tableKeys:this.removeCandidateTableKeys}),we.getMainEditor().update(()=>{Array.from(this.removeCandidateTableKeys).forEach(d=>{let g=(0,be.$getNodeByKey)(d);g&&g.remove()}),this.removeCandidateTableKeys.clear(),(0,be.$addUpdateTag)(no.historic)})}tableUpdateListener(d){this.validateTableCandidateKeys.add(d)}tableRowNodeChangesListener(d){let g=arguments.length>1&&arguments[1]!==void 0&&arguments[1],t=we.getLexicalNodeByKey(d);if(!t)return void(g&&le.debug("[TablesValidator][tableRowNodeChangesListener] no row node found in lexical: ",{tableRowNodeKey:d}));let f=t.__parent;f?this.validateTableCandidateKeys.add(f):le.debug("[tableRowNodeChangesListener] no parent table for row node found in lexical: ",{rowNode:t})}tableCellNodeChangesListener(d){let g=we.getLexicalNodeByKey(d);if(!g||!g.__parent)return;let t=we.getLexicalNodeByKey(g.__parent);t&&t.__parent&&this.validateTableCandidateKeys.add(t.__parent)}shouldValidateUpdatedTables(){return!!this.validateTableCandidateKeys.size}validateUpdatedTables(){let d=Array.from(this.validateTableCandidateKeys);return we.getMainEditorState().read(()=>{for(let g of d){let t=we.getLexicalNodeByKey(g);if(!t)continue;let f=t.getChildren();if(!f.length){this.tableFixActions.push(this._createFixAction_ADD_ROW_CELL_TO_TABLE_NODE(g));continue}let r=0;f.forEach(i=>{i.__size>r&&(r=i.__size)});let n=[],e=f.map((i,l)=>{if(!(0,kn.$isTableRowNode)(i))return this.tableFixActions.push(this._createFixAction_WRAP_INVALID_ROW_NODE(g,i.__key)),"invalid_row_node";let o=i.getChildren();if(!o.length&&!n.length)return this.tableFixActions.push(this._createFixAction_ADD_CELL_TO_EMPTY_ROW_NODE(i.__key,r)),"empty_row_should_add_cell";if(!o.length&&n.length)return n=[],"empty_row_should_be_empty";let a=0;if(n.length){let u=[];n.forEach(h=>{let[p,m]=h;a+=m,p--,p&&u.push([p,m])}),n=[...u]}let c=o.map((u,h)=>{if(!(0,kn.$isTableCellNode)(u))return this.tableFixActions.push(this._createFixAction_WRAP_INVALID_CELL_NODE(i.__key,u.__key)),a++,"invalid_cell_node_should_wrap_in_cell";let p,m=u.getChildren(),b=!m.length;if(b?this.tableFixActions.push(this._createFixAction_ADD_PARAGRAPH_TO_EMPTY_CELL(u.__key)):(p=this._isValidCellChildren(m),p||this.tableFixActions.push(this._createFixAction_WRAP_CELL_CHILDREN_IN_PARAGRAPH(u.__key))),u.__rowSpan>1){let _=u.__rowSpan,v=u.__colSpan;n.push([_-1,v])}if(a+=u.__colSpan,u.__headerState===Li.NO_STATUS){let _=this._scanForCellHeaderState(f,o,h,r);_&&this.tableFixActions.push(this._createFixAction_APPLY_HEADER_STATE_TO_CELL(u.__key,_))}return{cellKey:u.__key,rowKey:i.__key,tableKey:g,colSpan:u.__colSpan,rowSpan:u.__rowSpan,headerState:u.__headerState,childrenAreValid:p,isEmptyCell:b}});if(a<r){let u=r-a;this.tableFixActions.push(this._createFixAction_APPEND_CELLS_TO_ROW(i.__key,u))}return{realRowLength:a,rowKey:i.__key,tableKey:g,cells:c}}),s=!this.tableFixActions.length;le[s?"debug":"warn"](`[TablesValidator][validateUpdatedTables] IS TABLE VALID: ${s}`,{tableNodeKey:g,tableValidationMatrix:e,requiredRowLength:r}),this.validateTableCandidateKeys.delete(g)}}),!this.tableFixActions.length}shouldFixTablesStructure(){return!!this.tableFixActions.length}fixTablesStructure(){if(!this.tableFixActions.length)return;let d=we.getMainEditor();le.log("[TablesValidator][fixTablesStructure]: fix actions to apply - count: ",this.tableFixActions.length),d.update(()=>{for(let g of this.tableFixActions)g();this.tableFixActions=[],(0,be.$addUpdateTag)(no.historic)})}ensureDocTablesAreValid(d){return this.shouldGCRemovedTables()?(le.warn("[TablesValidator][GARBAGE COLLECT TABLE NODES AFTER TABLE REMOVAL ATTEMPT]"),this.gcRemovedTables(),!1):!(this.shouldValidateUpdatedTables()&&(le.debug("[TablesValidator][shouldValidateUpdatedTables] invoked"),!this.validateUpdatedTables()))||(le.warn("[TablesValidator][shouldValidateUpdatedTables] INVALID LEXICAL TABLE(S) STRUCTURE FOUND - FIXING",{state:JSON.parse(JSON.stringify(d.toJSON()))}),this.fixTablesStructure(),!1)}}const No=new yw,bw=["contentChanged"],vw=["state","remoteSelection"];function T0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function xs(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?T0(Object(g),!0).forEach(function(t){_w(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):T0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function _w(y,d,g){return(d=xw(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function xw(y){var d=ww(y,"string");return typeof d=="symbol"?d:d+""}function ww(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}function j0(y,d){if(y==null)return{};var g,t,f=Sw(y,d);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(y);for(t=0;t<r.length;t++)g=r[t],d.indexOf(g)>=0||{}.propertyIsEnumerable.call(y,g)&&(f[g]=y[g])}return f}function Sw(y,d){if(y==null)return{};var g={};for(var t in y)if({}.hasOwnProperty.call(y,t)){if(d.indexOf(t)>=0)continue;g[t]=y[t]}return g}const Jf={DEBUG:!1,VERSION:"1.0.2",NAME:"@codoxhq/lexical-provider",SDKUI_SOURCE_PATH:"../../../sdkui/dist-production2/codox.bundle.js"}.LOCAL==="true";le.info("MODE: ","production");const Cw=y=>async()=>{const{state:d,timestamp:g}=await y();if(!we.isValidJSONState(d))throw new Error("Invalid state received from fetchDocOnNetworkReconnect hook");const{commentThreads:t,root:f}=d,r={content:{comments:t,root:f},timestamp:g};return le.info("[decorateFetchOnReconnctHook] hook invoked: ",{returnObj:r}),r};let wu=0,li=null,Vf=!1,_o={},Wf={};const Ew=(0,Gt.forwardRef)((y,d)=>{let{onBlacklistedInsert:g}=y;const t=(0,Gt.useContext)(Fi.LexicalComposerContext);if(!t)throw new Error("[CodoxCollabPlugin] CodoxCollabPlugin must be inited inside <LexicalComposer> component - LexicalComposerContext is missing");const[f]=(0,Fi.useLexicalComposerContext)(),r=(0,k0.useCollaborationContext)();(0,Gt.useEffect)(()=>{if(le.debug("[INIT] lexical context check: ",{lexicalContext:t,editor:f}),!f)return;le.log("[useEffect][editor] Editor instance changed: ",{editor:f,key:f._key}),we.setMainEditor(f),jn.gcAbandonedNodes(),si.gc(),No.clear(),le.log("[useEffect][editor] subscribe to editor changes");const b=(0,bs.mergeRegister)(f.registerUpdateListener(h),f.registerCommand(be.PASTE_COMMAND,sw,be.COMMAND_PRIORITY_CRITICAL),f.registerCommand(be.UNDO_COMMAND,()=>{we.setUndoInvoked(!0)},be.COMMAND_PRIORITY_CRITICAL),f.registerCommand(be.REDO_COMMAND,()=>{we.setRedoInvoked(!0)},be.COMMAND_PRIORITY_CRITICAL),f.registerCommand(be.KEY_DELETE_COMMAND,(v,w)=>{No.tableRemoveEventListener("KEY_DELETE_COMMAND")},be.COMMAND_PRIORITY_CRITICAL),f.registerCommand(be.KEY_BACKSPACE_COMMAND,(v,w)=>{No.tableRemoveEventListener("KEY_BACKSPACE_COMMAND")},be.COMMAND_PRIORITY_CRITICAL),f.registerCommand(be.CUT_COMMAND,(v,w)=>{No.tableRemoveEventListener("CUT_COMMAND")},be.COMMAND_PRIORITY_CRITICAL),...p());vo.mount(),we.alignStateSelectionJSONsFromLatestEditor(),le.debug("New editor mounted: ",{isCodoxStarted:we.isCodoxStarted,codoxLexicalEditorManager:we,nestedEditorsProcessor:si});let _=f._onError;return f._onError=v=>{le.error("[ERROR HANDLER WRAPPER] error from editor: ",v),_&&_(v),u()},g&&zi.setClientCallback(g),()=>{we.getMainEditorKey()&&(le.debug("Unmount prev editor"),b(),we.removeMainEditor(),vo.unmount(),we.clearJSONs(),Cn.clear(),No.clear(),we.isCodoxStarted&&(le.debug("EDITOR USE_EFFECT stopping codox"),n(),we.setIsCodoxStarted(!1)),zi.removeClientCallback())}},[f]);const n=()=>{we.isCodoxStarted&&(le.log("[stopCodoxInstance] stopping codox"),we.setIsCodoxStarted(!1),Jf||ti().stop(),we.clearJSONs(),jn.clearAll(),vo.clear(),Cn.resetComments(),si.clearListeners())},e=async b=>{le.debug("[startCodoxInstance] invoked"),ti().createNewInstance(),le.debug("[startCodoxInstance] instance created");for(let O in Wf)ti().instance.on(O,Wf[O]);if(le.debug("[startCodoxInstance] events subscribed"),_o=b,li=_o.docId,!li)return le.error("[startCodoxInstance] - start codox skipped - docId is missing",{docId:li});let _=Cn.initialCommentsExist();le.debug("[startCodoxInstance] initCommentsExist: ",_),_&&(Cn.activateInitialComments(f,jn),le.log("[activateInitialComments] "));let v=we.getMainEditorState().toJSON();if(!we.isValidJSONState(v))throw le.error("[startCodoxInstance] - start codox skipped - invalid init state",{docId:li,initJSONState:v}),new Error("start codox skipped - invalid init state");le.log("[startCodoxInstance] starting codox with: ",{docId:li,initJSONState:v,config:_o,codoxComments:Cn}),we.currentContentStateJSON||we.setCurrentContentStateJSON(v),we.isCodoxStarted&&n();let{username:w,apiKey:x,getServerState:S,domain:E="",demo:k=!1,hooks:D}=_o;D&&D.fetchDocOnNetworkReconnect&&(D.fetchDocOnNetworkReconnect=Cw(D.fetchDocOnNetworkReconnect));const P=j0(D,bw);await ti().start(ti().createConfig(xs(xs({},_o),{},{docId:li,username:w,apiKey:x,domain:E,hooks:xs({syncState:l,getState:i,getServerState:async()=>await S(li)},P),editorInstanceHooks:{getSelection:()=>we.getCurrentActiveSelectionJSON(),setSelection:O=>o(O),getState:i,setState:O=>{const{root:R,comments:A}=O;le.info("DEBUG: EDITOR INSTANCE setState:",{fullState:O}),a({state:{root:R},selection:we.getCurrentActiveSelectionJSON()},vo.getCurrentRemoteSelections()),Cn.setAllComments(A)},enableEditor:()=>{we.disableEditorReadOnlyMode()},disableEditor:()=>{we.enableEditorReadOnlyMode(),vo.updateRemoteSelections([])},getContent:()=>{let O=we.composeFullStateWithRootAndComments();return le.info("[getContent]: ",O),{state:O}}},appServer:_o.appServer,demo:k}))),le.log("[startCodoxInstance] codox started - first sync invoking"),we.setIsCodoxStarted(!0),r.clientID=_o.username,r.name=_o.username,c()},s=()=>{let b=we.composeFullStateWithRootAndComments({directlyFromEditor:!0});e(b)},i=()=>({state:xs(xs({},we.getMainEditorState().toJSON()),{},{comments:Cn.getAllComments()}),docId:li}),l=b=>{if(!we.isCodoxStarted)return;le.log("[SYNC_STATE]: Before sync payload = ",b);const _=ti().sync({meta:b}),{state:v,remoteSelection:w=[]}=_,x=j0(_,vw);if(le.log("[SYNC_STATE]: After sync",{state:v,remoteSelection:w,rest:x}),!v)return le.error("[SYNC_STATE] abort apply - synced state is not valid - restarting codox"),s();const S=v.state;le.log("[SYNC_STATE] synced state: ",{synced:JSON.parse(JSON.stringify(S))});let{stateFromSync:E,commentsFromSync:k}=we.extractStateAndCommentsFromSynced(S);if(!we.isValidJSONState(E.state))return le.error("[SYNC_STATE] - invalid state from sync - local update skipped - restarting codox",{contentState:E.state}),s();a(E,w),Cn.setAllComments(k)},o=b=>{if(!we.isCodoxStarted||(le.log("[setLocalSelectionFromSync] synced selection: ",{syncedSelectionJSON:b}),!qf.validateJSONSelection(b,zf.local)))return;let _=we.getCurrentActiveSelectionJSON();if($e.equalSelectionsJSON(_,b))return void le.log("[setLocalSelectionFromSync] STOP - local and synced selections are equal");let v=$e.isNestedSelectionJSON(b);f.update(()=>{le.log("[setLocalSelectionFromSync] json selection to apply: ",{syncedSelectionJSON:b});const w=$e.JSONToLexical(b);if(le.log("[setLocalSelectionFromSync] lexical selection to apply: ",w),v){let x=si.setNestedEditorSelection(b);we.setNestedSelectionJSON(x?b:null)}else(0,be.$setSelection)(w),we.setMainSelectionJSON(b);le.log("[setLocalSelectionFromSync] selection updated. latest selection: ",{latestSelectionJSON:we.getCurrentActiveSelectionJSON()})})},a=function(){let{state:b,selection:_,stateReplace:v}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",S=we.getCurrentContentStateJSON();le.log("[updateEditor] invoked: ",{currentContentStateJSON:JSON.parse(JSON.stringify(S)),newStateJSON:JSON.parse(JSON.stringify(b)),newSelectionJSON:_,remoteSelection:w,stateReplace:v,editor:f}),_===void 0&&le.error("SELECTION FROm SYNC IS UNDEFINED - will default prev selection",_);const E=Hf(S,b),k=$e.equalSelectionsJSON(we.getCurrentActiveSelectionJSON(),_);f.update(()=>{if(we.addUpdateTag({isSameState:E,isSameSelection:k,updateTag:x}),v)le.log("[updateEditor] invoke full stateReplace after sync"),E0(b),S=we.setCurrentContentStateJSON(b),(0,be.$addUpdateTag)("codox_sync_state_changes"),le.log("[updateEditor] state updated: ",S);else{le.log("[updateEditor] invoke deltas diff");let P=ti().diff(S,b,{keyNames:{default:"codoxId"}});le.log("JSON_DIFF_ANALYSIS: ",{currentContentStateJSON:JSON.parse(JSON.stringify(S)),newStateJSON:b,deltas:P&&JSON.parse(JSON.stringify(P))}),P&&P.length&&(le.log("[updateEditor] apply deltas to lexical state"),aw(b,P),S=we.setCurrentContentStateJSON(b),(0,be.$addUpdateTag)("codox_sync_state_changes"),le.log("[updateEditor] state updated: ",S))}let D=$e.isNestedSelectionJSON(_);if(qf.validateJSONSelection(_,zf.local)||(_=we.getCurrentActiveSelectionJSON()),D){let P=si.setNestedEditorSelection(_);we.setNestedSelectionJSON(P?_:null),le.log("[updateEditor] nested selection updated",P?_:null)}else if(_!==void 0){const P=$e.JSONToLexical(_);le.log("[updateEditor] updated selection to apply: ",{isSameSelection:k,newSelectionJSON:_,lexicalSelection:P}),(0,be.$setSelection)(P),we.setMainSelectionJSON(_),le.log("[updateEditor] selection updated",_)}},{onUpdate:()=>{E||vo.updateRemoteSelections(w,"from onUpdate hook")}}),E&&vo.updateRemoteSelections(w,"from direct updateEditor")},c=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";if(!we.isCodoxStarted)return;le.log("[invokeSync] SYNC INVOKED ",{upd_call_counter:b});let _=we.composeFullStateWithRootAndComments();const v={docId:li,state:{state:_,selection:we.getCurrentActiveSelectionJSON()}};le.log("[codoxSync]: Before sync",{local:v,upd_call_counter:b}),le.log("[codoxSync]: Before sync state",JSON.parse(JSON.stringify(v.state)));let{state:w,remoteSelection:x=[],changes:S}=ti().sync({state:v,meta:{}});if(le.log("[codoxSync]: After sync",{afterSyncState:JSON.parse(JSON.stringify(w)),remoteSelection:x,changes:S}),!w)return le.error("[codoxSync] abort apply - synced state is not valid - restarting codox "),s();const E=w.state;le.log("[codoxSync]: synced state: ",JSON.parse(JSON.stringify(E)),b);let{stateFromSync:k,commentsFromSync:D}=we.extractStateAndCommentsFromSynced(E);if(!we.isValidJSONState(k.state))return le.error("[invokeSync] - invalid state from sync - local update skipped - restarting codox",{contentState:k.state}),s();a(k,x),Cn.setAllComments(D)},u=()=>{le.warn("[rollbackStateDuringUpdateError] rollback invoked"),le.log("[rollbackStateDuringUpdateError] values: ",{prevState:we.getPrevContentStateJSON(),currentState:we.getCurrentContentStateJSON(),prevSelection:we.getPrevMainSelectionJSON(),currentSelection:we.getCurrentActiveSelectionJSON(),codoxComments:Cn});let b=we.getPrevContentStateJSON(),_=we.getPrevMainSelectionJSON();a({state:b,selection:_},vo.getCurrentRemoteSelections(),no.historic);let v=we.undoInvoked(),w=we.redoInvoked();Cn.gcAbandonedNodeKeys(we.getMainEditorState()._nodeMap),v&&f.dispatchCommand(be.CAN_REDO_COMMAND,!1),w&&f.dispatchCommand(be.CAN_UNDO_COMMAND,!1)},h=b=>{let{editorState:_,prevEditorState:v,tags:w,dirtyElements:x,dirtyLeaves:S}=b;if(Vf)return Vf=!1,void le.debug("[editorUpdatesListener] invoked blacklisted queued selection change - stop");if(zi.isBlacklistedFound())return Vf=!0,le.warn("[editorUpdatesListener] BLACKLISTED CHANGES FOUND - revert back to prev state"),((W,G)=>{let F=null,q=null;G.read(()=>{F=$e.lexicalToJSON(G._selection),q=G.toJSON()});let T=null,I=null;W.read(()=>{let L=(0,be.$getSelection)();I=$e.lexicalToJSON(L),T=W.toJSON()}),we.setCurrentContentStateJSON(T),we.setMainSelectionJSON(I),a({state:q,selection:F},vo.getCurrentRemoteSelections(),no.historic),f.dispatchCommand(be.CAN_REDO_COMMAND,!1),f.dispatchCommand(be.CAN_UNDO_COMMAND,!1)})(_,v),void zi.invokeClientCallback();if(!No.ensureDocTablesAreValid(_))return;wu++,le.log("[editorUpdatesListener] invoked by lexical. call counter: ",{upd_call_counter:wu,isCodoxStarted:we.isCodoxStarted});let E=we.isOnlySelectionChanged(x,S),k=null,D=null,P=null,O=null,R=we.getCurrentContentStateJSON(),A=w.has("codox_sync_state_changes"),z=w.has(Bl),H=we.undoInvoked(),$=we.redoInvoked(),M=we.canUndo(),J=we.canRedo();k=_.toJSON(),D=v.toJSON(),v.read(()=>{O=$e.lexicalToJSON(v._selection)}),_.read(()=>{let W=(0,be.$getSelection)();P=$e.lexicalToJSON(W);let G=$e.JSONToLexical(P),F=W===null&&G===null||W.is(G);le.log("[editorUpdatesListener] new values: ",{newContentStateJSON:k,currentContentStateJSON:JSON.parse(JSON.stringify(R)),prevContentStateJSON:JSON.parse(JSON.stringify(D)),currentCommentsJSON:JSON.parse(JSON.stringify(Cn.getAllComments())),newSelectionJSON:JSON.parse(JSON.stringify(P)),currentMainSelectionJSON:JSON.parse(JSON.stringify(we.getCurrentMainSelectionJSON())),currentNestedSelectionJSON:JSON.parse(JSON.stringify(we.getCurrentNestedSelectionJSON())),currentActiveSelectionJSON:JSON.parse(JSON.stringify(we.getCurrentActiveSelectionJSON())),lexicalSelection:W,convertedBackMainSelection:G,isMainSelectionConvertionCorrect:F,nodes:f._editorState._nodeMap,fullEditor:f,codoxNodesMap:jn.toArray(),codoxComments:Cn,isUpdateFromSync:A,isUpdateFromComments:z,tags:w,onlySelectionChanged:E,undoInvoked:H,redoInvoked:$,canUndo:M,canRedo:J})});let K=Hf(R,k),N=$e.equalSelectionsJSON(we.getCurrentActiveSelectionJSON(),P);le.log("[editorUpdatesListener] compares: ",{isStateSame:K,isSelectionSame:N});let U=K&&N&&!z;if(!K||z||A){let W=xs({},K?R:k),G=Cn.getAllComments();G.length&&(W.commentThreads=G);let F={source:A?s0.remote:s0.local,content:W};_o.hooks&&_o.hooks.contentChanged&&_o.hooks.contentChanged(F),ti().instance.emit("content_changed",F)}if(U)le.log("[editorUpdatesListener] STOP - state and selection and comments are same ",wu);else if(we.undoInvoked()&&we.setUndoInvoked(!1),we.redoInvoked()&&we.setRedoInvoked(!1),we.setCurrentContentStateJSON(k),we.setPrevContentStateJSON(D),we.setMainSelectionJSON(P),we.setPrevMainSelectionJSON(O),Jf){let W=we.getCurrentActiveSelectionJSON();a({state:we.getCurrentContentStateJSON(),selection:W},[])}else c(wu)},p=()=>{let b=[];return we.getMainEditorNodesClassesMap().forEach((_,v,w)=>{let{klass:x}=_,S=f.registerMutationListener(x,E=>{for(let[k,D]of E){if(!Jr[D])continue;const P=we.getLexicalNodeByKey(k);if(D===Jr.created&&P&&zi.trackBlacklisted(P,D),x.name===kn.TableNode.name&&(D===Jr.destroyed?No.tableNodeRemoveListener(k):No.tableUpdateListener(k)),x.name===kn.TableRowNode.name&&D!==Jr.destroyed&&No.tableRowNodeChangesListener(k,D===Jr.updated),x.name===kn.TableCellNode.name&&D===Jr.updated&&No.tableCellNodeChangesListener(k),x.name===eo.MarkNode.name&&(le.debug("[MUTATION LISTENER] MARK node: ",{nodeKey:k,node:P,mutationType:D,codoxComments:Cn}),D===Jr.destroyed?Cn.removeRelatedNodeKey(k):P&&Cn.addRelatedNodeKey(P.__key,P.__ids,D===Jr.created)),P&&P.codoxId){if(D===Jr.destroyed)return void(P.codoxId&&jn.remove(P.codoxId));L0(P)||le.warn("[MutationListener Error] duplicating codoxId detected - such codoxId already exists in codoxNodesMap - updating node ref to latest: ",{mutationType:D,node:P}),jn.add(P.codoxId,P)}}b.push(S)})}),b},m={start:e,stop:n,on:(b,_)=>{le.info(`Subscribing client to codox ${b} event`),Wf[b]=_},cursor:{hide:()=>{vo.hideRemoteSelectionsFromUI()},show:()=>{vo.showHiddenRemoteSelectionsInUI()}},initComments:b=>{Cn.setInitialComments(b)}};return(0,Gt.useImperativeHandle)(d,()=>m),null}),kw=Ew,Ow=["comments"];function A0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function Kf(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?A0(Object(g),!0).forEach(function(t){Tw(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):A0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function Tw(y,d,g){return(d=jw(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function jw(y){var d=Aw(y,"string");return typeof d=="symbol"?d:d+""}function Aw(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}function Pw(y,d){if(y==null)return{};var g,t,f=Nw(y,d);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(y);for(t=0;t<r.length;t++)g=r[t],d.indexOf(g)>=0||{}.propertyIsEnumerable.call(y,g)&&(f[g]=y[g])}return f}function Nw(y,d){if(y==null)return{};var g={};for(var t in y)if({}.hasOwnProperty.call(y,t)){if(d.indexOf(t)>=0)continue;g[t]=y[t]}return g}class Iw extends o0{constructor(){super(),this.mainEditor=null,this.mainEditorKey=null,this.currentContentStateJSON=null,this.currentMainSelectionJSON=null,this.currentNestedSelectionJSON=null,this._isCodoxStarted=!1,this.prevContentStateJSON=null,this.prevMainSelectionJSON=null,this._undoInvoked=!1,this._redoInvoked=!1,this._canUndo=!1,this._canRedo=!1}setCanUndo(d){this._canUndo=d}setCanRedo(d){this._canRedo=d}canUndo(){return this._canUndo}canRedo(){return this._canRedo}setUndoInvoked(d){this._undoInvoked=d}setRedoInvoked(d){this._redoInvoked=d}undoInvoked(){return this._undoInvoked}redoInvoked(){return this._redoInvoked}setIsCodoxStarted(){let d=arguments.length>0&&arguments[0]!==void 0&&arguments[0];this._isCodoxStarted=d}get isCodoxStarted(){return this._isCodoxStarted}getMainEditorKey(){return this.mainEditorKey}setMainEditor(d){this.mainEditor=d,this.mainEditorKey=d._key}clearJSONs(){le.debug("[CodoxLexicalEditorManager][clearJSONs] invoked"),this.currentContentStateJSON=null,this.currentMainSelectionJSON=null,this.currentNestedSelectionJSON=null,this.prevContentStateJSON=null,this.prevMainSelectionJSON=null}removeMainEditor(){this.mainEditor=null,this.mainEditorKey=null,this._undoInvoked=!1,this._redoInvoked=!1,this._canUndo=!1,this._canRedo=!1,super.clear()}getMainEditor(){return this.mainEditor}alignStateSelectionJSONsFromLatestEditor(){this.getMainEditorState().read(()=>{this.setCurrentContentStateJSON(this.getMainEditorState().toJSON()),this.setMainSelectionJSON($e.lexicalToJSON((0,be.$getSelection)()))})}mainEditorExists(){return!!this.mainEditor}getMainEditorState(){return this.mainEditor?this.mainEditor.getEditorState():{}}getMainEditorNodesClassesMap(){return this.mainEditor?this.mainEditor._nodes:new Map}getLexicalNodeByKey(d){return this.mainEditor?this.getMainEditorState()._nodeMap.get(d):null}isLexicalEditorInstance(d){return d&&typeof d=="object"&&!!d.setEditorState}setCurrentContentStateJSON(d){return this.currentContentStateJSON=d,this.currentContentStateJSON}getCurrentContentStateJSON(){return this.currentContentStateJSON}setPrevContentStateJSON(d){this.prevContentStateJSON=d}getPrevContentStateJSON(){return this.prevContentStateJSON}setMainSelectionJSON(d){this.currentMainSelectionJSON=d,this.currentMainSelectionJSON&&this.currentNestedSelectionJSON&&(this.currentNestedSelectionJSON=null)}setNestedSelectionJSON(d){this.currentNestedSelectionJSON=d,this.currentNestedSelectionJSON&&this.currentMainSelectionJSON&&(this.currentMainSelectionJSON=null)}getCurrentMainSelectionJSON(){return this.currentMainSelectionJSON}getCurrentNestedSelectionJSON(){return this.currentNestedSelectionJSON}getCurrentActiveSelectionJSON(){return!this.currentMainSelectionJSON&&this.currentNestedSelectionJSON?this.currentNestedSelectionJSON:this.currentMainSelectionJSON}clearSelectionJSON(){this.currentMainSelectionJSON=null,this.currentNestedSelectionJSON=null}setPrevMainSelectionJSON(d){this.prevMainSelectionJSON=d}getPrevMainSelectionJSON(){return this.prevMainSelectionJSON}extractStateAndCommentsFromSynced(d){let{state:{comments:g},selection:t,stateReplace:f}=d;return{stateFromSync:{state:Kf({},Pw(d.state,Ow)),selection:t,stateReplace:f},commentsFromSync:g}}composeFullStateWithRootAndComments(){let{directlyFromEditor:d=!1}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Kf(Kf({},d?this.getMainEditorState().toJSON():this.currentContentStateJSON),{},{comments:Cn.getAllComments()})}isValidJSONState(d){let g=!1;try{if(!d)throw new Error("State is undefined");if(!d.root)throw new Error("State 'root' node is missing");let t=this.getMainEditorNodesClassesMap(),f=function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",e=r,s=t.get(e.type);if(!s)throw new Error(`Node with type "${e.type}" is not registered in editor`);let{klass:i}=s;if(n==="root"){let l=i.prototype instanceof be.ElementNode,o=i.prototype instanceof be.DecoratorNode;if(!l&&!o)throw new Error("State root node can have only element nodes as children")}if(e.children)for(let l of e.children)f(l,e.type)};f(d.root),g=!0}catch(t){le.error("[isValidJSONState] invalid state found: ",t.message),g=!1}return g}scanLexicalNodeForNestedEditorAttribute(d){for(let g in d){let t=d[g];if(this.isLexicalEditorInstance(t))return g}return""}isOnlySelectionChanged(d,g){return d.size===0&&g.size===0}addUpdateTag(){let{isSameState:d,isSameSelection:g,fromNestedEditor:t=!1,updateTag:f=""}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return f?(le.log(`[addUpdateTag] explicit add of tag "${f}" `),void(0,be.$addUpdateTag)(f)):t?(le.log(`[addUpdateTag] add "${no.historic}" tag - change invoked by nested editor`),void(0,be.$addUpdateTag)(no.historic)):void(d?(le.log(`[addUpdateTag] add "${no.historic}" tag - state is same`),(0,be.$addUpdateTag)(no.historic)):(le.log(`[addUpdateTag] add "${no.historyMerge}" tag - state is different`),(0,be.$addUpdateTag)(no.historyMerge)))}enableEditorReadOnlyMode(){this.mainEditor&&this.mainEditor.isEditable()&&this.mainEditor.setEditable(!1)}disableEditorReadOnlyMode(){this.mainEditor&&(this.mainEditor.isEditable()||this.mainEditor.setEditable(!0))}}const Rw=new Iw,we=Rw;class Mw{constructor(){this._nodesMap=new Map,this._pastedNodesCodoxIds=new Set}get size(){return this._nodesMap.size}add(d,g){this._nodesMap.set(d,g)}get(d){return this._nodesMap.get(d)||null}remove(d){this._nodesMap.delete(d)}has(d){return this._nodesMap.has(d)}nodesToArray(){return Array.from(this._nodesMap.values())}keysToArray(){return Array.from(this._nodesMap.keys())}toArray(){return Array.from(this._nodesMap.entries())}addPastedId(d){this._pastedNodesCodoxIds.add(d)}removePastedId(d){this._pastedNodesCodoxIds.delete(d)}hasPastedId(d){return this._pastedNodesCodoxIds.has(d)}clearPastedIds(){this._pastedNodesCodoxIds.size>0&&this._pastedNodesCodoxIds.clear()}isEmptyPastedIds(){return this._pastedNodesCodoxIds.size===0}getPastedIdsSize(){return this._pastedNodesCodoxIds.size}clearAll(){this._nodesMap.clear(),this._pastedNodesCodoxIds.clear()}gcAbandonedNodes(){let d=we.getMainEditorState();if(!d._nodeMap)return;let g=this.nodesToArray();for(let t of g)d._nodeMap.has(t.__key)||this.remove(t.codoxId)}}const Dw=new Mw,jn=Dw;function P0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function N0(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?P0(Object(g),!0).forEach(function(t){Lw(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):P0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function Lw(y,d,g){return(d=Bw(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function Bw(y){var d=Fw(y,"string");return typeof d=="symbol"?d:d+""}function Fw(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}const Gf=()=>W_(),I0=y=>typeof y=="number";function ws(y){let d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const g=function(){for(var t=arguments.length,f=new Array(t),r=0;r<t;r++)f[r]=arguments[r];return y.apply(this,f)};return Object.defineProperty(g,"name",{value:d,writable:!0}),g}const ka=y=>y.__type==="root"||y.type==="root",R0=y=>ka(y.getParent()),$n=y=>y.__type===mu.text||y.type===mu.text||y.hasOwnProperty("__text")||y.hasOwnProperty("text"),Ss=y=>(0,be.$isElementNode)(y),Cs=y=>(0,kn.$isTableNode)(y)||(0,kn.$isTableRowNode)(y)||(0,kn.$isTableCellNode)(y),zw=y=>!y.getChildren,M0=y=>!!y.getChildren,En=y=>(0,be.$isDecoratorNode)(y),zl=y=>(0,F_.$isLinkNode)(y),Ul=y=>y.__type==="mark"||y.type==="mark",Yf=y=>(0,be.$isLineBreakNode)(y),Ui=y=>$n(y)||Yf(y),Zf=y=>y.__type===mu.horizontalrule||y.type===mu.horizontalrule,D0=y=>{if(Ui(y)||zl(y)||Ul(y))return!1;if(!y.__parent||y.__parent==="root"||(0,be.$isParagraphNode)(y))return!0;let d=y.getParent().getChildren();return d.length===1&&d[0].__key===y.__key?!((En(y)||zl(y)||Ul(y))&&!Zf(y)):!d.some(g=>{let t=Zf(g);return g.__key!==y.__key&&(Ui(g)||En(g)&&!t||zl(g)||Ul(g))})},L0=y=>{const d=jn.get(y.codoxId);return!d||y.__key===d.__key},Es=function(y){const d=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:null)||Gf();y.codoxId=d,jn.add(d,y)},B0=y=>{jn.remove(y.codoxId),delete y.codoxId},Uw=y=>{if(!M0(y)||!y.getChildrenSize())return;const d=y.getChildren();if(d.some(f=>!!(0,be.$isParagraphNode)(f)))return;let g=!1,t=[];for(let f of d)(Ui(f)||En(f)||zl(f)||Ul(f))&&!g&&(Zf(f)||(g=!0)),(M0(f)||En(f))&&t.push(f);for(let f of t)g||f.codoxId?g&&f.codoxId&&(f=f.getWritable(),B0(f)):(f=f.getWritable(),Es(f))},$w=y=>{const d=N0({},y);for(const g in y)y[g]===void 0&&y.hasOwnProperty(g)&&delete d[g];return d},Hw=y=>{const d=`__nativeCreateDOM_${y.name}`;y.prototype[d]=ws(y.prototype.createDOM,d),y.prototype.createDOM=function(g,t){if(D0(this))if(this.codoxId){if(!L0(this)){let r=jn.get(this.codoxId);r.__type===this.__type&&this.isAttached()&&!r.isAttached()?(le.warn("[createDOM][Non-unique codoxId] overwrite abandoned existing node with latest: ",{latestNode:this,existingNode:r}),jn.add(this.codoxId,this)):Es(this)}}else Es(this);else this.codoxId&&B0(this);En(this)&&!this.codoxDId&&(this.codoxDId=Gf()),si.manageNestedEditorInLexicalNode(this);let f=this[d](g,t);return f.__codox_track=!0,f}},qw=y=>{const d=`__nativeUpdateDOM_${y.name}`;return y.prototype[d]=ws(y.prototype.updateDOM,d),y.prototype.updateDOM=function(){const g=this[d](...arguments);return Uw(this),g},y},Jw=y=>{const d=`__nativeRemove_${y.name}`;return y.prototype[d]=ws(y.prototype.remove,d),y.prototype.remove=function(){const g=this.codoxId;return g&&jn.remove(g),si.gcNestedEditorListenerInLexicalNode(this),this[d](...arguments)},y},Vw=y=>{const d=`__nativeExportJSON_${y.name}`;y.prototype[d]=ws(y.prototype.exportJSON,d),y.prototype.exportJSON=function(){const g=this[d]();return this.codoxId&&(g.codoxId=this.codoxId),this.codoxDId&&(g.codoxDId=this.codoxDId),$n(this)&&I0(g.format)&&this.hasFormat&&(g.format=ox(this)),$w(g)}},Ww=y=>{const d="__nativeImportJSON";y[d]=ws(y.importJSON,d),y.importJSON=function(g){const t=N0({},g);$n(t)&&!I0(t.format)&&(t.format=rx(t.format));const f=y[d](t);si.manageNestedEditorInLexicalNode(f);const r=D0(f);return r&&t.codoxId&&(jn.hasPastedId(t.codoxId)&&jn.has(t.codoxId)?(jn.removePastedId(t.codoxId),Es(f)):Es(f,t.codoxId)),r&&!f.codoxId&&Es(f),t.codoxDId&&(f.codoxDId=t.codoxDId),f}},Kw=y=>{const d="__nativeClone";y[d]=ws(y.clone,d),y.clone=function(g){const t=y[d](g);return g.codoxId&&(t.codoxId=g.codoxId),g.codoxDId&&(t.codoxDId=g.codoxDId),si.manageNestedEditorInClonedLexicalNode(g,t),t}},Gw=y=>{let d=!1,g=!1,t=!1,f=!1;y.forEach(n=>{n.name===be.TextNode.name?d=!0:n.name===be.ParagraphNode.name?g=!0:n.name===be.LineBreakNode.name?t=!0:n.name===eo.MarkNode.name&&(f=!0)});let r=[];return d||r.push(be.TextNode),g||r.push(be.ParagraphNode),t||r.push(be.LineBreakNode),f||r.push(eo.MarkNode),r.length?[...r,...y]:y},Yw=function(){return Gw(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).map(y=>(y.hasOwnProperty("__isCodoxExtended")||(Hw(y),qw(y),Vw(y),Jw(y),Ww(y),Kw(y),Object.defineProperty(y,"__isCodoxExtended",{value:!0,writable:!1})),y))};var Su=on(777),ks={};ks.styleTagTransform=ai(),ks.setAttributes=oi(),ks.insert=ri().bind(null,"head"),ks.domAPI=ni(),ks.insertStyleElement=ii(),ei()(Su.A,ks),Su.A&&Su.A.locals&&Su.A.locals;var Zw=y=>{var d={};return on.d(d,y),d};const Qw=Zw({AutoFocusPlugin:()=>Zg});var Xw=y=>{var d={};return on.d(d,y),d};const tS=Xw({ClearEditorPlugin:()=>w_});var eS=y=>{var d={};return on.d(d,y),d};const nS=eS({LexicalComposer:()=>Yg});var rS=y=>{var d={};return on.d(d,y),d};const F0=rS({default:()=>C_});var oS=y=>{var d={};return on.d(d,y),d};const iS=oS({HistoryPlugin:()=>pm});var aS=y=>{var d={};return on.d(d,y),d};const sS=aS({OnChangePlugin:()=>k_});var lS=y=>{var d={};return on.d(d,y),d};const cS=lS({PlainTextPlugin:()=>R_});var uS=y=>{var d={};return on.d(d,y),d};const z0=uS({$isRootTextContentEmpty:()=>gm,$rootTextContent:()=>hm});var dS=y=>{var d={};return on.d(d,y),d};const Os=dS({createPortal:()=>Yb.createPortal}),fS=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,pS=fS?Gt.useLayoutEffect:Gt.useEffect,U0=pS;var Cu=on(253),Ts={};Ts.styleTagTransform=ai(),Ts.setAttributes=oi(),Ts.insert=ri().bind(null,"head"),Ts.domAPI=ni(),Ts.insertStyleElement=ii(),ei()(Cu.A,Ts),Cu.A&&Cu.A.locals&&Cu.A.locals;function hS(y){let{onClose:d,children:g,title:t,closeOnClickOutside:f}=y;const r=(0,Gt.useRef)(null);return(0,Gt.useEffect)(()=>{r.current!==null&&r.current.focus()},[]),(0,Gt.useEffect)(()=>{let n=null;const e=l=>{l.key==="Escape"&&d()},s=l=>{const o=l.target;r.current!==null&&!r.current.contains(o)&&f&&d()},i=r.current;return i!==null&&(n=i.parentElement,n!==null&&n.addEventListener("click",s)),window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e),n!==null&&(n==null||n.removeEventListener("click",s))}},[f,d]),Gt.createElement("div",{className:"Modal__overlay",role:"dialog"},Gt.createElement("div",{className:"Modal__modal",tabIndex:-1,ref:r},Gt.createElement("h2",{className:"Modal__title"},t),Gt.createElement("button",{className:"Modal__closeButton","aria-label":"Close modal",type:"button",onClick:d},"X"),Gt.createElement("div",{className:"Modal__content"},g)))}function gS(y){let{onClose:d,children:g,title:t,closeOnClickOutside:f=!1}=y;return(0,Os.createPortal)(Gt.createElement(hS,{onClose:d,title:t,closeOnClickOutside:f},g),document.body)}function $0(){const[y,d]=(0,Gt.useState)(null),g=(0,Gt.useCallback)(()=>{d(null)},[]),t=(0,Gt.useMemo)(()=>{if(y===null)return null;const{title:r,content:n,closeOnClickOutside:e}=y;return Gt.createElement(gS,{onClose:g,title:r,closeOnClickOutside:e},n)},[y,g]),f=(0,Gt.useCallback)(function(r,n){d({closeOnClickOutside:arguments.length>2&&arguments[2]!==void 0&&arguments[2],content:n(g),title:r})},[g]);return[t,f]}var Eu=on(191),js={};js.styleTagTransform=ai(),js.setAttributes=oi(),js.insert=ri().bind(null,"head"),js.domAPI=ni(),js.insertStyleElement=ii(),ei()(Eu.A,js),Eu.A&&Eu.A.locals&&Eu.A.locals;const mS={blockCursor:"CommentEditorTheme__blockCursor",characterLimit:"CommentEditorTheme__characterLimit",code:"CommentEditorTheme__code",codeHighlight:{atrule:"CommentEditorTheme__tokenAttr",attr:"CommentEditorTheme__tokenAttr",boolean:"CommentEditorTheme__tokenProperty",builtin:"CommentEditorTheme__tokenSelector",cdata:"CommentEditorTheme__tokenComment",char:"CommentEditorTheme__tokenSelector",class:"CommentEditorTheme__tokenFunction","class-name":"CommentEditorTheme__tokenFunction",comment:"CommentEditorTheme__tokenComment",constant:"CommentEditorTheme__tokenProperty",deleted:"CommentEditorTheme__tokenProperty",doctype:"CommentEditorTheme__tokenComment",entity:"CommentEditorTheme__tokenOperator",function:"CommentEditorTheme__tokenFunction",important:"CommentEditorTheme__tokenVariable",inserted:"CommentEditorTheme__tokenSelector",keyword:"CommentEditorTheme__tokenAttr",namespace:"CommentEditorTheme__tokenVariable",number:"CommentEditorTheme__tokenProperty",operator:"CommentEditorTheme__tokenOperator",prolog:"CommentEditorTheme__tokenComment",property:"CommentEditorTheme__tokenProperty",punctuation:"CommentEditorTheme__tokenPunctuation",regex:"CommentEditorTheme__tokenVariable",selector:"CommentEditorTheme__tokenSelector",string:"CommentEditorTheme__tokenSelector",symbol:"CommentEditorTheme__tokenProperty",tag:"CommentEditorTheme__tokenProperty",url:"CommentEditorTheme__tokenOperator",variable:"CommentEditorTheme__tokenVariable"},embedBlock:{base:"CommentEditorTheme__embedBlock",focus:"CommentEditorTheme__embedBlockFocus"},hashtag:"CommentEditorTheme__hashtag",heading:{h1:"CommentEditorTheme__h1",h2:"CommentEditorTheme__h2",h3:"CommentEditorTheme__h3",h4:"CommentEditorTheme__h4",h5:"CommentEditorTheme__h5",h6:"CommentEditorTheme__h6"},image:"editor-image",indent:"CommentEditorTheme__indent",inlineImage:"inline-editor-image",layoutContainer:"CommentEditorTheme__layoutContainer",layoutItem:"CommentEditorTheme__layoutItem",link:"CommentEditorTheme__link",list:{checklist:"CommentEditorTheme__checklist",listitem:"CommentEditorTheme__listItem",listitemChecked:"CommentEditorTheme__listItemChecked",listitemUnchecked:"CommentEditorTheme__listItemUnchecked",nested:{listitem:"CommentEditorTheme__nestedListItem"},olDepth:["CommentEditorTheme__ol1","CommentEditorTheme__ol2","CommentEditorTheme__ol3","CommentEditorTheme__ol4","CommentEditorTheme__ol5"],ul:"CommentEditorTheme__ul"},ltr:"CommentEditorTheme__ltr",mark:"CommentEditorTheme__mark",markOverlap:"CommentEditorTheme__markOverlap",paragraph:"CommentEditorTheme__paragraph",quote:"CommentEditorTheme__quote",rtl:"CommentEditorTheme__rtl",table:"CommentEditorTheme__table",tableCell:"CommentEditorTheme__tableCell",tableCellActionButton:"CommentEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"CommentEditorTheme__tableCellActionButtonContainer",tableCellEditing:"CommentEditorTheme__tableCellEditing",tableCellHeader:"CommentEditorTheme__tableCellHeader",tableCellPrimarySelected:"CommentEditorTheme__tableCellPrimarySelected",tableCellResizer:"CommentEditorTheme__tableCellResizer",tableCellSelected:"CommentEditorTheme__tableCellSelected",tableCellSortedIndicator:"CommentEditorTheme__tableCellSortedIndicator",tableResizeRuler:"CommentEditorTheme__tableCellResizeRuler",tableSelected:"CommentEditorTheme__tableSelected",tableSelection:"CommentEditorTheme__tableSelection",text:{bold:"CommentEditorTheme__textBold",code:"CommentEditorTheme__textCode",italic:"CommentEditorTheme__textItalic",strikethrough:"CommentEditorTheme__textStrikethrough",subscript:"CommentEditorTheme__textSubscript",superscript:"CommentEditorTheme__textSuperscript",underline:"CommentEditorTheme__textUnderline",underlineStrikethrough:"CommentEditorTheme__textUnderlineStrikethrough"}},yS=mS;var ku=on(72),As={};As.styleTagTransform=ai(),As.setAttributes=oi(),As.insert=ri().bind(null,"head"),As.domAPI=ni(),As.insertStyleElement=ii(),ei()(ku.A,As),ku.A&&ku.A.locals&&ku.A.locals;function bS(){for(var y=arguments.length,d=new Array(y),g=0;g<y;g++)d[g]=arguments[g];return d.filter(Boolean).join(" ")}function Qf(){return Qf=Object.assign?Object.assign.bind():function(y){for(var d=1;d<arguments.length;d++){var g=arguments[d];for(var t in g)({}).hasOwnProperty.call(g,t)&&(y[t]=g[t])}return y},Qf.apply(null,arguments)}function $i(y){let{"data-test-id":d,children:g,className:t,onClick:f,disabled:r,small:n,title:e}=y;return Gt.createElement("button",Qf({disabled:r,className:bS("Button__root",r&&"Button__disabled",n&&"Button__small",t),onClick:f,title:e,"aria-label":e},d&&{"data-test-id":d}),g)}var Ou=on(129),Ps={};Ps.styleTagTransform=ai(),Ps.setAttributes=oi(),Ps.insert=ri().bind(null,"head"),Ps.domAPI=ni(),Ps.insertStyleElement=ii(),ei()(Ou.A,Ps),Ou.A&&Ou.A.locals&&Ou.A.locals;var vS=y=>{var d={};return on.d(d,y),d};const _S=vS({ContentEditable:()=>Qg});function xS(y){let{className:d}=y;return Gt.createElement(_S.ContentEditable,{className:d||"ContentEditable__root"})}var Tu=on(457),Ns={};Ns.styleTagTransform=ai(),Ns.setAttributes=oi(),Ns.insert=ri().bind(null,"head"),Ns.domAPI=ni(),Ns.insertStyleElement=ii(),ei()(Tu.A,Ns),Tu.A&&Tu.A.locals&&Tu.A.locals;function wS(y){let{children:d,className:g}=y;return Gt.createElement("div",{className:g||"Placeholder__root"},d)}const SS=F0.default.LexicalErrorBoundary||F0.default,CS=()=>Gt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#050505",className:"codox-add-comment-right"},Gt.createElement("path",{d:"M14 1a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4.414A2 2 0 0 0 3 11.586l-2 2V2a1 1 0 0 1 1-1h12zM2 0a2 2 0 0 0-2 2v12.793a.5.5 0 0 0 .854.353l2.853-2.853A1 1 0 0 1 4.414 12H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z"}),Gt.createElement("path",{d:"M3 3.5a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9a.5.5 0 0 1-.5-.5zM3 6a.5.5 0 0 1 .5-.5h9a.5.5 0 0 1 0 1h-9A.5.5 0 0 1 3 6zm0 2.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5z"})),H0=()=>Gt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"currentColor",className:"codox-remove-comment"},Gt.createElement("path",{d:"M6.5 1h3a.5.5 0 0 1 .5.5v1H6v-1a.5.5 0 0 1 .5-.5ZM11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3A1.5 1.5 0 0 0 5 1.5v1H2.506a.58.58 0 0 0-.01 0H1.5a.5.5 0 0 0 0 1h.538l.853 10.66A2 2 0 0 0 4.885 16h6.23a2 2 0 0 0 1.994-1.84l.853-10.66h.538a.5.5 0 0 0 0-1h-.995a.59.59 0 0 0-.01 0H11Zm1.958 1-.846 10.58a1 1 0 0 1-.997.92h-6.23a1 1 0 0 1-.997-.92L3.042 3.5h9.916Zm-7.487 1a.5.5 0 0 1 .528.47l.5 8.5a.5.5 0 0 1-.998.06L5 5.03a.5.5 0 0 1 .47-.53Zm5.058 0a.5.5 0 0 1 .47.53l-.5 8.5a.5.5 0 1 1-.998-.06l.5-8.5a.5.5 0 0 1 .528-.47ZM8 4.5a.5.5 0 0 1 .5.5v8.5a.5.5 0 0 1-1 0V5a.5.5 0 0 1 .5-.5Z"})),ES=()=>Gt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",className:"codox-add-comment"},Gt.createElement("path",{d:"M15.854.146a.5.5 0 0 1 .11.54l-5.819 14.547a.75.75 0 0 1-1.329.124l-3.178-4.995L.643 7.184a.75.75 0 0 1 .124-1.33L15.314.037a.5.5 0 0 1 .54.11ZM6.636 10.07l2.761 4.338L14.13 2.576 6.636 10.07Zm6.787-8.201L1.591 6.602l4.339 2.76 7.494-7.493Z"})),kS=()=>Gt.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"#0000008c",className:"codox-hide-show-comments"},Gt.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 5.885v1.166a3.95 3.95 0 0 1-3.949 3.95H6.917a.748.748 0 0 0-.45.15l-1.345 1.007a.752.752 0 0 0-.032 1.181A2.933 2.933 0 0 0 6.95 14h2.716l2.534 1.901a.506.506 0 0 0 .524.047A.501.501 0 0 0 13 15.5V14h.051a2.949 2.949 0 0 0 2.95-2.949v-3.05a3.002 3.002 0 0 0-2.002-2.83.756.756 0 0 0-.999.714"}),Gt.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.05 1H2.95A2.952 2.952 0 0 0 0 3.949v3.102A2.952 2.952 0 0 0 2.949 10H3v1.5a.502.502 0 0 0 .8.4L6.334 10H9.05A2.952 2.952 0 0 0 12 7.05V3.95A2.952 2.952 0 0 0 9.05 1"}));function q0(y,d,g){let t=arguments.length>3&&arguments[3]!==void 0?arguments[3]:performance.now(),f=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return Cn.createNewCommentObj({content:y,author:d,codoxId:g,timeStamp:t,deleted:f})}function OS(y,d,g){return Cn.createNewThreadObj({quote:y,comments:d,codoxId:g})}function TS(y){let{anchorKey:d,editor:g,onAddComment:t}=y;const f=(0,Gt.useRef)(null),r=(0,Gt.useCallback)(()=>{const n=f.current,e=g.getRootElement(),s=g.getElementByKey(d);if(n!==null&&e!==null&&s!==null){const{right:i}=e.getBoundingClientRect(),{top:l}=s.getBoundingClientRect();n.style.left=i-20+"px",n.style.top=l-30+"px"}},[d,g]);return(0,Gt.useEffect)(()=>(window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}),[g,r]),U0(()=>{r()},[d,g,r]),Gt.createElement("div",{className:"CodoxCommentPlugin_AddCommentBox",ref:f},Gt.createElement("button",{className:"CodoxCommentPlugin_AddCommentBox_button",onClick:t},Gt.createElement(CS,null)))}function jS(y){let{onEscape:d}=y;const[g]=(0,Fi.useLexicalComposerContext)();return(0,Gt.useEffect)(()=>g.registerCommand(be.KEY_ESCAPE_COMMAND,t=>d(t),2),[g,d]),null}function AS(y){let{editorRef:d}=y;const[g]=(0,Fi.useLexicalComposerContext)();return typeof d=="function"?d(g):typeof d=="object"&&(d.current=g),null}function J0(y){let{className:d,autoFocus:g,onEscape:t,onChange:f,editorRef:r,placeholder:n="Type a comment...",onEditorClick:e=()=>{}}=y;const s={namespace:"Commenting",nodes:[],onError:i=>{throw i},theme:yS};return Gt.createElement(nS.LexicalComposer,{initialConfig:s},Gt.createElement("div",{className:"CodoxCommentPlugin_CommentInputBox_EditorContainer",onClick:e},Gt.createElement(cS.PlainTextPlugin,{contentEditable:Gt.createElement(xS,{className:d}),placeholder:Gt.createElement(wS,null,n),ErrorBoundary:SS}),Gt.createElement(sS.OnChangePlugin,{onChange:f}),Gt.createElement(iS.HistoryPlugin,null),g!==!1&&Gt.createElement(Qw.AutoFocusPlugin,null),Gt.createElement(jS,{onEscape:t}),Gt.createElement(tS.ClearEditorPlugin,null),r!==void 0&&Gt.createElement(AS,{editorRef:r})))}function V0(y,d){return(0,Gt.useCallback)((g,t)=>{g.read(()=>{y((0,z0.$rootTextContent)()),d(!(0,z0.$isRootTextContentEmpty)(t.isComposing(),!0))})},[d,y])}function PS(y){let{editor:d,cancelAddComment:g,submitAddComment:t}=y;const[f,r]=(0,Gt.useState)(""),[n,e]=(0,Gt.useState)(!1),s=(0,Gt.useRef)(null),i=(0,Gt.useMemo)(()=>({container:document.createElement("div"),elements:[]}),[]),l=(0,Gt.useRef)(null),o=G0(),a=(0,Gt.useCallback)(()=>{d.getEditorState().read(()=>{const u=(0,be.$getSelection)();if((0,be.$isRangeSelection)(u)){l.current=u.clone();const h=u.anchor,p=u.focus,m=(0,Ca.createDOMRange)(d,h.getNode(),h.offset,p.getNode(),p.offset),b=s.current;if(m!==null&&b!==null){const{left:_,bottom:v,width:w}=m.getBoundingClientRect(),x=(0,Ca.createRectsFromDOMRange)(d,m);let S=x.length===1?_+w/2-125:_-125;S<10&&(S=10),b.style.left=`${S}px`,b.style.top=`${v+20+(window.pageYOffset||document.documentElement.scrollTop)}px`;const E=x.length,{container:k}=i,D=i.elements,P=D.length;for(let O=0;O<E;O++){const R=x[O];let A=D[O];A===void 0&&(A=document.createElement("span"),D[O]=A,k.appendChild(A));const z="255, 212, 0",H=`position:absolute;top:${R.top+(window.pageYOffset||document.documentElement.scrollTop)}px;left:${R.left}px;height:${R.height}px;width:${R.width}px;background-color:rgba(${z}, 0.3);pointer-events:none;z-index:5;`;A.style.cssText=H}for(let O=P-1;O>=E;O--){const R=D[O];k.removeChild(R),D.pop()}}}})},[d,i]);U0(()=>{a();const u=i.container,h=document.body;if(h!==null)return h.appendChild(u),()=>{h.removeChild(u)}},[i.container,a]),(0,Gt.useEffect)(()=>(window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}),[a]);const c=V0(r,e);return Gt.createElement("div",{className:"CodoxCommentPlugin_CommentInputBox",ref:s},Gt.createElement(J0,{className:"CodoxCommentPlugin_CommentInputBox_Editor",onEscape:u=>(u.preventDefault(),g(),!0),onChange:c}),Gt.createElement("div",{className:"CodoxCommentPlugin_CommentInputBox_Buttons"},Gt.createElement($i,{onClick:g,className:"CodoxCommentPlugin_CommentInputBox_Button"},"Cancel"),Gt.createElement($i,{onClick:()=>{if(n){let u=d.getEditorState().read(()=>{const h=l.current;return h?h.getTextContent():""});u.length>100&&(u=u.slice(0,99)+"…"),t(OS(u,[q0(f,o)]),!0,void 0,l.current),l.current=null}},disabled:!n,className:"CodoxCommentPlugin_CommentInputBox_Button primary"},"Comment")))}function NS(y){let{submitAddComment:d,thread:g,placeholder:t}=y;const[f,r]=(0,Gt.useState)(""),[n,e]=(0,Gt.useState)(!1),s=(0,Gt.useRef)(null),i=G0(),l=V0(r,e);return Gt.createElement(Gt.Fragment,null,Gt.createElement(J0,{className:"CodoxCommentPlugin_CommentsPanel_Editor",autoFocus:!1,onEscape:()=>!0,onChange:l,editorRef:s,placeholder:t}),Gt.createElement($i,{className:"CodoxCommentPlugin_CommentsPanel_SendButton",onClick:()=>{if(n){d(q0(f,i),!1,g);const o=s.current;o!==null&&o.dispatchCommand(be.CLEAR_EDITOR_COMMAND,void 0)}},disabled:!n},Gt.createElement(ES,null)))}function W0(y){let{commentOrThread:d,deleteCommentOrThread:g,onClose:t,thread:f}=y;return Gt.createElement(Gt.Fragment,null,"Are you sure you want to delete this ",d.type,"?",Gt.createElement("div",{className:"Modal__content"},Gt.createElement($i,{onClick:()=>{g(d,f),t()}},"Delete")," ",Gt.createElement($i,{onClick:()=>{t()}},"Cancel")))}function K0(y){let{comment:d,deleteComment:g,thread:t,rtf:f}=y;const r=Math.round((d.timeStamp-performance.now())/1e3),n=Math.round(r/60),[e,s]=$0();return Gt.createElement("li",{className:"CodoxCommentPlugin_CommentsPanel_List_Comment"},Gt.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_List_Details"},Gt.createElement("span",{className:"CodoxCommentPlugin_CommentsPanel_List_Comment_Author"},d.author),Gt.createElement("span",{className:"CodoxCommentPlugin_CommentsPanel_List_Comment_Time"},"· ",r>-10?"Just now":f.format(n,"minute"))),Gt.createElement("p",{className:d.deleted?"CodoxCommentPlugin_CommentsPanel_DeletedComment":""},d.content),!d.deleted&&Gt.createElement(Gt.Fragment,null,Gt.createElement($i,{onClick:()=>{s("Delete Comment",i=>Gt.createElement(W0,{commentOrThread:d,deleteCommentOrThread:g,thread:t,onClose:i}))},className:"CodoxCommentPlugin_CommentsPanel_List_DeleteButton"},Gt.createElement(H0,null)),e))}function IS(y){let{activeIDs:d,comments:g,deleteCommentOrThread:t,listRef:f,submitAddComment:r,markNodeMap:n}=y;const[e]=(0,Fi.useLexicalComposerContext)(),[s,i]=(0,Gt.useState)(0),[l,o]=$0(),a=(0,Gt.useMemo)(()=>new Intl.RelativeTimeFormat("en",{localeMatcher:"best fit",numeric:"auto",style:"short"}),[]);return(0,Gt.useEffect)(()=>{const c=setTimeout(()=>{i(s+1)},1e4);return()=>{clearTimeout(c)}},[s]),Gt.createElement("ul",{className:"CodoxCommentPlugin_CommentsPanel_List",ref:f},g.map(c=>{const u=c.codoxId;if(!u)return null;if(c.type==="thread"){const h=()=>{if(n.get(u)!==void 0&&(d===null||d.indexOf(u)===-1)){const p=document.activeElement;e.update(()=>{(0,be.$setSelection)(null)},{onUpdate(){p!==null&&p.focus()}})}};return Gt.createElement("li",{key:u,onClick:h,className:`CodoxCommentPlugin_CommentsPanel_List_Thread ${n.has(u)?"interactive":""} ${d.indexOf(u)===-1?"":"active"}`},Gt.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_QuoteBox"},Gt.createElement("blockquote",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_Quote"},"> ",Gt.createElement("span",null,c.quote)),Gt.createElement($i,{onClick:()=>{o("Delete Thread",p=>Gt.createElement(W0,{commentOrThread:c,deleteCommentOrThread:t,onClose:p}))},className:"CodoxCommentPlugin_CommentsPanel_List_DeleteButton"},Gt.createElement(H0,null)),l),Gt.createElement("ul",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_Comments"},c.comments.map(p=>Gt.createElement(K0,{key:p.codoxId,comment:p,deleteComment:t,thread:c,rtf:a}))),Gt.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_List_Thread_Editor"},Gt.createElement(NS,{submitAddComment:r,thread:c,placeholder:"Reply to comment..."})))}return Gt.createElement(K0,{key:u,comment:c,deleteComment:t,rtf:a})}))}function RS(y){let{activeIDs:d,deleteCommentOrThread:g,comments:t,submitAddComment:f,markNodeMap:r}=y;const n=(0,Gt.useRef)(null),e=t.length===0;return Gt.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel"},Gt.createElement("h2",{className:"CodoxCommentPlugin_CommentsPanel_Heading"},"Comments"),e?Gt.createElement("div",{className:"CodoxCommentPlugin_CommentsPanel_Empty"},"No Comments"):Gt.createElement(IS,{activeIDs:d,comments:t,deleteCommentOrThread:g,listRef:n,submitAddComment:f,markNodeMap:r}))}function G0(){const y=(0,k0.useCollaborationContext)(),{yjsDocMap:d,name:g}=y;return g||"Playground User"}function MS(y){const[d]=(0,Fi.useLexicalComposerContext)(),g=yx(),t=(0,Gt.useMemo)(()=>new Map,[]),[f,r]=(0,Gt.useState)(),[n,e]=(0,Gt.useState)([]),[s,i]=(0,Gt.useState)(!1),[l,o]=(0,Gt.useState)(!1);(0,Gt.useEffect)(()=>{!g.length&&l?o(!1):g.length},[g]);const a=(0,Gt.useCallback)(()=>{d.update(()=>{const h=(0,be.$getSelection)();h!==null&&(h.dirty=!0)}),i(!1)},[d]),c=(0,Gt.useCallback)((h,p)=>{if(h.type==="comment"){if(le.log("[deleteCommentOrThread]: type comment new values",{comment:h,thread:p,markNodeMap:t}),Cn.removeComment(p.codoxId,h.codoxId),!p)return;const m=p.codoxId,b=t.get(m);d.update(()=>{b?b.forEach((_,v)=>{const w=(0,be.$getNodeByKey)(v);le.log("[deleteCommentOrThread]: type comment new values",{lexicalNode:w}),w&&w.markDirty()}):(0,be.$getRoot)().markDirty(),(0,be.$addUpdateTag)(no.historic),(0,be.$addUpdateTag)(Bl)})}else{le.log("[deleteCommentOrThread]: type thread new values",{comment:h,markNodeMap:t});const m=p!==void 0?p.codoxId:h.codoxId,b=t.get(m);setTimeout(()=>{d.update(()=>{if(b)for(const _ of b){const v=(0,be.$getNodeByKey)(_);le.log("[deleteCommentOrThread]: type thread new values",{node:v}),(0,eo.$isMarkNode)(v)&&(v.deleteID(m),v.getIDs().length===0&&(0,eo.$unwrapMarkNode)(v))}else(0,be.$getRoot)().markDirty(),le.debug("[deleteCommentOrThread][refreshComments]");Cn.refreshComments(!0),(0,be.$addUpdateTag)(Bl)})})}},[d,t]),u=(0,Gt.useCallback)((h,p,m,b)=>{if(le.log("[submitAddComment]: new values",{commentOrThread:h,isInlineComment:p,thread:m,markNodeMap:t}),m?Cn.addComment(m.codoxId,h):Cn.addCommentThread(h),p)d.update(()=>{if((0,be.$isRangeSelection)(b)){const _=b.isBackward(),v=h.codoxId;(0,eo.$wrapSelectionInMarkNode)(b,_,v),(0,be.$addUpdateTag)(Bl)}}),i(!1);else if(!p&&m){const _=m.codoxId,v=t.get(_);if(!v)return void Cn.removeComment(m.codoxId,h.codoxId);d.update(()=>{v.forEach((w,x)=>{let S=(0,be.$getNodeByKey)(x);S&&S.markDirty()}),(0,be.$addUpdateTag)(no.historic),(0,be.$addUpdateTag)(Bl)})}},[d]);return(0,Gt.useEffect)(()=>{const h=[];for(let p=0;p<n.length;p++){const m=n[p],b=t.get(m);if(b!==void 0)for(const _ of b){const v=d.getElementByKey(_);v!==null&&(v.classList.add("selected"),h.push(v),o(!0))}}return()=>{for(let p=0;p<h.length;p++)h[p].classList.remove("selected")}},[n,d,t]),(0,Gt.useEffect)(()=>{const h=new Map;return(0,bs.mergeRegister)((0,bs.registerNestedElementResolver)(d,eo.MarkNode,p=>(0,eo.$createMarkNode)(p.getIDs()),(p,m)=>{p.getIDs().forEach(b=>{m.addID(b)})}),d.registerMutationListener(eo.MarkNode,p=>{d.getEditorState().read(()=>{for(const[m,b]of p){const _=(0,be.$getNodeByKey)(m);let v=[];b==="destroyed"?v=h.get(m)||[]:(0,eo.$isMarkNode)(_)&&(v=_.getIDs());for(let w=0;w<v.length;w++){const x=v[w];let S=t.get(x);h.set(m,v),b==="destroyed"?S!==void 0&&(S.delete(m),S.size===0&&t.delete(x)):(S===void 0&&(S=new Set,t.set(x,S)),S.has(m)||S.add(m))}}})}),d.registerUpdateListener(p=>{let{editorState:m,tags:b}=p;m.read(()=>{const _=(0,be.$getSelection)();let v=!1,w=!1;if((0,be.$isRangeSelection)(_)){const x=_.anchor.getNode();if((0,be.$isTextNode)(x)){const S=(0,eo.$getMarkIDs)(x,_.anchor.offset);S!==null&&(e(S),v=!0),_.isCollapsed()||(r(x.getKey()),w=!0)}}v||e(x=>x.length===0?x:[]),w||r(null),(0,be.$isRangeSelection)(_)&&i(!1)})}),d.registerCommand($f,()=>{const p=window.getSelection();return p!==null&&p.removeAllRanges(),i(!0),!0},be.COMMAND_PRIORITY_EDITOR))},[d,t]),Gt.createElement(Gt.Fragment,null,s&&(0,Os.createPortal)(Gt.createElement(PS,{editor:d,cancelAddComment:a,submitAddComment:u}),document.body),f!=null&&!s&&(0,Os.createPortal)(Gt.createElement(TS,{anchorKey:f,editor:d,onAddComment:()=>{d.dispatchCommand($f,void 0)}}),document.body),(0,Os.createPortal)(Gt.createElement($i,{className:"CodoxCommentPlugin_ShowCommentsButton "+(l?"active":""),onClick:()=>o(!l),title:l?"Hide Comments":"Show Comments"},Gt.createElement(kS,null)),document.body),l&&(0,Os.createPortal)(Gt.createElement(RS,{comments:g,submitAddComment:u,deleteCommentOrThread:c,activeIDs:n,markNodeMap:t}),document.body))}var ju=on(766),Is={};Is.styleTagTransform=ai(),Is.setAttributes=oi(),Is.insert=ri().bind(null,"head"),Is.domAPI=ni(),Is.insertStyleElement=ii(),ei()(ju.A,Is),ju.A&&ju.A.locals&&ju.A.locals;var Au=on(225),Rs={};Rs.styleTagTransform=ai(),Rs.setAttributes=oi(),Rs.insert=ri().bind(null,"head"),Rs.domAPI=ni(),Rs.insertStyleElement=ii(),ei()(Au.A,Rs),Au.A&&Au.A.locals&&Au.A.locals;function DS(y){let{label:d,value:g,onChange:t,placeholder:f="","data-test-id":r,type:n="text"}=y;return Gt.createElement("div",{className:"CodoxInput__wrapper"},Gt.createElement("label",{className:"CodoxInput__label"},d),Gt.createElement("input",{type:n,className:"CodoxInput__input",placeholder:f,value:g,onChange:e=>{t(e.target.value)},"data-test-id":r}))}function Y0(y,d){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(y);d&&(t=t.filter(function(f){return Object.getOwnPropertyDescriptor(y,f).enumerable})),g.push.apply(g,t)}return g}function Pu(y){for(var d=1;d<arguments.length;d++){var g=arguments[d]!=null?arguments[d]:{};d%2?Y0(Object(g),!0).forEach(function(t){LS(y,t,g[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):Y0(Object(g)).forEach(function(t){Object.defineProperty(y,t,Object.getOwnPropertyDescriptor(g,t))})}return y}function LS(y,d,g){return(d=BS(d))in y?Object.defineProperty(y,d,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[d]=g,y}function BS(y){var d=FS(y,"string");return typeof d=="symbol"?d:d+""}function FS(y,d){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var t=g.call(y,d||"default");if(typeof t!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(y)}let $l=!1;const zS=["#d0021b","#f5a623","#f8e71c","#8b572a","#7ed321","#417505","#bd10e0","#9013fe","#4a90e2","#50e3c2","#b8e986","#000000","#4a4a4a","#9b9b9b","#ffffff"],Hl=214,Z0=150;function US(y){let{color:d,onChange:g}=y;const[t,f]=(0,Gt.useState)(Ms("hex",d)),[r,n]=(0,Gt.useState)(d),e=(0,Gt.useRef)(null),s=(0,Gt.useMemo)(()=>({x:t.hsv.s/100*Hl,y:(100-t.hsv.v)/100*Z0}),[t.hsv.s,t.hsv.v]),i=(0,Gt.useMemo)(()=>({x:t.hsv.h/360*Hl}),[t.hsv]);return(0,Gt.useEffect)(()=>{e.current!==null&&g&&n(t.hex)},[t,g]),(0,Gt.useEffect)(()=>{if(d===void 0)return;const l=Ms("hex",d);f(l),n(l.hex)},[d]),Gt.createElement("div",{className:"codox-color-picker-wrapper",style:{width:Hl},ref:e},Gt.createElement(DS,{label:"Hex",onChange:l=>{if(n(l),/^#[0-9A-Fa-f]{6}$/i.test(l)){const o=Ms("hex",l);f(o)}},value:r}),Gt.createElement("div",{className:"codox-color-picker-basic-color"},zS.map(l=>Gt.createElement("button",{className:l===t.hex?" active":"",key:l,style:{backgroundColor:l},onClick:()=>(o=>{n(o);let a=Ms("hex",o);f(a),g(a.hex,$l)})(l)}))),Gt.createElement(Q0,{className:"codox-color-picker-saturation",style:{backgroundColor:`hsl(${t.hsv.h}, 100%, 50%)`},onChange:l=>{let{x:o,y:a}=l;const c=Ms("hsv",Pu(Pu({},t.hsv),{},{s:o/Hl*100,v:100-a/Z0*100}));f(c),n(c.hex),g(c.hex,$l)}},Gt.createElement("div",{className:"codox-color-picker-saturation_cursor",style:{backgroundColor:t.hex,left:s.x,top:s.y}})),Gt.createElement(Q0,{className:"codox-color-picker-hue",onChange:l=>{let{x:o}=l;const a=Ms("hsv",Pu(Pu({},t.hsv),{},{h:o/Hl*360}));f(a),n(a.hex),g(a.hex,$l)}},Gt.createElement("div",{className:"codox-color-picker-hue_cursor",style:{backgroundColor:`hsl(${t.hsv.h}, 100%, 50%)`,left:i.x}})),Gt.createElement("div",{className:"codox-color-picker-color",style:{backgroundColor:t.hex}}))}function Q0(y){let{className:d,style:g,onChange:t,children:f}=y;const r=(0,Gt.useRef)(null),n=(0,Gt.useRef)(!1),e=s=>{if(r.current){const{current:i}=r,{width:l,height:o,left:a,top:c}=i.getBoundingClientRect(),u=X0(s.clientX-a,l,0),h=X0(s.clientY-c,o,0);t({x:u,y:h})}};return Gt.createElement("div",{ref:r,className:d,style:g,onMouseDown:s=>{if(s.button!==0)return;e(s);const i=o=>{n.current=!0,$l=!0,e(o)},l=o=>{n.current&&($l=!1),document.removeEventListener("mousemove",i,!1),document.removeEventListener("mouseup",l,!1),e(o),n.current=!1};document.addEventListener("mousemove",i,!1),document.addEventListener("mouseup",l,!1)}},f)}function X0(y,d,g){return y>d?d:y<g?g:y}function ty(y){if(!y.startsWith("#")){const d=document.createElement("canvas").getContext("2d");if(!d)throw new Error("2d context not supported or canvas already initialized");return d.fillStyle=y,d.fillStyle}return y.length===4||y.length===5?y=y.split("").map((d,g)=>g?d+d:"#").join(""):y.length===7||y.length===9?y:"#000000"}function ey(y){const d=(y.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(g,t,f,r)=>"#"+t+t+f+f+r+r).substring(1).match(/.{2}/g)||[]).map(g=>parseInt(g,16));return{b:d[2],g:d[1],r:d[0]}}function Xf(y){let{r:d,g,b:t}=y;d/=255,g/=255,t/=255;const f=Math.max(d,g,t),r=f-Math.min(d,g,t);return{h:r?60*(f===d?(g-t)/r+(g<t?6:0):f===g?2+(t-d)/r:4+(d-g)/r):0,s:f?r/f*100:0,v:100*f}}function $S(y){let{h:d,s:g,v:t}=y;g/=100,t/=100;const f=~~(d/60),r=d/60-f,n=t*(1-g),e=t*(1-g*r),s=t*(1-g*(1-r)),i=f%6,l=Math.round(255*[t,e,n,n,s,t][i]),o=Math.round(255*[s,t,t,e,n,n][i]);return{b:Math.round(255*[n,n,s,t,t,e][i]),g:o,r:l}}function ny(y){let{b:d,g,r:t}=y;return"#"+[t,g,d].map(f=>f.toString(16).padStart(2,"0")).join("")}function Ms(y,d){let g=ty("#121212"),t=ey(g),f=Xf(t);return y==="hex"?(g=ty(d),t=ey(g),f=Xf(t)):y==="rgb"?(t=d,g=ny(t),f=Xf(t)):y==="hsv"&&(f=d,t=$S(f),g=ny(t)),{hex:g,hsv:f,rgb:t}}const HS=Gt.createContext(null),ry=4;function qS(y){let{children:d,dropDownRef:g,onClose:t,dropdownClassName:f}=y;const[r,n]=(0,Gt.useState)(),[e,s]=(0,Gt.useState)(),i=(0,Gt.useCallback)(o=>{n(a=>a?[...a,o]:[o])},[n]),l=(0,Gt.useMemo)(()=>({registerItem:i}),[i]);return(0,Gt.useEffect)(()=>{r&&!e&&s(r[0]),e&&e.current&&e.current.focus()},[r,e]),Gt.createElement(HS.Provider,{value:l},Gt.createElement("div",{className:f,ref:g,onKeyDown:o=>{if(!r)return;const a=o.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(a)&&o.preventDefault(),a==="Escape"||a==="Tab"?t():a==="ArrowUp"?s(c=>{if(!c)return r[0];const u=r.indexOf(c)-1;return r[u===-1?r.length-1:u]}):a==="ArrowDown"&&s(c=>c?r[r.indexOf(c)+1]:r[0])}},d))}function JS(y){let{disabled:d=!1,buttonLabel:g,buttonAriaLabel:t,buttonClassName:f,buttonIconClassName:r,children:n,stopCloseOnClickSelf:e,dropdownClassName:s,buttonLabelClassName:i,dropdownChevronClassName:l}=y;const o=(0,Gt.useRef)(null),a=(0,Gt.useRef)(null),[c,u]=(0,Gt.useState)(!1);return(0,Gt.useEffect)(()=>{const h=a.current,p=o.current;if(c&&h!==null&&p!==null){const{top:m,left:b}=h.getBoundingClientRect();p.style.top=`${m+h.offsetHeight+ry}px`,p.style.left=`${Math.min(b,window.innerWidth-p.offsetWidth-20)}px`}},[o,a,c]),(0,Gt.useEffect)(()=>{const h=a.current;if(h!==null&&c){const p=m=>{const b=m.target;e&&o.current&&o.current.contains(b)||h.contains(b)||u(!1)};return document.addEventListener("click",p),()=>{document.removeEventListener("click",p)}}},[o,a,c,e]),(0,Gt.useEffect)(()=>{const h=()=>{if(c){const p=a.current,m=o.current;if(p!==null&&m!==null){const{top:b}=p.getBoundingClientRect(),_=b+p.offsetHeight+ry;_!==m.getBoundingClientRect().top&&(m.style.top=`${_}px`)}}};return document.addEventListener("scroll",h),()=>{document.removeEventListener("scroll",h)}},[a,o,c]),Gt.createElement(Gt.Fragment,null,Gt.createElement("button",{type:"button",disabled:d,"aria-label":t||g,className:f,onClick:()=>u(!c),ref:a},r&&Gt.createElement("span",{className:r}),g&&Gt.createElement("span",{className:i},g),Gt.createElement("i",{className:l})),c&&(0,Os.createPortal)(Gt.createElement(qS,{dropDownRef:o,onClose:()=>{u(!1),a&&a.current&&a.current.focus()},dropdownClassName:s},n),document.body))}const VS=["disabled","stopCloseOnClickSelf","color","onChange"];function tp(){return tp=Object.assign?Object.assign.bind():function(y){for(var d=1;d<arguments.length;d++){var g=arguments[d];for(var t in g)({}).hasOwnProperty.call(g,t)&&(y[t]=g[t])}return y},tp.apply(null,arguments)}function WS(y,d){if(y==null)return{};var g,t,f=KS(y,d);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(y);for(t=0;t<r.length;t++)g=r[t],d.indexOf(g)>=0||{}.propertyIsEnumerable.call(y,g)&&(f[g]=y[g])}return f}function KS(y,d){if(y==null)return{};var g={};for(var t in y)if({}.hasOwnProperty.call(y,t)){if(d.indexOf(t)>=0)continue;g[t]=y[t]}return g}function oy(y){let{disabled:d=!1,stopCloseOnClickSelf:g=!0,color:t,onChange:f}=y,r=WS(y,VS);return Gt.createElement(JS,tp({},r,{disabled:d,stopCloseOnClickSelf:g}),Gt.createElement(US,{color:t,onChange:f}))}const GS=y=>{let{onColorChange:d,buttonClassName:g,buttonIconClassName:t,buttonAriaLabel:f,buttonLabel:r,dropdownClassName:n,buttonLabelClassName:e,dropdownChevronClassName:s}=y;const[i]=(0,Fi.useLexicalComposerContext)(),[l,o]=(0,Gt.useState)(()=>i.isEditable()),[a,c]=(0,Gt.useState)("");(0,Gt.useEffect)(()=>(0,bs.mergeRegister)(i.registerEditableListener(h=>{o(h)}),i.registerUpdateListener(h=>{let{editorState:p}=h;p.read(()=>{const m=(0,be.$getSelection)();if((0,be.$isRangeSelection)(m)){let b=(0,Ca.$getSelectionStyleValueForProperty)(m,"color");b!==a&&(c(b||""),d(b))}})})),[i]);const u=(0,Gt.useCallback)((h,p)=>{i.update(()=>{const m=(0,be.$getSelection)();m!==null&&(0,Ca.$patchStyleText)(m,{color:h})})},[i]);return Gt.createElement(oy,{disabled:!l,color:a,onChange:u,buttonClassName:g||"",buttonIconClassName:t||"",buttonAriaLabel:f||"",buttonLabel:r||"",dropdownClassName:n||"",buttonLabelClassName:e||"",dropdownChevronClassName:s||""})},YS=GS,ZS=y=>{let{onColorChange:d,buttonClassName:g,buttonIconClassName:t,buttonAriaLabel:f,buttonLabel:r,dropdownClassName:n,buttonLabelClassName:e,dropdownChevronClassName:s}=y;const[i]=(0,Fi.useLexicalComposerContext)(),[l,o]=(0,Gt.useState)(()=>i.isEditable()),[a,c]=(0,Gt.useState)("#fff");(0,Gt.useEffect)(()=>(0,bs.mergeRegister)(i.registerEditableListener(h=>{o(h)}),i.registerUpdateListener(h=>{let{editorState:p}=h;p.read(()=>{const m=(0,be.$getSelection)();if((0,be.$isRangeSelection)(m)){let b=(0,Ca.$getSelectionStyleValueForProperty)(m,"background-color");b!==a&&(c(b||""),d(b))}})})),[i]);const u=(0,Gt.useCallback)((h,p)=>{i.update(()=>{const m=(0,be.$getSelection)();m!==null&&(0,Ca.$patchStyleText)(m,{"background-color":h})})},[i]);return Gt.createElement(oy,{disabled:!l,color:a,onChange:u,buttonClassName:g||"",buttonIconClassName:t||"",buttonAriaLabel:f||"",buttonLabel:r||"",dropdownClassName:n||"",buttonLabelClassName:e||"",dropdownChevronClassName:s||""})},QS=ZS;var XS=Mi.yy;Mi._U,Mi.a8,Mi.Vs,Mi.Cn;var t2=Mi.gK,e2=Mi.vv;function n2(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}var Nu=n2(function(y){const d=new URLSearchParams;d.append("code",y);for(let g=1;g<arguments.length;g++)d.append("v",arguments[g]);throw Error(`Minified Lexical error #${y}; visit https://lexical.dev/docs/error?${d} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)});function r2({hasCellMerge:y=!0,hasCellBackgroundColor:d=!0,hasTabHandler:g=!0}){const[t]=jr();return Ce.useEffect(()=>(t.hasNodes([bo,Ao,xa])||Nu(10),mo(t.registerCommand(r_,({columns:f,rows:r,includeHeaders:n})=>{const e=Dm(Number(r),Number(f),n);cm(e);const s=e.getFirstDescendant();return Ne(s)&&s.select(),!0},an),t.registerNodeTransform(bo,f=>{const[r]=zm(f,null,null),n=r.reduce((e,s)=>Math.max(e,s.length),0);for(let e=0;e<r.length;++e){const s=r[e].length;if(s===n)continue;const i=r[e][s-1].cell;for(let l=s;l<n;++l){const o=Xo(0);o.append(Un()),i!==null?i.insertAfter(o):um(i,o)}}}))),[t]),Ce.useEffect(()=>{const f=new Map,r=e=>{const s=e.getKey(),i=t.getElementByKey(s);if(i&&!f.has(s)){const l=m_(e,i,t,g);f.set(s,l)}};t.getEditorState().read(()=>{const e=Qh(bo);for(const s of e)Pn(s)&&r(s)});const n=t.registerMutationListener(bo,e=>{for(const[s,i]of e)if(i==="created")t.getEditorState().read(()=>{const l=Vn(s);Pn(l)&&r(l)});else if(i==="destroyed"){const l=f.get(s);l!==void 0&&(l.removeListeners(),f.delete(s))}});return()=>{n();for(const[,e]of f)e.removeListeners()}},[t,g]),Ce.useEffect(()=>{if(!y)return t.registerNodeTransform(Ao,f=>{if(f.getColSpan()>1||f.getRowSpan()>1){const[,,r]=qr(f),[n]=Po(r,f,f),e=n.length,s=n[0].length;let i=r.getFirstChild();sr(i)||Nu(175);const l=[];for(let o=0;o<e;o++){o!==0&&(i=i.getNextSibling(),sr(i)||Nu(175));let a=null;for(let c=0;c<s;c++){const u=n[o][c],h=u.cell;if(u.startRow===o&&u.startColumn===c)a=h,l.push(h);else if(h.getColSpan()>1||h.getRowSpan()>1){rn(h)||Nu(176);const p=Xo(h.__headerState);a!==null?a.insertAfter(p):um(i,p)}}}for(const o of l)o.setColSpan(1),o.setRowSpan(1)}})},[t,y]),Ce.useEffect(()=>{if(!d)return t.registerNodeTransform(Ao,f=>{f.getBackgroundColor()!==null&&f.setBackgroundColor(null)})},[t,d,y]),null}const o2={code:"editor-code",heading:{h1:"editor-heading-h1",h2:"editor-heading-h2",h3:"editor-heading-h3",h4:"editor-heading-h4",h5:"editor-heading-h5"},image:"editor-image",link:"editor-link",list:{listitem:"editor-listitem",nested:{listitem:"editor-nested-listitem"},ol:"editor-list-ol",ul:"editor-list-ul"},ltr:"ltr",paragraph:"editor-paragraph",placeholder:"editor-placeholder",quote:"editor-quote",rtl:"rtl",text:{bold:"editor-text-bold",code:"editor-text-code",hashtag:"editor-text-hashtag",italic:"editor-text-italic",overflowed:"editor-text-overflowed",strikethrough:"editor-text-strikethrough",underline:"editor-text-underline",underlineStrikethrough:"editor-text-underlineStrikethrough"},table:"PlaygroundEditorTheme__table",tableAddColumns:"PlaygroundEditorTheme__tableAddColumns",tableAddRows:"PlaygroundEditorTheme__tableAddRows",tableCell:"PlaygroundEditorTheme__tableCell",tableCellActionButton:"PlaygroundEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"PlaygroundEditorTheme__tableCellActionButtonContainer",tableCellEditing:"PlaygroundEditorTheme__tableCellEditing",tableCellHeader:"PlaygroundEditorTheme__tableCellHeader",tableCellPrimarySelected:"PlaygroundEditorTheme__tableCellPrimarySelected",tableCellResizer:"PlaygroundEditorTheme__tableCellResizer",tableCellSelected:"PlaygroundEditorTheme__tableCellSelected",tableCellSortedIndicator:"PlaygroundEditorTheme__tableCellSortedIndicator",tableResizeRuler:"PlaygroundEditorTheme__tableCellResizeRuler",tableSelected:"PlaygroundEditorTheme__tableSelected",tableSelection:"PlaygroundEditorTheme__tableSelection"},i2="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDE1IDE1IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYuMDAwMDEgOC4zMzMzM0wxLjkwMDAxIDEzLjhMMS4xMDAwMSAxMy4yTDUuMzc1MDEgNy41TDEuMTAwMDEgMS44TDEuOTAwMDEgMS4yTDYuMDAwMDEgNi42NjY2N0wxMC4xIDEuMkwxMC45IDEuOEw2LjYyNTAxIDcuNUwxMC45IDEzLjJMMTAuMSAxMy44TDYuMDAwMDEgOC4zMzMzM1pNMTIgMTIuNUMxMiAxMS42NzE2IDEyLjY3MTYgMTEgMTMuNSAxMUgxMy43OTI5QzE0LjQ1OTYgMTEgMTUgMTEuNTQwNCAxNSAxMi4yMDcxQzE1IDEyLjUyNzMgMTQuODcyOCAxMi44MzQzIDE0LjY0NjUgMTMuMDYwN0wxMy43MDcxIDE0SDE1VjE1SDEyLjVDMTIuMjk3OCAxNSAxMi4xMTU1IDE0Ljg3ODIgMTIuMDM4MSAxNC42OTEzQzExLjk2MDcgMTQuNTA0NSAxMi4wMDM1IDE0LjI4OTQgMTIuMTQ2NSAxNC4xNDY0TDEzLjkzOTMgMTIuMzUzNkMxMy45NzgyIDEyLjMxNDcgMTQgMTIuMjYyIDE0IDEyLjIwNzFDMTQgMTIuMDkyNyAxMy45MDczIDEyIDEzLjc5MjkgMTJIMTMuNUMxMy4yMjM5IDEyIDEzIDEyLjIyMzkgMTMgMTIuNUgxMloiIGZpbGw9IiMwMDAwMDAiLz4KPC9zdmc+",a2="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHNoYXBlLXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiB0ZXh0LXJlbmRlcmluZz0iZ2VvbWV0cmljUHJlY2lzaW9uIiBpbWFnZS1yZW5kZXJpbmc9Im9wdGltaXplUXVhbGl0eSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIHZpZXdCb3g9IjAgMCA1MDQgNTEyLjM2Ij48cGF0aCBmaWxsLXJ1bGU9Im5vbnplcm8iIGQ9Ik00OTkuNDMgMjMxLjM2SDM2OC40Yy0yLjUzIDAtNC41OC0yLjA1LTQuNTgtNC41N3YtOC4xMWMwLTEuMjYuNTItMi40IDEuMzQtMy4yMmw3MS41Ny04Mi41M2M2LjczLTcuNzUgMTIuNTctMTQuOTcgMTcuNDgtMjEuNjggNC44OC02LjY0IDguODMtMTIuNzQgMTEuODUtMTguMjggMi45Ny01LjQzIDUuMTgtMTAuNjEgNi42NC0xNS41NSAxLjQyLTQuODUgMi4xMy05LjUzIDIuMTMtMTQgMC0xNC42OC0zLjk4LTI2LjA1LTExLjkyLTM0LjA5LTMuOTItMy45Ni04Ljc1LTYuOTMtMTQuNDktOC45Mi01Ljk1LTIuMDMtMTIuOTEtMy4wNS0yMC44Ny0zLjA1LTguNDUgMC0xNS44OCAxLjIxLTIyLjI5IDMuNjItNi4yNyAyLjM2LTExLjYzIDUuOTItMTYuMDcgMTAuNjNhNDcuODg0IDQ3Ljg4NCAwIDAgMC0xMC4xNCAxNi42Yy0yLjI3IDYuMjktMy40MSAxMy4zOS0zLjQxIDIxLjI2IDAgMi41Mi0yLjA1IDQuNTctNC41NyA0LjU3aC02Ljg5Yy0yLjA1IDAtMy44LTEuMzYtNC4zNy0zLjI0bC0uMjctLjgyYy0uMTgtLjU2LS4yNS0xLjEzLS4yMi0xLjY3LS4yMy05LjMyIDEuMTQtMTcuOTkgNC4xMi0yNS45NyAzLjAyLTguMTMgNy42OC0xNS41NCAxMy45NC0yMi4xOSA2LjI2LTYuNyAxMy42My0xMS43NiAyMi4xLTE1LjEzQzQwNy44NCAxLjY4IDQxNy4yIDAgNDI3LjU1IDBjOS41OSAwIDE4LjI2IDEuMzggMjYuMDMgNC4xMyA3Ljg2IDIuNzkgMTQuNzcgNyAyMC43MiAxMi42MSA2LjAyIDUuNjMgMTAuNTUgMTIuNCAxMy41NSAyMC4yOCAyLjk2IDcuNzUgNC40NSAxNi41NiA0LjQ1IDI2LjQgMCA2LjUtMS4wNyAxMy4wOC0zLjE3IDE5LjY5bC0uMTQuMzhjLTIuMDkgNi40Ni01LjE3IDEyLjk3LTkuMiAxOS40OWwtLjE0LjIxYy00LjA4IDYuNTEtOC45IDEzLjQzLTE0LjQzIDIwLjc0LTUuNTYgNy4zMy0xMS45NiAxNS4yMy0xOS4yMiAyMy42N2wtNTYuOTEgNjYuNTFoMTEwLjM0YzIuNTIgMCA0LjU3IDIuMDUgNC41NyA0LjU3djguMTFjMCAyLjUyLTIuMDUgNC41Ny00LjU3IDQuNTd6bS0zMjcuMjUgNjguNzUgMTM3Ljk2LTE2Ny43NmMuODktMS4wNyAyLjMtMS42NSAzLjc0LTEuNjVsMjAuMTMtLjAyYzIuNTIgMCA0LjU3IDEuNzQgNC41NyAzLjg4IDAgLjkxLS4zNyAxLjc1LS45OCAyLjQxTDE4OC4zMiAzMTcuNjYgMzQ0LjEgNTA2LjI0YzEuNDUgMS43NS45NSA0LjE3LTEuMSA1LjQtLjguNDgtMS43Mi43MS0yLjYzLjcxbC0yMC4xMy4wMWMtMS43IDAtMy4xOC0uNzktMy45Ny0xLjk2bC0xNDQuMS0xNzUuMkwyOC4yMyA1MTAuNjljLS44OCAxLjA3LTIuMyAxLjY0LTMuNzMgMS42NWwtMTkuOTMuMDJjLTIuNTIgMC00LjU3LTEuNzQtNC41Ny0zLjg5IDAtLjkuMzctMS43NC45OC0yLjRsMTU1LjY1LTE4OC40TDYuOSAxMzYuOGMtMS40NS0xLjc1LS45NS00LjE4IDEuMTEtNS40MS43OS0uNDcgMS43MS0uNyAyLjYyLS43bDIwLjQ0LS4wMWMxLjYzIDAgMy4wNi43MiAzLjg3IDEuODFsMTM3LjI0IDE2Ny42MnoiLz48L3N2Zz4=",iy=Qn.createContext(null),ay=4;function Iu({children:y,className:d,onClick:g,title:t}){const f=Ce.useRef(null),r=Qn.useContext(iy);if(r===null)throw new Error("DropDownItem must be used within a DropDown");const{registerItem:n}=r;return Ce.useEffect(()=>{f&&f.current&&n(f)},[f,n]),he.jsx("button",{className:d,onClick:g,ref:f,title:t,type:"button",children:y})}function s2({children:y,dropDownRef:d,onClose:g}){const[t,f]=Ce.useState(),[r,n]=Ce.useState(),e=Ce.useCallback(l=>{f(o=>o?[...o,l]:[l])},[f]),s=l=>{if(!t)return;const o=l.key;["Escape","ArrowUp","ArrowDown","Tab"].includes(o)&&l.preventDefault(),o==="Escape"||o==="Tab"?g():o==="ArrowUp"?n(a=>{if(!a)return t[0];const c=t.indexOf(a)-1;return t[c===-1?t.length-1:c]}):o==="ArrowDown"&&n(a=>a?t[t.indexOf(a)+1]:t[0])},i=Ce.useMemo(()=>({registerItem:e}),[e]);return Ce.useEffect(()=>{t&&!r&&n(t[0]),r&&r.current&&r.current.focus()},[t,r]),he.jsx(iy.Provider,{value:i,children:he.jsx("div",{className:"dropdown",ref:d,onKeyDown:s,children:y})})}function l2({disabled:y=!1,buttonLabel:d,buttonAriaLabel:g,buttonClassName:t,buttonIconClassName:f,children:r,stopCloseOnClickSelf:n}){const e=Ce.useRef(null),s=Ce.useRef(null),[i,l]=Ce.useState(!1),o=()=>{l(!1),s&&s.current&&s.current.focus()};return Ce.useEffect(()=>{const a=s.current,c=e.current;if(i&&a!==null&&c!==null){const{top:u,left:h}=a.getBoundingClientRect();c.style.top=`${u+a.offsetHeight+ay}px`,c.style.left=`${Math.min(h,window.innerWidth-c.offsetWidth-20)}px`}},[e,s,i]),Ce.useEffect(()=>{const a=s.current;if(a!==null&&i){const c=u=>{const h=u.target;n&&e.current&&e.current.contains(h)||a.contains(h)||l(!1)};return document.addEventListener("click",c),()=>{document.removeEventListener("click",c)}}},[e,s,i,n]),Ce.useEffect(()=>{const a=()=>{if(i){const c=s.current,u=e.current;if(c!==null&&u!==null){const{top:h}=c.getBoundingClientRect(),p=h+c.offsetHeight+ay;p!==u.getBoundingClientRect().top&&(u.style.top=`${p}px`)}}};return document.addEventListener("scroll",a),()=>{document.removeEventListener("scroll",a)}},[s,e,i]),he.jsxs(he.Fragment,{children:[he.jsxs("button",{type:"button",disabled:y,"aria-label":g||d,className:t,onClick:()=>l(!i),ref:s,children:[f&&he.jsx("span",{className:f}),d&&he.jsx("span",{className:"text dropdown-button-text",children:d}),he.jsx("i",{className:"chevron-down"})]}),i&&$r.createPortal(he.jsx(s2,{dropDownRef:e,onClose:o,children:r}),document.body)]})}function sy(){return he.jsx("div",{className:"divider"})}const ep=8,np=72,Ds={h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",paragraph:"Normal"};function c2({selectionFontSize:y,disabled:d,editor:g,blockType:t,styleConfig:f}){const[r,n]=Qn.useState(y),[e,s]=Qn.useState(t);console.log("styleConfig coming inside fontsize.tsx =====>",f);const i=u=>{g.update(()=>{if(g.isEditable()){const h=Oe();h!==null&&om(h,u)}})},l=u=>{n(u.target.value)},o=()=>{const u=Number(r);if(!isNaN(u)){const h=Math.min(Math.max(u,ep),np);n(String(h)),i({"font-size":`${h}px`})}},a=u=>{const h=f[e].fontSize,p=u?Math.min(h+2,np):Math.max(h-2,ep);n(String(p)),i({"font-size":`${p}px`})},c=u=>{if(s(u),u==="paragraph"){const h=f.paragraph;n(String(h.fontSize)),i({"font-size":`${h.fontSize}px`,color:h.fontColor,"font-family":h.fontFamily,"line-height":`${1+h.leadingSpace}em`,"margin-bottom":`${h.trailingSpace}em`})}else{const{fontSize:h,fontColor:p,fontFamily:m,leadingSpace:b,trailingSpace:_}=f[u];n(String(h)),i({"font-size":`${h}px`,color:p,"font-family":m,"line-height":`${1+b}em`,"margin-bottom":`${_}em`})}};return Qn.useEffect(()=>{const u=()=>{g.update(()=>{const h=Oe();if(h!==null){const m=h.getNodes()[0];if(!Ne(m)){const b=m.getType();b in Ds&&s(b)}}})};return g.registerUpdateListener(u),()=>{g.registerUpdateListener(u)}},[g]),he.jsxs(he.Fragment,{children:[he.jsx("button",{type:"button",disabled:d,onClick:()=>a(!1),className:"toolbar-item font-decrement"}),he.jsx("input",{type:"number",value:r,disabled:d,readOnly:!0,className:"toolbar-item font-size-input",min:ep,max:np,onChange:l,onBlur:o}),he.jsx("button",{type:"button",disabled:d,onClick:()=>a(!0),className:"toolbar-item font-increment"}),he.jsx(sy,{}),he.jsxs("div",{className:"symbol-dropdown cust-head-dropDown",children:[he.jsxs(l2,{disabled:d,buttonClassName:"toolbar-item block-controls",buttonAriaLabel:"Formatting options for text style",buttonIconClassName:"icon block-type "+e,buttonLabel:Ds[e],children:[he.jsxs(Iu,{className:`item ${e==="paragraph"?"active":""}`,onClick:()=>c("paragraph"),children:[he.jsx("i",{className:"icon paragraph"}),he.jsx("span",{className:"text",children:Ds.paragraph})]}),he.jsxs(Iu,{className:`item ${e==="h1"?"active":""}`,onClick:()=>c("h1"),children:[he.jsx("i",{className:"icon h1"}),he.jsx("span",{className:"text",children:Ds.h1})]}),he.jsxs(Iu,{className:`item ${e==="h2"?"active":""}`,onClick:()=>c("h2"),children:[he.jsx("i",{className:"icon h2"}),he.jsx("span",{className:"text",children:Ds.h2})]}),he.jsxs(Iu,{className:`item ${e==="h3"?"active":""}`,onClick:()=>c("h3"),children:[he.jsx("i",{className:"icon h3"}),he.jsx("span",{className:"text",children:Ds.h3})]})]}),he.jsx(sy,{})]})]})}const u2="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj48IS0tISBGb250IEF3ZXNvbWUgUHJvIDYuMS4xIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlIChDb21tZXJjaWFsIExpY2Vuc2UpIENvcHlyaWdodCAyMDIyIEZvbnRpY29ucywgSW5jLi0tPjxwYXRoIGQ9Ik0wIDI1NkMwIDExNC42IDExNC42IDAgMjU2IDBzMjU2IDExNC42IDI1NiAyNTYtMTE0LjYgMjU2LTI1NiAyNTZTMCAzOTcuNCAwIDI1NnptMTc1LTQ3LjkgNDcuMSA0N0wxNzUgMzAzYy05LjMgOS40LTkuMyAyNC42IDAgMzMuMSA5LjQgMTAuMiAyNC42IDEwLjIgMzMuMSAwbDQ3LTQ2LjIgNDcuOSA0Ni4yYzkuNCAxMC4yIDI0LjYgMTAuMiAzMy4xIDAgMTAuMi04LjUgMTAuMi0yMy43IDAtMzMuMWwtNDYuMi00Ny45IDQ2LjItNDdjMTAuMi04LjUgMTAuMi0yMy43IDAtMzMuMS04LjUtOS4zLTIzLjctOS4zLTMzLjEgMGwtNDcuOSA0Ny4xLTQ3LTQ3LjFjLTguNS05LjMtMjMuNy05LjMtMzMuMSAwLTkuMyA5LjQtOS4zIDI0LjYgMCAzMy4xeiIvPjwvc3ZnPg==",d2="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgZmlsbD0iY3VycmVudENvbG9yIiBjbGFzcz0iYmkgYmktdGFibGUiPjxwYXRoIGQ9Ik0wIDJhMiAyIDAgMCAxIDItMmgxMmEyIDIgMCAwIDEgMiAydjEyYTIgMiAwIDAgMS0yIDJIMmEyIDIgMCAwIDEtMi0yVjJ6bTE1IDJoLTR2M2g0VjR6bTAgNGgtNHYzaDRWOHptMCA0aC00djNoM2ExIDEgMCAwIDAgMS0xdi0yem0tNSAzdi0zSDZ2M2g0em0tNSAwdi0zSDF2MmExIDEgMCAwIDAgMSAxaDN6bS00LTRoNFY4SDF2M3ptMC00aDRWNEgxdjN6bTUtM3YzaDRWNEg2em00IDRINnYzaDRWOHoiLz48L3N2Zz4=";function f2(){const[y,d]=Ce.useState("4"),[g,t]=Ce.useState("4"),[f,r]=Ce.useState(!1),[n,e]=Ce.useState(),[s]=jr(),i=()=>{!y||!g||(s.update(()=>{const l=Dm(y,g,!0),o=cm(l);e(o)}),r(!1))};return he.jsxs(he.Fragment,{children:[he.jsx("button",{className:"toolbar-item ",onClick:()=>r(!0),children:he.jsx("img",{className:"add-toolbar-table-icon",src:d2,alt:"Add Table"})}),f&&he.jsx("div",{className:"modal-overlay",children:he.jsxs("div",{className:"modal-content",children:[he.jsx("h3",{children:"Select Table Dimensions"}),he.jsx("button",{className:"modal-buttons-close",onClick:()=>r(!1),children:he.jsx("img",{src:u2,height:16,width:16,style:{margin:"0 0 29px 10px"}})}),he.jsxs("div",{className:"select-table-container",children:[he.jsx("label",{children:"Rows"}),he.jsx("input",{type:"number",value:y,onChange:l=>d(Number(l.target.value))})]}),he.jsxs("div",{className:"select-table-container",children:[he.jsx("label",{children:"Column"}),he.jsx("input",{type:"number",value:g,onChange:l=>t(Number(l.target.value))})]}),he.jsx("div",{children:he.jsx("div",{className:"modal-buttons",children:he.jsx("button",{className:"toolbar-item",onClick:i,children:"Confirm"})})})]})})]})}const ly="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNNCAxMkgyME0xMiA0VjIwIiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPg==",cy="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNNiAxMkwxOCAxMiIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4=";var p2=typeof global=="object"&&global&&global.Object===Object&&global;const h2=p2;var g2=typeof self=="object"&&self&&self.Object===Object&&self,m2=h2||g2||Function("return this")();const uy=m2;var y2=uy.Symbol;const Ru=y2;var dy=Object.prototype,b2=dy.hasOwnProperty,v2=dy.toString,ql=Ru?Ru.toStringTag:void 0;function _2(y){var d=b2.call(y,ql),g=y[ql];try{y[ql]=void 0;var t=!0}catch{}var f=v2.call(y);return t&&(d?y[ql]=g:delete y[ql]),f}var x2=Object.prototype,w2=x2.toString;function S2(y){return w2.call(y)}var C2="[object Null]",E2="[object Undefined]",fy=Ru?Ru.toStringTag:void 0;function k2(y){return y==null?y===void 0?E2:C2:fy&&fy in Object(y)?_2(y):S2(y)}function O2(y){return y!=null&&typeof y=="object"}var T2="[object Symbol]";function j2(y){return typeof y=="symbol"||O2(y)&&k2(y)==T2}var A2=/\s/;function P2(y){for(var d=y.length;d--&&A2.test(y.charAt(d)););return d}var N2=/^\s+/;function I2(y){return y&&y.slice(0,P2(y)+1).replace(N2,"")}function rp(y){var d=typeof y;return y!=null&&(d=="object"||d=="function")}var py=0/0,R2=/^[-+]0x[0-9a-f]+$/i,M2=/^0b[01]+$/i,D2=/^0o[0-7]+$/i,L2=parseInt;function hy(y){if(typeof y=="number")return y;if(j2(y))return py;if(rp(y)){var d=typeof y.valueOf=="function"?y.valueOf():y;y=rp(d)?d+"":d}if(typeof y!="string")return y===0?y:+y;y=I2(y);var g=M2.test(y);return g||D2.test(y)?L2(y.slice(2),g?2:8):R2.test(y)?py:+y}var B2=function(){return uy.Date.now()};const op=B2;var F2="Expected a function",z2=Math.max,U2=Math.min;function $2(y,d,g){var t,f,r,n,e,s,i=0,l=!1,o=!1,a=!0;if(typeof y!="function")throw new TypeError(F2);d=hy(d)||0,rp(g)&&(l=!!g.leading,o="maxWait"in g,r=o?z2(hy(g.maxWait)||0,d):r,a="trailing"in g?!!g.trailing:a);function c(x){var S=t,E=f;return t=f=void 0,i=x,n=y.apply(E,S),n}function u(x){return i=x,e=setTimeout(m,d),l?c(x):n}function h(x){var S=x-s,E=x-i,k=d-S;return o?U2(k,r-E):k}function p(x){var S=x-s,E=x-i;return s===void 0||S>=d||S<0||o&&E>=r}function m(){var x=op();if(p(x))return b(x);e=setTimeout(m,h(x))}function b(x){return e=void 0,a&&t?c(x):(t=f=void 0,n)}function _(){e!==void 0&&clearTimeout(e),i=0,t=s=f=e=void 0}function v(){return e===void 0?n:b(op())}function w(){var x=op(),S=p(x);if(t=arguments,f=this,s=x,S){if(e===void 0)return u(s);if(o)return clearTimeout(e),e=setTimeout(m,d),c(s)}return e===void 0&&(e=setTimeout(m,d)),n}return w.cancel=_,w.flush=v,w}function H2(y,d,g){const t=Ce.useRef(null);return t.current=y,Ce.useMemo(()=>$2((...f)=>{t.current&&t.current(...f)},d,{maxWait:g}),[d,g])}const gy=20;function q2({anchorElem:y}){const[d]=jr(),g=au(),[t,f]=Ce.useState(!1),[r,n]=Ce.useState(!1),[e,s]=Ce.useState(!1),[i,l]=Ce.useState({}),o=Ce.useRef(new Set),a=Ce.useRef(null),c=H2(m=>{const{isOutside:b,tableDOMNode:_}=J2(m);if(b){f(!1),n(!1);return}if(!_)return;a.current=_;let v=null,w=null,x=null;if(d.update(()=>{var E;const S=rr(_);if(rn(S)){const k=vn(S,D=>Pn(D));if(!Pn(k))return;if(x=d.getElementByKey(k==null?void 0:k.getKey()),x){const D=k.getChildrenSize(),P=(E=k.getChildAtIndex(0))==null?void 0:E.getChildrenSize(),O=l_(S),R=Bm(S);O===D-1?v=S:R===P-1&&(w=S)}}}),x){const{width:S,y:E,right:k,left:D,bottom:P,height:O}=x.getBoundingClientRect(),{y:R,left:A}=y.getBoundingClientRect();v?(n(!1),f(!0),l({height:gy,left:D-A,top:P-R+5,width:S})):w&&(n(!0),f(!1),l({height:O,left:k-A+5,top:E-R,width:gy}))}},50,250),u=Ce.useMemo(()=>new ResizeObserver(()=>{f(!1),n(!1)}),[]);Ce.useEffect(()=>{if(e)return document.addEventListener("mousemove",c),()=>{f(!1),n(!1),c.cancel(),document.removeEventListener("mousemove",c)}},[e,c]),Ce.useEffect(()=>mo(d.registerMutationListener(bo,m=>{d.getEditorState().read(()=>{for(const[b,_]of m){const v=d.getElementByKey(b);switch(_){case"created":o.current.add(b),s(o.current.size>0),v&&u.observe(v);break;case"destroyed":o.current.delete(b),s(o.current.size>0),u.disconnect(),o.current.forEach(w=>{const x=d.getElementByKey(w);x&&u.observe(x)});break}}})})),[d,u]);const h=m=>{d.update(()=>{if(a.current){const b=rr(a.current);b==null||b.selectEnd(),m?(c_(),f(!1)):(u_(),n(!1))}})},p=m=>{d.update(()=>{if(a.current){const b=rr(a.current);b==null||b.selectEnd(),m?(d_(),f(!1)):(f_(),n(!1))}})};return g?he.jsxs(he.Fragment,{children:[t&&he.jsxs("div",{children:[he.jsx("button",{className:"PlaygroundEditorTheme__tableAddRows",style:{...i,flex:"50%",padding:"20px"},onClick:()=>h(!0),children:he.jsx("img",{src:ly,height:14,width:14,style:{color:"grey",marginLeft:"-3px"}})}),he.jsx("button",{className:"PlaygroundEditorTheme__tableAddRows",style:{...i,flex:"50%"},onClick:()=>p(!0),children:he.jsx("img",{src:cy,height:14,width:14,style:{color:"grey",marginLeft:"-3px"}})})]}),r&&he.jsxs("div",{className:"table-add-row-flex-container",children:[he.jsx("button",{className:"PlaygroundEditorTheme__tableAddColumns table-add-row-flex-children",style:{...i,flex:"50%",padding:"20px"},onClick:()=>h(!1),children:he.jsx("img",{src:ly,height:14,width:14,style:{color:"grey",marginLeft:"-3px"}})}),he.jsx("button",{className:"PlaygroundEditorTheme__tableAddColumns table-add-row-flex-children",style:{...i,flex:"50%"},onClick:()=>p(!1),children:he.jsx("img",{src:cy,height:14,width:14,style:{color:"grey",marginLeft:"-3px"}})})]})]}):null}function J2(y){const d=y.target;if(d&&d instanceof HTMLElement){const g=d.closest("td.PlaygroundEditorTheme__tableCell, th.PlaygroundEditorTheme__tableCell");return{isOutside:!(g||d.closest("button.PlaygroundEditorTheme__tableAddRows")||d.closest("button.PlaygroundEditorTheme__tableAddColumns")||d.closest("div.TableCellResizer__resizer")),tableDOMNode:g}}else return{isOutside:!0,tableDOMNode:null}}function V2({anchorElem:y=document.body}){return au()?$r.createPortal(he.jsx(q2,{anchorElem:y}),y):null}const ip=1;function ap(){return he.jsx("div",{className:"divider"})}function W2({renderOnlineUsers:y,styleConfig:d}){const[g]=jr(),t=Ce.useRef(null),[f,r]=Ce.useState(!1),[n,e]=Ce.useState(!1),[s,i]=Ce.useState(!1),[l,o]=Ce.useState(!1),[a,c]=Ce.useState(!1),[u,h]=Ce.useState(!1),[p,m]=Ce.useState(!1),[b,_]=Ce.useState(!1),[v,w]=Ce.useState("11px"),[x,S]=Ce.useState(()=>g.isEditable()),E=Ce.useCallback(()=>{const k=Oe();xe(k)&&(i(k.hasFormat("bold")),o(k.hasFormat("italic")),c(k.hasFormat("underline")),h(k.hasFormat("strikethrough")),m(k.hasFormat("subscript")),_(k.hasFormat("superscript")),w(im(k,"font-size","11px")))},[]);return Ce.useEffect(()=>mo(g.registerUpdateListener(({editorState:k})=>{k.read(()=>{E()})}),g.registerCommand(Wo,(k,D)=>(E(),!1),ip),g.registerCommand(ts,k=>(r(k),!1),ip),g.registerCommand(Xa,k=>(e(k),!1),ip)),[g,E]),he.jsxs("div",{className:"toolbar",ref:t,children:[he.jsx("button",{disabled:!f,onClick:()=>{g.dispatchCommand(cl,void 0)},className:"toolbar-item spaced","aria-label":"Undo",children:he.jsx("i",{className:"format undo"})}),he.jsx("button",{disabled:!n,onClick:()=>{g.dispatchCommand(ul,void 0)},className:"toolbar-item","aria-label":"Redo",children:he.jsx("i",{className:"format redo"})}),he.jsx(ap,{}),he.jsx(c2,{selectionFontSize:v.slice(0,-2),editor:g,disabled:!x,blockType:"paragraph",styleConfig:d}),he.jsx(ap,{}),he.jsx("button",{onClick:()=>{g.dispatchCommand(Er,"bold")},className:"toolbar-item spaced "+(s?"active":""),"aria-label":"Format Bold",children:he.jsx("i",{className:"format bold"})}),he.jsx("button",{onClick:()=>{g.dispatchCommand(Er,"italic")},className:"toolbar-item spaced "+(l?"active":""),"aria-label":"Format Italics",children:he.jsx("i",{className:"format italic"})}),he.jsx("button",{onClick:()=>{g.dispatchCommand(Er,"underline")},className:"toolbar-item spaced "+(a?"active":""),"aria-label":"Format Underline",children:he.jsx("i",{className:"format underline"})}),he.jsx("button",{onClick:()=>{g.dispatchCommand(Er,"strikethrough")},className:"toolbar-item spaced "+(u?"active":""),"aria-label":"Format Strikethrough",children:he.jsx("i",{className:"format strikethrough"})}),he.jsx("button",{onClick:()=>{g.dispatchCommand(Er,"superscript")},className:"toolbar-item spaced "+(b?"active":""),"aria-label":"Format SuperScript",children:he.jsx("img",{src:a2,height:16,width:16,style:{marginTop:"1px"}})}),he.jsx("button",{onClick:()=>{g.dispatchCommand(Er,"subscript")},className:"toolbar-item spaced "+(p?"active":""),"aria-label":"Format SubScript",children:he.jsx("img",{src:i2,height:16,width:16,style:{marginTop:"1px"}})}),he.jsx(ap,{}),he.jsx("button",{onClick:()=>{g.dispatchCommand(Qa,"left")},className:"toolbar-item spaced","aria-label":"Left Align",children:he.jsx("i",{className:"format left-align"})}),he.jsx("button",{onClick:()=>{g.dispatchCommand(Qa,"center")},className:"toolbar-item spaced","aria-label":"Center Align",children:he.jsx("i",{className:"format center-align"})}),he.jsx("button",{onClick:()=>{g.dispatchCommand(Qa,"right")},className:"toolbar-item spaced","aria-label":"Right Align",children:he.jsx("i",{className:"format right-align"})}),he.jsx("button",{onClick:()=>{g.dispatchCommand(Qa,"justify")},className:"toolbar-item","aria-label":"Justify Align",children:he.jsx("i",{className:"format justify-align"})}),he.jsx(f2,{}),he.jsx(V2,{}),he.jsx("div",{className:"avtar-outer-div",children:y()})]})}const sp=t2([...[bo,xa,Ao]]);function K2(){return he.jsx("div",{className:"editor-placeholder"})}const G2={namespace:"React.js Demo",nodes:sp,onError(y){throw y},theme:o2},Y2=()=>he.jsx(he.Fragment,{children:"hello"});function Z2({collabApiKey:y,styleConfig:d,userObj:g}){const[t,f]=Ce.useState(!1),[r,n]=Ce.useState([]),[e,s]=Ce.useState("demo_docId_1"),[i,l]=Ce.useState({root:null}),{userId:o,userName:a,userEmail:c}=g,u=Ce.useRef();console.log("styleConfig passed in lexical pacakge is",d);const p={docId:e,apiKey:y,user:{name:a,id:o,email:c},hooks:{contentChanged:({source:w,content:x})=>{},usersUpdate:w=>{n(w)}}},m=()=>{u.current&&u.current.start(p).then(()=>{console.log("[Lexical Demo][codox.start] success"),f(!0)}).catch(w=>console.log("[Lexical Demo][codox.start] error",w))};Ce.useEffect(()=>()=>{b()},[]);const b=()=>{u.current&&(console.log("i am stop"),u.current.stop()),f(!1)};let _={root:{children:[{children:[],direction:"ltr",format:"",indent:0,type:"paragraph",version:1,textFormat:0,showUI:!0}],direction:"ltr",format:"",indent:0,type:"root",version:1}};Ce.useEffect(()=>{(async()=>{if(!e)return;t&&b();let w=_;if(w)try{e2(w,sp),l(w)}catch(x){console.error("[APP] error: ",x)}})()},[e]),Ce.useEffect(()=>{i&&e&&!t&&m()},[i,e,t]),Ce.useMemo(()=>({editorState:i?JSON.stringify({root:i.root}):null,namespace:"Playground",nodes:sp,onError:w=>{throw w},theme:{}}),[i]);const v=()=>{let w=[],x=[];return r&&r.length>0&&r.map((S,E)=>{x.includes(S.name)||(x.push(S.name),w.push(he.jsxs("div",{title:S.email,className:`avatarStyle avatar-color-${E+1}`,children:[" ",S.name&&S.name[0],S.name&&S.name[4]]},E)))}),he.jsx("div",{className:"flexContainer",children:w})};return he.jsx("div",{children:he.jsx(Yg,{initialConfig:G2,children:he.jsxs("div",{className:"editor-container",children:[he.jsx(W2,{renderOnlineUsers:v,styleConfig:d}),he.jsxs("div",{className:"editor-inner",children:[he.jsx(G1,{contentEditable:he.jsx(Qg,{className:"editor-input"}),placeholder:he.jsx(K2,{}),ErrorBoundary:Y2}),he.jsx(XS,{ref:u}),he.jsx(pm,{}),he.jsx(r2,{}),he.jsx(Zg,{})]})]})})})}Mr.Editor=Z2,Object.defineProperty(Mr,Symbol.toStringTag,{value:"Module"})});
|
|
1430
1430
|
//# sourceMappingURL=index.umd.js.map
|