@yext/pages-components 1.1.7 → 1.1.9
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/{debugger-DrRgTaNB.js → debugger-BwrGCC7Q.js} +1 -1
- package/dist/{debugger-3RbOKIha.cjs → debugger-HkoZKzeG.cjs} +1 -1
- package/dist/{index-59MyeK1e.js → index-B-328H9u.js} +6434 -6319
- package/dist/{index-B5KCvNJE.js → index-B_gmZeUL.js} +1 -1
- package/dist/{index-DjKBlVXj.cjs → index-CrwrCh_K.cjs} +1 -1
- package/dist/{index-COhY74cc.cjs → index-DIneK0am.cjs} +56 -56
- package/dist/index.d.cts +100 -217
- package/dist/index.d.ts +100 -217
- package/dist/pages-components.cjs +1 -1
- package/dist/pages-components.js +16 -15
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var ny=Object.defineProperty;var ry=(e,t,n)=>t in e?ny(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ie=(e,t,n)=>ry(e,typeof t!="symbol"?t+"":t,n);const rt=require("react"),fd=require("react-dom");function iy(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const sy=iy(rt);var mf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var zu={exports:{}},Yl={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var _f;function oy(){if(_f)return Yl;_f=1;var e=rt,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,l=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function f(p,_,E){var T,S={},w=null,O=null;E!==void 0&&(w=""+E),_.key!==void 0&&(w=""+_.key),_.ref!==void 0&&(O=_.ref);for(T in _)r.call(_,T)&&!d.hasOwnProperty(T)&&(S[T]=_[T]);if(p&&p.defaultProps)for(T in _=p.defaultProps,_)S[T]===void 0&&(S[T]=_[T]);return{$$typeof:t,type:p,key:w,ref:O,props:S,_owner:l.current}}return Yl.Fragment=n,Yl.jsx=f,Yl.jsxs=f,Yl}var jl={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,98 +14,98 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+_e+pe}}var
|
|
19
|
-
`),Ht=
|
|
20
|
-
`),
|
|
21
|
-
`+kt[
|
|
17
|
+
*/var yf;function ly(){return yf||(yf=1,process.env.NODE_ENV!=="production"&&function(){var e=rt,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),p=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),m=Symbol.iterator,v="@@iterator";function I(pe){if(pe===null||typeof pe!="object")return null;var Ze=m&&pe[m]||pe[v];return typeof Ze=="function"?Ze:null}var G=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(pe){{for(var Ze=arguments.length,lt=new Array(Ze>1?Ze-1:0),wt=1;wt<Ze;wt++)lt[wt-1]=arguments[wt];P("error",pe,lt)}}function P(pe,Ze,lt){{var wt=G.ReactDebugCurrentFrame,Gt=wt.getStackAddendum();Gt!==""&&(Ze+="%s",lt=lt.concat([Gt]));var Bt=lt.map(function(Pt){return String(Pt)});Bt.unshift("Warning: "+Ze),Function.prototype.apply.call(console[pe],console,Bt)}}var H=!1,j=!1,re=!1,te=!1,ce=!1,V;V=Symbol.for("react.module.reference");function z(pe){return!!(typeof pe=="string"||typeof pe=="function"||pe===r||pe===d||ce||pe===l||pe===E||pe===T||te||pe===O||H||j||re||typeof pe=="object"&&pe!==null&&(pe.$$typeof===w||pe.$$typeof===S||pe.$$typeof===f||pe.$$typeof===p||pe.$$typeof===_||pe.$$typeof===V||pe.getModuleId!==void 0))}function q(pe,Ze,lt){var wt=pe.displayName;if(wt)return wt;var Gt=Ze.displayName||Ze.name||"";return Gt!==""?lt+"("+Gt+")":lt}function Te(pe){return pe.displayName||"Context"}function Se(pe){if(pe==null)return null;if(typeof pe.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof pe=="function")return pe.displayName||pe.name||null;if(typeof pe=="string")return pe;switch(pe){case r:return"Fragment";case n:return"Portal";case d:return"Profiler";case l:return"StrictMode";case E:return"Suspense";case T:return"SuspenseList"}if(typeof pe=="object")switch(pe.$$typeof){case p:var Ze=pe;return Te(Ze)+".Consumer";case f:var lt=pe;return Te(lt._context)+".Provider";case _:return q(pe,pe.render,"ForwardRef");case S:var wt=pe.displayName||null;return wt!==null?wt:Se(pe.type)||"Memo";case w:{var Gt=pe,Bt=Gt._payload,Pt=Gt._init;try{return Se(Pt(Bt))}catch{return null}}}return null}var Ee=Object.assign,de=0,K,D,Z,oe,Y,W,J;function R(){}R.__reactDisabledLog=!0;function U(){{if(de===0){K=console.log,D=console.info,Z=console.warn,oe=console.error,Y=console.group,W=console.groupCollapsed,J=console.groupEnd;var pe={configurable:!0,enumerable:!0,value:R,writable:!0};Object.defineProperties(console,{info:pe,log:pe,warn:pe,error:pe,group:pe,groupCollapsed:pe,groupEnd:pe})}de++}}function X(){{if(de--,de===0){var pe={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ee({},pe,{value:K}),info:Ee({},pe,{value:D}),warn:Ee({},pe,{value:Z}),error:Ee({},pe,{value:oe}),group:Ee({},pe,{value:Y}),groupCollapsed:Ee({},pe,{value:W}),groupEnd:Ee({},pe,{value:J})})}de<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var fe=G.ReactCurrentDispatcher,_e;function B(pe,Ze,lt){{if(_e===void 0)try{throw Error()}catch(Gt){var wt=Gt.stack.trim().match(/\n( *(at )?)/);_e=wt&&wt[1]||""}return`
|
|
18
|
+
`+_e+pe}}var M=!1,F;{var se=typeof WeakMap=="function"?WeakMap:Map;F=new se}function ye(pe,Ze){if(!pe||M)return"";{var lt=F.get(pe);if(lt!==void 0)return lt}var wt;M=!0;var Gt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Bt;Bt=fe.current,fe.current=null,U();try{if(Ze){var Pt=function(){throw Error()};if(Object.defineProperty(Pt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Pt,[])}catch(fn){wt=fn}Reflect.construct(pe,[],Pt)}else{try{Pt.call()}catch(fn){wt=fn}pe.call(Pt.prototype)}}else{try{throw Error()}catch(fn){wt=fn}pe()}}catch(fn){if(fn&&wt&&typeof fn.stack=="string"){for(var kt=fn.stack.split(`
|
|
19
|
+
`),Ht=wt.stack.split(`
|
|
20
|
+
`),on=kt.length-1,an=Ht.length-1;on>=1&&an>=0&&kt[on]!==Ht[an];)an--;for(;on>=1&&an>=0;on--,an--)if(kt[on]!==Ht[an]){if(on!==1||an!==1)do if(on--,an--,an<0||kt[on]!==Ht[an]){var bn=`
|
|
21
|
+
`+kt[on].replace(" at new "," at ");return pe.displayName&&bn.includes("<anonymous>")&&(bn=bn.replace("<anonymous>",pe.displayName)),typeof pe=="function"&&F.set(pe,bn),bn}while(on>=1&&an>=0);break}}}finally{M=!1,fe.current=Bt,X(),Error.prepareStackTrace=Gt}var yr=pe?pe.displayName||pe.name:"",Zn=yr?B(yr):"";return typeof pe=="function"&&F.set(pe,Zn),Zn}function De(pe,Ze,lt){return ye(pe,!1)}function ee(pe){var Ze=pe.prototype;return!!(Ze&&Ze.isReactComponent)}function ne(pe,Ze,lt){if(pe==null)return"";if(typeof pe=="function")return ye(pe,ee(pe));if(typeof pe=="string")return B(pe);switch(pe){case E:return B("Suspense");case T:return B("SuspenseList")}if(typeof pe=="object")switch(pe.$$typeof){case _:return De(pe.render);case S:return ne(pe.type,Ze,lt);case w:{var wt=pe,Gt=wt._payload,Bt=wt._init;try{return ne(Bt(Gt),Ze,lt)}catch{}}}return""}var ue=Object.prototype.hasOwnProperty,be={},Ne=G.ReactDebugCurrentFrame;function Re(pe){if(pe){var Ze=pe._owner,lt=ne(pe.type,pe._source,Ze?Ze.type:null);Ne.setExtraStackFrame(lt)}else Ne.setExtraStackFrame(null)}function ke(pe,Ze,lt,wt,Gt){{var Bt=Function.call.bind(ue);for(var Pt in pe)if(Bt(pe,Pt)){var kt=void 0;try{if(typeof pe[Pt]!="function"){var Ht=Error((wt||"React class")+": "+lt+" type `"+Pt+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof pe[Pt]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ht.name="Invariant Violation",Ht}kt=pe[Pt](Ze,Pt,wt,lt,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(on){kt=on}kt&&!(kt instanceof Error)&&(Re(Gt),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",wt||"React class",lt,Pt,typeof kt),Re(null)),kt instanceof Error&&!(kt.message in be)&&(be[kt.message]=!0,Re(Gt),k("Failed %s type: %s",lt,kt.message),Re(null))}}}var Fe=Array.isArray;function qe(pe){return Fe(pe)}function Be(pe){{var Ze=typeof Symbol=="function"&&Symbol.toStringTag,lt=Ze&&pe[Symbol.toStringTag]||pe.constructor.name||"Object";return lt}}function ut(pe){try{return At(pe),!1}catch{return!0}}function At(pe){return""+pe}function Ut(pe){if(ut(pe))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Be(pe)),At(pe)}var tn=G.ReactCurrentOwner,Oe={key:!0,ref:!0,__self:!0,__source:!0},ie,le;function ve(pe){if(ue.call(pe,"ref")){var Ze=Object.getOwnPropertyDescriptor(pe,"ref").get;if(Ze&&Ze.isReactWarning)return!1}return pe.ref!==void 0}function Le(pe){if(ue.call(pe,"key")){var Ze=Object.getOwnPropertyDescriptor(pe,"key").get;if(Ze&&Ze.isReactWarning)return!1}return pe.key!==void 0}function Me(pe,Ze){typeof pe.ref=="string"&&tn.current}function je(pe,Ze){{var lt=function(){ie||(ie=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ze))};lt.isReactWarning=!0,Object.defineProperty(pe,"key",{get:lt,configurable:!0})}}function it(pe,Ze){{var lt=function(){le||(le=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ze))};lt.isReactWarning=!0,Object.defineProperty(pe,"ref",{get:lt,configurable:!0})}}var st=function(pe,Ze,lt,wt,Gt,Bt,Pt){var kt={$$typeof:t,type:pe,key:Ze,ref:lt,props:Pt,_owner:Bt};return kt._store={},Object.defineProperty(kt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(kt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:wt}),Object.defineProperty(kt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Gt}),Object.freeze&&(Object.freeze(kt.props),Object.freeze(kt)),kt};function ot(pe,Ze,lt,wt,Gt){{var Bt,Pt={},kt=null,Ht=null;lt!==void 0&&(Ut(lt),kt=""+lt),Le(Ze)&&(Ut(Ze.key),kt=""+Ze.key),ve(Ze)&&(Ht=Ze.ref,Me(Ze,Gt));for(Bt in Ze)ue.call(Ze,Bt)&&!Oe.hasOwnProperty(Bt)&&(Pt[Bt]=Ze[Bt]);if(pe&&pe.defaultProps){var on=pe.defaultProps;for(Bt in on)Pt[Bt]===void 0&&(Pt[Bt]=on[Bt])}if(kt||Ht){var an=typeof pe=="function"?pe.displayName||pe.name||"Unknown":pe;kt&&je(Pt,an),Ht&&it(Pt,an)}return st(pe,kt,Ht,Gt,wt,tn.current,Pt)}}var St=G.ReactCurrentOwner,Ge=G.ReactDebugCurrentFrame;function ze(pe){if(pe){var Ze=pe._owner,lt=ne(pe.type,pe._source,Ze?Ze.type:null);Ge.setExtraStackFrame(lt)}else Ge.setExtraStackFrame(null)}var tt;tt=!1;function yt(pe){return typeof pe=="object"&&pe!==null&&pe.$$typeof===t}function Nt(){{if(St.current){var pe=Se(St.current.type);if(pe)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+pe+"`."}return""}}function Et(pe){return""}var gt={};function xt(pe){{var Ze=Nt();if(!Ze){var
|
|
23
|
+
Check the render method of \``+pe+"`."}return""}}function Et(pe){return""}var gt={};function xt(pe){{var Ze=Nt();if(!Ze){var lt=typeof pe=="string"?pe:pe.displayName||pe.name;lt&&(Ze=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+lt+">.")}return Ze}}function mt(pe,Ze){{if(!pe._store||pe._store.validated||pe.key!=null)return;pe._store.validated=!0;var lt=xt(Ze);if(gt[lt])return;gt[lt]=!0;var wt="";pe&&pe._owner&&pe._owner!==St.current&&(wt=" It was passed a child from "+Se(pe._owner.type)+"."),ze(pe),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',lt,wt),ze(null)}}function $t(pe,Ze){{if(typeof pe!="object")return;if(qe(pe))for(var lt=0;lt<pe.length;lt++){var wt=pe[lt];yt(wt)&&mt(wt,Ze)}else if(yt(pe))pe._store&&(pe._store.validated=!0);else if(pe){var Gt=I(pe);if(typeof Gt=="function"&&Gt!==pe.entries)for(var Bt=Gt.call(pe),Pt;!(Pt=Bt.next()).done;)yt(Pt.value)&&mt(Pt.value,Ze)}}}function Kt(pe){{var Ze=pe.type;if(Ze==null||typeof Ze=="string")return;var lt;if(typeof Ze=="function")lt=Ze.propTypes;else if(typeof Ze=="object"&&(Ze.$$typeof===_||Ze.$$typeof===S))lt=Ze.propTypes;else return;if(lt){var wt=Se(Ze);ke(lt,pe.props,"prop",wt,pe)}else if(Ze.PropTypes!==void 0&&!tt){tt=!0;var Gt=Se(Ze);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Gt||"Unknown")}typeof Ze.getDefaultProps=="function"&&!Ze.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function nn(pe){{for(var Ze=Object.keys(pe.props),lt=0;lt<Ze.length;lt++){var wt=Ze[lt];if(wt!=="children"&&wt!=="key"){ze(pe),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",wt),ze(null);break}}pe.ref!==null&&(ze(pe),k("Invalid attribute `ref` supplied to `React.Fragment`."),ze(null))}}var It={};function Vt(pe,Ze,lt,wt,Gt,Bt){{var Pt=z(pe);if(!Pt){var kt="";(pe===void 0||typeof pe=="object"&&pe!==null&&Object.keys(pe).length===0)&&(kt+=" 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 Ht=Et();Ht?kt+=Ht:kt+=Nt();var on;pe===null?on="null":qe(pe)?on="array":pe!==void 0&&pe.$$typeof===t?(on="<"+(Se(pe.type)||"Unknown")+" />",kt=" Did you accidentally export a JSX literal instead of a component?"):on=typeof pe,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",on,kt)}var an=ot(pe,Ze,lt,Gt,Bt);if(an==null)return an;if(Pt){var bn=Ze.children;if(bn!==void 0)if(wt)if(qe(bn)){for(var yr=0;yr<bn.length;yr++)$t(bn[yr],pe);Object.freeze&&Object.freeze(bn)}else k("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 $t(bn,pe)}if(ue.call(Ze,"key")){var Zn=Se(pe),fn=Object.keys(Ze).filter(function(Ai){return Ai!=="key"}),sr=fn.length>0?"{key: someKey, "+fn.join(": ..., ")+": ...}":"{key: someKey}";if(!It[Zn+sr]){var or=fn.length>0?"{"+fn.join(": ..., ")+": ...}":"{}";k(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,sr,Zn,or,Zn),It[Zn+sr]=!0}}return pe===r?tn(an):Kt(an),an}}function bt(pe,Ze,ot){return jt(pe,Ze,ot,!0)}function nn(pe,Ze,ot){return jt(pe,Ze,ot,!1)}var Or=nn,_i=bt;jl.Fragment=r,jl.jsx=Or,jl.jsxs=_i}()),jl}process.env.NODE_ENV==="production"?Hu.exports=ny():Hu.exports=ry();var at=Hu.exports;function iy(e){switch(e){case"AD":case"AM":case"AT":case"AX":case"AZ":case"BA":case"BY":case"CY":case"CZ":case"DK":case"DZ":case"EC":case"EH":case"ET":case"FI":case"FR":case"GE":case"GF":case"GI":case"GP":case"GW":case"HT":case"KE":case"KV":case"KW":case"LA":case"LU":case"MC":case"MD":case"ME":case"MG":case"MK":case"MQ":case"MZ":case"NC":case"NL":case"NO":case"PL":case"PT":case"PY":case"RE":case"RS":case"SA":case"SE":case"SJ":case"SM":case"SN":case"TC":case"TJ":case"TM":case"TN":case"TZ":case"UY":case"VG":case"ZM":return[["line1"],["line2"],["postalCode","city"],["countryCode"]];case"AF":case"IR":return[["line1"],["line2"],["city"],["region"],["postalCode"],["countryCode"]];case"AG":case"AO":case"AW":case"BJ":case"BO":case"BS":case"BZ":case"CI":case"CW":case"DJ":case"FJ":case"GA":case"GH":case"GM":case"GY":case"JM":case"KI":case"LY":case"MW":case"NA":case"NR":case"PS":case"QA":case"RW":case"SC":case"SR":case"SX":case"TG":case"TT":case"UG":case"VU":return[["line1"],["line2"],["city"],["countryCode"]];case"AL":case"EE":case"IS":return[["line1"],["line2"],["postalCode","city"]];case"AR":return[["line1"],["line2"],["postalCode","city",",","region"],["countryCode"]];case"AS":case"BB":case"BD":case"BM":case"BN":case"BT":case"CR":case"DO":case"FK":case"FM":case"GR":case"GU":case"JO":case"KZ":case"LB":case"LK":case"LS":case"MA":case"MH":case"MM":case"MR":case"MT":case"MV":case"NG":case"PG":case"PK":case"PR":case"RO":case"SG":case"VC":case"WS":return[["line1"],["line2"],["city","postalCode"],["countryCode"]];case"AU":case"CA":case"SZ":case"US":case"VI":return[["line1"],["line2"],["city",",","region","postalCode"],["countryCode"]];case"BE":case"PE":return[["line1"],["line2"],["postalCode","sublocality","city"],["countryCode"]];case"BF":case"BI":case"BQ":case"BW":case"CF":case"CG":case"CM":case"DM":case"ER":case"GQ":case"KM":case"ML":case"SY":case"TD":case"ZW":return[["line1"],["line2"],["city"],["region"],["countryCode"]];case"BG":return[["line1"],["postalCode","region"],["countryCode"]];case"BH":return[["line1"],["line2"],["sublocality","city"],["countryCode"]];case"BR":return[["line1"],["line2"],["sublocality"],["city","region"],["postalCode"],["countryCode"]];case"CH":case"DE":case"GT":case"IT":case"LI":case"MY":case"NI":case"OM":case"SK":case"VA":return[["line1"],["line2"],["postalCode","city","region"],["countryCode"]];case"CL":case"PF":return[["line1"],["line2"],["city","postalCode","region"],["countryCode"]];case"CN":return[["region","city","sublocality"],["line1"],["line2"],["countryCode"]];case"CO":case"ID":case"IQ":case"KH":case"MP":case"NP":case"PW":case"UA":return[["line1"],["line2"],["city","region","postalCode"],["countryCode"]];case"EG":return[["line1"],["line2"],["sublocality","city","region","postalCode"],["countryCode"]];case"ES":case"IL":return[["line1"],["line2"],["city","postalCode"],["region"],["countryCode"]];case"GB":case"MN":case"ZA":return[["line1"],["line2"],["sublocality","city","postalCode"],["countryCode"]];case"GG":case"IM":case"JE":return[["line1"],["line2"],["sublocality"],["city"],["postalCode"],["countryCode"]];case"GN":return[["line1","line2","city"],["countryCode"]];case"HK":return[["line1"],["line2"],["sublocality"],["city"],["region"],["countryCode"]];case"HR":return[["line1"],["postalCode","city","region"],["countryCode"]];case"HU":case"SI":return[["postalCode","city"],["line1"],["line2"],["countryCode"]];case"IE":return[["line1"],["line2"],["sublocality"],["city","region","postalCode"],["countryCode"]];case"IN":case"VE":return[["line1"],["line2"],["city","postalCode"],["region"],["countryCode"]];case"JP":return[["line2"],["line1","sublocality"],["city","region"],["postalCode"],["countryCode"]];case"KR":return[["countryCode"],["region","city","sublocality","line1"],["line2"],["postalCode"]];case"KY":return[["line1"],["line2"],["postalCode"],["countryCode"]];case"LT":return[["line1"],["postalCode","city","sublocality","region"],["countryCode"]];case"LV":return[["line1"],["city",",","postalCode"],["countryCode"]];case"MO":return[["line1"],["line2"],["sublocality"],["city"],["countryCode"]];case"MU":return[["line1"],["line2"],["city"],["region","postalCode"],["countryCode"]];case"MX":return[["line1"],["line2"],["sublocality"],["postalCode","city",",","region"],["countryCode"]];case"NE":case"SD":return[["line1"],["line2"],["postalCode"],["city"],["region"],["countryCode"]];case"NZ":return[["line1"],["line2"],["sublocality"],["city"],["postalCode"],["countryCode"]];case"PH":case"TW":case"VN":return[["line1"],["line2"],["sublocality","city"],["region","postalCode"],["countryCode"]];case"RU":return[["line1"],["line2"],["city"],["postalCode"],["countryCode"]];case"SB":case"SL":case"ST":case"TL":case"TO":case"TV":return[["line1"],["line2"],["city",",","region"],["countryCode"]];case"TH":case"TR":return[["line1"],["line2"],["sublocality"],["postalCode","city"],["countryCode"]];case"UZ":return[["line1"],["line2"],["region","postalCode"],["countryCode"]]}return[["line1","line2"],["city","region","postalCode"],["countryCode"]]}const sp={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},Wu={GOOGLE:"google",APPLE:"apple",BING:"bing"},sy=(e,t)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[e];return r&&t[r]},oy=(e,t=[],n,r={route:!1},l)=>{const d="Failed to construct query for maps service.";let f=e&&yf([e.line1,e.line2,e.city,e.region,e.postalCode,e.countryCode]);switch(r.provider){case Wu.APPLE:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return pf(`${l.latitude},${l.longitude}`,r.route);if(!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return pf(f,r.route)}case Wu.BING:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return mf(`${l.latitude},${l.longitude}`,r.route);if(f=e&&yf([e.line1,e.city,e.region,e.postalCode]),!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return mf(f,r.route)}default:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return _f(`${l.latitude},${l.longitude}`,r.route);const p=t.find(_=>{var T;return((T=_==null?void 0:_.publisher)==null?void 0:T.toUpperCase())===sp.GOOGLEMYBUSINESS});if(p!=null&&p.listingUrl)return p.listingUrl;if(n)return ly(n,f,r.route);if(!f){console.warn(`${d} Check that you've provided a valid Yext Address, Yext ListingType, or Google Place ID.`);break}return _f(f,r.route)}}},pf=(e,t)=>t?`https://maps.apple.com/?daddr=${e}`:`https://maps.apple.com/?address=${e}`,mf=(e,t)=>t?`https://bing.com/maps/default.aspx?rtp=adr.${e}`:`https://bing.com/maps/default.aspx?where1=${e}`,ly=(e,t,n)=>{const r=t?`&query=${t}`:"";return n?`https://maps.google.com/maps/dir/?api=1${r}&destination_place_id=${e}&destination=direct`:r?`https://maps.google.com/maps/search/?api=1${r}&query_place_id=${e}`:`https://maps.google.com/maps/dir/?api=1&destination_place_id=${e}&destination=direct`},_f=(e,t)=>t?`https://maps.google.com/maps/dir/?api=1&destination=${e}`:`https://maps.google.com/maps/search/?api=1&query=${e}`,yf=(e=[])=>{if(!e.length)return"";const t=e.filter(Boolean).join(", ");return encodeURI(t)},ay=({address:e,lines:t,separator:n=",",...r})=>{const l=(t||iy(e.countryCode)).map(d=>at.jsx(cy,{address:e,line:d,separator:n},d.toString()));return nt.createElement("div",{...r,key:e.toString()},l)},cy=({address:e,line:t,separator:n})=>{const r=[];let l=0;for(const d of t){if(d===","){r.push(at.jsx("span",{children:n},`separator-${l++}`));continue}const f=e[d];if(!f)continue;const p=sy(d,e);if(p){r.push(at.jsxs(ty.Fragment,{children:[" ",at.jsx("abbr",{title:p,children:f})]},d));continue}r.push(at.jsx("span",{children:" "+f},d))}return at.jsx("div",{className:"address-line",children:r})};var tl={};Object.defineProperty(tl,"__esModule",{value:!0});var uy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dy=typeof window<"u"&&typeof window.document<"u",fy=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,hy=(typeof self>"u"?"undefined":uy(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",gy=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),py=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Nf=tl.isBrowser=dy;tl.isWebWorker=hy;var my=tl.isNode=fy;tl.isJsDom=gy;var _y=tl.isDeno=py;class yy{constructor(){Ie(this,"name");Ie(this,"isServerSide");Ie(this,"version");var t;_y?(this.name="deno",this.version="",Nf&&(this.version=((t=window.Deno)==null?void 0:t.version.deno)||""),this.isServerSide=!0):my?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):Nf?(this.name="browser",this.version=navigator.userAgent,this.isServerSide=!1):(this.name="unknown",this.version="",this.isServerSide=!1)}getNodeMajorVersion(){if(this.name!=="node")throw new Error("Not running in Node.");return+this.version.split(".")[0]}}const Xo=()=>new yy,Ny=(...e)=>{var t;if(typeof window<"u"){if(window.IS_PRODUCTION)return!0;const n=(t=window.location)==null?void 0:t.hostname;return e==null?void 0:e.some(r=>r==null?void 0:r.includes(n))}return!1};function Yc(e){if(!cd(e))throw new Error("Parameter was not an error")}function cd(e){return!!e&&typeof e=="object"&&Cy(e)==="[object Error]"||e instanceof Error}function Cy(e){return Object.prototype.toString.call(e)}const Ey="Layerr";let Ty=Ey;function xy(){return Ty}function vy(e){let t,n="";if(e.length===0)t={};else if(cd(e[0]))t={cause:e[0]},n=e.slice(1).join(" ")||"";else if(e[0]&&typeof e[0]=="object")t=Object.assign({},e[0]),n=e.slice(1).join(" ")||"";else if(typeof e[0]=="string")t={},n=n=e.join(" ")||"";else throw new Error("Invalid arguments passed to Layerr");return{options:t,shortMessage:n}}class Ai extends Error{constructor(t,n){const r=[...arguments],{options:l,shortMessage:d}=vy(r);let f=d;if(l.cause&&(f=`${f}: ${l.cause.message}`),super(f),this.message=f,l.name&&typeof l.name=="string"?this.name=l.name:this.name=xy(),l.cause&&Object.defineProperty(this,"_cause",{value:l.cause}),Object.defineProperty(this,"_info",{value:{}}),l.info&&typeof l.info=="object"&&Object.assign(this._info,l.info),Error.captureStackTrace){const p=l.constructorOpt||this.constructor;Error.captureStackTrace(this,p)}}static cause(t){return Yc(t),t._cause&&cd(t._cause)?t._cause:null}static fullStack(t){Yc(t);const n=Ai.cause(t);return n?`${t.stack}
|
|
31
|
-
caused by: ${
|
|
32
|
-
`,t),null}}const ky="1.0.0",Tf={version:ky};function Py(e,t,n){return n.debug?(lp(!0,t,n),!0):navigator.sendBeacon(e,JSON.stringify(t))}function $y(e,t,n){return n.debug?(lp(!1,t,n),Promise.resolve(new Response)):fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function Fy(e,t){return!t&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function lp(e,t,n){var r=e?"Beacon":"fetch()";console.log("[DEBUG] AnalyticsConfig object at time of call to report():",n),console.log("[DEBUG] The following EventPayload would be sent to the Yext Events API using ".concat(r,":"),t)}var Ku=function(){return Ku=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},Ku.apply(this,arguments)},zu=function(e,t){if(!t||Object.keys(t).length===0)return e;if(!e||Object.keys(e).length===0)return t;var n=JSON.parse(JSON.stringify(e));for(var r in t)if(t.hasOwnProperty(r)){var l=t[r];l==null?delete n[r]:typeof l!="object"?n[r]=l:n[r]=zu(n[r],l)}return Ku({},n)},By="yextevents.com/accounts/me/events";function Hy(e,t){var n=e==="SANDBOX",r=t==null?void 0:t.toLowerCase();if(n&&r==="eu")throw new Error("Sandbox environment is not available in the EU region.");return"https://"+(n?"sbx.":"")+(r??"us")+"."+By}var Wy=function(e,t,n,r){function l(d){return d instanceof n?d:new n(function(f){f(d)})}return new(n||(n=Promise))(function(d,f){function p(E){try{T(r.next(E))}catch(S){f(S)}}function _(E){try{T(r.throw(E))}catch(S){f(S)}}function T(E){E.done?d(E.value):l(E.value).then(p,_)}T((r=r.apply(e,t||[])).next())})},Ky=function(e,t){var n={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,l,d,f;return f={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function p(T){return function(E){return _([T,E])}}function _(T){if(r)throw new TypeError("Generator is already executing.");for(;f&&(f=0,T[0]&&(n=0)),n;)try{if(r=1,l&&(d=T[0]&2?l.return:T[0]?l.throw||((d=l.return)&&d.call(l),0):l.next)&&!(d=d.call(l,T[1])).done)return d;switch(l=0,d&&(T=[T[0]&2,d.value]),T[0]){case 0:case 1:d=T;break;case 4:return n.label++,{value:T[1],done:!1};case 5:n.label++,l=T[1],T=[0];continue;case 7:T=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(T[0]===6||T[0]===2)){n=0;continue}if(T[0]===3&&(!d||T[1]>d[0]&&T[1]<d[3])){n.label=T[1];break}if(T[0]===6&&n.label<d[1]){n.label=d[1],d=T;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(T);break}d[2]&&n.ops.pop(),n.trys.pop();continue}T=t.call(e,n)}catch(E){T=[6,E],l=0}finally{r=d=0}if(T[0]&5)throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}},zy=function(){function e(t,n){if(t.authorizationType!=="apiKey"&&t.authorizationType!=="bearer")throw new Error("Authorization type must be either apiKey or bearer.");if(!t.authorization)throw new Error("Authorization must be provided.");this.config=t,this.payload=n}return e.prototype.with=function(t){var n=this.payload===void 0?t:zu(this.payload,t);return new e(this.config,n)},e.prototype.report=function(t){var n;return Wy(this,void 0,void 0,function(){var r,l,d,f,p=this;return Ky(this,function(_){return r=zu((n=this.payload)!==null&&n!==void 0?n:{},t??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=Iy()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=Tf.version:r.clientSdk=(f={},f.ANALYTICS=Tf.version,f),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,l=Fy(r,this.config.forceFetch),d=Hy(this.config.env,this.config.region),l?[2,new Promise(function(T,E){Py(d,r,p.config)?T(""):E("Failed Beacon Call")})]:[2,$y(d,r,this.config).then(function(T){return T}).catch(function(T){return T})]})})},e}();function Uy(e){return new zy(e)}function Uu(e){return e?e.toLowerCase().trim().replace(/\s/g,""):""}function ap(e,t){return[e,t].filter(n=>!!n).map(n=>Uu(n)).join("_")}const Gy=e=>{switch(Math.floor(e/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},ud=nt.createContext(null),Yy=nt.lazy(()=>Promise.resolve().then(()=>require("./debugger-3RbOKIha.cjs")));function jy(e){const{children:t,apiKey:n,currency:r,templateData:l,requireOptIn:d,disableSessionTracking:f,enableDebugging:p,productionDomains:_}=e;if(!n)throw new Error("API Key is required for AnalyticsProvider");const T=nt.useRef(null),[E,S]=nt.useState(!1);nt.useEffect(()=>{S(!0)},[]),T.current===null&&(T.current=new cp(n,r,l,d,f,_,p??cc()));const w=T.current;return nt.useEffect(()=>(window.enableYextAnalytics=()=>{w.optIn()},()=>{delete window.enableYextAnalytics}),[w]),at.jsxs(at.Fragment,{children:[at.jsx(ud.Provider,{value:w,children:t}),E&&(p||cc())&&Xo().name==="browser"?at.jsx(nt.Suspense,{fallback:at.jsx(at.Fragment,{}),children:at.jsx(Yy,{})}):null]})}function cc(){return Xo().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class cp{constructor(t,n,r,l,d,f,p=!1){Ie(this,"_optedIn");Ie(this,"_sessionTrackingEnabled");Ie(this,"_analyticsEventService");Ie(this,"_pageViewFired",!1);this.apiKey=t,this.defaultCurrency=n,this.templateData=r,this.productionDomains=f,this.enableDebugging=p,this._optedIn=!l,this._sessionTrackingEnabled=!d,this.makeReporter(),this.pageView()}makeReporter(){if(Xo().name!=="browser"||!this._optedIn)return;if(!Ny(...this.productionDomains??[])&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const t=Gy(this.templateData.document.businessId),n={authorizationType:"apiKey",authorization:this.apiKey,env:"PRODUCTION",region:t||"US",sessionTrackingEnabled:this._sessionTrackingEnabled,debug:this.getDebugEnabled()},r={pages:{siteUid:this.templateData.document.siteId,template:this.templateData.document.__.name},entity:this.templateData.document.uid||void 0,pageUrl:document.URL,referrerUrl:document.referrer!==""?document.referrer:void 0};this._analyticsEventService=Uy(n).with(r)}canTrack(){return Xo().name==="browser"&&this._optedIn&&!!this._analyticsEventService}identify(t){this.canTrack()&&this._analyticsEventService&&(this._analyticsEventService=this._analyticsEventService.with({visitor:t}))}async optIn(){this._optedIn=!0,this.makeReporter(),this._pageViewFired||await this.pageView()}async pageView(){var t;if(!this.canTrack())return Promise.resolve(void 0);await((t=this._analyticsEventService)==null?void 0:t.report({action:"PAGE_VIEW"})),this._pageViewFired=!0}async track(t){var S;if(!this.canTrack())return Promise.resolve();const{action:n,scope:r,eventName:l,currency:d,amount:f,destinationUrl:p,customTags:_,customValues:T}=t;let E;f&&(E={amount:f,currency:d||this.defaultCurrency}),await((S=this._analyticsEventService)==null?void 0:S.report({action:n,pages:{scope:Uu(r)||void 0,originalEventName:ap(r||"",Uu(l)||"")},value:E,destinationUrl:p,customTags:_,customValues:T}))}getDebugEnabled(){return this.enableDebugging||cc()}}const Gu=nt.createContext({name:""}),dd=()=>nt.useContext(Gu).name;function Vy(e){var f;const t=dd(),[n]=nt.useState({name:ap(t,e.name)}),r=(f=nl())==null?void 0:f.getDebugEnabled(),[l,d]=nt.useState(!1);return nt.useEffect(()=>{d(!0)},[]),r&&l?at.jsx("section",{"data-ya-scope":n.name,children:at.jsx(Gu.Provider,{value:n,children:e.children})}):at.jsx(Gu.Provider,{value:n,children:e.children})}function nl(){const e=nt.useContext(ud);if(!e)return e;Xo().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await e.optIn()});const t=dd();return{getDebugEnabled(){return e.getDebugEnabled()},identify(n){return e.identify(n)},optIn(){return e.optIn()},pageView(){return e.pageView()},track(n){return e.track({...n,scope:n.scope??t})}}}const qy=()=>{var e;return(e=nl())==null?void 0:e.track},Zy=()=>{var e;return(e=nl())==null?void 0:e.pageView},Jy=()=>{var e;return(e=nl())==null?void 0:e.identify},Ts={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},Xy=e=>{const t=e.protocol.slice(0,-1);if(t!=="http"&&t!=="https"){console.error(`Invalid scheme: ${e}`);return}const n=e.hostname;let r;if(n==="a.mktgcdn.com")r="us";else{if(n.replace("a.","").replace(".mktgcdn.com","")!=="eu"){console.error(`Invalid host: ${e}`);return}r="eu"}if(!e.pathname.startsWith("/f")){console.error(`Invalid path: ${e}`);return}const l=e.pathname.replace(/^\//,"").split("/");if(l.length<2||l.length>3){console.error(`Invalid path: ${e}`);return}let d;if(l[0]==="f")d="prod";else switch(l[0].replace("f-","")){case"sandbox":{d="sbx";break}case"qa":{d="qa";break}case"dev":{d="dev";break}default:{console.error(`Invalid path: ${e}`);return}}if(r==="eu"&&(d==="dev"||d==="sbx")){console.error(`Invalid path: ${e}`);return}let f;if(l.length===3&&(f=parseInt(l[1]),Number.isNaN(f))){console.error(`Invalid account id: ${e}`);return}const p=l[l.length-1].split("."),_=p.length===2?`.${p[1]}`:"",T=p[0];return{scheme:t,partition:r,env:d,accountId:f,contentHash:T,extension:_}},Qy=(e,t,n)=>{const r=`https://dyn${e.partition==="us"?"":`.${e.partition}`}.mktgcdn.com`;let l="f";switch(e.env){case"prod":break;case"sbx":{l+="-sandbox";break}default:l+=`-${e.env.toString()}`}const d=e.accountId!==void 0?`${e.accountId}/`:"";return`${r}/${l}/${d}${e.contentHash}${e.extension}/width=${Math.round(t)},height=${Math.round(n)}`},eN=e=>{const t=e.protocol.slice(0,-1);if(t!=="http"&&t!=="https"){console.error(`Invalid scheme: ${e}`);return}if(e.hostname!=="a.mktgcdn.com"){console.error(`Invalid host: ${e}`);return}if(!e.pathname.startsWith("/p")){console.error(`Invalid path: ${e}`);return}const n=e.pathname.replace(/^\//,"").split("/");if(n.length<3||n.length>4){console.error(`Invalid path: ${e}`);return}let r;if(n[0]==="p")r="prod";else switch(n[0].replace("p-","")){case"sandbox":{r="sbx";break}case"qa":{r="qa";break}case"dev":{r="dev";break}default:{console.error(`Invalid path: ${e}`);return}}const l=n[1];let d;if(n.length===4){if(!n[2].includes(".")){console.error(`Invalid aspect ratio: ${e}`);return}if(d=parseFloat(n[2]),Number.isNaN(d)||n[2].split(".")[1].length!==4){console.error(`Invalid aspect ratio: ${e}`);return}}const f=n[n.length-1].split("."),p=f.length===2?`.${f[1]}`:"",_=f[0];return{scheme:t,env:r,contentHash:l,aspectRatio:d,name:_,extension:p}},tN=(e,t,n)=>{const r="https://dyn.mktgcdn.com";let l="p";switch(e.env){case"prod":break;case"sbx":{l+="-sandbox";break}default:l+=`-${e.env.toString()}`}return`${r}/${l}/${e.contentHash}/width=${Math.round(t)},height=${Math.round(n)}`},Yu=(e,t,n)=>{if(!up(e)){console.error(`Invalid image url: ${e}.`);return}const r=new URL(e);if(r.pathname.startsWith("/p")){const l=eN(r);if(l)return tN(l,t,n)}else if(r.pathname.startsWith("/f")){const l=Xy(r);if(l)return Qy(l,t,n)}return e},up=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"},nN=({image:e,className:t,width:n,height:r,aspectRatio:l,layout:d=Ts.INTRINSIC,placeholder:f,imgOverrides:p,style:_={},loading:T="lazy"})=>{const E=nt.useRef(null),[S,w]=nt.useState(!1),M="image"in e?e.image:e;nt.useEffect(()=>{var ce;(ce=E.current)!=null&&ce.complete&&w(!0)},[]),rN(d,M.width,M.height,n,r,l);const m=Math.abs(M.width);m||console.warn("Invalid image width.");const v=Math.abs(M.height);if(v||console.warn("Invalid image height."),!up(M.url))return console.error(`Invalid image url: ${M.url}`),at.jsx(at.Fragment,{children:f!=null&&f});const k=n&&n>0?n:void 0,G=r&&r>0?r:void 0,{src:I,imgStyle:P,widths:H}=iN(d,m,v,_,M.url,k,G,l),j=H.map(ce=>`${Yu(M.url,ce,v/m*ce)} ${ce}w`).join(", "),re=[640,768,1024,1280,1536],te=H.map((ce,V)=>V===H.length-1?`${ce}px`:`(max-width: ${re[V]}px) ${ce}px`).join(", ");return at.jsxs(at.Fragment,{children:[!S&&f!=null&&f,at.jsx("img",{ref:E,style:P,src:I,className:t,width:k,height:G,srcSet:j,sizes:te,loading:T,alt:M.alternateText||"",...p})]})},rN=(e,t,n,r,l,d)=>{if(t<0&&console.warn(`Invalid image width: ${t}.`),n<0&&console.warn(`Invalid image height: ${n}.`),e===Ts.FIXED){if(!r&&!l){console.warn("Using fixed layout but neither width nor height is passed as props.");return}r&&r<0&&console.warn(`Using fixed layout but width is invalid: ${r}.`),l&&l<0&&console.warn(`Using fixed layout but height is invalid: ${l}.`);return}(r||l)&&console.warn("Width or height is passed in but layout is not fixed. These will have no impact. If you want to have a fixed height or width then set layout to fixed."),e===Ts.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},iN=(e,t,n,r,l,d,f,p)=>{let _=[100,320,640,960,1280,1920],T=Yu(l,500,500);const E={...r};switch(E.objectFit=E.objectFit||"cover",E.objectPosition=E.objectPosition||"center",e){case Ts.INTRINSIC:E.maxWidth=t,E.width="100%",E.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case Ts.FIXED:{const{fixedWidth:S,fixedHeight:w,fixedWidths:M}=sN(t,n,_,d,f);E.width=S,E.height=w,_=M,T=Yu(l,S,w);break}case Ts.ASPECT:E.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case Ts.FILL:E.width="100%",E.aspectRatio=p?`${p}`:`${t} / ${n}`;break;default:console.warn(`Unrecognized layout: ${e}.`);break}return{src:T,imgStyle:E,widths:_}},sN=(e,t,n,r,l)=>r&&l?{fixedWidth:r,fixedHeight:l,fixedWidths:[r]}:r?{fixedWidth:r,fixedHeight:r*t/e,fixedWidths:[r]}:l?{fixedWidth:l/t*e,fixedHeight:l,fixedWidths:[l/t*e]}:{fixedWidth:e,fixedHeight:t,fixedWidths:n};var dp={exports:{}};/*!
|
|
30
|
+
<%s key={someKey} {...props} />`,sr,Zn,or,Zn),It[Zn+sr]=!0}}return pe===r?nn(an):Kt(an),an}}function bt(pe,Ze,lt){return Vt(pe,Ze,lt,!0)}function rn(pe,Ze,lt){return Vt(pe,Ze,lt,!1)}var Or=rn,_i=bt;jl.Fragment=r,jl.jsx=Or,jl.jsxs=_i}()),jl}process.env.NODE_ENV==="production"?zu.exports=oy():zu.exports=ly();var nt=zu.exports;function ay(e){switch(e){case"AD":case"AM":case"AT":case"AX":case"AZ":case"BA":case"BY":case"CY":case"CZ":case"DK":case"DZ":case"EC":case"EH":case"ET":case"FI":case"FR":case"GE":case"GF":case"GI":case"GP":case"GW":case"HT":case"KE":case"KV":case"KW":case"LA":case"LU":case"MC":case"MD":case"ME":case"MG":case"MK":case"MQ":case"MZ":case"NC":case"NL":case"NO":case"PL":case"PT":case"PY":case"RE":case"RS":case"SA":case"SE":case"SJ":case"SM":case"SN":case"TC":case"TJ":case"TM":case"TN":case"TZ":case"UY":case"VG":case"ZM":return[["line1"],["line2"],["postalCode","city"],["countryCode"]];case"AF":case"IR":return[["line1"],["line2"],["city"],["region"],["postalCode"],["countryCode"]];case"AG":case"AO":case"AW":case"BJ":case"BO":case"BS":case"BZ":case"CI":case"CW":case"DJ":case"FJ":case"GA":case"GH":case"GM":case"GY":case"JM":case"KI":case"LY":case"MW":case"NA":case"NR":case"PS":case"QA":case"RW":case"SC":case"SR":case"SX":case"TG":case"TT":case"UG":case"VU":return[["line1"],["line2"],["city"],["countryCode"]];case"AL":case"EE":case"IS":return[["line1"],["line2"],["postalCode","city"]];case"AR":return[["line1"],["line2"],["postalCode","city",",","region"],["countryCode"]];case"AS":case"BB":case"BD":case"BM":case"BN":case"BT":case"CR":case"DO":case"FK":case"FM":case"GR":case"GU":case"JO":case"KZ":case"LB":case"LK":case"LS":case"MA":case"MH":case"MM":case"MR":case"MT":case"MV":case"NG":case"PG":case"PK":case"PR":case"RO":case"SG":case"VC":case"WS":return[["line1"],["line2"],["city","postalCode"],["countryCode"]];case"AU":case"CA":case"SZ":case"US":case"VI":return[["line1"],["line2"],["city",",","region","postalCode"],["countryCode"]];case"BE":case"PE":return[["line1"],["line2"],["postalCode","sublocality","city"],["countryCode"]];case"BF":case"BI":case"BQ":case"BW":case"CF":case"CG":case"CM":case"DM":case"ER":case"GQ":case"KM":case"ML":case"SY":case"TD":case"ZW":return[["line1"],["line2"],["city"],["region"],["countryCode"]];case"BG":return[["line1"],["postalCode","region"],["countryCode"]];case"BH":return[["line1"],["line2"],["sublocality","city"],["countryCode"]];case"BR":return[["line1"],["line2"],["sublocality"],["city","region"],["postalCode"],["countryCode"]];case"CH":case"DE":case"GT":case"IT":case"LI":case"MY":case"NI":case"OM":case"SK":case"VA":return[["line1"],["line2"],["postalCode","city","region"],["countryCode"]];case"CL":case"PF":return[["line1"],["line2"],["city","postalCode","region"],["countryCode"]];case"CN":return[["region","city","sublocality"],["line1"],["line2"],["countryCode"]];case"CO":case"ID":case"IQ":case"KH":case"MP":case"NP":case"PW":case"UA":return[["line1"],["line2"],["city","region","postalCode"],["countryCode"]];case"EG":return[["line1"],["line2"],["sublocality","city","region","postalCode"],["countryCode"]];case"ES":case"IL":return[["line1"],["line2"],["city","postalCode"],["region"],["countryCode"]];case"GB":case"MN":case"ZA":return[["line1"],["line2"],["sublocality","city","postalCode"],["countryCode"]];case"GG":case"IM":case"JE":return[["line1"],["line2"],["sublocality"],["city"],["postalCode"],["countryCode"]];case"GN":return[["line1","line2","city"],["countryCode"]];case"HK":return[["line1"],["line2"],["sublocality"],["city"],["region"],["countryCode"]];case"HR":return[["line1"],["postalCode","city","region"],["countryCode"]];case"HU":case"SI":return[["postalCode","city"],["line1"],["line2"],["countryCode"]];case"IE":return[["line1"],["line2"],["sublocality"],["city","region","postalCode"],["countryCode"]];case"IN":case"VE":return[["line1"],["line2"],["city","postalCode"],["region"],["countryCode"]];case"JP":return[["line2"],["line1","sublocality"],["city","region"],["postalCode"],["countryCode"]];case"KR":return[["countryCode"],["region","city","sublocality","line1"],["line2"],["postalCode"]];case"KY":return[["line1"],["line2"],["postalCode"],["countryCode"]];case"LT":return[["line1"],["postalCode","city","sublocality","region"],["countryCode"]];case"LV":return[["line1"],["city",",","postalCode"],["countryCode"]];case"MO":return[["line1"],["line2"],["sublocality"],["city"],["countryCode"]];case"MU":return[["line1"],["line2"],["city"],["region","postalCode"],["countryCode"]];case"MX":return[["line1"],["line2"],["sublocality"],["postalCode","city",",","region"],["countryCode"]];case"NE":case"SD":return[["line1"],["line2"],["postalCode"],["city"],["region"],["countryCode"]];case"NZ":return[["line1"],["line2"],["sublocality"],["city"],["postalCode"],["countryCode"]];case"PH":case"TW":case"VN":return[["line1"],["line2"],["sublocality","city"],["region","postalCode"],["countryCode"]];case"RU":return[["line1"],["line2"],["city"],["postalCode"],["countryCode"]];case"SB":case"SL":case"ST":case"TL":case"TO":case"TV":return[["line1"],["line2"],["city",",","region"],["countryCode"]];case"TH":case"TR":return[["line1"],["line2"],["sublocality"],["postalCode","city"],["countryCode"]];case"UZ":return[["line1"],["line2"],["region","postalCode"],["countryCode"]]}return[["line1","line2"],["city","region","postalCode"],["countryCode"]]}const ap={GOOGLEMYBUSINESS:"GOOGLEMYBUSINESS"},Uu={GOOGLE:"google",APPLE:"apple",BING:"bing"},cy=(e,t)=>{const r={region:"localizedRegionName",countryCode:"localizedCountryName"}[e];return r&&t[r]},uy=(e,t=[],n,r={route:!1},l)=>{const d="Failed to construct query for maps service.";let f=e&&Tf([e.line1,e.line2,e.city,e.region,e.postalCode,e.countryCode]);switch(r.provider){case Uu.APPLE:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return Nf(`${l.latitude},${l.longitude}`,r.route);if(!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return Nf(f,r.route)}case Uu.BING:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return Cf(`${l.latitude},${l.longitude}`,r.route);if(f=e&&Tf([e.line1,e.city,e.region,e.postalCode]),!f){console.warn(`${d} Check that you've provided a valid Yext Address.`);break}return Cf(f,r.route)}default:{if(l!=null&&l.latitude&&(l!=null&&l.longitude))return Ef(`${l.latitude},${l.longitude}`,r.route);const p=t.find(_=>{var E;return((E=_==null?void 0:_.publisher)==null?void 0:E.toUpperCase())===ap.GOOGLEMYBUSINESS});if(p!=null&&p.listingUrl)return p.listingUrl;if(n)return dy(n,f,r.route);if(!f){console.warn(`${d} Check that you've provided a valid Yext Address, Yext ListingType, or Google Place ID.`);break}return Ef(f,r.route)}}},Nf=(e,t)=>t?`https://maps.apple.com/?daddr=${e}`:`https://maps.apple.com/?address=${e}`,Cf=(e,t)=>t?`https://bing.com/maps/default.aspx?rtp=adr.${e}`:`https://bing.com/maps/default.aspx?where1=${e}`,dy=(e,t,n)=>{const r=t?`&query=${t}`:"";return n?`https://maps.google.com/maps/dir/?api=1${r}&destination_place_id=${e}&destination=direct`:r?`https://maps.google.com/maps/search/?api=1${r}&query_place_id=${e}`:`https://maps.google.com/maps/dir/?api=1&destination_place_id=${e}&destination=direct`},Ef=(e,t)=>t?`https://maps.google.com/maps/dir/?api=1&destination=${e}`:`https://maps.google.com/maps/search/?api=1&query=${e}`,Tf=(e=[])=>{if(!e.length)return"";const t=e.filter(Boolean).join(", ");return encodeURI(t)},fy=({address:e,lines:t,separator:n=",",...r})=>{const l=(t||ay(e.countryCode)).map(d=>nt.jsx(hy,{address:e,line:d,separator:n},d.toString()));return rt.createElement("div",{...r,key:e.toString()},l)},hy=({address:e,line:t,separator:n})=>{const r=[];let l=0;for(const d of t){if(d===","){r.push(nt.jsx("span",{children:n},`separator-${l++}`));continue}const f=e[d];if(!f)continue;const p=cy(d,e);if(p){r.push(nt.jsxs(sy.Fragment,{children:[" ",nt.jsx("abbr",{title:p,children:f})]},d));continue}r.push(nt.jsx("span",{children:" "+f},d))}return nt.jsx("div",{className:"address-line",children:r})};var tl={};Object.defineProperty(tl,"__esModule",{value:!0});var gy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},py=typeof window<"u"&&typeof window.document<"u",my=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,_y=(typeof self>"u"?"undefined":gy(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",yy=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Ny=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",xf=tl.isBrowser=py;tl.isWebWorker=_y;var Cy=tl.isNode=my;tl.isJsDom=yy;var Ey=tl.isDeno=Ny;class Ty{constructor(){Ie(this,"name");Ie(this,"isServerSide");Ie(this,"version");var t;Ey?(this.name="deno",this.version="",xf&&(this.version=((t=window.Deno)==null?void 0:t.version.deno)||""),this.isServerSide=!0):Cy?(this.name="node",this.version=process.versions.node,this.isServerSide=!0):xf?(this.name="browser",this.version=navigator.userAgent,this.isServerSide=!1):(this.name="unknown",this.version="",this.isServerSide=!1)}getNodeMajorVersion(){if(this.name!=="node")throw new Error("Not running in Node.");return+this.version.split(".")[0]}}const Qo=()=>new Ty,xy=(...e)=>{var t;if(typeof window<"u"){if(window.IS_PRODUCTION)return!0;const n=(t=window.location)==null?void 0:t.hostname;return e==null?void 0:e.some(r=>r==null?void 0:r.includes(n))}return!1};function qc(e){if(!gd(e))throw new Error("Parameter was not an error")}function gd(e){return!!e&&typeof e=="object"&&vy(e)==="[object Error]"||e instanceof Error}function vy(e){return Object.prototype.toString.call(e)}const Sy="Layerr";let wy=Sy;function Oy(){return wy}function Dy(e){let t,n="";if(e.length===0)t={};else if(gd(e[0]))t={cause:e[0]},n=e.slice(1).join(" ")||"";else if(e[0]&&typeof e[0]=="object")t=Object.assign({},e[0]),n=e.slice(1).join(" ")||"";else if(typeof e[0]=="string")t={},n=n=e.join(" ")||"";else throw new Error("Invalid arguments passed to Layerr");return{options:t,shortMessage:n}}class Di extends Error{constructor(t,n){const r=[...arguments],{options:l,shortMessage:d}=Dy(r);let f=d;if(l.cause&&(f=`${f}: ${l.cause.message}`),super(f),this.message=f,l.name&&typeof l.name=="string"?this.name=l.name:this.name=Oy(),l.cause&&Object.defineProperty(this,"_cause",{value:l.cause}),Object.defineProperty(this,"_info",{value:{}}),l.info&&typeof l.info=="object"&&Object.assign(this._info,l.info),Error.captureStackTrace){const p=l.constructorOpt||this.constructor;Error.captureStackTrace(this,p)}}static cause(t){return qc(t),t._cause&&gd(t._cause)?t._cause:null}static fullStack(t){qc(t);const n=Di.cause(t);return n?`${t.stack}
|
|
31
|
+
caused by: ${Di.fullStack(n)}`:t.stack??""}static info(t){qc(t);const n={},r=Di.cause(t);return r&&Object.assign(n,Di.info(r)),t._info&&Object.assign(n,t._info),n}toString(){let t=this.name||this.constructor.name||this.constructor.prototype.name;return this.message&&(t=`${t}: ${this.message}`),t}}const cp="0123456789ABCDEFGHJKMNPQRSTVWXYZ",ia=32,vf=0xffffffffffff,Ay=10,My=16,ea=Object.freeze({source:"ulid"});function Ry(e){const t=by(),n=t&&(t.crypto||t.msCrypto)||null;if(typeof(n==null?void 0:n.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return n.getRandomValues(r),r[0]/255};if(typeof(n==null?void 0:n.randomBytes)=="function")return()=>n.randomBytes(1).readUInt8()/255;throw new Di({info:{code:"PRNG_DETECT",...ea}},"Failed to find a reliable PRNG")}function by(){return ky()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function Ly(e,t){let n="";for(;e>0;e--)n=Py(t)+n;return n}function Iy(e,t){if(isNaN(e))throw new Di({info:{code:"ENC_TIME_NAN",...ea}},`Time must be a number: ${e}`);if(e>vf)throw new Di({info:{code:"ENC_TIME_SIZE_EXCEED",...ea}},`Cannot encode a time larger than ${vf}: ${e}`);if(e<0)throw new Di({info:{code:"ENC_TIME_NEG",...ea}},`Time must be positive: ${e}`);if(Number.isInteger(e)===!1)throw new Di({info:{code:"ENC_TIME_TYPE",...ea}},`Time must be an integer: ${e}`);let n,r="";for(let l=t;l>0;l--)n=e%ia,r=cp.charAt(n)+r,e=(e-n)/ia;return r}function ky(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Py(e){let t=Math.floor(e()*ia);return t===ia&&(t=ia-1),cp.charAt(t)}function $y(e,t){const n=Ry(),r=isNaN(e)?Date.now():e;return Iy(r,Ay)+Ly(My,n)}var Sf="yext_analytics_session_id";function Fy(){if(typeof window>"u")return null;try{var e=window.sessionStorage.getItem(Sf);return e||(e=$y(),window.sessionStorage.setItem(Sf,e)),e}catch(t){return console.warn(`Unable to use browser sessionStorage for sessionId.
|
|
32
|
+
`,t),null}}const By="1.0.0",wf={version:By};function Hy(e,t,n){return n.debug?(up(!0,t,n),!0):navigator.sendBeacon(e,JSON.stringify(t))}function Wy(e,t,n){return n.debug?(up(!1,t,n),Promise.resolve(new Response)):fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),keepalive:!0})}function Ky(e,t){return!t&&!!navigator.userAgent&&navigator.userAgent.toLowerCase().includes("firefox")}function up(e,t,n){var r=e?"Beacon":"fetch()";console.log("[DEBUG] AnalyticsConfig object at time of call to report():",n),console.log("[DEBUG] The following EventPayload would be sent to the Yext Events API using ".concat(r,":"),t)}var Gu=function(){return Gu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},Gu.apply(this,arguments)},Yu=function(e,t){if(!t||Object.keys(t).length===0)return e;if(!e||Object.keys(e).length===0)return t;var n=JSON.parse(JSON.stringify(e));for(var r in t)if(t.hasOwnProperty(r)){var l=t[r];l==null?delete n[r]:typeof l!="object"?n[r]=l:n[r]=Yu(n[r],l)}return Gu({},n)},zy="yextevents.com/accounts/me/events";function Uy(e,t){var n=e==="SANDBOX",r=t==null?void 0:t.toLowerCase();if(n&&r==="eu")throw new Error("Sandbox environment is not available in the EU region.");return"https://"+(n?"sbx.":"")+(r??"us")+"."+zy}var Gy=function(e,t,n,r){function l(d){return d instanceof n?d:new n(function(f){f(d)})}return new(n||(n=Promise))(function(d,f){function p(T){try{E(r.next(T))}catch(S){f(S)}}function _(T){try{E(r.throw(T))}catch(S){f(S)}}function E(T){T.done?d(T.value):l(T.value).then(p,_)}E((r=r.apply(e,t||[])).next())})},Yy=function(e,t){var n={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},r,l,d,f;return f={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function p(E){return function(T){return _([E,T])}}function _(E){if(r)throw new TypeError("Generator is already executing.");for(;f&&(f=0,E[0]&&(n=0)),n;)try{if(r=1,l&&(d=E[0]&2?l.return:E[0]?l.throw||((d=l.return)&&d.call(l),0):l.next)&&!(d=d.call(l,E[1])).done)return d;switch(l=0,d&&(E=[E[0]&2,d.value]),E[0]){case 0:case 1:d=E;break;case 4:return n.label++,{value:E[1],done:!1};case 5:n.label++,l=E[1],E=[0];continue;case 7:E=n.ops.pop(),n.trys.pop();continue;default:if(d=n.trys,!(d=d.length>0&&d[d.length-1])&&(E[0]===6||E[0]===2)){n=0;continue}if(E[0]===3&&(!d||E[1]>d[0]&&E[1]<d[3])){n.label=E[1];break}if(E[0]===6&&n.label<d[1]){n.label=d[1],d=E;break}if(d&&n.label<d[2]){n.label=d[2],n.ops.push(E);break}d[2]&&n.ops.pop(),n.trys.pop();continue}E=t.call(e,n)}catch(T){E=[6,T],l=0}finally{r=d=0}if(E[0]&5)throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}},jy=function(){function e(t,n){if(t.authorizationType!=="apiKey"&&t.authorizationType!=="bearer")throw new Error("Authorization type must be either apiKey or bearer.");if(!t.authorization)throw new Error("Authorization must be provided.");this.config=t,this.payload=n}return e.prototype.with=function(t){var n=this.payload===void 0?t:Yu(this.payload,t);return new e(this.config,n)},e.prototype.report=function(t){var n;return Gy(this,void 0,void 0,function(){var r,l,d,f,p=this;return Yy(this,function(_){return r=Yu((n=this.payload)!==null&&n!==void 0?n:{},t??{}),this.config.sessionTrackingEnabled?r.sessionId||(r.sessionId=Fy()):r.sessionId=void 0,r.clientSdk?r.clientSdk.ANALYTICS=wf.version:r.clientSdk=(f={},f.ANALYTICS=wf.version,f),r.authorization=this.config.authorizationType==="apiKey"?"KEY "+this.config.authorization:"Bearer "+this.config.authorization,l=Ky(r,this.config.forceFetch),d=Uy(this.config.env,this.config.region),l?[2,new Promise(function(E,T){Hy(d,r,p.config)?E(""):T("Failed Beacon Call")})]:[2,Wy(d,r,this.config).then(function(E){return E}).catch(function(E){return E})]})})},e}();function Vy(e){return new jy(e)}function ju(e){return e?e.toLowerCase().trim().replace(/\s/g,""):""}function dp(e,t){return[e,t].filter(n=>!!n).map(n=>ju(n)).join("_")}const qy=e=>{switch(Math.floor(e/1e8%10)){case 0:return"US";case 1:return"EU";default:return""}},pd=rt.createContext(null),Zy=rt.lazy(()=>Promise.resolve().then(()=>require("./debugger-HkoZKzeG.cjs")));function Jy(e){const{children:t,apiKey:n,currency:r,templateData:l,requireOptIn:d,disableSessionTracking:f,enableDebugging:p,productionDomains:_}=e;if(!n)throw new Error("API Key is required for AnalyticsProvider");const E=rt.useRef(null),[T,S]=rt.useState(!1);rt.useEffect(()=>{S(!0)},[]),E.current===null&&(E.current=new fp(n,r,l,d,f,_,p??uc()));const w=E.current;return rt.useEffect(()=>(window.enableYextAnalytics=()=>{w.optIn()},()=>{delete window.enableYextAnalytics}),[w]),nt.jsxs(nt.Fragment,{children:[nt.jsx(pd.Provider,{value:w,children:t}),T&&(p||uc())&&Qo().name==="browser"?nt.jsx(rt.Suspense,{fallback:nt.jsx(nt.Fragment,{}),children:nt.jsx(Zy,{})}):null]})}function uc(){return Qo().name!=="browser"||typeof window===void 0?!1:!!new URL(window.location.href).searchParams.get("xYextDebug")}class fp{constructor(t,n,r,l,d,f,p=!1){Ie(this,"_optedIn");Ie(this,"_sessionTrackingEnabled");Ie(this,"_analyticsEventService");Ie(this,"_pageViewFired",!1);this.apiKey=t,this.defaultCurrency=n,this.templateData=r,this.productionDomains=f,this.enableDebugging=p,this._optedIn=!l,this._sessionTrackingEnabled=!d,this.makeReporter(),this.pageView()}makeReporter(){if(Qo().name!=="browser"||!this._optedIn)return;if(!xy(...this.productionDomains??[])&&!this.getDebugEnabled()){console.warn("Yext Analytics disabled for non-production domains");return}const t=qy(this.templateData.document.businessId),n={authorizationType:"apiKey",authorization:this.apiKey,env:"PRODUCTION",region:t||"US",sessionTrackingEnabled:this._sessionTrackingEnabled,debug:this.getDebugEnabled()},r={pages:{siteUid:this.templateData.document.siteId,template:this.templateData.document.__.name},entity:this.templateData.document.uid||void 0,pageUrl:document.URL,referrerUrl:document.referrer!==""?document.referrer:void 0};this._analyticsEventService=Vy(n).with(r)}canTrack(){return Qo().name==="browser"&&this._optedIn&&!!this._analyticsEventService}identify(t){this.canTrack()&&this._analyticsEventService&&(this._analyticsEventService=this._analyticsEventService.with({visitor:t}))}async optIn(){this._optedIn=!0,this.makeReporter(),this._pageViewFired||await this.pageView()}async pageView(){var t;if(!this.canTrack())return Promise.resolve(void 0);await((t=this._analyticsEventService)==null?void 0:t.report({action:"PAGE_VIEW"})),this._pageViewFired=!0}async track(t){var S;if(!this.canTrack())return Promise.resolve();const{action:n,scope:r,eventName:l,currency:d,amount:f,destinationUrl:p,customTags:_,customValues:E}=t;let T;f&&(T={amount:f,currency:d||this.defaultCurrency}),await((S=this._analyticsEventService)==null?void 0:S.report({action:n,pages:{scope:ju(r)||void 0,originalEventName:dp(r||"",ju(l)||"")},value:T,destinationUrl:p,customTags:_,customValues:E}))}getDebugEnabled(){return this.enableDebugging||uc()}}const Vu=rt.createContext({name:""}),md=()=>rt.useContext(Vu).name;function Xy(e){var f;const t=md(),[n]=rt.useState({name:dp(t,e.name)}),r=(f=nl())==null?void 0:f.getDebugEnabled(),[l,d]=rt.useState(!1);return rt.useEffect(()=>{d(!0)},[]),r&&l?nt.jsx("section",{"data-ya-scope":n.name,children:nt.jsx(Vu.Provider,{value:n,children:e.children})}):nt.jsx(Vu.Provider,{value:n,children:e.children})}function nl(){const e=rt.useContext(pd);if(!e)return e;Qo().name==="browser"&&!window.setAnalyticsOptIn&&(window.setAnalyticsOptIn=async()=>{await e.optIn()});const t=md();return{getDebugEnabled(){return e.getDebugEnabled()},identify(n){return e.identify(n)},optIn(){return e.optIn()},pageView(){return e.pageView()},track(n){return e.track({...n,scope:n.scope??t})}}}const Qy=()=>{var e;return(e=nl())==null?void 0:e.track},eN=()=>{var e;return(e=nl())==null?void 0:e.pageView},tN=()=>{var e;return(e=nl())==null?void 0:e.identify},Es={INTRINSIC:"intrinsic",FIXED:"fixed",ASPECT:"aspect",FILL:"fill"},nN=e=>{const t=e.protocol.slice(0,-1);if(t!=="http"&&t!=="https"){console.error(`Invalid scheme: ${e}`);return}const n=e.hostname;let r;if(n==="a.mktgcdn.com")r="us";else{if(n.replace("a.","").replace(".mktgcdn.com","")!=="eu"){console.error(`Invalid host: ${e}`);return}r="eu"}if(!e.pathname.startsWith("/f")){console.error(`Invalid path: ${e}`);return}const l=e.pathname.replace(/^\//,"").split("/");if(l.length<2||l.length>3){console.error(`Invalid path: ${e}`);return}let d;if(l[0]==="f")d="prod";else switch(l[0].replace("f-","")){case"sandbox":{d="sbx";break}case"qa":{d="qa";break}case"dev":{d="dev";break}default:{console.error(`Invalid path: ${e}`);return}}if(r==="eu"&&(d==="dev"||d==="sbx")){console.error(`Invalid path: ${e}`);return}let f;if(l.length===3&&(f=parseInt(l[1]),Number.isNaN(f))){console.error(`Invalid account id: ${e}`);return}const p=l[l.length-1].split("."),_=p.length===2?`.${p[1]}`:"",E=p[0];return{scheme:t,partition:r,env:d,accountId:f,contentHash:E,extension:_}},rN=(e,t,n)=>{const r=`https://dyn${e.partition==="us"?"":`.${e.partition}`}.mktgcdn.com`;let l="f";switch(e.env){case"prod":break;case"sbx":{l+="-sandbox";break}default:l+=`-${e.env.toString()}`}const d=e.accountId!==void 0?`${e.accountId}/`:"";return`${r}/${l}/${d}${e.contentHash}${e.extension}/width=${Math.round(t)},height=${Math.round(n)}`},iN=e=>{const t=e.protocol.slice(0,-1);if(t!=="http"&&t!=="https"){console.error(`Invalid scheme: ${e}`);return}if(e.hostname!=="a.mktgcdn.com"){console.error(`Invalid host: ${e}`);return}if(!e.pathname.startsWith("/p")){console.error(`Invalid path: ${e}`);return}const n=e.pathname.replace(/^\//,"").split("/");if(n.length<3||n.length>4){console.error(`Invalid path: ${e}`);return}let r;if(n[0]==="p")r="prod";else switch(n[0].replace("p-","")){case"sandbox":{r="sbx";break}case"qa":{r="qa";break}case"dev":{r="dev";break}default:{console.error(`Invalid path: ${e}`);return}}const l=n[1];let d;if(n.length===4){if(!n[2].includes(".")){console.error(`Invalid aspect ratio: ${e}`);return}if(d=parseFloat(n[2]),Number.isNaN(d)||n[2].split(".")[1].length!==4){console.error(`Invalid aspect ratio: ${e}`);return}}const f=n[n.length-1].split("."),p=f.length===2?`.${f[1]}`:"",_=f[0];return{scheme:t,env:r,contentHash:l,aspectRatio:d,name:_,extension:p}},sN=(e,t,n)=>{const r="https://dyn.mktgcdn.com";let l="p";switch(e.env){case"prod":break;case"sbx":{l+="-sandbox";break}default:l+=`-${e.env.toString()}`}return`${r}/${l}/${e.contentHash}/width=${Math.round(t)},height=${Math.round(n)}`},qu=(e,t,n)=>{if(!hp(e)){console.error(`Invalid image url: ${e}.`);return}const r=new URL(e);if(r.pathname.startsWith("/p")){const l=iN(r);if(l)return sN(l,t,n)}else if(r.pathname.startsWith("/f")){const l=nN(r);if(l)return rN(l,t,n)}return e},hp=e=>{let t;try{t=new URL(e)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"},oN=({image:e,className:t,width:n,height:r,aspectRatio:l,layout:d=Es.INTRINSIC,placeholder:f,imgOverrides:p,style:_={},loading:E="lazy"})=>{const T=rt.useRef(null),[S,w]=rt.useState(!1),O="image"in e?e.image:e;rt.useEffect(()=>{var ce;(ce=T.current)!=null&&ce.complete&&w(!0)},[]),lN(d,O.width,O.height,n,r,l);const m=Math.abs(O.width);m||console.warn("Invalid image width.");const v=Math.abs(O.height);if(v||console.warn("Invalid image height."),!hp(O.url))return console.error(`Invalid image url: ${O.url}`),nt.jsx(nt.Fragment,{children:f!=null&&f});const I=n&&n>0?n:void 0,G=r&&r>0?r:void 0,{src:k,imgStyle:P,widths:H}=aN(d,m,v,_,O.url,I,G,l),j=H.map(ce=>`${qu(O.url,ce,v/m*ce)} ${ce}w`).join(", "),re=[640,768,1024,1280,1536],te=H.map((ce,V)=>V===H.length-1?`${ce}px`:`(max-width: ${re[V]}px) ${ce}px`).join(", ");return nt.jsxs(nt.Fragment,{children:[!S&&f!=null&&f,nt.jsx("img",{ref:T,style:P,src:k,className:t,width:I,height:G,srcSet:j,sizes:te,loading:E,alt:O.alternateText||"",...p})]})},lN=(e,t,n,r,l,d)=>{if(t<0&&console.warn(`Invalid image width: ${t}.`),n<0&&console.warn(`Invalid image height: ${n}.`),e===Es.FIXED){if(!r&&!l){console.warn("Using fixed layout but neither width nor height is passed as props.");return}r&&r<0&&console.warn(`Using fixed layout but width is invalid: ${r}.`),l&&l<0&&console.warn(`Using fixed layout but height is invalid: ${l}.`);return}(r||l)&&console.warn("Width or height is passed in but layout is not fixed. These will have no impact. If you want to have a fixed height or width then set layout to fixed."),e===Es.ASPECT&&!d&&console.warn("Using aspect layout but aspectRatio is not passed as a prop.")},aN=(e,t,n,r,l,d,f,p)=>{let _=[100,320,640,960,1280,1920],E=qu(l,500,500);const T={...r};switch(T.objectFit=T.objectFit||"cover",T.objectPosition=T.objectPosition||"center",e){case Es.INTRINSIC:T.maxWidth=t,T.width="100%",T.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case Es.FIXED:{const{fixedWidth:S,fixedHeight:w,fixedWidths:O}=cN(t,n,_,d,f);T.width=S,T.height=w,_=O,E=qu(l,S,w);break}case Es.ASPECT:T.aspectRatio=p?`${p}`:`${t} / ${n}`;break;case Es.FILL:T.width="100%",T.aspectRatio=p?`${p}`:`${t} / ${n}`;break;default:console.warn(`Unrecognized layout: ${e}.`);break}return{src:E,imgStyle:T,widths:_}},cN=(e,t,n,r,l)=>r&&l?{fixedWidth:r,fixedHeight:l,fixedWidths:[r]}:r?{fixedWidth:r,fixedHeight:r*t/e,fixedWidths:[r]}:l?{fixedWidth:l/t*e,fixedHeight:l,fixedWidths:[l/t*e]}:{fixedWidth:e,fixedHeight:t,fixedWidths:n};var gp={exports:{}};/*!
|
|
33
33
|
Copyright (c) 2018 Jed Watson.
|
|
34
34
|
Licensed under the MIT License (MIT), see
|
|
35
35
|
http://jedwatson.github.io/classnames
|
|
36
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var d="",f=0;f<arguments.length;f++){var p=arguments[f];p&&(d=l(d,r(p)))}return d}function r(d){if(typeof d=="string"||typeof d=="number")return d;if(typeof d!="object")return"";if(Array.isArray(d))return n.apply(null,d);if(d.toString!==Object.prototype.toString&&!d.toString.toString().includes("[native code]"))return d.toString();var f="";for(var p in d)t.call(d,p)&&d[p]&&(f=l(f,p));return f}function l(d,f){return f?d?d+" "+f:d+f:d}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(dp);var oN=dp.exports;const Qo=ad(oN),lN="phonecall",aN="drivingdirection",xf="calltoactionclick",cN="clicktowebsite",uN="other",vf="link",dN="cta",fN=e=>{const t=e.cta??{link:e.href};if(!t.link)throw e.cta?new Error("CTA's link is undefined"):new Error("Link's href is undefined");return t.linkType||(t.linkType=pN(t.link)),t.link=mN(t),t},hN=(e,t)=>{switch(e.linkType){case"EMAIL":return"CTA_CLICK";case"PHONE":return"TAP_TO_CALL";case"CLICK_TO_WEBSITE":return"WEBSITE";case"DRIVING_DIRECTIONS":return"DRIVING_DIRECTIONS";case"OTHER":return"CTA_CLICK";case"URL":return"LINK";default:return t?"CTA_CLICK":"LINK"}},gN=(e,t,n)=>{if(e)return e;if(t)switch(t){case"PHONE":return lN;case"EMAIL":return xf;case"URL":return vf;case"DRIVING_DIRECTIONS":return aN;case"CLICK_TO_WEBSITE":return cN;case"OTHER":return uN;default:return n?xf:vf}return dN},pN=e=>_N(e)?"EMAIL":e.startsWith("tel:")?"PHONE":"URL",mN=e=>e.linkType==="EMAIL"?e.link.startsWith("mailto:")?e.link:`mailto:${e.link}`:e.linkType==="PHONE"?e.link.startsWith("tel:")?e.link:`tel:${e.link}`:e.link,_N=e=>e.startsWith("mailto:")?!0:/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e),fp=nt.forwardRef(function(t,n){const{children:r,onClick:l,className:d,eventName:f,scope:p,currency:_,amount:T,cta:E,obfuscate:S,customTags:w,customValues:M,...m}=t,v=fN(t),k=hN(v,!!E),G=gN(f,v.linkType,!!E),I=nl(),P=S||S!==!1&&v.linkType==="EMAIL",H=async te=>{const ce=te.currentTarget;let V="";if(P){te.preventDefault();const z=ce.href.split("/").at(-1);z&&(V=atob(z))}if(I!==null)try{await I.track({action:k,scope:p,eventName:G,currency:_,amount:T,destinationUrl:V||ce.href,customTags:w,customValues:M})}catch{console.error("Failed to report click Analytics Event")}l&&l(te),V&&(window.location.href=V)},j=P?"Obfuscated, set a label or child":v.link,re={className:Qo("Link",d),href:P?btoa(v.link):v.link,onClick:H,rel:t.target&&!t.rel?"noopener":void 0,ref:n};return I!=null&&I.getDebugEnabled()&&(re["data-ya-action"]=k,re["data-ya-scopeoverride"]=p,re["data-ya-eventname"]=G),at.jsx("a",{...m,...re,suppressHydrationWarning:!0,children:r||v.label||j})});var Nn=(e=>(e.DEGREE="deg",e.KILOMETER="km",e.MILE="mi",e.RADIAN="r",e))(Nn||{}),Gr=(e=>(e.MERCATOR="mercator",e.SPHERICAL="spherical",e))(Gr||{});const jc=3959,Vc=6371,yN=["latitude","lat"],NN=["longitude","lon","lng","long"];function Sf(e,t){for(const n of t)if(e[n]||e[n]===0)return e[n]}function wf(e){switch(typeof e){case"string":case"number":const t=Number.parseFloat(e);if(Number.isNaN(t))throw new Error(`'${e}' must be convertible to a Number'`);return t;default:throw new Error(`typeof '${e}' must be a number or a string that can be converted to a number, is '${typeof e}'`)}}function io(e){return e*Math.PI/180}function Ji(e){return e/Math.PI*180}function CN(e,t){const n=io(e.latitude),r=io(t.latitude),l=r-n,d=io(t.longitude-e.longitude),f=Math.pow(Math.sin(l/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(d/2),2);return 2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f))}function EN(e,t){const n=Math.tan(Math.PI/360*(e+90)),r=Math.tan(Math.PI/360*(t+90));return Math.log(r/n)}function TN(e,t){const r=Math.tan(Math.PI/360*(e+90))*Math.pow(Math.E,t);return Math.atan(r)*360/Math.PI-90}class dn{constructor(t,n){Ie(this,"_lat");Ie(this,"_lon");let r=t,l=n;this._lat=0,this._lon=0,typeof t=="object"?(r=Sf(t,yN)??0,l=Sf(t,NN)??0,this.latitude=typeof r=="function"?r():r,this.longitude=typeof l=="function"?l():l):typeof r=="number"&&typeof l=="number"&&(this.latitude=r,this.longitude=l)}get latitude(){return this._lat}set latitude(t){this._lat=Math.max(-90,Math.min(wf(t),90))}get longitude(){return this._lon}set longitude(t){this._lon=wf(t)}get normalLon(){return((this._lon+180)%360+360)%360-180}add(t,n,r=Nn.DEGREE,l=Gr.SPHERICAL){if(l===Gr.MERCATOR&&(r===Nn.DEGREE||r===Nn.RADIAN)){const d=r===Nn.DEGREE?io(t):t,f=r===Nn.DEGREE?n:Ji(n);this.latitude=TN(this.latitude,d),this.longitude+=f}else switch(r){case Nn.DEGREE:this.latitude+=t,this.longitude+=n;break;case Nn.KILOMETER:this.latitude+=Ji(t)*Vc,this.longitude+=Ji(n)*Vc*Math.cos(io(this.latitude));break;case Nn.MILE:this.latitude+=Ji(t)*jc,this.longitude+=Ji(n)*jc*Math.cos(io(this.latitude));break;case Nn.RADIAN:this.latitude+=Ji(t),this.longitude+=Ji(n);break;default:throw new Error(`unit unhandled: ${String(r)}`)}}distanceTo(t,n=Nn.MILE,r=Gr.SPHERICAL){if(r===Gr.MERCATOR&&(n===Nn.DEGREE||n===Nn.RADIAN)){const l=EN(this.latitude,t.latitude),d=Math.abs(t.normalLon-this.normalLon),f=io(Math.min(d,360-d)),p=Math.sqrt(Math.pow(l,2)+Math.pow(f,2));switch(n){case Nn.DEGREE:return Ji(p);case Nn.RADIAN:return p;default:throw new Error(`unit unhandled: ${String(n)}`)}}else{const l=CN(this,t);switch(n){case Nn.DEGREE:return Ji(l);case Nn.KILOMETER:return l*Vc;case Nn.MILE:return l*jc;case Nn.RADIAN:return l;default:throw new Error(`unit unhandled: ${String(n)}`)}}}equals(t){return t&&t.latitude===this.latitude&&t.longitude===this.longitude}searchQueryString(){return`${this.latitude},${this.longitude}`}}function hp(e,t=()=>null){const n=document.createElement("script");n.async=!0,n.onload=t,n.src=e,document.head.appendChild(n)}var Sr=(e=>(e.UNDEFINED="undefined",e.NULL="object",e.BOOLEAN="boolean",e.NUMBER="number",e.BIGINT="bigint",e.STRING="string",e.SYMBOL="symbol",e.FUNCTION="function",e.OBJECT="object",e))(Sr||{});function kr(e,t){if(typeof t!="string")throw new Error("Assertion error: 'type' must be a string");if(typeof e!==t)throw new Error(`Expected an object of type '${t}' but received '${typeof e}'`)}function wr(e,t){let n;try{n=e instanceof t}catch{throw new Error("Assertion error: 'instanceClass' is not a valid constructor")}if(!n)throw new Error(`Expected an instance of '${t.name}' but received '${e.constructor.name}'`)}class gp{constructor(t,n){Ie(this,"providerMapClass");Ie(this,"wrapper");Ie(this,"controlEnabled");Ie(this,"panHandler");Ie(this,"panStartHandler");Ie(this,"providerOptions");wr(t,ao),n&&wr(n,HTMLElement),this.providerMapClass=t.getMapClass(),this.wrapper=n,this.controlEnabled=!0,this.panHandler=()=>null,this.panStartHandler=()=>null,this.providerOptions={}}withControlEnabled(t){return this.controlEnabled=t,this}withPanHandler(t){return kr(t,Sr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return kr(t,Sr.FUNCTION),this.panStartHandler=t,this}withProviderOptions(t){return this.providerOptions=t,this}build(){const t=this.providerMapClass;return new t(this)}}class rl{constructor(t){Ie(this,"_panHandler");Ie(this,"_panStartHandler");wr(t,gp),this._panHandler=t.panHandler,this._panStartHandler=t.panStartHandler}getCenter(){throw new Error("not implemented")}getZoom(){throw new Error("not implemented")}setCenter(t,n){throw new Error("not implemented")}setZoom(t,n){throw new Error("not implemented")}setZoomCenter(t,n,r){this.setZoom(t,r),this.setCenter(n,r)}}class pp{constructor(t){Ie(this,"providerPinClass");Ie(this,"clickHandler");Ie(this,"focusHandler");Ie(this,"hoverHandler");Ie(this,"icons");Ie(this,"hasPinUrl");wr(t,ao),this.providerPinClass=t.getPinClass(),this.clickHandler=()=>null,this.focusHandler=n=>null,this.hoverHandler=n=>null,this.icons={},this.hasPinUrl=!1}withClickHandler(t){return kr(t,Sr.FUNCTION),this.clickHandler=t,this}withFocusHandler(t){return kr(t,Sr.FUNCTION),this.focusHandler=t,this}withHoverHandler(t){return kr(t,Sr.FUNCTION),this.hoverHandler=t,this}withIcons(t){return this.icons=t,this}withHasPinUrl(t){return this.hasPinUrl=t,this}build(){const t=this.providerPinClass;return new t(this)}}class fd{constructor(t){Ie(this,"_clickHandler");Ie(this,"_focusHandler");Ie(this,"_hoverHandler");Ie(this,"_icons");wr(t,pp),this._clickHandler=t.clickHandler,this._focusHandler=t.focusHandler,this._hoverHandler=t.hoverHandler,this._icons=t.icons}setCoordinate(t){throw new Error("not implemented")}setMap(t,n){throw new Error("not implemented")}setProperties(t){throw new Error("not implemented")}}const xN=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class il extends fd{constructor(n){super(n);Ie(this,"_pinEl");Ie(this,"_pinAlt");Ie(this,"_wrapper");this._pinEl=n.hasPinUrl?document.createElement("div"):document.createElement("button"),Object.assign(this._pinEl.style,il.baseStyle),this._pinAlt=document.createElement("span"),this._pinAlt.classList.add("sr-only"),this._pinEl.appendChild(this._pinAlt),this._wrapper=document.createElement("div"),this._wrapper.style.pointerEvents="none",this._wrapper.appendChild(this._pinEl),this.addListeners()}static get baseStyle(){return xN}addListeners(){this._wrapper&&(this._wrapper.addEventListener("click",()=>this._clickHandler()),this._wrapper.addEventListener("focusin",()=>this._focusHandler(!0)),this._wrapper.addEventListener("focusout",()=>this._focusHandler(!1)),this._wrapper.addEventListener("mouseover",()=>this._hoverHandler(!0)),this._wrapper.addEventListener("mouseout",()=>this._hoverHandler(!1)))}getPinElement(){return this._pinEl}getWrapperElement(){return this._wrapper}setProperties(n){this.setElementProperties(n);const r=n.getClass(),l=n.getElement()||this._pinEl,d=n.getZIndex();l.style.pointerEvents="auto",this._wrapper&&(this._wrapper.style.zIndex=d.toString(),this._wrapper.setAttribute("class",r),l!==this._wrapper.children[0]&&(this._wrapper.children[0].style.pointerEvents="",this._wrapper.removeChild(this._wrapper.children[0]),this._wrapper.appendChild(l)))}setElementProperties(n){const r=n.getAnchorX(),l=n.getAnchorY(),d=n.getHeight(),f=this._icons[n.getIcon()],p=n.getSRText(),_=n.getWidth();Object.assign(this._pinEl.style,{backgroundImage:f?`url("${f}")`:"",height:d+"px",transform:`translate(${-100*r}%, ${-100*l}%)`,width:_+"px"}),this._pinAlt.innerText=p}}class lo{constructor(){Ie(this,"loadFunction");Ie(this,"mapClass");Ie(this,"pinClass");Ie(this,"providerName");this.loadFunction=(t,n,r,l)=>t(),this.mapClass=rl,this.pinClass=fd,this.providerName=""}withLoadFunction(t){return kr(t,Sr.FUNCTION),this.loadFunction=t,this}withMapClass(t){return this.mapClass=t,this}withPinClass(t){return this.pinClass=t,this}withProviderName(t){return this.providerName=t,this}build(){return new ao(this)}}class ao{constructor(t){Ie(this,"_loadFunction");Ie(this,"_mapClass");Ie(this,"_pinClass");Ie(this,"_providerName");Ie(this,"_loadPromise");Ie(this,"_resolveLoad");Ie(this,"_rejectLoad");Ie(this,"_apiKey");Ie(this,"_loadInvoked");Ie(this,"_loaded");Ie(this,"_options");wr(t,lo),this._loadFunction=t.loadFunction,this._mapClass=t.mapClass,this._pinClass=t.pinClass,this._providerName=t.providerName,this._loadPromise=new Promise((n,r)=>{this._resolveLoad=n,this._rejectLoad=r}),this._apiKey="",this._loadInvoked=!1,this._loaded=!1,this._options={}}get loaded(){return this._loaded}getMapClass(){return this._mapClass}getPinClass(){return this._pinClass}getProviderName(){return this._providerName}async load(t=this._apiKey,n=this._options){!this._loadInvoked&&this._resolveLoad&&this._rejectLoad&&(this._loadInvoked=!0,this._loadFunction(this._resolveLoad,this._rejectLoad,t,n)),await this.ready(),this._loaded=!0}async ready(){await this._loadPromise}setLoadOptions(t,n=null){this._loadInvoked||(this._apiKey=t,this._options=n||this._options)}}class vN extends rl{constructor(n){super(n);Ie(this,"map");Ie(this,"_moving");n.wrapper&&(this.map=new google.maps.Map(n.wrapper,{disableDefaultUI:!n.controlEnabled,fullscreenControl:!1,gestureHandling:n.controlEnabled?"auto":"none",mapTypeControl:!1,rotateControl:!1,scaleControl:!1,streetViewControl:!1,zoomControl:n.controlEnabled,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},...n.providerOptions}),this._moving=!1,google.maps.event.addListener(this.map,"bounds_changed",()=>{this._moving||(this._moving=!0,this._panStartHandler())}),google.maps.event.addListener(this.map,"idle",()=>{this._moving=!1,this._panHandler()}))}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d,f;const l=new google.maps.LatLng(n.latitude,n.longitude);r?(d=this.map)==null||d.panTo(l):(f=this.map)==null||f.setCenter(l)}setZoom(n,r){var l;(l=this.map)==null||l.setZoom(Math.floor(n))}setZoomCenter(n,r,l){this.setCenter(r,l),this.setZoom(n,l)}}class SN extends il{constructor(n){super(n);Ie(this,"_latLng");Ie(this,"pin");this._wrapper&&(this._wrapper.style.position="absolute",google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._wrapper));class r extends google.maps.OverlayView{constructor(f){super();Ie(this,"pin");this.pin=f}draw(){var p;const f=(p=this.getProjection())==null?void 0:p.fromLatLngToDivPixel(this.pin._latLng??null);f&&this.pin._wrapper&&(this.pin._wrapper.style.left=f.x+"px",this.pin._wrapper.style.top=f.y+"px")}onAdd(){var f;this.pin._wrapper&&((f=this.getPanes())==null||f.floatPane.appendChild(this.pin._wrapper))}onRemove(){var f,p;(p=(f=this.pin._wrapper)==null?void 0:f.parentNode)==null||p.removeChild(this.pin._wrapper)}}this.pin=new r(this)}setCoordinate(n){this._latLng=new google.maps.LatLng(n.latitude,n.longitude),this.pin.draw()}setMap(n,r){var d;const l=(d=n==null?void 0:n.getProviderMap())==null?void 0:d.map;this.pin.setMap(l??null)}}const Of="GoogleMapsCallback_b7d77ff2",wN="https://maps.googleapis.com/maps/api/js";function ON(e,t,n,{autocomplete:r=!1,channel:l=window.location.hostname,client:d,language:f,region:p,libraries:_=[],loading:T="async",params:E={}}={}){window[Of]=e,r&&_.push("geocoder","places");const S={callback:Of,channel:l,libraries:_.join(","),...E};n&&(S.key=n),d&&(S.client=d),f&&(S.language=f),p&&(S.region=p),T&&(S.loading=T),hp(wN+"?"+Object.entries(S).map(([w,M])=>w+"="+M).join("&"))}const mp=new lo().withLoadFunction(ON).withMapClass(vN).withPinClass(SN).withProviderName("Google").build();class no{constructor(t,n){Ie(this,"_ne");Ie(this,"_sw");this._ne=new dn(n),this._sw=new dn(t)}static fit(t){const n=t.map(T=>T.latitude),r=Math.max(...n),l=Math.min(...n),d=t.map(T=>T.normalLon).sort((T,E)=>T-E),f=d.map((T,E)=>({distance:(E<d.length-1?d[E+1]:d[0]+360)-T,index:E})).reduce((T,E)=>E.distance>T.distance?E:T).index,p=d[f],_=d[(f+1)%d.length];return new this(new dn(l,_),new dn(r,p))}get ne(){return this._ne}set ne(t){this._ne=new dn(t)}get sw(){return this._sw}set sw(t){this._sw=new dn(t)}contains(t){const n=this._sw.latitude<=t.latitude&&t.latitude<=this._ne.latitude,r=this._ne.longitude-this._sw.longitude>=360,l=this._sw.normalLon<=this._ne.normalLon?this._sw.normalLon<=t.normalLon&&t.normalLon<=this._ne.normalLon:this._sw.normalLon<=t.normalLon||t.normalLon<=this._ne.normalLon;return n&&(r||l)}extend(t){if(this._ne.latitude=Math.max(this._ne.latitude,t.latitude),this._sw.latitude=Math.min(this._sw.latitude,t.latitude),!this.contains(t)){const n=((t.longitude-this._ne.longitude)%360+360)%360,r=((this._sw.longitude-t.longitude)%360+360)%360;n<r?this._ne.longitude+=n:this._sw.longitude-=r}}getCenter(t=Gr.SPHERICAL){const n=new dn(this._ne.latitude,this._sw.longitude),r=this._sw.distanceTo(n,Nn.DEGREE,t),l=(n.longitude+this._ne.longitude)/2+(this._ne.longitude<n.longitude?180:0);return n.add(-r/2,0,Nn.DEGREE,t),n.longitude=l,n}}class DN{constructor(){Ie(this,"_anchorX");Ie(this,"_anchorY");Ie(this,"_height");Ie(this,"_icon");Ie(this,"_srText");Ie(this,"_width");Ie(this,"_zIndex");Ie(this,"_class");Ie(this,"_element");this._anchorX=.5,this._anchorY=1,this._height=39,this._icon="default",this._srText="map pin",this._width=33,this._zIndex=0,this._class="",this._element=null}getAnchorX(){return this._anchorX}getAnchorY(){return this._anchorY}getClass(){return this._class}getElement(){return this._element}getHeight(){return this._height}getIcon(){return this._icon}getSRText(){return this._srText}getWidth(){return this._width}getZIndex(){return this._zIndex}setAnchorX(t){return this._anchorX=t,this}setAnchorY(t){return this._anchorY=t,this}setClass(t){return this._class=t,this}setElement(t){return this._element=t,this}setHeight(t){return this._height=t,this}setIcon(t){return this._icon=t,this}setSRText(t){return this._srText=t,this}setWidth(t){return this._width=t,this}setZIndex(t){return this._zIndex=t,this}}class hd{constructor(){Ie(this,"coordinate");Ie(this,"hideOffscreen");Ie(this,"icons");Ie(this,"propertiesForStatus");Ie(this,"provider");Ie(this,"type");Ie(this,"hasPinUrl");this.coordinate=new dn(0,0),this.hideOffscreen=!1,this.icons={},this.propertiesForStatus=t=>new DN,this.provider=null,this.type="",this.hasPinUrl=!1}withCoordinate(t){return this.coordinate=new dn(t),this}withHideOffscreen(t){return this.hideOffscreen=t,this}withIcon(t,n){return this.icons[t]=n,this}withPropertiesForStatus(t){return kr(t,Sr.FUNCTION),this.propertiesForStatus=t,this}withProvider(t){return t&&(wr(t,ao),this.provider=t),this}withHasPinUrl(t){return this.hasPinUrl=t,this}withType(t){return this.type=t,this}build(){return new AN(this)}}class AN{constructor(t){Ie(this,"_coordinate");Ie(this,"_hideOffscreen");Ie(this,"_icons");Ie(this,"_propertiesForStatus");Ie(this,"_type");Ie(this,"_clickHandler");Ie(this,"_focusHandler");Ie(this,"_hoverHandler");Ie(this,"_hidden");Ie(this,"_cancelHiddenUpdater");Ie(this,"_map");Ie(this,"_pin");Ie(this,"_status");var n,r;if(wr(t,hd),t.provider&&wr(t.provider,ao),!((n=t.provider)!=null&&n.loaded))throw new Error(`MapProvider '${(r=t.provider)==null?void 0:r.getProviderName()}' is not loaded. The MapProvider must be loaded before calling MapPin constructor.`);this._coordinate=t.coordinate,this._hideOffscreen=t.hideOffscreen,this._icons={...t.icons},this._propertiesForStatus=t.propertiesForStatus,this._type=t.type,this._clickHandler=()=>null,this._focusHandler=l=>this._hoverHandler(l),this._hoverHandler=l=>null,this._hidden=!1,this._cancelHiddenUpdater=()=>null,this._map=null,this._pin=new pp(t.provider).withIcons({...this._icons}).withClickHandler(()=>this._clickHandler()).withFocusHandler(l=>this._focusHandler(l)).withHoverHandler(l=>this._hoverHandler(l)).withHasPinUrl(t.hasPinUrl).build(),this._pin.setCoordinate(t.coordinate),this._status={},this.setStatus(this._status)}getCoordinate(){return this._coordinate}getIcon(t){return this._icons[t]}getMap(){return this._map}getProviderPin(){return this._pin}getType(){return this._type}remove(){this.setMap(null)}setClickHandler(t){kr(t,Sr.FUNCTION),this._clickHandler=t}setCoordinate(t){this._coordinate=new dn(t),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(t){kr(t,Sr.FUNCTION),this._focusHandler=t}setHoverHandler(t){kr(t,Sr.FUNCTION),this._hoverHandler=t}setMap(t){if(t!==this._map&&(t!==null&&wr(t,yp),this._pin.setMap(t,this._hidden?null:this._map),this._map=t,this._hidden=!1,this._cancelHiddenUpdater(),t&&this._hideOffscreen)){let n=!1;const r=new Promise(l=>{this._cancelHiddenUpdater=()=>{n=!0,l()}});(async()=>{for(;!n;)this._hideIfOffscreen(),await Promise.race([r,t.moving()]),await Promise.race([r,t.idle()])})()}}setStatus(t){Object.assign(this._status,t),this._pin.setProperties(this._propertiesForStatus(this._status))}_hideIfOffscreen(){if(this._map){const t=this._map.getBounds().contains(this._coordinate);this._hidden&&t?this._pin.setMap(this._map,null):!this._hidden&&!t&&this._pin.setMap(null,this._map),this._hidden=!t}}}const _s=.98;function Va(e,t){return Math.max(e instanceof Function?e():e||0,0)/t}class _p{constructor(){Ie(this,"controlEnabled");Ie(this,"defaultCenter");Ie(this,"defaultZoom");Ie(this,"legendPins");Ie(this,"padding");Ie(this,"panHandler");Ie(this,"panStartHandler");Ie(this,"provider");Ie(this,"providerOptions");Ie(this,"singlePinZoom");Ie(this,"wrapper");this.controlEnabled=!0,this.defaultCenter=new dn(39.83,-98.58),this.defaultZoom=4,this.legendPins=[],this.padding={bottom:()=>50,left:()=>50,right:()=>50,top:()=>50},this.panHandler=(t,n)=>null,this.panStartHandler=t=>null,this.provider=null,this.providerOptions={},this.singlePinZoom=14,this.wrapper=null}withControlEnabled(t){return this.controlEnabled=t,this}withDefaultCenter(t){return this.defaultCenter=new dn(t),this}withDefaultZoom(t){return this.defaultZoom=t,this}withLegendPins(t){return this.legendPins=Array.from(t),this}withPadding(t){return this.padding=t,this}withPanHandler(t){return kr(t,Sr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return kr(t,Sr.FUNCTION),this.panStartHandler=t,this}withProvider(t){return wr(t,ao),this.provider=t,this}withProviderOptions(t){return this.providerOptions=t,this}withSinglePinZoom(t){return this.singlePinZoom=t,this}withWrapper(t){return t?(wr(t,HTMLElement),this.wrapper=t,this):this}build(){return new yp(this)}}let yp=class{constructor(t){Ie(this,"_defaultCenter");Ie(this,"_defaultZoom");Ie(this,"_legendPins");Ie(this,"_padding");Ie(this,"_provider");Ie(this,"_singlePinZoom");Ie(this,"_wrapper");Ie(this,"_cachedBounds");Ie(this,"_resolveIdle");Ie(this,"_resolveMoving");Ie(this,"_idlePromise");Ie(this,"_panHandlerRunning");Ie(this,"_panStartHandlerRunning");Ie(this,"_currentBounds");Ie(this,"_movingPromise");Ie(this,"_panHandler");Ie(this,"_panStartHandler");Ie(this,"_map");var n,r,l;if(wr(t,_p),t.provider&&wr(t.provider,ao),t.wrapper&&wr(t.wrapper,HTMLElement),!((n=t.provider)!=null&&n.loaded))throw new Error(`MapProvider '${(r=t.provider)==null?void 0:r.getProviderName()}' is not loaded. The MapProvider must be loaded before calling Map constructor.`);for(this._defaultCenter=t.defaultCenter,this._defaultZoom=t.defaultZoom,this._legendPins=t.legendPins,this._provider=t.provider,this._singlePinZoom=t.singlePinZoom,this._wrapper=t.wrapper,this._padding={},this.setPadding(t.padding),this._cachedBounds=null,this._resolveIdle=()=>null,this._resolveMoving=()=>null,this._idlePromise=Promise.resolve(),this._setIdle(),this.setPanHandler(t.panHandler),this.setPanStartHandler(t.panStartHandler);(l=this._wrapper)!=null&&l.lastChild;)this._wrapper.removeChild(this._wrapper.lastChild);this._panHandlerRunning=!1,this._panStartHandlerRunning=!1,this._map=new gp(t.provider,this._wrapper).withControlEnabled(t.controlEnabled).withPanHandler(()=>this.panHandler()).withPanStartHandler(()=>this.panStartHandler()).withProviderOptions(t.providerOptions).build(),this.setZoomCenter(this._defaultZoom,this._defaultCenter),this._currentBounds=this.getBounds()}fitCoordinates(t,n=!1,r=this._singlePinZoom){t.length?this.setBounds(no.fit(t),n,this._padding,r):this.setZoomCenter(this._defaultZoom,this._defaultCenter,n)}getBounds(){var t,n;if(!this._cachedBounds){const r=((t=this._wrapper)==null?void 0:t.offsetHeight)??0,l=((n=this._wrapper)==null?void 0:n.offsetWidth)??0,d=this.getZoom(),f=this.getCenter(),p=360/Math.pow(2,d+8),_=l*p,T=r*p;this._cachedBounds=new no(f,f),this._cachedBounds.ne.add(T/2,_/2,Nn.DEGREE,Gr.MERCATOR),this._cachedBounds.sw.add(-T/2,-_/2,Nn.DEGREE,Gr.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new no(this._cachedBounds.sw,this._cachedBounds.ne)}getCenter(){return this._map.getCenter()}getProviderMap(){return this._map}getZoom(){return this._map.getZoom()}async idle(){await this._idlePromise}async moving(){await this._movingPromise}newPinOptions(){return new hd().withProvider(this._provider)}panHandler(){this._panHandlerRunning||(this._panHandlerRunning=!0,requestAnimationFrame(()=>{const t=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler&&this._panHandler(t,new no(new dn(this._currentBounds.sw),new dn(this._currentBounds.ne))),this._panHandlerRunning=!1}),this._setIdle())}panStartHandler(){this._panStartHandlerRunning||(this._panStartHandlerRunning=!0,requestAnimationFrame(()=>{this._panStartHandler&&this._panStartHandler(new no(new dn(this._currentBounds.sw),new dn(this._currentBounds.ne))),this._panStartHandlerRunning=!1}),this._setMoving())}setBounds({ne:t,sw:n},r=!1,l={},d=1/0){var z,q;const f=(z=this._wrapper)==null?void 0:z.offsetHeight,p=(q=this._wrapper)==null?void 0:q.offsetWidth;if(!f||!p)return;let _=Va(l.bottom,f),T=Va(l.left,p),E=Va(l.right,p),S=Va(l.top,f),w=T+E,M=_+S;w>_s&&(T*=_s/w,E*=_s/w,w=_s),M>_s&&(_*=_s/M,S*=_s/M,M=_s);const m=f*(1-M),v=p*(1-w),k=new no(n,t),G=new dn(k.ne.latitude,k.sw.longitude),I=k.sw.distanceTo(G,Nn.DEGREE,Gr.MERCATOR),P=(k.ne.longitude-G.longitude+360)%360;let H=Math.max(I,P*m/v)/(1-M),j=Math.max(P,I*v/m)/(1-w),re=Math.log2(p*360/j)-8;re>d&&(re=d,j=p*360/2**(re+8),H=j*f/p);const te=k.getCenter(Gr.MERCATOR),ce=(S-_)/2*H,V=(E-T)/2*j;te.add(ce,V,Nn.DEGREE,Gr.MERCATOR),this.setZoomCenter(re,te,r)}setCenter(t,n=!1){this._map.setCenter(new dn(t),n)}setPadding({bottom:t=this._padding.bottom,left:n=this._padding.left,right:r=this._padding.right,top:l=this._padding.top}){return this._padding={bottom:t,left:n,right:r,top:l},this}setPanHandler(t){kr(t,Sr.FUNCTION),this._panHandler=t}setPanStartHandler(t){kr(t,Sr.FUNCTION),this._panStartHandler=t}setZoom(t,n=!1){this._map.setZoom(t,n)}setZoomCenter(t,n,r=!1){this._map.setZoomCenter(t,n,r)}_setIdle(){this._resolveMoving(),this._movingPromise=new Promise(t=>this._resolveMoving=t),this._resolveIdle()}_setMoving(){this._resolveIdle(),this._idlePromise=new Promise(t=>this._resolveIdle=t),this._resolveMoving()}};const _c=nt.createContext(null);function MN(){const e=nt.useContext(_c);if(!e||e.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return e.map}const Np=({apiKey:e,bounds:t,children:n,className:r,clientKey:l,controls:d=!0,defaultCenter:f={latitude:39.83,longitude:-98.58},defaultZoom:p=4,mapRef:_,padding:T={bottom:50,left:50,right:50,top:50},panHandler:E=()=>null,panStartHandler:S=()=>null,provider:w=mp,providerOptions:M={},singleZoom:m=14})=>{const v=nt.useRef(null),[k,G]=nt.useState(new dn(f)),[I,P]=nt.useState(!1),[H,j]=nt.useState(),[re,te]=nt.useState(p),ce=(V,z)=>{E(V,z),z&&G(z.getCenter())};return nt.useEffect(()=>{!I||!H||te(H.getZoom())},[k]),nt.useEffect(()=>{if(!t||!I||!H)return;const V=t.map(z=>new dn(z));H.fitCoordinates(V)},[JSON.stringify(t),H]),nt.useEffect(()=>{if(!I||H)return;const V=new _p().withControlEnabled(d).withDefaultCenter(k).withDefaultZoom(re).withPadding(T).withPanHandler(ce).withPanStartHandler(S).withProvider(w).withProviderOptions(M).withSinglePinZoom(m).withWrapper(v.current).build();j(V),_&&(_.current=V)},[I]),nt.useEffect(()=>{I||H||!v.current||w.load(e,{...M,...l&&{client:l}}).then(()=>P(!0))},[]),at.jsx("div",{className:Qo({"is-loaded":I},r),id:"map",ref:v,"data-testid":"map",children:H&&at.jsx(_c.Provider,{value:{map:H,provider:w},children:n})})},RN=({count:e})=>at.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",children:at.jsxs("g",{fill:"none",fillRule:"evenodd",children:[at.jsx("circle",{fill:"red",fillRule:"nonzero",stroke:"white",cx:"11",cy:"11",r:"11"}),at.jsx("text",{fill:"white",fontFamily:"Arial-BoldMT,Arial",fontSize:"12",fontWeight:"bold",children:at.jsx("tspan",{x:"50%",y:"15",textAnchor:"middle",children:e})})]})}),gd=nt.createContext(null);function bN(){const e=nt.useContext(gd);if(!e)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return e}const LN=({clusterRadius:e=50,children:t,ClusterTemplate:n=RN})=>{const{map:r}=nt.useContext(_c),[l,d]=nt.useState([]),[f,p]=nt.useState(),[_,T]=nt.useState([]),[E,S]=nt.useState([]);return nt.useEffect(()=>{p(IN(l,r.getZoom(),e))},[l,r.getZoom()]),nt.useEffect(()=>{S(()=>[]),T(()=>[]),(f==null?void 0:f.length)!==0&&(f==null||f.forEach(w=>{if(w.length===1){w[0].pin.setMap(r);return}if(w.length>1){const M=no.fit(w.map(v=>v.pin.getCoordinate())).getCenter(Gr.MERCATOR),m=`cluster-{${M._lat},${M._lon}}`;w.forEach(v=>v.pin.setMap(null)),T(v=>[...v,m]),S(v=>[...v,at.jsx(pd,{coordinate:M,id:m,onClick:()=>r.fitCoordinates(w.map(k=>k.pin.getCoordinate()),!0,1/0),children:at.jsx(n,{count:w.length})},m)])}}))},[f]),at.jsx(gd.Provider,{value:{clusters:f??[],clusterIds:_,setPinStore:d},children:at.jsxs(at.Fragment,{children:[E.map((w,M)=>at.jsx(nt.Fragment,{children:w},M)),t]})})},IN=(e,t,n)=>{const r=n*Math.PI/2**(t+7),l=e.map((p,_)=>[_]),d=[];e.forEach((p,_)=>{for(let T=_;T<e.length;T++)T!==_&&new dn(p.pin.getCoordinate()).distanceTo(new dn(e[T].pin.getCoordinate()),Nn.RADIAN,Gr.MERCATOR)<=r&&(l[_].push(T),l[T].push(_))});let f=1;for(;f;){f=0;let p;if(l.forEach((E,S)=>{E.length>f&&(f=E.length,p=S)}),!f)break;const _=l[p??0],T=[];l[p??0]=[];for(const E of _){const S=l[E];T.push(e[E]),l[E]=[],S.forEach(w=>l[w].splice(l[w].indexOf(E),1))}d.push(T)}return d},kN=at.jsx("svg",{width:"30",height:"38",viewBox:"0 0 30 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:at.jsx("path",{d:"M30 15.0882C30 23.4212 23.3333 30.7353 15 38C7.22222 31.2941 0 23.4212 0 15.0882C0 6.75523 6.71573 0 15 0C23.2843 0 30 6.75523 30 15.0882Z",fill:"red"})}),pd=({children:e,coordinate:t,hideOffscreen:n=!1,id:r,icon:l=kN,onClick:d=()=>null,onFocus:f=()=>null,onHover:p=()=>null,zIndex:_,hasPinUrl:T=!1})=>{const{map:E,provider:S}=nt.useContext(_c),w=nt.useContext(gd),M=nt.useMemo(()=>new hd().withCoordinate(t).withHideOffscreen(n).withProvider(S).withHasPinUrl(T).build(),[]);nt.useEffect(()=>{if(_!==0&&!_)return;const v=M.getProviderPin().getWrapperElement();v&&(v.style.zIndex=_.toString())},[_]),nt.useEffect(()=>{M.setMap(E),M.setClickHandler(()=>d(r)),M.setFocusHandler(k=>f(k,r)),M.setHoverHandler(k=>p(k,r));const v=w==null?void 0:w.clusterIds.includes(r);return w&&!v&&w.setPinStore(k=>[...k,{pin:M,id:r}]),()=>{M.setMap(null),w&&w.setPinStore(k=>k.filter(G=>G.id!==r))}},[]);const m=e||l;if(m){const v=M.getProviderPin().getPinElement();return Object.assign(v.style,{height:"auto",width:"auto"}),ld.createPortal(m,v)}return null},PN=({children:e,coordinate:t,linkSameTab:n,pinUrl:r,onClick:l=()=>null,onHover:d=()=>null,onFocus:f=()=>null,...p})=>{var _;return at.jsx(Np,{bounds:[t],...p,children:at.jsx(pd,{coordinate:t,id:"location-map-marker",onClick:l,onHover:d,onFocus:f,hasPinUrl:((_=r||"")==null?void 0:_.length)>0,children:r?at.jsx(fp,{href:r,target:n?"_self":"_blank","aria-label":"map-marker",children:e}):e||void 0})})};var qc={},Vl={},Df;function $N(){if(Df)return Vl;Df=1;var e=nt;const t=e.createContext(null);function n(l,d){let f=null;l!=null&&(f=l[1]);function p(){return d??(f!=null?f.getTheme():null)}return{getTheme:p}}function r(){const l=e.useContext(t);if(l==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return l}return Vl.LexicalComposerContext=t,Vl.createLexicalComposerContext=n,Vl.useLexicalComposerContext=r,Vl}var ql={},Af;function FN(){if(Af)return ql;Af=1;var e=nt;function t(r){let l=new URLSearchParams;l.append("code",r);for(let d=1;d<arguments.length;d++)l.append("v",arguments[d]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${l} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let n=e.createContext(null);return ql.LexicalComposerContext=n,ql.createLexicalComposerContext=function(r,l){let d=null;return r!=null&&(d=r[1]),{getTheme:function(){return l??(d!=null?d.getTheme():null)}}},ql.useLexicalComposerContext=function(){let r=e.useContext(n);return r==null&&t(8),r},ql}var Zc,Mf;function qn(){return Mf||(Mf=1,Zc=process.env.NODE_ENV==="development"?$N():FN()),Zc}var He={},Rf;function BN(){if(Rf)return He;Rf=1;function e(u){return{type:u}}const t=e("SELECTION_CHANGE_COMMAND"),n=e("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),r=e("CLICK_COMMAND"),l=e("DELETE_CHARACTER_COMMAND"),d=e("INSERT_LINE_BREAK_COMMAND"),f=e("INSERT_PARAGRAPH_COMMAND"),p=e("CONTROLLED_TEXT_INSERTION_COMMAND"),_=e("PASTE_COMMAND"),T=e("REMOVE_TEXT_COMMAND"),E=e("DELETE_WORD_COMMAND"),S=e("DELETE_LINE_COMMAND"),w=e("FORMAT_TEXT_COMMAND"),M=e("UNDO_COMMAND"),m=e("REDO_COMMAND"),v=e("KEYDOWN_COMMAND"),k=e("KEY_ARROW_RIGHT_COMMAND"),G=e("MOVE_TO_END"),I=e("KEY_ARROW_LEFT_COMMAND"),P=e("MOVE_TO_START"),H=e("KEY_ARROW_UP_COMMAND"),j=e("KEY_ARROW_DOWN_COMMAND"),re=e("KEY_ENTER_COMMAND"),te=e("KEY_SPACE_COMMAND"),ce=e("KEY_BACKSPACE_COMMAND"),V=e("KEY_ESCAPE_COMMAND"),z=e("KEY_DELETE_COMMAND"),q=e("KEY_TAB_COMMAND"),Te=e("INSERT_TAB_COMMAND"),Se=e("INDENT_CONTENT_COMMAND"),Ee=e("OUTDENT_CONTENT_COMMAND"),de=e("DROP_COMMAND"),K=e("FORMAT_ELEMENT_COMMAND"),O=e("DRAGSTART_COMMAND"),Z=e("DRAGOVER_COMMAND"),oe=e("DRAGEND_COMMAND"),Y=e("COPY_COMMAND"),W=e("CUT_COMMAND"),J=e("SELECT_ALL_COMMAND"),R=e("CLEAR_EDITOR_COMMAND"),U=e("CLEAR_HISTORY_COMMAND"),X=e("CAN_REDO_COMMAND"),fe=e("CAN_UNDO_COMMAND"),_e=e("FOCUS_COMMAND"),B=e("BLUR_COMMAND"),A=e("KEY_MODIFIER_COMMAND"),F=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",se=F&&"documentMode"in document?document.documentMode:null,ye=F&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),De=F&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ee=F&&"InputEvent"in window&&!se?"getTargetRanges"in new window.InputEvent("input"):!1,ne=F&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ue=F&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,be=F&&/Android/.test(navigator.userAgent),Ne=F&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Re=F&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ne,ke=1,Fe=3,qe=0,Be=1,ut=2,At=0,Ut=1,en=2,Oe=1,ie=2,le=4,ve=8,Le=16,Me=32,je=64,rt=128,it=Oe|ie|le|ve|Le|Me|je|rt,st=1,vt=2,Ge=1,ze=2,tt=3,yt=4,Nt=5,Et=6,gt=" ",mt=ne||ue||Re?gt:"",$t=`
|
|
36
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var d="",f=0;f<arguments.length;f++){var p=arguments[f];p&&(d=l(d,r(p)))}return d}function r(d){if(typeof d=="string"||typeof d=="number")return d;if(typeof d!="object")return"";if(Array.isArray(d))return n.apply(null,d);if(d.toString!==Object.prototype.toString&&!d.toString.toString().includes("[native code]"))return d.toString();var f="";for(var p in d)t.call(d,p)&&d[p]&&(f=l(f,p));return f}function l(d,f){return f?d?d+" "+f:d+f:d}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(gp);var uN=gp.exports;const lo=hd(uN),dN="phonecall",fN="drivingdirection",Of="calltoactionclick",hN="clicktowebsite",gN="other",Df="link",pN="cta",mN=e=>{const t=e.cta??{link:e.href};if(!t.link)throw e.cta?new Error("CTA's link is undefined"):new Error("Link's href is undefined");return t.linkType||(t.linkType=NN(t.link)),t.link=CN(t),t},_N=(e,t)=>{switch(e.linkType){case"EMAIL":return"CTA_CLICK";case"PHONE":return"TAP_TO_CALL";case"CLICK_TO_WEBSITE":return"WEBSITE";case"DRIVING_DIRECTIONS":return"DRIVING_DIRECTIONS";case"OTHER":return"CTA_CLICK";case"URL":return"LINK";default:return t?"CTA_CLICK":"LINK"}},yN=(e,t,n)=>{if(e)return e;if(t)switch(t){case"PHONE":return dN;case"EMAIL":return Of;case"URL":return Df;case"DRIVING_DIRECTIONS":return fN;case"CLICK_TO_WEBSITE":return hN;case"OTHER":return gN;default:return n?Of:Df}return pN},NN=e=>EN(e)?"EMAIL":e.startsWith("tel:")?"PHONE":"URL",CN=e=>e.linkType==="EMAIL"?e.link.startsWith("mailto:")?e.link:`mailto:${e.link}`:e.linkType==="PHONE"?e.link.startsWith("tel:")?e.link:`tel:${e.link}`:e.link,EN=e=>e.startsWith("mailto:")?!0:/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(e),pp=rt.forwardRef(function(t,n){const{children:r,onClick:l,className:d,eventName:f,scope:p,currency:_,amount:E,cta:T,obfuscate:S,customTags:w,customValues:O,...m}=t,v=mN(t),I=_N(v,!!T),G=yN(f,v.linkType,!!T),k=nl(),P=S||S!==!1&&v.linkType==="EMAIL",H=async te=>{const ce=te.currentTarget;let V="";if(P){te.preventDefault();const z=ce.href.split("/").at(-1);z&&(V=atob(z))}if(k!==null)try{await k.track({action:I,scope:p,eventName:G,currency:_,amount:E,destinationUrl:V||ce.href,customTags:w,customValues:O})}catch{console.error("Failed to report click Analytics Event")}l&&l(te),V&&(window.location.href=V)},j=P?"Obfuscated, set a label or child":v.link,re={className:lo("Link",d),href:P?btoa(v.link):v.link,onClick:H,rel:t.target&&!t.rel?"noopener":void 0,ref:n};return k!=null&&k.getDebugEnabled()&&(re["data-ya-action"]=I,re["data-ya-scopeoverride"]=p,re["data-ya-eventname"]=G),nt.jsx("a",{...m,...re,suppressHydrationWarning:!0,children:r||v.label||j})});var Nn=(e=>(e.DEGREE="deg",e.KILOMETER="km",e.MILE="mi",e.RADIAN="r",e))(Nn||{}),Gr=(e=>(e.MERCATOR="mercator",e.SPHERICAL="spherical",e))(Gr||{});const Zc=3959,Jc=6371,TN=["latitude","lat"],xN=["longitude","lon","lng","long"];function Af(e,t){for(const n of t)if(e[n]||e[n]===0)return e[n]}function Mf(e){switch(typeof e){case"string":case"number":const t=Number.parseFloat(e);if(Number.isNaN(t))throw new Error(`'${e}' must be convertible to a Number'`);return t;default:throw new Error(`typeof '${e}' must be a number or a string that can be converted to a number, is '${typeof e}'`)}}function ro(e){return e*Math.PI/180}function Zi(e){return e/Math.PI*180}function vN(e,t){const n=ro(e.latitude),r=ro(t.latitude),l=r-n,d=ro(t.longitude-e.longitude),f=Math.pow(Math.sin(l/2),2)+Math.cos(n)*Math.cos(r)*Math.pow(Math.sin(d/2),2);return 2*Math.atan2(Math.sqrt(f),Math.sqrt(1-f))}function SN(e,t){const n=Math.tan(Math.PI/360*(e+90)),r=Math.tan(Math.PI/360*(t+90));return Math.log(r/n)}function wN(e,t){const r=Math.tan(Math.PI/360*(e+90))*Math.pow(Math.E,t);return Math.atan(r)*360/Math.PI-90}class dn{constructor(t,n){Ie(this,"_lat");Ie(this,"_lon");let r=t,l=n;this._lat=0,this._lon=0,typeof t=="object"?(r=Af(t,TN)??0,l=Af(t,xN)??0,this.latitude=typeof r=="function"?r():r,this.longitude=typeof l=="function"?l():l):typeof r=="number"&&typeof l=="number"&&(this.latitude=r,this.longitude=l)}get latitude(){return this._lat}set latitude(t){this._lat=Math.max(-90,Math.min(Mf(t),90))}get longitude(){return this._lon}set longitude(t){this._lon=Mf(t)}get normalLon(){return((this._lon+180)%360+360)%360-180}add(t,n,r=Nn.DEGREE,l=Gr.SPHERICAL){if(l===Gr.MERCATOR&&(r===Nn.DEGREE||r===Nn.RADIAN)){const d=r===Nn.DEGREE?ro(t):t,f=r===Nn.DEGREE?n:Zi(n);this.latitude=wN(this.latitude,d),this.longitude+=f}else switch(r){case Nn.DEGREE:this.latitude+=t,this.longitude+=n;break;case Nn.KILOMETER:this.latitude+=Zi(t)*Jc,this.longitude+=Zi(n)*Jc*Math.cos(ro(this.latitude));break;case Nn.MILE:this.latitude+=Zi(t)*Zc,this.longitude+=Zi(n)*Zc*Math.cos(ro(this.latitude));break;case Nn.RADIAN:this.latitude+=Zi(t),this.longitude+=Zi(n);break;default:throw new Error(`unit unhandled: ${String(r)}`)}}distanceTo(t,n=Nn.MILE,r=Gr.SPHERICAL){if(r===Gr.MERCATOR&&(n===Nn.DEGREE||n===Nn.RADIAN)){const l=SN(this.latitude,t.latitude),d=Math.abs(t.normalLon-this.normalLon),f=ro(Math.min(d,360-d)),p=Math.sqrt(Math.pow(l,2)+Math.pow(f,2));switch(n){case Nn.DEGREE:return Zi(p);case Nn.RADIAN:return p;default:throw new Error(`unit unhandled: ${String(n)}`)}}else{const l=vN(this,t);switch(n){case Nn.DEGREE:return Zi(l);case Nn.KILOMETER:return l*Jc;case Nn.MILE:return l*Zc;case Nn.RADIAN:return l;default:throw new Error(`unit unhandled: ${String(n)}`)}}}equals(t){return t&&t.latitude===this.latitude&&t.longitude===this.longitude}searchQueryString(){return`${this.latitude},${this.longitude}`}}function mp(e,t=()=>null){const n=document.createElement("script");n.async=!0,n.onload=t,n.src=e,document.head.appendChild(n)}var Sr=(e=>(e.UNDEFINED="undefined",e.NULL="object",e.BOOLEAN="boolean",e.NUMBER="number",e.BIGINT="bigint",e.STRING="string",e.SYMBOL="symbol",e.FUNCTION="function",e.OBJECT="object",e))(Sr||{});function kr(e,t){if(typeof t!="string")throw new Error("Assertion error: 'type' must be a string");if(typeof e!==t)throw new Error(`Expected an object of type '${t}' but received '${typeof e}'`)}function wr(e,t){let n;try{n=e instanceof t}catch{throw new Error("Assertion error: 'instanceClass' is not a valid constructor")}if(!n)throw new Error(`Expected an instance of '${t.name}' but received '${e.constructor.name}'`)}class _p{constructor(t,n){Ie(this,"providerMapClass");Ie(this,"wrapper");Ie(this,"controlEnabled");Ie(this,"panHandler");Ie(this,"panStartHandler");Ie(this,"providerOptions");wr(t,co),n&&wr(n,HTMLElement),this.providerMapClass=t.getMapClass(),this.wrapper=n,this.controlEnabled=!0,this.panHandler=()=>null,this.panStartHandler=()=>null,this.providerOptions={}}withControlEnabled(t){return this.controlEnabled=t,this}withPanHandler(t){return kr(t,Sr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return kr(t,Sr.FUNCTION),this.panStartHandler=t,this}withProviderOptions(t){return this.providerOptions=t,this}build(){const t=this.providerMapClass;return new t(this)}}class rl{constructor(t){Ie(this,"_panHandler");Ie(this,"_panStartHandler");wr(t,_p),this._panHandler=t.panHandler,this._panStartHandler=t.panStartHandler}getCenter(){throw new Error("not implemented")}getZoom(){throw new Error("not implemented")}setCenter(t,n){throw new Error("not implemented")}setZoom(t,n){throw new Error("not implemented")}setZoomCenter(t,n,r){this.setZoom(t,r),this.setCenter(n,r)}}class yp{constructor(t){Ie(this,"providerPinClass");Ie(this,"clickHandler");Ie(this,"focusHandler");Ie(this,"hoverHandler");Ie(this,"icons");Ie(this,"hasPinUrl");wr(t,co),this.providerPinClass=t.getPinClass(),this.clickHandler=()=>null,this.focusHandler=n=>null,this.hoverHandler=n=>null,this.icons={},this.hasPinUrl=!1}withClickHandler(t){return kr(t,Sr.FUNCTION),this.clickHandler=t,this}withFocusHandler(t){return kr(t,Sr.FUNCTION),this.focusHandler=t,this}withHoverHandler(t){return kr(t,Sr.FUNCTION),this.hoverHandler=t,this}withIcons(t){return this.icons=t,this}withHasPinUrl(t){return this.hasPinUrl=t,this}build(){const t=this.providerPinClass;return new t(this)}}class _d{constructor(t){Ie(this,"_clickHandler");Ie(this,"_focusHandler");Ie(this,"_hoverHandler");Ie(this,"_icons");wr(t,yp),this._clickHandler=t.clickHandler,this._focusHandler=t.focusHandler,this._hoverHandler=t.hoverHandler,this._icons=t.icons}setCoordinate(t){throw new Error("not implemented")}setMap(t,n){throw new Error("not implemented")}setProperties(t){throw new Error("not implemented")}}const ON=Object.freeze({backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundSize:"contain",left:"0",outline:"none",pointerEvents:"auto",position:"absolute",top:"0"});class il extends _d{constructor(n){super(n);Ie(this,"_pinEl");Ie(this,"_pinAlt");Ie(this,"_wrapper");this._pinEl=n.hasPinUrl?document.createElement("div"):document.createElement("button"),Object.assign(this._pinEl.style,il.baseStyle),this._pinAlt=document.createElement("span"),this._pinAlt.classList.add("sr-only"),this._pinEl.appendChild(this._pinAlt),this._wrapper=document.createElement("div"),this._wrapper.style.pointerEvents="none",this._wrapper.appendChild(this._pinEl),this.addListeners()}static get baseStyle(){return ON}addListeners(){this._wrapper&&(this._wrapper.addEventListener("click",()=>this._clickHandler()),this._wrapper.addEventListener("focusin",()=>this._focusHandler(!0)),this._wrapper.addEventListener("focusout",()=>this._focusHandler(!1)),this._wrapper.addEventListener("mouseover",()=>this._hoverHandler(!0)),this._wrapper.addEventListener("mouseout",()=>this._hoverHandler(!1)))}getPinElement(){return this._pinEl}getWrapperElement(){return this._wrapper}setProperties(n){this.setElementProperties(n);const r=n.getClass(),l=n.getElement()||this._pinEl,d=n.getZIndex();l.style.pointerEvents="auto",this._wrapper&&(this._wrapper.style.zIndex=d.toString(),this._wrapper.setAttribute("class",r),l!==this._wrapper.children[0]&&(this._wrapper.children[0].style.pointerEvents="",this._wrapper.removeChild(this._wrapper.children[0]),this._wrapper.appendChild(l)))}setElementProperties(n){const r=n.getAnchorX(),l=n.getAnchorY(),d=n.getHeight(),f=this._icons[n.getIcon()],p=n.getSRText(),_=n.getWidth();Object.assign(this._pinEl.style,{backgroundImage:f?`url("${f}")`:"",height:d+"px",transform:`translate(${-100*r}%, ${-100*l}%)`,width:_+"px"}),this._pinAlt.innerText=p}}class ao{constructor(){Ie(this,"loadFunction");Ie(this,"mapClass");Ie(this,"pinClass");Ie(this,"providerName");this.loadFunction=(t,n,r,l)=>t(),this.mapClass=rl,this.pinClass=_d,this.providerName=""}withLoadFunction(t){return kr(t,Sr.FUNCTION),this.loadFunction=t,this}withMapClass(t){return this.mapClass=t,this}withPinClass(t){return this.pinClass=t,this}withProviderName(t){return this.providerName=t,this}build(){return new co(this)}}class co{constructor(t){Ie(this,"_loadFunction");Ie(this,"_mapClass");Ie(this,"_pinClass");Ie(this,"_providerName");Ie(this,"_loadPromise");Ie(this,"_resolveLoad");Ie(this,"_rejectLoad");Ie(this,"_apiKey");Ie(this,"_loadInvoked");Ie(this,"_loaded");Ie(this,"_options");wr(t,ao),this._loadFunction=t.loadFunction,this._mapClass=t.mapClass,this._pinClass=t.pinClass,this._providerName=t.providerName,this._loadPromise=new Promise((n,r)=>{this._resolveLoad=n,this._rejectLoad=r}),this._apiKey="",this._loadInvoked=!1,this._loaded=!1,this._options={}}get loaded(){return this._loaded}getMapClass(){return this._mapClass}getPinClass(){return this._pinClass}getProviderName(){return this._providerName}async load(t=this._apiKey,n=this._options){!this._loadInvoked&&this._resolveLoad&&this._rejectLoad&&(this._loadInvoked=!0,this._loadFunction(this._resolveLoad,this._rejectLoad,t,n)),await this.ready(),this._loaded=!0}async ready(){await this._loadPromise}setLoadOptions(t,n=null){this._loadInvoked||(this._apiKey=t,this._options=n||this._options)}}class DN extends rl{constructor(n){super(n);Ie(this,"map");Ie(this,"_moving");n.wrapper&&(this.map=new google.maps.Map(n.wrapper,{disableDefaultUI:!n.controlEnabled,fullscreenControl:!1,gestureHandling:n.controlEnabled?"auto":"none",mapTypeControl:!1,rotateControl:!1,scaleControl:!1,streetViewControl:!1,zoomControl:n.controlEnabled,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},...n.providerOptions}),this._moving=!1,google.maps.event.addListener(this.map,"bounds_changed",()=>{this._moving||(this._moving=!0,this._panStartHandler())}),google.maps.event.addListener(this.map,"idle",()=>{this._moving=!1,this._panHandler()}))}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d,f;const l=new google.maps.LatLng(n.latitude,n.longitude);r?(d=this.map)==null||d.panTo(l):(f=this.map)==null||f.setCenter(l)}setZoom(n,r){var l;(l=this.map)==null||l.setZoom(Math.floor(n))}setZoomCenter(n,r,l){this.setCenter(r,l),this.setZoom(n,l)}}class AN extends il{constructor(n){super(n);Ie(this,"_latLng");Ie(this,"pin");this._wrapper&&(this._wrapper.style.position="absolute",google.maps.OverlayView.preventMapHitsAndGesturesFrom(this._wrapper));class r extends google.maps.OverlayView{constructor(f){super();Ie(this,"pin");this.pin=f}draw(){var p;const f=(p=this.getProjection())==null?void 0:p.fromLatLngToDivPixel(this.pin._latLng??null);f&&this.pin._wrapper&&(this.pin._wrapper.style.left=f.x+"px",this.pin._wrapper.style.top=f.y+"px")}onAdd(){var f;this.pin._wrapper&&((f=this.getPanes())==null||f.floatPane.appendChild(this.pin._wrapper))}onRemove(){var f,p;(p=(f=this.pin._wrapper)==null?void 0:f.parentNode)==null||p.removeChild(this.pin._wrapper)}}this.pin=new r(this)}setCoordinate(n){this._latLng=new google.maps.LatLng(n.latitude,n.longitude),this.pin.draw()}setMap(n,r){var d;const l=(d=n==null?void 0:n.getProviderMap())==null?void 0:d.map;this.pin.setMap(l??null)}}const Rf="GoogleMapsCallback_b7d77ff2",MN="https://maps.googleapis.com/maps/api/js";function RN(e,t,n,{autocomplete:r=!1,channel:l=window.location.hostname,client:d,language:f,region:p,libraries:_=[],loading:E="async",params:T={}}={}){window[Rf]=e,r&&_.push("geocoder","places");const S={callback:Rf,channel:l,libraries:_.join(","),...T};n&&(S.key=n),d&&(S.client=d),f&&(S.language=f),p&&(S.region=p),E&&(S.loading=E),mp(MN+"?"+Object.entries(S).map(([w,O])=>w+"="+O).join("&"))}const Np=new ao().withLoadFunction(RN).withMapClass(DN).withPinClass(AN).withProviderName("Google").build();class to{constructor(t,n){Ie(this,"_ne");Ie(this,"_sw");this._ne=new dn(n),this._sw=new dn(t)}static fit(t){const n=t.map(E=>E.latitude),r=Math.max(...n),l=Math.min(...n),d=t.map(E=>E.normalLon).sort((E,T)=>E-T),f=d.map((E,T)=>({distance:(T<d.length-1?d[T+1]:d[0]+360)-E,index:T})).reduce((E,T)=>T.distance>E.distance?T:E).index,p=d[f],_=d[(f+1)%d.length];return new this(new dn(l,_),new dn(r,p))}get ne(){return this._ne}set ne(t){this._ne=new dn(t)}get sw(){return this._sw}set sw(t){this._sw=new dn(t)}contains(t){const n=this._sw.latitude<=t.latitude&&t.latitude<=this._ne.latitude,r=this._ne.longitude-this._sw.longitude>=360,l=this._sw.normalLon<=this._ne.normalLon?this._sw.normalLon<=t.normalLon&&t.normalLon<=this._ne.normalLon:this._sw.normalLon<=t.normalLon||t.normalLon<=this._ne.normalLon;return n&&(r||l)}extend(t){if(this._ne.latitude=Math.max(this._ne.latitude,t.latitude),this._sw.latitude=Math.min(this._sw.latitude,t.latitude),!this.contains(t)){const n=((t.longitude-this._ne.longitude)%360+360)%360,r=((this._sw.longitude-t.longitude)%360+360)%360;n<r?this._ne.longitude+=n:this._sw.longitude-=r}}getCenter(t=Gr.SPHERICAL){const n=new dn(this._ne.latitude,this._sw.longitude),r=this._sw.distanceTo(n,Nn.DEGREE,t),l=(n.longitude+this._ne.longitude)/2+(this._ne.longitude<n.longitude?180:0);return n.add(-r/2,0,Nn.DEGREE,t),n.longitude=l,n}}class bN{constructor(){Ie(this,"_anchorX");Ie(this,"_anchorY");Ie(this,"_height");Ie(this,"_icon");Ie(this,"_srText");Ie(this,"_width");Ie(this,"_zIndex");Ie(this,"_class");Ie(this,"_element");this._anchorX=.5,this._anchorY=1,this._height=39,this._icon="default",this._srText="map pin",this._width=33,this._zIndex=0,this._class="",this._element=null}getAnchorX(){return this._anchorX}getAnchorY(){return this._anchorY}getClass(){return this._class}getElement(){return this._element}getHeight(){return this._height}getIcon(){return this._icon}getSRText(){return this._srText}getWidth(){return this._width}getZIndex(){return this._zIndex}setAnchorX(t){return this._anchorX=t,this}setAnchorY(t){return this._anchorY=t,this}setClass(t){return this._class=t,this}setElement(t){return this._element=t,this}setHeight(t){return this._height=t,this}setIcon(t){return this._icon=t,this}setSRText(t){return this._srText=t,this}setWidth(t){return this._width=t,this}setZIndex(t){return this._zIndex=t,this}}class yd{constructor(){Ie(this,"coordinate");Ie(this,"hideOffscreen");Ie(this,"icons");Ie(this,"propertiesForStatus");Ie(this,"provider");Ie(this,"type");Ie(this,"hasPinUrl");this.coordinate=new dn(0,0),this.hideOffscreen=!1,this.icons={},this.propertiesForStatus=t=>new bN,this.provider=null,this.type="",this.hasPinUrl=!1}withCoordinate(t){return this.coordinate=new dn(t),this}withHideOffscreen(t){return this.hideOffscreen=t,this}withIcon(t,n){return this.icons[t]=n,this}withPropertiesForStatus(t){return kr(t,Sr.FUNCTION),this.propertiesForStatus=t,this}withProvider(t){return t&&(wr(t,co),this.provider=t),this}withHasPinUrl(t){return this.hasPinUrl=t,this}withType(t){return this.type=t,this}build(){return new LN(this)}}class LN{constructor(t){Ie(this,"_coordinate");Ie(this,"_hideOffscreen");Ie(this,"_icons");Ie(this,"_propertiesForStatus");Ie(this,"_type");Ie(this,"_clickHandler");Ie(this,"_focusHandler");Ie(this,"_hoverHandler");Ie(this,"_hidden");Ie(this,"_cancelHiddenUpdater");Ie(this,"_map");Ie(this,"_pin");Ie(this,"_status");var n,r;if(wr(t,yd),t.provider&&wr(t.provider,co),!((n=t.provider)!=null&&n.loaded))throw new Error(`MapProvider '${(r=t.provider)==null?void 0:r.getProviderName()}' is not loaded. The MapProvider must be loaded before calling MapPin constructor.`);this._coordinate=t.coordinate,this._hideOffscreen=t.hideOffscreen,this._icons={...t.icons},this._propertiesForStatus=t.propertiesForStatus,this._type=t.type,this._clickHandler=()=>null,this._focusHandler=l=>this._hoverHandler(l),this._hoverHandler=l=>null,this._hidden=!1,this._cancelHiddenUpdater=()=>null,this._map=null,this._pin=new yp(t.provider).withIcons({...this._icons}).withClickHandler(()=>this._clickHandler()).withFocusHandler(l=>this._focusHandler(l)).withHoverHandler(l=>this._hoverHandler(l)).withHasPinUrl(t.hasPinUrl).build(),this._pin.setCoordinate(t.coordinate),this._status={},this.setStatus(this._status)}getCoordinate(){return this._coordinate}getIcon(t){return this._icons[t]}getMap(){return this._map}getProviderPin(){return this._pin}getType(){return this._type}remove(){this.setMap(null)}setClickHandler(t){kr(t,Sr.FUNCTION),this._clickHandler=t}setCoordinate(t){this._coordinate=new dn(t),this._pin.setCoordinate(this._coordinate),this._hideOffscreen&&this._hideIfOffscreen()}setFocusHandler(t){kr(t,Sr.FUNCTION),this._focusHandler=t}setHoverHandler(t){kr(t,Sr.FUNCTION),this._hoverHandler=t}setMap(t){if(t!==this._map&&(t!==null&&wr(t,Ep),this._pin.setMap(t,this._hidden?null:this._map),this._map=t,this._hidden=!1,this._cancelHiddenUpdater(),t&&this._hideOffscreen)){let n=!1;const r=new Promise(l=>{this._cancelHiddenUpdater=()=>{n=!0,l()}});(async()=>{for(;!n;)this._hideIfOffscreen(),await Promise.race([r,t.moving()]),await Promise.race([r,t.idle()])})()}}setStatus(t){Object.assign(this._status,t),this._pin.setProperties(this._propertiesForStatus(this._status))}_hideIfOffscreen(){if(this._map){const t=this._map.getBounds().contains(this._coordinate);this._hidden&&t?this._pin.setMap(this._map,null):!this._hidden&&!t&&this._pin.setMap(null,this._map),this._hidden=!t}}}const ms=.98;function qa(e,t){return Math.max(e instanceof Function?e():e||0,0)/t}class Cp{constructor(){Ie(this,"controlEnabled");Ie(this,"defaultCenter");Ie(this,"defaultZoom");Ie(this,"legendPins");Ie(this,"padding");Ie(this,"panHandler");Ie(this,"panStartHandler");Ie(this,"provider");Ie(this,"providerOptions");Ie(this,"singlePinZoom");Ie(this,"wrapper");this.controlEnabled=!0,this.defaultCenter=new dn(39.83,-98.58),this.defaultZoom=4,this.legendPins=[],this.padding={bottom:()=>50,left:()=>50,right:()=>50,top:()=>50},this.panHandler=(t,n)=>null,this.panStartHandler=t=>null,this.provider=null,this.providerOptions={},this.singlePinZoom=14,this.wrapper=null}withControlEnabled(t){return this.controlEnabled=t,this}withDefaultCenter(t){return this.defaultCenter=new dn(t),this}withDefaultZoom(t){return this.defaultZoom=t,this}withLegendPins(t){return this.legendPins=Array.from(t),this}withPadding(t){return this.padding=t,this}withPanHandler(t){return kr(t,Sr.FUNCTION),this.panHandler=t,this}withPanStartHandler(t){return kr(t,Sr.FUNCTION),this.panStartHandler=t,this}withProvider(t){return wr(t,co),this.provider=t,this}withProviderOptions(t){return this.providerOptions=t,this}withSinglePinZoom(t){return this.singlePinZoom=t,this}withWrapper(t){return t?(wr(t,HTMLElement),this.wrapper=t,this):this}build(){return new Ep(this)}}let Ep=class{constructor(t){Ie(this,"_defaultCenter");Ie(this,"_defaultZoom");Ie(this,"_legendPins");Ie(this,"_padding");Ie(this,"_provider");Ie(this,"_singlePinZoom");Ie(this,"_wrapper");Ie(this,"_cachedBounds");Ie(this,"_resolveIdle");Ie(this,"_resolveMoving");Ie(this,"_idlePromise");Ie(this,"_panHandlerRunning");Ie(this,"_panStartHandlerRunning");Ie(this,"_currentBounds");Ie(this,"_movingPromise");Ie(this,"_panHandler");Ie(this,"_panStartHandler");Ie(this,"_map");var n,r,l;if(wr(t,Cp),t.provider&&wr(t.provider,co),t.wrapper&&wr(t.wrapper,HTMLElement),!((n=t.provider)!=null&&n.loaded))throw new Error(`MapProvider '${(r=t.provider)==null?void 0:r.getProviderName()}' is not loaded. The MapProvider must be loaded before calling Map constructor.`);for(this._defaultCenter=t.defaultCenter,this._defaultZoom=t.defaultZoom,this._legendPins=t.legendPins,this._provider=t.provider,this._singlePinZoom=t.singlePinZoom,this._wrapper=t.wrapper,this._padding={},this.setPadding(t.padding),this._cachedBounds=null,this._resolveIdle=()=>null,this._resolveMoving=()=>null,this._idlePromise=Promise.resolve(),this._setIdle(),this.setPanHandler(t.panHandler),this.setPanStartHandler(t.panStartHandler);(l=this._wrapper)!=null&&l.lastChild;)this._wrapper.removeChild(this._wrapper.lastChild);this._panHandlerRunning=!1,this._panStartHandlerRunning=!1,this._map=new _p(t.provider,this._wrapper).withControlEnabled(t.controlEnabled).withPanHandler(()=>this.panHandler()).withPanStartHandler(()=>this.panStartHandler()).withProviderOptions(t.providerOptions).build(),this.setZoomCenter(this._defaultZoom,this._defaultCenter),this._currentBounds=this.getBounds()}fitCoordinates(t,n=!1,r=this._singlePinZoom){t.length?this.setBounds(to.fit(t),n,this._padding,r):this.setZoomCenter(this._defaultZoom,this._defaultCenter,n)}getBounds(){var t,n;if(!this._cachedBounds){const r=((t=this._wrapper)==null?void 0:t.offsetHeight)??0,l=((n=this._wrapper)==null?void 0:n.offsetWidth)??0,d=this.getZoom(),f=this.getCenter(),p=360/Math.pow(2,d+8),_=l*p,E=r*p;this._cachedBounds=new to(f,f),this._cachedBounds.ne.add(E/2,_/2,Nn.DEGREE,Gr.MERCATOR),this._cachedBounds.sw.add(-E/2,-_/2,Nn.DEGREE,Gr.MERCATOR),this.moving().then(()=>this._cachedBounds=null)}return new to(this._cachedBounds.sw,this._cachedBounds.ne)}getCenter(){return this._map.getCenter()}getProviderMap(){return this._map}getZoom(){return this._map.getZoom()}async idle(){await this._idlePromise}async moving(){await this._movingPromise}newPinOptions(){return new yd().withProvider(this._provider)}panHandler(){this._panHandlerRunning||(this._panHandlerRunning=!0,requestAnimationFrame(()=>{const t=this._currentBounds;this._currentBounds=this.getBounds(),this._panHandler&&this._panHandler(t,new to(new dn(this._currentBounds.sw),new dn(this._currentBounds.ne))),this._panHandlerRunning=!1}),this._setIdle())}panStartHandler(){this._panStartHandlerRunning||(this._panStartHandlerRunning=!0,requestAnimationFrame(()=>{this._panStartHandler&&this._panStartHandler(new to(new dn(this._currentBounds.sw),new dn(this._currentBounds.ne))),this._panStartHandlerRunning=!1}),this._setMoving())}setBounds({ne:t,sw:n},r=!1,l={},d=1/0){var z,q;const f=(z=this._wrapper)==null?void 0:z.offsetHeight,p=(q=this._wrapper)==null?void 0:q.offsetWidth;if(!f||!p)return;let _=qa(l.bottom,f),E=qa(l.left,p),T=qa(l.right,p),S=qa(l.top,f),w=E+T,O=_+S;w>ms&&(E*=ms/w,T*=ms/w,w=ms),O>ms&&(_*=ms/O,S*=ms/O,O=ms);const m=f*(1-O),v=p*(1-w),I=new to(n,t),G=new dn(I.ne.latitude,I.sw.longitude),k=I.sw.distanceTo(G,Nn.DEGREE,Gr.MERCATOR),P=(I.ne.longitude-G.longitude+360)%360;let H=Math.max(k,P*m/v)/(1-O),j=Math.max(P,k*v/m)/(1-w),re=Math.log2(p*360/j)-8;re>d&&(re=d,j=p*360/2**(re+8),H=j*f/p);const te=I.getCenter(Gr.MERCATOR),ce=(S-_)/2*H,V=(T-E)/2*j;te.add(ce,V,Nn.DEGREE,Gr.MERCATOR),this.setZoomCenter(re,te,r)}setCenter(t,n=!1){this._map.setCenter(new dn(t),n)}setPadding({bottom:t=this._padding.bottom,left:n=this._padding.left,right:r=this._padding.right,top:l=this._padding.top}){return this._padding={bottom:t,left:n,right:r,top:l},this}setPanHandler(t){kr(t,Sr.FUNCTION),this._panHandler=t}setPanStartHandler(t){kr(t,Sr.FUNCTION),this._panStartHandler=t}setZoom(t,n=!1){this._map.setZoom(t,n)}setZoomCenter(t,n,r=!1){this._map.setZoomCenter(t,n,r)}_setIdle(){this._resolveMoving(),this._movingPromise=new Promise(t=>this._resolveMoving=t),this._resolveIdle()}_setMoving(){this._resolveIdle(),this._idlePromise=new Promise(t=>this._resolveIdle=t),this._resolveMoving()}};const Nc=rt.createContext(null);function IN(){const e=rt.useContext(Nc);if(!e||e.map===void 0)throw new Error("Attempted to call useMapContext() outside of <Map>.");return e.map}const Tp=({apiKey:e,bounds:t,children:n,className:r,clientKey:l,controls:d=!0,defaultCenter:f={latitude:39.83,longitude:-98.58},defaultZoom:p=4,mapRef:_,padding:E={bottom:50,left:50,right:50,top:50},panHandler:T=()=>null,panStartHandler:S=()=>null,provider:w=Np,providerOptions:O={},singleZoom:m=14})=>{const v=rt.useRef(null),[I,G]=rt.useState(new dn(f)),[k,P]=rt.useState(!1),[H,j]=rt.useState(),[re,te]=rt.useState(p),ce=(V,z)=>{T(V,z),z&&G(z.getCenter())};return rt.useEffect(()=>{!k||!H||te(H.getZoom())},[I]),rt.useEffect(()=>{if(!t||!k||!H)return;const V=t.map(z=>new dn(z));H.fitCoordinates(V)},[JSON.stringify(t),H]),rt.useEffect(()=>{if(!k||H)return;const V=new Cp().withControlEnabled(d).withDefaultCenter(I).withDefaultZoom(re).withPadding(E).withPanHandler(ce).withPanStartHandler(S).withProvider(w).withProviderOptions(O).withSinglePinZoom(m).withWrapper(v.current).build();j(V),_&&(_.current=V)},[k]),rt.useEffect(()=>{k||H||!v.current||w.load(e,{...O,...l&&{client:l}}).then(()=>P(!0))},[]),nt.jsx("div",{className:lo({"is-loaded":k},r),id:"map",ref:v,"data-testid":"map",children:H&&nt.jsx(Nc.Provider,{value:{map:H,provider:w},children:n})})},kN=({count:e})=>nt.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 22 22",children:nt.jsxs("g",{fill:"none",fillRule:"evenodd",children:[nt.jsx("circle",{fill:"red",fillRule:"nonzero",stroke:"white",cx:"11",cy:"11",r:"11"}),nt.jsx("text",{fill:"white",fontFamily:"Arial-BoldMT,Arial",fontSize:"12",fontWeight:"bold",children:nt.jsx("tspan",{x:"50%",y:"15",textAnchor:"middle",children:e})})]})}),Nd=rt.createContext(null);function PN(){const e=rt.useContext(Nd);if(!e)throw new Error("Attempted to call useClustererContext() outside of <Clusterer>.");return e}const $N=({clusterRadius:e=50,children:t,ClusterTemplate:n=kN})=>{const{map:r}=rt.useContext(Nc),[l,d]=rt.useState([]),[f,p]=rt.useState(),[_,E]=rt.useState([]),[T,S]=rt.useState([]);return rt.useEffect(()=>{p(FN(l,r.getZoom(),e))},[l,r.getZoom()]),rt.useEffect(()=>{S(()=>[]),E(()=>[]),(f==null?void 0:f.length)!==0&&(f==null||f.forEach(w=>{if(w.length===1){w[0].pin.setMap(r);return}if(w.length>1){const O=to.fit(w.map(v=>v.pin.getCoordinate())).getCenter(Gr.MERCATOR),m=`cluster-{${O._lat},${O._lon}}`;w.forEach(v=>v.pin.setMap(null)),E(v=>[...v,m]),S(v=>[...v,nt.jsx(Cd,{coordinate:O,id:m,onClick:()=>r.fitCoordinates(w.map(I=>I.pin.getCoordinate()),!0,1/0),children:nt.jsx(n,{count:w.length})},m)])}}))},[f]),nt.jsx(Nd.Provider,{value:{clusters:f??[],clusterIds:_,setPinStore:d},children:nt.jsxs(nt.Fragment,{children:[T.map((w,O)=>nt.jsx(rt.Fragment,{children:w},O)),t]})})},FN=(e,t,n)=>{const r=n*Math.PI/2**(t+7),l=e.map((p,_)=>[_]),d=[];e.forEach((p,_)=>{for(let E=_;E<e.length;E++)E!==_&&new dn(p.pin.getCoordinate()).distanceTo(new dn(e[E].pin.getCoordinate()),Nn.RADIAN,Gr.MERCATOR)<=r&&(l[_].push(E),l[E].push(_))});let f=1;for(;f;){f=0;let p;if(l.forEach((T,S)=>{T.length>f&&(f=T.length,p=S)}),!f)break;const _=l[p??0],E=[];l[p??0]=[];for(const T of _){const S=l[T];E.push(e[T]),l[T]=[],S.forEach(w=>l[w].splice(l[w].indexOf(T),1))}d.push(E)}return d},BN=nt.jsx("svg",{width:"30",height:"38",viewBox:"0 0 30 38",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:nt.jsx("path",{d:"M30 15.0882C30 23.4212 23.3333 30.7353 15 38C7.22222 31.2941 0 23.4212 0 15.0882C0 6.75523 6.71573 0 15 0C23.2843 0 30 6.75523 30 15.0882Z",fill:"red"})}),Cd=({children:e,coordinate:t,hideOffscreen:n=!1,id:r,icon:l=BN,onClick:d=()=>null,onFocus:f=()=>null,onHover:p=()=>null,zIndex:_,hasPinUrl:E=!1})=>{const{map:T,provider:S}=rt.useContext(Nc),w=rt.useContext(Nd),O=rt.useMemo(()=>new yd().withCoordinate(t).withHideOffscreen(n).withProvider(S).withHasPinUrl(E).build(),[]);rt.useEffect(()=>{if(_!==0&&!_)return;const v=O.getProviderPin().getWrapperElement();v&&(v.style.zIndex=_.toString())},[_]),rt.useEffect(()=>{O.setMap(T),O.setClickHandler(()=>d(r)),O.setFocusHandler(I=>f(I,r)),O.setHoverHandler(I=>p(I,r));const v=w==null?void 0:w.clusterIds.includes(r);return w&&!v&&w.setPinStore(I=>[...I,{pin:O,id:r}]),()=>{O.setMap(null),w&&w.setPinStore(I=>I.filter(G=>G.id!==r))}},[]);const m=e||l;if(m){const v=O.getProviderPin().getPinElement();return Object.assign(v.style,{height:"auto",width:"auto"}),fd.createPortal(m,v)}return null},HN=({children:e,coordinate:t,linkSameTab:n,pinUrl:r,onClick:l=()=>null,onHover:d=()=>null,onFocus:f=()=>null,...p})=>{var _;return nt.jsx(Tp,{bounds:[t],...p,children:nt.jsx(Cd,{coordinate:t,id:"location-map-marker",onClick:l,onHover:d,onFocus:f,hasPinUrl:((_=r||"")==null?void 0:_.length)>0,children:r?nt.jsx(pp,{href:r,target:n?"_self":"_blank","aria-label":"map-marker",children:e}):e||void 0})})};var Xc={},Vl={},bf;function WN(){if(bf)return Vl;bf=1;var e=rt;const t=e.createContext(null);function n(l,d){let f=null;l!=null&&(f=l[1]);function p(){return d??(f!=null?f.getTheme():null)}return{getTheme:p}}function r(){const l=e.useContext(t);if(l==null)throw Error("LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext");return l}return Vl.LexicalComposerContext=t,Vl.createLexicalComposerContext=n,Vl.useLexicalComposerContext=r,Vl}var ql={},Lf;function KN(){if(Lf)return ql;Lf=1;var e=rt;function t(r){let l=new URLSearchParams;l.append("code",r);for(let d=1;d<arguments.length;d++)l.append("v",arguments[d]);throw Error(`Minified Lexical error #${r}; visit https://lexical.dev/docs/error?${l} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let n=e.createContext(null);return ql.LexicalComposerContext=n,ql.createLexicalComposerContext=function(r,l){let d=null;return r!=null&&(d=r[1]),{getTheme:function(){return l??(d!=null?d.getTheme():null)}}},ql.useLexicalComposerContext=function(){let r=e.useContext(n);return r==null&&t(8),r},ql}var Qc,If;function qn(){return If||(If=1,Qc=process.env.NODE_ENV==="development"?WN():KN()),Qc}var He={},kf;function zN(){if(kf)return He;kf=1;function e(u){return{type:u}}const t=e("SELECTION_CHANGE_COMMAND"),n=e("SELECTION_INSERT_CLIPBOARD_NODES_COMMAND"),r=e("CLICK_COMMAND"),l=e("DELETE_CHARACTER_COMMAND"),d=e("INSERT_LINE_BREAK_COMMAND"),f=e("INSERT_PARAGRAPH_COMMAND"),p=e("CONTROLLED_TEXT_INSERTION_COMMAND"),_=e("PASTE_COMMAND"),E=e("REMOVE_TEXT_COMMAND"),T=e("DELETE_WORD_COMMAND"),S=e("DELETE_LINE_COMMAND"),w=e("FORMAT_TEXT_COMMAND"),O=e("UNDO_COMMAND"),m=e("REDO_COMMAND"),v=e("KEYDOWN_COMMAND"),I=e("KEY_ARROW_RIGHT_COMMAND"),G=e("MOVE_TO_END"),k=e("KEY_ARROW_LEFT_COMMAND"),P=e("MOVE_TO_START"),H=e("KEY_ARROW_UP_COMMAND"),j=e("KEY_ARROW_DOWN_COMMAND"),re=e("KEY_ENTER_COMMAND"),te=e("KEY_SPACE_COMMAND"),ce=e("KEY_BACKSPACE_COMMAND"),V=e("KEY_ESCAPE_COMMAND"),z=e("KEY_DELETE_COMMAND"),q=e("KEY_TAB_COMMAND"),Te=e("INSERT_TAB_COMMAND"),Se=e("INDENT_CONTENT_COMMAND"),Ee=e("OUTDENT_CONTENT_COMMAND"),de=e("DROP_COMMAND"),K=e("FORMAT_ELEMENT_COMMAND"),D=e("DRAGSTART_COMMAND"),Z=e("DRAGOVER_COMMAND"),oe=e("DRAGEND_COMMAND"),Y=e("COPY_COMMAND"),W=e("CUT_COMMAND"),J=e("SELECT_ALL_COMMAND"),R=e("CLEAR_EDITOR_COMMAND"),U=e("CLEAR_HISTORY_COMMAND"),X=e("CAN_REDO_COMMAND"),fe=e("CAN_UNDO_COMMAND"),_e=e("FOCUS_COMMAND"),B=e("BLUR_COMMAND"),M=e("KEY_MODIFIER_COMMAND"),F=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",se=F&&"documentMode"in document?document.documentMode:null,ye=F&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),De=F&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),ee=F&&"InputEvent"in window&&!se?"getTargetRanges"in new window.InputEvent("input"):!1,ne=F&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),ue=F&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,be=F&&/Android/.test(navigator.userAgent),Ne=F&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Re=F&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!Ne,ke=1,Fe=3,qe=0,Be=1,ut=2,At=0,Ut=1,tn=2,Oe=1,ie=2,le=4,ve=8,Le=16,Me=32,je=64,it=128,st=Oe|ie|le|ve|Le|Me|je|it,ot=1,St=2,Ge=1,ze=2,tt=3,yt=4,Nt=5,Et=6,gt=" ",mt=ne||ue||Re?gt:"",$t=`
|
|
37
37
|
|
|
38
|
-
`,Kt=De?gt:mt,tn="֑-߿יִ-﷽ﹰ-ﻼ",It="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",jt=new RegExp("^[^"+It+"]*["+tn+"]"),bt=new RegExp("^[^"+tn+"]*["+It+"]"),nn={bold:Oe,code:Le,highlight:rt,italic:ie,strikethrough:le,subscript:Me,superscript:je,underline:ve},Or={directionless:st,unmergeable:vt},_i={center:ze,end:Et,justify:yt,left:Ge,right:tt,start:Nt},pe={[ze]:"center",[Et]:"end",[yt]:"justify",[Ge]:"left",[tt]:"right",[Nt]:"start"},Ze={normal:At,segmented:en,token:Ut},ot={[At]:"normal",[en]:"segmented",[Ut]:"token"},St=100;let Gt=!1,Bt=0;function Pt(){return Gt}function kt(u){Bt=u.timeStamp}function Ht(u){Bt===0&&No(u).addEventListener("textInput",kt,!0)}function sn(u,s,c){return s.__lexicalLineBreak===u||u[`__lexicalKey_${c._key}`]!==void 0}function an(u){return u.getEditorState().read(()=>{const s=_n();return s!==null?s.clone():null})}function bn(u,s,c){const h=ar(c._window);let y=null,N=null;h!==null&&h.anchorNode===u&&(y=h.anchorOffset,N=h.focusOffset);const b=u.nodeValue;b!==null&&$r(s,b,y,N,!1)}function yr(u,s,c){if(Tt(u)){const h=u.anchor.getNode();if(h.is(c)&&u.format!==h.getFormat())return!1}return s.nodeType===Fe&&c.isAttached()}function Zn(u,s,c){Gt=!0;const h=performance.now()-Bt>St;try{zr(u,()=>{const y=_n()||an(u),N=new Map,b=u.getRootElement(),$=u._editorState,ae=u._blockCursorElement;let he=!1,me="";for(let we=0;we<s.length;we++){const Ce=s[we],Ve=Ce.type,Ue=Ce.target;let $e=ii(Ue,$);if(!($e===null&&Ue!==b||An($e))){if(Ve==="characterData")h&&_t($e)&&yr(y,Ue,$e)&&bn(Ue,$e,u);else if(Ve==="childList"){he=!0;const Rt=Ce.addedNodes;for(let qt=0;qt<Rt.length;qt++){const Wt=Rt[qt],Dt=ho(Wt),cn=Wt.parentNode;if(cn!=null&&Wt!==ae&&Dt===null&&(Wt.nodeName!=="BR"||!sn(Wt,cn,u))){if(De){const ir=Wt.innerText||Wt.nodeValue;ir&&(me+=ir)}cn.removeChild(Wt)}}const Qe=Ce.removedNodes,ht=Qe.length;if(ht>0){let qt=0;for(let Wt=0;Wt<ht;Wt++){const Dt=Qe[Wt];(Dt.nodeName==="BR"&&sn(Dt,Ue,u)||ae===Dt)&&(Ue.appendChild(Dt),qt++)}ht!==qt&&(Ue===b&&($e=ml($)),N.set(Ue,$e))}}}}if(N.size>0)for(const[we,Ce]of N)if(et(Ce)){const Ve=Ce.getChildrenKeys();let Ue=we.firstChild;for(let $e=0;$e<Ve.length;$e++){const Rt=Ve[$e],Qe=u.getElementByKey(Rt);Qe!==null&&(Ue==null?(we.appendChild(Qe),Ue=Qe):Ue!==Qe&&we.replaceChild(Qe,Ue),Ue=Ue.nextSibling)}}else _t(Ce)&&Ce.markDirty();const xe=c.takeRecords();if(xe.length>0){for(let we=0;we<xe.length;we++){const Ce=xe[we],Ve=Ce.addedNodes,Ue=Ce.target;for(let $e=0;$e<Ve.length;$e++){const Rt=Ve[$e],Qe=Rt.parentNode;Qe!=null&&Rt.nodeName==="BR"&&!sn(Rt,Ue,u)&&Qe.removeChild(Rt)}}c.takeRecords()}y!==null&&(he&&(y.dirty=!0,Cr(y)),De&&Ol(u)&&y.insertRawText(me))})}finally{Gt=!1}}function fn(u){const s=u._observer;if(s!==null){const c=s.takeRecords();Zn(u,c,s)}}function sr(u){Ht(u),u._observer=new MutationObserver((s,c)=>{Zn(u,s,c)})}function or(u,s){const c=u.__mode,h=u.__format,y=u.__style,N=s.__mode,b=s.__format,$=s.__style;return(c===null||c===N)&&(h===null||h===b)&&(y===null||y===$)}function Mi(u,s){const c=u.mergeWithSibling(s),h=xn()._normalizedNodes;return h.add(u.__key),h.add(s.__key),c}function Nr(u){let s=u;if(s.__text===""&&s.isSimpleText()&&!s.isUnmergeable()){s.remove();return}let c;for(;(c=s.getPreviousSibling())!==null&&_t(c)&&c.isSimpleText()&&!c.isUnmergeable();)if(c.__text==="")c.remove();else if(or(c,s)){s=Mi(c,s);break}else break;let h;for(;(h=s.getNextSibling())!==null&&_t(h)&&h.isSimpleText()&&!h.isUnmergeable();)if(h.__text==="")h.remove();else if(or(s,h)){s=Mi(s,h);break}else break}function Os(u){return uo(u.anchor),uo(u.focus),u}function uo(u){for(;u.type==="element";){const s=u.getNode(),c=u.offset;let h,y;if(c===s.getChildrenSize()?(h=s.getChildAtIndex(c-1),y=!0):(h=s.getChildAtIndex(c),y=!1),_t(h)){u.set(h.__key,y?h.getTextContentSize():0,"text");break}else if(!et(h))break;u.set(h.__key,y?h.getChildrenSize():0,"element")}}let dl=1;function jr(){return""+dl++}function pa(u,s){const c=u._nodes.get(s);if(c===void 0)throw Error(`registeredNode: Type ${s} not found`);return c}const fo=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function is(u){return An(ii(u))}function Ds(u){const s=document.activeElement;if(s===null)return!1;const c=s.nodeName;return An(ii(u))&&(c==="INPUT"||c==="TEXTAREA"||s.contentEditable==="true"&&s.__lexicalEditor==null)}function ss(u,s,c){const h=u.getRootElement();try{return h!==null&&h.contains(s)&&h.contains(c)&&s!==null&&!Ds(s)&&fl(s)===u}catch{return!1}}function fl(u){let s=u;for(;s!=null;){const c=s.__lexicalEditor;if(c!=null)return c;s=yo(s)}return null}function Ln(u){return jt.test(u)?"rtl":bt.test(u)?"ltr":null}function zn(u){return u.isToken()||u.isSegmented()}function ri(u){return u.nodeType===Fe}function Pr(u){let s=u;for(;s!=null;){if(ri(s))return s;s=s.firstChild}return null}function Bn(u,s,c){const h=nn[s];if(c!==null&&(u&h)===(c&h))return u;let y=u^h;return s==="subscript"?y&=-65:s==="superscript"&&(y&=-33),y}function As(u){return _t(u)||ai(u)||An(u)}function hl(u,s){if(s!=null){u.__key=s;return}fr(),Jd();const c=xn(),h=xi(),y=jr();h._nodeMap.set(y,u),et(u)?c._dirtyElements.set(y,!0):c._dirtyLeaves.add(y),c._cloneNotNeeded.add(y),c._dirtyType=Be,u.__key=y}function gl(u,s,c){let h=u;for(;h!==null;){if(c.has(h))return;const y=s.get(h);if(y===void 0)break;c.set(h,!1),h=y.__parent}}function Vr(u){const s=u.getParent();if(s!==null){const c=u.getWritable(),h=s.getWritable(),y=u.getPreviousSibling(),N=u.getNextSibling();if(y===null)if(N!==null){const b=N.getWritable();h.__first=N.__key,b.__prev=null}else h.__first=null;else{const b=y.getWritable();if(N!==null){const $=N.getWritable();$.__prev=b.__key,b.__next=$.__key}else b.__next=null;c.__prev=null}if(N===null)if(y!==null){const b=y.getWritable();h.__last=y.__key,b.__next=null}else h.__last=null;else{const b=N.getWritable();if(y!==null){const $=y.getWritable();$.__next=b.__key,b.__prev=$.__key}else b.__prev=null;c.__next=null}h.__size--,c.__parent=null}}function Ri(u){Jd();const s=u.getLatest(),c=s.__parent,h=xi(),y=xn(),N=h._nodeMap,b=y._dirtyElements;c!==null&&gl(c,N,b);const $=s.__key;y._dirtyType=Be,et(u)?b.set($,!0):y._dirtyLeaves.add($)}function pl(u){const s=u.getPreviousSibling(),c=u.getNextSibling();s!==null&&Ri(s),c!==null&&Ri(c)}function vn(u){fr();const s=xn(),c=s._compositionKey;if(u!==c){if(s._compositionKey=u,c!==null){const h=Cn(c);h!==null&&h.getWritable()}if(u!==null){const h=Cn(u);h!==null&&h.getWritable()}}}function lr(){return Fo()?null:xn()._compositionKey}function Cn(u,s){const h=(s||xi())._nodeMap.get(u);return h===void 0?null:h}function ho(u,s){const c=xn(),h=u[`__lexicalKey_${c._key}`];return h!==void 0?Cn(h,s):null}function ii(u,s){let c=u;for(;c!=null;){const h=ho(c,s);if(h!==null)return h;c=yo(c)}return null}function Ms(u){const s=u._decorators,c=Object.assign({},s);return u._pendingDecorators=c,c}function go(u){return u.read(()=>tr().getTextContent())}function bi(u,s){zr(u,()=>{const c=xi();if(c.isEmpty())return;if(s==="root"){tr().markDirty();return}const h=c._nodeMap;for(const[,y]of h)y.markDirty()},u._pendingEditorState===null?{tag:"history-merge"}:void 0)}function tr(){return ml(xi())}function ml(u){return u._nodeMap.get("root")}function Cr(u){fr();const s=xi();if(u!==null){if(Object.isFrozen(u))throw Error("$setSelection called on frozen selection object. Ensure selection is cloned before passing in.");u.dirty=!0,u.setCachedNodes(null)}s._selection=u}function _l(){fr();const u=xn();fn(u)}function Li(u){const s=xn(),c=ma(u,s);if(c===null){const h=s.getRootElement();return u===h?Cn("root"):null}return Cn(c)}function yl(u,s){return s?u.getTextContentSize():0}function ma(u,s){let c=u;for(;c!=null;){const h=c[`__lexicalKey_${s._key}`];if(h!==void 0)return h;c=yo(c)}return null}function Rs(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function Ii(u){const s=[];let c=u;for(;c!==null;)s.push(c),c=c._parentEditor;return s}function Nl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function po(u){return u.nodeType===Fe?u.nodeValue:null}function bs(u,s,c){const h=ar(s._window);if(h===null)return;const y=h.anchorNode;let{anchorOffset:N,focusOffset:b}=h;if(y!==null){let $=po(y);const ae=ii(y);if($!==null&&_t(ae)){if($===mt&&c){const he=c.length;$=c,N=he,b=he}$!==null&&$r(ae,$,N,b,u)}}}function $r(u,s,c,h,y){let N=u;if(N.isAttached()&&(y||!N.isDirty())){const b=N.isComposing();let $=s;(b||y)&&s[s.length-1]===mt&&($=s.slice(0,-1));const ae=N.getTextContent();if(y||$!==ae){if($===""){if(vn(null),!ne&&!ue&&!Re){const Ue=xn();setTimeout(()=>{Ue.update(()=>{N.isAttached()&&N.remove()})},20)}else N.remove();return}const he=N.getParent(),me=$o(),xe=N.getTextContentSize(),we=lr(),Ce=N.getKey();if(N.isToken()||we!==null&&Ce===we&&!b||Tt(me)&&(he!==null&&!he.canInsertTextBefore()&&me.anchor.offset===0||me.anchor.key===u.__key&&me.anchor.offset===0&&!N.canInsertTextBefore()&&!b||me.focus.key===u.__key&&me.focus.offset===xe&&!N.canInsertTextAfter()&&!b)){N.markDirty();return}const Ve=_n();if(!Tt(Ve)||c===null||h===null){N.setTextContent($);return}if(Ve.setTextNodeRange(N,c,N,h),N.isSegmented()){const Ue=N.getTextContent(),$e=Dn(Ue);N.replace($e),N=$e}N.setTextContent($)}}}function Cl(u){const s=u.getPreviousSibling();return(_t(s)||et(s)&&s.isInline())&&!s.canInsertTextAfter()}function Ls(u,s){if(s.isSegmented())return!0;if(!u.isCollapsed())return!1;const c=u.anchor.offset,h=s.getParentOrThrow(),y=s.isToken();return c===0?!s.canInsertTextBefore()||!h.canInsertTextBefore()||y||Cl(s):c===s.getTextContentSize()?!s.canInsertTextAfter()||!h.canInsertTextAfter()||y:!1}function _a(u,s,c,h){return u===9&&!s&&!c&&!h}function ya(u,s,c,h){return u===66&&!s&&qr(c,h)}function os(u,s,c,h){return u===73&&!s&&qr(c,h)}function Is(u,s,c,h){return u===85&&!s&&qr(c,h)}function El(u,s){return Da(u)&&!s}function Tl(u,s){return Da(u)&&s}function ks(u,s){return ye&&s&&u===79}function Ps(u,s,c){return Zr(u)&&(ye?s:c)}function Na(u,s,c){return Pi(u)&&(ye?s:c)}function Ca(u,s){return ye&&s&&Zr(u)}function Ea(u,s){return ye&&s&&Pi(u)}function Ta(u,s,c,h){return ye?s||c?!1:Zr(u)||u===72&&h:h||s||c?!1:Zr(u)}function Dc(u,s,c,h,y){return ye?c||h||y?!1:Pi(u)||u===68&&s:s||h||y?!1:Pi(u)}function Ac(u,s,c,h){return u===90&&!s&&qr(c,h)}function xa(u,s,c,h){return ye?u===90&&c&&s:u===89&&h||u===90&&h&&s}function Mc(u,s,c,h){return s?!1:u===67?ye?c:h:!1}function Rc(u,s,c,h){return s?!1:u===88?ye?c:h:!1}function va(u){return u===37}function Sa(u){return u===39}function xl(u){return u===38}function bc(u){return u===40}function Lc(u,s,c,h){return va(u)&&!s&&!h&&!c}function wa(u,s,c,h,y){return va(u)&&!h&&!c&&(s||y)}function ls(u,s,c,h){return Sa(u)&&!s&&!h&&!c}function Oa(u,s,c,h,y){return Sa(u)&&!h&&!c&&(s||y)}function Ic(u,s,c){return xl(u)&&!s&&!c}function vl(u,s,c){return bc(u)&&!s&&!c}function $s(u,s,c,h){return u||s||c||h}function kc(u){return u===32}function qr(u,s){return ye?u:s}function Da(u){return u===13}function Zr(u){return u===8}function ki(u){return u===27}function Pi(u){return u===46}function mo(u,s,c){return u===65&&qr(s,c)}function Sl(){const u=tr(),s=u.select(0,u.getChildrenSize());Cr(Os(s))}function $i(u,s){u.__lexicalClassNameCache===void 0&&(u.__lexicalClassNameCache={});const c=u.__lexicalClassNameCache,h=c[s];if(h!==void 0)return h;const y=u[s];if(typeof y=="string"){const N=y.split(" ");return c[s]=N,N}return y}function as(u,s,c,h,y){if(c.size===0)return;const N=h.__type,b=h.__key,$=s.get(N);if($===void 0)throw Error(`Type ${N} not in registeredNodes`);const ae=$.klass;let he=u.get(ae);he===void 0&&(he=new Map,u.set(ae,he));const me=he.get(b),xe=me==="destroyed"&&y==="created";(me===void 0||xe)&&he.set(b,xe?"updated":y)}function Fi(u){const s=xi(),c=s._readOnly,h=u.getType(),y=s._nodeMap,N=[];for(const[,b]of y)b instanceof u&&b.__type===h&&(c||b.isAttached())&&N.push(b);return N}function Aa(u,s,c){const h=u.getParent();let y=c,N=u;return h!==null&&(s&&c===0?(y=N.getIndexWithinParent(),N=h):!s&&c===N.getChildrenSize()&&(y=N.getIndexWithinParent()+1,N=h)),N.getChildAtIndex(s?y-1:y)}function wl(u,s){const c=u.offset;if(u.type==="element"){const h=u.getNode();return Aa(h,s,c)}else{const h=u.getNode();if(s&&c===0||!s&&c===h.getTextContentSize()){const y=s?h.getPreviousSibling():h.getNextSibling();return y===null?Aa(h.getParentOrThrow(),s,h.getIndexWithinParent()+(s?0:1)):y}}return null}function Ol(u){const s=No(u).event,c=s&&s.inputType;return c==="insertFromPaste"||c==="insertFromPasteAsQuotation"}function dt(u,s,c){return nf(u,s,c)}function _o(u){return!Ur(u)&&!u.isLastChild()&&!u.isInline()}function Fs(u,s){const c=u._keyToDOMMap.get(s);if(c===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${s}`);return c}function yo(u){const s=u.assignedSlot||u.parentElement;return s!==null&&s.nodeType===11?s.host:s}function yi(u,s,c){const h=c.ownerDocument,y=h.defaultView;if(y===null)return;let{top:N,bottom:b}=s,$=0,ae=0,he=c;for(;he!==null;){const me=he===h.body;if(me)$=0,ae=No(u).innerHeight;else{const we=he.getBoundingClientRect();$=we.top,ae=we.bottom}let xe=0;if(N<$?xe=-($-N):b>ae&&(xe=b-ae),xe!==0)if(me)y.scrollBy(0,xe);else{const we=he.scrollTop;he.scrollTop+=xe;const Ce=he.scrollTop-we;N-=Ce,b-=Ce}if(me)break;he=yo(he)}}function Un(u){return xn()._updateTags.has(u)}function Ct(u){fr(),xn()._updateTags.add(u)}function cs(u){const s=_n();if(!Tt(s)||!et(u))return s;const{anchor:c,focus:h}=s,y=c.getNode(),N=h.getNode();return Bi(y,u)&&c.set(u.__key,0,"element"),Bi(N,u)&&h.set(u.__key,0,"element"),s}function Bi(u,s){let c=u.getParent();for(;c!==null;){if(c.is(s))return!0;c=c.getParent()}return!1}function Ma(u){const s=u.ownerDocument;return s&&s.defaultView||null}function No(u){const s=u._window;if(s===null)throw Error("window object not found");return s}function Fr(u){return et(u)&&u.isInline()||An(u)&&u.isInline()}function Co(u){let s=u.getParentOrThrow();for(;s!==null;){if(si(s))return s;s=s.getParentOrThrow()}return s}function si(u){return Ur(u)||et(u)&&u.isShadowRoot()}function Dl(u){const s=u.constructor.clone(u);return hl(s,null),s}function Dr(u){const s=xn(),c=u.constructor.getType(),h=s._nodes.get(c);if(h===void 0)throw Error('$initializeNode failed. Ensure node has been registered to the editor. You can do this by passing the node class via the "nodes" array in the editor config.');const y=h.replace;if(y!==null){const N=y(u);if(!(N instanceof u.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return N}return u}function Bs(u,s){const c=u.getParent();if(Ur(c)&&!et(s)&&!An(s))throw Error("Only element or decorator nodes can be inserted in to the root node")}function Eo(u){const s=u.theme,c=document.createElement("div");c.contentEditable="false",c.setAttribute("data-lexical-cursor","true");let h=s.blockCursor;if(h!==void 0){if(typeof h=="string"){const y=h.split(" ");h=s.blockCursor=y}h!==void 0&&c.classList.add(...h)}return c}function Mt(u){return(An(u)||et(u)&&!u.canBeEmpty())&&!u.isInline()}function Hs(u,s,c){c.style.removeProperty("caret-color"),s._blockCursorElement=null;const h=u.parentElement;h!==null&&h.removeChild(u)}function Ni(u,s,c){let h=u._blockCursorElement;if(Tt(c)&&c.isCollapsed()&&c.anchor.type==="element"&&s.contains(document.activeElement)){const y=c.anchor,N=y.getNode(),b=y.offset,$=N.getChildrenSize();let ae=!1,he=null;if(b===$){const me=N.getChildAtIndex(b-1);Mt(me)&&(ae=!0)}else{const me=N.getChildAtIndex(b);if(Mt(me)){const xe=me.getPreviousSibling();(xe===null||Mt(xe))&&(ae=!0,he=u.getElementByKey(me.__key))}}if(ae){const me=u.getElementByKey(N.__key);h===null&&(u._blockCursorElement=h=Eo(u._config)),s.style.caretColor="transparent",he===null?me.appendChild(h):me.insertBefore(h,he);return}}h!==null&&Hs(h,u,s)}function ar(u){return F?(u||window).getSelection():null}function Ra(u,s){let c=u.getChildAtIndex(s);if(c==null&&(c=u),si(u))throw Error("Can not call $splitNode() on root element");const h=b=>{const $=b.getParentOrThrow(),ae=si($),he=b===c&&!ae?b:Dl(b);if(ae){if(!(et(b)&&et(he)))throw Error("Children of a root must be ElementNode");return b.insertAfter(he),[b,he,he]}else{const[me,xe,we]=h($),Ce=b.getNextSiblings();return we.append(he,...Ce),[me,xe,he]}},[y,N]=h(c);return[y,N]}function To(u,s){let c=u;for(;c!==tr()&&c!=null;){if(s(c))return c;c=c.getParent()}return null}function ba(u){return Ws(u)&&u.tagName==="A"}function Ws(u){return u.nodeType===1}function Hi(u){if(An(u)&&!u.isInline())return!0;if(!et(u)||si(u))return!1;const s=u.getFirstChild(),c=s===null||ai(s)||_t(s)||s.isInline();return!u.isInline()&&u.canBeEmpty()!==!1&&c}function xo(u,s){let c=u;for(;c!==null&&c.getParent()!==null&&!s(c);)c=c.getParentOrThrow();return s(c)?c:null}function La(u,s){const c=u._decorators;let y=u._pendingDecorators||c;const N=s._nodeMap;let b;for(b in y)N.has(b)||(y===c&&(y=Ms(u)),delete y[b])}function Al(u,s,c,h,y,N){let b=u.getFirstChild();for(;b!==null;){const $=b.__key;b.__parent===s&&(et(b)&&Al(b,$,c,h,y,N),c.has($)||N.delete($),y.push($)),b=b.getNextSibling()}}function Ml(u,s,c,h){const y=u._nodeMap,N=s._nodeMap,b=[];for(const[$]of h){const ae=N.get($);ae!==void 0&&(ae.isAttached()||(et(ae)&&Al(ae,$,y,N,b,h),y.has($)||h.delete($),b.push($)))}for(const $ of b)N.delete($);for(const $ of c){const ae=N.get($);ae!==void 0&&!ae.isAttached()&&(y.has($)||c.delete($),N.delete($))}}let In="",Gn="",Vt="",Er,Hn,us,Ia=!1,ds=!1,Ks,zs=null,Us,Rl,Wi,gn,On,Wn;function fs(u,s){const c=Wi.get(u);if(s!==null){const h=wo(u);h.parentNode===s&&s.removeChild(h)}if(gn.has(u)||Hn._keyToDOMMap.delete(u),et(c)){const h=Ei(c,Wi);Ki(h,0,h.length-1,null)}c!==void 0&&as(Wn,us,Ks,c,"destroyed")}function Ki(u,s,c,h){let y=s;for(;y<=c;++y){const N=u[y];N!==void 0&&fs(N,h)}}function Ci(u,s){u.setProperty("text-align",s)}const hs="40px";function Jn(u,s){const c=Er.theme.indent;if(typeof c=="string"){const y=u.classList.contains(c);s>0&&!y?u.classList.add(c):s<1&&y&&u.classList.remove(c)}const h=getComputedStyle(u).getPropertyValue("--lexical-indent-base-value")||hs;u.style.setProperty("padding-inline-start",s===0?"":`calc(${s} * ${h})`)}function Br(u,s){const c=u.style;s===0?Ci(c,""):s===Ge?Ci(c,"left"):s===ze?Ci(c,"center"):s===tt?Ci(c,"right"):s===yt?Ci(c,"justify"):s===Nt?Ci(c,"start"):s===Et&&Ci(c,"end")}function hn(u,s,c){const h=gn.get(u);if(h===void 0)throw Error("createNode: node does not exist in nodeMap");const y=h.createDOM(Er,Hn);if(Je(u,y,Hn),_t(h)?y.setAttribute("data-lexical-text","true"):An(h)&&y.setAttribute("data-lexical-decorator","true"),et(h)){const N=h.__indent,b=h.__size;if(N!==0&&Jn(y,N),b!==0){const ae=b-1,he=Ei(h,gn);ka(he,ae,h,y)}const $=h.__format;$!==0&&Br(y,$),h.isInline()||vo(null,h,y),_o(h)&&(In+=$t,Vt+=$t)}else{const N=h.getTextContent();if(An(h)){const b=h.decorate(Hn,Er);b!==null&&Il(u,b),y.contentEditable="false"}else _t(h)&&(h.isDirectionless()||(Gn+=N));In+=N,Vt+=N}if(s!==null)if(c!=null)s.insertBefore(y,c);else{const N=s.__lexicalLineBreak;N!=null?s.insertBefore(y,N):s.appendChild(y)}return Object.freeze(h),as(Wn,us,Ks,h,"created"),y}function ka(u,s,c,h){const y=Gn;Gn="",bl(u,c,0,s,h,null),Ll(c,h),Gn=y}function bl(u,s,c,h,y,N){const b=In;In="";let $=c;for(;$<=h;++$)hn(u[$],y,N);_o(s)&&(In+=$t),y.__lexicalTextContent=In,In=b+In}function Pa(u,s){const c=s.get(u);return ai(c)||An(c)&&c.isInline()}function vo(u,s,c){const h=u!==null&&(u.__size===0||Pa(u.__last,Wi)),y=s.__size===0||Pa(s.__last,gn);if(h){if(!y){const N=c.__lexicalLineBreak;N!=null&&c.removeChild(N),c.__lexicalLineBreak=null}}else if(y){const N=document.createElement("br");c.__lexicalLineBreak=N,c.appendChild(N)}}function Ll(u,s){const c=s.__lexicalDirTextContent,h=s.__lexicalDir;if(c!==Gn||h!==zs){const y=Gn==="",N=y?zs:Ln(Gn);if(N!==h){const b=s.classList,$=Er.theme;let ae=h!==null?$[h]:void 0,he=N!==null?$[N]:void 0;if(ae!==void 0){if(typeof ae=="string"){const me=ae.split(" ");ae=$[h]=me}b.remove(...ae)}if(N===null||y&&N==="ltr")s.removeAttribute("dir");else{if(he!==void 0){if(typeof he=="string"){const me=he.split(" ");he=$[N]=me}he!==void 0&&b.add(...he)}s.dir=N}if(!ds){const me=u.getWritable();me.__dir=N}}zs=N,s.__lexicalDirTextContent=Gn,s.__lexicalDir=N}}function zi(u,s,c){const h=Gn;Gn="",ct(u,s,c),Ll(s,c),Gn=h}function Ei(u,s){const c=[];let h=u.__first;for(;h!==null;){const y=s.get(h);if(y===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");c.push(h),h=y.__next}return c}function ct(u,s,c){const h=In,y=u.__size,N=s.__size;if(In="",y===1&&N===1){const b=u.__first,$=s.__first;if(b===$)gs(b,c);else{const ae=wo(b),he=hn($,null,null);c.replaceChild(he,ae),fs(b,null)}}else{const b=Ei(u,Wi),$=Ei(s,gn);if(y===0)N!==0&&bl($,s,0,N-1,c,null);else if(N===0){if(y!==0){const he=c.__lexicalLineBreak==null;Ki(b,0,y-1,he?null:c),he&&(c.textContent="")}}else En(s,b,$,y,N,c)}_o(s)&&(In+=$t),c.__lexicalTextContent=In,In=h+In}function gs(u,s){const c=Wi.get(u);let h=gn.get(u);if(c===void 0||h===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const y=Ia||Rl.has(u)||Us.has(u),N=Fs(Hn,u);if(c===h&&!y){if(et(c)){const b=N.__lexicalTextContent;b!==void 0&&(In+=b,Vt+=b);const $=N.__lexicalDirTextContent;$!==void 0&&(Gn+=$)}else{const b=c.getTextContent();_t(c)&&!c.isDirectionless()&&(Gn+=b),Vt+=b,In+=b}return N}if(c!==h&&y&&as(Wn,us,Ks,h,"updated"),h.updateDOM(c,N,Er)){const b=hn(u,null,null);if(s===null)throw Error("reconcileNode: parentDOM is null");return s.replaceChild(b,N),fs(u,null),b}if(et(c)&&et(h)){const b=h.__indent;b!==c.__indent&&Jn(N,b);const $=h.__format;$!==c.__format&&Br(N,$),y&&(zi(c,h,N),!Ur(h)&&!h.isInline()&&vo(c,h,N)),_o(h)&&(In+=$t,Vt+=$t)}else{const b=h.getTextContent();if(An(h)){const $=h.decorate(Hn,Er);$!==null&&Il(u,$)}else _t(h)&&!h.isDirectionless()&&(Gn+=b);In+=b,Vt+=b}if(!ds&&Ur(h)&&h.__cachedText!==Vt){const b=h.getWritable();b.__cachedText=Vt,h=b}return Object.freeze(h),N}function Il(u,s){let c=Hn._pendingDecorators;const h=Hn._decorators;if(c===null){if(h[u]===s)return;c=Ms(Hn)}c[u]=s}function Tr(u){return u.firstChild}function So(u){let s=u.nextSibling;return s!==null&&s===Hn._blockCursorElement&&(s=s.nextSibling),s}function En(u,s,c,h,y,N){const b=h-1,$=y-1;let ae,he,me=Tr(N),xe=0,we=0;for(;xe<=b&&we<=$;){const Ue=s[xe],$e=c[we];if(Ue===$e)me=So(gs($e,N)),xe++,we++;else{ae===void 0&&(ae=new Set(s)),he===void 0&&(he=new Set(c));const Rt=he.has(Ue),Qe=ae.has($e);if(!Rt)me=So(wo(Ue)),fs(Ue,N),xe++;else if(!Qe)hn($e,N,me),we++;else{const ht=Fs(Hn,$e);ht===me?me=So(gs($e,N)):(me!=null?N.insertBefore(ht,me):N.appendChild(ht),gs($e,N)),xe++,we++}}}const Ce=xe>b,Ve=we>$;if(Ce&&!Ve){const Ue=c[$+1],$e=Ue===void 0?null:Hn.getElementByKey(Ue);bl(c,u,we,$,N,$e)}else Ve&&!Ce&&Ki(s,xe,b,N)}function Ui(u,s,c,h,y,N){In="",Vt="",Gn="",Ia=h===ut,zs=null,Hn=c,Er=c._config,us=c._nodes,Ks=Hn._listeners.mutation,Us=y,Rl=N,Wi=u._nodeMap,gn=s._nodeMap,ds=s._readOnly,On=new Map(c._keyToDOMMap);const b=new Map;return Wn=b,gs("root",null),Hn=void 0,us=void 0,Us=void 0,Rl=void 0,Wi=void 0,gn=void 0,Er=void 0,On=void 0,Wn=void 0,b}function Je(u,s,c){const h=c._keyToDOMMap;s["__lexicalKey_"+c._key]=u,h.set(u,s)}function wo(u){const s=On.get(u);if(s===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${u}`);return s}const cr=Object.freeze({}),nr=30,kl=[["keydown",ge],["pointerdown",Bl],["compositionstart",x],["compositionend",Q],["input",C],["click",$a],["cut",cr],["copy",cr],["dragstart",cr],["dragover",cr],["dragend",cr],["paste",cr],["focus",cr],["blur",cr],["drop",cr]];ee&&kl.push(["beforeinput",(u,s)=>g(u,s)]);let Gi=0,Pl=0,Gs=0,Hr=null,Ys=0,Wr=!1,Oo=!1,js=!1,Vs=!1,Do=[0,"",0,"root",0];function Yi(u,s,c,h,y){const N=u.anchor,b=u.focus,$=N.getNode(),ae=xn(),he=ar(ae._window),me=he!==null?he.anchorNode:null,xe=N.key,we=ae.getElementByKey(xe),Ce=c.length;return xe!==b.key||!_t($)||(!y&&(!ee||Gs<h+50)||$.isDirty()&&Ce<2||Rs(c))&&N.offset!==b.offset&&!$.isComposing()||zn($)||$.isDirty()&&Ce>1||(y||!ee)&&we!==null&&!$.isComposing()&&me!==Pr(we)||he!==null&&s!==null&&(!s.collapsed||s.startContainer!==he.anchorNode||s.startOffset!==he.anchorOffset)||$.getFormat()!==u.format||$.getStyle()!==u.style||Ls(u,$)}function $l(u,s){return u!==null&&u.nodeValue!==null&&u.nodeType===Fe&&s!==0&&s!==u.nodeValue.length}function Fl(u,s,c){const{anchorNode:h,anchorOffset:y,focusNode:N,focusOffset:b}=u;Wr&&(Wr=!1,$l(h,y)&&$l(N,b))||zr(s,()=>{if(!c){Cr(null);return}if(!ss(s,h,N))return;const $=_n();if(Tt($)){const ae=$.anchor,he=ae.getNode();if($.isCollapsed()){u.type==="Range"&&u.anchorNode===u.focusNode&&($.dirty=!0);const me=No(s).event,xe=me?me.timeStamp:performance.now(),[we,Ce,Ve,Ue,$e]=Do,Rt=tr(),Qe=s.isComposing()===!1&&Rt.getTextContent()==="";if(xe<$e+200&&ae.offset===Ve&&ae.key===Ue)$.format=we,$.style=Ce;else if(ae.type==="text"){if(!_t(he))throw Error("Point.getNode() must return TextNode when type is text");$.format=he.getFormat(),$.style=he.getStyle()}else ae.type==="element"&&!Qe&&($.format=0,$.style="")}else{let me=it,xe=!1;const we=$.getNodes(),Ce=we.length;for(let Ve=0;Ve<Ce;Ve++){const Ue=we[Ve];if(_t(Ue)&&(xe=!0,me&=Ue.getFormat(),me===0))break}$.format=xe?me:0}}dt(s,t,void 0)})}function $a(u,s){zr(s,()=>{const c=_n(),h=ar(s._window),y=$o();if(h){if(Tt(c)){const N=c.anchor,b=N.getNode();if(N.type==="element"&&N.offset===0&&c.isCollapsed()&&!Ur(b)&&tr().getChildrenSize()===1&&b.getTopLevelElementOrThrow().isEmpty()&&y!==null&&c.is(y))h.removeAllRanges(),c.dirty=!0;else if(u.detail===3&&!c.isCollapsed()){const ae=c.focus.getNode();b!==ae&&(et(b)?b.select(0):b.getParentOrThrow().select(0))}}else if(u.pointerType==="touch"){const N=h.anchorNode;if(N!==null){const b=N.nodeType;if(b===ke||b===Fe){const $=Fc(y,h,s,u);Cr($)}}}}dt(s,r,u)})}function Bl(u,s){const c=u.target,h=u.pointerType;c instanceof Node&&h!=="touch"&&zr(s,()=>{is(c)||(Oo=!0)})}function o(u){if(!u.getTargetRanges)return null;const s=u.getTargetRanges();return s.length===0?null:s[0]}function i(u,s){return u!==s||et(u)||et(s)||!u.isToken()||!s.isToken()}function a(u){return Pl===229&&u<Gi+nr}function g(u,s){const c=u.inputType,h=o(u);c==="deleteCompositionText"||De&&Ol(s)||c!=="insertCompositionText"&&zr(s,()=>{const y=_n();if(c==="deleteContentBackward"){if(y===null){const me=$o();if(!Tt(me))return;Cr(me.clone())}if(Tt(y)){if(be&&vn(y.anchor.key),a(u.timeStamp)&&s.isComposing()&&y.anchor.key===y.focus.key){if(vn(null),Gi=0,setTimeout(()=>{zr(s,()=>{vn(null)})},nr),Tt(y)){const xe=y.anchor.getNode();if(xe.markDirty(),y.format=xe.getFormat(),!_t(xe))throw Error("Anchor node must be a TextNode");y.style=xe.getStyle()}y.anchor.getNode().getTextContent().length<=1&&(u.preventDefault(),dt(s,l,!0))}else vn(null),u.preventDefault(),dt(s,l,!0);return}}if(!Tt(y))return;const N=u.data;Hr!==null&&bs(!1,s,Hr),(!y.dirty||Hr!==null)&&y.isCollapsed()&&!Ur(y.anchor.getNode())&&h!==null&&y.applyDOMRange(h),Hr=null;const b=y.anchor,$=y.focus,ae=b.getNode(),he=$.getNode();if(c==="insertText"||c==="insertTranspose"){if(N===`
|
|
39
|
-
`)u.preventDefault(),dt(s,d,!1);else if(N===$t)u.preventDefault(),dt(s,f,void 0);else if(N==null&&u.dataTransfer){const me=u.dataTransfer.getData("text/plain");u.preventDefault(),y.insertRawText(me)}else N!=null&&
|
|
40
|
-
`){const h=_n();if(Tt(h)){const y=h.focus;h.anchor.set(y.key,y.offset,y.type),dt(u,re,null);return}}}bs(!0,u,s)}function Q(u,s){De?Vs=!0:zr(s,()=>{D(s,u.data)})}function ge(u,s){if(Gi=u.timeStamp,Pl=u.keyCode,s.isComposing())return;const{keyCode:c,shiftKey:h,ctrlKey:y,metaKey:N,altKey:b}=u;if(!dt(s,v,u)){if(ls(c,y,b,N))dt(s,k,u);else if(Oa(c,y,h,b,N))dt(s,G,u);else if(Lc(c,y,b,N))dt(s,I,u);else if(wa(c,y,h,b,N))dt(s,P,u);else if(Ic(c,y,N))dt(s,H,u);else if(vl(c,y,N))dt(s,j,u);else if(Tl(c,h))js=!0,dt(s,re,u);else if(kc(c))dt(s,te,u);else if(ks(c,y))u.preventDefault(),js=!0,dt(s,d,!0);else if(El(c,h))js=!1,dt(s,re,u);else if(Ta(c,b,N,y))Zr(c)?dt(s,ce,u):(u.preventDefault(),dt(s,l,!0));else if(ki(c))dt(s,V,u);else if(Dc(c,y,h,b,N))Pi(c)?dt(s,z,u):(u.preventDefault(),dt(s,l,!1));else if(Ps(c,b,y))u.preventDefault(),dt(s,E,!0);else if(Na(c,b,y))u.preventDefault(),dt(s,E,!1);else if(Ca(c,N))u.preventDefault(),dt(s,S,!0);else if(Ea(c,N))u.preventDefault(),dt(s,S,!1);else if(ya(c,b,N,y))u.preventDefault(),dt(s,w,"bold");else if(Is(c,b,N,y))u.preventDefault(),dt(s,w,"underline");else if(os(c,b,N,y))u.preventDefault(),dt(s,w,"italic");else if(_a(c,b,y,N))dt(s,q,u);else if(Ac(c,h,N,y))u.preventDefault(),dt(s,M,void 0);else if(xa(c,h,N,y))u.preventDefault(),dt(s,m,void 0);else{const $=s._editorState._selection;Kr($)?Mc(c,h,N,y)?(u.preventDefault(),dt(s,Y,u)):Rc(c,h,N,y)?(u.preventDefault(),dt(s,W,u)):mo(c,N,y)&&(u.preventDefault(),dt(s,J,u)):!De&&mo(c,N,y)&&(u.preventDefault(),dt(s,J,u))}$s(y,h,b,N)&&dt(s,A,u)}}function Ae(u){let s=u.__lexicalEventHandles;return s===void 0&&(s=[],u.__lexicalEventHandles=s),s}const Ye=new Map;function Xe(u){const s=u.target,c=s==null?null:s.nodeType===9?s.defaultView:s.ownerDocument.defaultView,h=ar(c);if(h===null)return;const y=fl(h.anchorNode);if(y===null)return;Oo&&(Oo=!1,zr(y,()=>{const me=$o(),xe=h.anchorNode;if(xe===null)return;const we=xe.nodeType;if(we!==ke&&we!==Fe)return;const Ce=Fc(me,h,y,u);Cr(Ce)}));const N=Ii(y),b=N[N.length-1],$=b._key,ae=Ye.get($),he=ae||b;he!==y&&Fl(h,he,!1),Fl(h,y,!0),y!==b?Ye.set($,y):ae&&Ye.delete($)}function Ke(u){u._lexicalHandled=!0}function Pe(u){return u._lexicalHandled===!0}function pt(u,s){Ys===0&&u.ownerDocument.addEventListener("selectionchange",Xe),Ys++,u.__lexicalEditor=s;const c=Ae(u);for(let h=0;h<kl.length;h++){const[y,N]=kl[h],b=typeof N=="function"?$=>{Pe($)||(Ke($),s.isEditable()&&N($,s))}:$=>{if(!Pe($)&&(Ke($),s.isEditable()))switch(y){case"cut":return dt(s,W,$);case"copy":return dt(s,Y,$);case"paste":return dt(s,_,$);case"dragstart":return dt(s,O,$);case"dragover":return dt(s,Z,$);case"dragend":return dt(s,oe,$);case"focus":return dt(s,_e,$);case"blur":return dt(s,B,$);case"drop":return dt(s,de,$)}};u.addEventListener(y,b),c.push(()=>{u.removeEventListener(y,b)})}}function wt(u){Ys!==0&&(Ys--,Ys===0&&u.ownerDocument.removeEventListener("selectionchange",Xe));const s=u.__lexicalEditor;s!=null&&(Ft(s),u.__lexicalEditor=null);const c=Ae(u);for(let h=0;h<c.length;h++)c[h]();u.__lexicalEventHandles=[]}function Ft(u){if(u._parentEditor!==null){const s=Ii(u),h=s[s.length-1]._key;Ye.get(h)===u&&Ye.delete(h)}else Ye.delete(u._key)}function zt(){Wr=!0}function Yn(u,s,c,h,y){Do=[u,s,c,h,y]}function Ar(u,s,c){fr();const h=u.__key,y=u.getParent();if(y===null)return;const N=cs(u);let b=!1;if(Tt(N)&&s){const $=N.anchor,ae=N.focus;$.key===h&&(Ga($,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0),ae.key===h&&(Ga(ae,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0)}else Kr(N)&&s&&u.isSelected()&&u.selectPrevious();if(Tt(N)&&s&&!b){const $=u.getIndexWithinParent();Vr(u),Ua(N,y,$,-1)}else Vr(u);!c&&!si(y)&&!y.canBeEmpty()&&y.isEmpty()&&Ar(y,s),s&&Ur(y)&&y.isEmpty()&&y.selectEnd()}class oi{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(s){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(s){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,hl(this,s),this.__type!=="root"&&(fr(),li(this.__type,this.constructor))}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){let s=this.__key;for(;s!==null;){if(s==="root")return!0;const c=Cn(s);if(c===null)break;s=c.__parent}return!1}isSelected(s){const c=s||_n();if(c==null)return!1;const h=c.getNodes().some(y=>y.__key===this.__key);return _t(this)?h:Tt(c)&&c.anchor.type==="element"&&c.focus.type==="element"&&c.anchor.key===c.focus.key&&c.anchor.offset===c.focus.offset?!1:h}getKey(){return this.__key}getIndexWithinParent(){const s=this.getParent();if(s===null)return-1;let c=s.getFirstChild(),h=0;for(;c!==null;){if(this.is(c))return h;h++,c=c.getNextSibling()}return-1}getParent(){const s=this.getLatest().__parent;return s===null?null:Cn(s)}getParentOrThrow(){const s=this.getParent();if(s===null)throw Error(`Expected node ${this.__key} to have a parent.`);return s}getTopLevelElement(){let s=this;for(;s!==null;){const c=s.getParent();if(si(c)){if(!et(s))throw Error("Children of root nodes must be elements");return s}s=c}return null}getTopLevelElementOrThrow(){const s=this.getTopLevelElement();if(s===null)throw Error(`Expected node ${this.__key} to have a top parent element.`);return s}getParents(){const s=[];let c=this.getParent();for(;c!==null;)s.push(c),c=c.getParent();return s}getParentKeys(){const s=[];let c=this.getParent();for(;c!==null;)s.push(c.__key),c=c.getParent();return s}getPreviousSibling(){const c=this.getLatest().__prev;return c===null?null:Cn(c)}getPreviousSiblings(){const s=[],c=this.getParent();if(c===null)return s;let h=c.getFirstChild();for(;h!==null&&!h.is(this);)s.push(h),h=h.getNextSibling();return s}getNextSibling(){const c=this.getLatest().__next;return c===null?null:Cn(c)}getNextSiblings(){const s=[];let c=this.getNextSibling();for(;c!==null;)s.push(c),c=c.getNextSibling();return s}getCommonAncestor(s){const c=this.getParents(),h=s.getParents();et(this)&&c.unshift(this),et(s)&&h.unshift(s);const y=c.length,N=h.length;if(y===0||N===0||c[y-1]!==h[N-1])return null;const b=new Set(h);for(let $=0;$<y;$++){const ae=c[$];if(b.has(ae))return ae}return null}is(s){return s==null?!1:this.__key===s.__key}isBefore(s){if(this===s)return!1;if(s.isParentOf(this))return!0;if(this.isParentOf(s))return!1;const c=this.getCommonAncestor(s);let h=0,y=0,N=this;for(;;){const b=N.getParentOrThrow();if(b===c){h=N.getIndexWithinParent();break}N=b}for(N=s;;){const b=N.getParentOrThrow();if(b===c){y=N.getIndexWithinParent();break}N=b}return h<y}isParentOf(s){const c=this.__key;if(c===s.__key)return!1;let h=s;for(;h!==null;){if(h.__key===c)return!0;h=h.getParent()}return!1}getNodesBetween(s){const c=this.isBefore(s),h=[],y=new Set;let N=this;for(;;){const b=N.__key;if(y.has(b)||(y.add(b),h.push(N)),N===s)break;const $=et(N)?c?N.getFirstChild():N.getLastChild():null;if($!==null){N=$;continue}const ae=c?N.getNextSibling():N.getPreviousSibling();if(ae!==null){N=ae;continue}const he=N.getParentOrThrow();if(y.has(he.__key)||h.push(he),he===s)break;let me=null,xe=he;do{if(xe===null)throw Error("getNodesBetween: ancestor is null");me=c?xe.getNextSibling():xe.getPreviousSibling(),xe=xe.getParent(),xe!==null&&me===null&&!y.has(xe.__key)&&h.push(xe)}while(me===null);N=me}return c||h.reverse(),h}isDirty(){const c=xn()._dirtyLeaves;return c!==null&&c.has(this.__key)}getLatest(){const s=Cn(this.__key);if(s===null)throw Error("Lexical node does not exist in active editor state. Avoid using the same node references between nested closures from editorState.read/editor.update.");return s}getWritable(){fr();const s=xi(),c=xn(),h=s._nodeMap,y=this.__key,N=this.getLatest(),b=N.__parent,$=c._cloneNotNeeded,ae=_n();if(ur(ae)&&ae.setCachedNodes(null),$.has(y))return Ri(N),N;const me=N.constructor.clone(N);return me.__parent=b,me.__next=N.__next,me.__prev=N.__prev,et(N)&&et(me)?(me.__first=N.__first,me.__last=N.__last,me.__size=N.__size,me.__indent=N.__indent,me.__format=N.__format,me.__dir=N.__dir):_t(N)&&_t(me)&&(me.__format=N.__format,me.__style=N.__style,me.__mode=N.__mode,me.__detail=N.__detail),$.add(y),me.__key=y,Ri(me),h.set(y,me),me}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(s,c){throw Error("createDOM: base method not extended")}updateDOM(s,c,h){throw Error("updateDOM: base method not extended")}exportDOM(s){return{element:this.createDOM(s._config,s)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(s){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(s){Ar(this,!0,s)}replace(s,c){fr();let h=_n();h!==null&&(h=h.clone()),Bs(this,s);const y=this.getLatest(),N=this.__key,b=s.__key,$=s.getWritable(),ae=this.getParentOrThrow().getWritable(),he=ae.__size;Vr($);const me=y.getPreviousSibling(),xe=y.getNextSibling(),we=y.__prev,Ce=y.__next,Ve=y.__parent;if(Ar(y,!1,!0),me===null)ae.__first=b;else{const Ue=me.getWritable();Ue.__next=b}if($.__prev=we,xe===null)ae.__last=b;else{const Ue=xe.getWritable();Ue.__prev=b}if($.__next=Ce,$.__parent=Ve,ae.__size=he,c){if(!(et(this)&&et($)))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Ue=>{$.append(Ue)})}if(Tt(h)){Cr(h);const Ue=h.anchor,$e=h.focus;Ue.key===N&&mn(Ue,$),$e.key===N&&mn($e,$)}return lr()===N&&vn(b),$}insertAfter(s,c=!0){fr(),Bs(this,s);const h=this.getWritable(),y=s.getWritable(),N=y.getParent(),b=_n();let $=!1,ae=!1;if(N!==null){const Ce=s.getIndexWithinParent();if(Vr(y),Tt(b)){const Ve=N.__key,Ue=b.anchor,$e=b.focus;$=Ue.type==="element"&&Ue.key===Ve&&Ue.offset===Ce+1,ae=$e.type==="element"&&$e.key===Ve&&$e.offset===Ce+1}}const he=this.getNextSibling(),me=this.getParentOrThrow().getWritable(),xe=y.__key,we=h.__next;if(he===null)me.__last=xe;else{const Ce=he.getWritable();Ce.__prev=xe}if(me.__size++,h.__next=xe,y.__next=we,y.__prev=h.__key,y.__parent=h.__parent,c&&Tt(b)){const Ce=this.getIndexWithinParent();Ua(b,me,Ce+1);const Ve=me.__key;$&&b.anchor.set(Ve,Ce+2,"element"),ae&&b.focus.set(Ve,Ce+2,"element")}return s}insertBefore(s,c=!0){fr(),Bs(this,s);const h=this.getWritable(),y=s.getWritable(),N=y.__key;Vr(y);const b=this.getPreviousSibling(),$=this.getParentOrThrow().getWritable(),ae=h.__prev,he=this.getIndexWithinParent();if(b===null)$.__first=N;else{const xe=b.getWritable();xe.__next=N}$.__size++,h.__prev=N,y.__prev=ae,y.__next=h.__key,y.__parent=h.__parent;const me=_n();if(c&&Tt(me)){const xe=this.getParentOrThrow();Ua(me,xe,he)}return s}isParentRequired(){return!1}createParentElementNode(){return qi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(s,c){fr();const h=this.getPreviousSibling(),y=this.getParentOrThrow();if(h===null)return y.select(0,0);if(et(h))return h.select();if(!_t(h)){const N=h.getIndexWithinParent()+1;return y.select(N,N)}return h.select(s,c)}selectNext(s,c){fr();const h=this.getNextSibling(),y=this.getParentOrThrow();if(h===null)return y.select();if(et(h))return h.select(0,0);if(!_t(h)){const N=h.getIndexWithinParent();return y.select(N,N)}return h.select(s,c)}markDirty(){this.getWritable()}}function li(u,s){const c=xn()._nodes.get(u);if(c===void 0)throw Error(`Create node: Attempted to create node ${s.name} that was not configured to be used on the editor.`);const h=c.klass;if(h!==s)throw Error(`Create node: Type ${u} in node ${s.name} does not match registered node ${h.name} with the same type`)}function Hl(u,s,c){const h=s.getParentOrThrow().getLastChild();let y=s;const N=[s];for(;y!==h;){if(!y.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");y=y.getNextSibling(),N.push(y)}let b=u;for(const $ of N)b=b.insertAfter($)}class ji extends oi{static getType(){return"linebreak"}static clone(s){return new ji(s.__key)}constructor(s){super(s)}getTextContent(){return`
|
|
41
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:s=>{const c=s.parentElement;let h,y;return c!==null&&((h=c.firstChild)===s||h.nextSibling===s&&h.nodeType===Fe&&(h.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((y=c.lastChild)===s||y.previousSibling===s&&y.nodeType===Fe&&(y.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:
|
|
38
|
+
`,Kt=De?gt:mt,nn="֑-߿יִ-﷽ﹰ-ﻼ",It="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",Vt=new RegExp("^[^"+It+"]*["+nn+"]"),bt=new RegExp("^[^"+nn+"]*["+It+"]"),rn={bold:Oe,code:Le,highlight:it,italic:ie,strikethrough:le,subscript:Me,superscript:je,underline:ve},Or={directionless:ot,unmergeable:St},_i={center:ze,end:Et,justify:yt,left:Ge,right:tt,start:Nt},pe={[ze]:"center",[Et]:"end",[yt]:"justify",[Ge]:"left",[tt]:"right",[Nt]:"start"},Ze={normal:At,segmented:tn,token:Ut},lt={[At]:"normal",[tn]:"segmented",[Ut]:"token"},wt=100;let Gt=!1,Bt=0;function Pt(){return Gt}function kt(u){Bt=u.timeStamp}function Ht(u){Bt===0&&Co(u).addEventListener("textInput",kt,!0)}function on(u,s,c){return s.__lexicalLineBreak===u||u[`__lexicalKey_${c._key}`]!==void 0}function an(u){return u.getEditorState().read(()=>{const s=_n();return s!==null?s.clone():null})}function bn(u,s,c){const h=ar(c._window);let y=null,N=null;h!==null&&h.anchorNode===u&&(y=h.anchorOffset,N=h.focusOffset);const b=u.nodeValue;b!==null&&$r(s,b,y,N,!1)}function yr(u,s,c){if(Tt(u)){const h=u.anchor.getNode();if(h.is(c)&&u.format!==h.getFormat())return!1}return s.nodeType===Fe&&c.isAttached()}function Zn(u,s,c){Gt=!0;const h=performance.now()-Bt>wt;try{zr(u,()=>{const y=_n()||an(u),N=new Map,b=u.getRootElement(),$=u._editorState,ae=u._blockCursorElement;let he=!1,me="";for(let we=0;we<s.length;we++){const Ce=s[we],Ve=Ce.type,Ue=Ce.target;let $e=ii(Ue,$);if(!($e===null&&Ue!==b||An($e))){if(Ve==="characterData")h&&_t($e)&&yr(y,Ue,$e)&&bn(Ue,$e,u);else if(Ve==="childList"){he=!0;const Rt=Ce.addedNodes;for(let Zt=0;Zt<Rt.length;Zt++){const Wt=Rt[Zt],Dt=go(Wt),cn=Wt.parentNode;if(cn!=null&&Wt!==ae&&Dt===null&&(Wt.nodeName!=="BR"||!on(Wt,cn,u))){if(De){const ir=Wt.innerText||Wt.nodeValue;ir&&(me+=ir)}cn.removeChild(Wt)}}const Qe=Ce.removedNodes,ht=Qe.length;if(ht>0){let Zt=0;for(let Wt=0;Wt<ht;Wt++){const Dt=Qe[Wt];(Dt.nodeName==="BR"&&on(Dt,Ue,u)||ae===Dt)&&(Ue.appendChild(Dt),Zt++)}ht!==Zt&&(Ue===b&&($e=ml($)),N.set(Ue,$e))}}}}if(N.size>0)for(const[we,Ce]of N)if(et(Ce)){const Ve=Ce.getChildrenKeys();let Ue=we.firstChild;for(let $e=0;$e<Ve.length;$e++){const Rt=Ve[$e],Qe=u.getElementByKey(Rt);Qe!==null&&(Ue==null?(we.appendChild(Qe),Ue=Qe):Ue!==Qe&&we.replaceChild(Qe,Ue),Ue=Ue.nextSibling)}}else _t(Ce)&&Ce.markDirty();const xe=c.takeRecords();if(xe.length>0){for(let we=0;we<xe.length;we++){const Ce=xe[we],Ve=Ce.addedNodes,Ue=Ce.target;for(let $e=0;$e<Ve.length;$e++){const Rt=Ve[$e],Qe=Rt.parentNode;Qe!=null&&Rt.nodeName==="BR"&&!on(Rt,Ue,u)&&Qe.removeChild(Rt)}}c.takeRecords()}y!==null&&(he&&(y.dirty=!0,Cr(y)),De&&Ol(u)&&y.insertRawText(me))})}finally{Gt=!1}}function fn(u){const s=u._observer;if(s!==null){const c=s.takeRecords();Zn(u,c,s)}}function sr(u){Ht(u),u._observer=new MutationObserver((s,c)=>{Zn(u,s,c)})}function or(u,s){const c=u.__mode,h=u.__format,y=u.__style,N=s.__mode,b=s.__format,$=s.__style;return(c===null||c===N)&&(h===null||h===b)&&(y===null||y===$)}function Ai(u,s){const c=u.mergeWithSibling(s),h=xn()._normalizedNodes;return h.add(u.__key),h.add(s.__key),c}function Nr(u){let s=u;if(s.__text===""&&s.isSimpleText()&&!s.isUnmergeable()){s.remove();return}let c;for(;(c=s.getPreviousSibling())!==null&&_t(c)&&c.isSimpleText()&&!c.isUnmergeable();)if(c.__text==="")c.remove();else if(or(c,s)){s=Ai(c,s);break}else break;let h;for(;(h=s.getNextSibling())!==null&&_t(h)&&h.isSimpleText()&&!h.isUnmergeable();)if(h.__text==="")h.remove();else if(or(s,h)){s=Ai(s,h);break}else break}function ws(u){return fo(u.anchor),fo(u.focus),u}function fo(u){for(;u.type==="element";){const s=u.getNode(),c=u.offset;let h,y;if(c===s.getChildrenSize()?(h=s.getChildAtIndex(c-1),y=!0):(h=s.getChildAtIndex(c),y=!1),_t(h)){u.set(h.__key,y?h.getTextContentSize():0,"text");break}else if(!et(h))break;u.set(h.__key,y?h.getChildrenSize():0,"element")}}let dl=1;function jr(){return""+dl++}function ma(u,s){const c=u._nodes.get(s);if(c===void 0)throw Error(`registeredNode: Type ${s} not found`);return c}const ho=typeof queueMicrotask=="function"?queueMicrotask:u=>{Promise.resolve().then(u)};function rs(u){return An(ii(u))}function Os(u){const s=document.activeElement;if(s===null)return!1;const c=s.nodeName;return An(ii(u))&&(c==="INPUT"||c==="TEXTAREA"||s.contentEditable==="true"&&s.__lexicalEditor==null)}function is(u,s,c){const h=u.getRootElement();try{return h!==null&&h.contains(s)&&h.contains(c)&&s!==null&&!Os(s)&&fl(s)===u}catch{return!1}}function fl(u){let s=u;for(;s!=null;){const c=s.__lexicalEditor;if(c!=null)return c;s=No(s)}return null}function Ln(u){return Vt.test(u)?"rtl":bt.test(u)?"ltr":null}function zn(u){return u.isToken()||u.isSegmented()}function ri(u){return u.nodeType===Fe}function Pr(u){let s=u;for(;s!=null;){if(ri(s))return s;s=s.firstChild}return null}function Bn(u,s,c){const h=rn[s];if(c!==null&&(u&h)===(c&h))return u;let y=u^h;return s==="subscript"?y&=-65:s==="superscript"&&(y&=-33),y}function Ds(u){return _t(u)||ai(u)||An(u)}function hl(u,s){if(s!=null){u.__key=s;return}fr(),tf();const c=xn(),h=xi(),y=jr();h._nodeMap.set(y,u),et(u)?c._dirtyElements.set(y,!0):c._dirtyLeaves.add(y),c._cloneNotNeeded.add(y),c._dirtyType=Be,u.__key=y}function gl(u,s,c){let h=u;for(;h!==null;){if(c.has(h))return;const y=s.get(h);if(y===void 0)break;c.set(h,!1),h=y.__parent}}function Vr(u){const s=u.getParent();if(s!==null){const c=u.getWritable(),h=s.getWritable(),y=u.getPreviousSibling(),N=u.getNextSibling();if(y===null)if(N!==null){const b=N.getWritable();h.__first=N.__key,b.__prev=null}else h.__first=null;else{const b=y.getWritable();if(N!==null){const $=N.getWritable();$.__prev=b.__key,b.__next=$.__key}else b.__next=null;c.__prev=null}if(N===null)if(y!==null){const b=y.getWritable();h.__last=y.__key,b.__next=null}else h.__last=null;else{const b=N.getWritable();if(y!==null){const $=y.getWritable();$.__next=b.__key,b.__prev=$.__key}else b.__prev=null;c.__next=null}h.__size--,c.__parent=null}}function Mi(u){tf();const s=u.getLatest(),c=s.__parent,h=xi(),y=xn(),N=h._nodeMap,b=y._dirtyElements;c!==null&&gl(c,N,b);const $=s.__key;y._dirtyType=Be,et(u)?b.set($,!0):y._dirtyLeaves.add($)}function pl(u){const s=u.getPreviousSibling(),c=u.getNextSibling();s!==null&&Mi(s),c!==null&&Mi(c)}function vn(u){fr();const s=xn(),c=s._compositionKey;if(u!==c){if(s._compositionKey=u,c!==null){const h=Cn(c);h!==null&&h.getWritable()}if(u!==null){const h=Cn(u);h!==null&&h.getWritable()}}}function lr(){return Bo()?null:xn()._compositionKey}function Cn(u,s){const h=(s||xi())._nodeMap.get(u);return h===void 0?null:h}function go(u,s){const c=xn(),h=u[`__lexicalKey_${c._key}`];return h!==void 0?Cn(h,s):null}function ii(u,s){let c=u;for(;c!=null;){const h=go(c,s);if(h!==null)return h;c=No(c)}return null}function As(u){const s=u._decorators,c=Object.assign({},s);return u._pendingDecorators=c,c}function po(u){return u.read(()=>tr().getTextContent())}function Ri(u,s){zr(u,()=>{const c=xi();if(c.isEmpty())return;if(s==="root"){tr().markDirty();return}const h=c._nodeMap;for(const[,y]of h)y.markDirty()},u._pendingEditorState===null?{tag:"history-merge"}:void 0)}function tr(){return ml(xi())}function ml(u){return u._nodeMap.get("root")}function Cr(u){fr();const s=xi();if(u!==null){if(Object.isFrozen(u))throw Error("$setSelection called on frozen selection object. Ensure selection is cloned before passing in.");u.dirty=!0,u.setCachedNodes(null)}s._selection=u}function _l(){fr();const u=xn();fn(u)}function bi(u){const s=xn(),c=_a(u,s);if(c===null){const h=s.getRootElement();return u===h?Cn("root"):null}return Cn(c)}function yl(u,s){return s?u.getTextContentSize():0}function _a(u,s){let c=u;for(;c!=null;){const h=c[`__lexicalKey_${s._key}`];if(h!==void 0)return h;c=No(c)}return null}function Ms(u){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(u)}function Li(u){const s=[];let c=u;for(;c!==null;)s.push(c),c=c._parentEditor;return s}function Nl(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function mo(u){return u.nodeType===Fe?u.nodeValue:null}function Rs(u,s,c){const h=ar(s._window);if(h===null)return;const y=h.anchorNode;let{anchorOffset:N,focusOffset:b}=h;if(y!==null){let $=mo(y);const ae=ii(y);if($!==null&&_t(ae)){if($===mt&&c){const he=c.length;$=c,N=he,b=he}$!==null&&$r(ae,$,N,b,u)}}}function $r(u,s,c,h,y){let N=u;if(N.isAttached()&&(y||!N.isDirty())){const b=N.isComposing();let $=s;(b||y)&&s[s.length-1]===mt&&($=s.slice(0,-1));const ae=N.getTextContent();if(y||$!==ae){if($===""){if(vn(null),!ne&&!ue&&!Re){const Ue=xn();setTimeout(()=>{Ue.update(()=>{N.isAttached()&&N.remove()})},20)}else N.remove();return}const he=N.getParent(),me=Fo(),xe=N.getTextContentSize(),we=lr(),Ce=N.getKey();if(N.isToken()||we!==null&&Ce===we&&!b||Tt(me)&&(he!==null&&!he.canInsertTextBefore()&&me.anchor.offset===0||me.anchor.key===u.__key&&me.anchor.offset===0&&!N.canInsertTextBefore()&&!b||me.focus.key===u.__key&&me.focus.offset===xe&&!N.canInsertTextAfter()&&!b)){N.markDirty();return}const Ve=_n();if(!Tt(Ve)||c===null||h===null){N.setTextContent($);return}if(Ve.setTextNodeRange(N,c,N,h),N.isSegmented()){const Ue=N.getTextContent(),$e=Dn(Ue);N.replace($e),N=$e}N.setTextContent($)}}}function Cl(u){const s=u.getPreviousSibling();return(_t(s)||et(s)&&s.isInline())&&!s.canInsertTextAfter()}function bs(u,s){if(s.isSegmented())return!0;if(!u.isCollapsed())return!1;const c=u.anchor.offset,h=s.getParentOrThrow(),y=s.isToken();return c===0?!s.canInsertTextBefore()||!h.canInsertTextBefore()||y||Cl(s):c===s.getTextContentSize()?!s.canInsertTextAfter()||!h.canInsertTextAfter()||y:!1}function ya(u,s,c,h){return u===9&&!s&&!c&&!h}function Na(u,s,c,h){return u===66&&!s&&qr(c,h)}function ss(u,s,c,h){return u===73&&!s&&qr(c,h)}function Ls(u,s,c,h){return u===85&&!s&&qr(c,h)}function El(u,s){return Aa(u)&&!s}function Tl(u,s){return Aa(u)&&s}function Is(u,s){return ye&&s&&u===79}function ks(u,s,c){return Zr(u)&&(ye?s:c)}function Ca(u,s,c){return ki(u)&&(ye?s:c)}function Ea(u,s){return ye&&s&&Zr(u)}function Ta(u,s){return ye&&s&&ki(u)}function xa(u,s,c,h){return ye?s||c?!1:Zr(u)||u===72&&h:h||s||c?!1:Zr(u)}function Rc(u,s,c,h,y){return ye?c||h||y?!1:ki(u)||u===68&&s:s||h||y?!1:ki(u)}function bc(u,s,c,h){return u===90&&!s&&qr(c,h)}function va(u,s,c,h){return ye?u===90&&c&&s:u===89&&h||u===90&&h&&s}function Lc(u,s,c,h){return s?!1:u===67?ye?c:h:!1}function Ic(u,s,c,h){return s?!1:u===88?ye?c:h:!1}function Sa(u){return u===37}function wa(u){return u===39}function xl(u){return u===38}function kc(u){return u===40}function Pc(u,s,c,h){return Sa(u)&&!s&&!h&&!c}function Oa(u,s,c,h,y){return Sa(u)&&!h&&!c&&(s||y)}function os(u,s,c,h){return wa(u)&&!s&&!h&&!c}function Da(u,s,c,h,y){return wa(u)&&!h&&!c&&(s||y)}function $c(u,s,c){return xl(u)&&!s&&!c}function vl(u,s,c){return kc(u)&&!s&&!c}function Ps(u,s,c,h){return u||s||c||h}function Fc(u){return u===32}function qr(u,s){return ye?u:s}function Aa(u){return u===13}function Zr(u){return u===8}function Ii(u){return u===27}function ki(u){return u===46}function _o(u,s,c){return u===65&&qr(s,c)}function Sl(){const u=tr(),s=u.select(0,u.getChildrenSize());Cr(ws(s))}function Pi(u,s){u.__lexicalClassNameCache===void 0&&(u.__lexicalClassNameCache={});const c=u.__lexicalClassNameCache,h=c[s];if(h!==void 0)return h;const y=u[s];if(typeof y=="string"){const N=y.split(" ");return c[s]=N,N}return y}function ls(u,s,c,h,y){if(c.size===0)return;const N=h.__type,b=h.__key,$=s.get(N);if($===void 0)throw Error(`Type ${N} not in registeredNodes`);const ae=$.klass;let he=u.get(ae);he===void 0&&(he=new Map,u.set(ae,he));const me=he.get(b),xe=me==="destroyed"&&y==="created";(me===void 0||xe)&&he.set(b,xe?"updated":y)}function $i(u){const s=xi(),c=s._readOnly,h=u.getType(),y=s._nodeMap,N=[];for(const[,b]of y)b instanceof u&&b.__type===h&&(c||b.isAttached())&&N.push(b);return N}function Ma(u,s,c){const h=u.getParent();let y=c,N=u;return h!==null&&(s&&c===0?(y=N.getIndexWithinParent(),N=h):!s&&c===N.getChildrenSize()&&(y=N.getIndexWithinParent()+1,N=h)),N.getChildAtIndex(s?y-1:y)}function wl(u,s){const c=u.offset;if(u.type==="element"){const h=u.getNode();return Ma(h,s,c)}else{const h=u.getNode();if(s&&c===0||!s&&c===h.getTextContentSize()){const y=s?h.getPreviousSibling():h.getNextSibling();return y===null?Ma(h.getParentOrThrow(),s,h.getIndexWithinParent()+(s?0:1)):y}}return null}function Ol(u){const s=Co(u).event,c=s&&s.inputType;return c==="insertFromPaste"||c==="insertFromPasteAsQuotation"}function dt(u,s,c){return lf(u,s,c)}function yo(u){return!Ur(u)&&!u.isLastChild()&&!u.isInline()}function $s(u,s){const c=u._keyToDOMMap.get(s);if(c===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${s}`);return c}function No(u){const s=u.assignedSlot||u.parentElement;return s!==null&&s.nodeType===11?s.host:s}function yi(u,s,c){const h=c.ownerDocument,y=h.defaultView;if(y===null)return;let{top:N,bottom:b}=s,$=0,ae=0,he=c;for(;he!==null;){const me=he===h.body;if(me)$=0,ae=Co(u).innerHeight;else{const we=he.getBoundingClientRect();$=we.top,ae=we.bottom}let xe=0;if(N<$?xe=-($-N):b>ae&&(xe=b-ae),xe!==0)if(me)y.scrollBy(0,xe);else{const we=he.scrollTop;he.scrollTop+=xe;const Ce=he.scrollTop-we;N-=Ce,b-=Ce}if(me)break;he=No(he)}}function Un(u){return xn()._updateTags.has(u)}function Ct(u){fr(),xn()._updateTags.add(u)}function as(u){const s=_n();if(!Tt(s)||!et(u))return s;const{anchor:c,focus:h}=s,y=c.getNode(),N=h.getNode();return Fi(y,u)&&c.set(u.__key,0,"element"),Fi(N,u)&&h.set(u.__key,0,"element"),s}function Fi(u,s){let c=u.getParent();for(;c!==null;){if(c.is(s))return!0;c=c.getParent()}return!1}function Ra(u){const s=u.ownerDocument;return s&&s.defaultView||null}function Co(u){const s=u._window;if(s===null)throw Error("window object not found");return s}function Fr(u){return et(u)&&u.isInline()||An(u)&&u.isInline()}function Eo(u){let s=u.getParentOrThrow();for(;s!==null;){if(si(s))return s;s=s.getParentOrThrow()}return s}function si(u){return Ur(u)||et(u)&&u.isShadowRoot()}function Dl(u){const s=u.constructor.clone(u);return hl(s,null),s}function Dr(u){const s=xn(),c=u.constructor.getType(),h=s._nodes.get(c);if(h===void 0)throw Error('$initializeNode failed. Ensure node has been registered to the editor. You can do this by passing the node class via the "nodes" array in the editor config.');const y=h.replace;if(y!==null){const N=y(u);if(!(N instanceof u.constructor))throw Error("$initializeNode failed. Ensure replacement node is a subclass of the original node.");return N}return u}function Fs(u,s){const c=u.getParent();if(Ur(c)&&!et(s)&&!An(s))throw Error("Only element or decorator nodes can be inserted in to the root node")}function To(u){const s=u.theme,c=document.createElement("div");c.contentEditable="false",c.setAttribute("data-lexical-cursor","true");let h=s.blockCursor;if(h!==void 0){if(typeof h=="string"){const y=h.split(" ");h=s.blockCursor=y}h!==void 0&&c.classList.add(...h)}return c}function Mt(u){return(An(u)||et(u)&&!u.canBeEmpty())&&!u.isInline()}function Bs(u,s,c){c.style.removeProperty("caret-color"),s._blockCursorElement=null;const h=u.parentElement;h!==null&&h.removeChild(u)}function Ni(u,s,c){let h=u._blockCursorElement;if(Tt(c)&&c.isCollapsed()&&c.anchor.type==="element"&&s.contains(document.activeElement)){const y=c.anchor,N=y.getNode(),b=y.offset,$=N.getChildrenSize();let ae=!1,he=null;if(b===$){const me=N.getChildAtIndex(b-1);Mt(me)&&(ae=!0)}else{const me=N.getChildAtIndex(b);if(Mt(me)){const xe=me.getPreviousSibling();(xe===null||Mt(xe))&&(ae=!0,he=u.getElementByKey(me.__key))}}if(ae){const me=u.getElementByKey(N.__key);h===null&&(u._blockCursorElement=h=To(u._config)),s.style.caretColor="transparent",he===null?me.appendChild(h):me.insertBefore(h,he);return}}h!==null&&Bs(h,u,s)}function ar(u){return F?(u||window).getSelection():null}function ba(u,s){let c=u.getChildAtIndex(s);if(c==null&&(c=u),si(u))throw Error("Can not call $splitNode() on root element");const h=b=>{const $=b.getParentOrThrow(),ae=si($),he=b===c&&!ae?b:Dl(b);if(ae){if(!(et(b)&&et(he)))throw Error("Children of a root must be ElementNode");return b.insertAfter(he),[b,he,he]}else{const[me,xe,we]=h($),Ce=b.getNextSiblings();return we.append(he,...Ce),[me,xe,he]}},[y,N]=h(c);return[y,N]}function xo(u,s){let c=u;for(;c!==tr()&&c!=null;){if(s(c))return c;c=c.getParent()}return null}function La(u){return Hs(u)&&u.tagName==="A"}function Hs(u){return u.nodeType===1}function Bi(u){if(An(u)&&!u.isInline())return!0;if(!et(u)||si(u))return!1;const s=u.getFirstChild(),c=s===null||ai(s)||_t(s)||s.isInline();return!u.isInline()&&u.canBeEmpty()!==!1&&c}function vo(u,s){let c=u;for(;c!==null&&c.getParent()!==null&&!s(c);)c=c.getParentOrThrow();return s(c)?c:null}function Ia(u,s){const c=u._decorators;let y=u._pendingDecorators||c;const N=s._nodeMap;let b;for(b in y)N.has(b)||(y===c&&(y=As(u)),delete y[b])}function Al(u,s,c,h,y,N){let b=u.getFirstChild();for(;b!==null;){const $=b.__key;b.__parent===s&&(et(b)&&Al(b,$,c,h,y,N),c.has($)||N.delete($),y.push($)),b=b.getNextSibling()}}function Ml(u,s,c,h){const y=u._nodeMap,N=s._nodeMap,b=[];for(const[$]of h){const ae=N.get($);ae!==void 0&&(ae.isAttached()||(et(ae)&&Al(ae,$,y,N,b,h),y.has($)||h.delete($),b.push($)))}for(const $ of b)N.delete($);for(const $ of c){const ae=N.get($);ae!==void 0&&!ae.isAttached()&&(y.has($)||c.delete($),N.delete($))}}let In="",Gn="",qt="",Er,Hn,cs,ka=!1,us=!1,Ws,Ks=null,zs,Rl,Hi,gn,On,Wn;function ds(u,s){const c=Hi.get(u);if(s!==null){const h=Oo(u);h.parentNode===s&&s.removeChild(h)}if(gn.has(u)||Hn._keyToDOMMap.delete(u),et(c)){const h=Ei(c,Hi);Wi(h,0,h.length-1,null)}c!==void 0&&ls(Wn,cs,Ws,c,"destroyed")}function Wi(u,s,c,h){let y=s;for(;y<=c;++y){const N=u[y];N!==void 0&&ds(N,h)}}function Ci(u,s){u.setProperty("text-align",s)}const fs="40px";function Jn(u,s){const c=Er.theme.indent;if(typeof c=="string"){const y=u.classList.contains(c);s>0&&!y?u.classList.add(c):s<1&&y&&u.classList.remove(c)}const h=getComputedStyle(u).getPropertyValue("--lexical-indent-base-value")||fs;u.style.setProperty("padding-inline-start",s===0?"":`calc(${s} * ${h})`)}function Br(u,s){const c=u.style;s===0?Ci(c,""):s===Ge?Ci(c,"left"):s===ze?Ci(c,"center"):s===tt?Ci(c,"right"):s===yt?Ci(c,"justify"):s===Nt?Ci(c,"start"):s===Et&&Ci(c,"end")}function hn(u,s,c){const h=gn.get(u);if(h===void 0)throw Error("createNode: node does not exist in nodeMap");const y=h.createDOM(Er,Hn);if(Je(u,y,Hn),_t(h)?y.setAttribute("data-lexical-text","true"):An(h)&&y.setAttribute("data-lexical-decorator","true"),et(h)){const N=h.__indent,b=h.__size;if(N!==0&&Jn(y,N),b!==0){const ae=b-1,he=Ei(h,gn);Pa(he,ae,h,y)}const $=h.__format;$!==0&&Br(y,$),h.isInline()||So(null,h,y),yo(h)&&(In+=$t,qt+=$t)}else{const N=h.getTextContent();if(An(h)){const b=h.decorate(Hn,Er);b!==null&&Il(u,b),y.contentEditable="false"}else _t(h)&&(h.isDirectionless()||(Gn+=N));In+=N,qt+=N}if(s!==null)if(c!=null)s.insertBefore(y,c);else{const N=s.__lexicalLineBreak;N!=null?s.insertBefore(y,N):s.appendChild(y)}return Object.freeze(h),ls(Wn,cs,Ws,h,"created"),y}function Pa(u,s,c,h){const y=Gn;Gn="",bl(u,c,0,s,h,null),Ll(c,h),Gn=y}function bl(u,s,c,h,y,N){const b=In;In="";let $=c;for(;$<=h;++$)hn(u[$],y,N);yo(s)&&(In+=$t),y.__lexicalTextContent=In,In=b+In}function $a(u,s){const c=s.get(u);return ai(c)||An(c)&&c.isInline()}function So(u,s,c){const h=u!==null&&(u.__size===0||$a(u.__last,Hi)),y=s.__size===0||$a(s.__last,gn);if(h){if(!y){const N=c.__lexicalLineBreak;N!=null&&c.removeChild(N),c.__lexicalLineBreak=null}}else if(y){const N=document.createElement("br");c.__lexicalLineBreak=N,c.appendChild(N)}}function Ll(u,s){const c=s.__lexicalDirTextContent,h=s.__lexicalDir;if(c!==Gn||h!==Ks){const y=Gn==="",N=y?Ks:Ln(Gn);if(N!==h){const b=s.classList,$=Er.theme;let ae=h!==null?$[h]:void 0,he=N!==null?$[N]:void 0;if(ae!==void 0){if(typeof ae=="string"){const me=ae.split(" ");ae=$[h]=me}b.remove(...ae)}if(N===null||y&&N==="ltr")s.removeAttribute("dir");else{if(he!==void 0){if(typeof he=="string"){const me=he.split(" ");he=$[N]=me}he!==void 0&&b.add(...he)}s.dir=N}if(!us){const me=u.getWritable();me.__dir=N}}Ks=N,s.__lexicalDirTextContent=Gn,s.__lexicalDir=N}}function Ki(u,s,c){const h=Gn;Gn="",ct(u,s,c),Ll(s,c),Gn=h}function Ei(u,s){const c=[];let h=u.__first;for(;h!==null;){const y=s.get(h);if(y===void 0)throw Error("createChildrenArray: node does not exist in nodeMap");c.push(h),h=y.__next}return c}function ct(u,s,c){const h=In,y=u.__size,N=s.__size;if(In="",y===1&&N===1){const b=u.__first,$=s.__first;if(b===$)hs(b,c);else{const ae=Oo(b),he=hn($,null,null);c.replaceChild(he,ae),ds(b,null)}}else{const b=Ei(u,Hi),$=Ei(s,gn);if(y===0)N!==0&&bl($,s,0,N-1,c,null);else if(N===0){if(y!==0){const he=c.__lexicalLineBreak==null;Wi(b,0,y-1,he?null:c),he&&(c.textContent="")}}else En(s,b,$,y,N,c)}yo(s)&&(In+=$t),c.__lexicalTextContent=In,In=h+In}function hs(u,s){const c=Hi.get(u);let h=gn.get(u);if(c===void 0||h===void 0)throw Error("reconcileNode: prevNode or nextNode does not exist in nodeMap");const y=ka||Rl.has(u)||zs.has(u),N=$s(Hn,u);if(c===h&&!y){if(et(c)){const b=N.__lexicalTextContent;b!==void 0&&(In+=b,qt+=b);const $=N.__lexicalDirTextContent;$!==void 0&&(Gn+=$)}else{const b=c.getTextContent();_t(c)&&!c.isDirectionless()&&(Gn+=b),qt+=b,In+=b}return N}if(c!==h&&y&&ls(Wn,cs,Ws,h,"updated"),h.updateDOM(c,N,Er)){const b=hn(u,null,null);if(s===null)throw Error("reconcileNode: parentDOM is null");return s.replaceChild(b,N),ds(u,null),b}if(et(c)&&et(h)){const b=h.__indent;b!==c.__indent&&Jn(N,b);const $=h.__format;$!==c.__format&&Br(N,$),y&&(Ki(c,h,N),!Ur(h)&&!h.isInline()&&So(c,h,N)),yo(h)&&(In+=$t,qt+=$t)}else{const b=h.getTextContent();if(An(h)){const $=h.decorate(Hn,Er);$!==null&&Il(u,$)}else _t(h)&&!h.isDirectionless()&&(Gn+=b);In+=b,qt+=b}if(!us&&Ur(h)&&h.__cachedText!==qt){const b=h.getWritable();b.__cachedText=qt,h=b}return Object.freeze(h),N}function Il(u,s){let c=Hn._pendingDecorators;const h=Hn._decorators;if(c===null){if(h[u]===s)return;c=As(Hn)}c[u]=s}function Tr(u){return u.firstChild}function wo(u){let s=u.nextSibling;return s!==null&&s===Hn._blockCursorElement&&(s=s.nextSibling),s}function En(u,s,c,h,y,N){const b=h-1,$=y-1;let ae,he,me=Tr(N),xe=0,we=0;for(;xe<=b&&we<=$;){const Ue=s[xe],$e=c[we];if(Ue===$e)me=wo(hs($e,N)),xe++,we++;else{ae===void 0&&(ae=new Set(s)),he===void 0&&(he=new Set(c));const Rt=he.has(Ue),Qe=ae.has($e);if(!Rt)me=wo(Oo(Ue)),ds(Ue,N),xe++;else if(!Qe)hn($e,N,me),we++;else{const ht=$s(Hn,$e);ht===me?me=wo(hs($e,N)):(me!=null?N.insertBefore(ht,me):N.appendChild(ht),hs($e,N)),xe++,we++}}}const Ce=xe>b,Ve=we>$;if(Ce&&!Ve){const Ue=c[$+1],$e=Ue===void 0?null:Hn.getElementByKey(Ue);bl(c,u,we,$,N,$e)}else Ve&&!Ce&&Wi(s,xe,b,N)}function zi(u,s,c,h,y,N){In="",qt="",Gn="",ka=h===ut,Ks=null,Hn=c,Er=c._config,cs=c._nodes,Ws=Hn._listeners.mutation,zs=y,Rl=N,Hi=u._nodeMap,gn=s._nodeMap,us=s._readOnly,On=new Map(c._keyToDOMMap);const b=new Map;return Wn=b,hs("root",null),Hn=void 0,cs=void 0,zs=void 0,Rl=void 0,Hi=void 0,gn=void 0,Er=void 0,On=void 0,Wn=void 0,b}function Je(u,s,c){const h=c._keyToDOMMap;s["__lexicalKey_"+c._key]=u,h.set(u,s)}function Oo(u){const s=On.get(u);if(s===void 0)throw Error(`Reconciliation: could not find DOM element for node key ${u}`);return s}const cr=Object.freeze({}),nr=30,kl=[["keydown",ge],["pointerdown",Bl],["compositionstart",x],["compositionend",Q],["input",C],["click",Fa],["cut",cr],["copy",cr],["dragstart",cr],["dragover",cr],["dragend",cr],["paste",cr],["focus",cr],["blur",cr],["drop",cr]];ee&&kl.push(["beforeinput",(u,s)=>g(u,s)]);let Ui=0,Pl=0,Us=0,Hr=null,Gs=0,Wr=!1,Do=!1,Ys=!1,js=!1,Ao=[0,"",0,"root",0];function Gi(u,s,c,h,y){const N=u.anchor,b=u.focus,$=N.getNode(),ae=xn(),he=ar(ae._window),me=he!==null?he.anchorNode:null,xe=N.key,we=ae.getElementByKey(xe),Ce=c.length;return xe!==b.key||!_t($)||(!y&&(!ee||Us<h+50)||$.isDirty()&&Ce<2||Ms(c))&&N.offset!==b.offset&&!$.isComposing()||zn($)||$.isDirty()&&Ce>1||(y||!ee)&&we!==null&&!$.isComposing()&&me!==Pr(we)||he!==null&&s!==null&&(!s.collapsed||s.startContainer!==he.anchorNode||s.startOffset!==he.anchorOffset)||$.getFormat()!==u.format||$.getStyle()!==u.style||bs(u,$)}function $l(u,s){return u!==null&&u.nodeValue!==null&&u.nodeType===Fe&&s!==0&&s!==u.nodeValue.length}function Fl(u,s,c){const{anchorNode:h,anchorOffset:y,focusNode:N,focusOffset:b}=u;Wr&&(Wr=!1,$l(h,y)&&$l(N,b))||zr(s,()=>{if(!c){Cr(null);return}if(!is(s,h,N))return;const $=_n();if(Tt($)){const ae=$.anchor,he=ae.getNode();if($.isCollapsed()){u.type==="Range"&&u.anchorNode===u.focusNode&&($.dirty=!0);const me=Co(s).event,xe=me?me.timeStamp:performance.now(),[we,Ce,Ve,Ue,$e]=Ao,Rt=tr(),Qe=s.isComposing()===!1&&Rt.getTextContent()==="";if(xe<$e+200&&ae.offset===Ve&&ae.key===Ue)$.format=we,$.style=Ce;else if(ae.type==="text"){if(!_t(he))throw Error("Point.getNode() must return TextNode when type is text");$.format=he.getFormat(),$.style=he.getStyle()}else ae.type==="element"&&!Qe&&($.format=0,$.style="")}else{let me=st,xe=!1;const we=$.getNodes(),Ce=we.length;for(let Ve=0;Ve<Ce;Ve++){const Ue=we[Ve];if(_t(Ue)&&(xe=!0,me&=Ue.getFormat(),me===0))break}$.format=xe?me:0}}dt(s,t,void 0)})}function Fa(u,s){zr(s,()=>{const c=_n(),h=ar(s._window),y=Fo();if(h){if(Tt(c)){const N=c.anchor,b=N.getNode();if(N.type==="element"&&N.offset===0&&c.isCollapsed()&&!Ur(b)&&tr().getChildrenSize()===1&&b.getTopLevelElementOrThrow().isEmpty()&&y!==null&&c.is(y))h.removeAllRanges(),c.dirty=!0;else if(u.detail===3&&!c.isCollapsed()){const ae=c.focus.getNode();b!==ae&&(et(b)?b.select(0):b.getParentOrThrow().select(0))}}else if(u.pointerType==="touch"){const N=h.anchorNode;if(N!==null){const b=N.nodeType;if(b===ke||b===Fe){const $=Wc(y,h,s,u);Cr($)}}}}dt(s,r,u)})}function Bl(u,s){const c=u.target,h=u.pointerType;c instanceof Node&&h!=="touch"&&zr(s,()=>{rs(c)||(Do=!0)})}function o(u){if(!u.getTargetRanges)return null;const s=u.getTargetRanges();return s.length===0?null:s[0]}function i(u,s){return u!==s||et(u)||et(s)||!u.isToken()||!s.isToken()}function a(u){return Pl===229&&u<Ui+nr}function g(u,s){const c=u.inputType,h=o(u);c==="deleteCompositionText"||De&&Ol(s)||c!=="insertCompositionText"&&zr(s,()=>{const y=_n();if(c==="deleteContentBackward"){if(y===null){const me=Fo();if(!Tt(me))return;Cr(me.clone())}if(Tt(y)){if(be&&vn(y.anchor.key),a(u.timeStamp)&&s.isComposing()&&y.anchor.key===y.focus.key){if(vn(null),Ui=0,setTimeout(()=>{zr(s,()=>{vn(null)})},nr),Tt(y)){const xe=y.anchor.getNode();if(xe.markDirty(),y.format=xe.getFormat(),!_t(xe))throw Error("Anchor node must be a TextNode");y.style=xe.getStyle()}y.anchor.getNode().getTextContent().length<=1&&(u.preventDefault(),dt(s,l,!0))}else vn(null),u.preventDefault(),dt(s,l,!0);return}}if(!Tt(y))return;const N=u.data;Hr!==null&&Rs(!1,s,Hr),(!y.dirty||Hr!==null)&&y.isCollapsed()&&!Ur(y.anchor.getNode())&&h!==null&&y.applyDOMRange(h),Hr=null;const b=y.anchor,$=y.focus,ae=b.getNode(),he=$.getNode();if(c==="insertText"||c==="insertTranspose"){if(N===`
|
|
39
|
+
`)u.preventDefault(),dt(s,d,!1);else if(N===$t)u.preventDefault(),dt(s,f,void 0);else if(N==null&&u.dataTransfer){const me=u.dataTransfer.getData("text/plain");u.preventDefault(),y.insertRawText(me)}else N!=null&&Gi(y,h,N,u.timeStamp,!0)?(u.preventDefault(),dt(s,p,N)):Hr=N;Us=u.timeStamp;return}switch(u.preventDefault(),c){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":{dt(s,p,u);break}case"insertFromComposition":{vn(null),dt(s,p,u);break}case"insertLineBreak":{vn(null),dt(s,d,!1);break}case"insertParagraph":{vn(null),Ys&&!ue?(Ys=!1,dt(s,d,!1)):dt(s,f,void 0);break}case"insertFromPaste":case"insertFromPasteAsQuotation":{dt(s,_,u);break}case"deleteByComposition":{i(ae,he)&&dt(s,E,u);break}case"deleteByDrag":case"deleteByCut":{dt(s,E,u);break}case"deleteContent":{dt(s,l,!1);break}case"deleteWordBackward":{dt(s,T,!0);break}case"deleteWordForward":{dt(s,T,!1);break}case"deleteHardLineBackward":case"deleteSoftLineBackward":{dt(s,S,!0);break}case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":{dt(s,S,!1);break}case"formatStrikeThrough":{dt(s,w,"strikethrough");break}case"formatBold":{dt(s,w,"bold");break}case"formatItalic":{dt(s,w,"italic");break}case"formatUnderline":{dt(s,w,"underline");break}case"historyUndo":{dt(s,O,void 0);break}case"historyRedo":{dt(s,m,void 0);break}}})}function C(u,s){u.stopPropagation(),zr(s,()=>{const c=_n(),h=u.data,y=o(u);if(h!=null&&Tt(c)&&Gi(c,y,h,u.timeStamp,!1)){js&&(A(s,h),js=!1);const N=c.anchor,b=N.getNode(),$=ar(s._window);if($===null)return;const ae=N.offset;(!ee||c.isCollapsed()||!_t(b)||$.anchorNode===null||b.getTextContent().slice(0,ae)+h+b.getTextContent().slice(ae+c.focus.offset)!==mo($.anchorNode))&&dt(s,p,h);const he=h.length;De&&he>1&&u.inputType==="insertCompositionText"&&!s.isComposing()&&(c.anchor.offset-=he),!ne&&!ue&&!Re&&s.isComposing()&&(Ui=0,vn(null))}else Rs(!1,s,h!==null?h:void 0),js&&(A(s,h||void 0),js=!1);_l()}),Hr=null}function x(u,s){zr(s,()=>{const c=_n();if(Tt(c)&&!s.isComposing()){const h=c.anchor,y=c.anchor.getNode();vn(h.key),(u.timeStamp<Ui+nr||h.type==="element"||!c.isCollapsed()||y.getFormat()!==c.format||_t(y)&&y.getStyle()!==c.style)&&dt(s,p,Kt)}})}function A(u,s){const c=u._compositionKey;if(vn(null),c!==null&&s!=null){if(s===""){const h=Cn(c),y=Pr(u.getElementByKey(c));y!==null&&y.nodeValue!==null&&_t(h)&&$r(h,y.nodeValue,null,null,!0);return}if(s[s.length-1]===`
|
|
40
|
+
`){const h=_n();if(Tt(h)){const y=h.focus;h.anchor.set(y.key,y.offset,y.type),dt(u,re,null);return}}}Rs(!0,u,s)}function Q(u,s){De?js=!0:zr(s,()=>{A(s,u.data)})}function ge(u,s){if(Ui=u.timeStamp,Pl=u.keyCode,s.isComposing())return;const{keyCode:c,shiftKey:h,ctrlKey:y,metaKey:N,altKey:b}=u;if(!dt(s,v,u)){if(os(c,y,b,N))dt(s,I,u);else if(Da(c,y,h,b,N))dt(s,G,u);else if(Pc(c,y,b,N))dt(s,k,u);else if(Oa(c,y,h,b,N))dt(s,P,u);else if($c(c,y,N))dt(s,H,u);else if(vl(c,y,N))dt(s,j,u);else if(Tl(c,h))Ys=!0,dt(s,re,u);else if(Fc(c))dt(s,te,u);else if(Is(c,y))u.preventDefault(),Ys=!0,dt(s,d,!0);else if(El(c,h))Ys=!1,dt(s,re,u);else if(xa(c,b,N,y))Zr(c)?dt(s,ce,u):(u.preventDefault(),dt(s,l,!0));else if(Ii(c))dt(s,V,u);else if(Rc(c,y,h,b,N))ki(c)?dt(s,z,u):(u.preventDefault(),dt(s,l,!1));else if(ks(c,b,y))u.preventDefault(),dt(s,T,!0);else if(Ca(c,b,y))u.preventDefault(),dt(s,T,!1);else if(Ea(c,N))u.preventDefault(),dt(s,S,!0);else if(Ta(c,N))u.preventDefault(),dt(s,S,!1);else if(Na(c,b,N,y))u.preventDefault(),dt(s,w,"bold");else if(Ls(c,b,N,y))u.preventDefault(),dt(s,w,"underline");else if(ss(c,b,N,y))u.preventDefault(),dt(s,w,"italic");else if(ya(c,b,y,N))dt(s,q,u);else if(bc(c,h,N,y))u.preventDefault(),dt(s,O,void 0);else if(va(c,h,N,y))u.preventDefault(),dt(s,m,void 0);else{const $=s._editorState._selection;Kr($)?Lc(c,h,N,y)?(u.preventDefault(),dt(s,Y,u)):Ic(c,h,N,y)?(u.preventDefault(),dt(s,W,u)):_o(c,N,y)&&(u.preventDefault(),dt(s,J,u)):!De&&_o(c,N,y)&&(u.preventDefault(),dt(s,J,u))}Ps(y,h,b,N)&&dt(s,M,u)}}function Ae(u){let s=u.__lexicalEventHandles;return s===void 0&&(s=[],u.__lexicalEventHandles=s),s}const Ye=new Map;function Xe(u){const s=u.target,c=s==null?null:s.nodeType===9?s.defaultView:s.ownerDocument.defaultView,h=ar(c);if(h===null)return;const y=fl(h.anchorNode);if(y===null)return;Do&&(Do=!1,zr(y,()=>{const me=Fo(),xe=h.anchorNode;if(xe===null)return;const we=xe.nodeType;if(we!==ke&&we!==Fe)return;const Ce=Wc(me,h,y,u);Cr(Ce)}));const N=Li(y),b=N[N.length-1],$=b._key,ae=Ye.get($),he=ae||b;he!==y&&Fl(h,he,!1),Fl(h,y,!0),y!==b?Ye.set($,y):ae&&Ye.delete($)}function Ke(u){u._lexicalHandled=!0}function Pe(u){return u._lexicalHandled===!0}function pt(u,s){Gs===0&&u.ownerDocument.addEventListener("selectionchange",Xe),Gs++,u.__lexicalEditor=s;const c=Ae(u);for(let h=0;h<kl.length;h++){const[y,N]=kl[h],b=typeof N=="function"?$=>{Pe($)||(Ke($),s.isEditable()&&N($,s))}:$=>{if(!Pe($)&&(Ke($),s.isEditable()))switch(y){case"cut":return dt(s,W,$);case"copy":return dt(s,Y,$);case"paste":return dt(s,_,$);case"dragstart":return dt(s,D,$);case"dragover":return dt(s,Z,$);case"dragend":return dt(s,oe,$);case"focus":return dt(s,_e,$);case"blur":return dt(s,B,$);case"drop":return dt(s,de,$)}};u.addEventListener(y,b),c.push(()=>{u.removeEventListener(y,b)})}}function Ot(u){Gs!==0&&(Gs--,Gs===0&&u.ownerDocument.removeEventListener("selectionchange",Xe));const s=u.__lexicalEditor;s!=null&&(Ft(s),u.__lexicalEditor=null);const c=Ae(u);for(let h=0;h<c.length;h++)c[h]();u.__lexicalEventHandles=[]}function Ft(u){if(u._parentEditor!==null){const s=Li(u),h=s[s.length-1]._key;Ye.get(h)===u&&Ye.delete(h)}else Ye.delete(u._key)}function zt(){Wr=!0}function Yn(u,s,c,h,y){Ao=[u,s,c,h,y]}function Ar(u,s,c){fr();const h=u.__key,y=u.getParent();if(y===null)return;const N=as(u);let b=!1;if(Tt(N)&&s){const $=N.anchor,ae=N.focus;$.key===h&&(Ya($,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0),ae.key===h&&(Ya(ae,u,y,u.getPreviousSibling(),u.getNextSibling()),b=!0)}else Kr(N)&&s&&u.isSelected()&&u.selectPrevious();if(Tt(N)&&s&&!b){const $=u.getIndexWithinParent();Vr(u),Ga(N,y,$,-1)}else Vr(u);!c&&!si(y)&&!y.canBeEmpty()&&y.isEmpty()&&Ar(y,s),s&&Ur(y)&&y.isEmpty()&&y.selectEnd()}class oi{static getType(){throw Error(`LexicalNode: Node ${this.name} does not implement .getType().`)}static clone(s){throw Error(`LexicalNode: Node ${this.name} does not implement .clone().`)}constructor(s){this.__type=this.constructor.getType(),this.__parent=null,this.__prev=null,this.__next=null,hl(this,s),this.__type!=="root"&&(fr(),li(this.__type,this.constructor))}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){let s=this.__key;for(;s!==null;){if(s==="root")return!0;const c=Cn(s);if(c===null)break;s=c.__parent}return!1}isSelected(s){const c=s||_n();if(c==null)return!1;const h=c.getNodes().some(y=>y.__key===this.__key);return _t(this)?h:Tt(c)&&c.anchor.type==="element"&&c.focus.type==="element"&&c.anchor.key===c.focus.key&&c.anchor.offset===c.focus.offset?!1:h}getKey(){return this.__key}getIndexWithinParent(){const s=this.getParent();if(s===null)return-1;let c=s.getFirstChild(),h=0;for(;c!==null;){if(this.is(c))return h;h++,c=c.getNextSibling()}return-1}getParent(){const s=this.getLatest().__parent;return s===null?null:Cn(s)}getParentOrThrow(){const s=this.getParent();if(s===null)throw Error(`Expected node ${this.__key} to have a parent.`);return s}getTopLevelElement(){let s=this;for(;s!==null;){const c=s.getParent();if(si(c)){if(!et(s))throw Error("Children of root nodes must be elements");return s}s=c}return null}getTopLevelElementOrThrow(){const s=this.getTopLevelElement();if(s===null)throw Error(`Expected node ${this.__key} to have a top parent element.`);return s}getParents(){const s=[];let c=this.getParent();for(;c!==null;)s.push(c),c=c.getParent();return s}getParentKeys(){const s=[];let c=this.getParent();for(;c!==null;)s.push(c.__key),c=c.getParent();return s}getPreviousSibling(){const c=this.getLatest().__prev;return c===null?null:Cn(c)}getPreviousSiblings(){const s=[],c=this.getParent();if(c===null)return s;let h=c.getFirstChild();for(;h!==null&&!h.is(this);)s.push(h),h=h.getNextSibling();return s}getNextSibling(){const c=this.getLatest().__next;return c===null?null:Cn(c)}getNextSiblings(){const s=[];let c=this.getNextSibling();for(;c!==null;)s.push(c),c=c.getNextSibling();return s}getCommonAncestor(s){const c=this.getParents(),h=s.getParents();et(this)&&c.unshift(this),et(s)&&h.unshift(s);const y=c.length,N=h.length;if(y===0||N===0||c[y-1]!==h[N-1])return null;const b=new Set(h);for(let $=0;$<y;$++){const ae=c[$];if(b.has(ae))return ae}return null}is(s){return s==null?!1:this.__key===s.__key}isBefore(s){if(this===s)return!1;if(s.isParentOf(this))return!0;if(this.isParentOf(s))return!1;const c=this.getCommonAncestor(s);let h=0,y=0,N=this;for(;;){const b=N.getParentOrThrow();if(b===c){h=N.getIndexWithinParent();break}N=b}for(N=s;;){const b=N.getParentOrThrow();if(b===c){y=N.getIndexWithinParent();break}N=b}return h<y}isParentOf(s){const c=this.__key;if(c===s.__key)return!1;let h=s;for(;h!==null;){if(h.__key===c)return!0;h=h.getParent()}return!1}getNodesBetween(s){const c=this.isBefore(s),h=[],y=new Set;let N=this;for(;;){const b=N.__key;if(y.has(b)||(y.add(b),h.push(N)),N===s)break;const $=et(N)?c?N.getFirstChild():N.getLastChild():null;if($!==null){N=$;continue}const ae=c?N.getNextSibling():N.getPreviousSibling();if(ae!==null){N=ae;continue}const he=N.getParentOrThrow();if(y.has(he.__key)||h.push(he),he===s)break;let me=null,xe=he;do{if(xe===null)throw Error("getNodesBetween: ancestor is null");me=c?xe.getNextSibling():xe.getPreviousSibling(),xe=xe.getParent(),xe!==null&&me===null&&!y.has(xe.__key)&&h.push(xe)}while(me===null);N=me}return c||h.reverse(),h}isDirty(){const c=xn()._dirtyLeaves;return c!==null&&c.has(this.__key)}getLatest(){const s=Cn(this.__key);if(s===null)throw Error("Lexical node does not exist in active editor state. Avoid using the same node references between nested closures from editorState.read/editor.update.");return s}getWritable(){fr();const s=xi(),c=xn(),h=s._nodeMap,y=this.__key,N=this.getLatest(),b=N.__parent,$=c._cloneNotNeeded,ae=_n();if(ur(ae)&&ae.setCachedNodes(null),$.has(y))return Mi(N),N;const me=N.constructor.clone(N);return me.__parent=b,me.__next=N.__next,me.__prev=N.__prev,et(N)&&et(me)?(me.__first=N.__first,me.__last=N.__last,me.__size=N.__size,me.__indent=N.__indent,me.__format=N.__format,me.__dir=N.__dir):_t(N)&&_t(me)&&(me.__format=N.__format,me.__style=N.__style,me.__mode=N.__mode,me.__detail=N.__detail),$.add(y),me.__key=y,Mi(me),h.set(y,me),me}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(s,c){throw Error("createDOM: base method not extended")}updateDOM(s,c,h){throw Error("updateDOM: base method not extended")}exportDOM(s){return{element:this.createDOM(s._config,s)}}exportJSON(){throw Error("exportJSON: base method not extended")}static importJSON(s){throw Error(`LexicalNode: Node ${this.name} does not implement .importJSON().`)}static transform(){return null}remove(s){Ar(this,!0,s)}replace(s,c){fr();let h=_n();h!==null&&(h=h.clone()),Fs(this,s);const y=this.getLatest(),N=this.__key,b=s.__key,$=s.getWritable(),ae=this.getParentOrThrow().getWritable(),he=ae.__size;Vr($);const me=y.getPreviousSibling(),xe=y.getNextSibling(),we=y.__prev,Ce=y.__next,Ve=y.__parent;if(Ar(y,!1,!0),me===null)ae.__first=b;else{const Ue=me.getWritable();Ue.__next=b}if($.__prev=we,xe===null)ae.__last=b;else{const Ue=xe.getWritable();Ue.__prev=b}if($.__next=Ce,$.__parent=Ve,ae.__size=he,c){if(!(et(this)&&et($)))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Ue=>{$.append(Ue)})}if(Tt(h)){Cr(h);const Ue=h.anchor,$e=h.focus;Ue.key===N&&mn(Ue,$),$e.key===N&&mn($e,$)}return lr()===N&&vn(b),$}insertAfter(s,c=!0){fr(),Fs(this,s);const h=this.getWritable(),y=s.getWritable(),N=y.getParent(),b=_n();let $=!1,ae=!1;if(N!==null){const Ce=s.getIndexWithinParent();if(Vr(y),Tt(b)){const Ve=N.__key,Ue=b.anchor,$e=b.focus;$=Ue.type==="element"&&Ue.key===Ve&&Ue.offset===Ce+1,ae=$e.type==="element"&&$e.key===Ve&&$e.offset===Ce+1}}const he=this.getNextSibling(),me=this.getParentOrThrow().getWritable(),xe=y.__key,we=h.__next;if(he===null)me.__last=xe;else{const Ce=he.getWritable();Ce.__prev=xe}if(me.__size++,h.__next=xe,y.__next=we,y.__prev=h.__key,y.__parent=h.__parent,c&&Tt(b)){const Ce=this.getIndexWithinParent();Ga(b,me,Ce+1);const Ve=me.__key;$&&b.anchor.set(Ve,Ce+2,"element"),ae&&b.focus.set(Ve,Ce+2,"element")}return s}insertBefore(s,c=!0){fr(),Fs(this,s);const h=this.getWritable(),y=s.getWritable(),N=y.__key;Vr(y);const b=this.getPreviousSibling(),$=this.getParentOrThrow().getWritable(),ae=h.__prev,he=this.getIndexWithinParent();if(b===null)$.__first=N;else{const xe=b.getWritable();xe.__next=N}$.__size++,h.__prev=N,y.__prev=ae,y.__next=h.__key,y.__parent=h.__parent;const me=_n();if(c&&Tt(me)){const xe=this.getParentOrThrow();Ga(me,xe,he)}return s}isParentRequired(){return!1}createParentElementNode(){return Vi()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(s,c){fr();const h=this.getPreviousSibling(),y=this.getParentOrThrow();if(h===null)return y.select(0,0);if(et(h))return h.select();if(!_t(h)){const N=h.getIndexWithinParent()+1;return y.select(N,N)}return h.select(s,c)}selectNext(s,c){fr();const h=this.getNextSibling(),y=this.getParentOrThrow();if(h===null)return y.select();if(et(h))return h.select(0,0);if(!_t(h)){const N=h.getIndexWithinParent();return y.select(N,N)}return h.select(s,c)}markDirty(){this.getWritable()}}function li(u,s){const c=xn()._nodes.get(u);if(c===void 0)throw Error(`Create node: Attempted to create node ${s.name} that was not configured to be used on the editor.`);const h=c.klass;if(h!==s)throw Error(`Create node: Type ${u} in node ${s.name} does not match registered node ${h.name} with the same type`)}function Hl(u,s,c){const h=s.getParentOrThrow().getLastChild();let y=s;const N=[s];for(;y!==h;){if(!y.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");y=y.getNextSibling(),N.push(y)}let b=u;for(const $ of N)b=b.insertAfter($)}class Yi extends oi{static getType(){return"linebreak"}static clone(s){return new Yi(s.__key)}constructor(s){super(s)}getTextContent(){return`
|
|
41
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:s=>{const c=s.parentElement;let h,y;return c!==null&&((h=c.firstChild)===s||h.nextSibling===s&&h.nodeType===Fe&&(h.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((y=c.lastChild)===s||y.previousSibling===s&&y.nodeType===Fe&&(y.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:Mo,priority:0}}}}static importJSON(s){return gs()}exportJSON(){return{type:"linebreak",version:1}}}function Mo(u){return{node:gs()}}function gs(){return Dr(new Yi)}function ai(u){return u instanceof Yi}function Mr(u,s){return s&Le?"code":s&it?"mark":s&Me?"sub":s&je?"sup":null}function ji(u,s){return s&Oe?"strong":s&ie?"em":"span"}function Ro(u,s,c,h,y){const N=h.classList;let b=Pi(y,"base");b!==void 0&&N.add(...b),b=Pi(y,"underlineStrikethrough");let $=!1;const ae=s&ve&&s&le,he=c&ve&&c≤b!==void 0&&(he?($=!0,ae||N.add(...b)):ae&&N.remove(...b));for(const me in rn){const we=rn[me];if(b=Pi(y,me),b!==void 0)if(c&we){if($&&(me==="underline"||me==="strikethrough")){s&we&&N.remove(...b);continue}(!(s&we)||ae&&me==="underline"||me==="strikethrough")&&N.add(...b)}else s&we&&N.remove(...b)}}function Ba(u,s){const c=u.length,h=s.length;let y=0,N=0;for(;y<c&&y<h&&u[y]===s[y];)y++;for(;N+y<c&&N+y<h&&u[c-N-1]===s[h-N-1];)N++;return[y,c-y-N,s.slice(y,h-N)]}function Ha(u,s,c){const h=s.firstChild,y=c.isComposing(),b=u+(y?mt:"");if(h==null)s.textContent=b;else{const $=h.nodeValue;if($!==b)if(y||De){const[ae,he,me]=Ba($,b);he!==0&&h.deleteData(ae,he),h.insertData(ae,me)}else h.nodeValue=b}}function Wl(u,s,c,h,y,N){Ha(y,u,s);const $=N.theme.text;$!==void 0&&Ro(c,0,h,u,$)}function Vs(u,s){const c=document.createElement(s);return c.appendChild(u),c}class Jr extends oi{static getType(){return"text"}static clone(s){return new Jr(s.__text,s.__key)}constructor(s,c){super(c),this.__text=s,this.__format=0,this.__style="",this.__mode=0,this.__detail=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){const s=this.getLatest();return lt[s.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===Ut}isComposing(){return this.__key===lr()}isSegmented(){return this.getLatest().__mode===tn}isDirectionless(){return(this.getLatest().__detail&ot)!==0}isUnmergeable(){return(this.getLatest().__detail&St)!==0}hasFormat(s){const c=rn[s];return(this.getFormat()&c)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(s,c){const y=this.getLatest().__format;return Bn(y,s,c)}createDOM(s,c){const h=this.__format,y=Mr(this,h),N=ji(this,h),b=y===null?N:y,$=document.createElement(b);let ae=$;this.hasFormat("code")&&$.setAttribute("spellcheck","false"),y!==null&&(ae=document.createElement(N),$.appendChild(ae));const he=this.__text;Wl(ae,this,N,h,he,s);const me=this.__style;return me!==""&&($.style.cssText=me),$}updateDOM(s,c,h){const y=this.__text,N=s.__format,b=this.__format,$=Mr(this,N),ae=Mr(this,b),he=ji(this,N),me=ji(this,b);if(($===null?he:$)!==(ae===null?me:ae))return!0;if($===ae&&he!==me){const Qe=c.firstChild;if(Qe==null)throw Error("updateDOM: prevInnerDOM is null or undefined");const ht=document.createElement(me);return Wl(ht,this,me,b,y,h),c.replaceChild(ht,Qe),!1}let Ce=c;if(ae!==null&&$!==null&&(Ce=c.firstChild,Ce==null))throw Error("updateDOM: innerDOM is null or undefined");Ha(y,Ce,this);const Ue=h.theme.text;Ue!==void 0&&N!==b&&Ro(me,N,b,Ce,Ue);const $e=s.__style,Rt=this.__style;return $e!==Rt&&(c.style.cssText=Rt),!1}static importDOM(){return{"#text":()=>({conversion:Lo,priority:0}),b:()=>({conversion:Kl,priority:0}),code:()=>({conversion:Xr,priority:0}),em:()=>({conversion:Xr,priority:0}),i:()=>({conversion:Xr,priority:0}),s:()=>({conversion:Xr,priority:0}),span:()=>({conversion:Wa,priority:0}),strong:()=>({conversion:Xr,priority:0}),sub:()=>({conversion:Xr,priority:0}),sup:()=>({conversion:Xr,priority:0}),u:()=>({conversion:Xr,priority:0})}}static importJSON(s){const c=Dn(s.text);return c.setFormat(s.format),c.setDetail(s.detail),c.setMode(s.mode),c.setStyle(s.style),c}exportDOM(s){let{element:c}=super.exportDOM(s);if(!(c!==null&&Hs(c)))throw Error("Expected TextNode createDOM to always return a HTMLElement");return c.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(c=Vs(c,"b")),this.hasFormat("italic")&&(c=Vs(c,"i")),this.hasFormat("strikethrough")&&(c=Vs(c,"s")),this.hasFormat("underline")&&(c=Vs(c,"u")),{element:c}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(s,c){}setFormat(s){const c=this.getWritable();return c.__format=typeof s=="string"?rn[s]:s,c}setDetail(s){const c=this.getWritable();return c.__detail=typeof s=="string"?Or[s]:s,c}setStyle(s){const c=this.getWritable();return c.__style=s,c}toggleFormat(s){const c=this.getFormat(),h=Bn(c,s,null);return this.setFormat(h)}toggleDirectionless(){const s=this.getWritable();return s.__detail^=ot,s}toggleUnmergeable(){const s=this.getWritable();return s.__detail^=St,s}setMode(s){const c=Ze[s];if(this.__mode===c)return this;const h=this.getWritable();return h.__mode=c,h}setTextContent(s){if(this.__text===s)return this;const c=this.getWritable();return c.__text=s,c}select(s,c){fr();let h=s,y=c;const N=_n(),b=this.getTextContent(),$=this.__key;if(typeof b=="string"){const ae=b.length;h===void 0&&(h=ae),y===void 0&&(y=ae)}else h=0,y=0;if(Tt(N)){const ae=lr();(ae===N.anchor.key||ae===N.focus.key)&&vn($),N.setTextNodeRange(this,h,this,y)}else return Zd($,h,$,y,"text","text");return N}selectStart(){return this.select(0,0)}selectEnd(){const s=this.getTextContentSize();return this.select(s,s)}spliceText(s,c,h,y){const N=this.getWritable(),b=N.__text,$=h.length;let ae=s;ae<0&&(ae=$+ae,ae<0&&(ae=0));const he=_n();if(y&&Tt(he)){const xe=s+$;he.setTextNodeRange(N,xe,N,xe)}const me=b.slice(0,ae)+h+b.slice(ae+c);return N.__text=me,N}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...s){fr();const c=this.getLatest(),h=c.getTextContent(),y=c.__key,N=lr(),b=new Set(s),$=[],ae=h.length;let he="";for(let cn=0;cn<ae;cn++)he!==""&&b.has(cn)&&($.push(he),he=""),he+=h[cn];he!==""&&$.push(he);const me=$.length;if(me===0)return[];if($[0]===h)return[c];const xe=$[0],we=c.getParentOrThrow();let Ce;const Ve=c.getFormat(),Ue=c.getStyle(),$e=c.__detail;let Rt=!1;c.isSegmented()?(Ce=Dn(xe),Ce.__format=Ve,Ce.__style=Ue,Ce.__detail=$e,Rt=!0):(Ce=c.getWritable(),Ce.__text=xe);const Qe=_n(),ht=[Ce];let Zt=xe.length;for(let cn=1;cn<me;cn++){const ir=$[cn],ps=ir.length,hr=Dn(ir).getWritable();hr.__format=Ve,hr.__style=Ue,hr.__detail=$e;const sn=hr.__key,kn=Zt+ps;if(Tt(Qe)){const ui=Qe.anchor,qi=Qe.focus;ui.key===y&&ui.type==="text"&&ui.offset>Zt&&ui.offset<=kn&&(ui.key=sn,ui.offset-=Zt,Qe.dirty=!0),qi.key===y&&qi.type==="text"&&qi.offset>Zt&&qi.offset<=kn&&(qi.key=sn,qi.offset-=Zt,Qe.dirty=!0)}N===y&&vn(sn),Zt=kn,ht.push(hr)}pl(this);const Wt=we.getWritable(),Dt=this.getIndexWithinParent();return Rt?(Wt.splice(Dt,0,ht),this.remove()):Wt.splice(Dt,1,ht),Tt(Qe)&&Ga(Qe,we,Dt,me-1),ht}mergeWithSibling(s){const c=s===this.getPreviousSibling();if(!c&&s!==this.getNextSibling())throw Error("mergeWithSibling: sibling must be a previous or next sibling");const h=this.__key,y=s.__key,N=this.__text,b=N.length;lr()===y&&vn(h);const ae=_n();if(Tt(ae)){const we=ae.anchor,Ce=ae.focus;we!==null&&we.key===y&&(Xd(we,c,h,s,b),ae.dirty=!0),Ce!==null&&Ce.key===y&&(Xd(Ce,c,h,s,b),ae.dirty=!0)}const he=s.__text,me=c?he+N:N+he;this.setTextContent(me);const xe=this.getWritable();return s.remove(),xe}isTextEntity(){return!1}}function Wa(u){const s=u,c=s.style.fontWeight==="700",h=s.style.textDecoration==="line-through",y=s.style.fontStyle==="italic",N=s.style.textDecoration==="underline",b=s.style.verticalAlign;return{forChild:$=>(_t($)&&(c&&$.toggleFormat("bold"),h&&$.toggleFormat("strikethrough"),y&&$.toggleFormat("italic"),N&&$.toggleFormat("underline"),b==="sub"&&$.toggleFormat("subscript"),b==="super"&&$.toggleFormat("superscript")),$),node:null}}function Kl(u){const c=u.style.fontWeight==="normal";return{forChild:h=>(_t(h)&&!c&&h.toggleFormat("bold"),h),node:null}}const bo=new WeakMap;function Ka(u){return u.nodeName==="PRE"||u.nodeType===ke&&u.style!==void 0&&u.style.whiteSpace!==void 0&&u.style.whiteSpace.startsWith("pre")}function qs(u){let s,c=u.parentNode;const h=[u];for(;c!==null&&(s=bo.get(c))===void 0&&!Ka(c);)h.push(c),c=c.parentNode;const y=s===void 0?c:s;for(let N=0;N<h.length;N++)bo.set(h[N],y);return y}function Lo(u){const s=u;if(u.parentElement===null)throw Error("Expected parentElement of Text not to be null");let h=s.textContent||"";if(qs(s)!==null){const y=h.split(/(\r?\n|\t)/),N=[],b=y.length;for(let $=0;$<b;$++){const ae=y[$];ae===`
|
|
42
42
|
`||ae===`\r
|
|
43
|
-
`?N.push(
|
|
44
|
-
`),we.isEmpty()?me=!1:me=!0;else if(me=!1,_t(we)){let Ce=we.getTextContent();we===c?we===h?(y.type!=="element"||N.type!=="element"||N.offset===y.offset)&&(Ce=$<ae?Ce.slice($,ae):Ce.slice(ae,$)):Ce=b?Ce.slice($):Ce.slice(ae):we===h&&(Ce=b?Ce.slice(0,ae):Ce.slice(0,$)),he+=Ce}else(An(we)||ai(we))&&(we!==h||!this.isCollapsed())&&(he+=we.getTextContent())}return he}applyDOMRange(s){const c=xn(),y=c.getEditorState()._selection,N=
|
|
43
|
+
`?N.push(gs()):ae===" "?N.push(Io()):ae!==""&&N.push(Dn(ae))}return{node:N}}if(h=h.replace(/\r/g,"").replace(/[ \t\n]+/g," "),h==="")return{node:null};if(h[0]===" "){let y=s,N=!0;for(;y!==null&&(y=za(y,!1))!==null;){const b=y.textContent||"";if(b.length>0){/[ \t\n]$/.test(b)&&(h=h.slice(1)),N=!1;break}}N&&(h=h.slice(1))}if(h[h.length-1]===" "){let y=s,N=!0;for(;y!==null&&(y=za(y,!0))!==null;)if((y.textContent||"").replace(/^( |\t|\r?\n)+/,"").length>0){N=!1;break}N&&(h=h.slice(0,h.length-1))}return h===""?{node:null}:{node:Dn(h)}}const zl=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)$/,"i");function za(u,s){let c=u;for(;;){let h;for(;(h=s?c.nextSibling:c.previousSibling)===null;){const N=c.parentElement;if(N===null)return null;c=N}if(c=h,c.nodeType===ke){const N=c.style.display;if(N===""&&c.nodeName.match(zl)===null||N!==""&&!N.startsWith("inline"))return null}let y=c;for(;(y=s?c.firstChild:c.lastChild)!==null;)c=y;if(c.nodeType===Fe)return c;if(c.nodeName==="BR")return null}}const Ul={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function Xr(u){const s=Ul[u.nodeName.toLowerCase()];return s===void 0?{node:null}:{forChild:c=>(_t(c)&&!c.hasFormat(s)&&c.toggleFormat(s),c),node:null}}function Dn(u=""){return Dr(new Jr(u))}function _t(u){return u instanceof Jr}class xr extends Jr{static getType(){return"tab"}static clone(s){const c=new xr(s.__key);return c.__text=s.__text,c.__format=s.__format,c.__style=s.__style,c}constructor(s){super(" ",s),this.__detail=St}static importDOM(){return null}static importJSON(s){const c=Io();return c.setFormat(s.format),c.setStyle(s.style),c}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(s){throw Error("TabNode does not support setTextContent")}setDetail(s){throw Error("TabNode does not support setDetail")}setMode(s){throw Error("TabNode does not support setMode")}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Io(){return Dr(new xr)}function ko(u){return u instanceof xr}class Bc{constructor(s,c,h){this._selection=null,this.key=s,this.offset=c,this.type=h}is(s){return this.key===s.key&&this.offset===s.offset&&this.type===s.type}isBefore(s){let c=this.getNode(),h=s.getNode();const y=this.offset,N=s.offset;if(et(c)){const b=c.getDescendantByIndex(y);c=b??c}if(et(h)){const b=h.getDescendantByIndex(N);h=b??h}return c===h?y<N:c.isBefore(h)}getNode(){const s=this.key,c=Cn(s);if(c===null)throw Error("Point.getNode: node not found");return c}set(s,c,h){const y=this._selection,N=this.key;this.key=s,this.offset=c,this.type=h,Bo()||(lr()===N&&vn(s),y!==null&&(y.setCachedNodes(null),y.dirty=!0))}}function Rr(u,s,c){return new Bc(u,s,c)}function Po(u,s){let c=s.__key,h=u.offset,y="element";if(_t(s)){y="text";const N=s.getTextContentSize();h>N&&(h=N)}else if(!et(s)){const N=s.getNextSibling();if(_t(N))c=N.__key,h=0,y="text";else{const b=s.getParent();b&&(c=b.__key,h=s.getIndexWithinParent()+1)}}u.set(c,h,y)}function mn(u,s){if(et(s)){const c=s.getLastDescendant();et(c)||_t(c)?Po(u,c):Po(u,s)}else Po(u,s)}function Xn(u,s,c,h){const y=u.getNode(),N=y.getChildAtIndex(u.offset),b=Dn(),$=Ur(y)?Vi().append(b):b;b.setFormat(c),b.setStyle(h),N===null?y.append($):N.insertBefore($),u.is(s)&&s.set(b.__key,0,"text"),u.set(b.__key,0,"text")}function Tn(u,s,c,h){u.key=s,u.offset=c,u.type=h}class br{constructor(s,c){this.anchor=s,this.focus=c,s._selection=this,c._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(s){this._cachedNodes=s}is(s){return ur(s)?this.anchor.is(s.anchor)&&this.focus.is(s.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return ci(this)}}class Ti{constructor(s){this.dirty=!1,this._nodes=s,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(s){this._cachedNodes=s}is(s){if(!Kr(s))return!1;const c=this._nodes,h=s._nodes;return c.size===h.size&&Array.from(c).every(y=>h.has(y))}add(s){this.dirty=!0,this._nodes.add(s),this._cachedNodes=null}delete(s){this.dirty=!0,this._nodes.delete(s),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(s){return this._nodes.has(s)}clone(){return new Ti(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(s){}insertText(){}insertNodes(s){const c=this.getNodes(),h=c.length,y=c[h-1];let N;if(_t(y))N=y.select();else{const b=y.getIndexWithinParent()+1;N=y.getParentOrThrow().select(b,b)}N.insertNodes(s);for(let b=0;b<h;b++)c[b].remove()}getNodes(){const s=this._cachedNodes;if(s!==null)return s;const c=this._nodes,h=[];for(const y of c){const N=Cn(y);N!==null&&h.push(N)}return Bo()||(this._cachedNodes=h),h}getTextContent(){const s=this.getNodes();let c="";for(let h=0;h<s.length;h++)c+=s[h].getTextContent();return c}}function Tt(u){return u instanceof rr}function ur(u){return u instanceof br}function Lr(u){const[s,,c]=Qd(u),h=c.getChildren(),y=h.length,N=h[0].getChildren().length,b=new Array(y);for(let $=0;$<y;$++)b[$]=new Array(N);for(let $=0;$<y;$++){const he=h[$].getChildren();let me=0;for(let xe=0;xe<he.length;xe++){for(;b[$][me];)me++;const we=he[xe],Ce=we.__rowSpan||1,Ve=we.__colSpan||1;for(let Ue=0;Ue<Ce;Ue++)for(let $e=0;$e<Ve;$e++)b[$+Ue][me+$e]=we;if(s===we)return{colSpan:Ve,columnIndex:me,rowIndex:$,rowSpan:Ce};me+=Ve}}return null}class rr extends br{constructor(s,c,h,y){super(s,c),this.format=h,this.style=y}is(s){return Tt(s)?this.anchor.is(s.anchor)&&this.focus.is(s.focus)&&this.format===s.format&&this.style===s.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){const s=this._cachedNodes;if(s!==null)return s;const c=this.anchor,h=this.focus,y=c.isBefore(h),N=y?c:h,b=y?h:c;let $=N.getNode(),ae=b.getNode();const he=N.offset,me=b.offset;if(et($)){const we=$.getDescendantByIndex(he);$=we??$}if(et(ae)){let we=ae.getDescendantByIndex(me);we!==null&&we!==$&&ae.getChildAtIndex(me)===we&&(we=we.getPreviousSibling()),ae=we??ae}let xe;return $.is(ae)?et($)&&$.getChildrenSize()>0?xe=[]:xe=[$]:xe=$.getNodesBetween(ae),Bo()||(this._cachedNodes=xe),xe}setTextNodeRange(s,c,h,y){Tn(this.anchor,s.__key,c,"text"),Tn(this.focus,h.__key,y,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){const s=this.getNodes();if(s.length===0)return"";const c=s[0],h=s[s.length-1],y=this.anchor,N=this.focus,b=y.isBefore(N),[$,ae]=ci(this);let he="",me=!0;for(let xe=0;xe<s.length;xe++){const we=s[xe];if(et(we)&&!we.isInline())me||(he+=`
|
|
44
|
+
`),we.isEmpty()?me=!1:me=!0;else if(me=!1,_t(we)){let Ce=we.getTextContent();we===c?we===h?(y.type!=="element"||N.type!=="element"||N.offset===y.offset)&&(Ce=$<ae?Ce.slice($,ae):Ce.slice(ae,$)):Ce=b?Ce.slice($):Ce.slice(ae):we===h&&(Ce=b?Ce.slice(0,ae):Ce.slice(0,$)),he+=Ce}else(An(we)||ai(we))&&(we!==h||!this.isCollapsed())&&(he+=we.getTextContent())}return he}applyDOMRange(s){const c=xn(),y=c.getEditorState()._selection,N=qd(s.startContainer,s.startOffset,s.endContainer,s.endOffset,c,y);if(N===null)return;const[b,$]=N;Tn(this.anchor,b.key,b.offset,b.type),Tn(this.focus,$.key,$.offset,$.type),this._cachedNodes=null}clone(){const s=this.anchor,c=this.focus;return new rr(Rr(s.key,s.offset,s.type),Rr(c.key,c.offset,c.type),this.format,this.style)}toggleFormat(s){this.format=Bn(this.format,s,null),this.dirty=!0}setStyle(s){this.style=s,this.dirty=!0}hasFormat(s){const c=rn[s];return(this.format&c)!==0}insertRawText(s){const c=s.split(/(\r?\n|\t)/),h=[],y=c.length;for(let N=0;N<y;N++){const b=c[N];b===`
|
|
45
45
|
`||b===`\r
|
|
46
|
-
`?h.push(ps()):b===" "?h.push(Lo()):h.push(Dn(b))}this.insertNodes(h)}insertText(s){const c=this.anchor,h=this.focus,y=this.isCollapsed()||c.isBefore(h),N=this.format,b=this.style;y&&c.type==="element"?Xn(c,h,N,b):!y&&h.type==="element"&&Xn(h,c,N,b);const $=this.getNodes(),ae=$.length,he=y?c:h,me=y?h:c,xe=he.offset,we=me.offset;let Ce=$[0];if(!_t(Ce))throw Error("insertText: first node is not a text node");const Ue=Ce.getTextContent().length,$e=Ce.getParentOrThrow(),Rt=ae-1;let Qe=$[Rt];if(this.isCollapsed()&&xe===Ue&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextAfter()||!$e.canInsertTextAfter()&&Ce.getNextSibling()===null)){let ht=Ce.getNextSibling();if((!_t(ht)||!ht.canInsertTextBefore()||zn(ht))&&(ht=Dn(),ht.setFormat(N),$e.canInsertTextAfter()?Ce.insertAfter(ht):$e.insertAfter(ht)),ht.select(0,0),Ce=ht,s!==""){this.insertText(s);return}}else if(this.isCollapsed()&&xe===0&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextBefore()||!$e.canInsertTextBefore()&&Ce.getPreviousSibling()===null)){let ht=Ce.getPreviousSibling();if((!_t(ht)||zn(ht))&&(ht=Dn(),ht.setFormat(N),$e.canInsertTextBefore()?Ce.insertBefore(ht):$e.insertBefore(ht)),ht.select(),Ce=ht,s!==""){this.insertText(s);return}}else if(Ce.isSegmented()&&xe!==Ue){const ht=Dn(Ce.getTextContent());ht.setFormat(N),Ce.replace(ht),Ce=ht}else if(!this.isCollapsed()&&s!==""){const ht=Qe.getParent();if(!$e.canInsertTextBefore()||!$e.canInsertTextAfter()||et(ht)&&(!ht.canInsertTextBefore()||!ht.canInsertTextAfter())){this.insertText(""),Ud(this.anchor,this.focus,null),this.insertText(s);return}}if(ae===1){if(Ce.isToken()){const Dt=Dn(s);Dt.select(),Ce.replace(Dt);return}const ht=Ce.getFormat(),qt=Ce.getStyle();if(xe===we&&(ht!==N||qt!==b))if(Ce.getTextContent()==="")Ce.setFormat(N),Ce.setStyle(b);else{const Dt=Dn(s);if(Dt.setFormat(N),Dt.setStyle(b),Dt.select(),xe===0)Ce.insertBefore(Dt,!1);else{const[cn]=Ce.splitText(xe);cn.insertAfter(Dt,!1)}Dt.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);return}else if(Io(Ce)){const Dt=Dn(s);Dt.setFormat(N),Dt.setStyle(b),Dt.select(),Ce.replace(Dt);return}const Wt=we-xe;Ce=Ce.spliceText(xe,Wt,s,!0),Ce.getTextContent()===""?Ce.remove():this.anchor.type==="text"&&(Ce.isComposing()?this.anchor.offset-=s.length:(this.format=ht,this.style=qt))}else{const ht=new Set([...Ce.getParentKeys(),...Qe.getParentKeys()]),qt=et(Ce)?Ce:Ce.getParentOrThrow();let Wt=et(Qe)?Qe:Qe.getParentOrThrow(),Dt=Qe;if(!qt.is(Wt)&&Wt.isInline())do Dt=Wt,Wt=Wt.getParentOrThrow();while(Wt.isInline());if(me.type==="text"&&(we!==0||Qe.getTextContent()==="")||me.type==="element"&&Qe.getIndexWithinParent()<we)if(_t(Qe)&&!Qe.isToken()&&we!==Qe.getTextContentSize()){if(Qe.isSegmented()){const rn=Dn(Qe.getTextContent());Qe.replace(rn),Qe=rn}!Ur(me.getNode())&&me.type==="text"&&(Qe=Qe.spliceText(0,we,"")),ht.add(Qe.__key)}else{const rn=Qe.getParentOrThrow();!rn.canBeEmpty()&&rn.getChildrenSize()===1?rn.remove():Qe.remove()}else ht.add(Qe.__key);const cn=Wt.getChildren(),ir=new Set($),ms=qt.is(Wt),hr=qt.isInline()&&Ce.getNextSibling()===null?qt:Ce;for(let rn=cn.length-1;rn>=0;rn--){const kn=cn[rn];if(kn.is(Ce)||et(kn)&&kn.isParentOf(Ce))break;kn.isAttached()&&(!ir.has(kn)||kn.is(Dt)?ms||hr.insertAfter(kn,!1):kn.remove())}if(!ms){let rn=Wt,kn=null;for(;rn!==null;){const ui=rn.getChildren(),Zi=ui.length;(Zi===0||ui[Zi-1].is(kn))&&(ht.delete(rn.__key),kn=rn),rn=rn.getParent()}}if(!Ce.isToken())Ce=Ce.spliceText(xe,Ue-xe,s,!0),Ce.getTextContent()===""?Ce.remove():Ce.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);else if(xe===Ue)Ce.select();else{const rn=Dn(s);rn.select(),Ce.replace(rn)}for(let rn=1;rn<ae;rn++){const kn=$[rn],ui=kn.__key;ht.has(ui)||kn.remove()}}}removeText(){this.insertText("")}formatText(s){if(this.isCollapsed()){this.toggleFormat(s),vn(null);return}const c=this.getNodes(),h=[];for(const Qe of c)_t(Qe)&&h.push(Qe);const y=h.length;if(y===0){this.toggleFormat(s),vn(null);return}const N=this.anchor,b=this.focus,$=this.isBackward(),ae=$?b:N,he=$?N:b;let me=0,xe=h[0],we=ae.type==="element"?0:ae.offset;if(ae.type==="text"&&we===xe.getTextContentSize()&&(me=1,xe=h[1],we=0),xe==null)return;const Ce=xe.getFormatFlags(s,null),Ve=y-1;let Ue=h[Ve];const $e=he.type==="text"?he.offset:Ue.getTextContentSize();if(xe.is(Ue)){if(we===$e)return;if(we===0&&$e===xe.getTextContentSize())xe.setFormat(Ce);else{const Qe=xe.splitText(we,$e),ht=we===0?Qe[0]:Qe[1];ht.setFormat(Ce),ae.type==="text"&&ae.set(ht.__key,0,"text"),he.type==="text"&&he.set(ht.__key,$e-we,"text")}this.format=Ce;return}we!==0&&([,xe]=xe.splitText(we),we=0),xe.setFormat(Ce);const Rt=Ue.getFormatFlags(s,Ce);$e>0&&($e!==Ue.getTextContentSize()&&([Ue]=Ue.splitText($e)),Ue.setFormat(Rt));for(let Qe=me+1;Qe<Ve;Qe++){const ht=h[Qe];if(!ht.isToken()){const qt=ht.getFormatFlags(s,Rt);ht.setFormat(qt)}}ae.type==="text"&&ae.set(xe.__key,we,"text"),he.type==="text"&&he.set(Ue.__key,$e,"text"),this.format=Ce|Rt}insertNodes(s){if(s.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const $e=_n();if(!Tt($e))throw Error("Expected RangeSelection after insertParagraph");return $e.insertNodes(s)}const c=xo(this.anchor.getNode(),Hi),h=s[s.length-1];if("__language"in c&&et(c)){if("__language"in s[0])this.insertText(s[0].getTextContent());else{const $e=Bc(this);c.splice($e,0,s),h.selectEnd()}return}const y=$e=>(et($e)||An($e))&&!$e.isInline();if(!s.some(y)){if(!et(c))throw Error("Expected 'firstBlock' to be an ElementNode");const $e=Bc(this);c.splice($e,0,s),h.selectEnd();return}const N=A_(s),b=N.getLastDescendant(),$=N.getChildren(),ae=$e=>"__value"in $e&&"__checked"in $e,he=$e=>et($e)&&Hi($e)&&!$e.isEmpty()&&et(c)&&(!c.isEmpty()||ae(c)),xe=!et(c)||!c.isEmpty()?this.insertParagraph():null,we=$[$.length-1];let Ce=$[0];if(he(Ce)){if(!et(c))throw Error("Expected 'firstBlock' to be an ElementNode");c.append(...Ce.getChildren()),Ce=$[1]}Ce&&Hl(c,Ce);const Ve=xo(b,Hi);xe&&et(Ve)&&(ae(xe)||Hi(we))&&(Ve.append(...xe.getChildren()),xe.remove()),et(c)&&c.isEmpty()&&c.remove(),b.selectEnd();const Ue=et(c)?c.getLastChild():null;ai(Ue)&&Ve!==c&&Ue.remove()}insertParagraph(){if(this.anchor.key==="root"){const b=qi();return tr().splice(this.anchor.offset,0,[b]),b.select(),b}const s=Bc(this),c=xo(this.anchor.getNode(),Hi);if(!et(c))throw Error("Expected ancestor to be an ElementNode");const h=c.getChildAtIndex(s),y=h?[h,...h.getNextSiblings()]:[],N=c.insertNewAfter(this,!1);return N?(N.append(...y),N.selectStart(),N):null}insertLineBreak(s){const c=ps();if(this.insertNodes([c]),s){const h=c.getParentOrThrow(),y=c.getIndexWithinParent();h.select(y,y)}}extract(){const s=this.getNodes(),c=s.length,h=c-1,y=this.anchor,N=this.focus;let b=s[0],$=s[h];const[ae,he]=ci(this);if(c===0)return[];if(c===1){if(_t(b)&&!this.isCollapsed()){const xe=ae>he?he:ae,we=ae>he?ae:he,Ce=b.splitText(xe,we),Ve=xe===0?Ce[0]:Ce[1];return Ve!=null?[Ve]:[]}return[b]}const me=y.isBefore(N);if(_t(b)){const xe=me?ae:he;xe===b.getTextContentSize()?s.shift():xe!==0&&([,b]=b.splitText(xe),s[0]=b)}if(_t($)){const we=$.getTextContent().length,Ce=me?he:ae;Ce===0?s.pop():Ce!==we&&([$]=$.splitText(Ce),s[h]=$)}return s}modify(s,c,h){const y=this.focus,N=this.anchor,b=s==="move",$=wl(y,c);if(An($)&&!$.isIsolated()){if(b&&$.isKeyboardSelectable()){const Ce=$c();Ce.add($.__key),Cr(Ce);return}const we=c?$.getPreviousSibling():$.getNextSibling();if(_t(we)){const Ce=we.__key,Ve=c?we.getTextContent().length:0;y.set(Ce,Ve,"text"),b&&N.set(Ce,Ve,"text");return}else{const Ce=$.getParentOrThrow();let Ve,Ue;et(we)?(Ue=we.__key,Ve=c?we.getChildrenSize():0):(Ve=$.getIndexWithinParent(),Ue=Ce.__key,c||Ve++),y.set(Ue,Ve,"element"),b&&N.set(Ue,Ve,"element");return}}const ae=xn(),he=ar(ae._window);if(!he)return;const me=ae._blockCursorElement,xe=ae._rootElement;if(xe!==null&&me!==null&&et($)&&!$.isInline()&&!$.canBeEmpty()&&Hs(me,ae,xe),za(he,s,c?"backward":"forward",h),he.rangeCount>0){const we=he.getRangeAt(0),Ce=this.anchor.getNode(),Ve=Ur(Ce)?Ce:Co(Ce);if(this.applyDOMRange(we),this.dirty=!0,!b){const Ue=this.getNodes(),$e=[];let Rt=!1;for(let Qe=0;Qe<Ue.length;Qe++){const ht=Ue[Qe];Bi(ht,Ve)?$e.push(ht):Rt=!0}if(Rt&&$e.length>0)if(c){const Qe=$e[0];et(Qe)?Qe.selectStart():Qe.getParentOrThrow().selectStart()}else{const Qe=$e[$e.length-1];et(Qe)?Qe.selectEnd():Qe.getParentOrThrow().selectEnd()}(he.anchorNode!==we.startContainer||he.anchorOffset!==we.startOffset)&&Po(this)}}}deleteCharacter(s){const c=this.isCollapsed();if(this.isCollapsed()){const h=this.anchor,y=this.focus;let N=h.getNode();if(!s&&(h.type==="element"&&et(N)&&h.offset===N.getChildrenSize()||h.type==="text"&&h.offset===N.getTextContentSize())){const $=N.getParent(),ae=N.getNextSibling()||($===null?null:$.getNextSibling());if(et(ae)&&ae.isShadowRoot())return}const b=wl(y,s);if(An(b)&&!b.isIsolated()){if(b.isKeyboardSelectable()&&et(N)&&N.getChildrenSize()===0){N.remove();const $=$c();$.add(b.__key),Cr($)}else b.remove(),xn().dispatchCommand(t,void 0);return}else if(!s&&et(b)&&et(N)&&N.isEmpty()){N.remove(),b.selectStart();return}if(this.modify("extend",s,"character"),this.isCollapsed()){if(s&&h.offset===0&&(h.type==="element"?h.getNode():h.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const $=y.type==="text"?y.getNode():null;if(N=h.type==="text"?h.getNode():null,$!==null&&$.isSegmented()){const ae=y.offset,he=$.getTextContentSize();if($.is(N)||s&&ae!==he||!s&&ae!==0){Wd($,s,ae);return}}else if(N!==null&&N.isSegmented()){const ae=h.offset,he=N.getTextContentSize();if(N.is($)||s&&ae!==0||!s&&ae!==he){Wd(N,s,ae);return}}y_(this,s)}}if(this.removeText(),s&&!c&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const h=this.anchor.getNode();h.isEmpty()&&Ur(h.getParent())&&h.getIndexWithinParent()===0&&h.collapseAtStart(this)}}deleteLine(s){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",s,"lineboundary"),(s?this.focus:this.anchor).offset===0&&this.modify("extend",s,"character")),this.removeText()}deleteWord(s){this.isCollapsed()&&this.modify("extend",s,"word"),this.removeText()}}function Kr(u){return u instanceof Ti}function dr(u){const s=u.offset;if(u.type==="text")return s;const c=u.getNode();return s===c.getChildrenSize()?c.getTextContent().length:0}function ci(u){const s=u.anchor,c=u.focus;return s.type==="element"&&c.type==="element"&&s.key===c.key&&s.offset===c.offset?[0,0]:[dr(s),dr(c)]}function Po(u){const s=u.focus,c=u.anchor,h=c.key,y=c.offset,N=c.type;Tn(c,s.key,s.offset,s.type),Tn(s,h,y,N),u._cachedNodes=null}function za(u,s,c,h){u.modify(s,c,h)}function y_(u,s){const c=u.anchor,h=u.focus,y=c.getNode(),N=h.getNode();if(y===N&&c.type==="text"&&h.type==="text"){const b=c.offset,$=h.offset,ae=b<$,he=ae?b:$,me=ae?$:b,xe=me-1;if(he!==xe){const we=y.getTextContent().slice(he,me);Rs(we)||(s?h.offset=xe:c.offset=xe)}}}function Wd(u,s,c){const h=u,N=h.getTextContent().split(/(?=\s)/g),b=N.length;let $=0,ae=0;for(let me=0;me<b;me++){const xe=N[me],we=me===b-1;if(ae=$,$+=xe.length,s&&$===c||$>c||we){N.splice(me,1),we&&(ae=void 0);break}}const he=N.join("").trim();he===""?h.remove():(h.setTextContent(he),h.select(ae,ae))}function N_(u,s,c){const h=u.getParent();return c===null||h===null||!h.canBeEmpty()||h!==c.getNode()}function Kd(u,s,c,h){let y=s,N;if(u.nodeType===ke){let b=!1;const $=u.childNodes,ae=$.length;y===ae&&(b=!0,y=ae-1);let he=$[y],me=!1;if(he===h._blockCursorElement?(he=$[y+1],me=!0):h._blockCursorElement!==null&&y--,N=Li(he),_t(N))y=yl(N,b);else{let xe=Li(u);if(xe===null)return null;if(et(xe)){let we=xe.getChildAtIndex(y);if(et(we)&&N_(we,y,c)){const Ce=b?we.getLastDescendant():we.getFirstDescendant();Ce===null?(xe=we,y=0):(we=Ce,xe=et(we)?we:we.getParentOrThrow())}_t(we)?(N=we,xe=null,y=yl(we,b)):we!==xe&&b&&!me&&y++}else{const we=xe.getIndexWithinParent();s===0&&An(xe)&&Li(u)===xe?y=we:y=we+1,xe=xe.getParentOrThrow()}if(et(xe))return Rr(xe.__key,y,"element")}}else N=Li(u);return _t(N)?Rr(N.__key,y,"text"):null}function zd(u,s,c){const h=u.offset,y=u.getNode();if(h===0){const N=y.getPreviousSibling(),b=y.getParent();if(!s)et(N)&&!c&&N.isInline()?(u.key=N.__key,u.offset=N.getChildrenSize(),u.type="element"):_t(N)&&(u.key=N.__key,u.offset=N.getTextContent().length);else if((c||!s)&&N===null&&et(b)&&b.isInline()){const $=b.getPreviousSibling();_t($)&&(u.key=$.__key,u.offset=$.getTextContent().length)}}else if(h===y.getTextContent().length){const N=y.getNextSibling(),b=y.getParent();if(s&&et(N)&&N.isInline())u.key=N.__key,u.offset=0,u.type="element";else if((c||s)&&N===null&&et(b)&&b.isInline()&&!b.canInsertTextAfter()){const $=b.getNextSibling();_t($)&&(u.key=$.__key,u.offset=0)}}}function Ud(u,s,c){if(u.type==="text"&&s.type==="text"){const h=u.isBefore(s),y=u.is(s);zd(u,h,y),zd(s,!h,y),y&&(s.key=u.key,s.offset=u.offset,s.type=u.type);const N=xn();if(N.isComposing()&&N._compositionKey!==u.key&&Tt(c)){const b=c.anchor,$=c.focus;Tn(u,b.key,b.offset,b.type),Tn(s,$.key,$.offset,$.type)}}}function Gd(u,s,c,h,y,N){if(u===null||c===null||!ss(y,u,c))return null;const b=Kd(u,s,Tt(N)?N.anchor:null,y);if(b===null)return null;const $=Kd(c,h,Tt(N)?N.focus:null,y);if($===null)return null;if(b.type==="element"&&$.type==="element"){const ae=Li(u),he=Li(c);if(An(ae)&&An(he))return null}return Ud(b,$,N),[b,$]}function C_(u){return et(u)&&!u.isInline()}function Yd(u,s,c,h,y,N){const b=xi(),$=new rr(Rr(u,s,y),Rr(c,h,N),0,"");return $.dirty=!0,b._selection=$,$}function E_(){const u=Rr("root",0,"element"),s=Rr("root",0,"element");return new rr(u,s,0,"")}function $c(){return new Ti(new Set)}function T_(u){const c=u.getEditorState()._selection,h=ar(u._window);return Tt(c)||c==null?Fc(c,h,u,null):c.clone()}function Fc(u,s,c,h){const y=c._window;if(y===null)return null;const N=h||y.event,b=N?N.type:void 0,$=b==="selectionchange",ae=!Pt()&&($||b==="beforeinput"||b==="compositionstart"||b==="compositionend"||b==="click"&&N&&N.detail===3||b==="drop"||b===void 0);let he,me,xe,we;if(!Tt(u)||ae){if(s===null)return null;if(he=s.anchorNode,me=s.focusNode,xe=s.anchorOffset,we=s.focusOffset,$&&Tt(u)&&!ss(c,he,me))return u.clone()}else return u.clone();const Ce=Gd(he,xe,me,we,c,u);if(Ce===null)return null;const[Ve,Ue]=Ce;return new rr(Ve,Ue,Tt(u)?u.format:0,Tt(u)?u.style:"")}function _n(){return xi()._selection}function $o(){return xn()._editorState._selection}function Ua(u,s,c,h=1){const y=u.anchor,N=u.focus,b=y.getNode(),$=N.getNode();if(!s.is(b)&&!s.is($))return;const ae=s.__key;if(u.isCollapsed()){const he=y.offset;if(c<=he&&h>0||c<he&&h<0){const me=Math.max(0,he+h);y.set(ae,me,"element"),N.set(ae,me,"element"),jd(u)}}else{const he=u.isBackward(),me=he?N:y,xe=me.getNode(),we=he?y:N,Ce=we.getNode();if(s.is(xe)){const Ve=me.offset;(c<=Ve&&h>0||c<Ve&&h<0)&&me.set(ae,Math.max(0,Ve+h),"element")}if(s.is(Ce)){const Ve=we.offset;(c<=Ve&&h>0||c<Ve&&h<0)&&we.set(ae,Math.max(0,Ve+h),"element")}}jd(u)}function jd(u){const s=u.anchor,c=s.offset,h=u.focus,y=h.offset,N=s.getNode(),b=h.getNode();if(u.isCollapsed()){if(!et(N))return;const $=N.getChildrenSize(),ae=c>=$,he=ae?N.getChildAtIndex($-1):N.getChildAtIndex(c);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),s.set(he.__key,me,"text"),h.set(he.__key,me,"text")}return}if(et(N)){const $=N.getChildrenSize(),ae=c>=$,he=ae?N.getChildAtIndex($-1):N.getChildAtIndex(c);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),s.set(he.__key,me,"text")}}if(et(b)){const $=b.getChildrenSize(),ae=y>=$,he=ae?b.getChildAtIndex($-1):b.getChildAtIndex(y);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),h.set(he.__key,me,"text")}}}function x_(u,s){const h=s.getEditorState()._selection,y=u._selection;if(Tt(y)){const N=y.anchor,b=y.focus;let $;if(N.type==="text"&&($=N.getNode(),$.selectionTransform(h,y)),b.type==="text"){const ae=b.getNode();$!==ae&&ae.selectionTransform(h,y)}}}function Ga(u,s,c,h,y){let N=null,b=0,$=null;h!==null?(N=h.__key,_t(h)?(b=h.getTextContentSize(),$="text"):et(h)&&(b=h.getChildrenSize(),$="element")):y!==null&&(N=y.__key,_t(y)?$="text":et(y)&&($="element")),N!==null&&$!==null?u.set(N,b,$):(b=s.getIndexWithinParent(),b===-1&&(b=c.getChildrenSize()),u.set(c.__key,b,"element"))}function Vd(u,s,c,h,y){u.type==="text"?(u.key=c,s||(u.offset+=y)):u.offset>h.getIndexWithinParent()&&(u.offset-=1)}function v_(u,s,c,h,y,N,b){const $=h.anchorNode,ae=h.focusNode,he=h.anchorOffset,me=h.focusOffset,xe=document.activeElement;if(y.has("collaboration")&&xe!==N||xe!==null&&Ds(xe))return;if(!Tt(s)){u!==null&&ss(c,$,ae)&&h.removeAllRanges();return}const we=s.anchor,Ce=s.focus,Ve=we.key,Ue=Ce.key,$e=Fs(c,Ve),Rt=Fs(c,Ue),Qe=we.offset,ht=Ce.offset,qt=s.format,Wt=s.style,Dt=s.isCollapsed();let cn=$e,ir=Rt,ms=!1;if(we.type==="text"){cn=Pr($e);const hr=we.getNode();ms=hr.getFormat()!==qt||hr.getStyle()!==Wt}else Tt(u)&&u.anchor.type==="text"&&(ms=!0);if(Ce.type==="text"&&(ir=Pr(Rt)),!(cn===null||ir===null)&&(Dt&&(u===null||ms||Tt(u)&&(u.format!==qt||u.style!==Wt))&&Yn(qt,Wt,Qe,Ve,performance.now()),!(he===Qe&&me===ht&&$===cn&&ae===ir&&!(h.type==="Range"&&Dt)&&((xe===null||!N.contains(xe))&&N.focus({preventScroll:!0}),we.type!=="element")))){try{h.setBaseAndExtent(cn,Qe,ir,ht)}catch{}if(!y.has("skip-scroll-into-view")&&s.isCollapsed()&&N!==null&&N===document.activeElement){const hr=s instanceof rr&&s.anchor.type==="element"?cn.childNodes[Qe]||null:h.rangeCount>0?h.getRangeAt(0):null;if(hr!==null){let rn;if(hr instanceof Text){const kn=document.createRange();kn.selectNode(hr),rn=kn.getBoundingClientRect()}else rn=hr.getBoundingClientRect();yi(c,rn,N)}}zt()}}function S_(u){let s=_n()||$o();s===null&&(s=tr().selectEnd()),s.insertNodes(u)}function w_(){const u=_n();return u===null?"":u.getTextContent()}function O_(u,s,c){const h=[];let y=null,N=null;function b(he,me,xe){const we={cell:xe,startColumn:me,startRow:he},Ce=xe.__rowSpan,Ve=xe.__colSpan;for(let Ue=0;Ue<Ce;Ue++){h[he+Ue]===void 0&&(h[he+Ue]=[]);for(let $e=0;$e<Ve;$e++)h[he+Ue][me+$e]=we}s.is(xe)&&(y=we),c.is(xe)&&(N=we)}function $(he,me){return h[he]===void 0||h[he][me]===void 0}const ae=u.getChildren();for(let he=0;he<ae.length;he++){const me=ae[he];if(!Gc(me))throw Error("Expected GridNode children to be GridRowNode");const xe=me.getChildren();let we=0;for(const Ce of xe){if(!Wo(Ce))throw Error("Expected GridRowNode children to be GridCellNode");for(;!$(he,we);)we++;b(he,we,Ce),we+=Ce.__colSpan}}if(y===null)throw Error("Anchor not found in Grid");if(N===null)throw Error("Focus not found in Grid");return[h,y,N]}function qd(u){let s;if(u instanceof Uc)s=u;else if(u instanceof oi){const y=To(u,Wo);if(!Wo(y))throw Error("Expected to find a parent GridCellNode");s=y}else{const y=To(u.getNode(),Wo);if(!Wo(y))throw Error("Expected to find a parent GridCellNode");s=y}const c=s.getParent();if(!Gc(c))throw Error("Expected GridCellNode to have a parent GridRowNode");const h=c.getParent();if(!uf(h))throw Error("Expected GridRowNode to have a parent GridNode");return[s,c,h]}function Bc(u){u.isCollapsed()||u.removeText();const s=u.anchor;let c=s.getNode(),h=s.offset;for(;!Hi(c);)[c,h]=D_(c,h);return h}function D_(u,s){const c=u.getParent();if(!c){const y=qi();return tr().append(y),y.select(),[tr(),0]}if(_t(u)){const y=u.splitText(s);if(y.length===0)return[c,u.getIndexWithinParent()];const N=s===0?0:1,b=y[0].getIndexWithinParent()+N;return[c,b]}if(!et(u)||s===0)return[c,u.getIndexWithinParent()];const h=u.getChildAtIndex(s);if(h){const y=new rr(Rr(u.__key,s,"element"),Rr(u.__key,s,"element"),0,""),N=u.insertNewAfter(y);N&&N.append(h,...h.getNextSiblings())}return[c,u.getIndexWithinParent()+1]}function A_(u){const s=qi();let c=null;for(let h=0;h<u.length;h++){const y=u[h],N=ai(y);if(N||An(y)&&y.isInline()||et(y)&&y.isInline()||_t(y)||y.isParentRequired()){if(c===null&&(c=y.createParentElementNode(),s.append(c),N))continue;c!==null&&c.append(y)}else s.append(y),c=null}return s}let Qn=null,er=null,Ir=!1,Hc=!1,Ya=0;const Zd={characterData:!0,childList:!0,subtree:!0};function Fo(){return Ir||Qn!==null&&Qn._readOnly}function fr(){if(Ir)throw Error("Cannot use method in read-only mode.")}function Jd(){if(Ya>99)throw Error("One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function xi(){if(Qn===null)throw Error("Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update() or editorState.read().");return Qn}function xn(){if(er===null)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return er}function M_(){return er}function Xd(u,s,c){const h=s.__type,y=pa(u,h);let N=c.get(h);N===void 0&&(N=Array.from(y.transforms),c.set(h,N));const b=N.length;for(let $=0;$<b&&(N[$](s),!!s.isAttached());$++);}function Qd(u,s){return u!==void 0&&u.__key!==s&&u.isAttached()}function R_(u,s){const c=s._dirtyLeaves,h=u._nodeMap;for(const y of c){const N=h.get(y);_t(N)&&N.isAttached()&&N.isSimpleText()&&!N.isUnmergeable()&&Nr(N)}}function b_(u,s){const c=s._dirtyLeaves,h=s._dirtyElements,y=u._nodeMap,N=lr(),b=new Map;let $=c,ae=$.size,he=h,me=he.size;for(;ae>0||me>0;){if(ae>0){s._dirtyLeaves=new Set;for(const xe of $){const we=y.get(xe);_t(we)&&we.isAttached()&&we.isSimpleText()&&!we.isUnmergeable()&&Nr(we),we!==void 0&&Qd(we,N)&&Xd(s,we,b),c.add(xe)}if($=s._dirtyLeaves,ae=$.size,ae>0){Ya++;continue}}s._dirtyLeaves=new Set,s._dirtyElements=new Map;for(const xe of he){const we=xe[0],Ce=xe[1];if(we!=="root"&&!Ce)continue;const Ve=y.get(we);Ve!==void 0&&Qd(Ve,N)&&Xd(s,Ve,b),h.set(we,Ce)}$=s._dirtyLeaves,ae=$.size,he=s._dirtyElements,me=he.size,Ya++}s._dirtyLeaves=c,s._dirtyElements=h}function L_(u){return Wc(u,xn()._nodes)}function Wc(u,s){const c=u.type,h=s.get(c);if(h===void 0)throw Error(`parseEditorState: type "${c}" + not found`);const y=h.klass;if(u.type!==y.getType())throw Error(`LexicalNode: Node ${y.name} does not implement .importJSON().`);const N=y.importJSON(u),b=u.children;if(et(N)&&Array.isArray(b))for(let $=0;$<b.length;$++){const ae=b[$],he=Wc(ae,s);N.append(he)}return N}function I_(u,s,c){const h=zc(),y=Qn,N=Ir,b=er,$=s._dirtyElements,ae=s._dirtyLeaves,he=s._cloneNotNeeded,me=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Qn=h,Ir=!1,er=s;try{const xe=s._nodes,we=u.root;Wc(we,xe),c&&c(),h._readOnly=!0,tf(h)}catch(xe){xe instanceof Error&&s._onError(xe)}finally{s._dirtyElements=$,s._dirtyLeaves=ae,s._cloneNotNeeded=he,s._dirtyType=me,Qn=y,Ir=N,er=b}return h}function ef(u,s){const c=Qn,h=Ir,y=er;Qn=u,Ir=!0,er=null;try{return s()}finally{Qn=c,Ir=h,er=y}}function tf(u){const s=u._nodeMap;s.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},s.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},s.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function Js(u,s){const c=u._pendingEditorState,h=u._rootElement,y=u._headless||h===null;if(c===null)return;const N=u._editorState,b=N._selection,$=c._selection,ae=u._dirtyType!==qe,he=Qn,me=Ir,xe=er,we=u._updating,Ce=u._observer;let Ve=null;if(u._pendingEditorState=null,u._editorState=c,!y&&ae&&Ce!==null){er=u,Qn=c,Ir=!1,u._updating=!0;try{const Dt=u._dirtyType,cn=u._dirtyElements,ir=u._dirtyLeaves;Ce.disconnect(),Ve=Ui(N,c,u,Dt,cn,ir)}catch(Dt){if(Dt instanceof Error&&u._onError(Dt),!Hc)af(u,null,h,c),sr(u),u._dirtyType=ut,Hc=!0,Js(u,N),Hc=!1;else throw Dt;return}finally{Ce.observe(h,Zd),u._updating=we,Qn=he,Ir=me,er=xe}}c._readOnly||(c._readOnly=!0,tf(c),Tt($)&&(Object.freeze($.anchor),Object.freeze($.focus)),Object.freeze($));const Ue=u._dirtyLeaves,$e=u._dirtyElements,Rt=u._normalizedNodes,Qe=u._updateTags,ht=u._deferred;ae&&(u._dirtyType=qe,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements=new Map,u._normalizedNodes=new Set,u._updateTags=new Set),La(u,c);const qt=y?null:ar(u._window);if(u._editable&&qt!==null&&(ae||$===null||$.dirty)){er=u,Qn=c;try{if(Ce!==null&&Ce.disconnect(),ae||$===null||$.dirty){const Dt=u._blockCursorElement;Dt!==null&&Hs(Dt,u,h),v_(b,$,u,qt,Qe,h)}Ni(u,h,$),Ce!==null&&Ce.observe(h,Zd)}finally{er=xe,Qn=he}}Ve!==null&&P_(u,Ve,Qe,Ue,N),!Tt($)&&$!==null&&(b===null||!b.is($))&&u.dispatchCommand(t,void 0);const Wt=u._pendingDecorators;Wt!==null&&(u._decorators=Wt,u._pendingDecorators=null,Gl("decorator",u,!0,Wt)),k_(u,s||N,c),Gl("update",u,!0,{dirtyElements:$e,dirtyLeaves:Ue,editorState:c,normalizedNodes:Rt,prevEditorState:s||N,tags:Qe}),F_(u,ht),$_(u)}function k_(u,s,c){const h=go(s),y=go(c);h!==y&&Gl("textcontent",u,!0,y)}function P_(u,s,c,h,y){const N=Array.from(u._listeners.mutation),b=N.length;for(let $=0;$<b;$++){const[ae,he]=N[$],me=s.get(he);me!==void 0&&ae(me,{dirtyLeaves:h,prevEditorState:y,updateTags:c})}}function Gl(u,s,c,...h){const y=s._updating;s._updating=c;try{const N=Array.from(s._listeners[u]);for(let b=0;b<N.length;b++)N[b].apply(null,h)}finally{s._updating=y}}function nf(u,s,c){if(u._updating===!1||er!==u){let y=!1;return u.update(()=>{y=nf(u,s,c)}),y}const h=Ii(u);for(let y=4;y>=0;y--)for(let N=0;N<h.length;N++){const ae=h[N]._commands.get(s);if(ae!==void 0){const he=ae[y];if(he!==void 0){const me=Array.from(he),xe=me.length;for(let we=0;we<xe;we++)if(me[we](c,u)===!0)return!0}}}return!1}function $_(u){const s=u._updates;if(s.length!==0){const c=s.shift();if(c){const[h,y]=c;sf(u,h,y)}}}function F_(u,s){if(u._deferred=[],s.length!==0){const c=u._updating;u._updating=!0;try{for(let h=0;h<s.length;h++)s[h]()}finally{u._updating=c}}}function rf(u,s){const c=u._updates;let h=s||!1;for(;c.length!==0;){const y=c.shift();if(y){const[N,b]=y;let $,ae;b!==void 0&&($=b.onUpdate,ae=b.tag,b.skipTransforms&&(h=!0),$&&u._deferred.push($),ae&&u._updateTags.add(ae)),N()}}return h}function sf(u,s,c){const h=u._updateTags;let y,N,b=!1,$=!1;c!==void 0&&(y=c.onUpdate,N=c.tag,N!=null&&h.add(N),b=c.skipTransforms||!1,$=c.discrete||!1),y&&u._deferred.push(y);const ae=u._editorState;let he=u._pendingEditorState,me=!1;(he===null||he._readOnly)&&(he=u._pendingEditorState=W_(he||ae),me=!0),he._flushSync=$;const xe=Qn,we=Ir,Ce=er,Ve=u._updating;Qn=he,Ir=!1,u._updating=!0,er=u;try{me&&(u._headless?ae._selection!=null&&(he._selection=ae._selection.clone()):he._selection=T_(u));const $e=u._compositionKey;s(),b=rf(u,b),x_(he,u),u._dirtyType!==qe&&(b?R_(he,u):b_(he,u),rf(u),Ml(ae,he,u._dirtyLeaves,u._dirtyElements));const Rt=u._compositionKey;$e!==Rt&&(he._flushSync=!0);const Qe=he._selection;if(Tt(Qe)){const ht=he._nodeMap,qt=Qe.anchor.key,Wt=Qe.focus.key;if(ht.get(qt)===void 0||ht.get(Wt)===void 0)throw Error("updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node.")}else Kr(Qe)&&Qe._nodes.size===0&&(he._selection=null)}catch($e){$e instanceof Error&&u._onError($e),u._pendingEditorState=ae,u._dirtyType=ut,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),Js(u);return}finally{Qn=xe,Ir=we,er=Ce,u._updating=Ve,Ya=0}u._dirtyType!==qe||H_(he,u)?he._flushSync?(he._flushSync=!1,Js(u)):me&&fo(()=>{Js(u)}):(he._flushSync=!1,me&&(h.clear(),u._deferred=[],u._pendingEditorState=null))}function zr(u,s,c){u._updating?u._updates.push([s,c]):sf(u,s,c)}class Kc extends oi{constructor(s){super(s)}decorate(s,c){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function An(u){return u instanceof Kc}class Xs extends oi{constructor(s){super(s),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 s=this.getFormat();return pe[s]||""}getIndent(){return this.getLatest().__indent}getChildren(){const s=[];let c=this.getFirstChild();for(;c!==null;)s.push(c),c=c.getNextSibling();return s}getChildrenKeys(){const s=[];let c=this.getFirstChild();for(;c!==null;)s.push(c.__key),c=c.getNextSibling();return s}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const c=xn()._dirtyElements;return c!==null&&c.has(this.__key)}isLastChild(){const s=this.getLatest(),c=this.getParentOrThrow().getLastChild();return c!==null&&c.is(s)}getAllTextNodes(){const s=[];let c=this.getFirstChild();for(;c!==null;){if(_t(c)&&s.push(c),et(c)){const h=c.getAllTextNodes();s.push(...h)}c=c.getNextSibling()}return s}getFirstDescendant(){let s=this.getFirstChild();for(;s!==null;){if(et(s)){const c=s.getFirstChild();if(c!==null){s=c;continue}}break}return s}getLastDescendant(){let s=this.getLastChild();for(;s!==null;){if(et(s)){const c=s.getLastChild();if(c!==null){s=c;continue}}break}return s}getDescendantByIndex(s){const c=this.getChildren(),h=c.length;if(s>=h){const N=c[h-1];return et(N)&&N.getLastDescendant()||N||null}const y=c[s];return et(y)&&y.getFirstDescendant()||y||null}getFirstChild(){const c=this.getLatest().__first;return c===null?null:Cn(c)}getFirstChildOrThrow(){const s=this.getFirstChild();if(s===null)throw Error(`Expected node ${this.__key} to have a first child.`);return s}getLastChild(){const c=this.getLatest().__last;return c===null?null:Cn(c)}getLastChildOrThrow(){const s=this.getLastChild();if(s===null)throw Error(`Expected node ${this.__key} to have a last child.`);return s}getChildAtIndex(s){const c=this.getChildrenSize();let h,y;if(s<c/2){for(h=this.getFirstChild(),y=0;h!==null&&y<=s;){if(y===s)return h;h=h.getNextSibling(),y++}return null}for(h=this.getLastChild(),y=c-1;h!==null&&y>=s;){if(y===s)return h;h=h.getPreviousSibling(),y--}return null}getTextContent(){let s="";const c=this.getChildren(),h=c.length;for(let y=0;y<h;y++){const N=c[y];s+=N.getTextContent(),et(N)&&y!==h-1&&!N.isInline()&&(s+=$t)}return s}getTextContentSize(){let s=0;const c=this.getChildren(),h=c.length;for(let y=0;y<h;y++){const N=c[y];s+=N.getTextContentSize(),et(N)&&y!==h-1&&!N.isInline()&&(s+=$t.length)}return s}getDirection(){return this.getLatest().__dir}hasFormat(s){if(s!==""){const c=_i[s];return(this.getFormat()&c)!==0}return!1}select(s,c){fr();const h=_n();let y=s,N=c;const b=this.getChildrenSize();if(!this.canBeEmpty()){if(s===0&&c===0){const ae=this.getFirstChild();if(_t(ae)||et(ae))return ae.select(0,0)}else if((s===void 0||s===b)&&(c===void 0||c===b)){const ae=this.getLastChild();if(_t(ae)||et(ae))return ae.select()}}y===void 0&&(y=b),N===void 0&&(N=b);const $=this.__key;if(Tt(h))h.anchor.set($,y,"element"),h.focus.set($,N,"element"),h.dirty=!0;else return Yd($,y,$,N,"element","element");return h}selectStart(){const s=this.getFirstDescendant();return s?s.selectStart():this.select()}selectEnd(){const s=this.getLastDescendant();return s?s.selectEnd():this.select()}clear(){const s=this.getWritable();return this.getChildren().forEach(h=>h.remove()),s}append(...s){return this.splice(this.getChildrenSize(),0,s)}setDirection(s){const c=this.getWritable();return c.__dir=s,c}setFormat(s){const c=this.getWritable();return c.__format=s!==""?_i[s]:0,this}setIndent(s){const c=this.getWritable();return c.__indent=s,this}splice(s,c,h){const y=h.length,N=this.getChildrenSize(),b=this.getWritable(),$=b.__key,ae=[],he=[],me=this.getChildAtIndex(s+c);let xe=null,we=N-c+y;if(s!==0)if(s===N)xe=this.getLastChild();else{const Ve=this.getChildAtIndex(s);Ve!==null&&(xe=Ve.getPreviousSibling())}if(c>0){let Ve=xe===null?this.getFirstChild():xe.getNextSibling();for(let Ue=0;Ue<c;Ue++){if(Ve===null)throw Error("splice: sibling not found");const $e=Ve.getNextSibling(),Rt=Ve.__key,Qe=Ve.getWritable();Vr(Qe),he.push(Rt),Ve=$e}}let Ce=xe;for(let Ve=0;Ve<y;Ve++){const Ue=h[Ve];Ce!==null&&Ue.is(Ce)&&(xe=Ce=Ce.getPreviousSibling());const $e=Ue.getWritable();$e.__parent===$&&we--,Vr($e);const Rt=Ue.__key;if(Ce===null)b.__first=Rt,$e.__prev=null;else{const Qe=Ce.getWritable();Qe.__next=Rt,$e.__prev=Qe.__key}if(Ue.__key===$)throw Error("append: attempting to append self");$e.__parent=$,ae.push(Rt),Ce=Ue}if(s+c===N){if(Ce!==null){const Ve=Ce.getWritable();Ve.__next=null,b.__last=Ce.__key}}else if(me!==null){const Ve=me.getWritable();if(Ce!==null){const Ue=Ce.getWritable();Ve.__prev=Ce.__key,Ue.__next=me.__key}else Ve.__prev=null}if(b.__size=we,he.length){const Ve=_n();if(Tt(Ve)){const Ue=new Set(he),$e=new Set(ae),{anchor:Rt,focus:Qe}=Ve;of(Rt,Ue,$e)&&Ga(Rt,Rt.getNode(),this,xe,me),of(Qe,Ue,$e)&&Ga(Qe,Qe.getNode(),this,xe,me),we===0&&!this.canBeEmpty()&&!si(this)&&this.remove()}}return b}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(s,c){return null}canIndent(){return!0}collapseAtStart(s){return!1}excludeFromCopy(s){return!1}canExtractContents(){return!0}canReplaceWith(s){return!0}canInsertAfter(s){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(s){return!1}extractWithChild(s,c,h){return!1}}function et(u){return u instanceof Xs}function of(u,s,c){let h=u.getNode();for(;h;){const y=h.__key;if(s.has(y)&&!c.has(y))return!0;h=h.getParent()}return!1}class Bo extends Xs{static getType(){return"root"}static clone(){return new Bo}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const s=this.__cachedText;return(Fo()||xn()._dirtyType===qe)&&s!==null?s:super.getTextContent()}remove(){throw Error("remove: cannot be called on root nodes")}replace(s){throw Error("replace: cannot be called on root nodes")}insertBefore(s){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(s){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(s,c){return!1}append(...s){for(let c=0;c<s.length;c++){const h=s[c];if(!et(h)&&!An(h))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...s)}static importJSON(s){const c=tr();return c.setFormat(s.format),c.setIndent(s.indent),c.setDirection(s.direction),c}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function B_(){return new Bo}function Ur(u){return u instanceof Bo}function H_(u,s){const c=s.getEditorState()._selection,h=u._selection;if(h!==null){if(h.dirty||!h.is(c))return!0}else if(c!==null)return!0;return!1}function W_(u){return new ja(new Map(u._nodeMap))}function zc(){return new ja(new Map([["root",B_()]]))}function lf(u){const s=u.exportJSON(),c=u.constructor;if(s.type!==c.getType())throw Error(`LexicalNode: Node ${c.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(et(u)){const h=s.children;if(!Array.isArray(h))throw Error(`LexicalNode: Node ${c.name} is an element but .exportJSON() does not have a children array.`);const y=u.getChildren();for(let N=0;N<y.length;N++){const b=y[N],$=lf(b);h.push($)}}return s}class ja{constructor(s,c){this._nodeMap=s,this._selection=c||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(s){return ef(this,s)}clone(s){const c=new ja(this._nodeMap,s===void 0?this._selection:s);return c._readOnly=!0,c}toJSON(){return ef(this,()=>({root:lf(tr())}))}}class Ho extends Xs{static getType(){return"paragraph"}static clone(s){return new Ho(s.__key)}createDOM(s){const c=document.createElement("p"),h=$i(s.theme,"paragraph");return h!==void 0&&c.classList.add(...h),c}updateDOM(s,c,h){return!1}static importDOM(){return{p:s=>({conversion:K_,priority:0})}}exportDOM(s){const{element:c}=super.exportDOM(s);if(c&&Ws(c)){this.isEmpty()&&c.append(document.createElement("br"));const h=this.getFormatType();c.style.textAlign=h;const y=this.getDirection();y&&(c.dir=y);const N=this.getIndent();N>0&&(c.style.textIndent=`${N*20}px`)}return{element:c}}static importJSON(s){const c=qi();return c.setFormat(s.format),c.setIndent(s.indent),c.setDirection(s.direction),c}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(s,c){const h=qi(),y=this.getDirection();return h.setDirection(y),this.insertAfter(h,c),h}collapseAtStart(){const s=this.getChildren();if(s.length===0||_t(s[0])&&s[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 K_(u){const s=qi();if(u.style){s.setFormat(u.style.textAlign);const c=parseInt(u.style.textIndent,10)/20;c>0&&s.setIndent(c)}return{node:s}}function qi(){return Dr(new Ho)}function z_(u){return u instanceof Ho}const U_=0,G_=1,Y_=2,j_=3,V_=4;function af(u,s,c,h){const y=u._keyToDOMMap;y.clear(),u._editorState=zc(),u._pendingEditorState=h,u._compositionKey=null,u._dirtyType=qe,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),u._normalizedNodes=new Set,u._updateTags=new Set,u._updates=[],u._blockCursorElement=null;const N=u._observer;N!==null&&(N.disconnect(),u._observer=null),s!==null&&(s.textContent=""),c!==null&&(c.textContent="",y.set("root",c))}function q_(u,s){const c=new Map,h=new Set,y=N=>{Object.keys(N).forEach(b=>{let $=c.get(b);$===void 0&&($=[],c.set(b,$)),$.push(N[b])})};return u.forEach(N=>{const b=N.klass.importDOM!=null?N.klass.importDOM.bind(N.klass):null;if(b==null||h.has(b))return;h.add(b);const $=b();$!==null&&y($)}),s&&y(s),c}function Z_(u){const s=u||{},c=M_(),h=s.theme||{},y=u===void 0?c:s.parentEditor||null,N=s.disableEvents||!1,b=zc(),$=s.namespace||(y!==null?y._config.namespace:Nl()),ae=s.editorState,he=[Bo,Jr,ji,xr,Ho,...s.nodes||[]],{onError:me,html:xe}=s,we=s.editable!==void 0?s.editable:!0;let Ce;if(u===void 0&&c!==null)Ce=c._nodes;else{Ce=new Map;for(let Ue=0;Ue<he.length;Ue++){let $e=he[Ue],Rt=null,Qe=null;if(typeof $e!="function"){const Dt=$e;$e=Dt.replace,Rt=Dt.with,Qe=Dt.withKlass||null}{const Dt=$e.name;if(Dt!=="RootNode"){const cn=$e.prototype;["getType","clone"].forEach(ir=>{$e.hasOwnProperty(ir)||console.warn(`${Dt} must implement static "${ir}" method`)}),!$e.hasOwnProperty("importDOM")&&$e.hasOwnProperty("exportDOM")&&console.warn(`${Dt} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),cn instanceof Kc&&(cn.hasOwnProperty("decorate")||console.warn(`${cn.constructor.name} must implement "decorate" method`)),$e.hasOwnProperty("importJSON")||console.warn(`${Dt} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),cn.hasOwnProperty("exportJSON")||console.warn(`${Dt} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const ht=$e.getType(),qt=$e.transform(),Wt=new Set;qt!==null&&Wt.add(qt),Ce.set(ht,{exportDOM:xe&&xe.export?xe.export.get($e):void 0,klass:$e,replace:Rt,replaceWithKlass:Qe,transforms:Wt})}}const Ve=new J_(b,y,Ce,{disableEvents:N,namespace:$,theme:h},me||console.error,q_(Ce,xe?xe.import:void 0),we);return ae!==void 0&&(Ve._pendingEditorState=ae,Ve._dirtyType=ut),Ve}class J_{constructor(s,c,h,y,N,b,$){this._parentEditor=c,this._rootElement=null,this._editorState=s,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=y,this._nodes=h,this._decorators={},this._pendingDecorators=null,this._dirtyType=qe,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=Nl(),this._onError=N,this._htmlConversions=b,this._editable=$,this._headless=c!==null&&c._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(s){const c=this._listeners.update;return c.add(s),()=>{c.delete(s)}}registerEditableListener(s){const c=this._listeners.editable;return c.add(s),()=>{c.delete(s)}}registerDecoratorListener(s){const c=this._listeners.decorator;return c.add(s),()=>{c.delete(s)}}registerTextContentListener(s){const c=this._listeners.textcontent;return c.add(s),()=>{c.delete(s)}}registerRootListener(s){const c=this._listeners.root;return s(this._rootElement,null),c.add(s),()=>{s(null,this._rootElement),c.delete(s)}}registerCommand(s,c,h){if(h===void 0)throw Error('Listener for type "command" requires a "priority".');const y=this._commands;y.has(s)||y.set(s,[new Set,new Set,new Set,new Set,new Set]);const N=y.get(s);if(N===void 0)throw Error(`registerCommand: Command ${String(s)} not found in command map`);const b=N[h];return b.add(c),()=>{b.delete(c),N.every($=>$.size===0)&&y.delete(s)}}registerMutationListener(s,c){if(this._nodes.get(s.getType())===void 0)throw Error(`Node ${s.name} has not been registered. Ensure node has been passed to createEditor.`);const y=this._listeners.mutation;return y.set(c,s),()=>{y.delete(c)}}registerNodeTransformToKlass(s,c){const h=s.getType(),y=this._nodes.get(h);if(y===void 0)throw Error(`Node ${s.name} has not been registered. Ensure node has been passed to createEditor.`);return y.transforms.add(c),y}registerNodeTransform(s,c){const h=this.registerNodeTransformToKlass(s,c),y=[h],N=h.replaceWithKlass;if(N!=null){const b=this.registerNodeTransformToKlass(N,c);y.push(b)}return bi(this,s.getType()),()=>{y.forEach(b=>b.transforms.delete(c))}}hasNode(s){return this._nodes.has(s.getType())}hasNodes(s){return s.every(this.hasNode.bind(this))}dispatchCommand(s,c){return dt(this,s,c)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(s){const c=this._rootElement;if(s!==c){const h=$i(this._config.theme,"root"),y=this._pendingEditorState||this._editorState;if(this._rootElement=s,af(this,c,s,y),c!==null&&(this._config.disableEvents||wt(c),h!=null&&c.classList.remove(...h)),s!==null){const N=Ma(s),b=s.style;b.userSelect="text",b.whiteSpace="pre-wrap",b.wordBreak="break-word",s.setAttribute("data-lexical-editor","true"),this._window=N,this._dirtyType=ut,sr(this),this._updateTags.add("history-merge"),Js(this),this._config.disableEvents||pt(s,this),h!=null&&s.classList.add(...h)}else this._editorState=y,this._pendingEditorState=null,this._window=null;Gl("root",this,!1,s,c)}}getElementByKey(s){return this._keyToDOMMap.get(s)||null}getEditorState(){return this._editorState}setEditorState(s,c){if(s.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");fn(this);const h=this._pendingEditorState,y=this._updateTags,N=c!==void 0?c.tag:null;h!==null&&!h.isEmpty()&&(N!=null&&y.add(N),Js(this)),this._pendingEditorState=s,this._dirtyType=ut,this._dirtyElements.set("root",!1),this._compositionKey=null,N!=null&&y.add(N),Js(this)}parseEditorState(s,c){const h=typeof s=="string"?JSON.parse(s):s;return I_(h,this,c)}update(s,c){zr(this,s,c)}focus(s,c={}){const h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),zr(this,()=>{const y=_n(),N=tr();y!==null?y.dirty=!0:N.getChildrenSize()!==0&&(c.defaultSelection==="rootStart"?N.selectStart():N.selectEnd())},{onUpdate:()=>{h.removeAttribute("autocapitalize"),s&&s()},tag:"focus"}),this._pendingEditorState===null&&h.removeAttribute("autocapitalize"))}blur(){const s=this._rootElement;s!==null&&s.blur();const c=ar(this._window);c!==null&&c.removeAllRanges()}isEditable(){return this._editable}setEditable(s){this._editable!==s&&(this._editable=s,Gl("editable",this,!0,s))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Uc extends Xs{constructor(s,c){super(c),this.__colSpan=s,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(s){return this.getWritable().__colSpan=s,this}getRowSpan(){return this.__rowSpan}setRowSpan(s){return this.getWritable().__rowSpan=s,this}}function Wo(u){return u instanceof Uc}class cf extends Xs{}function uf(u){return u instanceof cf}class df extends Xs{}function Gc(u){return u instanceof df}return He.$INTERNAL_isPointSelection=ur,He.$addUpdateTag=Ct,He.$applyNodeReplacement=Dr,He.$copyNode=Dl,He.$createLineBreakNode=ps,He.$createNodeSelection=$c,He.$createParagraphNode=qi,He.$createPoint=Rr,He.$createRangeSelection=E_,He.$createTabNode=Lo,He.$createTextNode=Dn,He.$getAdjacentNode=wl,He.$getNearestNodeFromDOMNode=ii,He.$getNearestRootOrShadowRoot=Co,He.$getNodeByKey=Cn,He.$getPreviousSelection=$o,He.$getRoot=tr,He.$getSelection=_n,He.$getTextContent=w_,He.$hasAncestor=Bi,He.$hasUpdateTag=Un,He.$insertNodes=S_,He.$isBlockElementNode=C_,He.$isDecoratorNode=An,He.$isElementNode=et,He.$isInlineElementOrDecoratorNode=Fr,He.$isLeafNode=As,He.$isLineBreakNode=ai,He.$isNodeSelection=Kr,He.$isParagraphNode=z_,He.$isRangeSelection=Tt,He.$isRootNode=Ur,He.$isRootOrShadowRoot=si,He.$isTabNode=Io,He.$isTextNode=_t,He.$nodesOfType=Fi,He.$normalizeSelection__EXPERIMENTAL=Os,He.$parseSerializedNode=L_,He.$selectAll=Sl,He.$setCompositionKey=vn,He.$setSelection=Cr,He.$splitNode=Ra,He.BLUR_COMMAND=B,He.CAN_REDO_COMMAND=X,He.CAN_UNDO_COMMAND=fe,He.CLEAR_EDITOR_COMMAND=R,He.CLEAR_HISTORY_COMMAND=U,He.CLICK_COMMAND=r,He.COMMAND_PRIORITY_CRITICAL=V_,He.COMMAND_PRIORITY_EDITOR=U_,He.COMMAND_PRIORITY_HIGH=j_,He.COMMAND_PRIORITY_LOW=G_,He.COMMAND_PRIORITY_NORMAL=Y_,He.CONTROLLED_TEXT_INSERTION_COMMAND=p,He.COPY_COMMAND=Y,He.CUT_COMMAND=W,He.DELETE_CHARACTER_COMMAND=l,He.DELETE_LINE_COMMAND=S,He.DELETE_WORD_COMMAND=E,He.DEPRECATED_$computeGridMap=O_,He.DEPRECATED_$getGridCellNodeRect=Lr,He.DEPRECATED_$getNodeTriplet=qd,He.DEPRECATED_$isGridCellNode=Wo,He.DEPRECATED_$isGridNode=uf,He.DEPRECATED_$isGridRowNode=Gc,He.DEPRECATED_GridCellNode=Uc,He.DEPRECATED_GridNode=cf,He.DEPRECATED_GridRowNode=df,He.DRAGEND_COMMAND=oe,He.DRAGOVER_COMMAND=Z,He.DRAGSTART_COMMAND=O,He.DROP_COMMAND=de,He.DecoratorNode=Kc,He.ElementNode=Xs,He.FOCUS_COMMAND=_e,He.FORMAT_ELEMENT_COMMAND=K,He.FORMAT_TEXT_COMMAND=w,He.INDENT_CONTENT_COMMAND=Se,He.INSERT_LINE_BREAK_COMMAND=d,He.INSERT_PARAGRAPH_COMMAND=f,He.INSERT_TAB_COMMAND=Te,He.INTERNAL_PointSelection=br,He.KEY_ARROW_DOWN_COMMAND=j,He.KEY_ARROW_LEFT_COMMAND=I,He.KEY_ARROW_RIGHT_COMMAND=k,He.KEY_ARROW_UP_COMMAND=H,He.KEY_BACKSPACE_COMMAND=ce,He.KEY_DELETE_COMMAND=z,He.KEY_DOWN_COMMAND=v,He.KEY_ENTER_COMMAND=re,He.KEY_ESCAPE_COMMAND=V,He.KEY_MODIFIER_COMMAND=A,He.KEY_SPACE_COMMAND=te,He.KEY_TAB_COMMAND=q,He.LineBreakNode=ji,He.MOVE_TO_END=G,He.MOVE_TO_START=P,He.OUTDENT_CONTENT_COMMAND=Ee,He.PASTE_COMMAND=_,He.ParagraphNode=Ho,He.REDO_COMMAND=m,He.REMOVE_TEXT_COMMAND=T,He.RootNode=Bo,He.SELECTION_CHANGE_COMMAND=t,He.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND=n,He.SELECT_ALL_COMMAND=J,He.TabNode=xr,He.TextNode=Jr,He.UNDO_COMMAND=M,He.createCommand=e,He.createEditor=Z_,He.getNearestEditorFromDOMNode=fl,He.isCurrentlyReadOnlyMode=Fo,He.isHTMLAnchorElement=ba,He.isHTMLElement=Ws,He.isSelectionCapturedInDecoratorInput=Ds,He.isSelectionWithinEditor=ss,He}var We={},bf;function HN(){if(bf)return We;bf=1;let e={},t={},n={},r={},l={},d={},f={},p={},_={},T={},E={},S={},w={},M={},m={},v={},k={},G={},I={},P={},H={},j={},re={},te={},ce={},V={},z={},q={},Te={},Se={},Ee={},de={},K={},O={},Z={},oe={};function Y(o){let i=new URLSearchParams;i.append("code",o);for(let a=1;a<arguments.length;a++)i.append("v",arguments[a]);throw Error(`Minified Lexical error #${o}; visit https://lexical.dev/docs/error?${i} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let W=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",J=W&&"documentMode"in document?document.documentMode:null,R=W&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),U=W&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),X=W&&"InputEvent"in window&&!J?"getTargetRanges"in new window.InputEvent("input"):!1,fe=W&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),_e=W&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,B=W&&/Android/.test(navigator.userAgent),A=W&&/^(?=.*Chrome).*/i.test(navigator.userAgent),F=W&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!A,se=fe||_e||F?" ":"",ye=U?" ":se,De=/^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]/,ee=/^[^\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]*[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]/,ne={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},ue={directionless:1,unmergeable:2},be={center:2,end:6,justify:4,left:1,right:3,start:5},Ne={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},Re={normal:0,segmented:2,token:1},ke={0:"normal",2:"segmented",1:"token"},Fe=!1,qe=0;function Be(o){qe=o.timeStamp}function ut(o,i,a){return i.__lexicalLineBreak===o||o[`__lexicalKey_${a._key}`]!==void 0}function At(o){return o.getEditorState().read(()=>{let i=Vt();return i!==null?i.clone():null})}function Ut(o,i,a){Fe=!0;let g=100<performance.now()-qe;try{Tr(o,()=>{let C=Vt()||At(o);var x=new Map,D=o.getRootElement(),Q=o._editorState,ge=o._blockCursorElement;let Ae=!1,Ye="";for(var Xe=0;Xe<i.length;Xe++){var Ke=i[Xe],Pe=Ke.type,pt=Ke.target,wt=Kt(pt,Q);if(!(wt===null&&pt!==D||En(wt))){if(Pe==="characterData"){if(Ke=g&&Ct(wt))e:{Ke=C,Pe=pt;var Ft=wt;if(Mt(Ke)){var zt=Ke.anchor.getNode();if(zt.is(Ft)&&Ke.format!==zt.getFormat()){Ke=!1;break e}}Ke=Pe.nodeType===3&&Ft.isAttached()}Ke&&(Ft=jr(o._window),Pe=Ke=null,Ft!==null&&Ft.anchorNode===pt&&(Ke=Ft.anchorOffset,Pe=Ft.focusOffset),pt=pt.nodeValue,pt!==null&&St(wt,pt,Ke,Pe,!1))}else if(Pe==="childList"){for(Ae=!0,Pe=Ke.addedNodes,Ft=0;Ft<Pe.length;Ft++){zt=Pe[Ft];var Yn=$t(zt),Ar=zt.parentNode;Ar==null||zt===ge||Yn!==null||zt.nodeName==="BR"&&ut(zt,Ar,o)||(U&&(Yn=zt.innerText||zt.nodeValue)&&(Ye+=Yn),Ar.removeChild(zt))}if(Ke=Ke.removedNodes,Pe=Ke.length,0<Pe){for(Ft=0,zt=0;zt<Pe;zt++)Ar=Ke[zt],(Ar.nodeName==="BR"&&ut(Ar,pt,o)||ge===Ar)&&(pt.appendChild(Ar),Ft++);Pe!==Ft&&(pt===D&&(wt=Q._nodeMap.get("root")),x.set(pt,wt))}}}}if(0<x.size)for(let[oi,li]of x)if(Je(li))for(x=li.getChildrenKeys(),D=oi.firstChild,Q=0;Q<x.length;Q++)ge=o.getElementByKey(x[Q]),ge!==null&&(D==null?(oi.appendChild(ge),D=ge):D!==ge&&oi.replaceChild(ge,D),D=D.nextSibling);else Ct(li)&&li.markDirty();if(x=a.takeRecords(),0<x.length){for(D=0;D<x.length;D++)for(ge=x[D],Q=ge.addedNodes,ge=ge.target,Xe=0;Xe<Q.length;Xe++)wt=Q[Xe],pt=wt.parentNode,pt==null||wt.nodeName!=="BR"||ut(wt,ge,o)||pt.removeChild(wt);a.takeRecords()}C!==null&&(Ae&&(C.dirty=!0,nn(C)),U&&sn(o)&&C.insertRawText(Ye))})}finally{Fe=!1}}function en(o){let i=o._observer;if(i!==null){let a=i.takeRecords();Ut(o,a,i)}}function Oe(o){qe===0&&fn(o).addEventListener("textInput",Be,!0),o._observer=new MutationObserver((i,a)=>{Ut(o,i,a)})}function ie(o,i){let a=o.__mode,g=o.__format;o=o.__style;let C=i.__mode,x=i.__format;return i=i.__style,(a===null||a===C)&&(g===null||g===x)&&(o===null||o===i)}function le(o,i){let a=o.mergeWithSibling(i),g=hn()._normalizedNodes;return g.add(o.__key),g.add(i.__key),a}function ve(o){if(o.__text===""&&o.isSimpleText()&&!o.isUnmergeable())o.remove();else{for(var i;(i=o.getPreviousSibling())!==null&&Ct(i)&&i.isSimpleText()&&!i.isUnmergeable();)if(i.__text==="")i.remove();else{ie(i,o)&&(o=le(i,o));break}for(var a;(a=o.getNextSibling())!==null&&Ct(a)&&a.isSimpleText()&&!a.isUnmergeable();)if(a.__text==="")a.remove();else{ie(o,a)&&le(o,a);break}}}function Le(o){return Me(o.anchor),Me(o.focus),o}function Me(o){for(;o.type==="element";){var i=o.getNode(),a=o.offset;if(a===i.getChildrenSize()?(i=i.getChildAtIndex(a-1),a=!0):(i=i.getChildAtIndex(a),a=!1),Ct(i)){o.set(i.__key,a?i.getTextContentSize():0,"text");break}else if(!Je(i))break;o.set(i.__key,a?i.getChildrenSize():0,"element")}}let je=1,rt=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)};function it(o){let i=document.activeElement;if(i===null)return!1;let a=i.nodeName;return En(Kt(o))&&(a==="INPUT"||a==="TEXTAREA"||i.contentEditable==="true"&&i.__lexicalEditor==null)}function st(o,i,a){let g=o.getRootElement();try{return g!==null&&g.contains(i)&&g.contains(a)&&i!==null&&!it(i)&&vt(i)===o}catch{return!1}}function vt(o){for(;o!=null;){let i=o.__lexicalEditor;if(i!=null)return i;o=yr(o)}return null}function Ge(o){return o.isToken()||o.isSegmented()}function ze(o){for(;o!=null;){if(o.nodeType===3)return o;o=o.firstChild}return null}function tt(o,i,a){let g=ne[i];return a!==null&&(o&g)===(a&g)||(o^=g,i==="subscript"?o&=-65:i==="superscript"&&(o&=-33)),o}function yt(o,i){if(i!=null)o.__key=i;else{Jn(),99<Ki&&Y(14),i=hn();var a=Br(),g=""+je++;a._nodeMap.set(g,o),Je(o)?i._dirtyElements.set(g,!0):i._dirtyLeaves.add(g),i._cloneNotNeeded.add(g),i._dirtyType=1,o.__key=g}}function Nt(o){var i=o.getParent();if(i!==null){let C=o.getWritable();i=i.getWritable();var a=o.getPreviousSibling();if(o=o.getNextSibling(),a===null)if(o!==null){var g=o.getWritable();i.__first=o.__key,g.__prev=null}else i.__first=null;else{if(g=a.getWritable(),o!==null){let x=o.getWritable();x.__prev=g.__key,g.__next=x.__key}else g.__next=null;C.__prev=null}o===null?a!==null?(o=a.getWritable(),i.__last=a.__key,o.__next=null):i.__last=null:(o=o.getWritable(),a!==null?(a=a.getWritable(),a.__next=o.__key,o.__prev=a.__key):o.__prev=null,C.__next=null),i.__size--,C.__parent=null}}function Et(o){99<Ki&&Y(14);var i=o.getLatest(),a=i.__parent,g=Br();let C=hn(),x=g._nodeMap;if(g=C._dirtyElements,a!==null)e:for(;a!==null;){if(g.has(a))break e;let D=x.get(a);if(D===void 0)break;g.set(a,!1),a=D.__parent}i=i.__key,C._dirtyType=1,Je(o)?g.set(i,!0):C._dirtyLeaves.add(i)}function gt(o){Jn();var i=hn();let a=i._compositionKey;o!==a&&(i._compositionKey=o,a!==null&&(i=mt(a),i!==null&&i.getWritable()),o!==null&&(o=mt(o),o!==null&&o.getWritable()))}function xt(){return hs()?null:hn()._compositionKey}function mt(o,i){return o=(i||Br())._nodeMap.get(o),o===void 0?null:o}function $t(o,i){let a=hn();return o=o[`__lexicalKey_${a._key}`],o!==void 0?mt(o,i):null}function Kt(o,i){for(;o!=null;){let a=$t(o,i);if(a!==null)return a;o=yr(o)}return null}function tn(o){let i=Object.assign({},o._decorators);return o._pendingDecorators=i}function It(o){return o.read(()=>bt().getTextContent())}function jt(o,i){Tr(o,()=>{var a=Br();if(!a.isEmpty())if(i==="root")bt().markDirty();else{a=a._nodeMap;for(let[,g]of a)g.markDirty()}},o._pendingEditorState===null?{tag:"history-merge"}:void 0)}function bt(){return Br()._nodeMap.get("root")}function nn(o){Jn();let i=Br();o!==null&&(o.dirty=!0,o.setCachedNodes(null)),i._selection=o}function Or(o){var i=hn(),a;e:{for(a=o;a!=null;){let g=a[`__lexicalKey_${i._key}`];if(g!==void 0){a=g;break e}a=yr(a)}a=null}return a===null?(i=i.getRootElement(),o===i?mt("root"):null):mt(a)}function _i(o){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(o)}function pe(o){let i=[];for(;o!==null;)i.push(o),o=o._parentEditor;return i}function Ze(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function ot(o,i,a){if(i=jr(i._window),i!==null){var g=i.anchorNode,{anchorOffset:C,focusOffset:x}=i;if(g!==null&&(i=g.nodeType===3?g.nodeValue:null,g=Kt(g),i!==null&&Ct(g))){if(i===se&&a){let D=a.length;i=a,x=C=D}i!==null&&St(g,i,C,x,o)}}}function St(o,i,a,g,C){let x=o;if(x.isAttached()&&(C||!x.isDirty())){let Ae=x.isComposing(),Ye=i;if((Ae||C)&&i[i.length-1]===se&&(Ye=i.slice(0,-1)),i=x.getTextContent(),C||Ye!==i)if(Ye==="")if(gt(null),fe||_e||F)x.remove();else{let Xe=hn();setTimeout(()=>{Xe.update(()=>{x.isAttached()&&x.remove()})},20)}else{C=x.getParent(),i=Er();var D=x.getTextContentSize(),Q=xt(),ge=x.getKey();x.isToken()||Q!==null&&ge===Q&&!Ae||Mt(i)&&(C!==null&&!C.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===o.__key&&i.anchor.offset===0&&!x.canInsertTextBefore()&&!Ae||i.focus.key===o.__key&&i.focus.offset===D&&!x.canInsertTextAfter()&&!Ae)?x.markDirty():(o=Vt(),Mt(o)&&a!==null&&g!==null&&(o.setTextNodeRange(x,a,x,g),x.isSegmented()&&(a=x.getTextContent(),a=Un(a),x.replace(a),x=a)),x.setTextContent(Ye))}}}function Gt(o,i){if(i.isSegmented())return!0;if(!o.isCollapsed())return!1;o=o.anchor.offset;let a=i.getParentOrThrow(),g=i.isToken();return o===0?((o=!i.canInsertTextBefore()||!a.canInsertTextBefore()||g)||(i=i.getPreviousSibling(),o=(Ct(i)||Je(i)&&i.isInline())&&!i.canInsertTextAfter()),o):o===i.getTextContentSize()?!i.canInsertTextAfter()||!a.canInsertTextAfter()||g:!1}function Bt(o,i){o.__lexicalClassNameCache===void 0&&(o.__lexicalClassNameCache={});let a=o.__lexicalClassNameCache,g=a[i];return g!==void 0?g:(o=o[i],typeof o=="string"?(o=o.split(" "),a[i]=o):o)}function Pt(o,i,a,g,C){a.size!==0&&(a=g.__type,g=g.__key,i=i.get(a),i===void 0&&Y(33,a),a=i.klass,i=o.get(a),i===void 0&&(i=new Map,o.set(a,i)),o=i.get(g),a=o==="destroyed"&&C==="created",(o===void 0||a)&&i.set(g,a?"updated":C))}function kt(o,i,a){let g=o.getParent(),C=a;return g!==null&&(i&&a===0?(C=o.getIndexWithinParent(),o=g):i||a!==o.getChildrenSize()||(C=o.getIndexWithinParent()+1,o=g)),o.getChildAtIndex(i?C-1:C)}function Ht(o,i){var a=o.offset;return o.type==="element"?(o=o.getNode(),kt(o,i,a)):(o=o.getNode(),i&&a===0||!i&&a===o.getTextContentSize()?(a=i?o.getPreviousSibling():o.getNextSibling(),a===null?kt(o.getParentOrThrow(),i,o.getIndexWithinParent()+(i?0:1)):a):null)}function sn(o){return o=(o=fn(o).event)&&o.inputType,o==="insertFromPaste"||o==="insertFromPasteAsQuotation"}function an(o){return!nr(o)&&!o.isLastChild()&&!o.isInline()}function bn(o,i){return o=o._keyToDOMMap.get(i),o===void 0&&Y(75,i),o}function yr(o){return o=o.assignedSlot||o.parentElement,o!==null&&o.nodeType===11?o.host:o}function Zn(o,i){for(o=o.getParent();o!==null;){if(o.is(i))return!0;o=o.getParent()}return!1}function fn(o){return o=o._window,o===null&&Y(78),o}function sr(o){for(o=o.getParentOrThrow();o!==null&&!or(o);)o=o.getParentOrThrow();return o}function or(o){return nr(o)||Je(o)&&o.isShadowRoot()}function Mi(o){return o=o.constructor.clone(o),yt(o,null),o}function Nr(o){var i=hn();let a=o.constructor.getType();return i=i._nodes.get(a),i===void 0&&Y(97),i=i.replace,i!==null?(i=i(o),i instanceof o.constructor||Y(98),i):o}function Os(o,i){o=o.getParent(),!nr(o)||Je(i)||En(i)||Y(99)}function uo(o){return(En(o)||Je(o)&&!o.canBeEmpty())&&!o.isInline()}function dl(o,i,a){a.style.removeProperty("caret-color"),i._blockCursorElement=null,i=o.parentElement,i!==null&&i.removeChild(o)}function jr(o){return W?(o||window).getSelection():null}function pa(o,i){for(;o!==bt()&&o!=null;){if(i(o))return o;o=o.getParent()}return null}function fo(o){return o.nodeType===1}function is(o){if(En(o)&&!o.isInline())return!0;if(!Je(o)||or(o))return!1;var i=o.getFirstChild();return i=i===null||ki(i)||Ct(i)||i.isInline(),!o.isInline()&&o.canBeEmpty()!==!1&&i}function Ds(o,i){for(;o!==null&&o.getParent()!==null&&!i(o);)o=o.getParentOrThrow();return i(o)?o:null}function ss(o,i,a,g,C,x){for(o=o.getFirstChild();o!==null;){let D=o.__key;o.__parent===i&&(Je(o)&&ss(o,D,a,g,C,x),a.has(D)||x.delete(D),C.push(D)),o=o.getNextSibling()}}function fl(o,i,a,g){o=o._nodeMap,i=i._nodeMap;let C=[];for(let[x]of g){let D=i.get(x);D===void 0||D.isAttached()||(Je(D)&&ss(D,x,o,i,C,g),o.has(x)||g.delete(x),C.push(x))}for(let x of C)i.delete(x);for(let x of a)g=i.get(x),g===void 0||g.isAttached()||(o.has(x)||a.delete(x),i.delete(x))}let Ln="",zn="",ri="",Pr,Bn,As,hl=!1,gl=!1,Vr,Ri=null,pl,vn,lr,Cn,ho,ii;function Ms(o,i){let a=lr.get(o);if(i!==null){let g=bs(o);g.parentNode===i&&i.removeChild(g)}Cn.has(o)||Bn._keyToDOMMap.delete(o),Je(a)&&(o=Rs(a,lr),go(o,0,o.length-1,null)),a!==void 0&&Pt(ii,As,Vr,a,"destroyed")}function go(o,i,a,g){for(;i<=a;++i){let C=o[i];C!==void 0&&Ms(C,g)}}function bi(o,i){o.setProperty("text-align",i)}function tr(o,i){var a=Pr.theme.indent;if(typeof a=="string"){let g=o.classList.contains(a);0<i&&!g?o.classList.add(a):1>i&&g&&o.classList.remove(a)}a=getComputedStyle(o).getPropertyValue("--lexical-indent-base-value")||"40px",o.style.setProperty("padding-inline-start",i===0?"":`calc(${i} * ${a})`)}function ml(o,i){o=o.style,i===0?bi(o,""):i===1?bi(o,"left"):i===2?bi(o,"center"):i===3?bi(o,"right"):i===4?bi(o,"justify"):i===5?bi(o,"start"):i===6&&bi(o,"end")}function Cr(o,i,a){let g=Cn.get(o);g===void 0&&Y(60);let C=g.createDOM(Pr,Bn);var x=Bn._keyToDOMMap;if(C["__lexicalKey_"+Bn._key]=o,x.set(o,C),Ct(g)?C.setAttribute("data-lexical-text","true"):En(g)&&C.setAttribute("data-lexical-decorator","true"),Je(g)){if(o=g.__indent,x=g.__size,o!==0&&tr(C,o),x!==0){--x,o=Rs(g,Cn);var D=zn;zn="",_l(o,g,0,x,C,null),ma(g,C),zn=D}o=g.__format,o!==0&&ml(C,o),g.isInline()||yl(null,g,C),an(g)&&(Ln+=`
|
|
46
|
+
`?h.push(gs()):b===" "?h.push(Io()):h.push(Dn(b))}this.insertNodes(h)}insertText(s){const c=this.anchor,h=this.focus,y=this.isCollapsed()||c.isBefore(h),N=this.format,b=this.style;y&&c.type==="element"?Xn(c,h,N,b):!y&&h.type==="element"&&Xn(h,c,N,b);const $=this.getNodes(),ae=$.length,he=y?c:h,me=y?h:c,xe=he.offset,we=me.offset;let Ce=$[0];if(!_t(Ce))throw Error("insertText: first node is not a text node");const Ue=Ce.getTextContent().length,$e=Ce.getParentOrThrow(),Rt=ae-1;let Qe=$[Rt];if(this.isCollapsed()&&xe===Ue&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextAfter()||!$e.canInsertTextAfter()&&Ce.getNextSibling()===null)){let ht=Ce.getNextSibling();if((!_t(ht)||!ht.canInsertTextBefore()||zn(ht))&&(ht=Dn(),ht.setFormat(N),$e.canInsertTextAfter()?Ce.insertAfter(ht):$e.insertAfter(ht)),ht.select(0,0),Ce=ht,s!==""){this.insertText(s);return}}else if(this.isCollapsed()&&xe===0&&(Ce.isSegmented()||Ce.isToken()||!Ce.canInsertTextBefore()||!$e.canInsertTextBefore()&&Ce.getPreviousSibling()===null)){let ht=Ce.getPreviousSibling();if((!_t(ht)||zn(ht))&&(ht=Dn(),ht.setFormat(N),$e.canInsertTextBefore()?Ce.insertBefore(ht):$e.insertBefore(ht)),ht.select(),Ce=ht,s!==""){this.insertText(s);return}}else if(Ce.isSegmented()&&xe!==Ue){const ht=Dn(Ce.getTextContent());ht.setFormat(N),Ce.replace(ht),Ce=ht}else if(!this.isCollapsed()&&s!==""){const ht=Qe.getParent();if(!$e.canInsertTextBefore()||!$e.canInsertTextAfter()||et(ht)&&(!ht.canInsertTextBefore()||!ht.canInsertTextAfter())){this.insertText(""),Vd(this.anchor,this.focus,null),this.insertText(s);return}}if(ae===1){if(Ce.isToken()){const Dt=Dn(s);Dt.select(),Ce.replace(Dt);return}const ht=Ce.getFormat(),Zt=Ce.getStyle();if(xe===we&&(ht!==N||Zt!==b))if(Ce.getTextContent()==="")Ce.setFormat(N),Ce.setStyle(b);else{const Dt=Dn(s);if(Dt.setFormat(N),Dt.setStyle(b),Dt.select(),xe===0)Ce.insertBefore(Dt,!1);else{const[cn]=Ce.splitText(xe);cn.insertAfter(Dt,!1)}Dt.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);return}else if(ko(Ce)){const Dt=Dn(s);Dt.setFormat(N),Dt.setStyle(b),Dt.select(),Ce.replace(Dt);return}const Wt=we-xe;Ce=Ce.spliceText(xe,Wt,s,!0),Ce.getTextContent()===""?Ce.remove():this.anchor.type==="text"&&(Ce.isComposing()?this.anchor.offset-=s.length:(this.format=ht,this.style=Zt))}else{const ht=new Set([...Ce.getParentKeys(),...Qe.getParentKeys()]),Zt=et(Ce)?Ce:Ce.getParentOrThrow();let Wt=et(Qe)?Qe:Qe.getParentOrThrow(),Dt=Qe;if(!Zt.is(Wt)&&Wt.isInline())do Dt=Wt,Wt=Wt.getParentOrThrow();while(Wt.isInline());if(me.type==="text"&&(we!==0||Qe.getTextContent()==="")||me.type==="element"&&Qe.getIndexWithinParent()<we)if(_t(Qe)&&!Qe.isToken()&&we!==Qe.getTextContentSize()){if(Qe.isSegmented()){const sn=Dn(Qe.getTextContent());Qe.replace(sn),Qe=sn}!Ur(me.getNode())&&me.type==="text"&&(Qe=Qe.spliceText(0,we,"")),ht.add(Qe.__key)}else{const sn=Qe.getParentOrThrow();!sn.canBeEmpty()&&sn.getChildrenSize()===1?sn.remove():Qe.remove()}else ht.add(Qe.__key);const cn=Wt.getChildren(),ir=new Set($),ps=Zt.is(Wt),hr=Zt.isInline()&&Ce.getNextSibling()===null?Zt:Ce;for(let sn=cn.length-1;sn>=0;sn--){const kn=cn[sn];if(kn.is(Ce)||et(kn)&&kn.isParentOf(Ce))break;kn.isAttached()&&(!ir.has(kn)||kn.is(Dt)?ps||hr.insertAfter(kn,!1):kn.remove())}if(!ps){let sn=Wt,kn=null;for(;sn!==null;){const ui=sn.getChildren(),qi=ui.length;(qi===0||ui[qi-1].is(kn))&&(ht.delete(sn.__key),kn=sn),sn=sn.getParent()}}if(!Ce.isToken())Ce=Ce.spliceText(xe,Ue-xe,s,!0),Ce.getTextContent()===""?Ce.remove():Ce.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=s.length);else if(xe===Ue)Ce.select();else{const sn=Dn(s);sn.select(),Ce.replace(sn)}for(let sn=1;sn<ae;sn++){const kn=$[sn],ui=kn.__key;ht.has(ui)||kn.remove()}}}removeText(){this.insertText("")}formatText(s){if(this.isCollapsed()){this.toggleFormat(s),vn(null);return}const c=this.getNodes(),h=[];for(const Qe of c)_t(Qe)&&h.push(Qe);const y=h.length;if(y===0){this.toggleFormat(s),vn(null);return}const N=this.anchor,b=this.focus,$=this.isBackward(),ae=$?b:N,he=$?N:b;let me=0,xe=h[0],we=ae.type==="element"?0:ae.offset;if(ae.type==="text"&&we===xe.getTextContentSize()&&(me=1,xe=h[1],we=0),xe==null)return;const Ce=xe.getFormatFlags(s,null),Ve=y-1;let Ue=h[Ve];const $e=he.type==="text"?he.offset:Ue.getTextContentSize();if(xe.is(Ue)){if(we===$e)return;if(we===0&&$e===xe.getTextContentSize())xe.setFormat(Ce);else{const Qe=xe.splitText(we,$e),ht=we===0?Qe[0]:Qe[1];ht.setFormat(Ce),ae.type==="text"&&ae.set(ht.__key,0,"text"),he.type==="text"&&he.set(ht.__key,$e-we,"text")}this.format=Ce;return}we!==0&&([,xe]=xe.splitText(we),we=0),xe.setFormat(Ce);const Rt=Ue.getFormatFlags(s,Ce);$e>0&&($e!==Ue.getTextContentSize()&&([Ue]=Ue.splitText($e)),Ue.setFormat(Rt));for(let Qe=me+1;Qe<Ve;Qe++){const ht=h[Qe];if(!ht.isToken()){const Zt=ht.getFormatFlags(s,Rt);ht.setFormat(Zt)}}ae.type==="text"&&ae.set(xe.__key,we,"text"),he.type==="text"&&he.set(Ue.__key,$e,"text"),this.format=Ce|Rt}insertNodes(s){if(s.length===0)return;if(this.anchor.key==="root"){this.insertParagraph();const $e=_n();if(!Tt($e))throw Error("Expected RangeSelection after insertParagraph");return $e.insertNodes(s)}const c=vo(this.anchor.getNode(),Bi),h=s[s.length-1];if("__language"in c&&et(c)){if("__language"in s[0])this.insertText(s[0].getTextContent());else{const $e=Kc(this);c.splice($e,0,s),h.selectEnd()}return}const y=$e=>(et($e)||An($e))&&!$e.isInline();if(!s.some(y)){if(!et(c))throw Error("Expected 'firstBlock' to be an ElementNode");const $e=Kc(this);c.splice($e,0,s),h.selectEnd();return}const N=L_(s),b=N.getLastDescendant(),$=N.getChildren(),ae=$e=>"__value"in $e&&"__checked"in $e,he=$e=>et($e)&&Bi($e)&&!$e.isEmpty()&&et(c)&&(!c.isEmpty()||ae(c)),xe=!et(c)||!c.isEmpty()?this.insertParagraph():null,we=$[$.length-1];let Ce=$[0];if(he(Ce)){if(!et(c))throw Error("Expected 'firstBlock' to be an ElementNode");c.append(...Ce.getChildren()),Ce=$[1]}Ce&&Hl(c,Ce);const Ve=vo(b,Bi);xe&&et(Ve)&&(ae(xe)||Bi(we))&&(Ve.append(...xe.getChildren()),xe.remove()),et(c)&&c.isEmpty()&&c.remove(),b.selectEnd();const Ue=et(c)?c.getLastChild():null;ai(Ue)&&Ve!==c&&Ue.remove()}insertParagraph(){if(this.anchor.key==="root"){const b=Vi();return tr().splice(this.anchor.offset,0,[b]),b.select(),b}const s=Kc(this),c=vo(this.anchor.getNode(),Bi);if(!et(c))throw Error("Expected ancestor to be an ElementNode");const h=c.getChildAtIndex(s),y=h?[h,...h.getNextSiblings()]:[],N=c.insertNewAfter(this,!1);return N?(N.append(...y),N.selectStart(),N):null}insertLineBreak(s){const c=gs();if(this.insertNodes([c]),s){const h=c.getParentOrThrow(),y=c.getIndexWithinParent();h.select(y,y)}}extract(){const s=this.getNodes(),c=s.length,h=c-1,y=this.anchor,N=this.focus;let b=s[0],$=s[h];const[ae,he]=ci(this);if(c===0)return[];if(c===1){if(_t(b)&&!this.isCollapsed()){const xe=ae>he?he:ae,we=ae>he?ae:he,Ce=b.splitText(xe,we),Ve=xe===0?Ce[0]:Ce[1];return Ve!=null?[Ve]:[]}return[b]}const me=y.isBefore(N);if(_t(b)){const xe=me?ae:he;xe===b.getTextContentSize()?s.shift():xe!==0&&([,b]=b.splitText(xe),s[0]=b)}if(_t($)){const we=$.getTextContent().length,Ce=me?he:ae;Ce===0?s.pop():Ce!==we&&([$]=$.splitText(Ce),s[h]=$)}return s}modify(s,c,h){const y=this.focus,N=this.anchor,b=s==="move",$=wl(y,c);if(An($)&&!$.isIsolated()){if(b&&$.isKeyboardSelectable()){const Ce=Hc();Ce.add($.__key),Cr(Ce);return}const we=c?$.getPreviousSibling():$.getNextSibling();if(_t(we)){const Ce=we.__key,Ve=c?we.getTextContent().length:0;y.set(Ce,Ve,"text"),b&&N.set(Ce,Ve,"text");return}else{const Ce=$.getParentOrThrow();let Ve,Ue;et(we)?(Ue=we.__key,Ve=c?we.getChildrenSize():0):(Ve=$.getIndexWithinParent(),Ue=Ce.__key,c||Ve++),y.set(Ue,Ve,"element"),b&&N.set(Ue,Ve,"element");return}}const ae=xn(),he=ar(ae._window);if(!he)return;const me=ae._blockCursorElement,xe=ae._rootElement;if(xe!==null&&me!==null&&et($)&&!$.isInline()&&!$.canBeEmpty()&&Bs(me,ae,xe),Ua(he,s,c?"backward":"forward",h),he.rangeCount>0){const we=he.getRangeAt(0),Ce=this.anchor.getNode(),Ve=Ur(Ce)?Ce:Eo(Ce);if(this.applyDOMRange(we),this.dirty=!0,!b){const Ue=this.getNodes(),$e=[];let Rt=!1;for(let Qe=0;Qe<Ue.length;Qe++){const ht=Ue[Qe];Fi(ht,Ve)?$e.push(ht):Rt=!0}if(Rt&&$e.length>0)if(c){const Qe=$e[0];et(Qe)?Qe.selectStart():Qe.getParentOrThrow().selectStart()}else{const Qe=$e[$e.length-1];et(Qe)?Qe.selectEnd():Qe.getParentOrThrow().selectEnd()}(he.anchorNode!==we.startContainer||he.anchorOffset!==we.startOffset)&&$o(this)}}}deleteCharacter(s){const c=this.isCollapsed();if(this.isCollapsed()){const h=this.anchor,y=this.focus;let N=h.getNode();if(!s&&(h.type==="element"&&et(N)&&h.offset===N.getChildrenSize()||h.type==="text"&&h.offset===N.getTextContentSize())){const $=N.getParent(),ae=N.getNextSibling()||($===null?null:$.getNextSibling());if(et(ae)&&ae.isShadowRoot())return}const b=wl(y,s);if(An(b)&&!b.isIsolated()){if(b.isKeyboardSelectable()&&et(N)&&N.getChildrenSize()===0){N.remove();const $=Hc();$.add(b.__key),Cr($)}else b.remove(),xn().dispatchCommand(t,void 0);return}else if(!s&&et(b)&&et(N)&&N.isEmpty()){N.remove(),b.selectStart();return}if(this.modify("extend",s,"character"),this.isCollapsed()){if(s&&h.offset===0&&(h.type==="element"?h.getNode():h.getNode().getParentOrThrow()).collapseAtStart(this))return}else{const $=y.type==="text"?y.getNode():null;if(N=h.type==="text"?h.getNode():null,$!==null&&$.isSegmented()){const ae=y.offset,he=$.getTextContentSize();if($.is(N)||s&&ae!==he||!s&&ae!==0){Gd($,s,ae);return}}else if(N!==null&&N.isSegmented()){const ae=h.offset,he=N.getTextContentSize();if(N.is($)||s&&ae!==0||!s&&ae!==he){Gd(N,s,ae);return}}T_(this,s)}}if(this.removeText(),s&&!c&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0){const h=this.anchor.getNode();h.isEmpty()&&Ur(h.getParent())&&h.getIndexWithinParent()===0&&h.collapseAtStart(this)}}deleteLine(s){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",s,"lineboundary"),(s?this.focus:this.anchor).offset===0&&this.modify("extend",s,"character")),this.removeText()}deleteWord(s){this.isCollapsed()&&this.modify("extend",s,"word"),this.removeText()}}function Kr(u){return u instanceof Ti}function dr(u){const s=u.offset;if(u.type==="text")return s;const c=u.getNode();return s===c.getChildrenSize()?c.getTextContent().length:0}function ci(u){const s=u.anchor,c=u.focus;return s.type==="element"&&c.type==="element"&&s.key===c.key&&s.offset===c.offset?[0,0]:[dr(s),dr(c)]}function $o(u){const s=u.focus,c=u.anchor,h=c.key,y=c.offset,N=c.type;Tn(c,s.key,s.offset,s.type),Tn(s,h,y,N),u._cachedNodes=null}function Ua(u,s,c,h){u.modify(s,c,h)}function T_(u,s){const c=u.anchor,h=u.focus,y=c.getNode(),N=h.getNode();if(y===N&&c.type==="text"&&h.type==="text"){const b=c.offset,$=h.offset,ae=b<$,he=ae?b:$,me=ae?$:b,xe=me-1;if(he!==xe){const we=y.getTextContent().slice(he,me);Ms(we)||(s?h.offset=xe:c.offset=xe)}}}function Gd(u,s,c){const h=u,N=h.getTextContent().split(/(?=\s)/g),b=N.length;let $=0,ae=0;for(let me=0;me<b;me++){const xe=N[me],we=me===b-1;if(ae=$,$+=xe.length,s&&$===c||$>c||we){N.splice(me,1),we&&(ae=void 0);break}}const he=N.join("").trim();he===""?h.remove():(h.setTextContent(he),h.select(ae,ae))}function x_(u,s,c){const h=u.getParent();return c===null||h===null||!h.canBeEmpty()||h!==c.getNode()}function Yd(u,s,c,h){let y=s,N;if(u.nodeType===ke){let b=!1;const $=u.childNodes,ae=$.length;y===ae&&(b=!0,y=ae-1);let he=$[y],me=!1;if(he===h._blockCursorElement?(he=$[y+1],me=!0):h._blockCursorElement!==null&&y--,N=bi(he),_t(N))y=yl(N,b);else{let xe=bi(u);if(xe===null)return null;if(et(xe)){let we=xe.getChildAtIndex(y);if(et(we)&&x_(we,y,c)){const Ce=b?we.getLastDescendant():we.getFirstDescendant();Ce===null?(xe=we,y=0):(we=Ce,xe=et(we)?we:we.getParentOrThrow())}_t(we)?(N=we,xe=null,y=yl(we,b)):we!==xe&&b&&!me&&y++}else{const we=xe.getIndexWithinParent();s===0&&An(xe)&&bi(u)===xe?y=we:y=we+1,xe=xe.getParentOrThrow()}if(et(xe))return Rr(xe.__key,y,"element")}}else N=bi(u);return _t(N)?Rr(N.__key,y,"text"):null}function jd(u,s,c){const h=u.offset,y=u.getNode();if(h===0){const N=y.getPreviousSibling(),b=y.getParent();if(!s)et(N)&&!c&&N.isInline()?(u.key=N.__key,u.offset=N.getChildrenSize(),u.type="element"):_t(N)&&(u.key=N.__key,u.offset=N.getTextContent().length);else if((c||!s)&&N===null&&et(b)&&b.isInline()){const $=b.getPreviousSibling();_t($)&&(u.key=$.__key,u.offset=$.getTextContent().length)}}else if(h===y.getTextContent().length){const N=y.getNextSibling(),b=y.getParent();if(s&&et(N)&&N.isInline())u.key=N.__key,u.offset=0,u.type="element";else if((c||s)&&N===null&&et(b)&&b.isInline()&&!b.canInsertTextAfter()){const $=b.getNextSibling();_t($)&&(u.key=$.__key,u.offset=0)}}}function Vd(u,s,c){if(u.type==="text"&&s.type==="text"){const h=u.isBefore(s),y=u.is(s);jd(u,h,y),jd(s,!h,y),y&&(s.key=u.key,s.offset=u.offset,s.type=u.type);const N=xn();if(N.isComposing()&&N._compositionKey!==u.key&&Tt(c)){const b=c.anchor,$=c.focus;Tn(u,b.key,b.offset,b.type),Tn(s,$.key,$.offset,$.type)}}}function qd(u,s,c,h,y,N){if(u===null||c===null||!is(y,u,c))return null;const b=Yd(u,s,Tt(N)?N.anchor:null,y);if(b===null)return null;const $=Yd(c,h,Tt(N)?N.focus:null,y);if($===null)return null;if(b.type==="element"&&$.type==="element"){const ae=bi(u),he=bi(c);if(An(ae)&&An(he))return null}return Vd(b,$,N),[b,$]}function v_(u){return et(u)&&!u.isInline()}function Zd(u,s,c,h,y,N){const b=xi(),$=new rr(Rr(u,s,y),Rr(c,h,N),0,"");return $.dirty=!0,b._selection=$,$}function S_(){const u=Rr("root",0,"element"),s=Rr("root",0,"element");return new rr(u,s,0,"")}function Hc(){return new Ti(new Set)}function w_(u){const c=u.getEditorState()._selection,h=ar(u._window);return Tt(c)||c==null?Wc(c,h,u,null):c.clone()}function Wc(u,s,c,h){const y=c._window;if(y===null)return null;const N=h||y.event,b=N?N.type:void 0,$=b==="selectionchange",ae=!Pt()&&($||b==="beforeinput"||b==="compositionstart"||b==="compositionend"||b==="click"&&N&&N.detail===3||b==="drop"||b===void 0);let he,me,xe,we;if(!Tt(u)||ae){if(s===null)return null;if(he=s.anchorNode,me=s.focusNode,xe=s.anchorOffset,we=s.focusOffset,$&&Tt(u)&&!is(c,he,me))return u.clone()}else return u.clone();const Ce=qd(he,xe,me,we,c,u);if(Ce===null)return null;const[Ve,Ue]=Ce;return new rr(Ve,Ue,Tt(u)?u.format:0,Tt(u)?u.style:"")}function _n(){return xi()._selection}function Fo(){return xn()._editorState._selection}function Ga(u,s,c,h=1){const y=u.anchor,N=u.focus,b=y.getNode(),$=N.getNode();if(!s.is(b)&&!s.is($))return;const ae=s.__key;if(u.isCollapsed()){const he=y.offset;if(c<=he&&h>0||c<he&&h<0){const me=Math.max(0,he+h);y.set(ae,me,"element"),N.set(ae,me,"element"),Jd(u)}}else{const he=u.isBackward(),me=he?N:y,xe=me.getNode(),we=he?y:N,Ce=we.getNode();if(s.is(xe)){const Ve=me.offset;(c<=Ve&&h>0||c<Ve&&h<0)&&me.set(ae,Math.max(0,Ve+h),"element")}if(s.is(Ce)){const Ve=we.offset;(c<=Ve&&h>0||c<Ve&&h<0)&&we.set(ae,Math.max(0,Ve+h),"element")}}Jd(u)}function Jd(u){const s=u.anchor,c=s.offset,h=u.focus,y=h.offset,N=s.getNode(),b=h.getNode();if(u.isCollapsed()){if(!et(N))return;const $=N.getChildrenSize(),ae=c>=$,he=ae?N.getChildAtIndex($-1):N.getChildAtIndex(c);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),s.set(he.__key,me,"text"),h.set(he.__key,me,"text")}return}if(et(N)){const $=N.getChildrenSize(),ae=c>=$,he=ae?N.getChildAtIndex($-1):N.getChildAtIndex(c);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),s.set(he.__key,me,"text")}}if(et(b)){const $=b.getChildrenSize(),ae=y>=$,he=ae?b.getChildAtIndex($-1):b.getChildAtIndex(y);if(_t(he)){let me=0;ae&&(me=he.getTextContentSize()),h.set(he.__key,me,"text")}}}function O_(u,s){const h=s.getEditorState()._selection,y=u._selection;if(Tt(y)){const N=y.anchor,b=y.focus;let $;if(N.type==="text"&&($=N.getNode(),$.selectionTransform(h,y)),b.type==="text"){const ae=b.getNode();$!==ae&&ae.selectionTransform(h,y)}}}function Ya(u,s,c,h,y){let N=null,b=0,$=null;h!==null?(N=h.__key,_t(h)?(b=h.getTextContentSize(),$="text"):et(h)&&(b=h.getChildrenSize(),$="element")):y!==null&&(N=y.__key,_t(y)?$="text":et(y)&&($="element")),N!==null&&$!==null?u.set(N,b,$):(b=s.getIndexWithinParent(),b===-1&&(b=c.getChildrenSize()),u.set(c.__key,b,"element"))}function Xd(u,s,c,h,y){u.type==="text"?(u.key=c,s||(u.offset+=y)):u.offset>h.getIndexWithinParent()&&(u.offset-=1)}function D_(u,s,c,h,y,N,b){const $=h.anchorNode,ae=h.focusNode,he=h.anchorOffset,me=h.focusOffset,xe=document.activeElement;if(y.has("collaboration")&&xe!==N||xe!==null&&Os(xe))return;if(!Tt(s)){u!==null&&is(c,$,ae)&&h.removeAllRanges();return}const we=s.anchor,Ce=s.focus,Ve=we.key,Ue=Ce.key,$e=$s(c,Ve),Rt=$s(c,Ue),Qe=we.offset,ht=Ce.offset,Zt=s.format,Wt=s.style,Dt=s.isCollapsed();let cn=$e,ir=Rt,ps=!1;if(we.type==="text"){cn=Pr($e);const hr=we.getNode();ps=hr.getFormat()!==Zt||hr.getStyle()!==Wt}else Tt(u)&&u.anchor.type==="text"&&(ps=!0);if(Ce.type==="text"&&(ir=Pr(Rt)),!(cn===null||ir===null)&&(Dt&&(u===null||ps||Tt(u)&&(u.format!==Zt||u.style!==Wt))&&Yn(Zt,Wt,Qe,Ve,performance.now()),!(he===Qe&&me===ht&&$===cn&&ae===ir&&!(h.type==="Range"&&Dt)&&((xe===null||!N.contains(xe))&&N.focus({preventScroll:!0}),we.type!=="element")))){try{h.setBaseAndExtent(cn,Qe,ir,ht)}catch{}if(!y.has("skip-scroll-into-view")&&s.isCollapsed()&&N!==null&&N===document.activeElement){const hr=s instanceof rr&&s.anchor.type==="element"?cn.childNodes[Qe]||null:h.rangeCount>0?h.getRangeAt(0):null;if(hr!==null){let sn;if(hr instanceof Text){const kn=document.createRange();kn.selectNode(hr),sn=kn.getBoundingClientRect()}else sn=hr.getBoundingClientRect();yi(c,sn,N)}}zt()}}function A_(u){let s=_n()||Fo();s===null&&(s=tr().selectEnd()),s.insertNodes(u)}function M_(){const u=_n();return u===null?"":u.getTextContent()}function R_(u,s,c){const h=[];let y=null,N=null;function b(he,me,xe){const we={cell:xe,startColumn:me,startRow:he},Ce=xe.__rowSpan,Ve=xe.__colSpan;for(let Ue=0;Ue<Ce;Ue++){h[he+Ue]===void 0&&(h[he+Ue]=[]);for(let $e=0;$e<Ve;$e++)h[he+Ue][me+$e]=we}s.is(xe)&&(y=we),c.is(xe)&&(N=we)}function $(he,me){return h[he]===void 0||h[he][me]===void 0}const ae=u.getChildren();for(let he=0;he<ae.length;he++){const me=ae[he];if(!Vc(me))throw Error("Expected GridNode children to be GridRowNode");const xe=me.getChildren();let we=0;for(const Ce of xe){if(!Ko(Ce))throw Error("Expected GridRowNode children to be GridCellNode");for(;!$(he,we);)we++;b(he,we,Ce),we+=Ce.__colSpan}}if(y===null)throw Error("Anchor not found in Grid");if(N===null)throw Error("Focus not found in Grid");return[h,y,N]}function Qd(u){let s;if(u instanceof jc)s=u;else if(u instanceof oi){const y=xo(u,Ko);if(!Ko(y))throw Error("Expected to find a parent GridCellNode");s=y}else{const y=xo(u.getNode(),Ko);if(!Ko(y))throw Error("Expected to find a parent GridCellNode");s=y}const c=s.getParent();if(!Vc(c))throw Error("Expected GridCellNode to have a parent GridRowNode");const h=c.getParent();if(!gf(h))throw Error("Expected GridRowNode to have a parent GridNode");return[s,c,h]}function Kc(u){u.isCollapsed()||u.removeText();const s=u.anchor;let c=s.getNode(),h=s.offset;for(;!Bi(c);)[c,h]=b_(c,h);return h}function b_(u,s){const c=u.getParent();if(!c){const y=Vi();return tr().append(y),y.select(),[tr(),0]}if(_t(u)){const y=u.splitText(s);if(y.length===0)return[c,u.getIndexWithinParent()];const N=s===0?0:1,b=y[0].getIndexWithinParent()+N;return[c,b]}if(!et(u)||s===0)return[c,u.getIndexWithinParent()];const h=u.getChildAtIndex(s);if(h){const y=new rr(Rr(u.__key,s,"element"),Rr(u.__key,s,"element"),0,""),N=u.insertNewAfter(y);N&&N.append(h,...h.getNextSiblings())}return[c,u.getIndexWithinParent()+1]}function L_(u){const s=Vi();let c=null;for(let h=0;h<u.length;h++){const y=u[h],N=ai(y);if(N||An(y)&&y.isInline()||et(y)&&y.isInline()||_t(y)||y.isParentRequired()){if(c===null&&(c=y.createParentElementNode(),s.append(c),N))continue;c!==null&&c.append(y)}else s.append(y),c=null}return s}let Qn=null,er=null,Ir=!1,zc=!1,ja=0;const ef={characterData:!0,childList:!0,subtree:!0};function Bo(){return Ir||Qn!==null&&Qn._readOnly}function fr(){if(Ir)throw Error("Cannot use method in read-only mode.")}function tf(){if(ja>99)throw Error("One or more transforms are endlessly triggering additional transforms. May have encountered infinite recursion caused by transforms that have their preconditions too lose and/or conflict with each other.")}function xi(){if(Qn===null)throw Error("Unable to find an active editor state. State helpers or node methods can only be used synchronously during the callback of editor.update() or editorState.read().");return Qn}function xn(){if(er===null)throw Error("Unable to find an active editor. This method can only be used synchronously during the callback of editor.update().");return er}function I_(){return er}function nf(u,s,c){const h=s.__type,y=ma(u,h);let N=c.get(h);N===void 0&&(N=Array.from(y.transforms),c.set(h,N));const b=N.length;for(let $=0;$<b&&(N[$](s),!!s.isAttached());$++);}function rf(u,s){return u!==void 0&&u.__key!==s&&u.isAttached()}function k_(u,s){const c=s._dirtyLeaves,h=u._nodeMap;for(const y of c){const N=h.get(y);_t(N)&&N.isAttached()&&N.isSimpleText()&&!N.isUnmergeable()&&Nr(N)}}function P_(u,s){const c=s._dirtyLeaves,h=s._dirtyElements,y=u._nodeMap,N=lr(),b=new Map;let $=c,ae=$.size,he=h,me=he.size;for(;ae>0||me>0;){if(ae>0){s._dirtyLeaves=new Set;for(const xe of $){const we=y.get(xe);_t(we)&&we.isAttached()&&we.isSimpleText()&&!we.isUnmergeable()&&Nr(we),we!==void 0&&rf(we,N)&&nf(s,we,b),c.add(xe)}if($=s._dirtyLeaves,ae=$.size,ae>0){ja++;continue}}s._dirtyLeaves=new Set,s._dirtyElements=new Map;for(const xe of he){const we=xe[0],Ce=xe[1];if(we!=="root"&&!Ce)continue;const Ve=y.get(we);Ve!==void 0&&rf(Ve,N)&&nf(s,Ve,b),h.set(we,Ce)}$=s._dirtyLeaves,ae=$.size,he=s._dirtyElements,me=he.size,ja++}s._dirtyLeaves=c,s._dirtyElements=h}function $_(u){return Uc(u,xn()._nodes)}function Uc(u,s){const c=u.type,h=s.get(c);if(h===void 0)throw Error(`parseEditorState: type "${c}" + not found`);const y=h.klass;if(u.type!==y.getType())throw Error(`LexicalNode: Node ${y.name} does not implement .importJSON().`);const N=y.importJSON(u),b=u.children;if(et(N)&&Array.isArray(b))for(let $=0;$<b.length;$++){const ae=b[$],he=Uc(ae,s);N.append(he)}return N}function F_(u,s,c){const h=Yc(),y=Qn,N=Ir,b=er,$=s._dirtyElements,ae=s._dirtyLeaves,he=s._cloneNotNeeded,me=s._dirtyType;s._dirtyElements=new Map,s._dirtyLeaves=new Set,s._cloneNotNeeded=new Set,s._dirtyType=0,Qn=h,Ir=!1,er=s;try{const xe=s._nodes,we=u.root;Uc(we,xe),c&&c(),h._readOnly=!0,of(h)}catch(xe){xe instanceof Error&&s._onError(xe)}finally{s._dirtyElements=$,s._dirtyLeaves=ae,s._cloneNotNeeded=he,s._dirtyType=me,Qn=y,Ir=N,er=b}return h}function sf(u,s){const c=Qn,h=Ir,y=er;Qn=u,Ir=!0,er=null;try{return s()}finally{Qn=c,Ir=h,er=y}}function of(u){const s=u._nodeMap;s.set=()=>{throw new Error("Cannot call set() on a frozen Lexical node map")},s.clear=()=>{throw new Error("Cannot call clear() on a frozen Lexical node map")},s.delete=()=>{throw new Error("Cannot call delete() on a frozen Lexical node map")}}function Zs(u,s){const c=u._pendingEditorState,h=u._rootElement,y=u._headless||h===null;if(c===null)return;const N=u._editorState,b=N._selection,$=c._selection,ae=u._dirtyType!==qe,he=Qn,me=Ir,xe=er,we=u._updating,Ce=u._observer;let Ve=null;if(u._pendingEditorState=null,u._editorState=c,!y&&ae&&Ce!==null){er=u,Qn=c,Ir=!1,u._updating=!0;try{const Dt=u._dirtyType,cn=u._dirtyElements,ir=u._dirtyLeaves;Ce.disconnect(),Ve=zi(N,c,u,Dt,cn,ir)}catch(Dt){if(Dt instanceof Error&&u._onError(Dt),!zc)ff(u,null,h,c),sr(u),u._dirtyType=ut,zc=!0,Zs(u,N),zc=!1;else throw Dt;return}finally{Ce.observe(h,ef),u._updating=we,Qn=he,Ir=me,er=xe}}c._readOnly||(c._readOnly=!0,of(c),Tt($)&&(Object.freeze($.anchor),Object.freeze($.focus)),Object.freeze($));const Ue=u._dirtyLeaves,$e=u._dirtyElements,Rt=u._normalizedNodes,Qe=u._updateTags,ht=u._deferred;ae&&(u._dirtyType=qe,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements=new Map,u._normalizedNodes=new Set,u._updateTags=new Set),Ia(u,c);const Zt=y?null:ar(u._window);if(u._editable&&Zt!==null&&(ae||$===null||$.dirty)){er=u,Qn=c;try{if(Ce!==null&&Ce.disconnect(),ae||$===null||$.dirty){const Dt=u._blockCursorElement;Dt!==null&&Bs(Dt,u,h),D_(b,$,u,Zt,Qe,h)}Ni(u,h,$),Ce!==null&&Ce.observe(h,ef)}finally{er=xe,Qn=he}}Ve!==null&&H_(u,Ve,Qe,Ue,N),!Tt($)&&$!==null&&(b===null||!b.is($))&&u.dispatchCommand(t,void 0);const Wt=u._pendingDecorators;Wt!==null&&(u._decorators=Wt,u._pendingDecorators=null,Gl("decorator",u,!0,Wt)),B_(u,s||N,c),Gl("update",u,!0,{dirtyElements:$e,dirtyLeaves:Ue,editorState:c,normalizedNodes:Rt,prevEditorState:s||N,tags:Qe}),K_(u,ht),W_(u)}function B_(u,s,c){const h=po(s),y=po(c);h!==y&&Gl("textcontent",u,!0,y)}function H_(u,s,c,h,y){const N=Array.from(u._listeners.mutation),b=N.length;for(let $=0;$<b;$++){const[ae,he]=N[$],me=s.get(he);me!==void 0&&ae(me,{dirtyLeaves:h,prevEditorState:y,updateTags:c})}}function Gl(u,s,c,...h){const y=s._updating;s._updating=c;try{const N=Array.from(s._listeners[u]);for(let b=0;b<N.length;b++)N[b].apply(null,h)}finally{s._updating=y}}function lf(u,s,c){if(u._updating===!1||er!==u){let y=!1;return u.update(()=>{y=lf(u,s,c)}),y}const h=Li(u);for(let y=4;y>=0;y--)for(let N=0;N<h.length;N++){const ae=h[N]._commands.get(s);if(ae!==void 0){const he=ae[y];if(he!==void 0){const me=Array.from(he),xe=me.length;for(let we=0;we<xe;we++)if(me[we](c,u)===!0)return!0}}}return!1}function W_(u){const s=u._updates;if(s.length!==0){const c=s.shift();if(c){const[h,y]=c;cf(u,h,y)}}}function K_(u,s){if(u._deferred=[],s.length!==0){const c=u._updating;u._updating=!0;try{for(let h=0;h<s.length;h++)s[h]()}finally{u._updating=c}}}function af(u,s){const c=u._updates;let h=s||!1;for(;c.length!==0;){const y=c.shift();if(y){const[N,b]=y;let $,ae;b!==void 0&&($=b.onUpdate,ae=b.tag,b.skipTransforms&&(h=!0),$&&u._deferred.push($),ae&&u._updateTags.add(ae)),N()}}return h}function cf(u,s,c){const h=u._updateTags;let y,N,b=!1,$=!1;c!==void 0&&(y=c.onUpdate,N=c.tag,N!=null&&h.add(N),b=c.skipTransforms||!1,$=c.discrete||!1),y&&u._deferred.push(y);const ae=u._editorState;let he=u._pendingEditorState,me=!1;(he===null||he._readOnly)&&(he=u._pendingEditorState=G_(he||ae),me=!0),he._flushSync=$;const xe=Qn,we=Ir,Ce=er,Ve=u._updating;Qn=he,Ir=!1,u._updating=!0,er=u;try{me&&(u._headless?ae._selection!=null&&(he._selection=ae._selection.clone()):he._selection=w_(u));const $e=u._compositionKey;s(),b=af(u,b),O_(he,u),u._dirtyType!==qe&&(b?k_(he,u):P_(he,u),af(u),Ml(ae,he,u._dirtyLeaves,u._dirtyElements));const Rt=u._compositionKey;$e!==Rt&&(he._flushSync=!0);const Qe=he._selection;if(Tt(Qe)){const ht=he._nodeMap,Zt=Qe.anchor.key,Wt=Qe.focus.key;if(ht.get(Zt)===void 0||ht.get(Wt)===void 0)throw Error("updateEditor: selection has been lost because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node.")}else Kr(Qe)&&Qe._nodes.size===0&&(he._selection=null)}catch($e){$e instanceof Error&&u._onError($e),u._pendingEditorState=ae,u._dirtyType=ut,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),Zs(u);return}finally{Qn=xe,Ir=we,er=Ce,u._updating=Ve,ja=0}u._dirtyType!==qe||U_(he,u)?he._flushSync?(he._flushSync=!1,Zs(u)):me&&ho(()=>{Zs(u)}):(he._flushSync=!1,me&&(h.clear(),u._deferred=[],u._pendingEditorState=null))}function zr(u,s,c){u._updating?u._updates.push([s,c]):cf(u,s,c)}class Gc extends oi{constructor(s){super(s)}decorate(s,c){throw Error("decorate: base method not extended")}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function An(u){return u instanceof Gc}class Js extends oi{constructor(s){super(s),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 s=this.getFormat();return pe[s]||""}getIndent(){return this.getLatest().__indent}getChildren(){const s=[];let c=this.getFirstChild();for(;c!==null;)s.push(c),c=c.getNextSibling();return s}getChildrenKeys(){const s=[];let c=this.getFirstChild();for(;c!==null;)s.push(c.__key),c=c.getNextSibling();return s}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){const c=xn()._dirtyElements;return c!==null&&c.has(this.__key)}isLastChild(){const s=this.getLatest(),c=this.getParentOrThrow().getLastChild();return c!==null&&c.is(s)}getAllTextNodes(){const s=[];let c=this.getFirstChild();for(;c!==null;){if(_t(c)&&s.push(c),et(c)){const h=c.getAllTextNodes();s.push(...h)}c=c.getNextSibling()}return s}getFirstDescendant(){let s=this.getFirstChild();for(;s!==null;){if(et(s)){const c=s.getFirstChild();if(c!==null){s=c;continue}}break}return s}getLastDescendant(){let s=this.getLastChild();for(;s!==null;){if(et(s)){const c=s.getLastChild();if(c!==null){s=c;continue}}break}return s}getDescendantByIndex(s){const c=this.getChildren(),h=c.length;if(s>=h){const N=c[h-1];return et(N)&&N.getLastDescendant()||N||null}const y=c[s];return et(y)&&y.getFirstDescendant()||y||null}getFirstChild(){const c=this.getLatest().__first;return c===null?null:Cn(c)}getFirstChildOrThrow(){const s=this.getFirstChild();if(s===null)throw Error(`Expected node ${this.__key} to have a first child.`);return s}getLastChild(){const c=this.getLatest().__last;return c===null?null:Cn(c)}getLastChildOrThrow(){const s=this.getLastChild();if(s===null)throw Error(`Expected node ${this.__key} to have a last child.`);return s}getChildAtIndex(s){const c=this.getChildrenSize();let h,y;if(s<c/2){for(h=this.getFirstChild(),y=0;h!==null&&y<=s;){if(y===s)return h;h=h.getNextSibling(),y++}return null}for(h=this.getLastChild(),y=c-1;h!==null&&y>=s;){if(y===s)return h;h=h.getPreviousSibling(),y--}return null}getTextContent(){let s="";const c=this.getChildren(),h=c.length;for(let y=0;y<h;y++){const N=c[y];s+=N.getTextContent(),et(N)&&y!==h-1&&!N.isInline()&&(s+=$t)}return s}getTextContentSize(){let s=0;const c=this.getChildren(),h=c.length;for(let y=0;y<h;y++){const N=c[y];s+=N.getTextContentSize(),et(N)&&y!==h-1&&!N.isInline()&&(s+=$t.length)}return s}getDirection(){return this.getLatest().__dir}hasFormat(s){if(s!==""){const c=_i[s];return(this.getFormat()&c)!==0}return!1}select(s,c){fr();const h=_n();let y=s,N=c;const b=this.getChildrenSize();if(!this.canBeEmpty()){if(s===0&&c===0){const ae=this.getFirstChild();if(_t(ae)||et(ae))return ae.select(0,0)}else if((s===void 0||s===b)&&(c===void 0||c===b)){const ae=this.getLastChild();if(_t(ae)||et(ae))return ae.select()}}y===void 0&&(y=b),N===void 0&&(N=b);const $=this.__key;if(Tt(h))h.anchor.set($,y,"element"),h.focus.set($,N,"element"),h.dirty=!0;else return Zd($,y,$,N,"element","element");return h}selectStart(){const s=this.getFirstDescendant();return s?s.selectStart():this.select()}selectEnd(){const s=this.getLastDescendant();return s?s.selectEnd():this.select()}clear(){const s=this.getWritable();return this.getChildren().forEach(h=>h.remove()),s}append(...s){return this.splice(this.getChildrenSize(),0,s)}setDirection(s){const c=this.getWritable();return c.__dir=s,c}setFormat(s){const c=this.getWritable();return c.__format=s!==""?_i[s]:0,this}setIndent(s){const c=this.getWritable();return c.__indent=s,this}splice(s,c,h){const y=h.length,N=this.getChildrenSize(),b=this.getWritable(),$=b.__key,ae=[],he=[],me=this.getChildAtIndex(s+c);let xe=null,we=N-c+y;if(s!==0)if(s===N)xe=this.getLastChild();else{const Ve=this.getChildAtIndex(s);Ve!==null&&(xe=Ve.getPreviousSibling())}if(c>0){let Ve=xe===null?this.getFirstChild():xe.getNextSibling();for(let Ue=0;Ue<c;Ue++){if(Ve===null)throw Error("splice: sibling not found");const $e=Ve.getNextSibling(),Rt=Ve.__key,Qe=Ve.getWritable();Vr(Qe),he.push(Rt),Ve=$e}}let Ce=xe;for(let Ve=0;Ve<y;Ve++){const Ue=h[Ve];Ce!==null&&Ue.is(Ce)&&(xe=Ce=Ce.getPreviousSibling());const $e=Ue.getWritable();$e.__parent===$&&we--,Vr($e);const Rt=Ue.__key;if(Ce===null)b.__first=Rt,$e.__prev=null;else{const Qe=Ce.getWritable();Qe.__next=Rt,$e.__prev=Qe.__key}if(Ue.__key===$)throw Error("append: attempting to append self");$e.__parent=$,ae.push(Rt),Ce=Ue}if(s+c===N){if(Ce!==null){const Ve=Ce.getWritable();Ve.__next=null,b.__last=Ce.__key}}else if(me!==null){const Ve=me.getWritable();if(Ce!==null){const Ue=Ce.getWritable();Ve.__prev=Ce.__key,Ue.__next=me.__key}else Ve.__prev=null}if(b.__size=we,he.length){const Ve=_n();if(Tt(Ve)){const Ue=new Set(he),$e=new Set(ae),{anchor:Rt,focus:Qe}=Ve;uf(Rt,Ue,$e)&&Ya(Rt,Rt.getNode(),this,xe,me),uf(Qe,Ue,$e)&&Ya(Qe,Qe.getNode(),this,xe,me),we===0&&!this.canBeEmpty()&&!si(this)&&this.remove()}}return b}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(s,c){return null}canIndent(){return!0}collapseAtStart(s){return!1}excludeFromCopy(s){return!1}canExtractContents(){return!0}canReplaceWith(s){return!0}canInsertAfter(s){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(s){return!1}extractWithChild(s,c,h){return!1}}function et(u){return u instanceof Js}function uf(u,s,c){let h=u.getNode();for(;h;){const y=h.__key;if(s.has(y)&&!c.has(y))return!0;h=h.getParent()}return!1}class Ho extends Js{static getType(){return"root"}static clone(){return new Ho}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){throw Error("getTopLevelElementOrThrow: root nodes are not top level elements")}getTextContent(){const s=this.__cachedText;return(Bo()||xn()._dirtyType===qe)&&s!==null?s:super.getTextContent()}remove(){throw Error("remove: cannot be called on root nodes")}replace(s){throw Error("replace: cannot be called on root nodes")}insertBefore(s){throw Error("insertBefore: cannot be called on root nodes")}insertAfter(s){throw Error("insertAfter: cannot be called on root nodes")}updateDOM(s,c){return!1}append(...s){for(let c=0;c<s.length;c++){const h=s[c];if(!et(h)&&!An(h))throw Error("rootNode.append: Only element or decorator nodes can be appended to the root node")}return super.append(...s)}static importJSON(s){const c=tr();return c.setFormat(s.format),c.setIndent(s.indent),c.setDirection(s.direction),c}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function z_(){return new Ho}function Ur(u){return u instanceof Ho}function U_(u,s){const c=s.getEditorState()._selection,h=u._selection;if(h!==null){if(h.dirty||!h.is(c))return!0}else if(c!==null)return!0;return!1}function G_(u){return new Va(new Map(u._nodeMap))}function Yc(){return new Va(new Map([["root",z_()]]))}function df(u){const s=u.exportJSON(),c=u.constructor;if(s.type!==c.getType())throw Error(`LexicalNode: Node ${c.name} does not match the serialized type. Check if .exportJSON() is implemented and it is returning the correct type.`);if(et(u)){const h=s.children;if(!Array.isArray(h))throw Error(`LexicalNode: Node ${c.name} is an element but .exportJSON() does not have a children array.`);const y=u.getChildren();for(let N=0;N<y.length;N++){const b=y[N],$=df(b);h.push($)}}return s}class Va{constructor(s,c){this._nodeMap=s,this._selection=c||null,this._flushSync=!1,this._readOnly=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(s){return sf(this,s)}clone(s){const c=new Va(this._nodeMap,s===void 0?this._selection:s);return c._readOnly=!0,c}toJSON(){return sf(this,()=>({root:df(tr())}))}}class Wo extends Js{static getType(){return"paragraph"}static clone(s){return new Wo(s.__key)}createDOM(s){const c=document.createElement("p"),h=Pi(s.theme,"paragraph");return h!==void 0&&c.classList.add(...h),c}updateDOM(s,c,h){return!1}static importDOM(){return{p:s=>({conversion:Y_,priority:0})}}exportDOM(s){const{element:c}=super.exportDOM(s);if(c&&Hs(c)){this.isEmpty()&&c.append(document.createElement("br"));const h=this.getFormatType();c.style.textAlign=h;const y=this.getDirection();y&&(c.dir=y);const N=this.getIndent();N>0&&(c.style.textIndent=`${N*20}px`)}return{element:c}}static importJSON(s){const c=Vi();return c.setFormat(s.format),c.setIndent(s.indent),c.setDirection(s.direction),c}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(s,c){const h=Vi(),y=this.getDirection();return h.setDirection(y),this.insertAfter(h,c),h}collapseAtStart(){const s=this.getChildren();if(s.length===0||_t(s[0])&&s[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 Y_(u){const s=Vi();if(u.style){s.setFormat(u.style.textAlign);const c=parseInt(u.style.textIndent,10)/20;c>0&&s.setIndent(c)}return{node:s}}function Vi(){return Dr(new Wo)}function j_(u){return u instanceof Wo}const V_=0,q_=1,Z_=2,J_=3,X_=4;function ff(u,s,c,h){const y=u._keyToDOMMap;y.clear(),u._editorState=Yc(),u._pendingEditorState=h,u._compositionKey=null,u._dirtyType=qe,u._cloneNotNeeded.clear(),u._dirtyLeaves=new Set,u._dirtyElements.clear(),u._normalizedNodes=new Set,u._updateTags=new Set,u._updates=[],u._blockCursorElement=null;const N=u._observer;N!==null&&(N.disconnect(),u._observer=null),s!==null&&(s.textContent=""),c!==null&&(c.textContent="",y.set("root",c))}function Q_(u,s){const c=new Map,h=new Set,y=N=>{Object.keys(N).forEach(b=>{let $=c.get(b);$===void 0&&($=[],c.set(b,$)),$.push(N[b])})};return u.forEach(N=>{const b=N.klass.importDOM!=null?N.klass.importDOM.bind(N.klass):null;if(b==null||h.has(b))return;h.add(b);const $=b();$!==null&&y($)}),s&&y(s),c}function ey(u){const s=u||{},c=I_(),h=s.theme||{},y=u===void 0?c:s.parentEditor||null,N=s.disableEvents||!1,b=Yc(),$=s.namespace||(y!==null?y._config.namespace:Nl()),ae=s.editorState,he=[Ho,Jr,Yi,xr,Wo,...s.nodes||[]],{onError:me,html:xe}=s,we=s.editable!==void 0?s.editable:!0;let Ce;if(u===void 0&&c!==null)Ce=c._nodes;else{Ce=new Map;for(let Ue=0;Ue<he.length;Ue++){let $e=he[Ue],Rt=null,Qe=null;if(typeof $e!="function"){const Dt=$e;$e=Dt.replace,Rt=Dt.with,Qe=Dt.withKlass||null}{const Dt=$e.name;if(Dt!=="RootNode"){const cn=$e.prototype;["getType","clone"].forEach(ir=>{$e.hasOwnProperty(ir)||console.warn(`${Dt} must implement static "${ir}" method`)}),!$e.hasOwnProperty("importDOM")&&$e.hasOwnProperty("exportDOM")&&console.warn(`${Dt} should implement "importDOM" if using a custom "exportDOM" method to ensure HTML serialization (important for copy & paste) works as expected`),cn instanceof Gc&&(cn.hasOwnProperty("decorate")||console.warn(`${cn.constructor.name} must implement "decorate" method`)),$e.hasOwnProperty("importJSON")||console.warn(`${Dt} should implement "importJSON" method to ensure JSON and default HTML serialization works as expected`),cn.hasOwnProperty("exportJSON")||console.warn(`${Dt} should implement "exportJSON" method to ensure JSON and default HTML serialization works as expected`)}}const ht=$e.getType(),Zt=$e.transform(),Wt=new Set;Zt!==null&&Wt.add(Zt),Ce.set(ht,{exportDOM:xe&&xe.export?xe.export.get($e):void 0,klass:$e,replace:Rt,replaceWithKlass:Qe,transforms:Wt})}}const Ve=new ty(b,y,Ce,{disableEvents:N,namespace:$,theme:h},me||console.error,Q_(Ce,xe?xe.import:void 0),we);return ae!==void 0&&(Ve._pendingEditorState=ae,Ve._dirtyType=ut),Ve}class ty{constructor(s,c,h,y,N,b,$){this._parentEditor=c,this._rootElement=null,this._editorState=s,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=y,this._nodes=h,this._decorators={},this._pendingDecorators=null,this._dirtyType=qe,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=Nl(),this._onError=N,this._htmlConversions=b,this._editable=$,this._headless=c!==null&&c._headless,this._window=null,this._blockCursorElement=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(s){const c=this._listeners.update;return c.add(s),()=>{c.delete(s)}}registerEditableListener(s){const c=this._listeners.editable;return c.add(s),()=>{c.delete(s)}}registerDecoratorListener(s){const c=this._listeners.decorator;return c.add(s),()=>{c.delete(s)}}registerTextContentListener(s){const c=this._listeners.textcontent;return c.add(s),()=>{c.delete(s)}}registerRootListener(s){const c=this._listeners.root;return s(this._rootElement,null),c.add(s),()=>{s(null,this._rootElement),c.delete(s)}}registerCommand(s,c,h){if(h===void 0)throw Error('Listener for type "command" requires a "priority".');const y=this._commands;y.has(s)||y.set(s,[new Set,new Set,new Set,new Set,new Set]);const N=y.get(s);if(N===void 0)throw Error(`registerCommand: Command ${String(s)} not found in command map`);const b=N[h];return b.add(c),()=>{b.delete(c),N.every($=>$.size===0)&&y.delete(s)}}registerMutationListener(s,c){if(this._nodes.get(s.getType())===void 0)throw Error(`Node ${s.name} has not been registered. Ensure node has been passed to createEditor.`);const y=this._listeners.mutation;return y.set(c,s),()=>{y.delete(c)}}registerNodeTransformToKlass(s,c){const h=s.getType(),y=this._nodes.get(h);if(y===void 0)throw Error(`Node ${s.name} has not been registered. Ensure node has been passed to createEditor.`);return y.transforms.add(c),y}registerNodeTransform(s,c){const h=this.registerNodeTransformToKlass(s,c),y=[h],N=h.replaceWithKlass;if(N!=null){const b=this.registerNodeTransformToKlass(N,c);y.push(b)}return Ri(this,s.getType()),()=>{y.forEach(b=>b.transforms.delete(c))}}hasNode(s){return this._nodes.has(s.getType())}hasNodes(s){return s.every(this.hasNode.bind(this))}dispatchCommand(s,c){return dt(this,s,c)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(s){const c=this._rootElement;if(s!==c){const h=Pi(this._config.theme,"root"),y=this._pendingEditorState||this._editorState;if(this._rootElement=s,ff(this,c,s,y),c!==null&&(this._config.disableEvents||Ot(c),h!=null&&c.classList.remove(...h)),s!==null){const N=Ra(s),b=s.style;b.userSelect="text",b.whiteSpace="pre-wrap",b.wordBreak="break-word",s.setAttribute("data-lexical-editor","true"),this._window=N,this._dirtyType=ut,sr(this),this._updateTags.add("history-merge"),Zs(this),this._config.disableEvents||pt(s,this),h!=null&&s.classList.add(...h)}else this._editorState=y,this._pendingEditorState=null,this._window=null;Gl("root",this,!1,s,c)}}getElementByKey(s){return this._keyToDOMMap.get(s)||null}getEditorState(){return this._editorState}setEditorState(s,c){if(s.isEmpty())throw Error("setEditorState: the editor state is empty. Ensure the editor state's root node never becomes empty.");fn(this);const h=this._pendingEditorState,y=this._updateTags,N=c!==void 0?c.tag:null;h!==null&&!h.isEmpty()&&(N!=null&&y.add(N),Zs(this)),this._pendingEditorState=s,this._dirtyType=ut,this._dirtyElements.set("root",!1),this._compositionKey=null,N!=null&&y.add(N),Zs(this)}parseEditorState(s,c){const h=typeof s=="string"?JSON.parse(s):s;return F_(h,this,c)}update(s,c){zr(this,s,c)}focus(s,c={}){const h=this._rootElement;h!==null&&(h.setAttribute("autocapitalize","off"),zr(this,()=>{const y=_n(),N=tr();y!==null?y.dirty=!0:N.getChildrenSize()!==0&&(c.defaultSelection==="rootStart"?N.selectStart():N.selectEnd())},{onUpdate:()=>{h.removeAttribute("autocapitalize"),s&&s()},tag:"focus"}),this._pendingEditorState===null&&h.removeAttribute("autocapitalize"))}blur(){const s=this._rootElement;s!==null&&s.blur();const c=ar(this._window);c!==null&&c.removeAllRanges()}isEditable(){return this._editable}setEditable(s){this._editable!==s&&(this._editable=s,Gl("editable",this,!0,s))}toJSON(){return{editorState:this._editorState.toJSON()}}}class jc extends Js{constructor(s,c){super(c),this.__colSpan=s,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(s){return this.getWritable().__colSpan=s,this}getRowSpan(){return this.__rowSpan}setRowSpan(s){return this.getWritable().__rowSpan=s,this}}function Ko(u){return u instanceof jc}class hf extends Js{}function gf(u){return u instanceof hf}class pf extends Js{}function Vc(u){return u instanceof pf}return He.$INTERNAL_isPointSelection=ur,He.$addUpdateTag=Ct,He.$applyNodeReplacement=Dr,He.$copyNode=Dl,He.$createLineBreakNode=gs,He.$createNodeSelection=Hc,He.$createParagraphNode=Vi,He.$createPoint=Rr,He.$createRangeSelection=S_,He.$createTabNode=Io,He.$createTextNode=Dn,He.$getAdjacentNode=wl,He.$getNearestNodeFromDOMNode=ii,He.$getNearestRootOrShadowRoot=Eo,He.$getNodeByKey=Cn,He.$getPreviousSelection=Fo,He.$getRoot=tr,He.$getSelection=_n,He.$getTextContent=M_,He.$hasAncestor=Fi,He.$hasUpdateTag=Un,He.$insertNodes=A_,He.$isBlockElementNode=v_,He.$isDecoratorNode=An,He.$isElementNode=et,He.$isInlineElementOrDecoratorNode=Fr,He.$isLeafNode=Ds,He.$isLineBreakNode=ai,He.$isNodeSelection=Kr,He.$isParagraphNode=j_,He.$isRangeSelection=Tt,He.$isRootNode=Ur,He.$isRootOrShadowRoot=si,He.$isTabNode=ko,He.$isTextNode=_t,He.$nodesOfType=$i,He.$normalizeSelection__EXPERIMENTAL=ws,He.$parseSerializedNode=$_,He.$selectAll=Sl,He.$setCompositionKey=vn,He.$setSelection=Cr,He.$splitNode=ba,He.BLUR_COMMAND=B,He.CAN_REDO_COMMAND=X,He.CAN_UNDO_COMMAND=fe,He.CLEAR_EDITOR_COMMAND=R,He.CLEAR_HISTORY_COMMAND=U,He.CLICK_COMMAND=r,He.COMMAND_PRIORITY_CRITICAL=X_,He.COMMAND_PRIORITY_EDITOR=V_,He.COMMAND_PRIORITY_HIGH=J_,He.COMMAND_PRIORITY_LOW=q_,He.COMMAND_PRIORITY_NORMAL=Z_,He.CONTROLLED_TEXT_INSERTION_COMMAND=p,He.COPY_COMMAND=Y,He.CUT_COMMAND=W,He.DELETE_CHARACTER_COMMAND=l,He.DELETE_LINE_COMMAND=S,He.DELETE_WORD_COMMAND=T,He.DEPRECATED_$computeGridMap=R_,He.DEPRECATED_$getGridCellNodeRect=Lr,He.DEPRECATED_$getNodeTriplet=Qd,He.DEPRECATED_$isGridCellNode=Ko,He.DEPRECATED_$isGridNode=gf,He.DEPRECATED_$isGridRowNode=Vc,He.DEPRECATED_GridCellNode=jc,He.DEPRECATED_GridNode=hf,He.DEPRECATED_GridRowNode=pf,He.DRAGEND_COMMAND=oe,He.DRAGOVER_COMMAND=Z,He.DRAGSTART_COMMAND=D,He.DROP_COMMAND=de,He.DecoratorNode=Gc,He.ElementNode=Js,He.FOCUS_COMMAND=_e,He.FORMAT_ELEMENT_COMMAND=K,He.FORMAT_TEXT_COMMAND=w,He.INDENT_CONTENT_COMMAND=Se,He.INSERT_LINE_BREAK_COMMAND=d,He.INSERT_PARAGRAPH_COMMAND=f,He.INSERT_TAB_COMMAND=Te,He.INTERNAL_PointSelection=br,He.KEY_ARROW_DOWN_COMMAND=j,He.KEY_ARROW_LEFT_COMMAND=k,He.KEY_ARROW_RIGHT_COMMAND=I,He.KEY_ARROW_UP_COMMAND=H,He.KEY_BACKSPACE_COMMAND=ce,He.KEY_DELETE_COMMAND=z,He.KEY_DOWN_COMMAND=v,He.KEY_ENTER_COMMAND=re,He.KEY_ESCAPE_COMMAND=V,He.KEY_MODIFIER_COMMAND=M,He.KEY_SPACE_COMMAND=te,He.KEY_TAB_COMMAND=q,He.LineBreakNode=Yi,He.MOVE_TO_END=G,He.MOVE_TO_START=P,He.OUTDENT_CONTENT_COMMAND=Ee,He.PASTE_COMMAND=_,He.ParagraphNode=Wo,He.REDO_COMMAND=m,He.REMOVE_TEXT_COMMAND=E,He.RootNode=Ho,He.SELECTION_CHANGE_COMMAND=t,He.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND=n,He.SELECT_ALL_COMMAND=J,He.TabNode=xr,He.TextNode=Jr,He.UNDO_COMMAND=O,He.createCommand=e,He.createEditor=ey,He.getNearestEditorFromDOMNode=fl,He.isCurrentlyReadOnlyMode=Bo,He.isHTMLAnchorElement=La,He.isHTMLElement=Hs,He.isSelectionCapturedInDecoratorInput=Os,He.isSelectionWithinEditor=is,He}var We={},Pf;function UN(){if(Pf)return We;Pf=1;let e={},t={},n={},r={},l={},d={},f={},p={},_={},E={},T={},S={},w={},O={},m={},v={},I={},G={},k={},P={},H={},j={},re={},te={},ce={},V={},z={},q={},Te={},Se={},Ee={},de={},K={},D={},Z={},oe={};function Y(o){let i=new URLSearchParams;i.append("code",o);for(let a=1;a<arguments.length;a++)i.append("v",arguments[a]);throw Error(`Minified Lexical error #${o}; visit https://lexical.dev/docs/error?${i} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let W=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",J=W&&"documentMode"in document?document.documentMode:null,R=W&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),U=W&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),X=W&&"InputEvent"in window&&!J?"getTargetRanges"in new window.InputEvent("input"):!1,fe=W&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),_e=W&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,B=W&&/Android/.test(navigator.userAgent),M=W&&/^(?=.*Chrome).*/i.test(navigator.userAgent),F=W&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!M,se=fe||_e||F?" ":"",ye=U?" ":se,De=/^[^A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]*[\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]/,ee=/^[^\u0591-\u07ff\ufb1d-\ufdfd\ufe70-\ufefc]*[A-Za-z\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02b8\u0300-\u0590\u0800-\u1fff\u200e\u2c00-\ufb1c\ufe00-\ufe6f\ufefd-\uffff]/,ne={bold:1,code:16,highlight:128,italic:2,strikethrough:4,subscript:32,superscript:64,underline:8},ue={directionless:1,unmergeable:2},be={center:2,end:6,justify:4,left:1,right:3,start:5},Ne={2:"center",6:"end",4:"justify",1:"left",3:"right",5:"start"},Re={normal:0,segmented:2,token:1},ke={0:"normal",2:"segmented",1:"token"},Fe=!1,qe=0;function Be(o){qe=o.timeStamp}function ut(o,i,a){return i.__lexicalLineBreak===o||o[`__lexicalKey_${a._key}`]!==void 0}function At(o){return o.getEditorState().read(()=>{let i=qt();return i!==null?i.clone():null})}function Ut(o,i,a){Fe=!0;let g=100<performance.now()-qe;try{Tr(o,()=>{let C=qt()||At(o);var x=new Map,A=o.getRootElement(),Q=o._editorState,ge=o._blockCursorElement;let Ae=!1,Ye="";for(var Xe=0;Xe<i.length;Xe++){var Ke=i[Xe],Pe=Ke.type,pt=Ke.target,Ot=Kt(pt,Q);if(!(Ot===null&&pt!==A||En(Ot))){if(Pe==="characterData"){if(Ke=g&&Ct(Ot))e:{Ke=C,Pe=pt;var Ft=Ot;if(Mt(Ke)){var zt=Ke.anchor.getNode();if(zt.is(Ft)&&Ke.format!==zt.getFormat()){Ke=!1;break e}}Ke=Pe.nodeType===3&&Ft.isAttached()}Ke&&(Ft=jr(o._window),Pe=Ke=null,Ft!==null&&Ft.anchorNode===pt&&(Ke=Ft.anchorOffset,Pe=Ft.focusOffset),pt=pt.nodeValue,pt!==null&&wt(Ot,pt,Ke,Pe,!1))}else if(Pe==="childList"){for(Ae=!0,Pe=Ke.addedNodes,Ft=0;Ft<Pe.length;Ft++){zt=Pe[Ft];var Yn=$t(zt),Ar=zt.parentNode;Ar==null||zt===ge||Yn!==null||zt.nodeName==="BR"&&ut(zt,Ar,o)||(U&&(Yn=zt.innerText||zt.nodeValue)&&(Ye+=Yn),Ar.removeChild(zt))}if(Ke=Ke.removedNodes,Pe=Ke.length,0<Pe){for(Ft=0,zt=0;zt<Pe;zt++)Ar=Ke[zt],(Ar.nodeName==="BR"&&ut(Ar,pt,o)||ge===Ar)&&(pt.appendChild(Ar),Ft++);Pe!==Ft&&(pt===A&&(Ot=Q._nodeMap.get("root")),x.set(pt,Ot))}}}}if(0<x.size)for(let[oi,li]of x)if(Je(li))for(x=li.getChildrenKeys(),A=oi.firstChild,Q=0;Q<x.length;Q++)ge=o.getElementByKey(x[Q]),ge!==null&&(A==null?(oi.appendChild(ge),A=ge):A!==ge&&oi.replaceChild(ge,A),A=A.nextSibling);else Ct(li)&&li.markDirty();if(x=a.takeRecords(),0<x.length){for(A=0;A<x.length;A++)for(ge=x[A],Q=ge.addedNodes,ge=ge.target,Xe=0;Xe<Q.length;Xe++)Ot=Q[Xe],pt=Ot.parentNode,pt==null||Ot.nodeName!=="BR"||ut(Ot,ge,o)||pt.removeChild(Ot);a.takeRecords()}C!==null&&(Ae&&(C.dirty=!0,rn(C)),U&&on(o)&&C.insertRawText(Ye))})}finally{Fe=!1}}function tn(o){let i=o._observer;if(i!==null){let a=i.takeRecords();Ut(o,a,i)}}function Oe(o){qe===0&&fn(o).addEventListener("textInput",Be,!0),o._observer=new MutationObserver((i,a)=>{Ut(o,i,a)})}function ie(o,i){let a=o.__mode,g=o.__format;o=o.__style;let C=i.__mode,x=i.__format;return i=i.__style,(a===null||a===C)&&(g===null||g===x)&&(o===null||o===i)}function le(o,i){let a=o.mergeWithSibling(i),g=hn()._normalizedNodes;return g.add(o.__key),g.add(i.__key),a}function ve(o){if(o.__text===""&&o.isSimpleText()&&!o.isUnmergeable())o.remove();else{for(var i;(i=o.getPreviousSibling())!==null&&Ct(i)&&i.isSimpleText()&&!i.isUnmergeable();)if(i.__text==="")i.remove();else{ie(i,o)&&(o=le(i,o));break}for(var a;(a=o.getNextSibling())!==null&&Ct(a)&&a.isSimpleText()&&!a.isUnmergeable();)if(a.__text==="")a.remove();else{ie(o,a)&&le(o,a);break}}}function Le(o){return Me(o.anchor),Me(o.focus),o}function Me(o){for(;o.type==="element";){var i=o.getNode(),a=o.offset;if(a===i.getChildrenSize()?(i=i.getChildAtIndex(a-1),a=!0):(i=i.getChildAtIndex(a),a=!1),Ct(i)){o.set(i.__key,a?i.getTextContentSize():0,"text");break}else if(!Je(i))break;o.set(i.__key,a?i.getChildrenSize():0,"element")}}let je=1,it=typeof queueMicrotask=="function"?queueMicrotask:o=>{Promise.resolve().then(o)};function st(o){let i=document.activeElement;if(i===null)return!1;let a=i.nodeName;return En(Kt(o))&&(a==="INPUT"||a==="TEXTAREA"||i.contentEditable==="true"&&i.__lexicalEditor==null)}function ot(o,i,a){let g=o.getRootElement();try{return g!==null&&g.contains(i)&&g.contains(a)&&i!==null&&!st(i)&&St(i)===o}catch{return!1}}function St(o){for(;o!=null;){let i=o.__lexicalEditor;if(i!=null)return i;o=yr(o)}return null}function Ge(o){return o.isToken()||o.isSegmented()}function ze(o){for(;o!=null;){if(o.nodeType===3)return o;o=o.firstChild}return null}function tt(o,i,a){let g=ne[i];return a!==null&&(o&g)===(a&g)||(o^=g,i==="subscript"?o&=-65:i==="superscript"&&(o&=-33)),o}function yt(o,i){if(i!=null)o.__key=i;else{Jn(),99<Wi&&Y(14),i=hn();var a=Br(),g=""+je++;a._nodeMap.set(g,o),Je(o)?i._dirtyElements.set(g,!0):i._dirtyLeaves.add(g),i._cloneNotNeeded.add(g),i._dirtyType=1,o.__key=g}}function Nt(o){var i=o.getParent();if(i!==null){let C=o.getWritable();i=i.getWritable();var a=o.getPreviousSibling();if(o=o.getNextSibling(),a===null)if(o!==null){var g=o.getWritable();i.__first=o.__key,g.__prev=null}else i.__first=null;else{if(g=a.getWritable(),o!==null){let x=o.getWritable();x.__prev=g.__key,g.__next=x.__key}else g.__next=null;C.__prev=null}o===null?a!==null?(o=a.getWritable(),i.__last=a.__key,o.__next=null):i.__last=null:(o=o.getWritable(),a!==null?(a=a.getWritable(),a.__next=o.__key,o.__prev=a.__key):o.__prev=null,C.__next=null),i.__size--,C.__parent=null}}function Et(o){99<Wi&&Y(14);var i=o.getLatest(),a=i.__parent,g=Br();let C=hn(),x=g._nodeMap;if(g=C._dirtyElements,a!==null)e:for(;a!==null;){if(g.has(a))break e;let A=x.get(a);if(A===void 0)break;g.set(a,!1),a=A.__parent}i=i.__key,C._dirtyType=1,Je(o)?g.set(i,!0):C._dirtyLeaves.add(i)}function gt(o){Jn();var i=hn();let a=i._compositionKey;o!==a&&(i._compositionKey=o,a!==null&&(i=mt(a),i!==null&&i.getWritable()),o!==null&&(o=mt(o),o!==null&&o.getWritable()))}function xt(){return fs()?null:hn()._compositionKey}function mt(o,i){return o=(i||Br())._nodeMap.get(o),o===void 0?null:o}function $t(o,i){let a=hn();return o=o[`__lexicalKey_${a._key}`],o!==void 0?mt(o,i):null}function Kt(o,i){for(;o!=null;){let a=$t(o,i);if(a!==null)return a;o=yr(o)}return null}function nn(o){let i=Object.assign({},o._decorators);return o._pendingDecorators=i}function It(o){return o.read(()=>bt().getTextContent())}function Vt(o,i){Tr(o,()=>{var a=Br();if(!a.isEmpty())if(i==="root")bt().markDirty();else{a=a._nodeMap;for(let[,g]of a)g.markDirty()}},o._pendingEditorState===null?{tag:"history-merge"}:void 0)}function bt(){return Br()._nodeMap.get("root")}function rn(o){Jn();let i=Br();o!==null&&(o.dirty=!0,o.setCachedNodes(null)),i._selection=o}function Or(o){var i=hn(),a;e:{for(a=o;a!=null;){let g=a[`__lexicalKey_${i._key}`];if(g!==void 0){a=g;break e}a=yr(a)}a=null}return a===null?(i=i.getRootElement(),o===i?mt("root"):null):mt(a)}function _i(o){return/[\uD800-\uDBFF][\uDC00-\uDFFF]/g.test(o)}function pe(o){let i=[];for(;o!==null;)i.push(o),o=o._parentEditor;return i}function Ze(){return Math.random().toString(36).replace(/[^a-z]+/g,"").substr(0,5)}function lt(o,i,a){if(i=jr(i._window),i!==null){var g=i.anchorNode,{anchorOffset:C,focusOffset:x}=i;if(g!==null&&(i=g.nodeType===3?g.nodeValue:null,g=Kt(g),i!==null&&Ct(g))){if(i===se&&a){let A=a.length;i=a,x=C=A}i!==null&&wt(g,i,C,x,o)}}}function wt(o,i,a,g,C){let x=o;if(x.isAttached()&&(C||!x.isDirty())){let Ae=x.isComposing(),Ye=i;if((Ae||C)&&i[i.length-1]===se&&(Ye=i.slice(0,-1)),i=x.getTextContent(),C||Ye!==i)if(Ye==="")if(gt(null),fe||_e||F)x.remove();else{let Xe=hn();setTimeout(()=>{Xe.update(()=>{x.isAttached()&&x.remove()})},20)}else{C=x.getParent(),i=Er();var A=x.getTextContentSize(),Q=xt(),ge=x.getKey();x.isToken()||Q!==null&&ge===Q&&!Ae||Mt(i)&&(C!==null&&!C.canInsertTextBefore()&&i.anchor.offset===0||i.anchor.key===o.__key&&i.anchor.offset===0&&!x.canInsertTextBefore()&&!Ae||i.focus.key===o.__key&&i.focus.offset===A&&!x.canInsertTextAfter()&&!Ae)?x.markDirty():(o=qt(),Mt(o)&&a!==null&&g!==null&&(o.setTextNodeRange(x,a,x,g),x.isSegmented()&&(a=x.getTextContent(),a=Un(a),x.replace(a),x=a)),x.setTextContent(Ye))}}}function Gt(o,i){if(i.isSegmented())return!0;if(!o.isCollapsed())return!1;o=o.anchor.offset;let a=i.getParentOrThrow(),g=i.isToken();return o===0?((o=!i.canInsertTextBefore()||!a.canInsertTextBefore()||g)||(i=i.getPreviousSibling(),o=(Ct(i)||Je(i)&&i.isInline())&&!i.canInsertTextAfter()),o):o===i.getTextContentSize()?!i.canInsertTextAfter()||!a.canInsertTextAfter()||g:!1}function Bt(o,i){o.__lexicalClassNameCache===void 0&&(o.__lexicalClassNameCache={});let a=o.__lexicalClassNameCache,g=a[i];return g!==void 0?g:(o=o[i],typeof o=="string"?(o=o.split(" "),a[i]=o):o)}function Pt(o,i,a,g,C){a.size!==0&&(a=g.__type,g=g.__key,i=i.get(a),i===void 0&&Y(33,a),a=i.klass,i=o.get(a),i===void 0&&(i=new Map,o.set(a,i)),o=i.get(g),a=o==="destroyed"&&C==="created",(o===void 0||a)&&i.set(g,a?"updated":C))}function kt(o,i,a){let g=o.getParent(),C=a;return g!==null&&(i&&a===0?(C=o.getIndexWithinParent(),o=g):i||a!==o.getChildrenSize()||(C=o.getIndexWithinParent()+1,o=g)),o.getChildAtIndex(i?C-1:C)}function Ht(o,i){var a=o.offset;return o.type==="element"?(o=o.getNode(),kt(o,i,a)):(o=o.getNode(),i&&a===0||!i&&a===o.getTextContentSize()?(a=i?o.getPreviousSibling():o.getNextSibling(),a===null?kt(o.getParentOrThrow(),i,o.getIndexWithinParent()+(i?0:1)):a):null)}function on(o){return o=(o=fn(o).event)&&o.inputType,o==="insertFromPaste"||o==="insertFromPasteAsQuotation"}function an(o){return!nr(o)&&!o.isLastChild()&&!o.isInline()}function bn(o,i){return o=o._keyToDOMMap.get(i),o===void 0&&Y(75,i),o}function yr(o){return o=o.assignedSlot||o.parentElement,o!==null&&o.nodeType===11?o.host:o}function Zn(o,i){for(o=o.getParent();o!==null;){if(o.is(i))return!0;o=o.getParent()}return!1}function fn(o){return o=o._window,o===null&&Y(78),o}function sr(o){for(o=o.getParentOrThrow();o!==null&&!or(o);)o=o.getParentOrThrow();return o}function or(o){return nr(o)||Je(o)&&o.isShadowRoot()}function Ai(o){return o=o.constructor.clone(o),yt(o,null),o}function Nr(o){var i=hn();let a=o.constructor.getType();return i=i._nodes.get(a),i===void 0&&Y(97),i=i.replace,i!==null?(i=i(o),i instanceof o.constructor||Y(98),i):o}function ws(o,i){o=o.getParent(),!nr(o)||Je(i)||En(i)||Y(99)}function fo(o){return(En(o)||Je(o)&&!o.canBeEmpty())&&!o.isInline()}function dl(o,i,a){a.style.removeProperty("caret-color"),i._blockCursorElement=null,i=o.parentElement,i!==null&&i.removeChild(o)}function jr(o){return W?(o||window).getSelection():null}function ma(o,i){for(;o!==bt()&&o!=null;){if(i(o))return o;o=o.getParent()}return null}function ho(o){return o.nodeType===1}function rs(o){if(En(o)&&!o.isInline())return!0;if(!Je(o)||or(o))return!1;var i=o.getFirstChild();return i=i===null||Ii(i)||Ct(i)||i.isInline(),!o.isInline()&&o.canBeEmpty()!==!1&&i}function Os(o,i){for(;o!==null&&o.getParent()!==null&&!i(o);)o=o.getParentOrThrow();return i(o)?o:null}function is(o,i,a,g,C,x){for(o=o.getFirstChild();o!==null;){let A=o.__key;o.__parent===i&&(Je(o)&&is(o,A,a,g,C,x),a.has(A)||x.delete(A),C.push(A)),o=o.getNextSibling()}}function fl(o,i,a,g){o=o._nodeMap,i=i._nodeMap;let C=[];for(let[x]of g){let A=i.get(x);A===void 0||A.isAttached()||(Je(A)&&is(A,x,o,i,C,g),o.has(x)||g.delete(x),C.push(x))}for(let x of C)i.delete(x);for(let x of a)g=i.get(x),g===void 0||g.isAttached()||(o.has(x)||a.delete(x),i.delete(x))}let Ln="",zn="",ri="",Pr,Bn,Ds,hl=!1,gl=!1,Vr,Mi=null,pl,vn,lr,Cn,go,ii;function As(o,i){let a=lr.get(o);if(i!==null){let g=Rs(o);g.parentNode===i&&i.removeChild(g)}Cn.has(o)||Bn._keyToDOMMap.delete(o),Je(a)&&(o=Ms(a,lr),po(o,0,o.length-1,null)),a!==void 0&&Pt(ii,Ds,Vr,a,"destroyed")}function po(o,i,a,g){for(;i<=a;++i){let C=o[i];C!==void 0&&As(C,g)}}function Ri(o,i){o.setProperty("text-align",i)}function tr(o,i){var a=Pr.theme.indent;if(typeof a=="string"){let g=o.classList.contains(a);0<i&&!g?o.classList.add(a):1>i&&g&&o.classList.remove(a)}a=getComputedStyle(o).getPropertyValue("--lexical-indent-base-value")||"40px",o.style.setProperty("padding-inline-start",i===0?"":`calc(${i} * ${a})`)}function ml(o,i){o=o.style,i===0?Ri(o,""):i===1?Ri(o,"left"):i===2?Ri(o,"center"):i===3?Ri(o,"right"):i===4?Ri(o,"justify"):i===5?Ri(o,"start"):i===6&&Ri(o,"end")}function Cr(o,i,a){let g=Cn.get(o);g===void 0&&Y(60);let C=g.createDOM(Pr,Bn);var x=Bn._keyToDOMMap;if(C["__lexicalKey_"+Bn._key]=o,x.set(o,C),Ct(g)?C.setAttribute("data-lexical-text","true"):En(g)&&C.setAttribute("data-lexical-decorator","true"),Je(g)){if(o=g.__indent,x=g.__size,o!==0&&tr(C,o),x!==0){--x,o=Ms(g,Cn);var A=zn;zn="",_l(o,g,0,x,C,null),_a(g,C),zn=A}o=g.__format,o!==0&&ml(C,o),g.isInline()||yl(null,g,C),an(g)&&(Ln+=`
|
|
47
47
|
|
|
48
48
|
`,ri+=`
|
|
49
49
|
|
|
50
|
-
`)}else x=g.getTextContent(),En(g)?(
|
|
50
|
+
`)}else x=g.getTextContent(),En(g)?(A=g.decorate(Bn,Pr),A!==null&&Nl(o,A),C.contentEditable="false"):Ct(g)&&(g.isDirectionless()||(zn+=x)),Ln+=x,ri+=x;return i!==null&&(a!=null?i.insertBefore(C,a):(a=i.__lexicalLineBreak,a!=null?i.insertBefore(C,a):i.appendChild(C))),Pt(ii,Ds,Vr,g,"created"),C}function _l(o,i,a,g,C,x){let A=Ln;for(Ln="";a<=g;++a)Cr(o[a],C,x);an(i)&&(Ln+=`
|
|
51
51
|
|
|
52
|
-
`),C.__lexicalTextContent=Ln,Ln=
|
|
52
|
+
`),C.__lexicalTextContent=Ln,Ln=A+Ln}function bi(o,i){return o=i.get(o),Ii(o)||En(o)&&o.isInline()}function yl(o,i,a){o=o!==null&&(o.__size===0||bi(o.__last,lr)),i=i.__size===0||bi(i.__last,Cn),o?i||(i=a.__lexicalLineBreak,i!=null&&a.removeChild(i),a.__lexicalLineBreak=null):i&&(i=document.createElement("br"),a.__lexicalLineBreak=i,a.appendChild(i))}function _a(o,i){var a=i.__lexicalDir;if(i.__lexicalDirTextContent!==zn||a!==Mi){let x=zn==="";if(x)var g=Mi;else g=zn,g=De.test(g)?"rtl":ee.test(g)?"ltr":null;if(g!==a){let A=i.classList,Q=Pr.theme;var C=a!==null?Q[a]:void 0;let ge=g!==null?Q[g]:void 0;C!==void 0&&(typeof C=="string"&&(C=C.split(" "),C=Q[a]=C),A.remove(...C)),g===null||x&&g==="ltr"?i.removeAttribute("dir"):(ge!==void 0&&(typeof ge=="string"&&(a=ge.split(" "),ge=Q[g]=a),ge!==void 0&&A.add(...ge)),i.dir=g),gl||(o.getWritable().__dir=g)}Mi=g,i.__lexicalDirTextContent=zn,i.__lexicalDir=g}}function Ms(o,i){let a=[];for(o=o.__first;o!==null;){let g=i.get(o);g===void 0&&Y(101),a.push(o),o=g.__next}return a}function Li(o,i){var a=lr.get(o),g=Cn.get(o);a!==void 0&&g!==void 0||Y(61);var C=hl||vn.has(o)||pl.has(o);let x=bn(Bn,o);if(a===g&&!C)return Je(a)?(g=x.__lexicalTextContent,g!==void 0&&(Ln+=g,ri+=g),g=x.__lexicalDirTextContent,g!==void 0&&(zn+=g)):(g=a.getTextContent(),Ct(a)&&!a.isDirectionless()&&(zn+=g),ri+=g,Ln+=g),x;if(a!==g&&C&&Pt(ii,Ds,Vr,g,"updated"),g.updateDOM(a,x,Pr))return g=Cr(o,null,null),i===null&&Y(62),i.replaceChild(g,x),As(o,null),g;if(Je(a)&&Je(g)){if(o=g.__indent,o!==a.__indent&&tr(x,o),o=g.__format,o!==a.__format&&ml(x,o),C){o=zn,zn="",C=Ln;var A=a.__size,Q=g.__size;if(Ln="",A===1&&Q===1){var ge=a.__first;if(i=g.__first,ge===i)Li(ge,x);else{var Ae=Rs(ge);i=Cr(i,null,null),x.replaceChild(i,Ae),As(ge,null)}}else{i=Ms(a,lr);var Ye=Ms(g,Cn);if(A===0)Q!==0&&_l(Ye,g,0,Q-1,x,null);else if(Q===0)A!==0&&(ge=x.__lexicalLineBreak==null,po(i,0,A-1,ge?null:x),ge&&(x.textContent=""));else{var Xe=i;i=Ye,Ye=A-1,A=Q-1;let Pe=x.firstChild,pt=0;for(Q=0;pt<=Ye&&Q<=A;){var Ke=Xe[pt];let Ot=i[Q];if(Ke===Ot)Pe=mo(Li(Ot,x)),pt++,Q++;else{ge===void 0&&(ge=new Set(Xe)),Ae===void 0&&(Ae=new Set(i));let Ft=Ae.has(Ke),zt=ge.has(Ot);Ft?(zt?(Ke=bn(Bn,Ot),Ke===Pe?Pe=mo(Li(Ot,x)):(Pe!=null?x.insertBefore(Ke,Pe):x.appendChild(Ke),Li(Ot,x)),pt++):Cr(Ot,x,Pe),Q++):(Pe=mo(Rs(Ke)),As(Ke,x),pt++)}}ge=pt>Ye,Ae=Q>A,ge&&!Ae?(ge=i[A+1],ge=ge===void 0?null:Bn.getElementByKey(ge),_l(i,g,Q,A,x,ge)):Ae&&!ge&&po(Xe,pt,Ye,x)}}an(g)&&(Ln+=`
|
|
53
53
|
|
|
54
|
-
`),x.__lexicalTextContent=Ln,Ln=C+Ln,
|
|
54
|
+
`),x.__lexicalTextContent=Ln,Ln=C+Ln,_a(g,x),zn=o,nr(g)||g.isInline()||yl(a,g,x)}an(g)&&(Ln+=`
|
|
55
55
|
|
|
56
56
|
`,ri+=`
|
|
57
57
|
|
|
58
|
-
`)}else a=g.getTextContent(),En(g)?(C=g.decorate(Bn,Pr),C!==null&&Nl(o,C)):Ct(g)&&!g.isDirectionless()&&(zn+=a),Ln+=a,ri+=a;return!gl&&nr(g)&&g.__cachedText!==ri&&(g.getWritable().__cachedText=ri),x}function Nl(o,i){let a=Bn._pendingDecorators,g=Bn._decorators;if(a===null){if(g[o]===i)return;a=
|
|
58
|
+
`)}else a=g.getTextContent(),En(g)?(C=g.decorate(Bn,Pr),C!==null&&Nl(o,C)):Ct(g)&&!g.isDirectionless()&&(zn+=a),Ln+=a,ri+=a;return!gl&&nr(g)&&g.__cachedText!==ri&&(g.getWritable().__cachedText=ri),x}function Nl(o,i){let a=Bn._pendingDecorators,g=Bn._decorators;if(a===null){if(g[o]===i)return;a=nn(Bn)}a[o]=i}function mo(o){return o=o.nextSibling,o!==null&&o===Bn._blockCursorElement&&(o=o.nextSibling),o}function Rs(o){let i=go.get(o);return i===void 0&&Y(75,o),i}let $r=Object.freeze({}),Cl=[["keydown",Pc],["pointerdown",bc],["compositionstart",wa],["compositionend",kc],["input",Sa],["click",Rc],["cut",$r],["copy",$r],["dragstart",$r],["dragover",$r],["dragend",$r],["paste",$r],["focus",$r],["blur",$r],["drop",$r]];X&&Cl.push(["beforeinput",(o,i)=>Ic(o,i)]);let bs=0,ya=0,Na=0,ss=null,Ls=0,El=!1,Tl=!1,Is=!1,ks=!1,Ca=[0,"",0,"root",0];function Ea(o,i,a,g,C){let x=o.anchor,A=o.focus,Q=x.getNode();var ge=hn();let Ae=jr(ge._window),Ye=Ae!==null?Ae.anchorNode:null,Xe=x.key;ge=ge.getElementByKey(Xe);let Ke=a.length;return Xe!==A.key||!Ct(Q)||(!C&&(!X||Na<g+50)||Q.isDirty()&&2>Ke||_i(a))&&x.offset!==A.offset&&!Q.isComposing()||Ge(Q)||Q.isDirty()&&1<Ke||(C||!X)&&ge!==null&&!Q.isComposing()&&Ye!==ze(ge)||Ae!==null&&i!==null&&(!i.collapsed||i.startContainer!==Ae.anchorNode||i.startOffset!==Ae.anchorOffset)||Q.getFormat()!==o.format||Q.getStyle()!==o.style||Gt(o,Q)}function Ta(o,i){return o!==null&&o.nodeValue!==null&&o.nodeType===3&&i!==0&&i!==o.nodeValue.length}function xa(o,i,a){let{anchorNode:g,anchorOffset:C,focusNode:x,focusOffset:A}=o;El&&(El=!1,Ta(g,C)&&Ta(x,A))||Tr(i,()=>{if(!a)rn(null);else if(ot(i,g,x)){var Q=qt();if(Mt(Q)){var ge=Q.anchor,Ae=ge.getNode();if(Q.isCollapsed()){o.type==="Range"&&o.anchorNode===o.focusNode&&(Q.dirty=!0);var Ye=fn(i).event;Ye=Ye?Ye.timeStamp:performance.now();let[Ke,Pe,pt,Ot,Ft]=Ca;var Xe=bt();if(Xe=i.isComposing()===!1&&Xe.getTextContent()==="",Ye<Ft+200&&ge.offset===pt&&ge.key===Ot)Q.format=Ke,Q.style=Pe;else if(ge.type==="text"){if(!Ct(Ae))throw Error("Point.getNode() must return TextNode when type is text");Q.format=Ae.getFormat(),Q.style=Ae.getStyle()}else ge.type!=="element"||Xe||(Q.format=0,Q.style="")}else{ge=255,Ae=!1,Ye=Q.getNodes(),Xe=Ye.length;for(let Ke=0;Ke<Xe;Ke++){let Pe=Ye[Ke];if(Ct(Pe)&&(Ae=!0,ge&=Pe.getFormat(),ge===0))break}Q.format=Ae?ge:0}}ct(i,e,void 0)}})}function Rc(o,i){Tr(i,()=>{let a=qt();var g=jr(i._window);let C=Er();if(g)if(Mt(a)){let A=a.anchor;var x=A.getNode();A.type==="element"&&A.offset===0&&a.isCollapsed()&&!nr(x)&&bt().getChildrenSize()===1&&x.getTopLevelElementOrThrow().isEmpty()&&C!==null&&a.is(C)?(g.removeAllRanges(),a.dirty=!0):o.detail!==3||a.isCollapsed()||(g=a.focus.getNode(),x!==g&&(Je(x)?x.select(0):x.getParentOrThrow().select(0)))}else o.pointerType==="touch"&&(x=g.anchorNode,x!==null&&(x=x.nodeType,x===1||x===3))&&(g=Gn(C,g,i,o),rn(g));ct(i,t,o)})}function bc(o,i){let a=o.target;o=o.pointerType,a instanceof Node&&o!=="touch"&&Tr(i,()=>{En(Kt(a))||(Tl=!0)})}function va(o){return o.getTargetRanges?(o=o.getTargetRanges(),o.length===0?null:o[0]):null}function Lc(o,i){return o!==i||Je(o)||Je(i)||!o.isToken()||!i.isToken()}function Ic(o,i){let a=o.inputType,g=va(o);a==="deleteCompositionText"||U&&on(i)||a!=="insertCompositionText"&&Tr(i,()=>{let C=qt();if(a==="deleteContentBackward"){if(C===null){var x=Er();if(!Mt(x))return;rn(x.clone())}if(Mt(C)){if(B&>(C.anchor.key),ya===229&&o.timeStamp<bs+30&&i.isComposing()&&C.anchor.key===C.focus.key){if(gt(null),bs=0,setTimeout(()=>{Tr(i,()=>{gt(null)})},30),Mt(C)){if(x=C.anchor.getNode(),x.markDirty(),C.format=x.getFormat(),!Ct(x))throw Error("Anchor node must be a TextNode");C.style=x.getStyle()}1>=C.anchor.getNode().getTextContent().length&&(o.preventDefault(),ct(i,n,!0))}else gt(null),o.preventDefault(),ct(i,n,!0);return}}if(Mt(C)){x=o.data,ss!==null&<(!1,i,ss),C.dirty&&ss===null||!C.isCollapsed()||nr(C.anchor.getNode())||g===null||C.applyDOMRange(g),ss=null;var A=C.focus,Q=C.anchor.getNode();if(A=A.getNode(),a==="insertText"||a==="insertTranspose")x===`
|
|
59
59
|
`?(o.preventDefault(),ct(i,r,!1)):x===`
|
|
60
60
|
|
|
61
|
-
`?(o.preventDefault(),ct(i,l,void 0)):x==null&&o.dataTransfer?(x=o.dataTransfer.getData("text/plain"),o.preventDefault(),C.insertRawText(x)):x!=null&&
|
|
62
|
-
`&&(a=Vt(),Mt(a))){i=a.focus,a.anchor.set(i.key,i.offset,i.type),ct(o,H,null);return}}ot(!0,o,i)}function bc(o,i){U?Ps=!0:Tr(i,()=>{xl(i,o.data)})}function Lc(o,i){if(Ls=o.timeStamp,_a=o.keyCode,!i.isComposing()){var{keyCode:a,shiftKey:g,ctrlKey:C,metaKey:x,altKey:D}=o;if(!ct(i,M,o)){if(a!==39||C||x||D)if(a!==39||D||g||!C&&!x)if(a!==37||C||x||D)if(a!==37||D||g||!C&&!x)if(a!==38||C||x)if(a!==40||C||x)if(a===13&&g)ks=!0,ct(i,H,o);else if(a===32)ct(i,j,o);else if(R&&C&&a===79)o.preventDefault(),ks=!0,ct(i,r,!0);else if(a!==13||g){var Q=R?D||x?!1:a===8||a===72&&C:C||D||x?!1:a===8;Q?a===8?ct(i,re,o):(o.preventDefault(),ct(i,n,!0)):a===27?ct(i,te,o):(Q=R?g||D||x?!1:a===46||a===68&&C:C||D||x?!1:a===46,Q?a===46?ct(i,ce,o):(o.preventDefault(),ct(i,n,!1)):a===8&&(R?D:C)?(o.preventDefault(),ct(i,_,!0)):a===46&&(R?D:C)?(o.preventDefault(),ct(i,_,!1)):R&&x&&a===8?(o.preventDefault(),ct(i,T,!0)):R&&x&&a===46?(o.preventDefault(),ct(i,T,!1)):a===66&&!D&&(R?x:C)?(o.preventDefault(),ct(i,E,"bold")):a===85&&!D&&(R?x:C)?(o.preventDefault(),ct(i,E,"underline")):a===73&&!D&&(R?x:C)?(o.preventDefault(),ct(i,E,"italic")):a!==9||D||C||x?a===90&&!g&&(R?x:C)?(o.preventDefault(),ct(i,S,void 0)):(Q=R?a===90&&x&&g:a===89&&C||a===90&&C&&g,Q?(o.preventDefault(),ct(i,w,void 0)):ar(i._editorState._selection)?(Q=g?!1:a===67?R?x:C:!1,Q?(o.preventDefault(),ct(i,Ee,o)):(Q=g?!1:a===88?R?x:C:!1,Q?(o.preventDefault(),ct(i,de,o)):a===65&&(R?x:C)&&(o.preventDefault(),ct(i,K,o)))):!U&&a===65&&(R?x:C)&&(o.preventDefault(),ct(i,K,o))):ct(i,V,o))}else ks=!1,ct(i,H,o);else ct(i,P,o);else ct(i,I,o);else ct(i,G,o);else ct(i,k,o);else ct(i,v,o);else ct(i,m,o);(C||g||D||x)&&ct(i,oe,o)}}}function wa(o){let i=o.__lexicalEventHandles;return i===void 0&&(i=[],o.__lexicalEventHandles=i),i}let ls=new Map;function Oa(o){var i=o.target;let a=jr(i==null?null:i.nodeType===9?i.defaultView:i.ownerDocument.defaultView);if(a!==null){var g=vt(a.anchorNode);if(g!==null){Tl&&(Tl=!1,Tr(g,()=>{var Q=Er(),ge=a.anchorNode;ge!==null&&(ge=ge.nodeType,ge===1||ge===3)&&(Q=Gn(Q,a,g,o),nn(Q))})),i=pe(g),i=i[i.length-1];var C=i._key,x=ls.get(C),D=x||i;D!==g&&Ta(a,D,!1),Ta(a,g,!0),g!==i?ls.set(C,g):x&&ls.delete(C)}}}function Ic(o,i){Is===0&&o.ownerDocument.addEventListener("selectionchange",Oa),Is++,o.__lexicalEditor=i;let a=wa(o);for(let g=0;g<Cl.length;g++){let[C,x]=Cl[g],D=typeof x=="function"?Q=>{Q._lexicalHandled!==!0&&(Q._lexicalHandled=!0,i.isEditable()&&x(Q,i))}:Q=>{if(Q._lexicalHandled!==!0&&(Q._lexicalHandled=!0,i.isEditable()))switch(C){case"cut":return ct(i,de,Q);case"copy":return ct(i,Ee,Q);case"paste":return ct(i,f,Q);case"dragstart":return ct(i,q,Q);case"dragover":return ct(i,Te,Q);case"dragend":return ct(i,Se,Q);case"focus":return ct(i,O,Q);case"blur":return ct(i,Z,Q);case"drop":return ct(i,z,Q)}};o.addEventListener(C,D),a.push(()=>{o.removeEventListener(C,D)})}}function vl(o,i,a){Jn();var g=o.__key;let C=o.getParent();if(C!==null){var x=Vt();if(Mt(x)&&Je(o)){var{anchor:D,focus:Q}=x,ge=D.getNode(),Ae=Q.getNode();Zn(ge,o)&&D.set(o.__key,0,"element"),Zn(Ae,o)&&Q.set(o.__key,0,"element")}if(ge=x,Ae=!1,Mt(ge)&&i){x=ge.anchor;let Ye=ge.focus;x.key===g&&(ds(x,o,C,o.getPreviousSibling(),o.getNextSibling()),Ae=!0),Ye.key===g&&(ds(Ye,o,C,o.getPreviousSibling(),o.getNextSibling()),Ae=!0)}else ar(ge)&&i&&o.isSelected()&&o.selectPrevious();Mt(ge)&&i&&!Ae?(g=o.getIndexWithinParent(),Nt(o),Hn(ge,C,g,-1)):Nt(o),a||or(C)||C.canBeEmpty()||!C.isEmpty()||vl(C,i),i&&nr(C)&&C.isEmpty()&&C.selectEnd()}}class $s{static getType(){Y(64,this.name)}static clone(){Y(65,this.name)}constructor(i){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,yt(this,i)}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){for(var i=this.__key;i!==null;){if(i==="root")return!0;if(i=mt(i),i===null)break;i=i.__parent}return!1}isSelected(i){if(i=i||Vt(),i==null)return!1;let a=i.getNodes().some(g=>g.__key===this.__key);return Ct(this)?a:Mt(i)&&i.anchor.type==="element"&&i.focus.type==="element"&&i.anchor.key===i.focus.key&&i.anchor.offset===i.focus.offset?!1:a}getKey(){return this.__key}getIndexWithinParent(){var i=this.getParent();if(i===null)return-1;i=i.getFirstChild();let a=0;for(;i!==null;){if(this.is(i))return a;a++,i=i.getNextSibling()}return-1}getParent(){let i=this.getLatest().__parent;return i===null?null:mt(i)}getParentOrThrow(){let i=this.getParent();return i===null&&Y(66,this.__key),i}getTopLevelElement(){let i=this;for(;i!==null;){let a=i.getParent();if(or(a)){if(!Je(i))throw Error("Children of root nodes must be elements");return i}i=a}return null}getTopLevelElementOrThrow(){let i=this.getTopLevelElement();return i===null&&Y(67,this.__key),i}getParents(){let i=[],a=this.getParent();for(;a!==null;)i.push(a),a=a.getParent();return i}getParentKeys(){let i=[],a=this.getParent();for(;a!==null;)i.push(a.__key),a=a.getParent();return i}getPreviousSibling(){let i=this.getLatest().__prev;return i===null?null:mt(i)}getPreviousSiblings(){let i=[];var a=this.getParent();if(a===null)return i;for(a=a.getFirstChild();a!==null&&!a.is(this);)i.push(a),a=a.getNextSibling();return i}getNextSibling(){let i=this.getLatest().__next;return i===null?null:mt(i)}getNextSiblings(){let i=[],a=this.getNextSibling();for(;a!==null;)i.push(a),a=a.getNextSibling();return i}getCommonAncestor(i){let a=this.getParents();var g=i.getParents();Je(this)&&a.unshift(this),Je(i)&&g.unshift(i),i=a.length;var C=g.length;if(i===0||C===0||a[i-1]!==g[C-1])return null;for(g=new Set(g),C=0;C<i;C++){let x=a[C];if(g.has(x))return x}return null}is(i){return i==null?!1:this.__key===i.__key}isBefore(i){if(this===i)return!1;if(i.isParentOf(this))return!0;if(this.isParentOf(i))return!1;var a=this.getCommonAncestor(i);let g=this;for(;;){var C=g.getParentOrThrow();if(C===a){C=g.getIndexWithinParent();break}g=C}for(g=i;;){if(i=g.getParentOrThrow(),i===a){a=g.getIndexWithinParent();break}g=i}return C<a}isParentOf(i){let a=this.__key;if(a===i.__key)return!1;for(;i!==null;){if(i.__key===a)return!0;i=i.getParent()}return!1}getNodesBetween(i){let a=this.isBefore(i),g=[],C=new Set;for(var x=this;;){var D=x.__key;if(C.has(D)||(C.add(D),g.push(x)),x===i)break;if(D=Je(x)?a?x.getFirstChild():x.getLastChild():null,D!==null)x=D;else if(D=a?x.getNextSibling():x.getPreviousSibling(),D!==null)x=D;else{if(x=x.getParentOrThrow(),C.has(x.__key)||g.push(x),x===i)break;D=x;do D===null&&Y(68),x=a?D.getNextSibling():D.getPreviousSibling(),D=D.getParent(),D!==null&&(x!==null||C.has(D.__key)||g.push(D));while(x===null)}}return a||g.reverse(),g}isDirty(){let i=hn()._dirtyLeaves;return i!==null&&i.has(this.__key)}getLatest(){let i=mt(this.__key);return i===null&&Y(113),i}getWritable(){Jn();var i=Br(),a=hn();i=i._nodeMap;let g=this.__key,C=this.getLatest(),x=C.__parent;a=a._cloneNotNeeded;var D=Vt();return Hs(D)&&D.setCachedNodes(null),a.has(g)?(Et(C),C):(D=C.constructor.clone(C),D.__parent=x,D.__next=C.__next,D.__prev=C.__prev,Je(C)&&Je(D)?(D.__first=C.__first,D.__last=C.__last,D.__size=C.__size,D.__indent=C.__indent,D.__format=C.__format,D.__dir=C.__dir):Ct(C)&&Ct(D)&&(D.__format=C.__format,D.__style=C.__style,D.__mode=C.__mode,D.__detail=C.__detail),a.add(g),D.__key=g,Et(D),i.set(g,D),D)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){Y(70)}updateDOM(){Y(71)}exportDOM(i){return{element:this.createDOM(i._config,i)}}exportJSON(){Y(72)}static importJSON(){Y(18,this.name)}static transform(){return null}remove(i){vl(this,!0,i)}replace(i,a){Jn();var g=Vt();g!==null&&(g=g.clone()),Os(this,i);let C=this.getLatest(),x=this.__key,D=i.__key,Q=i.getWritable();i=this.getParentOrThrow().getWritable();let ge=i.__size;Nt(Q);let Ae=C.getPreviousSibling(),Ye=C.getNextSibling(),Xe=C.__prev,Ke=C.__next,Pe=C.__parent;if(vl(C,!1,!0),Ae===null?i.__first=D:Ae.getWritable().__next=D,Q.__prev=Xe,Ye===null?i.__last=D:Ye.getWritable().__prev=D,Q.__next=Ke,Q.__parent=Pe,i.__size=ge,a){if(!Je(this)||!Je(Q))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(pt=>{Q.append(pt)})}return Mt(g)&&(nn(g),a=g.anchor,g=g.focus,a.key===x&&si(a,Q),g.key===x&&si(g,Q)),xt()===x&>(D),Q}insertAfter(i,a=!0){Jn(),Os(this,i);var g=this.getWritable();let C=i.getWritable();var x=C.getParent();let D=Vt();var Q=!1,ge=!1;if(x!==null){var Ae=i.getIndexWithinParent();Nt(C),Mt(D)&&(ge=x.__key,Q=D.anchor,x=D.focus,Q=Q.type==="element"&&Q.key===ge&&Q.offset===Ae+1,ge=x.type==="element"&&x.key===ge&&x.offset===Ae+1)}x=this.getNextSibling(),Ae=this.getParentOrThrow().getWritable();let Ye=C.__key,Xe=g.__next;return x===null?Ae.__last=Ye:x.getWritable().__prev=Ye,Ae.__size++,g.__next=Ye,C.__next=Xe,C.__prev=g.__key,C.__parent=g.__parent,a&&Mt(D)&&(a=this.getIndexWithinParent(),Hn(D,Ae,a+1),g=Ae.__key,Q&&D.anchor.set(g,a+2,"element"),ge&&D.focus.set(g,a+2,"element")),i}insertBefore(i,a=!0){Jn(),Os(this,i);var g=this.getWritable();let C=i.getWritable(),x=C.__key;Nt(C);let D=this.getPreviousSibling(),Q=this.getParentOrThrow().getWritable(),ge=g.__prev,Ae=this.getIndexWithinParent();return D===null?Q.__first=x:D.getWritable().__next=x,Q.__size++,g.__prev=x,C.__prev=ge,C.__next=g.__key,C.__parent=g.__parent,g=Vt(),a&&Mt(g)&&(a=this.getParentOrThrow(),Hn(g,a,Ae)),i}isParentRequired(){return!1}createParentElementNode(){return Wr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(i,a){Jn();let g=this.getPreviousSibling(),C=this.getParentOrThrow();return g===null?C.select(0,0):Je(g)?g.select():Ct(g)?g.select(i,a):(i=g.getIndexWithinParent()+1,C.select(i,i))}selectNext(i,a){Jn();let g=this.getNextSibling(),C=this.getParentOrThrow();return g===null?C.select():Je(g)?g.select(0,0):Ct(g)?g.select(i,a):(i=g.getIndexWithinParent(),C.select(i,i))}markDirty(){this.getWritable()}}function kc(o,i,a){a=a||i.getParentOrThrow().getLastChild();let g=i;for(i=[i];g!==a;){if(!g.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");g=g.getNextSibling(),i.push(g)}for(let C of i)o=o.insertAfter(C)}class qr extends $s{static getType(){return"linebreak"}static clone(i){return new qr(i.__key)}constructor(i){super(i)}getTextContent(){return`
|
|
63
|
-
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:i=>{let a=i.parentElement,g,C;return a!==null&&((g=a.firstChild)===i||g.nextSibling===i&&g.nodeType===3&&(g.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((C=a.lastChild)===i||C.previousSibling===i&&C.nodeType===3&&(C.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:
|
|
61
|
+
`?(o.preventDefault(),ct(i,l,void 0)):x==null&&o.dataTransfer?(x=o.dataTransfer.getData("text/plain"),o.preventDefault(),C.insertRawText(x)):x!=null&&Ea(C,g,x,o.timeStamp,!0)?(o.preventDefault(),ct(i,d,x)):ss=x,Na=o.timeStamp;else switch(o.preventDefault(),a){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":ct(i,d,o);break;case"insertFromComposition":gt(null),ct(i,d,o);break;case"insertLineBreak":gt(null),ct(i,r,!1);break;case"insertParagraph":gt(null),Is&&!_e?(Is=!1,ct(i,r,!1)):ct(i,l,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":ct(i,f,o);break;case"deleteByComposition":Lc(Q,A)&&ct(i,p,o);break;case"deleteByDrag":case"deleteByCut":ct(i,p,o);break;case"deleteContent":ct(i,n,!1);break;case"deleteWordBackward":ct(i,_,!0);break;case"deleteWordForward":ct(i,_,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":ct(i,E,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":ct(i,E,!1);break;case"formatStrikeThrough":ct(i,T,"strikethrough");break;case"formatBold":ct(i,T,"bold");break;case"formatItalic":ct(i,T,"italic");break;case"formatUnderline":ct(i,T,"underline");break;case"historyUndo":ct(i,S,void 0);break;case"historyRedo":ct(i,w,void 0)}}})}function Sa(o,i){o.stopPropagation(),Tr(i,()=>{var a=qt(),g=o.data,C=va(o);if(g!=null&&Mt(a)&&Ea(a,C,g,o.timeStamp,!1)){ks&&(xl(i,g),ks=!1);var x=a.anchor,A=x.getNode();if(C=jr(i._window),C===null)return;let Q=x.offset;(x=X&&!a.isCollapsed()&&Ct(A)&&C.anchorNode!==null)&&(A=A.getTextContent().slice(0,Q)+g+A.getTextContent().slice(Q+a.focus.offset),C=C.anchorNode,x=A===(C.nodeType===3?C.nodeValue:null)),x||ct(i,d,g),g=g.length,U&&1<g&&o.inputType==="insertCompositionText"&&!i.isComposing()&&(a.anchor.offset-=g),fe||_e||F||!i.isComposing()||(bs=0,gt(null))}else lt(!1,i,g!==null?g:void 0),ks&&(xl(i,g||void 0),ks=!1);Jn(),a=hn(),tn(a)}),ss=null}function wa(o,i){Tr(i,()=>{let a=qt();if(Mt(a)&&!i.isComposing()){let g=a.anchor,C=a.anchor.getNode();gt(g.key),(o.timeStamp<bs+30||g.type==="element"||!a.isCollapsed()||C.getFormat()!==a.format||Ct(C)&&C.getStyle()!==a.style)&&ct(i,d,ye)}})}function xl(o,i){var a=o._compositionKey;if(gt(null),a!==null&&i!=null){if(i===""){i=mt(a),o=ze(o.getElementByKey(a)),o!==null&&o.nodeValue!==null&&Ct(i)&&wt(i,o.nodeValue,null,null,!0);return}if(i[i.length-1]===`
|
|
62
|
+
`&&(a=qt(),Mt(a))){i=a.focus,a.anchor.set(i.key,i.offset,i.type),ct(o,H,null);return}}lt(!0,o,i)}function kc(o,i){U?ks=!0:Tr(i,()=>{xl(i,o.data)})}function Pc(o,i){if(bs=o.timeStamp,ya=o.keyCode,!i.isComposing()){var{keyCode:a,shiftKey:g,ctrlKey:C,metaKey:x,altKey:A}=o;if(!ct(i,O,o)){if(a!==39||C||x||A)if(a!==39||A||g||!C&&!x)if(a!==37||C||x||A)if(a!==37||A||g||!C&&!x)if(a!==38||C||x)if(a!==40||C||x)if(a===13&&g)Is=!0,ct(i,H,o);else if(a===32)ct(i,j,o);else if(R&&C&&a===79)o.preventDefault(),Is=!0,ct(i,r,!0);else if(a!==13||g){var Q=R?A||x?!1:a===8||a===72&&C:C||A||x?!1:a===8;Q?a===8?ct(i,re,o):(o.preventDefault(),ct(i,n,!0)):a===27?ct(i,te,o):(Q=R?g||A||x?!1:a===46||a===68&&C:C||A||x?!1:a===46,Q?a===46?ct(i,ce,o):(o.preventDefault(),ct(i,n,!1)):a===8&&(R?A:C)?(o.preventDefault(),ct(i,_,!0)):a===46&&(R?A:C)?(o.preventDefault(),ct(i,_,!1)):R&&x&&a===8?(o.preventDefault(),ct(i,E,!0)):R&&x&&a===46?(o.preventDefault(),ct(i,E,!1)):a===66&&!A&&(R?x:C)?(o.preventDefault(),ct(i,T,"bold")):a===85&&!A&&(R?x:C)?(o.preventDefault(),ct(i,T,"underline")):a===73&&!A&&(R?x:C)?(o.preventDefault(),ct(i,T,"italic")):a!==9||A||C||x?a===90&&!g&&(R?x:C)?(o.preventDefault(),ct(i,S,void 0)):(Q=R?a===90&&x&&g:a===89&&C||a===90&&C&&g,Q?(o.preventDefault(),ct(i,w,void 0)):ar(i._editorState._selection)?(Q=g?!1:a===67?R?x:C:!1,Q?(o.preventDefault(),ct(i,Ee,o)):(Q=g?!1:a===88?R?x:C:!1,Q?(o.preventDefault(),ct(i,de,o)):a===65&&(R?x:C)&&(o.preventDefault(),ct(i,K,o)))):!U&&a===65&&(R?x:C)&&(o.preventDefault(),ct(i,K,o))):ct(i,V,o))}else Is=!1,ct(i,H,o);else ct(i,P,o);else ct(i,k,o);else ct(i,G,o);else ct(i,I,o);else ct(i,v,o);else ct(i,m,o);(C||g||A||x)&&ct(i,oe,o)}}}function Oa(o){let i=o.__lexicalEventHandles;return i===void 0&&(i=[],o.__lexicalEventHandles=i),i}let os=new Map;function Da(o){var i=o.target;let a=jr(i==null?null:i.nodeType===9?i.defaultView:i.ownerDocument.defaultView);if(a!==null){var g=St(a.anchorNode);if(g!==null){Tl&&(Tl=!1,Tr(g,()=>{var Q=Er(),ge=a.anchorNode;ge!==null&&(ge=ge.nodeType,ge===1||ge===3)&&(Q=Gn(Q,a,g,o),rn(Q))})),i=pe(g),i=i[i.length-1];var C=i._key,x=os.get(C),A=x||i;A!==g&&xa(a,A,!1),xa(a,g,!0),g!==i?os.set(C,g):x&&os.delete(C)}}}function $c(o,i){Ls===0&&o.ownerDocument.addEventListener("selectionchange",Da),Ls++,o.__lexicalEditor=i;let a=Oa(o);for(let g=0;g<Cl.length;g++){let[C,x]=Cl[g],A=typeof x=="function"?Q=>{Q._lexicalHandled!==!0&&(Q._lexicalHandled=!0,i.isEditable()&&x(Q,i))}:Q=>{if(Q._lexicalHandled!==!0&&(Q._lexicalHandled=!0,i.isEditable()))switch(C){case"cut":return ct(i,de,Q);case"copy":return ct(i,Ee,Q);case"paste":return ct(i,f,Q);case"dragstart":return ct(i,q,Q);case"dragover":return ct(i,Te,Q);case"dragend":return ct(i,Se,Q);case"focus":return ct(i,D,Q);case"blur":return ct(i,Z,Q);case"drop":return ct(i,z,Q)}};o.addEventListener(C,A),a.push(()=>{o.removeEventListener(C,A)})}}function vl(o,i,a){Jn();var g=o.__key;let C=o.getParent();if(C!==null){var x=qt();if(Mt(x)&&Je(o)){var{anchor:A,focus:Q}=x,ge=A.getNode(),Ae=Q.getNode();Zn(ge,o)&&A.set(o.__key,0,"element"),Zn(Ae,o)&&Q.set(o.__key,0,"element")}if(ge=x,Ae=!1,Mt(ge)&&i){x=ge.anchor;let Ye=ge.focus;x.key===g&&(us(x,o,C,o.getPreviousSibling(),o.getNextSibling()),Ae=!0),Ye.key===g&&(us(Ye,o,C,o.getPreviousSibling(),o.getNextSibling()),Ae=!0)}else ar(ge)&&i&&o.isSelected()&&o.selectPrevious();Mt(ge)&&i&&!Ae?(g=o.getIndexWithinParent(),Nt(o),Hn(ge,C,g,-1)):Nt(o),a||or(C)||C.canBeEmpty()||!C.isEmpty()||vl(C,i),i&&nr(C)&&C.isEmpty()&&C.selectEnd()}}class Ps{static getType(){Y(64,this.name)}static clone(){Y(65,this.name)}constructor(i){this.__type=this.constructor.getType(),this.__next=this.__prev=this.__parent=null,yt(this,i)}getType(){return this.__type}isInline(){throw Error(`LexicalNode: Node ${this.constructor.name} does not implement .isInline().`)}isAttached(){for(var i=this.__key;i!==null;){if(i==="root")return!0;if(i=mt(i),i===null)break;i=i.__parent}return!1}isSelected(i){if(i=i||qt(),i==null)return!1;let a=i.getNodes().some(g=>g.__key===this.__key);return Ct(this)?a:Mt(i)&&i.anchor.type==="element"&&i.focus.type==="element"&&i.anchor.key===i.focus.key&&i.anchor.offset===i.focus.offset?!1:a}getKey(){return this.__key}getIndexWithinParent(){var i=this.getParent();if(i===null)return-1;i=i.getFirstChild();let a=0;for(;i!==null;){if(this.is(i))return a;a++,i=i.getNextSibling()}return-1}getParent(){let i=this.getLatest().__parent;return i===null?null:mt(i)}getParentOrThrow(){let i=this.getParent();return i===null&&Y(66,this.__key),i}getTopLevelElement(){let i=this;for(;i!==null;){let a=i.getParent();if(or(a)){if(!Je(i))throw Error("Children of root nodes must be elements");return i}i=a}return null}getTopLevelElementOrThrow(){let i=this.getTopLevelElement();return i===null&&Y(67,this.__key),i}getParents(){let i=[],a=this.getParent();for(;a!==null;)i.push(a),a=a.getParent();return i}getParentKeys(){let i=[],a=this.getParent();for(;a!==null;)i.push(a.__key),a=a.getParent();return i}getPreviousSibling(){let i=this.getLatest().__prev;return i===null?null:mt(i)}getPreviousSiblings(){let i=[];var a=this.getParent();if(a===null)return i;for(a=a.getFirstChild();a!==null&&!a.is(this);)i.push(a),a=a.getNextSibling();return i}getNextSibling(){let i=this.getLatest().__next;return i===null?null:mt(i)}getNextSiblings(){let i=[],a=this.getNextSibling();for(;a!==null;)i.push(a),a=a.getNextSibling();return i}getCommonAncestor(i){let a=this.getParents();var g=i.getParents();Je(this)&&a.unshift(this),Je(i)&&g.unshift(i),i=a.length;var C=g.length;if(i===0||C===0||a[i-1]!==g[C-1])return null;for(g=new Set(g),C=0;C<i;C++){let x=a[C];if(g.has(x))return x}return null}is(i){return i==null?!1:this.__key===i.__key}isBefore(i){if(this===i)return!1;if(i.isParentOf(this))return!0;if(this.isParentOf(i))return!1;var a=this.getCommonAncestor(i);let g=this;for(;;){var C=g.getParentOrThrow();if(C===a){C=g.getIndexWithinParent();break}g=C}for(g=i;;){if(i=g.getParentOrThrow(),i===a){a=g.getIndexWithinParent();break}g=i}return C<a}isParentOf(i){let a=this.__key;if(a===i.__key)return!1;for(;i!==null;){if(i.__key===a)return!0;i=i.getParent()}return!1}getNodesBetween(i){let a=this.isBefore(i),g=[],C=new Set;for(var x=this;;){var A=x.__key;if(C.has(A)||(C.add(A),g.push(x)),x===i)break;if(A=Je(x)?a?x.getFirstChild():x.getLastChild():null,A!==null)x=A;else if(A=a?x.getNextSibling():x.getPreviousSibling(),A!==null)x=A;else{if(x=x.getParentOrThrow(),C.has(x.__key)||g.push(x),x===i)break;A=x;do A===null&&Y(68),x=a?A.getNextSibling():A.getPreviousSibling(),A=A.getParent(),A!==null&&(x!==null||C.has(A.__key)||g.push(A));while(x===null)}}return a||g.reverse(),g}isDirty(){let i=hn()._dirtyLeaves;return i!==null&&i.has(this.__key)}getLatest(){let i=mt(this.__key);return i===null&&Y(113),i}getWritable(){Jn();var i=Br(),a=hn();i=i._nodeMap;let g=this.__key,C=this.getLatest(),x=C.__parent;a=a._cloneNotNeeded;var A=qt();return Bs(A)&&A.setCachedNodes(null),a.has(g)?(Et(C),C):(A=C.constructor.clone(C),A.__parent=x,A.__next=C.__next,A.__prev=C.__prev,Je(C)&&Je(A)?(A.__first=C.__first,A.__last=C.__last,A.__size=C.__size,A.__indent=C.__indent,A.__format=C.__format,A.__dir=C.__dir):Ct(C)&&Ct(A)&&(A.__format=C.__format,A.__style=C.__style,A.__mode=C.__mode,A.__detail=C.__detail),a.add(g),A.__key=g,Et(A),i.set(g,A),A)}getTextContent(){return""}getTextContentSize(){return this.getTextContent().length}createDOM(){Y(70)}updateDOM(){Y(71)}exportDOM(i){return{element:this.createDOM(i._config,i)}}exportJSON(){Y(72)}static importJSON(){Y(18,this.name)}static transform(){return null}remove(i){vl(this,!0,i)}replace(i,a){Jn();var g=qt();g!==null&&(g=g.clone()),ws(this,i);let C=this.getLatest(),x=this.__key,A=i.__key,Q=i.getWritable();i=this.getParentOrThrow().getWritable();let ge=i.__size;Nt(Q);let Ae=C.getPreviousSibling(),Ye=C.getNextSibling(),Xe=C.__prev,Ke=C.__next,Pe=C.__parent;if(vl(C,!1,!0),Ae===null?i.__first=A:Ae.getWritable().__next=A,Q.__prev=Xe,Ye===null?i.__last=A:Ye.getWritable().__prev=A,Q.__next=Ke,Q.__parent=Pe,i.__size=ge,a){if(!Je(this)||!Je(Q))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(pt=>{Q.append(pt)})}return Mt(g)&&(rn(g),a=g.anchor,g=g.focus,a.key===x&&si(a,Q),g.key===x&&si(g,Q)),xt()===x&>(A),Q}insertAfter(i,a=!0){Jn(),ws(this,i);var g=this.getWritable();let C=i.getWritable();var x=C.getParent();let A=qt();var Q=!1,ge=!1;if(x!==null){var Ae=i.getIndexWithinParent();Nt(C),Mt(A)&&(ge=x.__key,Q=A.anchor,x=A.focus,Q=Q.type==="element"&&Q.key===ge&&Q.offset===Ae+1,ge=x.type==="element"&&x.key===ge&&x.offset===Ae+1)}x=this.getNextSibling(),Ae=this.getParentOrThrow().getWritable();let Ye=C.__key,Xe=g.__next;return x===null?Ae.__last=Ye:x.getWritable().__prev=Ye,Ae.__size++,g.__next=Ye,C.__next=Xe,C.__prev=g.__key,C.__parent=g.__parent,a&&Mt(A)&&(a=this.getIndexWithinParent(),Hn(A,Ae,a+1),g=Ae.__key,Q&&A.anchor.set(g,a+2,"element"),ge&&A.focus.set(g,a+2,"element")),i}insertBefore(i,a=!0){Jn(),ws(this,i);var g=this.getWritable();let C=i.getWritable(),x=C.__key;Nt(C);let A=this.getPreviousSibling(),Q=this.getParentOrThrow().getWritable(),ge=g.__prev,Ae=this.getIndexWithinParent();return A===null?Q.__first=x:A.getWritable().__next=x,Q.__size++,g.__prev=x,C.__prev=ge,C.__next=g.__key,C.__parent=g.__parent,g=qt(),a&&Mt(g)&&(a=this.getParentOrThrow(),Hn(g,a,Ae)),i}isParentRequired(){return!1}createParentElementNode(){return Wr()}selectStart(){return this.selectPrevious()}selectEnd(){return this.selectNext(0,0)}selectPrevious(i,a){Jn();let g=this.getPreviousSibling(),C=this.getParentOrThrow();return g===null?C.select(0,0):Je(g)?g.select():Ct(g)?g.select(i,a):(i=g.getIndexWithinParent()+1,C.select(i,i))}selectNext(i,a){Jn();let g=this.getNextSibling(),C=this.getParentOrThrow();return g===null?C.select():Je(g)?g.select(0,0):Ct(g)?g.select(i,a):(i=g.getIndexWithinParent(),C.select(i,i))}markDirty(){this.getWritable()}}function Fc(o,i,a){a=a||i.getParentOrThrow().getLastChild();let g=i;for(i=[i];g!==a;){if(!g.getNextSibling())throw Error("insertRangeAfter: lastToInsert must be a later sibling of firstToInsert");g=g.getNextSibling(),i.push(g)}for(let C of i)o=o.insertAfter(C)}class qr extends Ps{static getType(){return"linebreak"}static clone(i){return new qr(i.__key)}constructor(i){super(i)}getTextContent(){return`
|
|
63
|
+
`}createDOM(){return document.createElement("br")}updateDOM(){return!1}static importDOM(){return{br:i=>{let a=i.parentElement,g,C;return a!==null&&((g=a.firstChild)===i||g.nextSibling===i&&g.nodeType===3&&(g.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)&&((C=a.lastChild)===i||C.previousSibling===i&&C.nodeType===3&&(C.textContent||"").match(/^( |\t|\r?\n)+$/)!==null)?null:{conversion:Aa,priority:0}}}}static importJSON(){return Zr()}exportJSON(){return{type:"linebreak",version:1}}}function Aa(){return{node:Zr()}}function Zr(){return Nr(new qr)}function Ii(o){return o instanceof qr}function ki(o,i){return i&16?"code":i&128?"mark":i&32?"sub":i&64?"sup":null}function _o(o,i){return i&1?"strong":i&2?"em":"span"}function Sl(o,i,a,g,C){o=g.classList,g=Bt(C,"base"),g!==void 0&&o.add(...g),g=Bt(C,"underlineStrikethrough");let x=!1,A=i&8&&i&4;var Q=a&8&&a&4;g!==void 0&&(Q?(x=!0,A||o.add(...g)):A&&o.remove(...g));for(let ge in ne)Q=ne[ge],g=Bt(C,ge),g!==void 0&&(a&Q?!x||ge!=="underline"&&ge!=="strikethrough"?(!(i&Q)||A&&ge==="underline"||ge==="strikethrough")&&o.add(...g):i&Q&&o.remove(...g):i&Q&&o.remove(...g))}function Pi(o,i,a){let g=i.firstChild;if(a=a.isComposing(),o+=a?se:"",g==null)i.textContent=o;else if(i=g.nodeValue,i!==o)if(a||U){a=i.length;let C=o.length,x=0,A=0;for(;x<a&&x<C&&i[x]===o[x];)x++;for(;A+x<a&&A+x<C&&i[a-A-1]===o[C-A-1];)A++;o=[x,a-x-A,o.slice(x,C-A)];let[Q,ge,Ae]=o;ge!==0&&g.deleteData(Q,ge),g.insertData(Q,Ae)}else g.nodeValue=o}function ls(o,i){return i=document.createElement(i),i.appendChild(o),i}class $i extends Ps{static getType(){return"text"}static clone(i){return new $i(i.__text,i.__key)}constructor(i,a){super(a),this.__text=i,this.__format=0,this.__style="",this.__detail=this.__mode=0}getFormat(){return this.getLatest().__format}getDetail(){return this.getLatest().__detail}getMode(){let i=this.getLatest();return ke[i.__mode]}getStyle(){return this.getLatest().__style}isToken(){return this.getLatest().__mode===1}isComposing(){return this.__key===xt()}isSegmented(){return this.getLatest().__mode===2}isDirectionless(){return(this.getLatest().__detail&1)!==0}isUnmergeable(){return(this.getLatest().__detail&2)!==0}hasFormat(i){return i=ne[i],(this.getFormat()&i)!==0}isSimpleText(){return this.__type==="text"&&this.__mode===0}getTextContent(){return this.getLatest().__text}getFormatFlags(i,a){let g=this.getLatest().__format;return tt(g,i,a)}createDOM(i){var a=this.__format,g=ki(this,a);let C=_o(this,a),x=document.createElement(g===null?C:g),A=x;return this.hasFormat("code")&&x.setAttribute("spellcheck","false"),g!==null&&(A=document.createElement(C),x.appendChild(A)),g=A,Pi(this.__text,g,this),i=i.theme.text,i!==void 0&&Sl(C,0,a,g,i),a=this.__style,a!==""&&(x.style.cssText=a),x}updateDOM(i,a,g){let C=this.__text;var x=i.__format,A=this.__format,Q=ki(this,x);let ge=ki(this,A);var Ae=_o(this,x);let Ye=_o(this,A);return(Q===null?Ae:Q)!==(ge===null?Ye:ge)?!0:Q===ge&&Ae!==Ye?(x=a.firstChild,x==null&&Y(48),i=Q=document.createElement(Ye),Pi(C,i,this),g=g.theme.text,g!==void 0&&Sl(Ye,0,A,i,g),a.replaceChild(Q,x),!1):(Ae=a,ge!==null&&Q!==null&&(Ae=a.firstChild,Ae==null&&Y(49)),Pi(C,Ae,this),g=g.theme.text,g!==void 0&&x!==A&&Sl(Ye,x,A,Ae,g),A=this.__style,i.__style!==A&&(a.style.cssText=A),!1)}static importDOM(){return{"#text":()=>({conversion:dt,priority:0}),b:()=>({conversion:wl,priority:0}),code:()=>({conversion:yi,priority:0}),em:()=>({conversion:yi,priority:0}),i:()=>({conversion:yi,priority:0}),s:()=>({conversion:yi,priority:0}),span:()=>({conversion:Ma,priority:0}),strong:()=>({conversion:yi,priority:0}),sub:()=>({conversion:yi,priority:0}),sup:()=>({conversion:yi,priority:0}),u:()=>({conversion:yi,priority:0})}}static importJSON(i){let a=Un(i.text);return a.setFormat(i.format),a.setDetail(i.detail),a.setMode(i.mode),a.setStyle(i.style),a}exportDOM(i){return{element:i}=super.exportDOM(i),i!==null&&ho(i)||Y(132),i.style.whiteSpace="pre-wrap",this.hasFormat("bold")&&(i=ls(i,"b")),this.hasFormat("italic")&&(i=ls(i,"i")),this.hasFormat("strikethrough")&&(i=ls(i,"s")),this.hasFormat("underline")&&(i=ls(i,"u")),{element:i}}exportJSON(){return{detail:this.getDetail(),format:this.getFormat(),mode:this.getMode(),style:this.getStyle(),text:this.getTextContent(),type:"text",version:1}}selectionTransform(){}setFormat(i){let a=this.getWritable();return a.__format=typeof i=="string"?ne[i]:i,a}setDetail(i){let a=this.getWritable();return a.__detail=typeof i=="string"?ue[i]:i,a}setStyle(i){let a=this.getWritable();return a.__style=i,a}toggleFormat(i){let a=this.getFormat();return i=tt(a,i,null),this.setFormat(i)}toggleDirectionless(){let i=this.getWritable();return i.__detail^=1,i}toggleUnmergeable(){let i=this.getWritable();return i.__detail^=2,i}setMode(i){if(i=Re[i],this.__mode===i)return this;let a=this.getWritable();return a.__mode=i,a}setTextContent(i){if(this.__text===i)return this;let a=this.getWritable();return a.__text=i,a}select(i,a){Jn();let g=qt();var C=this.getTextContent();let x=this.__key;if(typeof C=="string"?(C=C.length,i===void 0&&(i=C),a===void 0&&(a=C)):a=i=0,Mt(g))C=xt(),C!==g.anchor.key&&C!==g.focus.key||gt(x),g.setTextNodeRange(this,i,this,a);else return Al(x,i,x,a,"text","text");return g}selectStart(){return this.select(0,0)}selectEnd(){let i=this.getTextContentSize();return this.select(i,i)}spliceText(i,a,g,C){let x=this.getWritable(),A=x.__text,Q=g.length,ge=i;0>ge&&(ge=Q+ge,0>ge&&(ge=0));let Ae=qt();return C&&Mt(Ae)&&(i+=Q,Ae.setTextNodeRange(x,i,x,i)),a=A.slice(0,ge)+g+A.slice(ge+a),x.__text=a,x}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}splitText(...i){Jn();var a=this.getLatest(),g=a.getTextContent(),C=a.__key,x=xt(),A=new Set(i);i=[];for(var Q=g.length,ge="",Ae=0;Ae<Q;Ae++)ge!==""&&A.has(Ae)&&(i.push(ge),ge=""),ge+=g[Ae];if(ge!==""&&i.push(ge),A=i.length,A===0)return[];if(i[0]===g)return[a];var Ye=i[0];g=a.getParentOrThrow(),Ae=a.getFormat();let Xe=a.getStyle(),Ke=a.__detail;Q=!1,a.isSegmented()?(ge=Un(Ye),ge.__format=Ae,ge.__style=Xe,ge.__detail=Ke,Q=!0):(ge=a.getWritable(),ge.__text=Ye),a=qt(),ge=[ge],Ye=Ye.length;for(let Ot=1;Ot<A;Ot++){var Pe=i[Ot],pt=Pe.length;Pe=Un(Pe).getWritable(),Pe.__format=Ae,Pe.__style=Xe,Pe.__detail=Ke;let Ft=Pe.__key;if(pt=Ye+pt,Mt(a)){let zt=a.anchor,Yn=a.focus;zt.key===C&&zt.type==="text"&&zt.offset>Ye&&zt.offset<=pt&&(zt.key=Ft,zt.offset-=Ye,a.dirty=!0),Yn.key===C&&Yn.type==="text"&&Yn.offset>Ye&&Yn.offset<=pt&&(Yn.key=Ft,Yn.offset-=Ye,a.dirty=!0)}x===C&>(Ft),Ye=pt,ge.push(Pe)}return C=this.getPreviousSibling(),x=this.getNextSibling(),C!==null&&Et(C),x!==null&&Et(x),C=g.getWritable(),x=this.getIndexWithinParent(),Q?(C.splice(x,0,ge),this.remove()):C.splice(x,1,ge),Mt(a)&&Hn(a,g,x,A-1),ge}mergeWithSibling(i){var a=i===this.getPreviousSibling();a||i===this.getNextSibling()||Y(50);var g=this.__key;let C=i.__key,x=this.__text,A=x.length;xt()===C&>(g);let Q=qt();if(Mt(Q)){let ge=Q.anchor,Ae=Q.focus;ge!==null&&ge.key===C&&(Ws(ge,a,g,i,A),Q.dirty=!0),Ae!==null&&Ae.key===C&&(Ws(Ae,a,g,i,A),Q.dirty=!0)}return g=i.__text,this.setTextContent(a?g+x:x+g),a=this.getWritable(),i.remove(),a}isTextEntity(){return!1}}function Ma(o){let i=o.style.fontWeight==="700",a=o.style.textDecoration==="line-through",g=o.style.fontStyle==="italic",C=o.style.textDecoration==="underline",x=o.style.verticalAlign;return{forChild:A=>(Ct(A)&&(i&&A.toggleFormat("bold"),a&&A.toggleFormat("strikethrough"),g&&A.toggleFormat("italic"),C&&A.toggleFormat("underline"),x==="sub"&&A.toggleFormat("subscript"),x==="super"&&A.toggleFormat("superscript")),A),node:null}}function wl(o){let i=o.style.fontWeight==="normal";return{forChild:a=>(Ct(a)&&!i&&a.toggleFormat("bold"),a),node:null}}let Ol=new WeakMap;function dt(o){o.parentElement===null&&Y(129);for(var i=o.textContent||"",a,g=o.parentNode,C=[o];g!==null&&(a=Ol.get(g))===void 0&&!(g.nodeName==="PRE"||g.nodeType===1&&g.style!==void 0&&g.style.whiteSpace!==void 0&&g.style.whiteSpace.startsWith("pre"));)C.push(g),g=g.parentNode;for(a=a===void 0?g:a,g=0;g<C.length;g++)Ol.set(C[g],a);if(a!==null){for(i=i.split(/(\r?\n|\t)/),o=[],C=i.length,a=0;a<C;a++)g=i[a],g===`
|
|
64
64
|
`||g===`\r
|
|
65
|
-
`?o.push(Zr()):g===" "?o.push(
|
|
66
|
-
`),Ye=!Ke.isEmpty();else if(Ye=!1,Ct(Ke)){let Pe=Ke.getTextContent();Ke===a?Ke===g?(C.type!=="element"||x.type!=="element"||x.offset===C.offset)&&(Pe=Q<ge?Pe.slice(Q,ge):Pe.slice(ge,Q)):Pe=
|
|
65
|
+
`?o.push(Zr()):g===" "?o.push(Fi()):g!==""&&o.push(Un(g));return{node:o}}if(i=i.replace(/\r/g,"").replace(/[ \t\n]+/g," "),i==="")return{node:null};if(i[0]===" "){for(C=o,a=!0;C!==null&&(C=$s(C,!1))!==null;)if(g=C.textContent||"",0<g.length){/[ \t\n]$/.test(g)&&(i=i.slice(1)),a=!1;break}a&&(i=i.slice(1))}if(i[i.length-1]===" "){for(C=!0;o!==null&&(o=$s(o,!0))!==null;)if(0<(o.textContent||"").replace(/^( |\t|\r?\n)+/,"").length){C=!1;break}C&&(i=i.slice(0,i.length-1))}return i===""?{node:null}:{node:Un(i)}}let yo=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)$/,"i");function $s(o,i){for(;;){for(var a=void 0;(a=i?o.nextSibling:o.previousSibling)===null;)if(o=o.parentElement,o===null)return null;if(o=a,o.nodeType===1&&(a=o.style.display,a===""&&o.nodeName.match(yo)===null||a!==""&&!a.startsWith("inline")))return null;for(;(a=i?o.firstChild:o.lastChild)!==null;)o=a;if(o.nodeType===3)return o;if(o.nodeName==="BR")return null}}let No={code:"code",em:"italic",i:"italic",s:"strikethrough",strong:"bold",sub:"subscript",sup:"superscript",u:"underline"};function yi(o){let i=No[o.nodeName.toLowerCase()];return i===void 0?{node:null}:{forChild:a=>(Ct(a)&&!a.hasFormat(i)&&a.toggleFormat(i),a),node:null}}function Un(o=""){return Nr(new $i(o))}function Ct(o){return o instanceof $i}class as extends $i{static getType(){return"tab"}static clone(i){let a=new as(i.__key);return a.__text=i.__text,a.__format=i.__format,a.__style=i.__style,a}constructor(i){super(" ",i),this.__detail=2}static importDOM(){return null}static importJSON(i){let a=Fi();return a.setFormat(i.format),a.setStyle(i.style),a}exportJSON(){return{...super.exportJSON(),type:"tab",version:1}}setTextContent(){Y(126)}setDetail(){Y(127)}setMode(){Y(128)}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}}function Fi(){return Nr(new as)}function Ra(o){return o instanceof as}class Co{constructor(i,a,g){this._selection=null,this.key=i,this.offset=a,this.type=g}is(i){return this.key===i.key&&this.offset===i.offset&&this.type===i.type}isBefore(i){let a=this.getNode(),g=i.getNode(),C=this.offset;if(i=i.offset,Je(a)){var x=a.getDescendantByIndex(C);a=x??a}return Je(g)&&(x=g.getDescendantByIndex(i),g=x??g),a===g?C<i:a.isBefore(g)}getNode(){let i=mt(this.key);return i===null&&Y(20),i}set(i,a,g){let C=this._selection,x=this.key;this.key=i,this.offset=a,this.type=g,fs()||(xt()===x&>(i),C!==null&&(C.setCachedNodes(null),C.dirty=!0))}}function Fr(o,i,a){return new Co(o,i,a)}function Eo(o,i){let a=i.__key,g=o.offset,C="element";if(Ct(i))C="text",i=i.getTextContentSize(),g>i&&(g=i);else if(!Je(i)){var x=i.getNextSibling();Ct(x)?(a=x.__key,g=0,C="text"):(x=i.getParent())&&(a=x.__key,g=i.getIndexWithinParent()+1)}o.set(a,g,C)}function si(o,i){if(Je(i)){let a=i.getLastDescendant();Je(a)||Ct(a)?Eo(o,a):Eo(o,i)}else Eo(o,i)}function Dl(o,i,a,g){let C=o.getNode(),x=C.getChildAtIndex(o.offset),A=Un(),Q=nr(C)?Wr().append(A):A;A.setFormat(a),A.setStyle(g),x===null?C.append(Q):x.insertBefore(Q),o.is(i)&&i.set(A.__key,0,"text"),o.set(A.__key,0,"text")}function Dr(o,i,a,g){o.key=i,o.offset=a,o.type=g}class Fs{constructor(i,a){this.anchor=i,this.focus=a,i._selection=this,a._selection=this,this._cachedNodes=null,this.dirty=!1}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){return Bs(i)?this.anchor.is(i.anchor)&&this.focus.is(i.focus):!1}isCollapsed(){return!1}extract(){return this.getNodes()}isBackward(){return this.focus.isBefore(this.anchor)}getCharacterOffsets(){return xo(this)}}class To{constructor(i){this.dirty=!1,this._nodes=i,this._cachedNodes=null}getCachedNodes(){return this._cachedNodes}setCachedNodes(i){this._cachedNodes=i}is(i){if(!ar(i))return!1;let a=this._nodes,g=i._nodes;return a.size===g.size&&Array.from(a).every(C=>g.has(C))}add(i){this.dirty=!0,this._nodes.add(i),this._cachedNodes=null}delete(i){this.dirty=!0,this._nodes.delete(i),this._cachedNodes=null}clear(){this.dirty=!0,this._nodes.clear(),this._cachedNodes=null}has(i){return this._nodes.has(i)}clone(){return new To(new Set(this._nodes))}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(i){let a=this.getNodes(),g=a.length;var C=a[g-1];if(Ct(C))C=C.select();else{let x=C.getIndexWithinParent()+1;C=C.getParentOrThrow().select(x,x)}for(C.insertNodes(i),i=0;i<g;i++)a[i].remove()}getNodes(){var i=this._cachedNodes;if(i!==null)return i;var a=this._nodes;i=[];for(let g of a)a=mt(g),a!==null&&i.push(a);return fs()||(this._cachedNodes=i),i}getTextContent(){let i=this.getNodes(),a="";for(let g=0;g<i.length;g++)a+=i[g].getTextContent();return a}}function Mt(o){return o instanceof Ni}function Bs(o){return o instanceof Fs}class Ni extends Fs{constructor(i,a,g,C){super(i,a),this.format=g,this.style=C}is(i){return Mt(i)?this.anchor.is(i.anchor)&&this.focus.is(i.focus)&&this.format===i.format&&this.style===i.style:!1}isCollapsed(){return this.anchor.is(this.focus)}getNodes(){var i=this._cachedNodes;if(i!==null)return i;i=this.anchor;var a=this.focus,g=i.isBefore(a),C=g?i:a;g=g?a:i,i=C.getNode(),a=g.getNode();let x=C.offset;return C=g.offset,Je(i)&&(g=i.getDescendantByIndex(x),i=g??i),Je(a)&&(g=a.getDescendantByIndex(C),g!==null&&g!==i&&a.getChildAtIndex(C)===g&&(g=g.getPreviousSibling()),a=g??a),i=i.is(a)?Je(i)&&0<i.getChildrenSize()?[]:[i]:i.getNodesBetween(a),fs()||(this._cachedNodes=i),i}setTextNodeRange(i,a,g,C){Dr(this.anchor,i.__key,a,"text"),Dr(this.focus,g.__key,C,"text"),this._cachedNodes=null,this.dirty=!0}getTextContent(){let i=this.getNodes();if(i.length===0)return"";let a=i[0],g=i[i.length-1],C=this.anchor,x=this.focus,A=C.isBefore(x),[Q,ge]=xo(this),Ae="",Ye=!0;for(let Xe=0;Xe<i.length;Xe++){let Ke=i[Xe];if(Je(Ke)&&!Ke.isInline())Ye||(Ae+=`
|
|
66
|
+
`),Ye=!Ke.isEmpty();else if(Ye=!1,Ct(Ke)){let Pe=Ke.getTextContent();Ke===a?Ke===g?(C.type!=="element"||x.type!=="element"||x.offset===C.offset)&&(Pe=Q<ge?Pe.slice(Q,ge):Pe.slice(ge,Q)):Pe=A?Pe.slice(Q):Pe.slice(ge):Ke===g&&(Pe=A?Pe.slice(0,ge):Pe.slice(0,Q)),Ae+=Pe}else!En(Ke)&&!Ii(Ke)||Ke===g&&this.isCollapsed()||(Ae+=Ke.getTextContent())}return Ae}applyDOMRange(i){let a=hn(),g=a.getEditorState()._selection;if(i=Ia(i.startContainer,i.startOffset,i.endContainer,i.endOffset,a,g),i!==null){var[C,x]=i;Dr(this.anchor,C.key,C.offset,C.type),Dr(this.focus,x.key,x.offset,x.type),this._cachedNodes=null}}clone(){let i=this.anchor,a=this.focus;return new Ni(Fr(i.key,i.offset,i.type),Fr(a.key,a.offset,a.type),this.format,this.style)}toggleFormat(i){this.format=tt(this.format,i,null),this.dirty=!0}setStyle(i){this.style=i,this.dirty=!0}hasFormat(i){return(this.format&ne[i])!==0}insertRawText(i){i=i.split(/(\r?\n|\t)/);let a=[],g=i.length;for(let C=0;C<g;C++){let x=i[C];x===`
|
|
67
67
|
`||x===`\r
|
|
68
|
-
`?a.push(Zr()):x===" "?a.push(Bi()):a.push(Un(x))}this.insertNodes(a)}insertText(i){var a=this.anchor,g=this.focus,C=this.isCollapsed()||a.isBefore(g),x=this.format,D=this.style;C&&a.type==="element"?Dl(a,g,x,D):C||g.type!=="element"||Dl(g,a,x,D);var Q=this.getNodes(),ge=Q.length,Ae=C?g:a;g=(C?a:g).offset;var Ye=Ae.offset;a=Q[0],Ct(a)||Y(26),C=a.getTextContent().length;var Xe=a.getParentOrThrow(),Ke=Q[ge-1];if(this.isCollapsed()&&g===C&&(a.isSegmented()||a.isToken()||!a.canInsertTextAfter()||!Xe.canInsertTextAfter()&&a.getNextSibling()===null)){var Pe=a.getNextSibling();if(Ct(Pe)&&Pe.canInsertTextBefore()&&!Ge(Pe)||(Pe=Un(),Pe.setFormat(x),Xe.canInsertTextAfter()?a.insertAfter(Pe):Xe.insertAfter(Pe)),Pe.select(0,0),a=Pe,i!==""){this.insertText(i);return}}else if(this.isCollapsed()&&g===0&&(a.isSegmented()||a.isToken()||!a.canInsertTextBefore()||!Xe.canInsertTextBefore()&&a.getPreviousSibling()===null)){if(Pe=a.getPreviousSibling(),(!Ct(Pe)||Ge(Pe))&&(Pe=Un(),Pe.setFormat(x),Xe.canInsertTextBefore()?a.insertBefore(Pe):Xe.insertBefore(Pe)),Pe.select(),a=Pe,i!==""){this.insertText(i);return}}else if(a.isSegmented()&&g!==C)Xe=Un(a.getTextContent()),Xe.setFormat(x),a.replace(Xe),a=Xe;else if(!(this.isCollapsed()||i===""||(Pe=Ke.getParent(),Xe.canInsertTextBefore()&&Xe.canInsertTextAfter()&&(!Je(Pe)||Pe.canInsertTextBefore()&&Pe.canInsertTextAfter())))){this.insertText(""),xo(this.anchor,this.focus,null),this.insertText(i);return}if(ge===1)if(a.isToken())i=Un(i),i.select(),a.replace(i);else{if(Q=a.getFormat(),ge=a.getStyle(),g===Ye&&(Q!==x||ge!==D))if(a.getTextContent()==="")a.setFormat(x),a.setStyle(D);else{Q=Un(i),Q.setFormat(x),Q.setStyle(D),Q.select(),g===0?a.insertBefore(Q,!1):([ge]=a.splitText(g),ge.insertAfter(Q,!1)),Q.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length);return}else if(Ma(a)){i=Un(i),i.setFormat(x),i.setStyle(D),i.select(),a.replace(i);return}a=a.spliceText(g,Ye-g,i,!0),a.getTextContent()===""?a.remove():this.anchor.type==="text"&&(a.isComposing()?this.anchor.offset-=i.length:(this.format=Q,this.style=ge))}else{if(x=new Set([...a.getParentKeys(),...Ke.getParentKeys()]),Pe=Je(a)?a:a.getParentOrThrow(),D=Je(Ke)?Ke:Ke.getParentOrThrow(),Xe=Ke,!Pe.is(D)&&D.isInline())do Xe=D,D=D.getParentOrThrow();while(D.isInline());if(Ae.type==="text"&&(Ye!==0||Ke.getTextContent()==="")||Ae.type==="element"&&Ke.getIndexWithinParent()<Ye)if(Ct(Ke)&&!Ke.isToken()&&Ye!==Ke.getTextContentSize()){if(Ke.isSegmented()){var pt=Un(Ke.getTextContent());Ke.replace(pt),Ke=pt}nr(Ae.getNode())||Ae.type!=="text"||(Ke=Ke.spliceText(0,Ye,"")),x.add(Ke.__key)}else Ae=Ke.getParentOrThrow(),Ae.canBeEmpty()||Ae.getChildrenSize()!==1?Ke.remove():Ae.remove();else x.add(Ke.__key);for(Ae=D.getChildren(),Ye=new Set(Q),Ke=Pe.is(D),Pe=Pe.isInline()&&a.getNextSibling()===null?Pe:a,pt=Ae.length-1;0<=pt;pt--){let wt=Ae[pt];if(wt.is(a)||Je(wt)&&wt.isParentOf(a))break;wt.isAttached()&&(!Ye.has(wt)||wt.is(Xe)?Ke||Pe.insertAfter(wt,!1):wt.remove())}if(!Ke)for(Ae=D,D=null;Ae!==null;)Ye=Ae.getChildren(),Ke=Ye.length,(Ke===0||Ye[Ke-1].is(D))&&(x.delete(Ae.__key),D=Ae),Ae=Ae.getParent();for(a.isToken()?g===C?a.select():(i=Un(i),i.select(),a.replace(i)):(a=a.spliceText(g,C-g,i,!0),a.getTextContent()===""?a.remove():a.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length)),i=1;i<ge;i++)a=Q[i],x.has(a.__key)||a.remove()}}removeText(){this.insertText("")}formatText(i){if(this.isCollapsed())this.toggleFormat(i),gt(null);else{var a=this.getNodes(),g=[];for(var C of a)Ct(C)&&g.push(C);var x=g.length;if(x===0)this.toggleFormat(i),gt(null);else{C=this.anchor;var D=this.focus,Q=this.isBackward();a=Q?D:C,C=Q?C:D;var ge=0,Ae=g[0];if(D=a.type==="element"?0:a.offset,a.type==="text"&&D===Ae.getTextContentSize()&&(ge=1,Ae=g[1],D=0),Ae!=null){Q=Ae.getFormatFlags(i,null);var Ye=x-1,Xe=g[Ye];if(x=C.type==="text"?C.offset:Xe.getTextContentSize(),Ae.is(Xe))D!==x&&(D===0&&x===Ae.getTextContentSize()?Ae.setFormat(Q):(i=Ae.splitText(D,x),i=D===0?i[0]:i[1],i.setFormat(Q),a.type==="text"&&a.set(i.__key,0,"text"),C.type==="text"&&C.set(i.__key,x-D,"text")),this.format=Q);else{D!==0&&([,Ae]=Ae.splitText(D),D=0),Ae.setFormat(Q);var Ke=Xe.getFormatFlags(i,Q);for(0<x&&(x!==Xe.getTextContentSize()&&([Xe]=Xe.splitText(x)),Xe.setFormat(Ke)),ge+=1;ge<Ye;ge++){let Pe=g[ge];if(!Pe.isToken()){let pt=Pe.getFormatFlags(i,Ke);Pe.setFormat(pt)}}a.type==="text"&&a.set(Ae.__key,D,"text"),C.type==="text"&&C.set(Xe.__key,x,"text"),this.format=Q|Ke}}}}}insertNodes(i){if(i.length!==0){if(this.anchor.key==="root"){this.insertParagraph();var a=Vt();if(!Mt(a))throw Error("Expected RangeSelection after insertParagraph");return a.insertNodes(i)}var g=Ds(this.anchor.getNode(),is);if(a=i[i.length-1],"__language"in g&&Je(g))if("__language"in i[0])this.insertText(i[0].getTextContent());else{var C=Us(this);g.splice(C,0,i),a.selectEnd()}else if(i.some(Q=>(Je(Q)||En(Q))&&!Q.isInline())){a=Wi(i),i=a.getLastDescendant();var x=a.getChildren();a=Je(g)&&g.isEmpty()?null:this.insertParagraph(),C=x[x.length-1];var D=x[0];if((Q=>Je(Q)&&is(Q)&&!Q.isEmpty()&&Je(g)&&(!g.isEmpty()||"__value"in g&&"__checked"in g))(D)){if(!Je(g))throw Error("Expected 'firstBlock' to be an ElementNode");g.append(...D.getChildren()),D=x[1]}D&&kc(g,D),x=Ds(i,is),a&&Je(x)&&("__value"in a&&"__checked"in a||is(C))&&(x.append(...a.getChildren()),a.remove()),Je(g)&&g.isEmpty()&&g.remove(),i.selectEnd(),i=Je(g)?g.getLastChild():null,ki(i)&&x!==g&&i.remove()}else{if(!Je(g))throw Error("Expected 'firstBlock' to be an ElementNode");C=Us(this),g.splice(C,0,i),a.selectEnd()}}}insertParagraph(){if(this.anchor.key==="root"){var i=Wr();return bt().splice(this.anchor.offset,0,[i]),i.select(),i}var a=Us(this);if(i=Ds(this.anchor.getNode(),is),!Je(i))throw Error("Expected ancestor to be an ElementNode");return a=(a=i.getChildAtIndex(a))?[a,...a.getNextSiblings()]:[],(i=i.insertNewAfter(this,!1))?(i.append(...a),i.selectStart(),i):null}insertLineBreak(i){var a=Zr();this.insertNodes([a]),i&&(i=a.getParentOrThrow(),a=a.getIndexWithinParent(),i.select(a,a))}extract(){var i=this.getNodes(),a=i.length,g=a-1,C=this.anchor;let x=this.focus;var D=i[0];let Q=i[g],[ge,Ae]=To(this);return a===0?[]:a===1?Ct(D)&&!this.isCollapsed()?(i=ge>Ae?Ae:ge,g=D.splitText(i,ge>Ae?ge:Ae),i=i===0?g[0]:g[1],i!=null?[i]:[]):[D]:(a=C.isBefore(x),Ct(D)&&(C=a?ge:Ae,C===D.getTextContentSize()?i.shift():C!==0&&([,D]=D.splitText(C),i[0]=D)),Ct(Q)&&(D=Q.getTextContent().length,a=a?Ae:ge,a===0?i.pop():a!==D&&([Q]=Q.splitText(a),i[g]=Q)),i)}modify(i,a,g){var C=this.focus,x=this.anchor,D=i==="move",Q=Ht(C,a);if(En(Q)&&!Q.isIsolated())D&&Q.isKeyboardSelectable()?(a=Ml(),a.add(Q.__key),nn(a)):(i=a?Q.getPreviousSibling():Q.getNextSibling(),Ct(i)?(Q=i.__key,a=a?i.getTextContent().length:0,C.set(Q,a,"text"),D&&x.set(Q,a,"text")):(g=Q.getParentOrThrow(),Je(i)?(g=i.__key,Q=a?i.getChildrenSize():0):(Q=Q.getIndexWithinParent(),g=g.__key,a||Q++),C.set(g,Q,"element"),D&&x.set(g,Q,"element")));else if(x=hn(),C=jr(x._window)){var ge=x._blockCursorElement,Ae=x._rootElement;if(Ae===null||ge===null||!Je(Q)||Q.isInline()||Q.canBeEmpty()||dl(ge,x,Ae),C.modify(i,a?"backward":"forward",g),0<C.rangeCount&&(Q=C.getRangeAt(0),x=this.anchor.getNode(),x=nr(x)?x:sr(x),this.applyDOMRange(Q),this.dirty=!0,!D)){for(D=this.getNodes(),i=[],g=!1,ge=0;ge<D.length;ge++)Ae=D[ge],Zn(Ae,x)?i.push(Ae):g=!0;g&&0<i.length&&(a?(a=i[0],Je(a)?a.selectStart():a.getParentOrThrow().selectStart()):(a=i[i.length-1],Je(a)?a.selectEnd():a.getParentOrThrow().selectEnd())),(C.anchorNode!==Q.startContainer||C.anchorOffset!==Q.startOffset)&&(a=this.focus,D=this.anchor,C=D.key,Q=D.offset,x=D.type,Dr(D,a.key,a.offset,a.type),Dr(a,C,Q,x),this._cachedNodes=null)}}}deleteCharacter(i){let a=this.isCollapsed();if(this.isCollapsed()){var g=this.anchor,C=this.focus,x=g.getNode();if(!i&&(g.type==="element"&&Je(x)&&g.offset===x.getChildrenSize()||g.type==="text"&&g.offset===x.getTextContentSize())){var D=x.getParent();if(D=x.getNextSibling()||(D===null?null:D.getNextSibling()),Je(D)&&D.isShadowRoot())return}if(D=Ht(C,i),En(D)&&!D.isIsolated()){D.isKeyboardSelectable()&&Je(x)&&x.getChildrenSize()===0?(x.remove(),i=Ml(),i.add(D.__key),nn(i)):(D.remove(),hn().dispatchCommand(e,void 0));return}if(!i&&Je(D)&&Je(x)&&x.isEmpty()){x.remove(),D.selectStart();return}if(this.modify("extend",i,"character"),this.isCollapsed()){if(i&&g.offset===0&&(g.type==="element"?g.getNode():g.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(D=C.type==="text"?C.getNode():null,x=g.type==="text"?g.getNode():null,D!==null&&D.isSegmented()){if(g=C.offset,C=D.getTextContentSize(),D.is(x)||i&&g!==C||!i&&g!==0){ba(D,i,g);return}}else if(x!==null&&x.isSegmented()&&(g=g.offset,C=x.getTextContentSize(),x.is(D)||i&&g!==0||!i&&g!==C)){ba(x,i,g);return}if(x=this.anchor,D=this.focus,g=x.getNode(),C=D.getNode(),g===C&&x.type==="text"&&D.type==="text"){var Q=x.offset,ge=D.offset;let Ae=Q<ge;C=Ae?Q:ge,ge=Ae?ge:Q,Q=ge-1,C!==Q&&(g=g.getTextContent().slice(C,ge),_i(g)||(i?D.offset=Q:x.offset=Q))}}}this.removeText(),i&&!a&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(i=this.anchor.getNode(),i.isEmpty()&&nr(i.getParent())&&i.getIndexWithinParent()===0&&i.collapseAtStart(this))}deleteLine(i){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",i,"lineboundary"),(i?this.focus:this.anchor).offset===0&&this.modify("extend",i,"character")),this.removeText()}deleteWord(i){this.isCollapsed()&&this.modify("extend",i,"word"),this.removeText()}}function ar(o){return o instanceof Eo}function Ra(o){let i=o.offset;return o.type==="text"?i:(o=o.getNode(),i===o.getChildrenSize()?o.getTextContent().length:0)}function To(o){let i=o.anchor;return o=o.focus,i.type==="element"&&o.type==="element"&&i.key===o.key&&i.offset===o.offset?[0,0]:[Ra(i),Ra(o)]}function ba(o,i,a){let g=o.getTextContent().split(/(?=\s)/g),C=g.length,x=0,D=0;for(let Q=0;Q<C;Q++){let ge=g[Q],Ae=Q===C-1;if(D=x,x+=ge.length,i&&x===a||x>a||Ae){g.splice(Q,1),Ae&&(D=void 0);break}}i=g.join("").trim(),i===""?o.remove():(o.setTextContent(i),o.select(D,D))}function Ws(o,i,a,g){var C=i;if(o.nodeType===1){let Q=!1;var x=o.childNodes,D=x.length;C===D&&(Q=!0,C=D-1);let ge=x[C];if(D=!1,ge===g._blockCursorElement?(ge=x[C+1],D=!0):g._blockCursorElement!==null&&C--,g=Or(ge),Ct(g))C=Q?g.getTextContentSize():0;else{if(x=Or(o),x===null)return null;if(Je(x)?(o=x.getChildAtIndex(C),(i=Je(o))&&(i=o.getParent(),i=a===null||i===null||!i.canBeEmpty()||i!==a.getNode()),i&&(a=Q?o.getLastDescendant():o.getFirstDescendant(),a===null?(x=o,C=0):(o=a,x=Je(o)?o:o.getParentOrThrow())),Ct(o)?(g=o,x=null,C=Q?o.getTextContentSize():0):o!==x&&Q&&!D&&C++):(C=x.getIndexWithinParent(),C=i===0&&En(x)&&Or(o)===x?C:C+1,x=x.getParentOrThrow()),Je(x))return Fr(x.__key,C,"element")}}else g=Or(o);return Ct(g)?Fr(g.__key,C,"text"):null}function Hi(o,i,a){var g=o.offset,C=o.getNode();g===0?(g=C.getPreviousSibling(),C=C.getParent(),i?(a||!i)&&g===null&&Je(C)&&C.isInline()&&(i=C.getPreviousSibling(),Ct(i)&&(o.key=i.__key,o.offset=i.getTextContent().length)):Je(g)&&!a&&g.isInline()?(o.key=g.__key,o.offset=g.getChildrenSize(),o.type="element"):Ct(g)&&(o.key=g.__key,o.offset=g.getTextContent().length)):g===C.getTextContent().length&&(g=C.getNextSibling(),C=C.getParent(),i&&Je(g)&&g.isInline()?(o.key=g.__key,o.offset=0,o.type="element"):(a||i)&&g===null&&Je(C)&&C.isInline()&&!C.canInsertTextAfter()&&(i=C.getNextSibling(),Ct(i)&&(o.key=i.__key,o.offset=0)))}function xo(o,i,a){if(o.type==="text"&&i.type==="text"){var g=o.isBefore(i);let C=o.is(i);Hi(o,g,C),Hi(i,!g,C),C&&(i.key=o.key,i.offset=o.offset,i.type=o.type),g=hn(),g.isComposing()&&g._compositionKey!==o.key&&Mt(a)&&(g=a.anchor,a=a.focus,Dr(o,g.key,g.offset,g.type),Dr(i,a.key,a.offset,a.type))}}function La(o,i,a,g,C,x){return o===null||a===null||!st(C,o,a)||(i=Ws(o,i,Mt(x)?x.anchor:null,C),i===null)||(g=Ws(a,g,Mt(x)?x.focus:null,C),g===null||i.type==="element"&&g.type==="element"&&(o=Or(o),a=Or(a),En(o)&&En(a)))?null:(xo(i,g,x),[i,g])}function Al(o,i,a,g,C,x){let D=Br();return o=new Ni(Fr(o,i,C),Fr(a,g,x),0,""),o.dirty=!0,D._selection=o}function Ml(){return new Eo(new Set)}function In(o){let i=o.getEditorState()._selection,a=jr(o._window);return Mt(i)||i==null?Gn(i,a,o,null):i.clone()}function Gn(o,i,a,g){var C=a._window;if(C===null)return null;var x=(C=g||C.event)?C.type:void 0;g=x==="selectionchange",C=!Fe&&(g||x==="beforeinput"||x==="compositionstart"||x==="compositionend"||x==="click"&&C&&C.detail===3||x==="drop"||x===void 0);let D;if(!Mt(o)||C){if(i===null)return null;if(C=i.anchorNode,x=i.focusNode,D=i.anchorOffset,i=i.focusOffset,g&&Mt(o)&&!st(a,C,x))return o.clone()}else return o.clone();if(a=La(C,D,x,i,a,o),a===null)return null;let[Q,ge]=a;return new Ni(Q,ge,Mt(o)?o.format:0,Mt(o)?o.style:"")}function Vt(){return Br()._selection}function Er(){return hn()._editorState._selection}function Hn(o,i,a,g=1){var C=o.anchor,x=o.focus,D=C.getNode(),Q=x.getNode();if(i.is(D)||i.is(Q)){if(D=i.__key,o.isCollapsed())i=C.offset,(a<=i&&0<g||a<i&&0>g)&&(a=Math.max(0,i+g),C.set(D,a,"element"),x.set(D,a,"element"),us(o));else{let Ae=o.isBackward();Q=Ae?x:C;var ge=Q.getNode();C=Ae?C:x,x=C.getNode(),i.is(ge)&&(ge=Q.offset,(a<=ge&&0<g||a<ge&&0>g)&&Q.set(D,Math.max(0,ge+g),"element")),i.is(x)&&(i=C.offset,(a<=i&&0<g||a<i&&0>g)&&C.set(D,Math.max(0,i+g),"element"))}us(o)}}function us(o){var i=o.anchor,a=i.offset;let g=o.focus;var C=g.offset,x=i.getNode(),D=g.getNode();if(o.isCollapsed())Je(x)&&(D=x.getChildrenSize(),D=(C=a>=D)?x.getChildAtIndex(D-1):x.getChildAtIndex(a),Ct(D)&&(a=0,C&&(a=D.getTextContentSize()),i.set(D.__key,a,"text"),g.set(D.__key,a,"text")));else{if(Je(x)){let Q=x.getChildrenSize();a=(o=a>=Q)?x.getChildAtIndex(Q-1):x.getChildAtIndex(a),Ct(a)&&(x=0,o&&(x=a.getTextContentSize()),i.set(a.__key,x,"text"))}Je(D)&&(a=D.getChildrenSize(),C=(i=C>=a)?D.getChildAtIndex(a-1):D.getChildAtIndex(C),Ct(C)&&(D=0,i&&(D=C.getTextContentSize()),g.set(C.__key,D,"text")))}}function Ia(o,i){if(i=i.getEditorState()._selection,o=o._selection,Mt(o)){var a=o.anchor;let g=o.focus,C;a.type==="text"&&(C=a.getNode(),C.selectionTransform(i,o)),g.type==="text"&&(a=g.getNode(),C!==a&&a.selectionTransform(i,o))}}function ds(o,i,a,g,C){let x=null,D=0,Q=null;g!==null?(x=g.__key,Ct(g)?(D=g.getTextContentSize(),Q="text"):Je(g)&&(D=g.getChildrenSize(),Q="element")):C!==null&&(x=C.__key,Ct(C)?Q="text":Je(C)&&(Q="element")),x!==null&&Q!==null?o.set(x,D,Q):(D=i.getIndexWithinParent(),D===-1&&(D=a.getChildrenSize()),o.set(a.__key,D,"element"))}function Ks(o,i,a,g,C){o.type==="text"?(o.key=a,i||(o.offset+=C)):o.offset>g.getIndexWithinParent()&&--o.offset}function zs(o){o instanceof Do||(o instanceof $s?(o=pa(o,Yi),Yi(o)||Y(114)):(o=pa(o.getNode(),Yi),Yi(o)||Y(114)));let i=o.getParent();Bl(i)||Y(115);let a=i.getParent();return Fl(a)||Y(116),[o,i,a]}function Us(o){o.isCollapsed()||o.removeText();var i=o.anchor;for(o=i.getNode(),i=i.offset;!is(o);)[o,i]=Rl(o,i);return i}function Rl(o,i){var a=o.getParent();if(!a)return a=Wr(),bt().append(a),a.select(),[bt(),0];if(Ct(o)){var g=o.splitText(i);return g.length===0?[a,o.getIndexWithinParent()]:(o=i===0?0:1,o=g[0].getIndexWithinParent()+o,[a,o])}return!Je(o)||i===0?[a,o.getIndexWithinParent()]:((g=o.getChildAtIndex(i))&&(i=new Ni(Fr(o.__key,i,"element"),Fr(o.__key,i,"element"),0,""),(i=o.insertNewAfter(i))&&i.append(g,...g.getNextSiblings())),[a,o.getIndexWithinParent()+1])}function Wi(o){let i=Wr(),a=null;for(let g=0;g<o.length;g++){let C=o[g],x=ki(C);if(x||En(C)&&C.isInline()||Je(C)&&C.isInline()||Ct(C)||C.isParentRequired()){if(a===null&&(a=C.createParentElementNode(),i.append(a),x))continue;a!==null&&a.append(C)}else i.append(C),a=null}return i}let gn=null,On=null,Wn=!1,fs=!1,Ki=0,Ci={characterData:!0,childList:!0,subtree:!0};function hs(){return Wn||gn!==null&&gn._readOnly}function Jn(){Wn&&Y(13)}function Br(){return gn===null&&Y(15),gn}function hn(){return On===null&&Y(16),On}function ka(o,i,a){var g=i.__type;let C=o._nodes.get(g);for(C===void 0&&Y(30,g),o=a.get(g),o===void 0&&(o=Array.from(C.transforms),a.set(g,o)),a=o.length,g=0;g<a&&(o[g](i),i.isAttached());g++);}function bl(o,i){i=i._dirtyLeaves,o=o._nodeMap;for(let a of i)i=o.get(a),Ct(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&ve(i)}function Pa(o,i){let a=i._dirtyLeaves,g=i._dirtyElements;o=o._nodeMap;let C=xt(),x=new Map;var D=a;let Q=D.size;for(var ge=g,Ae=ge.size;0<Q||0<Ae;){if(0<Q){i._dirtyLeaves=new Set;for(let Ye of D)D=o.get(Ye),Ct(D)&&D.isAttached()&&D.isSimpleText()&&!D.isUnmergeable()&&ve(D),D!==void 0&&D!==void 0&&D.__key!==C&&D.isAttached()&&ka(i,D,x),a.add(Ye);if(D=i._dirtyLeaves,Q=D.size,0<Q){Ki++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Ye of ge)ge=Ye[0],Ae=Ye[1],(ge==="root"||Ae)&&(D=o.get(ge),D!==void 0&&D!==void 0&&D.__key!==C&&D.isAttached()&&ka(i,D,x),g.set(ge,Ae));D=i._dirtyLeaves,Q=D.size,ge=i._dirtyElements,Ae=ge.size,Ki++}i._dirtyLeaves=a,i._dirtyElements=g}function vo(o,i){var a=o.type,g=i.get(a);if(g===void 0&&Y(17,a),a=g.klass,o.type!==a.getType()&&Y(18,a.name),a=a.importJSON(o),o=o.children,Je(a)&&Array.isArray(o))for(g=0;g<o.length;g++){let C=vo(o[g],i);a.append(C)}return a}function Ll(o,i){let a=gn,g=Wn,C=On;gn=o,Wn=!0,On=null;try{return i()}finally{gn=a,Wn=g,On=C}}function zi(o,i){let a=o._pendingEditorState,g=o._rootElement,C=o._headless||g===null;if(a!==null){var x=o._editorState,D=x._selection,Q=a._selection,ge=o._dirtyType!==0,Ae=gn,Ye=Wn,Xe=On,Ke=o._updating,Pe=o._observer,pt=null;if(o._pendingEditorState=null,o._editorState=a,!C&&ge&&Pe!==null){On=o,gn=a,Wn=!1,o._updating=!0;try{let mn=o._dirtyType,Xn=o._dirtyElements,Tn=o._dirtyLeaves;Pe.disconnect();var wt=mn,Ft=Xn,zt=Tn;zn=ri=Ln="",hl=wt===2,Ri=null,Bn=o,Pr=o._config,As=o._nodes,Vr=Bn._listeners.mutation,pl=Ft,vn=zt,lr=x._nodeMap,Cn=a._nodeMap,gl=a._readOnly,ho=new Map(o._keyToDOMMap);let br=new Map;ii=br,Ii("root",null),ii=ho=Pr=Cn=lr=vn=pl=As=Bn=void 0,pt=br}catch(mn){if(mn instanceof Error&&o._onError(mn),fs)throw mn;Oo(o,null,g,a),Oe(o),o._dirtyType=2,fs=!0,zi(o,x),fs=!1;return}finally{Pe.observe(g,Ci),o._updating=Ke,gn=Ae,Wn=Ye,On=Xe}}a._readOnly||(a._readOnly=!0);var Yn=o._dirtyLeaves,Ar=o._dirtyElements,oi=o._normalizedNodes,li=o._updateTags,Hl=o._deferred;ge&&(o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements=new Map,o._normalizedNodes=new Set,o._updateTags=new Set);var ji=o._decorators,Ao=o._pendingDecorators||ji,ps=a._nodeMap,ai;for(ai in Ao)ps.has(ai)||(Ao===ji&&(Ao=tn(o)),delete Ao[ai]);var Mr=C?null:jr(o._window);if(o._editable&&Mr!==null&&(ge||Q===null||Q.dirty)){On=o,gn=a;try{if(Pe!==null&&Pe.disconnect(),ge||Q===null||Q.dirty){let mn=o._blockCursorElement;mn!==null&&dl(mn,o,g);e:{let Xn=Mr.anchorNode,Tn=Mr.focusNode,br=Mr.anchorOffset,Ti=Mr.focusOffset,Tt=document.activeElement;if(!(li.has("collaboration")&&Tt!==g||Tt!==null&&it(Tt)))if(Mt(Q)){var Vi=Q.anchor,Mo=Q.focus,Fa=Vi.key,Ba=Mo.key,Wl=bn(o,Fa),qs=bn(o,Ba),Jr=Vi.offset,Ha=Mo.offset,Kl=Q.format,Ro=Q.style,Wa=Q.isCollapsed(),Zs=Wl,bo=qs,zl=!1;if(Vi.type==="text"){Zs=ze(Wl);let ur=Vi.getNode();zl=ur.getFormat()!==Kl||ur.getStyle()!==Ro}else Mt(D)&&D.anchor.type==="text"&&(zl=!0);if(Mo.type==="text"&&(bo=ze(qs)),Zs!==null&&bo!==null){if(Wa&&(D===null||zl||Mt(D)&&(D.format!==Kl||D.style!==Ro))){var Ka=performance.now();Na=[Kl,Ro,Jr,Fa,Ka]}if(br===Jr&&Ti===Ha&&Xn===Zs&&Tn===bo&&(Mr.type!=="Range"||!Wa)&&(Tt!==null&&g.contains(Tt)||g.focus({preventScroll:!0}),Vi.type!=="element"))break e;try{Mr.setBaseAndExtent(Zs,Jr,bo,Ha)}catch{}if(!li.has("skip-scroll-into-view")&&Q.isCollapsed()&&g!==null&&g===document.activeElement){let ur=Q instanceof Ni&&Q.anchor.type==="element"?Zs.childNodes[Jr]||null:0<Mr.rangeCount?Mr.getRangeAt(0):null;if(ur!==null){let Lr;if(ur instanceof Text){let dr=document.createRange();dr.selectNode(ur),Lr=dr.getBoundingClientRect()}else Lr=ur.getBoundingClientRect();let rr=g.ownerDocument,Kr=rr.defaultView;if(Kr!==null)for(var{top:Ul,bottom:Xr}=Lr,Dn,_t,xr=g;xr!==null;){let dr=xr===rr.body;if(dr)Dn=0,_t=fn(o).innerHeight;else{let Po=xr.getBoundingClientRect();Dn=Po.top,_t=Po.bottom}let ci=0;if(Ul<Dn?ci=-(Dn-Ul):Xr>_t&&(ci=Xr-_t),ci!==0)if(dr)Kr.scrollBy(0,ci);else{let Po=xr.scrollTop;xr.scrollTop+=ci;let za=xr.scrollTop-Po;Ul-=za,Xr-=za}if(dr)break;xr=yr(xr)}}}El=!0}}else D!==null&&st(o,Xn,Tn)&&Mr.removeAllRanges()}}e:{let mn=o._blockCursorElement;if(Mt(Q)&&Q.isCollapsed()&&Q.anchor.type==="element"&&g.contains(document.activeElement)){let Xn=Q.anchor,Tn=Xn.getNode(),br=Xn.offset,Ti=Tn.getChildrenSize(),Tt=!1,ur=null;if(br===Ti){let Lr=Tn.getChildAtIndex(br-1);uo(Lr)&&(Tt=!0)}else{let Lr=Tn.getChildAtIndex(br);if(uo(Lr)){let rr=Lr.getPreviousSibling();(rr===null||uo(rr))&&(Tt=!0,ur=o.getElementByKey(Lr.__key))}}if(Tt){let Lr=o.getElementByKey(Tn.__key);if(mn===null){let rr=o._config.theme,Kr=document.createElement("div");Kr.contentEditable="false",Kr.setAttribute("data-lexical-cursor","true");let dr=rr.blockCursor;if(dr!==void 0){if(typeof dr=="string"){let ci=dr.split(" ");dr=rr.blockCursor=ci}dr!==void 0&&Kr.classList.add(...dr)}o._blockCursorElement=mn=Kr}g.style.caretColor="transparent",ur===null?Lr.appendChild(mn):Lr.insertBefore(mn,ur);break e}}mn!==null&&dl(mn,o,g)}Pe!==null&&Pe.observe(g,Ci)}finally{On=Xe,gn=Ae}}if(pt!==null){var Lo=pt;let mn=Array.from(o._listeners.mutation),Xn=mn.length;for(let Tn=0;Tn<Xn;Tn++){let[br,Ti]=mn[Tn],Tt=Lo.get(Ti);Tt!==void 0&&br(Tt,{dirtyLeaves:Yn,prevEditorState:x,updateTags:li})}}Mt(Q)||Q===null||D!==null&&D.is(Q)||o.dispatchCommand(e,void 0);var Io=o._pendingDecorators;Io!==null&&(o._decorators=Io,o._pendingDecorators=null,Ei("decorator",o,!0,Io));var Pc=It(i||x),Rr=It(a);if(Pc!==Rr&&Ei("textcontent",o,!0,Rr),Ei("update",o,!0,{dirtyElements:Ar,dirtyLeaves:Yn,editorState:a,normalizedNodes:oi,prevEditorState:i||x,tags:li}),o._deferred=[],Hl.length!==0){let mn=o._updating;o._updating=!0;try{for(let Xn=0;Xn<Hl.length;Xn++)Hl[Xn]()}finally{o._updating=mn}}var ko=o._updates;if(ko.length!==0){let mn=ko.shift();if(mn){let[Xn,Tn]=mn;Il(o,Xn,Tn)}}}}function Ei(o,i,a,...g){let C=i._updating;i._updating=a;try{let x=Array.from(i._listeners[o]);for(o=0;o<x.length;o++)x[o].apply(null,g)}finally{i._updating=C}}function ct(o,i,a){if(o._updating===!1||On!==o){let x=!1;return o.update(()=>{x=ct(o,i,a)}),x}let g=pe(o);for(let x=4;0<=x;x--)for(let D=0;D<g.length;D++){var C=g[D]._commands.get(i);if(C!==void 0&&(C=C[x],C!==void 0)){C=Array.from(C);let Q=C.length;for(let ge=0;ge<Q;ge++)if(C[ge](a,o)===!0)return!0}}return!1}function gs(o,i){let a=o._updates;for(i=i||!1;a.length!==0;){var g=a.shift();if(g){let[C,x]=g,D;x!==void 0&&(g=x.onUpdate,D=x.tag,x.skipTransforms&&(i=!0),g&&o._deferred.push(g),D&&o._updateTags.add(D)),C()}}return i}function Il(o,i,a){let g=o._updateTags;var C,x=C=!1;if(a!==void 0){var D=a.onUpdate;C=a.tag,C!=null&&g.add(C),C=a.skipTransforms||!1,x=a.discrete||!1}D&&o._deferred.push(D),a=o._editorState,D=o._pendingEditorState;let Q=!1;(D===null||D._readOnly)&&(D=o._pendingEditorState=new Gs(new Map((D||a)._nodeMap)),Q=!0),D._flushSync=x,x=gn;let ge=Wn,Ae=On,Ye=o._updating;gn=D,Wn=!1,o._updating=!0,On=o;try{Q&&(o._headless?a._selection!=null&&(D._selection=a._selection.clone()):D._selection=In(o));let Xe=o._compositionKey;i(),C=gs(o,C),Ia(D,o),o._dirtyType!==0&&(C?bl(D,o):Pa(D,o),gs(o),fl(a,D,o._dirtyLeaves,o._dirtyElements)),Xe!==o._compositionKey&&(D._flushSync=!0);let Ke=D._selection;if(Mt(Ke)){let Pe=D._nodeMap,pt=Ke.focus.key;Pe.get(Ke.anchor.key)!==void 0&&Pe.get(pt)!==void 0||Y(19)}else ar(Ke)&&Ke._nodes.size===0&&(D._selection=null)}catch(Xe){Xe instanceof Error&&o._onError(Xe),o._pendingEditorState=a,o._dirtyType=2,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),zi(o);return}finally{gn=x,Wn=ge,On=Ae,o._updating=Ye,Ki=0}o._dirtyType!==0||kl(D,o)?D._flushSync?(D._flushSync=!1,zi(o)):Q&&rt(()=>{zi(o)}):(D._flushSync=!1,Q&&(g.clear(),o._deferred=[],o._pendingEditorState=null))}function Tr(o,i,a){o._updating?o._updates.push([i,a]):Il(o,i,a)}class So extends $s{constructor(i){super(i)}decorate(){Y(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function En(o){return o instanceof So}class Ui extends $s{constructor(i){super(i),this.__last=this.__first=null,this.__indent=this.__format=this.__size=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){let i=this.getFormat();return Ne[i]||""}getIndent(){return this.getLatest().__indent}getChildren(){let i=[],a=this.getFirstChild();for(;a!==null;)i.push(a),a=a.getNextSibling();return i}getChildrenKeys(){let i=[],a=this.getFirstChild();for(;a!==null;)i.push(a.__key),a=a.getNextSibling();return i}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let i=hn()._dirtyElements;return i!==null&&i.has(this.__key)}isLastChild(){let i=this.getLatest(),a=this.getParentOrThrow().getLastChild();return a!==null&&a.is(i)}getAllTextNodes(){let i=[],a=this.getFirstChild();for(;a!==null;){if(Ct(a)&&i.push(a),Je(a)){let g=a.getAllTextNodes();i.push(...g)}a=a.getNextSibling()}return i}getFirstDescendant(){let i=this.getFirstChild();for(;i!==null;){if(Je(i)){let a=i.getFirstChild();if(a!==null){i=a;continue}}break}return i}getLastDescendant(){let i=this.getLastChild();for(;i!==null;){if(Je(i)){let a=i.getLastChild();if(a!==null){i=a;continue}}break}return i}getDescendantByIndex(i){let a=this.getChildren(),g=a.length;return i>=g?(i=a[g-1],Je(i)&&i.getLastDescendant()||i||null):(i=a[i],Je(i)&&i.getFirstDescendant()||i||null)}getFirstChild(){let i=this.getLatest().__first;return i===null?null:mt(i)}getFirstChildOrThrow(){let i=this.getFirstChild();return i===null&&Y(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:mt(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&Y(96,this.__key),i}getChildAtIndex(i){var a=this.getChildrenSize();let g;if(i<a/2){for(g=this.getFirstChild(),a=0;g!==null&&a<=i;){if(a===i)return g;g=g.getNextSibling(),a++}return null}for(g=this.getLastChild(),--a;g!==null&&a>=i;){if(a===i)return g;g=g.getPreviousSibling(),a--}return null}getTextContent(){let i="",a=this.getChildren(),g=a.length;for(let C=0;C<g;C++){let x=a[C];i+=x.getTextContent(),Je(x)&&C!==g-1&&!x.isInline()&&(i+=`
|
|
68
|
+
`?a.push(Zr()):x===" "?a.push(Fi()):a.push(Un(x))}this.insertNodes(a)}insertText(i){var a=this.anchor,g=this.focus,C=this.isCollapsed()||a.isBefore(g),x=this.format,A=this.style;C&&a.type==="element"?Dl(a,g,x,A):C||g.type!=="element"||Dl(g,a,x,A);var Q=this.getNodes(),ge=Q.length,Ae=C?g:a;g=(C?a:g).offset;var Ye=Ae.offset;a=Q[0],Ct(a)||Y(26),C=a.getTextContent().length;var Xe=a.getParentOrThrow(),Ke=Q[ge-1];if(this.isCollapsed()&&g===C&&(a.isSegmented()||a.isToken()||!a.canInsertTextAfter()||!Xe.canInsertTextAfter()&&a.getNextSibling()===null)){var Pe=a.getNextSibling();if(Ct(Pe)&&Pe.canInsertTextBefore()&&!Ge(Pe)||(Pe=Un(),Pe.setFormat(x),Xe.canInsertTextAfter()?a.insertAfter(Pe):Xe.insertAfter(Pe)),Pe.select(0,0),a=Pe,i!==""){this.insertText(i);return}}else if(this.isCollapsed()&&g===0&&(a.isSegmented()||a.isToken()||!a.canInsertTextBefore()||!Xe.canInsertTextBefore()&&a.getPreviousSibling()===null)){if(Pe=a.getPreviousSibling(),(!Ct(Pe)||Ge(Pe))&&(Pe=Un(),Pe.setFormat(x),Xe.canInsertTextBefore()?a.insertBefore(Pe):Xe.insertBefore(Pe)),Pe.select(),a=Pe,i!==""){this.insertText(i);return}}else if(a.isSegmented()&&g!==C)Xe=Un(a.getTextContent()),Xe.setFormat(x),a.replace(Xe),a=Xe;else if(!(this.isCollapsed()||i===""||(Pe=Ke.getParent(),Xe.canInsertTextBefore()&&Xe.canInsertTextAfter()&&(!Je(Pe)||Pe.canInsertTextBefore()&&Pe.canInsertTextAfter())))){this.insertText(""),vo(this.anchor,this.focus,null),this.insertText(i);return}if(ge===1)if(a.isToken())i=Un(i),i.select(),a.replace(i);else{if(Q=a.getFormat(),ge=a.getStyle(),g===Ye&&(Q!==x||ge!==A))if(a.getTextContent()==="")a.setFormat(x),a.setStyle(A);else{Q=Un(i),Q.setFormat(x),Q.setStyle(A),Q.select(),g===0?a.insertBefore(Q,!1):([ge]=a.splitText(g),ge.insertAfter(Q,!1)),Q.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length);return}else if(Ra(a)){i=Un(i),i.setFormat(x),i.setStyle(A),i.select(),a.replace(i);return}a=a.spliceText(g,Ye-g,i,!0),a.getTextContent()===""?a.remove():this.anchor.type==="text"&&(a.isComposing()?this.anchor.offset-=i.length:(this.format=Q,this.style=ge))}else{if(x=new Set([...a.getParentKeys(),...Ke.getParentKeys()]),Pe=Je(a)?a:a.getParentOrThrow(),A=Je(Ke)?Ke:Ke.getParentOrThrow(),Xe=Ke,!Pe.is(A)&&A.isInline())do Xe=A,A=A.getParentOrThrow();while(A.isInline());if(Ae.type==="text"&&(Ye!==0||Ke.getTextContent()==="")||Ae.type==="element"&&Ke.getIndexWithinParent()<Ye)if(Ct(Ke)&&!Ke.isToken()&&Ye!==Ke.getTextContentSize()){if(Ke.isSegmented()){var pt=Un(Ke.getTextContent());Ke.replace(pt),Ke=pt}nr(Ae.getNode())||Ae.type!=="text"||(Ke=Ke.spliceText(0,Ye,"")),x.add(Ke.__key)}else Ae=Ke.getParentOrThrow(),Ae.canBeEmpty()||Ae.getChildrenSize()!==1?Ke.remove():Ae.remove();else x.add(Ke.__key);for(Ae=A.getChildren(),Ye=new Set(Q),Ke=Pe.is(A),Pe=Pe.isInline()&&a.getNextSibling()===null?Pe:a,pt=Ae.length-1;0<=pt;pt--){let Ot=Ae[pt];if(Ot.is(a)||Je(Ot)&&Ot.isParentOf(a))break;Ot.isAttached()&&(!Ye.has(Ot)||Ot.is(Xe)?Ke||Pe.insertAfter(Ot,!1):Ot.remove())}if(!Ke)for(Ae=A,A=null;Ae!==null;)Ye=Ae.getChildren(),Ke=Ye.length,(Ke===0||Ye[Ke-1].is(A))&&(x.delete(Ae.__key),A=Ae),Ae=Ae.getParent();for(a.isToken()?g===C?a.select():(i=Un(i),i.select(),a.replace(i)):(a=a.spliceText(g,C-g,i,!0),a.getTextContent()===""?a.remove():a.isComposing()&&this.anchor.type==="text"&&(this.anchor.offset-=i.length)),i=1;i<ge;i++)a=Q[i],x.has(a.__key)||a.remove()}}removeText(){this.insertText("")}formatText(i){if(this.isCollapsed())this.toggleFormat(i),gt(null);else{var a=this.getNodes(),g=[];for(var C of a)Ct(C)&&g.push(C);var x=g.length;if(x===0)this.toggleFormat(i),gt(null);else{C=this.anchor;var A=this.focus,Q=this.isBackward();a=Q?A:C,C=Q?C:A;var ge=0,Ae=g[0];if(A=a.type==="element"?0:a.offset,a.type==="text"&&A===Ae.getTextContentSize()&&(ge=1,Ae=g[1],A=0),Ae!=null){Q=Ae.getFormatFlags(i,null);var Ye=x-1,Xe=g[Ye];if(x=C.type==="text"?C.offset:Xe.getTextContentSize(),Ae.is(Xe))A!==x&&(A===0&&x===Ae.getTextContentSize()?Ae.setFormat(Q):(i=Ae.splitText(A,x),i=A===0?i[0]:i[1],i.setFormat(Q),a.type==="text"&&a.set(i.__key,0,"text"),C.type==="text"&&C.set(i.__key,x-A,"text")),this.format=Q);else{A!==0&&([,Ae]=Ae.splitText(A),A=0),Ae.setFormat(Q);var Ke=Xe.getFormatFlags(i,Q);for(0<x&&(x!==Xe.getTextContentSize()&&([Xe]=Xe.splitText(x)),Xe.setFormat(Ke)),ge+=1;ge<Ye;ge++){let Pe=g[ge];if(!Pe.isToken()){let pt=Pe.getFormatFlags(i,Ke);Pe.setFormat(pt)}}a.type==="text"&&a.set(Ae.__key,A,"text"),C.type==="text"&&C.set(Xe.__key,x,"text"),this.format=Q|Ke}}}}}insertNodes(i){if(i.length!==0){if(this.anchor.key==="root"){this.insertParagraph();var a=qt();if(!Mt(a))throw Error("Expected RangeSelection after insertParagraph");return a.insertNodes(i)}var g=Os(this.anchor.getNode(),rs);if(a=i[i.length-1],"__language"in g&&Je(g))if("__language"in i[0])this.insertText(i[0].getTextContent());else{var C=zs(this);g.splice(C,0,i),a.selectEnd()}else if(i.some(Q=>(Je(Q)||En(Q))&&!Q.isInline())){a=Hi(i),i=a.getLastDescendant();var x=a.getChildren();a=Je(g)&&g.isEmpty()?null:this.insertParagraph(),C=x[x.length-1];var A=x[0];if((Q=>Je(Q)&&rs(Q)&&!Q.isEmpty()&&Je(g)&&(!g.isEmpty()||"__value"in g&&"__checked"in g))(A)){if(!Je(g))throw Error("Expected 'firstBlock' to be an ElementNode");g.append(...A.getChildren()),A=x[1]}A&&Fc(g,A),x=Os(i,rs),a&&Je(x)&&("__value"in a&&"__checked"in a||rs(C))&&(x.append(...a.getChildren()),a.remove()),Je(g)&&g.isEmpty()&&g.remove(),i.selectEnd(),i=Je(g)?g.getLastChild():null,Ii(i)&&x!==g&&i.remove()}else{if(!Je(g))throw Error("Expected 'firstBlock' to be an ElementNode");C=zs(this),g.splice(C,0,i),a.selectEnd()}}}insertParagraph(){if(this.anchor.key==="root"){var i=Wr();return bt().splice(this.anchor.offset,0,[i]),i.select(),i}var a=zs(this);if(i=Os(this.anchor.getNode(),rs),!Je(i))throw Error("Expected ancestor to be an ElementNode");return a=(a=i.getChildAtIndex(a))?[a,...a.getNextSiblings()]:[],(i=i.insertNewAfter(this,!1))?(i.append(...a),i.selectStart(),i):null}insertLineBreak(i){var a=Zr();this.insertNodes([a]),i&&(i=a.getParentOrThrow(),a=a.getIndexWithinParent(),i.select(a,a))}extract(){var i=this.getNodes(),a=i.length,g=a-1,C=this.anchor;let x=this.focus;var A=i[0];let Q=i[g],[ge,Ae]=xo(this);return a===0?[]:a===1?Ct(A)&&!this.isCollapsed()?(i=ge>Ae?Ae:ge,g=A.splitText(i,ge>Ae?ge:Ae),i=i===0?g[0]:g[1],i!=null?[i]:[]):[A]:(a=C.isBefore(x),Ct(A)&&(C=a?ge:Ae,C===A.getTextContentSize()?i.shift():C!==0&&([,A]=A.splitText(C),i[0]=A)),Ct(Q)&&(A=Q.getTextContent().length,a=a?Ae:ge,a===0?i.pop():a!==A&&([Q]=Q.splitText(a),i[g]=Q)),i)}modify(i,a,g){var C=this.focus,x=this.anchor,A=i==="move",Q=Ht(C,a);if(En(Q)&&!Q.isIsolated())A&&Q.isKeyboardSelectable()?(a=Ml(),a.add(Q.__key),rn(a)):(i=a?Q.getPreviousSibling():Q.getNextSibling(),Ct(i)?(Q=i.__key,a=a?i.getTextContent().length:0,C.set(Q,a,"text"),A&&x.set(Q,a,"text")):(g=Q.getParentOrThrow(),Je(i)?(g=i.__key,Q=a?i.getChildrenSize():0):(Q=Q.getIndexWithinParent(),g=g.__key,a||Q++),C.set(g,Q,"element"),A&&x.set(g,Q,"element")));else if(x=hn(),C=jr(x._window)){var ge=x._blockCursorElement,Ae=x._rootElement;if(Ae===null||ge===null||!Je(Q)||Q.isInline()||Q.canBeEmpty()||dl(ge,x,Ae),C.modify(i,a?"backward":"forward",g),0<C.rangeCount&&(Q=C.getRangeAt(0),x=this.anchor.getNode(),x=nr(x)?x:sr(x),this.applyDOMRange(Q),this.dirty=!0,!A)){for(A=this.getNodes(),i=[],g=!1,ge=0;ge<A.length;ge++)Ae=A[ge],Zn(Ae,x)?i.push(Ae):g=!0;g&&0<i.length&&(a?(a=i[0],Je(a)?a.selectStart():a.getParentOrThrow().selectStart()):(a=i[i.length-1],Je(a)?a.selectEnd():a.getParentOrThrow().selectEnd())),(C.anchorNode!==Q.startContainer||C.anchorOffset!==Q.startOffset)&&(a=this.focus,A=this.anchor,C=A.key,Q=A.offset,x=A.type,Dr(A,a.key,a.offset,a.type),Dr(a,C,Q,x),this._cachedNodes=null)}}}deleteCharacter(i){let a=this.isCollapsed();if(this.isCollapsed()){var g=this.anchor,C=this.focus,x=g.getNode();if(!i&&(g.type==="element"&&Je(x)&&g.offset===x.getChildrenSize()||g.type==="text"&&g.offset===x.getTextContentSize())){var A=x.getParent();if(A=x.getNextSibling()||(A===null?null:A.getNextSibling()),Je(A)&&A.isShadowRoot())return}if(A=Ht(C,i),En(A)&&!A.isIsolated()){A.isKeyboardSelectable()&&Je(x)&&x.getChildrenSize()===0?(x.remove(),i=Ml(),i.add(A.__key),rn(i)):(A.remove(),hn().dispatchCommand(e,void 0));return}if(!i&&Je(A)&&Je(x)&&x.isEmpty()){x.remove(),A.selectStart();return}if(this.modify("extend",i,"character"),this.isCollapsed()){if(i&&g.offset===0&&(g.type==="element"?g.getNode():g.getNode().getParentOrThrow()).collapseAtStart(this))return}else{if(A=C.type==="text"?C.getNode():null,x=g.type==="text"?g.getNode():null,A!==null&&A.isSegmented()){if(g=C.offset,C=A.getTextContentSize(),A.is(x)||i&&g!==C||!i&&g!==0){La(A,i,g);return}}else if(x!==null&&x.isSegmented()&&(g=g.offset,C=x.getTextContentSize(),x.is(A)||i&&g!==0||!i&&g!==C)){La(x,i,g);return}if(x=this.anchor,A=this.focus,g=x.getNode(),C=A.getNode(),g===C&&x.type==="text"&&A.type==="text"){var Q=x.offset,ge=A.offset;let Ae=Q<ge;C=Ae?Q:ge,ge=Ae?ge:Q,Q=ge-1,C!==Q&&(g=g.getTextContent().slice(C,ge),_i(g)||(i?A.offset=Q:x.offset=Q))}}}this.removeText(),i&&!a&&this.isCollapsed()&&this.anchor.type==="element"&&this.anchor.offset===0&&(i=this.anchor.getNode(),i.isEmpty()&&nr(i.getParent())&&i.getIndexWithinParent()===0&&i.collapseAtStart(this))}deleteLine(i){this.isCollapsed()&&(this.anchor.type==="text"&&this.modify("extend",i,"lineboundary"),(i?this.focus:this.anchor).offset===0&&this.modify("extend",i,"character")),this.removeText()}deleteWord(i){this.isCollapsed()&&this.modify("extend",i,"word"),this.removeText()}}function ar(o){return o instanceof To}function ba(o){let i=o.offset;return o.type==="text"?i:(o=o.getNode(),i===o.getChildrenSize()?o.getTextContent().length:0)}function xo(o){let i=o.anchor;return o=o.focus,i.type==="element"&&o.type==="element"&&i.key===o.key&&i.offset===o.offset?[0,0]:[ba(i),ba(o)]}function La(o,i,a){let g=o.getTextContent().split(/(?=\s)/g),C=g.length,x=0,A=0;for(let Q=0;Q<C;Q++){let ge=g[Q],Ae=Q===C-1;if(A=x,x+=ge.length,i&&x===a||x>a||Ae){g.splice(Q,1),Ae&&(A=void 0);break}}i=g.join("").trim(),i===""?o.remove():(o.setTextContent(i),o.select(A,A))}function Hs(o,i,a,g){var C=i;if(o.nodeType===1){let Q=!1;var x=o.childNodes,A=x.length;C===A&&(Q=!0,C=A-1);let ge=x[C];if(A=!1,ge===g._blockCursorElement?(ge=x[C+1],A=!0):g._blockCursorElement!==null&&C--,g=Or(ge),Ct(g))C=Q?g.getTextContentSize():0;else{if(x=Or(o),x===null)return null;if(Je(x)?(o=x.getChildAtIndex(C),(i=Je(o))&&(i=o.getParent(),i=a===null||i===null||!i.canBeEmpty()||i!==a.getNode()),i&&(a=Q?o.getLastDescendant():o.getFirstDescendant(),a===null?(x=o,C=0):(o=a,x=Je(o)?o:o.getParentOrThrow())),Ct(o)?(g=o,x=null,C=Q?o.getTextContentSize():0):o!==x&&Q&&!A&&C++):(C=x.getIndexWithinParent(),C=i===0&&En(x)&&Or(o)===x?C:C+1,x=x.getParentOrThrow()),Je(x))return Fr(x.__key,C,"element")}}else g=Or(o);return Ct(g)?Fr(g.__key,C,"text"):null}function Bi(o,i,a){var g=o.offset,C=o.getNode();g===0?(g=C.getPreviousSibling(),C=C.getParent(),i?(a||!i)&&g===null&&Je(C)&&C.isInline()&&(i=C.getPreviousSibling(),Ct(i)&&(o.key=i.__key,o.offset=i.getTextContent().length)):Je(g)&&!a&&g.isInline()?(o.key=g.__key,o.offset=g.getChildrenSize(),o.type="element"):Ct(g)&&(o.key=g.__key,o.offset=g.getTextContent().length)):g===C.getTextContent().length&&(g=C.getNextSibling(),C=C.getParent(),i&&Je(g)&&g.isInline()?(o.key=g.__key,o.offset=0,o.type="element"):(a||i)&&g===null&&Je(C)&&C.isInline()&&!C.canInsertTextAfter()&&(i=C.getNextSibling(),Ct(i)&&(o.key=i.__key,o.offset=0)))}function vo(o,i,a){if(o.type==="text"&&i.type==="text"){var g=o.isBefore(i);let C=o.is(i);Bi(o,g,C),Bi(i,!g,C),C&&(i.key=o.key,i.offset=o.offset,i.type=o.type),g=hn(),g.isComposing()&&g._compositionKey!==o.key&&Mt(a)&&(g=a.anchor,a=a.focus,Dr(o,g.key,g.offset,g.type),Dr(i,a.key,a.offset,a.type))}}function Ia(o,i,a,g,C,x){return o===null||a===null||!ot(C,o,a)||(i=Hs(o,i,Mt(x)?x.anchor:null,C),i===null)||(g=Hs(a,g,Mt(x)?x.focus:null,C),g===null||i.type==="element"&&g.type==="element"&&(o=Or(o),a=Or(a),En(o)&&En(a)))?null:(vo(i,g,x),[i,g])}function Al(o,i,a,g,C,x){let A=Br();return o=new Ni(Fr(o,i,C),Fr(a,g,x),0,""),o.dirty=!0,A._selection=o}function Ml(){return new To(new Set)}function In(o){let i=o.getEditorState()._selection,a=jr(o._window);return Mt(i)||i==null?Gn(i,a,o,null):i.clone()}function Gn(o,i,a,g){var C=a._window;if(C===null)return null;var x=(C=g||C.event)?C.type:void 0;g=x==="selectionchange",C=!Fe&&(g||x==="beforeinput"||x==="compositionstart"||x==="compositionend"||x==="click"&&C&&C.detail===3||x==="drop"||x===void 0);let A;if(!Mt(o)||C){if(i===null)return null;if(C=i.anchorNode,x=i.focusNode,A=i.anchorOffset,i=i.focusOffset,g&&Mt(o)&&!ot(a,C,x))return o.clone()}else return o.clone();if(a=Ia(C,A,x,i,a,o),a===null)return null;let[Q,ge]=a;return new Ni(Q,ge,Mt(o)?o.format:0,Mt(o)?o.style:"")}function qt(){return Br()._selection}function Er(){return hn()._editorState._selection}function Hn(o,i,a,g=1){var C=o.anchor,x=o.focus,A=C.getNode(),Q=x.getNode();if(i.is(A)||i.is(Q)){if(A=i.__key,o.isCollapsed())i=C.offset,(a<=i&&0<g||a<i&&0>g)&&(a=Math.max(0,i+g),C.set(A,a,"element"),x.set(A,a,"element"),cs(o));else{let Ae=o.isBackward();Q=Ae?x:C;var ge=Q.getNode();C=Ae?C:x,x=C.getNode(),i.is(ge)&&(ge=Q.offset,(a<=ge&&0<g||a<ge&&0>g)&&Q.set(A,Math.max(0,ge+g),"element")),i.is(x)&&(i=C.offset,(a<=i&&0<g||a<i&&0>g)&&C.set(A,Math.max(0,i+g),"element"))}cs(o)}}function cs(o){var i=o.anchor,a=i.offset;let g=o.focus;var C=g.offset,x=i.getNode(),A=g.getNode();if(o.isCollapsed())Je(x)&&(A=x.getChildrenSize(),A=(C=a>=A)?x.getChildAtIndex(A-1):x.getChildAtIndex(a),Ct(A)&&(a=0,C&&(a=A.getTextContentSize()),i.set(A.__key,a,"text"),g.set(A.__key,a,"text")));else{if(Je(x)){let Q=x.getChildrenSize();a=(o=a>=Q)?x.getChildAtIndex(Q-1):x.getChildAtIndex(a),Ct(a)&&(x=0,o&&(x=a.getTextContentSize()),i.set(a.__key,x,"text"))}Je(A)&&(a=A.getChildrenSize(),C=(i=C>=a)?A.getChildAtIndex(a-1):A.getChildAtIndex(C),Ct(C)&&(A=0,i&&(A=C.getTextContentSize()),g.set(C.__key,A,"text")))}}function ka(o,i){if(i=i.getEditorState()._selection,o=o._selection,Mt(o)){var a=o.anchor;let g=o.focus,C;a.type==="text"&&(C=a.getNode(),C.selectionTransform(i,o)),g.type==="text"&&(a=g.getNode(),C!==a&&a.selectionTransform(i,o))}}function us(o,i,a,g,C){let x=null,A=0,Q=null;g!==null?(x=g.__key,Ct(g)?(A=g.getTextContentSize(),Q="text"):Je(g)&&(A=g.getChildrenSize(),Q="element")):C!==null&&(x=C.__key,Ct(C)?Q="text":Je(C)&&(Q="element")),x!==null&&Q!==null?o.set(x,A,Q):(A=i.getIndexWithinParent(),A===-1&&(A=a.getChildrenSize()),o.set(a.__key,A,"element"))}function Ws(o,i,a,g,C){o.type==="text"?(o.key=a,i||(o.offset+=C)):o.offset>g.getIndexWithinParent()&&--o.offset}function Ks(o){o instanceof Ao||(o instanceof Ps?(o=ma(o,Gi),Gi(o)||Y(114)):(o=ma(o.getNode(),Gi),Gi(o)||Y(114)));let i=o.getParent();Bl(i)||Y(115);let a=i.getParent();return Fl(a)||Y(116),[o,i,a]}function zs(o){o.isCollapsed()||o.removeText();var i=o.anchor;for(o=i.getNode(),i=i.offset;!rs(o);)[o,i]=Rl(o,i);return i}function Rl(o,i){var a=o.getParent();if(!a)return a=Wr(),bt().append(a),a.select(),[bt(),0];if(Ct(o)){var g=o.splitText(i);return g.length===0?[a,o.getIndexWithinParent()]:(o=i===0?0:1,o=g[0].getIndexWithinParent()+o,[a,o])}return!Je(o)||i===0?[a,o.getIndexWithinParent()]:((g=o.getChildAtIndex(i))&&(i=new Ni(Fr(o.__key,i,"element"),Fr(o.__key,i,"element"),0,""),(i=o.insertNewAfter(i))&&i.append(g,...g.getNextSiblings())),[a,o.getIndexWithinParent()+1])}function Hi(o){let i=Wr(),a=null;for(let g=0;g<o.length;g++){let C=o[g],x=Ii(C);if(x||En(C)&&C.isInline()||Je(C)&&C.isInline()||Ct(C)||C.isParentRequired()){if(a===null&&(a=C.createParentElementNode(),i.append(a),x))continue;a!==null&&a.append(C)}else i.append(C),a=null}return i}let gn=null,On=null,Wn=!1,ds=!1,Wi=0,Ci={characterData:!0,childList:!0,subtree:!0};function fs(){return Wn||gn!==null&&gn._readOnly}function Jn(){Wn&&Y(13)}function Br(){return gn===null&&Y(15),gn}function hn(){return On===null&&Y(16),On}function Pa(o,i,a){var g=i.__type;let C=o._nodes.get(g);for(C===void 0&&Y(30,g),o=a.get(g),o===void 0&&(o=Array.from(C.transforms),a.set(g,o)),a=o.length,g=0;g<a&&(o[g](i),i.isAttached());g++);}function bl(o,i){i=i._dirtyLeaves,o=o._nodeMap;for(let a of i)i=o.get(a),Ct(i)&&i.isAttached()&&i.isSimpleText()&&!i.isUnmergeable()&&ve(i)}function $a(o,i){let a=i._dirtyLeaves,g=i._dirtyElements;o=o._nodeMap;let C=xt(),x=new Map;var A=a;let Q=A.size;for(var ge=g,Ae=ge.size;0<Q||0<Ae;){if(0<Q){i._dirtyLeaves=new Set;for(let Ye of A)A=o.get(Ye),Ct(A)&&A.isAttached()&&A.isSimpleText()&&!A.isUnmergeable()&&ve(A),A!==void 0&&A!==void 0&&A.__key!==C&&A.isAttached()&&Pa(i,A,x),a.add(Ye);if(A=i._dirtyLeaves,Q=A.size,0<Q){Wi++;continue}}i._dirtyLeaves=new Set,i._dirtyElements=new Map;for(let Ye of ge)ge=Ye[0],Ae=Ye[1],(ge==="root"||Ae)&&(A=o.get(ge),A!==void 0&&A!==void 0&&A.__key!==C&&A.isAttached()&&Pa(i,A,x),g.set(ge,Ae));A=i._dirtyLeaves,Q=A.size,ge=i._dirtyElements,Ae=ge.size,Wi++}i._dirtyLeaves=a,i._dirtyElements=g}function So(o,i){var a=o.type,g=i.get(a);if(g===void 0&&Y(17,a),a=g.klass,o.type!==a.getType()&&Y(18,a.name),a=a.importJSON(o),o=o.children,Je(a)&&Array.isArray(o))for(g=0;g<o.length;g++){let C=So(o[g],i);a.append(C)}return a}function Ll(o,i){let a=gn,g=Wn,C=On;gn=o,Wn=!0,On=null;try{return i()}finally{gn=a,Wn=g,On=C}}function Ki(o,i){let a=o._pendingEditorState,g=o._rootElement,C=o._headless||g===null;if(a!==null){var x=o._editorState,A=x._selection,Q=a._selection,ge=o._dirtyType!==0,Ae=gn,Ye=Wn,Xe=On,Ke=o._updating,Pe=o._observer,pt=null;if(o._pendingEditorState=null,o._editorState=a,!C&&ge&&Pe!==null){On=o,gn=a,Wn=!1,o._updating=!0;try{let mn=o._dirtyType,Xn=o._dirtyElements,Tn=o._dirtyLeaves;Pe.disconnect();var Ot=mn,Ft=Xn,zt=Tn;zn=ri=Ln="",hl=Ot===2,Mi=null,Bn=o,Pr=o._config,Ds=o._nodes,Vr=Bn._listeners.mutation,pl=Ft,vn=zt,lr=x._nodeMap,Cn=a._nodeMap,gl=a._readOnly,go=new Map(o._keyToDOMMap);let br=new Map;ii=br,Li("root",null),ii=go=Pr=Cn=lr=vn=pl=Ds=Bn=void 0,pt=br}catch(mn){if(mn instanceof Error&&o._onError(mn),ds)throw mn;Do(o,null,g,a),Oe(o),o._dirtyType=2,ds=!0,Ki(o,x),ds=!1;return}finally{Pe.observe(g,Ci),o._updating=Ke,gn=Ae,Wn=Ye,On=Xe}}a._readOnly||(a._readOnly=!0);var Yn=o._dirtyLeaves,Ar=o._dirtyElements,oi=o._normalizedNodes,li=o._updateTags,Hl=o._deferred;ge&&(o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements=new Map,o._normalizedNodes=new Set,o._updateTags=new Set);var Yi=o._decorators,Mo=o._pendingDecorators||Yi,gs=a._nodeMap,ai;for(ai in Mo)gs.has(ai)||(Mo===Yi&&(Mo=nn(o)),delete Mo[ai]);var Mr=C?null:jr(o._window);if(o._editable&&Mr!==null&&(ge||Q===null||Q.dirty)){On=o,gn=a;try{if(Pe!==null&&Pe.disconnect(),ge||Q===null||Q.dirty){let mn=o._blockCursorElement;mn!==null&&dl(mn,o,g);e:{let Xn=Mr.anchorNode,Tn=Mr.focusNode,br=Mr.anchorOffset,Ti=Mr.focusOffset,Tt=document.activeElement;if(!(li.has("collaboration")&&Tt!==g||Tt!==null&&st(Tt)))if(Mt(Q)){var ji=Q.anchor,Ro=Q.focus,Ba=ji.key,Ha=Ro.key,Wl=bn(o,Ba),Vs=bn(o,Ha),Jr=ji.offset,Wa=Ro.offset,Kl=Q.format,bo=Q.style,Ka=Q.isCollapsed(),qs=Wl,Lo=Vs,zl=!1;if(ji.type==="text"){qs=ze(Wl);let ur=ji.getNode();zl=ur.getFormat()!==Kl||ur.getStyle()!==bo}else Mt(A)&&A.anchor.type==="text"&&(zl=!0);if(Ro.type==="text"&&(Lo=ze(Vs)),qs!==null&&Lo!==null){if(Ka&&(A===null||zl||Mt(A)&&(A.format!==Kl||A.style!==bo))){var za=performance.now();Ca=[Kl,bo,Jr,Ba,za]}if(br===Jr&&Ti===Wa&&Xn===qs&&Tn===Lo&&(Mr.type!=="Range"||!Ka)&&(Tt!==null&&g.contains(Tt)||g.focus({preventScroll:!0}),ji.type!=="element"))break e;try{Mr.setBaseAndExtent(qs,Jr,Lo,Wa)}catch{}if(!li.has("skip-scroll-into-view")&&Q.isCollapsed()&&g!==null&&g===document.activeElement){let ur=Q instanceof Ni&&Q.anchor.type==="element"?qs.childNodes[Jr]||null:0<Mr.rangeCount?Mr.getRangeAt(0):null;if(ur!==null){let Lr;if(ur instanceof Text){let dr=document.createRange();dr.selectNode(ur),Lr=dr.getBoundingClientRect()}else Lr=ur.getBoundingClientRect();let rr=g.ownerDocument,Kr=rr.defaultView;if(Kr!==null)for(var{top:Ul,bottom:Xr}=Lr,Dn,_t,xr=g;xr!==null;){let dr=xr===rr.body;if(dr)Dn=0,_t=fn(o).innerHeight;else{let $o=xr.getBoundingClientRect();Dn=$o.top,_t=$o.bottom}let ci=0;if(Ul<Dn?ci=-(Dn-Ul):Xr>_t&&(ci=Xr-_t),ci!==0)if(dr)Kr.scrollBy(0,ci);else{let $o=xr.scrollTop;xr.scrollTop+=ci;let Ua=xr.scrollTop-$o;Ul-=Ua,Xr-=Ua}if(dr)break;xr=yr(xr)}}}El=!0}}else A!==null&&ot(o,Xn,Tn)&&Mr.removeAllRanges()}}e:{let mn=o._blockCursorElement;if(Mt(Q)&&Q.isCollapsed()&&Q.anchor.type==="element"&&g.contains(document.activeElement)){let Xn=Q.anchor,Tn=Xn.getNode(),br=Xn.offset,Ti=Tn.getChildrenSize(),Tt=!1,ur=null;if(br===Ti){let Lr=Tn.getChildAtIndex(br-1);fo(Lr)&&(Tt=!0)}else{let Lr=Tn.getChildAtIndex(br);if(fo(Lr)){let rr=Lr.getPreviousSibling();(rr===null||fo(rr))&&(Tt=!0,ur=o.getElementByKey(Lr.__key))}}if(Tt){let Lr=o.getElementByKey(Tn.__key);if(mn===null){let rr=o._config.theme,Kr=document.createElement("div");Kr.contentEditable="false",Kr.setAttribute("data-lexical-cursor","true");let dr=rr.blockCursor;if(dr!==void 0){if(typeof dr=="string"){let ci=dr.split(" ");dr=rr.blockCursor=ci}dr!==void 0&&Kr.classList.add(...dr)}o._blockCursorElement=mn=Kr}g.style.caretColor="transparent",ur===null?Lr.appendChild(mn):Lr.insertBefore(mn,ur);break e}}mn!==null&&dl(mn,o,g)}Pe!==null&&Pe.observe(g,Ci)}finally{On=Xe,gn=Ae}}if(pt!==null){var Io=pt;let mn=Array.from(o._listeners.mutation),Xn=mn.length;for(let Tn=0;Tn<Xn;Tn++){let[br,Ti]=mn[Tn],Tt=Io.get(Ti);Tt!==void 0&&br(Tt,{dirtyLeaves:Yn,prevEditorState:x,updateTags:li})}}Mt(Q)||Q===null||A!==null&&A.is(Q)||o.dispatchCommand(e,void 0);var ko=o._pendingDecorators;ko!==null&&(o._decorators=ko,o._pendingDecorators=null,Ei("decorator",o,!0,ko));var Bc=It(i||x),Rr=It(a);if(Bc!==Rr&&Ei("textcontent",o,!0,Rr),Ei("update",o,!0,{dirtyElements:Ar,dirtyLeaves:Yn,editorState:a,normalizedNodes:oi,prevEditorState:i||x,tags:li}),o._deferred=[],Hl.length!==0){let mn=o._updating;o._updating=!0;try{for(let Xn=0;Xn<Hl.length;Xn++)Hl[Xn]()}finally{o._updating=mn}}var Po=o._updates;if(Po.length!==0){let mn=Po.shift();if(mn){let[Xn,Tn]=mn;Il(o,Xn,Tn)}}}}function Ei(o,i,a,...g){let C=i._updating;i._updating=a;try{let x=Array.from(i._listeners[o]);for(o=0;o<x.length;o++)x[o].apply(null,g)}finally{i._updating=C}}function ct(o,i,a){if(o._updating===!1||On!==o){let x=!1;return o.update(()=>{x=ct(o,i,a)}),x}let g=pe(o);for(let x=4;0<=x;x--)for(let A=0;A<g.length;A++){var C=g[A]._commands.get(i);if(C!==void 0&&(C=C[x],C!==void 0)){C=Array.from(C);let Q=C.length;for(let ge=0;ge<Q;ge++)if(C[ge](a,o)===!0)return!0}}return!1}function hs(o,i){let a=o._updates;for(i=i||!1;a.length!==0;){var g=a.shift();if(g){let[C,x]=g,A;x!==void 0&&(g=x.onUpdate,A=x.tag,x.skipTransforms&&(i=!0),g&&o._deferred.push(g),A&&o._updateTags.add(A)),C()}}return i}function Il(o,i,a){let g=o._updateTags;var C,x=C=!1;if(a!==void 0){var A=a.onUpdate;C=a.tag,C!=null&&g.add(C),C=a.skipTransforms||!1,x=a.discrete||!1}A&&o._deferred.push(A),a=o._editorState,A=o._pendingEditorState;let Q=!1;(A===null||A._readOnly)&&(A=o._pendingEditorState=new Us(new Map((A||a)._nodeMap)),Q=!0),A._flushSync=x,x=gn;let ge=Wn,Ae=On,Ye=o._updating;gn=A,Wn=!1,o._updating=!0,On=o;try{Q&&(o._headless?a._selection!=null&&(A._selection=a._selection.clone()):A._selection=In(o));let Xe=o._compositionKey;i(),C=hs(o,C),ka(A,o),o._dirtyType!==0&&(C?bl(A,o):$a(A,o),hs(o),fl(a,A,o._dirtyLeaves,o._dirtyElements)),Xe!==o._compositionKey&&(A._flushSync=!0);let Ke=A._selection;if(Mt(Ke)){let Pe=A._nodeMap,pt=Ke.focus.key;Pe.get(Ke.anchor.key)!==void 0&&Pe.get(pt)!==void 0||Y(19)}else ar(Ke)&&Ke._nodes.size===0&&(A._selection=null)}catch(Xe){Xe instanceof Error&&o._onError(Xe),o._pendingEditorState=a,o._dirtyType=2,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),Ki(o);return}finally{gn=x,Wn=ge,On=Ae,o._updating=Ye,Wi=0}o._dirtyType!==0||kl(A,o)?A._flushSync?(A._flushSync=!1,Ki(o)):Q&&it(()=>{Ki(o)}):(A._flushSync=!1,Q&&(g.clear(),o._deferred=[],o._pendingEditorState=null))}function Tr(o,i,a){o._updating?o._updates.push([i,a]):Il(o,i,a)}class wo extends Ps{constructor(i){super(i)}decorate(){Y(47)}isIsolated(){return!1}isInline(){return!0}isKeyboardSelectable(){return!0}}function En(o){return o instanceof wo}class zi extends Ps{constructor(i){super(i),this.__last=this.__first=null,this.__indent=this.__format=this.__size=0,this.__dir=null}getFormat(){return this.getLatest().__format}getFormatType(){let i=this.getFormat();return Ne[i]||""}getIndent(){return this.getLatest().__indent}getChildren(){let i=[],a=this.getFirstChild();for(;a!==null;)i.push(a),a=a.getNextSibling();return i}getChildrenKeys(){let i=[],a=this.getFirstChild();for(;a!==null;)i.push(a.__key),a=a.getNextSibling();return i}getChildrenSize(){return this.getLatest().__size}isEmpty(){return this.getChildrenSize()===0}isDirty(){let i=hn()._dirtyElements;return i!==null&&i.has(this.__key)}isLastChild(){let i=this.getLatest(),a=this.getParentOrThrow().getLastChild();return a!==null&&a.is(i)}getAllTextNodes(){let i=[],a=this.getFirstChild();for(;a!==null;){if(Ct(a)&&i.push(a),Je(a)){let g=a.getAllTextNodes();i.push(...g)}a=a.getNextSibling()}return i}getFirstDescendant(){let i=this.getFirstChild();for(;i!==null;){if(Je(i)){let a=i.getFirstChild();if(a!==null){i=a;continue}}break}return i}getLastDescendant(){let i=this.getLastChild();for(;i!==null;){if(Je(i)){let a=i.getLastChild();if(a!==null){i=a;continue}}break}return i}getDescendantByIndex(i){let a=this.getChildren(),g=a.length;return i>=g?(i=a[g-1],Je(i)&&i.getLastDescendant()||i||null):(i=a[i],Je(i)&&i.getFirstDescendant()||i||null)}getFirstChild(){let i=this.getLatest().__first;return i===null?null:mt(i)}getFirstChildOrThrow(){let i=this.getFirstChild();return i===null&&Y(45,this.__key),i}getLastChild(){let i=this.getLatest().__last;return i===null?null:mt(i)}getLastChildOrThrow(){let i=this.getLastChild();return i===null&&Y(96,this.__key),i}getChildAtIndex(i){var a=this.getChildrenSize();let g;if(i<a/2){for(g=this.getFirstChild(),a=0;g!==null&&a<=i;){if(a===i)return g;g=g.getNextSibling(),a++}return null}for(g=this.getLastChild(),--a;g!==null&&a>=i;){if(a===i)return g;g=g.getPreviousSibling(),a--}return null}getTextContent(){let i="",a=this.getChildren(),g=a.length;for(let C=0;C<g;C++){let x=a[C];i+=x.getTextContent(),Je(x)&&C!==g-1&&!x.isInline()&&(i+=`
|
|
69
69
|
|
|
70
|
-
`)}return i}getTextContentSize(){let i=0,a=this.getChildren(),g=a.length;for(let C=0;C<g;C++){let x=a[C];i+=x.getTextContentSize(),Je(x)&&C!==g-1&&!x.isInline()&&(i+=2)}return i}getDirection(){return this.getLatest().__dir}hasFormat(i){return i!==""?(i=be[i],(this.getFormat()&i)!==0):!1}select(i,a){Jn();let g=Vt(),C=i,x=a;var D=this.getChildrenSize();if(!this.canBeEmpty()){if(i===0&&a===0){if(i=this.getFirstChild(),Ct(i)||Je(i))return i.select(0,0)}else if(!(i!==void 0&&i!==D||a!==void 0&&a!==D)&&(i=this.getLastChild(),Ct(i)||Je(i)))return i.select()}if(C===void 0&&(C=D),x===void 0&&(x=D),D=this.__key,Mt(g))g.anchor.set(D,C,"element"),g.focus.set(D,x,"element"),g.dirty=!0;else return Al(D,C,D,x,"element","element");return g}selectStart(){let i=this.getFirstDescendant();return i?i.selectStart():this.select()}selectEnd(){let i=this.getLastDescendant();return i?i.selectEnd():this.select()}clear(){let i=this.getWritable();return this.getChildren().forEach(a=>a.remove()),i}append(...i){return this.splice(this.getChildrenSize(),0,i)}setDirection(i){let a=this.getWritable();return a.__dir=i,a}setFormat(i){return this.getWritable().__format=i!==""?be[i]:0,this}setIndent(i){return this.getWritable().__indent=i,this}splice(i,a,g){let C=g.length,x=this.getChildrenSize(),D=this.getWritable(),Q=D.__key;var ge=[],Ae=[];let Ye=this.getChildAtIndex(i+a),Xe=null,Ke=x-a+C;if(i!==0)if(i===x)Xe=this.getLastChild();else{var Pe=this.getChildAtIndex(i);Pe!==null&&(Xe=Pe.getPreviousSibling())}if(0<a){var pt=Xe===null?this.getFirstChild():Xe.getNextSibling();for(Pe=0;Pe<a;Pe++){pt===null&&Y(100);var wt=pt.getNextSibling(),Ft=pt.__key;pt=pt.getWritable(),Nt(pt),Ae.push(Ft),pt=wt}}for(Pe=Xe,wt=0;wt<C;wt++){Ft=g[wt],Pe!==null&&Ft.is(Pe)&&(Xe=Pe=Pe.getPreviousSibling()),pt=Ft.getWritable(),pt.__parent===Q&&Ke--,Nt(pt);let zt=Ft.__key;Pe===null?(D.__first=zt,pt.__prev=null):(Pe=Pe.getWritable(),Pe.__next=zt,pt.__prev=Pe.__key),Ft.__key===Q&&Y(76),pt.__parent=Q,ge.push(zt),Pe=Ft}if(i+a===x?Pe!==null&&(Pe.getWritable().__next=null,D.__last=Pe.__key):Ye!==null&&(i=Ye.getWritable(),Pe!==null?(a=Pe.getWritable(),i.__prev=Pe.__key,a.__next=Ye.__key):i.__prev=null),D.__size=Ke,Ae.length&&(i=Vt(),Mt(i))){Ae=new Set(Ae),ge=new Set(ge);let{anchor:zt,focus:Yn}=i;wo(zt,Ae,ge)&&ds(zt,zt.getNode(),this,Xe,Ye),wo(Yn,Ae,ge)&&ds(Yn,Yn.getNode(),this,Xe,Ye),Ke!==0||this.canBeEmpty()||or(this)||this.remove()}return D}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(){return null}canIndent(){return!0}collapseAtStart(){return!1}excludeFromCopy(){return!1}canExtractContents(){return!0}canReplaceWith(){return!0}canInsertAfter(){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(){return!1}extractWithChild(){return!1}}function Je(o){return o instanceof Ui}function wo(o,i,a){for(o=o.getNode();o;){let g=o.__key;if(i.has(g)&&!a.has(g))return!0;o=o.getParent()}return!1}class cr extends Ui{static getType(){return"root"}static clone(){return new cr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){let i=this.__cachedText;return!hs()&&hn()._dirtyType!==0||i===null?super.getTextContent():i}remove(){Y(52)}replace(){Y(53)}insertBefore(){Y(54)}insertAfter(){Y(55)}updateDOM(){return!1}append(...i){for(let a=0;a<i.length;a++){let g=i[a];Je(g)||En(g)||Y(56)}return super.append(...i)}static importJSON(i){let a=bt();return a.setFormat(i.format),a.setIndent(i.indent),a.setDirection(i.direction),a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function nr(o){return o instanceof cr}function kl(o,i){if(i=i.getEditorState()._selection,o=o._selection,o!==null){if(o.dirty||!o.is(i))return!0}else if(i!==null)return!0;return!1}function Gi(){return new Gs(new Map([["root",new cr]]))}function Pl(o){let i=o.exportJSON();var a=o.constructor;if(i.type!==a.getType()&&Y(130,a.name),Je(o)){let g=i.children;for(Array.isArray(g)||Y(59,a.name),o=o.getChildren(),a=0;a<o.length;a++){let C=Pl(o[a]);g.push(C)}}return i}class Gs{constructor(i,a){this._nodeMap=i,this._selection=a||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(i){return Ll(this,i)}clone(i){return i=new Gs(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Ll(this,()=>({root:Pl(bt())}))}}class Hr extends Ui{static getType(){return"paragraph"}static clone(i){return new Hr(i.__key)}createDOM(i){let a=document.createElement("p");return i=Bt(i.theme,"paragraph"),i!==void 0&&a.classList.add(...i),a}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Ys,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&fo(i)){this.isEmpty()&&i.append(document.createElement("br"));var a=this.getFormatType();i.style.textAlign=a,(a=this.getDirection())&&(i.dir=a),a=this.getIndent(),0<a&&(i.style.textIndent=`${20*a}px`)}return{element:i}}static importJSON(i){let a=Wr();return a.setFormat(i.format),a.setIndent(i.indent),a.setDirection(i.direction),a}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(i,a){i=Wr();let g=this.getDirection();return i.setDirection(g),this.insertAfter(i,a),i}collapseAtStart(){let i=this.getChildren();if(i.length===0||Ct(i[0])&&i[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 Ys(o){let i=Wr();return o.style&&(i.setFormat(o.style.textAlign),o=parseInt(o.style.textIndent,10)/20,0<o&&i.setIndent(o)),{node:i}}function Wr(){return Nr(new Hr)}function Oo(o,i,a,g){let C=o._keyToDOMMap;C.clear(),o._editorState=Gi(),o._pendingEditorState=g,o._compositionKey=null,o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),o._normalizedNodes=new Set,o._updateTags=new Set,o._updates=[],o._blockCursorElement=null,g=o._observer,g!==null&&(g.disconnect(),o._observer=null),i!==null&&(i.textContent=""),a!==null&&(a.textContent="",C.set("root",a))}function js(o,i){let a=new Map,g=new Set,C=x=>{Object.keys(x).forEach(D=>{let Q=a.get(D);Q===void 0&&(Q=[],a.set(D,Q)),Q.push(x[D])})};return o.forEach(x=>{x=x.klass.importDOM!=null?x.klass.importDOM.bind(x.klass):null,x==null||g.has(x)||(g.add(x),x=x(),x!==null&&C(x))}),i&&C(i),a}class Vs{constructor(i,a,g,C,x,D,Q){this._parentEditor=a,this._rootElement=null,this._editorState=i,this._compositionKey=this._pendingEditorState=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=C,this._nodes=g,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,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=Ze(),this._onError=x,this._htmlConversions=D,this._editable=Q,this._headless=a!==null&&a._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(i){let a=this._listeners.update;return a.add(i),()=>{a.delete(i)}}registerEditableListener(i){let a=this._listeners.editable;return a.add(i),()=>{a.delete(i)}}registerDecoratorListener(i){let a=this._listeners.decorator;return a.add(i),()=>{a.delete(i)}}registerTextContentListener(i){let a=this._listeners.textcontent;return a.add(i),()=>{a.delete(i)}}registerRootListener(i){let a=this._listeners.root;return i(this._rootElement,null),a.add(i),()=>{i(null,this._rootElement),a.delete(i)}}registerCommand(i,a,g){g===void 0&&Y(35);let C=this._commands;C.has(i)||C.set(i,[new Set,new Set,new Set,new Set,new Set]);let x=C.get(i);x===void 0&&Y(36,String(i));let D=x[g];return D.add(a),()=>{D.delete(a),x.every(Q=>Q.size===0)&&C.delete(i)}}registerMutationListener(i,a){this._nodes.get(i.getType())===void 0&&Y(37,i.name);let g=this._listeners.mutation;return g.set(a,i),()=>{g.delete(a)}}registerNodeTransformToKlass(i,a){var g=i.getType();return g=this._nodes.get(g),g===void 0&&Y(37,i.name),g.transforms.add(a),g}registerNodeTransform(i,a){var g=this.registerNodeTransformToKlass(i,a);let C=[g];return g=g.replaceWithKlass,g!=null&&(g=this.registerNodeTransformToKlass(g,a),C.push(g)),jt(this,i.getType()),()=>{C.forEach(x=>x.transforms.delete(a))}}hasNode(i){return this._nodes.has(i.getType())}hasNodes(i){return i.every(this.hasNode.bind(this))}dispatchCommand(i,a){return ct(this,i,a)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(i){let a=this._rootElement;if(i!==a){let D=Bt(this._config.theme,"root");var g=this._pendingEditorState||this._editorState;if(this._rootElement=i,Oo(this,a,i,g),a!==null){if(!this._config.disableEvents){Is!==0&&(Is--,Is===0&&a.ownerDocument.removeEventListener("selectionchange",Oa));var C=a.__lexicalEditor;if(C!=null){if(C._parentEditor!==null){var x=pe(C);x=x[x.length-1]._key,ls.get(x)===C&&ls.delete(x)}else ls.delete(C._key);a.__lexicalEditor=null}for(C=wa(a),x=0;x<C.length;x++)C[x]();a.__lexicalEventHandles=[]}D!=null&&a.classList.remove(...D)}i!==null?(g=(g=i.ownerDocument)&&g.defaultView||null,C=i.style,C.userSelect="text",C.whiteSpace="pre-wrap",C.wordBreak="break-word",i.setAttribute("data-lexical-editor","true"),this._window=g,this._dirtyType=2,Oe(this),this._updateTags.add("history-merge"),zi(this),this._config.disableEvents||Ic(i,this),D!=null&&i.classList.add(...D)):(this._editorState=g,this._window=this._pendingEditorState=null),Ei("root",this,!1,i,a)}}getElementByKey(i){return this._keyToDOMMap.get(i)||null}getEditorState(){return this._editorState}setEditorState(i,a){i.isEmpty()&&Y(38),en(this);let g=this._pendingEditorState,C=this._updateTags;a=a!==void 0?a.tag:null,g===null||g.isEmpty()||(a!=null&&C.add(a),zi(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,a!=null&&C.add(a),zi(this)}parseEditorState(i,a){i=typeof i=="string"?JSON.parse(i):i;let g=Gi(),C=gn,x=Wn,D=On,Q=this._dirtyElements,ge=this._dirtyLeaves,Ae=this._cloneNotNeeded,Ye=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,gn=g,Wn=!1,On=this;try{vo(i.root,this._nodes),a&&a(),g._readOnly=!0}catch(Xe){Xe instanceof Error&&this._onError(Xe)}finally{this._dirtyElements=Q,this._dirtyLeaves=ge,this._cloneNotNeeded=Ae,this._dirtyType=Ye,gn=C,Wn=x,On=D}return g}update(i,a){Tr(this,i,a)}focus(i,a={}){let g=this._rootElement;g!==null&&(g.setAttribute("autocapitalize","off"),Tr(this,()=>{let C=Vt(),x=bt();C!==null?C.dirty=!0:x.getChildrenSize()!==0&&(a.defaultSelection==="rootStart"?x.selectStart():x.selectEnd())},{onUpdate:()=>{g.removeAttribute("autocapitalize"),i&&i()},tag:"focus"}),this._pendingEditorState===null&&g.removeAttribute("autocapitalize"))}blur(){var i=this._rootElement;i!==null&&i.blur(),i=jr(this._window),i!==null&&i.removeAllRanges()}isEditable(){return this._editable}setEditable(i){this._editable!==i&&(this._editable=i,Ei("editable",this,!0,i))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Do extends Ui{constructor(i,a){super(a),this.__colSpan=i,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(i){return this.getWritable().__colSpan=i,this}getRowSpan(){return this.__rowSpan}setRowSpan(i){return this.getWritable().__rowSpan=i,this}}function Yi(o){return o instanceof Do}class $l extends Ui{}function Fl(o){return o instanceof $l}class $a extends Ui{}function Bl(o){return o instanceof $a}return We.$INTERNAL_isPointSelection=Hs,We.$addUpdateTag=function(o){Jn(),hn()._updateTags.add(o)},We.$applyNodeReplacement=Nr,We.$copyNode=Mi,We.$createLineBreakNode=Zr,We.$createNodeSelection=Ml,We.$createParagraphNode=Wr,We.$createPoint=Fr,We.$createRangeSelection=function(){let o=Fr("root",0,"element"),i=Fr("root",0,"element");return new Ni(o,i,0,"")},We.$createTabNode=Bi,We.$createTextNode=Un,We.$getAdjacentNode=Ht,We.$getNearestNodeFromDOMNode=Kt,We.$getNearestRootOrShadowRoot=sr,We.$getNodeByKey=mt,We.$getPreviousSelection=Er,We.$getRoot=bt,We.$getSelection=Vt,We.$getTextContent=function(){let o=Vt();return o===null?"":o.getTextContent()},We.$hasAncestor=Zn,We.$hasUpdateTag=function(o){return hn()._updateTags.has(o)},We.$insertNodes=function(o){let i=Vt()||Er();i===null&&(i=bt().selectEnd()),i.insertNodes(o)},We.$isBlockElementNode=function(o){return Je(o)&&!o.isInline()},We.$isDecoratorNode=En,We.$isElementNode=Je,We.$isInlineElementOrDecoratorNode=function(o){return Je(o)&&o.isInline()||En(o)&&o.isInline()},We.$isLeafNode=function(o){return Ct(o)||ki(o)||En(o)},We.$isLineBreakNode=ki,We.$isNodeSelection=ar,We.$isParagraphNode=function(o){return o instanceof Hr},We.$isRangeSelection=Mt,We.$isRootNode=nr,We.$isRootOrShadowRoot=or,We.$isTabNode=Ma,We.$isTextNode=Ct,We.$nodesOfType=function(o){var i=Br();let a=i._readOnly,g=o.getType();i=i._nodeMap;let C=[];for(let[,x]of i)x instanceof o&&x.__type===g&&(a||x.isAttached())&&C.push(x);return C},We.$normalizeSelection__EXPERIMENTAL=Le,We.$parseSerializedNode=function(o){return vo(o,hn()._nodes)},We.$selectAll=function(){var o=bt();o=o.select(0,o.getChildrenSize()),nn(Le(o))},We.$setCompositionKey=gt,We.$setSelection=nn,We.$splitNode=function(o,i){let a=o.getChildAtIndex(i);a==null&&(a=o),or(o)&&Y(102);let g=D=>{const Q=D.getParentOrThrow(),ge=or(Q),Ae=D!==a||ge?Mi(D):D;if(ge){if(!Je(D)||!Je(Ae))throw Error("Children of a root must be ElementNode");return D.insertAfter(Ae),[D,Ae,Ae]}const[Ye,Xe,Ke]=g(Q);return D=D.getNextSiblings(),Ke.append(Ae,...D),[Ye,Xe,Ae]},[C,x]=g(a);return[C,x]},We.BLUR_COMMAND=Z,We.CAN_REDO_COMMAND={},We.CAN_UNDO_COMMAND={},We.CLEAR_EDITOR_COMMAND={},We.CLEAR_HISTORY_COMMAND={},We.CLICK_COMMAND=t,We.COMMAND_PRIORITY_CRITICAL=4,We.COMMAND_PRIORITY_EDITOR=0,We.COMMAND_PRIORITY_HIGH=3,We.COMMAND_PRIORITY_LOW=1,We.COMMAND_PRIORITY_NORMAL=2,We.CONTROLLED_TEXT_INSERTION_COMMAND=d,We.COPY_COMMAND=Ee,We.CUT_COMMAND=de,We.DELETE_CHARACTER_COMMAND=n,We.DELETE_LINE_COMMAND=T,We.DELETE_WORD_COMMAND=_,We.DEPRECATED_$computeGridMap=function(o,i,a){let g=[],C=null,x=null;o=o.getChildren();for(let Ye=0;Ye<o.length;Ye++){var D=o[Ye];Bl(D)||Y(108);var Q=D.getChildren();D=0;for(let Xe of Q){for(Yi(Xe)||Y(109);g[Ye]!==void 0&&g[Ye][D]!==void 0;)D++;Q=Ye;var ge=D,Ae=Xe;let Ke={cell:Ae,startColumn:ge,startRow:Q},Pe=Ae.__rowSpan,pt=Ae.__colSpan;for(let wt=0;wt<Pe;wt++){g[Q+wt]===void 0&&(g[Q+wt]=[]);for(let Ft=0;Ft<pt;Ft++)g[Q+wt][ge+Ft]=Ke}i.is(Ae)&&(C=Ke),a.is(Ae)&&(x=Ke),D+=Xe.__colSpan}}return C===null&&Y(110),x===null&&Y(111),[g,C,x]},We.DEPRECATED_$getGridCellNodeRect=function(o){let[i,,a]=zs(o);o=a.getChildren();let g=o.length;var C=o[0].getChildren().length;let x=Array(g);for(var D=0;D<g;D++)x[D]=Array(C);for(C=0;C<g;C++){D=o[C].getChildren();let Q=0;for(let ge=0;ge<D.length;ge++){for(;x[C][Q];)Q++;let Ae=D[ge],Ye=Ae.__rowSpan||1,Xe=Ae.__colSpan||1;for(let Ke=0;Ke<Ye;Ke++)for(let Pe=0;Pe<Xe;Pe++)x[C+Ke][Q+Pe]=Ae;if(i===Ae)return{colSpan:Xe,columnIndex:Q,rowIndex:C,rowSpan:Ye};Q+=Xe}}return null},We.DEPRECATED_$getNodeTriplet=zs,We.DEPRECATED_$isGridCellNode=Yi,We.DEPRECATED_$isGridNode=Fl,We.DEPRECATED_$isGridRowNode=Bl,We.DEPRECATED_GridCellNode=Do,We.DEPRECATED_GridNode=$l,We.DEPRECATED_GridRowNode=$a,We.DRAGEND_COMMAND=Se,We.DRAGOVER_COMMAND=Te,We.DRAGSTART_COMMAND=q,We.DROP_COMMAND=z,We.DecoratorNode=So,We.ElementNode=Ui,We.FOCUS_COMMAND=O,We.FORMAT_ELEMENT_COMMAND={},We.FORMAT_TEXT_COMMAND=E,We.INDENT_CONTENT_COMMAND={},We.INSERT_LINE_BREAK_COMMAND=r,We.INSERT_PARAGRAPH_COMMAND=l,We.INSERT_TAB_COMMAND={},We.INTERNAL_PointSelection=Bs,We.KEY_ARROW_DOWN_COMMAND=P,We.KEY_ARROW_LEFT_COMMAND=k,We.KEY_ARROW_RIGHT_COMMAND=m,We.KEY_ARROW_UP_COMMAND=I,We.KEY_BACKSPACE_COMMAND=re,We.KEY_DELETE_COMMAND=ce,We.KEY_DOWN_COMMAND=M,We.KEY_ENTER_COMMAND=H,We.KEY_ESCAPE_COMMAND=te,We.KEY_MODIFIER_COMMAND=oe,We.KEY_SPACE_COMMAND=j,We.KEY_TAB_COMMAND=V,We.LineBreakNode=qr,We.MOVE_TO_END=v,We.MOVE_TO_START=G,We.OUTDENT_CONTENT_COMMAND={},We.PASTE_COMMAND=f,We.ParagraphNode=Hr,We.REDO_COMMAND=w,We.REMOVE_TEXT_COMMAND=p,We.RootNode=cr,We.SELECTION_CHANGE_COMMAND=e,We.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND={},We.SELECT_ALL_COMMAND=K,We.TabNode=cs,We.TextNode=Fi,We.UNDO_COMMAND=S,We.createCommand=function(){return{}},We.createEditor=function(o){var i=o||{},a=On,g=i.theme||{};let C=o===void 0?a:i.parentEditor||null,x=i.disableEvents||!1,D=Gi(),Q=i.namespace||(C!==null?C._config.namespace:Ze()),ge=i.editorState,Ae=[cr,Fi,qr,cs,Hr,...i.nodes||[]],{onError:Ye,html:Xe}=i;if(i=i.editable!==void 0?i.editable:!0,o===void 0&&a!==null)o=a._nodes;else for(o=new Map,a=0;a<Ae.length;a++){let Pe=Ae[a],pt=null;var Ke=null;typeof Pe!="function"&&(Ke=Pe,Pe=Ke.replace,pt=Ke.with,Ke=Ke.withKlass||null);let wt=Pe.getType(),Ft=Pe.transform(),zt=new Set;Ft!==null&&zt.add(Ft),o.set(wt,{exportDOM:Xe&&Xe.export?Xe.export.get(Pe):void 0,klass:Pe,replace:pt,replaceWithKlass:Ke,transforms:zt})}return g=new Vs(D,C,o,{disableEvents:x,namespace:Q,theme:g},Ye||console.error,js(o,Xe?Xe.import:void 0),i),ge!==void 0&&(g._pendingEditorState=ge,g._dirtyType=2),g},We.getNearestEditorFromDOMNode=vt,We.isCurrentlyReadOnlyMode=hs,We.isHTMLAnchorElement=function(o){return fo(o)&&o.tagName==="A"},We.isHTMLElement=fo,We.isSelectionCapturedInDecoratorInput=it,We.isSelectionWithinEditor=st,We}var Jc,Lf;function Yt(){return Lf||(Lf=1,Jc=process.env.NODE_ENV==="development"?BN():HN()),Jc}var If;function WN(){if(If)return qc;If=1;var e=qn(),t=Yt(),n=nt;const r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var d=r?n.useLayoutEffect:n.useEffect;const f={tag:"history-merge"};function p({initialConfig:T,children:E}){const S=n.useMemo(()=>{const{theme:w,namespace:M,editor__DEPRECATED:m,nodes:v,onError:k,editorState:G,html:I}=T,P=e.createLexicalComposerContext(null,w);let H=m||null;if(H===null){const j=t.createEditor({editable:T.editable,html:I,namespace:M,nodes:v,onError:re=>k(re,j),theme:w});_(j,G),H=j}return[H,P]},[]);return d(()=>{const w=T.editable,[M]=S;M.setEditable(w!==void 0?w:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:S},E)}function _(T,E){if(E!==null){if(E===void 0)T.update(()=>{const S=t.$getRoot();if(S.isEmpty()){const w=t.$createParagraphNode();S.append(w);const M=r?document.activeElement:null;(t.$getSelection()!==null||M!==null&&M===T.getRootElement())&&w.select()}},f);else if(E!==null)switch(typeof E){case"string":{const S=T.parseEditorState(E);T.setEditorState(S,f);break}case"object":{T.setEditorState(E,f);break}case"function":{T.update(()=>{t.$getRoot().isEmpty()&&E(T)},f);break}}}}return qc.LexicalComposer=p,qc}var Xc={},kf;function KN(){if(kf)return Xc;kf=1;var e=qn(),t=Yt(),n=nt;let r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var l=r?n.useLayoutEffect:n.useEffect;let d={tag:"history-merge"};function f(p,_){if(_!==null){if(_===void 0)p.update(()=>{var T=t.$getRoot();if(T.isEmpty()){let E=t.$createParagraphNode();T.append(E),T=r?document.activeElement:null,(t.$getSelection()!==null||T!==null&&T===p.getRootElement())&&E.select()}},d);else if(_!==null)switch(typeof _){case"string":let T=p.parseEditorState(_);p.setEditorState(T,d);break;case"object":p.setEditorState(_,d);break;case"function":p.update(()=>{t.$getRoot().isEmpty()&&_(p)},d)}}}return Xc.LexicalComposer=function({initialConfig:p,children:_}){let T=n.useMemo(()=>{const{theme:E,namespace:S,editor__DEPRECATED:w,nodes:M,onError:m,editorState:v,html:k}=p,G=e.createLexicalComposerContext(null,E);let I=w||null;if(I===null){const P=t.createEditor({editable:p.editable,html:k,namespace:S,nodes:M,onError:H=>m(H,P),theme:E});f(P,v),I=P}return[I,G]},[]);return l(()=>{let E=p.editable,[S]=T;S.setEditable(E!==void 0?E:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:T},_)},Xc}const zN=process.env.NODE_ENV==="development"?WN():KN();var UN=zN,Qc={},eu,Pf;function GN(){if(Pf)return eu;Pf=1;var e=qn(),t=nt,l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function d(_){const[T]=e.useLexicalComposerContext(),E=t.useMemo(()=>_(T),[T,_]),S=t.useRef(E.initialValueFn()),[w,M]=t.useState(S.current);return l(()=>{const{initialValueFn:m,subscribe:v}=E,k=m();return S.current!==k&&(S.current=k,M(k)),v(G=>{S.current=G,M(G)})},[E,_]),w}function f(_){return{initialValueFn:()=>_.isEditable(),subscribe:T=>_.registerEditableListener(T)}}function p(){return d(f)}return eu=p,eu}var tu,$f;function YN(){if($f)return tu;$f=1;var e=qn(),t=nt,n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function r(d){let[f]=e.useLexicalComposerContext(),p=t.useMemo(()=>d(f),[f,d]),_=t.useRef(p.initialValueFn()),[T,E]=t.useState(_.current);return n(()=>{let{initialValueFn:S,subscribe:w}=p,M=S();return _.current!==M&&(_.current=M,E(M)),w(m=>{_.current=m,E(m)})},[p,d]),T}function l(d){return{initialValueFn:()=>d.isEditable(),subscribe:f=>d.registerEditableListener(f)}}return tu=function(){return r(l)},tu}var nu,Ff;function Cp(){return Ff||(Ff=1,nu=process.env.NODE_ENV==="development"?GN():YN()),nu}var Xi={},Bf;function jN(){if(Bf)return Xi;Bf=1;var e=Yt();function t(_,T){let E=_.getFirstChild(),S=0;e:for(;E!==null;){if(e.$isElementNode(E)){const m=E.getFirstChild();if(m!==null){E=m;continue}}else if(e.$isTextNode(E)){const m=E.getTextContentSize();if(S+m>T)return{node:E,offset:T-S};S+=m}const w=E.getNextSibling();if(w!==null){E=w;continue}let M=E.getParent();for(;M!==null;){const m=M.getNextSibling();if(m!==null){E=m;continue e}M=M.getParent()}break}return null}function n(_,T=!0){if(_)return!1;let E=l();return T&&(E=E.trim()),E===""}function r(_,T){return()=>n(_,T)}function l(){return e.$getRoot().getTextContent()}function d(_){if(!n(_,!1))return!1;const E=e.$getRoot().getChildren(),S=E.length;if(S>1)return!1;for(let w=0;w<S;w++){const M=E[w];if(e.$isDecoratorNode(M))return!1;if(e.$isElementNode(M)){if(!e.$isParagraphNode(M)||M.__indent!==0)return!1;const m=M.getChildren(),v=m.length;for(let k=0;k<v;k++){const G=m[w];if(!e.$isTextNode(G))return!1}}}return!0}function f(_){return()=>d(_)}function p(_,T,E,S){const w=P=>P instanceof E,M=P=>{const H=e.$createTextNode(P.getTextContent());H.setFormat(P.getFormat()),P.replace(H)},m=P=>P.getLatest().__mode,v=P=>{if(!P.isSimpleText())return;const H=P.getPreviousSibling();let j=P.getTextContent(),re=P,te;if(e.$isTextNode(H)){const ce=H.getTextContent(),V=ce+j,z=T(V);if(w(H))if(z===null||m(H)!==0){M(H);return}else{const q=z.end-ce.length;if(q>0){const Te=j.slice(0,q),Se=ce+Te;if(H.select(),H.setTextContent(Se),q===j.length)P.remove();else{const Ee=j.slice(q);P.setTextContent(Ee)}return}}else if(z===null||z.start<ce.length)return}for(;;){te=T(j);let ce=te===null?"":j.slice(te.end);if(j=ce,ce===""){const q=re.getNextSibling();if(e.$isTextNode(q)){ce=re.getTextContent()+q.getTextContent();const Te=T(ce);if(Te===null){w(q)?M(q):q.markDirty();return}else if(Te.start!==0)return}}else{const q=T(ce);if(q!==null&&q.start===0)return}if(te===null)return;if(te.start===0&&e.$isTextNode(H)&&H.isTextEntity())continue;let V;te.start===0?[V,re]=re.splitText(te.end):[,V,re]=re.splitText(te.start,te.end);const z=S(V);if(z.setFormat(V.getFormat()),V.replace(z),re==null)return}},k=P=>{const H=P.getTextContent(),j=T(H);if(j===null||j.start!==0){M(P);return}if(H.length>j.end){P.splitText(j.end);return}const re=P.getPreviousSibling();e.$isTextNode(re)&&re.isTextEntity()&&(M(re),M(P));const te=P.getNextSibling();e.$isTextNode(te)&&te.isTextEntity()&&(M(te),w(P)&&M(P))},G=_.registerNodeTransform(e.TextNode,v),I=_.registerNodeTransform(E,k);return[G,I]}return Xi.$canShowPlaceholder=d,Xi.$canShowPlaceholderCurry=f,Xi.$findTextIntersectionFromCharacters=t,Xi.$isRootTextContentEmpty=n,Xi.$isRootTextContentEmptyCurry=r,Xi.$rootTextContent=l,Xi.registerLexicalTextEntity=p,Xi}var Qi={},Hf;function VN(){if(Hf)return Qi;Hf=1;var e=Yt();function t(l,d=!0){return l?!1:(l=n(),d&&(l=l.trim()),l==="")}function n(){return e.$getRoot().getTextContent()}function r(l){if(!t(l,!1))return!1;l=e.$getRoot().getChildren();let d=l.length;if(1<d)return!1;for(let p=0;p<d;p++){var f=l[p];if(e.$isDecoratorNode(f))return!1;if(e.$isElementNode(f)){if(!e.$isParagraphNode(f)||f.__indent!==0)return!1;f=f.getChildren();let _=f.length;for(let T=0;T<_;T++)if(!e.$isTextNode(f[p]))return!1}}return!0}return Qi.$canShowPlaceholder=r,Qi.$canShowPlaceholderCurry=function(l){return()=>r(l)},Qi.$findTextIntersectionFromCharacters=function(l,d){var f=l.getFirstChild();l=0;e:for(;f!==null;){if(e.$isElementNode(f)){var p=f.getFirstChild();if(p!==null){f=p;continue}}else if(e.$isTextNode(f)){if(p=f.getTextContentSize(),l+p>d)return{node:f,offset:d-l};l+=p}if(p=f.getNextSibling(),p!==null)f=p;else{for(f=f.getParent();f!==null;){if(p=f.getNextSibling(),p!==null){f=p;continue e}f=f.getParent()}break}}return null},Qi.$isRootTextContentEmpty=t,Qi.$isRootTextContentEmptyCurry=function(l,d){return()=>t(l,d)},Qi.$rootTextContent=n,Qi.registerLexicalTextEntity=function(l,d,f,p){let _=E=>{const S=e.$createTextNode(E.getTextContent());S.setFormat(E.getFormat()),E.replace(S)},T=l.registerNodeTransform(e.TextNode,E=>{if(E.isSimpleText()){var S=E.getPreviousSibling(),w=E.getTextContent(),M=E;if(e.$isTextNode(S)){var m=S.getTextContent(),v=d(m+w);if(S instanceof f){if(v===null||S.getLatest().__mode!==0){_(S);return}if(v=v.end-m.length,0<v){M=w.slice(0,v),M=m+M,S.select(),S.setTextContent(M),v===w.length?E.remove():(S=w.slice(v),E.setTextContent(S));return}}else if(v===null||v.start<m.length)return}for(;;){if(E=d(w),w=v=E===null?"":w.slice(E.end),v===""){if(m=M.getNextSibling(),e.$isTextNode(m)){if(v=M.getTextContent()+m.getTextContent(),v=d(v),v===null){m instanceof f?_(m):m.markDirty();break}else if(v.start!==0)break}}else if(m=d(v),m!==null&&m.start===0)break;if(E===null)break;if(E.start===0&&e.$isTextNode(S)&&S.isTextEntity())continue;let k;if(E.start===0?[k,M]=M.splitText(E.end):[,k,M]=M.splitText(E.start,E.end),E=p(k),E.setFormat(k.getFormat()),k.replace(E),M==null)break}}});return l=l.registerNodeTransform(f,E=>{var S=E.getTextContent();const w=d(S);w===null||w.start!==0?_(E):S.length>w.end?E.splitText(w.end):(S=E.getPreviousSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),_(E)),S=E.getNextSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),E instanceof f&&_(E)))}),[T,l]},Qi}var ru,Wf;function Ep(){return Wf||(Wf=1,ru=process.env.NODE_ENV==="development"?jN():VN()),ru}var Sn={},jn={},Kf;function qN(){if(Kf)return jn;Kf=1;var e=Yt();const t=new Map;function n(K){let O=K;for(;O!=null;){if(O.nodeType===Node.TEXT_NODE)return O;O=O.firstChild}return null}function r(K){const O=K.parentNode;if(O==null)throw new Error("Should never happen");return[O,Array.from(O.childNodes).indexOf(K)]}function l(K,O,Z,oe,Y){const W=O.getKey(),J=oe.getKey(),R=document.createRange();let U=K.getElementByKey(W),X=K.getElementByKey(J),fe=Z,_e=Y;if(e.$isTextNode(O)&&(U=n(U)),e.$isTextNode(oe)&&(X=n(X)),O===void 0||oe===void 0||U===null||X===null)return null;U.nodeName==="BR"&&([U,fe]=r(U)),X.nodeName==="BR"&&([X,_e]=r(X));const B=U.firstChild;U===X&&B!=null&&B.nodeName==="BR"&&fe===0&&_e===0&&(_e=1);try{R.setStart(U,fe),R.setEnd(X,_e)}catch{return null}return R.collapsed&&(fe!==_e||W!==J)&&(R.setStart(X,_e),R.setEnd(U,fe)),R}function d(K,O){const Z=K.getRootElement();if(Z===null)return[];const oe=Z.getBoundingClientRect(),Y=getComputedStyle(Z),W=parseFloat(Y.paddingLeft)+parseFloat(Y.paddingRight),J=Array.from(O.getClientRects());let R=J.length;J.sort((X,fe)=>{const _e=X.top-fe.top;return Math.abs(_e)<=3?X.left-fe.left:_e});let U;for(let X=0;X<R;X++){const fe=J[X],_e=U&&U.top<=fe.top&&U.top+U.height>fe.top&&U.left+U.width>fe.left,B=fe.width+W===oe.width;if(_e||B){J.splice(X--,1),R--;continue}U=fe}return J}function f(K){const O={},Z=K.split(";");for(const oe of Z)if(oe!==""){const[Y,W]=oe.split(/:([^]+)/);Y&&W&&(O[Y.trim()]=W.trim())}return O}function p(K){let O=t.get(K);return O===void 0&&(O=f(K),t.set(K,O)),Object.freeze(O),O}function _(K){let O="";for(const Z in K)Z&&(O+=`${Z}: ${K[Z]};`);return O}function T(K,O){return K.__first=O.__first,K.__last=O.__last,K.__size=O.__size,K.__format=O.__format,K.__indent=O.__indent,K.__dir=O.__dir,K}function E(K,O){return K.__format=O.__format,K.__style=O.__style,K.__mode=O.__mode,K.__detail=O.__detail,K}function S(K){const Z=K.constructor.clone(K);return Z.__parent=K.__parent,Z.__next=K.__next,Z.__prev=K.__prev,e.$isElementNode(K)&&e.$isElementNode(Z)?T(Z,K):e.$isTextNode(K)&&e.$isTextNode(Z)?E(Z,K):Z}function w(K,O){if(O.isSelected(K)&&!O.isSegmented()&&!O.isToken()&&e.$INTERNAL_isPointSelection(K)){const Z=K.anchor.getNode(),oe=K.focus.getNode(),Y=O.is(Z),W=O.is(oe);if(Y||W){const J=K.isBackward(),[R,U]=K.getCharacterOffsets(),X=Z.is(oe),fe=O.is(J?oe:Z),_e=O.is(J?Z:oe);let B=0,A;if(X)B=R>U?U:R,A=R>U?R:U;else if(fe)B=J?U:R,A=void 0;else if(_e){const F=J?R:U;B=0,A=F}return O.__text=O.__text.slice(B,A),O}}return O}function M(K){if(K.type==="text")return K.offset===K.getNode().getTextContentSize();const O=K.getNode();if(!e.$isElementNode(O))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return K.offset===O.getChildrenSize()}function m(K,O,Z){let oe=O.getNode(),Y=Z;if(e.$isElementNode(oe)){const W=oe.getDescendantByIndex(O.offset);W!==null&&(oe=W)}for(;Y>0&&oe!==null;){if(e.$isElementNode(oe)){const X=oe.getLastDescendant();X!==null&&(oe=X)}let W=oe.getPreviousSibling(),J=0;if(W===null){let X=oe.getParentOrThrow(),fe=X.getPreviousSibling();for(;fe===null;){if(X=X.getParent(),X===null){W=null;break}fe=X.getPreviousSibling()}X!==null&&(J=X.isInline()?0:2,W=fe)}let R=oe.getTextContent();R===""&&e.$isElementNode(oe)&&!oe.isInline()&&(R=`
|
|
70
|
+
`)}return i}getTextContentSize(){let i=0,a=this.getChildren(),g=a.length;for(let C=0;C<g;C++){let x=a[C];i+=x.getTextContentSize(),Je(x)&&C!==g-1&&!x.isInline()&&(i+=2)}return i}getDirection(){return this.getLatest().__dir}hasFormat(i){return i!==""?(i=be[i],(this.getFormat()&i)!==0):!1}select(i,a){Jn();let g=qt(),C=i,x=a;var A=this.getChildrenSize();if(!this.canBeEmpty()){if(i===0&&a===0){if(i=this.getFirstChild(),Ct(i)||Je(i))return i.select(0,0)}else if(!(i!==void 0&&i!==A||a!==void 0&&a!==A)&&(i=this.getLastChild(),Ct(i)||Je(i)))return i.select()}if(C===void 0&&(C=A),x===void 0&&(x=A),A=this.__key,Mt(g))g.anchor.set(A,C,"element"),g.focus.set(A,x,"element"),g.dirty=!0;else return Al(A,C,A,x,"element","element");return g}selectStart(){let i=this.getFirstDescendant();return i?i.selectStart():this.select()}selectEnd(){let i=this.getLastDescendant();return i?i.selectEnd():this.select()}clear(){let i=this.getWritable();return this.getChildren().forEach(a=>a.remove()),i}append(...i){return this.splice(this.getChildrenSize(),0,i)}setDirection(i){let a=this.getWritable();return a.__dir=i,a}setFormat(i){return this.getWritable().__format=i!==""?be[i]:0,this}setIndent(i){return this.getWritable().__indent=i,this}splice(i,a,g){let C=g.length,x=this.getChildrenSize(),A=this.getWritable(),Q=A.__key;var ge=[],Ae=[];let Ye=this.getChildAtIndex(i+a),Xe=null,Ke=x-a+C;if(i!==0)if(i===x)Xe=this.getLastChild();else{var Pe=this.getChildAtIndex(i);Pe!==null&&(Xe=Pe.getPreviousSibling())}if(0<a){var pt=Xe===null?this.getFirstChild():Xe.getNextSibling();for(Pe=0;Pe<a;Pe++){pt===null&&Y(100);var Ot=pt.getNextSibling(),Ft=pt.__key;pt=pt.getWritable(),Nt(pt),Ae.push(Ft),pt=Ot}}for(Pe=Xe,Ot=0;Ot<C;Ot++){Ft=g[Ot],Pe!==null&&Ft.is(Pe)&&(Xe=Pe=Pe.getPreviousSibling()),pt=Ft.getWritable(),pt.__parent===Q&&Ke--,Nt(pt);let zt=Ft.__key;Pe===null?(A.__first=zt,pt.__prev=null):(Pe=Pe.getWritable(),Pe.__next=zt,pt.__prev=Pe.__key),Ft.__key===Q&&Y(76),pt.__parent=Q,ge.push(zt),Pe=Ft}if(i+a===x?Pe!==null&&(Pe.getWritable().__next=null,A.__last=Pe.__key):Ye!==null&&(i=Ye.getWritable(),Pe!==null?(a=Pe.getWritable(),i.__prev=Pe.__key,a.__next=Ye.__key):i.__prev=null),A.__size=Ke,Ae.length&&(i=qt(),Mt(i))){Ae=new Set(Ae),ge=new Set(ge);let{anchor:zt,focus:Yn}=i;Oo(zt,Ae,ge)&&us(zt,zt.getNode(),this,Xe,Ye),Oo(Yn,Ae,ge)&&us(Yn,Yn.getNode(),this,Xe,Ye),Ke!==0||this.canBeEmpty()||or(this)||this.remove()}return A}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"element",version:1}}insertNewAfter(){return null}canIndent(){return!0}collapseAtStart(){return!1}excludeFromCopy(){return!1}canExtractContents(){return!0}canReplaceWith(){return!0}canInsertAfter(){return!0}canBeEmpty(){return!0}canInsertTextBefore(){return!0}canInsertTextAfter(){return!0}isInline(){return!1}isShadowRoot(){return!1}canMergeWith(){return!1}extractWithChild(){return!1}}function Je(o){return o instanceof zi}function Oo(o,i,a){for(o=o.getNode();o;){let g=o.__key;if(i.has(g)&&!a.has(g))return!0;o=o.getParent()}return!1}class cr extends zi{static getType(){return"root"}static clone(){return new cr}constructor(){super("root"),this.__cachedText=null}getTopLevelElementOrThrow(){Y(51)}getTextContent(){let i=this.__cachedText;return!fs()&&hn()._dirtyType!==0||i===null?super.getTextContent():i}remove(){Y(52)}replace(){Y(53)}insertBefore(){Y(54)}insertAfter(){Y(55)}updateDOM(){return!1}append(...i){for(let a=0;a<i.length;a++){let g=i[a];Je(g)||En(g)||Y(56)}return super.append(...i)}static importJSON(i){let a=bt();return a.setFormat(i.format),a.setIndent(i.indent),a.setDirection(i.direction),a}exportJSON(){return{children:[],direction:this.getDirection(),format:this.getFormatType(),indent:this.getIndent(),type:"root",version:1}}collapseAtStart(){return!0}}function nr(o){return o instanceof cr}function kl(o,i){if(i=i.getEditorState()._selection,o=o._selection,o!==null){if(o.dirty||!o.is(i))return!0}else if(i!==null)return!0;return!1}function Ui(){return new Us(new Map([["root",new cr]]))}function Pl(o){let i=o.exportJSON();var a=o.constructor;if(i.type!==a.getType()&&Y(130,a.name),Je(o)){let g=i.children;for(Array.isArray(g)||Y(59,a.name),o=o.getChildren(),a=0;a<o.length;a++){let C=Pl(o[a]);g.push(C)}}return i}class Us{constructor(i,a){this._nodeMap=i,this._selection=a||null,this._readOnly=this._flushSync=!1}isEmpty(){return this._nodeMap.size===1&&this._selection===null}read(i){return Ll(this,i)}clone(i){return i=new Us(this._nodeMap,i===void 0?this._selection:i),i._readOnly=!0,i}toJSON(){return Ll(this,()=>({root:Pl(bt())}))}}class Hr extends zi{static getType(){return"paragraph"}static clone(i){return new Hr(i.__key)}createDOM(i){let a=document.createElement("p");return i=Bt(i.theme,"paragraph"),i!==void 0&&a.classList.add(...i),a}updateDOM(){return!1}static importDOM(){return{p:()=>({conversion:Gs,priority:0})}}exportDOM(i){if({element:i}=super.exportDOM(i),i&&ho(i)){this.isEmpty()&&i.append(document.createElement("br"));var a=this.getFormatType();i.style.textAlign=a,(a=this.getDirection())&&(i.dir=a),a=this.getIndent(),0<a&&(i.style.textIndent=`${20*a}px`)}return{element:i}}static importJSON(i){let a=Wr();return a.setFormat(i.format),a.setIndent(i.indent),a.setDirection(i.direction),a}exportJSON(){return{...super.exportJSON(),type:"paragraph",version:1}}insertNewAfter(i,a){i=Wr();let g=this.getDirection();return i.setDirection(g),this.insertAfter(i,a),i}collapseAtStart(){let i=this.getChildren();if(i.length===0||Ct(i[0])&&i[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 Gs(o){let i=Wr();return o.style&&(i.setFormat(o.style.textAlign),o=parseInt(o.style.textIndent,10)/20,0<o&&i.setIndent(o)),{node:i}}function Wr(){return Nr(new Hr)}function Do(o,i,a,g){let C=o._keyToDOMMap;C.clear(),o._editorState=Ui(),o._pendingEditorState=g,o._compositionKey=null,o._dirtyType=0,o._cloneNotNeeded.clear(),o._dirtyLeaves=new Set,o._dirtyElements.clear(),o._normalizedNodes=new Set,o._updateTags=new Set,o._updates=[],o._blockCursorElement=null,g=o._observer,g!==null&&(g.disconnect(),o._observer=null),i!==null&&(i.textContent=""),a!==null&&(a.textContent="",C.set("root",a))}function Ys(o,i){let a=new Map,g=new Set,C=x=>{Object.keys(x).forEach(A=>{let Q=a.get(A);Q===void 0&&(Q=[],a.set(A,Q)),Q.push(x[A])})};return o.forEach(x=>{x=x.klass.importDOM!=null?x.klass.importDOM.bind(x.klass):null,x==null||g.has(x)||(g.add(x),x=x(),x!==null&&C(x))}),i&&C(i),a}class js{constructor(i,a,g,C,x,A,Q){this._parentEditor=a,this._rootElement=null,this._editorState=i,this._compositionKey=this._pendingEditorState=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=C,this._nodes=g,this._decorators={},this._pendingDecorators=null,this._dirtyType=0,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=Ze(),this._onError=x,this._htmlConversions=A,this._editable=Q,this._headless=a!==null&&a._headless,this._blockCursorElement=this._window=null}isComposing(){return this._compositionKey!=null}registerUpdateListener(i){let a=this._listeners.update;return a.add(i),()=>{a.delete(i)}}registerEditableListener(i){let a=this._listeners.editable;return a.add(i),()=>{a.delete(i)}}registerDecoratorListener(i){let a=this._listeners.decorator;return a.add(i),()=>{a.delete(i)}}registerTextContentListener(i){let a=this._listeners.textcontent;return a.add(i),()=>{a.delete(i)}}registerRootListener(i){let a=this._listeners.root;return i(this._rootElement,null),a.add(i),()=>{i(null,this._rootElement),a.delete(i)}}registerCommand(i,a,g){g===void 0&&Y(35);let C=this._commands;C.has(i)||C.set(i,[new Set,new Set,new Set,new Set,new Set]);let x=C.get(i);x===void 0&&Y(36,String(i));let A=x[g];return A.add(a),()=>{A.delete(a),x.every(Q=>Q.size===0)&&C.delete(i)}}registerMutationListener(i,a){this._nodes.get(i.getType())===void 0&&Y(37,i.name);let g=this._listeners.mutation;return g.set(a,i),()=>{g.delete(a)}}registerNodeTransformToKlass(i,a){var g=i.getType();return g=this._nodes.get(g),g===void 0&&Y(37,i.name),g.transforms.add(a),g}registerNodeTransform(i,a){var g=this.registerNodeTransformToKlass(i,a);let C=[g];return g=g.replaceWithKlass,g!=null&&(g=this.registerNodeTransformToKlass(g,a),C.push(g)),Vt(this,i.getType()),()=>{C.forEach(x=>x.transforms.delete(a))}}hasNode(i){return this._nodes.has(i.getType())}hasNodes(i){return i.every(this.hasNode.bind(this))}dispatchCommand(i,a){return ct(this,i,a)}getDecorators(){return this._decorators}getRootElement(){return this._rootElement}getKey(){return this._key}setRootElement(i){let a=this._rootElement;if(i!==a){let A=Bt(this._config.theme,"root");var g=this._pendingEditorState||this._editorState;if(this._rootElement=i,Do(this,a,i,g),a!==null){if(!this._config.disableEvents){Ls!==0&&(Ls--,Ls===0&&a.ownerDocument.removeEventListener("selectionchange",Da));var C=a.__lexicalEditor;if(C!=null){if(C._parentEditor!==null){var x=pe(C);x=x[x.length-1]._key,os.get(x)===C&&os.delete(x)}else os.delete(C._key);a.__lexicalEditor=null}for(C=Oa(a),x=0;x<C.length;x++)C[x]();a.__lexicalEventHandles=[]}A!=null&&a.classList.remove(...A)}i!==null?(g=(g=i.ownerDocument)&&g.defaultView||null,C=i.style,C.userSelect="text",C.whiteSpace="pre-wrap",C.wordBreak="break-word",i.setAttribute("data-lexical-editor","true"),this._window=g,this._dirtyType=2,Oe(this),this._updateTags.add("history-merge"),Ki(this),this._config.disableEvents||$c(i,this),A!=null&&i.classList.add(...A)):(this._editorState=g,this._window=this._pendingEditorState=null),Ei("root",this,!1,i,a)}}getElementByKey(i){return this._keyToDOMMap.get(i)||null}getEditorState(){return this._editorState}setEditorState(i,a){i.isEmpty()&&Y(38),tn(this);let g=this._pendingEditorState,C=this._updateTags;a=a!==void 0?a.tag:null,g===null||g.isEmpty()||(a!=null&&C.add(a),Ki(this)),this._pendingEditorState=i,this._dirtyType=2,this._dirtyElements.set("root",!1),this._compositionKey=null,a!=null&&C.add(a),Ki(this)}parseEditorState(i,a){i=typeof i=="string"?JSON.parse(i):i;let g=Ui(),C=gn,x=Wn,A=On,Q=this._dirtyElements,ge=this._dirtyLeaves,Ae=this._cloneNotNeeded,Ye=this._dirtyType;this._dirtyElements=new Map,this._dirtyLeaves=new Set,this._cloneNotNeeded=new Set,this._dirtyType=0,gn=g,Wn=!1,On=this;try{So(i.root,this._nodes),a&&a(),g._readOnly=!0}catch(Xe){Xe instanceof Error&&this._onError(Xe)}finally{this._dirtyElements=Q,this._dirtyLeaves=ge,this._cloneNotNeeded=Ae,this._dirtyType=Ye,gn=C,Wn=x,On=A}return g}update(i,a){Tr(this,i,a)}focus(i,a={}){let g=this._rootElement;g!==null&&(g.setAttribute("autocapitalize","off"),Tr(this,()=>{let C=qt(),x=bt();C!==null?C.dirty=!0:x.getChildrenSize()!==0&&(a.defaultSelection==="rootStart"?x.selectStart():x.selectEnd())},{onUpdate:()=>{g.removeAttribute("autocapitalize"),i&&i()},tag:"focus"}),this._pendingEditorState===null&&g.removeAttribute("autocapitalize"))}blur(){var i=this._rootElement;i!==null&&i.blur(),i=jr(this._window),i!==null&&i.removeAllRanges()}isEditable(){return this._editable}setEditable(i){this._editable!==i&&(this._editable=i,Ei("editable",this,!0,i))}toJSON(){return{editorState:this._editorState.toJSON()}}}class Ao extends zi{constructor(i,a){super(a),this.__colSpan=i,this.__rowSpan=1}exportJSON(){return{...super.exportJSON(),colSpan:this.__colSpan,rowSpan:this.__rowSpan}}getColSpan(){return this.__colSpan}setColSpan(i){return this.getWritable().__colSpan=i,this}getRowSpan(){return this.__rowSpan}setRowSpan(i){return this.getWritable().__rowSpan=i,this}}function Gi(o){return o instanceof Ao}class $l extends zi{}function Fl(o){return o instanceof $l}class Fa extends zi{}function Bl(o){return o instanceof Fa}return We.$INTERNAL_isPointSelection=Bs,We.$addUpdateTag=function(o){Jn(),hn()._updateTags.add(o)},We.$applyNodeReplacement=Nr,We.$copyNode=Ai,We.$createLineBreakNode=Zr,We.$createNodeSelection=Ml,We.$createParagraphNode=Wr,We.$createPoint=Fr,We.$createRangeSelection=function(){let o=Fr("root",0,"element"),i=Fr("root",0,"element");return new Ni(o,i,0,"")},We.$createTabNode=Fi,We.$createTextNode=Un,We.$getAdjacentNode=Ht,We.$getNearestNodeFromDOMNode=Kt,We.$getNearestRootOrShadowRoot=sr,We.$getNodeByKey=mt,We.$getPreviousSelection=Er,We.$getRoot=bt,We.$getSelection=qt,We.$getTextContent=function(){let o=qt();return o===null?"":o.getTextContent()},We.$hasAncestor=Zn,We.$hasUpdateTag=function(o){return hn()._updateTags.has(o)},We.$insertNodes=function(o){let i=qt()||Er();i===null&&(i=bt().selectEnd()),i.insertNodes(o)},We.$isBlockElementNode=function(o){return Je(o)&&!o.isInline()},We.$isDecoratorNode=En,We.$isElementNode=Je,We.$isInlineElementOrDecoratorNode=function(o){return Je(o)&&o.isInline()||En(o)&&o.isInline()},We.$isLeafNode=function(o){return Ct(o)||Ii(o)||En(o)},We.$isLineBreakNode=Ii,We.$isNodeSelection=ar,We.$isParagraphNode=function(o){return o instanceof Hr},We.$isRangeSelection=Mt,We.$isRootNode=nr,We.$isRootOrShadowRoot=or,We.$isTabNode=Ra,We.$isTextNode=Ct,We.$nodesOfType=function(o){var i=Br();let a=i._readOnly,g=o.getType();i=i._nodeMap;let C=[];for(let[,x]of i)x instanceof o&&x.__type===g&&(a||x.isAttached())&&C.push(x);return C},We.$normalizeSelection__EXPERIMENTAL=Le,We.$parseSerializedNode=function(o){return So(o,hn()._nodes)},We.$selectAll=function(){var o=bt();o=o.select(0,o.getChildrenSize()),rn(Le(o))},We.$setCompositionKey=gt,We.$setSelection=rn,We.$splitNode=function(o,i){let a=o.getChildAtIndex(i);a==null&&(a=o),or(o)&&Y(102);let g=A=>{const Q=A.getParentOrThrow(),ge=or(Q),Ae=A!==a||ge?Ai(A):A;if(ge){if(!Je(A)||!Je(Ae))throw Error("Children of a root must be ElementNode");return A.insertAfter(Ae),[A,Ae,Ae]}const[Ye,Xe,Ke]=g(Q);return A=A.getNextSiblings(),Ke.append(Ae,...A),[Ye,Xe,Ae]},[C,x]=g(a);return[C,x]},We.BLUR_COMMAND=Z,We.CAN_REDO_COMMAND={},We.CAN_UNDO_COMMAND={},We.CLEAR_EDITOR_COMMAND={},We.CLEAR_HISTORY_COMMAND={},We.CLICK_COMMAND=t,We.COMMAND_PRIORITY_CRITICAL=4,We.COMMAND_PRIORITY_EDITOR=0,We.COMMAND_PRIORITY_HIGH=3,We.COMMAND_PRIORITY_LOW=1,We.COMMAND_PRIORITY_NORMAL=2,We.CONTROLLED_TEXT_INSERTION_COMMAND=d,We.COPY_COMMAND=Ee,We.CUT_COMMAND=de,We.DELETE_CHARACTER_COMMAND=n,We.DELETE_LINE_COMMAND=E,We.DELETE_WORD_COMMAND=_,We.DEPRECATED_$computeGridMap=function(o,i,a){let g=[],C=null,x=null;o=o.getChildren();for(let Ye=0;Ye<o.length;Ye++){var A=o[Ye];Bl(A)||Y(108);var Q=A.getChildren();A=0;for(let Xe of Q){for(Gi(Xe)||Y(109);g[Ye]!==void 0&&g[Ye][A]!==void 0;)A++;Q=Ye;var ge=A,Ae=Xe;let Ke={cell:Ae,startColumn:ge,startRow:Q},Pe=Ae.__rowSpan,pt=Ae.__colSpan;for(let Ot=0;Ot<Pe;Ot++){g[Q+Ot]===void 0&&(g[Q+Ot]=[]);for(let Ft=0;Ft<pt;Ft++)g[Q+Ot][ge+Ft]=Ke}i.is(Ae)&&(C=Ke),a.is(Ae)&&(x=Ke),A+=Xe.__colSpan}}return C===null&&Y(110),x===null&&Y(111),[g,C,x]},We.DEPRECATED_$getGridCellNodeRect=function(o){let[i,,a]=Ks(o);o=a.getChildren();let g=o.length;var C=o[0].getChildren().length;let x=Array(g);for(var A=0;A<g;A++)x[A]=Array(C);for(C=0;C<g;C++){A=o[C].getChildren();let Q=0;for(let ge=0;ge<A.length;ge++){for(;x[C][Q];)Q++;let Ae=A[ge],Ye=Ae.__rowSpan||1,Xe=Ae.__colSpan||1;for(let Ke=0;Ke<Ye;Ke++)for(let Pe=0;Pe<Xe;Pe++)x[C+Ke][Q+Pe]=Ae;if(i===Ae)return{colSpan:Xe,columnIndex:Q,rowIndex:C,rowSpan:Ye};Q+=Xe}}return null},We.DEPRECATED_$getNodeTriplet=Ks,We.DEPRECATED_$isGridCellNode=Gi,We.DEPRECATED_$isGridNode=Fl,We.DEPRECATED_$isGridRowNode=Bl,We.DEPRECATED_GridCellNode=Ao,We.DEPRECATED_GridNode=$l,We.DEPRECATED_GridRowNode=Fa,We.DRAGEND_COMMAND=Se,We.DRAGOVER_COMMAND=Te,We.DRAGSTART_COMMAND=q,We.DROP_COMMAND=z,We.DecoratorNode=wo,We.ElementNode=zi,We.FOCUS_COMMAND=D,We.FORMAT_ELEMENT_COMMAND={},We.FORMAT_TEXT_COMMAND=T,We.INDENT_CONTENT_COMMAND={},We.INSERT_LINE_BREAK_COMMAND=r,We.INSERT_PARAGRAPH_COMMAND=l,We.INSERT_TAB_COMMAND={},We.INTERNAL_PointSelection=Fs,We.KEY_ARROW_DOWN_COMMAND=P,We.KEY_ARROW_LEFT_COMMAND=I,We.KEY_ARROW_RIGHT_COMMAND=m,We.KEY_ARROW_UP_COMMAND=k,We.KEY_BACKSPACE_COMMAND=re,We.KEY_DELETE_COMMAND=ce,We.KEY_DOWN_COMMAND=O,We.KEY_ENTER_COMMAND=H,We.KEY_ESCAPE_COMMAND=te,We.KEY_MODIFIER_COMMAND=oe,We.KEY_SPACE_COMMAND=j,We.KEY_TAB_COMMAND=V,We.LineBreakNode=qr,We.MOVE_TO_END=v,We.MOVE_TO_START=G,We.OUTDENT_CONTENT_COMMAND={},We.PASTE_COMMAND=f,We.ParagraphNode=Hr,We.REDO_COMMAND=w,We.REMOVE_TEXT_COMMAND=p,We.RootNode=cr,We.SELECTION_CHANGE_COMMAND=e,We.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND={},We.SELECT_ALL_COMMAND=K,We.TabNode=as,We.TextNode=$i,We.UNDO_COMMAND=S,We.createCommand=function(){return{}},We.createEditor=function(o){var i=o||{},a=On,g=i.theme||{};let C=o===void 0?a:i.parentEditor||null,x=i.disableEvents||!1,A=Ui(),Q=i.namespace||(C!==null?C._config.namespace:Ze()),ge=i.editorState,Ae=[cr,$i,qr,as,Hr,...i.nodes||[]],{onError:Ye,html:Xe}=i;if(i=i.editable!==void 0?i.editable:!0,o===void 0&&a!==null)o=a._nodes;else for(o=new Map,a=0;a<Ae.length;a++){let Pe=Ae[a],pt=null;var Ke=null;typeof Pe!="function"&&(Ke=Pe,Pe=Ke.replace,pt=Ke.with,Ke=Ke.withKlass||null);let Ot=Pe.getType(),Ft=Pe.transform(),zt=new Set;Ft!==null&&zt.add(Ft),o.set(Ot,{exportDOM:Xe&&Xe.export?Xe.export.get(Pe):void 0,klass:Pe,replace:pt,replaceWithKlass:Ke,transforms:zt})}return g=new js(A,C,o,{disableEvents:x,namespace:Q,theme:g},Ye||console.error,Ys(o,Xe?Xe.import:void 0),i),ge!==void 0&&(g._pendingEditorState=ge,g._dirtyType=2),g},We.getNearestEditorFromDOMNode=St,We.isCurrentlyReadOnlyMode=fs,We.isHTMLAnchorElement=function(o){return ho(o)&&o.tagName==="A"},We.isHTMLElement=ho,We.isSelectionCapturedInDecoratorInput=st,We.isSelectionWithinEditor=ot,We}var eu,$f;function jt(){return $f||($f=1,eu=process.env.NODE_ENV==="development"?zN():UN()),eu}var Ff;function GN(){if(Ff)return Xc;Ff=1;var e=qn(),t=jt(),n=rt;const r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var d=r?n.useLayoutEffect:n.useEffect;const f={tag:"history-merge"};function p({initialConfig:E,children:T}){const S=n.useMemo(()=>{const{theme:w,namespace:O,editor__DEPRECATED:m,nodes:v,onError:I,editorState:G,html:k}=E,P=e.createLexicalComposerContext(null,w);let H=m||null;if(H===null){const j=t.createEditor({editable:E.editable,html:k,namespace:O,nodes:v,onError:re=>I(re,j),theme:w});_(j,G),H=j}return[H,P]},[]);return d(()=>{const w=E.editable,[O]=S;O.setEditable(w!==void 0?w:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:S},T)}function _(E,T){if(T!==null){if(T===void 0)E.update(()=>{const S=t.$getRoot();if(S.isEmpty()){const w=t.$createParagraphNode();S.append(w);const O=r?document.activeElement:null;(t.$getSelection()!==null||O!==null&&O===E.getRootElement())&&w.select()}},f);else if(T!==null)switch(typeof T){case"string":{const S=E.parseEditorState(T);E.setEditorState(S,f);break}case"object":{E.setEditorState(T,f);break}case"function":{E.update(()=>{t.$getRoot().isEmpty()&&T(E)},f);break}}}}return Xc.LexicalComposer=p,Xc}var tu={},Bf;function YN(){if(Bf)return tu;Bf=1;var e=qn(),t=jt(),n=rt;let r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var l=r?n.useLayoutEffect:n.useEffect;let d={tag:"history-merge"};function f(p,_){if(_!==null){if(_===void 0)p.update(()=>{var E=t.$getRoot();if(E.isEmpty()){let T=t.$createParagraphNode();E.append(T),E=r?document.activeElement:null,(t.$getSelection()!==null||E!==null&&E===p.getRootElement())&&T.select()}},d);else if(_!==null)switch(typeof _){case"string":let E=p.parseEditorState(_);p.setEditorState(E,d);break;case"object":p.setEditorState(_,d);break;case"function":p.update(()=>{t.$getRoot().isEmpty()&&_(p)},d)}}}return tu.LexicalComposer=function({initialConfig:p,children:_}){let E=n.useMemo(()=>{const{theme:T,namespace:S,editor__DEPRECATED:w,nodes:O,onError:m,editorState:v,html:I}=p,G=e.createLexicalComposerContext(null,T);let k=w||null;if(k===null){const P=t.createEditor({editable:p.editable,html:I,namespace:S,nodes:O,onError:H=>m(H,P),theme:T});f(P,v),k=P}return[k,G]},[]);return l(()=>{let T=p.editable,[S]=E;S.setEditable(T!==void 0?T:!0)},[]),n.createElement(e.LexicalComposerContext.Provider,{value:E},_)},tu}const jN=process.env.NODE_ENV==="development"?GN():YN();var VN=jN,nu={},ru,Hf;function qN(){if(Hf)return ru;Hf=1;var e=qn(),t=rt,l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function d(_){const[E]=e.useLexicalComposerContext(),T=t.useMemo(()=>_(E),[E,_]),S=t.useRef(T.initialValueFn()),[w,O]=t.useState(S.current);return l(()=>{const{initialValueFn:m,subscribe:v}=T,I=m();return S.current!==I&&(S.current=I,O(I)),v(G=>{S.current=G,O(G)})},[T,_]),w}function f(_){return{initialValueFn:()=>_.isEditable(),subscribe:E=>_.registerEditableListener(E)}}function p(){return d(f)}return ru=p,ru}var iu,Wf;function ZN(){if(Wf)return iu;Wf=1;var e=qn(),t=rt,n=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function r(d){let[f]=e.useLexicalComposerContext(),p=t.useMemo(()=>d(f),[f,d]),_=t.useRef(p.initialValueFn()),[E,T]=t.useState(_.current);return n(()=>{let{initialValueFn:S,subscribe:w}=p,O=S();return _.current!==O&&(_.current=O,T(O)),w(m=>{_.current=m,T(m)})},[p,d]),E}function l(d){return{initialValueFn:()=>d.isEditable(),subscribe:f=>d.registerEditableListener(f)}}return iu=function(){return r(l)},iu}var su,Kf;function xp(){return Kf||(Kf=1,su=process.env.NODE_ENV==="development"?qN():ZN()),su}var Ji={},zf;function JN(){if(zf)return Ji;zf=1;var e=jt();function t(_,E){let T=_.getFirstChild(),S=0;e:for(;T!==null;){if(e.$isElementNode(T)){const m=T.getFirstChild();if(m!==null){T=m;continue}}else if(e.$isTextNode(T)){const m=T.getTextContentSize();if(S+m>E)return{node:T,offset:E-S};S+=m}const w=T.getNextSibling();if(w!==null){T=w;continue}let O=T.getParent();for(;O!==null;){const m=O.getNextSibling();if(m!==null){T=m;continue e}O=O.getParent()}break}return null}function n(_,E=!0){if(_)return!1;let T=l();return E&&(T=T.trim()),T===""}function r(_,E){return()=>n(_,E)}function l(){return e.$getRoot().getTextContent()}function d(_){if(!n(_,!1))return!1;const T=e.$getRoot().getChildren(),S=T.length;if(S>1)return!1;for(let w=0;w<S;w++){const O=T[w];if(e.$isDecoratorNode(O))return!1;if(e.$isElementNode(O)){if(!e.$isParagraphNode(O)||O.__indent!==0)return!1;const m=O.getChildren(),v=m.length;for(let I=0;I<v;I++){const G=m[w];if(!e.$isTextNode(G))return!1}}}return!0}function f(_){return()=>d(_)}function p(_,E,T,S){const w=P=>P instanceof T,O=P=>{const H=e.$createTextNode(P.getTextContent());H.setFormat(P.getFormat()),P.replace(H)},m=P=>P.getLatest().__mode,v=P=>{if(!P.isSimpleText())return;const H=P.getPreviousSibling();let j=P.getTextContent(),re=P,te;if(e.$isTextNode(H)){const ce=H.getTextContent(),V=ce+j,z=E(V);if(w(H))if(z===null||m(H)!==0){O(H);return}else{const q=z.end-ce.length;if(q>0){const Te=j.slice(0,q),Se=ce+Te;if(H.select(),H.setTextContent(Se),q===j.length)P.remove();else{const Ee=j.slice(q);P.setTextContent(Ee)}return}}else if(z===null||z.start<ce.length)return}for(;;){te=E(j);let ce=te===null?"":j.slice(te.end);if(j=ce,ce===""){const q=re.getNextSibling();if(e.$isTextNode(q)){ce=re.getTextContent()+q.getTextContent();const Te=E(ce);if(Te===null){w(q)?O(q):q.markDirty();return}else if(Te.start!==0)return}}else{const q=E(ce);if(q!==null&&q.start===0)return}if(te===null)return;if(te.start===0&&e.$isTextNode(H)&&H.isTextEntity())continue;let V;te.start===0?[V,re]=re.splitText(te.end):[,V,re]=re.splitText(te.start,te.end);const z=S(V);if(z.setFormat(V.getFormat()),V.replace(z),re==null)return}},I=P=>{const H=P.getTextContent(),j=E(H);if(j===null||j.start!==0){O(P);return}if(H.length>j.end){P.splitText(j.end);return}const re=P.getPreviousSibling();e.$isTextNode(re)&&re.isTextEntity()&&(O(re),O(P));const te=P.getNextSibling();e.$isTextNode(te)&&te.isTextEntity()&&(O(te),w(P)&&O(P))},G=_.registerNodeTransform(e.TextNode,v),k=_.registerNodeTransform(T,I);return[G,k]}return Ji.$canShowPlaceholder=d,Ji.$canShowPlaceholderCurry=f,Ji.$findTextIntersectionFromCharacters=t,Ji.$isRootTextContentEmpty=n,Ji.$isRootTextContentEmptyCurry=r,Ji.$rootTextContent=l,Ji.registerLexicalTextEntity=p,Ji}var Xi={},Uf;function XN(){if(Uf)return Xi;Uf=1;var e=jt();function t(l,d=!0){return l?!1:(l=n(),d&&(l=l.trim()),l==="")}function n(){return e.$getRoot().getTextContent()}function r(l){if(!t(l,!1))return!1;l=e.$getRoot().getChildren();let d=l.length;if(1<d)return!1;for(let p=0;p<d;p++){var f=l[p];if(e.$isDecoratorNode(f))return!1;if(e.$isElementNode(f)){if(!e.$isParagraphNode(f)||f.__indent!==0)return!1;f=f.getChildren();let _=f.length;for(let E=0;E<_;E++)if(!e.$isTextNode(f[p]))return!1}}return!0}return Xi.$canShowPlaceholder=r,Xi.$canShowPlaceholderCurry=function(l){return()=>r(l)},Xi.$findTextIntersectionFromCharacters=function(l,d){var f=l.getFirstChild();l=0;e:for(;f!==null;){if(e.$isElementNode(f)){var p=f.getFirstChild();if(p!==null){f=p;continue}}else if(e.$isTextNode(f)){if(p=f.getTextContentSize(),l+p>d)return{node:f,offset:d-l};l+=p}if(p=f.getNextSibling(),p!==null)f=p;else{for(f=f.getParent();f!==null;){if(p=f.getNextSibling(),p!==null){f=p;continue e}f=f.getParent()}break}}return null},Xi.$isRootTextContentEmpty=t,Xi.$isRootTextContentEmptyCurry=function(l,d){return()=>t(l,d)},Xi.$rootTextContent=n,Xi.registerLexicalTextEntity=function(l,d,f,p){let _=T=>{const S=e.$createTextNode(T.getTextContent());S.setFormat(T.getFormat()),T.replace(S)},E=l.registerNodeTransform(e.TextNode,T=>{if(T.isSimpleText()){var S=T.getPreviousSibling(),w=T.getTextContent(),O=T;if(e.$isTextNode(S)){var m=S.getTextContent(),v=d(m+w);if(S instanceof f){if(v===null||S.getLatest().__mode!==0){_(S);return}if(v=v.end-m.length,0<v){O=w.slice(0,v),O=m+O,S.select(),S.setTextContent(O),v===w.length?T.remove():(S=w.slice(v),T.setTextContent(S));return}}else if(v===null||v.start<m.length)return}for(;;){if(T=d(w),w=v=T===null?"":w.slice(T.end),v===""){if(m=O.getNextSibling(),e.$isTextNode(m)){if(v=O.getTextContent()+m.getTextContent(),v=d(v),v===null){m instanceof f?_(m):m.markDirty();break}else if(v.start!==0)break}}else if(m=d(v),m!==null&&m.start===0)break;if(T===null)break;if(T.start===0&&e.$isTextNode(S)&&S.isTextEntity())continue;let I;if(T.start===0?[I,O]=O.splitText(T.end):[,I,O]=O.splitText(T.start,T.end),T=p(I),T.setFormat(I.getFormat()),I.replace(T),O==null)break}}});return l=l.registerNodeTransform(f,T=>{var S=T.getTextContent();const w=d(S);w===null||w.start!==0?_(T):S.length>w.end?T.splitText(w.end):(S=T.getPreviousSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),_(T)),S=T.getNextSibling(),e.$isTextNode(S)&&S.isTextEntity()&&(_(S),T instanceof f&&_(T)))}),[E,l]},Xi}var ou,Gf;function vp(){return Gf||(Gf=1,ou=process.env.NODE_ENV==="development"?JN():XN()),ou}var Sn={},jn={},Yf;function QN(){if(Yf)return jn;Yf=1;var e=jt();const t=new Map;function n(K){let D=K;for(;D!=null;){if(D.nodeType===Node.TEXT_NODE)return D;D=D.firstChild}return null}function r(K){const D=K.parentNode;if(D==null)throw new Error("Should never happen");return[D,Array.from(D.childNodes).indexOf(K)]}function l(K,D,Z,oe,Y){const W=D.getKey(),J=oe.getKey(),R=document.createRange();let U=K.getElementByKey(W),X=K.getElementByKey(J),fe=Z,_e=Y;if(e.$isTextNode(D)&&(U=n(U)),e.$isTextNode(oe)&&(X=n(X)),D===void 0||oe===void 0||U===null||X===null)return null;U.nodeName==="BR"&&([U,fe]=r(U)),X.nodeName==="BR"&&([X,_e]=r(X));const B=U.firstChild;U===X&&B!=null&&B.nodeName==="BR"&&fe===0&&_e===0&&(_e=1);try{R.setStart(U,fe),R.setEnd(X,_e)}catch{return null}return R.collapsed&&(fe!==_e||W!==J)&&(R.setStart(X,_e),R.setEnd(U,fe)),R}function d(K,D){const Z=K.getRootElement();if(Z===null)return[];const oe=Z.getBoundingClientRect(),Y=getComputedStyle(Z),W=parseFloat(Y.paddingLeft)+parseFloat(Y.paddingRight),J=Array.from(D.getClientRects());let R=J.length;J.sort((X,fe)=>{const _e=X.top-fe.top;return Math.abs(_e)<=3?X.left-fe.left:_e});let U;for(let X=0;X<R;X++){const fe=J[X],_e=U&&U.top<=fe.top&&U.top+U.height>fe.top&&U.left+U.width>fe.left,B=fe.width+W===oe.width;if(_e||B){J.splice(X--,1),R--;continue}U=fe}return J}function f(K){const D={},Z=K.split(";");for(const oe of Z)if(oe!==""){const[Y,W]=oe.split(/:([^]+)/);Y&&W&&(D[Y.trim()]=W.trim())}return D}function p(K){let D=t.get(K);return D===void 0&&(D=f(K),t.set(K,D)),Object.freeze(D),D}function _(K){let D="";for(const Z in K)Z&&(D+=`${Z}: ${K[Z]};`);return D}function E(K,D){return K.__first=D.__first,K.__last=D.__last,K.__size=D.__size,K.__format=D.__format,K.__indent=D.__indent,K.__dir=D.__dir,K}function T(K,D){return K.__format=D.__format,K.__style=D.__style,K.__mode=D.__mode,K.__detail=D.__detail,K}function S(K){const Z=K.constructor.clone(K);return Z.__parent=K.__parent,Z.__next=K.__next,Z.__prev=K.__prev,e.$isElementNode(K)&&e.$isElementNode(Z)?E(Z,K):e.$isTextNode(K)&&e.$isTextNode(Z)?T(Z,K):Z}function w(K,D){if(D.isSelected(K)&&!D.isSegmented()&&!D.isToken()&&e.$INTERNAL_isPointSelection(K)){const Z=K.anchor.getNode(),oe=K.focus.getNode(),Y=D.is(Z),W=D.is(oe);if(Y||W){const J=K.isBackward(),[R,U]=K.getCharacterOffsets(),X=Z.is(oe),fe=D.is(J?oe:Z),_e=D.is(J?Z:oe);let B=0,M;if(X)B=R>U?U:R,M=R>U?R:U;else if(fe)B=J?U:R,M=void 0;else if(_e){const F=J?R:U;B=0,M=F}return D.__text=D.__text.slice(B,M),D}}return D}function O(K){if(K.type==="text")return K.offset===K.getNode().getTextContentSize();const D=K.getNode();if(!e.$isElementNode(D))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return K.offset===D.getChildrenSize()}function m(K,D,Z){let oe=D.getNode(),Y=Z;if(e.$isElementNode(oe)){const W=oe.getDescendantByIndex(D.offset);W!==null&&(oe=W)}for(;Y>0&&oe!==null;){if(e.$isElementNode(oe)){const X=oe.getLastDescendant();X!==null&&(oe=X)}let W=oe.getPreviousSibling(),J=0;if(W===null){let X=oe.getParentOrThrow(),fe=X.getPreviousSibling();for(;fe===null;){if(X=X.getParent(),X===null){W=null;break}fe=X.getPreviousSibling()}X!==null&&(J=X.isInline()?0:2,W=fe)}let R=oe.getTextContent();R===""&&e.$isElementNode(oe)&&!oe.isInline()&&(R=`
|
|
71
71
|
|
|
72
|
-
`);const U=R.length;if(!e.$isTextNode(oe)||Y>=U){const X=oe.getParent();oe.remove(),X!=null&&X.getChildrenSize()===0&&!e.$isRootNode(X)&&X.remove(),Y-=U+J,oe=W}else{const X=oe.getKey(),fe=K.getEditorState().read(()=>{const A=e.$getNodeByKey(X);return e.$isTextNode(A)&&A.isSimpleText()?A.getTextContent():null}),_e=U-Y,B=R.slice(0,_e);if(fe!==null&&fe!==R){const A=e.$getPreviousSelection();let F=oe;if(oe.isSimpleText())oe.setTextContent(fe);else{const se=e.$createTextNode(fe);oe.replace(se),F=se}if(e.$isRangeSelection(A)&&A.isCollapsed()){const se=A.anchor.offset;F.select(se,se)}}else if(oe.isSimpleText()){const A=O.key===X;let F=O.offset;F<Y&&(F=U);const se=A?F-Y:0,ye=A?F:_e;if(A&&se===0){const[De]=oe.splitText(se,ye);De.remove()}else{const[,De]=oe.splitText(se,ye);De.remove()}}else{const A=e.$createTextNode(B);oe.replace(A)}Y=0}}}function v(K){const O=K.getStyle(),Z=f(O);t.set(O,Z)}function k(K,O){const Z=p("getStyle"in K?K.getStyle():K.style),oe=Object.entries(O).reduce((W,[J,R])=>(R===null?delete W[J]:W[J]=R,W),{...Z}),Y=_(oe);K.setStyle(Y),t.set(Y,oe)}function G(K,O){const Z=K.getNodes(),oe=Z.length;if(!e.$isRangeSelection(K)){const ne=e.$createRangeSelection(),ue=ne.anchor,be=ne.focus;for(let Ne=0;Ne<oe;Ne++){const Re=Z[Ne];e.DEPRECATED_$isGridCellNode(Re)&&(ue.set(Re.getKey(),0,"element"),be.set(Re.getKey(),Re.getChildrenSize(),"element"),G(e.$normalizeSelection__EXPERIMENTAL(ne),O))}e.$setSelection(K);return}const Y=oe-1;let W=Z[0],J=Z[Y];if(K.isCollapsed()&&e.$isRangeSelection(K)){k(K,O);return}const R=K.anchor,U=K.focus,fe=W.getTextContent().length,_e=U.offset;let B=R.offset;const A=R.isBefore(U);let F=A?B:_e,se=A?_e:B;const ye=A?R.type:U.type,De=A?U.type:R.type,ee=A?U.key:R.key;if(e.$isTextNode(W)&&F===fe){const ne=W.getNextSibling();e.$isTextNode(ne)&&(B=0,F=0,W=ne)}if(Z.length===1){if(e.$isTextNode(W)){if(F=ye==="element"?0:B>_e?_e:B,se=De==="element"?fe:B>_e?B:_e,F===se)return;if(F===0&&se===fe)k(W,O),W.select(F,se);else{const ne=W.splitText(F,se),ue=F===0?ne[0]:ne[1];k(ue,O),ue.select(0,se-F)}}}else{if(e.$isTextNode(W)&&F<W.getTextContentSize()&&(F!==0&&(W=W.splitText(F)[1],F=0,R.set(W.getKey(),F,"text")),k(W,O)),e.$isTextNode(J)){const ue=J.getTextContent().length;J.__key!==ee&&se!==0&&(se=ue),se!==ue&&([J]=J.splitText(se)),se!==0&&k(J,O)}for(let ne=1;ne<Y;ne++){const ue=Z[ne],be=ue.getKey();e.$isTextNode(ue)&&be!==W.getKey()&&be!==J.getKey()&&!ue.isToken()&&k(ue,O)}}}function I(K,O){if(K.anchor.key==="root"){const Y=O(),W=e.$getRoot(),J=W.getFirstChild();J?J.replace(Y,!0):W.append(Y);return}const Z=K.getNodes(),oe=de(K.anchor.getNode(),Ee);oe&&Z.indexOf(oe)===-1&&Z.push(oe);for(let Y=0;Y<Z.length;Y++){const W=Z[Y];if(!Ee(W))continue;if(!e.$isElementNode(W))throw Error("Expected block node to be an ElementNode");const J=O();J.setFormat(W.getFormatType()),J.setIndent(W.getIndent()),W.replace(J,!0)}}function P(K){return K.getNode().isAttached()}function H(K){let O=K;for(;O!==null&&!e.$isRootOrShadowRoot(O);){const Z=O.getLatest(),oe=O.getParent();Z.getChildrenSize()===0&&O.remove(!0),O=oe}}function j(K,O,Z=null){const oe=K.getNodes(),Y=oe.length,W=K.anchor;if(Y===0||Y===1&&W.type==="element"&&W.getNode().getChildrenSize()===0){const U=W.type==="text"?W.getNode().getParentOrThrow():W.getNode(),X=U.getChildren();let fe=O();fe.setFormat(U.getFormatType()),fe.setIndent(U.getIndent()),X.forEach(_e=>fe.append(_e)),Z&&(fe=Z.append(fe)),U.replace(fe);return}let J=null,R=[];for(let U=0;U<Y;U++){const X=oe[U];e.$isRootOrShadowRoot(X)?(re(K,R,R.length,O,Z),R=[],J=X):J===null||J!==null&&e.$hasAncestor(X,J)?R.push(X):(re(K,R,R.length,O,Z),R=[X])}re(K,R,R.length,O,Z)}function re(K,O,Z,oe,Y=null){if(O.length===0)return;const W=O[0],J=new Map,R=[];let U=e.$isElementNode(W)?W:W.getParentOrThrow();U.isInline()&&(U=U.getParentOrThrow());let X=!1;for(;U!==null;){const F=U.getPreviousSibling();if(F!==null){U=F,X=!0;break}if(U=U.getParentOrThrow(),e.$isRootOrShadowRoot(U))break}const fe=new Set;for(let F=0;F<Z;F++){const se=O[F];e.$isElementNode(se)&&se.getChildrenSize()===0&&fe.add(se.getKey())}const _e=new Set;for(let F=0;F<Z;F++){const se=O[F];let ye=se.getParent();if(ye!==null&&ye.isInline()&&(ye=ye.getParent()),ye!==null&&e.$isLeafNode(se)&&!_e.has(se.getKey())){const De=ye.getKey();if(J.get(De)===void 0){const ee=oe();ee.setFormat(ye.getFormatType()),ee.setIndent(ye.getIndent()),R.push(ee),J.set(De,ee),ye.getChildren().forEach(ne=>{ee.append(ne),_e.add(ne.getKey()),e.$isElementNode(ne)&&ne.getChildrenKeys().forEach(ue=>_e.add(ue))}),H(ye)}}else if(fe.has(se.getKey())){if(!e.$isElementNode(se))throw Error("Expected node in emptyElements to be an ElementNode");const De=oe();De.setFormat(se.getFormatType()),De.setIndent(se.getIndent()),R.push(De),se.remove(!0)}}if(Y!==null)for(let F=0;F<R.length;F++){const se=R[F];Y.append(se)}let B=null;if(e.$isRootOrShadowRoot(U))if(X)if(Y!==null)U.insertAfter(Y);else for(let F=R.length-1;F>=0;F--){const se=R[F];U.insertAfter(se)}else{const F=U.getFirstChild();if(e.$isElementNode(F)&&(U=F),F===null)if(Y)U.append(Y);else for(let se=0;se<R.length;se++){const ye=R[se];U.append(ye),B=ye}else if(Y!==null)F.insertBefore(Y);else for(let se=0;se<R.length;se++){const ye=R[se];F.insertBefore(ye),B=ye}}else if(Y)U.insertAfter(Y);else for(let F=R.length-1;F>=0;F--){const se=R[F];U.insertAfter(se),B=se}const A=e.$getPreviousSelection();e.$isRangeSelection(A)&&P(A.anchor)&&P(A.focus)?e.$setSelection(A.clone()):B!==null?B.selectEnd():K.dirty=!0}function te(K,O){const Z=e.$getAdjacentNode(K.focus,O);return e.$isDecoratorNode(Z)&&!Z.isIsolated()||e.$isElementNode(Z)&&!Z.isInline()&&!Z.canBeEmpty()}function ce(K,O,Z,oe){K.modify(O?"extend":"move",Z,oe)}function V(K){const O=K.anchor.getNode();return(e.$isRootNode(O)?O:O.getParentOrThrow()).getDirection()==="rtl"}function z(K,O,Z){const oe=V(K);ce(K,O,Z?!oe:oe,"character")}function q(K){const O=K.anchor,Z=K.focus,W=O.getNode().getTopLevelElementOrThrow().getParentOrThrow();let J=W.getFirstDescendant(),R=W.getLastDescendant(),U="element",X="element",fe=0;e.$isTextNode(J)?U="text":!e.$isElementNode(J)&&J!==null&&(J=J.getParentOrThrow()),e.$isTextNode(R)?(X="text",fe=R.getTextContentSize()):!e.$isElementNode(R)&&R!==null&&(R=R.getParentOrThrow()),J&&R&&(O.set(J.getKey(),0,U),Z.set(R.getKey(),fe,X))}function Te(K,O,Z){const oe=K.getStyle(),Y=p(oe);return Y!==null&&Y[O]||Z}function Se(K,O,Z=""){let oe=null;const Y=K.getNodes(),W=K.anchor,J=K.focus,R=K.isBackward(),U=R?J.offset:W.offset,X=R?J.getNode():W.getNode();if(K.isCollapsed()&&K.style!==""){const fe=K.style,_e=p(fe);if(_e!==null&&O in _e)return _e[O]}for(let fe=0;fe<Y.length;fe++){const _e=Y[fe];if(!(fe!==0&&U===0&&_e.is(X))&&e.$isTextNode(_e)){const B=Te(_e,O,Z);if(oe===null)oe=B;else if(oe!==B){oe="";break}}}return oe===null?Z:oe}function Ee(K){if(e.$isDecoratorNode(K)&&!K.isInline())return!0;if(!e.$isElementNode(K)||e.$isRootOrShadowRoot(K))return!1;const O=K.getFirstChild(),Z=O===null||e.$isLineBreakNode(O)||e.$isTextNode(O)||O.isInline();return!K.isInline()&&K.canBeEmpty()!==!1&&Z}function de(K,O){let Z=K;for(;Z!==null&&Z.getParent()!==null&&!O(Z);)Z=Z.getParentOrThrow();return O(Z)?Z:null}return jn.$addNodeStyle=v,jn.$cloneWithProperties=S,jn.$getSelectionStyleValueForProperty=Se,jn.$isAtNodeEnd=M,jn.$isParentElementRTL=V,jn.$moveCaretSelection=ce,jn.$moveCharacter=z,jn.$patchStyleText=G,jn.$selectAll=q,jn.$setBlocksType=I,jn.$shouldOverrideDefaultCharacterSelection=te,jn.$sliceSelectedTextNodeContent=w,jn.$wrapNodes=j,jn.createDOMRange=l,jn.createRectsFromDOMRange=d,jn.getStyleObjectFromCSS=p,jn.trimTextContentFromAnchor=m,jn}var Vn={},zf;function ZN(){if(zf)return Vn;zf=1;var e=Yt();let t=new Map;function n(m){for(;m!=null;){if(m.nodeType===Node.TEXT_NODE)return m;m=m.firstChild}return null}function r(m){let v=m.parentNode;if(v==null)throw Error("Should never happen");return[v,Array.from(v.childNodes).indexOf(m)]}function l(m){let v={};m=m.split(";");for(let k of m)if(k!==""){let[G,I]=k.split(/:([^]+)/);G&&I&&(v[G.trim()]=I.trim())}return v}function d(m){let v=t.get(m);return v===void 0&&(v=l(m),t.set(m,v)),v}function f(m){let v="";for(let k in m)k&&(v+=`${k}: ${m[k]};`);return v}function p(m,v){var k=d("getStyle"in m?m.getStyle():m.style);v=Object.entries(v).reduce((G,[I,P])=>(P===null?delete G[I]:G[I]=P,G),{...k}),k=f(v),m.setStyle(k),t.set(k,v)}function _(m,v){var k=m.getNodes(),G=k.length;if(e.$isRangeSelection(m)){--G;var I=k[0],P=k[G];if(m.isCollapsed()&&e.$isRangeSelection(m))p(m,v);else{var H=m.anchor,j=m.focus,re=I.getTextContent().length,te=j.offset,ce=H.offset,V=H.isBefore(j),z=V?ce:te;m=V?te:ce;var q=V?H.type:j.type,Te=V?j.type:H.type;if(j=V?j.key:H.key,e.$isTextNode(I)&&z===re&&(V=I.getNextSibling(),e.$isTextNode(V)&&(z=ce=0,I=V)),k.length===1)e.$isTextNode(I)&&(z=q==="element"?0:ce>te?te:ce,m=Te==="element"?re:ce>te?ce:te,z!==m&&(z===0&&m===re?(p(I,v),I.select(z,m)):(k=I.splitText(z,m),k=z===0?k[0]:k[1],p(k,v),k.select(0,m-z))));else for(e.$isTextNode(I)&&z<I.getTextContentSize()&&(z!==0&&(I=I.splitText(z)[1],z=0,H.set(I.getKey(),z,"text")),p(I,v)),e.$isTextNode(P)&&(z=P.getTextContent().length,P.__key!==j&&m!==0&&(m=z),m!==z&&([P]=P.splitText(m)),m!==0&&p(P,v)),m=1;m<G;m++)z=k[m],H=z.getKey(),e.$isTextNode(z)&&H!==I.getKey()&&H!==P.getKey()&&!z.isToken()&&p(z,v)}}else{for(I=e.$createRangeSelection(),P=I.anchor,z=I.focus,H=0;H<G;H++)re=k[H],e.DEPRECATED_$isGridCellNode(re)&&(P.set(re.getKey(),0,"element"),z.set(re.getKey(),re.getChildrenSize(),"element"),_(e.$normalizeSelection__EXPERIMENTAL(I),v));e.$setSelection(m)}}function T(m){for(;m!==null&&!e.$isRootOrShadowRoot(m);){let v=m.getLatest(),k=m.getParent();v.getChildrenSize()===0&&m.remove(!0),m=k}}function E(m,v,k,G,I=null){if(v.length!==0){var P=v[0],H=new Map,j=[];P=e.$isElementNode(P)?P:P.getParentOrThrow(),P.isInline()&&(P=P.getParentOrThrow());for(var re=!1;P!==null;){var te=P.getPreviousSibling();if(te!==null){P=te,re=!0;break}if(P=P.getParentOrThrow(),e.$isRootOrShadowRoot(P))break}te=new Set;for(var ce=0;ce<k;ce++){var V=v[ce];e.$isElementNode(V)&&V.getChildrenSize()===0&&te.add(V.getKey())}var z=new Set;for(ce=0;ce<k;ce++){V=v[ce];var q=V.getParent();if(q!==null&&q.isInline()&&(q=q.getParent()),q!==null&&e.$isLeafNode(V)&&!z.has(V.getKey())){if(V=q.getKey(),H.get(V)===void 0){let Te=G();Te.setFormat(q.getFormatType()),Te.setIndent(q.getIndent()),j.push(Te),H.set(V,Te),q.getChildren().forEach(Se=>{Te.append(Se),z.add(Se.getKey()),e.$isElementNode(Se)&&Se.getChildrenKeys().forEach(Ee=>z.add(Ee))}),T(q)}}else if(te.has(V.getKey())){if(!e.$isElementNode(V))throw Error("Expected node in emptyElements to be an ElementNode");q=G(),q.setFormat(V.getFormatType()),q.setIndent(V.getIndent()),j.push(q),V.remove(!0)}}if(I!==null)for(v=0;v<j.length;v++)I.append(j[v]);if(v=null,e.$isRootOrShadowRoot(P))if(re)if(I!==null)P.insertAfter(I);else for(I=j.length-1;0<=I;I--)P.insertAfter(j[I]);else if(re=P.getFirstChild(),e.$isElementNode(re)&&(P=re),re===null)if(I)P.append(I);else for(I=0;I<j.length;I++)re=j[I],P.append(re),v=re;else if(I!==null)re.insertBefore(I);else for(P=0;P<j.length;P++)I=j[P],re.insertBefore(I),v=I;else if(I)P.insertAfter(I);else for(I=j.length-1;0<=I;I--)re=j[I],P.insertAfter(re),v=re;j=e.$getPreviousSelection(),e.$isRangeSelection(j)&&j.anchor.getNode().isAttached()&&j.focus.getNode().isAttached()?e.$setSelection(j.clone()):v!==null?v.selectEnd():m.dirty=!0}}function S(m,v,k,G){m.modify(v?"extend":"move",k,G)}function w(m){return m=m.anchor.getNode(),(e.$isRootNode(m)?m:m.getParentOrThrow()).getDirection()==="rtl"}function M(m){if(e.$isDecoratorNode(m)&&!m.isInline())return!0;if(!e.$isElementNode(m)||e.$isRootOrShadowRoot(m))return!1;var v=m.getFirstChild();return v=v===null||e.$isLineBreakNode(v)||e.$isTextNode(v)||v.isInline(),!m.isInline()&&m.canBeEmpty()!==!1&&v}return Vn.$addNodeStyle=function(m){m=m.getStyle();let v=l(m);t.set(m,v)},Vn.$cloneWithProperties=function(m){let v=m.constructor.clone(m);return v.__parent=m.__parent,v.__next=m.__next,v.__prev=m.__prev,e.$isElementNode(m)&&e.$isElementNode(v)?(v.__first=m.__first,v.__last=m.__last,v.__size=m.__size,v.__format=m.__format,v.__indent=m.__indent,v.__dir=m.__dir,v):(e.$isTextNode(m)&&e.$isTextNode(v)&&(v.__format=m.__format,v.__style=m.__style,v.__mode=m.__mode,v.__detail=m.__detail),v)},Vn.$getSelectionStyleValueForProperty=function(m,v,k=""){let G=null,I=m.getNodes();var P=m.anchor,H=m.focus,j=m.isBackward();let re=j?H.offset:P.offset;if(P=j?H.getNode():P.getNode(),m.isCollapsed()&&m.style!==""&&(m=d(m.style),m!==null&&v in m))return m[v];for(m=0;m<I.length;m++){var te=I[m];if((m===0||re!==0||!te.is(P))&&e.$isTextNode(te)){if(H=v,j=k,te=te.getStyle(),te=d(te),H=te!==null&&te[H]||j,G===null)G=H;else if(G!==H){G="";break}}}return G===null?k:G},Vn.$isAtNodeEnd=function(m){if(m.type==="text")return m.offset===m.getNode().getTextContentSize();let v=m.getNode();if(!e.$isElementNode(v))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return m.offset===v.getChildrenSize()},Vn.$isParentElementRTL=w,Vn.$moveCaretSelection=S,Vn.$moveCharacter=function(m,v,k){let G=w(m);S(m,v,k?!G:G,"character")},Vn.$patchStyleText=_,Vn.$selectAll=function(m){let v=m.anchor;m=m.focus;var k=v.getNode().getTopLevelElementOrThrow().getParentOrThrow();let G=k.getFirstDescendant();k=k.getLastDescendant();let I="element",P="element",H=0;e.$isTextNode(G)?I="text":e.$isElementNode(G)||G===null||(G=G.getParentOrThrow()),e.$isTextNode(k)?(P="text",H=k.getTextContentSize()):e.$isElementNode(k)||k===null||(k=k.getParentOrThrow()),G&&k&&(v.set(G.getKey(),0,I),m.set(k.getKey(),H,P))},Vn.$setBlocksType=function(m,v){if(m.anchor.key==="root"){v=v();var k=e.$getRoot();(m=k.getFirstChild())?m.replace(v,!0):k.append(v)}else{for(k=m.getNodes(),m=m.anchor.getNode();m!==null&&m.getParent()!==null&&!M(m);)m=m.getParentOrThrow();for((m=M(m)?m:null)&&k.indexOf(m)===-1&&k.push(m),m=0;m<k.length;m++){let G=k[m];if(!M(G))continue;if(!e.$isElementNode(G))throw Error("Expected block node to be an ElementNode");let I=v();I.setFormat(G.getFormatType()),I.setIndent(G.getIndent()),G.replace(I,!0)}}},Vn.$shouldOverrideDefaultCharacterSelection=function(m,v){return m=e.$getAdjacentNode(m.focus,v),e.$isDecoratorNode(m)&&!m.isIsolated()||e.$isElementNode(m)&&!m.isInline()&&!m.canBeEmpty()},Vn.$sliceSelectedTextNodeContent=function(m,v){if(v.isSelected(m)&&!v.isSegmented()&&!v.isToken()&&e.$INTERNAL_isPointSelection(m)){var k=m.anchor.getNode(),G=m.focus.getNode(),I=v.is(k),P=v.is(G);if(I||P){I=m.isBackward();let[H,j]=m.getCharacterOffsets();m=k.is(G),P=v.is(I?G:k),G=v.is(I?k:G),k=0;let re;m?(k=H>j?j:H,re=H>j?H:j):P?(k=I?j:H,re=void 0):G&&(I=I?H:j,k=0,re=I),v.__text=v.__text.slice(k,re)}}return v},Vn.$wrapNodes=function(m,v,k=null){var G=m.getNodes();let I=G.length;var P=m.anchor;if(I===0||I===1&&P.type==="element"&&P.getNode().getChildrenSize()===0){m=P.type==="text"?P.getNode().getParentOrThrow():P.getNode(),G=m.getChildren();let j=v();j.setFormat(m.getFormatType()),j.setIndent(m.getIndent()),G.forEach(re=>j.append(re)),k&&(j=k.append(j)),m.replace(j)}else{P=null;var H=[];for(let j=0;j<I;j++){let re=G[j];e.$isRootOrShadowRoot(re)?(E(m,H,H.length,v,k),H=[],P=re):P===null||P!==null&&e.$hasAncestor(re,P)?H.push(re):(E(m,H,H.length,v,k),H=[re])}E(m,H,H.length,v,k)}},Vn.createDOMRange=function(m,v,k,G,I){let P=v.getKey(),H=G.getKey(),j=document.createRange(),re=m.getElementByKey(P);if(m=m.getElementByKey(H),e.$isTextNode(v)&&(re=n(re)),e.$isTextNode(G)&&(m=n(m)),v===void 0||G===void 0||re===null||m===null)return null;re.nodeName==="BR"&&([re,k]=r(re)),m.nodeName==="BR"&&([m,I]=r(m)),v=re.firstChild,re===m&&v!=null&&v.nodeName==="BR"&&k===0&&I===0&&(I=1);try{j.setStart(re,k),j.setEnd(m,I)}catch{return null}return!j.collapsed||k===I&&P===H||(j.setStart(m,I),j.setEnd(re,k)),j},Vn.createRectsFromDOMRange=function(m,v){var k=m.getRootElement();if(k===null)return[];m=k.getBoundingClientRect(),k=getComputedStyle(k),k=parseFloat(k.paddingLeft)+parseFloat(k.paddingRight),v=Array.from(v.getClientRects());let G=v.length;v.sort((P,H)=>{let j=P.top-H.top;return 3>=Math.abs(j)?P.left-H.left:j});let I;for(let P=0;P<G;P++){let H=v[P],j=H.width+k===m.width;I&&I.top<=H.top&&I.top+I.height>H.top&&I.left+I.width>H.left||j?(v.splice(P--,1),G--):I=H}return v},Vn.getStyleObjectFromCSS=d,Vn.trimTextContentFromAnchor=function(m,v,k){let G=v.getNode();if(e.$isElementNode(G)){var I=G.getDescendantByIndex(v.offset);I!==null&&(G=I)}for(;0<k&&G!==null;){e.$isElementNode(G)&&(I=G.getLastDescendant(),I!==null&&(G=I));var P=G.getPreviousSibling(),H=0;if(P===null){I=G.getParentOrThrow();for(var j=I.getPreviousSibling();j===null;){if(I=I.getParent(),I===null){P=null;break}j=I.getPreviousSibling()}I!==null&&(H=I.isInline()?0:2,P=j)}if(j=G.getTextContent(),j===""&&e.$isElementNode(G)&&!G.isInline()&&(j=`
|
|
72
|
+
`);const U=R.length;if(!e.$isTextNode(oe)||Y>=U){const X=oe.getParent();oe.remove(),X!=null&&X.getChildrenSize()===0&&!e.$isRootNode(X)&&X.remove(),Y-=U+J,oe=W}else{const X=oe.getKey(),fe=K.getEditorState().read(()=>{const M=e.$getNodeByKey(X);return e.$isTextNode(M)&&M.isSimpleText()?M.getTextContent():null}),_e=U-Y,B=R.slice(0,_e);if(fe!==null&&fe!==R){const M=e.$getPreviousSelection();let F=oe;if(oe.isSimpleText())oe.setTextContent(fe);else{const se=e.$createTextNode(fe);oe.replace(se),F=se}if(e.$isRangeSelection(M)&&M.isCollapsed()){const se=M.anchor.offset;F.select(se,se)}}else if(oe.isSimpleText()){const M=D.key===X;let F=D.offset;F<Y&&(F=U);const se=M?F-Y:0,ye=M?F:_e;if(M&&se===0){const[De]=oe.splitText(se,ye);De.remove()}else{const[,De]=oe.splitText(se,ye);De.remove()}}else{const M=e.$createTextNode(B);oe.replace(M)}Y=0}}}function v(K){const D=K.getStyle(),Z=f(D);t.set(D,Z)}function I(K,D){const Z=p("getStyle"in K?K.getStyle():K.style),oe=Object.entries(D).reduce((W,[J,R])=>(R===null?delete W[J]:W[J]=R,W),{...Z}),Y=_(oe);K.setStyle(Y),t.set(Y,oe)}function G(K,D){const Z=K.getNodes(),oe=Z.length;if(!e.$isRangeSelection(K)){const ne=e.$createRangeSelection(),ue=ne.anchor,be=ne.focus;for(let Ne=0;Ne<oe;Ne++){const Re=Z[Ne];e.DEPRECATED_$isGridCellNode(Re)&&(ue.set(Re.getKey(),0,"element"),be.set(Re.getKey(),Re.getChildrenSize(),"element"),G(e.$normalizeSelection__EXPERIMENTAL(ne),D))}e.$setSelection(K);return}const Y=oe-1;let W=Z[0],J=Z[Y];if(K.isCollapsed()&&e.$isRangeSelection(K)){I(K,D);return}const R=K.anchor,U=K.focus,fe=W.getTextContent().length,_e=U.offset;let B=R.offset;const M=R.isBefore(U);let F=M?B:_e,se=M?_e:B;const ye=M?R.type:U.type,De=M?U.type:R.type,ee=M?U.key:R.key;if(e.$isTextNode(W)&&F===fe){const ne=W.getNextSibling();e.$isTextNode(ne)&&(B=0,F=0,W=ne)}if(Z.length===1){if(e.$isTextNode(W)){if(F=ye==="element"?0:B>_e?_e:B,se=De==="element"?fe:B>_e?B:_e,F===se)return;if(F===0&&se===fe)I(W,D),W.select(F,se);else{const ne=W.splitText(F,se),ue=F===0?ne[0]:ne[1];I(ue,D),ue.select(0,se-F)}}}else{if(e.$isTextNode(W)&&F<W.getTextContentSize()&&(F!==0&&(W=W.splitText(F)[1],F=0,R.set(W.getKey(),F,"text")),I(W,D)),e.$isTextNode(J)){const ue=J.getTextContent().length;J.__key!==ee&&se!==0&&(se=ue),se!==ue&&([J]=J.splitText(se)),se!==0&&I(J,D)}for(let ne=1;ne<Y;ne++){const ue=Z[ne],be=ue.getKey();e.$isTextNode(ue)&&be!==W.getKey()&&be!==J.getKey()&&!ue.isToken()&&I(ue,D)}}}function k(K,D){if(K.anchor.key==="root"){const Y=D(),W=e.$getRoot(),J=W.getFirstChild();J?J.replace(Y,!0):W.append(Y);return}const Z=K.getNodes(),oe=de(K.anchor.getNode(),Ee);oe&&Z.indexOf(oe)===-1&&Z.push(oe);for(let Y=0;Y<Z.length;Y++){const W=Z[Y];if(!Ee(W))continue;if(!e.$isElementNode(W))throw Error("Expected block node to be an ElementNode");const J=D();J.setFormat(W.getFormatType()),J.setIndent(W.getIndent()),W.replace(J,!0)}}function P(K){return K.getNode().isAttached()}function H(K){let D=K;for(;D!==null&&!e.$isRootOrShadowRoot(D);){const Z=D.getLatest(),oe=D.getParent();Z.getChildrenSize()===0&&D.remove(!0),D=oe}}function j(K,D,Z=null){const oe=K.getNodes(),Y=oe.length,W=K.anchor;if(Y===0||Y===1&&W.type==="element"&&W.getNode().getChildrenSize()===0){const U=W.type==="text"?W.getNode().getParentOrThrow():W.getNode(),X=U.getChildren();let fe=D();fe.setFormat(U.getFormatType()),fe.setIndent(U.getIndent()),X.forEach(_e=>fe.append(_e)),Z&&(fe=Z.append(fe)),U.replace(fe);return}let J=null,R=[];for(let U=0;U<Y;U++){const X=oe[U];e.$isRootOrShadowRoot(X)?(re(K,R,R.length,D,Z),R=[],J=X):J===null||J!==null&&e.$hasAncestor(X,J)?R.push(X):(re(K,R,R.length,D,Z),R=[X])}re(K,R,R.length,D,Z)}function re(K,D,Z,oe,Y=null){if(D.length===0)return;const W=D[0],J=new Map,R=[];let U=e.$isElementNode(W)?W:W.getParentOrThrow();U.isInline()&&(U=U.getParentOrThrow());let X=!1;for(;U!==null;){const F=U.getPreviousSibling();if(F!==null){U=F,X=!0;break}if(U=U.getParentOrThrow(),e.$isRootOrShadowRoot(U))break}const fe=new Set;for(let F=0;F<Z;F++){const se=D[F];e.$isElementNode(se)&&se.getChildrenSize()===0&&fe.add(se.getKey())}const _e=new Set;for(let F=0;F<Z;F++){const se=D[F];let ye=se.getParent();if(ye!==null&&ye.isInline()&&(ye=ye.getParent()),ye!==null&&e.$isLeafNode(se)&&!_e.has(se.getKey())){const De=ye.getKey();if(J.get(De)===void 0){const ee=oe();ee.setFormat(ye.getFormatType()),ee.setIndent(ye.getIndent()),R.push(ee),J.set(De,ee),ye.getChildren().forEach(ne=>{ee.append(ne),_e.add(ne.getKey()),e.$isElementNode(ne)&&ne.getChildrenKeys().forEach(ue=>_e.add(ue))}),H(ye)}}else if(fe.has(se.getKey())){if(!e.$isElementNode(se))throw Error("Expected node in emptyElements to be an ElementNode");const De=oe();De.setFormat(se.getFormatType()),De.setIndent(se.getIndent()),R.push(De),se.remove(!0)}}if(Y!==null)for(let F=0;F<R.length;F++){const se=R[F];Y.append(se)}let B=null;if(e.$isRootOrShadowRoot(U))if(X)if(Y!==null)U.insertAfter(Y);else for(let F=R.length-1;F>=0;F--){const se=R[F];U.insertAfter(se)}else{const F=U.getFirstChild();if(e.$isElementNode(F)&&(U=F),F===null)if(Y)U.append(Y);else for(let se=0;se<R.length;se++){const ye=R[se];U.append(ye),B=ye}else if(Y!==null)F.insertBefore(Y);else for(let se=0;se<R.length;se++){const ye=R[se];F.insertBefore(ye),B=ye}}else if(Y)U.insertAfter(Y);else for(let F=R.length-1;F>=0;F--){const se=R[F];U.insertAfter(se),B=se}const M=e.$getPreviousSelection();e.$isRangeSelection(M)&&P(M.anchor)&&P(M.focus)?e.$setSelection(M.clone()):B!==null?B.selectEnd():K.dirty=!0}function te(K,D){const Z=e.$getAdjacentNode(K.focus,D);return e.$isDecoratorNode(Z)&&!Z.isIsolated()||e.$isElementNode(Z)&&!Z.isInline()&&!Z.canBeEmpty()}function ce(K,D,Z,oe){K.modify(D?"extend":"move",Z,oe)}function V(K){const D=K.anchor.getNode();return(e.$isRootNode(D)?D:D.getParentOrThrow()).getDirection()==="rtl"}function z(K,D,Z){const oe=V(K);ce(K,D,Z?!oe:oe,"character")}function q(K){const D=K.anchor,Z=K.focus,W=D.getNode().getTopLevelElementOrThrow().getParentOrThrow();let J=W.getFirstDescendant(),R=W.getLastDescendant(),U="element",X="element",fe=0;e.$isTextNode(J)?U="text":!e.$isElementNode(J)&&J!==null&&(J=J.getParentOrThrow()),e.$isTextNode(R)?(X="text",fe=R.getTextContentSize()):!e.$isElementNode(R)&&R!==null&&(R=R.getParentOrThrow()),J&&R&&(D.set(J.getKey(),0,U),Z.set(R.getKey(),fe,X))}function Te(K,D,Z){const oe=K.getStyle(),Y=p(oe);return Y!==null&&Y[D]||Z}function Se(K,D,Z=""){let oe=null;const Y=K.getNodes(),W=K.anchor,J=K.focus,R=K.isBackward(),U=R?J.offset:W.offset,X=R?J.getNode():W.getNode();if(K.isCollapsed()&&K.style!==""){const fe=K.style,_e=p(fe);if(_e!==null&&D in _e)return _e[D]}for(let fe=0;fe<Y.length;fe++){const _e=Y[fe];if(!(fe!==0&&U===0&&_e.is(X))&&e.$isTextNode(_e)){const B=Te(_e,D,Z);if(oe===null)oe=B;else if(oe!==B){oe="";break}}}return oe===null?Z:oe}function Ee(K){if(e.$isDecoratorNode(K)&&!K.isInline())return!0;if(!e.$isElementNode(K)||e.$isRootOrShadowRoot(K))return!1;const D=K.getFirstChild(),Z=D===null||e.$isLineBreakNode(D)||e.$isTextNode(D)||D.isInline();return!K.isInline()&&K.canBeEmpty()!==!1&&Z}function de(K,D){let Z=K;for(;Z!==null&&Z.getParent()!==null&&!D(Z);)Z=Z.getParentOrThrow();return D(Z)?Z:null}return jn.$addNodeStyle=v,jn.$cloneWithProperties=S,jn.$getSelectionStyleValueForProperty=Se,jn.$isAtNodeEnd=O,jn.$isParentElementRTL=V,jn.$moveCaretSelection=ce,jn.$moveCharacter=z,jn.$patchStyleText=G,jn.$selectAll=q,jn.$setBlocksType=k,jn.$shouldOverrideDefaultCharacterSelection=te,jn.$sliceSelectedTextNodeContent=w,jn.$wrapNodes=j,jn.createDOMRange=l,jn.createRectsFromDOMRange=d,jn.getStyleObjectFromCSS=p,jn.trimTextContentFromAnchor=m,jn}var Vn={},jf;function eC(){if(jf)return Vn;jf=1;var e=jt();let t=new Map;function n(m){for(;m!=null;){if(m.nodeType===Node.TEXT_NODE)return m;m=m.firstChild}return null}function r(m){let v=m.parentNode;if(v==null)throw Error("Should never happen");return[v,Array.from(v.childNodes).indexOf(m)]}function l(m){let v={};m=m.split(";");for(let I of m)if(I!==""){let[G,k]=I.split(/:([^]+)/);G&&k&&(v[G.trim()]=k.trim())}return v}function d(m){let v=t.get(m);return v===void 0&&(v=l(m),t.set(m,v)),v}function f(m){let v="";for(let I in m)I&&(v+=`${I}: ${m[I]};`);return v}function p(m,v){var I=d("getStyle"in m?m.getStyle():m.style);v=Object.entries(v).reduce((G,[k,P])=>(P===null?delete G[k]:G[k]=P,G),{...I}),I=f(v),m.setStyle(I),t.set(I,v)}function _(m,v){var I=m.getNodes(),G=I.length;if(e.$isRangeSelection(m)){--G;var k=I[0],P=I[G];if(m.isCollapsed()&&e.$isRangeSelection(m))p(m,v);else{var H=m.anchor,j=m.focus,re=k.getTextContent().length,te=j.offset,ce=H.offset,V=H.isBefore(j),z=V?ce:te;m=V?te:ce;var q=V?H.type:j.type,Te=V?j.type:H.type;if(j=V?j.key:H.key,e.$isTextNode(k)&&z===re&&(V=k.getNextSibling(),e.$isTextNode(V)&&(z=ce=0,k=V)),I.length===1)e.$isTextNode(k)&&(z=q==="element"?0:ce>te?te:ce,m=Te==="element"?re:ce>te?ce:te,z!==m&&(z===0&&m===re?(p(k,v),k.select(z,m)):(I=k.splitText(z,m),I=z===0?I[0]:I[1],p(I,v),I.select(0,m-z))));else for(e.$isTextNode(k)&&z<k.getTextContentSize()&&(z!==0&&(k=k.splitText(z)[1],z=0,H.set(k.getKey(),z,"text")),p(k,v)),e.$isTextNode(P)&&(z=P.getTextContent().length,P.__key!==j&&m!==0&&(m=z),m!==z&&([P]=P.splitText(m)),m!==0&&p(P,v)),m=1;m<G;m++)z=I[m],H=z.getKey(),e.$isTextNode(z)&&H!==k.getKey()&&H!==P.getKey()&&!z.isToken()&&p(z,v)}}else{for(k=e.$createRangeSelection(),P=k.anchor,z=k.focus,H=0;H<G;H++)re=I[H],e.DEPRECATED_$isGridCellNode(re)&&(P.set(re.getKey(),0,"element"),z.set(re.getKey(),re.getChildrenSize(),"element"),_(e.$normalizeSelection__EXPERIMENTAL(k),v));e.$setSelection(m)}}function E(m){for(;m!==null&&!e.$isRootOrShadowRoot(m);){let v=m.getLatest(),I=m.getParent();v.getChildrenSize()===0&&m.remove(!0),m=I}}function T(m,v,I,G,k=null){if(v.length!==0){var P=v[0],H=new Map,j=[];P=e.$isElementNode(P)?P:P.getParentOrThrow(),P.isInline()&&(P=P.getParentOrThrow());for(var re=!1;P!==null;){var te=P.getPreviousSibling();if(te!==null){P=te,re=!0;break}if(P=P.getParentOrThrow(),e.$isRootOrShadowRoot(P))break}te=new Set;for(var ce=0;ce<I;ce++){var V=v[ce];e.$isElementNode(V)&&V.getChildrenSize()===0&&te.add(V.getKey())}var z=new Set;for(ce=0;ce<I;ce++){V=v[ce];var q=V.getParent();if(q!==null&&q.isInline()&&(q=q.getParent()),q!==null&&e.$isLeafNode(V)&&!z.has(V.getKey())){if(V=q.getKey(),H.get(V)===void 0){let Te=G();Te.setFormat(q.getFormatType()),Te.setIndent(q.getIndent()),j.push(Te),H.set(V,Te),q.getChildren().forEach(Se=>{Te.append(Se),z.add(Se.getKey()),e.$isElementNode(Se)&&Se.getChildrenKeys().forEach(Ee=>z.add(Ee))}),E(q)}}else if(te.has(V.getKey())){if(!e.$isElementNode(V))throw Error("Expected node in emptyElements to be an ElementNode");q=G(),q.setFormat(V.getFormatType()),q.setIndent(V.getIndent()),j.push(q),V.remove(!0)}}if(k!==null)for(v=0;v<j.length;v++)k.append(j[v]);if(v=null,e.$isRootOrShadowRoot(P))if(re)if(k!==null)P.insertAfter(k);else for(k=j.length-1;0<=k;k--)P.insertAfter(j[k]);else if(re=P.getFirstChild(),e.$isElementNode(re)&&(P=re),re===null)if(k)P.append(k);else for(k=0;k<j.length;k++)re=j[k],P.append(re),v=re;else if(k!==null)re.insertBefore(k);else for(P=0;P<j.length;P++)k=j[P],re.insertBefore(k),v=k;else if(k)P.insertAfter(k);else for(k=j.length-1;0<=k;k--)re=j[k],P.insertAfter(re),v=re;j=e.$getPreviousSelection(),e.$isRangeSelection(j)&&j.anchor.getNode().isAttached()&&j.focus.getNode().isAttached()?e.$setSelection(j.clone()):v!==null?v.selectEnd():m.dirty=!0}}function S(m,v,I,G){m.modify(v?"extend":"move",I,G)}function w(m){return m=m.anchor.getNode(),(e.$isRootNode(m)?m:m.getParentOrThrow()).getDirection()==="rtl"}function O(m){if(e.$isDecoratorNode(m)&&!m.isInline())return!0;if(!e.$isElementNode(m)||e.$isRootOrShadowRoot(m))return!1;var v=m.getFirstChild();return v=v===null||e.$isLineBreakNode(v)||e.$isTextNode(v)||v.isInline(),!m.isInline()&&m.canBeEmpty()!==!1&&v}return Vn.$addNodeStyle=function(m){m=m.getStyle();let v=l(m);t.set(m,v)},Vn.$cloneWithProperties=function(m){let v=m.constructor.clone(m);return v.__parent=m.__parent,v.__next=m.__next,v.__prev=m.__prev,e.$isElementNode(m)&&e.$isElementNode(v)?(v.__first=m.__first,v.__last=m.__last,v.__size=m.__size,v.__format=m.__format,v.__indent=m.__indent,v.__dir=m.__dir,v):(e.$isTextNode(m)&&e.$isTextNode(v)&&(v.__format=m.__format,v.__style=m.__style,v.__mode=m.__mode,v.__detail=m.__detail),v)},Vn.$getSelectionStyleValueForProperty=function(m,v,I=""){let G=null,k=m.getNodes();var P=m.anchor,H=m.focus,j=m.isBackward();let re=j?H.offset:P.offset;if(P=j?H.getNode():P.getNode(),m.isCollapsed()&&m.style!==""&&(m=d(m.style),m!==null&&v in m))return m[v];for(m=0;m<k.length;m++){var te=k[m];if((m===0||re!==0||!te.is(P))&&e.$isTextNode(te)){if(H=v,j=I,te=te.getStyle(),te=d(te),H=te!==null&&te[H]||j,G===null)G=H;else if(G!==H){G="";break}}}return G===null?I:G},Vn.$isAtNodeEnd=function(m){if(m.type==="text")return m.offset===m.getNode().getTextContentSize();let v=m.getNode();if(!e.$isElementNode(v))throw Error("isAtNodeEnd: node must be a TextNode or ElementNode");return m.offset===v.getChildrenSize()},Vn.$isParentElementRTL=w,Vn.$moveCaretSelection=S,Vn.$moveCharacter=function(m,v,I){let G=w(m);S(m,v,I?!G:G,"character")},Vn.$patchStyleText=_,Vn.$selectAll=function(m){let v=m.anchor;m=m.focus;var I=v.getNode().getTopLevelElementOrThrow().getParentOrThrow();let G=I.getFirstDescendant();I=I.getLastDescendant();let k="element",P="element",H=0;e.$isTextNode(G)?k="text":e.$isElementNode(G)||G===null||(G=G.getParentOrThrow()),e.$isTextNode(I)?(P="text",H=I.getTextContentSize()):e.$isElementNode(I)||I===null||(I=I.getParentOrThrow()),G&&I&&(v.set(G.getKey(),0,k),m.set(I.getKey(),H,P))},Vn.$setBlocksType=function(m,v){if(m.anchor.key==="root"){v=v();var I=e.$getRoot();(m=I.getFirstChild())?m.replace(v,!0):I.append(v)}else{for(I=m.getNodes(),m=m.anchor.getNode();m!==null&&m.getParent()!==null&&!O(m);)m=m.getParentOrThrow();for((m=O(m)?m:null)&&I.indexOf(m)===-1&&I.push(m),m=0;m<I.length;m++){let G=I[m];if(!O(G))continue;if(!e.$isElementNode(G))throw Error("Expected block node to be an ElementNode");let k=v();k.setFormat(G.getFormatType()),k.setIndent(G.getIndent()),G.replace(k,!0)}}},Vn.$shouldOverrideDefaultCharacterSelection=function(m,v){return m=e.$getAdjacentNode(m.focus,v),e.$isDecoratorNode(m)&&!m.isIsolated()||e.$isElementNode(m)&&!m.isInline()&&!m.canBeEmpty()},Vn.$sliceSelectedTextNodeContent=function(m,v){if(v.isSelected(m)&&!v.isSegmented()&&!v.isToken()&&e.$INTERNAL_isPointSelection(m)){var I=m.anchor.getNode(),G=m.focus.getNode(),k=v.is(I),P=v.is(G);if(k||P){k=m.isBackward();let[H,j]=m.getCharacterOffsets();m=I.is(G),P=v.is(k?G:I),G=v.is(k?I:G),I=0;let re;m?(I=H>j?j:H,re=H>j?H:j):P?(I=k?j:H,re=void 0):G&&(k=k?H:j,I=0,re=k),v.__text=v.__text.slice(I,re)}}return v},Vn.$wrapNodes=function(m,v,I=null){var G=m.getNodes();let k=G.length;var P=m.anchor;if(k===0||k===1&&P.type==="element"&&P.getNode().getChildrenSize()===0){m=P.type==="text"?P.getNode().getParentOrThrow():P.getNode(),G=m.getChildren();let j=v();j.setFormat(m.getFormatType()),j.setIndent(m.getIndent()),G.forEach(re=>j.append(re)),I&&(j=I.append(j)),m.replace(j)}else{P=null;var H=[];for(let j=0;j<k;j++){let re=G[j];e.$isRootOrShadowRoot(re)?(T(m,H,H.length,v,I),H=[],P=re):P===null||P!==null&&e.$hasAncestor(re,P)?H.push(re):(T(m,H,H.length,v,I),H=[re])}T(m,H,H.length,v,I)}},Vn.createDOMRange=function(m,v,I,G,k){let P=v.getKey(),H=G.getKey(),j=document.createRange(),re=m.getElementByKey(P);if(m=m.getElementByKey(H),e.$isTextNode(v)&&(re=n(re)),e.$isTextNode(G)&&(m=n(m)),v===void 0||G===void 0||re===null||m===null)return null;re.nodeName==="BR"&&([re,I]=r(re)),m.nodeName==="BR"&&([m,k]=r(m)),v=re.firstChild,re===m&&v!=null&&v.nodeName==="BR"&&I===0&&k===0&&(k=1);try{j.setStart(re,I),j.setEnd(m,k)}catch{return null}return!j.collapsed||I===k&&P===H||(j.setStart(m,k),j.setEnd(re,I)),j},Vn.createRectsFromDOMRange=function(m,v){var I=m.getRootElement();if(I===null)return[];m=I.getBoundingClientRect(),I=getComputedStyle(I),I=parseFloat(I.paddingLeft)+parseFloat(I.paddingRight),v=Array.from(v.getClientRects());let G=v.length;v.sort((P,H)=>{let j=P.top-H.top;return 3>=Math.abs(j)?P.left-H.left:j});let k;for(let P=0;P<G;P++){let H=v[P],j=H.width+I===m.width;k&&k.top<=H.top&&k.top+k.height>H.top&&k.left+k.width>H.left||j?(v.splice(P--,1),G--):k=H}return v},Vn.getStyleObjectFromCSS=d,Vn.trimTextContentFromAnchor=function(m,v,I){let G=v.getNode();if(e.$isElementNode(G)){var k=G.getDescendantByIndex(v.offset);k!==null&&(G=k)}for(;0<I&&G!==null;){e.$isElementNode(G)&&(k=G.getLastDescendant(),k!==null&&(G=k));var P=G.getPreviousSibling(),H=0;if(P===null){k=G.getParentOrThrow();for(var j=k.getPreviousSibling();j===null;){if(k=k.getParent(),k===null){P=null;break}j=k.getPreviousSibling()}k!==null&&(H=k.isInline()?0:2,P=j)}if(j=G.getTextContent(),j===""&&e.$isElementNode(G)&&!G.isInline()&&(j=`
|
|
73
73
|
|
|
74
|
-
`),I=j.length,!e.$isTextNode(G)||k>=I)j=G.getParent(),G.remove(),j==null||j.getChildrenSize()!==0||e.$isRootNode(j)||j.remove(),k-=I+H,G=P;else{let re=G.getKey();H=m.getEditorState().read(()=>{const ce=e.$getNodeByKey(re);return e.$isTextNode(ce)&&ce.isSimpleText()?ce.getTextContent():null}),P=I-k;let te=j.slice(0,P);H!==null&&H!==j?(k=e.$getPreviousSelection(),I=G,G.isSimpleText()?G.setTextContent(H):(I=e.$createTextNode(H),G.replace(I)),e.$isRangeSelection(k)&&k.isCollapsed()&&(k=k.anchor.offset,I.select(k,k))):G.isSimpleText()?(H=v.key===re,j=v.offset,j<k&&(j=I),k=H?j-k:0,I=H?j:P,H&&k===0?([k]=G.splitText(k,I),k.remove()):([,k]=G.splitText(k,I),k.remove())):(k=e.$createTextNode(te),G.replace(k)),k=0}}},Vn}var iu,Uf;function vs(){return Uf||(Uf=1,iu=process.env.NODE_ENV==="development"?qN():ZN()),iu}var Gf;function JN(){if(Gf)return Sn;Gf=1;var e=vs(),t=Yt();function n(...te){return()=>{te.forEach(ce=>ce())}}function r(te){return`${te}px`}const l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(te,ce,V){let z=null,q=null,Te=null,Se=[];const Ee=document.createElement("div");function de(){if(z===null)throw Error("Unexpected null rootDOMNode");if(q===null)throw Error("Unexpected null parentDOMNode");const{left:oe,top:Y}=z.getBoundingClientRect(),W=q,J=e.createRectsFromDOMRange(te,ce);Ee.isConnected||W.append(Ee);let R=!1;for(let U=0;U<J.length;U++){const X=J[U],fe=Se[U]||document.createElement("div"),_e=fe.style;_e.position!=="absolute"&&(_e.position="absolute",R=!0);const B=r(X.left-oe);_e.left!==B&&(_e.left=B,R=!0);const A=r(X.top-Y);_e.top!==A&&(fe.style.top=A,R=!0);const F=r(X.width);_e.width!==F&&(fe.style.width=F,R=!0);const se=r(X.height);_e.height!==se&&(fe.style.height=se,R=!0),fe.parentNode!==Ee&&(Ee.append(fe),R=!0),Se[U]=fe}for(;Se.length>J.length;)Se.pop();R&&V(Se)}function K(){q=null,z=null,Te!==null&&Te.disconnect(),Te=null,Ee.remove();for(const oe of Se)oe.remove();Se=[]}function O(){const oe=te.getRootElement();if(oe===null)return K();const Y=oe.parentElement;if(!(Y instanceof HTMLElement))return K();K(),z=oe,q=Y,Te=new MutationObserver(W=>{const J=te.getRootElement(),R=J&&J.parentElement;if(J!==z||R!==q)return O();for(const U of W)if(!Ee.contains(U.target))return de()}),Te.observe(Y,l),de()}const Z=te.registerRootListener(O);return()=>{Z(),K()}}function f(te,ce){let V=null,z=null,q=null,Te=null,Se=()=>{};function Ee(de){de.read(()=>{const K=t.$getSelection();if(!t.$isRangeSelection(K)){V=null,z=null,q=null,Te=null,Se(),Se=()=>{};return}const{anchor:O,focus:Z}=K,oe=O.getNode(),Y=oe.getKey(),W=O.offset,J=Z.getNode(),R=J.getKey(),U=Z.offset,X=te.getElementByKey(Y),fe=te.getElementByKey(R),_e=V===null||X===null||W!==z||Y!==V.getKey()||oe!==V&&(!(V instanceof t.TextNode)||oe.updateDOM(V,X,te._config)),B=q===null||fe===null||U!==Te||R!==q.getKey()||J!==q&&(!(q instanceof t.TextNode)||J.updateDOM(q,fe,te._config));if(_e||B){const A=te.getElementByKey(O.getNode().getKey()),F=te.getElementByKey(Z.getNode().getKey());if(A!==null&&F!==null&&A.tagName==="SPAN"&&F.tagName==="SPAN"){const se=document.createRange();let ye,De,ee,ne;Z.isBefore(O)?(ye=F,De=Z.offset,ee=A,ne=O.offset):(ye=A,De=O.offset,ee=F,ne=Z.offset);const ue=ye.firstChild;if(ue===null)throw Error("Expected text node to be first child of span");const be=ee.firstChild;if(be===null)throw Error("Expected text node to be first child of span");se.setStart(ue,De),se.setEnd(be,ne),Se(),Se=d(te,se,Ne=>{for(const Re of Ne){const ke=Re.style;ke.background!=="Highlight"&&(ke.background="Highlight"),ke.color!=="HighlightText"&&(ke.color="HighlightText"),ke.zIndex!=="-1"&&(ke.zIndex="-1"),ke.pointerEvents!=="none"&&(ke.pointerEvents="none"),ke.marginTop!==r(-1.5)&&(ke.marginTop=r(-1.5)),ke.paddingTop!==r(4)&&(ke.paddingTop=r(4)),ke.paddingBottom!==r(0)&&(ke.paddingBottom=r(0))}ce!==void 0&&ce(Ne)})}}V=oe,z=W,q=J,Te=U})}return Ee(te.getEditorState()),n(te.registerUpdateListener(({editorState:de})=>Ee(de)),Se,()=>{Se()})}function p(te,...ce){ce.forEach(V=>{if(typeof V=="string"){const z=V.split(" ").filter(q=>q!=="");te.classList.add(...z)}})}function _(te,...ce){ce.forEach(V=>{typeof V=="string"&&te.classList.remove(...V.split(" "))})}function T(te,ce){for(const V of ce)if(te.type.startsWith(V))return!0;return!1}function E(te,ce){const V=te[Symbol.iterator]();return new Promise((z,q)=>{const Te=[],Se=()=>{const{done:Ee,value:de}=V.next();if(Ee)return z(Te);const K=new FileReader;K.addEventListener("error",q),K.addEventListener("load",()=>{const O=K.result;typeof O=="string"&&Te.push({file:de,result:O}),Se()}),T(de,ce)?K.readAsDataURL(de):Se()};Se()})}function S(te,ce){const V=[],z=(te||t.$getRoot()).getLatest(),q=ce||(t.$isElementNode(z)?z.getLastDescendant():z);let Te=z,Se=w(Te);for(;Te!==null&&!Te.is(q);)if(V.push({depth:Se,node:Te}),t.$isElementNode(Te)&&Te.getChildrenSize()>0)Te=Te.getFirstChild(),Se++;else{let Ee=null;for(;Ee===null&&Te!==null;)Ee=Te.getNextSibling(),Ee===null?(Te=Te.getParent(),Se--):Te=Ee}return Te!==null&&Te.is(q)&&V.push({depth:Se,node:Te}),V}function w(te){let ce=te,V=0;for(;(ce=ce.getParent())!==null;)V++;return V}function M(te,ce){let V=te;for(;V!=null;){if(V instanceof ce)return V;V=V.getParent()}return null}function m(te){const ce=v(te,V=>t.$isElementNode(V)&&!V.isInline());if(!t.$isElementNode(ce))throw Error(`Expected node ${te.__key} to have closest block element node.`);return ce}const v=(te,ce)=>{let V=te;for(;V!==t.$getRoot()&&V!=null;){if(ce(V))return V;V=V.getParent()}return null};function k(te,ce,V,z){const q=Ee=>Ee instanceof ce,Te=Ee=>{const de=Ee.getChildren();for(let Z=0;Z<de.length;Z++){const oe=de[Z];if(q(oe))return null}let K=Ee,O=Ee;for(;K!==null;)if(O=K,K=K.getParent(),q(K))return{child:O,parent:K};return null},Se=Ee=>{const de=Te(Ee);if(de!==null){const{child:K,parent:O}=de;if(K.is(Ee)){z(O,Ee);const Z=K.getNextSiblings(),oe=Z.length;if(O.insertAfter(K),oe!==0){const Y=V(O);K.insertAfter(Y);for(let W=0;W<oe;W++)Y.append(Z[W])}!O.canBeEmpty()&&O.getChildrenSize()===0&&O.remove()}}};return te.registerNodeTransform(ce,Se)}function G(te,ce){const z=new Map,q=te._pendingEditorState;for(const[Se,Ee]of ce._nodeMap){const de=e.$cloneWithProperties(Ee);if(t.$isTextNode(de)){if(!t.$isTextNode(Ee))throw Error("Expected node be a TextNode");de.__text=Ee.__text}z.set(Se,de)}q&&(q._nodeMap=z),te._dirtyType=2;const Te=ce._selection;t.$setSelection(Te===null?null:Te.clone())}function I(te){const ce=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(ce)){const{focus:V}=ce,z=V.getNode(),q=V.offset;if(t.$isRootOrShadowRoot(z)){const Te=z.getChildAtIndex(q);Te==null?z.append(te):Te.insertBefore(te),te.selectNext()}else{let Te,Se;t.$isTextNode(z)?(Te=z.getParentOrThrow(),Se=z.getIndexWithinParent(),q>0&&(Se+=1,z.splitText(q))):(Te=z,Se=q);const[,Ee]=t.$splitNode(Te,Se);Ee.insertBefore(te),Ee.selectStart()}}else{if(ce!=null){const z=ce.getNodes();z[z.length-1].getTopLevelElementOrThrow().insertAfter(te)}else t.$getRoot().append(te);const V=t.$createParagraphNode();te.insertAfter(V),V.select()}return te.getLatest()}function P(te,ce){const V=ce();return te.replace(V),V.append(te),V}function H(te,ce){return te!==null?Object.getPrototypeOf(te).constructor.name===ce.name:!1}function j(te,ce){const V=[];for(let z=0;z<te.length;z++){const q=ce(te[z]);q!==null&&V.push(q)}return V}function re(te,ce){const V=te.getFirstChild();V!==null?V.insertBefore(ce):te.append(ce)}return Sn.$splitNode=t.$splitNode,Sn.isHTMLAnchorElement=t.isHTMLAnchorElement,Sn.isHTMLElement=t.isHTMLElement,Sn.$dfs=S,Sn.$filter=j,Sn.$findMatchingParent=v,Sn.$getNearestBlockElementAncestorOrThrow=m,Sn.$getNearestNodeOfType=M,Sn.$insertFirst=re,Sn.$insertNodeToNearestRoot=I,Sn.$restoreEditorState=G,Sn.$wrapNodeInElement=P,Sn.addClassNamesToElement=p,Sn.isMimeType=T,Sn.markSelection=f,Sn.mediaFileReader=E,Sn.mergeRegister=n,Sn.objectKlassEquals=H,Sn.positionNodeOnRange=d,Sn.registerNestedElementResolver=k,Sn.removeClassNamesFromElement=_,Sn}var wn={},Yf;function XN(){if(Yf)return wn;Yf=1;var e=vs(),t=Yt();function n(_){let T=new URLSearchParams;T.append("code",_);for(let E=1;E<arguments.length;E++)T.append("v",arguments[E]);throw Error(`Minified Lexical error #${_}; visit https://lexical.dev/docs/error?${T} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(..._){return()=>{_.forEach(T=>T())}}let l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(_,T,E){function S(){if(m===null)throw Error("Unexpected null rootDOMNode");if(v===null)throw Error("Unexpected null parentDOMNode");let{left:H,top:j}=m.getBoundingClientRect();var re=v;let te=e.createRectsFromDOMRange(_,T);I.isConnected||re.append(I),re=!1;for(let z=0;z<te.length;z++){var ce=te[z];let q=G[z]||document.createElement("div"),Te=q.style;Te.position!=="absolute"&&(Te.position="absolute",re=!0);var V=`${ce.left-H}px`;Te.left!==V&&(Te.left=V,re=!0),V=`${ce.top-j}px`,Te.top!==V&&(q.style.top=V,re=!0),V=`${ce.width}px`,Te.width!==V&&(q.style.width=V,re=!0),ce=`${ce.height}px`,Te.height!==ce&&(q.style.height=ce,re=!0),q.parentNode!==I&&(I.append(q),re=!0),G[z]=q}for(;G.length>te.length;)G.pop();re&&E(G)}function w(){m=v=null,k!==null&&k.disconnect(),k=null,I.remove();for(let H of G)H.remove();G=[]}function M(){let H=_.getRootElement();if(H===null)return w();let j=H.parentElement;if(!(j instanceof HTMLElement))return w();w(),m=H,v=j,k=new MutationObserver(re=>{let te=_.getRootElement(),ce=te&&te.parentElement;if(te!==m||ce!==v)return M();for(let V of re)if(!I.contains(V.target))return S()}),k.observe(j,l),S()}let m=null,v=null,k=null,G=[],I=document.createElement("div"),P=_.registerRootListener(M);return()=>{P(),w()}}function f(_,T){for(let E of T)if(_.type.startsWith(E))return!0;return!1}let p=(_,T)=>{for(;_!==t.$getRoot()&&_!=null;){if(T(_))return _;_=_.getParent()}return null};return wn.$splitNode=t.$splitNode,wn.isHTMLAnchorElement=t.isHTMLAnchorElement,wn.isHTMLElement=t.isHTMLElement,wn.$dfs=function(_,T){let E=[];_=(_||t.$getRoot()).getLatest(),T=T||(t.$isElementNode(_)?_.getLastDescendant():_);for(var S=_,w=0;(S=S.getParent())!==null;)w++;for(S=w;_!==null&&!_.is(T);)if(E.push({depth:S,node:_}),t.$isElementNode(_)&&0<_.getChildrenSize())_=_.getFirstChild(),S++;else for(w=null;w===null&&_!==null;)w=_.getNextSibling(),w===null?(_=_.getParent(),S--):_=w;return _!==null&&_.is(T)&&E.push({depth:S,node:_}),E},wn.$filter=function(_,T){let E=[];for(let S=0;S<_.length;S++){let w=T(_[S]);w!==null&&E.push(w)}return E},wn.$findMatchingParent=p,wn.$getNearestBlockElementAncestorOrThrow=function(_){let T=p(_,E=>t.$isElementNode(E)&&!E.isInline());return t.$isElementNode(T)||n(4,_.__key),T},wn.$getNearestNodeOfType=function(_,T){for(;_!=null;){if(_ instanceof T)return _;_=_.getParent()}return null},wn.$insertFirst=function(_,T){let E=_.getFirstChild();E!==null?E.insertBefore(T):_.append(T)},wn.$insertNodeToNearestRoot=function(_){var T=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(T)){var{focus:E}=T;if(T=E.getNode(),E=E.offset,t.$isRootOrShadowRoot(T))E=T.getChildAtIndex(E),E==null?T.append(_):E.insertBefore(_),_.selectNext();else{let S,w;t.$isTextNode(T)?(S=T.getParentOrThrow(),w=T.getIndexWithinParent(),0<E&&(w+=1,T.splitText(E))):(S=T,w=E),[,T]=t.$splitNode(S,w),T.insertBefore(_),T.selectStart()}}else T!=null?(T=T.getNodes(),T[T.length-1].getTopLevelElementOrThrow().insertAfter(_)):t.$getRoot().append(_),T=t.$createParagraphNode(),_.insertAfter(T),T.select();return _.getLatest()},wn.$restoreEditorState=function(_,T){let E=new Map,S=_._pendingEditorState;for(let[w,M]of T._nodeMap){let m=e.$cloneWithProperties(M);if(t.$isTextNode(m)){if(!t.$isTextNode(M))throw Error("Expected node be a TextNode");m.__text=M.__text}E.set(w,m)}S&&(S._nodeMap=E),_._dirtyType=2,_=T._selection,t.$setSelection(_===null?null:_.clone())},wn.$wrapNodeInElement=function(_,T){return T=T(),_.replace(T),T.append(_),T},wn.addClassNamesToElement=function(_,...T){T.forEach(E=>{typeof E=="string"&&(E=E.split(" ").filter(S=>S!==""),_.classList.add(...E))})},wn.isMimeType=f,wn.markSelection=function(_,T){function E(k){k.read(()=>{var G=t.$getSelection();if(t.$isRangeSelection(G)){var{anchor:I,focus:P}=G;G=I.getNode();var H=G.getKey(),j=I.offset,re=P.getNode(),te=re.getKey(),ce=P.offset,V=_.getElementByKey(H),z=_.getElementByKey(te);if(H=S===null||V===null||j!==w||H!==S.getKey()||G!==S&&(!(S instanceof t.TextNode)||G.updateDOM(S,V,_._config)),te=M===null||z===null||ce!==m||te!==M.getKey()||re!==M&&(!(M instanceof t.TextNode)||re.updateDOM(M,z,_._config)),H||te){V=_.getElementByKey(I.getNode().getKey());var q=_.getElementByKey(P.getNode().getKey());if(V!==null&&q!==null&&V.tagName==="SPAN"&&q.tagName==="SPAN"){if(te=document.createRange(),P.isBefore(I)?(H=q,z=P.offset,q=V,V=I.offset):(H=V,z=I.offset,V=P.offset),H=H.firstChild,H===null||(q=q.firstChild,q===null))throw Error("Expected text node to be first child of span");te.setStart(H,z),te.setEnd(q,V),v(),v=d(_,te,Te=>{for(let Se of Te){let Ee=Se.style;Ee.background!=="Highlight"&&(Ee.background="Highlight"),Ee.color!=="HighlightText"&&(Ee.color="HighlightText"),Ee.zIndex!=="-1"&&(Ee.zIndex="-1"),Ee.pointerEvents!=="none"&&(Ee.pointerEvents="none"),Ee.marginTop!=="-1.5px"&&(Ee.marginTop="-1.5px"),Ee.paddingTop!=="4px"&&(Ee.paddingTop="4px"),Ee.paddingBottom!=="0px"&&(Ee.paddingBottom="0px")}T!==void 0&&T(Te)})}}S=G,w=j,M=re,m=ce}else m=M=w=S=null,v(),v=()=>{}})}let S=null,w=null,M=null,m=null,v=()=>{};return E(_.getEditorState()),r(_.registerUpdateListener(({editorState:k})=>E(k)),v,()=>{v()})},wn.mediaFileReader=function(_,T){let E=_[Symbol.iterator]();return new Promise((S,w)=>{let M=[],m=()=>{const{done:v,value:k}=E.next();if(v)return S(M);const G=new FileReader;G.addEventListener("error",w),G.addEventListener("load",()=>{const I=G.result;typeof I=="string"&&M.push({file:k,result:I}),m()}),f(k,T)?G.readAsDataURL(k):m()};m()})},wn.mergeRegister=r,wn.objectKlassEquals=function(_,T){return _!==null?Object.getPrototypeOf(_).constructor.name===T.name:!1},wn.positionNodeOnRange=d,wn.registerNestedElementResolver=function(_,T,E,S){return _.registerNodeTransform(T,w=>{e:{for(var M=w.getChildren(),m=0;m<M.length;m++)if(M[m]instanceof T){M=null;break e}for(M=w;M!==null;)if(m=M,M=M.getParent(),M instanceof T){M={child:m,parent:M};break e}M=null}if(M!==null){const{child:v,parent:k}=M;if(v.is(w)){if(S(k,w),w=v.getNextSiblings(),M=w.length,k.insertAfter(v),M!==0){m=E(k),v.insertAfter(m);for(let G=0;G<M;G++)m.append(w[G])}k.canBeEmpty()||k.getChildrenSize()!==0||k.remove()}}})},wn.removeClassNamesFromElement=function(_,...T){T.forEach(E=>{typeof E=="string"&&_.classList.remove(...E.split(" "))})},wn}var su,jf;function pn(){return jf||(jf=1,su=process.env.NODE_ENV==="development"?JN():XN()),su}var ou={},Vf;function QN(){if(Vf)return ou;Vf=1;var e=Yt();function t(n){const r=window.location.origin,l=d=>{if(d.origin!==r)return;const f=n.getRootElement();if(document.activeElement!==f)return;const p=d.data;if(typeof p=="string"){let _;try{_=JSON.parse(p)}catch{return}if(_&&_.protocol==="nuanria_messaging"&&_.type==="request"){const T=_.payload;if(T&&T.functionId==="makeChanges"){const E=T.args;if(E){const[S,w,M,m,v,k]=E;n.update(()=>{const G=e.$getSelection();if(e.$isRangeSelection(G)){const I=G.anchor;let P=I.getNode(),H=0,j=0;if(e.$isTextNode(P)&&S>=0&&w>=0&&(H=S,j=S+w,G.setTextNodeRange(P,H,P,j)),(H!==j||M!=="")&&(G.insertRawText(M),P=I.getNode()),e.$isTextNode(P)){H=m,j=m+v;const re=P.getTextContentSize();H=H>re?re:H,j=j>re?re:j,G.setTextNodeRange(P,H,P,j)}d.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",l,!0),()=>{window.removeEventListener("message",l,!0)}}return ou.registerDragonSupport=t,ou}var lu={},qf;function eC(){if(qf)return lu;qf=1;var e=Yt();return lu.registerDragonSupport=function(t){let n=window.location.origin,r=l=>{if(l.origin===n){var d=t.getRootElement();if(document.activeElement===d&&(d=l.data,typeof d=="string")){try{var f=JSON.parse(d)}catch{return}if(f&&f.protocol==="nuanria_messaging"&&f.type==="request"&&(f=f.payload)&&f.functionId==="makeChanges"&&(f=f.args)){const[p,_,T,E,S]=f;t.update(()=>{const w=e.$getSelection();if(e.$isRangeSelection(w)){var M=w.anchor;let m=M.getNode(),v=0,k=0;e.$isTextNode(m)&&0<=p&&0<=_&&(v=p,k=p+_,w.setTextNodeRange(m,v,m,k)),(v!==k||T!=="")&&(w.insertRawText(T),m=M.getNode()),e.$isTextNode(m)&&(v=E,k=E+S,M=m.getTextContentSize(),v=v>M?M:v,k=k>M?M:k,w.setTextNodeRange(m,v,m,k)),l.stopImmediatePropagation()}})}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}},lu}var au,Zf;function Tp(){return Zf||(Zf=1,au=process.env.NODE_ENV==="development"?QN():eC()),au}var di={},vi={},qa={},Jf;function tC(){if(Jf)return qa;Jf=1;var e=vs(),t=pn(),n=Yt();function r(T,E){const S=E.body?E.body.childNodes:[];let w=[];for(let M=0;M<S.length;M++){const m=S[M];if(!p.has(m.nodeName)){const v=_(m,T);v!==null&&(w=w.concat(v))}}return w}function l(T,E){if(typeof document>"u"||typeof window>"u")throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const S=document.createElement("div"),M=n.$getRoot().getChildren();for(let m=0;m<M.length;m++){const v=M[m];d(T,v,S,E)}return S.innerHTML}function d(T,E,S,w=null){let M=w!=null?E.isSelected(w):!0;const m=n.$isElementNode(E)&&E.excludeFromCopy("html");let v=E;if(w!==null){let re=e.$cloneWithProperties(E);re=n.$isTextNode(re)&&w!=null?e.$sliceSelectedTextNodeContent(w,re):re,v=re}const k=n.$isElementNode(v)?v.getChildren():[],G=T._nodes.get(v.getType());let I;G&&G.exportDOM!==void 0?I=G.exportDOM(T,v):I=v.exportDOM(T);const{element:P,after:H}=I;if(!P)return!1;const j=document.createDocumentFragment();for(let re=0;re<k.length;re++){const te=k[re],ce=d(T,te,j,w);!M&&n.$isElementNode(E)&&ce&&E.extractWithChild(te,w,"html")&&(M=!0)}if(M&&!m){if(t.isHTMLElement(P)&&P.append(j),S.append(P),H){const re=H.call(v,P);re&&P.replaceWith(re)}}else S.append(j);return M}function f(T,E){const{nodeName:S}=T,w=E._htmlConversions.get(S.toLowerCase());let M=null;if(w!==void 0)for(const m of w){const v=m(T);v!==null&&(M===null||(M.priority||0)<(v.priority||0))&&(M=v)}return M!==null?M.conversion:null}const p=new Set(["STYLE","SCRIPT"]);function _(T,E,S=new Map,w){let M=[];if(p.has(T.nodeName))return M;let m=null;const v=f(T,E),k=v?v(T):null;let G=null;if(k!==null){G=k.after;const H=k.node;if(m=Array.isArray(H)?H[H.length-1]:H,m!==null){for(const[,j]of S)if(m=j(m,w),!m)break;m&&M.push(...Array.isArray(H)?H:[m])}k.forChild!=null&&S.set(T.nodeName,k.forChild)}const I=T.childNodes;let P=[];for(let H=0;H<I.length;H++)P.push(..._(I[H],E,new Map(S),m));return G!=null&&(P=G(P)),m==null?M=M.concat(P):n.$isElementNode(m)&&m.append(...P),M}return qa.$generateHtmlFromNodes=l,qa.$generateNodesFromDOM=r,qa}var Za={},Xf;function nC(){if(Xf)return Za;Xf=1;var e=vs(),t=pn(),n=Yt();function r(f,p,_,T=null){let E=T!=null?p.isSelected(T):!0,S=n.$isElementNode(p)&&p.excludeFromCopy("html");var w=p;T!==null&&(w=e.$cloneWithProperties(p),w=n.$isTextNode(w)&&T!=null?e.$sliceSelectedTextNodeContent(T,w):w);let M=n.$isElementNode(w)?w.getChildren():[];var m=f._nodes.get(w.getType());m=m&&m.exportDOM!==void 0?m.exportDOM(f,w):w.exportDOM(f);let{element:v,after:k}=m;if(!v)return!1;m=document.createDocumentFragment();for(let G=0;G<M.length;G++){let I=M[G],P=r(f,I,m,T);!E&&n.$isElementNode(p)&&P&&p.extractWithChild(I,T,"html")&&(E=!0)}return E&&!S?(t.isHTMLElement(v)&&v.append(m),_.append(v),k&&(f=k.call(w,v))&&v.replaceWith(f)):_.append(m),E}let l=new Set(["STYLE","SCRIPT"]);function d(f,p,_=new Map,T){let E=[];if(l.has(f.nodeName))return E;let S=null;var w,{nodeName:M}=f,m=p._htmlConversions.get(M.toLowerCase());if(M=null,m!==void 0)for(w of m)m=w(f),m!==null&&(M===null||(M.priority||0)<(m.priority||0))&&(M=m);if(M=(w=M!==null?M.conversion:null)?w(f):null,w=null,M!==null){if(w=M.after,m=M.node,S=Array.isArray(m)?m[m.length-1]:m,S!==null){for(var[,v]of _)if(S=v(S,T),!S)break;S&&E.push(...Array.isArray(m)?m:[S])}M.forChild!=null&&_.set(f.nodeName,M.forChild)}for(f=f.childNodes,T=[],v=0;v<f.length;v++)T.push(...d(f[v],p,new Map(_),S));return w!=null&&(T=w(T)),S==null?E=E.concat(T):n.$isElementNode(S)&&S.append(...T),E}return Za.$generateHtmlFromNodes=function(f,p){if(typeof document>"u"||typeof window>"u")throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let _=document.createElement("div"),T=n.$getRoot().getChildren();for(let E=0;E<T.length;E++)r(f,T[E],_,p);return _.innerHTML},Za.$generateNodesFromDOM=function(f,p){p=p.body?p.body.childNodes:[];let _=[];for(let E=0;E<p.length;E++){var T=p[E];l.has(T.nodeName)||(T=d(T,f),T!==null&&(_=_.concat(T)))}return _},Za}var cu,Qf;function xp(){return Qf||(Qf=1,cu=process.env.NODE_ENV==="development"?tC():nC()),cu}var eh;function rC(){if(eh)return vi;eh=1;var e=xp(),t=vs(),n=pn(),r=Yt();const l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=P=>l?(P||window).getSelection():null;function f(P){const H=r.$getSelection();if(H==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(H)&&H.isCollapsed()||H.getNodes().length===0?"":e.$generateHtmlFromNodes(P,H)}function p(P){const H=r.$getSelection();if(H==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(H)&&H.isCollapsed()||H.getNodes().length===0?null:JSON.stringify(M(P,H))}function _(P,H){const j=P.getData("text/plain")||P.getData("text/uri-list");j!=null&&H.insertRawText(j)}function T(P,H,j){const re=P.getData("application/x-lexical-editor");if(re)try{const V=JSON.parse(re);if(V.namespace===j._config.namespace&&Array.isArray(V.nodes)){const z=m(V.nodes);return E(j,z,H)}}catch{}const te=P.getData("text/html");if(te)try{const z=new DOMParser().parseFromString(te,"text/html"),q=e.$generateNodesFromDOM(j,z);return E(j,q,H)}catch{}const ce=P.getData("text/plain")||P.getData("text/uri-list");if(ce!=null)if(r.$isRangeSelection(H)){const V=ce.split(/(\r?\n|\t)/);V[V.length-1]===""&&V.pop();for(let z=0;z<V.length;z++){const q=V[z];q===`
|
|
74
|
+
`),k=j.length,!e.$isTextNode(G)||I>=k)j=G.getParent(),G.remove(),j==null||j.getChildrenSize()!==0||e.$isRootNode(j)||j.remove(),I-=k+H,G=P;else{let re=G.getKey();H=m.getEditorState().read(()=>{const ce=e.$getNodeByKey(re);return e.$isTextNode(ce)&&ce.isSimpleText()?ce.getTextContent():null}),P=k-I;let te=j.slice(0,P);H!==null&&H!==j?(I=e.$getPreviousSelection(),k=G,G.isSimpleText()?G.setTextContent(H):(k=e.$createTextNode(H),G.replace(k)),e.$isRangeSelection(I)&&I.isCollapsed()&&(I=I.anchor.offset,k.select(I,I))):G.isSimpleText()?(H=v.key===re,j=v.offset,j<I&&(j=k),I=H?j-I:0,k=H?j:P,H&&I===0?([I]=G.splitText(I,k),I.remove()):([,I]=G.splitText(I,k),I.remove())):(I=e.$createTextNode(te),G.replace(I)),I=0}}},Vn}var lu,Vf;function xs(){return Vf||(Vf=1,lu=process.env.NODE_ENV==="development"?QN():eC()),lu}var qf;function tC(){if(qf)return Sn;qf=1;var e=xs(),t=jt();function n(...te){return()=>{te.forEach(ce=>ce())}}function r(te){return`${te}px`}const l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(te,ce,V){let z=null,q=null,Te=null,Se=[];const Ee=document.createElement("div");function de(){if(z===null)throw Error("Unexpected null rootDOMNode");if(q===null)throw Error("Unexpected null parentDOMNode");const{left:oe,top:Y}=z.getBoundingClientRect(),W=q,J=e.createRectsFromDOMRange(te,ce);Ee.isConnected||W.append(Ee);let R=!1;for(let U=0;U<J.length;U++){const X=J[U],fe=Se[U]||document.createElement("div"),_e=fe.style;_e.position!=="absolute"&&(_e.position="absolute",R=!0);const B=r(X.left-oe);_e.left!==B&&(_e.left=B,R=!0);const M=r(X.top-Y);_e.top!==M&&(fe.style.top=M,R=!0);const F=r(X.width);_e.width!==F&&(fe.style.width=F,R=!0);const se=r(X.height);_e.height!==se&&(fe.style.height=se,R=!0),fe.parentNode!==Ee&&(Ee.append(fe),R=!0),Se[U]=fe}for(;Se.length>J.length;)Se.pop();R&&V(Se)}function K(){q=null,z=null,Te!==null&&Te.disconnect(),Te=null,Ee.remove();for(const oe of Se)oe.remove();Se=[]}function D(){const oe=te.getRootElement();if(oe===null)return K();const Y=oe.parentElement;if(!(Y instanceof HTMLElement))return K();K(),z=oe,q=Y,Te=new MutationObserver(W=>{const J=te.getRootElement(),R=J&&J.parentElement;if(J!==z||R!==q)return D();for(const U of W)if(!Ee.contains(U.target))return de()}),Te.observe(Y,l),de()}const Z=te.registerRootListener(D);return()=>{Z(),K()}}function f(te,ce){let V=null,z=null,q=null,Te=null,Se=()=>{};function Ee(de){de.read(()=>{const K=t.$getSelection();if(!t.$isRangeSelection(K)){V=null,z=null,q=null,Te=null,Se(),Se=()=>{};return}const{anchor:D,focus:Z}=K,oe=D.getNode(),Y=oe.getKey(),W=D.offset,J=Z.getNode(),R=J.getKey(),U=Z.offset,X=te.getElementByKey(Y),fe=te.getElementByKey(R),_e=V===null||X===null||W!==z||Y!==V.getKey()||oe!==V&&(!(V instanceof t.TextNode)||oe.updateDOM(V,X,te._config)),B=q===null||fe===null||U!==Te||R!==q.getKey()||J!==q&&(!(q instanceof t.TextNode)||J.updateDOM(q,fe,te._config));if(_e||B){const M=te.getElementByKey(D.getNode().getKey()),F=te.getElementByKey(Z.getNode().getKey());if(M!==null&&F!==null&&M.tagName==="SPAN"&&F.tagName==="SPAN"){const se=document.createRange();let ye,De,ee,ne;Z.isBefore(D)?(ye=F,De=Z.offset,ee=M,ne=D.offset):(ye=M,De=D.offset,ee=F,ne=Z.offset);const ue=ye.firstChild;if(ue===null)throw Error("Expected text node to be first child of span");const be=ee.firstChild;if(be===null)throw Error("Expected text node to be first child of span");se.setStart(ue,De),se.setEnd(be,ne),Se(),Se=d(te,se,Ne=>{for(const Re of Ne){const ke=Re.style;ke.background!=="Highlight"&&(ke.background="Highlight"),ke.color!=="HighlightText"&&(ke.color="HighlightText"),ke.zIndex!=="-1"&&(ke.zIndex="-1"),ke.pointerEvents!=="none"&&(ke.pointerEvents="none"),ke.marginTop!==r(-1.5)&&(ke.marginTop=r(-1.5)),ke.paddingTop!==r(4)&&(ke.paddingTop=r(4)),ke.paddingBottom!==r(0)&&(ke.paddingBottom=r(0))}ce!==void 0&&ce(Ne)})}}V=oe,z=W,q=J,Te=U})}return Ee(te.getEditorState()),n(te.registerUpdateListener(({editorState:de})=>Ee(de)),Se,()=>{Se()})}function p(te,...ce){ce.forEach(V=>{if(typeof V=="string"){const z=V.split(" ").filter(q=>q!=="");te.classList.add(...z)}})}function _(te,...ce){ce.forEach(V=>{typeof V=="string"&&te.classList.remove(...V.split(" "))})}function E(te,ce){for(const V of ce)if(te.type.startsWith(V))return!0;return!1}function T(te,ce){const V=te[Symbol.iterator]();return new Promise((z,q)=>{const Te=[],Se=()=>{const{done:Ee,value:de}=V.next();if(Ee)return z(Te);const K=new FileReader;K.addEventListener("error",q),K.addEventListener("load",()=>{const D=K.result;typeof D=="string"&&Te.push({file:de,result:D}),Se()}),E(de,ce)?K.readAsDataURL(de):Se()};Se()})}function S(te,ce){const V=[],z=(te||t.$getRoot()).getLatest(),q=ce||(t.$isElementNode(z)?z.getLastDescendant():z);let Te=z,Se=w(Te);for(;Te!==null&&!Te.is(q);)if(V.push({depth:Se,node:Te}),t.$isElementNode(Te)&&Te.getChildrenSize()>0)Te=Te.getFirstChild(),Se++;else{let Ee=null;for(;Ee===null&&Te!==null;)Ee=Te.getNextSibling(),Ee===null?(Te=Te.getParent(),Se--):Te=Ee}return Te!==null&&Te.is(q)&&V.push({depth:Se,node:Te}),V}function w(te){let ce=te,V=0;for(;(ce=ce.getParent())!==null;)V++;return V}function O(te,ce){let V=te;for(;V!=null;){if(V instanceof ce)return V;V=V.getParent()}return null}function m(te){const ce=v(te,V=>t.$isElementNode(V)&&!V.isInline());if(!t.$isElementNode(ce))throw Error(`Expected node ${te.__key} to have closest block element node.`);return ce}const v=(te,ce)=>{let V=te;for(;V!==t.$getRoot()&&V!=null;){if(ce(V))return V;V=V.getParent()}return null};function I(te,ce,V,z){const q=Ee=>Ee instanceof ce,Te=Ee=>{const de=Ee.getChildren();for(let Z=0;Z<de.length;Z++){const oe=de[Z];if(q(oe))return null}let K=Ee,D=Ee;for(;K!==null;)if(D=K,K=K.getParent(),q(K))return{child:D,parent:K};return null},Se=Ee=>{const de=Te(Ee);if(de!==null){const{child:K,parent:D}=de;if(K.is(Ee)){z(D,Ee);const Z=K.getNextSiblings(),oe=Z.length;if(D.insertAfter(K),oe!==0){const Y=V(D);K.insertAfter(Y);for(let W=0;W<oe;W++)Y.append(Z[W])}!D.canBeEmpty()&&D.getChildrenSize()===0&&D.remove()}}};return te.registerNodeTransform(ce,Se)}function G(te,ce){const z=new Map,q=te._pendingEditorState;for(const[Se,Ee]of ce._nodeMap){const de=e.$cloneWithProperties(Ee);if(t.$isTextNode(de)){if(!t.$isTextNode(Ee))throw Error("Expected node be a TextNode");de.__text=Ee.__text}z.set(Se,de)}q&&(q._nodeMap=z),te._dirtyType=2;const Te=ce._selection;t.$setSelection(Te===null?null:Te.clone())}function k(te){const ce=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(ce)){const{focus:V}=ce,z=V.getNode(),q=V.offset;if(t.$isRootOrShadowRoot(z)){const Te=z.getChildAtIndex(q);Te==null?z.append(te):Te.insertBefore(te),te.selectNext()}else{let Te,Se;t.$isTextNode(z)?(Te=z.getParentOrThrow(),Se=z.getIndexWithinParent(),q>0&&(Se+=1,z.splitText(q))):(Te=z,Se=q);const[,Ee]=t.$splitNode(Te,Se);Ee.insertBefore(te),Ee.selectStart()}}else{if(ce!=null){const z=ce.getNodes();z[z.length-1].getTopLevelElementOrThrow().insertAfter(te)}else t.$getRoot().append(te);const V=t.$createParagraphNode();te.insertAfter(V),V.select()}return te.getLatest()}function P(te,ce){const V=ce();return te.replace(V),V.append(te),V}function H(te,ce){return te!==null?Object.getPrototypeOf(te).constructor.name===ce.name:!1}function j(te,ce){const V=[];for(let z=0;z<te.length;z++){const q=ce(te[z]);q!==null&&V.push(q)}return V}function re(te,ce){const V=te.getFirstChild();V!==null?V.insertBefore(ce):te.append(ce)}return Sn.$splitNode=t.$splitNode,Sn.isHTMLAnchorElement=t.isHTMLAnchorElement,Sn.isHTMLElement=t.isHTMLElement,Sn.$dfs=S,Sn.$filter=j,Sn.$findMatchingParent=v,Sn.$getNearestBlockElementAncestorOrThrow=m,Sn.$getNearestNodeOfType=O,Sn.$insertFirst=re,Sn.$insertNodeToNearestRoot=k,Sn.$restoreEditorState=G,Sn.$wrapNodeInElement=P,Sn.addClassNamesToElement=p,Sn.isMimeType=E,Sn.markSelection=f,Sn.mediaFileReader=T,Sn.mergeRegister=n,Sn.objectKlassEquals=H,Sn.positionNodeOnRange=d,Sn.registerNestedElementResolver=I,Sn.removeClassNamesFromElement=_,Sn}var wn={},Zf;function nC(){if(Zf)return wn;Zf=1;var e=xs(),t=jt();function n(_){let E=new URLSearchParams;E.append("code",_);for(let T=1;T<arguments.length;T++)E.append("v",arguments[T]);throw Error(`Minified Lexical error #${_}; visit https://lexical.dev/docs/error?${E} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(..._){return()=>{_.forEach(E=>E())}}let l={attributes:!0,characterData:!0,childList:!0,subtree:!0};function d(_,E,T){function S(){if(m===null)throw Error("Unexpected null rootDOMNode");if(v===null)throw Error("Unexpected null parentDOMNode");let{left:H,top:j}=m.getBoundingClientRect();var re=v;let te=e.createRectsFromDOMRange(_,E);k.isConnected||re.append(k),re=!1;for(let z=0;z<te.length;z++){var ce=te[z];let q=G[z]||document.createElement("div"),Te=q.style;Te.position!=="absolute"&&(Te.position="absolute",re=!0);var V=`${ce.left-H}px`;Te.left!==V&&(Te.left=V,re=!0),V=`${ce.top-j}px`,Te.top!==V&&(q.style.top=V,re=!0),V=`${ce.width}px`,Te.width!==V&&(q.style.width=V,re=!0),ce=`${ce.height}px`,Te.height!==ce&&(q.style.height=ce,re=!0),q.parentNode!==k&&(k.append(q),re=!0),G[z]=q}for(;G.length>te.length;)G.pop();re&&T(G)}function w(){m=v=null,I!==null&&I.disconnect(),I=null,k.remove();for(let H of G)H.remove();G=[]}function O(){let H=_.getRootElement();if(H===null)return w();let j=H.parentElement;if(!(j instanceof HTMLElement))return w();w(),m=H,v=j,I=new MutationObserver(re=>{let te=_.getRootElement(),ce=te&&te.parentElement;if(te!==m||ce!==v)return O();for(let V of re)if(!k.contains(V.target))return S()}),I.observe(j,l),S()}let m=null,v=null,I=null,G=[],k=document.createElement("div"),P=_.registerRootListener(O);return()=>{P(),w()}}function f(_,E){for(let T of E)if(_.type.startsWith(T))return!0;return!1}let p=(_,E)=>{for(;_!==t.$getRoot()&&_!=null;){if(E(_))return _;_=_.getParent()}return null};return wn.$splitNode=t.$splitNode,wn.isHTMLAnchorElement=t.isHTMLAnchorElement,wn.isHTMLElement=t.isHTMLElement,wn.$dfs=function(_,E){let T=[];_=(_||t.$getRoot()).getLatest(),E=E||(t.$isElementNode(_)?_.getLastDescendant():_);for(var S=_,w=0;(S=S.getParent())!==null;)w++;for(S=w;_!==null&&!_.is(E);)if(T.push({depth:S,node:_}),t.$isElementNode(_)&&0<_.getChildrenSize())_=_.getFirstChild(),S++;else for(w=null;w===null&&_!==null;)w=_.getNextSibling(),w===null?(_=_.getParent(),S--):_=w;return _!==null&&_.is(E)&&T.push({depth:S,node:_}),T},wn.$filter=function(_,E){let T=[];for(let S=0;S<_.length;S++){let w=E(_[S]);w!==null&&T.push(w)}return T},wn.$findMatchingParent=p,wn.$getNearestBlockElementAncestorOrThrow=function(_){let E=p(_,T=>t.$isElementNode(T)&&!T.isInline());return t.$isElementNode(E)||n(4,_.__key),E},wn.$getNearestNodeOfType=function(_,E){for(;_!=null;){if(_ instanceof E)return _;_=_.getParent()}return null},wn.$insertFirst=function(_,E){let T=_.getFirstChild();T!==null?T.insertBefore(E):_.append(E)},wn.$insertNodeToNearestRoot=function(_){var E=t.$getSelection()||t.$getPreviousSelection();if(t.$isRangeSelection(E)){var{focus:T}=E;if(E=T.getNode(),T=T.offset,t.$isRootOrShadowRoot(E))T=E.getChildAtIndex(T),T==null?E.append(_):T.insertBefore(_),_.selectNext();else{let S,w;t.$isTextNode(E)?(S=E.getParentOrThrow(),w=E.getIndexWithinParent(),0<T&&(w+=1,E.splitText(T))):(S=E,w=T),[,E]=t.$splitNode(S,w),E.insertBefore(_),E.selectStart()}}else E!=null?(E=E.getNodes(),E[E.length-1].getTopLevelElementOrThrow().insertAfter(_)):t.$getRoot().append(_),E=t.$createParagraphNode(),_.insertAfter(E),E.select();return _.getLatest()},wn.$restoreEditorState=function(_,E){let T=new Map,S=_._pendingEditorState;for(let[w,O]of E._nodeMap){let m=e.$cloneWithProperties(O);if(t.$isTextNode(m)){if(!t.$isTextNode(O))throw Error("Expected node be a TextNode");m.__text=O.__text}T.set(w,m)}S&&(S._nodeMap=T),_._dirtyType=2,_=E._selection,t.$setSelection(_===null?null:_.clone())},wn.$wrapNodeInElement=function(_,E){return E=E(),_.replace(E),E.append(_),E},wn.addClassNamesToElement=function(_,...E){E.forEach(T=>{typeof T=="string"&&(T=T.split(" ").filter(S=>S!==""),_.classList.add(...T))})},wn.isMimeType=f,wn.markSelection=function(_,E){function T(I){I.read(()=>{var G=t.$getSelection();if(t.$isRangeSelection(G)){var{anchor:k,focus:P}=G;G=k.getNode();var H=G.getKey(),j=k.offset,re=P.getNode(),te=re.getKey(),ce=P.offset,V=_.getElementByKey(H),z=_.getElementByKey(te);if(H=S===null||V===null||j!==w||H!==S.getKey()||G!==S&&(!(S instanceof t.TextNode)||G.updateDOM(S,V,_._config)),te=O===null||z===null||ce!==m||te!==O.getKey()||re!==O&&(!(O instanceof t.TextNode)||re.updateDOM(O,z,_._config)),H||te){V=_.getElementByKey(k.getNode().getKey());var q=_.getElementByKey(P.getNode().getKey());if(V!==null&&q!==null&&V.tagName==="SPAN"&&q.tagName==="SPAN"){if(te=document.createRange(),P.isBefore(k)?(H=q,z=P.offset,q=V,V=k.offset):(H=V,z=k.offset,V=P.offset),H=H.firstChild,H===null||(q=q.firstChild,q===null))throw Error("Expected text node to be first child of span");te.setStart(H,z),te.setEnd(q,V),v(),v=d(_,te,Te=>{for(let Se of Te){let Ee=Se.style;Ee.background!=="Highlight"&&(Ee.background="Highlight"),Ee.color!=="HighlightText"&&(Ee.color="HighlightText"),Ee.zIndex!=="-1"&&(Ee.zIndex="-1"),Ee.pointerEvents!=="none"&&(Ee.pointerEvents="none"),Ee.marginTop!=="-1.5px"&&(Ee.marginTop="-1.5px"),Ee.paddingTop!=="4px"&&(Ee.paddingTop="4px"),Ee.paddingBottom!=="0px"&&(Ee.paddingBottom="0px")}E!==void 0&&E(Te)})}}S=G,w=j,O=re,m=ce}else m=O=w=S=null,v(),v=()=>{}})}let S=null,w=null,O=null,m=null,v=()=>{};return T(_.getEditorState()),r(_.registerUpdateListener(({editorState:I})=>T(I)),v,()=>{v()})},wn.mediaFileReader=function(_,E){let T=_[Symbol.iterator]();return new Promise((S,w)=>{let O=[],m=()=>{const{done:v,value:I}=T.next();if(v)return S(O);const G=new FileReader;G.addEventListener("error",w),G.addEventListener("load",()=>{const k=G.result;typeof k=="string"&&O.push({file:I,result:k}),m()}),f(I,E)?G.readAsDataURL(I):m()};m()})},wn.mergeRegister=r,wn.objectKlassEquals=function(_,E){return _!==null?Object.getPrototypeOf(_).constructor.name===E.name:!1},wn.positionNodeOnRange=d,wn.registerNestedElementResolver=function(_,E,T,S){return _.registerNodeTransform(E,w=>{e:{for(var O=w.getChildren(),m=0;m<O.length;m++)if(O[m]instanceof E){O=null;break e}for(O=w;O!==null;)if(m=O,O=O.getParent(),O instanceof E){O={child:m,parent:O};break e}O=null}if(O!==null){const{child:v,parent:I}=O;if(v.is(w)){if(S(I,w),w=v.getNextSiblings(),O=w.length,I.insertAfter(v),O!==0){m=T(I),v.insertAfter(m);for(let G=0;G<O;G++)m.append(w[G])}I.canBeEmpty()||I.getChildrenSize()!==0||I.remove()}}})},wn.removeClassNamesFromElement=function(_,...E){E.forEach(T=>{typeof T=="string"&&_.classList.remove(...T.split(" "))})},wn}var au,Jf;function pn(){return Jf||(Jf=1,au=process.env.NODE_ENV==="development"?tC():nC()),au}var cu={},Xf;function rC(){if(Xf)return cu;Xf=1;var e=jt();function t(n){const r=window.location.origin,l=d=>{if(d.origin!==r)return;const f=n.getRootElement();if(document.activeElement!==f)return;const p=d.data;if(typeof p=="string"){let _;try{_=JSON.parse(p)}catch{return}if(_&&_.protocol==="nuanria_messaging"&&_.type==="request"){const E=_.payload;if(E&&E.functionId==="makeChanges"){const T=E.args;if(T){const[S,w,O,m,v,I]=T;n.update(()=>{const G=e.$getSelection();if(e.$isRangeSelection(G)){const k=G.anchor;let P=k.getNode(),H=0,j=0;if(e.$isTextNode(P)&&S>=0&&w>=0&&(H=S,j=S+w,G.setTextNodeRange(P,H,P,j)),(H!==j||O!=="")&&(G.insertRawText(O),P=k.getNode()),e.$isTextNode(P)){H=m,j=m+v;const re=P.getTextContentSize();H=H>re?re:H,j=j>re?re:j,G.setTextNodeRange(P,H,P,j)}d.stopImmediatePropagation()}})}}}}};return window.addEventListener("message",l,!0),()=>{window.removeEventListener("message",l,!0)}}return cu.registerDragonSupport=t,cu}var uu={},Qf;function iC(){if(Qf)return uu;Qf=1;var e=jt();return uu.registerDragonSupport=function(t){let n=window.location.origin,r=l=>{if(l.origin===n){var d=t.getRootElement();if(document.activeElement===d&&(d=l.data,typeof d=="string")){try{var f=JSON.parse(d)}catch{return}if(f&&f.protocol==="nuanria_messaging"&&f.type==="request"&&(f=f.payload)&&f.functionId==="makeChanges"&&(f=f.args)){const[p,_,E,T,S]=f;t.update(()=>{const w=e.$getSelection();if(e.$isRangeSelection(w)){var O=w.anchor;let m=O.getNode(),v=0,I=0;e.$isTextNode(m)&&0<=p&&0<=_&&(v=p,I=p+_,w.setTextNodeRange(m,v,m,I)),(v!==I||E!=="")&&(w.insertRawText(E),m=O.getNode()),e.$isTextNode(m)&&(v=T,I=T+S,O=m.getTextContentSize(),v=v>O?O:v,I=I>O?O:I,w.setTextNodeRange(m,v,m,I)),l.stopImmediatePropagation()}})}}}};return window.addEventListener("message",r,!0),()=>{window.removeEventListener("message",r,!0)}},uu}var du,eh;function Sp(){return eh||(eh=1,du=process.env.NODE_ENV==="development"?rC():iC()),du}var di={},vi={},Za={},th;function sC(){if(th)return Za;th=1;var e=xs(),t=pn(),n=jt();function r(E,T){const S=T.body?T.body.childNodes:[];let w=[];for(let O=0;O<S.length;O++){const m=S[O];if(!p.has(m.nodeName)){const v=_(m,E);v!==null&&(w=w.concat(v))}}return w}function l(E,T){if(typeof document>"u"||typeof window>"u")throw new Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");const S=document.createElement("div"),O=n.$getRoot().getChildren();for(let m=0;m<O.length;m++){const v=O[m];d(E,v,S,T)}return S.innerHTML}function d(E,T,S,w=null){let O=w!=null?T.isSelected(w):!0;const m=n.$isElementNode(T)&&T.excludeFromCopy("html");let v=T;if(w!==null){let re=e.$cloneWithProperties(T);re=n.$isTextNode(re)&&w!=null?e.$sliceSelectedTextNodeContent(w,re):re,v=re}const I=n.$isElementNode(v)?v.getChildren():[],G=E._nodes.get(v.getType());let k;G&&G.exportDOM!==void 0?k=G.exportDOM(E,v):k=v.exportDOM(E);const{element:P,after:H}=k;if(!P)return!1;const j=document.createDocumentFragment();for(let re=0;re<I.length;re++){const te=I[re],ce=d(E,te,j,w);!O&&n.$isElementNode(T)&&ce&&T.extractWithChild(te,w,"html")&&(O=!0)}if(O&&!m){if(t.isHTMLElement(P)&&P.append(j),S.append(P),H){const re=H.call(v,P);re&&P.replaceWith(re)}}else S.append(j);return O}function f(E,T){const{nodeName:S}=E,w=T._htmlConversions.get(S.toLowerCase());let O=null;if(w!==void 0)for(const m of w){const v=m(E);v!==null&&(O===null||(O.priority||0)<(v.priority||0))&&(O=v)}return O!==null?O.conversion:null}const p=new Set(["STYLE","SCRIPT"]);function _(E,T,S=new Map,w){let O=[];if(p.has(E.nodeName))return O;let m=null;const v=f(E,T),I=v?v(E):null;let G=null;if(I!==null){G=I.after;const H=I.node;if(m=Array.isArray(H)?H[H.length-1]:H,m!==null){for(const[,j]of S)if(m=j(m,w),!m)break;m&&O.push(...Array.isArray(H)?H:[m])}I.forChild!=null&&S.set(E.nodeName,I.forChild)}const k=E.childNodes;let P=[];for(let H=0;H<k.length;H++)P.push(..._(k[H],T,new Map(S),m));return G!=null&&(P=G(P)),m==null?O=O.concat(P):n.$isElementNode(m)&&m.append(...P),O}return Za.$generateHtmlFromNodes=l,Za.$generateNodesFromDOM=r,Za}var Ja={},nh;function oC(){if(nh)return Ja;nh=1;var e=xs(),t=pn(),n=jt();function r(f,p,_,E=null){let T=E!=null?p.isSelected(E):!0,S=n.$isElementNode(p)&&p.excludeFromCopy("html");var w=p;E!==null&&(w=e.$cloneWithProperties(p),w=n.$isTextNode(w)&&E!=null?e.$sliceSelectedTextNodeContent(E,w):w);let O=n.$isElementNode(w)?w.getChildren():[];var m=f._nodes.get(w.getType());m=m&&m.exportDOM!==void 0?m.exportDOM(f,w):w.exportDOM(f);let{element:v,after:I}=m;if(!v)return!1;m=document.createDocumentFragment();for(let G=0;G<O.length;G++){let k=O[G],P=r(f,k,m,E);!T&&n.$isElementNode(p)&&P&&p.extractWithChild(k,E,"html")&&(T=!0)}return T&&!S?(t.isHTMLElement(v)&&v.append(m),_.append(v),I&&(f=I.call(w,v))&&v.replaceWith(f)):_.append(m),T}let l=new Set(["STYLE","SCRIPT"]);function d(f,p,_=new Map,E){let T=[];if(l.has(f.nodeName))return T;let S=null;var w,{nodeName:O}=f,m=p._htmlConversions.get(O.toLowerCase());if(O=null,m!==void 0)for(w of m)m=w(f),m!==null&&(O===null||(O.priority||0)<(m.priority||0))&&(O=m);if(O=(w=O!==null?O.conversion:null)?w(f):null,w=null,O!==null){if(w=O.after,m=O.node,S=Array.isArray(m)?m[m.length-1]:m,S!==null){for(var[,v]of _)if(S=v(S,E),!S)break;S&&T.push(...Array.isArray(m)?m:[S])}O.forChild!=null&&_.set(f.nodeName,O.forChild)}for(f=f.childNodes,E=[],v=0;v<f.length;v++)E.push(...d(f[v],p,new Map(_),S));return w!=null&&(E=w(E)),S==null?T=T.concat(E):n.$isElementNode(S)&&S.append(...E),T}return Ja.$generateHtmlFromNodes=function(f,p){if(typeof document>"u"||typeof window>"u")throw Error("To use $generateHtmlFromNodes in headless mode please initialize a headless browser implementation such as JSDom before calling this function.");let _=document.createElement("div"),E=n.$getRoot().getChildren();for(let T=0;T<E.length;T++)r(f,E[T],_,p);return _.innerHTML},Ja.$generateNodesFromDOM=function(f,p){p=p.body?p.body.childNodes:[];let _=[];for(let T=0;T<p.length;T++){var E=p[T];l.has(E.nodeName)||(E=d(E,f),E!==null&&(_=_.concat(E)))}return _},Ja}var fu,rh;function wp(){return rh||(rh=1,fu=process.env.NODE_ENV==="development"?sC():oC()),fu}var ih;function lC(){if(ih)return vi;ih=1;var e=wp(),t=xs(),n=pn(),r=jt();const l=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",d=P=>l?(P||window).getSelection():null;function f(P){const H=r.$getSelection();if(H==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(H)&&H.isCollapsed()||H.getNodes().length===0?"":e.$generateHtmlFromNodes(P,H)}function p(P){const H=r.$getSelection();if(H==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(H)&&H.isCollapsed()||H.getNodes().length===0?null:JSON.stringify(O(P,H))}function _(P,H){const j=P.getData("text/plain")||P.getData("text/uri-list");j!=null&&H.insertRawText(j)}function E(P,H,j){const re=P.getData("application/x-lexical-editor");if(re)try{const V=JSON.parse(re);if(V.namespace===j._config.namespace&&Array.isArray(V.nodes)){const z=m(V.nodes);return T(j,z,H)}}catch{}const te=P.getData("text/html");if(te)try{const z=new DOMParser().parseFromString(te,"text/html"),q=e.$generateNodesFromDOM(j,z);return T(j,q,H)}catch{}const ce=P.getData("text/plain")||P.getData("text/uri-list");if(ce!=null)if(r.$isRangeSelection(H)){const V=ce.split(/(\r?\n|\t)/);V[V.length-1]===""&&V.pop();for(let z=0;z<V.length;z++){const q=V[z];q===`
|
|
75
75
|
`||q===`\r
|
|
76
|
-
`?H.insertParagraph():q===" "?H.insertNodes([r.$createTabNode()]):H.insertText(q)}}else H.insertRawText(ce)}function
|
|
77
|
-
`||
|
|
78
|
-
`?v.insertParagraph():I===" "?v.insertNodes([r.$createTabNode()]):v.insertText(I);else v.insertRawText(m)},Si.$insertGeneratedNodes=_,Si.copyToClipboard=async function(m,v){if(w!==null)return!1;if(v!==null)return new Promise(H=>{m.update(()=>{H(M(m,v))})});var k=m.getRootElement();let G=m._window==null?window.document:m._window.document,I=d?(m._window||window).getSelection():null;if(k===null||I===null)return!1;let P=G.createElement("span");return P.style.cssText="position: fixed; top: -1000px;",P.append(G.createTextNode("#")),k.append(P),k=new Range,k.setStart(P,0),k.setEnd(P,1),I.removeAllRanges(),I.addRange(k),new Promise(H=>{let j=m.registerCommand(r.COPY_COMMAND,re=>(n.objectKlassEquals(re,ClipboardEvent)&&(j(),w!==null&&(window.clearTimeout(w),w=null),H(M(m,re))),!0),r.COMMAND_PRIORITY_CRITICAL);w=window.setTimeout(()=>{j(),w=null,H(!1)},50),G.execCommand("copy"),P.remove()})},Si}var uu,nh;function vp(){return nh||(nh=1,uu=process.env.NODE_ENV==="development"?rC():iC()),uu}var rh;function sC(){if(rh)return di;rh=1;var e=vp(),t=vs(),n=pn(),r=Yt();function l(Se,Ee){if(typeof document.caretRangeFromPoint<"u"){const de=document.caretRangeFromPoint(Se,Ee);return de===null?null:{node:de.startContainer,offset:de.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const de=document.caretPositionFromPoint(Se,Ee);return de===null?null:{node:de.offsetNode,offset:de.offset}}else return null}const d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",f=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!f?"getTargetRanges"in new window.InputEvent("input"):!1,_=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,E=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!E,w=r.createCommand("DRAG_DROP_PASTE_FILE");class M extends r.ElementNode{static getType(){return"quote"}static clone(Ee){return new M(Ee.__key)}constructor(Ee){super(Ee)}createDOM(Ee){const de=document.createElement("blockquote");return n.addClassNamesToElement(de,Ee.theme.quote),de}updateDOM(Ee,de){return!1}static importDOM(){return{blockquote:Ee=>({conversion:P,priority:0})}}exportDOM(Ee){const{element:de}=super.exportDOM(Ee);if(de&&n.isHTMLElement(de)){this.isEmpty()&&de.append(document.createElement("br"));const K=this.getFormatType();de.style.textAlign=K;const O=this.getDirection();O&&(de.dir=O)}return{element:de}}static importJSON(Ee){const de=m();return de.setFormat(Ee.format),de.setIndent(Ee.indent),de.setDirection(Ee.direction),de}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(Ee,de){const K=r.$createParagraphNode(),O=this.getDirection();return K.setDirection(O),this.insertAfter(K,de),K}collapseAtStart(){const Ee=r.$createParagraphNode();return this.getChildren().forEach(K=>Ee.append(K)),this.replace(Ee),!0}}function m(){return r.$applyNodeReplacement(new M)}function v(Se){return Se instanceof M}class k extends r.ElementNode{static getType(){return"heading"}static clone(Ee){return new k(Ee.__tag,Ee.__key)}constructor(Ee,de){super(de),this.__tag=Ee}getTag(){return this.__tag}createDOM(Ee){const de=this.__tag,K=document.createElement(de),Z=Ee.theme.heading;if(Z!==void 0){const oe=Z[de];n.addClassNamesToElement(K,oe)}return K}updateDOM(Ee,de){return!1}static importDOM(){return{h1:Ee=>({conversion:I,priority:0}),h2:Ee=>({conversion:I,priority:0}),h3:Ee=>({conversion:I,priority:0}),h4:Ee=>({conversion:I,priority:0}),h5:Ee=>({conversion:I,priority:0}),h6:Ee=>({conversion:I,priority:0}),p:Ee=>{const K=Ee.firstChild;return K!==null&&G(K)?{conversion:()=>({node:null}),priority:3}:null},span:Ee=>G(Ee)?{conversion:de=>({node:H("h1")}),priority:3}:null}}exportDOM(Ee){const{element:de}=super.exportDOM(Ee);if(de&&n.isHTMLElement(de)){this.isEmpty()&&de.append(document.createElement("br"));const K=this.getFormatType();de.style.textAlign=K;const O=this.getDirection();O&&(de.dir=O)}return{element:de}}static importJSON(Ee){const de=H(Ee.tag);return de.setFormat(Ee.format),de.setIndent(Ee.indent),de.setDirection(Ee.direction),de}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(Ee,de=!0){const K=Ee?Ee.anchor.offset:0,O=K===this.getTextContentSize()||!Ee?r.$createParagraphNode():H(this.getTag()),Z=this.getDirection();if(O.setDirection(Z),this.insertAfter(O,de),K===0&&!this.isEmpty()&&Ee){const oe=r.$createParagraphNode();oe.select(),this.replace(oe,!0)}return O}collapseAtStart(){const Ee=this.isEmpty()?r.$createParagraphNode():H(this.getTag());return this.getChildren().forEach(K=>Ee.append(K)),this.replace(Ee),!0}extractWithChild(){return!0}}function G(Se){return Se.nodeName.toLowerCase()==="span"?Se.style.fontSize==="26pt":!1}function I(Se){const Ee=Se.nodeName.toLowerCase();let de=null;return(Ee==="h1"||Ee==="h2"||Ee==="h3"||Ee==="h4"||Ee==="h5"||Ee==="h6")&&(de=H(Ee),Se.style!==null&&de.setFormat(Se.style.textAlign)),{node:de}}function P(Se){const Ee=m();return Se.style!==null&&Ee.setFormat(Se.style.textAlign),{node:Ee}}function H(Se){return r.$applyNodeReplacement(new k(Se))}function j(Se){return Se instanceof k}function re(Se,Ee){Se.preventDefault(),Ee.update(()=>{const de=r.$getSelection(),K=Se instanceof InputEvent||Se instanceof KeyboardEvent?null:Se.clipboardData;K!=null&&r.$INTERNAL_isPointSelection(de)&&e.$insertDataTransferForRichText(K,de,Ee)},{tag:"paste"})}async function te(Se,Ee){await e.copyToClipboard(Ee,n.objectKlassEquals(Se,ClipboardEvent)?Se:null),Ee.update(()=>{const de=r.$getSelection();r.$isRangeSelection(de)?de.removeText():r.$isNodeSelection(de)&&de.getNodes().forEach(K=>K.remove())})}function ce(Se){let Ee=null;if(Se instanceof DragEvent?Ee=Se.dataTransfer:Se instanceof ClipboardEvent&&(Ee=Se.clipboardData),Ee===null)return[!1,[],!1];const de=Ee.types,K=de.includes("Files"),O=de.includes("text/html")||de.includes("text/plain");return[K,Array.from(Ee.files),O]}function V(Se){const Ee=r.$getSelection();if(!r.$isRangeSelection(Ee))return!1;const de=new Set,K=Ee.getNodes();for(let O=0;O<K.length;O++){const Z=K[O],oe=Z.getKey();if(de.has(oe))continue;const Y=n.$getNearestBlockElementAncestorOrThrow(Z),W=Y.getKey();Y.canIndent()&&!de.has(W)&&(de.add(W),Se(Y))}return de.size>0}function z(Se){const Ee=r.$getNearestNodeFromDOMNode(Se);return r.$isDecoratorNode(Ee)}function q(Se){const Ee=Se.focus;return Ee.key==="root"&&Ee.offset===r.$getRoot().getChildrenSize()}function Te(Se){return n.mergeRegister(Se.registerCommand(r.CLICK_COMMAND,de=>{const K=r.$getSelection();return r.$isNodeSelection(K)?(K.clear(),!0):!1},0),Se.registerCommand(r.DELETE_CHARACTER_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteCharacter(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DELETE_WORD_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteWord(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DELETE_LINE_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteLine(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,de=>{const K=r.$getSelection();if(typeof de=="string")r.$INTERNAL_isPointSelection(K)&&K.insertText(de);else{if(!r.$INTERNAL_isPointSelection(K))return!1;const O=de.dataTransfer;if(O!=null)e.$insertDataTransferForRichText(O,K,Se);else if(r.$isRangeSelection(K)){const Z=de.data;return Z&&K.insertText(Z),!0}}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(de.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.FORMAT_TEXT_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.formatText(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.FORMAT_ELEMENT_COMMAND,de=>{const K=r.$getSelection();if(!r.$isRangeSelection(K)&&!r.$isNodeSelection(K))return!1;const O=K.getNodes();for(const Z of O){const oe=n.$findMatchingParent(Z,Y=>r.$isElementNode(Y)&&!Y.isInline());oe!==null&&oe.setFormat(de)}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_LINE_BREAK_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.insertLineBreak(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(de.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INDENT_CONTENT_COMMAND,()=>V(de=>{const K=de.getIndent();de.setIndent(K+1)}),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>V(de=>{const K=de.getIndent();K>0&&de.setIndent(K-1)}),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_UP_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!z(de.target)){const O=K.getNodes();if(O.length>0)return O[0].selectPrevious(),!0}else if(r.$isRangeSelection(K)){const O=r.$getAdjacentNode(K.focus,!0);if(!de.shiftKey&&r.$isDecoratorNode(O)&&!O.isIsolated()&&!O.isInline())return O.selectPrevious(),de.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_DOWN_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const O=K.getNodes();if(O.length>0)return O[0].selectNext(0,0),!0}else if(r.$isRangeSelection(K)){if(q(K))return de.preventDefault(),!0;const O=r.$getAdjacentNode(K.focus,!1);if(!de.shiftKey&&r.$isDecoratorNode(O)&&!O.isIsolated()&&!O.isInline())return O.selectNext(),de.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_LEFT_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const O=K.getNodes();if(O.length>0)return de.preventDefault(),O[0].selectPrevious(),!0}if(!r.$isRangeSelection(K))return!1;if(t.$shouldOverrideDefaultCharacterSelection(K,!0)){const O=de.shiftKey;return de.preventDefault(),t.$moveCharacter(K,O,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!z(de.target)){const Z=K.getNodes();if(Z.length>0)return de.preventDefault(),Z[0].selectNext(0,0),!0}if(!r.$isRangeSelection(K))return!1;const O=de.shiftKey;return t.$shouldOverrideDefaultCharacterSelection(K,!1)?(de.preventDefault(),t.$moveCharacter(K,O,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_BACKSPACE_COMMAND,de=>{if(z(de.target))return!1;const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;de.preventDefault();const{anchor:O}=K,Z=O.getNode();return K.isCollapsed()&&O.offset===0&&!r.$isRootNode(Z)&&n.$getNearestBlockElementAncestorOrThrow(Z).getIndent()>0?Se.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):Se.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_DELETE_COMMAND,de=>{if(z(de.target))return!1;const K=r.$getSelection();return r.$isRangeSelection(K)?(de.preventDefault(),Se.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ENTER_COMMAND,de=>{const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;if(de!==null){if((T||_||S)&&p)return!1;if(de.preventDefault(),de.shiftKey)return Se.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return Se.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(Se.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DROP_COMMAND,de=>{const[,K]=ce(de);if(K.length>0){const Z=de.clientX,oe=de.clientY,Y=l(Z,oe);if(Y!==null){const{offset:W,node:J}=Y,R=r.$getNearestNodeFromDOMNode(J);if(R!==null){const U=r.$createRangeSelection();if(r.$isTextNode(R))U.anchor.set(R.getKey(),W,"text"),U.focus.set(R.getKey(),W,"text");else{const fe=R.getParentOrThrow().getKey(),_e=R.getIndexWithinParent()+1;U.anchor.set(fe,_e,"element"),U.focus.set(fe,_e,"element")}const X=r.$normalizeSelection__EXPERIMENTAL(U);r.$setSelection(X)}Se.dispatchCommand(w,K)}return de.preventDefault(),!0}const O=r.$getSelection();return!!r.$isRangeSelection(O)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGSTART_COMMAND,de=>{const[K]=ce(de),O=r.$getSelection();return!(K&&!r.$isRangeSelection(O))},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGOVER_COMMAND,de=>{const[K]=ce(de),O=r.$getSelection();if(K&&!r.$isRangeSelection(O))return!1;const Z=de.clientX,oe=de.clientY,Y=l(Z,oe);if(Y!==null){const W=r.$getNearestNodeFromDOMNode(Y.node);r.$isDecoratorNode(W)&&de.preventDefault()}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.COPY_COMMAND,de=>(e.copyToClipboard(Se,n.objectKlassEquals(de,ClipboardEvent)?de:null),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.CUT_COMMAND,de=>(te(de,Se),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.PASTE_COMMAND,de=>{const[,K,O]=ce(de);if(K.length>0&&!O)return Se.dispatchCommand(w,K),!0;if(r.isSelectionCapturedInDecoratorInput(de.target))return!1;const Z=r.$getSelection();return r.$INTERNAL_isPointSelection(Z)?(re(de,Se),!0):!1},r.COMMAND_PRIORITY_EDITOR))}return di.$createHeadingNode=H,di.$createQuoteNode=m,di.$isHeadingNode=j,di.$isQuoteNode=v,di.DRAG_DROP_PASTE=w,di.HeadingNode=k,di.QuoteNode=M,di.eventFiles=ce,di.registerRichText=Te,di}var fi={},ih;function oC(){if(ih)return fi;ih=1;var e=vp(),t=vs(),n=pn(),r=Yt();function l(V,z){return typeof document.caretRangeFromPoint<"u"?(V=document.caretRangeFromPoint(V,z),V===null?null:{node:V.startContainer,offset:V.startOffset}):document.caretPositionFromPoint!=="undefined"?(V=document.caretPositionFromPoint(V,z),V===null?null:{node:V.offsetNode,offset:V.offset}):null}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",f=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!f?"getTargetRanges"in new window.InputEvent("input"):!1,_=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),T=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,E=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!E,w=r.createCommand("DRAG_DROP_PASTE_FILE");class M extends r.ElementNode{static getType(){return"quote"}static clone(z){return new M(z.__key)}constructor(z){super(z)}createDOM(z){let q=document.createElement("blockquote");return n.addClassNamesToElement(q,z.theme.quote),q}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:I,priority:0})}}exportDOM(z){if({element:z}=super.exportDOM(z),z&&n.isHTMLElement(z)){this.isEmpty()&&z.append(document.createElement("br"));var q=this.getFormatType();z.style.textAlign=q,(q=this.getDirection())&&(z.dir=q)}return{element:z}}static importJSON(z){let q=m();return q.setFormat(z.format),q.setIndent(z.indent),q.setDirection(z.direction),q}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(z,q){z=r.$createParagraphNode();let Te=this.getDirection();return z.setDirection(Te),this.insertAfter(z,q),z}collapseAtStart(){let z=r.$createParagraphNode();return this.getChildren().forEach(q=>z.append(q)),this.replace(z),!0}}function m(){return r.$applyNodeReplacement(new M)}class v extends r.ElementNode{static getType(){return"heading"}static clone(z){return new v(z.__tag,z.__key)}constructor(z,q){super(q),this.__tag=z}getTag(){return this.__tag}createDOM(z){let q=this.__tag,Te=document.createElement(q);return z=z.theme.heading,z!==void 0&&n.addClassNamesToElement(Te,z[q]),Te}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:G,priority:0}),h2:()=>({conversion:G,priority:0}),h3:()=>({conversion:G,priority:0}),h4:()=>({conversion:G,priority:0}),h5:()=>({conversion:G,priority:0}),h6:()=>({conversion:G,priority:0}),p:z=>(z=z.firstChild,z!==null&&k(z)?{conversion:()=>({node:null}),priority:3}:null),span:z=>k(z)?{conversion:()=>({node:P("h1")}),priority:3}:null}}exportDOM(z){if({element:z}=super.exportDOM(z),z&&n.isHTMLElement(z)){this.isEmpty()&&z.append(document.createElement("br"));var q=this.getFormatType();z.style.textAlign=q,(q=this.getDirection())&&(z.dir=q)}return{element:z}}static importJSON(z){let q=P(z.tag);return q.setFormat(z.format),q.setIndent(z.indent),q.setDirection(z.direction),q}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(z,q=!0){let Te=z?z.anchor.offset:0,Se=Te!==this.getTextContentSize()&&z?P(this.getTag()):r.$createParagraphNode(),Ee=this.getDirection();return Se.setDirection(Ee),this.insertAfter(Se,q),Te===0&&!this.isEmpty()&&z&&(z=r.$createParagraphNode(),z.select(),this.replace(z,!0)),Se}collapseAtStart(){let z=this.isEmpty()?r.$createParagraphNode():P(this.getTag());return this.getChildren().forEach(q=>z.append(q)),this.replace(z),!0}extractWithChild(){return!0}}function k(V){return V.nodeName.toLowerCase()==="span"?V.style.fontSize==="26pt":!1}function G(V){let z=V.nodeName.toLowerCase(),q=null;return(z==="h1"||z==="h2"||z==="h3"||z==="h4"||z==="h5"||z==="h6")&&(q=P(z),V.style!==null&&q.setFormat(V.style.textAlign)),{node:q}}function I(V){let z=m();return V.style!==null&&z.setFormat(V.style.textAlign),{node:z}}function P(V){return r.$applyNodeReplacement(new v(V))}function H(V,z){V.preventDefault(),z.update(()=>{let q=r.$getSelection(),Te=V instanceof InputEvent||V instanceof KeyboardEvent?null:V.clipboardData;Te!=null&&r.$INTERNAL_isPointSelection(q)&&e.$insertDataTransferForRichText(Te,q,z)},{tag:"paste"})}async function j(V,z){await e.copyToClipboard(z,n.objectKlassEquals(V,ClipboardEvent)?V:null),z.update(()=>{let q=r.$getSelection();r.$isRangeSelection(q)?q.removeText():r.$isNodeSelection(q)&&q.getNodes().forEach(Te=>Te.remove())})}function re(V){let z=null;if(V instanceof DragEvent?z=V.dataTransfer:V instanceof ClipboardEvent&&(z=V.clipboardData),z===null)return[!1,[],!1];var q=z.types;return V=q.includes("Files"),q=q.includes("text/html")||q.includes("text/plain"),[V,Array.from(z.files),q]}function te(V){var z=r.$getSelection();if(!r.$isRangeSelection(z))return!1;let q=new Set;z=z.getNodes();for(let Ee=0;Ee<z.length;Ee++){var Te=z[Ee],Se=Te.getKey();q.has(Se)||(Te=n.$getNearestBlockElementAncestorOrThrow(Te),Se=Te.getKey(),Te.canIndent()&&!q.has(Se)&&(q.add(Se),V(Te)))}return 0<q.size}function ce(V){return V=r.$getNearestNodeFromDOMNode(V),r.$isDecoratorNode(V)}return fi.$createHeadingNode=P,fi.$createQuoteNode=m,fi.$isHeadingNode=function(V){return V instanceof v},fi.$isQuoteNode=function(V){return V instanceof M},fi.DRAG_DROP_PASTE=w,fi.HeadingNode=v,fi.QuoteNode=M,fi.eventFiles=re,fi.registerRichText=function(V){return n.mergeRegister(V.registerCommand(r.CLICK_COMMAND,()=>{const z=r.$getSelection();return r.$isNodeSelection(z)?(z.clear(),!0):!1},0),V.registerCommand(r.DELETE_CHARACTER_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteCharacter(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DELETE_WORD_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteWord(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DELETE_LINE_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteLine(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,z=>{const q=r.$getSelection();if(typeof z=="string")r.$INTERNAL_isPointSelection(q)&&q.insertText(z);else{if(!r.$INTERNAL_isPointSelection(q))return!1;const Te=z.dataTransfer;Te!=null?e.$insertDataTransferForRichText(Te,q,V):r.$isRangeSelection(q)&&(z=z.data)&&q.insertText(z)}return!0},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.FORMAT_TEXT_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.formatText(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.FORMAT_ELEMENT_COMMAND,z=>{var q=r.$getSelection();if(!r.$isRangeSelection(q)&&!r.$isNodeSelection(q))return!1;q=q.getNodes();for(const Te of q)q=n.$findMatchingParent(Te,Se=>r.$isElementNode(Se)&&!Se.isInline()),q!==null&&q.setFormat(z);return!0},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_LINE_BREAK_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.insertLineBreak(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INDENT_CONTENT_COMMAND,()=>te(z=>{const q=z.getIndent();z.setIndent(q+1)}),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>te(z=>{const q=z.getIndent();0<q&&z.setIndent(q-1)}),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_UP_COMMAND,z=>{var q=r.$getSelection();if(r.$isNodeSelection(q)&&!ce(z.target)){if(z=q.getNodes(),0<z.length)return z[0].selectPrevious(),!0}else if(r.$isRangeSelection(q)&&(q=r.$getAdjacentNode(q.focus,!0),!z.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline()))return q.selectPrevious(),z.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_DOWN_COMMAND,z=>{var q=r.$getSelection();if(r.$isNodeSelection(q)){if(z=q.getNodes(),0<z.length)return z[0].selectNext(0,0),!0}else if(r.$isRangeSelection(q)){let Te=q.focus;if(Te.key==="root"&&Te.offset===r.$getRoot().getChildrenSize())return z.preventDefault(),!0;if(q=r.$getAdjacentNode(q.focus,!1),!z.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline())return q.selectNext(),z.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_LEFT_COMMAND,z=>{const q=r.$getSelection();if(r.$isNodeSelection(q)){var Te=q.getNodes();if(0<Te.length)return z.preventDefault(),Te[0].selectPrevious(),!0}return r.$isRangeSelection(q)&&t.$shouldOverrideDefaultCharacterSelection(q,!0)?(Te=z.shiftKey,z.preventDefault(),t.$moveCharacter(q,Te,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,z=>{const q=r.$getSelection();if(r.$isNodeSelection(q)&&!ce(z.target)){var Te=q.getNodes();if(0<Te.length)return z.preventDefault(),Te[0].selectNext(0,0),!0}return r.$isRangeSelection(q)?(Te=z.shiftKey,t.$shouldOverrideDefaultCharacterSelection(q,!1)?(z.preventDefault(),t.$moveCharacter(q,Te,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_BACKSPACE_COMMAND,z=>{if(ce(z.target))return!1;const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;z.preventDefault(),{anchor:z}=q;const Te=z.getNode();return q.isCollapsed()&&z.offset===0&&!r.$isRootNode(Te)&&0<n.$getNearestBlockElementAncestorOrThrow(Te).getIndent()?V.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):V.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_DELETE_COMMAND,z=>{if(ce(z.target))return!1;const q=r.$getSelection();return r.$isRangeSelection(q)?(z.preventDefault(),V.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ENTER_COMMAND,z=>{const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;if(z!==null){if((T||_||S)&&p)return!1;if(z.preventDefault(),z.shiftKey)return V.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return V.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(V.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DROP_COMMAND,z=>{const[,q]=re(z);if(0<q.length){var Te=l(z.clientX,z.clientY);if(Te!==null){const{offset:Ee,node:de}=Te;var Se=r.$getNearestNodeFromDOMNode(de);if(Se!==null){if(Te=r.$createRangeSelection(),r.$isTextNode(Se))Te.anchor.set(Se.getKey(),Ee,"text"),Te.focus.set(Se.getKey(),Ee,"text");else{const K=Se.getParentOrThrow().getKey();Se=Se.getIndexWithinParent()+1,Te.anchor.set(K,Se,"element"),Te.focus.set(K,Se,"element")}Te=r.$normalizeSelection__EXPERIMENTAL(Te),r.$setSelection(Te)}V.dispatchCommand(w,q)}return z.preventDefault(),!0}return z=r.$getSelection(),!!r.$isRangeSelection(z)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DRAGSTART_COMMAND,z=>{[z]=re(z);const q=r.$getSelection();return!(z&&!r.$isRangeSelection(q))},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DRAGOVER_COMMAND,z=>{var[q]=re(z);const Te=r.$getSelection();return q&&!r.$isRangeSelection(Te)?!1:(q=l(z.clientX,z.clientY),q!==null&&(q=r.$getNearestNodeFromDOMNode(q.node),r.$isDecoratorNode(q)&&z.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.COPY_COMMAND,z=>(e.copyToClipboard(V,n.objectKlassEquals(z,ClipboardEvent)?z:null),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.CUT_COMMAND,z=>(j(z,V),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.PASTE_COMMAND,z=>{const[,q,Te]=re(z);if(0<q.length&&!Te)return V.dispatchCommand(w,q),!0;if(r.isSelectionCapturedInDecoratorInput(z.target))return!1;const Se=r.$getSelection();return r.$INTERNAL_isPointSelection(Se)?(H(z,V),!0):!1},r.COMMAND_PRIORITY_EDITOR))},fi}var du,sh;function md(){return sh||(sh=1,du=process.env.NODE_ENV==="development"?sC():oC()),du}var oh;function lC(){if(oh)return Qc;oh=1;var e=qn(),t=Cp(),n=nt,r=Ep(),l=pn(),d=ld,f=Tp(),p=md(),E=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function S(G){return G.getEditorState().read(r.$canShowPlaceholderCurry(G.isComposing()))}function w(G){const[I,P]=n.useState(()=>S(G));return E(()=>{function H(){const j=S(G);P(j)}return H(),l.mergeRegister(G.registerUpdateListener(()=>{H()}),G.registerEditableListener(()=>{H()}))},[G]),I}function M(G,I){const[P,H]=n.useState(()=>G.getDecorators());return E(()=>G.registerDecoratorListener(j=>{d.flushSync(()=>{H(j)})}),[G]),n.useEffect(()=>{H(G.getDecorators())},[G]),n.useMemo(()=>{const j=[],re=Object.keys(P);for(let te=0;te<re.length;te++){const ce=re[te],V=n.createElement(I,{onError:q=>G._onError(q)},n.createElement(n.Suspense,{fallback:null},P[ce])),z=G.getElementByKey(ce);z!==null&&j.push(d.createPortal(V,z,ce))}return j},[I,P,G])}function m(G){E(()=>l.mergeRegister(p.registerRichText(G),f.registerDragonSupport(G)),[G])}function v({contentEditable:G,placeholder:I,ErrorBoundary:P}){const[H]=e.useLexicalComposerContext(),j=M(H,P);return m(H),n.createElement(n.Fragment,null,G,n.createElement(k,{content:I}),j)}function k({content:G}){const[I]=e.useLexicalComposerContext(),P=w(I),H=t();return P?typeof G=="function"?G(H):G:null}return Qc.RichTextPlugin=v,Qc}var fu={},lh;function aC(){if(lh)return fu;lh=1;var e=qn(),t=Cp(),n=nt,r=Ep(),l=pn(),d=ld,f=Tp(),p=md(),_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function T(m){return m.getEditorState().read(r.$canShowPlaceholderCurry(m.isComposing()))}function E(m){let[v,k]=n.useState(()=>T(m));return _(()=>{function G(){let I=T(m);k(I)}return G(),l.mergeRegister(m.registerUpdateListener(()=>{G()}),m.registerEditableListener(()=>{G()}))},[m]),v}function S(m,v){let[k,G]=n.useState(()=>m.getDecorators());return _(()=>m.registerDecoratorListener(I=>{d.flushSync(()=>{G(I)})}),[m]),n.useEffect(()=>{G(m.getDecorators())},[m]),n.useMemo(()=>{let I=[],P=Object.keys(k);for(let H=0;H<P.length;H++){let j=P[H],re=n.createElement(v,{onError:ce=>m._onError(ce)},n.createElement(n.Suspense,{fallback:null},k[j])),te=m.getElementByKey(j);te!==null&&I.push(d.createPortal(re,te,j))}return I},[v,k,m])}function w(m){_(()=>l.mergeRegister(p.registerRichText(m),f.registerDragonSupport(m)),[m])}function M({content:m}){var[v]=e.useLexicalComposerContext();v=E(v);let k=t();return v?typeof m=="function"?m(k):m:null}return fu.RichTextPlugin=function({contentEditable:m,placeholder:v,ErrorBoundary:k}){let[G]=e.useLexicalComposerContext();return k=S(G,k),w(G),n.createElement(n.Fragment,null,m,n.createElement(M,{content:v}),k)},fu}const cC=process.env.NODE_ENV==="development"?lC():aC();var uC=cC,hu={},ah;function dC(){if(ah)return hu;ah=1;var e=qn(),t=nt;function n(){return n=Object.assign?Object.assign.bind():function(p){for(var _=1;_<arguments.length;_++){var T=arguments[_];for(var E in T)Object.prototype.hasOwnProperty.call(T,E)&&(p[E]=T[E])}return p},n.apply(this,arguments)}var d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function f({ariaActiveDescendant:p,ariaAutoComplete:_,ariaControls:T,ariaDescribedBy:E,ariaExpanded:S,ariaLabel:w,ariaLabelledBy:M,ariaMultiline:m,ariaOwns:v,ariaRequired:k,autoCapitalize:G,className:I,id:P,role:H="textbox",spellCheck:j=!0,style:re,tabIndex:te,"data-testid":ce,...V}){const[z]=e.useLexicalComposerContext(),[q,Te]=t.useState(!1),Se=t.useCallback(Ee=>{z.setRootElement(Ee)},[z]);return d(()=>(Te(z.isEditable()),z.registerEditableListener(Ee=>{Te(Ee)})),[z]),t.createElement("div",n({},V,{"aria-activedescendant":q?p:void 0,"aria-autocomplete":q?_:"none","aria-controls":q?T:void 0,"aria-describedby":E,"aria-expanded":q&&H==="combobox"?!!S:void 0,"aria-label":w,"aria-labelledby":M,"aria-multiline":m,"aria-owns":q?v:void 0,"aria-readonly":q?void 0:!0,"aria-required":k,autoCapitalize:G,className:I,contentEditable:q,"data-testid":ce,id:P,ref:Se,role:H,spellCheck:j,style:re,tabIndex:te}))}return hu.ContentEditable=f,hu}var gu={},ch;function fC(){if(ch)return gu;ch=1;var e=qn(),t=nt;function n(){return n=Object.assign?Object.assign.bind():function(l){for(var d=1;d<arguments.length;d++){var f=arguments[d],p;for(p in f)Object.prototype.hasOwnProperty.call(f,p)&&(l[p]=f[p])}return l},n.apply(this,arguments)}var r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;return gu.ContentEditable=function({ariaActiveDescendant:l,ariaAutoComplete:d,ariaControls:f,ariaDescribedBy:p,ariaExpanded:_,ariaLabel:T,ariaLabelledBy:E,ariaMultiline:S,ariaOwns:w,ariaRequired:M,autoCapitalize:m,className:v,id:k,role:G="textbox",spellCheck:I=!0,style:P,tabIndex:H,"data-testid":j,...re}){let[te]=e.useLexicalComposerContext(),[ce,V]=t.useState(!1),z=t.useCallback(q=>{te.setRootElement(q)},[te]);return r(()=>(V(te.isEditable()),te.registerEditableListener(q=>{V(q)})),[te]),t.createElement("div",n({},re,{"aria-activedescendant":ce?l:void 0,"aria-autocomplete":ce?d:"none","aria-controls":ce?f:void 0,"aria-describedby":p,"aria-expanded":ce&&G==="combobox"?!!_:void 0,"aria-label":T,"aria-labelledby":E,"aria-multiline":S,"aria-owns":ce?w:void 0,"aria-readonly":ce?void 0:!0,"aria-required":M,autoCapitalize:m,className:v,contentEditable:ce,"data-testid":j,id:k,ref:z,role:G,spellCheck:I,style:P,tabIndex:H}))},gu}const hC=process.env.NODE_ENV==="development"?dC():fC();var gC=hC,pu,uh;function pC(){if(uh)return pu;uh=1;var e=nt;function t(p,_){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,S){return E.__proto__=S,E},t(p,_)}function n(p,_){p.prototype=Object.create(_.prototype),p.prototype.constructor=p,t(p,_)}var r=function(_,T){return _===void 0&&(_=[]),T===void 0&&(T=[]),_.length!==T.length||_.some(function(E,S){return!Object.is(E,T[S])})},l={error:null},d=function(p){n(_,p);function _(){for(var E,S=arguments.length,w=new Array(S),M=0;M<S;M++)w[M]=arguments[M];return E=p.call.apply(p,[this].concat(w))||this,E.state=l,E.resetErrorBoundary=function(){for(var m,v=arguments.length,k=new Array(v),G=0;G<v;G++)k[G]=arguments[G];E.props.onReset==null||(m=E.props).onReset.apply(m,k),E.reset()},E}_.getDerivedStateFromError=function(S){return{error:S}};var T=_.prototype;return T.reset=function(){this.setState(l)},T.componentDidCatch=function(S,w){var M,m;(M=(m=this.props).onError)==null||M.call(m,S,w)},T.componentDidUpdate=function(S,w){var M=this.state.error,m=this.props.resetKeys;if(M!==null&&w.error!==null&&r(S.resetKeys,m)){var v,k;(v=(k=this.props).onResetKeysChange)==null||v.call(k,S.resetKeys,m),this.reset()}},T.render=function(){var S=this.state.error,w=this.props,M=w.fallbackRender,m=w.FallbackComponent,v=w.fallback;if(S!==null){var k={error:S,resetErrorBoundary:this.resetErrorBoundary};if(e.isValidElement(v))return v;if(typeof M=="function")return M(k);if(m)return e.createElement(m,k);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},_}(e.Component);function f({children:p,onError:_}){return e.createElement(d,{fallback:e.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:_},p)}return pu=f,pu}var mu,dh;function mC(){if(dh)return mu;dh=1;var e=nt;function t(f,p){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(_,T){return _.__proto__=T,_},t(f,p)}function n(f,p){f.prototype=Object.create(p.prototype),f.prototype.constructor=f,t(f,p)}function r(f,p){return f===void 0&&(f=[]),p===void 0&&(p=[]),f.length!==p.length||f.some(function(_,T){return!Object.is(_,p[T])})}var l={error:null},d=function(f){function p(){for(var T,E=arguments.length,S=Array(E),w=0;w<E;w++)S[w]=arguments[w];return T=f.call.apply(f,[this].concat(S))||this,T.state=l,T.resetErrorBoundary=function(){for(var M,m=arguments.length,v=Array(m),k=0;k<m;k++)v[k]=arguments[k];T.props.onReset==null||(M=T.props).onReset.apply(M,v),T.reset()},T}n(p,f),p.getDerivedStateFromError=function(T){return{error:T}};var _=p.prototype;return _.reset=function(){this.setState(l)},_.componentDidCatch=function(T,E){var S,w;(S=(w=this.props).onError)==null||S.call(w,T,E)},_.componentDidUpdate=function(T,E){var S=this.props.resetKeys;if(this.state.error!==null&&E.error!==null&&r(T.resetKeys,S)){var w,M;(w=(M=this.props).onResetKeysChange)==null||w.call(M,T.resetKeys,S),this.reset()}},_.render=function(){var T=this.state.error,E=this.props,S=E.fallbackRender,w=E.FallbackComponent;if(E=E.fallback,T!==null){if(T={error:T,resetErrorBoundary:this.resetErrorBoundary},e.isValidElement(E))return E;if(typeof S=="function")return S(T);if(w)return e.createElement(w,T);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},p}(e.Component);return mu=function({children:f,onError:p}){return e.createElement(d,{fallback:e.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:p},f)},mu}const _C=process.env.NODE_ENV==="development"?pC():mC();var yC=_C;const NC=ad(yC);var _u={},gr={},fh;function CC(){if(fh)return gr;fh=1;var e=Yt(),t=pn();function n(Y){let W=1,J=Y.getParent();for(;J!=null;){if(ce(J)){const R=J.getParent();if(de(R)){W++,J=R.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return W}return W}function r(Y){let W=Y.getParent();if(!de(W))throw Error("A ListItemNode must have a ListNode for a parent.");let J=W;for(;J!==null;)J=J.getParent(),de(J)&&(W=J);return W}function l(Y){let W=[];const J=Y.getChildren().filter(ce);for(let R=0;R<J.length;R++){const U=J[R],X=U.getFirstChild();de(X)?W=W.concat(l(X)):W.push(U)}return W}function d(Y){return ce(Y)&&de(Y.getFirstChild())}function f(Y){let W=Y;for(;W.getNextSibling()==null&&W.getPreviousSibling()==null;){const J=W.getParent();if(J==null||!(ce(W)||de(W)))break;W=J}W.remove()}function p(Y){return te().append(Y)}function _(Y,W){return ce(Y)&&(W.length===0||W.length===1&&Y.is(W[0])&&Y.getChildrenSize()===0)}function T(Y){const W=Y.getParent();let J=1;if(W!=null)if(de(W))J=W.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const R=Y.getPreviousSiblings();for(let U=0;U<R.length;U++){const X=R[U];ce(X)&&!de(X.getFirstChild())&&J++}return J}function E(Y,W){Y.update(()=>{const J=e.$getSelection();if(e.$INTERNAL_isPointSelection(J)){const R=J.getNodes(),X=J.anchor.getNode(),fe=X.getParent();if(_(X,R)){const _e=Ee(W);if(e.$isRootOrShadowRoot(fe)){X.replace(_e);const B=te();e.$isElementNode(X)&&(B.setFormat(X.getFormatType()),B.setIndent(X.getIndent())),_e.append(B)}else if(ce(X)){const B=X.getParentOrThrow();S(_e,B.getChildren()),B.replace(_e)}return}else{const _e=new Set;for(let B=0;B<R.length;B++){const A=R[B];if(e.$isElementNode(A)&&A.isEmpty()&&!ce(A)&&!_e.has(A.getKey())){w(A,W);continue}if(e.$isLeafNode(A)){let F=A.getParent();for(;F!=null;){const se=F.getKey();if(de(F)){if(!_e.has(se)){const ye=Ee(W);S(ye,F.getChildren()),F.replace(ye),v(ye),_e.add(se)}break}else{const ye=F.getParent();if(e.$isRootOrShadowRoot(ye)&&!_e.has(se)){_e.add(se),w(F,W);break}F=ye}}}}}}})}function S(Y,W){Y.splice(Y.getChildrenSize(),0,W)}function w(Y,W){if(de(Y))return Y;const J=Y.getPreviousSibling(),R=Y.getNextSibling(),U=te();if(U.setFormat(Y.getFormatType()),U.setIndent(Y.getIndent()),S(U,Y.getChildren()),de(J)&&W===J.getListType())return J.append(U),Y.remove(),de(R)&&W===R.getListType()&&(S(J,R.getChildren()),R.remove()),J;if(de(R)&&W===R.getListType())return R.getFirstChildOrThrow().insertBefore(U),Y.remove(),R;{const X=Ee(W);return X.append(U),Y.replace(X),v(X),X}}function M(Y,W){const J=Y.getLastChild(),R=W.getFirstChild();J&&R&&d(J)&&d(R)&&(M(J.getFirstChild(),R.getFirstChild()),R.remove());const U=W.getChildren();U.length>0&&(Y.append(...U),v(Y)),W.remove()}function m(Y){Y.update(()=>{const W=e.$getSelection();if(e.$isRangeSelection(W)){const J=new Set,R=W.getNodes(),U=W.anchor.getNode();if(_(U,R))J.add(r(U));else for(let X=0;X<R.length;X++){const fe=R[X];if(e.$isLeafNode(fe)){const _e=t.$getNearestNodeOfType(fe,P);_e!=null&&J.add(r(_e))}}for(const X of J){let fe=X;const _e=l(X);for(const B of _e){const A=e.$createParagraphNode();S(A,B.getChildren()),fe.insertAfter(A),fe=A,B.__key===W.anchor.key&&W.anchor.set(A.getKey(),0,"element"),B.__key===W.focus.key&&W.focus.set(A.getKey(),0,"element"),B.remove()}X.remove()}}})}function v(Y,W){const J=W||Y.getChildren();if(J!==void 0)for(let R=0;R<J.length;R++){const U=J[R];if(ce(U)){const X=U.getValue(),fe=T(U);X!==fe&&U.setValue(fe)}}}function k(Y){const W=new Set;if(d(Y)||W.has(Y.getKey()))return;const J=Y.getParent(),R=Y.getNextSibling(),U=Y.getPreviousSibling();if(d(R)&&d(U)){const X=U.getFirstChild();if(de(X)){X.append(Y);const fe=R.getFirstChild();if(de(fe)){const _e=fe.getChildren();S(X,_e),R.remove(),W.add(R.getKey())}v(X)}}else if(d(R)){const X=R.getFirstChild();if(de(X)){const fe=X.getFirstChild();fe!==null&&fe.insertBefore(Y),v(X)}}else if(d(U)){const X=U.getFirstChild();de(X)&&(X.append(Y),v(X))}else if(de(J)){const X=te(),fe=Ee(J.getListType());X.append(fe),fe.append(Y),U?U.insertAfter(X):R?R.insertBefore(X):J.append(X),v(fe)}de(J)&&v(J)}function G(Y){if(d(Y))return;const W=Y.getParent(),J=W?W.getParent():void 0,R=J?J.getParent():void 0;if(de(R)&&ce(J)&&de(W)){const U=W?W.getFirstChild():void 0,X=W?W.getLastChild():void 0;if(Y.is(U))J.insertBefore(Y),W.isEmpty()&&J.remove();else if(Y.is(X))J.insertAfter(Y),W.isEmpty()&&J.remove();else{const fe=W.getListType(),_e=te(),B=Ee(fe);_e.append(B),Y.getPreviousSiblings().forEach(se=>B.append(se));const A=te(),F=Ee(fe);A.append(F),S(F,Y.getNextSiblings()),J.insertBefore(_e),J.insertAfter(A),J.replace(Y)}v(W),v(R)}}function I(){const Y=e.$getSelection();if(!e.$isRangeSelection(Y)||!Y.isCollapsed())return!1;const W=Y.anchor.getNode();if(!ce(W)||W.getChildrenSize()!==0)return!1;const J=r(W),R=W.getParent();if(!de(R))throw Error("A ListItemNode must have a ListNode for a parent.");const U=R.getParent();let X;if(e.$isRootOrShadowRoot(U))X=e.$createParagraphNode(),J.insertAfter(X);else if(ce(U))X=te(),U.insertAfter(X);else return!1;X.select();const fe=W.getNextSiblings();if(fe.length>0){const _e=Ee(R.getListType());if(e.$isParagraphNode(X))X.insertAfter(_e);else{const B=te();B.append(_e),X.insertAfter(B)}fe.forEach(B=>{B.remove(),_e.append(B)})}return f(W),!0}class P extends e.ElementNode{static getType(){return"listitem"}static clone(W){return new P(W.__value,W.__checked,W.__key)}constructor(W,J,R){super(R),this.__value=W===void 0?1:W,this.__checked=J}createDOM(W){const J=document.createElement("li"),R=this.getParent();return de(R)&&R.getListType()==="check"&&j(J,this,null),J.value=this.__value,H(J,W.theme,this),J}updateDOM(W,J,R){const U=this.getParent();return de(U)&&U.getListType()==="check"&&j(J,this,W),J.value=this.__value,H(J,R.theme,this),!1}static transform(){return W=>{const J=W.getParent();if(de(J)){if(v(J),!ce(W))throw Error("node is not a ListItemNode");J.getListType()!=="check"&&W.getChecked()!=null&&W.setChecked(void 0)}}}static importDOM(){return{li:W=>({conversion:re,priority:0})}}static importJSON(W){const J=te();return J.setChecked(W.checked),J.setValue(W.value),J.setFormat(W.format),J.setDirection(W.direction),J}exportDOM(W){const J=this.createDOM(W._config);return J.style.textAlign=this.getFormatType(),{element:J}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...W){for(let J=0;J<W.length;J++){const R=W[J];if(e.$isElementNode(R)&&this.canMergeWith(R)){const U=R.getChildren();this.append(...U),R.remove()}else super.append(R)}return this}replace(W,J){if(ce(W))return super.replace(W);this.setIndent(0);const R=this.getParentOrThrow();if(!de(R))return W;if(R.__first===this.getKey())R.insertBefore(W);else if(R.__last===this.getKey())R.insertAfter(W);else{const U=Ee(R.getListType());let X=this.getNextSibling();for(;X;){const fe=X;X=X.getNextSibling(),U.append(fe)}R.insertAfter(W),W.insertAfter(U)}if(J){if(!e.$isElementNode(W))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(U=>{W.append(U)})}return this.remove(),R.getChildrenSize()===0&&R.remove(),W}insertAfter(W,J=!0){const R=this.getParentOrThrow();if(!de(R))throw Error("insertAfter: list node is not parent of list item node");const U=this.getNextSiblings();if(ce(W)){const X=super.insertAfter(W,J),fe=W.getParentOrThrow();return de(fe)&&v(fe),X}if(de(W)){let X=W;const fe=W.getChildren();for(let _e=fe.length-1;_e>=0;_e--)X=fe[_e],this.insertAfter(X,J);return X}if(R.insertAfter(W,J),U.length!==0){const X=Ee(R.getListType());U.forEach(fe=>X.append(fe)),W.insertAfter(X,J)}return W}remove(W){const J=this.getPreviousSibling(),R=this.getNextSibling();if(super.remove(W),J&&R&&d(J)&&d(R))M(J.getFirstChild(),R.getFirstChild()),R.remove();else if(R){const U=R.getParent();de(U)&&v(U)}}insertNewAfter(W,J=!0){const R=te(this.__checked==null?void 0:!1);return this.insertAfter(R,J),R}collapseAtStart(W){const J=e.$createParagraphNode();this.getChildren().forEach(_e=>J.append(_e));const U=this.getParentOrThrow(),X=U.getParentOrThrow(),fe=ce(X);if(U.getChildrenSize()===1)if(fe)U.remove(),X.select();else{U.insertBefore(J),U.remove();const _e=W.anchor,B=W.focus,A=J.getKey();_e.type==="element"&&_e.getNode().is(this)&&_e.set(A,_e.offset,"element"),B.type==="element"&&B.getNode().is(this)&&B.set(A,B.offset,"element")}else U.insertBefore(J),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(W){const J=this.getWritable();J.__value=W}getChecked(){return this.getLatest().__checked}setChecked(W){const J=this.getWritable();J.__checked=W}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const W=this.getParent();if(W===null)return this.getLatest().__indent;let J=W.getParentOrThrow(),R=0;for(;ce(J);)J=J.getParentOrThrow().getParentOrThrow(),R++;return R}setIndent(W){if(!(typeof W=="number"&&W>-1))throw Error("Invalid indent value.");let J=this.getIndent();for(;J!==W;)J<W?(k(this),J++):(G(this),J--);return this}insertBefore(W){if(ce(W)){const J=this.getParentOrThrow();if(de(J)){const R=this.getNextSiblings();v(J,R)}}return super.insertBefore(W)}canInsertAfter(W){return ce(W)}canReplaceWith(W){return ce(W)}canMergeWith(W){return e.$isParagraphNode(W)||ce(W)}extractWithChild(W,J){if(!e.$isRangeSelection(J))return!1;const R=J.anchor.getNode(),U=J.focus.getNode();return this.isParentOf(R)&&this.isParentOf(U)&&this.getTextContent().length===J.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ee("bullet")}}function H(Y,W,J){const R=[],U=[],X=W.list,fe=X?X.listitem:void 0;let _e;if(X&&X.nested&&(_e=X.nested.listitem),fe!==void 0){const B=fe.split(" ");R.push(...B)}if(X){const B=J.getParent(),A=de(B)&&B.getListType()==="check",F=J.getChecked();(!A||F)&&U.push(X.listitemUnchecked),(!A||!F)&&U.push(X.listitemChecked),A&&R.push(F?X.listitemChecked:X.listitemUnchecked)}if(_e!==void 0){const B=_e.split(" ");J.getChildren().some(A=>de(A))?R.push(...B):U.push(...B)}U.length>0&&t.removeClassNamesFromElement(Y,...U),R.length>0&&t.addClassNamesToElement(Y,...R)}function j(Y,W,J,R){de(W.getFirstChild())?(Y.removeAttribute("role"),Y.removeAttribute("tabIndex"),Y.removeAttribute("aria-checked")):(Y.setAttribute("role","checkbox"),Y.setAttribute("tabIndex","-1"),(!J||W.__checked!==J.__checked)&&Y.setAttribute("aria-checked",W.getChecked()?"true":"false"))}function re(Y){const W=t.isHTMLElement(Y)&&Y.getAttribute("aria-checked")==="true";return{node:te(W)}}function te(Y){return e.$applyNodeReplacement(new P(void 0,Y))}function ce(Y){return Y instanceof P}class V extends e.ElementNode{static getType(){return"list"}static clone(W){const J=W.__listType||Se[W.__tag];return new V(J,W.__start,W.__key)}constructor(W,J,R){super(R);const U=Se[W]||W;this.__listType=U,this.__tag=U==="number"?"ol":"ul",this.__start=J}getTag(){return this.__tag}setListType(W){const J=this.getWritable();J.__listType=W,J.__tag=W==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(W,J){const R=this.__tag,U=document.createElement(R);return this.__start!==1&&U.setAttribute("start",String(this.__start)),U.__lexicalListType=this.__listType,z(U,W.theme,this),U}updateDOM(W,J,R){return W.__tag!==this.__tag?!0:(z(J,R.theme,this),!1)}static importDOM(){return{ol:W=>({conversion:Te,priority:0}),ul:W=>({conversion:Te,priority:0})}}static importJSON(W){const J=Ee(W.listType,W.start);return J.setFormat(W.format),J.setIndent(W.indent),J.setDirection(W.direction),J}exportDOM(W){const{element:J}=super.exportDOM(W);return J&&t.isHTMLElement(J)&&(this.__start!==1&&J.setAttribute("start",String(this.__start)),this.__listType==="check"&&J.setAttribute("__lexicalListType","check")),{element:J}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...W){for(let J=0;J<W.length;J++){const R=W[J];if(ce(R))super.append(R);else{const U=te();if(de(R))U.append(R);else if(e.$isElementNode(R)){const X=e.$createTextNode(R.getTextContent());U.append(X)}else U.append(R);super.append(U)}}return v(this),this}extractWithChild(W){return ce(W)}}function z(Y,W,J){const R=[],U=[],X=W.list;if(X!==void 0){const fe=X[`${J.__tag}Depth`]||[],_e=n(J)-1,B=_e%fe.length,A=fe[B],F=X[J.__tag];let se;const ye=X.nested;if(ye!==void 0&&ye.list&&(se=ye.list),F!==void 0&&R.push(F),A!==void 0){const De=A.split(" ");R.push(...De);for(let ee=0;ee<fe.length;ee++)ee!==B&&U.push(J.__tag+ee)}if(se!==void 0){const De=se.split(" ");_e>1?R.push(...De):U.push(...De)}}U.length>0&&t.removeClassNamesFromElement(Y,...U),R.length>0&&t.addClassNamesToElement(Y,...R)}function q(Y){const W=[];for(let J=0;J<Y.length;J++){const R=Y[J];if(ce(R)){W.push(R);const U=R.getChildren();U.length>1&&U.forEach(X=>{de(X)&&W.push(p(X))})}else W.push(p(R))}return W}function Te(Y){const W=Y.nodeName.toLowerCase();let J=null;if(W==="ol"){const R=Y.start;J=Ee("number",R)}else W==="ul"&&(t.isHTMLElement(Y)&&Y.getAttribute("__lexicallisttype")==="check"?J=Ee("check"):J=Ee("bullet"));return{after:q,node:J}}const Se={ol:"number",ul:"bullet"};function Ee(Y,W=1){return e.$applyNodeReplacement(new V(Y,W))}function de(Y){return Y instanceof V}const K=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),O=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Z=e.createCommand("INSERT_CHECK_LIST_COMMAND"),oe=e.createCommand("REMOVE_LIST_COMMAND");return gr.$createListItemNode=te,gr.$createListNode=Ee,gr.$getListDepth=n,gr.$handleListInsertParagraph=I,gr.$isListItemNode=ce,gr.$isListNode=de,gr.INSERT_CHECK_LIST_COMMAND=Z,gr.INSERT_ORDERED_LIST_COMMAND=O,gr.INSERT_UNORDERED_LIST_COMMAND=K,gr.ListItemNode=P,gr.ListNode=V,gr.REMOVE_LIST_COMMAND=oe,gr.insertList=E,gr.removeList=m,gr}var pr={},hh;function EC(){if(hh)return pr;hh=1;var e=Yt(),t=pn();function n(K){let O=new URLSearchParams;O.append("code",K);for(let Z=1;Z<arguments.length;Z++)O.append("v",arguments[Z]);throw Error(`Minified Lexical error #${K}; visit https://lexical.dev/docs/error?${O} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function r(K){let O=1;for(K=K.getParent();K!=null;){if(H(K)){if(K=K.getParent(),q(K)){O++,K=K.getParent();continue}n(40)}break}return O}function l(K){K=K.getParent(),q(K)||n(40);let O=K;for(;O!==null;)O=O.getParent(),q(O)&&(K=O);return K}function d(K){let O=[];K=K.getChildren().filter(H);for(let Z=0;Z<K.length;Z++){let oe=K[Z],Y=oe.getFirstChild();q(Y)?O=O.concat(d(Y)):O.push(oe)}return O}function f(K){return H(K)&&q(K.getFirstChild())}function p(K){for(;K.getNextSibling()==null&&K.getPreviousSibling()==null;){let O=K.getParent();if(O==null||!H(K)&&!q(K))break;K=O}K.remove()}function _(K){return P().append(K)}function T(K,O){return H(K)&&(O.length===0||O.length===1&&K.is(O[0])&&K.getChildrenSize()===0)}function E(K,O){K.splice(K.getChildrenSize(),0,O)}function S(K,O){if(q(K))return K;let Z=K.getPreviousSibling(),oe=K.getNextSibling(),Y=P();return Y.setFormat(K.getFormatType()),Y.setIndent(K.getIndent()),E(Y,K.getChildren()),q(Z)&&O===Z.getListType()?(Z.append(Y),K.remove(),q(oe)&&O===oe.getListType()&&(E(Z,oe.getChildren()),oe.remove()),Z):q(oe)&&O===oe.getListType()?(oe.getFirstChildOrThrow().insertBefore(Y),K.remove(),oe):(O=z(O),O.append(Y),K.replace(O),M(O),O)}function w(K,O){var Z=K.getLastChild();let oe=O.getFirstChild();Z&&oe&&f(Z)&&f(oe)&&(w(Z.getFirstChild(),oe.getFirstChild()),oe.remove()),Z=O.getChildren(),0<Z.length&&(K.append(...Z),M(K)),O.remove()}function M(K,O){if(K=O||K.getChildren(),K!==void 0)for(O=0;O<K.length;O++){let W=K[O];if(H(W)){let J=W.getValue();var Z=W,oe=Z.getParent(),Y=1;for(oe!=null&&(q(oe)?Y=oe.getStart():n(44)),Z=Z.getPreviousSiblings(),oe=0;oe<Z.length;oe++){let R=Z[oe];H(R)&&!q(R.getFirstChild())&&Y++}J!==Y&&W.setValue(Y)}}}function m(K){if(!f(K)){var O=K.getParent(),Z=O?O.getParent():void 0,oe=Z?Z.getParent():void 0;if(q(oe)&&H(Z)&&q(O)){var Y=O?O.getFirstChild():void 0,W=O?O.getLastChild():void 0;if(K.is(Y))Z.insertBefore(K),O.isEmpty()&&Z.remove();else if(K.is(W))Z.insertAfter(K),O.isEmpty()&&Z.remove();else{var J=O.getListType();Y=P();let R=z(J);Y.append(R),K.getPreviousSiblings().forEach(U=>R.append(U)),W=P(),J=z(J),W.append(J),E(J,K.getNextSiblings()),Z.insertBefore(Y),Z.insertAfter(W),Z.replace(K)}M(O),M(oe)}}}class v extends e.ElementNode{static getType(){return"listitem"}static clone(O){return new v(O.__value,O.__checked,O.__key)}constructor(O,Z,oe){super(oe),this.__value=O===void 0?1:O,this.__checked=Z}createDOM(O){let Z=document.createElement("li"),oe=this.getParent();return q(oe)&&oe.getListType()==="check"&&G(Z,this,null),Z.value=this.__value,k(Z,O.theme,this),Z}updateDOM(O,Z,oe){let Y=this.getParent();return q(Y)&&Y.getListType()==="check"&&G(Z,this,O),Z.value=this.__value,k(Z,oe.theme,this),!1}static transform(){return O=>{let Z=O.getParent();if(q(Z)){if(M(Z),!H(O))throw Error("node is not a ListItemNode");Z.getListType()!=="check"&&O.getChecked()!=null&&O.setChecked(void 0)}}}static importDOM(){return{li:()=>({conversion:I,priority:0})}}static importJSON(O){let Z=P();return Z.setChecked(O.checked),Z.setValue(O.value),Z.setFormat(O.format),Z.setDirection(O.direction),Z}exportDOM(O){return O=this.createDOM(O._config),O.style.textAlign=this.getFormatType(),{element:O}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...O){for(let Z=0;Z<O.length;Z++){let oe=O[Z];if(e.$isElementNode(oe)&&this.canMergeWith(oe)){let Y=oe.getChildren();this.append(...Y),oe.remove()}else super.append(oe)}return this}replace(O,Z){if(H(O))return super.replace(O);this.setIndent(0);let oe=this.getParentOrThrow();if(!q(oe))return O;if(oe.__first===this.getKey())oe.insertBefore(O);else if(oe.__last===this.getKey())oe.insertAfter(O);else{let Y=z(oe.getListType()),W=this.getNextSibling();for(;W;){let J=W;W=W.getNextSibling(),Y.append(J)}oe.insertAfter(O),O.insertAfter(Y)}if(Z){if(!e.$isElementNode(O))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Y=>{O.append(Y)})}return this.remove(),oe.getChildrenSize()===0&&oe.remove(),O}insertAfter(O,Z=!0){var oe=this.getParentOrThrow();q(oe)||n(39);var Y=this.getNextSiblings();if(H(O))return Z=super.insertAfter(O,Z),O=O.getParentOrThrow(),q(O)&&M(O),Z;if(q(O)){for(oe=O,O=O.getChildren(),Y=O.length-1;0<=Y;Y--)oe=O[Y],this.insertAfter(oe,Z);return oe}if(oe.insertAfter(O,Z),Y.length!==0){let W=z(oe.getListType());Y.forEach(J=>W.append(J)),O.insertAfter(W,Z)}return O}remove(O){let Z=this.getPreviousSibling(),oe=this.getNextSibling();super.remove(O),Z&&oe&&f(Z)&&f(oe)?(w(Z.getFirstChild(),oe.getFirstChild()),oe.remove()):oe&&(O=oe.getParent(),q(O)&&M(O))}insertNewAfter(O,Z=!0){return O=P(this.__checked==null?void 0:!1),this.insertAfter(O,Z),O}collapseAtStart(O){let Z=e.$createParagraphNode();this.getChildren().forEach(J=>Z.append(J));var oe=this.getParentOrThrow(),Y=oe.getParentOrThrow();let W=H(Y);return oe.getChildrenSize()===1?W?(oe.remove(),Y.select()):(oe.insertBefore(Z),oe.remove(),oe=O.anchor,O=O.focus,Y=Z.getKey(),oe.type==="element"&&oe.getNode().is(this)&&oe.set(Y,oe.offset,"element"),O.type==="element"&&O.getNode().is(this)&&O.set(Y,O.offset,"element")):(oe.insertBefore(Z),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(O){this.getWritable().__value=O}getChecked(){return this.getLatest().__checked}setChecked(O){this.getWritable().__checked=O}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var O=this.getParent();if(O===null)return this.getLatest().__indent;O=O.getParentOrThrow();let Z=0;for(;H(O);)O=O.getParentOrThrow().getParentOrThrow(),Z++;return Z}setIndent(O){typeof O=="number"&&-1<O||n(117);let Z=this.getIndent();for(;Z!==O;)if(Z<O){e:{var oe=new Set;if(f(this)||oe.has(this.getKey()))break e;let R=this.getParent();var Y=this.getNextSibling(),W=this.getPreviousSibling();if(f(Y)&&f(W)){if(W=W.getFirstChild(),q(W)){W.append(this);var J=Y.getFirstChild();q(J)&&(J=J.getChildren(),E(W,J),Y.remove(),oe.add(Y.getKey())),M(W)}}else f(Y)?(Y=Y.getFirstChild(),q(Y)&&(oe=Y.getFirstChild(),oe!==null&&oe.insertBefore(this),M(Y))):f(W)?(Y=W.getFirstChild(),q(Y)&&(Y.append(this),M(Y))):q(R)&&(oe=P(),J=z(R.getListType()),oe.append(J),J.append(this),W?W.insertAfter(oe):Y?Y.insertBefore(oe):R.append(oe),M(J));q(R)&&M(R)}Z++}else m(this),Z--;return this}insertBefore(O){if(H(O)){let Z=this.getParentOrThrow();if(q(Z)){let oe=this.getNextSiblings();M(Z,oe)}}return super.insertBefore(O)}canInsertAfter(O){return H(O)}canReplaceWith(O){return H(O)}canMergeWith(O){return e.$isParagraphNode(O)||H(O)}extractWithChild(O,Z){if(!e.$isRangeSelection(Z))return!1;O=Z.anchor.getNode();let oe=Z.focus.getNode();return this.isParentOf(O)&&this.isParentOf(oe)&&this.getTextContent().length===Z.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return z("bullet")}}function k(K,O,Z){let oe=[],Y=[];var W=(O=O.list)?O.listitem:void 0;if(O&&O.nested)var J=O.nested.listitem;if(W!==void 0&&(W=W.split(" "),oe.push(...W)),O){W=Z.getParent(),W=q(W)&&W.getListType()==="check";let R=Z.getChecked();W&&!R||Y.push(O.listitemUnchecked),W&&R||Y.push(O.listitemChecked),W&&oe.push(R?O.listitemChecked:O.listitemUnchecked)}J!==void 0&&(J=J.split(" "),Z.getChildren().some(R=>q(R))?oe.push(...J):Y.push(...J)),0<Y.length&&t.removeClassNamesFromElement(K,...Y),0<oe.length&&t.addClassNamesToElement(K,...oe)}function G(K,O,Z){q(O.getFirstChild())?(K.removeAttribute("role"),K.removeAttribute("tabIndex"),K.removeAttribute("aria-checked")):(K.setAttribute("role","checkbox"),K.setAttribute("tabIndex","-1"),Z&&O.__checked===Z.__checked||K.setAttribute("aria-checked",O.getChecked()?"true":"false"))}function I(K){return K=t.isHTMLElement(K)&&K.getAttribute("aria-checked")==="true",{node:P(K)}}function P(K){return e.$applyNodeReplacement(new v(void 0,K))}function H(K){return K instanceof v}class j extends e.ElementNode{static getType(){return"list"}static clone(O){return new j(O.__listType||V[O.__tag],O.__start,O.__key)}constructor(O,Z,oe){super(oe),this.__listType=O=V[O]||O,this.__tag=O==="number"?"ol":"ul",this.__start=Z}getTag(){return this.__tag}setListType(O){let Z=this.getWritable();Z.__listType=O,Z.__tag=O==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(O){let Z=document.createElement(this.__tag);return this.__start!==1&&Z.setAttribute("start",String(this.__start)),Z.__lexicalListType=this.__listType,re(Z,O.theme,this),Z}updateDOM(O,Z,oe){return O.__tag!==this.__tag?!0:(re(Z,oe.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:ce,priority:0}),ul:()=>({conversion:ce,priority:0})}}static importJSON(O){let Z=z(O.listType,O.start);return Z.setFormat(O.format),Z.setIndent(O.indent),Z.setDirection(O.direction),Z}exportDOM(O){return{element:O}=super.exportDOM(O),O&&t.isHTMLElement(O)&&(this.__start!==1&&O.setAttribute("start",String(this.__start)),this.__listType==="check"&&O.setAttribute("__lexicalListType","check")),{element:O}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...O){for(let oe=0;oe<O.length;oe++){var Z=O[oe];if(H(Z))super.append(Z);else{let Y=P();q(Z)||e.$isElementNode(Z)&&(Z=e.$createTextNode(Z.getTextContent())),Y.append(Z),super.append(Y)}}return M(this),this}extractWithChild(O){return H(O)}}function re(K,O,Z){let oe=[],Y=[];var W=O.list;if(W!==void 0){let R=W[`${Z.__tag}Depth`]||[];O=r(Z)-1;let U=O%R.length;var J=R[U];let X=W[Z.__tag],fe;if(W=W.nested,W!==void 0&&W.list&&(fe=W.list),X!==void 0&&oe.push(X),J!==void 0)for(J=J.split(" "),oe.push(...J),J=0;J<R.length;J++)J!==U&&Y.push(Z.__tag+J);fe!==void 0&&(Z=fe.split(" "),1<O?oe.push(...Z):Y.push(...Z))}0<Y.length&&t.removeClassNamesFromElement(K,...Y),0<oe.length&&t.addClassNamesToElement(K,...oe)}function te(K){let O=[];for(let oe=0;oe<K.length;oe++){var Z=K[oe];H(Z)?(O.push(Z),Z=Z.getChildren(),1<Z.length&&Z.forEach(Y=>{q(Y)&&O.push(_(Y))})):O.push(_(Z))}return O}function ce(K){let O=K.nodeName.toLowerCase(),Z=null;return O==="ol"?Z=z("number",K.start):O==="ul"&&(Z=t.isHTMLElement(K)&&K.getAttribute("__lexicallisttype")==="check"?z("check"):z("bullet")),{after:te,node:Z}}let V={ol:"number",ul:"bullet"};function z(K,O=1){return e.$applyNodeReplacement(new j(K,O))}function q(K){return K instanceof j}let Te=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),Se=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Ee=e.createCommand("INSERT_CHECK_LIST_COMMAND"),de=e.createCommand("REMOVE_LIST_COMMAND");return pr.$createListItemNode=P,pr.$createListNode=z,pr.$getListDepth=r,pr.$handleListInsertParagraph=function(){var K=e.$getSelection();if(!e.$isRangeSelection(K)||!K.isCollapsed()||(K=K.anchor.getNode(),!H(K)||K.getChildrenSize()!==0))return!1;var O=l(K),Z=K.getParent();q(Z)||n(40);let oe=Z.getParent(),Y;if(e.$isRootOrShadowRoot(oe))Y=e.$createParagraphNode(),O.insertAfter(Y);else if(H(oe))Y=P(),oe.insertAfter(Y);else return!1;if(Y.select(),O=K.getNextSiblings(),0<O.length){let W=z(Z.getListType());e.$isParagraphNode(Y)?Y.insertAfter(W):(Z=P(),Z.append(W),Y.insertAfter(Z)),O.forEach(J=>{J.remove(),W.append(J)})}return p(K),!0},pr.$isListItemNode=H,pr.$isListNode=q,pr.INSERT_CHECK_LIST_COMMAND=Ee,pr.INSERT_ORDERED_LIST_COMMAND=Se,pr.INSERT_UNORDERED_LIST_COMMAND=Te,pr.ListItemNode=v,pr.ListNode=j,pr.REMOVE_LIST_COMMAND=de,pr.insertList=function(K,O){K.update(()=>{var Z=e.$getSelection();if(e.$INTERNAL_isPointSelection(Z)){var oe=Z.getNodes();Z=Z.anchor.getNode();var Y=Z.getParent();if(T(Z,oe))oe=z(O),e.$isRootOrShadowRoot(Y)?(Z.replace(oe),Y=P(),e.$isElementNode(Z)&&(Y.setFormat(Z.getFormatType()),Y.setIndent(Z.getIndent())),oe.append(Y)):H(Z)&&(Z=Z.getParentOrThrow(),E(oe,Z.getChildren()),Z.replace(oe));else for(Z=new Set,Y=0;Y<oe.length;Y++){var W=oe[Y];if(e.$isElementNode(W)&&W.isEmpty()&&!H(W)&&!Z.has(W.getKey()))S(W,O);else if(e.$isLeafNode(W))for(W=W.getParent();W!=null;){let R=W.getKey();if(q(W)){if(!Z.has(R)){var J=z(O);E(J,W.getChildren()),W.replace(J),M(J),Z.add(R)}break}else{if(J=W.getParent(),e.$isRootOrShadowRoot(J)&&!Z.has(R)){Z.add(R),S(W,O);break}W=J}}}}})},pr.removeList=function(K){K.update(()=>{let O=e.$getSelection();if(e.$isRangeSelection(O)){var Z=new Set,oe=O.getNodes(),Y=O.anchor.getNode();if(T(Y,oe))Z.add(l(Y));else for(Y=0;Y<oe.length;Y++){var W=oe[Y];e.$isLeafNode(W)&&(W=t.$getNearestNodeOfType(W,v),W!=null&&Z.add(l(W)))}for(let J of Z){Z=J,oe=d(J);for(let R of oe)oe=e.$createParagraphNode(),E(oe,R.getChildren()),Z.insertAfter(oe),Z=oe,R.__key===O.anchor.key&&O.anchor.set(oe.getKey(),0,"element"),R.__key===O.focus.key&&O.focus.set(oe.getKey(),0,"element"),R.remove();J.remove()}}})},pr}var yu,gh;function _d(){return gh||(gh=1,yu=process.env.NODE_ENV==="development"?CC():EC()),yu}var ph;function TC(){if(ph)return _u;ph=1;var e=_d(),t=qn(),n=nt,r=pn(),l=Yt();function d(p){n.useEffect(()=>r.mergeRegister(p.registerCommand(e.INSERT_ORDERED_LIST_COMMAND,()=>(e.insertList(p,"number"),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(e.INSERT_UNORDERED_LIST_COMMAND,()=>(e.insertList(p,"bullet"),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(e.REMOVE_LIST_COMMAND,()=>(e.removeList(p),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(l.INSERT_PARAGRAPH_COMMAND,()=>!!e.$handleListInsertParagraph(),l.COMMAND_PRIORITY_LOW)),[p])}function f(){const[p]=t.useLexicalComposerContext();return n.useEffect(()=>{if(!p.hasNodes([e.ListNode,e.ListItemNode]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[p]),d(p),null}return _u.ListPlugin=f,_u}var Nu={},mh;function xC(){if(mh)return Nu;mh=1;var e=_d(),t=qn(),n=nt,r=pn(),l=Yt();function d(f){n.useEffect(()=>r.mergeRegister(f.registerCommand(e.INSERT_ORDERED_LIST_COMMAND,()=>(e.insertList(f,"number"),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(e.INSERT_UNORDERED_LIST_COMMAND,()=>(e.insertList(f,"bullet"),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(e.REMOVE_LIST_COMMAND,()=>(e.removeList(f),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(l.INSERT_PARAGRAPH_COMMAND,()=>!!e.$handleListInsertParagraph(),l.COMMAND_PRIORITY_LOW)),[f])}return Nu.ListPlugin=function(){let[f]=t.useLexicalComposerContext();return n.useEffect(()=>{if(!f.hasNodes([e.ListNode,e.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[f]),d(f),null},Nu}const vC=process.env.NODE_ENV==="development"?TC():xC();var SC=vC,Cu={},wi={},_h;function wC(){if(_h)return wi;_h=1;var e=pn(),t=Yt();const n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(m){return new r(m.__url,{rel:m.__rel,target:m.__target,title:m.__title},m.__key)}constructor(m,v={},k){super(k);const{target:G=null,rel:I=null,title:P=null}=v;this.__url=m,this.__target=G,this.__rel=I,this.__title=P}createDOM(m){const v=document.createElement("a");return v.href=this.sanitizeUrl(this.__url),this.__target!==null&&(v.target=this.__target),this.__rel!==null&&(v.rel=this.__rel),this.__title!==null&&(v.title=this.__title),e.addClassNamesToElement(v,m.theme.link),v}updateDOM(m,v,k){const G=this.__url,I=this.__target,P=this.__rel,H=this.__title;return G!==m.__url&&(v.href=G),I!==m.__target&&(I?v.target=I:v.removeAttribute("target")),P!==m.__rel&&(P?v.rel=P:v.removeAttribute("rel")),H!==m.__title&&(H?v.title=H:v.removeAttribute("title")),!1}static importDOM(){return{a:m=>({conversion:l,priority:1})}}static importJSON(m){const v=d(m.url,{rel:m.rel,target:m.target,title:m.title});return v.setFormat(m.format),v.setIndent(m.indent),v.setDirection(m.direction),v}sanitizeUrl(m){try{const v=new URL(m);if(!n.has(v.protocol))return"about:blank"}catch{return m}return m}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(m){const v=this.getWritable();v.__url=m}getTarget(){return this.getLatest().__target}setTarget(m){const v=this.getWritable();v.__target=m}getRel(){return this.getLatest().__rel}setRel(m){const v=this.getWritable();v.__rel=m}getTitle(){return this.getLatest().__title}setTitle(m){const v=this.getWritable();v.__title=m}insertNewAfter(m,v=!0){const k=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(k,v),k}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(m,v,k){if(!t.$isRangeSelection(v))return!1;const G=v.anchor.getNode(),I=v.focus.getNode();return this.isParentOf(G)&&this.isParentOf(I)&&v.getTextContent().length>0}}function l(M){let m=null;if(e.isHTMLAnchorElement(M)){const v=M.textContent;(v!==null&&v!==""||M.children.length>0)&&(m=d(M.getAttribute("href")||"",{rel:M.getAttribute("rel"),target:M.getAttribute("target"),title:M.getAttribute("title")}))}return{node:m}}function d(M,m){return t.$applyNodeReplacement(new r(M,m))}function f(M){return M instanceof r}class p extends r{static getType(){return"autolink"}static clone(m){return new p(m.__url,{rel:m.__rel,target:m.__target,title:m.__title},m.__key)}static importJSON(m){const v=_(m.url,{rel:m.rel,target:m.target,title:m.title});return v.setFormat(m.format),v.setIndent(m.indent),v.setDirection(m.direction),v}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(m,v=!0){const k=this.getParentOrThrow().insertNewAfter(m,v);if(t.$isElementNode(k)){const G=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return k.append(G),G}return null}}function _(M,m){return t.$applyNodeReplacement(new p(M,m))}function T(M){return M instanceof p}const E=t.createCommand("TOGGLE_LINK_COMMAND");function S(M,m={}){const{target:v,title:k}=m,G=m.rel===void 0?"noreferrer":m.rel,I=t.$getSelection();if(!t.$isRangeSelection(I))return;const P=I.extract();if(M===null)P.forEach(H=>{const j=H.getParent();if(f(j)){const re=j.getChildren();for(let te=0;te<re.length;te++)j.insertBefore(re[te]);j.remove()}});else{if(P.length===1){const re=P[0],te=w(re,f);if(te!==null){te.setURL(M),v!==void 0&&te.setTarget(v),G!==null&&te.setRel(G),k!==void 0&&te.setTitle(k);return}}let H=null,j=null;P.forEach(re=>{const te=re.getParent();if(!(te===j||te===null||t.$isElementNode(re)&&!re.isInline())){if(f(te)){j=te,te.setURL(M),v!==void 0&&te.setTarget(v),G!==null&&j.setRel(G),k!==void 0&&j.setTitle(k);return}if(te.is(H)||(H=te,j=d(M,{rel:G,target:v,title:k}),f(te)?re.getPreviousSibling()===null?te.insertBefore(j):te.insertAfter(j):re.insertBefore(j)),f(re)){if(re.is(j))return;if(j!==null){const ce=re.getChildren();for(let V=0;V<ce.length;V++)j.append(ce[V])}re.remove();return}j!==null&&j.append(re)}})}}function w(M,m){let v=M;for(;v!==null&&v.getParent()!==null&&!m(v);)v=v.getParentOrThrow();return m(v)?v:null}return wi.$createAutoLinkNode=_,wi.$createLinkNode=d,wi.$isAutoLinkNode=T,wi.$isLinkNode=f,wi.AutoLinkNode=p,wi.LinkNode=r,wi.TOGGLE_LINK_COMMAND=E,wi.toggleLink=S,wi}var Oi={},yh;function OC(){if(yh)return Oi;yh=1;var e=pn(),t=Yt();let n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(w){return new r(w.__url,{rel:w.__rel,target:w.__target,title:w.__title},w.__key)}constructor(w,M={},m){super(m);let{target:v=null,rel:k=null,title:G=null}=M;this.__url=w,this.__target=v,this.__rel=k,this.__title=G}createDOM(w){let M=document.createElement("a");return M.href=this.sanitizeUrl(this.__url),this.__target!==null&&(M.target=this.__target),this.__rel!==null&&(M.rel=this.__rel),this.__title!==null&&(M.title=this.__title),e.addClassNamesToElement(M,w.theme.link),M}updateDOM(w,M){let m=this.__url,v=this.__target,k=this.__rel,G=this.__title;return m!==w.__url&&(M.href=m),v!==w.__target&&(v?M.target=v:M.removeAttribute("target")),k!==w.__rel&&(k?M.rel=k:M.removeAttribute("rel")),G!==w.__title&&(G?M.title=G:M.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:l,priority:1})}}static importJSON(w){let M=d(w.url,{rel:w.rel,target:w.target,title:w.title});return M.setFormat(w.format),M.setIndent(w.indent),M.setDirection(w.direction),M}sanitizeUrl(w){try{let M=new URL(w);if(!n.has(M.protocol))return"about:blank"}catch{}return w}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(w){this.getWritable().__url=w}getTarget(){return this.getLatest().__target}setTarget(w){this.getWritable().__target=w}getRel(){return this.getLatest().__rel}setRel(w){this.getWritable().__rel=w}getTitle(){return this.getLatest().__title}setTitle(w){this.getWritable().__title=w}insertNewAfter(w,M=!0){return w=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(w,M),w}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(w,M){if(!t.$isRangeSelection(M))return!1;w=M.anchor.getNode();let m=M.focus.getNode();return this.isParentOf(w)&&this.isParentOf(m)&&0<M.getTextContent().length}}function l(S){let w=null;if(e.isHTMLAnchorElement(S)){let M=S.textContent;(M!==null&&M!==""||0<S.children.length)&&(w=d(S.getAttribute("href")||"",{rel:S.getAttribute("rel"),target:S.getAttribute("target"),title:S.getAttribute("title")}))}return{node:w}}function d(S,w){return t.$applyNodeReplacement(new r(S,w))}function f(S){return S instanceof r}class p extends r{static getType(){return"autolink"}static clone(w){return new p(w.__url,{rel:w.__rel,target:w.__target,title:w.__title},w.__key)}static importJSON(w){let M=_(w.url,{rel:w.rel,target:w.target,title:w.title});return M.setFormat(w.format),M.setIndent(w.indent),M.setDirection(w.direction),M}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(w,M=!0){return w=this.getParentOrThrow().insertNewAfter(w,M),t.$isElementNode(w)?(M=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),w.append(M),M):null}}function _(S,w){return t.$applyNodeReplacement(new p(S,w))}let T=t.createCommand("TOGGLE_LINK_COMMAND");function E(S,w){for(;S!==null&&S.getParent()!==null&&!w(S);)S=S.getParentOrThrow();return w(S)?S:null}return Oi.$createAutoLinkNode=_,Oi.$createLinkNode=d,Oi.$isAutoLinkNode=function(S){return S instanceof p},Oi.$isLinkNode=f,Oi.AutoLinkNode=p,Oi.LinkNode=r,Oi.TOGGLE_LINK_COMMAND=T,Oi.toggleLink=function(S,w={}){let{target:M,title:m}=w,v=w.rel===void 0?"noreferrer":w.rel;if(w=t.$getSelection(),t.$isRangeSelection(w))if(w=w.extract(),S===null)w.forEach(k=>{if(k=k.getParent(),f(k)){let G=k.getChildren();for(let I=0;I<G.length;I++)k.insertBefore(G[I]);k.remove()}});else{if(w.length===1){let I=E(w[0],f);if(I!==null){I.setURL(S),M!==void 0&&I.setTarget(M),v!==null&&I.setRel(v),m!==void 0&&I.setTitle(m);return}}let k=null,G=null;w.forEach(I=>{var P=I.getParent();if(P!==G&&P!==null&&(!t.$isElementNode(I)||I.isInline()))if(f(P))G=P,P.setURL(S),M!==void 0&&P.setTarget(M),v!==null&&G.setRel(v),m!==void 0&&G.setTitle(m);else if(P.is(k)||(k=P,G=d(S,{rel:v,target:M,title:m}),f(P)?I.getPreviousSibling()===null?P.insertBefore(G):P.insertAfter(G):I.insertBefore(G)),f(I)){if(!I.is(G)){if(G!==null){P=I.getChildren();for(let H=0;H<P.length;H++)G.append(P[H])}I.remove()}}else G!==null&&G.append(I)})}},Oi}var Eu,Nh;function yd(){return Nh||(Nh=1,Eu=process.env.NODE_ENV==="development"?wC():OC()),Eu}var Ch;function DC(){if(Ch)return Cu;Ch=1;var e=yd(),t=qn(),n=pn(),r=Yt(),l=nt;function d({validateUrl:f}){const[p]=t.useLexicalComposerContext();return l.useEffect(()=>{if(!p.hasNodes([e.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(p.registerCommand(e.TOGGLE_LINK_COMMAND,_=>{if(_===null)return e.toggleLink(_),!0;if(typeof _=="string")return f===void 0||f(_)?(e.toggleLink(_),!0):!1;{const{url:T,target:E,rel:S,title:w}=_;return e.toggleLink(T,{rel:S,target:E,title:w}),!0}},r.COMMAND_PRIORITY_LOW),f!==void 0?p.registerCommand(r.PASTE_COMMAND,_=>{const T=r.$getSelection();if(!r.$isRangeSelection(T)||T.isCollapsed()||!(_ instanceof ClipboardEvent)||_.clipboardData==null)return!1;const E=_.clipboardData.getData("text");return f(E)?T.getNodes().some(S=>r.$isElementNode(S))?!1:(p.dispatchCommand(e.TOGGLE_LINK_COMMAND,E),_.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[p,f]),null}return Cu.LinkPlugin=d,Cu}var Tu={},Eh;function AC(){if(Eh)return Tu;Eh=1;var e=yd(),t=qn(),n=pn(),r=Yt(),l=nt;return Tu.LinkPlugin=function({validateUrl:d}){let[f]=t.useLexicalComposerContext();return l.useEffect(()=>{if(!f.hasNodes([e.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(f.registerCommand(e.TOGGLE_LINK_COMMAND,p=>{if(p===null)return e.toggleLink(p),!0;if(typeof p=="string")return d===void 0||d(p)?(e.toggleLink(p),!0):!1;let{url:_,target:T,rel:E,title:S}=p;return e.toggleLink(_,{rel:E,target:T,title:S}),!0},r.COMMAND_PRIORITY_LOW),d!==void 0?f.registerCommand(r.PASTE_COMMAND,p=>{let _=r.$getSelection();if(!r.$isRangeSelection(_)||_.isCollapsed()||!(p instanceof ClipboardEvent)||p.clipboardData==null)return!1;let T=p.clipboardData.getData("text");return d(T)?_.getNodes().some(E=>r.$isElementNode(E))?!1:(f.dispatchCommand(e.TOGGLE_LINK_COMMAND,T),p.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[f,d]),null},Tu}const MC=process.env.NODE_ENV==="development"?DC():AC();var RC=MC,xu={},Zt={},Th;function bC(){if(Th)return Zt;Th=1;var e=Yt(),t=pn();class n extends e.INTERNAL_PointSelection{constructor(ie,le,ve){super(le,ve),this.gridKey=ie}getCachedNodes(){return this._cachedNodes}setCachedNodes(ie){this._cachedNodes=ie}is(ie){return r(ie)?this.gridKey===ie.gridKey&&this.anchor.is(ie.anchor)&&this.focus.is(ie.focus):!1}set(ie,le,ve){this.dirty=!0,this.gridKey=ie,this.anchor.key=le,this.focus.key=ve,this._cachedNodes=null}clone(){return new n(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(ie){}insertText(){}insertNodes(ie){const le=this.focus.getNode();if(!e.$isElementNode(le))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(le.select(0,le.getChildrenSize())).insertNodes(ie)}getShape(){const ie=e.$getNodeByKey(this.anchor.key);if(!e.DEPRECATED_$isGridCellNode(ie))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");const le=e.DEPRECATED_$getGridCellNodeRect(ie);if(le===null)throw Error("getCellRect: expected to find AnchorNode");const ve=e.$getNodeByKey(this.focus.key);if(!e.DEPRECATED_$isGridCellNode(ve))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const Le=e.DEPRECATED_$getGridCellNodeRect(ve);if(Le===null)throw Error("getCellRect: expected to find focusCellNode");const Me=Math.min(le.columnIndex,Le.columnIndex),je=Math.max(le.columnIndex,Le.columnIndex),rt=Math.min(le.rowIndex,Le.rowIndex),it=Math.max(le.rowIndex,Le.rowIndex);return{fromX:Math.min(Me,je),fromY:Math.min(rt,it),toX:Math.max(Me,je),toY:Math.max(rt,it)}}getNodes(){const ie=this._cachedNodes;if(ie!==null)return ie;const le=this.anchor.getNode(),ve=this.focus.getNode(),Le=t.$findMatchingParent(le,e.DEPRECATED_$isGridCellNode),Me=t.$findMatchingParent(ve,e.DEPRECATED_$isGridCellNode);if(!e.DEPRECATED_$isGridCellNode(Le))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");if(!e.DEPRECATED_$isGridCellNode(Me))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const je=Le.getParent();if(!e.DEPRECATED_$isGridRowNode(je))throw Error("Expected anchorCell to have a parent GridRowNode");const rt=je.getParent();if(!e.DEPRECATED_$isGridNode(rt))throw Error("Expected tableNode to have a parent GridNode");const it=Me.getParents()[1];if(it!==rt){if(rt.isParentOf(Me)){const It=it.getParent();if(It==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,Me.getKey(),It.getKey())}else{const It=rt.getParent();if(It==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,It.getKey(),Me.getKey())}return this.getNodes()}const[st,vt,Ge]=e.DEPRECATED_$computeGridMap(rt,Le,Me);let ze=Math.min(vt.startColumn,Ge.startColumn),tt=Math.min(vt.startRow,Ge.startRow),yt=Math.max(vt.startColumn+vt.cell.__colSpan-1,Ge.startColumn+Ge.cell.__colSpan-1),Nt=Math.max(vt.startRow+vt.cell.__rowSpan-1,Ge.startRow+Ge.cell.__rowSpan-1),Et=ze,gt=tt,xt=ze,mt=tt;function $t(It){const{cell:jt,startColumn:bt,startRow:nn}=It;ze=Math.min(ze,bt),tt=Math.min(tt,nn),yt=Math.max(yt,bt+jt.__colSpan-1),Nt=Math.max(Nt,nn+jt.__rowSpan-1)}for(;ze<Et||tt<gt||yt>xt||Nt>mt;){if(ze<Et){const It=mt-gt,jt=Et-1;for(let bt=0;bt<=It;bt++)$t(st[gt+bt][jt]);Et=jt}if(tt<gt){const It=xt-Et,jt=gt-1;for(let bt=0;bt<=It;bt++)$t(st[jt][Et+bt]);gt=jt}if(yt>xt){const It=mt-gt,jt=xt+1;for(let bt=0;bt<=It;bt++)$t(st[gt+bt][jt]);xt=jt}if(Nt>mt){const It=xt-Et,jt=mt+1;for(let bt=0;bt<=It;bt++)$t(st[jt][Et+bt]);mt=jt}}const Kt=[rt];let tn=null;for(let It=tt;It<=Nt;It++)for(let jt=ze;jt<=yt;jt++){const{cell:bt}=st[It][jt],nn=bt.getParent();if(!e.DEPRECATED_$isGridRowNode(nn))throw Error("Expected GridCellNode parent to be a GridRowNode");nn!==tn&&Kt.push(nn),Kt.push(bt,...d(bt)),tn=nn}return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=Kt),Kt}getTextContent(){const ie=this.getNodes();let le="";for(let ve=0;ve<ie.length;ve++)le+=ie[ve].getTextContent();return le}}function r(Oe){return Oe instanceof n}function l(){const Oe=e.$createPoint("root",0,"element"),ie=e.$createPoint("root",0,"element");return new n("root",Oe,ie)}function d(Oe){const ie=[],le=[Oe];for(;le.length>0;){const ve=le.pop();if(ve===void 0)throw Error("Stack.length > 0; can't be undefined");e.$isElementNode(ve)&&le.unshift(...ve.getChildren()),ve!==Oe&&ie.push(ve)}return ie}const f=/^(\d+(?:\.\d+)?)px$/,p={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class _ extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(ie){const le=new _(ie.__headerState,ie.__colSpan,ie.__width,ie.__key);return le.__rowSpan=ie.__rowSpan,le.__backgroundColor=ie.__backgroundColor,le}static importDOM(){return{td:ie=>({conversion:T,priority:0}),th:ie=>({conversion:T,priority:0})}}static importJSON(ie){const le=ie.colSpan||1,ve=ie.rowSpan||1,Le=E(ie.headerState,le,ie.width||void 0);return Le.__rowSpan=ve,Le.__backgroundColor=ie.backgroundColor||null,Le}constructor(ie=p.NO_STATUS,le=1,ve,Le){super(le,Le),this.__headerState=ie,this.__width=ve,this.__backgroundColor=null}createDOM(ie){const le=document.createElement(this.getTag());return this.__width&&(le.style.width=`${this.__width}px`),this.__colSpan>1&&(le.colSpan=this.__colSpan),this.__rowSpan>1&&(le.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(le.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(le,ie.theme.tableCell,this.hasHeader()&&ie.theme.tableCellHeader),le}exportDOM(ie){const{element:le}=super.exportDOM(ie);if(le){const ve=le,Le=700,Me=this.getParentOrThrow().getChildrenSize();ve.style.border="1px solid black",this.__colSpan>1&&(ve.colSpan=this.__colSpan),this.__rowSpan>1&&(ve.rowSpan=this.__rowSpan),ve.style.width=`${this.getWidth()||Math.max(90,Le/Me)}px`,ve.style.verticalAlign="top",ve.style.textAlign="start";const je=this.getBackgroundColor();je!==null?ve.style.backgroundColor=je:this.hasHeader()&&(ve.style.backgroundColor="#f2f3f5")}return{element:le}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(ie){const le=this.getWritable();return le.__headerState=ie,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(ie){const le=this.getWritable();return le.__width=ie,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(ie){this.getWritable().__backgroundColor=ie}toggleHeaderStyle(ie){const le=this.getWritable();return(le.__headerState&ie)===ie?le.__headerState-=ie:le.__headerState+=ie,le}hasHeaderState(ie){return(this.getHeaderStyles()&ie)===ie}hasHeader(){return this.getLatest().__headerState!==p.NO_STATUS}updateDOM(ie){return ie.__headerState!==this.__headerState||ie.__width!==this.__width||ie.__colSpan!==this.__colSpan||ie.__rowSpan!==this.__rowSpan||ie.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function T(Oe){const ie=Oe,le=Oe.nodeName.toLowerCase();let ve;f.test(ie.style.width)&&(ve=parseFloat(ie.style.width));const Le=E(le==="th"?p.ROW:p.NO_STATUS,ie.colSpan,ve);Le.__rowSpan=ie.rowSpan;const Me=ie.style.backgroundColor;return Me!==""&&(Le.__backgroundColor=Me),{forChild:(je,rt)=>{if(S(rt)&&!e.$isElementNode(je)){const it=e.$createParagraphNode();return e.$isLineBreakNode(je)&&je.getTextContent()===`
|
|
79
|
-
`?null:(it.append(je),it)}return je},node:Le}}function E(Oe,ie=1,le){return e.$applyNodeReplacement(new _(Oe,ie,le))}function S(Oe){return Oe instanceof _}class w extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(ie){return new w(ie.__height,ie.__key)}static importDOM(){return{tr:ie=>({conversion:M,priority:0})}}static importJSON(ie){return m(ie.height)}constructor(ie,le){super(le),this.__height=ie}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(ie){const le=document.createElement("tr");return this.__height&&(le.style.height=`${this.__height}px`),t.addClassNamesToElement(le,ie.theme.tableRow),le}isShadowRoot(){return!0}setHeight(ie){const le=this.getWritable();return le.__height=ie,this.__height}getHeight(){return this.getLatest().__height}updateDOM(ie){return ie.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function M(Oe){const ie=Oe;let le;return f.test(ie.style.height)&&(le=parseFloat(ie.style.height)),{node:m(le)}}function m(Oe){return e.$applyNodeReplacement(new w(Oe))}function v(Oe){return Oe instanceof w}const k=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",G=Oe=>k?(Oe||window).getSelection():null;class I{constructor(ie,le){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=le,this.editor=ie,this.grid={cells:[],columns:0,rows:0},this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(ie=>ie())}trackTableGrid(){const ie=new MutationObserver(le=>{this.editor.update(()=>{let ve=!1;for(let Me=0;Me<le.length;Me++){const it=le[Me].target.nodeName;if(it==="TABLE"||it==="TR"){ve=!0;break}}if(!ve)return;const Le=this.editor.getElementByKey(this.tableNodeKey);if(!Le)throw new Error("Expected to find TableElement in DOM");this.grid=ce(Le)})});this.editor.update(()=>{const le=this.editor.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");this.grid=ce(le),ie.observe(le,{childList:!0,subtree:!0})})}clearHighlight(){const ie=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),ie.update(()=>{const le=e.$getNodeByKey(this.tableNodeKey);if(!B(le))throw new Error("Expected TableNode.");const ve=ie.getElementByKey(this.tableNodeKey);if(!ve)throw new Error("Expected to find TableElement in DOM");const Le=ce(ve);V(ie,Le,null),e.$setSelection(null),ie.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){const ie=this.editor;ie.update(()=>{const le=ie.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(le,ie._config.theme.tableSelection),le.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const ie=this.editor;ie.update(()=>{const le=ie.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");t.addClassNamesToElement(le,ie._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(ie){if(ie!=null&&ie.gridKey===this.tableNodeKey){const le=this.editor;this.gridSelection=ie,this.isHighlightingCells=!0,this.disableHighlightStyle(),V(le,this.grid,this.gridSelection)}else ie==null?this.clearHighlight():(this.tableNodeKey=ie.gridKey,this.updateTableGridSelection(ie))}setFocusCellForSelection(ie,le=!1){const ve=this.editor;ve.update(()=>{const Le=e.$getNodeByKey(this.tableNodeKey);if(!B(Le))throw new Error("Expected TableNode.");if(!ve.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const je=ie.x,rt=ie.y;if(this.focusCell=ie,this.anchorCell!==null){const it=G(ve._window);it&&it.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==je||this.anchorY!==rt||le))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(je===this.focusX&&rt===this.focusY)return;if(this.focusX=je,this.focusY=rt,this.isHighlightingCells){const it=e.$getNearestNodeFromDOMNode(ie.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&S(it)){const st=it.getKey();this.gridSelection=this.gridSelection.clone()||l(),this.focusCellNodeKey=st,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),ve.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),V(ve,this.grid,this.gridSelection)}}})}setAnchorCellForSelection(ie){this.isHighlightingCells=!1,this.anchorCell=ie,this.anchorX=ie.x,this.anchorY=ie.y,this.editor.update(()=>{const le=e.$getNearestNodeFromDOMNode(ie.elem);if(S(le)){const ve=le.getKey();this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():l(),this.anchorCellNodeKey=ve}})}formatCells(ie){this.editor.update(()=>{const le=e.$getSelection();if(!r(le))throw Error("Expected grid selection");const ve=e.$createRangeSelection(),Le=ve.anchor,Me=ve.focus;le.getNodes().forEach(je=>{S(je)&&je.getTextContentSize()!==0&&(Le.set(je.getKey(),0,"element"),Me.set(je.getKey(),je.getChildrenSize(),"element"),ve.formatText(ie))}),e.$setSelection(le),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){const ie=this.editor;ie.update(()=>{const le=e.$getNodeByKey(this.tableNodeKey);if(!B(le))throw new Error("Expected TableNode.");const ve=e.$getSelection();if(!r(ve))throw Error("Expected grid selection");const Le=ve.getNodes().filter(S);if(Le.length===this.grid.columns*this.grid.rows){le.selectPrevious(),le.remove(),e.$getRoot().selectStart();return}Le.forEach(Me=>{if(e.$isElementNode(Me)){const je=e.$createParagraphNode(),rt=e.$createTextNode();je.append(rt),Me.append(je),Me.getChildren().forEach(it=>{it!==je&&it.remove()})}}),V(ie,this.grid,null),e.$setSelection(null),ie.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}}const P="__lexicalTableSelection";function H(Oe,ie,le,ve){const Le=le.getRootElement();if(Le===null)throw new Error("No root element.");const Me=new I(le,Oe.getKey()),je=le._window||window;j(ie,Me),ie.addEventListener("mousedown",Ge=>{setTimeout(()=>{if(Ge.button!==0||!je)return;const ze=te(Ge.target);ze!==null&&(R(Ge),Me.setAnchorCellForSelection(ze));const tt=()=>{je.removeEventListener("mouseup",tt),je.removeEventListener("mousemove",yt)},yt=Nt=>{const Et=te(Nt.target);Et!==null&&(Me.anchorX!==Et.x||Me.anchorY!==Et.y)&&(Nt.preventDefault(),Me.setFocusCellForSelection(Et))};je.addEventListener("mouseup",tt),je.addEventListener("mousemove",yt)},0)});const rt=Ge=>{Ge.button===0&&le.update(()=>{const ze=e.$getSelection(),tt=Ge.target;r(ze)&&ze.gridKey===Me.tableNodeKey&&Le.contains(tt)&&Me.clearHighlight()})};je.addEventListener("mousedown",rt),Me.listenersToRemove.add(()=>je.removeEventListener("mousedown",rt)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ge=>J(le,Ge,"down",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_UP_COMMAND,Ge=>J(le,Ge,"up",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ge=>J(le,Ge,"backward",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ge=>J(le,Ge,"forward",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ESCAPE_COMMAND,Ge=>{const ze=e.$getSelection();if(r(ze)){const tt=t.$findMatchingParent(ze.focus.getNode(),S);if(S(tt))return R(Ge),tt.selectEnd(),!0}return!1},e.COMMAND_PRIORITY_HIGH));const it=Ge=>()=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Me.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>S(Kt));if(!S(tt))return!1;const yt=ze.anchor.getNode(),Nt=ze.focus.getNode(),Et=Oe.isParentOf(yt),gt=Oe.isParentOf(Nt);if(Et&&!gt||gt&&!Et)return Me.clearText(),!0;const mt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>e.$isElementNode(Kt)),$t=mt&&t.$findMatchingParent(mt,Kt=>e.$isElementNode(Kt)&&S(Kt.getParent()));if(!e.$isElementNode($t)||!e.$isElementNode(mt))return!1;if(Ge===e.DELETE_LINE_COMMAND&&$t.getPreviousSibling()===null)return!0;if((Ge===e.DELETE_CHARACTER_COMMAND||Ge===e.DELETE_WORD_COMMAND)&&ze.isCollapsed()&&ze.anchor.offset===0&&mt!==$t){const Kt=mt.getChildren(),tn=e.$createParagraphNode();return Kt.forEach(It=>tn.append(It)),mt.replace(tn),mt.getWritable().__parent=tt.getKey(),!0}}return!1};[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ge=>{Me.listenersToRemove.add(le.registerCommand(Ge,it(Ge),e.COMMAND_PRIORITY_CRITICAL))});const st=Ge=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Ge.preventDefault(),Ge.stopPropagation(),Me.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1};Me.listenersToRemove.add(le.registerCommand(e.KEY_BACKSPACE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.KEY_DELETE_COMMAND,st,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.FORMAT_TEXT_COMMAND,Ge=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Me.formatCells(Ge),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,Ge=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Me.clearHighlight(),!1;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),ve&&Me.listenersToRemove.add(le.registerCommand(e.KEY_TAB_COMMAND,Ge=>{const ze=e.$getSelection();if(!e.$isRangeSelection(ze)||!ze.isCollapsed()||!de(ze,Oe))return!1;const tt=Y(ze.anchor.getNode());if(tt===null)return!1;R(Ge);const yt=Oe.getCordsFromCellNode(tt,Me.grid);return Se(Me,Oe,yt.x,yt.y,Ge.shiftKey?"backward":"forward"),!0},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.FOCUS_COMMAND,Ge=>Oe.isSelected(),e.COMMAND_PRIORITY_HIGH));function vt(Ge){const ze=Oe.getCordsFromCellNode(Ge,Me.grid);return Oe.getCellFromCordsOrThrow(ze.x,ze.y,Me.grid)}return Me.listenersToRemove.add(le.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ge=>{const{nodes:ze,selection:tt}=Ge,yt=e.$INTERNAL_isPointSelection(tt),Nt=e.$isRangeSelection(tt),Et=Nt&&t.$findMatchingParent(tt.anchor.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht))!==null&&t.$findMatchingParent(tt.focus.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht))!==null||yt&&!Nt;if(ze.length!==1||!e.DEPRECATED_$isGridNode(ze[0])||!Et)return!1;const{anchor:gt}=tt,xt=ze[0],mt=xt.getChildren(),$t=xt.getFirstChildOrThrow().getChildrenSize(),Kt=xt.getChildrenSize(),tn=t.$findMatchingParent(gt.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht)),It=tn&&t.$findMatchingParent(tn,Ht=>e.DEPRECATED_$isGridRowNode(Ht)),jt=It&&t.$findMatchingParent(It,Ht=>e.DEPRECATED_$isGridNode(Ht));if(!e.DEPRECATED_$isGridCellNode(tn)||!e.DEPRECATED_$isGridRowNode(It)||!e.DEPRECATED_$isGridNode(jt))return!1;const bt=It.getIndexWithinParent(),nn=Math.min(jt.getChildrenSize()-1,bt+Kt-1),Or=tn.getIndexWithinParent(),_i=Math.min(It.getChildrenSize()-1,Or+$t-1),pe=Math.min(Or,_i),Ze=Math.min(bt,nn),ot=Math.max(Or,_i),St=Math.max(bt,nn),Gt=jt.getChildren();let Bt=0,Pt,kt;for(let Ht=Ze;Ht<=St;Ht++){const sn=Gt[Ht];if(!e.DEPRECATED_$isGridRowNode(sn))return!1;const an=mt[Bt];if(!e.DEPRECATED_$isGridRowNode(an))return!1;const bn=sn.getChildren(),yr=an.getChildren();let Zn=0;for(let fn=pe;fn<=ot;fn++){const sr=bn[fn];if(!e.DEPRECATED_$isGridCellNode(sr))return!1;const or=yr[Zn];if(!e.DEPRECATED_$isGridCellNode(or))return!1;Ht===Ze&&fn===pe?Pt=sr.getKey():Ht===St&&fn===ot&&(kt=sr.getKey());const Mi=sr.getChildren();or.getChildren().forEach(Nr=>{e.$isTextNode(Nr)&&e.$createParagraphNode().append(Nr),sr.append(Nr)}),Mi.forEach(Nr=>Nr.remove()),Zn++}Bt++}if(Pt&&kt){const Ht=l();Ht.set(ze[0].getKey(),Pt,kt),e.$setSelection(Ht)}return!0},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{const Ge=e.$getSelection(),ze=e.$getPreviousSelection();if(e.$isRangeSelection(Ge)){const{anchor:tt,focus:yt}=Ge,Nt=tt.getNode(),Et=yt.getNode(),gt=Y(Nt),xt=Y(Et),mt=gt&&Oe.is(W(gt)),$t=xt&&Oe.is(W(xt)),Kt=mt!==$t,tn=mt&&$t,It=Ge.isBackward();if(Kt){const jt=Ge.clone();jt.focus.set(Oe.getKey(),It?0:Oe.getChildrenSize(),"element"),e.$setSelection(jt),q(le,Me)}else tn&&(gt.is(xt)||(Me.setAnchorCellForSelection(vt(gt)),Me.setFocusCellForSelection(vt(xt),!0)))}return Ge&&!Ge.is(ze)&&(r(Ge)||r(ze))&&Me.gridSelection&&!Me.gridSelection.is(ze)?(r(Ge)&&Ge.gridKey===Me.tableNodeKey?Me.updateTableGridSelection(Ge):!r(Ge)&&r(ze)&&ze.gridKey===Me.tableNodeKey&&Me.updateTableGridSelection(null),!1):(Me.hasHijackedSelectionStyles&&!Oe.isSelected()?Te(le,Me):!Me.hasHijackedSelectionStyles&&Oe.isSelected()&&q(le,Me),!1)},e.COMMAND_PRIORITY_CRITICAL)),Me}function j(Oe,ie){Oe[P]=ie}function re(Oe){return Oe[P]}function te(Oe){let ie=Oe;for(;ie!=null;){const le=ie.nodeName;if(le==="TD"||le==="TH"){const ve=ie._cell;return ve===void 0?null:ve}ie=ie.parentNode}return null}function ce(Oe){const ie=[],le={cells:ie,columns:0,rows:0};let ve=Oe.firstChild,Le=0,Me=0;for(ie.length=0;ve!=null;){const je=ve.nodeName;if(je==="TD"||je==="TH"){const st=ve,vt={elem:st,hasBackgroundColor:st.style.backgroundColor!=="",highlighted:!1,x:Le,y:Me};ve._cell=vt;let Ge=ie[Me];Ge===void 0&&(Ge=ie[Me]=[]),Ge[Le]=vt}else{const st=ve.firstChild;if(st!=null){ve=st;continue}}const rt=ve.nextSibling;if(rt!=null){Le++,ve=rt;continue}const it=ve.parentNode;if(it!=null){const st=it.nextSibling;if(st==null)break;Me++,Le=0,ve=st}}return le.columns=Le+1,le.rows=Me+1,le}function V(Oe,ie,le){const ve=new Set(le?le.getNodes():[]);z(ie,(Le,Me)=>{const je=Le.elem;ve.has(Me)?(Le.highlighted=!0,Z(Oe,Le)):(Le.highlighted=!1,oe(Oe,Le),je.getAttribute("style")||je.removeAttribute("style"))})}function z(Oe,ie){const{cells:le}=Oe;for(let ve=0;ve<le.length;ve++){const Le=le[ve];if(Le)for(let Me=0;Me<Le.length;Me++){const je=Le[Me];if(!je)continue;const rt=e.$getNearestNodeFromDOMNode(je.elem);rt!==null&&ie(je,rt,{x:Me,y:ve})}}}function q(Oe,ie){ie.disableHighlightStyle(),z(ie.grid,le=>{le.highlighted=!0,Z(Oe,le)})}function Te(Oe,ie){ie.enableHighlightStyle(),z(ie.grid,le=>{const ve=le.elem;le.highlighted=!1,oe(Oe,le),ve.getAttribute("style")||ve.removeAttribute("style")})}const Se=(Oe,ie,le,ve,Le)=>{const Me=Le==="forward";switch(Le){case"backward":case"forward":return le!==(Me?Oe.grid.columns-1:0)?K(ie.getCellNodeFromCordsOrThrow(le+(Me?1:-1),ve,Oe.grid),Me):ve!==(Me?Oe.grid.rows-1:0)?K(ie.getCellNodeFromCordsOrThrow(Me?0:Oe.grid.columns-1,ve+(Me?1:-1),Oe.grid),Me):Me?ie.selectNext():ie.selectPrevious(),!0;case"up":return ve!==0?K(ie.getCellNodeFromCordsOrThrow(le,ve-1,Oe.grid),!1):ie.selectPrevious(),!0;case"down":return ve!==Oe.grid.rows-1?K(ie.getCellNodeFromCordsOrThrow(le,ve+1,Oe.grid),!0):ie.selectNext(),!0;default:return!1}},Ee=(Oe,ie,le,ve,Le)=>{const Me=Le==="forward";switch(Le){case"backward":case"forward":return le!==(Me?Oe.grid.columns-1:0)&&Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le+(Me?1:-1),ve,Oe.grid)),!0;case"up":return ve!==0?(Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le,ve-1,Oe.grid)),!0):!1;case"down":return ve!==Oe.grid.rows-1?(Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le,ve+1,Oe.grid)),!0):!1;default:return!1}};function de(Oe,ie){if(e.$isRangeSelection(Oe)||r(Oe)){const le=ie.isParentOf(Oe.anchor.getNode()),ve=ie.isParentOf(Oe.focus.getNode());return le&&ve}return!1}function K(Oe,ie){ie?Oe.selectStart():Oe.selectEnd()}const O="172,206,247";function Z(Oe,ie){const le=ie.elem,ve=e.$getNearestNodeFromDOMNode(le);if(!S(ve))throw Error("Expected to find LexicalNode from Table Cell DOMNode");ve.getBackgroundColor()===null?le.style.setProperty("background-color",`rgb(${O})`):le.style.setProperty("background-image",`linear-gradient(to right, rgba(${O},0.85), rgba(${O},0.85))`),le.style.setProperty("caret-color","transparent")}function oe(Oe,ie){const le=ie.elem,ve=e.$getNearestNodeFromDOMNode(le);if(!S(ve))throw Error("Expected to find LexicalNode from Table Cell DOMNode");ve.getBackgroundColor()===null&&le.style.removeProperty("background-color"),le.style.removeProperty("background-image"),le.style.removeProperty("caret-color")}function Y(Oe){const ie=t.$findMatchingParent(Oe,S);return S(ie)?ie:null}function W(Oe){const ie=t.$findMatchingParent(Oe,B);return B(ie)?ie:null}function J(Oe,ie,le,ve,Le){const Me=e.$getSelection();if(!de(Me,ve))return!1;if(e.$isRangeSelection(Me)&&Me.isCollapsed()){if(le==="backward"||le==="forward")return!1;const{anchor:je,focus:rt}=Me,it=t.$findMatchingParent(je.getNode(),S),st=t.$findMatchingParent(rt.getNode(),S);if(!S(it)||!it.is(st))return!1;const vt=W(it);if(vt!==ve&&vt!=null){const xt=Oe.getElementByKey(vt.getKey());if(xt!=null)return Le.grid=ce(xt),J(Oe,ie,le,vt,Le)}const Ge=Oe.getElementByKey(it.__key),ze=Oe.getElementByKey(je.key);if(ze==null||Ge==null)return!1;let tt;if(je.type==="element")tt=ze.getBoundingClientRect();else{const xt=window.getSelection();if(xt===null||xt.rangeCount===0)return!1;tt=xt.getRangeAt(0).getBoundingClientRect()}const yt=le==="up"?it.getFirstChild():it.getLastChild();if(yt==null)return!1;const Nt=Oe.getElementByKey(yt.__key);if(Nt==null)return!1;const Et=Nt.getBoundingClientRect();if(le==="up"?Et.top>tt.top-tt.height:tt.bottom+tt.height>Et.bottom){R(ie);const xt=ve.getCordsFromCellNode(it,Le.grid);if(ie.shiftKey){const mt=ve.getCellFromCordsOrThrow(xt.x,xt.y,Le.grid);Le.setAnchorCellForSelection(mt),Le.setFocusCellForSelection(mt,!0)}else return Se(Le,ve,xt.x,xt.y,le);return!0}}else if(r(Me)){const{anchor:je,focus:rt}=Me,it=t.$findMatchingParent(je.getNode(),S),st=t.$findMatchingParent(rt.getNode(),S),[vt]=Me.getNodes(),Ge=Oe.getElementByKey(vt.getKey());if(!S(it)||!S(st)||!B(vt)||Ge==null)return!1;Le.updateTableGridSelection(Me);const ze=ce(Ge),tt=ve.getCordsFromCellNode(it,ze),yt=ve.getCellFromCordsOrThrow(tt.x,tt.y,ze);if(Le.setAnchorCellForSelection(yt),R(ie),ie.shiftKey){const Nt=ve.getCordsFromCellNode(st,ze);return Ee(Le,vt,Nt.x,Nt.y,le)}else st.selectEnd();return!0}return!1}function R(Oe){Oe.preventDefault(),Oe.stopImmediatePropagation(),Oe.stopPropagation()}class U extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(ie){return new U(ie.__key)}static importDOM(){return{table:ie=>({conversion:fe,priority:1})}}static importJSON(ie){return _e()}constructor(ie){super(ie)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(ie,le){const ve=document.createElement("table");return t.addClassNamesToElement(ve,ie.theme.table),ve}updateDOM(){return!1}exportDOM(ie){return{...super.exportDOM(ie),after:le=>{if(le){const ve=le.cloneNode(),Le=document.createElement("colgroup"),Me=document.createElement("tbody");t.isHTMLElement(le)&&Me.append(...le.children);const je=this.getFirstChildOrThrow();if(!v(je))throw new Error("Expected to find row node.");const rt=je.getChildrenSize();for(let it=0;it<rt;it++){const st=document.createElement("col");Le.append(st)}return ve.replaceChildren(Le,Me),ve}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ie,le){const{rows:ve,cells:Le}=le;for(let Me=0;Me<ve;Me++){const je=Le[Me];if(je==null)continue;const rt=je.findIndex(it=>{if(!it)return;const{elem:st}=it;return e.$getNearestNodeFromDOMNode(st)===ie});if(rt!==-1)return{x:rt,y:Me}}throw new Error("Cell not found in table.")}getCellFromCords(ie,le,ve){const{cells:Le}=ve,Me=Le[le];if(Me==null)return null;const je=Me[ie];return je??null}getCellFromCordsOrThrow(ie,le,ve){const Le=this.getCellFromCords(ie,le,ve);if(!Le)throw new Error("Cell not found at cords.");return Le}getCellNodeFromCords(ie,le,ve){const Le=this.getCellFromCords(ie,le,ve);if(Le==null)return null;const Me=e.$getNearestNodeFromDOMNode(Le.elem);return S(Me)?Me:null}getCellNodeFromCordsOrThrow(ie,le,ve){const Le=this.getCellNodeFromCords(ie,le,ve);if(!Le)throw new Error("Node at cords not TableCellNode.");return Le}canSelectBefore(){return!0}canIndent(){return!1}}function X(Oe,ie){const le=Oe.getElementByKey(ie.getKey());if(le==null)throw new Error("Table Element Not Found");return ce(le)}function fe(Oe){return{node:_e()}}function _e(){return e.$applyNodeReplacement(new U)}function B(Oe){return Oe instanceof U}function A(Oe,ie,le=!0){const ve=_e();for(let Le=0;Le<Oe;Le++){const Me=m();for(let je=0;je<ie;je++){let rt=p.NO_STATUS;typeof le=="object"?(Le===0&&le.rows&&(rt|=p.ROW),je===0&&le.columns&&(rt|=p.COLUMN)):le&&(Le===0&&(rt|=p.ROW),je===0&&(rt|=p.COLUMN));const it=E(rt),st=e.$createParagraphNode();st.append(e.$createTextNode()),it.append(st),Me.append(it)}ve.append(Me)}return ve}function F(Oe){const ie=t.$findMatchingParent(Oe,le=>S(le));return S(ie)?ie:null}function se(Oe){const ie=t.$findMatchingParent(Oe,le=>v(le));if(v(ie))return ie;throw new Error("Expected table cell to be inside of table row.")}function ye(Oe){const ie=t.$findMatchingParent(Oe,le=>B(le));if(B(ie))return ie;throw new Error("Expected table cell to be inside of table.")}function De(Oe){const ie=se(Oe);return ye(ie).getChildren().findIndex(ve=>ve.is(ie))}function ee(Oe){return se(Oe).getChildren().findIndex(le=>le.is(Oe))}function ne(Oe,ie){const le=ye(Oe),{x:ve,y:Le}=le.getCordsFromCellNode(Oe,ie);return{above:le.getCellNodeFromCords(ve,Le-1,ie),below:le.getCellNodeFromCords(ve,Le+1,ie),left:le.getCellNodeFromCords(ve-1,Le,ie),right:le.getCellNodeFromCords(ve+1,Le,ie)}}function ue(Oe,ie){const le=Oe.getChildren();if(ie>=le.length||ie<0)throw new Error("Expected table cell to be inside of table row.");return le[ie].remove(),Oe}function be(Oe,ie,le=!0,ve,Le){const Me=Oe.getChildren();if(ie>=Me.length||ie<0)throw new Error("Table row target index out of range");const je=Me[ie];if(v(je))for(let rt=0;rt<ve;rt++){const it=je.getChildren(),st=it.length,vt=m();for(let Ge=0;Ge<st;Ge++){const ze=it[Ge];if(!S(ze))throw Error("Expected table cell");const{above:tt,below:yt}=ne(ze,Le);let Nt=p.NO_STATUS;const Et=tt&&tt.getWidth()||yt&&yt.getWidth()||void 0;(tt&&tt.hasHeaderState(p.COLUMN)||yt&&yt.hasHeaderState(p.COLUMN))&&(Nt|=p.COLUMN);const gt=E(Nt,1,Et);gt.append(e.$createParagraphNode()),vt.append(gt)}le?je.insertAfter(vt):je.insertBefore(vt)}else throw new Error("Row before insertion index does not exist.");return Oe}function Ne(Oe=!0){const ie=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ie))throw Error("Expected a INTERNAL_PointSelection");const le=ie.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(le),[Me,je]=e.DEPRECATED_$computeGridMap(Le,ve,ve),rt=Me[0].length,{startRow:it}=je;if(Oe){const st=it+ve.__rowSpan-1,vt=Me[st],Ge=m();for(let tt=0;tt<rt;tt++){const{cell:yt,startRow:Nt}=vt[tt];Nt+yt.__rowSpan-1<=st?Ge.append(E(p.NO_STATUS).append(e.$createParagraphNode())):yt.setRowSpan(yt.__rowSpan+1)}const ze=Le.getChildAtIndex(st);if(!e.DEPRECATED_$isGridRowNode(ze))throw Error("focusEndRow is not a GridRowNode");ze.insertAfter(Ge)}else{const st=Me[it],vt=m();for(let ze=0;ze<rt;ze++){const{cell:tt,startRow:yt}=st[ze];yt===it?vt.append(E(p.NO_STATUS).append(e.$createParagraphNode())):tt.setRowSpan(tt.__rowSpan+1)}const Ge=Le.getChildAtIndex(it);if(!e.DEPRECATED_$isGridRowNode(Ge))throw Error("focusEndRow is not a GridRowNode");Ge.insertBefore(vt)}}function Re(Oe,ie,le=!0,ve,Le){const Me=Oe.getChildren(),je=[];for(let rt=0;rt<Me.length;rt++){const it=Me[rt];if(v(it))for(let st=0;st<ve;st++){const vt=it.getChildren();if(ie>=vt.length||ie<0)throw new Error("Table column target index out of range");const Ge=vt[ie];if(!S(Ge))throw Error("Expected table cell");const{left:ze,right:tt}=ne(Ge,Le);let yt=p.NO_STATUS;(ze&&ze.hasHeaderState(p.ROW)||tt&&tt.hasHeaderState(p.ROW))&&(yt|=p.ROW);const Nt=E(yt);Nt.append(e.$createParagraphNode()),je.push({newTableCell:Nt,targetCell:Ge})}}return je.forEach(({newTableCell:rt,targetCell:it})=>{le?it.insertAfter(rt):it.insertBefore(rt)}),Oe}function ke(Oe=!0){const ie=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ie))throw Error("Expected a PointSeleciton");const le=ie.anchor.getNode(),ve=ie.focus.getNode(),[Le]=e.DEPRECATED_$getNodeTriplet(le),[Me,,je]=e.DEPRECATED_$getNodeTriplet(ve),[rt,it,st]=e.DEPRECATED_$computeGridMap(je,Me,Le),vt=rt.length,Ge=Oe?Math.max(it.startColumn,st.startColumn):Math.min(it.startColumn,st.startColumn),ze=Oe?Ge+Me.__colSpan-1:Ge-1,tt=je.getFirstChild();if(!e.DEPRECATED_$isGridRowNode(tt))throw Error("Expected firstTable child to be a row");let yt=null;function Nt(){const gt=E(p.NO_STATUS).append(e.$createParagraphNode());return yt===null&&(yt=gt),gt}let Et=tt;e:for(let gt=0;gt<vt;gt++){if(gt!==0){const tn=Et.getNextSibling();if(!e.DEPRECATED_$isGridRowNode(tn))throw Error("Expected row nextSibling to be a row");Et=tn}const xt=rt[gt];if(ze<0){At(Et,Nt());continue}const{cell:mt,startColumn:$t,startRow:Kt}=xt[ze];if($t+mt.__colSpan-1<=ze){let tn=mt,It=Kt,jt=ze;for(;It!==gt&&tn.__rowSpan>1;)if(jt-=mt.__colSpan,jt>=0){const{cell:bt,startRow:nn}=xt[jt];tn=bt,It=nn}else{Et.append(Nt());continue e}tn.insertAfter(Nt())}else mt.setColSpan(mt.__colSpan+1)}yt!==null&&ut(yt)}function Fe(Oe,ie){const le=Oe.getChildren();for(let ve=0;ve<le.length;ve++){const Le=le[ve];if(v(Le)){const Me=Le.getChildren();if(ie>=Me.length||ie<0)throw new Error("Table column target index out of range");Me[ie].remove()}}return Oe}function qe(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),le=Oe.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(ie),[Me]=e.DEPRECATED_$getNodeTriplet(le),[je,rt,it]=e.DEPRECATED_$computeGridMap(Le,ve,Me),{startRow:st}=rt,{startRow:vt}=it,Ge=vt+Me.__rowSpan-1;if(je.length===Ge-st+1){Le.remove();return}const ze=je[0].length,tt=je[Ge+1],yt=Le.getChildAtIndex(Ge+1);for(let Nt=Ge;Nt>=st;Nt--){for(let gt=ze-1;gt>=0;gt--){const{cell:xt,startRow:mt,startColumn:$t}=je[Nt][gt];if($t===gt&&(Nt===st&&mt<st&&xt.setRowSpan(xt.__rowSpan-(mt-st)),mt>=st&&mt+xt.__rowSpan-1>Ge)){if(xt.setRowSpan(xt.__rowSpan-(Ge-mt+1)),yt===null)throw Error("Expected nextRowNode not to be null");if(gt===0)At(yt,xt);else{const{cell:Kt}=tt[gt-1];Kt.insertAfter(xt)}}}const Et=Le.getChildAtIndex(Nt);if(!e.DEPRECATED_$isGridRowNode(Et))throw Error(`Expected GridNode childAtIndex(${String(Nt)}) to be RowNode`);Et.remove()}if(tt!==void 0){const{cell:Nt}=tt[0];ut(Nt)}else{const Nt=je[st-1],{cell:Et}=Nt[0];ut(Et)}}function Be(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),le=Oe.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(ie),[Me]=e.DEPRECATED_$getNodeTriplet(le),[je,rt,it]=e.DEPRECATED_$computeGridMap(Le,ve,Me),{startColumn:st}=rt,{startRow:vt,startColumn:Ge}=it,ze=Math.min(st,Ge),tt=Math.max(st+ve.__colSpan-1,Ge+Me.__colSpan-1),yt=tt-ze+1;if(je[0].length===tt-ze+1){Le.selectPrevious(),Le.remove();return}const Et=je.length;for(let mt=0;mt<Et;mt++)for(let $t=ze;$t<=tt;$t++){const{cell:Kt,startColumn:tn}=je[mt][$t];if(tn<ze){if($t===ze){const It=ze-tn;Kt.setColSpan(Kt.__colSpan-Math.min(yt,Kt.__colSpan-It))}}else if(tn+Kt.__colSpan-1>tt){if($t===tt){const It=tt-tn+1;Kt.setColSpan(Kt.__colSpan-It)}}else Kt.remove()}const gt=je[vt],xt=gt[Ge+Me.__colSpan];if(xt!==void 0){const{cell:mt}=xt;ut(mt)}else{const mt=gt[Ge-1],{cell:$t}=mt;ut($t)}}function ut(Oe){const ie=Oe.getFirstDescendant();ie==null?Oe.selectStart():ie.getParentOrThrow().selectStart()}function At(Oe,ie){const le=Oe.getFirstChild();le!==null?le.insertBefore(ie):Oe.append(ie)}function Ut(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),[le,ve,Le]=e.DEPRECATED_$getNodeTriplet(ie),Me=le.__colSpan,je=le.__rowSpan;if(Me>1){for(let rt=1;rt<Me;rt++)le.insertAfter(E(p.NO_STATUS));le.setColSpan(1)}if(je>1){const[rt,it]=e.DEPRECATED_$computeGridMap(Le,le,le),{startColumn:st,startRow:vt}=it;let Ge;for(let ze=1;ze<je;ze++){const tt=vt+ze,yt=rt[tt];if(Ge=(Ge||ve).getNextSibling(),!e.DEPRECATED_$isGridRowNode(Ge))throw Error("Expected row next sibling to be a row");let Nt=null;for(let Et=0;Et<st;Et++){const gt=yt[Et],xt=gt.cell;gt.startRow===tt&&(Nt=xt),xt.__colSpan>1&&(Et+=xt.__colSpan-1)}if(Nt===null)for(let Et=0;Et<Me;Et++)At(Ge,E(p.NO_STATUS));else for(let Et=0;Et<Me;Et++)Nt.insertAfter(E(p.NO_STATUS))}le.setRowSpan(1)}}const en=e.createCommand("INSERT_TABLE_COMMAND");return Zt.$createGridSelection=l,Zt.$createTableCellNode=E,Zt.$createTableNode=_e,Zt.$createTableNodeWithDimensions=A,Zt.$createTableRowNode=m,Zt.$deleteTableColumn=Fe,Zt.$deleteTableColumn__EXPERIMENTAL=Be,Zt.$deleteTableRow__EXPERIMENTAL=qe,Zt.$getElementGridForTableNode=X,Zt.$getTableCellNodeFromLexicalNode=F,Zt.$getTableColumnIndexFromTableCellNode=ee,Zt.$getTableNodeFromLexicalNodeOrThrow=ye,Zt.$getTableRowIndexFromTableCellNode=De,Zt.$getTableRowNodeFromTableCellNodeOrThrow=se,Zt.$insertTableColumn=Re,Zt.$insertTableColumn__EXPERIMENTAL=ke,Zt.$insertTableRow=be,Zt.$insertTableRow__EXPERIMENTAL=Ne,Zt.$isGridSelection=r,Zt.$isTableCellNode=S,Zt.$isTableNode=B,Zt.$isTableRowNode=v,Zt.$removeTableRowAtIndex=ue,Zt.$unmergeCell=Ut,Zt.INSERT_TABLE_COMMAND=en,Zt.TableCellHeaderStates=p,Zt.TableCellNode=_,Zt.TableNode=U,Zt.TableRowNode=w,Zt.TableSelection=I,Zt.applyTableHandlers=H,Zt.getCellFromTarget=te,Zt.getTableSelectionFromTableElement=re,Zt}var Jt={},xh;function LC(){if(xh)return Jt;xh=1;var e=Yt(),t=pn();function n(B){let A=new URLSearchParams;A.append("code",B);for(let F=1;F<arguments.length;F++)A.append("v",arguments[F]);throw Error(`Minified Lexical error #${B}; visit https://lexical.dev/docs/error?${A} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class r extends e.INTERNAL_PointSelection{constructor(A,F,se){super(F,se),this.gridKey=A}getCachedNodes(){return this._cachedNodes}setCachedNodes(A){this._cachedNodes=A}is(A){return l(A)?this.gridKey===A.gridKey&&this.anchor.is(A.anchor)&&this.focus.is(A.focus):!1}set(A,F,se){this.dirty=!0,this.gridKey=A,this.anchor.key=F,this.focus.key=se,this._cachedNodes=null}clone(){return new r(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(A){let F=this.focus.getNode();if(!e.$isElementNode(F))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(F.select(0,F.getChildrenSize())).insertNodes(A)}getShape(){var A=e.$getNodeByKey(this.anchor.key);if(e.DEPRECATED_$isGridCellNode(A)||n(103),A=e.DEPRECATED_$getGridCellNodeRect(A),A===null)throw Error("getCellRect: expected to find AnchorNode");var F=e.$getNodeByKey(this.focus.key);e.DEPRECATED_$isGridCellNode(F)||n(104);let se=e.DEPRECATED_$getGridCellNodeRect(F);if(se===null)throw Error("getCellRect: expected to find focusCellNode");F=Math.min(A.columnIndex,se.columnIndex);let ye=Math.max(A.columnIndex,se.columnIndex),De=Math.min(A.rowIndex,se.rowIndex);return A=Math.max(A.rowIndex,se.rowIndex),{fromX:Math.min(F,ye),fromY:Math.min(De,A),toX:Math.max(F,ye),toY:Math.max(De,A)}}getNodes(){function A(ut){let{cell:At,startColumn:Ut,startRow:en}=ut;be=Math.min(be,Ut),Ne=Math.min(Ne,en),Re=Math.max(Re,Ut+At.__colSpan-1),ke=Math.max(ke,en+At.__rowSpan-1)}var F=this._cachedNodes;if(F!==null)return F;var se=this.anchor.getNode();F=this.focus.getNode();var ye=t.$findMatchingParent(se,e.DEPRECATED_$isGridCellNode);se=t.$findMatchingParent(F,e.DEPRECATED_$isGridCellNode),e.DEPRECATED_$isGridCellNode(ye)||n(103),e.DEPRECATED_$isGridCellNode(se)||n(104),F=ye.getParent(),e.DEPRECATED_$isGridRowNode(F)||n(105),F=F.getParent(),e.DEPRECATED_$isGridNode(F)||n(106);var De=se.getParents()[1];if(De!==F){if(F.isParentOf(se)){if(F=De.getParent(),F==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,se.getKey(),F.getKey())}else{if(F=F.getParent(),F==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,F.getKey(),se.getKey())}return this.getNodes()}let[ee,ne,ue]=e.DEPRECATED_$computeGridMap(F,ye,se),be=Math.min(ne.startColumn,ue.startColumn),Ne=Math.min(ne.startRow,ue.startRow),Re=Math.max(ne.startColumn+ne.cell.__colSpan-1,ue.startColumn+ue.cell.__colSpan-1),ke=Math.max(ne.startRow+ne.cell.__rowSpan-1,ue.startRow+ue.cell.__rowSpan-1);se=be,ye=Ne,De=be;for(var Fe=Ne;be<se||Ne<ye||Re>De||ke>Fe;){if(be<se){var qe=Fe-ye;--se;for(var Be=0;Be<=qe;Be++)A(ee[ye+Be][se])}if(Ne<ye)for(qe=De-se,--ye,Be=0;Be<=qe;Be++)A(ee[ye][se+Be]);if(Re>De)for(qe=Fe-ye,De+=1,Be=0;Be<=qe;Be++)A(ee[ye+Be][De]);if(ke>Fe)for(qe=De-se,Fe+=1,Be=0;Be<=qe;Be++)A(ee[Fe][se+Be])}for(F=[F],se=null,ye=Ne;ye<=ke;ye++)for(De=be;De<=Re;De++)({cell:Fe}=ee[ye][De]),qe=Fe.getParent(),e.DEPRECATED_$isGridRowNode(qe)||n(107),qe!==se&&F.push(qe),F.push(Fe,...f(Fe)),se=qe;return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=F),F}getTextContent(){let A=this.getNodes(),F="";for(let se=0;se<A.length;se++)F+=A[se].getTextContent();return F}}function l(B){return B instanceof r}function d(){let B=e.$createPoint("root",0,"element"),A=e.$createPoint("root",0,"element");return new r("root",B,A)}function f(B){let A=[],F=[B];for(;0<F.length;){let se=F.pop();se===void 0&&n(112),e.$isElementNode(se)&&F.unshift(...se.getChildren()),se!==B&&A.push(se)}return A}let p=/^(\d+(?:\.\d+)?)px$/,_={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class T extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(A){let F=new T(A.__headerState,A.__colSpan,A.__width,A.__key);return F.__rowSpan=A.__rowSpan,F.__backgroundColor=A.__backgroundColor,F}static importDOM(){return{td:()=>({conversion:E,priority:0}),th:()=>({conversion:E,priority:0})}}static importJSON(A){let F=A.rowSpan||1,se=S(A.headerState,A.colSpan||1,A.width||void 0);return se.__rowSpan=F,se.__backgroundColor=A.backgroundColor||null,se}constructor(A=_.NO_STATUS,F=1,se,ye){super(F,ye),this.__headerState=A,this.__width=se,this.__backgroundColor=null}createDOM(A){let F=document.createElement(this.getTag());return this.__width&&(F.style.width=`${this.__width}px`),1<this.__colSpan&&(F.colSpan=this.__colSpan),1<this.__rowSpan&&(F.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(F.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(F,A.theme.tableCell,this.hasHeader()&&A.theme.tableCellHeader),F}exportDOM(A){if({element:A}=super.exportDOM(A),A){var F=this.getParentOrThrow().getChildrenSize();A.style.border="1px solid black",1<this.__colSpan&&(A.colSpan=this.__colSpan),1<this.__rowSpan&&(A.rowSpan=this.__rowSpan),A.style.width=`${this.getWidth()||Math.max(90,700/F)}px`,A.style.verticalAlign="top",A.style.textAlign="start",F=this.getBackgroundColor(),F!==null?A.style.backgroundColor=F:this.hasHeader()&&(A.style.backgroundColor="#f2f3f5")}return{element:A}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(A){return this.getWritable().__headerState=A,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(A){return this.getWritable().__width=A,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(A){this.getWritable().__backgroundColor=A}toggleHeaderStyle(A){let F=this.getWritable();return F.__headerState=(F.__headerState&A)===A?F.__headerState-A:F.__headerState+A,F}hasHeaderState(A){return(this.getHeaderStyles()&A)===A}hasHeader(){return this.getLatest().__headerState!==_.NO_STATUS}updateDOM(A){return A.__headerState!==this.__headerState||A.__width!==this.__width||A.__colSpan!==this.__colSpan||A.__rowSpan!==this.__rowSpan||A.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function E(B){var A=B.nodeName.toLowerCase();let F;return p.test(B.style.width)&&(F=parseFloat(B.style.width)),A=S(A==="th"?_.ROW:_.NO_STATUS,B.colSpan,F),A.__rowSpan=B.rowSpan,B=B.style.backgroundColor,B!==""&&(A.__backgroundColor=B),{forChild:(se,ye)=>w(ye)&&!e.$isElementNode(se)?(ye=e.$createParagraphNode(),e.$isLineBreakNode(se)&&se.getTextContent()===`
|
|
80
|
-
`?null:(ye.append(se),ye)):se,node:A}}function S(B,A=1,F){return e.$applyNodeReplacement(new T(B,A,F))}function w(B){return B instanceof T}class M extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(A){return new M(A.__height,A.__key)}static importDOM(){return{tr:()=>({conversion:m,priority:0})}}static importJSON(A){return v(A.height)}constructor(A,F){super(F),this.__height=A}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(A){let F=document.createElement("tr");return this.__height&&(F.style.height=`${this.__height}px`),t.addClassNamesToElement(F,A.theme.tableRow),F}isShadowRoot(){return!0}setHeight(A){return this.getWritable().__height=A,this.__height}getHeight(){return this.getLatest().__height}updateDOM(A){return A.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function m(B){let A;return p.test(B.style.height)&&(A=parseFloat(B.style.height)),{node:v(A)}}function v(B){return e.$applyNodeReplacement(new M(B))}function k(B){return B instanceof M}let G=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class I{constructor(A,F){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=F,this.editor=A,this.grid={cells:[],columns:0,rows:0},this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(A=>A())}trackTableGrid(){let A=new MutationObserver(F=>{this.editor.update(()=>{var se=!1;for(let ye=0;ye<F.length;ye++){const De=F[ye].target.nodeName;if(De==="TABLE"||De==="TR"){se=!0;break}}if(se){if(se=this.editor.getElementByKey(this.tableNodeKey),!se)throw Error("Expected to find TableElement in DOM");this.grid=H(se)}})});this.editor.update(()=>{let F=this.editor.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");this.grid=H(F),A.observe(F,{childList:!0,subtree:!0})})}clearHighlight(){let A=this.editor;this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),A.update(()=>{var F=e.$getNodeByKey(this.tableNodeKey);if(!W(F))throw Error("Expected TableNode.");if(F=A.getElementByKey(this.tableNodeKey),!F)throw Error("Expected to find TableElement in DOM");F=H(F),j(A,F,null),e.$setSelection(null),A.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let A=this.editor;A.update(()=>{let F=A.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(F,A._config.theme.tableSelection),F.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let A=this.editor;A.update(()=>{let F=A.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");t.addClassNamesToElement(F,A._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(A){if(A!=null&&A.gridKey===this.tableNodeKey){let F=this.editor;this.gridSelection=A,this.isHighlightingCells=!0,this.disableHighlightStyle(),j(F,this.grid,this.gridSelection)}else A==null?this.clearHighlight():(this.tableNodeKey=A.gridKey,this.updateTableGridSelection(A))}setFocusCellForSelection(A,F=!1){let se=this.editor;se.update(()=>{var ye=e.$getNodeByKey(this.tableNodeKey);if(!W(ye))throw Error("Expected TableNode.");if(!se.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ye=A.x;let De=A.y;if(this.focusCell=A,this.anchorCell!==null){let ee=G?(se._window||window).getSelection():null;ee&&ee.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ye||this.anchorY!==De||F))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ye===this.focusX&&De===this.focusY)return;this.focusX=ye,this.focusY=De,this.isHighlightingCells&&(ye=e.$getNearestNodeFromDOMNode(A.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&w(ye)&&(ye=ye.getKey(),this.gridSelection=this.gridSelection.clone()||d(),this.focusCellNodeKey=ye,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),se.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),j(se,this.grid,this.gridSelection)))})}setAnchorCellForSelection(A){this.isHighlightingCells=!1,this.anchorCell=A,this.anchorX=A.x,this.anchorY=A.y,this.editor.update(()=>{var F=e.$getNearestNodeFromDOMNode(A.elem);w(F)&&(F=F.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():d(),this.anchorCellNodeKey=F)})}formatCells(A){this.editor.update(()=>{let F=e.$getSelection();l(F)||n(11);let se=e.$createRangeSelection(),ye=se.anchor,De=se.focus;F.getNodes().forEach(ee=>{w(ee)&&ee.getTextContentSize()!==0&&(ye.set(ee.getKey(),0,"element"),De.set(ee.getKey(),ee.getChildrenSize(),"element"),se.formatText(A))}),e.$setSelection(F),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let A=this.editor;A.update(()=>{let F=e.$getNodeByKey(this.tableNodeKey);if(!W(F))throw Error("Expected TableNode.");var se=e.$getSelection();l(se)||n(11),se=se.getNodes().filter(w),se.length===this.grid.columns*this.grid.rows?(F.selectPrevious(),F.remove(),e.$getRoot().selectStart()):(se.forEach(ye=>{if(e.$isElementNode(ye)){let De=e.$createParagraphNode(),ee=e.$createTextNode();De.append(ee),ye.append(De),ye.getChildren().forEach(ne=>{ne!==De&&ne.remove()})}}),j(A,this.grid,null),e.$setSelection(null),A.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function P(B){for(;B!=null;){let A=B.nodeName;if(A==="TD"||A==="TH"){if(B=B._cell,B===void 0)break;return B}B=B.parentNode}return null}function H(B){let A=[],F={cells:A,columns:0,rows:0};var se=B.firstChild;let ye=B=0;for(A.length=0;se!=null;){var De=se.nodeName;if(De==="TD"||De==="TH"){De=se,De={elem:De,hasBackgroundColor:De.style.backgroundColor!=="",highlighted:!1,x:B,y:ye},se._cell=De;let ee=A[ye];ee===void 0&&(ee=A[ye]=[]),ee[B]=De}else if(De=se.firstChild,De!=null){se=De;continue}if(De=se.nextSibling,De!=null)B++,se=De;else if(De=se.parentNode,De!=null){if(se=De.nextSibling,se==null)break;ye++,B=0}}return F.columns=B+1,F.rows=ye+1,F}function j(B,A,F){let se=new Set(F?F.getNodes():[]);re(A,(ye,De)=>{let ee=ye.elem;se.has(De)?(ye.highlighted=!0,Te(B,ye)):(ye.highlighted=!1,Se(B,ye),ee.getAttribute("style")||ee.removeAttribute("style"))})}function re(B,A){({cells:B}=B);for(let F=0;F<B.length;F++){let se=B[F];if(se)for(let ye=0;ye<se.length;ye++){let De=se[ye];if(!De)continue;let ee=e.$getNearestNodeFromDOMNode(De.elem);ee!==null&&A(De,ee,{x:ye,y:F})}}}function te(B,A){A.disableHighlightStyle(),re(A.grid,F=>{F.highlighted=!0,Te(B,F)})}function ce(B,A){A.enableHighlightStyle(),re(A.grid,F=>{let se=F.elem;F.highlighted=!1,Se(B,F),se.getAttribute("style")||se.removeAttribute("style")})}let V=(B,A,F,se,ye)=>{const De=ye==="forward";switch(ye){case"backward":case"forward":return F!==(De?B.grid.columns-1:0)?(B=A.getCellNodeFromCordsOrThrow(F+(De?1:-1),se,B.grid),De?B.selectStart():B.selectEnd()):se!==(De?B.grid.rows-1:0)?(B=A.getCellNodeFromCordsOrThrow(De?0:B.grid.columns-1,se+(De?1:-1),B.grid),De?B.selectStart():B.selectEnd()):De?A.selectNext():A.selectPrevious(),!0;case"up":return se!==0?A.getCellNodeFromCordsOrThrow(F,se-1,B.grid).selectEnd():A.selectPrevious(),!0;case"down":return se!==B.grid.rows-1?A.getCellNodeFromCordsOrThrow(F,se+1,B.grid).selectStart():A.selectNext(),!0;default:return!1}},z=(B,A,F,se,ye)=>{const De=ye==="forward";switch(ye){case"backward":case"forward":return F!==(De?B.grid.columns-1:0)&&B.setFocusCellForSelection(A.getCellFromCordsOrThrow(F+(De?1:-1),se,B.grid)),!0;case"up":return se!==0?(B.setFocusCellForSelection(A.getCellFromCordsOrThrow(F,se-1,B.grid)),!0):!1;case"down":return se!==B.grid.rows-1?(B.setFocusCellForSelection(A.getCellFromCordsOrThrow(F,se+1,B.grid)),!0):!1;default:return!1}};function q(B,A){if(e.$isRangeSelection(B)||l(B)){let F=A.isParentOf(B.anchor.getNode());return B=A.isParentOf(B.focus.getNode()),F&&B}return!1}function Te(B,A){B=A.elem,A=e.$getNearestNodeFromDOMNode(B),w(A)||n(131),A.getBackgroundColor()===null?B.style.setProperty("background-color","rgb(172,206,247)"):B.style.setProperty("background-image","linear-gradient(to right, rgba(172,206,247,0.85), rgba(172,206,247,0.85))"),B.style.setProperty("caret-color","transparent")}function Se(B,A){B=A.elem,A=e.$getNearestNodeFromDOMNode(B),w(A)||n(131),A.getBackgroundColor()===null&&B.style.removeProperty("background-color"),B.style.removeProperty("background-image"),B.style.removeProperty("caret-color")}function Ee(B){return B=t.$findMatchingParent(B,w),w(B)?B:null}function de(B){return B=t.$findMatchingParent(B,W),W(B)?B:null}function K(B,A,F,se,ye){let De=e.$getSelection();if(!q(De,se))return!1;if(e.$isRangeSelection(De)&&De.isCollapsed()){if(F==="backward"||F==="forward")return!1;let{anchor:be,focus:Ne}=De;var ee=t.$findMatchingParent(be.getNode(),w),ne=t.$findMatchingParent(Ne.getNode(),w);if(!w(ee)||!ee.is(ne))return!1;if(ne=de(ee),ne!==se&&ne!=null){var ue=B.getElementByKey(ne.getKey());if(ue!=null)return ye.grid=H(ue),K(B,A,F,ne,ye)}if(ne=B.getElementByKey(ee.__key),ue=B.getElementByKey(be.key),ue==null||ne==null)return!1;if(be.type==="element")ne=ue.getBoundingClientRect();else{if(ne=window.getSelection(),ne===null||ne.rangeCount===0)return!1;ne=ne.getRangeAt(0).getBoundingClientRect()}if(ue=F==="up"?ee.getFirstChild():ee.getLastChild(),ue==null||(B=B.getElementByKey(ue.__key),B==null))return!1;if(B=B.getBoundingClientRect(),F==="up"?B.top>ne.top-ne.height:ne.bottom+ne.height>B.bottom){if(O(A),B=se.getCordsFromCellNode(ee,ye.grid),A.shiftKey)F=se.getCellFromCordsOrThrow(B.x,B.y,ye.grid),ye.setAnchorCellForSelection(F),ye.setFocusCellForSelection(F,!0);else return V(ye,se,B.x,B.y,F);return!0}}else if(l(De)){let{anchor:be,focus:Ne}=De;return ue=t.$findMatchingParent(be.getNode(),w),ne=t.$findMatchingParent(Ne.getNode(),w),[ee]=De.getNodes(),B=B.getElementByKey(ee.getKey()),!w(ue)||!w(ne)||!W(ee)||B==null?!1:(ye.updateTableGridSelection(De),B=H(B),ue=se.getCordsFromCellNode(ue,B),ue=se.getCellFromCordsOrThrow(ue.x,ue.y,B),ye.setAnchorCellForSelection(ue),O(A),A.shiftKey?(A=se.getCordsFromCellNode(ne,B),z(ye,ee,A.x,A.y,F)):(ne.selectEnd(),!0))}return!1}function O(B){B.preventDefault(),B.stopImmediatePropagation(),B.stopPropagation()}class Z extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(A){return new Z(A.__key)}static importDOM(){return{table:()=>({conversion:oe,priority:1})}}static importJSON(){return Y()}constructor(A){super(A)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(A){let F=document.createElement("table");return t.addClassNamesToElement(F,A.theme.table),F}updateDOM(){return!1}exportDOM(A){return{...super.exportDOM(A),after:F=>{if(F){let se=F.cloneNode(),ye=document.createElement("colgroup"),De=document.createElement("tbody");if(t.isHTMLElement(F)&&De.append(...F.children),F=this.getFirstChildOrThrow(),!k(F))throw Error("Expected to find row node.");F=F.getChildrenSize();for(let ee=0;ee<F;ee++){let ne=document.createElement("col");ye.append(ne)}return se.replaceChildren(ye,De),se}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(A,F){let{rows:se,cells:ye}=F;for(F=0;F<se;F++){var De=ye[F];if(De!=null&&(De=De.findIndex(ee=>{if(ee)return{elem:ee}=ee,e.$getNearestNodeFromDOMNode(ee)===A}),De!==-1))return{x:De,y:F}}throw Error("Cell not found in table.")}getCellFromCords(A,F,se){return{cells:se}=se,F=se[F],F==null?null:(A=F[A],A??null)}getCellFromCordsOrThrow(A,F,se){if(A=this.getCellFromCords(A,F,se),!A)throw Error("Cell not found at cords.");return A}getCellNodeFromCords(A,F,se){return A=this.getCellFromCords(A,F,se),A==null?null:(A=e.$getNearestNodeFromDOMNode(A.elem),w(A)?A:null)}getCellNodeFromCordsOrThrow(A,F,se){if(A=this.getCellNodeFromCords(A,F,se),!A)throw Error("Node at cords not TableCellNode.");return A}canSelectBefore(){return!0}canIndent(){return!1}}function oe(){return{node:Y()}}function Y(){return e.$applyNodeReplacement(new Z)}function W(B){return B instanceof Z}function J(B){if(B=t.$findMatchingParent(B,A=>k(A)),k(B))return B;throw Error("Expected table cell to be inside of table row.")}function R(B){if(B=t.$findMatchingParent(B,A=>W(A)),W(B))return B;throw Error("Expected table cell to be inside of table.")}function U(B,A){let F=R(B),{x:se,y:ye}=F.getCordsFromCellNode(B,A);return{above:F.getCellNodeFromCords(se,ye-1,A),below:F.getCellNodeFromCords(se,ye+1,A),left:F.getCellNodeFromCords(se-1,ye,A),right:F.getCellNodeFromCords(se+1,ye,A)}}function X(B){let A=B.getFirstDescendant();A==null?B.selectStart():A.getParentOrThrow().selectStart()}function fe(B,A){let F=B.getFirstChild();F!==null?F.insertBefore(A):B.append(A)}let _e=e.createCommand("INSERT_TABLE_COMMAND");return Jt.$createGridSelection=d,Jt.$createTableCellNode=S,Jt.$createTableNode=Y,Jt.$createTableNodeWithDimensions=function(B,A,F=!0){let se=Y();for(let De=0;De<B;De++){let ee=v();for(let ne=0;ne<A;ne++){var ye=_.NO_STATUS;typeof F=="object"?(De===0&&F.rows&&(ye|=_.ROW),ne===0&&F.columns&&(ye|=_.COLUMN)):F&&(De===0&&(ye|=_.ROW),ne===0&&(ye|=_.COLUMN)),ye=S(ye);let ue=e.$createParagraphNode();ue.append(e.$createTextNode()),ye.append(ue),ee.append(ye)}se.append(ee)}return se},Jt.$createTableRowNode=v,Jt.$deleteTableColumn=function(B,A){let F=B.getChildren();for(let ye=0;ye<F.length;ye++){var se=F[ye];if(k(se)){if(se=se.getChildren(),A>=se.length||0>A)throw Error("Table column target index out of range");se[A].remove()}}return B},Jt.$deleteTableColumn__EXPERIMENTAL=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");var A=B.anchor.getNode();B=B.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(A);[A]=e.DEPRECATED_$getNodeTriplet(B);let[ye,De,ee]=e.DEPRECATED_$computeGridMap(se,F,A);var{startColumn:ne}=De;let{startRow:ue,startColumn:be}=ee;B=Math.min(ne,be),ne=Math.max(ne+F.__colSpan-1,be+A.__colSpan-1);let Ne=ne-B+1;if(ye[0].length===ne-B+1)se.selectPrevious(),se.remove();else{var Re=ye.length;for(let ke=0;ke<Re;ke++)for(let Fe=B;Fe<=ne;Fe++){let{cell:qe,startColumn:Be}=ye[ke][Fe];Be<B?Fe===B&&qe.setColSpan(qe.__colSpan-Math.min(Ne,qe.__colSpan-(B-Be))):Be+qe.__colSpan-1>ne?Fe===ne&&qe.setColSpan(qe.__colSpan-(ne-Be+1)):qe.remove()}B=ye[ue],A=B[be+A.__colSpan],A!==void 0?({cell:A}=A,X(A)):({cell:A}=B[be-1],X(A))}},Jt.$deleteTableRow__EXPERIMENTAL=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");var A=B.anchor.getNode();B=B.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(A);[B]=e.DEPRECATED_$getNodeTriplet(B);let[ye,De,ee]=e.DEPRECATED_$computeGridMap(se,F,B);({startRow:A}=De);var{startRow:ne}=ee;if(B=ne+B.__rowSpan-1,ye.length===B-A+1)se.remove();else{ne=ye[0].length;var ue=ye[B+1],be=se.getChildAtIndex(B+1);for(let Re=B;Re>=A;Re--){for(var Ne=ne-1;0<=Ne;Ne--){let{cell:ke,startRow:Fe,startColumn:qe}=ye[Re][Ne];if(qe===Ne&&(Re===A&&Fe<A&&ke.setRowSpan(ke.__rowSpan-(Fe-A)),Fe>=A&&Fe+ke.__rowSpan-1>B))if(ke.setRowSpan(ke.__rowSpan-(B-Fe+1)),be===null&&n(122),Ne===0)fe(be,ke);else{let{cell:Be}=ue[Ne-1];Be.insertAfter(ke)}}Ne=se.getChildAtIndex(Re),e.DEPRECATED_$isGridRowNode(Ne)||n(123,String(Re)),Ne.remove()}ue!==void 0?({cell:A}=ue[0],X(A)):({cell:A}=ye[A-1][0],X(A))}},Jt.$getElementGridForTableNode=function(B,A){if(B=B.getElementByKey(A.getKey()),B==null)throw Error("Table Element Not Found");return H(B)},Jt.$getTableCellNodeFromLexicalNode=function(B){return B=t.$findMatchingParent(B,A=>w(A)),w(B)?B:null},Jt.$getTableColumnIndexFromTableCellNode=function(B){return J(B).getChildren().findIndex(A=>A.is(B))},Jt.$getTableNodeFromLexicalNodeOrThrow=R,Jt.$getTableRowIndexFromTableCellNode=function(B){let A=J(B);return R(A).getChildren().findIndex(F=>F.is(A))},Jt.$getTableRowNodeFromTableCellNodeOrThrow=J,Jt.$insertTableColumn=function(B,A,F=!0,se,ye){let De=B.getChildren(),ee=[];for(let be=0;be<De.length;be++){let Ne=De[be];if(k(Ne))for(let Re=0;Re<se;Re++){var ne=Ne.getChildren();if(A>=ne.length||0>A)throw Error("Table column target index out of range");ne=ne[A],w(ne)||n(12);let{left:ke,right:Fe}=U(ne,ye);var ue=_.NO_STATUS;(ke&&ke.hasHeaderState(_.ROW)||Fe&&Fe.hasHeaderState(_.ROW))&&(ue|=_.ROW),ue=S(ue),ue.append(e.$createParagraphNode()),ee.push({newTableCell:ue,targetCell:ne})}}return ee.forEach(({newTableCell:be,targetCell:Ne})=>{F?Ne.insertAfter(be):Ne.insertBefore(be)}),B},Jt.$insertTableColumn__EXPERIMENTAL=function(B=!0){function A(){let Re=S(_.NO_STATUS).append(e.$createParagraphNode());return be===null&&(be=Re),Re}var F=e.$getSelection();if(!e.$INTERNAL_isPointSelection(F))throw Error("Expected a PointSeleciton");var se=F.anchor.getNode();F=F.focus.getNode(),[se]=e.DEPRECATED_$getNodeTriplet(se);let[ye,,De]=e.DEPRECATED_$getNodeTriplet(F),[ee,ne,ue]=e.DEPRECATED_$computeGridMap(De,ye,se);se=ee.length,F=B?Math.max(ne.startColumn,ue.startColumn):Math.min(ne.startColumn,ue.startColumn),B=B?F+ye.__colSpan-1:F-1,F=De.getFirstChild(),e.DEPRECATED_$isGridRowNode(F)||n(120);let be=null;var Ne=F;e:for(F=0;F<se;F++){F!==0&&(Ne=Ne.getNextSibling(),e.DEPRECATED_$isGridRowNode(Ne)||n(121));let Re=ee[F];if(0>B){fe(Ne,A());continue}let{cell:ke,startColumn:Fe,startRow:qe}=Re[B];if(Fe+ke.__colSpan-1<=B){let Be=ke,ut=qe,At=B;for(;ut!==F&&1<Be.__rowSpan;)if(At-=ke.__colSpan,0<=At){let{cell:Ut,startRow:en}=Re[At];Be=Ut,ut=en}else{Ne.append(A());continue e}Be.insertAfter(A())}else ke.setColSpan(ke.__colSpan+1)}be!==null&&X(be)},Jt.$insertTableRow=function(B,A,F=!0,se,ye){var De=B.getChildren();if(A>=De.length||0>A)throw Error("Table row target index out of range");if(A=De[A],k(A))for(De=0;De<se;De++){let ne=A.getChildren(),ue=ne.length,be=v();for(let Ne=0;Ne<ue;Ne++){var ee=ne[Ne];w(ee)||n(12);let{above:Re,below:ke}=U(ee,ye);ee=_.NO_STATUS;let Fe=Re&&Re.getWidth()||ke&&ke.getWidth()||void 0;(Re&&Re.hasHeaderState(_.COLUMN)||ke&&ke.hasHeaderState(_.COLUMN))&&(ee|=_.COLUMN),ee=S(ee,1,Fe),ee.append(e.$createParagraphNode()),be.append(ee)}F?A.insertAfter(be):A.insertBefore(be)}else throw Error("Row before insertion index does not exist.");return B},Jt.$insertTableRow__EXPERIMENTAL=function(B=!0){var A=e.$getSelection();if(!e.$INTERNAL_isPointSelection(A))throw Error("Expected a INTERNAL_PointSelection");A=A.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(A),[ye,De]=e.DEPRECATED_$computeGridMap(se,F,F);A=ye[0].length;var{startRow:ee}=De;if(B){B=ee+F.__rowSpan-1;var ne=ye[B];ee=v();for(var ue=0;ue<A;ue++){let{cell:be,startRow:Ne}=ne[ue];Ne+be.__rowSpan-1<=B?ee.append(S(_.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}A=se.getChildAtIndex(B),e.DEPRECATED_$isGridRowNode(A)||n(119),A.insertAfter(ee)}else{for(ne=ye[ee],B=v(),ue=0;ue<A;ue++){let{cell:be,startRow:Ne}=ne[ue];Ne===ee?B.append(S(_.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}A=se.getChildAtIndex(ee),e.DEPRECATED_$isGridRowNode(A)||n(119),A.insertBefore(B)}},Jt.$isGridSelection=l,Jt.$isTableCellNode=w,Jt.$isTableNode=W,Jt.$isTableRowNode=k,Jt.$removeTableRowAtIndex=function(B,A){let F=B.getChildren();if(A>=F.length||0>A)throw Error("Expected table cell to be inside of table row.");return F[A].remove(),B},Jt.$unmergeCell=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");B=B.anchor.getNode();let[A,F,se]=e.DEPRECATED_$getNodeTriplet(B);B=A.__colSpan;let ye=A.__rowSpan;if(1<B){for(var De=1;De<B;De++)A.insertAfter(S(_.NO_STATUS));A.setColSpan(1)}if(1<ye){let[ue,be]=e.DEPRECATED_$computeGridMap(se,A,A),{startColumn:Ne,startRow:Re}=be,ke;for(De=1;De<ye;De++){var ee=Re+De;let Fe=ue[ee];ke=(ke||F).getNextSibling(),e.DEPRECATED_$isGridRowNode(ke)||n(125);var ne=null;for(let qe=0;qe<Ne;qe++){let Be=Fe[qe],ut=Be.cell;Be.startRow===ee&&(ne=ut),1<ut.__colSpan&&(qe+=ut.__colSpan-1)}if(ne===null)for(ne=0;ne<B;ne++)fe(ke,S(_.NO_STATUS));else for(ee=0;ee<B;ee++)ne.insertAfter(S(_.NO_STATUS))}A.setRowSpan(1)}},Jt.INSERT_TABLE_COMMAND=_e,Jt.TableCellHeaderStates=_,Jt.TableCellNode=T,Jt.TableNode=Z,Jt.TableRowNode=M,Jt.TableSelection=I,Jt.applyTableHandlers=function(B,A,F,se){function ye(Ne){return Ne=B.getCordsFromCellNode(Ne,ee.grid),B.getCellFromCordsOrThrow(Ne.x,Ne.y,ee.grid)}let De=F.getRootElement();if(De===null)throw Error("No root element.");let ee=new I(F,B.getKey()),ne=F._window||window;A.__lexicalTableSelection=ee,A.addEventListener("mousedown",Ne=>{setTimeout(()=>{if(Ne.button===0&&ne){var Re=P(Ne.target);Re!==null&&(O(Ne),ee.setAnchorCellForSelection(Re));var ke=()=>{ne.removeEventListener("mouseup",ke),ne.removeEventListener("mousemove",Fe)},Fe=qe=>{const Be=P(qe.target);Be===null||ee.anchorX===Be.x&&ee.anchorY===Be.y||(qe.preventDefault(),ee.setFocusCellForSelection(Be))};ne.addEventListener("mouseup",ke),ne.addEventListener("mousemove",Fe)}},0)});let ue=Ne=>{Ne.button===0&&F.update(()=>{const Re=e.$getSelection(),ke=Ne.target;l(Re)&&Re.gridKey===ee.tableNodeKey&&De.contains(ke)&&ee.clearHighlight()})};ne.addEventListener("mousedown",ue),ee.listenersToRemove.add(()=>ne.removeEventListener("mousedown",ue)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ne=>K(F,Ne,"down",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_UP_COMMAND,Ne=>K(F,Ne,"up",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ne=>K(F,Ne,"backward",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ne=>K(F,Ne,"forward",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ESCAPE_COMMAND,Ne=>{var Re=e.$getSelection();return l(Re)&&(Re=t.$findMatchingParent(Re.focus.getNode(),w),w(Re))?(O(Ne),Re.selectEnd(),!0):!1},e.COMMAND_PRIORITY_HIGH));let be=Ne=>()=>{var Re=e.$getSelection();if(!q(Re,B))return!1;if(l(Re))return ee.clearText(),!0;if(e.$isRangeSelection(Re)){const qe=t.$findMatchingParent(Re.anchor.getNode(),Be=>w(Be));if(!w(qe))return!1;var ke=Re.anchor.getNode(),Fe=Re.focus.getNode();if(ke=B.isParentOf(ke),Fe=B.isParentOf(Fe),ke&&!Fe||Fe&&!ke)return ee.clearText(),!0;if(ke=(Fe=t.$findMatchingParent(Re.anchor.getNode(),Be=>e.$isElementNode(Be)))&&t.$findMatchingParent(Fe,Be=>e.$isElementNode(Be)&&w(Be.getParent())),!e.$isElementNode(ke)||!e.$isElementNode(Fe))return!1;if(Ne===e.DELETE_LINE_COMMAND&&ke.getPreviousSibling()===null)return!0;if((Ne===e.DELETE_CHARACTER_COMMAND||Ne===e.DELETE_WORD_COMMAND)&&Re.isCollapsed()&&Re.anchor.offset===0&&Fe!==ke){Re=Fe.getChildren();const Be=e.$createParagraphNode();return Re.forEach(ut=>Be.append(ut)),Fe.replace(Be),Fe.getWritable().__parent=qe.getKey(),!0}}return!1};return[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ne=>{ee.listenersToRemove.add(F.registerCommand(Ne,be(Ne),e.COMMAND_PRIORITY_CRITICAL))}),A=Ne=>{const Re=e.$getSelection();return q(Re,B)?l(Re)?(Ne.preventDefault(),Ne.stopPropagation(),ee.clearText(),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),ke=>w(ke)),w(Ne)),!1):!1},ee.listenersToRemove.add(F.registerCommand(e.KEY_BACKSPACE_COMMAND,A,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.KEY_DELETE_COMMAND,A,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.FORMAT_TEXT_COMMAND,Ne=>{let Re=e.$getSelection();return q(Re,B)?l(Re)?(ee.formatCells(Ne),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),ke=>w(ke)),w(Ne)),!1):!1},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var Ne=e.$getSelection();return q(Ne,B)&&(l(Ne)?ee.clearHighlight():e.$isRangeSelection(Ne)&&(Ne=t.$findMatchingParent(Ne.anchor.getNode(),Re=>w(Re)),w(Ne))),!1},e.COMMAND_PRIORITY_CRITICAL)),se&&ee.listenersToRemove.add(F.registerCommand(e.KEY_TAB_COMMAND,Ne=>{var Re=e.$getSelection();return!e.$isRangeSelection(Re)||!Re.isCollapsed()||!q(Re,B)||(Re=Ee(Re.anchor.getNode()),Re===null)?!1:(O(Ne),Re=B.getCordsFromCellNode(Re,ee.grid),V(ee,B,Re.x,Re.y,Ne.shiftKey?"backward":"forward"),!0)},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.FOCUS_COMMAND,()=>B.isSelected(),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ne=>{let{nodes:Re,selection:ke}=Ne;Ne=e.$INTERNAL_isPointSelection(ke);var Fe=e.$isRangeSelection(ke);if(Ne=Fe&&t.$findMatchingParent(ke.anchor.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le))!==null&&t.$findMatchingParent(ke.focus.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le))!==null||Ne&&!Fe,Re.length!==1||!e.DEPRECATED_$isGridNode(Re[0])||!Ne)return!1;var{anchor:qe}=ke,Be=Re[0];Ne=Be.getChildren(),Fe=Be.getFirstChildOrThrow().getChildrenSize(),Be=Be.getChildrenSize();var ut=t.$findMatchingParent(qe.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le)),At=(qe=ut&&t.$findMatchingParent(ut,Le=>e.DEPRECATED_$isGridRowNode(Le)))&&t.$findMatchingParent(qe,Le=>e.DEPRECATED_$isGridNode(Le));if(!e.DEPRECATED_$isGridCellNode(ut)||!e.DEPRECATED_$isGridRowNode(qe)||!e.DEPRECATED_$isGridNode(At))return!1;var Ut=qe.getIndexWithinParent(),en=Math.min(At.getChildrenSize()-1,Ut+Be-1);Be=ut.getIndexWithinParent(),ut=Math.min(qe.getChildrenSize()-1,Be+Fe-1),Fe=Math.min(Be,ut),qe=Math.min(Ut,en),Be=Math.max(Be,ut),Ut=Math.max(Ut,en),At=At.getChildren(),en=0;let Oe,ie;for(ut=qe;ut<=Ut;ut++){var le=At[ut];if(!e.DEPRECATED_$isGridRowNode(le))return!1;var ve=Ne[en];if(!e.DEPRECATED_$isGridRowNode(ve))return!1;le=le.getChildren(),ve=ve.getChildren();let Le=0;for(let Me=Fe;Me<=Be;Me++){let je=le[Me];if(!e.DEPRECATED_$isGridCellNode(je))return!1;let rt=ve[Le];if(!e.DEPRECATED_$isGridCellNode(rt))return!1;ut===qe&&Me===Fe?Oe=je.getKey():ut===Ut&&Me===Be&&(ie=je.getKey());let it=je.getChildren();rt.getChildren().forEach(st=>{e.$isTextNode(st)&&e.$createParagraphNode().append(st),je.append(st)}),it.forEach(st=>st.remove()),Le++}en++}return Oe&&ie&&(Ne=d(),Ne.set(Re[0].getKey(),Oe,ie),e.$setSelection(Ne)),!0},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{let Ne=e.$getSelection(),Re=e.$getPreviousSelection();if(e.$isRangeSelection(Ne)){let{anchor:ut,focus:At}=Ne;var ke=ut.getNode(),Fe=At.getNode();ke=Ee(ke),Fe=Ee(Fe);var qe=ke&&B.is(de(ke)),Be=Fe&&B.is(de(Fe));let Ut=qe!==Be;Be=qe&&Be,qe=Ne.isBackward(),Ut?(ke=Ne.clone(),ke.focus.set(B.getKey(),qe?0:B.getChildrenSize(),"element"),e.$setSelection(ke),te(F,ee)):Be&&!ke.is(Fe)&&(ee.setAnchorCellForSelection(ye(ke)),ee.setFocusCellForSelection(ye(Fe),!0))}return Ne&&!Ne.is(Re)&&(l(Ne)||l(Re))&&ee.gridSelection&&!ee.gridSelection.is(Re)?(l(Ne)&&Ne.gridKey===ee.tableNodeKey?ee.updateTableGridSelection(Ne):!l(Ne)&&l(Re)&&Re.gridKey===ee.tableNodeKey&&ee.updateTableGridSelection(null),!1):(ee.hasHijackedSelectionStyles&&!B.isSelected()?ce(F,ee):!ee.hasHijackedSelectionStyles&&B.isSelected()&&te(F,ee),!1)},e.COMMAND_PRIORITY_CRITICAL)),ee},Jt.getCellFromTarget=P,Jt.getTableSelectionFromTableElement=function(B){return B.__lexicalTableSelection},Jt}var vu,vh;function Nd(){return vh||(vh=1,vu=process.env.NODE_ENV==="development"?bC():LC()),vu}var Sh;function IC(){if(Sh)return xu;Sh=1;var e=qn(),t=Nd(),n=pn(),r=Yt(),l=nt;function d({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){const[T]=e.useLexicalComposerContext();return l.useEffect(()=>{if(!T.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode]))throw Error("TablePlugin: TableNode, TableCellNode or TableRowNode not registered on editor");return T.registerCommand(t.INSERT_TABLE_COMMAND,({columns:E,rows:S,includeHeaders:w})=>{const M=t.$createTableNodeWithDimensions(Number(S),Number(E),w);n.$insertNodeToNearestRoot(M);const m=M.getFirstDescendant();return r.$isTextNode(m)&&m.select(),!0},r.COMMAND_PRIORITY_EDITOR)},[T]),l.useEffect(()=>{const E=new Map,S=M=>{const m=M.getKey(),v=T.getElementByKey(m);if(v&&!E.has(m)){const k=t.applyTableHandlers(M,v,T,_);E.set(m,k)}};T.getEditorState().read(()=>{const M=r.$nodesOfType(t.TableNode);for(const m of M)t.$isTableNode(m)&&S(m)});const w=T.registerMutationListener(t.TableNode,M=>{for(const[m,v]of M)if(v==="created")T.getEditorState().read(()=>{const k=r.$getNodeByKey(m);t.$isTableNode(k)&&S(k)});else if(v==="destroyed"){const k=E.get(m);k!==void 0&&(k.removeListeners(),E.delete(m))}});return()=>{w();for(const[,M]of E)M.removeListeners()}},[T,_]),l.useEffect(()=>{if(!f)return T.registerNodeTransform(t.TableCellNode,E=>{if(E.getColSpan()>1||E.getRowSpan()>1){const[,,S]=r.DEPRECATED_$getNodeTriplet(E),[w]=r.DEPRECATED_$computeGridMap(S,E,E),M=w.length,m=w[0].length;let v=S.getFirstChild();if(!r.DEPRECATED_$isGridRowNode(v))throw Error("Expected TableNode first child to be a RowNode");const k=[];for(let G=0;G<M;G++){if(G!==0&&(v=v.getNextSibling(),!r.DEPRECATED_$isGridRowNode(v)))throw Error("Expected TableNode first child to be a RowNode");let I=null;for(let P=0;P<m;P++){const H=w[G][P],j=H.cell;if(H.startRow===G&&H.startColumn===P)I=j,k.push(j);else if(j.getColSpan()>1||j.getRowSpan()>1){if(!t.$isTableCellNode(j))throw Error("Expected TableNode cell to be a TableCellNode");const re=t.$createTableCellNode(j.__headerState);I!==null?I.insertAfter(re):n.$insertFirst(v,re)}}}for(const G of k)G.setColSpan(1),G.setRowSpan(1)}})},[T,f]),l.useEffect(()=>{if(!p)return T.registerNodeTransform(t.TableCellNode,E=>{E.getBackgroundColor()!==null&&E.setBackgroundColor(null)})},[T,p,f]),null}return xu.TablePlugin=d,xu}var Su={},wh;function kC(){if(wh)return Su;wh=1;var e=qn(),t=Nd(),n=pn(),r=Yt(),l=nt;function d(f){let p=new URLSearchParams;p.append("code",f);for(let _=1;_<arguments.length;_++)p.append("v",arguments[_]);throw Error(`Minified Lexical error #${f}; visit https://lexical.dev/docs/error?${p} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}return Su.TablePlugin=function({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){let[T]=e.useLexicalComposerContext();return l.useEffect(()=>(T.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode])||d(10),T.registerCommand(t.INSERT_TABLE_COMMAND,({columns:E,rows:S,includeHeaders:w})=>(E=t.$createTableNodeWithDimensions(Number(S),Number(E),w),n.$insertNodeToNearestRoot(E),E=E.getFirstDescendant(),r.$isTextNode(E)&&E.select(),!0),r.COMMAND_PRIORITY_EDITOR)),[T]),l.useEffect(()=>{let E=new Map,S=M=>{const m=M.getKey(),v=T.getElementByKey(m);v&&!E.has(m)&&(M=t.applyTableHandlers(M,v,T,_),E.set(m,M))};T.getEditorState().read(()=>{let M=r.$nodesOfType(t.TableNode);for(let m of M)t.$isTableNode(m)&&S(m)});let w=T.registerMutationListener(t.TableNode,M=>{for(const[m,v]of M)v==="created"?T.getEditorState().read(()=>{const k=r.$getNodeByKey(m);t.$isTableNode(k)&&S(k)}):v==="destroyed"&&(M=E.get(m),M!==void 0&&(M.removeListeners(),E.delete(m)))});return()=>{w();for(let[,M]of E)M.removeListeners()}},[T,_]),l.useEffect(()=>{if(!f)return T.registerNodeTransform(t.TableCellNode,E=>{if(1<E.getColSpan()||1<E.getRowSpan()){var[,,S]=r.DEPRECATED_$getNodeTriplet(E);[E]=r.DEPRECATED_$computeGridMap(S,E,E);let M=E.length,m=E[0].length;if(S=S.getFirstChild(),!r.DEPRECATED_$isGridRowNode(S))throw Error("Expected TableNode first child to be a RowNode");let v=[];for(let k=0;k<M;k++){if(k!==0&&(S=S.getNextSibling(),!r.DEPRECATED_$isGridRowNode(S)))throw Error("Expected TableNode first child to be a RowNode");let G=null;for(let I=0;I<m;I++){var w=E[k][I];let P=w.cell;if(w.startRow===k&&w.startColumn===I)G=P,v.push(P);else if(1<P.getColSpan()||1<P.getRowSpan()){if(!t.$isTableCellNode(P))throw Error("Expected TableNode cell to be a TableCellNode");w=t.$createTableCellNode(P.__headerState),G!==null?G.insertAfter(w):n.$insertFirst(S,w)}}}for(let k of v)k.setColSpan(1),k.setRowSpan(1)}})},[T,f]),l.useEffect(()=>{if(!p)return T.registerNodeTransform(t.TableCellNode,E=>{E.getBackgroundColor()!==null&&E.setBackgroundColor(null)})},[T,p,f]),null},Su}const PC=process.env.NODE_ENV==="development"?IC():kC();var $C=PC,Pn={},wu={exports:{}},Oh;function Sp(){return Oh||(Oh=1,function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
76
|
+
`?H.insertParagraph():q===" "?H.insertNodes([r.$createTabNode()]):H.insertText(q)}}else H.insertRawText(ce)}function T(P,H,j){P.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:H,selection:j})||j.insertNodes(H)}function S(P){const H=P.exportJSON(),j=P.constructor;if(H.type!==j.getType())throw Error(`LexicalNode: Node ${j.name} does not implement .exportJSON().`);if(r.$isElementNode(P)){const re=H.children;if(!Array.isArray(re))throw Error(`LexicalNode: Node ${j.name} is an element but .exportJSON() does not have a children array.`)}return H}function w(P,H,j,re=[]){let te=H!=null?j.isSelected(H):!0;const ce=r.$isElementNode(j)&&j.excludeFromCopy("html");let V=j;if(H!==null){let Te=t.$cloneWithProperties(j);Te=r.$isTextNode(Te)&&H!=null?t.$sliceSelectedTextNodeContent(H,Te):Te,V=Te}const z=r.$isElementNode(V)?V.getChildren():[],q=S(V);if(r.$isTextNode(V)){const Te=V.__text;Te.length>0?q.text=Te:te=!1}for(let Te=0;Te<z.length;Te++){const Se=z[Te],Ee=w(P,H,Se,q.children);!te&&r.$isElementNode(j)&&Ee&&j.extractWithChild(Se,H,"clone")&&(te=!0)}if(te&&!ce)re.push(q);else if(Array.isArray(q.children))for(let Te=0;Te<q.children.length;Te++){const Se=q.children[Te];re.push(Se)}return te}function O(P,H){const j=[],te=r.$getRoot().getChildren();for(let ce=0;ce<te.length;ce++){const V=te[ce];w(P,H,V,j)}return{namespace:P._config.namespace,nodes:j}}function m(P){const H=[];for(let j=0;j<P.length;j++){const re=P[j],te=r.$parseSerializedNode(re);r.$isTextNode(te)&&t.$addNodeStyle(te),H.push(te)}return H}const v=50;let I=null;async function G(P,H){if(I!==null)return!1;if(H!==null)return new Promise((z,q)=>{P.update(()=>{z(k(P,H))})});const j=P.getRootElement(),re=P._window==null?window.document:P._window.document,te=d(P._window);if(j===null||te===null)return!1;const ce=re.createElement("span");ce.style.cssText="position: fixed; top: -1000px;",ce.append(re.createTextNode("#")),j.append(ce);const V=new Range;return V.setStart(ce,0),V.setEnd(ce,1),te.removeAllRanges(),te.addRange(V),new Promise((z,q)=>{const Te=P.registerCommand(r.COPY_COMMAND,Se=>(n.objectKlassEquals(Se,ClipboardEvent)&&(Te(),I!==null&&(window.clearTimeout(I),I=null),z(k(P,Se))),!0),r.COMMAND_PRIORITY_CRITICAL);I=window.setTimeout(()=>{Te(),I=null,z(!1)},v),re.execCommand("copy"),ce.remove()})}function k(P,H){const j=d(P._window);if(!j)return!1;const re=j.anchorNode,te=j.focusNode;if(re!==null&&te!==null&&!r.isSelectionWithinEditor(P,re,te))return!1;H.preventDefault();const ce=H.clipboardData,V=r.$getSelection();if(ce===null||V===null)return!1;const z=f(P),q=p(P);let Te="";return V!==null&&(Te=V.getTextContent()),z!==null&&ce.setData("text/html",z),q!==null&&ce.setData("application/x-lexical-editor",q),ce.setData("text/plain",Te),!0}return vi.$generateJSONFromSelectedNodes=O,vi.$generateNodesFromSerializedNodes=m,vi.$getHtmlContent=f,vi.$getLexicalContent=p,vi.$insertDataTransferForPlainText=_,vi.$insertDataTransferForRichText=E,vi.$insertGeneratedNodes=T,vi.copyToClipboard=G,vi}var Si={},sh;function aC(){if(sh)return Si;sh=1;var e=wp(),t=xs(),n=pn(),r=jt();function l(m){let v=new URLSearchParams;v.append("code",m);for(let I=1;I<arguments.length;I++)v.append("v",arguments[I]);throw Error(`Minified Lexical error #${m}; visit https://lexical.dev/docs/error?${v} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function f(m){let v=r.$getSelection();if(v==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(v)&&v.isCollapsed()||v.getNodes().length===0?"":e.$generateHtmlFromNodes(m,v)}function p(m){let v=r.$getSelection();if(v==null)throw Error("Expected valid LexicalSelection");return r.$isRangeSelection(v)&&v.isCollapsed()||v.getNodes().length===0?null:JSON.stringify(T(m,v))}function _(m,v,I){m.dispatchCommand(r.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,{nodes:v,selection:I})||I.insertNodes(v)}function E(m,v,I,G=[]){let k=v!=null?I.isSelected(v):!0,P=r.$isElementNode(I)&&I.excludeFromCopy("html");var H=I;if(v!==null){var j=t.$cloneWithProperties(I);H=j=r.$isTextNode(j)&&v!=null?t.$sliceSelectedTextNodeContent(v,j):j}let re=r.$isElementNode(H)?H.getChildren():[];var te=H;j=te.exportJSON();var ce=te.constructor;for(j.type!==ce.getType()&&l(58,ce.name),r.$isElementNode(te)&&(Array.isArray(j.children)||l(59,ce.name)),r.$isTextNode(H)&&(H=H.__text,0<H.length?j.text=H:k=!1),H=0;H<re.length;H++)te=re[H],ce=E(m,v,te,j.children),!k&&r.$isElementNode(I)&&ce&&I.extractWithChild(te,v,"clone")&&(k=!0);if(k&&!P)G.push(j);else if(Array.isArray(j.children))for(m=0;m<j.children.length;m++)G.push(j.children[m]);return k}function T(m,v){let I=[],G=r.$getRoot().getChildren();for(let k=0;k<G.length;k++)E(m,v,G[k],I);return{namespace:m._config.namespace,nodes:I}}function S(m){let v=[];for(let I=0;I<m.length;I++){let G=r.$parseSerializedNode(m[I]);r.$isTextNode(G)&&t.$addNodeStyle(G),v.push(G)}return v}let w=null;function O(m,v){var I=d?(m._window||window).getSelection():null;if(!I)return!1;var G=I.anchorNode;if(I=I.focusNode,G!==null&&I!==null&&!r.isSelectionWithinEditor(m,G,I)||(v.preventDefault(),v=v.clipboardData,G=r.$getSelection(),v===null||G===null))return!1;I=f(m),m=p(m);let k="";return G!==null&&(k=G.getTextContent()),I!==null&&v.setData("text/html",I),m!==null&&v.setData("application/x-lexical-editor",m),v.setData("text/plain",k),!0}return Si.$generateJSONFromSelectedNodes=T,Si.$generateNodesFromSerializedNodes=S,Si.$getHtmlContent=f,Si.$getLexicalContent=p,Si.$insertDataTransferForPlainText=function(m,v){m=m.getData("text/plain")||m.getData("text/uri-list"),m!=null&&v.insertRawText(m)},Si.$insertDataTransferForRichText=function(m,v,I){var G=m.getData("application/x-lexical-editor");if(G)try{let P=JSON.parse(G);if(P.namespace===I._config.namespace&&Array.isArray(P.nodes)){let H=S(P.nodes);return _(I,H,v)}}catch{}if(G=m.getData("text/html"))try{var k=new DOMParser().parseFromString(G,"text/html");let P=e.$generateNodesFromDOM(I,k);return _(I,P,v)}catch{}if(m=m.getData("text/plain")||m.getData("text/uri-list"),m!=null)if(r.$isRangeSelection(v))for(m=m.split(/(\r?\n|\t)/),m[m.length-1]===""&&m.pop(),I=0;I<m.length;I++)k=m[I],k===`
|
|
77
|
+
`||k===`\r
|
|
78
|
+
`?v.insertParagraph():k===" "?v.insertNodes([r.$createTabNode()]):v.insertText(k);else v.insertRawText(m)},Si.$insertGeneratedNodes=_,Si.copyToClipboard=async function(m,v){if(w!==null)return!1;if(v!==null)return new Promise(H=>{m.update(()=>{H(O(m,v))})});var I=m.getRootElement();let G=m._window==null?window.document:m._window.document,k=d?(m._window||window).getSelection():null;if(I===null||k===null)return!1;let P=G.createElement("span");return P.style.cssText="position: fixed; top: -1000px;",P.append(G.createTextNode("#")),I.append(P),I=new Range,I.setStart(P,0),I.setEnd(P,1),k.removeAllRanges(),k.addRange(I),new Promise(H=>{let j=m.registerCommand(r.COPY_COMMAND,re=>(n.objectKlassEquals(re,ClipboardEvent)&&(j(),w!==null&&(window.clearTimeout(w),w=null),H(O(m,re))),!0),r.COMMAND_PRIORITY_CRITICAL);w=window.setTimeout(()=>{j(),w=null,H(!1)},50),G.execCommand("copy"),P.remove()})},Si}var hu,oh;function Op(){return oh||(oh=1,hu=process.env.NODE_ENV==="development"?lC():aC()),hu}var lh;function cC(){if(lh)return di;lh=1;var e=Op(),t=xs(),n=pn(),r=jt();function l(Se,Ee){if(typeof document.caretRangeFromPoint<"u"){const de=document.caretRangeFromPoint(Se,Ee);return de===null?null:{node:de.startContainer,offset:de.startOffset}}else if(document.caretPositionFromPoint!=="undefined"){const de=document.caretPositionFromPoint(Se,Ee);return de===null?null:{node:de.offsetNode,offset:de.offset}}else return null}const d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",f=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!f?"getTargetRanges"in new window.InputEvent("input"):!1,_=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),E=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!T,w=r.createCommand("DRAG_DROP_PASTE_FILE");class O extends r.ElementNode{static getType(){return"quote"}static clone(Ee){return new O(Ee.__key)}constructor(Ee){super(Ee)}createDOM(Ee){const de=document.createElement("blockquote");return n.addClassNamesToElement(de,Ee.theme.quote),de}updateDOM(Ee,de){return!1}static importDOM(){return{blockquote:Ee=>({conversion:P,priority:0})}}exportDOM(Ee){const{element:de}=super.exportDOM(Ee);if(de&&n.isHTMLElement(de)){this.isEmpty()&&de.append(document.createElement("br"));const K=this.getFormatType();de.style.textAlign=K;const D=this.getDirection();D&&(de.dir=D)}return{element:de}}static importJSON(Ee){const de=m();return de.setFormat(Ee.format),de.setIndent(Ee.indent),de.setDirection(Ee.direction),de}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(Ee,de){const K=r.$createParagraphNode(),D=this.getDirection();return K.setDirection(D),this.insertAfter(K,de),K}collapseAtStart(){const Ee=r.$createParagraphNode();return this.getChildren().forEach(K=>Ee.append(K)),this.replace(Ee),!0}}function m(){return r.$applyNodeReplacement(new O)}function v(Se){return Se instanceof O}class I extends r.ElementNode{static getType(){return"heading"}static clone(Ee){return new I(Ee.__tag,Ee.__key)}constructor(Ee,de){super(de),this.__tag=Ee}getTag(){return this.__tag}createDOM(Ee){const de=this.__tag,K=document.createElement(de),Z=Ee.theme.heading;if(Z!==void 0){const oe=Z[de];n.addClassNamesToElement(K,oe)}return K}updateDOM(Ee,de){return!1}static importDOM(){return{h1:Ee=>({conversion:k,priority:0}),h2:Ee=>({conversion:k,priority:0}),h3:Ee=>({conversion:k,priority:0}),h4:Ee=>({conversion:k,priority:0}),h5:Ee=>({conversion:k,priority:0}),h6:Ee=>({conversion:k,priority:0}),p:Ee=>{const K=Ee.firstChild;return K!==null&&G(K)?{conversion:()=>({node:null}),priority:3}:null},span:Ee=>G(Ee)?{conversion:de=>({node:H("h1")}),priority:3}:null}}exportDOM(Ee){const{element:de}=super.exportDOM(Ee);if(de&&n.isHTMLElement(de)){this.isEmpty()&&de.append(document.createElement("br"));const K=this.getFormatType();de.style.textAlign=K;const D=this.getDirection();D&&(de.dir=D)}return{element:de}}static importJSON(Ee){const de=H(Ee.tag);return de.setFormat(Ee.format),de.setIndent(Ee.indent),de.setDirection(Ee.direction),de}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(Ee,de=!0){const K=Ee?Ee.anchor.offset:0,D=K===this.getTextContentSize()||!Ee?r.$createParagraphNode():H(this.getTag()),Z=this.getDirection();if(D.setDirection(Z),this.insertAfter(D,de),K===0&&!this.isEmpty()&&Ee){const oe=r.$createParagraphNode();oe.select(),this.replace(oe,!0)}return D}collapseAtStart(){const Ee=this.isEmpty()?r.$createParagraphNode():H(this.getTag());return this.getChildren().forEach(K=>Ee.append(K)),this.replace(Ee),!0}extractWithChild(){return!0}}function G(Se){return Se.nodeName.toLowerCase()==="span"?Se.style.fontSize==="26pt":!1}function k(Se){const Ee=Se.nodeName.toLowerCase();let de=null;return(Ee==="h1"||Ee==="h2"||Ee==="h3"||Ee==="h4"||Ee==="h5"||Ee==="h6")&&(de=H(Ee),Se.style!==null&&de.setFormat(Se.style.textAlign)),{node:de}}function P(Se){const Ee=m();return Se.style!==null&&Ee.setFormat(Se.style.textAlign),{node:Ee}}function H(Se){return r.$applyNodeReplacement(new I(Se))}function j(Se){return Se instanceof I}function re(Se,Ee){Se.preventDefault(),Ee.update(()=>{const de=r.$getSelection(),K=Se instanceof InputEvent||Se instanceof KeyboardEvent?null:Se.clipboardData;K!=null&&r.$INTERNAL_isPointSelection(de)&&e.$insertDataTransferForRichText(K,de,Ee)},{tag:"paste"})}async function te(Se,Ee){await e.copyToClipboard(Ee,n.objectKlassEquals(Se,ClipboardEvent)?Se:null),Ee.update(()=>{const de=r.$getSelection();r.$isRangeSelection(de)?de.removeText():r.$isNodeSelection(de)&&de.getNodes().forEach(K=>K.remove())})}function ce(Se){let Ee=null;if(Se instanceof DragEvent?Ee=Se.dataTransfer:Se instanceof ClipboardEvent&&(Ee=Se.clipboardData),Ee===null)return[!1,[],!1];const de=Ee.types,K=de.includes("Files"),D=de.includes("text/html")||de.includes("text/plain");return[K,Array.from(Ee.files),D]}function V(Se){const Ee=r.$getSelection();if(!r.$isRangeSelection(Ee))return!1;const de=new Set,K=Ee.getNodes();for(let D=0;D<K.length;D++){const Z=K[D],oe=Z.getKey();if(de.has(oe))continue;const Y=n.$getNearestBlockElementAncestorOrThrow(Z),W=Y.getKey();Y.canIndent()&&!de.has(W)&&(de.add(W),Se(Y))}return de.size>0}function z(Se){const Ee=r.$getNearestNodeFromDOMNode(Se);return r.$isDecoratorNode(Ee)}function q(Se){const Ee=Se.focus;return Ee.key==="root"&&Ee.offset===r.$getRoot().getChildrenSize()}function Te(Se){return n.mergeRegister(Se.registerCommand(r.CLICK_COMMAND,de=>{const K=r.$getSelection();return r.$isNodeSelection(K)?(K.clear(),!0):!1},0),Se.registerCommand(r.DELETE_CHARACTER_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteCharacter(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DELETE_WORD_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteWord(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DELETE_LINE_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.deleteLine(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,de=>{const K=r.$getSelection();if(typeof de=="string")r.$INTERNAL_isPointSelection(K)&&K.insertText(de);else{if(!r.$INTERNAL_isPointSelection(K))return!1;const D=de.dataTransfer;if(D!=null)e.$insertDataTransferForRichText(D,K,Se);else if(r.$isRangeSelection(K)){const Z=de.data;return Z&&K.insertText(Z),!0}}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(de.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.FORMAT_TEXT_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.formatText(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.FORMAT_ELEMENT_COMMAND,de=>{const K=r.$getSelection();if(!r.$isRangeSelection(K)&&!r.$isNodeSelection(K))return!1;const D=K.getNodes();for(const Z of D){const oe=n.$findMatchingParent(Z,Y=>r.$isElementNode(Y)&&!Y.isInline());oe!==null&&oe.setFormat(de)}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_LINE_BREAK_COMMAND,de=>{const K=r.$getSelection();return r.$isRangeSelection(K)?(K.insertLineBreak(de),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(de.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.INDENT_CONTENT_COMMAND,()=>V(de=>{const K=de.getIndent();de.setIndent(K+1)}),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>V(de=>{const K=de.getIndent();K>0&&de.setIndent(K-1)}),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_UP_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!z(de.target)){const D=K.getNodes();if(D.length>0)return D[0].selectPrevious(),!0}else if(r.$isRangeSelection(K)){const D=r.$getAdjacentNode(K.focus,!0);if(!de.shiftKey&&r.$isDecoratorNode(D)&&!D.isIsolated()&&!D.isInline())return D.selectPrevious(),de.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_DOWN_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const D=K.getNodes();if(D.length>0)return D[0].selectNext(0,0),!0}else if(r.$isRangeSelection(K)){if(q(K))return de.preventDefault(),!0;const D=r.$getAdjacentNode(K.focus,!1);if(!de.shiftKey&&r.$isDecoratorNode(D)&&!D.isIsolated()&&!D.isInline())return D.selectNext(),de.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_LEFT_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)){const D=K.getNodes();if(D.length>0)return de.preventDefault(),D[0].selectPrevious(),!0}if(!r.$isRangeSelection(K))return!1;if(t.$shouldOverrideDefaultCharacterSelection(K,!0)){const D=de.shiftKey;return de.preventDefault(),t.$moveCharacter(K,D,!0),!0}return!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,de=>{const K=r.$getSelection();if(r.$isNodeSelection(K)&&!z(de.target)){const Z=K.getNodes();if(Z.length>0)return de.preventDefault(),Z[0].selectNext(0,0),!0}if(!r.$isRangeSelection(K))return!1;const D=de.shiftKey;return t.$shouldOverrideDefaultCharacterSelection(K,!1)?(de.preventDefault(),t.$moveCharacter(K,D,!1),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_BACKSPACE_COMMAND,de=>{if(z(de.target))return!1;const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;de.preventDefault();const{anchor:D}=K,Z=D.getNode();return K.isCollapsed()&&D.offset===0&&!r.$isRootNode(Z)&&n.$getNearestBlockElementAncestorOrThrow(Z).getIndent()>0?Se.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):Se.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_DELETE_COMMAND,de=>{if(z(de.target))return!1;const K=r.$getSelection();return r.$isRangeSelection(K)?(de.preventDefault(),Se.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ENTER_COMMAND,de=>{const K=r.$getSelection();if(!r.$isRangeSelection(K))return!1;if(de!==null){if((E||_||S)&&p)return!1;if(de.preventDefault(),de.shiftKey)return Se.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return Se.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const de=r.$getSelection();return r.$isRangeSelection(de)?(Se.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DROP_COMMAND,de=>{const[,K]=ce(de);if(K.length>0){const Z=de.clientX,oe=de.clientY,Y=l(Z,oe);if(Y!==null){const{offset:W,node:J}=Y,R=r.$getNearestNodeFromDOMNode(J);if(R!==null){const U=r.$createRangeSelection();if(r.$isTextNode(R))U.anchor.set(R.getKey(),W,"text"),U.focus.set(R.getKey(),W,"text");else{const fe=R.getParentOrThrow().getKey(),_e=R.getIndexWithinParent()+1;U.anchor.set(fe,_e,"element"),U.focus.set(fe,_e,"element")}const X=r.$normalizeSelection__EXPERIMENTAL(U);r.$setSelection(X)}Se.dispatchCommand(w,K)}return de.preventDefault(),!0}const D=r.$getSelection();return!!r.$isRangeSelection(D)},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGSTART_COMMAND,de=>{const[K]=ce(de),D=r.$getSelection();return!(K&&!r.$isRangeSelection(D))},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.DRAGOVER_COMMAND,de=>{const[K]=ce(de),D=r.$getSelection();if(K&&!r.$isRangeSelection(D))return!1;const Z=de.clientX,oe=de.clientY,Y=l(Z,oe);if(Y!==null){const W=r.$getNearestNodeFromDOMNode(Y.node);r.$isDecoratorNode(W)&&de.preventDefault()}return!0},r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.COPY_COMMAND,de=>(e.copyToClipboard(Se,n.objectKlassEquals(de,ClipboardEvent)?de:null),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.CUT_COMMAND,de=>(te(de,Se),!0),r.COMMAND_PRIORITY_EDITOR),Se.registerCommand(r.PASTE_COMMAND,de=>{const[,K,D]=ce(de);if(K.length>0&&!D)return Se.dispatchCommand(w,K),!0;if(r.isSelectionCapturedInDecoratorInput(de.target))return!1;const Z=r.$getSelection();return r.$INTERNAL_isPointSelection(Z)?(re(de,Se),!0):!1},r.COMMAND_PRIORITY_EDITOR))}return di.$createHeadingNode=H,di.$createQuoteNode=m,di.$isHeadingNode=j,di.$isQuoteNode=v,di.DRAG_DROP_PASTE=w,di.HeadingNode=I,di.QuoteNode=O,di.eventFiles=ce,di.registerRichText=Te,di}var fi={},ah;function uC(){if(ah)return fi;ah=1;var e=Op(),t=xs(),n=pn(),r=jt();function l(V,z){return typeof document.caretRangeFromPoint<"u"?(V=document.caretRangeFromPoint(V,z),V===null?null:{node:V.startContainer,offset:V.startOffset}):document.caretPositionFromPoint!=="undefined"?(V=document.caretPositionFromPoint(V,z),V===null?null:{node:V.offsetNode,offset:V.offset}):null}let d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",f=d&&"documentMode"in document?document.documentMode:null,p=d&&"InputEvent"in window&&!f?"getTargetRanges"in new window.InputEvent("input"):!1,_=d&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),E=d&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,T=d&&/^(?=.*Chrome).*/i.test(navigator.userAgent),S=d&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!T,w=r.createCommand("DRAG_DROP_PASTE_FILE");class O extends r.ElementNode{static getType(){return"quote"}static clone(z){return new O(z.__key)}constructor(z){super(z)}createDOM(z){let q=document.createElement("blockquote");return n.addClassNamesToElement(q,z.theme.quote),q}updateDOM(){return!1}static importDOM(){return{blockquote:()=>({conversion:k,priority:0})}}exportDOM(z){if({element:z}=super.exportDOM(z),z&&n.isHTMLElement(z)){this.isEmpty()&&z.append(document.createElement("br"));var q=this.getFormatType();z.style.textAlign=q,(q=this.getDirection())&&(z.dir=q)}return{element:z}}static importJSON(z){let q=m();return q.setFormat(z.format),q.setIndent(z.indent),q.setDirection(z.direction),q}exportJSON(){return{...super.exportJSON(),type:"quote"}}insertNewAfter(z,q){z=r.$createParagraphNode();let Te=this.getDirection();return z.setDirection(Te),this.insertAfter(z,q),z}collapseAtStart(){let z=r.$createParagraphNode();return this.getChildren().forEach(q=>z.append(q)),this.replace(z),!0}}function m(){return r.$applyNodeReplacement(new O)}class v extends r.ElementNode{static getType(){return"heading"}static clone(z){return new v(z.__tag,z.__key)}constructor(z,q){super(q),this.__tag=z}getTag(){return this.__tag}createDOM(z){let q=this.__tag,Te=document.createElement(q);return z=z.theme.heading,z!==void 0&&n.addClassNamesToElement(Te,z[q]),Te}updateDOM(){return!1}static importDOM(){return{h1:()=>({conversion:G,priority:0}),h2:()=>({conversion:G,priority:0}),h3:()=>({conversion:G,priority:0}),h4:()=>({conversion:G,priority:0}),h5:()=>({conversion:G,priority:0}),h6:()=>({conversion:G,priority:0}),p:z=>(z=z.firstChild,z!==null&&I(z)?{conversion:()=>({node:null}),priority:3}:null),span:z=>I(z)?{conversion:()=>({node:P("h1")}),priority:3}:null}}exportDOM(z){if({element:z}=super.exportDOM(z),z&&n.isHTMLElement(z)){this.isEmpty()&&z.append(document.createElement("br"));var q=this.getFormatType();z.style.textAlign=q,(q=this.getDirection())&&(z.dir=q)}return{element:z}}static importJSON(z){let q=P(z.tag);return q.setFormat(z.format),q.setIndent(z.indent),q.setDirection(z.direction),q}exportJSON(){return{...super.exportJSON(),tag:this.getTag(),type:"heading",version:1}}insertNewAfter(z,q=!0){let Te=z?z.anchor.offset:0,Se=Te!==this.getTextContentSize()&&z?P(this.getTag()):r.$createParagraphNode(),Ee=this.getDirection();return Se.setDirection(Ee),this.insertAfter(Se,q),Te===0&&!this.isEmpty()&&z&&(z=r.$createParagraphNode(),z.select(),this.replace(z,!0)),Se}collapseAtStart(){let z=this.isEmpty()?r.$createParagraphNode():P(this.getTag());return this.getChildren().forEach(q=>z.append(q)),this.replace(z),!0}extractWithChild(){return!0}}function I(V){return V.nodeName.toLowerCase()==="span"?V.style.fontSize==="26pt":!1}function G(V){let z=V.nodeName.toLowerCase(),q=null;return(z==="h1"||z==="h2"||z==="h3"||z==="h4"||z==="h5"||z==="h6")&&(q=P(z),V.style!==null&&q.setFormat(V.style.textAlign)),{node:q}}function k(V){let z=m();return V.style!==null&&z.setFormat(V.style.textAlign),{node:z}}function P(V){return r.$applyNodeReplacement(new v(V))}function H(V,z){V.preventDefault(),z.update(()=>{let q=r.$getSelection(),Te=V instanceof InputEvent||V instanceof KeyboardEvent?null:V.clipboardData;Te!=null&&r.$INTERNAL_isPointSelection(q)&&e.$insertDataTransferForRichText(Te,q,z)},{tag:"paste"})}async function j(V,z){await e.copyToClipboard(z,n.objectKlassEquals(V,ClipboardEvent)?V:null),z.update(()=>{let q=r.$getSelection();r.$isRangeSelection(q)?q.removeText():r.$isNodeSelection(q)&&q.getNodes().forEach(Te=>Te.remove())})}function re(V){let z=null;if(V instanceof DragEvent?z=V.dataTransfer:V instanceof ClipboardEvent&&(z=V.clipboardData),z===null)return[!1,[],!1];var q=z.types;return V=q.includes("Files"),q=q.includes("text/html")||q.includes("text/plain"),[V,Array.from(z.files),q]}function te(V){var z=r.$getSelection();if(!r.$isRangeSelection(z))return!1;let q=new Set;z=z.getNodes();for(let Ee=0;Ee<z.length;Ee++){var Te=z[Ee],Se=Te.getKey();q.has(Se)||(Te=n.$getNearestBlockElementAncestorOrThrow(Te),Se=Te.getKey(),Te.canIndent()&&!q.has(Se)&&(q.add(Se),V(Te)))}return 0<q.size}function ce(V){return V=r.$getNearestNodeFromDOMNode(V),r.$isDecoratorNode(V)}return fi.$createHeadingNode=P,fi.$createQuoteNode=m,fi.$isHeadingNode=function(V){return V instanceof v},fi.$isQuoteNode=function(V){return V instanceof O},fi.DRAG_DROP_PASTE=w,fi.HeadingNode=v,fi.QuoteNode=O,fi.eventFiles=re,fi.registerRichText=function(V){return n.mergeRegister(V.registerCommand(r.CLICK_COMMAND,()=>{const z=r.$getSelection();return r.$isNodeSelection(z)?(z.clear(),!0):!1},0),V.registerCommand(r.DELETE_CHARACTER_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteCharacter(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DELETE_WORD_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteWord(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DELETE_LINE_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.deleteLine(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.CONTROLLED_TEXT_INSERTION_COMMAND,z=>{const q=r.$getSelection();if(typeof z=="string")r.$INTERNAL_isPointSelection(q)&&q.insertText(z);else{if(!r.$INTERNAL_isPointSelection(q))return!1;const Te=z.dataTransfer;Te!=null?e.$insertDataTransferForRichText(Te,q,V):r.$isRangeSelection(q)&&(z=z.data)&&q.insertText(z)}return!0},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.REMOVE_TEXT_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.removeText(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.FORMAT_TEXT_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.formatText(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.FORMAT_ELEMENT_COMMAND,z=>{var q=r.$getSelection();if(!r.$isRangeSelection(q)&&!r.$isNodeSelection(q))return!1;q=q.getNodes();for(const Te of q)q=n.$findMatchingParent(Te,Se=>r.$isElementNode(Se)&&!Se.isInline()),q!==null&&q.setFormat(z);return!0},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_LINE_BREAK_COMMAND,z=>{const q=r.$getSelection();return r.$isRangeSelection(q)?(q.insertLineBreak(z),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_PARAGRAPH_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(z.insertParagraph(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INSERT_TAB_COMMAND,()=>(r.$insertNodes([r.$createTabNode()]),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.INDENT_CONTENT_COMMAND,()=>te(z=>{const q=z.getIndent();z.setIndent(q+1)}),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.OUTDENT_CONTENT_COMMAND,()=>te(z=>{const q=z.getIndent();0<q&&z.setIndent(q-1)}),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_UP_COMMAND,z=>{var q=r.$getSelection();if(r.$isNodeSelection(q)&&!ce(z.target)){if(z=q.getNodes(),0<z.length)return z[0].selectPrevious(),!0}else if(r.$isRangeSelection(q)&&(q=r.$getAdjacentNode(q.focus,!0),!z.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline()))return q.selectPrevious(),z.preventDefault(),!0;return!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_DOWN_COMMAND,z=>{var q=r.$getSelection();if(r.$isNodeSelection(q)){if(z=q.getNodes(),0<z.length)return z[0].selectNext(0,0),!0}else if(r.$isRangeSelection(q)){let Te=q.focus;if(Te.key==="root"&&Te.offset===r.$getRoot().getChildrenSize())return z.preventDefault(),!0;if(q=r.$getAdjacentNode(q.focus,!1),!z.shiftKey&&r.$isDecoratorNode(q)&&!q.isIsolated()&&!q.isInline())return q.selectNext(),z.preventDefault(),!0}return!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_LEFT_COMMAND,z=>{const q=r.$getSelection();if(r.$isNodeSelection(q)){var Te=q.getNodes();if(0<Te.length)return z.preventDefault(),Te[0].selectPrevious(),!0}return r.$isRangeSelection(q)&&t.$shouldOverrideDefaultCharacterSelection(q,!0)?(Te=z.shiftKey,z.preventDefault(),t.$moveCharacter(q,Te,!0),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ARROW_RIGHT_COMMAND,z=>{const q=r.$getSelection();if(r.$isNodeSelection(q)&&!ce(z.target)){var Te=q.getNodes();if(0<Te.length)return z.preventDefault(),Te[0].selectNext(0,0),!0}return r.$isRangeSelection(q)?(Te=z.shiftKey,t.$shouldOverrideDefaultCharacterSelection(q,!1)?(z.preventDefault(),t.$moveCharacter(q,Te,!1),!0):!1):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_BACKSPACE_COMMAND,z=>{if(ce(z.target))return!1;const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;z.preventDefault(),{anchor:z}=q;const Te=z.getNode();return q.isCollapsed()&&z.offset===0&&!r.$isRootNode(Te)&&0<n.$getNearestBlockElementAncestorOrThrow(Te).getIndent()?V.dispatchCommand(r.OUTDENT_CONTENT_COMMAND,void 0):V.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_DELETE_COMMAND,z=>{if(ce(z.target))return!1;const q=r.$getSelection();return r.$isRangeSelection(q)?(z.preventDefault(),V.dispatchCommand(r.DELETE_CHARACTER_COMMAND,!1)):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ENTER_COMMAND,z=>{const q=r.$getSelection();if(!r.$isRangeSelection(q))return!1;if(z!==null){if((E||_||S)&&p)return!1;if(z.preventDefault(),z.shiftKey)return V.dispatchCommand(r.INSERT_LINE_BREAK_COMMAND,!1)}return V.dispatchCommand(r.INSERT_PARAGRAPH_COMMAND,void 0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.KEY_ESCAPE_COMMAND,()=>{const z=r.$getSelection();return r.$isRangeSelection(z)?(V.blur(),!0):!1},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DROP_COMMAND,z=>{const[,q]=re(z);if(0<q.length){var Te=l(z.clientX,z.clientY);if(Te!==null){const{offset:Ee,node:de}=Te;var Se=r.$getNearestNodeFromDOMNode(de);if(Se!==null){if(Te=r.$createRangeSelection(),r.$isTextNode(Se))Te.anchor.set(Se.getKey(),Ee,"text"),Te.focus.set(Se.getKey(),Ee,"text");else{const K=Se.getParentOrThrow().getKey();Se=Se.getIndexWithinParent()+1,Te.anchor.set(K,Se,"element"),Te.focus.set(K,Se,"element")}Te=r.$normalizeSelection__EXPERIMENTAL(Te),r.$setSelection(Te)}V.dispatchCommand(w,q)}return z.preventDefault(),!0}return z=r.$getSelection(),!!r.$isRangeSelection(z)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DRAGSTART_COMMAND,z=>{[z]=re(z);const q=r.$getSelection();return!(z&&!r.$isRangeSelection(q))},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.DRAGOVER_COMMAND,z=>{var[q]=re(z);const Te=r.$getSelection();return q&&!r.$isRangeSelection(Te)?!1:(q=l(z.clientX,z.clientY),q!==null&&(q=r.$getNearestNodeFromDOMNode(q.node),r.$isDecoratorNode(q)&&z.preventDefault()),!0)},r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.SELECT_ALL_COMMAND,()=>(r.$selectAll(),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.COPY_COMMAND,z=>(e.copyToClipboard(V,n.objectKlassEquals(z,ClipboardEvent)?z:null),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.CUT_COMMAND,z=>(j(z,V),!0),r.COMMAND_PRIORITY_EDITOR),V.registerCommand(r.PASTE_COMMAND,z=>{const[,q,Te]=re(z);if(0<q.length&&!Te)return V.dispatchCommand(w,q),!0;if(r.isSelectionCapturedInDecoratorInput(z.target))return!1;const Se=r.$getSelection();return r.$INTERNAL_isPointSelection(Se)?(H(z,V),!0):!1},r.COMMAND_PRIORITY_EDITOR))},fi}var gu,ch;function Ed(){return ch||(ch=1,gu=process.env.NODE_ENV==="development"?cC():uC()),gu}var uh;function dC(){if(uh)return nu;uh=1;var e=qn(),t=xp(),n=rt,r=vp(),l=pn(),d=fd,f=Sp(),p=Ed(),T=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function S(G){return G.getEditorState().read(r.$canShowPlaceholderCurry(G.isComposing()))}function w(G){const[k,P]=n.useState(()=>S(G));return T(()=>{function H(){const j=S(G);P(j)}return H(),l.mergeRegister(G.registerUpdateListener(()=>{H()}),G.registerEditableListener(()=>{H()}))},[G]),k}function O(G,k){const[P,H]=n.useState(()=>G.getDecorators());return T(()=>G.registerDecoratorListener(j=>{d.flushSync(()=>{H(j)})}),[G]),n.useEffect(()=>{H(G.getDecorators())},[G]),n.useMemo(()=>{const j=[],re=Object.keys(P);for(let te=0;te<re.length;te++){const ce=re[te],V=n.createElement(k,{onError:q=>G._onError(q)},n.createElement(n.Suspense,{fallback:null},P[ce])),z=G.getElementByKey(ce);z!==null&&j.push(d.createPortal(V,z,ce))}return j},[k,P,G])}function m(G){T(()=>l.mergeRegister(p.registerRichText(G),f.registerDragonSupport(G)),[G])}function v({contentEditable:G,placeholder:k,ErrorBoundary:P}){const[H]=e.useLexicalComposerContext(),j=O(H,P);return m(H),n.createElement(n.Fragment,null,G,n.createElement(I,{content:k}),j)}function I({content:G}){const[k]=e.useLexicalComposerContext(),P=w(k),H=t();return P?typeof G=="function"?G(H):G:null}return nu.RichTextPlugin=v,nu}var pu={},dh;function fC(){if(dh)return pu;dh=1;var e=qn(),t=xp(),n=rt,r=vp(),l=pn(),d=fd,f=Sp(),p=Ed(),_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?n.useLayoutEffect:n.useEffect;function E(m){return m.getEditorState().read(r.$canShowPlaceholderCurry(m.isComposing()))}function T(m){let[v,I]=n.useState(()=>E(m));return _(()=>{function G(){let k=E(m);I(k)}return G(),l.mergeRegister(m.registerUpdateListener(()=>{G()}),m.registerEditableListener(()=>{G()}))},[m]),v}function S(m,v){let[I,G]=n.useState(()=>m.getDecorators());return _(()=>m.registerDecoratorListener(k=>{d.flushSync(()=>{G(k)})}),[m]),n.useEffect(()=>{G(m.getDecorators())},[m]),n.useMemo(()=>{let k=[],P=Object.keys(I);for(let H=0;H<P.length;H++){let j=P[H],re=n.createElement(v,{onError:ce=>m._onError(ce)},n.createElement(n.Suspense,{fallback:null},I[j])),te=m.getElementByKey(j);te!==null&&k.push(d.createPortal(re,te,j))}return k},[v,I,m])}function w(m){_(()=>l.mergeRegister(p.registerRichText(m),f.registerDragonSupport(m)),[m])}function O({content:m}){var[v]=e.useLexicalComposerContext();v=T(v);let I=t();return v?typeof m=="function"?m(I):m:null}return pu.RichTextPlugin=function({contentEditable:m,placeholder:v,ErrorBoundary:I}){let[G]=e.useLexicalComposerContext();return I=S(G,I),w(G),n.createElement(n.Fragment,null,m,n.createElement(O,{content:v}),I)},pu}const hC=process.env.NODE_ENV==="development"?dC():fC();var gC=hC,mu={},fh;function pC(){if(fh)return mu;fh=1;var e=qn(),t=rt;function n(){return n=Object.assign?Object.assign.bind():function(p){for(var _=1;_<arguments.length;_++){var E=arguments[_];for(var T in E)Object.prototype.hasOwnProperty.call(E,T)&&(p[T]=E[T])}return p},n.apply(this,arguments)}var d=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;function f({ariaActiveDescendant:p,ariaAutoComplete:_,ariaControls:E,ariaDescribedBy:T,ariaExpanded:S,ariaLabel:w,ariaLabelledBy:O,ariaMultiline:m,ariaOwns:v,ariaRequired:I,autoCapitalize:G,className:k,id:P,role:H="textbox",spellCheck:j=!0,style:re,tabIndex:te,"data-testid":ce,...V}){const[z]=e.useLexicalComposerContext(),[q,Te]=t.useState(!1),Se=t.useCallback(Ee=>{z.setRootElement(Ee)},[z]);return d(()=>(Te(z.isEditable()),z.registerEditableListener(Ee=>{Te(Ee)})),[z]),t.createElement("div",n({},V,{"aria-activedescendant":q?p:void 0,"aria-autocomplete":q?_:"none","aria-controls":q?E:void 0,"aria-describedby":T,"aria-expanded":q&&H==="combobox"?!!S:void 0,"aria-label":w,"aria-labelledby":O,"aria-multiline":m,"aria-owns":q?v:void 0,"aria-readonly":q?void 0:!0,"aria-required":I,autoCapitalize:G,className:k,contentEditable:q,"data-testid":ce,id:P,ref:Se,role:H,spellCheck:j,style:re,tabIndex:te}))}return mu.ContentEditable=f,mu}var _u={},hh;function mC(){if(hh)return _u;hh=1;var e=qn(),t=rt;function n(){return n=Object.assign?Object.assign.bind():function(l){for(var d=1;d<arguments.length;d++){var f=arguments[d],p;for(p in f)Object.prototype.hasOwnProperty.call(f,p)&&(l[p]=f[p])}return l},n.apply(this,arguments)}var r=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?t.useLayoutEffect:t.useEffect;return _u.ContentEditable=function({ariaActiveDescendant:l,ariaAutoComplete:d,ariaControls:f,ariaDescribedBy:p,ariaExpanded:_,ariaLabel:E,ariaLabelledBy:T,ariaMultiline:S,ariaOwns:w,ariaRequired:O,autoCapitalize:m,className:v,id:I,role:G="textbox",spellCheck:k=!0,style:P,tabIndex:H,"data-testid":j,...re}){let[te]=e.useLexicalComposerContext(),[ce,V]=t.useState(!1),z=t.useCallback(q=>{te.setRootElement(q)},[te]);return r(()=>(V(te.isEditable()),te.registerEditableListener(q=>{V(q)})),[te]),t.createElement("div",n({},re,{"aria-activedescendant":ce?l:void 0,"aria-autocomplete":ce?d:"none","aria-controls":ce?f:void 0,"aria-describedby":p,"aria-expanded":ce&&G==="combobox"?!!_:void 0,"aria-label":E,"aria-labelledby":T,"aria-multiline":S,"aria-owns":ce?w:void 0,"aria-readonly":ce?void 0:!0,"aria-required":O,autoCapitalize:m,className:v,contentEditable:ce,"data-testid":j,id:I,ref:z,role:G,spellCheck:k,style:P,tabIndex:H}))},_u}const _C=process.env.NODE_ENV==="development"?pC():mC();var yC=_C,yu,gh;function NC(){if(gh)return yu;gh=1;var e=rt;function t(p,_){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(T,S){return T.__proto__=S,T},t(p,_)}function n(p,_){p.prototype=Object.create(_.prototype),p.prototype.constructor=p,t(p,_)}var r=function(_,E){return _===void 0&&(_=[]),E===void 0&&(E=[]),_.length!==E.length||_.some(function(T,S){return!Object.is(T,E[S])})},l={error:null},d=function(p){n(_,p);function _(){for(var T,S=arguments.length,w=new Array(S),O=0;O<S;O++)w[O]=arguments[O];return T=p.call.apply(p,[this].concat(w))||this,T.state=l,T.resetErrorBoundary=function(){for(var m,v=arguments.length,I=new Array(v),G=0;G<v;G++)I[G]=arguments[G];T.props.onReset==null||(m=T.props).onReset.apply(m,I),T.reset()},T}_.getDerivedStateFromError=function(S){return{error:S}};var E=_.prototype;return E.reset=function(){this.setState(l)},E.componentDidCatch=function(S,w){var O,m;(O=(m=this.props).onError)==null||O.call(m,S,w)},E.componentDidUpdate=function(S,w){var O=this.state.error,m=this.props.resetKeys;if(O!==null&&w.error!==null&&r(S.resetKeys,m)){var v,I;(v=(I=this.props).onResetKeysChange)==null||v.call(I,S.resetKeys,m),this.reset()}},E.render=function(){var S=this.state.error,w=this.props,O=w.fallbackRender,m=w.FallbackComponent,v=w.fallback;if(S!==null){var I={error:S,resetErrorBoundary:this.resetErrorBoundary};if(e.isValidElement(v))return v;if(typeof O=="function")return O(I);if(m)return e.createElement(m,I);throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},_}(e.Component);function f({children:p,onError:_}){return e.createElement(d,{fallback:e.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:_},p)}return yu=f,yu}var Nu,ph;function CC(){if(ph)return Nu;ph=1;var e=rt;function t(f,p){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(_,E){return _.__proto__=E,_},t(f,p)}function n(f,p){f.prototype=Object.create(p.prototype),f.prototype.constructor=f,t(f,p)}function r(f,p){return f===void 0&&(f=[]),p===void 0&&(p=[]),f.length!==p.length||f.some(function(_,E){return!Object.is(_,p[E])})}var l={error:null},d=function(f){function p(){for(var E,T=arguments.length,S=Array(T),w=0;w<T;w++)S[w]=arguments[w];return E=f.call.apply(f,[this].concat(S))||this,E.state=l,E.resetErrorBoundary=function(){for(var O,m=arguments.length,v=Array(m),I=0;I<m;I++)v[I]=arguments[I];E.props.onReset==null||(O=E.props).onReset.apply(O,v),E.reset()},E}n(p,f),p.getDerivedStateFromError=function(E){return{error:E}};var _=p.prototype;return _.reset=function(){this.setState(l)},_.componentDidCatch=function(E,T){var S,w;(S=(w=this.props).onError)==null||S.call(w,E,T)},_.componentDidUpdate=function(E,T){var S=this.props.resetKeys;if(this.state.error!==null&&T.error!==null&&r(E.resetKeys,S)){var w,O;(w=(O=this.props).onResetKeysChange)==null||w.call(O,E.resetKeys,S),this.reset()}},_.render=function(){var E=this.state.error,T=this.props,S=T.fallbackRender,w=T.FallbackComponent;if(T=T.fallback,E!==null){if(E={error:E,resetErrorBoundary:this.resetErrorBoundary},e.isValidElement(T))return T;if(typeof S=="function")return S(E);if(w)return e.createElement(w,E);throw Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop")}return this.props.children},p}(e.Component);return Nu=function({children:f,onError:p}){return e.createElement(d,{fallback:e.createElement("div",{style:{border:"1px solid #f00",color:"#f00",padding:"8px"}},"An error was thrown."),onError:p},f)},Nu}const EC=process.env.NODE_ENV==="development"?NC():CC();var TC=EC;const xC=hd(TC);var Cu={},gr={},mh;function vC(){if(mh)return gr;mh=1;var e=jt(),t=pn();function n(Y){let W=1,J=Y.getParent();for(;J!=null;){if(ce(J)){const R=J.getParent();if(de(R)){W++,J=R.getParent();continue}throw Error("A ListItemNode must have a ListNode for a parent.")}return W}return W}function r(Y){let W=Y.getParent();if(!de(W))throw Error("A ListItemNode must have a ListNode for a parent.");let J=W;for(;J!==null;)J=J.getParent(),de(J)&&(W=J);return W}function l(Y){let W=[];const J=Y.getChildren().filter(ce);for(let R=0;R<J.length;R++){const U=J[R],X=U.getFirstChild();de(X)?W=W.concat(l(X)):W.push(U)}return W}function d(Y){return ce(Y)&&de(Y.getFirstChild())}function f(Y){let W=Y;for(;W.getNextSibling()==null&&W.getPreviousSibling()==null;){const J=W.getParent();if(J==null||!(ce(W)||de(W)))break;W=J}W.remove()}function p(Y){return te().append(Y)}function _(Y,W){return ce(Y)&&(W.length===0||W.length===1&&Y.is(W[0])&&Y.getChildrenSize()===0)}function E(Y){const W=Y.getParent();let J=1;if(W!=null)if(de(W))J=W.getStart();else throw Error("$getListItemValue: list node is not parent of list item node");const R=Y.getPreviousSiblings();for(let U=0;U<R.length;U++){const X=R[U];ce(X)&&!de(X.getFirstChild())&&J++}return J}function T(Y,W){Y.update(()=>{const J=e.$getSelection();if(e.$INTERNAL_isPointSelection(J)){const R=J.getNodes(),X=J.anchor.getNode(),fe=X.getParent();if(_(X,R)){const _e=Ee(W);if(e.$isRootOrShadowRoot(fe)){X.replace(_e);const B=te();e.$isElementNode(X)&&(B.setFormat(X.getFormatType()),B.setIndent(X.getIndent())),_e.append(B)}else if(ce(X)){const B=X.getParentOrThrow();S(_e,B.getChildren()),B.replace(_e)}return}else{const _e=new Set;for(let B=0;B<R.length;B++){const M=R[B];if(e.$isElementNode(M)&&M.isEmpty()&&!ce(M)&&!_e.has(M.getKey())){w(M,W);continue}if(e.$isLeafNode(M)){let F=M.getParent();for(;F!=null;){const se=F.getKey();if(de(F)){if(!_e.has(se)){const ye=Ee(W);S(ye,F.getChildren()),F.replace(ye),v(ye),_e.add(se)}break}else{const ye=F.getParent();if(e.$isRootOrShadowRoot(ye)&&!_e.has(se)){_e.add(se),w(F,W);break}F=ye}}}}}}})}function S(Y,W){Y.splice(Y.getChildrenSize(),0,W)}function w(Y,W){if(de(Y))return Y;const J=Y.getPreviousSibling(),R=Y.getNextSibling(),U=te();if(U.setFormat(Y.getFormatType()),U.setIndent(Y.getIndent()),S(U,Y.getChildren()),de(J)&&W===J.getListType())return J.append(U),Y.remove(),de(R)&&W===R.getListType()&&(S(J,R.getChildren()),R.remove()),J;if(de(R)&&W===R.getListType())return R.getFirstChildOrThrow().insertBefore(U),Y.remove(),R;{const X=Ee(W);return X.append(U),Y.replace(X),v(X),X}}function O(Y,W){const J=Y.getLastChild(),R=W.getFirstChild();J&&R&&d(J)&&d(R)&&(O(J.getFirstChild(),R.getFirstChild()),R.remove());const U=W.getChildren();U.length>0&&(Y.append(...U),v(Y)),W.remove()}function m(Y){Y.update(()=>{const W=e.$getSelection();if(e.$isRangeSelection(W)){const J=new Set,R=W.getNodes(),U=W.anchor.getNode();if(_(U,R))J.add(r(U));else for(let X=0;X<R.length;X++){const fe=R[X];if(e.$isLeafNode(fe)){const _e=t.$getNearestNodeOfType(fe,P);_e!=null&&J.add(r(_e))}}for(const X of J){let fe=X;const _e=l(X);for(const B of _e){const M=e.$createParagraphNode();S(M,B.getChildren()),fe.insertAfter(M),fe=M,B.__key===W.anchor.key&&W.anchor.set(M.getKey(),0,"element"),B.__key===W.focus.key&&W.focus.set(M.getKey(),0,"element"),B.remove()}X.remove()}}})}function v(Y,W){const J=W||Y.getChildren();if(J!==void 0)for(let R=0;R<J.length;R++){const U=J[R];if(ce(U)){const X=U.getValue(),fe=E(U);X!==fe&&U.setValue(fe)}}}function I(Y){const W=new Set;if(d(Y)||W.has(Y.getKey()))return;const J=Y.getParent(),R=Y.getNextSibling(),U=Y.getPreviousSibling();if(d(R)&&d(U)){const X=U.getFirstChild();if(de(X)){X.append(Y);const fe=R.getFirstChild();if(de(fe)){const _e=fe.getChildren();S(X,_e),R.remove(),W.add(R.getKey())}v(X)}}else if(d(R)){const X=R.getFirstChild();if(de(X)){const fe=X.getFirstChild();fe!==null&&fe.insertBefore(Y),v(X)}}else if(d(U)){const X=U.getFirstChild();de(X)&&(X.append(Y),v(X))}else if(de(J)){const X=te(),fe=Ee(J.getListType());X.append(fe),fe.append(Y),U?U.insertAfter(X):R?R.insertBefore(X):J.append(X),v(fe)}de(J)&&v(J)}function G(Y){if(d(Y))return;const W=Y.getParent(),J=W?W.getParent():void 0,R=J?J.getParent():void 0;if(de(R)&&ce(J)&&de(W)){const U=W?W.getFirstChild():void 0,X=W?W.getLastChild():void 0;if(Y.is(U))J.insertBefore(Y),W.isEmpty()&&J.remove();else if(Y.is(X))J.insertAfter(Y),W.isEmpty()&&J.remove();else{const fe=W.getListType(),_e=te(),B=Ee(fe);_e.append(B),Y.getPreviousSiblings().forEach(se=>B.append(se));const M=te(),F=Ee(fe);M.append(F),S(F,Y.getNextSiblings()),J.insertBefore(_e),J.insertAfter(M),J.replace(Y)}v(W),v(R)}}function k(){const Y=e.$getSelection();if(!e.$isRangeSelection(Y)||!Y.isCollapsed())return!1;const W=Y.anchor.getNode();if(!ce(W)||W.getChildrenSize()!==0)return!1;const J=r(W),R=W.getParent();if(!de(R))throw Error("A ListItemNode must have a ListNode for a parent.");const U=R.getParent();let X;if(e.$isRootOrShadowRoot(U))X=e.$createParagraphNode(),J.insertAfter(X);else if(ce(U))X=te(),U.insertAfter(X);else return!1;X.select();const fe=W.getNextSiblings();if(fe.length>0){const _e=Ee(R.getListType());if(e.$isParagraphNode(X))X.insertAfter(_e);else{const B=te();B.append(_e),X.insertAfter(B)}fe.forEach(B=>{B.remove(),_e.append(B)})}return f(W),!0}class P extends e.ElementNode{static getType(){return"listitem"}static clone(W){return new P(W.__value,W.__checked,W.__key)}constructor(W,J,R){super(R),this.__value=W===void 0?1:W,this.__checked=J}createDOM(W){const J=document.createElement("li"),R=this.getParent();return de(R)&&R.getListType()==="check"&&j(J,this,null),J.value=this.__value,H(J,W.theme,this),J}updateDOM(W,J,R){const U=this.getParent();return de(U)&&U.getListType()==="check"&&j(J,this,W),J.value=this.__value,H(J,R.theme,this),!1}static transform(){return W=>{const J=W.getParent();if(de(J)){if(v(J),!ce(W))throw Error("node is not a ListItemNode");J.getListType()!=="check"&&W.getChecked()!=null&&W.setChecked(void 0)}}}static importDOM(){return{li:W=>({conversion:re,priority:0})}}static importJSON(W){const J=te();return J.setChecked(W.checked),J.setValue(W.value),J.setFormat(W.format),J.setDirection(W.direction),J}exportDOM(W){const J=this.createDOM(W._config);return J.style.textAlign=this.getFormatType(),{element:J}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...W){for(let J=0;J<W.length;J++){const R=W[J];if(e.$isElementNode(R)&&this.canMergeWith(R)){const U=R.getChildren();this.append(...U),R.remove()}else super.append(R)}return this}replace(W,J){if(ce(W))return super.replace(W);this.setIndent(0);const R=this.getParentOrThrow();if(!de(R))return W;if(R.__first===this.getKey())R.insertBefore(W);else if(R.__last===this.getKey())R.insertAfter(W);else{const U=Ee(R.getListType());let X=this.getNextSibling();for(;X;){const fe=X;X=X.getNextSibling(),U.append(fe)}R.insertAfter(W),W.insertAfter(U)}if(J){if(!e.$isElementNode(W))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(U=>{W.append(U)})}return this.remove(),R.getChildrenSize()===0&&R.remove(),W}insertAfter(W,J=!0){const R=this.getParentOrThrow();if(!de(R))throw Error("insertAfter: list node is not parent of list item node");const U=this.getNextSiblings();if(ce(W)){const X=super.insertAfter(W,J),fe=W.getParentOrThrow();return de(fe)&&v(fe),X}if(de(W)){let X=W;const fe=W.getChildren();for(let _e=fe.length-1;_e>=0;_e--)X=fe[_e],this.insertAfter(X,J);return X}if(R.insertAfter(W,J),U.length!==0){const X=Ee(R.getListType());U.forEach(fe=>X.append(fe)),W.insertAfter(X,J)}return W}remove(W){const J=this.getPreviousSibling(),R=this.getNextSibling();if(super.remove(W),J&&R&&d(J)&&d(R))O(J.getFirstChild(),R.getFirstChild()),R.remove();else if(R){const U=R.getParent();de(U)&&v(U)}}insertNewAfter(W,J=!0){const R=te(this.__checked==null?void 0:!1);return this.insertAfter(R,J),R}collapseAtStart(W){const J=e.$createParagraphNode();this.getChildren().forEach(_e=>J.append(_e));const U=this.getParentOrThrow(),X=U.getParentOrThrow(),fe=ce(X);if(U.getChildrenSize()===1)if(fe)U.remove(),X.select();else{U.insertBefore(J),U.remove();const _e=W.anchor,B=W.focus,M=J.getKey();_e.type==="element"&&_e.getNode().is(this)&&_e.set(M,_e.offset,"element"),B.type==="element"&&B.getNode().is(this)&&B.set(M,B.offset,"element")}else U.insertBefore(J),this.remove();return!0}getValue(){return this.getLatest().__value}setValue(W){const J=this.getWritable();J.__value=W}getChecked(){return this.getLatest().__checked}setChecked(W){const J=this.getWritable();J.__checked=W}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){const W=this.getParent();if(W===null)return this.getLatest().__indent;let J=W.getParentOrThrow(),R=0;for(;ce(J);)J=J.getParentOrThrow().getParentOrThrow(),R++;return R}setIndent(W){if(!(typeof W=="number"&&W>-1))throw Error("Invalid indent value.");let J=this.getIndent();for(;J!==W;)J<W?(I(this),J++):(G(this),J--);return this}insertBefore(W){if(ce(W)){const J=this.getParentOrThrow();if(de(J)){const R=this.getNextSiblings();v(J,R)}}return super.insertBefore(W)}canInsertAfter(W){return ce(W)}canReplaceWith(W){return ce(W)}canMergeWith(W){return e.$isParagraphNode(W)||ce(W)}extractWithChild(W,J){if(!e.$isRangeSelection(J))return!1;const R=J.anchor.getNode(),U=J.focus.getNode();return this.isParentOf(R)&&this.isParentOf(U)&&this.getTextContent().length===J.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return Ee("bullet")}}function H(Y,W,J){const R=[],U=[],X=W.list,fe=X?X.listitem:void 0;let _e;if(X&&X.nested&&(_e=X.nested.listitem),fe!==void 0){const B=fe.split(" ");R.push(...B)}if(X){const B=J.getParent(),M=de(B)&&B.getListType()==="check",F=J.getChecked();(!M||F)&&U.push(X.listitemUnchecked),(!M||!F)&&U.push(X.listitemChecked),M&&R.push(F?X.listitemChecked:X.listitemUnchecked)}if(_e!==void 0){const B=_e.split(" ");J.getChildren().some(M=>de(M))?R.push(...B):U.push(...B)}U.length>0&&t.removeClassNamesFromElement(Y,...U),R.length>0&&t.addClassNamesToElement(Y,...R)}function j(Y,W,J,R){de(W.getFirstChild())?(Y.removeAttribute("role"),Y.removeAttribute("tabIndex"),Y.removeAttribute("aria-checked")):(Y.setAttribute("role","checkbox"),Y.setAttribute("tabIndex","-1"),(!J||W.__checked!==J.__checked)&&Y.setAttribute("aria-checked",W.getChecked()?"true":"false"))}function re(Y){const W=t.isHTMLElement(Y)&&Y.getAttribute("aria-checked")==="true";return{node:te(W)}}function te(Y){return e.$applyNodeReplacement(new P(void 0,Y))}function ce(Y){return Y instanceof P}class V extends e.ElementNode{static getType(){return"list"}static clone(W){const J=W.__listType||Se[W.__tag];return new V(J,W.__start,W.__key)}constructor(W,J,R){super(R);const U=Se[W]||W;this.__listType=U,this.__tag=U==="number"?"ol":"ul",this.__start=J}getTag(){return this.__tag}setListType(W){const J=this.getWritable();J.__listType=W,J.__tag=W==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(W,J){const R=this.__tag,U=document.createElement(R);return this.__start!==1&&U.setAttribute("start",String(this.__start)),U.__lexicalListType=this.__listType,z(U,W.theme,this),U}updateDOM(W,J,R){return W.__tag!==this.__tag?!0:(z(J,R.theme,this),!1)}static importDOM(){return{ol:W=>({conversion:Te,priority:0}),ul:W=>({conversion:Te,priority:0})}}static importJSON(W){const J=Ee(W.listType,W.start);return J.setFormat(W.format),J.setIndent(W.indent),J.setDirection(W.direction),J}exportDOM(W){const{element:J}=super.exportDOM(W);return J&&t.isHTMLElement(J)&&(this.__start!==1&&J.setAttribute("start",String(this.__start)),this.__listType==="check"&&J.setAttribute("__lexicalListType","check")),{element:J}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...W){for(let J=0;J<W.length;J++){const R=W[J];if(ce(R))super.append(R);else{const U=te();if(de(R))U.append(R);else if(e.$isElementNode(R)){const X=e.$createTextNode(R.getTextContent());U.append(X)}else U.append(R);super.append(U)}}return v(this),this}extractWithChild(W){return ce(W)}}function z(Y,W,J){const R=[],U=[],X=W.list;if(X!==void 0){const fe=X[`${J.__tag}Depth`]||[],_e=n(J)-1,B=_e%fe.length,M=fe[B],F=X[J.__tag];let se;const ye=X.nested;if(ye!==void 0&&ye.list&&(se=ye.list),F!==void 0&&R.push(F),M!==void 0){const De=M.split(" ");R.push(...De);for(let ee=0;ee<fe.length;ee++)ee!==B&&U.push(J.__tag+ee)}if(se!==void 0){const De=se.split(" ");_e>1?R.push(...De):U.push(...De)}}U.length>0&&t.removeClassNamesFromElement(Y,...U),R.length>0&&t.addClassNamesToElement(Y,...R)}function q(Y){const W=[];for(let J=0;J<Y.length;J++){const R=Y[J];if(ce(R)){W.push(R);const U=R.getChildren();U.length>1&&U.forEach(X=>{de(X)&&W.push(p(X))})}else W.push(p(R))}return W}function Te(Y){const W=Y.nodeName.toLowerCase();let J=null;if(W==="ol"){const R=Y.start;J=Ee("number",R)}else W==="ul"&&(t.isHTMLElement(Y)&&Y.getAttribute("__lexicallisttype")==="check"?J=Ee("check"):J=Ee("bullet"));return{after:q,node:J}}const Se={ol:"number",ul:"bullet"};function Ee(Y,W=1){return e.$applyNodeReplacement(new V(Y,W))}function de(Y){return Y instanceof V}const K=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),D=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Z=e.createCommand("INSERT_CHECK_LIST_COMMAND"),oe=e.createCommand("REMOVE_LIST_COMMAND");return gr.$createListItemNode=te,gr.$createListNode=Ee,gr.$getListDepth=n,gr.$handleListInsertParagraph=k,gr.$isListItemNode=ce,gr.$isListNode=de,gr.INSERT_CHECK_LIST_COMMAND=Z,gr.INSERT_ORDERED_LIST_COMMAND=D,gr.INSERT_UNORDERED_LIST_COMMAND=K,gr.ListItemNode=P,gr.ListNode=V,gr.REMOVE_LIST_COMMAND=oe,gr.insertList=T,gr.removeList=m,gr}var pr={},_h;function SC(){if(_h)return pr;_h=1;var e=jt(),t=pn();function n(K){let D=new URLSearchParams;D.append("code",K);for(let Z=1;Z<arguments.length;Z++)D.append("v",arguments[Z]);throw Error(`Minified Lexical error #${K}; 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 r(K){let D=1;for(K=K.getParent();K!=null;){if(H(K)){if(K=K.getParent(),q(K)){D++,K=K.getParent();continue}n(40)}break}return D}function l(K){K=K.getParent(),q(K)||n(40);let D=K;for(;D!==null;)D=D.getParent(),q(D)&&(K=D);return K}function d(K){let D=[];K=K.getChildren().filter(H);for(let Z=0;Z<K.length;Z++){let oe=K[Z],Y=oe.getFirstChild();q(Y)?D=D.concat(d(Y)):D.push(oe)}return D}function f(K){return H(K)&&q(K.getFirstChild())}function p(K){for(;K.getNextSibling()==null&&K.getPreviousSibling()==null;){let D=K.getParent();if(D==null||!H(K)&&!q(K))break;K=D}K.remove()}function _(K){return P().append(K)}function E(K,D){return H(K)&&(D.length===0||D.length===1&&K.is(D[0])&&K.getChildrenSize()===0)}function T(K,D){K.splice(K.getChildrenSize(),0,D)}function S(K,D){if(q(K))return K;let Z=K.getPreviousSibling(),oe=K.getNextSibling(),Y=P();return Y.setFormat(K.getFormatType()),Y.setIndent(K.getIndent()),T(Y,K.getChildren()),q(Z)&&D===Z.getListType()?(Z.append(Y),K.remove(),q(oe)&&D===oe.getListType()&&(T(Z,oe.getChildren()),oe.remove()),Z):q(oe)&&D===oe.getListType()?(oe.getFirstChildOrThrow().insertBefore(Y),K.remove(),oe):(D=z(D),D.append(Y),K.replace(D),O(D),D)}function w(K,D){var Z=K.getLastChild();let oe=D.getFirstChild();Z&&oe&&f(Z)&&f(oe)&&(w(Z.getFirstChild(),oe.getFirstChild()),oe.remove()),Z=D.getChildren(),0<Z.length&&(K.append(...Z),O(K)),D.remove()}function O(K,D){if(K=D||K.getChildren(),K!==void 0)for(D=0;D<K.length;D++){let W=K[D];if(H(W)){let J=W.getValue();var Z=W,oe=Z.getParent(),Y=1;for(oe!=null&&(q(oe)?Y=oe.getStart():n(44)),Z=Z.getPreviousSiblings(),oe=0;oe<Z.length;oe++){let R=Z[oe];H(R)&&!q(R.getFirstChild())&&Y++}J!==Y&&W.setValue(Y)}}}function m(K){if(!f(K)){var D=K.getParent(),Z=D?D.getParent():void 0,oe=Z?Z.getParent():void 0;if(q(oe)&&H(Z)&&q(D)){var Y=D?D.getFirstChild():void 0,W=D?D.getLastChild():void 0;if(K.is(Y))Z.insertBefore(K),D.isEmpty()&&Z.remove();else if(K.is(W))Z.insertAfter(K),D.isEmpty()&&Z.remove();else{var J=D.getListType();Y=P();let R=z(J);Y.append(R),K.getPreviousSiblings().forEach(U=>R.append(U)),W=P(),J=z(J),W.append(J),T(J,K.getNextSiblings()),Z.insertBefore(Y),Z.insertAfter(W),Z.replace(K)}O(D),O(oe)}}}class v extends e.ElementNode{static getType(){return"listitem"}static clone(D){return new v(D.__value,D.__checked,D.__key)}constructor(D,Z,oe){super(oe),this.__value=D===void 0?1:D,this.__checked=Z}createDOM(D){let Z=document.createElement("li"),oe=this.getParent();return q(oe)&&oe.getListType()==="check"&&G(Z,this,null),Z.value=this.__value,I(Z,D.theme,this),Z}updateDOM(D,Z,oe){let Y=this.getParent();return q(Y)&&Y.getListType()==="check"&&G(Z,this,D),Z.value=this.__value,I(Z,oe.theme,this),!1}static transform(){return D=>{let Z=D.getParent();if(q(Z)){if(O(Z),!H(D))throw Error("node is not a ListItemNode");Z.getListType()!=="check"&&D.getChecked()!=null&&D.setChecked(void 0)}}}static importDOM(){return{li:()=>({conversion:k,priority:0})}}static importJSON(D){let Z=P();return Z.setChecked(D.checked),Z.setValue(D.value),Z.setFormat(D.format),Z.setDirection(D.direction),Z}exportDOM(D){return D=this.createDOM(D._config),D.style.textAlign=this.getFormatType(),{element:D}}exportJSON(){return{...super.exportJSON(),checked:this.getChecked(),type:"listitem",value:this.getValue(),version:1}}append(...D){for(let Z=0;Z<D.length;Z++){let oe=D[Z];if(e.$isElementNode(oe)&&this.canMergeWith(oe)){let Y=oe.getChildren();this.append(...Y),oe.remove()}else super.append(oe)}return this}replace(D,Z){if(H(D))return super.replace(D);this.setIndent(0);let oe=this.getParentOrThrow();if(!q(oe))return D;if(oe.__first===this.getKey())oe.insertBefore(D);else if(oe.__last===this.getKey())oe.insertAfter(D);else{let Y=z(oe.getListType()),W=this.getNextSibling();for(;W;){let J=W;W=W.getNextSibling(),Y.append(J)}oe.insertAfter(D),D.insertAfter(Y)}if(Z){if(!e.$isElementNode(D))throw Error("includeChildren should only be true for ElementNodes");this.getChildren().forEach(Y=>{D.append(Y)})}return this.remove(),oe.getChildrenSize()===0&&oe.remove(),D}insertAfter(D,Z=!0){var oe=this.getParentOrThrow();q(oe)||n(39);var Y=this.getNextSiblings();if(H(D))return Z=super.insertAfter(D,Z),D=D.getParentOrThrow(),q(D)&&O(D),Z;if(q(D)){for(oe=D,D=D.getChildren(),Y=D.length-1;0<=Y;Y--)oe=D[Y],this.insertAfter(oe,Z);return oe}if(oe.insertAfter(D,Z),Y.length!==0){let W=z(oe.getListType());Y.forEach(J=>W.append(J)),D.insertAfter(W,Z)}return D}remove(D){let Z=this.getPreviousSibling(),oe=this.getNextSibling();super.remove(D),Z&&oe&&f(Z)&&f(oe)?(w(Z.getFirstChild(),oe.getFirstChild()),oe.remove()):oe&&(D=oe.getParent(),q(D)&&O(D))}insertNewAfter(D,Z=!0){return D=P(this.__checked==null?void 0:!1),this.insertAfter(D,Z),D}collapseAtStart(D){let Z=e.$createParagraphNode();this.getChildren().forEach(J=>Z.append(J));var oe=this.getParentOrThrow(),Y=oe.getParentOrThrow();let W=H(Y);return oe.getChildrenSize()===1?W?(oe.remove(),Y.select()):(oe.insertBefore(Z),oe.remove(),oe=D.anchor,D=D.focus,Y=Z.getKey(),oe.type==="element"&&oe.getNode().is(this)&&oe.set(Y,oe.offset,"element"),D.type==="element"&&D.getNode().is(this)&&D.set(Y,D.offset,"element")):(oe.insertBefore(Z),this.remove()),!0}getValue(){return this.getLatest().__value}setValue(D){this.getWritable().__value=D}getChecked(){return this.getLatest().__checked}setChecked(D){this.getWritable().__checked=D}toggleChecked(){this.setChecked(!this.__checked)}getIndent(){var D=this.getParent();if(D===null)return this.getLatest().__indent;D=D.getParentOrThrow();let Z=0;for(;H(D);)D=D.getParentOrThrow().getParentOrThrow(),Z++;return Z}setIndent(D){typeof D=="number"&&-1<D||n(117);let Z=this.getIndent();for(;Z!==D;)if(Z<D){e:{var oe=new Set;if(f(this)||oe.has(this.getKey()))break e;let R=this.getParent();var Y=this.getNextSibling(),W=this.getPreviousSibling();if(f(Y)&&f(W)){if(W=W.getFirstChild(),q(W)){W.append(this);var J=Y.getFirstChild();q(J)&&(J=J.getChildren(),T(W,J),Y.remove(),oe.add(Y.getKey())),O(W)}}else f(Y)?(Y=Y.getFirstChild(),q(Y)&&(oe=Y.getFirstChild(),oe!==null&&oe.insertBefore(this),O(Y))):f(W)?(Y=W.getFirstChild(),q(Y)&&(Y.append(this),O(Y))):q(R)&&(oe=P(),J=z(R.getListType()),oe.append(J),J.append(this),W?W.insertAfter(oe):Y?Y.insertBefore(oe):R.append(oe),O(J));q(R)&&O(R)}Z++}else m(this),Z--;return this}insertBefore(D){if(H(D)){let Z=this.getParentOrThrow();if(q(Z)){let oe=this.getNextSiblings();O(Z,oe)}}return super.insertBefore(D)}canInsertAfter(D){return H(D)}canReplaceWith(D){return H(D)}canMergeWith(D){return e.$isParagraphNode(D)||H(D)}extractWithChild(D,Z){if(!e.$isRangeSelection(Z))return!1;D=Z.anchor.getNode();let oe=Z.focus.getNode();return this.isParentOf(D)&&this.isParentOf(oe)&&this.getTextContent().length===Z.getTextContent().length}isParentRequired(){return!0}createParentElementNode(){return z("bullet")}}function I(K,D,Z){let oe=[],Y=[];var W=(D=D.list)?D.listitem:void 0;if(D&&D.nested)var J=D.nested.listitem;if(W!==void 0&&(W=W.split(" "),oe.push(...W)),D){W=Z.getParent(),W=q(W)&&W.getListType()==="check";let R=Z.getChecked();W&&!R||Y.push(D.listitemUnchecked),W&&R||Y.push(D.listitemChecked),W&&oe.push(R?D.listitemChecked:D.listitemUnchecked)}J!==void 0&&(J=J.split(" "),Z.getChildren().some(R=>q(R))?oe.push(...J):Y.push(...J)),0<Y.length&&t.removeClassNamesFromElement(K,...Y),0<oe.length&&t.addClassNamesToElement(K,...oe)}function G(K,D,Z){q(D.getFirstChild())?(K.removeAttribute("role"),K.removeAttribute("tabIndex"),K.removeAttribute("aria-checked")):(K.setAttribute("role","checkbox"),K.setAttribute("tabIndex","-1"),Z&&D.__checked===Z.__checked||K.setAttribute("aria-checked",D.getChecked()?"true":"false"))}function k(K){return K=t.isHTMLElement(K)&&K.getAttribute("aria-checked")==="true",{node:P(K)}}function P(K){return e.$applyNodeReplacement(new v(void 0,K))}function H(K){return K instanceof v}class j extends e.ElementNode{static getType(){return"list"}static clone(D){return new j(D.__listType||V[D.__tag],D.__start,D.__key)}constructor(D,Z,oe){super(oe),this.__listType=D=V[D]||D,this.__tag=D==="number"?"ol":"ul",this.__start=Z}getTag(){return this.__tag}setListType(D){let Z=this.getWritable();Z.__listType=D,Z.__tag=D==="number"?"ol":"ul"}getListType(){return this.__listType}getStart(){return this.__start}createDOM(D){let Z=document.createElement(this.__tag);return this.__start!==1&&Z.setAttribute("start",String(this.__start)),Z.__lexicalListType=this.__listType,re(Z,D.theme,this),Z}updateDOM(D,Z,oe){return D.__tag!==this.__tag?!0:(re(Z,oe.theme,this),!1)}static importDOM(){return{ol:()=>({conversion:ce,priority:0}),ul:()=>({conversion:ce,priority:0})}}static importJSON(D){let Z=z(D.listType,D.start);return Z.setFormat(D.format),Z.setIndent(D.indent),Z.setDirection(D.direction),Z}exportDOM(D){return{element:D}=super.exportDOM(D),D&&t.isHTMLElement(D)&&(this.__start!==1&&D.setAttribute("start",String(this.__start)),this.__listType==="check"&&D.setAttribute("__lexicalListType","check")),{element:D}}exportJSON(){return{...super.exportJSON(),listType:this.getListType(),start:this.getStart(),tag:this.getTag(),type:"list",version:1}}canBeEmpty(){return!1}canIndent(){return!1}append(...D){for(let oe=0;oe<D.length;oe++){var Z=D[oe];if(H(Z))super.append(Z);else{let Y=P();q(Z)||e.$isElementNode(Z)&&(Z=e.$createTextNode(Z.getTextContent())),Y.append(Z),super.append(Y)}}return O(this),this}extractWithChild(D){return H(D)}}function re(K,D,Z){let oe=[],Y=[];var W=D.list;if(W!==void 0){let R=W[`${Z.__tag}Depth`]||[];D=r(Z)-1;let U=D%R.length;var J=R[U];let X=W[Z.__tag],fe;if(W=W.nested,W!==void 0&&W.list&&(fe=W.list),X!==void 0&&oe.push(X),J!==void 0)for(J=J.split(" "),oe.push(...J),J=0;J<R.length;J++)J!==U&&Y.push(Z.__tag+J);fe!==void 0&&(Z=fe.split(" "),1<D?oe.push(...Z):Y.push(...Z))}0<Y.length&&t.removeClassNamesFromElement(K,...Y),0<oe.length&&t.addClassNamesToElement(K,...oe)}function te(K){let D=[];for(let oe=0;oe<K.length;oe++){var Z=K[oe];H(Z)?(D.push(Z),Z=Z.getChildren(),1<Z.length&&Z.forEach(Y=>{q(Y)&&D.push(_(Y))})):D.push(_(Z))}return D}function ce(K){let D=K.nodeName.toLowerCase(),Z=null;return D==="ol"?Z=z("number",K.start):D==="ul"&&(Z=t.isHTMLElement(K)&&K.getAttribute("__lexicallisttype")==="check"?z("check"):z("bullet")),{after:te,node:Z}}let V={ol:"number",ul:"bullet"};function z(K,D=1){return e.$applyNodeReplacement(new j(K,D))}function q(K){return K instanceof j}let Te=e.createCommand("INSERT_UNORDERED_LIST_COMMAND"),Se=e.createCommand("INSERT_ORDERED_LIST_COMMAND"),Ee=e.createCommand("INSERT_CHECK_LIST_COMMAND"),de=e.createCommand("REMOVE_LIST_COMMAND");return pr.$createListItemNode=P,pr.$createListNode=z,pr.$getListDepth=r,pr.$handleListInsertParagraph=function(){var K=e.$getSelection();if(!e.$isRangeSelection(K)||!K.isCollapsed()||(K=K.anchor.getNode(),!H(K)||K.getChildrenSize()!==0))return!1;var D=l(K),Z=K.getParent();q(Z)||n(40);let oe=Z.getParent(),Y;if(e.$isRootOrShadowRoot(oe))Y=e.$createParagraphNode(),D.insertAfter(Y);else if(H(oe))Y=P(),oe.insertAfter(Y);else return!1;if(Y.select(),D=K.getNextSiblings(),0<D.length){let W=z(Z.getListType());e.$isParagraphNode(Y)?Y.insertAfter(W):(Z=P(),Z.append(W),Y.insertAfter(Z)),D.forEach(J=>{J.remove(),W.append(J)})}return p(K),!0},pr.$isListItemNode=H,pr.$isListNode=q,pr.INSERT_CHECK_LIST_COMMAND=Ee,pr.INSERT_ORDERED_LIST_COMMAND=Se,pr.INSERT_UNORDERED_LIST_COMMAND=Te,pr.ListItemNode=v,pr.ListNode=j,pr.REMOVE_LIST_COMMAND=de,pr.insertList=function(K,D){K.update(()=>{var Z=e.$getSelection();if(e.$INTERNAL_isPointSelection(Z)){var oe=Z.getNodes();Z=Z.anchor.getNode();var Y=Z.getParent();if(E(Z,oe))oe=z(D),e.$isRootOrShadowRoot(Y)?(Z.replace(oe),Y=P(),e.$isElementNode(Z)&&(Y.setFormat(Z.getFormatType()),Y.setIndent(Z.getIndent())),oe.append(Y)):H(Z)&&(Z=Z.getParentOrThrow(),T(oe,Z.getChildren()),Z.replace(oe));else for(Z=new Set,Y=0;Y<oe.length;Y++){var W=oe[Y];if(e.$isElementNode(W)&&W.isEmpty()&&!H(W)&&!Z.has(W.getKey()))S(W,D);else if(e.$isLeafNode(W))for(W=W.getParent();W!=null;){let R=W.getKey();if(q(W)){if(!Z.has(R)){var J=z(D);T(J,W.getChildren()),W.replace(J),O(J),Z.add(R)}break}else{if(J=W.getParent(),e.$isRootOrShadowRoot(J)&&!Z.has(R)){Z.add(R),S(W,D);break}W=J}}}}})},pr.removeList=function(K){K.update(()=>{let D=e.$getSelection();if(e.$isRangeSelection(D)){var Z=new Set,oe=D.getNodes(),Y=D.anchor.getNode();if(E(Y,oe))Z.add(l(Y));else for(Y=0;Y<oe.length;Y++){var W=oe[Y];e.$isLeafNode(W)&&(W=t.$getNearestNodeOfType(W,v),W!=null&&Z.add(l(W)))}for(let J of Z){Z=J,oe=d(J);for(let R of oe)oe=e.$createParagraphNode(),T(oe,R.getChildren()),Z.insertAfter(oe),Z=oe,R.__key===D.anchor.key&&D.anchor.set(oe.getKey(),0,"element"),R.__key===D.focus.key&&D.focus.set(oe.getKey(),0,"element"),R.remove();J.remove()}}})},pr}var Eu,yh;function Td(){return yh||(yh=1,Eu=process.env.NODE_ENV==="development"?vC():SC()),Eu}var Nh;function wC(){if(Nh)return Cu;Nh=1;var e=Td(),t=qn(),n=rt,r=pn(),l=jt();function d(p){n.useEffect(()=>r.mergeRegister(p.registerCommand(e.INSERT_ORDERED_LIST_COMMAND,()=>(e.insertList(p,"number"),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(e.INSERT_UNORDERED_LIST_COMMAND,()=>(e.insertList(p,"bullet"),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(e.REMOVE_LIST_COMMAND,()=>(e.removeList(p),!0),l.COMMAND_PRIORITY_LOW),p.registerCommand(l.INSERT_PARAGRAPH_COMMAND,()=>!!e.$handleListInsertParagraph(),l.COMMAND_PRIORITY_LOW)),[p])}function f(){const[p]=t.useLexicalComposerContext();return n.useEffect(()=>{if(!p.hasNodes([e.ListNode,e.ListItemNode]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[p]),d(p),null}return Cu.ListPlugin=f,Cu}var Tu={},Ch;function OC(){if(Ch)return Tu;Ch=1;var e=Td(),t=qn(),n=rt,r=pn(),l=jt();function d(f){n.useEffect(()=>r.mergeRegister(f.registerCommand(e.INSERT_ORDERED_LIST_COMMAND,()=>(e.insertList(f,"number"),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(e.INSERT_UNORDERED_LIST_COMMAND,()=>(e.insertList(f,"bullet"),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(e.REMOVE_LIST_COMMAND,()=>(e.removeList(f),!0),l.COMMAND_PRIORITY_LOW),f.registerCommand(l.INSERT_PARAGRAPH_COMMAND,()=>!!e.$handleListInsertParagraph(),l.COMMAND_PRIORITY_LOW)),[f])}return Tu.ListPlugin=function(){let[f]=t.useLexicalComposerContext();return n.useEffect(()=>{if(!f.hasNodes([e.ListNode,e.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")},[f]),d(f),null},Tu}const DC=process.env.NODE_ENV==="development"?wC():OC();var AC=DC,xu={},wi={},Eh;function MC(){if(Eh)return wi;Eh=1;var e=pn(),t=jt();const n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(m){return new r(m.__url,{rel:m.__rel,target:m.__target,title:m.__title},m.__key)}constructor(m,v={},I){super(I);const{target:G=null,rel:k=null,title:P=null}=v;this.__url=m,this.__target=G,this.__rel=k,this.__title=P}createDOM(m){const v=document.createElement("a");return v.href=this.sanitizeUrl(this.__url),this.__target!==null&&(v.target=this.__target),this.__rel!==null&&(v.rel=this.__rel),this.__title!==null&&(v.title=this.__title),e.addClassNamesToElement(v,m.theme.link),v}updateDOM(m,v,I){const G=this.__url,k=this.__target,P=this.__rel,H=this.__title;return G!==m.__url&&(v.href=G),k!==m.__target&&(k?v.target=k:v.removeAttribute("target")),P!==m.__rel&&(P?v.rel=P:v.removeAttribute("rel")),H!==m.__title&&(H?v.title=H:v.removeAttribute("title")),!1}static importDOM(){return{a:m=>({conversion:l,priority:1})}}static importJSON(m){const v=d(m.url,{rel:m.rel,target:m.target,title:m.title});return v.setFormat(m.format),v.setIndent(m.indent),v.setDirection(m.direction),v}sanitizeUrl(m){try{const v=new URL(m);if(!n.has(v.protocol))return"about:blank"}catch{return m}return m}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(m){const v=this.getWritable();v.__url=m}getTarget(){return this.getLatest().__target}setTarget(m){const v=this.getWritable();v.__target=m}getRel(){return this.getLatest().__rel}setRel(m){const v=this.getWritable();v.__rel=m}getTitle(){return this.getLatest().__title}setTitle(m){const v=this.getWritable();v.__title=m}insertNewAfter(m,v=!0){const I=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return this.insertAfter(I,v),I}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(m,v,I){if(!t.$isRangeSelection(v))return!1;const G=v.anchor.getNode(),k=v.focus.getNode();return this.isParentOf(G)&&this.isParentOf(k)&&v.getTextContent().length>0}}function l(O){let m=null;if(e.isHTMLAnchorElement(O)){const v=O.textContent;(v!==null&&v!==""||O.children.length>0)&&(m=d(O.getAttribute("href")||"",{rel:O.getAttribute("rel"),target:O.getAttribute("target"),title:O.getAttribute("title")}))}return{node:m}}function d(O,m){return t.$applyNodeReplacement(new r(O,m))}function f(O){return O instanceof r}class p extends r{static getType(){return"autolink"}static clone(m){return new p(m.__url,{rel:m.__rel,target:m.__target,title:m.__title},m.__key)}static importJSON(m){const v=_(m.url,{rel:m.rel,target:m.target,title:m.title});return v.setFormat(m.format),v.setIndent(m.indent),v.setDirection(m.direction),v}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(m,v=!0){const I=this.getParentOrThrow().insertNewAfter(m,v);if(t.$isElementNode(I)){const G=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title});return I.append(G),G}return null}}function _(O,m){return t.$applyNodeReplacement(new p(O,m))}function E(O){return O instanceof p}const T=t.createCommand("TOGGLE_LINK_COMMAND");function S(O,m={}){const{target:v,title:I}=m,G=m.rel===void 0?"noreferrer":m.rel,k=t.$getSelection();if(!t.$isRangeSelection(k))return;const P=k.extract();if(O===null)P.forEach(H=>{const j=H.getParent();if(f(j)){const re=j.getChildren();for(let te=0;te<re.length;te++)j.insertBefore(re[te]);j.remove()}});else{if(P.length===1){const re=P[0],te=w(re,f);if(te!==null){te.setURL(O),v!==void 0&&te.setTarget(v),G!==null&&te.setRel(G),I!==void 0&&te.setTitle(I);return}}let H=null,j=null;P.forEach(re=>{const te=re.getParent();if(!(te===j||te===null||t.$isElementNode(re)&&!re.isInline())){if(f(te)){j=te,te.setURL(O),v!==void 0&&te.setTarget(v),G!==null&&j.setRel(G),I!==void 0&&j.setTitle(I);return}if(te.is(H)||(H=te,j=d(O,{rel:G,target:v,title:I}),f(te)?re.getPreviousSibling()===null?te.insertBefore(j):te.insertAfter(j):re.insertBefore(j)),f(re)){if(re.is(j))return;if(j!==null){const ce=re.getChildren();for(let V=0;V<ce.length;V++)j.append(ce[V])}re.remove();return}j!==null&&j.append(re)}})}}function w(O,m){let v=O;for(;v!==null&&v.getParent()!==null&&!m(v);)v=v.getParentOrThrow();return m(v)?v:null}return wi.$createAutoLinkNode=_,wi.$createLinkNode=d,wi.$isAutoLinkNode=E,wi.$isLinkNode=f,wi.AutoLinkNode=p,wi.LinkNode=r,wi.TOGGLE_LINK_COMMAND=T,wi.toggleLink=S,wi}var Oi={},Th;function RC(){if(Th)return Oi;Th=1;var e=pn(),t=jt();let n=new Set(["http:","https:","mailto:","sms:","tel:"]);class r extends t.ElementNode{static getType(){return"link"}static clone(w){return new r(w.__url,{rel:w.__rel,target:w.__target,title:w.__title},w.__key)}constructor(w,O={},m){super(m);let{target:v=null,rel:I=null,title:G=null}=O;this.__url=w,this.__target=v,this.__rel=I,this.__title=G}createDOM(w){let O=document.createElement("a");return O.href=this.sanitizeUrl(this.__url),this.__target!==null&&(O.target=this.__target),this.__rel!==null&&(O.rel=this.__rel),this.__title!==null&&(O.title=this.__title),e.addClassNamesToElement(O,w.theme.link),O}updateDOM(w,O){let m=this.__url,v=this.__target,I=this.__rel,G=this.__title;return m!==w.__url&&(O.href=m),v!==w.__target&&(v?O.target=v:O.removeAttribute("target")),I!==w.__rel&&(I?O.rel=I:O.removeAttribute("rel")),G!==w.__title&&(G?O.title=G:O.removeAttribute("title")),!1}static importDOM(){return{a:()=>({conversion:l,priority:1})}}static importJSON(w){let O=d(w.url,{rel:w.rel,target:w.target,title:w.title});return O.setFormat(w.format),O.setIndent(w.indent),O.setDirection(w.direction),O}sanitizeUrl(w){try{let O=new URL(w);if(!n.has(O.protocol))return"about:blank"}catch{}return w}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(w){this.getWritable().__url=w}getTarget(){return this.getLatest().__target}setTarget(w){this.getWritable().__target=w}getRel(){return this.getLatest().__rel}setRel(w){this.getWritable().__rel=w}getTitle(){return this.getLatest().__title}setTitle(w){this.getWritable().__title=w}insertNewAfter(w,O=!0){return w=d(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),this.insertAfter(w,O),w}canInsertTextBefore(){return!1}canInsertTextAfter(){return!1}canBeEmpty(){return!1}isInline(){return!0}extractWithChild(w,O){if(!t.$isRangeSelection(O))return!1;w=O.anchor.getNode();let m=O.focus.getNode();return this.isParentOf(w)&&this.isParentOf(m)&&0<O.getTextContent().length}}function l(S){let w=null;if(e.isHTMLAnchorElement(S)){let O=S.textContent;(O!==null&&O!==""||0<S.children.length)&&(w=d(S.getAttribute("href")||"",{rel:S.getAttribute("rel"),target:S.getAttribute("target"),title:S.getAttribute("title")}))}return{node:w}}function d(S,w){return t.$applyNodeReplacement(new r(S,w))}function f(S){return S instanceof r}class p extends r{static getType(){return"autolink"}static clone(w){return new p(w.__url,{rel:w.__rel,target:w.__target,title:w.__title},w.__key)}static importJSON(w){let O=_(w.url,{rel:w.rel,target:w.target,title:w.title});return O.setFormat(w.format),O.setIndent(w.indent),O.setDirection(w.direction),O}static importDOM(){return null}exportJSON(){return{...super.exportJSON(),type:"autolink",version:1}}insertNewAfter(w,O=!0){return w=this.getParentOrThrow().insertNewAfter(w,O),t.$isElementNode(w)?(O=_(this.__url,{rel:this.__rel,target:this.__target,title:this.__title}),w.append(O),O):null}}function _(S,w){return t.$applyNodeReplacement(new p(S,w))}let E=t.createCommand("TOGGLE_LINK_COMMAND");function T(S,w){for(;S!==null&&S.getParent()!==null&&!w(S);)S=S.getParentOrThrow();return w(S)?S:null}return Oi.$createAutoLinkNode=_,Oi.$createLinkNode=d,Oi.$isAutoLinkNode=function(S){return S instanceof p},Oi.$isLinkNode=f,Oi.AutoLinkNode=p,Oi.LinkNode=r,Oi.TOGGLE_LINK_COMMAND=E,Oi.toggleLink=function(S,w={}){let{target:O,title:m}=w,v=w.rel===void 0?"noreferrer":w.rel;if(w=t.$getSelection(),t.$isRangeSelection(w))if(w=w.extract(),S===null)w.forEach(I=>{if(I=I.getParent(),f(I)){let G=I.getChildren();for(let k=0;k<G.length;k++)I.insertBefore(G[k]);I.remove()}});else{if(w.length===1){let k=T(w[0],f);if(k!==null){k.setURL(S),O!==void 0&&k.setTarget(O),v!==null&&k.setRel(v),m!==void 0&&k.setTitle(m);return}}let I=null,G=null;w.forEach(k=>{var P=k.getParent();if(P!==G&&P!==null&&(!t.$isElementNode(k)||k.isInline()))if(f(P))G=P,P.setURL(S),O!==void 0&&P.setTarget(O),v!==null&&G.setRel(v),m!==void 0&&G.setTitle(m);else if(P.is(I)||(I=P,G=d(S,{rel:v,target:O,title:m}),f(P)?k.getPreviousSibling()===null?P.insertBefore(G):P.insertAfter(G):k.insertBefore(G)),f(k)){if(!k.is(G)){if(G!==null){P=k.getChildren();for(let H=0;H<P.length;H++)G.append(P[H])}k.remove()}}else G!==null&&G.append(k)})}},Oi}var vu,xh;function xd(){return xh||(xh=1,vu=process.env.NODE_ENV==="development"?MC():RC()),vu}var vh;function bC(){if(vh)return xu;vh=1;var e=xd(),t=qn(),n=pn(),r=jt(),l=rt;function d({validateUrl:f}){const[p]=t.useLexicalComposerContext();return l.useEffect(()=>{if(!p.hasNodes([e.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(p.registerCommand(e.TOGGLE_LINK_COMMAND,_=>{if(_===null)return e.toggleLink(_),!0;if(typeof _=="string")return f===void 0||f(_)?(e.toggleLink(_),!0):!1;{const{url:E,target:T,rel:S,title:w}=_;return e.toggleLink(E,{rel:S,target:T,title:w}),!0}},r.COMMAND_PRIORITY_LOW),f!==void 0?p.registerCommand(r.PASTE_COMMAND,_=>{const E=r.$getSelection();if(!r.$isRangeSelection(E)||E.isCollapsed()||!(_ instanceof ClipboardEvent)||_.clipboardData==null)return!1;const T=_.clipboardData.getData("text");return f(T)?E.getNodes().some(S=>r.$isElementNode(S))?!1:(p.dispatchCommand(e.TOGGLE_LINK_COMMAND,T),_.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[p,f]),null}return xu.LinkPlugin=d,xu}var Su={},Sh;function LC(){if(Sh)return Su;Sh=1;var e=xd(),t=qn(),n=pn(),r=jt(),l=rt;return Su.LinkPlugin=function({validateUrl:d}){let[f]=t.useLexicalComposerContext();return l.useEffect(()=>{if(!f.hasNodes([e.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return n.mergeRegister(f.registerCommand(e.TOGGLE_LINK_COMMAND,p=>{if(p===null)return e.toggleLink(p),!0;if(typeof p=="string")return d===void 0||d(p)?(e.toggleLink(p),!0):!1;let{url:_,target:E,rel:T,title:S}=p;return e.toggleLink(_,{rel:T,target:E,title:S}),!0},r.COMMAND_PRIORITY_LOW),d!==void 0?f.registerCommand(r.PASTE_COMMAND,p=>{let _=r.$getSelection();if(!r.$isRangeSelection(_)||_.isCollapsed()||!(p instanceof ClipboardEvent)||p.clipboardData==null)return!1;let E=p.clipboardData.getData("text");return d(E)?_.getNodes().some(T=>r.$isElementNode(T))?!1:(f.dispatchCommand(e.TOGGLE_LINK_COMMAND,E),p.preventDefault(),!0):!1},r.COMMAND_PRIORITY_LOW):()=>{})},[f,d]),null},Su}const IC=process.env.NODE_ENV==="development"?bC():LC();var kC=IC,wu={},Jt={},wh;function PC(){if(wh)return Jt;wh=1;var e=jt(),t=pn();class n extends e.INTERNAL_PointSelection{constructor(ie,le,ve){super(le,ve),this.gridKey=ie}getCachedNodes(){return this._cachedNodes}setCachedNodes(ie){this._cachedNodes=ie}is(ie){return r(ie)?this.gridKey===ie.gridKey&&this.anchor.is(ie.anchor)&&this.focus.is(ie.focus):!1}set(ie,le,ve){this.dirty=!0,this.gridKey=ie,this.anchor.key=le,this.focus.key=ve,this._cachedNodes=null}clone(){return new n(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(ie){}insertText(){}insertNodes(ie){const le=this.focus.getNode();if(!e.$isElementNode(le))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(le.select(0,le.getChildrenSize())).insertNodes(ie)}getShape(){const ie=e.$getNodeByKey(this.anchor.key);if(!e.DEPRECATED_$isGridCellNode(ie))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");const le=e.DEPRECATED_$getGridCellNodeRect(ie);if(le===null)throw Error("getCellRect: expected to find AnchorNode");const ve=e.$getNodeByKey(this.focus.key);if(!e.DEPRECATED_$isGridCellNode(ve))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const Le=e.DEPRECATED_$getGridCellNodeRect(ve);if(Le===null)throw Error("getCellRect: expected to find focusCellNode");const Me=Math.min(le.columnIndex,Le.columnIndex),je=Math.max(le.columnIndex,Le.columnIndex),it=Math.min(le.rowIndex,Le.rowIndex),st=Math.max(le.rowIndex,Le.rowIndex);return{fromX:Math.min(Me,je),fromY:Math.min(it,st),toX:Math.max(Me,je),toY:Math.max(it,st)}}getNodes(){const ie=this._cachedNodes;if(ie!==null)return ie;const le=this.anchor.getNode(),ve=this.focus.getNode(),Le=t.$findMatchingParent(le,e.DEPRECATED_$isGridCellNode),Me=t.$findMatchingParent(ve,e.DEPRECATED_$isGridCellNode);if(!e.DEPRECATED_$isGridCellNode(Le))throw Error("Expected GridSelection anchor to be (or a child of) GridCellNode");if(!e.DEPRECATED_$isGridCellNode(Me))throw Error("Expected GridSelection focus to be (or a child of) GridCellNode");const je=Le.getParent();if(!e.DEPRECATED_$isGridRowNode(je))throw Error("Expected anchorCell to have a parent GridRowNode");const it=je.getParent();if(!e.DEPRECATED_$isGridNode(it))throw Error("Expected tableNode to have a parent GridNode");const st=Me.getParents()[1];if(st!==it){if(it.isParentOf(Me)){const It=st.getParent();if(It==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,Me.getKey(),It.getKey())}else{const It=it.getParent();if(It==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,It.getKey(),Me.getKey())}return this.getNodes()}const[ot,St,Ge]=e.DEPRECATED_$computeGridMap(it,Le,Me);let ze=Math.min(St.startColumn,Ge.startColumn),tt=Math.min(St.startRow,Ge.startRow),yt=Math.max(St.startColumn+St.cell.__colSpan-1,Ge.startColumn+Ge.cell.__colSpan-1),Nt=Math.max(St.startRow+St.cell.__rowSpan-1,Ge.startRow+Ge.cell.__rowSpan-1),Et=ze,gt=tt,xt=ze,mt=tt;function $t(It){const{cell:Vt,startColumn:bt,startRow:rn}=It;ze=Math.min(ze,bt),tt=Math.min(tt,rn),yt=Math.max(yt,bt+Vt.__colSpan-1),Nt=Math.max(Nt,rn+Vt.__rowSpan-1)}for(;ze<Et||tt<gt||yt>xt||Nt>mt;){if(ze<Et){const It=mt-gt,Vt=Et-1;for(let bt=0;bt<=It;bt++)$t(ot[gt+bt][Vt]);Et=Vt}if(tt<gt){const It=xt-Et,Vt=gt-1;for(let bt=0;bt<=It;bt++)$t(ot[Vt][Et+bt]);gt=Vt}if(yt>xt){const It=mt-gt,Vt=xt+1;for(let bt=0;bt<=It;bt++)$t(ot[gt+bt][Vt]);xt=Vt}if(Nt>mt){const It=xt-Et,Vt=mt+1;for(let bt=0;bt<=It;bt++)$t(ot[Vt][Et+bt]);mt=Vt}}const Kt=[it];let nn=null;for(let It=tt;It<=Nt;It++)for(let Vt=ze;Vt<=yt;Vt++){const{cell:bt}=ot[It][Vt],rn=bt.getParent();if(!e.DEPRECATED_$isGridRowNode(rn))throw Error("Expected GridCellNode parent to be a GridRowNode");rn!==nn&&Kt.push(rn),Kt.push(bt,...d(bt)),nn=rn}return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=Kt),Kt}getTextContent(){const ie=this.getNodes();let le="";for(let ve=0;ve<ie.length;ve++)le+=ie[ve].getTextContent();return le}}function r(Oe){return Oe instanceof n}function l(){const Oe=e.$createPoint("root",0,"element"),ie=e.$createPoint("root",0,"element");return new n("root",Oe,ie)}function d(Oe){const ie=[],le=[Oe];for(;le.length>0;){const ve=le.pop();if(ve===void 0)throw Error("Stack.length > 0; can't be undefined");e.$isElementNode(ve)&&le.unshift(...ve.getChildren()),ve!==Oe&&ie.push(ve)}return ie}const f=/^(\d+(?:\.\d+)?)px$/,p={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class _ extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(ie){const le=new _(ie.__headerState,ie.__colSpan,ie.__width,ie.__key);return le.__rowSpan=ie.__rowSpan,le.__backgroundColor=ie.__backgroundColor,le}static importDOM(){return{td:ie=>({conversion:E,priority:0}),th:ie=>({conversion:E,priority:0})}}static importJSON(ie){const le=ie.colSpan||1,ve=ie.rowSpan||1,Le=T(ie.headerState,le,ie.width||void 0);return Le.__rowSpan=ve,Le.__backgroundColor=ie.backgroundColor||null,Le}constructor(ie=p.NO_STATUS,le=1,ve,Le){super(le,Le),this.__headerState=ie,this.__width=ve,this.__backgroundColor=null}createDOM(ie){const le=document.createElement(this.getTag());return this.__width&&(le.style.width=`${this.__width}px`),this.__colSpan>1&&(le.colSpan=this.__colSpan),this.__rowSpan>1&&(le.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(le.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(le,ie.theme.tableCell,this.hasHeader()&&ie.theme.tableCellHeader),le}exportDOM(ie){const{element:le}=super.exportDOM(ie);if(le){const ve=le,Le=700,Me=this.getParentOrThrow().getChildrenSize();ve.style.border="1px solid black",this.__colSpan>1&&(ve.colSpan=this.__colSpan),this.__rowSpan>1&&(ve.rowSpan=this.__rowSpan),ve.style.width=`${this.getWidth()||Math.max(90,Le/Me)}px`,ve.style.verticalAlign="top",ve.style.textAlign="start";const je=this.getBackgroundColor();je!==null?ve.style.backgroundColor=je:this.hasHeader()&&(ve.style.backgroundColor="#f2f3f5")}return{element:le}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(ie){const le=this.getWritable();return le.__headerState=ie,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(ie){const le=this.getWritable();return le.__width=ie,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(ie){this.getWritable().__backgroundColor=ie}toggleHeaderStyle(ie){const le=this.getWritable();return(le.__headerState&ie)===ie?le.__headerState-=ie:le.__headerState+=ie,le}hasHeaderState(ie){return(this.getHeaderStyles()&ie)===ie}hasHeader(){return this.getLatest().__headerState!==p.NO_STATUS}updateDOM(ie){return ie.__headerState!==this.__headerState||ie.__width!==this.__width||ie.__colSpan!==this.__colSpan||ie.__rowSpan!==this.__rowSpan||ie.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function E(Oe){const ie=Oe,le=Oe.nodeName.toLowerCase();let ve;f.test(ie.style.width)&&(ve=parseFloat(ie.style.width));const Le=T(le==="th"?p.ROW:p.NO_STATUS,ie.colSpan,ve);Le.__rowSpan=ie.rowSpan;const Me=ie.style.backgroundColor;return Me!==""&&(Le.__backgroundColor=Me),{forChild:(je,it)=>{if(S(it)&&!e.$isElementNode(je)){const st=e.$createParagraphNode();return e.$isLineBreakNode(je)&&je.getTextContent()===`
|
|
79
|
+
`?null:(st.append(je),st)}return je},node:Le}}function T(Oe,ie=1,le){return e.$applyNodeReplacement(new _(Oe,ie,le))}function S(Oe){return Oe instanceof _}class w extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(ie){return new w(ie.__height,ie.__key)}static importDOM(){return{tr:ie=>({conversion:O,priority:0})}}static importJSON(ie){return m(ie.height)}constructor(ie,le){super(le),this.__height=ie}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(ie){const le=document.createElement("tr");return this.__height&&(le.style.height=`${this.__height}px`),t.addClassNamesToElement(le,ie.theme.tableRow),le}isShadowRoot(){return!0}setHeight(ie){const le=this.getWritable();return le.__height=ie,this.__height}getHeight(){return this.getLatest().__height}updateDOM(ie){return ie.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function O(Oe){const ie=Oe;let le;return f.test(ie.style.height)&&(le=parseFloat(ie.style.height)),{node:m(le)}}function m(Oe){return e.$applyNodeReplacement(new w(Oe))}function v(Oe){return Oe instanceof w}const I=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",G=Oe=>I?(Oe||window).getSelection():null;class k{constructor(ie,le){this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.listenersToRemove=new Set,this.tableNodeKey=le,this.editor=ie,this.grid={cells:[],columns:0,rows:0},this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(ie=>ie())}trackTableGrid(){const ie=new MutationObserver(le=>{this.editor.update(()=>{let ve=!1;for(let Me=0;Me<le.length;Me++){const st=le[Me].target.nodeName;if(st==="TABLE"||st==="TR"){ve=!0;break}}if(!ve)return;const Le=this.editor.getElementByKey(this.tableNodeKey);if(!Le)throw new Error("Expected to find TableElement in DOM");this.grid=ce(Le)})});this.editor.update(()=>{const le=this.editor.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");this.grid=ce(le),ie.observe(le,{childList:!0,subtree:!0})})}clearHighlight(){const ie=this.editor;this.isHighlightingCells=!1,this.anchorX=-1,this.anchorY=-1,this.focusX=-1,this.focusY=-1,this.gridSelection=null,this.anchorCellNodeKey=null,this.focusCellNodeKey=null,this.anchorCell=null,this.focusCell=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),ie.update(()=>{const le=e.$getNodeByKey(this.tableNodeKey);if(!B(le))throw new Error("Expected TableNode.");const ve=ie.getElementByKey(this.tableNodeKey);if(!ve)throw new Error("Expected to find TableElement in DOM");const Le=ce(ve);V(ie,Le,null),e.$setSelection(null),ie.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){const ie=this.editor;ie.update(()=>{const le=ie.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(le,ie._config.theme.tableSelection),le.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){const ie=this.editor;ie.update(()=>{const le=ie.getElementByKey(this.tableNodeKey);if(!le)throw new Error("Expected to find TableElement in DOM");t.addClassNamesToElement(le,ie._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(ie){if(ie!=null&&ie.gridKey===this.tableNodeKey){const le=this.editor;this.gridSelection=ie,this.isHighlightingCells=!0,this.disableHighlightStyle(),V(le,this.grid,this.gridSelection)}else ie==null?this.clearHighlight():(this.tableNodeKey=ie.gridKey,this.updateTableGridSelection(ie))}setFocusCellForSelection(ie,le=!1){const ve=this.editor;ve.update(()=>{const Le=e.$getNodeByKey(this.tableNodeKey);if(!B(Le))throw new Error("Expected TableNode.");if(!ve.getElementByKey(this.tableNodeKey))throw new Error("Expected to find TableElement in DOM");const je=ie.x,it=ie.y;if(this.focusCell=ie,this.anchorCell!==null){const st=G(ve._window);st&&st.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==je||this.anchorY!==it||le))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(je===this.focusX&&it===this.focusY)return;if(this.focusX=je,this.focusY=it,this.isHighlightingCells){const st=e.$getNearestNodeFromDOMNode(ie.elem);if(this.gridSelection!=null&&this.anchorCellNodeKey!=null&&S(st)){const ot=st.getKey();this.gridSelection=this.gridSelection.clone()||l(),this.focusCellNodeKey=ot,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),ve.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),V(ve,this.grid,this.gridSelection)}}})}setAnchorCellForSelection(ie){this.isHighlightingCells=!1,this.anchorCell=ie,this.anchorX=ie.x,this.anchorY=ie.y,this.editor.update(()=>{const le=e.$getNearestNodeFromDOMNode(ie.elem);if(S(le)){const ve=le.getKey();this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():l(),this.anchorCellNodeKey=ve}})}formatCells(ie){this.editor.update(()=>{const le=e.$getSelection();if(!r(le))throw Error("Expected grid selection");const ve=e.$createRangeSelection(),Le=ve.anchor,Me=ve.focus;le.getNodes().forEach(je=>{S(je)&&je.getTextContentSize()!==0&&(Le.set(je.getKey(),0,"element"),Me.set(je.getKey(),je.getChildrenSize(),"element"),ve.formatText(ie))}),e.$setSelection(le),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){const ie=this.editor;ie.update(()=>{const le=e.$getNodeByKey(this.tableNodeKey);if(!B(le))throw new Error("Expected TableNode.");const ve=e.$getSelection();if(!r(ve))throw Error("Expected grid selection");const Le=ve.getNodes().filter(S);if(Le.length===this.grid.columns*this.grid.rows){le.selectPrevious(),le.remove(),e.$getRoot().selectStart();return}Le.forEach(Me=>{if(e.$isElementNode(Me)){const je=e.$createParagraphNode(),it=e.$createTextNode();je.append(it),Me.append(je),Me.getChildren().forEach(st=>{st!==je&&st.remove()})}}),V(ie,this.grid,null),e.$setSelection(null),ie.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}}const P="__lexicalTableSelection";function H(Oe,ie,le,ve){const Le=le.getRootElement();if(Le===null)throw new Error("No root element.");const Me=new k(le,Oe.getKey()),je=le._window||window;j(ie,Me),ie.addEventListener("mousedown",Ge=>{setTimeout(()=>{if(Ge.button!==0||!je)return;const ze=te(Ge.target);ze!==null&&(R(Ge),Me.setAnchorCellForSelection(ze));const tt=()=>{je.removeEventListener("mouseup",tt),je.removeEventListener("mousemove",yt)},yt=Nt=>{const Et=te(Nt.target);Et!==null&&(Me.anchorX!==Et.x||Me.anchorY!==Et.y)&&(Nt.preventDefault(),Me.setFocusCellForSelection(Et))};je.addEventListener("mouseup",tt),je.addEventListener("mousemove",yt)},0)});const it=Ge=>{Ge.button===0&&le.update(()=>{const ze=e.$getSelection(),tt=Ge.target;r(ze)&&ze.gridKey===Me.tableNodeKey&&Le.contains(tt)&&Me.clearHighlight()})};je.addEventListener("mousedown",it),Me.listenersToRemove.add(()=>je.removeEventListener("mousedown",it)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ge=>J(le,Ge,"down",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_UP_COMMAND,Ge=>J(le,Ge,"up",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ge=>J(le,Ge,"backward",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ge=>J(le,Ge,"forward",Oe,Me),e.COMMAND_PRIORITY_HIGH)),Me.listenersToRemove.add(le.registerCommand(e.KEY_ESCAPE_COMMAND,Ge=>{const ze=e.$getSelection();if(r(ze)){const tt=t.$findMatchingParent(ze.focus.getNode(),S);if(S(tt))return R(Ge),tt.selectEnd(),!0}return!1},e.COMMAND_PRIORITY_HIGH));const st=Ge=>()=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Me.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>S(Kt));if(!S(tt))return!1;const yt=ze.anchor.getNode(),Nt=ze.focus.getNode(),Et=Oe.isParentOf(yt),gt=Oe.isParentOf(Nt);if(Et&&!gt||gt&&!Et)return Me.clearText(),!0;const mt=t.$findMatchingParent(ze.anchor.getNode(),Kt=>e.$isElementNode(Kt)),$t=mt&&t.$findMatchingParent(mt,Kt=>e.$isElementNode(Kt)&&S(Kt.getParent()));if(!e.$isElementNode($t)||!e.$isElementNode(mt))return!1;if(Ge===e.DELETE_LINE_COMMAND&&$t.getPreviousSibling()===null)return!0;if((Ge===e.DELETE_CHARACTER_COMMAND||Ge===e.DELETE_WORD_COMMAND)&&ze.isCollapsed()&&ze.anchor.offset===0&&mt!==$t){const Kt=mt.getChildren(),nn=e.$createParagraphNode();return Kt.forEach(It=>nn.append(It)),mt.replace(nn),mt.getWritable().__parent=tt.getKey(),!0}}return!1};[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ge=>{Me.listenersToRemove.add(le.registerCommand(Ge,st(Ge),e.COMMAND_PRIORITY_CRITICAL))});const ot=Ge=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Ge.preventDefault(),Ge.stopPropagation(),Me.clearText(),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1};Me.listenersToRemove.add(le.registerCommand(e.KEY_BACKSPACE_COMMAND,ot,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.KEY_DELETE_COMMAND,ot,e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.FORMAT_TEXT_COMMAND,Ge=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Me.formatCells(Ge),!0;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,Ge=>{const ze=e.$getSelection();if(!de(ze,Oe))return!1;if(r(ze))return Me.clearHighlight(),!1;if(e.$isRangeSelection(ze)){const tt=t.$findMatchingParent(ze.anchor.getNode(),yt=>S(yt));if(!S(tt))return!1}return!1},e.COMMAND_PRIORITY_CRITICAL)),ve&&Me.listenersToRemove.add(le.registerCommand(e.KEY_TAB_COMMAND,Ge=>{const ze=e.$getSelection();if(!e.$isRangeSelection(ze)||!ze.isCollapsed()||!de(ze,Oe))return!1;const tt=Y(ze.anchor.getNode());if(tt===null)return!1;R(Ge);const yt=Oe.getCordsFromCellNode(tt,Me.grid);return Se(Me,Oe,yt.x,yt.y,Ge.shiftKey?"backward":"forward"),!0},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.FOCUS_COMMAND,Ge=>Oe.isSelected(),e.COMMAND_PRIORITY_HIGH));function St(Ge){const ze=Oe.getCordsFromCellNode(Ge,Me.grid);return Oe.getCellFromCordsOrThrow(ze.x,ze.y,Me.grid)}return Me.listenersToRemove.add(le.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ge=>{const{nodes:ze,selection:tt}=Ge,yt=e.$INTERNAL_isPointSelection(tt),Nt=e.$isRangeSelection(tt),Et=Nt&&t.$findMatchingParent(tt.anchor.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht))!==null&&t.$findMatchingParent(tt.focus.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht))!==null||yt&&!Nt;if(ze.length!==1||!e.DEPRECATED_$isGridNode(ze[0])||!Et)return!1;const{anchor:gt}=tt,xt=ze[0],mt=xt.getChildren(),$t=xt.getFirstChildOrThrow().getChildrenSize(),Kt=xt.getChildrenSize(),nn=t.$findMatchingParent(gt.getNode(),Ht=>e.DEPRECATED_$isGridCellNode(Ht)),It=nn&&t.$findMatchingParent(nn,Ht=>e.DEPRECATED_$isGridRowNode(Ht)),Vt=It&&t.$findMatchingParent(It,Ht=>e.DEPRECATED_$isGridNode(Ht));if(!e.DEPRECATED_$isGridCellNode(nn)||!e.DEPRECATED_$isGridRowNode(It)||!e.DEPRECATED_$isGridNode(Vt))return!1;const bt=It.getIndexWithinParent(),rn=Math.min(Vt.getChildrenSize()-1,bt+Kt-1),Or=nn.getIndexWithinParent(),_i=Math.min(It.getChildrenSize()-1,Or+$t-1),pe=Math.min(Or,_i),Ze=Math.min(bt,rn),lt=Math.max(Or,_i),wt=Math.max(bt,rn),Gt=Vt.getChildren();let Bt=0,Pt,kt;for(let Ht=Ze;Ht<=wt;Ht++){const on=Gt[Ht];if(!e.DEPRECATED_$isGridRowNode(on))return!1;const an=mt[Bt];if(!e.DEPRECATED_$isGridRowNode(an))return!1;const bn=on.getChildren(),yr=an.getChildren();let Zn=0;for(let fn=pe;fn<=lt;fn++){const sr=bn[fn];if(!e.DEPRECATED_$isGridCellNode(sr))return!1;const or=yr[Zn];if(!e.DEPRECATED_$isGridCellNode(or))return!1;Ht===Ze&&fn===pe?Pt=sr.getKey():Ht===wt&&fn===lt&&(kt=sr.getKey());const Ai=sr.getChildren();or.getChildren().forEach(Nr=>{e.$isTextNode(Nr)&&e.$createParagraphNode().append(Nr),sr.append(Nr)}),Ai.forEach(Nr=>Nr.remove()),Zn++}Bt++}if(Pt&&kt){const Ht=l();Ht.set(ze[0].getKey(),Pt,kt),e.$setSelection(Ht)}return!0},e.COMMAND_PRIORITY_CRITICAL)),Me.listenersToRemove.add(le.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{const Ge=e.$getSelection(),ze=e.$getPreviousSelection();if(e.$isRangeSelection(Ge)){const{anchor:tt,focus:yt}=Ge,Nt=tt.getNode(),Et=yt.getNode(),gt=Y(Nt),xt=Y(Et),mt=gt&&Oe.is(W(gt)),$t=xt&&Oe.is(W(xt)),Kt=mt!==$t,nn=mt&&$t,It=Ge.isBackward();if(Kt){const Vt=Ge.clone();Vt.focus.set(Oe.getKey(),It?0:Oe.getChildrenSize(),"element"),e.$setSelection(Vt),q(le,Me)}else nn&&(gt.is(xt)||(Me.setAnchorCellForSelection(St(gt)),Me.setFocusCellForSelection(St(xt),!0)))}return Ge&&!Ge.is(ze)&&(r(Ge)||r(ze))&&Me.gridSelection&&!Me.gridSelection.is(ze)?(r(Ge)&&Ge.gridKey===Me.tableNodeKey?Me.updateTableGridSelection(Ge):!r(Ge)&&r(ze)&&ze.gridKey===Me.tableNodeKey&&Me.updateTableGridSelection(null),!1):(Me.hasHijackedSelectionStyles&&!Oe.isSelected()?Te(le,Me):!Me.hasHijackedSelectionStyles&&Oe.isSelected()&&q(le,Me),!1)},e.COMMAND_PRIORITY_CRITICAL)),Me}function j(Oe,ie){Oe[P]=ie}function re(Oe){return Oe[P]}function te(Oe){let ie=Oe;for(;ie!=null;){const le=ie.nodeName;if(le==="TD"||le==="TH"){const ve=ie._cell;return ve===void 0?null:ve}ie=ie.parentNode}return null}function ce(Oe){const ie=[],le={cells:ie,columns:0,rows:0};let ve=Oe.firstChild,Le=0,Me=0;for(ie.length=0;ve!=null;){const je=ve.nodeName;if(je==="TD"||je==="TH"){const ot=ve,St={elem:ot,hasBackgroundColor:ot.style.backgroundColor!=="",highlighted:!1,x:Le,y:Me};ve._cell=St;let Ge=ie[Me];Ge===void 0&&(Ge=ie[Me]=[]),Ge[Le]=St}else{const ot=ve.firstChild;if(ot!=null){ve=ot;continue}}const it=ve.nextSibling;if(it!=null){Le++,ve=it;continue}const st=ve.parentNode;if(st!=null){const ot=st.nextSibling;if(ot==null)break;Me++,Le=0,ve=ot}}return le.columns=Le+1,le.rows=Me+1,le}function V(Oe,ie,le){const ve=new Set(le?le.getNodes():[]);z(ie,(Le,Me)=>{const je=Le.elem;ve.has(Me)?(Le.highlighted=!0,Z(Oe,Le)):(Le.highlighted=!1,oe(Oe,Le),je.getAttribute("style")||je.removeAttribute("style"))})}function z(Oe,ie){const{cells:le}=Oe;for(let ve=0;ve<le.length;ve++){const Le=le[ve];if(Le)for(let Me=0;Me<Le.length;Me++){const je=Le[Me];if(!je)continue;const it=e.$getNearestNodeFromDOMNode(je.elem);it!==null&&ie(je,it,{x:Me,y:ve})}}}function q(Oe,ie){ie.disableHighlightStyle(),z(ie.grid,le=>{le.highlighted=!0,Z(Oe,le)})}function Te(Oe,ie){ie.enableHighlightStyle(),z(ie.grid,le=>{const ve=le.elem;le.highlighted=!1,oe(Oe,le),ve.getAttribute("style")||ve.removeAttribute("style")})}const Se=(Oe,ie,le,ve,Le)=>{const Me=Le==="forward";switch(Le){case"backward":case"forward":return le!==(Me?Oe.grid.columns-1:0)?K(ie.getCellNodeFromCordsOrThrow(le+(Me?1:-1),ve,Oe.grid),Me):ve!==(Me?Oe.grid.rows-1:0)?K(ie.getCellNodeFromCordsOrThrow(Me?0:Oe.grid.columns-1,ve+(Me?1:-1),Oe.grid),Me):Me?ie.selectNext():ie.selectPrevious(),!0;case"up":return ve!==0?K(ie.getCellNodeFromCordsOrThrow(le,ve-1,Oe.grid),!1):ie.selectPrevious(),!0;case"down":return ve!==Oe.grid.rows-1?K(ie.getCellNodeFromCordsOrThrow(le,ve+1,Oe.grid),!0):ie.selectNext(),!0;default:return!1}},Ee=(Oe,ie,le,ve,Le)=>{const Me=Le==="forward";switch(Le){case"backward":case"forward":return le!==(Me?Oe.grid.columns-1:0)&&Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le+(Me?1:-1),ve,Oe.grid)),!0;case"up":return ve!==0?(Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le,ve-1,Oe.grid)),!0):!1;case"down":return ve!==Oe.grid.rows-1?(Oe.setFocusCellForSelection(ie.getCellFromCordsOrThrow(le,ve+1,Oe.grid)),!0):!1;default:return!1}};function de(Oe,ie){if(e.$isRangeSelection(Oe)||r(Oe)){const le=ie.isParentOf(Oe.anchor.getNode()),ve=ie.isParentOf(Oe.focus.getNode());return le&&ve}return!1}function K(Oe,ie){ie?Oe.selectStart():Oe.selectEnd()}const D="172,206,247";function Z(Oe,ie){const le=ie.elem,ve=e.$getNearestNodeFromDOMNode(le);if(!S(ve))throw Error("Expected to find LexicalNode from Table Cell DOMNode");ve.getBackgroundColor()===null?le.style.setProperty("background-color",`rgb(${D})`):le.style.setProperty("background-image",`linear-gradient(to right, rgba(${D},0.85), rgba(${D},0.85))`),le.style.setProperty("caret-color","transparent")}function oe(Oe,ie){const le=ie.elem,ve=e.$getNearestNodeFromDOMNode(le);if(!S(ve))throw Error("Expected to find LexicalNode from Table Cell DOMNode");ve.getBackgroundColor()===null&&le.style.removeProperty("background-color"),le.style.removeProperty("background-image"),le.style.removeProperty("caret-color")}function Y(Oe){const ie=t.$findMatchingParent(Oe,S);return S(ie)?ie:null}function W(Oe){const ie=t.$findMatchingParent(Oe,B);return B(ie)?ie:null}function J(Oe,ie,le,ve,Le){const Me=e.$getSelection();if(!de(Me,ve))return!1;if(e.$isRangeSelection(Me)&&Me.isCollapsed()){if(le==="backward"||le==="forward")return!1;const{anchor:je,focus:it}=Me,st=t.$findMatchingParent(je.getNode(),S),ot=t.$findMatchingParent(it.getNode(),S);if(!S(st)||!st.is(ot))return!1;const St=W(st);if(St!==ve&&St!=null){const xt=Oe.getElementByKey(St.getKey());if(xt!=null)return Le.grid=ce(xt),J(Oe,ie,le,St,Le)}const Ge=Oe.getElementByKey(st.__key),ze=Oe.getElementByKey(je.key);if(ze==null||Ge==null)return!1;let tt;if(je.type==="element")tt=ze.getBoundingClientRect();else{const xt=window.getSelection();if(xt===null||xt.rangeCount===0)return!1;tt=xt.getRangeAt(0).getBoundingClientRect()}const yt=le==="up"?st.getFirstChild():st.getLastChild();if(yt==null)return!1;const Nt=Oe.getElementByKey(yt.__key);if(Nt==null)return!1;const Et=Nt.getBoundingClientRect();if(le==="up"?Et.top>tt.top-tt.height:tt.bottom+tt.height>Et.bottom){R(ie);const xt=ve.getCordsFromCellNode(st,Le.grid);if(ie.shiftKey){const mt=ve.getCellFromCordsOrThrow(xt.x,xt.y,Le.grid);Le.setAnchorCellForSelection(mt),Le.setFocusCellForSelection(mt,!0)}else return Se(Le,ve,xt.x,xt.y,le);return!0}}else if(r(Me)){const{anchor:je,focus:it}=Me,st=t.$findMatchingParent(je.getNode(),S),ot=t.$findMatchingParent(it.getNode(),S),[St]=Me.getNodes(),Ge=Oe.getElementByKey(St.getKey());if(!S(st)||!S(ot)||!B(St)||Ge==null)return!1;Le.updateTableGridSelection(Me);const ze=ce(Ge),tt=ve.getCordsFromCellNode(st,ze),yt=ve.getCellFromCordsOrThrow(tt.x,tt.y,ze);if(Le.setAnchorCellForSelection(yt),R(ie),ie.shiftKey){const Nt=ve.getCordsFromCellNode(ot,ze);return Ee(Le,St,Nt.x,Nt.y,le)}else ot.selectEnd();return!0}return!1}function R(Oe){Oe.preventDefault(),Oe.stopImmediatePropagation(),Oe.stopPropagation()}class U extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(ie){return new U(ie.__key)}static importDOM(){return{table:ie=>({conversion:fe,priority:1})}}static importJSON(ie){return _e()}constructor(ie){super(ie)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(ie,le){const ve=document.createElement("table");return t.addClassNamesToElement(ve,ie.theme.table),ve}updateDOM(){return!1}exportDOM(ie){return{...super.exportDOM(ie),after:le=>{if(le){const ve=le.cloneNode(),Le=document.createElement("colgroup"),Me=document.createElement("tbody");t.isHTMLElement(le)&&Me.append(...le.children);const je=this.getFirstChildOrThrow();if(!v(je))throw new Error("Expected to find row node.");const it=je.getChildrenSize();for(let st=0;st<it;st++){const ot=document.createElement("col");Le.append(ot)}return ve.replaceChildren(Le,Me),ve}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(ie,le){const{rows:ve,cells:Le}=le;for(let Me=0;Me<ve;Me++){const je=Le[Me];if(je==null)continue;const it=je.findIndex(st=>{if(!st)return;const{elem:ot}=st;return e.$getNearestNodeFromDOMNode(ot)===ie});if(it!==-1)return{x:it,y:Me}}throw new Error("Cell not found in table.")}getCellFromCords(ie,le,ve){const{cells:Le}=ve,Me=Le[le];if(Me==null)return null;const je=Me[ie];return je??null}getCellFromCordsOrThrow(ie,le,ve){const Le=this.getCellFromCords(ie,le,ve);if(!Le)throw new Error("Cell not found at cords.");return Le}getCellNodeFromCords(ie,le,ve){const Le=this.getCellFromCords(ie,le,ve);if(Le==null)return null;const Me=e.$getNearestNodeFromDOMNode(Le.elem);return S(Me)?Me:null}getCellNodeFromCordsOrThrow(ie,le,ve){const Le=this.getCellNodeFromCords(ie,le,ve);if(!Le)throw new Error("Node at cords not TableCellNode.");return Le}canSelectBefore(){return!0}canIndent(){return!1}}function X(Oe,ie){const le=Oe.getElementByKey(ie.getKey());if(le==null)throw new Error("Table Element Not Found");return ce(le)}function fe(Oe){return{node:_e()}}function _e(){return e.$applyNodeReplacement(new U)}function B(Oe){return Oe instanceof U}function M(Oe,ie,le=!0){const ve=_e();for(let Le=0;Le<Oe;Le++){const Me=m();for(let je=0;je<ie;je++){let it=p.NO_STATUS;typeof le=="object"?(Le===0&&le.rows&&(it|=p.ROW),je===0&&le.columns&&(it|=p.COLUMN)):le&&(Le===0&&(it|=p.ROW),je===0&&(it|=p.COLUMN));const st=T(it),ot=e.$createParagraphNode();ot.append(e.$createTextNode()),st.append(ot),Me.append(st)}ve.append(Me)}return ve}function F(Oe){const ie=t.$findMatchingParent(Oe,le=>S(le));return S(ie)?ie:null}function se(Oe){const ie=t.$findMatchingParent(Oe,le=>v(le));if(v(ie))return ie;throw new Error("Expected table cell to be inside of table row.")}function ye(Oe){const ie=t.$findMatchingParent(Oe,le=>B(le));if(B(ie))return ie;throw new Error("Expected table cell to be inside of table.")}function De(Oe){const ie=se(Oe);return ye(ie).getChildren().findIndex(ve=>ve.is(ie))}function ee(Oe){return se(Oe).getChildren().findIndex(le=>le.is(Oe))}function ne(Oe,ie){const le=ye(Oe),{x:ve,y:Le}=le.getCordsFromCellNode(Oe,ie);return{above:le.getCellNodeFromCords(ve,Le-1,ie),below:le.getCellNodeFromCords(ve,Le+1,ie),left:le.getCellNodeFromCords(ve-1,Le,ie),right:le.getCellNodeFromCords(ve+1,Le,ie)}}function ue(Oe,ie){const le=Oe.getChildren();if(ie>=le.length||ie<0)throw new Error("Expected table cell to be inside of table row.");return le[ie].remove(),Oe}function be(Oe,ie,le=!0,ve,Le){const Me=Oe.getChildren();if(ie>=Me.length||ie<0)throw new Error("Table row target index out of range");const je=Me[ie];if(v(je))for(let it=0;it<ve;it++){const st=je.getChildren(),ot=st.length,St=m();for(let Ge=0;Ge<ot;Ge++){const ze=st[Ge];if(!S(ze))throw Error("Expected table cell");const{above:tt,below:yt}=ne(ze,Le);let Nt=p.NO_STATUS;const Et=tt&&tt.getWidth()||yt&&yt.getWidth()||void 0;(tt&&tt.hasHeaderState(p.COLUMN)||yt&&yt.hasHeaderState(p.COLUMN))&&(Nt|=p.COLUMN);const gt=T(Nt,1,Et);gt.append(e.$createParagraphNode()),St.append(gt)}le?je.insertAfter(St):je.insertBefore(St)}else throw new Error("Row before insertion index does not exist.");return Oe}function Ne(Oe=!0){const ie=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ie))throw Error("Expected a INTERNAL_PointSelection");const le=ie.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(le),[Me,je]=e.DEPRECATED_$computeGridMap(Le,ve,ve),it=Me[0].length,{startRow:st}=je;if(Oe){const ot=st+ve.__rowSpan-1,St=Me[ot],Ge=m();for(let tt=0;tt<it;tt++){const{cell:yt,startRow:Nt}=St[tt];Nt+yt.__rowSpan-1<=ot?Ge.append(T(p.NO_STATUS).append(e.$createParagraphNode())):yt.setRowSpan(yt.__rowSpan+1)}const ze=Le.getChildAtIndex(ot);if(!e.DEPRECATED_$isGridRowNode(ze))throw Error("focusEndRow is not a GridRowNode");ze.insertAfter(Ge)}else{const ot=Me[st],St=m();for(let ze=0;ze<it;ze++){const{cell:tt,startRow:yt}=ot[ze];yt===st?St.append(T(p.NO_STATUS).append(e.$createParagraphNode())):tt.setRowSpan(tt.__rowSpan+1)}const Ge=Le.getChildAtIndex(st);if(!e.DEPRECATED_$isGridRowNode(Ge))throw Error("focusEndRow is not a GridRowNode");Ge.insertBefore(St)}}function Re(Oe,ie,le=!0,ve,Le){const Me=Oe.getChildren(),je=[];for(let it=0;it<Me.length;it++){const st=Me[it];if(v(st))for(let ot=0;ot<ve;ot++){const St=st.getChildren();if(ie>=St.length||ie<0)throw new Error("Table column target index out of range");const Ge=St[ie];if(!S(Ge))throw Error("Expected table cell");const{left:ze,right:tt}=ne(Ge,Le);let yt=p.NO_STATUS;(ze&&ze.hasHeaderState(p.ROW)||tt&&tt.hasHeaderState(p.ROW))&&(yt|=p.ROW);const Nt=T(yt);Nt.append(e.$createParagraphNode()),je.push({newTableCell:Nt,targetCell:Ge})}}return je.forEach(({newTableCell:it,targetCell:st})=>{le?st.insertAfter(it):st.insertBefore(it)}),Oe}function ke(Oe=!0){const ie=e.$getSelection();if(!e.$INTERNAL_isPointSelection(ie))throw Error("Expected a PointSeleciton");const le=ie.anchor.getNode(),ve=ie.focus.getNode(),[Le]=e.DEPRECATED_$getNodeTriplet(le),[Me,,je]=e.DEPRECATED_$getNodeTriplet(ve),[it,st,ot]=e.DEPRECATED_$computeGridMap(je,Me,Le),St=it.length,Ge=Oe?Math.max(st.startColumn,ot.startColumn):Math.min(st.startColumn,ot.startColumn),ze=Oe?Ge+Me.__colSpan-1:Ge-1,tt=je.getFirstChild();if(!e.DEPRECATED_$isGridRowNode(tt))throw Error("Expected firstTable child to be a row");let yt=null;function Nt(){const gt=T(p.NO_STATUS).append(e.$createParagraphNode());return yt===null&&(yt=gt),gt}let Et=tt;e:for(let gt=0;gt<St;gt++){if(gt!==0){const nn=Et.getNextSibling();if(!e.DEPRECATED_$isGridRowNode(nn))throw Error("Expected row nextSibling to be a row");Et=nn}const xt=it[gt];if(ze<0){At(Et,Nt());continue}const{cell:mt,startColumn:$t,startRow:Kt}=xt[ze];if($t+mt.__colSpan-1<=ze){let nn=mt,It=Kt,Vt=ze;for(;It!==gt&&nn.__rowSpan>1;)if(Vt-=mt.__colSpan,Vt>=0){const{cell:bt,startRow:rn}=xt[Vt];nn=bt,It=rn}else{Et.append(Nt());continue e}nn.insertAfter(Nt())}else mt.setColSpan(mt.__colSpan+1)}yt!==null&&ut(yt)}function Fe(Oe,ie){const le=Oe.getChildren();for(let ve=0;ve<le.length;ve++){const Le=le[ve];if(v(Le)){const Me=Le.getChildren();if(ie>=Me.length||ie<0)throw new Error("Table column target index out of range");Me[ie].remove()}}return Oe}function qe(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),le=Oe.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(ie),[Me]=e.DEPRECATED_$getNodeTriplet(le),[je,it,st]=e.DEPRECATED_$computeGridMap(Le,ve,Me),{startRow:ot}=it,{startRow:St}=st,Ge=St+Me.__rowSpan-1;if(je.length===Ge-ot+1){Le.remove();return}const ze=je[0].length,tt=je[Ge+1],yt=Le.getChildAtIndex(Ge+1);for(let Nt=Ge;Nt>=ot;Nt--){for(let gt=ze-1;gt>=0;gt--){const{cell:xt,startRow:mt,startColumn:$t}=je[Nt][gt];if($t===gt&&(Nt===ot&&mt<ot&&xt.setRowSpan(xt.__rowSpan-(mt-ot)),mt>=ot&&mt+xt.__rowSpan-1>Ge)){if(xt.setRowSpan(xt.__rowSpan-(Ge-mt+1)),yt===null)throw Error("Expected nextRowNode not to be null");if(gt===0)At(yt,xt);else{const{cell:Kt}=tt[gt-1];Kt.insertAfter(xt)}}}const Et=Le.getChildAtIndex(Nt);if(!e.DEPRECATED_$isGridRowNode(Et))throw Error(`Expected GridNode childAtIndex(${String(Nt)}) to be RowNode`);Et.remove()}if(tt!==void 0){const{cell:Nt}=tt[0];ut(Nt)}else{const Nt=je[ot-1],{cell:Et}=Nt[0];ut(Et)}}function Be(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),le=Oe.focus.getNode(),[ve,,Le]=e.DEPRECATED_$getNodeTriplet(ie),[Me]=e.DEPRECATED_$getNodeTriplet(le),[je,it,st]=e.DEPRECATED_$computeGridMap(Le,ve,Me),{startColumn:ot}=it,{startRow:St,startColumn:Ge}=st,ze=Math.min(ot,Ge),tt=Math.max(ot+ve.__colSpan-1,Ge+Me.__colSpan-1),yt=tt-ze+1;if(je[0].length===tt-ze+1){Le.selectPrevious(),Le.remove();return}const Et=je.length;for(let mt=0;mt<Et;mt++)for(let $t=ze;$t<=tt;$t++){const{cell:Kt,startColumn:nn}=je[mt][$t];if(nn<ze){if($t===ze){const It=ze-nn;Kt.setColSpan(Kt.__colSpan-Math.min(yt,Kt.__colSpan-It))}}else if(nn+Kt.__colSpan-1>tt){if($t===tt){const It=tt-nn+1;Kt.setColSpan(Kt.__colSpan-It)}}else Kt.remove()}const gt=je[St],xt=gt[Ge+Me.__colSpan];if(xt!==void 0){const{cell:mt}=xt;ut(mt)}else{const mt=gt[Ge-1],{cell:$t}=mt;ut($t)}}function ut(Oe){const ie=Oe.getFirstDescendant();ie==null?Oe.selectStart():ie.getParentOrThrow().selectStart()}function At(Oe,ie){const le=Oe.getFirstChild();le!==null?le.insertBefore(ie):Oe.append(ie)}function Ut(){const Oe=e.$getSelection();if(!e.$INTERNAL_isPointSelection(Oe))throw Error("Expected a INTERNAL_PointSelection");const ie=Oe.anchor.getNode(),[le,ve,Le]=e.DEPRECATED_$getNodeTriplet(ie),Me=le.__colSpan,je=le.__rowSpan;if(Me>1){for(let it=1;it<Me;it++)le.insertAfter(T(p.NO_STATUS));le.setColSpan(1)}if(je>1){const[it,st]=e.DEPRECATED_$computeGridMap(Le,le,le),{startColumn:ot,startRow:St}=st;let Ge;for(let ze=1;ze<je;ze++){const tt=St+ze,yt=it[tt];if(Ge=(Ge||ve).getNextSibling(),!e.DEPRECATED_$isGridRowNode(Ge))throw Error("Expected row next sibling to be a row");let Nt=null;for(let Et=0;Et<ot;Et++){const gt=yt[Et],xt=gt.cell;gt.startRow===tt&&(Nt=xt),xt.__colSpan>1&&(Et+=xt.__colSpan-1)}if(Nt===null)for(let Et=0;Et<Me;Et++)At(Ge,T(p.NO_STATUS));else for(let Et=0;Et<Me;Et++)Nt.insertAfter(T(p.NO_STATUS))}le.setRowSpan(1)}}const tn=e.createCommand("INSERT_TABLE_COMMAND");return Jt.$createGridSelection=l,Jt.$createTableCellNode=T,Jt.$createTableNode=_e,Jt.$createTableNodeWithDimensions=M,Jt.$createTableRowNode=m,Jt.$deleteTableColumn=Fe,Jt.$deleteTableColumn__EXPERIMENTAL=Be,Jt.$deleteTableRow__EXPERIMENTAL=qe,Jt.$getElementGridForTableNode=X,Jt.$getTableCellNodeFromLexicalNode=F,Jt.$getTableColumnIndexFromTableCellNode=ee,Jt.$getTableNodeFromLexicalNodeOrThrow=ye,Jt.$getTableRowIndexFromTableCellNode=De,Jt.$getTableRowNodeFromTableCellNodeOrThrow=se,Jt.$insertTableColumn=Re,Jt.$insertTableColumn__EXPERIMENTAL=ke,Jt.$insertTableRow=be,Jt.$insertTableRow__EXPERIMENTAL=Ne,Jt.$isGridSelection=r,Jt.$isTableCellNode=S,Jt.$isTableNode=B,Jt.$isTableRowNode=v,Jt.$removeTableRowAtIndex=ue,Jt.$unmergeCell=Ut,Jt.INSERT_TABLE_COMMAND=tn,Jt.TableCellHeaderStates=p,Jt.TableCellNode=_,Jt.TableNode=U,Jt.TableRowNode=w,Jt.TableSelection=k,Jt.applyTableHandlers=H,Jt.getCellFromTarget=te,Jt.getTableSelectionFromTableElement=re,Jt}var Xt={},Oh;function $C(){if(Oh)return Xt;Oh=1;var e=jt(),t=pn();function n(B){let M=new URLSearchParams;M.append("code",B);for(let F=1;F<arguments.length;F++)M.append("v",arguments[F]);throw Error(`Minified Lexical error #${B}; visit https://lexical.dev/docs/error?${M} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}class r extends e.INTERNAL_PointSelection{constructor(M,F,se){super(F,se),this.gridKey=M}getCachedNodes(){return this._cachedNodes}setCachedNodes(M){this._cachedNodes=M}is(M){return l(M)?this.gridKey===M.gridKey&&this.anchor.is(M.anchor)&&this.focus.is(M.focus):!1}set(M,F,se){this.dirty=!0,this.gridKey=M,this.anchor.key=F,this.focus.key=se,this._cachedNodes=null}clone(){return new r(this.gridKey,this.anchor,this.focus)}isCollapsed(){return!1}extract(){return this.getNodes()}insertRawText(){}insertText(){}insertNodes(M){let F=this.focus.getNode();if(!e.$isElementNode(F))throw Error("Expected GridSelection focus to be an ElementNode");e.$normalizeSelection__EXPERIMENTAL(F.select(0,F.getChildrenSize())).insertNodes(M)}getShape(){var M=e.$getNodeByKey(this.anchor.key);if(e.DEPRECATED_$isGridCellNode(M)||n(103),M=e.DEPRECATED_$getGridCellNodeRect(M),M===null)throw Error("getCellRect: expected to find AnchorNode");var F=e.$getNodeByKey(this.focus.key);e.DEPRECATED_$isGridCellNode(F)||n(104);let se=e.DEPRECATED_$getGridCellNodeRect(F);if(se===null)throw Error("getCellRect: expected to find focusCellNode");F=Math.min(M.columnIndex,se.columnIndex);let ye=Math.max(M.columnIndex,se.columnIndex),De=Math.min(M.rowIndex,se.rowIndex);return M=Math.max(M.rowIndex,se.rowIndex),{fromX:Math.min(F,ye),fromY:Math.min(De,M),toX:Math.max(F,ye),toY:Math.max(De,M)}}getNodes(){function M(ut){let{cell:At,startColumn:Ut,startRow:tn}=ut;be=Math.min(be,Ut),Ne=Math.min(Ne,tn),Re=Math.max(Re,Ut+At.__colSpan-1),ke=Math.max(ke,tn+At.__rowSpan-1)}var F=this._cachedNodes;if(F!==null)return F;var se=this.anchor.getNode();F=this.focus.getNode();var ye=t.$findMatchingParent(se,e.DEPRECATED_$isGridCellNode);se=t.$findMatchingParent(F,e.DEPRECATED_$isGridCellNode),e.DEPRECATED_$isGridCellNode(ye)||n(103),e.DEPRECATED_$isGridCellNode(se)||n(104),F=ye.getParent(),e.DEPRECATED_$isGridRowNode(F)||n(105),F=F.getParent(),e.DEPRECATED_$isGridNode(F)||n(106);var De=se.getParents()[1];if(De!==F){if(F.isParentOf(se)){if(F=De.getParent(),F==null)throw Error("Expected focusCellParent to have a parent");this.set(this.gridKey,se.getKey(),F.getKey())}else{if(F=F.getParent(),F==null)throw Error("Expected gridParent to have a parent");this.set(this.gridKey,F.getKey(),se.getKey())}return this.getNodes()}let[ee,ne,ue]=e.DEPRECATED_$computeGridMap(F,ye,se),be=Math.min(ne.startColumn,ue.startColumn),Ne=Math.min(ne.startRow,ue.startRow),Re=Math.max(ne.startColumn+ne.cell.__colSpan-1,ue.startColumn+ue.cell.__colSpan-1),ke=Math.max(ne.startRow+ne.cell.__rowSpan-1,ue.startRow+ue.cell.__rowSpan-1);se=be,ye=Ne,De=be;for(var Fe=Ne;be<se||Ne<ye||Re>De||ke>Fe;){if(be<se){var qe=Fe-ye;--se;for(var Be=0;Be<=qe;Be++)M(ee[ye+Be][se])}if(Ne<ye)for(qe=De-se,--ye,Be=0;Be<=qe;Be++)M(ee[ye][se+Be]);if(Re>De)for(qe=Fe-ye,De+=1,Be=0;Be<=qe;Be++)M(ee[ye+Be][De]);if(ke>Fe)for(qe=De-se,Fe+=1,Be=0;Be<=qe;Be++)M(ee[Fe][se+Be])}for(F=[F],se=null,ye=Ne;ye<=ke;ye++)for(De=be;De<=Re;De++)({cell:Fe}=ee[ye][De]),qe=Fe.getParent(),e.DEPRECATED_$isGridRowNode(qe)||n(107),qe!==se&&F.push(qe),F.push(Fe,...f(Fe)),se=qe;return e.isCurrentlyReadOnlyMode()||(this._cachedNodes=F),F}getTextContent(){let M=this.getNodes(),F="";for(let se=0;se<M.length;se++)F+=M[se].getTextContent();return F}}function l(B){return B instanceof r}function d(){let B=e.$createPoint("root",0,"element"),M=e.$createPoint("root",0,"element");return new r("root",B,M)}function f(B){let M=[],F=[B];for(;0<F.length;){let se=F.pop();se===void 0&&n(112),e.$isElementNode(se)&&F.unshift(...se.getChildren()),se!==B&&M.push(se)}return M}let p=/^(\d+(?:\.\d+)?)px$/,_={BOTH:3,COLUMN:2,NO_STATUS:0,ROW:1};class E extends e.DEPRECATED_GridCellNode{static getType(){return"tablecell"}static clone(M){let F=new E(M.__headerState,M.__colSpan,M.__width,M.__key);return F.__rowSpan=M.__rowSpan,F.__backgroundColor=M.__backgroundColor,F}static importDOM(){return{td:()=>({conversion:T,priority:0}),th:()=>({conversion:T,priority:0})}}static importJSON(M){let F=M.rowSpan||1,se=S(M.headerState,M.colSpan||1,M.width||void 0);return se.__rowSpan=F,se.__backgroundColor=M.backgroundColor||null,se}constructor(M=_.NO_STATUS,F=1,se,ye){super(F,ye),this.__headerState=M,this.__width=se,this.__backgroundColor=null}createDOM(M){let F=document.createElement(this.getTag());return this.__width&&(F.style.width=`${this.__width}px`),1<this.__colSpan&&(F.colSpan=this.__colSpan),1<this.__rowSpan&&(F.rowSpan=this.__rowSpan),this.__backgroundColor!==null&&(F.style.backgroundColor=this.__backgroundColor),t.addClassNamesToElement(F,M.theme.tableCell,this.hasHeader()&&M.theme.tableCellHeader),F}exportDOM(M){if({element:M}=super.exportDOM(M),M){var F=this.getParentOrThrow().getChildrenSize();M.style.border="1px solid black",1<this.__colSpan&&(M.colSpan=this.__colSpan),1<this.__rowSpan&&(M.rowSpan=this.__rowSpan),M.style.width=`${this.getWidth()||Math.max(90,700/F)}px`,M.style.verticalAlign="top",M.style.textAlign="start",F=this.getBackgroundColor(),F!==null?M.style.backgroundColor=F:this.hasHeader()&&(M.style.backgroundColor="#f2f3f5")}return{element:M}}exportJSON(){return{...super.exportJSON(),backgroundColor:this.getBackgroundColor(),headerState:this.__headerState,type:"tablecell",width:this.getWidth()}}getTag(){return this.hasHeader()?"th":"td"}setHeaderStyles(M){return this.getWritable().__headerState=M,this.__headerState}getHeaderStyles(){return this.getLatest().__headerState}setWidth(M){return this.getWritable().__width=M,this.__width}getWidth(){return this.getLatest().__width}getBackgroundColor(){return this.getLatest().__backgroundColor}setBackgroundColor(M){this.getWritable().__backgroundColor=M}toggleHeaderStyle(M){let F=this.getWritable();return F.__headerState=(F.__headerState&M)===M?F.__headerState-M:F.__headerState+M,F}hasHeaderState(M){return(this.getHeaderStyles()&M)===M}hasHeader(){return this.getLatest().__headerState!==_.NO_STATUS}updateDOM(M){return M.__headerState!==this.__headerState||M.__width!==this.__width||M.__colSpan!==this.__colSpan||M.__rowSpan!==this.__rowSpan||M.__backgroundColor!==this.__backgroundColor}isShadowRoot(){return!0}collapseAtStart(){return!0}canBeEmpty(){return!1}canIndent(){return!1}}function T(B){var M=B.nodeName.toLowerCase();let F;return p.test(B.style.width)&&(F=parseFloat(B.style.width)),M=S(M==="th"?_.ROW:_.NO_STATUS,B.colSpan,F),M.__rowSpan=B.rowSpan,B=B.style.backgroundColor,B!==""&&(M.__backgroundColor=B),{forChild:(se,ye)=>w(ye)&&!e.$isElementNode(se)?(ye=e.$createParagraphNode(),e.$isLineBreakNode(se)&&se.getTextContent()===`
|
|
80
|
+
`?null:(ye.append(se),ye)):se,node:M}}function S(B,M=1,F){return e.$applyNodeReplacement(new E(B,M,F))}function w(B){return B instanceof E}class O extends e.DEPRECATED_GridRowNode{static getType(){return"tablerow"}static clone(M){return new O(M.__height,M.__key)}static importDOM(){return{tr:()=>({conversion:m,priority:0})}}static importJSON(M){return v(M.height)}constructor(M,F){super(F),this.__height=M}exportJSON(){return{...super.exportJSON(),type:"tablerow",version:1}}createDOM(M){let F=document.createElement("tr");return this.__height&&(F.style.height=`${this.__height}px`),t.addClassNamesToElement(F,M.theme.tableRow),F}isShadowRoot(){return!0}setHeight(M){return this.getWritable().__height=M,this.__height}getHeight(){return this.getLatest().__height}updateDOM(M){return M.__height!==this.__height}canBeEmpty(){return!1}canIndent(){return!1}}function m(B){let M;return p.test(B.style.height)&&(M=parseFloat(B.style.height)),{node:v(M)}}function v(B){return e.$applyNodeReplacement(new O(B))}function I(B){return B instanceof O}let G=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";class k{constructor(M,F){this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.listenersToRemove=new Set,this.tableNodeKey=F,this.editor=M,this.grid={cells:[],columns:0,rows:0},this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.trackTableGrid()}getGrid(){return this.grid}removeListeners(){Array.from(this.listenersToRemove).forEach(M=>M())}trackTableGrid(){let M=new MutationObserver(F=>{this.editor.update(()=>{var se=!1;for(let ye=0;ye<F.length;ye++){const De=F[ye].target.nodeName;if(De==="TABLE"||De==="TR"){se=!0;break}}if(se){if(se=this.editor.getElementByKey(this.tableNodeKey),!se)throw Error("Expected to find TableElement in DOM");this.grid=H(se)}})});this.editor.update(()=>{let F=this.editor.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");this.grid=H(F),M.observe(F,{childList:!0,subtree:!0})})}clearHighlight(){let M=this.editor;this.isHighlightingCells=!1,this.focusY=this.focusX=this.anchorY=this.anchorX=-1,this.focusCell=this.anchorCell=this.focusCellNodeKey=this.anchorCellNodeKey=this.gridSelection=null,this.hasHijackedSelectionStyles=!1,this.enableHighlightStyle(),M.update(()=>{var F=e.$getNodeByKey(this.tableNodeKey);if(!W(F))throw Error("Expected TableNode.");if(F=M.getElementByKey(this.tableNodeKey),!F)throw Error("Expected to find TableElement in DOM");F=H(F),j(M,F,null),e.$setSelection(null),M.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}enableHighlightStyle(){let M=this.editor;M.update(()=>{let F=M.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");t.removeClassNamesFromElement(F,M._config.theme.tableSelection),F.classList.remove("disable-selection"),this.hasHijackedSelectionStyles=!1})}disableHighlightStyle(){let M=this.editor;M.update(()=>{let F=M.getElementByKey(this.tableNodeKey);if(!F)throw Error("Expected to find TableElement in DOM");t.addClassNamesToElement(F,M._config.theme.tableSelection),this.hasHijackedSelectionStyles=!0})}updateTableGridSelection(M){if(M!=null&&M.gridKey===this.tableNodeKey){let F=this.editor;this.gridSelection=M,this.isHighlightingCells=!0,this.disableHighlightStyle(),j(F,this.grid,this.gridSelection)}else M==null?this.clearHighlight():(this.tableNodeKey=M.gridKey,this.updateTableGridSelection(M))}setFocusCellForSelection(M,F=!1){let se=this.editor;se.update(()=>{var ye=e.$getNodeByKey(this.tableNodeKey);if(!W(ye))throw Error("Expected TableNode.");if(!se.getElementByKey(this.tableNodeKey))throw Error("Expected to find TableElement in DOM");ye=M.x;let De=M.y;if(this.focusCell=M,this.anchorCell!==null){let ee=G?(se._window||window).getSelection():null;ee&&ee.setBaseAndExtent(this.anchorCell.elem,0,this.focusCell.elem,0)}if(!this.isHighlightingCells&&(this.anchorX!==ye||this.anchorY!==De||F))this.isHighlightingCells=!0,this.disableHighlightStyle();else if(ye===this.focusX&&De===this.focusY)return;this.focusX=ye,this.focusY=De,this.isHighlightingCells&&(ye=e.$getNearestNodeFromDOMNode(M.elem),this.gridSelection!=null&&this.anchorCellNodeKey!=null&&w(ye)&&(ye=ye.getKey(),this.gridSelection=this.gridSelection.clone()||d(),this.focusCellNodeKey=ye,this.gridSelection.set(this.tableNodeKey,this.anchorCellNodeKey,this.focusCellNodeKey),e.$setSelection(this.gridSelection),se.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0),j(se,this.grid,this.gridSelection)))})}setAnchorCellForSelection(M){this.isHighlightingCells=!1,this.anchorCell=M,this.anchorX=M.x,this.anchorY=M.y,this.editor.update(()=>{var F=e.$getNearestNodeFromDOMNode(M.elem);w(F)&&(F=F.getKey(),this.gridSelection=this.gridSelection!=null?this.gridSelection.clone():d(),this.anchorCellNodeKey=F)})}formatCells(M){this.editor.update(()=>{let F=e.$getSelection();l(F)||n(11);let se=e.$createRangeSelection(),ye=se.anchor,De=se.focus;F.getNodes().forEach(ee=>{w(ee)&&ee.getTextContentSize()!==0&&(ye.set(ee.getKey(),0,"element"),De.set(ee.getKey(),ee.getChildrenSize(),"element"),se.formatText(M))}),e.$setSelection(F),this.editor.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0)})}clearText(){let M=this.editor;M.update(()=>{let F=e.$getNodeByKey(this.tableNodeKey);if(!W(F))throw Error("Expected TableNode.");var se=e.$getSelection();l(se)||n(11),se=se.getNodes().filter(w),se.length===this.grid.columns*this.grid.rows?(F.selectPrevious(),F.remove(),e.$getRoot().selectStart()):(se.forEach(ye=>{if(e.$isElementNode(ye)){let De=e.$createParagraphNode(),ee=e.$createTextNode();De.append(ee),ye.append(De),ye.getChildren().forEach(ne=>{ne!==De&&ne.remove()})}}),j(M,this.grid,null),e.$setSelection(null),M.dispatchCommand(e.SELECTION_CHANGE_COMMAND,void 0))})}}function P(B){for(;B!=null;){let M=B.nodeName;if(M==="TD"||M==="TH"){if(B=B._cell,B===void 0)break;return B}B=B.parentNode}return null}function H(B){let M=[],F={cells:M,columns:0,rows:0};var se=B.firstChild;let ye=B=0;for(M.length=0;se!=null;){var De=se.nodeName;if(De==="TD"||De==="TH"){De=se,De={elem:De,hasBackgroundColor:De.style.backgroundColor!=="",highlighted:!1,x:B,y:ye},se._cell=De;let ee=M[ye];ee===void 0&&(ee=M[ye]=[]),ee[B]=De}else if(De=se.firstChild,De!=null){se=De;continue}if(De=se.nextSibling,De!=null)B++,se=De;else if(De=se.parentNode,De!=null){if(se=De.nextSibling,se==null)break;ye++,B=0}}return F.columns=B+1,F.rows=ye+1,F}function j(B,M,F){let se=new Set(F?F.getNodes():[]);re(M,(ye,De)=>{let ee=ye.elem;se.has(De)?(ye.highlighted=!0,Te(B,ye)):(ye.highlighted=!1,Se(B,ye),ee.getAttribute("style")||ee.removeAttribute("style"))})}function re(B,M){({cells:B}=B);for(let F=0;F<B.length;F++){let se=B[F];if(se)for(let ye=0;ye<se.length;ye++){let De=se[ye];if(!De)continue;let ee=e.$getNearestNodeFromDOMNode(De.elem);ee!==null&&M(De,ee,{x:ye,y:F})}}}function te(B,M){M.disableHighlightStyle(),re(M.grid,F=>{F.highlighted=!0,Te(B,F)})}function ce(B,M){M.enableHighlightStyle(),re(M.grid,F=>{let se=F.elem;F.highlighted=!1,Se(B,F),se.getAttribute("style")||se.removeAttribute("style")})}let V=(B,M,F,se,ye)=>{const De=ye==="forward";switch(ye){case"backward":case"forward":return F!==(De?B.grid.columns-1:0)?(B=M.getCellNodeFromCordsOrThrow(F+(De?1:-1),se,B.grid),De?B.selectStart():B.selectEnd()):se!==(De?B.grid.rows-1:0)?(B=M.getCellNodeFromCordsOrThrow(De?0:B.grid.columns-1,se+(De?1:-1),B.grid),De?B.selectStart():B.selectEnd()):De?M.selectNext():M.selectPrevious(),!0;case"up":return se!==0?M.getCellNodeFromCordsOrThrow(F,se-1,B.grid).selectEnd():M.selectPrevious(),!0;case"down":return se!==B.grid.rows-1?M.getCellNodeFromCordsOrThrow(F,se+1,B.grid).selectStart():M.selectNext(),!0;default:return!1}},z=(B,M,F,se,ye)=>{const De=ye==="forward";switch(ye){case"backward":case"forward":return F!==(De?B.grid.columns-1:0)&&B.setFocusCellForSelection(M.getCellFromCordsOrThrow(F+(De?1:-1),se,B.grid)),!0;case"up":return se!==0?(B.setFocusCellForSelection(M.getCellFromCordsOrThrow(F,se-1,B.grid)),!0):!1;case"down":return se!==B.grid.rows-1?(B.setFocusCellForSelection(M.getCellFromCordsOrThrow(F,se+1,B.grid)),!0):!1;default:return!1}};function q(B,M){if(e.$isRangeSelection(B)||l(B)){let F=M.isParentOf(B.anchor.getNode());return B=M.isParentOf(B.focus.getNode()),F&&B}return!1}function Te(B,M){B=M.elem,M=e.$getNearestNodeFromDOMNode(B),w(M)||n(131),M.getBackgroundColor()===null?B.style.setProperty("background-color","rgb(172,206,247)"):B.style.setProperty("background-image","linear-gradient(to right, rgba(172,206,247,0.85), rgba(172,206,247,0.85))"),B.style.setProperty("caret-color","transparent")}function Se(B,M){B=M.elem,M=e.$getNearestNodeFromDOMNode(B),w(M)||n(131),M.getBackgroundColor()===null&&B.style.removeProperty("background-color"),B.style.removeProperty("background-image"),B.style.removeProperty("caret-color")}function Ee(B){return B=t.$findMatchingParent(B,w),w(B)?B:null}function de(B){return B=t.$findMatchingParent(B,W),W(B)?B:null}function K(B,M,F,se,ye){let De=e.$getSelection();if(!q(De,se))return!1;if(e.$isRangeSelection(De)&&De.isCollapsed()){if(F==="backward"||F==="forward")return!1;let{anchor:be,focus:Ne}=De;var ee=t.$findMatchingParent(be.getNode(),w),ne=t.$findMatchingParent(Ne.getNode(),w);if(!w(ee)||!ee.is(ne))return!1;if(ne=de(ee),ne!==se&&ne!=null){var ue=B.getElementByKey(ne.getKey());if(ue!=null)return ye.grid=H(ue),K(B,M,F,ne,ye)}if(ne=B.getElementByKey(ee.__key),ue=B.getElementByKey(be.key),ue==null||ne==null)return!1;if(be.type==="element")ne=ue.getBoundingClientRect();else{if(ne=window.getSelection(),ne===null||ne.rangeCount===0)return!1;ne=ne.getRangeAt(0).getBoundingClientRect()}if(ue=F==="up"?ee.getFirstChild():ee.getLastChild(),ue==null||(B=B.getElementByKey(ue.__key),B==null))return!1;if(B=B.getBoundingClientRect(),F==="up"?B.top>ne.top-ne.height:ne.bottom+ne.height>B.bottom){if(D(M),B=se.getCordsFromCellNode(ee,ye.grid),M.shiftKey)F=se.getCellFromCordsOrThrow(B.x,B.y,ye.grid),ye.setAnchorCellForSelection(F),ye.setFocusCellForSelection(F,!0);else return V(ye,se,B.x,B.y,F);return!0}}else if(l(De)){let{anchor:be,focus:Ne}=De;return ue=t.$findMatchingParent(be.getNode(),w),ne=t.$findMatchingParent(Ne.getNode(),w),[ee]=De.getNodes(),B=B.getElementByKey(ee.getKey()),!w(ue)||!w(ne)||!W(ee)||B==null?!1:(ye.updateTableGridSelection(De),B=H(B),ue=se.getCordsFromCellNode(ue,B),ue=se.getCellFromCordsOrThrow(ue.x,ue.y,B),ye.setAnchorCellForSelection(ue),D(M),M.shiftKey?(M=se.getCordsFromCellNode(ne,B),z(ye,ee,M.x,M.y,F)):(ne.selectEnd(),!0))}return!1}function D(B){B.preventDefault(),B.stopImmediatePropagation(),B.stopPropagation()}class Z extends e.DEPRECATED_GridNode{static getType(){return"table"}static clone(M){return new Z(M.__key)}static importDOM(){return{table:()=>({conversion:oe,priority:1})}}static importJSON(){return Y()}constructor(M){super(M)}exportJSON(){return{...super.exportJSON(),type:"table",version:1}}createDOM(M){let F=document.createElement("table");return t.addClassNamesToElement(F,M.theme.table),F}updateDOM(){return!1}exportDOM(M){return{...super.exportDOM(M),after:F=>{if(F){let se=F.cloneNode(),ye=document.createElement("colgroup"),De=document.createElement("tbody");if(t.isHTMLElement(F)&&De.append(...F.children),F=this.getFirstChildOrThrow(),!I(F))throw Error("Expected to find row node.");F=F.getChildrenSize();for(let ee=0;ee<F;ee++){let ne=document.createElement("col");ye.append(ne)}return se.replaceChildren(ye,De),se}}}}canExtractContents(){return!1}canBeEmpty(){return!1}isShadowRoot(){return!0}getCordsFromCellNode(M,F){let{rows:se,cells:ye}=F;for(F=0;F<se;F++){var De=ye[F];if(De!=null&&(De=De.findIndex(ee=>{if(ee)return{elem:ee}=ee,e.$getNearestNodeFromDOMNode(ee)===M}),De!==-1))return{x:De,y:F}}throw Error("Cell not found in table.")}getCellFromCords(M,F,se){return{cells:se}=se,F=se[F],F==null?null:(M=F[M],M??null)}getCellFromCordsOrThrow(M,F,se){if(M=this.getCellFromCords(M,F,se),!M)throw Error("Cell not found at cords.");return M}getCellNodeFromCords(M,F,se){return M=this.getCellFromCords(M,F,se),M==null?null:(M=e.$getNearestNodeFromDOMNode(M.elem),w(M)?M:null)}getCellNodeFromCordsOrThrow(M,F,se){if(M=this.getCellNodeFromCords(M,F,se),!M)throw Error("Node at cords not TableCellNode.");return M}canSelectBefore(){return!0}canIndent(){return!1}}function oe(){return{node:Y()}}function Y(){return e.$applyNodeReplacement(new Z)}function W(B){return B instanceof Z}function J(B){if(B=t.$findMatchingParent(B,M=>I(M)),I(B))return B;throw Error("Expected table cell to be inside of table row.")}function R(B){if(B=t.$findMatchingParent(B,M=>W(M)),W(B))return B;throw Error("Expected table cell to be inside of table.")}function U(B,M){let F=R(B),{x:se,y:ye}=F.getCordsFromCellNode(B,M);return{above:F.getCellNodeFromCords(se,ye-1,M),below:F.getCellNodeFromCords(se,ye+1,M),left:F.getCellNodeFromCords(se-1,ye,M),right:F.getCellNodeFromCords(se+1,ye,M)}}function X(B){let M=B.getFirstDescendant();M==null?B.selectStart():M.getParentOrThrow().selectStart()}function fe(B,M){let F=B.getFirstChild();F!==null?F.insertBefore(M):B.append(M)}let _e=e.createCommand("INSERT_TABLE_COMMAND");return Xt.$createGridSelection=d,Xt.$createTableCellNode=S,Xt.$createTableNode=Y,Xt.$createTableNodeWithDimensions=function(B,M,F=!0){let se=Y();for(let De=0;De<B;De++){let ee=v();for(let ne=0;ne<M;ne++){var ye=_.NO_STATUS;typeof F=="object"?(De===0&&F.rows&&(ye|=_.ROW),ne===0&&F.columns&&(ye|=_.COLUMN)):F&&(De===0&&(ye|=_.ROW),ne===0&&(ye|=_.COLUMN)),ye=S(ye);let ue=e.$createParagraphNode();ue.append(e.$createTextNode()),ye.append(ue),ee.append(ye)}se.append(ee)}return se},Xt.$createTableRowNode=v,Xt.$deleteTableColumn=function(B,M){let F=B.getChildren();for(let ye=0;ye<F.length;ye++){var se=F[ye];if(I(se)){if(se=se.getChildren(),M>=se.length||0>M)throw Error("Table column target index out of range");se[M].remove()}}return B},Xt.$deleteTableColumn__EXPERIMENTAL=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");var M=B.anchor.getNode();B=B.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(M);[M]=e.DEPRECATED_$getNodeTriplet(B);let[ye,De,ee]=e.DEPRECATED_$computeGridMap(se,F,M);var{startColumn:ne}=De;let{startRow:ue,startColumn:be}=ee;B=Math.min(ne,be),ne=Math.max(ne+F.__colSpan-1,be+M.__colSpan-1);let Ne=ne-B+1;if(ye[0].length===ne-B+1)se.selectPrevious(),se.remove();else{var Re=ye.length;for(let ke=0;ke<Re;ke++)for(let Fe=B;Fe<=ne;Fe++){let{cell:qe,startColumn:Be}=ye[ke][Fe];Be<B?Fe===B&&qe.setColSpan(qe.__colSpan-Math.min(Ne,qe.__colSpan-(B-Be))):Be+qe.__colSpan-1>ne?Fe===ne&&qe.setColSpan(qe.__colSpan-(ne-Be+1)):qe.remove()}B=ye[ue],M=B[be+M.__colSpan],M!==void 0?({cell:M}=M,X(M)):({cell:M}=B[be-1],X(M))}},Xt.$deleteTableRow__EXPERIMENTAL=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");var M=B.anchor.getNode();B=B.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(M);[B]=e.DEPRECATED_$getNodeTriplet(B);let[ye,De,ee]=e.DEPRECATED_$computeGridMap(se,F,B);({startRow:M}=De);var{startRow:ne}=ee;if(B=ne+B.__rowSpan-1,ye.length===B-M+1)se.remove();else{ne=ye[0].length;var ue=ye[B+1],be=se.getChildAtIndex(B+1);for(let Re=B;Re>=M;Re--){for(var Ne=ne-1;0<=Ne;Ne--){let{cell:ke,startRow:Fe,startColumn:qe}=ye[Re][Ne];if(qe===Ne&&(Re===M&&Fe<M&&ke.setRowSpan(ke.__rowSpan-(Fe-M)),Fe>=M&&Fe+ke.__rowSpan-1>B))if(ke.setRowSpan(ke.__rowSpan-(B-Fe+1)),be===null&&n(122),Ne===0)fe(be,ke);else{let{cell:Be}=ue[Ne-1];Be.insertAfter(ke)}}Ne=se.getChildAtIndex(Re),e.DEPRECATED_$isGridRowNode(Ne)||n(123,String(Re)),Ne.remove()}ue!==void 0?({cell:M}=ue[0],X(M)):({cell:M}=ye[M-1][0],X(M))}},Xt.$getElementGridForTableNode=function(B,M){if(B=B.getElementByKey(M.getKey()),B==null)throw Error("Table Element Not Found");return H(B)},Xt.$getTableCellNodeFromLexicalNode=function(B){return B=t.$findMatchingParent(B,M=>w(M)),w(B)?B:null},Xt.$getTableColumnIndexFromTableCellNode=function(B){return J(B).getChildren().findIndex(M=>M.is(B))},Xt.$getTableNodeFromLexicalNodeOrThrow=R,Xt.$getTableRowIndexFromTableCellNode=function(B){let M=J(B);return R(M).getChildren().findIndex(F=>F.is(M))},Xt.$getTableRowNodeFromTableCellNodeOrThrow=J,Xt.$insertTableColumn=function(B,M,F=!0,se,ye){let De=B.getChildren(),ee=[];for(let be=0;be<De.length;be++){let Ne=De[be];if(I(Ne))for(let Re=0;Re<se;Re++){var ne=Ne.getChildren();if(M>=ne.length||0>M)throw Error("Table column target index out of range");ne=ne[M],w(ne)||n(12);let{left:ke,right:Fe}=U(ne,ye);var ue=_.NO_STATUS;(ke&&ke.hasHeaderState(_.ROW)||Fe&&Fe.hasHeaderState(_.ROW))&&(ue|=_.ROW),ue=S(ue),ue.append(e.$createParagraphNode()),ee.push({newTableCell:ue,targetCell:ne})}}return ee.forEach(({newTableCell:be,targetCell:Ne})=>{F?Ne.insertAfter(be):Ne.insertBefore(be)}),B},Xt.$insertTableColumn__EXPERIMENTAL=function(B=!0){function M(){let Re=S(_.NO_STATUS).append(e.$createParagraphNode());return be===null&&(be=Re),Re}var F=e.$getSelection();if(!e.$INTERNAL_isPointSelection(F))throw Error("Expected a PointSeleciton");var se=F.anchor.getNode();F=F.focus.getNode(),[se]=e.DEPRECATED_$getNodeTriplet(se);let[ye,,De]=e.DEPRECATED_$getNodeTriplet(F),[ee,ne,ue]=e.DEPRECATED_$computeGridMap(De,ye,se);se=ee.length,F=B?Math.max(ne.startColumn,ue.startColumn):Math.min(ne.startColumn,ue.startColumn),B=B?F+ye.__colSpan-1:F-1,F=De.getFirstChild(),e.DEPRECATED_$isGridRowNode(F)||n(120);let be=null;var Ne=F;e:for(F=0;F<se;F++){F!==0&&(Ne=Ne.getNextSibling(),e.DEPRECATED_$isGridRowNode(Ne)||n(121));let Re=ee[F];if(0>B){fe(Ne,M());continue}let{cell:ke,startColumn:Fe,startRow:qe}=Re[B];if(Fe+ke.__colSpan-1<=B){let Be=ke,ut=qe,At=B;for(;ut!==F&&1<Be.__rowSpan;)if(At-=ke.__colSpan,0<=At){let{cell:Ut,startRow:tn}=Re[At];Be=Ut,ut=tn}else{Ne.append(M());continue e}Be.insertAfter(M())}else ke.setColSpan(ke.__colSpan+1)}be!==null&&X(be)},Xt.$insertTableRow=function(B,M,F=!0,se,ye){var De=B.getChildren();if(M>=De.length||0>M)throw Error("Table row target index out of range");if(M=De[M],I(M))for(De=0;De<se;De++){let ne=M.getChildren(),ue=ne.length,be=v();for(let Ne=0;Ne<ue;Ne++){var ee=ne[Ne];w(ee)||n(12);let{above:Re,below:ke}=U(ee,ye);ee=_.NO_STATUS;let Fe=Re&&Re.getWidth()||ke&&ke.getWidth()||void 0;(Re&&Re.hasHeaderState(_.COLUMN)||ke&&ke.hasHeaderState(_.COLUMN))&&(ee|=_.COLUMN),ee=S(ee,1,Fe),ee.append(e.$createParagraphNode()),be.append(ee)}F?M.insertAfter(be):M.insertBefore(be)}else throw Error("Row before insertion index does not exist.");return B},Xt.$insertTableRow__EXPERIMENTAL=function(B=!0){var M=e.$getSelection();if(!e.$INTERNAL_isPointSelection(M))throw Error("Expected a INTERNAL_PointSelection");M=M.focus.getNode();let[F,,se]=e.DEPRECATED_$getNodeTriplet(M),[ye,De]=e.DEPRECATED_$computeGridMap(se,F,F);M=ye[0].length;var{startRow:ee}=De;if(B){B=ee+F.__rowSpan-1;var ne=ye[B];ee=v();for(var ue=0;ue<M;ue++){let{cell:be,startRow:Ne}=ne[ue];Ne+be.__rowSpan-1<=B?ee.append(S(_.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}M=se.getChildAtIndex(B),e.DEPRECATED_$isGridRowNode(M)||n(119),M.insertAfter(ee)}else{for(ne=ye[ee],B=v(),ue=0;ue<M;ue++){let{cell:be,startRow:Ne}=ne[ue];Ne===ee?B.append(S(_.NO_STATUS).append(e.$createParagraphNode())):be.setRowSpan(be.__rowSpan+1)}M=se.getChildAtIndex(ee),e.DEPRECATED_$isGridRowNode(M)||n(119),M.insertBefore(B)}},Xt.$isGridSelection=l,Xt.$isTableCellNode=w,Xt.$isTableNode=W,Xt.$isTableRowNode=I,Xt.$removeTableRowAtIndex=function(B,M){let F=B.getChildren();if(M>=F.length||0>M)throw Error("Expected table cell to be inside of table row.");return F[M].remove(),B},Xt.$unmergeCell=function(){var B=e.$getSelection();if(!e.$INTERNAL_isPointSelection(B))throw Error("Expected a INTERNAL_PointSelection");B=B.anchor.getNode();let[M,F,se]=e.DEPRECATED_$getNodeTriplet(B);B=M.__colSpan;let ye=M.__rowSpan;if(1<B){for(var De=1;De<B;De++)M.insertAfter(S(_.NO_STATUS));M.setColSpan(1)}if(1<ye){let[ue,be]=e.DEPRECATED_$computeGridMap(se,M,M),{startColumn:Ne,startRow:Re}=be,ke;for(De=1;De<ye;De++){var ee=Re+De;let Fe=ue[ee];ke=(ke||F).getNextSibling(),e.DEPRECATED_$isGridRowNode(ke)||n(125);var ne=null;for(let qe=0;qe<Ne;qe++){let Be=Fe[qe],ut=Be.cell;Be.startRow===ee&&(ne=ut),1<ut.__colSpan&&(qe+=ut.__colSpan-1)}if(ne===null)for(ne=0;ne<B;ne++)fe(ke,S(_.NO_STATUS));else for(ee=0;ee<B;ee++)ne.insertAfter(S(_.NO_STATUS))}M.setRowSpan(1)}},Xt.INSERT_TABLE_COMMAND=_e,Xt.TableCellHeaderStates=_,Xt.TableCellNode=E,Xt.TableNode=Z,Xt.TableRowNode=O,Xt.TableSelection=k,Xt.applyTableHandlers=function(B,M,F,se){function ye(Ne){return Ne=B.getCordsFromCellNode(Ne,ee.grid),B.getCellFromCordsOrThrow(Ne.x,Ne.y,ee.grid)}let De=F.getRootElement();if(De===null)throw Error("No root element.");let ee=new k(F,B.getKey()),ne=F._window||window;M.__lexicalTableSelection=ee,M.addEventListener("mousedown",Ne=>{setTimeout(()=>{if(Ne.button===0&&ne){var Re=P(Ne.target);Re!==null&&(D(Ne),ee.setAnchorCellForSelection(Re));var ke=()=>{ne.removeEventListener("mouseup",ke),ne.removeEventListener("mousemove",Fe)},Fe=qe=>{const Be=P(qe.target);Be===null||ee.anchorX===Be.x&&ee.anchorY===Be.y||(qe.preventDefault(),ee.setFocusCellForSelection(Be))};ne.addEventListener("mouseup",ke),ne.addEventListener("mousemove",Fe)}},0)});let ue=Ne=>{Ne.button===0&&F.update(()=>{const Re=e.$getSelection(),ke=Ne.target;l(Re)&&Re.gridKey===ee.tableNodeKey&&De.contains(ke)&&ee.clearHighlight()})};ne.addEventListener("mousedown",ue),ee.listenersToRemove.add(()=>ne.removeEventListener("mousedown",ue)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_DOWN_COMMAND,Ne=>K(F,Ne,"down",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_UP_COMMAND,Ne=>K(F,Ne,"up",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_LEFT_COMMAND,Ne=>K(F,Ne,"backward",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ARROW_RIGHT_COMMAND,Ne=>K(F,Ne,"forward",B,ee),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.KEY_ESCAPE_COMMAND,Ne=>{var Re=e.$getSelection();return l(Re)&&(Re=t.$findMatchingParent(Re.focus.getNode(),w),w(Re))?(D(Ne),Re.selectEnd(),!0):!1},e.COMMAND_PRIORITY_HIGH));let be=Ne=>()=>{var Re=e.$getSelection();if(!q(Re,B))return!1;if(l(Re))return ee.clearText(),!0;if(e.$isRangeSelection(Re)){const qe=t.$findMatchingParent(Re.anchor.getNode(),Be=>w(Be));if(!w(qe))return!1;var ke=Re.anchor.getNode(),Fe=Re.focus.getNode();if(ke=B.isParentOf(ke),Fe=B.isParentOf(Fe),ke&&!Fe||Fe&&!ke)return ee.clearText(),!0;if(ke=(Fe=t.$findMatchingParent(Re.anchor.getNode(),Be=>e.$isElementNode(Be)))&&t.$findMatchingParent(Fe,Be=>e.$isElementNode(Be)&&w(Be.getParent())),!e.$isElementNode(ke)||!e.$isElementNode(Fe))return!1;if(Ne===e.DELETE_LINE_COMMAND&&ke.getPreviousSibling()===null)return!0;if((Ne===e.DELETE_CHARACTER_COMMAND||Ne===e.DELETE_WORD_COMMAND)&&Re.isCollapsed()&&Re.anchor.offset===0&&Fe!==ke){Re=Fe.getChildren();const Be=e.$createParagraphNode();return Re.forEach(ut=>Be.append(ut)),Fe.replace(Be),Fe.getWritable().__parent=qe.getKey(),!0}}return!1};return[e.DELETE_WORD_COMMAND,e.DELETE_LINE_COMMAND,e.DELETE_CHARACTER_COMMAND].forEach(Ne=>{ee.listenersToRemove.add(F.registerCommand(Ne,be(Ne),e.COMMAND_PRIORITY_CRITICAL))}),M=Ne=>{const Re=e.$getSelection();return q(Re,B)?l(Re)?(Ne.preventDefault(),Ne.stopPropagation(),ee.clearText(),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),ke=>w(ke)),w(Ne)),!1):!1},ee.listenersToRemove.add(F.registerCommand(e.KEY_BACKSPACE_COMMAND,M,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.KEY_DELETE_COMMAND,M,e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.FORMAT_TEXT_COMMAND,Ne=>{let Re=e.$getSelection();return q(Re,B)?l(Re)?(ee.formatCells(Ne),!0):(e.$isRangeSelection(Re)&&(Ne=t.$findMatchingParent(Re.anchor.getNode(),ke=>w(ke)),w(Ne)),!1):!1},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.CONTROLLED_TEXT_INSERTION_COMMAND,()=>{var Ne=e.$getSelection();return q(Ne,B)&&(l(Ne)?ee.clearHighlight():e.$isRangeSelection(Ne)&&(Ne=t.$findMatchingParent(Ne.anchor.getNode(),Re=>w(Re)),w(Ne))),!1},e.COMMAND_PRIORITY_CRITICAL)),se&&ee.listenersToRemove.add(F.registerCommand(e.KEY_TAB_COMMAND,Ne=>{var Re=e.$getSelection();return!e.$isRangeSelection(Re)||!Re.isCollapsed()||!q(Re,B)||(Re=Ee(Re.anchor.getNode()),Re===null)?!1:(D(Ne),Re=B.getCordsFromCellNode(Re,ee.grid),V(ee,B,Re.x,Re.y,Ne.shiftKey?"backward":"forward"),!0)},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.FOCUS_COMMAND,()=>B.isSelected(),e.COMMAND_PRIORITY_HIGH)),ee.listenersToRemove.add(F.registerCommand(e.SELECTION_INSERT_CLIPBOARD_NODES_COMMAND,Ne=>{let{nodes:Re,selection:ke}=Ne;Ne=e.$INTERNAL_isPointSelection(ke);var Fe=e.$isRangeSelection(ke);if(Ne=Fe&&t.$findMatchingParent(ke.anchor.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le))!==null&&t.$findMatchingParent(ke.focus.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le))!==null||Ne&&!Fe,Re.length!==1||!e.DEPRECATED_$isGridNode(Re[0])||!Ne)return!1;var{anchor:qe}=ke,Be=Re[0];Ne=Be.getChildren(),Fe=Be.getFirstChildOrThrow().getChildrenSize(),Be=Be.getChildrenSize();var ut=t.$findMatchingParent(qe.getNode(),Le=>e.DEPRECATED_$isGridCellNode(Le)),At=(qe=ut&&t.$findMatchingParent(ut,Le=>e.DEPRECATED_$isGridRowNode(Le)))&&t.$findMatchingParent(qe,Le=>e.DEPRECATED_$isGridNode(Le));if(!e.DEPRECATED_$isGridCellNode(ut)||!e.DEPRECATED_$isGridRowNode(qe)||!e.DEPRECATED_$isGridNode(At))return!1;var Ut=qe.getIndexWithinParent(),tn=Math.min(At.getChildrenSize()-1,Ut+Be-1);Be=ut.getIndexWithinParent(),ut=Math.min(qe.getChildrenSize()-1,Be+Fe-1),Fe=Math.min(Be,ut),qe=Math.min(Ut,tn),Be=Math.max(Be,ut),Ut=Math.max(Ut,tn),At=At.getChildren(),tn=0;let Oe,ie;for(ut=qe;ut<=Ut;ut++){var le=At[ut];if(!e.DEPRECATED_$isGridRowNode(le))return!1;var ve=Ne[tn];if(!e.DEPRECATED_$isGridRowNode(ve))return!1;le=le.getChildren(),ve=ve.getChildren();let Le=0;for(let Me=Fe;Me<=Be;Me++){let je=le[Me];if(!e.DEPRECATED_$isGridCellNode(je))return!1;let it=ve[Le];if(!e.DEPRECATED_$isGridCellNode(it))return!1;ut===qe&&Me===Fe?Oe=je.getKey():ut===Ut&&Me===Be&&(ie=je.getKey());let st=je.getChildren();it.getChildren().forEach(ot=>{e.$isTextNode(ot)&&e.$createParagraphNode().append(ot),je.append(ot)}),st.forEach(ot=>ot.remove()),Le++}tn++}return Oe&&ie&&(Ne=d(),Ne.set(Re[0].getKey(),Oe,ie),e.$setSelection(Ne)),!0},e.COMMAND_PRIORITY_CRITICAL)),ee.listenersToRemove.add(F.registerCommand(e.SELECTION_CHANGE_COMMAND,()=>{let Ne=e.$getSelection(),Re=e.$getPreviousSelection();if(e.$isRangeSelection(Ne)){let{anchor:ut,focus:At}=Ne;var ke=ut.getNode(),Fe=At.getNode();ke=Ee(ke),Fe=Ee(Fe);var qe=ke&&B.is(de(ke)),Be=Fe&&B.is(de(Fe));let Ut=qe!==Be;Be=qe&&Be,qe=Ne.isBackward(),Ut?(ke=Ne.clone(),ke.focus.set(B.getKey(),qe?0:B.getChildrenSize(),"element"),e.$setSelection(ke),te(F,ee)):Be&&!ke.is(Fe)&&(ee.setAnchorCellForSelection(ye(ke)),ee.setFocusCellForSelection(ye(Fe),!0))}return Ne&&!Ne.is(Re)&&(l(Ne)||l(Re))&&ee.gridSelection&&!ee.gridSelection.is(Re)?(l(Ne)&&Ne.gridKey===ee.tableNodeKey?ee.updateTableGridSelection(Ne):!l(Ne)&&l(Re)&&Re.gridKey===ee.tableNodeKey&&ee.updateTableGridSelection(null),!1):(ee.hasHijackedSelectionStyles&&!B.isSelected()?ce(F,ee):!ee.hasHijackedSelectionStyles&&B.isSelected()&&te(F,ee),!1)},e.COMMAND_PRIORITY_CRITICAL)),ee},Xt.getCellFromTarget=P,Xt.getTableSelectionFromTableElement=function(B){return B.__lexicalTableSelection},Xt}var Ou,Dh;function vd(){return Dh||(Dh=1,Ou=process.env.NODE_ENV==="development"?PC():$C()),Ou}var Ah;function FC(){if(Ah)return wu;Ah=1;var e=qn(),t=vd(),n=pn(),r=jt(),l=rt;function d({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){const[E]=e.useLexicalComposerContext();return l.useEffect(()=>{if(!E.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode]))throw Error("TablePlugin: TableNode, TableCellNode or TableRowNode not registered on editor");return E.registerCommand(t.INSERT_TABLE_COMMAND,({columns:T,rows:S,includeHeaders:w})=>{const O=t.$createTableNodeWithDimensions(Number(S),Number(T),w);n.$insertNodeToNearestRoot(O);const m=O.getFirstDescendant();return r.$isTextNode(m)&&m.select(),!0},r.COMMAND_PRIORITY_EDITOR)},[E]),l.useEffect(()=>{const T=new Map,S=O=>{const m=O.getKey(),v=E.getElementByKey(m);if(v&&!T.has(m)){const I=t.applyTableHandlers(O,v,E,_);T.set(m,I)}};E.getEditorState().read(()=>{const O=r.$nodesOfType(t.TableNode);for(const m of O)t.$isTableNode(m)&&S(m)});const w=E.registerMutationListener(t.TableNode,O=>{for(const[m,v]of O)if(v==="created")E.getEditorState().read(()=>{const I=r.$getNodeByKey(m);t.$isTableNode(I)&&S(I)});else if(v==="destroyed"){const I=T.get(m);I!==void 0&&(I.removeListeners(),T.delete(m))}});return()=>{w();for(const[,O]of T)O.removeListeners()}},[E,_]),l.useEffect(()=>{if(!f)return E.registerNodeTransform(t.TableCellNode,T=>{if(T.getColSpan()>1||T.getRowSpan()>1){const[,,S]=r.DEPRECATED_$getNodeTriplet(T),[w]=r.DEPRECATED_$computeGridMap(S,T,T),O=w.length,m=w[0].length;let v=S.getFirstChild();if(!r.DEPRECATED_$isGridRowNode(v))throw Error("Expected TableNode first child to be a RowNode");const I=[];for(let G=0;G<O;G++){if(G!==0&&(v=v.getNextSibling(),!r.DEPRECATED_$isGridRowNode(v)))throw Error("Expected TableNode first child to be a RowNode");let k=null;for(let P=0;P<m;P++){const H=w[G][P],j=H.cell;if(H.startRow===G&&H.startColumn===P)k=j,I.push(j);else if(j.getColSpan()>1||j.getRowSpan()>1){if(!t.$isTableCellNode(j))throw Error("Expected TableNode cell to be a TableCellNode");const re=t.$createTableCellNode(j.__headerState);k!==null?k.insertAfter(re):n.$insertFirst(v,re)}}}for(const G of I)G.setColSpan(1),G.setRowSpan(1)}})},[E,f]),l.useEffect(()=>{if(!p)return E.registerNodeTransform(t.TableCellNode,T=>{T.getBackgroundColor()!==null&&T.setBackgroundColor(null)})},[E,p,f]),null}return wu.TablePlugin=d,wu}var Du={},Mh;function BC(){if(Mh)return Du;Mh=1;var e=qn(),t=vd(),n=pn(),r=jt(),l=rt;function d(f){let p=new URLSearchParams;p.append("code",f);for(let _=1;_<arguments.length;_++)p.append("v",arguments[_]);throw Error(`Minified Lexical error #${f}; visit https://lexical.dev/docs/error?${p} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}return Du.TablePlugin=function({hasCellMerge:f=!0,hasCellBackgroundColor:p=!0,hasTabHandler:_=!0}){let[E]=e.useLexicalComposerContext();return l.useEffect(()=>(E.hasNodes([t.TableNode,t.TableCellNode,t.TableRowNode])||d(10),E.registerCommand(t.INSERT_TABLE_COMMAND,({columns:T,rows:S,includeHeaders:w})=>(T=t.$createTableNodeWithDimensions(Number(S),Number(T),w),n.$insertNodeToNearestRoot(T),T=T.getFirstDescendant(),r.$isTextNode(T)&&T.select(),!0),r.COMMAND_PRIORITY_EDITOR)),[E]),l.useEffect(()=>{let T=new Map,S=O=>{const m=O.getKey(),v=E.getElementByKey(m);v&&!T.has(m)&&(O=t.applyTableHandlers(O,v,E,_),T.set(m,O))};E.getEditorState().read(()=>{let O=r.$nodesOfType(t.TableNode);for(let m of O)t.$isTableNode(m)&&S(m)});let w=E.registerMutationListener(t.TableNode,O=>{for(const[m,v]of O)v==="created"?E.getEditorState().read(()=>{const I=r.$getNodeByKey(m);t.$isTableNode(I)&&S(I)}):v==="destroyed"&&(O=T.get(m),O!==void 0&&(O.removeListeners(),T.delete(m)))});return()=>{w();for(let[,O]of T)O.removeListeners()}},[E,_]),l.useEffect(()=>{if(!f)return E.registerNodeTransform(t.TableCellNode,T=>{if(1<T.getColSpan()||1<T.getRowSpan()){var[,,S]=r.DEPRECATED_$getNodeTriplet(T);[T]=r.DEPRECATED_$computeGridMap(S,T,T);let O=T.length,m=T[0].length;if(S=S.getFirstChild(),!r.DEPRECATED_$isGridRowNode(S))throw Error("Expected TableNode first child to be a RowNode");let v=[];for(let I=0;I<O;I++){if(I!==0&&(S=S.getNextSibling(),!r.DEPRECATED_$isGridRowNode(S)))throw Error("Expected TableNode first child to be a RowNode");let G=null;for(let k=0;k<m;k++){var w=T[I][k];let P=w.cell;if(w.startRow===I&&w.startColumn===k)G=P,v.push(P);else if(1<P.getColSpan()||1<P.getRowSpan()){if(!t.$isTableCellNode(P))throw Error("Expected TableNode cell to be a TableCellNode");w=t.$createTableCellNode(P.__headerState),G!==null?G.insertAfter(w):n.$insertFirst(S,w)}}}for(let I of v)I.setColSpan(1),I.setRowSpan(1)}})},[E,f]),l.useEffect(()=>{if(!p)return E.registerNodeTransform(t.TableCellNode,T=>{T.getBackgroundColor()!==null&&T.setBackgroundColor(null)})},[E,p,f]),null},Du}const HC=process.env.NODE_ENV==="development"?FC():BC();var WC=HC,Pn={},Au={exports:{}},Rh;function Dp(){return Rh||(Rh=1,function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
81
81
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
82
82
|
*
|
|
83
83
|
* @license MIT <https://opensource.org/licenses/MIT>
|
|
84
84
|
* @author Lea Verou <https://lea.verou.me>
|
|
85
85
|
* @namespace
|
|
86
86
|
* @public
|
|
87
|
-
*/var n=function(r){var l=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,d=0,f={},p={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function I(P){return P instanceof _?new _(P.type,I(P.content),P.alias):Array.isArray(P)?P.map(I):P.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(I){return Object.prototype.toString.call(I).slice(8,-1)},objId:function(I){return I.__id||Object.defineProperty(I,"__id",{value:++d}),I.__id},clone:function I(P,H){H=H||{};var j,re;switch(p.util.type(P)){case"Object":if(re=p.util.objId(P),H[re])return H[re];j={},H[re]=j;for(var te in P)P.hasOwnProperty(te)&&(j[te]=I(P[te],H));return j;case"Array":return re=p.util.objId(P),H[re]?H[re]:(j=[],H[re]=j,P.forEach(function(ce,V){j[V]=I(ce,H)}),j);default:return P}},getLanguage:function(I){for(;I;){var P=l.exec(I.className);if(P)return P[1].toLowerCase();I=I.parentElement}return"none"},setLanguage:function(I,P){I.className=I.className.replace(RegExp(l,"gi"),""),I.classList.add("language-"+P)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(j){var I=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(j.stack)||[])[1];if(I){var P=document.getElementsByTagName("script");for(var H in P)if(P[H].src==I)return P[H]}return null}},isActive:function(I,P,H){for(var j="no-"+P;I;){var re=I.classList;if(re.contains(P))return!0;if(re.contains(j))return!1;I=I.parentElement}return!!H}},languages:{plain:f,plaintext:f,text:f,txt:f,extend:function(I,P){var H=p.util.clone(p.languages[I]);for(var j in P)H[j]=P[j];return H},insertBefore:function(I,P,H,j){j=j||p.languages;var re=j[I],te={};for(var ce in re)if(re.hasOwnProperty(ce)){if(ce==P)for(var V in H)H.hasOwnProperty(V)&&(te[V]=H[V]);H.hasOwnProperty(ce)||(te[ce]=re[ce])}var z=j[I];return j[I]=te,p.languages.DFS(p.languages,function(q,Te){Te===z&&q!=I&&(this[q]=te)}),te},DFS:function I(P,H,j,re){re=re||{};var te=p.util.objId;for(var ce in P)if(P.hasOwnProperty(ce)){H.call(P,ce,P[ce],j||ce);var V=P[ce],z=p.util.type(V);z==="Object"&&!re[te(V)]?(re[te(V)]=!0,I(V,H,null,re)):z==="Array"&&!re[te(V)]&&(re[te(V)]=!0,I(V,H,ce,re))}}},plugins:{},highlightAll:function(I,P){p.highlightAllUnder(document,I,P)},highlightAllUnder:function(I,P,H){var j={callback:H,container:I,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};p.hooks.run("before-highlightall",j),j.elements=Array.prototype.slice.apply(j.container.querySelectorAll(j.selector)),p.hooks.run("before-all-elements-highlight",j);for(var re=0,te;te=j.elements[re++];)p.highlightElement(te,P===!0,j.callback)},highlightElement:function(I,P,H){var j=p.util.getLanguage(I),re=p.languages[j];p.util.setLanguage(I,j);var te=I.parentElement;te&&te.nodeName.toLowerCase()==="pre"&&p.util.setLanguage(te,j);var ce=I.textContent,V={element:I,language:j,grammar:re,code:ce};function z(Te){V.highlightedCode=Te,p.hooks.run("before-insert",V),V.element.innerHTML=V.highlightedCode,p.hooks.run("after-highlight",V),p.hooks.run("complete",V),H&&H.call(V.element)}if(p.hooks.run("before-sanity-check",V),te=V.element.parentElement,te&&te.nodeName.toLowerCase()==="pre"&&!te.hasAttribute("tabindex")&&te.setAttribute("tabindex","0"),!V.code){p.hooks.run("complete",V),H&&H.call(V.element);return}if(p.hooks.run("before-highlight",V),!V.grammar){z(p.util.encode(V.code));return}if(P&&r.Worker){var q=new Worker(p.filename);q.onmessage=function(Te){z(Te.data)},q.postMessage(JSON.stringify({language:V.language,code:V.code,immediateClose:!0}))}else z(p.highlight(V.code,V.grammar,V.language))},highlight:function(I,P,H){var j={code:I,grammar:P,language:H};if(p.hooks.run("before-tokenize",j),!j.grammar)throw new Error('The language "'+j.language+'" has no grammar.');return j.tokens=p.tokenize(j.code,j.grammar),p.hooks.run("after-tokenize",j),_.stringify(p.util.encode(j.tokens),j.language)},tokenize:function(I,P){var H=P.rest;if(H){for(var j in H)P[j]=H[j];delete P.rest}var re=new S;return w(re,re.head,I),E(I,re,P,re.head,0),m(re)},hooks:{all:{},add:function(I,P){var H=p.hooks.all;H[I]=H[I]||[],H[I].push(P)},run:function(I,P){var H=p.hooks.all[I];if(!(!H||!H.length))for(var j=0,re;re=H[j++];)re(P)}},Token:_};r.Prism=p;function _(I,P,H,j){this.type=I,this.content=P,this.alias=H,this.length=(j||"").length|0}_.stringify=function I(P,H){if(typeof P=="string")return P;if(Array.isArray(P)){var j="";return P.forEach(function(z){j+=I(z,H)}),j}var re={type:P.type,content:I(P.content,H),tag:"span",classes:["token",P.type],attributes:{},language:H},te=P.alias;te&&(Array.isArray(te)?Array.prototype.push.apply(re.classes,te):re.classes.push(te)),p.hooks.run("wrap",re);var ce="";for(var V in re.attributes)ce+=" "+V+'="'+(re.attributes[V]||"").replace(/"/g,""")+'"';return"<"+re.tag+' class="'+re.classes.join(" ")+'"'+ce+">"+re.content+"</"+re.tag+">"};function T(I,P,H,j){I.lastIndex=P;var re=I.exec(H);if(re&&j&&re[1]){var te=re[1].length;re.index+=te,re[0]=re[0].slice(te)}return re}function E(I,P,H,j,re,te){for(var ce in H)if(!(!H.hasOwnProperty(ce)||!H[ce])){var V=H[ce];V=Array.isArray(V)?V:[V];for(var z=0;z<V.length;++z){if(te&&te.cause==ce+","+z)return;var q=V[z],Te=q.inside,Se=!!q.lookbehind,Ee=!!q.greedy,de=q.alias;if(Ee&&!q.pattern.global){var K=q.pattern.toString().match(/[imsuy]*$/)[0];q.pattern=RegExp(q.pattern.source,K+"g")}for(var O=q.pattern||q,Z=j.next,oe=re;Z!==P.tail&&!(te&&oe>=te.reach);oe+=Z.value.length,Z=Z.next){var Y=Z.value;if(P.length>I.length)return;if(!(Y instanceof _)){var W=1,J;if(Ee){if(J=T(O,oe,I,Se),!J||J.index>=I.length)break;var fe=J.index,R=J.index+J[0].length,U=oe;for(U+=Z.value.length;fe>=U;)Z=Z.next,U+=Z.value.length;if(U-=Z.value.length,oe=U,Z.value instanceof _)continue;for(var X=Z;X!==P.tail&&(U<R||typeof X.value=="string");X=X.next)W++,U+=X.value.length;W--,Y=I.slice(oe,U),J.index-=oe}else if(J=T(O,0,Y,Se),!J)continue;var fe=J.index,_e=J[0],B=Y.slice(0,fe),A=Y.slice(fe+_e.length),F=oe+Y.length;te&&F>te.reach&&(te.reach=F);var se=Z.prev;B&&(se=w(P,se,B),oe+=B.length),M(P,se,W);var ye=new _(ce,Te?p.tokenize(_e,Te):_e,de,_e);if(Z=w(P,se,ye),A&&w(P,Z,A),W>1){var De={cause:ce+","+z,reach:F};E(I,P,H,Z.prev,oe,De),te&&De.reach>te.reach&&(te.reach=De.reach)}}}}}}function S(){var I={value:null,prev:null,next:null},P={value:null,prev:I,next:null};I.next=P,this.head=I,this.tail=P,this.length=0}function w(I,P,H){var j=P.next,re={value:H,prev:P,next:j};return P.next=re,j.prev=re,I.length++,re}function M(I,P,H){for(var j=P.next,re=0;re<H&&j!==I.tail;re++)j=j.next;P.next=j,j.prev=P,I.length-=re}function m(I){for(var P=[],H=I.head.next;H!==I.tail;)P.push(H.value),H=H.next;return P}if(!r.document)return r.addEventListener&&(p.disableWorkerMessageHandler||r.addEventListener("message",function(I){var P=JSON.parse(I.data),H=P.language,j=P.code,re=P.immediateClose;r.postMessage(p.highlight(j,p.languages[H],H)),re&&r.close()},!1)),p;var v=p.util.currentScript();v&&(p.filename=v.src,v.hasAttribute("data-manual")&&(p.manual=!0));function k(){p.manual||p.highlightAll()}if(!p.manual){var G=document.readyState;G==="loading"||G==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",k):window.requestAnimationFrame?window.requestAnimationFrame(k):window.setTimeout(k,16)}return p}(t);e.exports&&(e.exports=n),typeof ff<"u"&&(ff.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(l,d){var f={};f["language-"+d]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[d]},f.cdata=/^<!\[CDATA\[|\]\]>$/i;var p={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:f}};p["language-"+d]={pattern:/[\s\S]+/,inside:n.languages[d]};var _={};_[l]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:p},n.languages.insertBefore("markup","cdata",_)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,l){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[l,"language-"+l],inside:n.languages[l]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(r){var l=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+l.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+l.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+l.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+l.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:l,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var d=r.languages.markup;d&&(d.tag.addInlined("style","css"),d.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",l=function(v,k){return"✖ Error "+v+" while fetching file: "+k},d="✖ Error: File does not exist or is empty",f={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},p="data-src-status",_="loading",T="loaded",E="failed",S="pre[data-src]:not(["+p+'="'+T+'"]):not(['+p+'="'+_+'"])';function w(v,k,G){var I=new XMLHttpRequest;I.open("GET",v,!0),I.onreadystatechange=function(){I.readyState==4&&(I.status<400&&I.responseText?k(I.responseText):I.status>=400?G(l(I.status,I.statusText)):G(d))},I.send(null)}function M(v){var k=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(k){var G=Number(k[1]),I=k[2],P=k[3];return I?P?[G,Number(P)]:[G,void 0]:[G,G]}}n.hooks.add("before-highlightall",function(v){v.selector+=", "+S}),n.hooks.add("before-sanity-check",function(v){var k=v.element;if(k.matches(S)){v.code="",k.setAttribute(p,_);var G=k.appendChild(document.createElement("CODE"));G.textContent=r;var I=k.getAttribute("data-src"),P=v.language;if(P==="none"){var H=(/\.(\w+)$/.exec(I)||[,"none"])[1];P=f[H]||H}n.util.setLanguage(G,P),n.util.setLanguage(k,P);var j=n.plugins.autoloader;j&&j.loadLanguages(P),w(I,function(re){k.setAttribute(p,T);var te=M(k.getAttribute("data-range"));if(te){var ce=re.split(/\r\n?|\n/g),V=te[0],z=te[1]==null?ce.length:te[1];V<0&&(V+=ce.length),V=Math.max(0,Math.min(V-1,ce.length)),z<0&&(z+=ce.length),z=Math.max(0,Math.min(z,ce.length)),re=ce.slice(V,z).join(`
|
|
88
|
-
`),k.hasAttribute("data-start")||k.setAttribute("data-start",String(V+1))}G.textContent=re,n.highlightElement(G)},function(re){k.setAttribute(p,E),G.textContent=re})}}),n.plugins.fileHighlight={highlight:function(k){for(var G=(k||document).querySelectorAll(S),I=0,P;P=G[I++];)n.highlightElement(P)}};var m=!1;n.fileHighlight=function(){m||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),m=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(wu)),wu.exports}var Dh={},Ah;function wp(){return Ah||(Ah=1,Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}),Dh}var Mh={},Rh;function Op(){return Rh||(Rh=1,Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript),Mh}var bh={},Lh;function Dp(){return Lh||(Lh=1,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};l["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var d={};d[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:l},Prism.languages.insertBefore("markup","cdata",d)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml),bh}var Ih={},kh;function Ap(){return kh||(kh=1,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(E){return E=E.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+E+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),d=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+d+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+d+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+d+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(E){["url","bold","italic","strike","code-snippet"].forEach(function(S){E!==S&&(e.languages.markdown[E].inside.content.inside[S]=e.languages.markdown[S])})}),e.hooks.add("after-tokenize",function(E){if(E.language!=="markdown"&&E.language!=="md")return;function S(w){if(!(!w||typeof w=="string"))for(var M=0,m=w.length;M<m;M++){var v=w[M];if(v.type!=="code"){S(v.content);continue}var k=v.content[1],G=v.content[3];if(k&&G&&k.type==="code-language"&&G.type==="code-block"&&typeof k.content=="string"){var I=k.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");I=(/[a-z][\w-]*/i.exec(I)||[""])[0].toLowerCase();var P="language-"+I;G.alias?typeof G.alias=="string"?G.alias=[G.alias,P]:G.alias.push(P):G.alias=[P]}}}S(E.tokens)}),e.hooks.add("wrap",function(E){if(E.type==="code-block"){for(var S="",w=0,M=E.classes.length;w<M;w++){var m=E.classes[w],v=/language-(.+)/.exec(m);if(v){S=v[1];break}}var k=e.languages[S];if(k)E.content=e.highlight(T(E.content),k,S);else if(S&&S!=="none"&&e.plugins.autoloader){var G="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);E.attributes.id=G,e.plugins.autoloader.loadLanguages(S,function(){var I=document.getElementById(G);I&&(I.innerHTML=e.highlight(I.textContent,e.languages[S],S))})}}});var f=RegExp(e.languages.markup.tag.pattern.source,"gi"),p={amp:"&",lt:"<",gt:">",quot:'"'},_=String.fromCodePoint||String.fromCharCode;function T(E){var S=E.replace(f,"");return S=S.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(w,M){if(M=M.toLowerCase(),M[0]==="#"){var m;return M[1]==="x"?m=parseInt(M.slice(2),16):m=Number(M.slice(1)),_(m)}else{var v=p[M];return v||w}}),S}e.languages.md=e.languages.markdown}(Prism)),Ih}var Ph={},$h;function Mp(){return $h||($h=1,Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean),Ph}var Fh={},Bh;function Rp(){return Bh||(Bh=1,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)),Fh}var Hh={},Wh;function bp(){return Wh||(Wh=1,Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec),Hh}var Kh={},zh;function Lp(){return zh||(zh=1,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}),Kh}var Uh={},Gh;function Ip(){return Gh||(Gh=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Uh}var Yh={},jh;function kp(){return jh||(jh=1,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism)),Yh}var Vh={},qh;function Pp(){return qh||(qh=1,Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift})),Vh}var Zh={},Jh;function $p(){return Jh||(Jh=1,function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism)),Zh}var Xh={},Qh;function Fp(){return Qh||(Qh=1,function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)),Xh}var eg={},tg;function Bp(){return tg||(tg=1,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism)),eg}var ng;function FC(){if(ng)return Pn;ng=1;var e=Sp();wp(),Op(),Dp(),Ap(),Mp(),Rp(),bp(),Lp(),Ip(),kp(),Pp(),$p(),Fp(),Bp();var t=pn(),n=Yt();const r=ee=>ee!=null&&e.languages.hasOwnProperty(ee)?ee:void 0;function l(ee,ne){for(const ue of ee.childNodes){if(t.isHTMLElement(ue)&&ue.tagName===ne)return!0;l(ue,ne)}return!1}const d="data-highlight-language";class f extends n.ElementNode{static getType(){return"code"}static clone(ne){return new f(ne.__language,ne.__key)}constructor(ne,ue){super(ue),this.__language=r(ne)}createDOM(ne){const ue=document.createElement("code");t.addClassNamesToElement(ue,ne.theme.code),ue.setAttribute("spellcheck","false");const be=this.getLanguage();return be&&ue.setAttribute(d,be),ue}updateDOM(ne,ue,be){const Ne=this.__language,Re=ne.__language;return Ne?Ne!==Re&&ue.setAttribute(d,Ne):Re&&ue.removeAttribute(d),!1}exportDOM(){const ne=document.createElement("pre");ne.setAttribute("spellcheck","false");const ue=this.getLanguage();return ue&&ne.setAttribute(d,ue),{element:ne}}static importDOM(){return{code:ne=>ne.textContent!=null&&(/\r?\n/.test(ne.textContent)||l(ne,"BR"))?{conversion:T,priority:1}:null,div:ne=>({conversion:E,priority:1}),pre:ne=>({conversion:T,priority:0}),table:ne=>G(ne)?{conversion:S,priority:3}:null,td:ne=>{const ue=ne,be=ue.closest("table");return k(ue)?{conversion:M,priority:3}:be&&G(be)?{conversion:w,priority:3}:null},tr:ne=>{const be=ne.closest("table");return be&&G(be)?{conversion:w,priority:3}:null}}}static importJSON(ne){const ue=p(ne.language);return ue.setFormat(ne.format),ue.setIndent(ne.indent),ue.setDirection(ne.direction),ue}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(ne,ue=!0){const be=this.getChildren(),Ne=be.length;if(Ne>=2&&be[Ne-1].getTextContent()===`
|
|
87
|
+
*/var n=function(r){var l=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,d=0,f={},p={manual:r.Prism&&r.Prism.manual,disableWorkerMessageHandler:r.Prism&&r.Prism.disableWorkerMessageHandler,util:{encode:function k(P){return P instanceof _?new _(P.type,k(P.content),P.alias):Array.isArray(P)?P.map(k):P.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(k){return Object.prototype.toString.call(k).slice(8,-1)},objId:function(k){return k.__id||Object.defineProperty(k,"__id",{value:++d}),k.__id},clone:function k(P,H){H=H||{};var j,re;switch(p.util.type(P)){case"Object":if(re=p.util.objId(P),H[re])return H[re];j={},H[re]=j;for(var te in P)P.hasOwnProperty(te)&&(j[te]=k(P[te],H));return j;case"Array":return re=p.util.objId(P),H[re]?H[re]:(j=[],H[re]=j,P.forEach(function(ce,V){j[V]=k(ce,H)}),j);default:return P}},getLanguage:function(k){for(;k;){var P=l.exec(k.className);if(P)return P[1].toLowerCase();k=k.parentElement}return"none"},setLanguage:function(k,P){k.className=k.className.replace(RegExp(l,"gi"),""),k.classList.add("language-"+P)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(j){var k=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(j.stack)||[])[1];if(k){var P=document.getElementsByTagName("script");for(var H in P)if(P[H].src==k)return P[H]}return null}},isActive:function(k,P,H){for(var j="no-"+P;k;){var re=k.classList;if(re.contains(P))return!0;if(re.contains(j))return!1;k=k.parentElement}return!!H}},languages:{plain:f,plaintext:f,text:f,txt:f,extend:function(k,P){var H=p.util.clone(p.languages[k]);for(var j in P)H[j]=P[j];return H},insertBefore:function(k,P,H,j){j=j||p.languages;var re=j[k],te={};for(var ce in re)if(re.hasOwnProperty(ce)){if(ce==P)for(var V in H)H.hasOwnProperty(V)&&(te[V]=H[V]);H.hasOwnProperty(ce)||(te[ce]=re[ce])}var z=j[k];return j[k]=te,p.languages.DFS(p.languages,function(q,Te){Te===z&&q!=k&&(this[q]=te)}),te},DFS:function k(P,H,j,re){re=re||{};var te=p.util.objId;for(var ce in P)if(P.hasOwnProperty(ce)){H.call(P,ce,P[ce],j||ce);var V=P[ce],z=p.util.type(V);z==="Object"&&!re[te(V)]?(re[te(V)]=!0,k(V,H,null,re)):z==="Array"&&!re[te(V)]&&(re[te(V)]=!0,k(V,H,ce,re))}}},plugins:{},highlightAll:function(k,P){p.highlightAllUnder(document,k,P)},highlightAllUnder:function(k,P,H){var j={callback:H,container:k,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};p.hooks.run("before-highlightall",j),j.elements=Array.prototype.slice.apply(j.container.querySelectorAll(j.selector)),p.hooks.run("before-all-elements-highlight",j);for(var re=0,te;te=j.elements[re++];)p.highlightElement(te,P===!0,j.callback)},highlightElement:function(k,P,H){var j=p.util.getLanguage(k),re=p.languages[j];p.util.setLanguage(k,j);var te=k.parentElement;te&&te.nodeName.toLowerCase()==="pre"&&p.util.setLanguage(te,j);var ce=k.textContent,V={element:k,language:j,grammar:re,code:ce};function z(Te){V.highlightedCode=Te,p.hooks.run("before-insert",V),V.element.innerHTML=V.highlightedCode,p.hooks.run("after-highlight",V),p.hooks.run("complete",V),H&&H.call(V.element)}if(p.hooks.run("before-sanity-check",V),te=V.element.parentElement,te&&te.nodeName.toLowerCase()==="pre"&&!te.hasAttribute("tabindex")&&te.setAttribute("tabindex","0"),!V.code){p.hooks.run("complete",V),H&&H.call(V.element);return}if(p.hooks.run("before-highlight",V),!V.grammar){z(p.util.encode(V.code));return}if(P&&r.Worker){var q=new Worker(p.filename);q.onmessage=function(Te){z(Te.data)},q.postMessage(JSON.stringify({language:V.language,code:V.code,immediateClose:!0}))}else z(p.highlight(V.code,V.grammar,V.language))},highlight:function(k,P,H){var j={code:k,grammar:P,language:H};if(p.hooks.run("before-tokenize",j),!j.grammar)throw new Error('The language "'+j.language+'" has no grammar.');return j.tokens=p.tokenize(j.code,j.grammar),p.hooks.run("after-tokenize",j),_.stringify(p.util.encode(j.tokens),j.language)},tokenize:function(k,P){var H=P.rest;if(H){for(var j in H)P[j]=H[j];delete P.rest}var re=new S;return w(re,re.head,k),T(k,re,P,re.head,0),m(re)},hooks:{all:{},add:function(k,P){var H=p.hooks.all;H[k]=H[k]||[],H[k].push(P)},run:function(k,P){var H=p.hooks.all[k];if(!(!H||!H.length))for(var j=0,re;re=H[j++];)re(P)}},Token:_};r.Prism=p;function _(k,P,H,j){this.type=k,this.content=P,this.alias=H,this.length=(j||"").length|0}_.stringify=function k(P,H){if(typeof P=="string")return P;if(Array.isArray(P)){var j="";return P.forEach(function(z){j+=k(z,H)}),j}var re={type:P.type,content:k(P.content,H),tag:"span",classes:["token",P.type],attributes:{},language:H},te=P.alias;te&&(Array.isArray(te)?Array.prototype.push.apply(re.classes,te):re.classes.push(te)),p.hooks.run("wrap",re);var ce="";for(var V in re.attributes)ce+=" "+V+'="'+(re.attributes[V]||"").replace(/"/g,""")+'"';return"<"+re.tag+' class="'+re.classes.join(" ")+'"'+ce+">"+re.content+"</"+re.tag+">"};function E(k,P,H,j){k.lastIndex=P;var re=k.exec(H);if(re&&j&&re[1]){var te=re[1].length;re.index+=te,re[0]=re[0].slice(te)}return re}function T(k,P,H,j,re,te){for(var ce in H)if(!(!H.hasOwnProperty(ce)||!H[ce])){var V=H[ce];V=Array.isArray(V)?V:[V];for(var z=0;z<V.length;++z){if(te&&te.cause==ce+","+z)return;var q=V[z],Te=q.inside,Se=!!q.lookbehind,Ee=!!q.greedy,de=q.alias;if(Ee&&!q.pattern.global){var K=q.pattern.toString().match(/[imsuy]*$/)[0];q.pattern=RegExp(q.pattern.source,K+"g")}for(var D=q.pattern||q,Z=j.next,oe=re;Z!==P.tail&&!(te&&oe>=te.reach);oe+=Z.value.length,Z=Z.next){var Y=Z.value;if(P.length>k.length)return;if(!(Y instanceof _)){var W=1,J;if(Ee){if(J=E(D,oe,k,Se),!J||J.index>=k.length)break;var fe=J.index,R=J.index+J[0].length,U=oe;for(U+=Z.value.length;fe>=U;)Z=Z.next,U+=Z.value.length;if(U-=Z.value.length,oe=U,Z.value instanceof _)continue;for(var X=Z;X!==P.tail&&(U<R||typeof X.value=="string");X=X.next)W++,U+=X.value.length;W--,Y=k.slice(oe,U),J.index-=oe}else if(J=E(D,0,Y,Se),!J)continue;var fe=J.index,_e=J[0],B=Y.slice(0,fe),M=Y.slice(fe+_e.length),F=oe+Y.length;te&&F>te.reach&&(te.reach=F);var se=Z.prev;B&&(se=w(P,se,B),oe+=B.length),O(P,se,W);var ye=new _(ce,Te?p.tokenize(_e,Te):_e,de,_e);if(Z=w(P,se,ye),M&&w(P,Z,M),W>1){var De={cause:ce+","+z,reach:F};T(k,P,H,Z.prev,oe,De),te&&De.reach>te.reach&&(te.reach=De.reach)}}}}}}function S(){var k={value:null,prev:null,next:null},P={value:null,prev:k,next:null};k.next=P,this.head=k,this.tail=P,this.length=0}function w(k,P,H){var j=P.next,re={value:H,prev:P,next:j};return P.next=re,j.prev=re,k.length++,re}function O(k,P,H){for(var j=P.next,re=0;re<H&&j!==k.tail;re++)j=j.next;P.next=j,j.prev=P,k.length-=re}function m(k){for(var P=[],H=k.head.next;H!==k.tail;)P.push(H.value),H=H.next;return P}if(!r.document)return r.addEventListener&&(p.disableWorkerMessageHandler||r.addEventListener("message",function(k){var P=JSON.parse(k.data),H=P.language,j=P.code,re=P.immediateClose;r.postMessage(p.highlight(j,p.languages[H],H)),re&&r.close()},!1)),p;var v=p.util.currentScript();v&&(p.filename=v.src,v.hasAttribute("data-manual")&&(p.manual=!0));function I(){p.manual||p.highlightAll()}if(!p.manual){var G=document.readyState;G==="loading"||G==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",I):window.requestAnimationFrame?window.requestAnimationFrame(I):window.setTimeout(I,16)}return p}(t);e.exports&&(e.exports=n),typeof mf<"u"&&(mf.Prism=n),n.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},n.languages.markup.tag.inside["attr-value"].inside.entity=n.languages.markup.entity,n.languages.markup.doctype.inside["internal-subset"].inside=n.languages.markup,n.hooks.add("wrap",function(r){r.type==="entity"&&(r.attributes.title=r.content.replace(/&/,"&"))}),Object.defineProperty(n.languages.markup.tag,"addInlined",{value:function(l,d){var f={};f["language-"+d]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:n.languages[d]},f.cdata=/^<!\[CDATA\[|\]\]>$/i;var p={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:f}};p["language-"+d]={pattern:/[\s\S]+/,inside:n.languages[d]};var _={};_[l]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return l}),"i"),lookbehind:!0,greedy:!0,inside:p},n.languages.insertBefore("markup","cdata",_)}}),Object.defineProperty(n.languages.markup.tag,"addAttribute",{value:function(r,l){n.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+r+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[l,"language-"+l],inside:n.languages[l]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),n.languages.html=n.languages.markup,n.languages.mathml=n.languages.markup,n.languages.svg=n.languages.markup,n.languages.xml=n.languages.extend("markup",{}),n.languages.ssml=n.languages.xml,n.languages.atom=n.languages.xml,n.languages.rss=n.languages.xml,function(r){var l=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;r.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+l.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+l.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+l.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+l.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:l,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},r.languages.css.atrule.inside.rest=r.languages.css;var d=r.languages.markup;d&&(d.tag.addInlined("style","css"),d.tag.addAttribute("style","css"))}(n),n.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},n.languages.javascript=n.languages.extend("clike",{"class-name":[n.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),n.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,n.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:n.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:n.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:n.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:n.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:n.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),n.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:n.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),n.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),n.languages.markup&&(n.languages.markup.tag.addInlined("script","javascript"),n.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),n.languages.js=n.languages.javascript,function(){if(typeof n>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var r="Loading…",l=function(v,I){return"✖ Error "+v+" while fetching file: "+I},d="✖ Error: File does not exist or is empty",f={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},p="data-src-status",_="loading",E="loaded",T="failed",S="pre[data-src]:not(["+p+'="'+E+'"]):not(['+p+'="'+_+'"])';function w(v,I,G){var k=new XMLHttpRequest;k.open("GET",v,!0),k.onreadystatechange=function(){k.readyState==4&&(k.status<400&&k.responseText?I(k.responseText):k.status>=400?G(l(k.status,k.statusText)):G(d))},k.send(null)}function O(v){var I=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(I){var G=Number(I[1]),k=I[2],P=I[3];return k?P?[G,Number(P)]:[G,void 0]:[G,G]}}n.hooks.add("before-highlightall",function(v){v.selector+=", "+S}),n.hooks.add("before-sanity-check",function(v){var I=v.element;if(I.matches(S)){v.code="",I.setAttribute(p,_);var G=I.appendChild(document.createElement("CODE"));G.textContent=r;var k=I.getAttribute("data-src"),P=v.language;if(P==="none"){var H=(/\.(\w+)$/.exec(k)||[,"none"])[1];P=f[H]||H}n.util.setLanguage(G,P),n.util.setLanguage(I,P);var j=n.plugins.autoloader;j&&j.loadLanguages(P),w(k,function(re){I.setAttribute(p,E);var te=O(I.getAttribute("data-range"));if(te){var ce=re.split(/\r\n?|\n/g),V=te[0],z=te[1]==null?ce.length:te[1];V<0&&(V+=ce.length),V=Math.max(0,Math.min(V-1,ce.length)),z<0&&(z+=ce.length),z=Math.max(0,Math.min(z,ce.length)),re=ce.slice(V,z).join(`
|
|
88
|
+
`),I.hasAttribute("data-start")||I.setAttribute("data-start",String(V+1))}G.textContent=re,n.highlightElement(G)},function(re){I.setAttribute(p,T),G.textContent=re})}}),n.plugins.fileHighlight={highlight:function(I){for(var G=(I||document).querySelectorAll(S),k=0,P;P=G[k++];)n.highlightElement(P)}};var m=!1;n.fileHighlight=function(){m||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),m=!0),n.plugins.fileHighlight.highlight.apply(this,arguments)}}()}(Au)),Au.exports}var bh={},Lh;function Ap(){return Lh||(Lh=1,Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}),bh}var Ih={},kh;function Mp(){return kh||(kh=1,Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript),Ih}var Ph={},$h;function Rp(){return $h||($h=1,Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,n){var r={};r["language-"+n]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[n]},r.cdata=/^<!\[CDATA\[|\]\]>$/i;var l={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:r}};l["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var d={};d[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:l},Prism.languages.insertBefore("markup","cdata",d)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(e,t){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:Prism.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml),Ph}var Fh={},Bh;function bp(){return Bh||(Bh=1,function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(T){return T=T.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+T+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),d=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+d+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+d+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+d+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(T){["url","bold","italic","strike","code-snippet"].forEach(function(S){T!==S&&(e.languages.markdown[T].inside.content.inside[S]=e.languages.markdown[S])})}),e.hooks.add("after-tokenize",function(T){if(T.language!=="markdown"&&T.language!=="md")return;function S(w){if(!(!w||typeof w=="string"))for(var O=0,m=w.length;O<m;O++){var v=w[O];if(v.type!=="code"){S(v.content);continue}var I=v.content[1],G=v.content[3];if(I&&G&&I.type==="code-language"&&G.type==="code-block"&&typeof I.content=="string"){var k=I.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");k=(/[a-z][\w-]*/i.exec(k)||[""])[0].toLowerCase();var P="language-"+k;G.alias?typeof G.alias=="string"?G.alias=[G.alias,P]:G.alias.push(P):G.alias=[P]}}}S(T.tokens)}),e.hooks.add("wrap",function(T){if(T.type==="code-block"){for(var S="",w=0,O=T.classes.length;w<O;w++){var m=T.classes[w],v=/language-(.+)/.exec(m);if(v){S=v[1];break}}var I=e.languages[S];if(I)T.content=e.highlight(E(T.content),I,S);else if(S&&S!=="none"&&e.plugins.autoloader){var G="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);T.attributes.id=G,e.plugins.autoloader.loadLanguages(S,function(){var k=document.getElementById(G);k&&(k.innerHTML=e.highlight(k.textContent,e.languages[S],S))})}}});var f=RegExp(e.languages.markup.tag.pattern.source,"gi"),p={amp:"&",lt:"<",gt:">",quot:'"'},_=String.fromCodePoint||String.fromCharCode;function E(T){var S=T.replace(f,"");return S=S.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(w,O){if(O=O.toLowerCase(),O[0]==="#"){var m;return O[1]==="x"?m=parseInt(O.slice(2),16):m=Number(O.slice(1)),_(m)}else{var v=p[O];return v||w}}),S}e.languages.md=e.languages.markdown}(Prism)),Fh}var Hh={},Wh;function Lp(){return Wh||(Wh=1,Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean),Hh}var Kh={},zh;function Ip(){return zh||(zh=1,function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(Prism)),Kh}var Uh={},Gh;function kp(){return Gh||(Gh=1,Prism.languages.objectivec=Prism.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete Prism.languages.objectivec["class-name"],Prism.languages.objc=Prism.languages.objectivec),Uh}var Yh={},jh;function Pp(){return jh||(jh=1,Prism.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}),Yh}var Vh={},qh;function $p(){return qh||(qh=1,Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python),Vh}var Zh={},Jh;function Fp(){return Jh||(Jh=1,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(Prism)),Zh}var Xh={},Qh;function Bp(){return Qh||(Qh=1,Prism.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},Prism.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=Prism.languages.swift})),Xh}var eg={},tg;function Hp(){return tg||(tg=1,function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(Prism)),eg}var ng={},rg;function Wp(){return rg||(rg=1,function(e){var t=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,n=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,r={pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};e.languages.java=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[r,{pattern:RegExp(/(^|[^\w.])/.source+n+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:r.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+n+/[A-Z]\w*\b/.source),lookbehind:!0,inside:r.inside}],keyword:t,function:[e.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),e.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),e.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":r,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+n+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:r.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+n+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:r.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0,inside:{punctuation:/\./}}})}(Prism)),ng}var ig={},sg;function Kp(){return sg||(sg=1,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(Prism)),ig}var og;function KC(){if(og)return Pn;og=1;var e=Dp();Ap(),Mp(),Rp(),bp(),Lp(),Ip(),kp(),Pp(),$p(),Fp(),Bp(),Hp(),Wp(),Kp();var t=pn(),n=jt();const r=ee=>ee!=null&&e.languages.hasOwnProperty(ee)?ee:void 0;function l(ee,ne){for(const ue of ee.childNodes){if(t.isHTMLElement(ue)&&ue.tagName===ne)return!0;l(ue,ne)}return!1}const d="data-highlight-language";class f extends n.ElementNode{static getType(){return"code"}static clone(ne){return new f(ne.__language,ne.__key)}constructor(ne,ue){super(ue),this.__language=r(ne)}createDOM(ne){const ue=document.createElement("code");t.addClassNamesToElement(ue,ne.theme.code),ue.setAttribute("spellcheck","false");const be=this.getLanguage();return be&&ue.setAttribute(d,be),ue}updateDOM(ne,ue,be){const Ne=this.__language,Re=ne.__language;return Ne?Ne!==Re&&ue.setAttribute(d,Ne):Re&&ue.removeAttribute(d),!1}exportDOM(){const ne=document.createElement("pre");ne.setAttribute("spellcheck","false");const ue=this.getLanguage();return ue&&ne.setAttribute(d,ue),{element:ne}}static importDOM(){return{code:ne=>ne.textContent!=null&&(/\r?\n/.test(ne.textContent)||l(ne,"BR"))?{conversion:E,priority:1}:null,div:ne=>({conversion:T,priority:1}),pre:ne=>({conversion:E,priority:0}),table:ne=>G(ne)?{conversion:S,priority:3}:null,td:ne=>{const ue=ne,be=ue.closest("table");return I(ue)?{conversion:O,priority:3}:be&&G(be)?{conversion:w,priority:3}:null},tr:ne=>{const be=ne.closest("table");return be&&G(be)?{conversion:w,priority:3}:null}}}static importJSON(ne){const ue=p(ne.language);return ue.setFormat(ne.format),ue.setIndent(ne.indent),ue.setDirection(ne.direction),ue}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(ne,ue=!0){const be=this.getChildren(),Ne=be.length;if(Ne>=2&&be[Ne-1].getTextContent()===`
|
|
89
89
|
`&&be[Ne-2].getTextContent()===`
|
|
90
|
-
`&&ne.isCollapsed()&&ne.anchor.key===this.__key&&ne.anchor.offset===Ne){be[Ne-1].remove(),be[Ne-2].remove();const Be=n.$createParagraphNode();return this.insertAfter(Be,ue),Be}const{anchor:Re,focus:ke}=ne,qe=(Re.isBefore(ke)?Re:ke).getNode();if(n.$isTextNode(qe)){let Be=Se(qe);const ut=[];for(;;)if(n.$isTabNode(Be))ut.push(n.$createTabNode()),Be=Be.getNextSibling();else if(Te(Be)){let ve=0;const Le=Be.getTextContent(),Me=Be.getTextContentSize();for(;ve<Me&&Le[ve]===" ";ve++);if(ve!==0&&ut.push(q(" ".repeat(ve))),ve!==Me)break;Be=Be.getNextSibling()}else break;const At=qe.splitText(Re.offset)[0],Ut=Re.offset===0?0:1,
|
|
90
|
+
`&&ne.isCollapsed()&&ne.anchor.key===this.__key&&ne.anchor.offset===Ne){be[Ne-1].remove(),be[Ne-2].remove();const Be=n.$createParagraphNode();return this.insertAfter(Be,ue),Be}const{anchor:Re,focus:ke}=ne,qe=(Re.isBefore(ke)?Re:ke).getNode();if(n.$isTextNode(qe)){let Be=Se(qe);const ut=[];for(;;)if(n.$isTabNode(Be))ut.push(n.$createTabNode()),Be=Be.getNextSibling();else if(Te(Be)){let ve=0;const Le=Be.getTextContent(),Me=Be.getTextContentSize();for(;ve<Me&&Le[ve]===" ";ve++);if(ve!==0&&ut.push(q(" ".repeat(ve))),ve!==Me)break;Be=Be.getNextSibling()}else break;const At=qe.splitText(Re.offset)[0],Ut=Re.offset===0?0:1,tn=At.getIndexWithinParent()+Ut,Oe=qe.getParentOrThrow(),ie=[n.$createLineBreakNode(),...ut];Oe.splice(tn,0,ie);const le=ut[ut.length-1];le?le.select():Re.offset===0?At.selectPrevious():At.getNextSibling().selectNext(0,0)}if(_(qe)){const{offset:Be}=ne.anchor;qe.splice(Be,0,[n.$createLineBreakNode()]),qe.select(Be+1,Be+1)}return null}canIndent(){return!1}collapseAtStart(){const ne=n.$createParagraphNode();return this.getChildren().forEach(be=>ne.append(be)),this.replace(ne),!0}setLanguage(ne){const ue=this.getWritable();ue.__language=r(ne)}getLanguage(){return this.getLatest().__language}}function p(ee){return n.$applyNodeReplacement(new f(ee))}function _(ee){return ee instanceof f}function E(ee){let ne;return t.isHTMLElement(ee)&&(ne=ee.getAttribute(d)),{node:p(ne)}}function T(ee){const ne=ee,ue=m(ne);return!ue&&!v(ne)?{node:null}:{after:be=>{const Ne=ee.parentNode;return Ne!=null&&ee!==Ne.lastChild&&be.push(n.$createLineBreakNode()),be},node:ue?p():null}}function S(){return{node:p()}}function w(){return{node:null}}function O(ee){const ne=ee;return{after:ue=>(ne.parentNode&&ne.parentNode.nextSibling&&ue.push(n.$createLineBreakNode()),ue),node:null}}function m(ee){return ee.style.fontFamily.match("monospace")!==null}function v(ee){let ne=ee.parentElement;for(;ne!==null;){if(m(ne))return!0;ne=ne.parentElement}return!1}function I(ee){return ee.classList.contains("js-file-line")}function G(ee){return ee.classList.contains("js-file-line-container")}const k="javascript",P={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},H={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function j(ee){return H[ee]||ee}function re(ee){const ne=j(ee);return P[ne]||ne}const te=()=>k,ce=()=>Object.keys(e.languages).filter(ee=>typeof e.languages[ee]!="function").sort();class V extends n.TextNode{constructor(ne,ue,be){super(ne,be),this.__highlightType=ue}static getType(){return"code-highlight"}static clone(ne){return new V(ne.__text,ne.__highlightType||void 0,ne.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(ne){const ue=super.createDOM(ne),be=z(ne.theme,this.__highlightType);return t.addClassNamesToElement(ue,be),ue}updateDOM(ne,ue,be){const Ne=super.updateDOM(ne,ue,be),Re=z(be.theme,ne.__highlightType),ke=z(be.theme,this.__highlightType);return Re!==ke&&(Re&&t.removeClassNamesFromElement(ue,Re),ke&&t.addClassNamesToElement(ue,ke)),Ne}static importJSON(ne){const ue=q(ne.text,ne.highlightType);return ue.setFormat(ne.format),ue.setDetail(ne.detail),ue.setMode(ne.mode),ue.setStyle(ne.style),ue}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(ne){return this}isParentRequired(){return!0}createParentElementNode(){return p()}}function z(ee,ne){return ne&&ee&&ee.codeHighlight&&ee.codeHighlight[ne]}function q(ee,ne){return n.$applyNodeReplacement(new V(ee,ne))}function Te(ee){return ee instanceof V}function Se(ee){let ne=ee,ue=ee;for(;Te(ue)||n.$isTabNode(ue);)ne=ue,ue=ue.getPreviousSibling();return ne}function Ee(ee){let ne=ee,ue=ee;for(;Te(ue)||n.$isTabNode(ue);)ne=ue,ue=ue.getNextSibling();return ne}const de={defaultLanguage:k,tokenize(ee,ne){return e.tokenize(ee,e.languages[ne||""]||e.languages[this.defaultLanguage])}};function K(ee,ne){let ue=null,be=null,Ne=ee,Re=ne,ke=ee.getTextContent();for(;;){if(Re===0){if(Ne=Ne.getPreviousSibling(),Ne===null)break;if(!(Te(Ne)||n.$isTabNode(Ne)||n.$isLineBreakNode(Ne)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(Ne)){ue={node:Ne,offset:1};break}Re=Math.max(0,Ne.getTextContentSize()-1),ke=Ne.getTextContent()}else Re--;const qe=ke[Re];Te(Ne)&&qe!==" "&&(be={node:Ne,offset:Re})}if(be!==null)return be;let Fe=null;if(ne<ee.getTextContentSize())Te(ee)&&(Fe=ee.getTextContent()[ne]);else{const qe=ee.getNextSibling();Te(qe)&&(Fe=qe.getTextContent()[0])}if(Fe!==null&&Fe!==" ")return ue;{const qe=D(ee,ne);return qe!==null?qe:ue}}function D(ee,ne){let ue=ee,be=ne,Ne=ee.getTextContent(),Re=ee.getTextContentSize();for(;;){if(!Te(ue)||be===Re){if(ue=ue.getNextSibling(),ue===null||n.$isLineBreakNode(ue))return null;Te(ue)&&(be=0,Ne=ue.getTextContent(),Re=ue.getTextContentSize())}if(Te(ue)){if(Ne[be]!==" ")return{node:ue,offset:be};be++}}}function Z(ee){const ne=Ee(ee);if(n.$isLineBreakNode(ne))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return ne}function oe(ee,ne,ue){const be=ee.getParent();_(be)?J(be,ne,ue):Te(ee)&&ee.replace(n.$createTextNode(ee.__text))}function Y(ee,ne){const ue=ne.getElementByKey(ee.getKey());if(ue===null)return;const be=ee.getChildren(),Ne=be.length;if(Ne===ue.__cachedChildrenLength)return;ue.__cachedChildrenLength=Ne;let Re="1",ke=1;for(let Fe=0;Fe<Ne;Fe++)n.$isLineBreakNode(be[Fe])&&(Re+=`
|
|
91
91
|
`+ ++ke);ue.setAttribute("data-gutter",Re)}const W=new Set;function J(ee,ne,ue){const be=ee.getKey();W.has(be)||(W.add(be),ee.getLanguage()===void 0&&ee.setLanguage(ue.defaultLanguage),ne.update(()=>{U(be,()=>{const Ne=n.$getNodeByKey(be);if(!_(Ne)||!Ne.isAttached())return!1;const Re=Ne.getTextContent(),ke=ue.tokenize(Re,Ne.getLanguage()||ue.defaultLanguage),Fe=R(ke),qe=X(Ne.getChildren(),Fe),{from:Be,to:ut,nodesForReplacement:At}=qe;return Be!==ut||At.length?(ee.splice(Be,ut-Be,At),!0):!1})},{onUpdate:()=>{W.delete(be)},skipTransforms:!0}))}function R(ee,ne){const ue=[];for(const be of ee)if(typeof be=="string"){const Ne=be.split(/(\n|\t)/),Re=Ne.length;for(let ke=0;ke<Re;ke++){const Fe=Ne[ke];Fe===`
|
|
92
92
|
`||Fe===`\r
|
|
93
|
-
`?ue.push(n.$createLineBreakNode()):Fe===" "?ue.push(n.$createTabNode()):Fe.length>0&&ue.push(q(Fe,ne))}}else{const{content:Ne}=be;typeof Ne=="string"?ue.push(...R([Ne],be.type)):Array.isArray(Ne)&&ue.push(...R(Ne,be.type))}return ue}function U(ee,ne){const ue=n.$getNodeByKey(ee);if(!_(ue)||!ue.isAttached())return;const be=n.$getSelection();if(!n.$isRangeSelection(be)){ne();return}const Ne=be.anchor,Re=Ne.offset,ke=Ne.type==="element"&&n.$isLineBreakNode(ue.getChildAtIndex(Ne.offset-1));let Fe=0;if(!ke){const Be=Ne.getNode();Fe=Re+Be.getPreviousSiblings().reduce((ut,At)=>ut+At.getTextContentSize(),0)}if(ne()){if(ke){Ne.getNode().select(Re,Re);return}ue.getChildren().some(Be=>{const ut=n.$isTextNode(Be);if(ut||n.$isLineBreakNode(Be)){const At=Be.getTextContentSize();if(ut&&At>=Fe)return Be.select(Fe,Fe),!0;Fe-=At}return!1})}}function X(ee,ne){let ue=0;for(;ue<ee.length&&fe(ee[ue],ne[ue]);)ue++;const be=ee.length,Ne=ne.length,Re=Math.min(be,Ne)-ue;let ke=0;for(;ke<Re;)if(ke++,!fe(ee[be-ke],ne[Ne-ke])){ke--;break}const Fe=ue,qe=be-ke,Be=ne.slice(ue,Ne-ke);return{from:Fe,nodesForReplacement:Be,to:qe}}function fe(ee,ne){return Te(ee)&&Te(ne)&&ee.__text===ne.__text&&ee.__highlightType===ne.__highlightType||n.$isTabNode(ee)&&n.$isTabNode(ne)||n.$isLineBreakNode(ee)&&n.$isLineBreakNode(ne)}function _e(ee){if(!n.$isRangeSelection(ee))return!1;const ne=ee.anchor.getNode(),ue=ee.focus.getNode();if(ne.is(ue)&&_(ne))return!0;const be=ne.getParent();return _(be)&&be.is(ue.getParent())}function B(ee){const ne=ee.getNodes(),ue=[[]];if(ne.length===1&&_(ne[0]))return ue;let be=ue[0];for(let Ne=0;Ne<ne.length;Ne++){const Re=ne[Ne];if(!(Te(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(Re)?Ne!==0&&be.length>0&&(be=[],ue.push(be)):be.push(Re)}return ue}function
|
|
93
|
+
`?ue.push(n.$createLineBreakNode()):Fe===" "?ue.push(n.$createTabNode()):Fe.length>0&&ue.push(q(Fe,ne))}}else{const{content:Ne}=be;typeof Ne=="string"?ue.push(...R([Ne],be.type)):Array.isArray(Ne)&&ue.push(...R(Ne,be.type))}return ue}function U(ee,ne){const ue=n.$getNodeByKey(ee);if(!_(ue)||!ue.isAttached())return;const be=n.$getSelection();if(!n.$isRangeSelection(be)){ne();return}const Ne=be.anchor,Re=Ne.offset,ke=Ne.type==="element"&&n.$isLineBreakNode(ue.getChildAtIndex(Ne.offset-1));let Fe=0;if(!ke){const Be=Ne.getNode();Fe=Re+Be.getPreviousSiblings().reduce((ut,At)=>ut+At.getTextContentSize(),0)}if(ne()){if(ke){Ne.getNode().select(Re,Re);return}ue.getChildren().some(Be=>{const ut=n.$isTextNode(Be);if(ut||n.$isLineBreakNode(Be)){const At=Be.getTextContentSize();if(ut&&At>=Fe)return Be.select(Fe,Fe),!0;Fe-=At}return!1})}}function X(ee,ne){let ue=0;for(;ue<ee.length&&fe(ee[ue],ne[ue]);)ue++;const be=ee.length,Ne=ne.length,Re=Math.min(be,Ne)-ue;let ke=0;for(;ke<Re;)if(ke++,!fe(ee[be-ke],ne[Ne-ke])){ke--;break}const Fe=ue,qe=be-ke,Be=ne.slice(ue,Ne-ke);return{from:Fe,nodesForReplacement:Be,to:qe}}function fe(ee,ne){return Te(ee)&&Te(ne)&&ee.__text===ne.__text&&ee.__highlightType===ne.__highlightType||n.$isTabNode(ee)&&n.$isTabNode(ne)||n.$isLineBreakNode(ee)&&n.$isLineBreakNode(ne)}function _e(ee){if(!n.$isRangeSelection(ee))return!1;const ne=ee.anchor.getNode(),ue=ee.focus.getNode();if(ne.is(ue)&&_(ne))return!0;const be=ne.getParent();return _(be)&&be.is(ue.getParent())}function B(ee){const ne=ee.getNodes(),ue=[[]];if(ne.length===1&&_(ne[0]))return ue;let be=ue[0];for(let Ne=0;Ne<ne.length;Ne++){const Re=ne[Ne];if(!(Te(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(Re)?Ne!==0&&be.length>0&&(be=[],ue.push(be)):be.push(Re)}return ue}function M(ee){const ne=n.$getSelection();if(!n.$isRangeSelection(ne)||!_e(ne))return null;const ue=ee?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND,be=ee?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND;if(B(ne).length>1)return ue;const ke=ne.getNodes()[0];if(!(_(ke)||Te(ke)||n.$isTabNode(ke)||n.$isLineBreakNode(ke)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(_(ke))return ue;const Fe=Se(ke),qe=Ee(ke),Be=ne.anchor,ut=ne.focus;let At,Ut;return ut.isBefore(Be)?(At=ut,Ut=Be):(At=Be,Ut=ut),Fe!==null&&qe!==null&&At.key===Fe.getKey()&&At.offset===0&&Ut.key===qe.getKey()&&Ut.offset===qe.getTextContentSize()?ue:be}function F(ee){const ne=n.$getSelection();if(!n.$isRangeSelection(ne)||!_e(ne))return!1;const ue=B(ne),be=ue.length;if(ue.length>1){for(let Fe=0;Fe<be;Fe++){const qe=ue[Fe];if(qe.length>0){let Be=qe[0];Fe===0&&(Be=Se(Be)),Be!==null&&(ee===n.INDENT_CONTENT_COMMAND?Be.insertBefore(n.$createTabNode()):n.$isTabNode(Be)&&Be.remove())}}return!0}const Re=ne.getNodes()[0];if(!(_(Re)||Te(Re)||n.$isTabNode(Re)||n.$isLineBreakNode(Re)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(_(Re))return ee===n.INDENT_CONTENT_COMMAND&&ne.insertNodes([n.$createTabNode()]),!0;const ke=Se(Re);if(ke===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return ee===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(ke)?ke.insertAfter(n.$createTabNode()):ke.insertBefore(n.$createTabNode()):n.$isTabNode(ke)&&ke.remove(),!0}function se(ee,ne){const ue=n.$getSelection();if(!n.$isRangeSelection(ue))return!1;const{anchor:be,focus:Ne}=ue,Re=be.offset,ke=Ne.offset,Fe=be.getNode(),qe=Ne.getNode(),Be=ee===n.KEY_ARROW_UP_COMMAND;if(!_e(ue)||!(Te(Fe)||n.$isTabNode(Fe))||!(Te(qe)||n.$isTabNode(qe)))return!1;if(!ne.altKey){if(ue.isCollapsed()){const ve=Fe.getParentOrThrow();if(Be&&Re===0&&Fe.getPreviousSibling()===null){if(ve.getPreviousSibling()===null)return ve.selectPrevious(),ne.preventDefault(),!0}else if(!Be&&Re===Fe.getTextContentSize()&&Fe.getNextSibling()===null&&ve.getNextSibling()===null)return ve.selectNext(),ne.preventDefault(),!0}return!1}let ut,At;if(Fe.isBefore(qe)?(ut=Se(Fe),At=Ee(qe)):(ut=Se(qe),At=Ee(Fe)),ut==null||At==null)return!1;const Ut=ut.getNodesBetween(At);for(let ve=0;ve<Ut.length;ve++){const Le=Ut[ve];if(!Te(Le)&&!n.$isTabNode(Le)&&!n.$isLineBreakNode(Le))return!1}ne.preventDefault(),ne.stopPropagation();const tn=Be?ut.getPreviousSibling():At.getNextSibling();if(!n.$isLineBreakNode(tn))return!0;const Oe=Be?tn.getPreviousSibling():tn.getNextSibling();if(Oe==null)return!0;const ie=Te(Oe)||n.$isTabNode(Oe)||n.$isLineBreakNode(Oe)?Be?Se(Oe):Ee(Oe):null;let le=ie??Oe;return tn.remove(),Ut.forEach(ve=>ve.remove()),ee===n.KEY_ARROW_UP_COMMAND?(Ut.forEach(ve=>le.insertBefore(ve)),le.insertBefore(tn)):(le.insertAfter(tn),le=tn,Ut.forEach(ve=>{le.insertAfter(ve),le=ve})),ue.setTextNodeRange(Fe,Re,qe,ke),!0}function ye(ee,ne){const ue=n.$getSelection();if(!n.$isRangeSelection(ue))return!1;const{anchor:be,focus:Ne}=ue,Re=be.getNode(),ke=Ne.getNode(),Fe=ee===n.MOVE_TO_START;if(!(Te(Re)||n.$isTabNode(Re))||!(Te(ke)||n.$isTabNode(ke)))return!1;if(Fe){const qe=K(ke,Ne.offset);if(qe!==null){const{node:Be,offset:ut}=qe;n.$isLineBreakNode(Be)?Be.selectNext(0,0):ue.setTextNodeRange(Be,ut,Be,ut)}else ke.getParentOrThrow().selectStart()}else Z(ke).select();return ne.preventDefault(),ne.stopPropagation(),!0}function De(ee,ne){if(!ee.hasNodes([f,V]))throw new Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return ne==null&&(ne=de),t.mergeRegister(ee.registerMutationListener(f,ue=>{ee.update(()=>{for(const[be,Ne]of ue)if(Ne!=="destroyed"){const Re=n.$getNodeByKey(be);Re!==null&&Y(Re,ee)}})}),ee.registerNodeTransform(f,ue=>J(ue,ee,ne)),ee.registerNodeTransform(n.TextNode,ue=>oe(ue,ee,ne)),ee.registerNodeTransform(V,ue=>oe(ue,ee,ne)),ee.registerCommand(n.KEY_TAB_COMMAND,ue=>{const be=M(ue.shiftKey);return be===null?!1:(ue.preventDefault(),ee.dispatchCommand(be,void 0),!0)},n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.INSERT_TAB_COMMAND,()=>{const ue=n.$getSelection();return _e(ue)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.INDENT_CONTENT_COMMAND,ue=>F(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.OUTDENT_CONTENT_COMMAND,ue=>F(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_UP_COMMAND,ue=>se(n.KEY_ARROW_UP_COMMAND,ue),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.KEY_ARROW_DOWN_COMMAND,ue=>se(n.KEY_ARROW_DOWN_COMMAND,ue),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.MOVE_TO_END,ue=>ye(n.MOVE_TO_END,ue),n.COMMAND_PRIORITY_LOW),ee.registerCommand(n.MOVE_TO_START,ue=>ye(n.MOVE_TO_START,ue),n.COMMAND_PRIORITY_LOW))}return Pn.$createCodeHighlightNode=q,Pn.$createCodeNode=p,Pn.$isCodeHighlightNode=Te,Pn.$isCodeNode=_,Pn.CODE_LANGUAGE_FRIENDLY_NAME_MAP=P,Pn.CODE_LANGUAGE_MAP=H,Pn.CodeHighlightNode=V,Pn.CodeNode=f,Pn.DEFAULT_CODE_LANGUAGE=k,Pn.PrismTokenizer=de,Pn.getCodeLanguages=ce,Pn.getDefaultCodeLanguage=te,Pn.getEndOfCodeInLine=Z,Pn.getFirstCodeNodeOfLine=Se,Pn.getLanguageFriendlyName=re,Pn.getLastCodeNodeOfLine=Ee,Pn.getStartOfCodeInLine=K,Pn.normalizeCodeLang=j,Pn.registerCodeHighlighting=De,Pn}var $n={},lg;function zC(){if(lg)return $n;lg=1;var e=Dp();Ap(),Mp(),Rp(),bp(),Lp(),Ip(),kp(),Pp(),$p(),Fp(),Bp(),Hp(),Wp(),Kp();var t=pn(),n=jt();let r=R=>R!=null&&e.languages.hasOwnProperty(R)?R:void 0;function l(R,U){for(let X of R.childNodes){if(t.isHTMLElement(X)&&X.tagName===U)return!0;l(X,U)}return!1}class d extends n.ElementNode{static getType(){return"code"}static clone(U){return new d(U.__language,U.__key)}constructor(U,X){super(X),this.__language=r(U)}createDOM(U){let X=document.createElement("code");return t.addClassNamesToElement(X,U.theme.code),X.setAttribute("spellcheck","false"),(U=this.getLanguage())&&X.setAttribute("data-highlight-language",U),X}updateDOM(U,X){let fe=this.__language;return U=U.__language,fe?fe!==U&&X.setAttribute("data-highlight-language",fe):U&&X.removeAttribute("data-highlight-language"),!1}exportDOM(){let U=document.createElement("pre");U.setAttribute("spellcheck","false");let X=this.getLanguage();return X&&U.setAttribute("data-highlight-language",X),{element:U}}static importDOM(){return{code:U=>U.textContent!=null&&(/\r?\n/.test(U.textContent)||l(U,"BR"))?{conversion:_,priority:1}:null,div:()=>({conversion:E,priority:1}),pre:()=>({conversion:_,priority:0}),table:U=>m(U)?{conversion:T,priority:3}:null,td:U=>{let X=U.closest("table");return U.classList.contains("js-file-line")?{conversion:w,priority:3}:X&&m(X)?{conversion:S,priority:3}:null},tr:U=>(U=U.closest("table"))&&m(U)?{conversion:S,priority:3}:null}}static importJSON(U){let X=f(U.language);return X.setFormat(U.format),X.setIndent(U.indent),X.setDirection(U.direction),X}exportJSON(){return{...super.exportJSON(),language:this.getLanguage(),type:"code",version:1}}insertNewAfter(U,X=!0){var fe=this.getChildren(),_e=fe.length;if(2<=_e&&fe[_e-1].getTextContent()===`
|
|
94
94
|
`&&fe[_e-2].getTextContent()===`
|
|
95
|
-
`&&U.isCollapsed()&&U.anchor.key===this.__key&&U.anchor.offset===_e)return fe[_e-1].remove(),fe[_e-2].remove(),U=n.$createParagraphNode(),this.insertAfter(U,X),U;let{anchor:B,focus:
|
|
96
|
-
`||
|
|
97
|
-
`?X.push(n.$createLineBreakNode()):
|
|
98
|
-
`+ ++ye);fe.setAttribute("data-gutter",se)}}})}),R.registerNodeTransform(d,X=>Se(X,R,U)),R.registerNodeTransform(n.TextNode,X=>q(X,R,U)),R.registerNodeTransform(I,X=>q(X,R,U)),R.registerCommand(n.KEY_TAB_COMMAND,X=>{let fe=oe(X.shiftKey);return fe===null?!1:(X.preventDefault(),R.dispatchCommand(fe,void 0),!0)},n.COMMAND_PRIORITY_LOW),R.registerCommand(n.INSERT_TAB_COMMAND,()=>{let X=n.$getSelection();return O(X)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),R.registerCommand(n.INDENT_CONTENT_COMMAND,()=>Y(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>Y(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.KEY_ARROW_UP_COMMAND,X=>W(n.KEY_ARROW_UP_COMMAND,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.KEY_ARROW_DOWN_COMMAND,X=>W(n.KEY_ARROW_DOWN_COMMAND,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.MOVE_TO_END,X=>J(n.MOVE_TO_END,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.MOVE_TO_START,X=>J(n.MOVE_TO_START,X),n.COMMAND_PRIORITY_LOW))},$n}const HC=process.env.NODE_ENV==="development"?FC():BC();var ju=HC,Cd=qn();function WC(){const[e]=Cd.useLexicalComposerContext();return nt.useEffect(()=>ju.registerCodeHighlighting(e),[e]),null}var ig=pn(),Fn=Yt();function KC({src:e,altText:t,width:n,height:r,maxWidth:l}){const d=nt.useMemo(()=>({height:r,width:n,maxWidth:l}),[r,n,l]);return at.jsx("img",{src:e,alt:t,style:d})}function Hp({altText:e,height:t,maxWidth:n=500,src:r,width:l,key:d}){return Fn.$applyNodeReplacement(new sl(r,e,n,l,t,d))}function zC(e){return e instanceof sl}class sl extends Fn.DecoratorNode{constructor(n,r,l,d,f,p){super(p);Ie(this,"__src");Ie(this,"__altText");Ie(this,"__width");Ie(this,"__height");Ie(this,"__maxWidth");this.__src=n,this.__altText=r,this.__maxWidth=l,this.__width=d||"inherit",this.__height=f||"inherit"}static getType(){return"image"}static clone(n){return new sl(n.__src,n.__altText,n.__maxWidth,n.__width,n.__height,n.__key)}getSrc(){return this.getLatest().__src}getAltText(){return this.getLatest().__altText}exportJSON(){return{altText:this.getAltText(),height:this.__height==="inherit"?0:this.__height,maxWidth:this.__maxWidth,src:this.getSrc(),type:"image",version:1,width:this.__width==="inherit"?0:this.__width}}static importJSON(n){return Hp(n)}createDOM(n){const r=document.createElement("span"),l=n.theme.image;return l&&(r.className=l),r}updateDOM(){return!1}decorate(){return at.jsx(KC,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}const UC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",GC=e=>UC?(e||window).getSelection():null,Wp=Fn.createCommand("INSERT_IMAGE_COMMAND");function YC(){const[e]=Cd.useLexicalComposerContext();return nt.useEffect(()=>{if(!e.hasNodes([sl]))throw new Error("ImagePlugin: ImageNode not registered on editor");return ig.mergeRegister(e.registerCommand(Wp,t=>{const n=Hp(t);return Fn.$insertNodes([n]),Fn.$isRootOrShadowRoot(n.getParentOrThrow())&&ig.$wrapNodeInElement(n,Fn.$createParagraphNode).selectEnd(),!0},Fn.COMMAND_PRIORITY_EDITOR),e.registerCommand(Fn.DRAGSTART_COMMAND,t=>jC(t),Fn.COMMAND_PRIORITY_HIGH),e.registerCommand(Fn.DRAGOVER_COMMAND,t=>VC(t),Fn.COMMAND_PRIORITY_LOW),e.registerCommand(Fn.DROP_COMMAND,t=>qC(t,e),Fn.COMMAND_PRIORITY_HIGH))},[e]),null}function jC(e){const t="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n=document.createElement("img");n.src=t;const r=Ed();if(!r)return!1;const l=e.dataTransfer;return l?(l.setData("text/plain","_"),l.setDragImage(n,0,0),l.setData("application/x-lexical-drag",JSON.stringify({data:{altText:r.__altText,height:r.__height,key:r.getKey(),maxWidth:r.__maxWidth,src:r.__src,width:r.__width},type:"image"})),!0):!1}function VC(e){return Ed()?(Kp(e)||e.preventDefault(),!0):!1}function qC(e,t){const n=Ed();if(!n)return!1;const r=ZC(e);if(!r)return!1;if(e.preventDefault(),Kp(e)){const l=JC(e);n.remove();const d=Fn.$createRangeSelection();l!=null&&d.applyDOMRange(l),Fn.$setSelection(d),t.dispatchCommand(Wp,r)}return!0}function Ed(){const e=Fn.$getSelection();if(!Fn.$isNodeSelection(e))return null;const n=e.getNodes()[0];return zC(n)?n:null}function ZC(e){var l;const t=(l=e.dataTransfer)==null?void 0:l.getData("application/x-lexical-drag");if(!t)return null;const{type:n,data:r}=JSON.parse(t);return n!=="image"?null:r}function Kp(e){const t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.yext-default-richtextv2-theme__image")&&t.parentElement)}function JC(e){let t;const n=e.target,r=n===null||!(n instanceof Node)?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,l=GC(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&l!==null)l.collapse(e.rangeParent,e.rangeOffset||0),t=l.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var ro=_d();function XC(e){const t=e.getNodes();return t.length===0?new Set([e.anchor.getNode().getParentOrThrow(),e.focus.getNode().getParentOrThrow()]):new Set(t.map(n=>Fn.$isElementNode(n)?n:n.getParentOrThrow()))}const QC=3;function eE(e){const t=Fn.$getSelection();if(!Fn.$isRangeSelection(t))return!1;const n=XC(t);let r=0;for(const l of n)if(ro.$isListNode(l))r=Math.max(ro.$getListDepth(l)+1,r);else if(ro.$isListItemNode(l)){const d=l.getParent();if(!ro.$isListNode(d))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(ro.$getListDepth(d)+1,r)}return r<=e}function tE({maxDepth:e}){const[t]=Cd.useLexicalComposerContext();return nt.useEffect(()=>t.registerCommand(Fn.INDENT_CONTENT_COMMAND,()=>!eE(e||7),QC),[t,e]),null}var Ou=Nd(),sg=yd(),og=md(),Zl={},lg;function nE(){if(lg)return Zl;lg=1;var e=pn(),t=Yt();class n extends t.TextNode{static getType(){return"hashtag"}static clone(f){return new n(f.__text,f.__key)}constructor(f,p){super(f,p)}createDOM(f){const p=super.createDOM(f);return e.addClassNamesToElement(p,f.theme.hashtag),p}static importJSON(f){const p=r(f.text);return p.setFormat(f.format),p.setDetail(f.detail),p.setMode(f.mode),p.setStyle(f.style),p}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(d=""){return t.$applyNodeReplacement(new n(d))}function l(d){return d instanceof n}return Zl.$createHashtagNode=r,Zl.$isHashtagNode=l,Zl.HashtagNode=n,Zl}var Jl={},ag;function rE(){if(ag)return Jl;ag=1;var e=pn(),t=Yt();class n extends t.TextNode{static getType(){return"hashtag"}static clone(d){return new n(d.__text,d.__key)}constructor(d,f){super(d,f)}createDOM(d){let f=super.createDOM(d);return e.addClassNamesToElement(f,d.theme.hashtag),f}static importJSON(d){let f=r(d.text);return f.setFormat(d.format),f.setDetail(d.detail),f.setMode(d.mode),f.setStyle(d.style),f}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(l=""){return t.$applyNodeReplacement(new n(l))}return Jl.$createHashtagNode=r,Jl.$isHashtagNode=function(l){return l instanceof n},Jl.HashtagNode=n,Jl}const iE=process.env.NODE_ENV==="development"?nE():rE();var sE=iE;const ft={"yext-default-richtextv2-theme__ul1":"_yext-default-richtextv2-theme__ul1_13v3w_17","yext-default-richtextv2-theme__ul2":"_yext-default-richtextv2-theme__ul2_13v3w_25","yext-default-richtextv2-theme__ul3":"_yext-default-richtextv2-theme__ul3_13v3w_33","yext-default-richtextv2-theme__ltr":"_yext-default-richtextv2-theme__ltr_13v3w_55","yext-default-richtextv2-theme__rtl":"_yext-default-richtextv2-theme__rtl_13v3w_58","yext-default-richtextv2-theme__paragraph":"_yext-default-richtextv2-theme__paragraph_13v3w_61","yext-default-richtextv2-theme__quote":"_yext-default-richtextv2-theme__quote_13v3w_70","yext-default-richtextv2-theme__h1":"_yext-default-richtextv2-theme__h1_13v3w_81","yext-default-richtextv2-theme__h2":"_yext-default-richtextv2-theme__h2_13v3w_89","yext-default-richtextv2-theme__h3":"_yext-default-richtextv2-theme__h3_13v3w_97","yext-default-richtextv2-theme__h4":"_yext-default-richtextv2-theme__h4_13v3w_105","yext-default-richtextv2-theme__h5":"_yext-default-richtextv2-theme__h5_13v3w_113","yext-default-richtextv2-theme__h6":"_yext-default-richtextv2-theme__h6_13v3w_121","yext-default-richtextv2-theme__textBold":"_yext-default-richtextv2-theme__textBold_13v3w_130","yext-default-richtextv2-theme__textItalic":"_yext-default-richtextv2-theme__textItalic_13v3w_133","yext-default-richtextv2-theme__textUnderline":"_yext-default-richtextv2-theme__textUnderline_13v3w_136","yext-default-richtextv2-theme__textStrikethrough":"_yext-default-richtextv2-theme__textStrikethrough_13v3w_139","yext-default-richtextv2-theme__textUnderlineStrikethrough":"_yext-default-richtextv2-theme__textUnderlineStrikethrough_13v3w_142","yext-default-richtextv2-theme__textSubscript":"_yext-default-richtextv2-theme__textSubscript_13v3w_145","yext-default-richtextv2-theme__textSuperscript":"_yext-default-richtextv2-theme__textSuperscript_13v3w_149","yext-default-richtextv2-theme__textCode":"_yext-default-richtextv2-theme__textCode_13v3w_153","yext-default-richtextv2-theme__hashtag":"_yext-default-richtextv2-theme__hashtag_13v3w_159","yext-default-richtextv2-theme__link":"_yext-default-richtextv2-theme__link_13v3w_163","yext-default-richtextv2-theme__code":"_yext-default-richtextv2-theme__code_13v3w_171","yext-default-richtextv2-theme__table":"_yext-default-richtextv2-theme__table_13v3w_199","yext-default-richtextv2-theme__tableCell":"_yext-default-richtextv2-theme__tableCell_13v3w_208","yext-default-richtextv2-theme__tableCellHeader":"_yext-default-richtextv2-theme__tableCellHeader_13v3w_218","yext-default-richtextv2-theme__characterLimit":"_yext-default-richtextv2-theme__characterLimit_13v3w_222","yext-default-richtextv2-theme__ol1":"_yext-default-richtextv2-theme__ol1_13v3w_226","yext-default-richtextv2-theme__ol2":"_yext-default-richtextv2-theme__ol2_13v3w_233","yext-default-richtextv2-theme__ol3":"_yext-default-richtextv2-theme__ol3_13v3w_240","yext-default-richtextv2-theme__ol4":"_yext-default-richtextv2-theme__ol4_13v3w_247","yext-default-richtextv2-theme__ol5":"_yext-default-richtextv2-theme__ol5_13v3w_254","yext-default-richtextv2-theme__listItem":"_yext-default-richtextv2-theme__listItem_13v3w_267","yext-default-richtextv2-theme__listItemChecked":"_yext-default-richtextv2-theme__listItemChecked_13v3w_270","yext-default-richtextv2-theme__listItemUnchecked":"_yext-default-richtextv2-theme__listItemUnchecked_13v3w_271","yext-default-richtextv2-theme__nestedListItem":"_yext-default-richtextv2-theme__nestedListItem_13v3w_330","yext-default-richtextv2-theme__tokenComment":"_yext-default-richtextv2-theme__tokenComment_13v3w_337","yext-default-richtextv2-theme__tokenPunctuation":"_yext-default-richtextv2-theme__tokenPunctuation_13v3w_340","yext-default-richtextv2-theme__tokenProperty":"_yext-default-richtextv2-theme__tokenProperty_13v3w_343","yext-default-richtextv2-theme__tokenSelector":"_yext-default-richtextv2-theme__tokenSelector_13v3w_346","yext-default-richtextv2-theme__tokenOperator":"_yext-default-richtextv2-theme__tokenOperator_13v3w_349","yext-default-richtextv2-theme__tokenAttr":"_yext-default-richtextv2-theme__tokenAttr_13v3w_352","yext-default-richtextv2-theme__tokenVariable":"_yext-default-richtextv2-theme__tokenVariable_13v3w_355","yext-default-richtextv2-theme__tokenFunction":"_yext-default-richtextv2-theme__tokenFunction_13v3w_358","yext-default-richtextv2-theme__mark":"_yext-default-richtextv2-theme__mark_13v3w_361","yext-default-richtextv2-theme__markOverlap":"_yext-default-richtextv2-theme__markOverlap_13v3w_366","yext-default-richtextv2-theme__embedBlock":"_yext-default-richtextv2-theme__embedBlock_13v3w_378","yext-default-richtextv2-theme__embedBlockFocus":"_yext-default-richtextv2-theme__embedBlockFocus_13v3w_381","yext-default-richtextv2-theme__image":"_yext-default-richtextv2-theme__image_13v3w_385"},oE={characterLimit:ft["yext-default-richtextv2-theme__characterLimit"],code:ft["yext-default-richtextv2-theme__code"],codeHighlight:{atrule:ft["yext-default-richtextv2-theme__tokenAttr"],attr:ft["yext-default-richtextv2-theme__tokenAttr"],boolean:ft["yext-default-richtextv2-theme__tokenProperty"],builtin:ft["yext-default-richtextv2-theme__tokenSelector"],cdata:ft["yext-default-richtextv2-theme__tokenComment"],char:ft["yext-default-richtextv2-theme__tokenSelector"],class:ft["yext-default-richtextv2-theme__tokenFunction"],"class-name":ft["yext-default-richtextv2-theme__tokenFunction"],comment:ft["yext-default-richtextv2-theme__tokenComment"],constant:ft["yext-default-richtextv2-theme__tokenProperty"],deleted:ft["yext-default-richtextv2-theme__tokenProperty"],doctype:ft["yext-default-richtextv2-theme__tokenComment"],entity:ft["yext-default-richtextv2-theme__tokenOperator"],function:ft["yext-default-richtextv2-theme__tokenFunction"],important:ft["yext-default-richtextv2-theme__tokenVariable"],inserted:ft["yext-default-richtextv2-theme__tokenSelector"],keyword:ft["yext-default-richtextv2-theme__tokenAttr"],namespace:ft["yext-default-richtextv2-theme__tokenVariable"],number:ft["yext-default-richtextv2-theme__tokenProperty"],operator:ft["yext-default-richtextv2-theme__tokenOperator"],prolog:ft["yext-default-richtextv2-theme__tokenComment"],property:ft["yext-default-richtextv2-theme__tokenProperty"],punctuation:ft["yext-default-richtextv2-theme__tokenPunctuation"],regex:ft["yext-default-richtextv2-theme__tokenVariable"],selector:ft["yext-default-richtextv2-theme__tokenSelector"],string:ft["yext-default-richtextv2-theme__tokenSelector"],symbol:ft["yext-default-richtextv2-theme__tokenProperty"],tag:ft["yext-default-richtextv2-theme__tokenProperty"],url:ft["yext-default-richtextv2-theme__tokenOperator"],variable:ft["yext-default-richtextv2-theme__tokenVariable"]},embedBlock:{base:ft["yext-default-richtextv2-theme__embedBlock"],focus:ft["yext-default-richtextv2-theme__embedBlockFocus"]},hashtag:ft["yext-default-richtextv2-theme__hashtag"],heading:{h1:ft["yext-default-richtextv2-theme__h1"],h2:ft["yext-default-richtextv2-theme__h2"],h3:ft["yext-default-richtextv2-theme__h3"],h4:ft["yext-default-richtextv2-theme__h4"],h5:ft["yext-default-richtextv2-theme__h5"],h6:ft["yext-default-richtextv2-theme__h6"]},image:ft["yext-default-richtextv2-theme__image"],link:ft["yext-default-richtextv2-theme__link"],list:{listitem:ft["yext-default-richtextv2-theme__listItem"],listitemChecked:ft["yext-default-richtextv2-theme__listItemChecked"],listitemUnchecked:ft["yext-default-richtextv2-theme__listItemUnchecked"],nested:{listitem:ft["yext-default-richtextv2-theme__nestedListItem"]},olDepth:[ft["yext-default-richtextv2-theme__ol1"],ft["yext-default-richtextv2-theme__ol2"],ft["yext-default-richtextv2-theme__ol3"],ft["yext-default-richtextv2-theme__ol4"],ft["yext-default-richtextv2-theme__ol5"]],ulDepth:[ft["yext-default-richtextv2-theme__ul1"],ft["yext-default-richtextv2-theme__ul2"],ft["yext-default-richtextv2-theme__ul3"]]},ltr:ft["yext-default-richtextv2-theme__ltr"],mark:ft["yext-default-richtextv2-theme__mark"],markOverlap:ft["yext-default-richtextv2-theme__markOverlap"],paragraph:ft["yext-default-richtextv2-theme__paragraph"],quote:ft["yext-default-richtextv2-theme__quote"],rtl:ft["yext-default-richtextv2-theme__rtl"],table:ft["yext-default-richtextv2-theme__table"],tableCell:ft["yext-default-richtextv2-theme__tableCell"],tableCellHeader:ft["yext-default-richtextv2-theme__tableCellHeader"],text:{bold:ft["yext-default-richtextv2-theme__textBold"],code:ft["yext-default-richtextv2-theme__textCode"],italic:ft["yext-default-richtextv2-theme__textItalic"],strikethrough:ft["yext-default-richtextv2-theme__textStrikethrough"],subscript:ft["yext-default-richtextv2-theme__textSubscript"],superscript:ft["yext-default-richtextv2-theme__textSuperscript"],underline:ft["yext-default-richtextv2-theme__textUnderline"],underlineStrikethrough:ft["yext-default-richtextv2-theme__textUnderlineStrikethrough"]}};var Ko={},Du={},cg;function lE(){if(cg)return Du;cg=1;var e=qn(),t=Yt(),n=nt;function r(d,f){return d.getEditorState().read(()=>{const p=t.$getNodeByKey(f);return p===null?!1:p.isSelected()})}function l(d){const[f]=e.useLexicalComposerContext(),[p,_]=n.useState(()=>r(f,d));n.useEffect(()=>{let S=!0;const w=f.registerUpdateListener(()=>{S&&_(r(f,d))});return()=>{S=!1,w()}},[f,d]);const T=n.useCallback(S=>{f.update(()=>{let w=t.$getSelection();t.$isNodeSelection(w)||(w=t.$createNodeSelection(),t.$setSelection(w)),t.$isNodeSelection(w)&&(S?w.add(d):w.delete(d))})},[f,d]),E=n.useCallback(()=>{f.update(()=>{const S=t.$getSelection();t.$isNodeSelection(S)&&S.clear()})},[f]);return[p,T,E]}return Du.useLexicalNodeSelection=l,Du}var Au={},ug;function aE(){if(ug)return Au;ug=1;var e=qn(),t=Yt(),n=nt;function r(l,d){return l.getEditorState().read(()=>{let f=t.$getNodeByKey(d);return f===null?!1:f.isSelected()})}return Au.useLexicalNodeSelection=function(l){let[d]=e.useLexicalComposerContext(),[f,p]=n.useState(()=>r(d,l));n.useEffect(()=>{let E=!0,S=d.registerUpdateListener(()=>{E&&p(r(d,l))});return()=>{E=!1,S()}},[d,l]);let _=n.useCallback(E=>{d.update(()=>{let S=t.$getSelection();t.$isNodeSelection(S)||(S=t.$createNodeSelection(),t.$setSelection(S)),t.$isNodeSelection(S)&&(E?S.add(l):S.delete(l))})},[d,l]),T=n.useCallback(()=>{d.update(()=>{const E=t.$getSelection();t.$isNodeSelection(E)&&E.clear()})},[d]);return[f,_,T]},Au}var Mu,dg;function zp(){return dg||(dg=1,Mu=process.env.NODE_ENV==="development"?lE():aE()),Mu}var fg;function cE(){if(fg)return Ko;fg=1;var e=qn(),t=zp(),n=pn(),r=Yt(),l=nt;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function f({nodeKey:S}){const[w]=e.useLexicalComposerContext(),[M,m,v]=t.useLexicalNodeSelection(S),k=l.useCallback(G=>{if(M&&r.$isNodeSelection(r.$getSelection())){G.preventDefault();const I=r.$getNodeByKey(S);E(I)&&I.remove()}return!1},[M,S]);return l.useEffect(()=>n.mergeRegister(w.registerCommand(r.CLICK_COMMAND,G=>{const I=w.getElementByKey(S);return G.target===I?(G.shiftKey||v(),m(!M),!0):!1},r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_DELETE_COMMAND,k,r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_BACKSPACE_COMMAND,k,r.COMMAND_PRIORITY_LOW)),[v,w,M,S,k,m]),l.useEffect(()=>{const G=w.getElementByKey(S);G!==null&&(G.className=M?"selected":"")},[w,M,S]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(w){return new p(w.__key)}static importJSON(w){return T()}static importDOM(){return{hr:()=>({conversion:_,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
|
|
99
|
-
`}isInline(){return!1}updateDOM(){return!1}decorate(){return l.createElement(f,{nodeKey:this.__key})}}function _(){return{node:
|
|
100
|
-
`}isInline(){return!1}updateDOM(){return!1}decorate(){return l.createElement(f,{nodeKey:this.__key})}}function _(){return{node:
|
|
101
|
-
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var l=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=l:(this.options.ignoreWhitespace&&(l=l.trim()),t.push(l))}return t};var
|
|
102
|
-
`);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,l=(t||[]).length;for(;n<l;n++)r=Math.min(r,t[n].length);return l&&r?e.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):e}class
|
|
103
|
-
`}]}function
|
|
104
|
-
`:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,l={};r&&(l.className=["language-"+r]);let d={type:"element",tagName:"code",properties:l,children:[{type:"text",value:n}]};return t.meta&&(d.data={meta:t.meta}),e.patch(t,d),d=e.applyData(t,d),d={type:"element",tagName:"pre",properties:{},children:[d]},e.patch(t,d),d}function
|
|
105
|
-
`}),
|
|
106
|
-
`});const
|
|
95
|
+
`&&U.isCollapsed()&&U.anchor.key===this.__key&&U.anchor.offset===_e)return fe[_e-1].remove(),fe[_e-2].remove(),U=n.$createParagraphNode(),this.insertAfter(U,X),U;let{anchor:B,focus:M}=U;if(X=(B.isBefore(M)?B:M).getNode(),n.$isTextNode(X)){for(_e=re(X),fe=[];;)if(n.$isTabNode(_e))fe.push(n.$createTabNode()),_e=_e.getNextSibling();else if(j(_e)){for(var F=0,se=_e.getTextContent(),ye=_e.getTextContentSize();F<ye&&se[F]===" ";F++);if(F!==0&&fe.push(H(" ".repeat(F))),F!==ye)break;_e=_e.getNextSibling()}else break;_e=X.splitText(B.offset)[0],F=B.offset===0?0:1,F=_e.getIndexWithinParent()+F,se=X.getParentOrThrow(),ye=[n.$createLineBreakNode(),...fe],se.splice(F,0,ye),(fe=fe[fe.length-1])?fe.select():B.offset===0?_e.selectPrevious():_e.getNextSibling().selectNext(0,0)}return p(X)&&({offset:U}=U.anchor,X.splice(U,0,[n.$createLineBreakNode()]),X.select(U+1,U+1)),null}canIndent(){return!1}collapseAtStart(){let U=n.$createParagraphNode();return this.getChildren().forEach(X=>U.append(X)),this.replace(U),!0}setLanguage(U){this.getWritable().__language=r(U)}getLanguage(){return this.getLatest().__language}}function f(R){return n.$applyNodeReplacement(new d(R))}function p(R){return R instanceof d}function _(R){let U;return t.isHTMLElement(R)&&(U=R.getAttribute("data-highlight-language")),{node:f(U)}}function E(R){let U=R.style.fontFamily.match("monospace")!==null;return U||O(R)?{after:X=>{let fe=R.parentNode;return fe!=null&&R!==fe.lastChild&&X.push(n.$createLineBreakNode()),X},node:U?f():null}:{node:null}}function T(){return{node:f()}}function S(){return{node:null}}function w(R){return{after:U=>(R.parentNode&&R.parentNode.nextSibling&&U.push(n.$createLineBreakNode()),U),node:null}}function O(R){for(R=R.parentElement;R!==null;){if(R.style.fontFamily.match("monospace")!==null)return!0;R=R.parentElement}return!1}function m(R){return R.classList.contains("js-file-line-container")}let v={c:"C",clike:"C-like",cpp:"C++",css:"CSS",html:"HTML",java:"Java",js:"JavaScript",markdown:"Markdown",objc:"Objective-C",plain:"Plain Text",py:"Python",rust:"Rust",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML"},I={cpp:"cpp",java:"java",javascript:"js",md:"markdown",plaintext:"plain",python:"py",text:"plain",ts:"typescript"};function G(R){return I[R]||R}class k extends n.TextNode{constructor(U,X,fe){super(U,fe),this.__highlightType=X}static getType(){return"code-highlight"}static clone(U){return new k(U.__text,U.__highlightType||void 0,U.__key)}getHighlightType(){return this.getLatest().__highlightType}createDOM(U){let X=super.createDOM(U);return U=P(U.theme,this.__highlightType),t.addClassNamesToElement(X,U),X}updateDOM(U,X,fe){let _e=super.updateDOM(U,X,fe);return U=P(fe.theme,U.__highlightType),fe=P(fe.theme,this.__highlightType),U!==fe&&(U&&t.removeClassNamesFromElement(X,U),fe&&t.addClassNamesToElement(X,fe)),_e}static importJSON(U){let X=H(U.text,U.highlightType);return X.setFormat(U.format),X.setDetail(U.detail),X.setMode(U.mode),X.setStyle(U.style),X}exportJSON(){return{...super.exportJSON(),highlightType:this.getHighlightType(),type:"code-highlight",version:1}}setFormat(){return this}isParentRequired(){return!0}createParentElementNode(){return f()}}function P(R,U){return U&&R&&R.codeHighlight&&R.codeHighlight[U]}function H(R,U){return n.$applyNodeReplacement(new k(R,U))}function j(R){return R instanceof k}function re(R){let U=R;for(;j(R)||n.$isTabNode(R);)U=R,R=R.getPreviousSibling();return U}function te(R){let U=R;for(;j(R)||n.$isTabNode(R);)U=R,R=R.getNextSibling();return U}let ce={defaultLanguage:"javascript",tokenize(R,U){return e.tokenize(R,e.languages[U||""]||e.languages[this.defaultLanguage])}};function V(R,U){let X=null;var fe=null,_e=R;let B=U,M=R.getTextContent();for(;;){if(B===0){if(_e=_e.getPreviousSibling(),_e===null)break;if(!(j(_e)||n.$isTabNode(_e)||n.$isLineBreakNode(_e)))throw Error("Expected a valid Code Node: CodeHighlightNode, TabNode, LineBreakNode");if(n.$isLineBreakNode(_e)){X={node:_e,offset:1};break}B=Math.max(0,_e.getTextContentSize()-1),M=_e.getTextContent()}else B--;let F=M[B];j(_e)&&F!==" "&&(fe={node:_e,offset:B})}if(fe!==null)return fe;if(fe=null,U<R.getTextContentSize()?j(R)&&(fe=R.getTextContent()[U]):(_e=R.getNextSibling(),j(_e)&&(fe=_e.getTextContent()[0])),fe!==null&&fe!==" ")return X;e:for(fe=R,_e=R.getTextContent(),R=R.getTextContentSize();;){if(!j(fe)||U===R){if(fe=fe.getNextSibling(),fe===null||n.$isLineBreakNode(fe)){R=null;break e}j(fe)&&(U=0,_e=fe.getTextContent(),R=fe.getTextContentSize())}if(j(fe)){if(_e[U]!==" "){R={node:fe,offset:U};break e}U++}}return R!==null?R:X}function z(R){if(R=te(R),n.$isLineBreakNode(R))throw Error("Unexpected lineBreakNode in getEndOfCodeInLine");return R}function q(R,U,X){let fe=R.getParent();p(fe)?Se(fe,U,X):j(R)&&R.replace(n.$createTextNode(R.__text))}let Te=new Set;function Se(R,U,X){let fe=R.getKey();Te.has(fe)||(Te.add(fe),R.getLanguage()===void 0&&R.setLanguage(X.defaultLanguage),U.update(()=>{de(fe,()=>{var _e=n.$getNodeByKey(fe);if(!p(_e)||!_e.isAttached())return!1;var B=_e.getTextContent();B=X.tokenize(B,_e.getLanguage()||X.defaultLanguage),B=Ee(B);var M=_e.getChildren();for(_e=0;_e<M.length&&K(M[_e],B[_e]);)_e++;var F=M.length;let se=B.length,ye=Math.min(F,se)-_e,De=0;for(;De<ye;)if(De++,!K(M[F-De],B[se-De])){De--;break}M=_e,F-=De,B=B.slice(_e,se-De);let{from:ee,to:ne,nodesForReplacement:ue}={from:M,nodesForReplacement:B,to:F};return ee!==ne||ue.length?(R.splice(ee,ne-ee,ue),!0):!1})},{onUpdate:()=>{Te.delete(fe)},skipTransforms:!0}))}function Ee(R,U){let X=[];for(let fe of R)if(typeof fe=="string"){R=fe.split(/(\n|\t)/);let _e=R.length;for(let B=0;B<_e;B++){let M=R[B];M===`
|
|
96
|
+
`||M===`\r
|
|
97
|
+
`?X.push(n.$createLineBreakNode()):M===" "?X.push(n.$createTabNode()):0<M.length&&X.push(H(M,U))}}else({content:R}=fe),typeof R=="string"?X.push(...Ee([R],fe.type)):Array.isArray(R)&&X.push(...Ee(R,fe.type));return X}function de(R,U){if(R=n.$getNodeByKey(R),p(R)&&R.isAttached()){var X=n.$getSelection();if(n.$isRangeSelection(X)){X=X.anchor;var fe=X.offset,_e=X.type==="element"&&n.$isLineBreakNode(R.getChildAtIndex(X.offset-1)),B=0;if(!_e){let M=X.getNode();B=fe+M.getPreviousSiblings().reduce((F,se)=>F+se.getTextContentSize(),0)}U()&&(_e?X.getNode().select(fe,fe):R.getChildren().some(M=>{let F=n.$isTextNode(M);if(F||n.$isLineBreakNode(M)){let se=M.getTextContentSize();if(F&&se>=B)return M.select(B,B),!0;B-=se}return!1}))}else U()}}function K(R,U){return j(R)&&j(U)&&R.__text===U.__text&&R.__highlightType===U.__highlightType||n.$isTabNode(R)&&n.$isTabNode(U)||n.$isLineBreakNode(R)&&n.$isLineBreakNode(U)}function D(R){if(!n.$isRangeSelection(R))return!1;var U=R.anchor.getNode();return R=R.focus.getNode(),U.is(R)&&p(U)?!0:(U=U.getParent(),p(U)&&U.is(R.getParent()))}function Z(R){R=R.getNodes();let U=[[]];if(R.length===1&&p(R[0]))return U;let X=U[0];for(let fe=0;fe<R.length;fe++){let _e=R[fe];if(!(j(_e)||n.$isTabNode(_e)||n.$isLineBreakNode(_e)))throw Error("Expected selection to be inside CodeBlock and consisting of CodeHighlightNode, TabNode and LineBreakNode");n.$isLineBreakNode(_e)?fe!==0&&0<X.length&&(X=[],U.push(X)):X.push(_e)}return U}function oe(R){var U=n.$getSelection();if(!n.$isRangeSelection(U)||!D(U))return null;let X=R?n.OUTDENT_CONTENT_COMMAND:n.INDENT_CONTENT_COMMAND;if(R=R?n.OUTDENT_CONTENT_COMMAND:n.INSERT_TAB_COMMAND,1<Z(U).length)return X;var fe=U.getNodes()[0];if(!(p(fe)||j(fe)||n.$isTabNode(fe)||n.$isLineBreakNode(fe)))throw Error("Expected selection firstNode to be CodeHighlightNode or TabNode");if(p(fe))return X;let _e=re(fe);fe=te(fe);var B=U.anchor;let M=U.focus;return M.isBefore(B)?U=M:(U=B,B=M),_e!==null&&fe!==null&&U.key===_e.getKey()&&U.offset===0&&B.key===fe.getKey()&&B.offset===fe.getTextContentSize()?X:R}function Y(R){var U=n.$getSelection();if(!n.$isRangeSelection(U)||!D(U))return!1;var X=Z(U);let fe=X.length;if(1<X.length){for(U=0;U<fe;U++){var _e=X[U];0<_e.length&&(_e=_e[0],U===0&&(_e=re(_e)),_e!==null&&(R===n.INDENT_CONTENT_COMMAND?_e.insertBefore(n.$createTabNode()):n.$isTabNode(_e)&&_e.remove()))}return!0}if(X=U.getNodes()[0],!(p(X)||j(X)||n.$isTabNode(X)||n.$isLineBreakNode(X)))throw Error("Expected selection firstNode to be CodeHighlightNode or CodeTabNode");if(p(X))return R===n.INDENT_CONTENT_COMMAND&&U.insertNodes([n.$createTabNode()]),!0;if(X=re(X),X===null)throw Error("Expected getFirstCodeNodeOfLine to return a valid Code Node");return R===n.INDENT_CONTENT_COMMAND?n.$isLineBreakNode(X)?X.insertAfter(n.$createTabNode()):X.insertBefore(n.$createTabNode()):n.$isTabNode(X)&&X.remove(),!0}function W(R,U){let X=n.$getSelection();if(!n.$isRangeSelection(X))return!1;let{anchor:fe,focus:_e}=X,B=fe.offset,M=_e.offset,F=fe.getNode(),se=_e.getNode();var ye=R===n.KEY_ARROW_UP_COMMAND;if(!D(X)||!j(F)&&!n.$isTabNode(F)||!j(se)&&!n.$isTabNode(se))return!1;if(!U.altKey){if(X.isCollapsed()){if(R=F.getParentOrThrow(),ye&&B===0&&F.getPreviousSibling()===null){if(R.getPreviousSibling()===null)return R.selectPrevious(),U.preventDefault(),!0}else if(!ye&&B===F.getTextContentSize()&&F.getNextSibling()===null&&R.getNextSibling()===null)return R.selectNext(),U.preventDefault(),!0}return!1}let De;if(F.isBefore(se)){var ee=re(F);De=te(se)}else ee=re(se),De=te(F);if(ee==null||De==null)return!1;let ne=ee.getNodesBetween(De);for(let be=0;be<ne.length;be++){let Ne=ne[be];if(!j(Ne)&&!n.$isTabNode(Ne)&&!n.$isLineBreakNode(Ne))return!1}if(U.preventDefault(),U.stopPropagation(),U=ye?ee.getPreviousSibling():De.getNextSibling(),!n.$isLineBreakNode(U)||(ee=ye?U.getPreviousSibling():U.getNextSibling(),ee==null))return!0;ye=j(ee)||n.$isTabNode(ee)||n.$isLineBreakNode(ee)?ye?re(ee):te(ee):null;let ue=ye??ee;return U.remove(),ne.forEach(be=>be.remove()),R===n.KEY_ARROW_UP_COMMAND?(ne.forEach(be=>ue.insertBefore(be)),ue.insertBefore(U)):(ue.insertAfter(U),ue=U,ne.forEach(be=>{ue.insertAfter(be),ue=be})),X.setTextNodeRange(F,B,se,M),!0}function J(R,U){let X=n.$getSelection();if(!n.$isRangeSelection(X))return!1;let{anchor:fe,focus:_e}=X;var B=fe.getNode();let M=_e.getNode();if(R=R===n.MOVE_TO_START,!j(B)&&!n.$isTabNode(B)||!j(M)&&!n.$isTabNode(M))return!1;if(R)if(B=V(M,_e.offset),B!==null){let{node:F,offset:se}=B;n.$isLineBreakNode(F)?F.selectNext(0,0):X.setTextNodeRange(F,se,F,se)}else M.getParentOrThrow().selectStart();else z(M).select();return U.preventDefault(),U.stopPropagation(),!0}return $n.$createCodeHighlightNode=H,$n.$createCodeNode=f,$n.$isCodeHighlightNode=j,$n.$isCodeNode=p,$n.CODE_LANGUAGE_FRIENDLY_NAME_MAP=v,$n.CODE_LANGUAGE_MAP=I,$n.CodeHighlightNode=k,$n.CodeNode=d,$n.DEFAULT_CODE_LANGUAGE="javascript",$n.PrismTokenizer=ce,$n.getCodeLanguages=()=>Object.keys(e.languages).filter(R=>typeof e.languages[R]!="function").sort(),$n.getDefaultCodeLanguage=()=>"javascript",$n.getEndOfCodeInLine=z,$n.getFirstCodeNodeOfLine=re,$n.getLanguageFriendlyName=function(R){return R=G(R),v[R]||R},$n.getLastCodeNodeOfLine=te,$n.getStartOfCodeInLine=V,$n.normalizeCodeLang=G,$n.registerCodeHighlighting=function(R,U){if(!R.hasNodes([d,k]))throw Error("CodeHighlightPlugin: CodeNode or CodeHighlightNode not registered on editor");return U==null&&(U=ce),t.mergeRegister(R.registerMutationListener(d,X=>{R.update(()=>{for(let[B,M]of X)if(M!=="destroyed"){var fe=n.$getNodeByKey(B);if(fe!==null)e:{var _e=fe;if(fe=R.getElementByKey(_e.getKey()),fe===null)break e;_e=_e.getChildren();let F=_e.length;if(F===fe.__cachedChildrenLength)break e;fe.__cachedChildrenLength=F;let se="1",ye=1;for(let De=0;De<F;De++)n.$isLineBreakNode(_e[De])&&(se+=`
|
|
98
|
+
`+ ++ye);fe.setAttribute("data-gutter",se)}}})}),R.registerNodeTransform(d,X=>Se(X,R,U)),R.registerNodeTransform(n.TextNode,X=>q(X,R,U)),R.registerNodeTransform(k,X=>q(X,R,U)),R.registerCommand(n.KEY_TAB_COMMAND,X=>{let fe=oe(X.shiftKey);return fe===null?!1:(X.preventDefault(),R.dispatchCommand(fe,void 0),!0)},n.COMMAND_PRIORITY_LOW),R.registerCommand(n.INSERT_TAB_COMMAND,()=>{let X=n.$getSelection();return D(X)?(n.$insertNodes([n.$createTabNode()]),!0):!1},n.COMMAND_PRIORITY_LOW),R.registerCommand(n.INDENT_CONTENT_COMMAND,()=>Y(n.INDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.OUTDENT_CONTENT_COMMAND,()=>Y(n.OUTDENT_CONTENT_COMMAND),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.KEY_ARROW_UP_COMMAND,X=>W(n.KEY_ARROW_UP_COMMAND,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.KEY_ARROW_DOWN_COMMAND,X=>W(n.KEY_ARROW_DOWN_COMMAND,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.MOVE_TO_END,X=>J(n.MOVE_TO_END,X),n.COMMAND_PRIORITY_LOW),R.registerCommand(n.MOVE_TO_START,X=>J(n.MOVE_TO_START,X),n.COMMAND_PRIORITY_LOW))},$n}const UC=process.env.NODE_ENV==="development"?KC():zC();var Zu=UC,Sd=qn();function GC(){const[e]=Sd.useLexicalComposerContext();return rt.useEffect(()=>Zu.registerCodeHighlighting(e),[e]),null}var ag=pn(),Fn=jt();function YC({src:e,altText:t,width:n,height:r,maxWidth:l}){const d=rt.useMemo(()=>({height:r,width:n,maxWidth:l}),[r,n,l]);return nt.jsx("img",{src:e,alt:t,style:d})}function zp({altText:e,height:t,maxWidth:n=500,src:r,width:l,key:d}){return Fn.$applyNodeReplacement(new sl(r,e,n,l,t,d))}function jC(e){return e instanceof sl}class sl extends Fn.DecoratorNode{constructor(n,r,l,d,f,p){super(p);Ie(this,"__src");Ie(this,"__altText");Ie(this,"__width");Ie(this,"__height");Ie(this,"__maxWidth");this.__src=n,this.__altText=r,this.__maxWidth=l,this.__width=d||"inherit",this.__height=f||"inherit"}static getType(){return"image"}static clone(n){return new sl(n.__src,n.__altText,n.__maxWidth,n.__width,n.__height,n.__key)}getSrc(){return this.getLatest().__src}getAltText(){return this.getLatest().__altText}exportJSON(){return{altText:this.getAltText(),height:this.__height==="inherit"?0:this.__height,maxWidth:this.__maxWidth,src:this.getSrc(),type:"image",version:1,width:this.__width==="inherit"?0:this.__width}}static importJSON(n){return zp(n)}createDOM(n){const r=document.createElement("span"),l=n.theme.image;return l&&(r.className=l),r}updateDOM(){return!1}decorate(){return nt.jsx(YC,{src:this.__src,altText:this.__altText,width:this.__width,height:this.__height,maxWidth:this.__maxWidth})}}const VC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",qC=e=>VC?(e||window).getSelection():null,Up=Fn.createCommand("INSERT_IMAGE_COMMAND");function ZC(){const[e]=Sd.useLexicalComposerContext();return rt.useEffect(()=>{if(!e.hasNodes([sl]))throw new Error("ImagePlugin: ImageNode not registered on editor");return ag.mergeRegister(e.registerCommand(Up,t=>{const n=zp(t);return Fn.$insertNodes([n]),Fn.$isRootOrShadowRoot(n.getParentOrThrow())&&ag.$wrapNodeInElement(n,Fn.$createParagraphNode).selectEnd(),!0},Fn.COMMAND_PRIORITY_EDITOR),e.registerCommand(Fn.DRAGSTART_COMMAND,t=>JC(t),Fn.COMMAND_PRIORITY_HIGH),e.registerCommand(Fn.DRAGOVER_COMMAND,t=>XC(t),Fn.COMMAND_PRIORITY_LOW),e.registerCommand(Fn.DROP_COMMAND,t=>QC(t,e),Fn.COMMAND_PRIORITY_HIGH))},[e]),null}function JC(e){const t="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n=document.createElement("img");n.src=t;const r=wd();if(!r)return!1;const l=e.dataTransfer;return l?(l.setData("text/plain","_"),l.setDragImage(n,0,0),l.setData("application/x-lexical-drag",JSON.stringify({data:{altText:r.__altText,height:r.__height,key:r.getKey(),maxWidth:r.__maxWidth,src:r.__src,width:r.__width},type:"image"})),!0):!1}function XC(e){return wd()?(Gp(e)||e.preventDefault(),!0):!1}function QC(e,t){const n=wd();if(!n)return!1;const r=eE(e);if(!r)return!1;if(e.preventDefault(),Gp(e)){const l=tE(e);n.remove();const d=Fn.$createRangeSelection();l!=null&&d.applyDOMRange(l),Fn.$setSelection(d),t.dispatchCommand(Up,r)}return!0}function wd(){const e=Fn.$getSelection();if(!Fn.$isNodeSelection(e))return null;const n=e.getNodes()[0];return jC(n)?n:null}function eE(e){var l;const t=(l=e.dataTransfer)==null?void 0:l.getData("application/x-lexical-drag");if(!t)return null;const{type:n,data:r}=JSON.parse(t);return n!=="image"?null:r}function Gp(e){const t=e.target;return!!(t&&t instanceof HTMLElement&&!t.closest("code, span.yext-default-richtextv2-theme__image")&&t.parentElement)}function tE(e){let t;const n=e.target,r=n===null||!(n instanceof Node)?null:n.nodeType===9?n.defaultView:n.ownerDocument.defaultView,l=qC(r);if(document.caretRangeFromPoint)t=document.caretRangeFromPoint(e.clientX,e.clientY);else if(e.rangeParent&&l!==null)l.collapse(e.rangeParent,e.rangeOffset||0),t=l.getRangeAt(0);else throw Error("Cannot get the selection when dragging");return t}var no=Td();function nE(e){const t=e.getNodes();return t.length===0?new Set([e.anchor.getNode().getParentOrThrow(),e.focus.getNode().getParentOrThrow()]):new Set(t.map(n=>Fn.$isElementNode(n)?n:n.getParentOrThrow()))}const rE=3;function iE(e){const t=Fn.$getSelection();if(!Fn.$isRangeSelection(t))return!1;const n=nE(t);let r=0;for(const l of n)if(no.$isListNode(l))r=Math.max(no.$getListDepth(l)+1,r);else if(no.$isListItemNode(l)){const d=l.getParent();if(!no.$isListNode(d))throw new Error("ListMaxIndentLevelPlugin: A ListItemNode must have a ListNode for a parent.");r=Math.max(no.$getListDepth(d)+1,r)}return r<=e}function sE({maxDepth:e}){const[t]=Sd.useLexicalComposerContext();return rt.useEffect(()=>t.registerCommand(Fn.INDENT_CONTENT_COMMAND,()=>!iE(e||7),rE),[t,e]),null}var Mu=vd(),cg=xd(),ug=Ed(),Zl={},dg;function oE(){if(dg)return Zl;dg=1;var e=pn(),t=jt();class n extends t.TextNode{static getType(){return"hashtag"}static clone(f){return new n(f.__text,f.__key)}constructor(f,p){super(f,p)}createDOM(f){const p=super.createDOM(f);return e.addClassNamesToElement(p,f.theme.hashtag),p}static importJSON(f){const p=r(f.text);return p.setFormat(f.format),p.setDetail(f.detail),p.setMode(f.mode),p.setStyle(f.style),p}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(d=""){return t.$applyNodeReplacement(new n(d))}function l(d){return d instanceof n}return Zl.$createHashtagNode=r,Zl.$isHashtagNode=l,Zl.HashtagNode=n,Zl}var Jl={},fg;function lE(){if(fg)return Jl;fg=1;var e=pn(),t=jt();class n extends t.TextNode{static getType(){return"hashtag"}static clone(d){return new n(d.__text,d.__key)}constructor(d,f){super(d,f)}createDOM(d){let f=super.createDOM(d);return e.addClassNamesToElement(f,d.theme.hashtag),f}static importJSON(d){let f=r(d.text);return f.setFormat(d.format),f.setDetail(d.detail),f.setMode(d.mode),f.setStyle(d.style),f}exportJSON(){return{...super.exportJSON(),type:"hashtag"}}canInsertTextBefore(){return!1}isTextEntity(){return!0}}function r(l=""){return t.$applyNodeReplacement(new n(l))}return Jl.$createHashtagNode=r,Jl.$isHashtagNode=function(l){return l instanceof n},Jl.HashtagNode=n,Jl}const aE=process.env.NODE_ENV==="development"?oE():lE();var cE=aE;const ft={"yext-default-richtextv2-theme__ul1":"_yext-default-richtextv2-theme__ul1_13v3w_17","yext-default-richtextv2-theme__ul2":"_yext-default-richtextv2-theme__ul2_13v3w_25","yext-default-richtextv2-theme__ul3":"_yext-default-richtextv2-theme__ul3_13v3w_33","yext-default-richtextv2-theme__ltr":"_yext-default-richtextv2-theme__ltr_13v3w_55","yext-default-richtextv2-theme__rtl":"_yext-default-richtextv2-theme__rtl_13v3w_58","yext-default-richtextv2-theme__paragraph":"_yext-default-richtextv2-theme__paragraph_13v3w_61","yext-default-richtextv2-theme__quote":"_yext-default-richtextv2-theme__quote_13v3w_70","yext-default-richtextv2-theme__h1":"_yext-default-richtextv2-theme__h1_13v3w_81","yext-default-richtextv2-theme__h2":"_yext-default-richtextv2-theme__h2_13v3w_89","yext-default-richtextv2-theme__h3":"_yext-default-richtextv2-theme__h3_13v3w_97","yext-default-richtextv2-theme__h4":"_yext-default-richtextv2-theme__h4_13v3w_105","yext-default-richtextv2-theme__h5":"_yext-default-richtextv2-theme__h5_13v3w_113","yext-default-richtextv2-theme__h6":"_yext-default-richtextv2-theme__h6_13v3w_121","yext-default-richtextv2-theme__textBold":"_yext-default-richtextv2-theme__textBold_13v3w_130","yext-default-richtextv2-theme__textItalic":"_yext-default-richtextv2-theme__textItalic_13v3w_133","yext-default-richtextv2-theme__textUnderline":"_yext-default-richtextv2-theme__textUnderline_13v3w_136","yext-default-richtextv2-theme__textStrikethrough":"_yext-default-richtextv2-theme__textStrikethrough_13v3w_139","yext-default-richtextv2-theme__textUnderlineStrikethrough":"_yext-default-richtextv2-theme__textUnderlineStrikethrough_13v3w_142","yext-default-richtextv2-theme__textSubscript":"_yext-default-richtextv2-theme__textSubscript_13v3w_145","yext-default-richtextv2-theme__textSuperscript":"_yext-default-richtextv2-theme__textSuperscript_13v3w_149","yext-default-richtextv2-theme__textCode":"_yext-default-richtextv2-theme__textCode_13v3w_153","yext-default-richtextv2-theme__hashtag":"_yext-default-richtextv2-theme__hashtag_13v3w_159","yext-default-richtextv2-theme__link":"_yext-default-richtextv2-theme__link_13v3w_163","yext-default-richtextv2-theme__code":"_yext-default-richtextv2-theme__code_13v3w_171","yext-default-richtextv2-theme__table":"_yext-default-richtextv2-theme__table_13v3w_199","yext-default-richtextv2-theme__tableCell":"_yext-default-richtextv2-theme__tableCell_13v3w_208","yext-default-richtextv2-theme__tableCellHeader":"_yext-default-richtextv2-theme__tableCellHeader_13v3w_218","yext-default-richtextv2-theme__characterLimit":"_yext-default-richtextv2-theme__characterLimit_13v3w_222","yext-default-richtextv2-theme__ol1":"_yext-default-richtextv2-theme__ol1_13v3w_226","yext-default-richtextv2-theme__ol2":"_yext-default-richtextv2-theme__ol2_13v3w_233","yext-default-richtextv2-theme__ol3":"_yext-default-richtextv2-theme__ol3_13v3w_240","yext-default-richtextv2-theme__ol4":"_yext-default-richtextv2-theme__ol4_13v3w_247","yext-default-richtextv2-theme__ol5":"_yext-default-richtextv2-theme__ol5_13v3w_254","yext-default-richtextv2-theme__listItem":"_yext-default-richtextv2-theme__listItem_13v3w_267","yext-default-richtextv2-theme__listItemChecked":"_yext-default-richtextv2-theme__listItemChecked_13v3w_270","yext-default-richtextv2-theme__listItemUnchecked":"_yext-default-richtextv2-theme__listItemUnchecked_13v3w_271","yext-default-richtextv2-theme__nestedListItem":"_yext-default-richtextv2-theme__nestedListItem_13v3w_330","yext-default-richtextv2-theme__tokenComment":"_yext-default-richtextv2-theme__tokenComment_13v3w_337","yext-default-richtextv2-theme__tokenPunctuation":"_yext-default-richtextv2-theme__tokenPunctuation_13v3w_340","yext-default-richtextv2-theme__tokenProperty":"_yext-default-richtextv2-theme__tokenProperty_13v3w_343","yext-default-richtextv2-theme__tokenSelector":"_yext-default-richtextv2-theme__tokenSelector_13v3w_346","yext-default-richtextv2-theme__tokenOperator":"_yext-default-richtextv2-theme__tokenOperator_13v3w_349","yext-default-richtextv2-theme__tokenAttr":"_yext-default-richtextv2-theme__tokenAttr_13v3w_352","yext-default-richtextv2-theme__tokenVariable":"_yext-default-richtextv2-theme__tokenVariable_13v3w_355","yext-default-richtextv2-theme__tokenFunction":"_yext-default-richtextv2-theme__tokenFunction_13v3w_358","yext-default-richtextv2-theme__mark":"_yext-default-richtextv2-theme__mark_13v3w_361","yext-default-richtextv2-theme__markOverlap":"_yext-default-richtextv2-theme__markOverlap_13v3w_366","yext-default-richtextv2-theme__embedBlock":"_yext-default-richtextv2-theme__embedBlock_13v3w_378","yext-default-richtextv2-theme__embedBlockFocus":"_yext-default-richtextv2-theme__embedBlockFocus_13v3w_381","yext-default-richtextv2-theme__image":"_yext-default-richtextv2-theme__image_13v3w_385"},uE={characterLimit:ft["yext-default-richtextv2-theme__characterLimit"],code:ft["yext-default-richtextv2-theme__code"],codeHighlight:{atrule:ft["yext-default-richtextv2-theme__tokenAttr"],attr:ft["yext-default-richtextv2-theme__tokenAttr"],boolean:ft["yext-default-richtextv2-theme__tokenProperty"],builtin:ft["yext-default-richtextv2-theme__tokenSelector"],cdata:ft["yext-default-richtextv2-theme__tokenComment"],char:ft["yext-default-richtextv2-theme__tokenSelector"],class:ft["yext-default-richtextv2-theme__tokenFunction"],"class-name":ft["yext-default-richtextv2-theme__tokenFunction"],comment:ft["yext-default-richtextv2-theme__tokenComment"],constant:ft["yext-default-richtextv2-theme__tokenProperty"],deleted:ft["yext-default-richtextv2-theme__tokenProperty"],doctype:ft["yext-default-richtextv2-theme__tokenComment"],entity:ft["yext-default-richtextv2-theme__tokenOperator"],function:ft["yext-default-richtextv2-theme__tokenFunction"],important:ft["yext-default-richtextv2-theme__tokenVariable"],inserted:ft["yext-default-richtextv2-theme__tokenSelector"],keyword:ft["yext-default-richtextv2-theme__tokenAttr"],namespace:ft["yext-default-richtextv2-theme__tokenVariable"],number:ft["yext-default-richtextv2-theme__tokenProperty"],operator:ft["yext-default-richtextv2-theme__tokenOperator"],prolog:ft["yext-default-richtextv2-theme__tokenComment"],property:ft["yext-default-richtextv2-theme__tokenProperty"],punctuation:ft["yext-default-richtextv2-theme__tokenPunctuation"],regex:ft["yext-default-richtextv2-theme__tokenVariable"],selector:ft["yext-default-richtextv2-theme__tokenSelector"],string:ft["yext-default-richtextv2-theme__tokenSelector"],symbol:ft["yext-default-richtextv2-theme__tokenProperty"],tag:ft["yext-default-richtextv2-theme__tokenProperty"],url:ft["yext-default-richtextv2-theme__tokenOperator"],variable:ft["yext-default-richtextv2-theme__tokenVariable"]},embedBlock:{base:ft["yext-default-richtextv2-theme__embedBlock"],focus:ft["yext-default-richtextv2-theme__embedBlockFocus"]},hashtag:ft["yext-default-richtextv2-theme__hashtag"],heading:{h1:ft["yext-default-richtextv2-theme__h1"],h2:ft["yext-default-richtextv2-theme__h2"],h3:ft["yext-default-richtextv2-theme__h3"],h4:ft["yext-default-richtextv2-theme__h4"],h5:ft["yext-default-richtextv2-theme__h5"],h6:ft["yext-default-richtextv2-theme__h6"]},image:ft["yext-default-richtextv2-theme__image"],link:ft["yext-default-richtextv2-theme__link"],list:{listitem:ft["yext-default-richtextv2-theme__listItem"],listitemChecked:ft["yext-default-richtextv2-theme__listItemChecked"],listitemUnchecked:ft["yext-default-richtextv2-theme__listItemUnchecked"],nested:{listitem:ft["yext-default-richtextv2-theme__nestedListItem"]},olDepth:[ft["yext-default-richtextv2-theme__ol1"],ft["yext-default-richtextv2-theme__ol2"],ft["yext-default-richtextv2-theme__ol3"],ft["yext-default-richtextv2-theme__ol4"],ft["yext-default-richtextv2-theme__ol5"]],ulDepth:[ft["yext-default-richtextv2-theme__ul1"],ft["yext-default-richtextv2-theme__ul2"],ft["yext-default-richtextv2-theme__ul3"]]},ltr:ft["yext-default-richtextv2-theme__ltr"],mark:ft["yext-default-richtextv2-theme__mark"],markOverlap:ft["yext-default-richtextv2-theme__markOverlap"],paragraph:ft["yext-default-richtextv2-theme__paragraph"],quote:ft["yext-default-richtextv2-theme__quote"],rtl:ft["yext-default-richtextv2-theme__rtl"],table:ft["yext-default-richtextv2-theme__table"],tableCell:ft["yext-default-richtextv2-theme__tableCell"],tableCellHeader:ft["yext-default-richtextv2-theme__tableCellHeader"],text:{bold:ft["yext-default-richtextv2-theme__textBold"],code:ft["yext-default-richtextv2-theme__textCode"],italic:ft["yext-default-richtextv2-theme__textItalic"],strikethrough:ft["yext-default-richtextv2-theme__textStrikethrough"],subscript:ft["yext-default-richtextv2-theme__textSubscript"],superscript:ft["yext-default-richtextv2-theme__textSuperscript"],underline:ft["yext-default-richtextv2-theme__textUnderline"],underlineStrikethrough:ft["yext-default-richtextv2-theme__textUnderlineStrikethrough"]}};var zo={},Ru={},hg;function dE(){if(hg)return Ru;hg=1;var e=qn(),t=jt(),n=rt;function r(d,f){return d.getEditorState().read(()=>{const p=t.$getNodeByKey(f);return p===null?!1:p.isSelected()})}function l(d){const[f]=e.useLexicalComposerContext(),[p,_]=n.useState(()=>r(f,d));n.useEffect(()=>{let S=!0;const w=f.registerUpdateListener(()=>{S&&_(r(f,d))});return()=>{S=!1,w()}},[f,d]);const E=n.useCallback(S=>{f.update(()=>{let w=t.$getSelection();t.$isNodeSelection(w)||(w=t.$createNodeSelection(),t.$setSelection(w)),t.$isNodeSelection(w)&&(S?w.add(d):w.delete(d))})},[f,d]),T=n.useCallback(()=>{f.update(()=>{const S=t.$getSelection();t.$isNodeSelection(S)&&S.clear()})},[f]);return[p,E,T]}return Ru.useLexicalNodeSelection=l,Ru}var bu={},gg;function fE(){if(gg)return bu;gg=1;var e=qn(),t=jt(),n=rt;function r(l,d){return l.getEditorState().read(()=>{let f=t.$getNodeByKey(d);return f===null?!1:f.isSelected()})}return bu.useLexicalNodeSelection=function(l){let[d]=e.useLexicalComposerContext(),[f,p]=n.useState(()=>r(d,l));n.useEffect(()=>{let T=!0,S=d.registerUpdateListener(()=>{T&&p(r(d,l))});return()=>{T=!1,S()}},[d,l]);let _=n.useCallback(T=>{d.update(()=>{let S=t.$getSelection();t.$isNodeSelection(S)||(S=t.$createNodeSelection(),t.$setSelection(S)),t.$isNodeSelection(S)&&(T?S.add(l):S.delete(l))})},[d,l]),E=n.useCallback(()=>{d.update(()=>{const T=t.$getSelection();t.$isNodeSelection(T)&&T.clear()})},[d]);return[f,_,E]},bu}var Lu,pg;function Yp(){return pg||(pg=1,Lu=process.env.NODE_ENV==="development"?dE():fE()),Lu}var mg;function hE(){if(mg)return zo;mg=1;var e=qn(),t=Yp(),n=pn(),r=jt(),l=rt;const d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function f({nodeKey:S}){const[w]=e.useLexicalComposerContext(),[O,m,v]=t.useLexicalNodeSelection(S),I=l.useCallback(G=>{if(O&&r.$isNodeSelection(r.$getSelection())){G.preventDefault();const k=r.$getNodeByKey(S);T(k)&&k.remove()}return!1},[O,S]);return l.useEffect(()=>n.mergeRegister(w.registerCommand(r.CLICK_COMMAND,G=>{const k=w.getElementByKey(S);return G.target===k?(G.shiftKey||v(),m(!O),!0):!1},r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_DELETE_COMMAND,I,r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_BACKSPACE_COMMAND,I,r.COMMAND_PRIORITY_LOW)),[v,w,O,S,I,m]),l.useEffect(()=>{const G=w.getElementByKey(S);G!==null&&(G.className=O?"selected":"")},[w,O,S]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(w){return new p(w.__key)}static importJSON(w){return E()}static importDOM(){return{hr:()=>({conversion:_,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
|
|
99
|
+
`}isInline(){return!1}updateDOM(){return!1}decorate(){return l.createElement(f,{nodeKey:this.__key})}}function _(){return{node:E()}}function E(){return r.$applyNodeReplacement(new p)}function T(S){return S instanceof p}return zo.$createHorizontalRuleNode=E,zo.$isHorizontalRuleNode=T,zo.HorizontalRuleNode=p,zo.INSERT_HORIZONTAL_RULE_COMMAND=d,zo}var Uo={},_g;function gE(){if(_g)return Uo;_g=1;var e=qn(),t=Yp(),n=pn(),r=jt(),l=rt;let d=r.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function f({nodeKey:S}){let[w]=e.useLexicalComposerContext(),[O,m,v]=t.useLexicalNodeSelection(S),I=l.useCallback(G=>(O&&r.$isNodeSelection(r.$getSelection())&&(G.preventDefault(),G=r.$getNodeByKey(S),T(G)&&G.remove()),!1),[O,S]);return l.useEffect(()=>n.mergeRegister(w.registerCommand(r.CLICK_COMMAND,G=>{let k=w.getElementByKey(S);return G.target===k?(G.shiftKey||v(),m(!O),!0):!1},r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_DELETE_COMMAND,I,r.COMMAND_PRIORITY_LOW),w.registerCommand(r.KEY_BACKSPACE_COMMAND,I,r.COMMAND_PRIORITY_LOW)),[v,w,O,S,I,m]),l.useEffect(()=>{let G=w.getElementByKey(S);G!==null&&(G.className=O?"selected":"")},[w,O,S]),null}class p extends r.DecoratorNode{static getType(){return"horizontalrule"}static clone(w){return new p(w.__key)}static importJSON(){return E()}static importDOM(){return{hr:()=>({conversion:_,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return`
|
|
100
|
+
`}isInline(){return!1}updateDOM(){return!1}decorate(){return l.createElement(f,{nodeKey:this.__key})}}function _(){return{node:E()}}function E(){return r.$applyNodeReplacement(new p)}function T(S){return S instanceof p}return Uo.$createHorizontalRuleNode=E,Uo.$isHorizontalRuleNode=T,Uo.HorizontalRuleNode=p,Uo.INSERT_HORIZONTAL_RULE_COMMAND=d,Uo}const pE=process.env.NODE_ENV==="development"?hE():gE();var mE=pE;function _E(e,t){return{namespace:"",editable:!1,onError:n=>{throw n},editorState:e,theme:t??uE,nodes:[ug.HeadingNode,cE.HashtagNode,sl,no.ListNode,no.ListItemNode,ug.QuoteNode,Zu.CodeNode,Zu.CodeHighlightNode,Mu.TableNode,Mu.TableCellNode,Mu.TableRowNode,cg.AutoLinkNode,cg.LinkNode,mE.HorizontalRuleNode]}}const Iu={"editor-inner":"_editor-inner_1mmqo_6","no-border":"_no-border_1mmqo_10"};function yE({serializedAST:e,nodeClassNames:t}){return nt.jsx(VN.LexicalComposer,{initialConfig:_E(e,t),children:nt.jsx("div",{className:`${Iu["editor-inner"]} ${Iu["no-border"]}`,children:nt.jsxs("div",{className:Iu["editor-inner"],children:[nt.jsx(gC.RichTextPlugin,{contentEditable:nt.jsx(yC.ContentEditable,{className:"editor-input",ariaLabel:"Lexical Rich Text"}),ErrorBoundary:xC,placeholder:nt.jsx("div",{})}),nt.jsx(GC,{}),nt.jsx(AC.ListPlugin,{}),nt.jsx(kC.LinkPlugin,{}),nt.jsx(WC.TablePlugin,{}),nt.jsx(ZC,{}),nt.jsx(sE,{maxDepth:7})]})})})}function Cc(e,t,n,r){const l=e.length;let d=0,f;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,r.length<1e4)f=Array.from(r),f.unshift(t,n),[].splice.apply(e,f);else for(n&&[].splice.apply(e,[t,n]);d<r.length;)f=r.slice(d,d+1e4),f.unshift(t,0),[].splice.apply(e,f),d+=1e4,t+=1e4}function Vo(e,t){return e.length>0?(Cc(e,e.length,0,t),e):t}const yg={}.hasOwnProperty;function jp(e){const t={};let n=-1;for(;++n<e.length;)NE(t,e[n]);return t}function NE(e,t){let n;for(n in t){const l=(yg.call(e,n)?e[n]:void 0)||(e[n]={}),d=t[n];let f;for(f in d){yg.call(l,f)||(l[f]=[]);const p=d[f];CE(l[f],Array.isArray(p)?p:p?[p]:[])}}}function CE(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Cc(e,0,0,r)}const Qi={plusSign:43,caret:94,tilde:126};var Ng=Object.prototype.hasOwnProperty;function Cg(e,t,n){for(n of e.keys())if(sa(n,t))return n}function sa(e,t){var n,r,l;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&sa(e[r],t[r]););return r===-1}if(n===Set){if(e.size!==t.size)return!1;for(r of e)if(l=r,l&&typeof l=="object"&&(l=Cg(t,l),!l)||!t.has(l))return!1;return!0}if(n===Map){if(e.size!==t.size)return!1;for(r of e)if(l=r[0],l&&typeof l=="object"&&(l=Cg(t,l),!l)||!sa(r[1],t.get(l)))return!1;return!0}if(n===ArrayBuffer)e=new Uint8Array(e),t=new Uint8Array(t);else if(n===DataView){if((r=e.byteLength)===t.byteLength)for(;r--&&e.getInt8(r)===t.getInt8(r););return r===-1}if(ArrayBuffer.isView(e)){if((r=e.byteLength)===t.byteLength)for(;r--&&e[r]===t[r];);return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Ng.call(e,n)&&++r&&!Ng.call(t,n)||!(n in t)||!sa(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}let Ju,Vp,qp,Zp,Jp=!0;typeof process<"u"&&({FORCE_COLOR:Ju,NODE_DISABLE_COLORS:Vp,NO_COLOR:qp,TERM:Zp}=process.env||{},Jp=process.stdout&&process.stdout.isTTY);const Qt={enabled:!Vp&&qp==null&&Zp!=="dumb"&&(Ju!=null&&Ju!=="0"||Jp),reset:yn(0,0),bold:yn(1,22),dim:yn(2,22),italic:yn(3,23),underline:yn(4,24),inverse:yn(7,27),hidden:yn(8,28),strikethrough:yn(9,29),black:yn(30,39),red:yn(31,39),green:yn(32,39),yellow:yn(33,39),blue:yn(34,39),magenta:yn(35,39),cyan:yn(36,39),white:yn(37,39),gray:yn(90,39),grey:yn(90,39),bgBlack:yn(40,49),bgRed:yn(41,49),bgGreen:yn(42,49),bgYellow:yn(43,49),bgBlue:yn(44,49),bgMagenta:yn(45,49),bgCyan:yn(46,49),bgWhite:yn(47,49)};function Eg(e,t){let n=0,r,l="",d="";for(;n<e.length;n++)r=e[n],l+=r.open,d+=r.close,~t.indexOf(r.close)&&(t=t.replace(r.rgx,r.close+r.open));return l+t+d}function EE(e,t){let n={has:e,keys:t};return n.reset=Qt.reset.bind(n),n.bold=Qt.bold.bind(n),n.dim=Qt.dim.bind(n),n.italic=Qt.italic.bind(n),n.underline=Qt.underline.bind(n),n.inverse=Qt.inverse.bind(n),n.hidden=Qt.hidden.bind(n),n.strikethrough=Qt.strikethrough.bind(n),n.black=Qt.black.bind(n),n.red=Qt.red.bind(n),n.green=Qt.green.bind(n),n.yellow=Qt.yellow.bind(n),n.blue=Qt.blue.bind(n),n.magenta=Qt.magenta.bind(n),n.cyan=Qt.cyan.bind(n),n.white=Qt.white.bind(n),n.gray=Qt.gray.bind(n),n.grey=Qt.grey.bind(n),n.bgBlack=Qt.bgBlack.bind(n),n.bgRed=Qt.bgRed.bind(n),n.bgGreen=Qt.bgGreen.bind(n),n.bgYellow=Qt.bgYellow.bind(n),n.bgBlue=Qt.bgBlue.bind(n),n.bgMagenta=Qt.bgMagenta.bind(n),n.bgCyan=Qt.bgCyan.bind(n),n.bgWhite=Qt.bgWhite.bind(n),n}function yn(e,t){let n={open:`\x1B[${e}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(r){return this!==void 0&&this.has!==void 0?(~this.has.indexOf(e)||(this.has.push(e),this.keys.push(n)),r===void 0?this:Qt.enabled?Eg(this.keys,r+""):r+""):r===void 0?EE([e],[n]):Qt.enabled?Eg([n],r+""):r+""}}function vs(){}vs.prototype={diff:function(t,n){var r,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},d=l.callback;typeof l=="function"&&(d=l,l={}),this.options=l;var f=this;function p(H){return d?(setTimeout(function(){d(void 0,H)},0),!0):H}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var _=n.length,E=t.length,T=1,S=_+E;l.maxEditLength&&(S=Math.min(S,l.maxEditLength));var w=(r=l.timeout)!==null&&r!==void 0?r:1/0,O=Date.now()+w,m=[{oldPos:-1,lastComponent:void 0}],v=this.extractCommon(m[0],n,t,0);if(m[0].oldPos+1>=E&&v+1>=_)return p([{value:this.join(n),count:n.length}]);var I=-1/0,G=1/0;function k(){for(var H=Math.max(I,-T);H<=Math.min(G,T);H+=2){var j=void 0,re=m[H-1],te=m[H+1];re&&(m[H-1]=void 0);var ce=!1;if(te){var V=te.oldPos-H;ce=te&&0<=V&&V<_}var z=re&&re.oldPos+1<E;if(!ce&&!z){m[H]=void 0;continue}if(!z||ce&&re.oldPos+1<te.oldPos?j=f.addToPath(te,!0,void 0,0):j=f.addToPath(re,void 0,!0,1),v=f.extractCommon(j,n,t,H),j.oldPos+1>=E&&v+1>=_)return p(TE(f,j.lastComponent,n,t,f.useLongestToken));m[H]=j,j.oldPos+1>=E&&(G=Math.min(G,H-1)),v+1>=_&&(I=Math.max(I,H+1))}T++}if(d)(function H(){setTimeout(function(){if(T>S||Date.now()>O)return d();k()||H()},0)})();else for(;T<=S&&Date.now()<=O;){var P=k();if(P)return P}},addToPath:function(t,n,r,l){var d=t.lastComponent;return d&&d.added===n&&d.removed===r?{oldPos:t.oldPos+l,lastComponent:{count:d.count+1,added:n,removed:r,previousComponent:d.previousComponent}}:{oldPos:t.oldPos+l,lastComponent:{count:1,added:n,removed:r,previousComponent:d}}},extractCommon:function(t,n,r,l){for(var d=n.length,f=r.length,p=t.oldPos,_=p-l,E=0;_+1<d&&p+1<f&&this.equals(n[_+1],r[p+1]);)_++,p++,E++;return E&&(t.lastComponent={count:E,previousComponent:t.lastComponent}),t.oldPos=p,_},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function TE(e,t,n,r,l){for(var d=[],f;t;)d.push(t),f=t.previousComponent,delete t.previousComponent,t=f;d.reverse();for(var p=0,_=d.length,E=0,T=0;p<_;p++){var S=d[p];if(S.removed){if(S.value=e.join(r.slice(T,T+S.count)),T+=S.count,p&&d[p-1].added){var O=d[p-1];d[p-1]=d[p],d[p]=O}}else{if(!S.added&&l){var w=n.slice(E,E+S.count);w=w.map(function(v,I){var G=r[T+I];return G.length>v.length?G:v}),S.value=e.join(w)}else S.value=e.join(n.slice(E,E+S.count));E+=S.count,S.added||(T+=S.count)}}var m=d[_-1];return _>1&&typeof m.value=="string"&&(m.added||m.removed)&&e.equals("",m.value)&&(d[_-2].value+=m.value,d.pop()),d}var Tg=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,xg=/\S/,Xp=new vs;Xp.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!xg.test(e)&&!xg.test(t)};Xp.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&Tg.test(t[n])&&Tg.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var Qp=new vs;Qp.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
101
|
+
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var l=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=l:(this.options.ignoreWhitespace&&(l=l.trim()),t.push(l))}return t};var xE=new vs;xE.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var vE=new vs;vE.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function sc(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?sc=function(t){return typeof t}:sc=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sc(e)}var SE=Object.prototype.toString,la=new vs;la.useLongestToken=!0;la.tokenize=Qp.tokenize;la.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,l=r===void 0?function(d,f){return typeof f>"u"?n:f}:r;return typeof e=="string"?e:JSON.stringify(Xu(e,null,null,l),l," ")};la.equals=function(e,t){return vs.prototype.equals.call(la,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Xu(e,t,n,r,l){t=t||[],n=n||[],r&&(e=r(l,e));var d;for(d=0;d<t.length;d+=1)if(t[d]===e)return n[d];var f;if(SE.call(e)==="[object Array]"){for(t.push(e),f=new Array(e.length),n.push(f),d=0;d<e.length;d+=1)f[d]=Xu(e[d],t,n,r,l);return t.pop(),n.pop(),f}if(e&&e.toJSON&&(e=e.toJSON()),sc(e)==="object"&&e!==null){t.push(e),f={},n.push(f);var p=[],_;for(_ in e)e.hasOwnProperty(_)&&p.push(_);for(p.sort(),d=0;d<p.length;d+=1)_=p[d],f[_]=Xu(e[_],t,n,r,_);t.pop(),n.pop()}else f=e;return f}var Qu=new vs;Qu.tokenize=function(e){return e.slice()};Qu.join=Qu.removeEmpty=function(e){return e};Qt.red,Qt.grey,Qt.green;Qt.dim().italic;Qt.dim("→");Qt.dim("·");Qt.dim("↵");function dc(e){e=e.replace(/\r?\n/g,`
|
|
102
|
+
`);let t=e.match(/^[ \t]*(?=\S)/gm),n=0,r=1/0,l=(t||[]).length;for(;n<l;n++)r=Math.min(r,t[n].length);return l&&r?e.replace(new RegExp(`^[ \\t]{${r}}`,"gm"),""):e}class wE extends Error{constructor(t={}){super(t.message),this.name="Assertion",this.code="ERR_ASSERTION",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.details=t.details||!1,this.generated=!!t.generated,this.operator=t.operator,this.expects=t.expects,this.actual=t.actual}}function ni(e,t,n,r,l,d,f){if(e)return;let p=f||d;if(f instanceof Error)throw f;let _=l;throw new wE({actual:t,expects:n,operator:r,message:p,details:_,generated:!f})}function Ec(e,t){ni(!!e,!1,!0,"ok",!1,"Expected value to be truthy",t)}function es(e,t){ni(!e,!0,!1,"not",!1,"Expected value to be falsey",t)}es.ok=es;es.equal=function(e,t,n){ni(!sa(e,t),e,t,"not.equal",!1,"Expected values not to be deeply equal",n)};es.type=function(e,t,n){let r=typeof e;ni(r!==t,r,t,"not.type",!1,`Expected "${r}" not to be "${t}"`,n)};es.instance=function(e,t,n){let r="`"+(t.name||t.constructor.name)+"`";ni(!(e instanceof t),e,t,"not.instance",!1,`Expected value not to be an instance of ${r}`,n)};es.snapshot=function(e,t,n){e=dc(e),t=dc(t),ni(e!==t,e,t,"not.snapshot",!1,"Expected value not to match snapshot",n)};es.fixture=function(e,t,n){e=dc(e),t=dc(t),ni(e!==t,e,t,"not.fixture",!1,"Expected value not to match fixture",n)};es.match=function(e,t,n){typeof t=="string"?ni(!e.includes(t),e,t,"not.match",!1,`Expected value not to include "${t}" substring`,n):ni(!t.test(e),e,t,"not.match",!1,`Expected value not to match \`${String(t)}\` pattern`,n)};es.throws=function(e,t,n){!n&&typeof t=="string"&&(n=t,t=null);try{e()}catch(r){typeof t=="function"?ni(!t(r),!0,!1,"not.throws",!1,"Expected function not to throw matching exception",n):t instanceof RegExp?ni(!t.test(r.message),!0,!1,"not.throws",!1,`Expected function not to throw exception matching \`${String(t)}\` pattern`,n):t||ni(!1,!0,!1,"not.throws",!1,"Expected function not to throw",n)}};const OE=/[!-\/:-@\[-`\{-~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]/,DE=Ss(/[A-Za-z]/),ed=Ss(/[\dA-Za-z]/),AE=Ss(/[#-'*+\--9=?A-Z^-~]/);function ME(e){return e!==null&&(e<32||e===127)}const RE=Ss(/\d/),bE=Ss(/[\dA-Fa-f]/),LE=Ss(/[!-/:-@[-`{-~]/);function IE(e){return e!==null&&e<-2}function em(e){return e!==null&&(e<0||e===32)}function kE(e){return e===-2||e===-1||e===32}const PE=Ss(OE),$E=Ss(/\s/);function Ss(e){return t;function t(n){return n!==null&&e.test(String.fromCharCode(n))}}function aa(e){if(e===null||em(e)||$E(e))return 1;if(PE(e))return 2}const fc={characterGroupPunctuation:2};function FE(e,t){const n=this.previous,r=aa(n);return l;function l(f){return Ec(f===Qi.tilde,"expected `~`"),e.enter("tildeSequenceTemporary"),d(f)}function d(f){if(f===Qi.tilde)return e.consume(f),d;const p=e.exit("tildeSequenceTemporary"),_=aa(f);return p._open=!_||_===fc.characterGroupPunctuation&&!!r,p._close=!r||r===fc.characterGroupPunctuation&&!!_,t(f)}}function tm(e,t,n){const r=[];let l=-1;for(;++l<e.length;){const d=e[l].resolveAll;d&&!r.includes(d)&&(t=d(t,n),r.push(d))}return t}const BE={data:"data"};function Od(e,t){return!!(e[0]==="enter"&&e[1].type===`${t}SequenceTemporary`&&e[1]._close)}function Dd(e,t){return!!(e[0]==="exit"&&e[1].type===`${t}SequenceTemporary`&&e[1]._open)}function Ad(e,t,n,r,l,d){const[f,p,_,E]=HE(e[t],e[n],l,d);e[t][1].end=Object.assign({},f.start),e[n][1].start=Object.assign({},p.end);let T=[];e[t][1].end.offset-e[t][1].start.offset&&(T=Vo(T,[["enter",e[t][1],r],["exit",e[t][1],r]])),T=Vo(T,[["enter",E,r],["enter",f,r],["exit",f,r],["enter",_,r]]),T=Vo(T,tm(r.parser.constructs.insideSpan.null,e.slice(t+1,n),r)),T=Vo(T,[["exit",_,r],["enter",p,r],["exit",p,r],["exit",E,r]]);let S=0;return e[n][1].end.offset-e[n][1].start.offset&&(S=2,T=Vo(T,[["enter",e[n][1],r],["exit",e[n][1],r]])),Cc(e,t-1,n-t+3,T),t+T.length-S-2}function HE(e,t,n,r){const l=Object.assign({},e[1].end),d=Object.assign({},t[1].start);vg(l,-r),vg(d,r);const f={type:`${n}Sequence`,start:l,end:Object.assign({},e[1].end)},p={type:`${n}Sequence`,start:Object.assign({},t[1].start),end:d},_={type:`${n}Text`,start:Object.assign({},e[1].end),end:Object.assign({},t[1].start)},E={type:`${n}`,start:Object.assign({},f.start),end:Object.assign({},p.end)};return[f,p,_,E]}function vg(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}function Md(e,t){e.forEach(n=>{n[1].type===`${t}SequenceTemporary`&&(n[1].type=BE.data)})}function WE(e,t){let n=-1;for(;++n<e.length;)if(Od(e[n],"tilde")){let r=n;for(;r--;)if(Dd(e[r],"tilde")){const l=KE(e[r],e[n]);n=Ad(e,r,n,t,l===1?"subscript":"strikethrough",l);break}}return Md(e,"tilde"),e}function KE(e,t){const n=e[1].end.offset-e[1].start.offset,r=t[1].end.offset-t[1].start.offset;return n<3||r<3?r<n?r:n:r%2===0?2:1}function zE(){const e={tokenize:FE,resolveAll:WE};return{text:{[Qi.tilde]:e},insideSpan:{null:[e]}}}function UE(e,t){let n=-1;for(;++n<e.length;)if(Od(e[n],"superscript")){let r=n;for(;r--;)if(Dd(e[r],"superscript")){n=Ad(e,r,n,t,"superscript",1);break}}return Md(e,"superscript"),e}function GE(e,t){return n;function n(l){return Ec(l===Qi.caret,"expected `^`"),e.enter("superscriptSequenceTemporary"),r(l)}function r(l){if(l===Qi.caret)return e.consume(l),r;const d=e.exit("superscriptSequenceTemporary");return d._open=!0,d._close=!0,t(l)}}function YE(){const e={tokenize:GE,resolveAll:UE};return{text:{[Qi.caret]:e},insideSpan:{null:[e]}}}function jE(e,t,n){const r=this.previous,l=aa(r);let d=0;return f;function f(_){return Ec(_===Qi.plusSign,"expected `+`"),e.enter("underlineSequenceTemporary"),p(_)}function p(_){if(_===Qi.plusSign)return e.consume(_),d++,p;if(d<2)return n(_);const E=e.exit("underlineSequenceTemporary"),T=aa(_);return E._open=!T||T===fc.characterGroupPunctuation&&!!l,E._close=!l||l===fc.characterGroupPunctuation&&!!T,t(_)}}function VE(e,t){let n=-1;for(;++n<e.length;)if(Od(e[n],"underline")&&e[n][1].end.offset-e[n][1].start.offset>1){let r=n;for(;r--;)if(Dd(e[r],"underline")&&e[r][1].end.offset-e[r][1].start.offset>1){n=Ad(e,r,n,t,"underline",2);break}}return Md(e,"underline"),e}function qE(){const e={tokenize:jE,resolveAll:VE};return{text:{[Qi.plusSign]:e},insideSpan:{null:[e]}}}function ZE(){return jp([qE(),YE(),zE()])}const JE={canContainEols:["strikethrough"],enter:{strikethrough:XE},exit:{strikethrough:QE}};function XE(e){this.enter({type:"strikethrough",children:[]},e)}function QE(e){this.exit(e)}const eT={canContainEols:["subscript"],enter:{subscript:tT},exit:{subscript:nT}};function tT(e){this.enter({type:"subscript",children:[]},e)}function nT(e){this.exit(e)}const rT={canContainEols:["superscript"],enter:{superscript:iT},exit:{superscript:sT}};function iT(e){this.enter({type:"superscript",children:[]},e)}function sT(e){this.exit(e)}const oT={canContainEols:["underline"],enter:{underline:lT},exit:{underline:aT}};function lT(e){this.enter({type:"underline",children:[]},e)}function aT(e){this.exit(e)}function cT(){return[oT,JE,eT,rT]}function uT(){const e=this.data();t("micromarkExtensions",ZE()),t("fromMarkdownExtensions",cT());function t(n,r){const l=e[n];l?(Ec(Array.isArray(l)),l.push(r)):e[n]=[r]}}function dT(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function fT(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
103
|
+
`}]}function hT(e,t){const n=t.value?t.value+`
|
|
104
|
+
`:"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,l={};r&&(l.className=["language-"+r]);let d={type:"element",tagName:"code",properties:l,children:[{type:"text",value:n}]};return t.meta&&(d.data={meta:t.meta}),e.patch(t,d),d=e.applyData(t,d),d={type:"element",tagName:"pre",properties:{},children:[d]},e.patch(t,d),d}function gT(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pT(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ol(e){const t=[];let n=-1,r=0,l=0;for(;++n<e.length;){const d=e.charCodeAt(n);let f="";if(d===37&&ed(e.charCodeAt(n+1))&&ed(e.charCodeAt(n+2)))l=2;else if(d<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(d))||(f=String.fromCharCode(d));else if(d>55295&&d<57344){const p=e.charCodeAt(n+1);d<56320&&p>56319&&p<57344?(f=String.fromCharCode(d,p),l=1):f="�"}else f=String.fromCharCode(d);f&&(t.push(e.slice(r,n),encodeURIComponent(f)),r=n+l+1,f=""),l&&(n+=l,l=0)}return t.join("")+e.slice(r)}function nm(e,t){const n=String(t.identifier).toUpperCase(),r=ol(n.toLowerCase()),l=e.footnoteOrder.indexOf(n);let d;l===-1?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,d=e.footnoteOrder.length):(e.footnoteCounts[n]++,d=l+1);const f=e.footnoteCounts[n],p={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(t,p);const _={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(t,_),e.applyData(t,_)}function mT(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const l=String(r);return n[l]={type:"footnoteDefinition",identifier:l,children:[{type:"paragraph",children:t.children}],position:t.position},nm(e,{type:"footnoteReference",identifier:l,position:t.position})}function _T(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yT(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null}function rm(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return{type:"text",value:"!["+t.alt+r};const l=e.all(t),d=l[0];d&&d.type==="text"?d.value="["+d.value:l.unshift({type:"text",value:"["});const f=l[l.length-1];return f&&f.type==="text"?f.value+=r:l.push({type:"text",value:r}),l}function NT(e,t){const n=e.definition(t.identifier);if(!n)return rm(e,t);const r={src:ol(n.url||""),alt:t.alt};n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,l),e.applyData(t,l)}function CT(e,t){const n={src:ol(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function ET(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function TT(e,t){const n=e.definition(t.identifier);if(!n)return rm(e,t);const r={href:ol(n.url||"")};n.title!==null&&n.title!==void 0&&(r.title=n.title);const l={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function xT(e,t){const n={href:ol(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vT(e,t,n){const r=e.all(t),l=n?ST(n):im(t),d={},f=[];if(typeof t.checked=="boolean"){const T=r[0];let S;T&&T.type==="element"&&T.tagName==="p"?S=T:(S={type:"element",tagName:"p",properties:{},children:[]},r.unshift(S)),S.children.length>0&&S.children.unshift({type:"text",value:" "}),S.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),d.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const T=r[p];(l||p!==0||T.type!=="element"||T.tagName!=="p")&&f.push({type:"text",value:`
|
|
105
|
+
`}),T.type==="element"&&T.tagName==="p"&&!l?f.push(...T.children):f.push(T)}const _=r[r.length-1];_&&(l||_.type!=="element"||_.tagName!=="p")&&f.push({type:"text",value:`
|
|
106
|
+
`});const E={type:"element",tagName:"li",properties:d,children:f};return e.patch(t,E),e.applyData(t,E)}function ST(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=im(n[r])}return t}function im(e){const t=e.spread;return t??e.children.length>1}function wT(e,t){const n={},r=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<r.length;){const f=r[l];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const d={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,d),e.applyData(t,d)}function OT(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function DT(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function AT(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Rd=sm("start"),bd=sm("end");function MT(e){return{start:Rd(e),end:bd(e)}}function sm(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};return{line:r.line||null,column:r.column||null,offset:r.offset>-1?r.offset:null}}}function RT(e,t){const n=e.all(t),r=n.shift(),l=[];if(r){const f={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],f),l.push(f)}if(n.length>0){const f={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},p=Rd(t.children[1]),_=bd(t.children[t.children.length-1]);p.line&&_.line&&(f.position={start:p,end:_}),l.push(f)}const d={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,d),e.applyData(t,d)}function bT(e,t,n){const r=n?n.children:void 0,d=(r?r.indexOf(t):1)===0?"th":"td",f=n&&n.type==="table"?n.align:void 0,p=f?f.length:t.children.length;let _=-1;const E=[];for(;++_<p;){const S=t.children[_],w={},O=f?f[_]:void 0;O&&(w.align=O);let m={type:"element",tagName:d,properties:w,children:[]};S&&(m.children=e.all(S),e.patch(S,m),m=e.applyData(t,m)),E.push(m)}const T={type:"element",tagName:"tr",properties:{},children:e.wrap(E,!0)};return e.patch(t,T),e.applyData(t,T)}function LT(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Sg=9,wg=32;function IT(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),l=0;const d=[];for(;r;)d.push(Og(t.slice(l,r.index),l>0,!0),r[0]),l=r.index+r[0].length,r=n.exec(t);return d.push(Og(t.slice(l),l>0,!1)),d.join("")}function Og(e,t,n){let r=0,l=e.length;if(t){let d=e.codePointAt(r);for(;d===Sg||d===wg;)r++,d=e.codePointAt(r)}if(n){let d=e.codePointAt(l-1);for(;d===Sg||d===wg;)l--,d=e.codePointAt(l-1)}return l>r?e.slice(r,l):""}function kT(e,t){const n={type:"text",value:IT(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function PT(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const $T={blockquote:dT,break:fT,code:hT,delete:gT,emphasis:pT,footnoteReference:nm,footnote:mT,heading:_T,html:yT,imageReference:NT,image:CT,inlineCode:ET,linkReference:TT,link:xT,listItem:vT,list:wT,paragraph:OT,root:DT,strong:AT,table:RT,tableCell:LT,tableRow:bT,text:kT,thematicBreak:PT,toml:Xa,yaml:Xa,definition:Xa,footnoteDefinition:Xa};function Xa(){return null}const om=function(e){if(e==null)return WT;if(typeof e=="string")return HT(e);if(typeof e=="object")return Array.isArray(e)?FT(e):BT(e);if(typeof e=="function")return Tc(e);throw new Error("Expected function, string, or object as test")};function FT(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=om(e[n]);return Tc(r);function r(...l){let d=-1;for(;++d<t.length;)if(t[d].call(this,...l))return!0;return!1}}function BT(e){return Tc(t);function t(n){let r;for(r in e)if(n[r]!==e[r])return!1;return!0}}function HT(e){return Tc(t);function t(n){return n&&n.type===e}}function Tc(e){return t;function t(n,...r){return!!(n&&typeof n=="object"&&"type"in n&&e.call(this,n,...r))}}function WT(){return!0}const KT=!0,Dg=!1,zT="skip",UT=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null);const l=om(t),d=r?-1:1;f(e,void 0,[])();function f(p,_,E){const T=p&&typeof p=="object"?p:{};if(typeof T.type=="string"){const w=typeof T.tagName=="string"?T.tagName:typeof T.name=="string"?T.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(p.type+(w?"<"+w+">":""))+")"})}return S;function S(){let w=[],O,m,v;if((!t||l(p,_,E[E.length-1]||null))&&(w=GT(n(p,E)),w[0]===Dg))return w;if(p.children&&w[0]!==zT)for(m=(r?p.children.length:-1)+d,v=E.concat(p);m>-1&&m<p.children.length;){if(O=f(p.children[m],m,v)(),O[0]===Dg)return O;m=typeof O[1]=="number"?O[1]:m+d}return w}}};function GT(e){return Array.isArray(e)?e:typeof e=="number"?[KT,e]:[e]}const Ld=function(e,t,n,r){typeof t=="function"&&typeof n!="function"&&(r=n,n=t,t=null),UT(e,t,l,r);function l(d,f){const p=f[f.length-1];return n(d,p?p.children.indexOf(d):null,p)}};function YT(e){return!e||!e.position||!e.position.start||!e.position.start.line||!e.position.start.column||!e.position.end||!e.position.end.line||!e.position.end.column}const Ag={}.hasOwnProperty;function jT(e){const t=Object.create(null);if(!e||!e.type)throw new Error("mdast-util-definitions expected node");return Ld(e,"definition",r=>{const l=Mg(r.identifier);l&&!Ag.call(t,l)&&(t[l]=r)}),n;function n(r){const l=Mg(r);return l&&Ag.call(t,l)?t[l]:null}}function Mg(e){return String(e||"").toUpperCase()}const hc={}.hasOwnProperty;function VT(e,t){const n=t||{},r=n.allowDangerousHtml||!1,l={};return f.dangerous=r,f.clobberPrefix=n.clobberPrefix===void 0||n.clobberPrefix===null?"user-content-":n.clobberPrefix,f.footnoteLabel=n.footnoteLabel||"Footnotes",f.footnoteLabelTagName=n.footnoteLabelTagName||"h2",f.footnoteLabelProperties=n.footnoteLabelProperties||{className:["sr-only"]},f.footnoteBackLabel=n.footnoteBackLabel||"Back to content",f.unknownHandler=n.unknownHandler,f.passThrough=n.passThrough,f.handlers={...$T,...n.handlers},f.definition=jT(e),f.footnoteById=l,f.footnoteOrder=[],f.footnoteCounts={},f.patch=qT,f.applyData=ZT,f.one=p,f.all=_,f.wrap=XT,f.augment=d,Ld(e,"footnoteDefinition",E=>{const T=String(E.identifier).toUpperCase();hc.call(l,T)||(l[T]=E)}),f;function d(E,T){if(E&&"data"in E&&E.data){const S=E.data;S.hName&&(T.type!=="element"&&(T={type:"element",tagName:"",properties:{},children:[]}),T.tagName=S.hName),T.type==="element"&&S.hProperties&&(T.properties={...T.properties,...S.hProperties}),"children"in T&&T.children&&S.hChildren&&(T.children=S.hChildren)}if(E){const S="type"in E?E:{position:E};YT(S)||(T.position={start:Rd(S),end:bd(S)})}return T}function f(E,T,S,w){return Array.isArray(S)&&(w=S,S={}),d(E,{type:"element",tagName:T,properties:S||{},children:w||[]})}function p(E,T){return lm(f,E,T)}function _(E){return ns(f,E)}}function qT(e,t){e.position&&(t.position=MT(e))}function ZT(e,t){let n=t;if(e&&e.data){const r=e.data.hName,l=e.data.hChildren,d=e.data.hProperties;typeof r=="string"&&(n.type==="element"?n.tagName=r:n={type:"element",tagName:r,properties:{},children:[]}),n.type==="element"&&d&&(n.properties={...n.properties,...d}),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function lm(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return hc.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:ns(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):JT(e,t)}function ns(e,t){const n=[];if("children"in t){const r=t.children;let l=-1;for(;++l<r.length;){const d=lm(e,r[l],t);if(d){if(l&&r[l-1].type==="break"&&(!Array.isArray(d)&&d.type==="text"&&(d.value=d.value.replace(/^\s+/,"")),!Array.isArray(d)&&d.type==="element")){const f=d.children[0];f&&f.type==="text"&&(f.value=f.value.replace(/^\s+/,""))}Array.isArray(d)?n.push(...d):n.push(d)}}}return n}function JT(e,t){const n=t.data||{},r="value"in t&&!(hc.call(n,"hProperties")||hc.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:ns(e,t)};return e.patch(t,r),e.applyData(t,r)}function XT(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
107
107
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
108
108
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
109
|
-
`}),n}const qT=(e,t)=>e(t,"i",rs(e,t)),ZT=(e,t)=>e(t,"b",rs(e,t)),JT=(e,t)=>e(t,"u",rs(e,t)),XT=(e,t)=>e(t,"s",rs(e,t)),QT=(e,t)=>e(t,"sub",rs(e,t)),ex=(e,t)=>e(t,"sup",rs(e,t)),tx={emphasis:qT,strong:ZT,underline:JT,strikethrough:XT,subscript:QT,superscript:ex},nx=e=>{const[t,n]=nt.useState();let r;return nt.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-DjKBlVXj.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:e.markdown,remarkPlugins:[oT],remarkRehypeOptions:{handlers:tx}});n(d)})()},[e.markdown]),t||null};class co extends Error{}class rx extends co{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class ix extends co{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class sx extends co{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class qo extends co{}class sm extends co{constructor(t){super(`Invalid unit ${t}`)}}class mr extends co{}class ys extends co{constructor(){super("Zone is an abstract class")}}const lt="numeric",mi="short",Yr="long",hc={year:lt,month:lt,day:lt},om={year:lt,month:mi,day:lt},ox={year:lt,month:mi,day:lt,weekday:mi},lm={year:lt,month:Yr,day:lt},am={year:lt,month:Yr,day:lt,weekday:Yr},cm={hour:lt,minute:lt},um={hour:lt,minute:lt,second:lt},dm={hour:lt,minute:lt,second:lt,timeZoneName:mi},fm={hour:lt,minute:lt,second:lt,timeZoneName:Yr},hm={hour:lt,minute:lt,hourCycle:"h23"},gm={hour:lt,minute:lt,second:lt,hourCycle:"h23"},pm={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:mi},mm={hour:lt,minute:lt,second:lt,hourCycle:"h23",timeZoneName:Yr},_m={year:lt,month:lt,day:lt,hour:lt,minute:lt},ym={year:lt,month:lt,day:lt,hour:lt,minute:lt,second:lt},Nm={year:lt,month:mi,day:lt,hour:lt,minute:lt},Cm={year:lt,month:mi,day:lt,hour:lt,minute:lt,second:lt},lx={year:lt,month:mi,day:lt,weekday:mi,hour:lt,minute:lt},Em={year:lt,month:Yr,day:lt,hour:lt,minute:lt,timeZoneName:mi},Tm={year:lt,month:Yr,day:lt,hour:lt,minute:lt,second:lt,timeZoneName:mi},xm={year:lt,month:Yr,day:lt,weekday:Yr,hour:lt,minute:lt,timeZoneName:Yr},vm={year:lt,month:Yr,day:lt,weekday:Yr,hour:lt,minute:lt,second:lt,timeZoneName:Yr};class ca{get type(){throw new ys}get name(){throw new ys}get ianaName(){return this.name}get isUniversal(){throw new ys}offsetName(t,n){throw new ys}formatOffset(t,n){throw new ys}offset(t){throw new ys}equals(t){throw new ys}get isValid(){throw new ys}}let bu=null;class Ec extends ca{static get instance(){return bu===null&&(bu=new Ec),bu}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Lm(t,n,r)}formatOffset(t,n){return sa(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let sc={};function ax(e){return sc[e]||(sc[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),sc[e]}const cx={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function ux(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,l,d,f,p,_,T,E]=r;return[f,l,d,p,_,T,E]}function dx(e,t){const n=e.formatToParts(t),r=[];for(let l=0;l<n.length;l++){const{type:d,value:f}=n[l],p=cx[d];d==="era"?r[p]=f:Lt(p)||(r[p]=parseInt(f,10))}return r}let Xa={};class ns extends ca{static create(t){return Xa[t]||(Xa[t]=new ns(t)),Xa[t]}static resetCache(){Xa={},sc={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=ns.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Lm(t,n,r,this.name)}formatOffset(t,n){return sa(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=ax(this.name);let[l,d,f,p,_,T,E]=r.formatToParts?dx(r,n):ux(r,n);p==="BC"&&(l=-Math.abs(l)+1);const w=xc({year:l,month:d,day:f,hour:_===24?0:_,minute:T,second:E,millisecond:0});let M=+n;const m=M%1e3;return M-=m>=0?m:1e3+m,(w-M)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Og={};function fx(e,t={}){const n=JSON.stringify([e,t]);let r=Og[n];return r||(r=new Intl.ListFormat(e,t),Og[n]=r),r}let Xu={};function Qu(e,t={}){const n=JSON.stringify([e,t]);let r=Xu[n];return r||(r=new Intl.DateTimeFormat(e,t),Xu[n]=r),r}let ed={};function hx(e,t={}){const n=JSON.stringify([e,t]);let r=ed[n];return r||(r=new Intl.NumberFormat(e,t),ed[n]=r),r}let td={};function gx(e,t={}){const{base:n,...r}=t,l=JSON.stringify([e,r]);let d=td[l];return d||(d=new Intl.RelativeTimeFormat(e,t),td[l]=d),d}let ta=null;function px(){return ta||(ta=new Intl.DateTimeFormat().resolvedOptions().locale,ta)}let Dg={};function mx(e){let t=Dg[e];if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,Dg[e]=t}return t}function _x(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,l;try{r=Qu(e).resolvedOptions(),l=e}catch{const _=e.substring(0,n);r=Qu(_).resolvedOptions(),l=_}const{numberingSystem:d,calendar:f}=r;return[l,d,f]}}function yx(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Nx(e){const t=[];for(let n=1;n<=12;n++){const r=Ot.utc(2009,n,1);t.push(e(r))}return t}function Cx(e){const t=[];for(let n=1;n<=7;n++){const r=Ot.utc(2016,11,13+n);t.push(e(r))}return t}function Qa(e,t,n,r){const l=e.listingMode();return l==="error"?null:l==="en"?n(t):r(t)}function Ex(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class Tx{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:l,floor:d,...f}=r;if(!n||Object.keys(f).length>0){const p={useGrouping:!1,...r};r.padTo>0&&(p.minimumIntegerDigits=r.padTo),this.inf=hx(t,p)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):Ld(t,3);return Kn(n,this.padTo)}}}class xx{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const f=-1*(t.offset/60),p=f>=0?`Etc/GMT+${f}`:`Etc/GMT${f}`;t.offset!==0&&ns.create(p).valid?(l=p,this.dt=t):(l="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,l=t.zone.name):(l="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const d={...this.opts};d.timeZone=d.timeZone||l,this.dtf=Qu(n,d)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class vx{constructor(t,n,r){this.opts={style:"long",...r},!n&&Rm()&&(this.rtf=gx(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):jx(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const Sx={firstDay:1,minimalDays:4,weekend:[6,7]};class un{static fromOpts(t){return un.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,l,d=!1){const f=t||Rn.defaultLocale,p=f||(d?"en-US":px()),_=n||Rn.defaultNumberingSystem,T=r||Rn.defaultOutputCalendar,E=nd(l)||Rn.defaultWeekSettings;return new un(p,_,T,E,f)}static resetCache(){ta=null,Xu={},ed={},td={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:l}={}){return un.create(t,n,r,l)}constructor(t,n,r,l,d){const[f,p,_]=_x(t);this.locale=f,this.numberingSystem=n||p||null,this.outputCalendar=r||_||null,this.weekSettings=l,this.intl=yx(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=d,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Ex(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:un.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,nd(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Qa(this,t,Pm,()=>{const r=n?{month:t,day:"numeric"}:{month:t},l=n?"format":"standalone";return this.monthsCache[l][t]||(this.monthsCache[l][t]=Nx(d=>this.extract(d,r,"month"))),this.monthsCache[l][t]})}weekdays(t,n=!1){return Qa(this,t,Bm,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},l=n?"format":"standalone";return this.weekdaysCache[l][t]||(this.weekdaysCache[l][t]=Cx(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[l][t]})}meridiems(){return Qa(this,void 0,()=>Hm,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ot.utc(2016,11,13,9),Ot.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Qa(this,t,Wm,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[Ot.utc(-40,1,1),Ot.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const l=this.dtFormatter(t,n),d=l.formatToParts(),f=d.find(p=>p.type.toLowerCase()===r);return f?f.value:null}numberFormatter(t={}){return new Tx(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new xx(t,this.intl,n)}relFormatter(t={}){return new vx(this.intl,this.isEnglish(),t)}listFormatter(t={}){return fx(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:bm()?mx(this.locale):Sx}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Lu=null;class vr extends ca{static get utcInstance(){return Lu===null&&(Lu=new vr(0)),Lu}static instance(t){return t===0?vr.utcInstance:new vr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new vr(vc(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${sa(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${sa(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return sa(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class wx extends ca{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Es(e,t){if(Lt(e)||e===null)return t;if(e instanceof ca)return e;if(bx(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Ec.instance:n==="utc"||n==="gmt"?vr.utcInstance:vr.parseSpecifier(n)||ns.create(e)}else return xs(e)?vr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new wx(e)}const Ad={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Ag={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ox=Ad.hanidec.replace(/[\[|\]]/g,"").split("");function Dx(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(Ad.hanidec)!==-1)t+=Ox.indexOf(e[n]);else for(const l in Ag){const[d,f]=Ag[l];r>=d&&r<=f&&(t+=r-d)}}return parseInt(t,10)}else return t}let Vo={};function Ax(){Vo={}}function hi({numberingSystem:e},t=""){const n=e||"latn";return Vo[n]||(Vo[n]={}),Vo[n][t]||(Vo[n][t]=new RegExp(`${Ad[n]}${t}`)),Vo[n][t]}let Mg=()=>Date.now(),Rg="system",bg=null,Lg=null,Ig=null,kg=60,Pg,$g=null;class Rn{static get now(){return Mg}static set now(t){Mg=t}static set defaultZone(t){Rg=t}static get defaultZone(){return Es(Rg,Ec.instance)}static get defaultLocale(){return bg}static set defaultLocale(t){bg=t}static get defaultNumberingSystem(){return Lg}static set defaultNumberingSystem(t){Lg=t}static get defaultOutputCalendar(){return Ig}static set defaultOutputCalendar(t){Ig=t}static get defaultWeekSettings(){return $g}static set defaultWeekSettings(t){$g=nd(t)}static get twoDigitCutoffYear(){return kg}static set twoDigitCutoffYear(t){kg=t%100}static get throwOnInvalid(){return Pg}static set throwOnInvalid(t){Pg=t}static resetCaches(){un.resetCache(),ns.resetCache(),Ot.resetCache(),Ax()}}class pi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Sm=[0,31,59,90,120,151,181,212,243,273,304,334],wm=[0,31,60,91,121,152,182,213,244,274,305,335];function ei(e,t){return new pi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function Md(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const l=r.getUTCDay();return l===0?7:l}function Om(e,t,n){return n+(ua(e)?wm:Sm)[t-1]}function Dm(e,t){const n=ua(e)?wm:Sm,r=n.findIndex(d=>d<t),l=t-n[r];return{month:r+1,day:l}}function Rd(e,t){return(e-t+7)%7+1}function gc(e,t=4,n=1){const{year:r,month:l,day:d}=e,f=Om(r,l,d),p=Rd(Md(r,l,d),n);let _=Math.floor((f-p+14-t)/7),T;return _<1?(T=r-1,_=aa(T,t,n)):_>aa(r,t,n)?(T=r+1,_=1):T=r,{weekYear:T,weekNumber:_,weekday:p,...Sc(e)}}function Fg(e,t=4,n=1){const{weekYear:r,weekNumber:l,weekday:d}=e,f=Rd(Md(r,1,t),n),p=Zo(r);let _=l*7+d-f-7+t,T;_<1?(T=r-1,_+=Zo(T)):_>p?(T=r+1,_-=Zo(r)):T=r;const{month:E,day:S}=Dm(T,_);return{year:T,month:E,day:S,...Sc(e)}}function Iu(e){const{year:t,month:n,day:r}=e,l=Om(t,n,r);return{year:t,ordinal:l,...Sc(e)}}function Bg(e){const{year:t,ordinal:n}=e,{month:r,day:l}=Dm(t,n);return{year:t,month:r,day:l,...Sc(e)}}function Hg(e,t){if(!Lt(e.localWeekday)||!Lt(e.localWeekNumber)||!Lt(e.localWeekYear)){if(!Lt(e.weekday)||!Lt(e.weekNumber)||!Lt(e.weekYear))throw new qo("Cannot mix locale-based week fields with ISO-based week fields");return Lt(e.localWeekday)||(e.weekday=e.localWeekday),Lt(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Lt(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Mx(e,t=4,n=1){const r=Tc(e.weekYear),l=ti(e.weekNumber,1,aa(e.weekYear,t,n)),d=ti(e.weekday,1,7);return r?l?d?!1:ei("weekday",e.weekday):ei("week",e.weekNumber):ei("weekYear",e.weekYear)}function Rx(e){const t=Tc(e.year),n=ti(e.ordinal,1,Zo(e.year));return t?n?!1:ei("ordinal",e.ordinal):ei("year",e.year)}function Am(e){const t=Tc(e.year),n=ti(e.month,1,12),r=ti(e.day,1,pc(e.year,e.month));return t?n?r?!1:ei("day",e.day):ei("month",e.month):ei("year",e.year)}function Mm(e){const{hour:t,minute:n,second:r,millisecond:l}=e,d=ti(t,0,23)||t===24&&n===0&&r===0&&l===0,f=ti(n,0,59),p=ti(r,0,59),_=ti(l,0,999);return d?f?p?_?!1:ei("millisecond",l):ei("second",r):ei("minute",n):ei("hour",t)}function Lt(e){return typeof e>"u"}function xs(e){return typeof e=="number"}function Tc(e){return typeof e=="number"&&e%1===0}function bx(e){return typeof e=="string"}function Lx(e){return Object.prototype.toString.call(e)==="[object Date]"}function Rm(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function bm(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Ix(e){return Array.isArray(e)?e:[e]}function Wg(e,t,n){if(e.length!==0)return e.reduce((r,l)=>{const d=[t(l),l];return r&&n(r[0],d[0])===r[0]?r:d},null)[1]}function kx(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function el(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function nd(e){if(e==null)return null;if(typeof e!="object")throw new mr("Week settings must be an object");if(!ti(e.firstDay,1,7)||!ti(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ti(t,1,7)))throw new mr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ti(e,t,n){return Tc(e)&&e>=t&&e<=n}function Px(e,t){return e-t*Math.floor(e/t)}function Kn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Cs(e){if(!(Lt(e)||e===null||e===""))return parseInt(e,10)}function Qs(e){if(!(Lt(e)||e===null||e===""))return parseFloat(e)}function bd(e){if(!(Lt(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Ld(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function ua(e){return e%4===0&&(e%100!==0||e%400===0)}function Zo(e){return ua(e)?366:365}function pc(e,t){const n=Px(t-1,12)+1,r=e+(t-n)/12;return n===2?ua(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function xc(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Kg(e,t,n){return-Rd(Md(e,1,t),n)+t-1}function aa(e,t=4,n=1){const r=Kg(e,t,n),l=Kg(e+1,t,n);return(Zo(e)-r+l)/7}function rd(e){return e>99?e:e>Rn.twoDigitCutoffYear?1900+e:2e3+e}function Lm(e,t,n,r=null){const l=new Date(e),d={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(d.timeZone=r);const f={timeZoneName:t,...d},p=new Intl.DateTimeFormat(n,f).formatToParts(l).find(_=>_.type.toLowerCase()==="timezonename");return p?p.value:null}function vc(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,l=n<0||Object.is(n,-0)?-r:r;return n*60+l}function Im(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new mr(`Invalid unit value ${e}`);return t}function mc(e,t){const n={};for(const r in e)if(el(e,r)){const l=e[r];if(l==null)continue;n[t(r)]=Im(l)}return n}function sa(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),l=e>=0?"+":"-";switch(t){case"short":return`${l}${Kn(n,2)}:${Kn(r,2)}`;case"narrow":return`${l}${n}${r>0?`:${r}`:""}`;case"techie":return`${l}${Kn(n,2)}${Kn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Sc(e){return kx(e,["hour","minute","second","millisecond"])}const $x=["January","February","March","April","May","June","July","August","September","October","November","December"],km=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Fx=["J","F","M","A","M","J","J","A","S","O","N","D"];function Pm(e){switch(e){case"narrow":return[...Fx];case"short":return[...km];case"long":return[...$x];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const $m=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Fm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Bx=["M","T","W","T","F","S","S"];function Bm(e){switch(e){case"narrow":return[...Bx];case"short":return[...Fm];case"long":return[...$m];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Hm=["AM","PM"],Hx=["Before Christ","Anno Domini"],Wx=["BC","AD"],Kx=["B","A"];function Wm(e){switch(e){case"narrow":return[...Kx];case"short":return[...Wx];case"long":return[...Hx];default:return null}}function zx(e){return Hm[e.hour<12?0:1]}function Ux(e,t){return Bm(t)[e.weekday-1]}function Gx(e,t){return Pm(t)[e.month-1]}function Yx(e,t){return Wm(t)[e.year<0?0:1]}function jx(e,t,n="always",r=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},d=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&d){const S=e==="days";switch(t){case 1:return S?"tomorrow":`next ${l[e][0]}`;case-1:return S?"yesterday":`last ${l[e][0]}`;case 0:return S?"today":`this ${l[e][0]}`}}const f=Object.is(t,-0)||t<0,p=Math.abs(t),_=p===1,T=l[e],E=r?_?T[1]:T[2]||T[1]:_?l[e][0]:e;return f?`${p} ${E} ago`:`in ${p} ${E}`}function zg(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Vx={D:hc,DD:om,DDD:lm,DDDD:am,t:cm,tt:um,ttt:dm,tttt:fm,T:hm,TT:gm,TTT:pm,TTTT:mm,f:_m,ff:Nm,fff:Em,ffff:xm,F:ym,FF:Cm,FFF:Tm,FFFF:vm};class _r{static create(t,n={}){return new _r(t,n)}static parseFormat(t){let n=null,r="",l=!1;const d=[];for(let f=0;f<t.length;f++){const p=t.charAt(f);p==="'"?(r.length>0&&d.push({literal:l||/^\s+$/.test(r),val:r}),n=null,r="",l=!l):l||p===n?r+=p:(r.length>0&&d.push({literal:/^\s+$/.test(r),val:r}),r=p,n=p)}return r.length>0&&d.push({literal:l||/^\s+$/.test(r),val:r}),d}static macroTokenToFormatOpts(t){return Vx[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Kn(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",d=(M,m)=>this.loc.extract(t,M,m),f=M=>t.isOffsetFixed&&t.offset===0&&M.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,M.format):"",p=()=>r?zx(t):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),_=(M,m)=>r?Gx(t,M):d(m?{month:M}:{month:M,day:"numeric"},"month"),T=(M,m)=>r?Ux(t,M):d(m?{weekday:M}:{weekday:M,month:"long",day:"numeric"},"weekday"),E=M=>{const m=_r.macroTokenToFormatOpts(M);return m?this.formatWithSystemDefault(t,m):M},S=M=>r?Yx(t,M):d({era:M},"era"),w=M=>{switch(M){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return f({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return f({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return f({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return p();case"d":return l?d({day:"numeric"},"day"):this.num(t.day);case"dd":return l?d({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return T("short",!0);case"cccc":return T("long",!0);case"ccccc":return T("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return T("short",!1);case"EEEE":return T("long",!1);case"EEEEE":return T("narrow",!1);case"L":return l?d({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return l?d({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return _("short",!0);case"LLLL":return _("long",!0);case"LLLLL":return _("narrow",!0);case"M":return l?d({month:"numeric"},"month"):this.num(t.month);case"MM":return l?d({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return _("short",!1);case"MMMM":return _("long",!1);case"MMMMM":return _("narrow",!1);case"y":return l?d({year:"numeric"},"year"):this.num(t.year);case"yy":return l?d({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return l?d({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return l?d({year:"numeric"},"year"):this.num(t.year,6);case"G":return S("short");case"GG":return S("long");case"GGGGG":return S("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return E(M)}};return zg(_r.parseFormat(n),w)}formatDurationFromString(t,n){const r=_=>{switch(_[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=_=>T=>{const E=r(T);return E?this.num(_.get(E),T.length):T},d=_r.parseFormat(n),f=d.reduce((_,{literal:T,val:E})=>T?_:_.concat(E),[]),p=t.shiftTo(...f.map(r).filter(_=>_));return zg(d,l(p))}}const Km=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ll(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function al(...e){return t=>e.reduce(([n,r,l],d)=>{const[f,p,_]=d(t,l);return[{...n,...f},p||r,_]},[{},null,1]).slice(0,2)}function cl(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const l=n.exec(e);if(l)return r(l)}return[null,null]}function zm(...e){return(t,n)=>{const r={};let l;for(l=0;l<e.length;l++)r[e[l]]=Cs(t[n+l]);return[r,null,n+l]}}const Um=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,qx=`(?:${Um.source}?(?:\\[(${Km.source})\\])?)?`,Id=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Gm=RegExp(`${Id.source}${qx}`),kd=RegExp(`(?:T${Gm.source})?`),Zx=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Jx=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Xx=/(\d{4})-?(\d{3})/,Qx=zm("weekYear","weekNumber","weekDay"),ev=zm("year","ordinal"),tv=/(\d{4})-(\d\d)-(\d\d)/,Ym=RegExp(`${Id.source} ?(?:${Um.source}|(${Km.source}))?`),nv=RegExp(`(?: ${Ym.source})?`);function Jo(e,t,n){const r=e[t];return Lt(r)?n:Cs(r)}function rv(e,t){return[{year:Jo(e,t),month:Jo(e,t+1,1),day:Jo(e,t+2,1)},null,t+3]}function ul(e,t){return[{hours:Jo(e,t,0),minutes:Jo(e,t+1,0),seconds:Jo(e,t+2,0),milliseconds:bd(e[t+3])},null,t+4]}function da(e,t){const n=!e[t]&&!e[t+1],r=vc(e[t+1],e[t+2]),l=n?null:vr.instance(r);return[{},l,t+3]}function fa(e,t){const n=e[t]?ns.create(e[t]):null;return[{},n,t+1]}const iv=RegExp(`^T?${Id.source}$`),sv=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function ov(e){const[t,n,r,l,d,f,p,_,T]=e,E=t[0]==="-",S=_&&_[0]==="-",w=(M,m=!1)=>M!==void 0&&(m||M&&E)?-M:M;return[{years:w(Qs(n)),months:w(Qs(r)),weeks:w(Qs(l)),days:w(Qs(d)),hours:w(Qs(f)),minutes:w(Qs(p)),seconds:w(Qs(_),_==="-0"),milliseconds:w(bd(T),S)}]}const lv={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Pd(e,t,n,r,l,d,f){const p={year:t.length===2?rd(Cs(t)):Cs(t),month:km.indexOf(n)+1,day:Cs(r),hour:Cs(l),minute:Cs(d)};return f&&(p.second=Cs(f)),e&&(p.weekday=e.length>3?$m.indexOf(e)+1:Fm.indexOf(e)+1),p}const av=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function cv(e){const[,t,n,r,l,d,f,p,_,T,E,S]=e,w=Pd(t,l,r,n,d,f,p);let M;return _?M=lv[_]:T?M=0:M=vc(E,S),[w,new vr(M)]}function uv(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const dv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,fv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,hv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Ug(e){const[,t,n,r,l,d,f,p]=e;return[Pd(t,l,r,n,d,f,p),vr.utcInstance]}function gv(e){const[,t,n,r,l,d,f,p]=e;return[Pd(t,p,n,r,l,d,f),vr.utcInstance]}const pv=ll(Zx,kd),mv=ll(Jx,kd),_v=ll(Xx,kd),yv=ll(Gm),jm=al(rv,ul,da,fa),Nv=al(Qx,ul,da,fa),Cv=al(ev,ul,da,fa),Ev=al(ul,da,fa);function Tv(e){return cl(e,[pv,jm],[mv,Nv],[_v,Cv],[yv,Ev])}function xv(e){return cl(uv(e),[av,cv])}function vv(e){return cl(e,[dv,Ug],[fv,Ug],[hv,gv])}function Sv(e){return cl(e,[sv,ov])}const wv=al(ul);function Ov(e){return cl(e,[iv,wv])}const Dv=ll(tv,nv),Av=ll(Ym),Mv=al(ul,da,fa);function Rv(e){return cl(e,[Dv,jm],[Av,Mv])}const Gg="Invalid Duration",Vm={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},bv={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Vm},Qr=146097/400,Uo=146097/4800,Lv={years:{quarters:4,months:12,weeks:Qr/7,days:Qr,hours:Qr*24,minutes:Qr*24*60,seconds:Qr*24*60*60,milliseconds:Qr*24*60*60*1e3},quarters:{months:3,weeks:Qr/28,days:Qr/4,hours:Qr*24/4,minutes:Qr*24*60/4,seconds:Qr*24*60*60/4,milliseconds:Qr*24*60*60*1e3/4},months:{weeks:Uo/7,days:Uo,hours:Uo*24,minutes:Uo*24*60,seconds:Uo*24*60*60,milliseconds:Uo*24*60*60*1e3},...Vm},so=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Iv=so.slice(0).reverse();function Ns(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Qt(r)}function qm(e,t){let n=t.milliseconds??0;for(const r of Iv.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Yg(e,t){const n=qm(e,t)<0?-1:1;so.reduceRight((r,l)=>{if(Lt(t[l]))return r;if(r){const d=t[r]*n,f=e[l][r],p=Math.floor(d/f);t[l]+=p*n,t[r]-=p*f*n}return l},null),so.reduce((r,l)=>{if(Lt(t[l]))return r;if(r){const d=t[r]%1;t[r]-=d,t[l]+=d*e[r][l]}return l},null)}function kv(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Qt{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?Lv:bv;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||un.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Qt.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new mr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Qt({values:mc(t,Qt.normalizeUnit),loc:un.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(xs(t))return Qt.fromMillis(t);if(Qt.isDuration(t))return t;if(typeof t=="object")return Qt.fromObject(t);throw new mr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=Sv(t);return r?Qt.fromObject(r,n):Qt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=Ov(t);return r?Qt.fromObject(r,n):Qt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new mr("need to specify a reason the Duration is invalid");const r=t instanceof pi?t:new pi(t,n);if(Rn.throwOnInvalid)throw new sx(r);return new Qt({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new sm(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?_r.create(this.loc,r).formatDurationFromString(this,t):Gg}toHuman(t={}){if(!this.isValid)return Gg;const n=so.map(r=>{const l=this.values[r];return Lt(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(l)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Ld(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},Ot.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?qm(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t),r={};for(const l of so)(el(n.values,l)||el(this.values,l))&&(r[l]=n.get(l)+this.get(l));return Ns(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Im(t(this.values[r],r));return Ns(this,{values:n},!0)}get(t){return this[Qt.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...mc(t,Qt.normalizeUnit)};return Ns(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:l}={}){const f={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:l,conversionAccuracy:r};return Ns(this,f)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Yg(this.matrix,t),Ns(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=kv(this.normalize().shiftToAll().toObject());return Ns(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(f=>Qt.normalizeUnit(f));const n={},r={},l=this.toObject();let d;for(const f of so)if(t.indexOf(f)>=0){d=f;let p=0;for(const T in r)p+=this.matrix[T][f]*r[T],r[T]=0;xs(l[f])&&(p+=l[f]);const _=Math.trunc(p);n[f]=_,r[f]=(p*1e3-_*1e3)/1e3}else xs(l[f])&&(r[f]=l[f]);for(const f in r)r[f]!==0&&(n[d]+=f===d?r[f]:r[f]/this.matrix[d][f]);return Yg(this.matrix,n),Ns(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Ns(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,l){return r===void 0||r===0?l===void 0||l===0:r===l}for(const r of so)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Go="Invalid Interval";function Pv(e,t){return!e||!e.isValid?Mn.invalid("missing or invalid start"):!t||!t.isValid?Mn.invalid("missing or invalid end"):t<e?Mn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Mn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new mr("need to specify a reason the Interval is invalid");const r=t instanceof pi?t:new pi(t,n);if(Rn.throwOnInvalid)throw new ix(r);return new Mn({invalid:r})}static fromDateTimes(t,n){const r=Xl(t),l=Xl(n),d=Pv(r,l);return d??new Mn({start:r,end:l})}static after(t,n){const r=Qt.fromDurationLike(n),l=Xl(t);return Mn.fromDateTimes(l,l.plus(r))}static before(t,n){const r=Qt.fromDurationLike(n),l=Xl(t);return Mn.fromDateTimes(l.minus(r),l)}static fromISO(t,n){const[r,l]=(t||"").split("/",2);if(r&&l){let d,f;try{d=Ot.fromISO(r,n),f=d.isValid}catch{f=!1}let p,_;try{p=Ot.fromISO(l,n),_=p.isValid}catch{_=!1}if(f&&_)return Mn.fromDateTimes(d,p);if(f){const T=Qt.fromISO(l,n);if(T.isValid)return Mn.after(d,T)}else if(_){const T=Qt.fromISO(r,n);if(T.isValid)return Mn.before(p,T)}}return Mn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let l;return n!=null&&n.useLocaleWeeks?l=this.end.reconfigure({locale:r.locale}):l=this.end,l=l.startOf(t,n),Math.floor(l.diff(r,t).get(t))+(l.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Mn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Xl).filter(f=>this.contains(f)).sort((f,p)=>f.toMillis()-p.toMillis()),r=[];let{s:l}=this,d=0;for(;l<this.e;){const f=n[d]||this.e,p=+f>+this.e?this.e:f;r.push(Mn.fromDateTimes(l,p)),l=p,d+=1}return r}splitBy(t){const n=Qt.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,l=1,d;const f=[];for(;r<this.e;){const p=this.start.plus(n.mapUnits(_=>_*l));d=+p>+this.e?this.e:p,f.push(Mn.fromDateTimes(r,d)),r=d,l+=1}return f}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:Mn.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return Mn.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((l,d)=>l.s-d.s).reduce(([l,d],f)=>d?d.overlaps(f)||d.abutsStart(f)?[l,d.union(f)]:[l.concat([d]),f]:[l,f],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const l=[],d=t.map(_=>[{time:_.s,type:"s"},{time:_.e,type:"e"}]),f=Array.prototype.concat(...d),p=f.sort((_,T)=>_.time-T.time);for(const _ of p)r+=_.type==="s"?1:-1,r===1?n=_.time:(n&&+n!=+_.time&&l.push(Mn.fromDateTimes(n,_.time)),n=null);return Mn.merge(l)}difference(...t){return Mn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Go}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=hc,n={}){return this.isValid?_r.create(this.s.loc.clone(n),t).formatInterval(this):Go}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Go}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Go}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Go}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Go}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Qt.invalid(this.invalidReason)}mapEndpoints(t){return Mn.fromDateTimes(t(this.s),t(this.e))}}class ec{static hasDST(t=Rn.defaultZone){const n=Ot.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return ns.isValidZone(t)}static normalizeZone(t){return Es(t,Rn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||un.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||un.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||un.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null,outputCalendar:d="gregory"}={}){return(l||un.create(n,r,d)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null,outputCalendar:d="gregory"}={}){return(l||un.create(n,r,d)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null}={}){return(l||un.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null}={}){return(l||un.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return un.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return un.create(n,null,"gregory").eras(t)}static features(){return{relative:Rm(),localeWeek:bm()}}}function jg(e,t){const n=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Qt.fromMillis(r).as("days"))}function $v(e,t,n){const r=[["years",(_,T)=>T.year-_.year],["quarters",(_,T)=>T.quarter-_.quarter+(T.year-_.year)*4],["months",(_,T)=>T.month-_.month+(T.year-_.year)*12],["weeks",(_,T)=>{const E=jg(_,T);return(E-E%7)/7}],["days",jg]],l={},d=e;let f,p;for(const[_,T]of r)n.indexOf(_)>=0&&(f=_,l[_]=T(e,t),p=d.plus(l),p>t?(l[_]--,e=d.plus(l),e>t&&(p=e,l[_]--,e=d.plus(l))):e=p);return[e,l,p,f]}function Fv(e,t,n,r){let[l,d,f,p]=$v(e,t,n);const _=t-l,T=n.filter(S=>["hours","minutes","seconds","milliseconds"].indexOf(S)>=0);T.length===0&&(f<t&&(f=l.plus({[p]:1})),f!==l&&(d[p]=(d[p]||0)+_/(f-l)));const E=Qt.fromObject(d,r);return T.length>0?Qt.fromMillis(_,r).shiftTo(...T).plus(E):E}const Bv="missing Intl.DateTimeFormat.formatToParts support";function on(e,t=n=>n){return{regex:e,deser:([n])=>t(Dx(n))}}const Hv=" ",Zm=`[ ${Hv}]`,Jm=new RegExp(Zm,"g");function Wv(e){return e.replace(/\./g,"\\.?").replace(Jm,Zm)}function Vg(e){return e.replace(/\./g,"").replace(Jm," ").toLowerCase()}function gi(e,t){return e===null?null:{regex:RegExp(e.map(Wv).join("|")),deser:([n])=>e.findIndex(r=>Vg(n)===Vg(r))+t}}function qg(e,t){return{regex:e,deser:([,n,r])=>vc(n,r),groups:t}}function tc(e){return{regex:e,deser:([t])=>t}}function Kv(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function zv(e,t){const n=hi(t),r=hi(t,"{2}"),l=hi(t,"{3}"),d=hi(t,"{4}"),f=hi(t,"{6}"),p=hi(t,"{1,2}"),_=hi(t,"{1,3}"),T=hi(t,"{1,6}"),E=hi(t,"{1,9}"),S=hi(t,"{2,4}"),w=hi(t,"{4,6}"),M=k=>({regex:RegExp(Kv(k.val)),deser:([G])=>G,literal:!0}),v=(k=>{if(e.literal)return M(k);switch(k.val){case"G":return gi(t.eras("short"),0);case"GG":return gi(t.eras("long"),0);case"y":return on(T);case"yy":return on(S,rd);case"yyyy":return on(d);case"yyyyy":return on(w);case"yyyyyy":return on(f);case"M":return on(p);case"MM":return on(r);case"MMM":return gi(t.months("short",!0),1);case"MMMM":return gi(t.months("long",!0),1);case"L":return on(p);case"LL":return on(r);case"LLL":return gi(t.months("short",!1),1);case"LLLL":return gi(t.months("long",!1),1);case"d":return on(p);case"dd":return on(r);case"o":return on(_);case"ooo":return on(l);case"HH":return on(r);case"H":return on(p);case"hh":return on(r);case"h":return on(p);case"mm":return on(r);case"m":return on(p);case"q":return on(p);case"qq":return on(r);case"s":return on(p);case"ss":return on(r);case"S":return on(_);case"SSS":return on(l);case"u":return tc(E);case"uu":return tc(p);case"uuu":return on(n);case"a":return gi(t.meridiems(),0);case"kkkk":return on(d);case"kk":return on(S,rd);case"W":return on(p);case"WW":return on(r);case"E":case"c":return on(n);case"EEE":return gi(t.weekdays("short",!1),1);case"EEEE":return gi(t.weekdays("long",!1),1);case"ccc":return gi(t.weekdays("short",!0),1);case"cccc":return gi(t.weekdays("long",!0),1);case"Z":case"ZZ":return qg(new RegExp(`([+-]${p.source})(?::(${r.source}))?`),2);case"ZZZ":return qg(new RegExp(`([+-]${p.source})(${r.source})?`),2);case"z":return tc(/[a-z_+-/]{1,256}?/i);case" ":return tc(/[^\S\n\r]/);default:return M(k)}})(e)||{invalidReason:Bv};return v.token=e,v}const Uv={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Gv(e,t,n){const{type:r,value:l}=e;if(r==="literal"){const _=/^\s+$/.test(l);return{literal:!_,val:_?" ":l}}const d=t[r];let f=r;r==="hour"&&(t.hour12!=null?f=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?f="hour12":f="hour24":f=n.hour12?"hour12":"hour24");let p=Uv[f];if(typeof p=="object"&&(p=p[d]),p)return{literal:!1,val:p}}function Yv(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function jv(e,t,n){const r=e.match(t);if(r){const l={};let d=1;for(const f in n)if(el(n,f)){const p=n[f],_=p.groups?p.groups+1:1;!p.literal&&p.token&&(l[p.token.val[0]]=p.deser(r.slice(d,d+_))),d+=_}return[r,l]}else return[r,{}]}function Vv(e){const t=d=>{switch(d){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return Lt(e.z)||(n=ns.create(e.z)),Lt(e.Z)||(n||(n=new vr(e.Z)),r=e.Z),Lt(e.q)||(e.M=(e.q-1)*3+1),Lt(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Lt(e.u)||(e.S=bd(e.u)),[Object.keys(e).reduce((d,f)=>{const p=t(f);return p&&(d[p]=e[f]),d},{}),n,r]}let ku=null;function qv(){return ku||(ku=Ot.fromMillis(1555555555555)),ku}function Zv(e,t){if(e.literal)return e;const n=_r.macroTokenToFormatOpts(e.val),r=t_(n,t);return r==null||r.includes(void 0)?e:r}function Xm(e,t){return Array.prototype.concat(...e.map(n=>Zv(n,t)))}class Qm{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=Xm(_r.parseFormat(n),t),this.units=this.tokens.map(r=>zv(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,l]=Yv(this.units);this.regex=RegExp(r,"i"),this.handlers=l}}explainFromTokens(t){if(this.isValid){const[n,r]=jv(t,this.regex,this.handlers),[l,d,f]=r?Vv(r):[null,null,void 0];if(el(r,"a")&&el(r,"H"))throw new qo("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:l,zone:d,specificOffset:f}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function e_(e,t,n){return new Qm(e,n).explainFromTokens(t)}function Jv(e,t,n){const{result:r,zone:l,specificOffset:d,invalidReason:f}=e_(e,t,n);return[r,l,d,f]}function t_(e,t){if(!e)return null;const r=_r.create(t,e).dtFormatter(qv()),l=r.formatToParts(),d=r.resolvedOptions();return l.map(f=>Gv(f,e,d))}const Pu="Invalid DateTime",Xv=864e13;function na(e){return new pi("unsupported zone",`the zone "${e.name}" is not supported`)}function $u(e){return e.weekData===null&&(e.weekData=gc(e.c)),e.weekData}function Fu(e){return e.localWeekData===null&&(e.localWeekData=gc(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function eo(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Ot({...n,...t,old:n})}function n_(e,t,n){let r=e-t*60*1e3;const l=n.offset(r);if(t===l)return[r,t];r-=(l-t)*60*1e3;const d=n.offset(r);return l===d?[r,l]:[e-Math.min(l,d)*60*1e3,Math.max(l,d)]}function nc(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function oc(e,t,n){return n_(xc(e),t,n)}function Zg(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),l=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,d={...e.c,year:r,month:l,day:Math.min(e.c.day,pc(r,l))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},f=Qt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),p=xc(d);let[_,T]=n_(p,n,e.zone);return f!==0&&(_+=f,T=e.zone.offset(_)),{ts:_,o:T}}function Yo(e,t,n,r,l,d){const{setZone:f,zone:p}=n;if(e&&Object.keys(e).length!==0||t){const _=t||p,T=Ot.fromObject(e,{...n,zone:_,specificOffset:d});return f?T:T.setZone(p)}else return Ot.invalid(new pi("unparsable",`the input "${l}" can't be parsed as ${r}`))}function rc(e,t,n=!0){return e.isValid?_r.create(un.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Bu(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Kn(e.c.year,n?6:4),t?(r+="-",r+=Kn(e.c.month),r+="-",r+=Kn(e.c.day)):(r+=Kn(e.c.month),r+=Kn(e.c.day)),r}function Jg(e,t,n,r,l,d){let f=Kn(e.c.hour);return t?(f+=":",f+=Kn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(f+=":")):f+=Kn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(f+=Kn(e.c.second),(e.c.millisecond!==0||!r)&&(f+=".",f+=Kn(e.c.millisecond,3))),l&&(e.isOffsetFixed&&e.offset===0&&!d?f+="Z":e.o<0?(f+="-",f+=Kn(Math.trunc(-e.o/60)),f+=":",f+=Kn(Math.trunc(-e.o%60))):(f+="+",f+=Kn(Math.trunc(e.o/60)),f+=":",f+=Kn(Math.trunc(e.o%60)))),d&&(f+="["+e.zone.ianaName+"]"),f}const r_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Qv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},eS={ordinal:1,hour:0,minute:0,second:0,millisecond:0},i_=["year","month","day","hour","minute","second","millisecond"],tS=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],nS=["year","ordinal","hour","minute","second","millisecond"];function rS(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new sm(e);return t}function Xg(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return rS(e)}}function iS(e){return ac[e]||(lc===void 0&&(lc=Rn.now()),ac[e]=e.offset(lc)),ac[e]}function Qg(e,t){const n=Es(t.zone,Rn.defaultZone);if(!n.isValid)return Ot.invalid(na(n));const r=un.fromObject(t);let l,d;if(Lt(e.year))l=Rn.now();else{for(const _ of i_)Lt(e[_])&&(e[_]=r_[_]);const f=Am(e)||Mm(e);if(f)return Ot.invalid(f);const p=iS(n);[l,d]=oc(e,p,n)}return new Ot({ts:l,zone:n,loc:r,o:d})}function ep(e,t,n){const r=Lt(n.round)?!0:n.round,l=(f,p)=>(f=Ld(f,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(f,p)),d=f=>n.calendary?t.hasSame(e,f)?0:t.startOf(f).diff(e.startOf(f),f).get(f):t.diff(e,f).get(f);if(n.unit)return l(d(n.unit),n.unit);for(const f of n.units){const p=d(f);if(Math.abs(p)>=1)return l(p,f)}return l(e>t?-0:0,n.units[n.units.length-1])}function tp(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let lc,ac={};class Ot{constructor(t){const n=t.zone||Rn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new pi("invalid input"):null)||(n.isValid?null:na(n));this.ts=Lt(t.ts)?Rn.now():t.ts;let l=null,d=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[l,d]=[t.old.c,t.old.o];else{const p=xs(t.o)&&!t.old?t.o:n.offset(this.ts);l=nc(this.ts,p),r=Number.isNaN(l.year)?new pi("invalid input"):null,l=r?null:l,d=r?null:p}this._zone=n,this.loc=t.loc||un.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=l,this.o=d,this.isLuxonDateTime=!0}static now(){return new Ot({})}static local(){const[t,n]=tp(arguments),[r,l,d,f,p,_,T]=n;return Qg({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:T},t)}static utc(){const[t,n]=tp(arguments),[r,l,d,f,p,_,T]=n;return t.zone=vr.utcInstance,Qg({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:T},t)}static fromJSDate(t,n={}){const r=Lx(t)?t.valueOf():NaN;if(Number.isNaN(r))return Ot.invalid("invalid input");const l=Es(n.zone,Rn.defaultZone);return l.isValid?new Ot({ts:r,zone:l,loc:un.fromObject(n)}):Ot.invalid(na(l))}static fromMillis(t,n={}){if(xs(t))return t<-864e13||t>Xv?Ot.invalid("Timestamp out of range"):new Ot({ts:t,zone:Es(n.zone,Rn.defaultZone),loc:un.fromObject(n)});throw new mr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(xs(t))return new Ot({ts:t*1e3,zone:Es(n.zone,Rn.defaultZone),loc:un.fromObject(n)});throw new mr("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Es(n.zone,Rn.defaultZone);if(!r.isValid)return Ot.invalid(na(r));const l=un.fromObject(n),d=mc(t,Xg),{minDaysInFirstWeek:f,startOfWeek:p}=Hg(d,l),_=Rn.now(),T=Lt(n.specificOffset)?r.offset(_):n.specificOffset,E=!Lt(d.ordinal),S=!Lt(d.year),w=!Lt(d.month)||!Lt(d.day),M=S||w,m=d.weekYear||d.weekNumber;if((M||E)&&m)throw new qo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&E)throw new qo("Can't mix ordinal dates with month/day");const v=m||d.weekday&&!M;let k,G,I=nc(_,T);v?(k=tS,G=Qv,I=gc(I,f,p)):E?(k=nS,G=eS,I=Iu(I)):(k=i_,G=r_);let P=!1;for(const z of k){const q=d[z];Lt(q)?P?d[z]=G[z]:d[z]=I[z]:P=!0}const H=v?Mx(d,f,p):E?Rx(d):Am(d),j=H||Mm(d);if(j)return Ot.invalid(j);const re=v?Fg(d,f,p):E?Bg(d):d,[te,ce]=oc(re,T,r),V=new Ot({ts:te,zone:r,o:ce,loc:l});return d.weekday&&M&&t.weekday!==V.weekday?Ot.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${V.toISO()}`):V.isValid?V:Ot.invalid(V.invalid)}static fromISO(t,n={}){const[r,l]=Tv(t);return Yo(r,l,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,l]=xv(t);return Yo(r,l,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,l]=vv(t);return Yo(r,l,n,"HTTP",n)}static fromFormat(t,n,r={}){if(Lt(t)||Lt(n))throw new mr("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:d=null}=r,f=un.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0}),[p,_,T,E]=Jv(f,t,n);return E?Ot.invalid(E):Yo(p,_,r,`format ${n}`,t,T)}static fromString(t,n,r={}){return Ot.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,l]=Rv(t);return Yo(r,l,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new mr("need to specify a reason the DateTime is invalid");const r=t instanceof pi?t:new pi(t,n);if(Rn.throwOnInvalid)throw new rx(r);return new Ot({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=t_(t,un.fromObject(n));return r?r.map(l=>l?l.val:null).join(""):null}static expandFormat(t,n={}){return Xm(_r.parseFormat(t),un.fromObject(n)).map(l=>l.val).join("")}static resetCache(){lc=void 0,ac={}}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?$u(this).weekYear:NaN}get weekNumber(){return this.isValid?$u(this).weekNumber:NaN}get weekday(){return this.isValid?$u(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Fu(this).weekday:NaN}get localWeekNumber(){return this.isValid?Fu(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Fu(this).weekYear:NaN}get ordinal(){return this.isValid?Iu(this.c).ordinal:NaN}get monthShort(){return this.isValid?ec.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?ec.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?ec.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?ec.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,r=xc(this.c),l=this.zone.offset(r-t),d=this.zone.offset(r+t),f=this.zone.offset(r-l*n),p=this.zone.offset(r-d*n);if(f===p)return[this];const _=r-f*n,T=r-p*n,E=nc(_,f),S=nc(T,p);return E.hour===S.hour&&E.minute===S.minute&&E.second===S.second&&E.millisecond===S.millisecond?[eo(this,{ts:_}),eo(this,{ts:T})]:[this]}get isInLeapYear(){return ua(this.year)}get daysInMonth(){return pc(this.year,this.month)}get daysInYear(){return this.isValid?Zo(this.year):NaN}get weeksInWeekYear(){return this.isValid?aa(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?aa(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:l}=_r.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:l}}toUTC(t=0,n={}){return this.setZone(vr.instance(t),n)}toLocal(){return this.setZone(Rn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Es(t,Rn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let l=this.ts;if(n||r){const d=t.offset(this.ts),f=this.toObject();[l]=oc(f,d,t)}return eo(this,{ts:l,zone:t})}else return Ot.invalid(na(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const l=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return eo(this,{loc:l})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=mc(t,Xg),{minDaysInFirstWeek:r,startOfWeek:l}=Hg(n,this.loc),d=!Lt(n.weekYear)||!Lt(n.weekNumber)||!Lt(n.weekday),f=!Lt(n.ordinal),p=!Lt(n.year),_=!Lt(n.month)||!Lt(n.day),T=p||_,E=n.weekYear||n.weekNumber;if((T||f)&&E)throw new qo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(_&&f)throw new qo("Can't mix ordinal dates with month/day");let S;d?S=Fg({...gc(this.c,r,l),...n},r,l):Lt(n.ordinal)?(S={...this.toObject(),...n},Lt(n.day)&&(S.day=Math.min(pc(S.year,S.month),S.day))):S=Bg({...Iu(this.c),...n});const[w,M]=oc(S,this.o,this.zone);return eo(this,{ts:w,o:M})}plus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t);return eo(this,Zg(this,n))}minus(t){if(!this.isValid)return this;const n=Qt.fromDurationLike(t).negate();return eo(this,Zg(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},l=Qt.normalizeUnit(t);switch(l){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(l==="weeks")if(n){const d=this.loc.getStartOfWeek(),{weekday:f}=this;f<d&&(r.weekNumber=this.weekNumber-1),r.weekday=d}else r.weekday=1;if(l==="quarters"){const d=Math.ceil(this.month/3);r.month=(d-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?_r.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Pu}toLocaleString(t=hc,n={}){return this.isValid?_r.create(this.loc.clone(n),t).formatDateTime(this):Pu}toLocaleParts(t={}){return this.isValid?_r.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:l=!0,extendedZone:d=!1}={}){if(!this.isValid)return null;const f=t==="extended";let p=Bu(this,f);return p+="T",p+=Jg(this,f,n,r,l,d),p}toISODate({format:t="extended"}={}){return this.isValid?Bu(this,t==="extended"):null}toISOWeekDate(){return rc(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:l=!1,extendedZone:d=!1,format:f="extended"}={}){return this.isValid?(l?"T":"")+Jg(this,f==="extended",n,t,r,d):null}toRFC2822(){return rc(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return rc(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Bu(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let l="HH:mm:ss.SSS";return(n||t)&&(r&&(l+=" "),n?l+="z":t&&(l+="ZZ")),rc(this,l,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Pu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Qt.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=Ix(n).map(Qt.normalizeUnit),f=t.valueOf()>this.valueOf(),p=f?this:t,_=f?t:this,T=Fv(p,_,d,l);return f?T.negate():T}diffNow(t="milliseconds",n={}){return this.diff(Ot.now(),t,n)}until(t){return this.isValid?Mn.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const l=t.valueOf(),d=this.setZone(t.zone,{keepLocalTime:!0});return d.startOf(n,r)<=l&&l<=d.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||Ot.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let l=["years","months","days","hours","minutes","seconds"],d=t.unit;return Array.isArray(t.unit)&&(l=t.unit,d=void 0),ep(n,this.plus(r),{...t,numeric:"always",units:l,unit:d})}toRelativeCalendar(t={}){return this.isValid?ep(t.base||Ot.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(Ot.isDateTime))throw new mr("min requires all arguments be DateTimes");return Wg(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(Ot.isDateTime))throw new mr("max requires all arguments be DateTimes");return Wg(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:l=null,numberingSystem:d=null}=r,f=un.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0});return e_(f,t,n)}static fromStringExplain(t,n,r={}){return Ot.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:l=null}=n,d=un.fromOpts({locale:r,numberingSystem:l,defaultToEN:!0});return new Qm(d,t)}static fromFormatParser(t,n,r={}){if(Lt(t)||Lt(n))throw new mr("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:d=null}=r,f=un.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0});if(!f.equals(n.locale))throw new mr(`fromFormatParser called with a locale of ${f}, but the format parser was created for ${n.locale}`);const{result:p,zone:_,specificOffset:T,invalidReason:E}=n.explainFromTokens(t);return E?Ot.invalid(E):Yo(p,_,r,`format ${n.format}`,t,T)}static get DATE_SHORT(){return hc}static get DATE_MED(){return om}static get DATE_MED_WITH_WEEKDAY(){return ox}static get DATE_FULL(){return lm}static get DATE_HUGE(){return am}static get TIME_SIMPLE(){return cm}static get TIME_WITH_SECONDS(){return um}static get TIME_WITH_SHORT_OFFSET(){return dm}static get TIME_WITH_LONG_OFFSET(){return fm}static get TIME_24_SIMPLE(){return hm}static get TIME_24_WITH_SECONDS(){return gm}static get TIME_24_WITH_SHORT_OFFSET(){return pm}static get TIME_24_WITH_LONG_OFFSET(){return mm}static get DATETIME_SHORT(){return _m}static get DATETIME_SHORT_WITH_SECONDS(){return ym}static get DATETIME_MED(){return Nm}static get DATETIME_MED_WITH_SECONDS(){return Cm}static get DATETIME_MED_WITH_WEEKDAY(){return lx}static get DATETIME_FULL(){return Em}static get DATETIME_FULL_WITH_SECONDS(){return Tm}static get DATETIME_HUGE(){return xm}static get DATETIME_HUGE_WITH_SECONDS(){return vm}}function Xl(e){if(Ot.isDateTime(e))return e;if(e&&e.valueOf&&xs(e.valueOf()))return Ot.fromJSDate(e);if(e&&typeof e=="object")return Ot.fromObject(e);throw new mr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}var ln=(e=>(e.Monday="MONDAY",e.Tuesday="TUESDAY",e.Wednesday="WEDNESDAY",e.Thursday="THURSDAY",e.Friday="FRIDAY",e.Saturday="SATURDAY",e.Sunday="SUNDAY",e))(ln||{});function $d(e){const t={1:ln.Monday,2:ln.Tuesday,3:ln.Wednesday,4:ln.Thursday,5:ln.Friday,6:ln.Saturday,7:ln.Sunday};if(e.weekday in t)return t[e.weekday];throw new Error(`Invalid DateTime.weekday property: ${e}, ${e.weekday}`)}function Di(e){return{[ln.Monday]:"Monday",[ln.Tuesday]:"Tuesday",[ln.Wednesday]:"Wednesday",[ln.Thursday]:"Thursday",[ln.Friday]:"Friday",[ln.Saturday]:"Saturday",[ln.Sunday]:"Sunday"}[e]}class np{constructor(t,n,r){Ie(this,"end");Ie(this,"start");this.end=t.setZone(r),this.start=t.setZone(r),[n.start,n.end].forEach(T=>{if(T.split(":").length!==2)throw new Error('expected interval start and end data to be in the format "HH:MM"')});const[l,d]=n.start.split(":"),[f,p]=n.end.split(":");let _=0;f<l&&(_=1),this.end=this.end.set({hour:Number(f),minute:Number(p),day:this.end.day+_}),this.start=this.start.set({hour:Number(l),minute:Number(d)}),this.end.minute===59&&(this.end=this.end.set({minute:60}))}contains(t){return this.start<=t&&t<this.end}getStartTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.start.setLocale(t||"en-US").toLocaleString(r)}getEndTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.end.setLocale(t||"en-US").toLocaleString(r)}timeIsEqualTo(t){const n=this.getStartTime()===t.getStartTime(),r=this.getEndTime()===t.getEndTime();return n&&r}is24h(){const t=this.start.minute===0&&this.start.hour===0,n=this.end.minute===0&&this.end.hour===0,r=this.end.day-this.start.day===1||this.end.day===1;return t&&n&&r}}class s_{constructor(t,n){Ie(this,"holidayHoursByDate");Ie(this,"hours");Ie(this,"timezone");this.holidayHoursByDate=Object.fromEntries((t.holidayHours||[]).map(r=>[r.date,r])),this.hours=t,this.timezone=n}getInterval(t){if(this.isTemporarilyClosedAt(t))return null;let n=t;n=n.minus({days:1});for(const r of[n,t]){const l=this.getHours(r);if(l&&!l.isClosed)for(const d of l.openIntervals||[]){const f=new np(r,d,this.timezone);if(f.contains(t))return f}}return null}getCurrentInterval(){return this.getInterval(Ot.now())}getIntervalAfter(t){const n=this.getIntervalsForNDays(8,t),r=(d,f)=>d.start===f.start?0:d.start>f.start?1:-1,l=n.sort(r);for(const[d,f]of l.entries())if(f.contains(t)&&l.length>d+1)return l[d+1];for(const d of l)if(d.start>t)return d;return null}getIntervalsForNDays(t,n){const r=[];for(let l=0;l<t;l++){let d=n;d=d.plus({days:l});const f=this.getHours(d);f&&!f.isClosed&&r.push(...f.openIntervals.map(p=>new np(d,p,this.timezone)))}return r}getHolidayHours(t){return this.isTemporarilyClosedAt(t)?null:this.holidayHoursByDate[(t.toISO()||"").replace(/T.*/,"")]||null}getNormalHours(t){if(this.isTemporarilyClosedAt(t))return null;const n=Di($d(t)).toLowerCase();return this.hours[n]}getHours(t){const n=this.getHolidayHours(t);return!n||n.isRegularHours?this.getNormalHours(t):n}getNextInterval(){return this.getIntervalAfter(Ot.now())}isHoliday(t){return!!this.getHolidayHours(t)}isTemporarilyClosedAt(t){if(!this.hours.reopenDate)return!1;const n=this.hours.reopenDate.split("-");if(n.length===3){const[r,l,d]=n,f=Ot.fromObject({year:Number(r),month:Number(l),day:Number(d)},{zone:this.timezone});if(t<f)return!0}return!1}isOpenAt(t){return this.isTemporarilyClosedAt(t)?!1:!!this.getInterval(t)}isOpenNow(){return this.isOpenAt(Ot.now())}}function sS(e,t){const n=[...e];return t=t%n.length,n.concat(n.splice(0,n.length-t))}function oS(e,t){if(e.length!==t.length)return!1;for(const[n,r]of e.entries())if(!r.timeIsEqualTo(t[n]))return!1;return!0}function ha(e){var t,n;return((n=(t=e==null?void 0:e.currentInterval)==null?void 0:t.is24h)==null?void 0:n.call(t))||!1}function ga(e){return!e.futureInterval}function lS(e){return ha(e)?at.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):ga(e)?at.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):at.jsx("span",{className:"HoursStatus-current",children:e.isOpen?"Open Now":"Closed"})}function aS(e){return ha(e)||ga(e)?null:at.jsx("span",{className:"HoursStatus-separator",children:" • "})}function cS(e){return ha(e)||ga(e)?null:at.jsx("span",{className:"HoursStatus-future",children:e.isOpen?"Closes at":"Opens at"})}function uS(e){if(ha(e)||ga(e))return null;let t="";if(e.isOpen){const n=e.currentInterval;t+=n?n.getEndTime("en-US",e.timeOptions):""}else{const n=e.futureInterval;t+=n?n.getStartTime("en-US",e.timeOptions):""}return at.jsxs("span",{className:"HoursStatus-time",children:[" ",t]})}function dS(e){var r,l;if(ha(e)||ga(e))return null;const t={weekday:"long",...e.dayOptions??{}};let n="";if(e.isOpen){const d=e.currentInterval;n+=((r=d==null?void 0:d.end)==null?void 0:r.setLocale("en-US").toLocaleString(t))||""}else{const d=e.futureInterval;n+=((l=d==null?void 0:d.start)==null?void 0:l.setLocale("en-US").toLocaleString(t))||""}return at.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function fS(e,t){const n=e.currentTemplate||lS,r=e.separatorTemplate||aS,l=e.futureTemplate||cS,d=e.timeTemplate||uS,f=e.dayOfWeekTemplate||dS;return at.jsxs("div",{className:Qo("HoursStatus",(t==null?void 0:t.className)||""),children:[n(e),r(e),l(e),d(e),f(e)]})}const hS={minHeight:`${1.5}em`},gS=e=>{const[t,n]=nt.useState(!1),[r,l]=nt.useState(!1);nt.useEffect(()=>{l(!0)},[]);const d=e.statusTemplate||fS,f=new s_(e.hours,e.timezone),p=f.isOpenNow(),_=f.getCurrentInterval(),T=f.getNextInterval(),E=(_==null?void 0:_.end)||(T==null?void 0:T.start);if(E&&!t){n(!0);const w=E.toMillis()-Ot.now().toMillis();setTimeout(()=>n(!1),w)}const S={isOpen:p,currentInterval:_,futureInterval:T,...e};return at.jsx(at.Fragment,{children:r?d(S,e):at.jsx("div",{style:hS})})};function pS(e,t){const n=[];return e.forEach(r=>{const l=n[n.length-1];l?oS(l.intervals,r.intervals)?(l.endDay=r.endDay,l.isToday=l.isToday||r.isToday):n.push({...r}):n.push({...r})}),n.map(r=>{const l=t&&Di(r.startDay)in t?t[Di(r.startDay)]||"":Di(r.startDay),d=t&&Di(r.endDay)in t?t[Di(r.endDay)]||"":Di(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${l}`:`${l} - ${d}`}})}function mS(e,t){const n=[],r=e.intervals.length>0&&e.intervals[0].is24h();return e.intervals.length===0?n.push("Closed"):r?n.push("Open 24 hours"):e.intervals.forEach(l=>{const d=l.getStartTime("en-US",t),f=l.getEndTime("en-US",t);n.push(`${d} - ${f}`)}),n}function _S(e,t,n){const r=[];for(let l=1;l<=7;l++){const d=Ot.fromObject({weekday:l}),f=$d(d);r.push({startDay:f,endDay:f,dayName:n&&Di(f).toLowerCase()in n?n[Di(f).toLowerCase()]||"":Di(f),intervals:e.filter(p=>p.start.weekday===l),isToday:t.weekday===l})}return r}const yS=e=>{const[t,n]=nt.useState(!1);nt.useEffect(()=>{n(!0)},[]);const r=new s_(e.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),l=Ot.now(),d=r.getIntervalsForNDays(7,l);let f=_S(d,l,e.dayOfWeekNames);function p(S){return S?{today:$d(l),monday:ln.Monday,tuesday:ln.Tuesday,wednesday:ln.Wednesday,thursday:ln.Thursday,friday:ln.Friday,saturday:ln.Saturday,sunday:ln.Sunday}[S]:ln.Sunday}let _=[ln.Sunday,ln.Monday,ln.Tuesday,ln.Wednesday,ln.Thursday,ln.Friday,ln.Saturday];const T=_.indexOf(p(e.startOfWeek));_=sS(_,7-T),f.sort((S,w)=>_.indexOf(S.startDay)-_.indexOf(w.startDay)),e.collapseDays&&(f=pS(f,e.dayOfWeekNames));const E=nt.useMemo(()=>({minHeight:`${f.length*1.5}em`}),[f.length]);return at.jsx(at.Fragment,{children:t?at.jsx("div",{className:Qo("HoursTable",e.className),children:f.map(S=>{const M=(e.intervalStringsBuilderFn||mS)(S,e.timeOptions);return at.jsxs("div",{className:Qo("HoursTable-row",{"is-today":S.isToday}),children:[at.jsx("span",{className:"HoursTable-day",children:S.dayName}),at.jsx("span",{className:"HoursTable-intervals",children:M.map((m,v)=>at.jsx("span",{className:"HoursTable-interval",children:m},v))})]},S.dayName)})}):at.jsx("div",{style:E})})},NS=e=>`<script type="application/ld+json">
|
|
109
|
+
`}),n}const QT=(e,t)=>e(t,"i",ns(e,t)),ex=(e,t)=>e(t,"b",ns(e,t)),tx=(e,t)=>e(t,"u",ns(e,t)),nx=(e,t)=>e(t,"s",ns(e,t)),rx=(e,t)=>e(t,"sub",ns(e,t)),ix=(e,t)=>e(t,"sup",ns(e,t)),sx={emphasis:QT,strong:ex,underline:tx,strikethrough:nx,subscript:rx,superscript:ix},ox=e=>{const[t,n]=rt.useState();let r;return rt.useEffect(()=>{(async()=>{if(!r)try{r=(await Promise.resolve().then(()=>require("./index-CrwrCh_K.cjs"))).default}catch{throw new Error("Failed to import React Markdown, cannot properly render LegacyRichText.")}const d=r({children:e.markdown,remarkPlugins:[uT],remarkRehypeOptions:{handlers:sx}});n(d)})()},[e.markdown]),t||null};class uo extends Error{}class lx extends uo{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class ax extends uo{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class cx extends uo{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Zo extends uo{}class am extends uo{constructor(t){super(`Invalid unit ${t}`)}}class mr extends uo{}class _s extends uo{constructor(){super("Zone is an abstract class")}}const at="numeric",mi="short",Yr="long",gc={year:at,month:at,day:at},cm={year:at,month:mi,day:at},ux={year:at,month:mi,day:at,weekday:mi},um={year:at,month:Yr,day:at},dm={year:at,month:Yr,day:at,weekday:Yr},fm={hour:at,minute:at},hm={hour:at,minute:at,second:at},gm={hour:at,minute:at,second:at,timeZoneName:mi},pm={hour:at,minute:at,second:at,timeZoneName:Yr},mm={hour:at,minute:at,hourCycle:"h23"},_m={hour:at,minute:at,second:at,hourCycle:"h23"},ym={hour:at,minute:at,second:at,hourCycle:"h23",timeZoneName:mi},Nm={hour:at,minute:at,second:at,hourCycle:"h23",timeZoneName:Yr},Cm={year:at,month:at,day:at,hour:at,minute:at},Em={year:at,month:at,day:at,hour:at,minute:at,second:at},Tm={year:at,month:mi,day:at,hour:at,minute:at},xm={year:at,month:mi,day:at,hour:at,minute:at,second:at},dx={year:at,month:mi,day:at,weekday:mi,hour:at,minute:at},vm={year:at,month:Yr,day:at,hour:at,minute:at,timeZoneName:mi},Sm={year:at,month:Yr,day:at,hour:at,minute:at,second:at,timeZoneName:mi},wm={year:at,month:Yr,day:at,weekday:Yr,hour:at,minute:at,timeZoneName:Yr},Om={year:at,month:Yr,day:at,weekday:Yr,hour:at,minute:at,second:at,timeZoneName:Yr};class ua{get type(){throw new _s}get name(){throw new _s}get ianaName(){return this.name}get isUniversal(){throw new _s}offsetName(t,n){throw new _s}formatOffset(t,n){throw new _s}offset(t){throw new _s}equals(t){throw new _s}get isValid(){throw new _s}}let ku=null;class xc extends ua{static get instance(){return ku===null&&(ku=new xc),ku}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Pm(t,n,r)}formatOffset(t,n){return oa(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let oc={};function fx(e){return oc[e]||(oc[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),oc[e]}const hx={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function gx(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,l,d,f,p,_,E,T]=r;return[f,l,d,p,_,E,T]}function px(e,t){const n=e.formatToParts(t),r=[];for(let l=0;l<n.length;l++){const{type:d,value:f}=n[l],p=hx[d];d==="era"?r[p]=f:Lt(p)||(r[p]=parseInt(f,10))}return r}let Qa={};class ts extends ua{static create(t){return Qa[t]||(Qa[t]=new ts(t)),Qa[t]}static resetCache(){Qa={},oc={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=ts.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Pm(t,n,r,this.name)}formatOffset(t,n){return oa(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=fx(this.name);let[l,d,f,p,_,E,T]=r.formatToParts?px(r,n):gx(r,n);p==="BC"&&(l=-Math.abs(l)+1);const w=Sc({year:l,month:d,day:f,hour:_===24?0:_,minute:E,second:T,millisecond:0});let O=+n;const m=O%1e3;return O-=m>=0?m:1e3+m,(w-O)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Rg={};function mx(e,t={}){const n=JSON.stringify([e,t]);let r=Rg[n];return r||(r=new Intl.ListFormat(e,t),Rg[n]=r),r}let td={};function nd(e,t={}){const n=JSON.stringify([e,t]);let r=td[n];return r||(r=new Intl.DateTimeFormat(e,t),td[n]=r),r}let rd={};function _x(e,t={}){const n=JSON.stringify([e,t]);let r=rd[n];return r||(r=new Intl.NumberFormat(e,t),rd[n]=r),r}let id={};function yx(e,t={}){const{base:n,...r}=t,l=JSON.stringify([e,r]);let d=id[l];return d||(d=new Intl.RelativeTimeFormat(e,t),id[l]=d),d}let ta=null;function Nx(){return ta||(ta=new Intl.DateTimeFormat().resolvedOptions().locale,ta)}let bg={};function Cx(e){let t=bg[e];if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,bg[e]=t}return t}function Ex(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,l;try{r=nd(e).resolvedOptions(),l=e}catch{const _=e.substring(0,n);r=nd(_).resolvedOptions(),l=_}const{numberingSystem:d,calendar:f}=r;return[l,d,f]}}function Tx(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function xx(e){const t=[];for(let n=1;n<=12;n++){const r=vt.utc(2009,n,1);t.push(e(r))}return t}function vx(e){const t=[];for(let n=1;n<=7;n++){const r=vt.utc(2016,11,13+n);t.push(e(r))}return t}function ec(e,t,n,r){const l=e.listingMode();return l==="error"?null:l==="en"?n(t):r(t)}function Sx(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class wx{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:l,floor:d,...f}=r;if(!n||Object.keys(f).length>0){const p={useGrouping:!1,...r};r.padTo>0&&(p.minimumIntegerDigits=r.padTo),this.inf=_x(t,p)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):Fd(t,3);return Kn(n,this.padTo)}}}class Ox{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const f=-1*(t.offset/60),p=f>=0?`Etc/GMT+${f}`:`Etc/GMT${f}`;t.offset!==0&&ts.create(p).valid?(l=p,this.dt=t):(l="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,l=t.zone.name):(l="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const d={...this.opts};d.timeZone=d.timeZone||l,this.dtf=nd(n,d)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class Dx{constructor(t,n,r){this.opts={style:"long",...r},!n&&Im()&&(this.rtf=yx(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):Jx(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const Ax={firstDay:1,minimalDays:4,weekend:[6,7]};class un{static fromOpts(t){return un.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,l,d=!1){const f=t||Rn.defaultLocale,p=f||(d?"en-US":Nx()),_=n||Rn.defaultNumberingSystem,E=r||Rn.defaultOutputCalendar,T=sd(l)||Rn.defaultWeekSettings;return new un(p,_,E,T,f)}static resetCache(){ta=null,td={},rd={},id={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:l}={}){return un.create(t,n,r,l)}constructor(t,n,r,l,d){const[f,p,_]=Ex(t);this.locale=f,this.numberingSystem=n||p||null,this.outputCalendar=r||_||null,this.weekSettings=l,this.intl=Tx(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=d,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Sx(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:un.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,sd(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return ec(this,t,Bm,()=>{const r=n?{month:t,day:"numeric"}:{month:t},l=n?"format":"standalone";return this.monthsCache[l][t]||(this.monthsCache[l][t]=xx(d=>this.extract(d,r,"month"))),this.monthsCache[l][t]})}weekdays(t,n=!1){return ec(this,t,Km,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},l=n?"format":"standalone";return this.weekdaysCache[l][t]||(this.weekdaysCache[l][t]=vx(d=>this.extract(d,r,"weekday"))),this.weekdaysCache[l][t]})}meridiems(){return ec(this,void 0,()=>zm,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[vt.utc(2016,11,13,9),vt.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return ec(this,t,Um,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[vt.utc(-40,1,1),vt.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const l=this.dtFormatter(t,n),d=l.formatToParts(),f=d.find(p=>p.type.toLowerCase()===r);return f?f.value:null}numberFormatter(t={}){return new wx(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new Ox(t,this.intl,n)}relFormatter(t={}){return new Dx(this.intl,this.isEnglish(),t)}listFormatter(t={}){return mx(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:km()?Cx(this.locale):Ax}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let Pu=null;class vr extends ua{static get utcInstance(){return Pu===null&&(Pu=new vr(0)),Pu}static instance(t){return t===0?vr.utcInstance:new vr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new vr(wc(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${oa(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${oa(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return oa(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class Mx extends ua{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Cs(e,t){if(Lt(e)||e===null)return t;if(e instanceof ua)return e;if(Px(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?xc.instance:n==="utc"||n==="gmt"?vr.utcInstance:vr.parseSpecifier(n)||ts.create(e)}else return Ts(e)?vr.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new Mx(e)}const Id={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Lg={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Rx=Id.hanidec.replace(/[\[|\]]/g,"").split("");function bx(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(Id.hanidec)!==-1)t+=Rx.indexOf(e[n]);else for(const l in Lg){const[d,f]=Lg[l];r>=d&&r<=f&&(t+=r-d)}}return parseInt(t,10)}else return t}let qo={};function Lx(){qo={}}function hi({numberingSystem:e},t=""){const n=e||"latn";return qo[n]||(qo[n]={}),qo[n][t]||(qo[n][t]=new RegExp(`${Id[n]}${t}`)),qo[n][t]}let Ig=()=>Date.now(),kg="system",Pg=null,$g=null,Fg=null,Bg=60,Hg,Wg=null;class Rn{static get now(){return Ig}static set now(t){Ig=t}static set defaultZone(t){kg=t}static get defaultZone(){return Cs(kg,xc.instance)}static get defaultLocale(){return Pg}static set defaultLocale(t){Pg=t}static get defaultNumberingSystem(){return $g}static set defaultNumberingSystem(t){$g=t}static get defaultOutputCalendar(){return Fg}static set defaultOutputCalendar(t){Fg=t}static get defaultWeekSettings(){return Wg}static set defaultWeekSettings(t){Wg=sd(t)}static get twoDigitCutoffYear(){return Bg}static set twoDigitCutoffYear(t){Bg=t%100}static get throwOnInvalid(){return Hg}static set throwOnInvalid(t){Hg=t}static resetCaches(){un.resetCache(),ts.resetCache(),vt.resetCache(),Lx()}}class pi{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Dm=[0,31,59,90,120,151,181,212,243,273,304,334],Am=[0,31,60,91,121,152,182,213,244,274,305,335];function ei(e,t){return new pi("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function kd(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const l=r.getUTCDay();return l===0?7:l}function Mm(e,t,n){return n+(da(e)?Am:Dm)[t-1]}function Rm(e,t){const n=da(e)?Am:Dm,r=n.findIndex(d=>d<t),l=t-n[r];return{month:r+1,day:l}}function Pd(e,t){return(e-t+7)%7+1}function pc(e,t=4,n=1){const{year:r,month:l,day:d}=e,f=Mm(r,l,d),p=Pd(kd(r,l,d),n);let _=Math.floor((f-p+14-t)/7),E;return _<1?(E=r-1,_=ca(E,t,n)):_>ca(r,t,n)?(E=r+1,_=1):E=r,{weekYear:E,weekNumber:_,weekday:p,...Oc(e)}}function Kg(e,t=4,n=1){const{weekYear:r,weekNumber:l,weekday:d}=e,f=Pd(kd(r,1,t),n),p=Jo(r);let _=l*7+d-f-7+t,E;_<1?(E=r-1,_+=Jo(E)):_>p?(E=r+1,_-=Jo(r)):E=r;const{month:T,day:S}=Rm(E,_);return{year:E,month:T,day:S,...Oc(e)}}function $u(e){const{year:t,month:n,day:r}=e,l=Mm(t,n,r);return{year:t,ordinal:l,...Oc(e)}}function zg(e){const{year:t,ordinal:n}=e,{month:r,day:l}=Rm(t,n);return{year:t,month:r,day:l,...Oc(e)}}function Ug(e,t){if(!Lt(e.localWeekday)||!Lt(e.localWeekNumber)||!Lt(e.localWeekYear)){if(!Lt(e.weekday)||!Lt(e.weekNumber)||!Lt(e.weekYear))throw new Zo("Cannot mix locale-based week fields with ISO-based week fields");return Lt(e.localWeekday)||(e.weekday=e.localWeekday),Lt(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Lt(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Ix(e,t=4,n=1){const r=vc(e.weekYear),l=ti(e.weekNumber,1,ca(e.weekYear,t,n)),d=ti(e.weekday,1,7);return r?l?d?!1:ei("weekday",e.weekday):ei("week",e.weekNumber):ei("weekYear",e.weekYear)}function kx(e){const t=vc(e.year),n=ti(e.ordinal,1,Jo(e.year));return t?n?!1:ei("ordinal",e.ordinal):ei("year",e.year)}function bm(e){const t=vc(e.year),n=ti(e.month,1,12),r=ti(e.day,1,mc(e.year,e.month));return t?n?r?!1:ei("day",e.day):ei("month",e.month):ei("year",e.year)}function Lm(e){const{hour:t,minute:n,second:r,millisecond:l}=e,d=ti(t,0,23)||t===24&&n===0&&r===0&&l===0,f=ti(n,0,59),p=ti(r,0,59),_=ti(l,0,999);return d?f?p?_?!1:ei("millisecond",l):ei("second",r):ei("minute",n):ei("hour",t)}function Lt(e){return typeof e>"u"}function Ts(e){return typeof e=="number"}function vc(e){return typeof e=="number"&&e%1===0}function Px(e){return typeof e=="string"}function $x(e){return Object.prototype.toString.call(e)==="[object Date]"}function Im(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function km(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function Fx(e){return Array.isArray(e)?e:[e]}function Gg(e,t,n){if(e.length!==0)return e.reduce((r,l)=>{const d=[t(l),l];return r&&n(r[0],d[0])===r[0]?r:d},null)[1]}function Bx(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function el(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function sd(e){if(e==null)return null;if(typeof e!="object")throw new mr("Week settings must be an object");if(!ti(e.firstDay,1,7)||!ti(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ti(t,1,7)))throw new mr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ti(e,t,n){return vc(e)&&e>=t&&e<=n}function Hx(e,t){return e-t*Math.floor(e/t)}function Kn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Ns(e){if(!(Lt(e)||e===null||e===""))return parseInt(e,10)}function Xs(e){if(!(Lt(e)||e===null||e===""))return parseFloat(e)}function $d(e){if(!(Lt(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function Fd(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function da(e){return e%4===0&&(e%100!==0||e%400===0)}function Jo(e){return da(e)?366:365}function mc(e,t){const n=Hx(t-1,12)+1,r=e+(t-n)/12;return n===2?da(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Sc(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Yg(e,t,n){return-Pd(kd(e,1,t),n)+t-1}function ca(e,t=4,n=1){const r=Yg(e,t,n),l=Yg(e+1,t,n);return(Jo(e)-r+l)/7}function od(e){return e>99?e:e>Rn.twoDigitCutoffYear?1900+e:2e3+e}function Pm(e,t,n,r=null){const l=new Date(e),d={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(d.timeZone=r);const f={timeZoneName:t,...d},p=new Intl.DateTimeFormat(n,f).formatToParts(l).find(_=>_.type.toLowerCase()==="timezonename");return p?p.value:null}function wc(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,l=n<0||Object.is(n,-0)?-r:r;return n*60+l}function $m(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new mr(`Invalid unit value ${e}`);return t}function _c(e,t){const n={};for(const r in e)if(el(e,r)){const l=e[r];if(l==null)continue;n[t(r)]=$m(l)}return n}function oa(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),l=e>=0?"+":"-";switch(t){case"short":return`${l}${Kn(n,2)}:${Kn(r,2)}`;case"narrow":return`${l}${n}${r>0?`:${r}`:""}`;case"techie":return`${l}${Kn(n,2)}${Kn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Oc(e){return Bx(e,["hour","minute","second","millisecond"])}const Wx=["January","February","March","April","May","June","July","August","September","October","November","December"],Fm=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Kx=["J","F","M","A","M","J","J","A","S","O","N","D"];function Bm(e){switch(e){case"narrow":return[...Kx];case"short":return[...Fm];case"long":return[...Wx];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Hm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Wm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],zx=["M","T","W","T","F","S","S"];function Km(e){switch(e){case"narrow":return[...zx];case"short":return[...Wm];case"long":return[...Hm];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const zm=["AM","PM"],Ux=["Before Christ","Anno Domini"],Gx=["BC","AD"],Yx=["B","A"];function Um(e){switch(e){case"narrow":return[...Yx];case"short":return[...Gx];case"long":return[...Ux];default:return null}}function jx(e){return zm[e.hour<12?0:1]}function Vx(e,t){return Km(t)[e.weekday-1]}function qx(e,t){return Bm(t)[e.month-1]}function Zx(e,t){return Um(t)[e.year<0?0:1]}function Jx(e,t,n="always",r=!1){const l={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},d=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&d){const S=e==="days";switch(t){case 1:return S?"tomorrow":`next ${l[e][0]}`;case-1:return S?"yesterday":`last ${l[e][0]}`;case 0:return S?"today":`this ${l[e][0]}`}}const f=Object.is(t,-0)||t<0,p=Math.abs(t),_=p===1,E=l[e],T=r?_?E[1]:E[2]||E[1]:_?l[e][0]:e;return f?`${p} ${T} ago`:`in ${p} ${T}`}function jg(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Xx={D:gc,DD:cm,DDD:um,DDDD:dm,t:fm,tt:hm,ttt:gm,tttt:pm,T:mm,TT:_m,TTT:ym,TTTT:Nm,f:Cm,ff:Tm,fff:vm,ffff:wm,F:Em,FF:xm,FFF:Sm,FFFF:Om};class _r{static create(t,n={}){return new _r(t,n)}static parseFormat(t){let n=null,r="",l=!1;const d=[];for(let f=0;f<t.length;f++){const p=t.charAt(f);p==="'"?(r.length>0&&d.push({literal:l||/^\s+$/.test(r),val:r}),n=null,r="",l=!l):l||p===n?r+=p:(r.length>0&&d.push({literal:/^\s+$/.test(r),val:r}),r=p,n=p)}return r.length>0&&d.push({literal:l||/^\s+$/.test(r),val:r}),d}static macroTokenToFormatOpts(t){return Xx[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Kn(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",d=(O,m)=>this.loc.extract(t,O,m),f=O=>t.isOffsetFixed&&t.offset===0&&O.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,O.format):"",p=()=>r?jx(t):d({hour:"numeric",hourCycle:"h12"},"dayperiod"),_=(O,m)=>r?qx(t,O):d(m?{month:O}:{month:O,day:"numeric"},"month"),E=(O,m)=>r?Vx(t,O):d(m?{weekday:O}:{weekday:O,month:"long",day:"numeric"},"weekday"),T=O=>{const m=_r.macroTokenToFormatOpts(O);return m?this.formatWithSystemDefault(t,m):O},S=O=>r?Zx(t,O):d({era:O},"era"),w=O=>{switch(O){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return f({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return f({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return f({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return p();case"d":return l?d({day:"numeric"},"day"):this.num(t.day);case"dd":return l?d({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return E("short",!0);case"cccc":return E("long",!0);case"ccccc":return E("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return E("short",!1);case"EEEE":return E("long",!1);case"EEEEE":return E("narrow",!1);case"L":return l?d({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return l?d({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return _("short",!0);case"LLLL":return _("long",!0);case"LLLLL":return _("narrow",!0);case"M":return l?d({month:"numeric"},"month"):this.num(t.month);case"MM":return l?d({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return _("short",!1);case"MMMM":return _("long",!1);case"MMMMM":return _("narrow",!1);case"y":return l?d({year:"numeric"},"year"):this.num(t.year);case"yy":return l?d({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return l?d({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return l?d({year:"numeric"},"year"):this.num(t.year,6);case"G":return S("short");case"GG":return S("long");case"GGGGG":return S("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return T(O)}};return jg(_r.parseFormat(n),w)}formatDurationFromString(t,n){const r=_=>{switch(_[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},l=_=>E=>{const T=r(E);return T?this.num(_.get(T),E.length):E},d=_r.parseFormat(n),f=d.reduce((_,{literal:E,val:T})=>E?_:_.concat(T),[]),p=t.shiftTo(...f.map(r).filter(_=>_));return jg(d,l(p))}}const Gm=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function ll(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function al(...e){return t=>e.reduce(([n,r,l],d)=>{const[f,p,_]=d(t,l);return[{...n,...f},p||r,_]},[{},null,1]).slice(0,2)}function cl(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const l=n.exec(e);if(l)return r(l)}return[null,null]}function Ym(...e){return(t,n)=>{const r={};let l;for(l=0;l<e.length;l++)r[e[l]]=Ns(t[n+l]);return[r,null,n+l]}}const jm=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,Qx=`(?:${jm.source}?(?:\\[(${Gm.source})\\])?)?`,Bd=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Vm=RegExp(`${Bd.source}${Qx}`),Hd=RegExp(`(?:T${Vm.source})?`),ev=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,tv=/(\d{4})-?W(\d\d)(?:-?(\d))?/,nv=/(\d{4})-?(\d{3})/,rv=Ym("weekYear","weekNumber","weekDay"),iv=Ym("year","ordinal"),sv=/(\d{4})-(\d\d)-(\d\d)/,qm=RegExp(`${Bd.source} ?(?:${jm.source}|(${Gm.source}))?`),ov=RegExp(`(?: ${qm.source})?`);function Xo(e,t,n){const r=e[t];return Lt(r)?n:Ns(r)}function lv(e,t){return[{year:Xo(e,t),month:Xo(e,t+1,1),day:Xo(e,t+2,1)},null,t+3]}function ul(e,t){return[{hours:Xo(e,t,0),minutes:Xo(e,t+1,0),seconds:Xo(e,t+2,0),milliseconds:$d(e[t+3])},null,t+4]}function fa(e,t){const n=!e[t]&&!e[t+1],r=wc(e[t+1],e[t+2]),l=n?null:vr.instance(r);return[{},l,t+3]}function ha(e,t){const n=e[t]?ts.create(e[t]):null;return[{},n,t+1]}const av=RegExp(`^T?${Bd.source}$`),cv=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function uv(e){const[t,n,r,l,d,f,p,_,E]=e,T=t[0]==="-",S=_&&_[0]==="-",w=(O,m=!1)=>O!==void 0&&(m||O&&T)?-O:O;return[{years:w(Xs(n)),months:w(Xs(r)),weeks:w(Xs(l)),days:w(Xs(d)),hours:w(Xs(f)),minutes:w(Xs(p)),seconds:w(Xs(_),_==="-0"),milliseconds:w($d(E),S)}]}const dv={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Wd(e,t,n,r,l,d,f){const p={year:t.length===2?od(Ns(t)):Ns(t),month:Fm.indexOf(n)+1,day:Ns(r),hour:Ns(l),minute:Ns(d)};return f&&(p.second=Ns(f)),e&&(p.weekday=e.length>3?Hm.indexOf(e)+1:Wm.indexOf(e)+1),p}const fv=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function hv(e){const[,t,n,r,l,d,f,p,_,E,T,S]=e,w=Wd(t,l,r,n,d,f,p);let O;return _?O=dv[_]:E?O=0:O=wc(T,S),[w,new vr(O)]}function gv(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const pv=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,mv=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,_v=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Vg(e){const[,t,n,r,l,d,f,p]=e;return[Wd(t,l,r,n,d,f,p),vr.utcInstance]}function yv(e){const[,t,n,r,l,d,f,p]=e;return[Wd(t,p,n,r,l,d,f),vr.utcInstance]}const Nv=ll(ev,Hd),Cv=ll(tv,Hd),Ev=ll(nv,Hd),Tv=ll(Vm),Zm=al(lv,ul,fa,ha),xv=al(rv,ul,fa,ha),vv=al(iv,ul,fa,ha),Sv=al(ul,fa,ha);function wv(e){return cl(e,[Nv,Zm],[Cv,xv],[Ev,vv],[Tv,Sv])}function Ov(e){return cl(gv(e),[fv,hv])}function Dv(e){return cl(e,[pv,Vg],[mv,Vg],[_v,yv])}function Av(e){return cl(e,[cv,uv])}const Mv=al(ul);function Rv(e){return cl(e,[av,Mv])}const bv=ll(sv,ov),Lv=ll(qm),Iv=al(ul,fa,ha);function kv(e){return cl(e,[bv,Zm],[Lv,Iv])}const qg="Invalid Duration",Jm={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Pv={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Jm},Qr=146097/400,Go=146097/4800,$v={years:{quarters:4,months:12,weeks:Qr/7,days:Qr,hours:Qr*24,minutes:Qr*24*60,seconds:Qr*24*60*60,milliseconds:Qr*24*60*60*1e3},quarters:{months:3,weeks:Qr/28,days:Qr/4,hours:Qr*24/4,minutes:Qr*24*60/4,seconds:Qr*24*60*60/4,milliseconds:Qr*24*60*60*1e3/4},months:{weeks:Go/7,days:Go,hours:Go*24,minutes:Go*24*60,seconds:Go*24*60*60,milliseconds:Go*24*60*60*1e3},...Jm},io=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Fv=io.slice(0).reverse();function ys(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new en(r)}function Xm(e,t){let n=t.milliseconds??0;for(const r of Fv.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Zg(e,t){const n=Xm(e,t)<0?-1:1;io.reduceRight((r,l)=>{if(Lt(t[l]))return r;if(r){const d=t[r]*n,f=e[l][r],p=Math.floor(d/f);t[l]+=p*n,t[r]-=p*f*n}return l},null),io.reduce((r,l)=>{if(Lt(t[l]))return r;if(r){const d=t[r]%1;t[r]-=d,t[l]+=d*e[r][l]}return l},null)}function Bv(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class en{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?$v:Pv;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||un.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return en.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new mr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new en({values:_c(t,en.normalizeUnit),loc:un.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Ts(t))return en.fromMillis(t);if(en.isDuration(t))return t;if(typeof t=="object")return en.fromObject(t);throw new mr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=Av(t);return r?en.fromObject(r,n):en.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=Rv(t);return r?en.fromObject(r,n):en.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new mr("need to specify a reason the Duration is invalid");const r=t instanceof pi?t:new pi(t,n);if(Rn.throwOnInvalid)throw new cx(r);return new en({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new am(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?_r.create(this.loc,r).formatDurationFromString(this,t):qg}toHuman(t={}){if(!this.isValid)return qg;const n=io.map(r=>{const l=this.values[r];return Lt(l)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(l)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=Fd(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},vt.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Xm(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t),r={};for(const l of io)(el(n.values,l)||el(this.values,l))&&(r[l]=n.get(l)+this.get(l));return ys(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=$m(t(this.values[r],r));return ys(this,{values:n},!0)}get(t){return this[en.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,..._c(t,en.normalizeUnit)};return ys(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:l}={}){const f={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:l,conversionAccuracy:r};return ys(this,f)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return Zg(this.matrix,t),ys(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=Bv(this.normalize().shiftToAll().toObject());return ys(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(f=>en.normalizeUnit(f));const n={},r={},l=this.toObject();let d;for(const f of io)if(t.indexOf(f)>=0){d=f;let p=0;for(const E in r)p+=this.matrix[E][f]*r[E],r[E]=0;Ts(l[f])&&(p+=l[f]);const _=Math.trunc(p);n[f]=_,r[f]=(p*1e3-_*1e3)/1e3}else Ts(l[f])&&(r[f]=l[f]);for(const f in r)r[f]!==0&&(n[d]+=f===d?r[f]:r[f]/this.matrix[d][f]);return Zg(this.matrix,n),ys(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return ys(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,l){return r===void 0||r===0?l===void 0||l===0:r===l}for(const r of io)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Yo="Invalid Interval";function Hv(e,t){return!e||!e.isValid?Mn.invalid("missing or invalid start"):!t||!t.isValid?Mn.invalid("missing or invalid end"):t<e?Mn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class Mn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new mr("need to specify a reason the Interval is invalid");const r=t instanceof pi?t:new pi(t,n);if(Rn.throwOnInvalid)throw new ax(r);return new Mn({invalid:r})}static fromDateTimes(t,n){const r=Xl(t),l=Xl(n),d=Hv(r,l);return d??new Mn({start:r,end:l})}static after(t,n){const r=en.fromDurationLike(n),l=Xl(t);return Mn.fromDateTimes(l,l.plus(r))}static before(t,n){const r=en.fromDurationLike(n),l=Xl(t);return Mn.fromDateTimes(l.minus(r),l)}static fromISO(t,n){const[r,l]=(t||"").split("/",2);if(r&&l){let d,f;try{d=vt.fromISO(r,n),f=d.isValid}catch{f=!1}let p,_;try{p=vt.fromISO(l,n),_=p.isValid}catch{_=!1}if(f&&_)return Mn.fromDateTimes(d,p);if(f){const E=en.fromISO(l,n);if(E.isValid)return Mn.after(d,E)}else if(_){const E=en.fromISO(r,n);if(E.isValid)return Mn.before(p,E)}}return Mn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let l;return n!=null&&n.useLocaleWeeks?l=this.end.reconfigure({locale:r.locale}):l=this.end,l=l.startOf(t,n),Math.floor(l.diff(r,t).get(t))+(l.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?Mn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Xl).filter(f=>this.contains(f)).sort((f,p)=>f.toMillis()-p.toMillis()),r=[];let{s:l}=this,d=0;for(;l<this.e;){const f=n[d]||this.e,p=+f>+this.e?this.e:f;r.push(Mn.fromDateTimes(l,p)),l=p,d+=1}return r}splitBy(t){const n=en.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,l=1,d;const f=[];for(;r<this.e;){const p=this.start.plus(n.mapUnits(_=>_*l));d=+p>+this.e?this.e:p,f.push(Mn.fromDateTimes(r,d)),r=d,l+=1}return f}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:Mn.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return Mn.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((l,d)=>l.s-d.s).reduce(([l,d],f)=>d?d.overlaps(f)||d.abutsStart(f)?[l,d.union(f)]:[l.concat([d]),f]:[l,f],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const l=[],d=t.map(_=>[{time:_.s,type:"s"},{time:_.e,type:"e"}]),f=Array.prototype.concat(...d),p=f.sort((_,E)=>_.time-E.time);for(const _ of p)r+=_.type==="s"?1:-1,r===1?n=_.time:(n&&+n!=+_.time&&l.push(Mn.fromDateTimes(n,_.time)),n=null);return Mn.merge(l)}difference(...t){return Mn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Yo}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=gc,n={}){return this.isValid?_r.create(this.s.loc.clone(n),t).formatInterval(this):Yo}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Yo}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Yo}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Yo}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Yo}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):en.invalid(this.invalidReason)}mapEndpoints(t){return Mn.fromDateTimes(t(this.s),t(this.e))}}class tc{static hasDST(t=Rn.defaultZone){const n=vt.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return ts.isValidZone(t)}static normalizeZone(t){return Cs(t,Rn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||un.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||un.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||un.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null,outputCalendar:d="gregory"}={}){return(l||un.create(n,r,d)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null,outputCalendar:d="gregory"}={}){return(l||un.create(n,r,d)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null}={}){return(l||un.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:l=null}={}){return(l||un.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return un.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return un.create(n,null,"gregory").eras(t)}static features(){return{relative:Im(),localeWeek:km()}}}function Jg(e,t){const n=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(en.fromMillis(r).as("days"))}function Wv(e,t,n){const r=[["years",(_,E)=>E.year-_.year],["quarters",(_,E)=>E.quarter-_.quarter+(E.year-_.year)*4],["months",(_,E)=>E.month-_.month+(E.year-_.year)*12],["weeks",(_,E)=>{const T=Jg(_,E);return(T-T%7)/7}],["days",Jg]],l={},d=e;let f,p;for(const[_,E]of r)n.indexOf(_)>=0&&(f=_,l[_]=E(e,t),p=d.plus(l),p>t?(l[_]--,e=d.plus(l),e>t&&(p=e,l[_]--,e=d.plus(l))):e=p);return[e,l,p,f]}function Kv(e,t,n,r){let[l,d,f,p]=Wv(e,t,n);const _=t-l,E=n.filter(S=>["hours","minutes","seconds","milliseconds"].indexOf(S)>=0);E.length===0&&(f<t&&(f=l.plus({[p]:1})),f!==l&&(d[p]=(d[p]||0)+_/(f-l)));const T=en.fromObject(d,r);return E.length>0?en.fromMillis(_,r).shiftTo(...E).plus(T):T}const zv="missing Intl.DateTimeFormat.formatToParts support";function ln(e,t=n=>n){return{regex:e,deser:([n])=>t(bx(n))}}const Uv=" ",Qm=`[ ${Uv}]`,e_=new RegExp(Qm,"g");function Gv(e){return e.replace(/\./g,"\\.?").replace(e_,Qm)}function Xg(e){return e.replace(/\./g,"").replace(e_," ").toLowerCase()}function gi(e,t){return e===null?null:{regex:RegExp(e.map(Gv).join("|")),deser:([n])=>e.findIndex(r=>Xg(n)===Xg(r))+t}}function Qg(e,t){return{regex:e,deser:([,n,r])=>wc(n,r),groups:t}}function nc(e){return{regex:e,deser:([t])=>t}}function Yv(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function jv(e,t){const n=hi(t),r=hi(t,"{2}"),l=hi(t,"{3}"),d=hi(t,"{4}"),f=hi(t,"{6}"),p=hi(t,"{1,2}"),_=hi(t,"{1,3}"),E=hi(t,"{1,6}"),T=hi(t,"{1,9}"),S=hi(t,"{2,4}"),w=hi(t,"{4,6}"),O=I=>({regex:RegExp(Yv(I.val)),deser:([G])=>G,literal:!0}),v=(I=>{if(e.literal)return O(I);switch(I.val){case"G":return gi(t.eras("short"),0);case"GG":return gi(t.eras("long"),0);case"y":return ln(E);case"yy":return ln(S,od);case"yyyy":return ln(d);case"yyyyy":return ln(w);case"yyyyyy":return ln(f);case"M":return ln(p);case"MM":return ln(r);case"MMM":return gi(t.months("short",!0),1);case"MMMM":return gi(t.months("long",!0),1);case"L":return ln(p);case"LL":return ln(r);case"LLL":return gi(t.months("short",!1),1);case"LLLL":return gi(t.months("long",!1),1);case"d":return ln(p);case"dd":return ln(r);case"o":return ln(_);case"ooo":return ln(l);case"HH":return ln(r);case"H":return ln(p);case"hh":return ln(r);case"h":return ln(p);case"mm":return ln(r);case"m":return ln(p);case"q":return ln(p);case"qq":return ln(r);case"s":return ln(p);case"ss":return ln(r);case"S":return ln(_);case"SSS":return ln(l);case"u":return nc(T);case"uu":return nc(p);case"uuu":return ln(n);case"a":return gi(t.meridiems(),0);case"kkkk":return ln(d);case"kk":return ln(S,od);case"W":return ln(p);case"WW":return ln(r);case"E":case"c":return ln(n);case"EEE":return gi(t.weekdays("short",!1),1);case"EEEE":return gi(t.weekdays("long",!1),1);case"ccc":return gi(t.weekdays("short",!0),1);case"cccc":return gi(t.weekdays("long",!0),1);case"Z":case"ZZ":return Qg(new RegExp(`([+-]${p.source})(?::(${r.source}))?`),2);case"ZZZ":return Qg(new RegExp(`([+-]${p.source})(${r.source})?`),2);case"z":return nc(/[a-z_+-/]{1,256}?/i);case" ":return nc(/[^\S\n\r]/);default:return O(I)}})(e)||{invalidReason:zv};return v.token=e,v}const Vv={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function qv(e,t,n){const{type:r,value:l}=e;if(r==="literal"){const _=/^\s+$/.test(l);return{literal:!_,val:_?" ":l}}const d=t[r];let f=r;r==="hour"&&(t.hour12!=null?f=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?f="hour12":f="hour24":f=n.hour12?"hour12":"hour24");let p=Vv[f];if(typeof p=="object"&&(p=p[d]),p)return{literal:!1,val:p}}function Zv(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function Jv(e,t,n){const r=e.match(t);if(r){const l={};let d=1;for(const f in n)if(el(n,f)){const p=n[f],_=p.groups?p.groups+1:1;!p.literal&&p.token&&(l[p.token.val[0]]=p.deser(r.slice(d,d+_))),d+=_}return[r,l]}else return[r,{}]}function Xv(e){const t=d=>{switch(d){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return Lt(e.z)||(n=ts.create(e.z)),Lt(e.Z)||(n||(n=new vr(e.Z)),r=e.Z),Lt(e.q)||(e.M=(e.q-1)*3+1),Lt(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),Lt(e.u)||(e.S=$d(e.u)),[Object.keys(e).reduce((d,f)=>{const p=t(f);return p&&(d[p]=e[f]),d},{}),n,r]}let Fu=null;function Qv(){return Fu||(Fu=vt.fromMillis(1555555555555)),Fu}function eS(e,t){if(e.literal)return e;const n=_r.macroTokenToFormatOpts(e.val),r=i_(n,t);return r==null||r.includes(void 0)?e:r}function t_(e,t){return Array.prototype.concat(...e.map(n=>eS(n,t)))}class n_{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=t_(_r.parseFormat(n),t),this.units=this.tokens.map(r=>jv(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,l]=Zv(this.units);this.regex=RegExp(r,"i"),this.handlers=l}}explainFromTokens(t){if(this.isValid){const[n,r]=Jv(t,this.regex,this.handlers),[l,d,f]=r?Xv(r):[null,null,void 0];if(el(r,"a")&&el(r,"H"))throw new Zo("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:l,zone:d,specificOffset:f}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function r_(e,t,n){return new n_(e,n).explainFromTokens(t)}function tS(e,t,n){const{result:r,zone:l,specificOffset:d,invalidReason:f}=r_(e,t,n);return[r,l,d,f]}function i_(e,t){if(!e)return null;const r=_r.create(t,e).dtFormatter(Qv()),l=r.formatToParts(),d=r.resolvedOptions();return l.map(f=>qv(f,e,d))}const Bu="Invalid DateTime",nS=864e13;function na(e){return new pi("unsupported zone",`the zone "${e.name}" is not supported`)}function Hu(e){return e.weekData===null&&(e.weekData=pc(e.c)),e.weekData}function Wu(e){return e.localWeekData===null&&(e.localWeekData=pc(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Qs(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new vt({...n,...t,old:n})}function s_(e,t,n){let r=e-t*60*1e3;const l=n.offset(r);if(t===l)return[r,t];r-=(l-t)*60*1e3;const d=n.offset(r);return l===d?[r,l]:[e-Math.min(l,d)*60*1e3,Math.max(l,d)]}function rc(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function lc(e,t,n){return s_(Sc(e),t,n)}function ep(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),l=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,d={...e.c,year:r,month:l,day:Math.min(e.c.day,mc(r,l))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},f=en.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),p=Sc(d);let[_,E]=s_(p,n,e.zone);return f!==0&&(_+=f,E=e.zone.offset(_)),{ts:_,o:E}}function jo(e,t,n,r,l,d){const{setZone:f,zone:p}=n;if(e&&Object.keys(e).length!==0||t){const _=t||p,E=vt.fromObject(e,{...n,zone:_,specificOffset:d});return f?E:E.setZone(p)}else return vt.invalid(new pi("unparsable",`the input "${l}" can't be parsed as ${r}`))}function ic(e,t,n=!0){return e.isValid?_r.create(un.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Ku(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Kn(e.c.year,n?6:4),t?(r+="-",r+=Kn(e.c.month),r+="-",r+=Kn(e.c.day)):(r+=Kn(e.c.month),r+=Kn(e.c.day)),r}function tp(e,t,n,r,l,d){let f=Kn(e.c.hour);return t?(f+=":",f+=Kn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(f+=":")):f+=Kn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(f+=Kn(e.c.second),(e.c.millisecond!==0||!r)&&(f+=".",f+=Kn(e.c.millisecond,3))),l&&(e.isOffsetFixed&&e.offset===0&&!d?f+="Z":e.o<0?(f+="-",f+=Kn(Math.trunc(-e.o/60)),f+=":",f+=Kn(Math.trunc(-e.o%60))):(f+="+",f+=Kn(Math.trunc(e.o/60)),f+=":",f+=Kn(Math.trunc(e.o%60)))),d&&(f+="["+e.zone.ianaName+"]"),f}const o_={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},rS={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},iS={ordinal:1,hour:0,minute:0,second:0,millisecond:0},l_=["year","month","day","hour","minute","second","millisecond"],sS=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],oS=["year","ordinal","hour","minute","second","millisecond"];function lS(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new am(e);return t}function np(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return lS(e)}}function aS(e){return cc[e]||(ac===void 0&&(ac=Rn.now()),cc[e]=e.offset(ac)),cc[e]}function rp(e,t){const n=Cs(t.zone,Rn.defaultZone);if(!n.isValid)return vt.invalid(na(n));const r=un.fromObject(t);let l,d;if(Lt(e.year))l=Rn.now();else{for(const _ of l_)Lt(e[_])&&(e[_]=o_[_]);const f=bm(e)||Lm(e);if(f)return vt.invalid(f);const p=aS(n);[l,d]=lc(e,p,n)}return new vt({ts:l,zone:n,loc:r,o:d})}function ip(e,t,n){const r=Lt(n.round)?!0:n.round,l=(f,p)=>(f=Fd(f,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(f,p)),d=f=>n.calendary?t.hasSame(e,f)?0:t.startOf(f).diff(e.startOf(f),f).get(f):t.diff(e,f).get(f);if(n.unit)return l(d(n.unit),n.unit);for(const f of n.units){const p=d(f);if(Math.abs(p)>=1)return l(p,f)}return l(e>t?-0:0,n.units[n.units.length-1])}function sp(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let ac,cc={};class vt{constructor(t){const n=t.zone||Rn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new pi("invalid input"):null)||(n.isValid?null:na(n));this.ts=Lt(t.ts)?Rn.now():t.ts;let l=null,d=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[l,d]=[t.old.c,t.old.o];else{const p=Ts(t.o)&&!t.old?t.o:n.offset(this.ts);l=rc(this.ts,p),r=Number.isNaN(l.year)?new pi("invalid input"):null,l=r?null:l,d=r?null:p}this._zone=n,this.loc=t.loc||un.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=l,this.o=d,this.isLuxonDateTime=!0}static now(){return new vt({})}static local(){const[t,n]=sp(arguments),[r,l,d,f,p,_,E]=n;return rp({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:E},t)}static utc(){const[t,n]=sp(arguments),[r,l,d,f,p,_,E]=n;return t.zone=vr.utcInstance,rp({year:r,month:l,day:d,hour:f,minute:p,second:_,millisecond:E},t)}static fromJSDate(t,n={}){const r=$x(t)?t.valueOf():NaN;if(Number.isNaN(r))return vt.invalid("invalid input");const l=Cs(n.zone,Rn.defaultZone);return l.isValid?new vt({ts:r,zone:l,loc:un.fromObject(n)}):vt.invalid(na(l))}static fromMillis(t,n={}){if(Ts(t))return t<-864e13||t>nS?vt.invalid("Timestamp out of range"):new vt({ts:t,zone:Cs(n.zone,Rn.defaultZone),loc:un.fromObject(n)});throw new mr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Ts(t))return new vt({ts:t*1e3,zone:Cs(n.zone,Rn.defaultZone),loc:un.fromObject(n)});throw new mr("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Cs(n.zone,Rn.defaultZone);if(!r.isValid)return vt.invalid(na(r));const l=un.fromObject(n),d=_c(t,np),{minDaysInFirstWeek:f,startOfWeek:p}=Ug(d,l),_=Rn.now(),E=Lt(n.specificOffset)?r.offset(_):n.specificOffset,T=!Lt(d.ordinal),S=!Lt(d.year),w=!Lt(d.month)||!Lt(d.day),O=S||w,m=d.weekYear||d.weekNumber;if((O||T)&&m)throw new Zo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(w&&T)throw new Zo("Can't mix ordinal dates with month/day");const v=m||d.weekday&&!O;let I,G,k=rc(_,E);v?(I=sS,G=rS,k=pc(k,f,p)):T?(I=oS,G=iS,k=$u(k)):(I=l_,G=o_);let P=!1;for(const z of I){const q=d[z];Lt(q)?P?d[z]=G[z]:d[z]=k[z]:P=!0}const H=v?Ix(d,f,p):T?kx(d):bm(d),j=H||Lm(d);if(j)return vt.invalid(j);const re=v?Kg(d,f,p):T?zg(d):d,[te,ce]=lc(re,E,r),V=new vt({ts:te,zone:r,o:ce,loc:l});return d.weekday&&O&&t.weekday!==V.weekday?vt.invalid("mismatched weekday",`you can't specify both a weekday of ${d.weekday} and a date of ${V.toISO()}`):V.isValid?V:vt.invalid(V.invalid)}static fromISO(t,n={}){const[r,l]=wv(t);return jo(r,l,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,l]=Ov(t);return jo(r,l,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,l]=Dv(t);return jo(r,l,n,"HTTP",n)}static fromFormat(t,n,r={}){if(Lt(t)||Lt(n))throw new mr("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:d=null}=r,f=un.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0}),[p,_,E,T]=tS(f,t,n);return T?vt.invalid(T):jo(p,_,r,`format ${n}`,t,E)}static fromString(t,n,r={}){return vt.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,l]=kv(t);return jo(r,l,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new mr("need to specify a reason the DateTime is invalid");const r=t instanceof pi?t:new pi(t,n);if(Rn.throwOnInvalid)throw new lx(r);return new vt({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=i_(t,un.fromObject(n));return r?r.map(l=>l?l.val:null).join(""):null}static expandFormat(t,n={}){return t_(_r.parseFormat(t),un.fromObject(n)).map(l=>l.val).join("")}static resetCache(){ac=void 0,cc={}}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Hu(this).weekYear:NaN}get weekNumber(){return this.isValid?Hu(this).weekNumber:NaN}get weekday(){return this.isValid?Hu(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?Wu(this).weekday:NaN}get localWeekNumber(){return this.isValid?Wu(this).weekNumber:NaN}get localWeekYear(){return this.isValid?Wu(this).weekYear:NaN}get ordinal(){return this.isValid?$u(this.c).ordinal:NaN}get monthShort(){return this.isValid?tc.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?tc.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?tc.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?tc.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,r=Sc(this.c),l=this.zone.offset(r-t),d=this.zone.offset(r+t),f=this.zone.offset(r-l*n),p=this.zone.offset(r-d*n);if(f===p)return[this];const _=r-f*n,E=r-p*n,T=rc(_,f),S=rc(E,p);return T.hour===S.hour&&T.minute===S.minute&&T.second===S.second&&T.millisecond===S.millisecond?[Qs(this,{ts:_}),Qs(this,{ts:E})]:[this]}get isInLeapYear(){return da(this.year)}get daysInMonth(){return mc(this.year,this.month)}get daysInYear(){return this.isValid?Jo(this.year):NaN}get weeksInWeekYear(){return this.isValid?ca(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ca(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:l}=_r.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:l}}toUTC(t=0,n={}){return this.setZone(vr.instance(t),n)}toLocal(){return this.setZone(Rn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Cs(t,Rn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let l=this.ts;if(n||r){const d=t.offset(this.ts),f=this.toObject();[l]=lc(f,d,t)}return Qs(this,{ts:l,zone:t})}else return vt.invalid(na(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const l=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Qs(this,{loc:l})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=_c(t,np),{minDaysInFirstWeek:r,startOfWeek:l}=Ug(n,this.loc),d=!Lt(n.weekYear)||!Lt(n.weekNumber)||!Lt(n.weekday),f=!Lt(n.ordinal),p=!Lt(n.year),_=!Lt(n.month)||!Lt(n.day),E=p||_,T=n.weekYear||n.weekNumber;if((E||f)&&T)throw new Zo("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(_&&f)throw new Zo("Can't mix ordinal dates with month/day");let S;d?S=Kg({...pc(this.c,r,l),...n},r,l):Lt(n.ordinal)?(S={...this.toObject(),...n},Lt(n.day)&&(S.day=Math.min(mc(S.year,S.month),S.day))):S=zg({...$u(this.c),...n});const[w,O]=lc(S,this.o,this.zone);return Qs(this,{ts:w,o:O})}plus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t);return Qs(this,ep(this,n))}minus(t){if(!this.isValid)return this;const n=en.fromDurationLike(t).negate();return Qs(this,ep(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},l=en.normalizeUnit(t);switch(l){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(l==="weeks")if(n){const d=this.loc.getStartOfWeek(),{weekday:f}=this;f<d&&(r.weekNumber=this.weekNumber-1),r.weekday=d}else r.weekday=1;if(l==="quarters"){const d=Math.ceil(this.month/3);r.month=(d-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?_r.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Bu}toLocaleString(t=gc,n={}){return this.isValid?_r.create(this.loc.clone(n),t).formatDateTime(this):Bu}toLocaleParts(t={}){return this.isValid?_r.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:l=!0,extendedZone:d=!1}={}){if(!this.isValid)return null;const f=t==="extended";let p=Ku(this,f);return p+="T",p+=tp(this,f,n,r,l,d),p}toISODate({format:t="extended"}={}){return this.isValid?Ku(this,t==="extended"):null}toISOWeekDate(){return ic(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:l=!1,extendedZone:d=!1,format:f="extended"}={}){return this.isValid?(l?"T":"")+tp(this,f==="extended",n,t,r,d):null}toRFC2822(){return ic(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return ic(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ku(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let l="HH:mm:ss.SSS";return(n||t)&&(r&&(l+=" "),n?l+="z":t&&(l+="ZZ")),ic(this,l,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Bu}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return en.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...r},d=Fx(n).map(en.normalizeUnit),f=t.valueOf()>this.valueOf(),p=f?this:t,_=f?t:this,E=Kv(p,_,d,l);return f?E.negate():E}diffNow(t="milliseconds",n={}){return this.diff(vt.now(),t,n)}until(t){return this.isValid?Mn.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const l=t.valueOf(),d=this.setZone(t.zone,{keepLocalTime:!0});return d.startOf(n,r)<=l&&l<=d.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||vt.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let l=["years","months","days","hours","minutes","seconds"],d=t.unit;return Array.isArray(t.unit)&&(l=t.unit,d=void 0),ip(n,this.plus(r),{...t,numeric:"always",units:l,unit:d})}toRelativeCalendar(t={}){return this.isValid?ip(t.base||vt.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(vt.isDateTime))throw new mr("min requires all arguments be DateTimes");return Gg(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(vt.isDateTime))throw new mr("max requires all arguments be DateTimes");return Gg(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:l=null,numberingSystem:d=null}=r,f=un.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0});return r_(f,t,n)}static fromStringExplain(t,n,r={}){return vt.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:l=null}=n,d=un.fromOpts({locale:r,numberingSystem:l,defaultToEN:!0});return new n_(d,t)}static fromFormatParser(t,n,r={}){if(Lt(t)||Lt(n))throw new mr("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:d=null}=r,f=un.fromOpts({locale:l,numberingSystem:d,defaultToEN:!0});if(!f.equals(n.locale))throw new mr(`fromFormatParser called with a locale of ${f}, but the format parser was created for ${n.locale}`);const{result:p,zone:_,specificOffset:E,invalidReason:T}=n.explainFromTokens(t);return T?vt.invalid(T):jo(p,_,r,`format ${n.format}`,t,E)}static get DATE_SHORT(){return gc}static get DATE_MED(){return cm}static get DATE_MED_WITH_WEEKDAY(){return ux}static get DATE_FULL(){return um}static get DATE_HUGE(){return dm}static get TIME_SIMPLE(){return fm}static get TIME_WITH_SECONDS(){return hm}static get TIME_WITH_SHORT_OFFSET(){return gm}static get TIME_WITH_LONG_OFFSET(){return pm}static get TIME_24_SIMPLE(){return mm}static get TIME_24_WITH_SECONDS(){return _m}static get TIME_24_WITH_SHORT_OFFSET(){return ym}static get TIME_24_WITH_LONG_OFFSET(){return Nm}static get DATETIME_SHORT(){return Cm}static get DATETIME_SHORT_WITH_SECONDS(){return Em}static get DATETIME_MED(){return Tm}static get DATETIME_MED_WITH_SECONDS(){return xm}static get DATETIME_MED_WITH_WEEKDAY(){return dx}static get DATETIME_FULL(){return vm}static get DATETIME_FULL_WITH_SECONDS(){return Sm}static get DATETIME_HUGE(){return wm}static get DATETIME_HUGE_WITH_SECONDS(){return Om}}function Xl(e){if(vt.isDateTime(e))return e;if(e&&e.valueOf&&Ts(e.valueOf()))return vt.fromJSDate(e);if(e&&typeof e=="object")return vt.fromObject(e);throw new mr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}var Yt=(e=>(e.Monday="MONDAY",e.Tuesday="TUESDAY",e.Wednesday="WEDNESDAY",e.Thursday="THURSDAY",e.Friday="FRIDAY",e.Saturday="SATURDAY",e.Sunday="SUNDAY",e))(Yt||{});function Dc(e){const t={1:Yt.Monday,2:Yt.Tuesday,3:Yt.Wednesday,4:Yt.Thursday,5:Yt.Friday,6:Yt.Saturday,7:Yt.Sunday};if(e.weekday in t)return t[e.weekday];throw new Error(`Invalid DateTime.weekday property: ${e}, ${e.weekday}`)}function oo(e){return{[Yt.Monday]:"Monday",[Yt.Tuesday]:"Tuesday",[Yt.Wednesday]:"Wednesday",[Yt.Thursday]:"Thursday",[Yt.Friday]:"Friday",[Yt.Saturday]:"Saturday",[Yt.Sunday]:"Sunday"}[e]}const ld=[Yt.Monday,Yt.Tuesday,Yt.Wednesday,Yt.Thursday,Yt.Friday,Yt.Saturday,Yt.Sunday],ra={[Yt.Monday]:"monday",[Yt.Tuesday]:"tuesday",[Yt.Wednesday]:"wednesday",[Yt.Thursday]:"thursday",[Yt.Friday]:"friday",[Yt.Saturday]:"saturday",[Yt.Sunday]:"sunday"};class yc{constructor(t,n,r){Ie(this,"end");Ie(this,"start");this.end=t.setZone(r),this.start=t.setZone(r),[n.start,n.end].forEach(E=>{if(E.split(":").length!==2)throw new Error('expected interval start and end data to be in the format "HH:MM"')});const[l,d]=n.start.split(":").map(Number),[f,p]=n.end.split(":").map(Number);let _=0;f<l&&(_=1),this.end=this.end.set({hour:f,minute:p,day:this.end.day+_}),this.start=this.start.set({hour:l,minute:d}),this.end.minute===59&&(this.end=this.end.set({minute:60}))}contains(t){return this.start<=t&&t<this.end}getStartTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.start.setLocale(t||"en-US").toLocaleString(r).replace(" "," ")}getEndTime(t,n){const r={hour:"numeric",minute:"numeric",...n};return this.end.setLocale(t||"en-US").toLocaleString(r).replace(" "," ")}timeIsEqualTo(t){const n=this.getStartTime()===t.getStartTime(),r=this.getEndTime()===t.getEndTime();return n&&r}is24h(){const t=this.start.minute===0&&this.start.hour===0,n=this.end.minute===0&&this.end.hour===0,r=this.end.day-this.start.day===1||this.end.day===1;return t&&n&&r}}class a_{constructor(t,n){Ie(this,"holidayHoursByDate");Ie(this,"hours");Ie(this,"timezone");this.holidayHoursByDate=Object.fromEntries((t.holidayHours||[]).map(r=>[r.date,r])),this.hours=t,this.timezone=n}getInterval(t){if(this.isTemporarilyClosedAt(t))return null;const n=t.minus({days:1});for(const r of[n,t]){const l=this.getHours(r);if(l&&!l.isClosed)for(const d of l.openIntervals||[]){const f=new yc(r,d,this.timezone);if(f.contains(t))return f}}return null}getCurrentInterval(){return this.getInterval(vt.now())}getIntervalAfter(t){const n=this.getIntervalsForNDays(8,t),r=(d,f)=>d.start===f.start?0:d.start>f.start?1:-1,l=n.sort(r);for(const[d,f]of l.entries())if(f.contains(t)&&l.length>d+1)return l[d+1];for(const d of l)if(d.start>t)return d;return null}getIntervalsForNDays(t,n){const r=[];for(let l=0;l<t;l++){let d=n;d=d.plus({days:l});const f=this.getHours(d);f!=null&&f.openIntervals&&!f.isClosed&&r.push(...f.openIntervals.map(p=>new yc(d,p,this.timezone)))}return r}getHolidayHours(t){return this.isTemporarilyClosedAt(t)?null:this.holidayHoursByDate[(t.toISO()||"").replace(/T.*/,"")]||null}getNormalHours(t){if(this.isTemporarilyClosedAt(t))return null;const n=oo(Dc(t)).toLowerCase();return this.hours[n]}getHours(t){const n=this.getHolidayHours(t);return!n||n.isRegularHours?this.getNormalHours(t):n}getNextInterval(){return this.getIntervalAfter(vt.now())}isHoliday(t){return!!this.getHolidayHours(t)}isTemporarilyClosedAt(t){if(!this.hours.reopenDate)return!1;const n=this.hours.reopenDate.split("-");if(n.length===3){const[r,l,d]=n,f=vt.fromObject({year:Number(r),month:Number(l),day:Number(d)},{zone:this.timezone});if(t<f)return!0}return!1}isOpenAt(t){return this.isTemporarilyClosedAt(t)?!1:!!this.getInterval(t)}isOpenNow(){return this.isOpenAt(vt.now())}}function cS(e,t){const n=[...e];return t=t%n.length,n.concat(n.splice(0,n.length-t))}function uS(e,t){if(e.length!==t.length)return!1;for(const[n,r]of e.entries())if(!r.timeIsEqualTo(t[n]))return!1;return!0}function ga(e){var t,n;return((n=(t=e==null?void 0:e.currentInterval)==null?void 0:t.is24h)==null?void 0:n.call(t))||!1}function pa(e){return!e.futureInterval}function dS(e){return ga(e)?nt.jsx("span",{className:"HoursStatus-current",children:"Open 24 Hours"}):pa(e)?nt.jsx("span",{className:"HoursStatus-current",children:"Temporarily Closed"}):nt.jsx("span",{className:"HoursStatus-current",children:e.isOpen?"Open Now":"Closed"})}function fS(e){return ga(e)||pa(e)?null:nt.jsx("span",{className:"HoursStatus-separator",children:" • "})}function hS(e){return ga(e)||pa(e)?null:nt.jsx("span",{className:"HoursStatus-future",children:e.isOpen?"Closes at":"Opens at"})}function gS(e){if(ga(e)||pa(e))return null;let t="";if(e.isOpen){const n=e.currentInterval;t+=n?n.getEndTime("en-US",e.timeOptions):""}else{const n=e.futureInterval;t+=n?n.getStartTime("en-US",e.timeOptions):""}return nt.jsxs("span",{className:"HoursStatus-time",children:[" ",t]})}function pS(e){var r,l;if(ga(e)||pa(e))return null;const t={weekday:"long",...e.dayOptions??{}};let n="";if(e.isOpen){const d=e.currentInterval;n+=((r=d==null?void 0:d.end)==null?void 0:r.setLocale("en-US").toLocaleString(t))||""}else{const d=e.futureInterval;n+=((l=d==null?void 0:d.start)==null?void 0:l.setLocale("en-US").toLocaleString(t))||""}return nt.jsxs("span",{className:"HoursStatus-dayOfWeek",children:[" ",n]})}function mS(e,t){const n=e.currentTemplate||dS,r=e.separatorTemplate||fS,l=e.futureTemplate||hS,d=e.timeTemplate||gS,f=e.dayOfWeekTemplate||pS;return nt.jsxs("div",{className:lo("HoursStatus",(t==null?void 0:t.className)||""),children:[n(e),r(e),l(e),d(e),f(e)]})}const _S={minHeight:`${1.5}em`},yS=e=>{const[t,n]=rt.useState(!1),[r,l]=rt.useState(!1);if(rt.useEffect(()=>{l(!0)},[]),!e.hours)return nt.jsx(nt.Fragment,{});const d=e.statusTemplate||mS,f=new a_(e.hours,e.timezone),p=f.isOpenNow(),_=f.getCurrentInterval(),E=f.getNextInterval(),T=(_==null?void 0:_.end)||(E==null?void 0:E.start);if(T&&!t){n(!0);const w=T.toMillis()-vt.now().toMillis();setTimeout(()=>n(!1),w)}const S={isOpen:p,currentInterval:_,futureInterval:E,...e};return nt.jsx(nt.Fragment,{children:r?d(S,e):nt.jsx("div",{style:_S,className:lo("HoursStatus",(e==null?void 0:e.className)||"")})})};function NS(e,t){const n=[];return e.forEach(r=>{const l=n[n.length-1];l?uS(l.intervals,r.intervals)?(l.endDay=r.endDay,l.isToday=l.isToday||r.isToday):n.push({...r}):n.push({...r})}),n.map(r=>{const l=t&&ra[r.startDay]in t?t[ra[r.startDay]]||"":oo(r.startDay),d=t&&ra[r.endDay]in t?t[ra[r.endDay]]||"":oo(r.endDay);return{...r,dayOfWeek:"Collapsed",dayName:r.startDay===r.endDay?`${l}`:`${l} - ${d}`}})}function CS(e,t,n){const r=[],l=e.intervals.length>0&&e.intervals[0].is24h();return e.intervals.length===0?r.push((n==null?void 0:n.isClosed)||"Closed"):l?r.push((n==null?void 0:n.open24Hours)||"Open 24 hours"):e.intervals.forEach(d=>{const f=d.getStartTime((n==null?void 0:n.timeFormatLocale)||"en-US",t),p=d.getEndTime((n==null?void 0:n.timeFormatLocale)||"en-US",t);r.push(`${f} - ${p}`)}),r}function ES(e,t,n){const r=[];for(let l=1;l<=7;l++){const d=vt.fromObject({weekday:l}),f=Dc(d);r.push({startDay:f,endDay:f,dayName:n&&oo(f).toLowerCase()in n?n[oo(f).toLowerCase()]||"":oo(f),intervals:e.filter(p=>p.start.weekday===l),isToday:(t==null?void 0:t.weekday)===l})}return r}const TS=e=>{const[t,n]=rt.useState(!1);return rt.useEffect(()=>{n(!0)},[]),e.hours?nt.jsx(nt.Fragment,{children:t?nt.jsx(xS,{...e}):nt.jsx(vS,{...e})}):nt.jsx(nt.Fragment,{})},xS=e=>{const t=new a_(e.hours,Intl.DateTimeFormat().resolvedOptions().timeZone),n=vt.now(),r=t.getIntervalsForNDays(7,n),l=ES(r,n,e.dayOfWeekNames);return nt.jsx(ad,{...e,hoursData:l,isClient:!0})},vS=e=>{var f;const{hours:t,dayOfWeekNames:n,intervalTranslations:r}=e,l=ld.map(p=>{var E,T;const _=ra[p];return{dayName:(n==null?void 0:n[_])||oo(p),startDay:p,endDay:p,isToday:!1,intervals:((T=(E=t[_])==null?void 0:E.openIntervals)==null?void 0:T.map(S=>new yc(vt.now(),S,"UTC")))??[]}}),d=(f=t.holidayHours)==null?void 0:f.map(p=>{var T,S;const _=vt.fromFormat(p.date,"yyyy-MM-dd"),E=Dc(_);return{dayName:_.setLocale((r==null?void 0:r.timeFormatLocale)||"en-US").toLocaleString(),isToday:!1,startDay:E,endDay:E,intervals:(p.isRegularHours?(T=p.openIntervals)==null?void 0:T.map(w=>new yc(_,w,"UTC")):(S=l.find(w=>w.startDay===E))==null?void 0:S.intervals)??[]}});return nt.jsxs(nt.Fragment,{children:[nt.jsx(ad,{...e,hoursData:l,isClient:!1}),d&&d.length>0&&nt.jsx(ad,{...e,hoursData:d,isClient:!1,isHolidayHours:!0}),t.reopenDate&&nt.jsxs("div",{className:"HoursTable-row",children:[nt.jsx("span",{className:"HoursTable-day",children:(r==null?void 0:r.reopenDate)||"Reopen Date"}),nt.jsx("span",{className:"HoursTable-intervals",children:vt.fromFormat(t.reopenDate,"yyyy-MM-dd").setLocale((r==null?void 0:r.timeFormatLocale)||"en-US").toLocaleString()})]})]})},ad=e=>{const{intervalStringsBuilderFn:t,className:n,timeOptions:r,intervalTranslations:l,dayOfWeekNames:d,startOfWeek:f,isClient:p,isHolidayHours:_}=e;let E=e.hoursData;function T(O){return O?{today:Dc(vt.now()),monday:Yt.Monday,tuesday:Yt.Tuesday,wednesday:Yt.Wednesday,thursday:Yt.Thursday,friday:Yt.Friday,saturday:Yt.Saturday,sunday:Yt.Sunday}[O]:Yt.Sunday}const S=ld.indexOf(T(p||f!=="today"?f:"sunday")),w=cS(ld,7-S);return _||(E.sort((O,m)=>w.indexOf(O.startDay)-w.indexOf(m.startDay)),e.collapseDays&&(E=NS(E,d))),nt.jsx("div",{className:lo("HoursTable",n),children:E.map(O=>{const v=(t||CS)(O,r,l);return nt.jsxs("div",{className:lo("HoursTable-row",{"is-today":O.isToday}),children:[nt.jsx("span",{className:"HoursTable-day",children:O.dayName}),nt.jsx("span",{className:"HoursTable-intervals",children:v.map((I,G)=>nt.jsx("span",{className:"HoursTable-interval",children:I},G))})]},O.dayName)})})},SS=e=>`<script type="application/ld+json">
|
|
110
110
|
${JSON.stringify(e)}
|
|
111
|
-
<\/script>`,wc=(e,t)=>({"@context":"https://schema.org","@type":t,name:e.name}),CS=e=>typeof e!="object"?!1:"name"in e||"address"in e,ES=e=>typeof e!="object"?!1:"line1"in e||"city"in e||"region"in e||"postalCode"in e||"countryCode"in e,Fd=e=>ES(e)&&{address:{"@type":"PostalAddress",streetAddress:e.line1,addressLocality:e.city,addressRegion:e.region,postalCode:e.postalCode,addressCountry:e.countryCode}},o_=e=>CS(e)&&{"@type":"Place",name:e.name,...Fd(e.address)},l_=e=>typeof e!="object"||!("image"in e)?!1:"url"in e.image,Oc=e=>{if(!e)return{};const t=new Array;for(const n of e)l_(n)&&t.push(n.image.url);return{image:t}},TS=e=>l_(e)&&{image:e.image.url},xS=e=>typeof e!="object"?!1:"url"in e||"name"in e,vS=e=>Array.isArray(e),a_=e=>vS(e)&&{performer:{"@type":"PerformingGroup",name:e.join(" and ")}},c_=e=>xS(e)&&{organizer:{"@type":"Organization",name:e.name,url:e.url}},SS=e=>typeof e!="object"?!1:"url"in e||"priceCurrency"in e||"price"in e||"priceValidUntil"in e||"itemCondition"in e||"availability"in e,Bd=e=>SS(e)&&{offers:{"@type":"Offer",url:e.url,priceCurrency:e.priceCurrency,price:e.price,priceValidUntil:e.priceValidUntil,itemCondition:e.itemCondition,availability:e.availability}},wS=(e,t)=>({...wc(e,t??"Event"),...Oc(e.photoGallery),...o_({name:e.geomodifier,address:e.address}),startDate:e.c_startDate,endDate:e.c_endDate,description:e.description,eventAttendanceMode:e.attendance,eventStatus:e.eventStatus,...a_(e.performers),...c_({name:e.organizerName}),...Bd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.stockStatus,availability:e.availabilityDate})}),OS=e=>typeof e!="object"?!1:"monday"in e||"tuesday"in e||"wednesday"in e||"thursday"in e||"friday"in e||"saturday"in e||"sunday"in e,DS=e=>typeof e=="object"&&"isClosed"in e&&Array.isArray(e.openIntervals)?e.openIntervals.length===0?!0:e.openIntervals.every(t=>typeof t=="object"&&"start"in t&&"end"in t):!1,u_=e=>{if(!OS(e))return{};let t=new Map;t=to(e.monday,t,"Mo"),t=to(e.tuesday,t,"Tu"),t=to(e.wednesday,t,"We"),t=to(e.thursday,t,"Th"),t=to(e.friday,t,"Fr"),t=to(e.saturday,t,"Sa"),t=to(e.sunday,t,"Su");const n=new Array;for(const[r,l]of t){const d=l.join(",");n.push(d+" "+r)}return{openingHours:n}},to=(e,t,n)=>{if(!DS(e)||e.isClosed){const r="00:00-00:00",l=t.get(r)??[];return l.push(n),t.set(r,l),t}for(let r=0;r<e.openIntervals.length;r++){const l=e.openIntervals[r].start+"-"+e.openIntervals[r].end,d=t.get(l)??[];d.push(n),t.set(l,d)}return t},AS=(e,t)=>({...wc(e,t??"LocalBusiness"),...Fd(e.address),...u_(e.hours),...Oc(e.photoGallery),description:e.description,telephone:e.mainPhone,email:e.email}),MS=e=>typeof e!="object"?!1:"ratingValue"in e||"bestRating"in e||"author"in e,RS=e=>typeof e!="object"?!1:"ratingValue"in e||"reviewCount"in e,d_=e=>MS(e)&&{review:{"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:e.ratingValue,bestRating:e.bestRating},author:{"@type":"Person",name:e.author}}},f_=e=>RS(e)?{aggregateRating:{"@type":"AggregateRating",ratingValue:e.ratingValue,reviewCount:e.reviewCount}}:void 0,bS=(e,t)=>({...wc(e,t??"Product"),...Oc(e.photoGallery),...d_(e.c_reviews),...f_(e.c_aggregateRating),...Bd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.stockStatus,availability:e.availabilityDate}),description:e.description,sku:e.sku,mpn:e.mpn,brand:{"@type":"Brand",name:e.brand}}),LS=e=>typeof e!="object"?!1:"question"in e&&"answer"in e,IS=e=>typeof e!="object"?!1:"question"in e&&"answerV2"in e?"json"in e.answerV2&&typeof e.answerV2.json=="object":!1;function id(e,t){for(const n in e)if(typeof e[n]=="object")if(Array.isArray(e[n]))for(let r=0;r<e[n].length;r++)id(e[n][r],t);else id(e[n],t);else n==="text"&&t.push(e[n])}function kS(e){if(e.json){const t=[];return id(e.json,t),t.join("")}return""}const PS=e=>({"@context":"http://www.schema.org","@type":"FAQPage",mainEntity:e.map(t=>{if(LS(t)||IS(t))return{"@type":"Question",name:t.question,acceptedAnswer:{"@type":"Answer",text:"answer"in t?t.answer:kS(t.answerV2)}}})}),sd=Math.log2(1.6745627884839434),$S=4,FS=19,od="js-baidu-neg-lng-fix";let h_;const BS=new Promise(e=>h_=e),HS="https://api.map.baidu.com/geoconv/v1/";let Ql=[];const WS="gcj02ToBD09Callback_b872c21c";let KS=0,rp;async function g_(e){return await new Promise((t,n)=>{Ql.push({coordinates:e,resolve:t,reject:n}),Ql.length===1&&(rp=setTimeout(r,100)),Ql.length>40&&(clearTimeout(rp),r());function r(){const l=Ql;Ql=[];const d=[].concat(...l.map(_=>_.coordinates)),f=WS+"_"+KS++,p=document.createElement("script");window[f]=_=>{var S;if(_.status){const w=new Error(`Unable to convert coordinates to BD-09: Received status code ${_.status}${_.message?": "+_.message:""}`);l.forEach(M=>M.reject(w))}const T=_.result.map(w=>new dn(w.y,w.x));let E=0;l.forEach(w=>{w.resolve(T.slice(E,E+=w.coordinates.length))}),delete window[f],(S=p.parentNode)==null||S.removeChild(p)},BS.then(_=>{const T={ak:_,callback:f,coords:d.map(E=>`${E.longitude},${E.latitude}`).join(";"),from:3,to:5};p.src=HS+"?"+Object.entries(T).map(([E,S])=>E+"="+S).join("&"),document.head.appendChild(p)})}})}class zS extends rl{constructor(n){super(n);Ie(this,"_wrapper");Ie(this,"map");Ie(this,"_panStartHandler");Ie(this,"_panHandler");Ie(this,"_centerReady");const r=!!(window.MSInputMethodContext&&document.DOCUMENT_NODE);this._wrapper=n.wrapper,this.map=new BMap.Map(this._wrapper,{enableMapClick:n.controlEnabled,maxZoom:r?14:18,...n.providerOptions}),n.controlEnabled?(this.map.enableScrollWheelZoom(),this.map.addControl(new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_RIGHT,type:BMAP_NAVIGATION_CONTROL_ZOOM}))):(this.map.disableDragging(),this.map.disableDoubleClickZoom(),this.map.disablePinchToZoom()),this._panStartHandler=()=>null,this._panHandler=()=>null,this.map.addEventListener("movestart",()=>this._panStartHandler()),this.map.addEventListener("moveend",()=>this._panHandler()),this.map.addEventListener("zoomstart",()=>this._panStartHandler()),this.map.addEventListener("zoomend",()=>{this._wrapper&&(this._wrapper.dataset.baiduZoom=this.map.getZoom()),this._panHandler()}),this._centerReady=Promise.resolve()}getCenter(){return new dn(this.map.getCenter())}getZoom(){return this.map.getZoom()-sd}setCenter(n,r){this._centerReady=g_([n]).then(([l])=>{const d=new BMap.Point(l.longitude,l.latitude);this.map.panTo(d,{noAnimation:!r})})}setZoom(n,r){this._centerReady.then(()=>{this.map.setViewport({center:this.map.getCenter(),zoom:Math.floor(n+sd)},{enableAnimation:r})})}}class US extends il{constructor(n){super(n);Ie(this,"_wrapper");Ie(this,"_zIndex");Ie(this,"_wrapperClass");Ie(this,"_originalWrapperClass");Ie(this,"_element");Ie(this,"_coordinateReady");Ie(this,"_negativeLngFix");Ie(this,"pin");this._wrapper=null,this._zIndex=0,this._wrapperClass="",this._originalWrapperClass="",this._element=this._pinEl,this._coordinateReady=Promise.resolve(),this._negativeLngFix=!1;class r extends BMap.Marker{constructor(p,_){super(p);Ie(this,"pin");this.pin=_}initialize(p){return this.pin._wrapper=super.initialize(p),this.pin._wrapper&&(this.pin._wrapper.style.zIndex=this.pin._zIndex.toString(),this.pin._originalWrapperClass=this.pin._wrapper.getAttribute("class")??"",this.pin._wrapper.setAttribute("class",this.pin._getClass()),this.pin._wrapper.appendChild(this.pin._element),this.pin.addListeners()),this.pin._wrapper}draw(){if(this.pin._wrapper){const p=this.pin._wrapper.style.zIndex;super.draw(),this.pin._wrapper.style.height="",this.pin._wrapper.style.width="",this.pin._wrapper.style.pointerEvents="none",this.pin._wrapper.style.zIndex=p}else super.draw()}}this.pin=new r(new BMap.Point(0,0),this);const l=new BMap.Icon("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",{height:0,width:0});this.pin.setIcon(l),this.pin.setShadow(l)}addListeners(){super.addListeners(),this._wrapper&&this._wrapper.addEventListener("touchend",()=>this._clickHandler())}setCoordinate(n){this._coordinateReady=g_([n]).then(([r])=>{this._negativeLngFix=r.longitude<0,this.pin.setPosition(new BMap.Point(r.longitude+(this._negativeLngFix?180:0),r.latitude)),this._wrapper&&this._wrapper.classList[this._negativeLngFix?"add":"remove"](od)})}setMap(n,r){this._coordinateReady.then(()=>{r&&r.getProviderMap().map.removeOverlay(this.pin),n&&n.getProviderMap().map.addOverlay(this.pin)})}setProperties(n){super.setProperties(n),this._wrapperClass=n.getClass(),this._element=n.getElement()||this._pinEl,this._zIndex=n.getZIndex(),this._wrapper&&this._wrapper.setAttribute("class",this._getClass())}_getClass(){return`${this._originalWrapperClass} ${this._negativeLngFix?od:""} ${this._wrapperClass}`}}const GS="https://api.map.baidu.com/getscript";function YS(e,t,n,{params:r={},version:l="3.0"}={}){window.BMAP_PROTOCOL="https",window.BMap_loadScriptTime=new Date().getTime();const d=n,f={ak:d,v:l,...r};h_(d);const p=document.createElement("script");p.src=GS+"?"+Object.entries(f).map(([E,S])=>E+"="+S).join("&"),p.onload=()=>e(),document.head.appendChild(p);let _="";for(let E=$S;E<=FS;E++){const S=2**(E-sd+7);_+=`[data-baidu-zoom="${E}"] .${od}{transform:translateX(-${S}px);}`}const T=document.createElement("style");T.appendChild(document.createTextNode(_)),document.head.appendChild(T)}const jS=new lo().withLoadFunction(YS).withMapClass(zS).withPinClass(US).withProviderName("Baidu").build();let p_;function VS(){class e extends Microsoft.Maps.CustomOverlay{constructor(){super({beneathLabels:!1});Ie(this,"_container");Ie(this,"_pins");Ie(this,"_viewChangeEventHandler");Ie(this,"_map");this._container=document.createElement("div"),this._pins=new Set,this._viewChangeEventHandler=null,this._container.style.position="absolute",this._container.style.left="0",this._container.style.top="0"}addPin(r){this._pins.add(r),r._wrapper&&(r._wrapper.style.position="absolute",this._container.appendChild(r._wrapper)),this._map&&this.updatePinPosition(r)}onAdd(){this._map=this.getMap(),this.setHtmlElement(this._container)}onLoad(){this._viewChangeEventHandler=Microsoft.Maps.Events.addHandler(this._map,"viewchange",()=>this.updatePinPositions()),this.updatePinPositions()}onRemove(){this._viewChangeEventHandler&&Microsoft.Maps.Events.removeHandler(this._viewChangeEventHandler),this._map=null}removePin(r){this._pins.delete(r),r._wrapper&&this._container.removeChild(r._wrapper)}updatePinPosition(r){if(!this._map)return;const l=this._map.tryLocationToPixel(r._location,Microsoft.Maps.PixelReference.control);r._wrapper&&l instanceof Microsoft.Maps.Point&&(r._wrapper.style.left=l.x+"px",r._wrapper.style.top=l.y+"px")}updatePinPositions(){this._pins.forEach(r=>this.updatePinPosition(r))}}p_=e}class qS extends rl{constructor(n){super(n);Ie(this,"wrapper");Ie(this,"map");Ie(this,"pinOverlay");this.wrapper=n.wrapper,this.wrapper&&(this.map=new Microsoft.Maps.Map(this.wrapper,{disablePanning:!n.controlEnabled,disableZooming:!n.controlEnabled,showLocateMeButton:!1,showMapTypeSelector:!1,showScalebar:!1,showTrafficButton:!1,...n.providerOptions}),this.pinOverlay=new p_(this.map),this.map.layers.insert(this.pinOverlay),Microsoft.Maps.Events.addHandler(this.map,"viewchangestart",()=>this._panStartHandler()),Microsoft.Maps.Events.addHandler(this.map,"viewchangeend",()=>this._panHandler()))}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d;const l=new Microsoft.Maps.Location(n.latitude,n.longitude);(d=this.map)==null||d.setView({center:l}),this.pinOverlay.updatePinPositions()}setZoom(n,r){var l;(l=this.map)==null||l.setView({zoom:Math.floor(n)}),this.pinOverlay.updatePinPositions()}}class m_ extends il{constructor(n){super(n);Ie(this,"_location");Ie(this,"_map");this._map=null,this._location=new Microsoft.Maps.Location(0,0)}static getId(){return this._pinId=(this._pinId||0)+1,this._pinId}setCoordinate(n){this._location=new Microsoft.Maps.Location(n.latitude,n.longitude),this._map&&this._map.getProviderMap().pinOverlay.updatePinPosition(this)}setMap(n,r){r&&r.getProviderMap().pinOverlay.removePin(this),n&&n.getProviderMap().pinOverlay.addPin(this),this._map=n}}Ie(m_,"_pinId");const ip="BingMapsCallback_593d7d33",ZS="https://www.bing.com/api/maps/mapcontrol";function JS(e,t,n,{params:r={}}={}){window[ip]=()=>{VS(),e()};const l={callback:ip,key:n,...r};hp(ZS+"?"+Object.entries(l).map(([d,f])=>d+"="+f).join("&"))}const XS=new lo().withLoadFunction(JS).withMapClass(qS).withPinClass(m_).withProviderName("Bing").build();class QS extends rl{constructor(n){var r,l,d;super(n);Ie(this,"map");if(n.wrapper&&(this.map=new mapboxgl.Map({container:n.wrapper,interactive:n.controlEnabled,style:"mapbox://styles/mapbox/streets-v9",...n.providerOptions})),n.controlEnabled){const f=new mapboxgl.NavigationControl({showCompass:!1});(r=this.map)==null||r.addControl(f)}(l=this.map)==null||l.on("movestart",()=>this._panStartHandler()),(d=this.map)==null||d.on("moveend",()=>this._panHandler())}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return(((n=this.map)==null?void 0:n.getZoom())??0)+1}setCenter(n,r){const l=new mapboxgl.LngLat(n.longitude,n.latitude);this.map&&this.map[r?"panTo":"setCenter"](l)}setZoom(n,r){this.map&&this.map[r?"zoomTo":"setZoom"](n-1)}setZoomCenter(n,r,l){const d=new mapboxgl.LngLat(r.longitude,r.latitude);this.map&&this.map[l?"easeTo":"jumpTo"]({center:d,zoom:n-1})}}class ew extends il{constructor(n){super(n);Ie(this,"pin");this._wrapper&&(this._wrapper.style.position="relative",this.pin=new mapboxgl.Marker({anchor:"top-left",element:this._wrapper}))}setCoordinate(n){var r;(r=this.pin)==null||r.setLngLat(new mapboxgl.LngLat(n.longitude,n.latitude))}setMap(n,r){var l,d;if(n){const f=n.getProviderMap().map;f&&((l=this.pin)==null||l.addTo(f))}else(d=this.pin)==null||d.remove()}}function tw(e,t,n,{version:r="v1.13.0"}={}){const l=`https://api.mapbox.com/mapbox-gl-js/${r}/mapbox-gl`,d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>{mapboxgl.accessToken=n,e()},document.head.appendChild(d),document.head.appendChild(f)}const nw=new lo().withLoadFunction(tw).withMapClass(QS).withPinClass(ew).withProviderName("Mapbox").build();var oo;let __=(oo=class extends rl{constructor(n){var r,l,d;super(n);Ie(this,"map");this._initMap(n),n.controlEnabled&&((r=this.map)==null||r.zoomControl.setPosition("topright")),(l=this.map)==null||l.on("movestart",()=>this._panStartHandler()),(d=this.map)==null||d.on("moveend",()=>this._panHandler())}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d;const l=new L.LatLng(n.latitude,n.longitude);(d=this.map)==null||d.panTo(l,{animate:r})}setZoom(n,r){var l;(l=this.map)==null||l.setZoom(n,{animate:r})}setZoomCenter(n,r,l){var f;const d=new L.LatLng(r.latitude,r.longitude);(f=this.map)==null||f.setView(d,n,{animate:l})}_initMap(n){n.wrapper&&(this.map=new L.Map(n.wrapper,{boxZoom:n.controlEnabled,doubleClickZoom:n.controlEnabled,dragging:n.controlEnabled,zoom:0,zoomControl:n.controlEnabled,zoomSnap:0,...n.providerOptions}));const r=n.providerOptions,l=r.tileLayerSrc||"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",d=r.tileLayerOptions||{attribution:'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',id:"mapbox/streets-v11"};d.accessToken=oo.apiKey,this.map&&L.tileLayer(l,d).addTo(this.map)}},Ie(oo,"apiKey"),oo),rw=class extends fd{constructor(n){super(n);Ie(this,"pin");this.pin=new L.Marker(new L.LatLng(0,0)),this.pin.on("click",()=>this._clickHandler()),this.pin.on("mouseover",()=>this._hoverHandler(!0)),this.pin.on("mouseout",()=>this._hoverHandler(!1))}setCoordinate(n){const r=new L.LatLng(n.latitude,n.longitude);this.pin.setLatLng(r)}setMap(n,r){if(n){const l=n.getProviderMap().map;l&&this.pin.addTo(l)}else this.pin.remove()}setProperties(n){const r=n.getWidth(),l=n.getHeight(),d=n.getAnchorX(),f=n.getAnchorY();this.pin.setIcon(new L.Icon({iconUrl:this._icons[n.getIcon()],iconSize:[r,l],iconAnchor:[d*r,f*l],className:n.getClass()})),this.pin.setZIndexOffset(n.getZIndex())}};function iw(e,t,n,{version:r="1.7.1"}={}){const l=`https://unpkg.com/leaflet@${r}/dist/leaflet`;__.apiKey=n;const d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>e(),document.head.appendChild(d),document.head.appendChild(f)}const Hd=new lo().withLoadFunction(iw).withMapClass(__).withPinClass(rw).withProviderName("Leaflet").build(),sw=Hd.getMapClass(),ow=Hd.getPinClass();class lw extends sw{constructor(){super(...arguments);Ie(this,"map")}_initMap(n){this.map=L.mapquest.map(n.wrapper,{boxZoom:n.controlEnabled,center:new L.LatLng(0,0),doubleClickZoom:n.controlEnabled,dragging:n.controlEnabled,layers:L.mapquest.tileLayer("map"),zoom:0,zoomControl:n.controlEnabled,zoomSnap:0,...n.providerOptions})}}class aw extends ow{}function cw(e,t,n,{version:r="v1.3.2"}={}){const l=`https://api.mqcdn.com/sdk/mapquest-js/${r}/mapquest-maps`,d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>{L.mapquest.key=n,e()},document.head.appendChild(d),document.head.appendChild(f)}const uw=new lo().withLoadFunction(cw).withMapClass(lw).withPinClass(aw).withProviderName("MapQuest").build();exports.Address=ay;exports.AddressSchema=Fd;exports.AggregateRatingSchema=f_;exports.Analytics=cp;exports.AnalyticsContext=ud;exports.AnalyticsProvider=jy;exports.AnalyticsScopeProvider=Vy;exports.BaiduMaps=jS;exports.BaseSchema=wc;exports.BingMaps=XS;exports.Clusterer=LN;exports.Coordinate=dn;exports.Day=ln;exports.Event=wS;exports.FAQPage=PS;exports.GoogleMaps=mp;exports.HoursStatus=gS;exports.HoursTable=yS;exports.Image=nN;exports.ImageLayoutOption=Ts;exports.LeafletMaps=Hd;exports.LegacyRichText=nx;exports.LexicalRichText=gE;exports.Link=fp;exports.ListingPublisherOption=sp;exports.LocalBusiness=AS;exports.LocationMap=PN;exports.LocationSchema=o_;exports.Map=Np;exports.MapProviderOption=Wu;exports.MapQuestMaps=uw;exports.MapboxMaps=nw;exports.Marker=pd;exports.OfferSchema=Bd;exports.OpeningHoursSchema=u_;exports.OrganizationSchema=c_;exports.PerformerSchema=a_;exports.PhotoGallerySchema=Oc;exports.PhotoSchema=TS;exports.Product=bS;exports.ReviewSchema=d_;exports.SchemaWrapper=NS;exports.asciiAlpha=vE;exports.asciiAlphanumeric=Ju;exports.asciiAtext=SE;exports.asciiControl=wE;exports.asciiDigit=OE;exports.asciiHexDigit=DE;exports.asciiPunctuation=AE;exports.c=Qo;exports.classifyCharacter=la;exports.combineExtensions=Up;exports.createState=UT;exports.debuggingParamDetected=cc;exports.getDefaultExportFromCjs=ad;exports.getDirections=oy;exports.getRuntime=Xo;exports.jsxRuntimeExports=at;exports.markdownLineEnding=ME;exports.markdownLineEndingOrSpace=Jp;exports.markdownSpace=RE;exports.normalizeUri=ol;exports.push=jo;exports.resolveAll=Xp;exports.splice=yc;exports.useAnalytics=nl;exports.useClusterContext=bN;exports.useIdentify=Jy;exports.useMapContext=MN;exports.usePageView=Zy;exports.useScope=dd;exports.useTrack=qy;exports.visit=Dd;
|
|
111
|
+
<\/script>`,Ac=(e,t)=>{if(!(!e.name||typeof e.name!="string"))return{"@context":"https://schema.org","@type":t,name:e.name}},wS=e=>typeof e!="object"?!1:!!e.name||!!e.address,OS=e=>typeof e!="object"?!1:!!e.line1||!!e.city||!!e.region||!!e.postalCode||!!e.countryCode,Kd=e=>OS(e)&&{address:{"@type":"PostalAddress",streetAddress:e.line1,addressLocality:e.city,addressRegion:e.region,postalCode:e.postalCode,addressCountry:e.countryCode}},c_=e=>wS(e)&&{"@type":"Place",name:e.name,...Kd(e.address)},u_=e=>typeof e!="object"||!("image"in e)?!1:"url"in e.image&&typeof e.image.url=="string",Mc=e=>{if(!e)return{};const t=new Array;for(const n of e)u_(n)&&t.push(n.image.url);return{image:t}},DS=e=>u_(e)&&{image:e.image.url},AS=e=>typeof e!="object"?!1:!!e.name,MS=e=>Array.isArray(e)&&e.length>0,d_=e=>MS(e)&&{performer:{"@type":"PerformingGroup",name:e.join(" and ")}},f_=e=>AS(e)&&{organizer:{"@type":"Organization",name:e.name,...e.url&&{url:e.url}}},RS=["BackOrder","Discontinued","InStock","InStoreOnly","LimitedAvailability","MadeToOrder","OnlineOnly","OutOfStock","PreOrder","PreSale","Reserved","SoldOut"],bS=e=>typeof e!="object"?!1:"priceCurrency"in e&&"price"in e&&"availability"in e&&RS.includes(e.availability),zd=e=>bS(e)&&{offers:{"@type":"Offer",url:e.url,priceCurrency:e.priceCurrency,price:e.price,priceValidUntil:e.priceValidUntil,itemCondition:e.itemCondition,availability:e.availability}},LS=(e,t)=>{const n=c_({name:e.geomodifier,address:e.address});return{...Ac(e,t??"Event"),...Mc(e.photoGallery),...n&&{location:n},...d_(e.performers),...f_({name:e.organizerName}),...zd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.condition,availability:e.stockStatus}),...e.c_startDate&&{startDate:e.c_startDate},...e.c_endDate&&{endDate:e.c_endDate},...e.description&&{description:e.description},...e.attendance&&{eventAttendanceMode:e.attendance},...e.eventStatus&&{eventStatus:e.eventStatus}}},IS=e=>typeof e!="object"?!1:"monday"in e||"tuesday"in e||"wednesday"in e||"thursday"in e||"friday"in e||"saturday"in e||"sunday"in e,kS=e=>typeof e!="object"?!1:e.isClosed?!0:"openIntervals"in e&&Array.isArray(e.openIntervals)&&e.openIntervals.length?e.openIntervals.every(t=>typeof t=="object"&&"start"in t&&"end"in t):!1,h_=e=>{if(!IS(e))return{};let t=new Map;t=eo(e.monday,t,"Mo"),t=eo(e.tuesday,t,"Tu"),t=eo(e.wednesday,t,"We"),t=eo(e.thursday,t,"Th"),t=eo(e.friday,t,"Fr"),t=eo(e.saturday,t,"Sa"),t=eo(e.sunday,t,"Su");const n=new Array;for(const[r,l]of t){const d=l.join(",");n.push(d+" "+r)}return{openingHours:n}},eo=(e,t,n)=>{if(!kS(e))return t;if(e.isClosed||!e.openIntervals){const r="00:00-00:00",l=t.get(r)??[];return l.push(n),t.set(r,l),t}for(let r=0;r<e.openIntervals.length;r++){const l=e.openIntervals[r].start+"-"+e.openIntervals[r].end,d=t.get(l)??[];d.push(n),t.set(l,d)}return t},PS=(e,t)=>({...Ac(e,t??"LocalBusiness"),...Kd(e.address),...h_(e.hours),...Mc(e.photoGallery),description:e.description,telephone:e.mainPhone,email:e.email}),$S=e=>typeof e!="object"?!1:"ratingValue"in e,FS=e=>typeof e!="object"?!1:"ratingValue"in e&&"reviewCount"in e,g_=e=>$S(e)&&{review:{"@type":"Review",reviewRating:{"@type":"Rating",ratingValue:e.ratingValue,bestRating:e.bestRating},...e.author&&{author:{"@type":"Person",name:e.author}}}},p_=e=>FS(e)?{aggregateRating:{"@type":"AggregateRating",ratingValue:e.ratingValue,reviewCount:e.reviewCount}}:void 0,BS=(e,t)=>({...Ac(e,t??"Product"),...Mc(e.photoGallery),...g_(e.c_reviews),...p_(e.c_aggregateRating),...zd({url:"",priceCurrency:e.c_currency,price:e.price,priceValidUntil:e.expirationDate,itemCondition:e.condition,availability:e.stockStatus}),description:e.description,sku:e.sku,mpn:e.mpn,...e.brand&&{brand:{"@type":"Brand",name:e.brand}}}),HS=e=>!e||typeof e!="object"?!1:"question"in e&&"answer"in e,WS=e=>!e||typeof e!="object"?!1:"question"in e&&"answerV2"in e?"json"in e.answerV2&&typeof e.answerV2.json=="object":!1;function cd(e,t){for(const n in e)if(typeof e[n]=="object")if(Array.isArray(e[n]))for(let r=0;r<e[n].length;r++)cd(e[n][r],t);else cd(e[n],t);else n==="text"&&t.push(e[n])}function m_(e){if(e.json){const t=[];return cd(e.json,t),t.join("")}return""}const KS=e=>{const t=e.map(n=>{if(HS(n)||WS(n))return{"@type":"Question",name:n.question,acceptedAnswer:{"@type":"Answer",text:"answer"in n?n.answer:m_(n.answerV2)}}}).filter(Boolean);if(t.length)return{"@context":"http://www.schema.org","@type":"FAQPage",mainEntity:t}},ud=Math.log2(1.6745627884839434),zS=4,US=19,dd="js-baidu-neg-lng-fix";let __;const GS=new Promise(e=>__=e),YS="https://api.map.baidu.com/geoconv/v1/";let Ql=[];const jS="gcj02ToBD09Callback_b872c21c";let VS=0,op;async function y_(e){return await new Promise((t,n)=>{Ql.push({coordinates:e,resolve:t,reject:n}),Ql.length===1&&(op=setTimeout(r,100)),Ql.length>40&&(clearTimeout(op),r());function r(){const l=Ql;Ql=[];const d=[].concat(...l.map(_=>_.coordinates)),f=jS+"_"+VS++,p=document.createElement("script");window[f]=_=>{var S;if(_.status){const w=new Error(`Unable to convert coordinates to BD-09: Received status code ${_.status}${_.message?": "+_.message:""}`);l.forEach(O=>O.reject(w))}const E=_.result.map(w=>new dn(w.y,w.x));let T=0;l.forEach(w=>{w.resolve(E.slice(T,T+=w.coordinates.length))}),delete window[f],(S=p.parentNode)==null||S.removeChild(p)},GS.then(_=>{const E={ak:_,callback:f,coords:d.map(T=>`${T.longitude},${T.latitude}`).join(";"),from:3,to:5};p.src=YS+"?"+Object.entries(E).map(([T,S])=>T+"="+S).join("&"),document.head.appendChild(p)})}})}class qS extends rl{constructor(n){super(n);Ie(this,"_wrapper");Ie(this,"map");Ie(this,"_panStartHandler");Ie(this,"_panHandler");Ie(this,"_centerReady");const r=!!(window.MSInputMethodContext&&document.DOCUMENT_NODE);this._wrapper=n.wrapper,this.map=new BMap.Map(this._wrapper,{enableMapClick:n.controlEnabled,maxZoom:r?14:18,...n.providerOptions}),n.controlEnabled?(this.map.enableScrollWheelZoom(),this.map.addControl(new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_RIGHT,type:BMAP_NAVIGATION_CONTROL_ZOOM}))):(this.map.disableDragging(),this.map.disableDoubleClickZoom(),this.map.disablePinchToZoom()),this._panStartHandler=()=>null,this._panHandler=()=>null,this.map.addEventListener("movestart",()=>this._panStartHandler()),this.map.addEventListener("moveend",()=>this._panHandler()),this.map.addEventListener("zoomstart",()=>this._panStartHandler()),this.map.addEventListener("zoomend",()=>{this._wrapper&&(this._wrapper.dataset.baiduZoom=this.map.getZoom()),this._panHandler()}),this._centerReady=Promise.resolve()}getCenter(){return new dn(this.map.getCenter())}getZoom(){return this.map.getZoom()-ud}setCenter(n,r){this._centerReady=y_([n]).then(([l])=>{const d=new BMap.Point(l.longitude,l.latitude);this.map.panTo(d,{noAnimation:!r})})}setZoom(n,r){this._centerReady.then(()=>{this.map.setViewport({center:this.map.getCenter(),zoom:Math.floor(n+ud)},{enableAnimation:r})})}}class ZS extends il{constructor(n){super(n);Ie(this,"_wrapper");Ie(this,"_zIndex");Ie(this,"_wrapperClass");Ie(this,"_originalWrapperClass");Ie(this,"_element");Ie(this,"_coordinateReady");Ie(this,"_negativeLngFix");Ie(this,"pin");this._wrapper=null,this._zIndex=0,this._wrapperClass="",this._originalWrapperClass="",this._element=this._pinEl,this._coordinateReady=Promise.resolve(),this._negativeLngFix=!1;class r extends BMap.Marker{constructor(p,_){super(p);Ie(this,"pin");this.pin=_}initialize(p){return this.pin._wrapper=super.initialize(p),this.pin._wrapper&&(this.pin._wrapper.style.zIndex=this.pin._zIndex.toString(),this.pin._originalWrapperClass=this.pin._wrapper.getAttribute("class")??"",this.pin._wrapper.setAttribute("class",this.pin._getClass()),this.pin._wrapper.appendChild(this.pin._element),this.pin.addListeners()),this.pin._wrapper}draw(){if(this.pin._wrapper){const p=this.pin._wrapper.style.zIndex;super.draw(),this.pin._wrapper.style.height="",this.pin._wrapper.style.width="",this.pin._wrapper.style.pointerEvents="none",this.pin._wrapper.style.zIndex=p}else super.draw()}}this.pin=new r(new BMap.Point(0,0),this);const l=new BMap.Icon("data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",{height:0,width:0});this.pin.setIcon(l),this.pin.setShadow(l)}addListeners(){super.addListeners(),this._wrapper&&this._wrapper.addEventListener("touchend",()=>this._clickHandler())}setCoordinate(n){this._coordinateReady=y_([n]).then(([r])=>{this._negativeLngFix=r.longitude<0,this.pin.setPosition(new BMap.Point(r.longitude+(this._negativeLngFix?180:0),r.latitude)),this._wrapper&&this._wrapper.classList[this._negativeLngFix?"add":"remove"](dd)})}setMap(n,r){this._coordinateReady.then(()=>{r&&r.getProviderMap().map.removeOverlay(this.pin),n&&n.getProviderMap().map.addOverlay(this.pin)})}setProperties(n){super.setProperties(n),this._wrapperClass=n.getClass(),this._element=n.getElement()||this._pinEl,this._zIndex=n.getZIndex(),this._wrapper&&this._wrapper.setAttribute("class",this._getClass())}_getClass(){return`${this._originalWrapperClass} ${this._negativeLngFix?dd:""} ${this._wrapperClass}`}}const JS="https://api.map.baidu.com/getscript";function XS(e,t,n,{params:r={},version:l="3.0"}={}){window.BMAP_PROTOCOL="https",window.BMap_loadScriptTime=new Date().getTime();const d=n,f={ak:d,v:l,...r};__(d);const p=document.createElement("script");p.src=JS+"?"+Object.entries(f).map(([T,S])=>T+"="+S).join("&"),p.onload=()=>e(),document.head.appendChild(p);let _="";for(let T=zS;T<=US;T++){const S=2**(T-ud+7);_+=`[data-baidu-zoom="${T}"] .${dd}{transform:translateX(-${S}px);}`}const E=document.createElement("style");E.appendChild(document.createTextNode(_)),document.head.appendChild(E)}const QS=new ao().withLoadFunction(XS).withMapClass(qS).withPinClass(ZS).withProviderName("Baidu").build();let N_;function ew(){class e extends Microsoft.Maps.CustomOverlay{constructor(){super({beneathLabels:!1});Ie(this,"_container");Ie(this,"_pins");Ie(this,"_viewChangeEventHandler");Ie(this,"_map");this._container=document.createElement("div"),this._pins=new Set,this._viewChangeEventHandler=null,this._container.style.position="absolute",this._container.style.left="0",this._container.style.top="0"}addPin(r){this._pins.add(r),r._wrapper&&(r._wrapper.style.position="absolute",this._container.appendChild(r._wrapper)),this._map&&this.updatePinPosition(r)}onAdd(){this._map=this.getMap(),this.setHtmlElement(this._container)}onLoad(){this._viewChangeEventHandler=Microsoft.Maps.Events.addHandler(this._map,"viewchange",()=>this.updatePinPositions()),this.updatePinPositions()}onRemove(){this._viewChangeEventHandler&&Microsoft.Maps.Events.removeHandler(this._viewChangeEventHandler),this._map=null}removePin(r){this._pins.delete(r),r._wrapper&&this._container.removeChild(r._wrapper)}updatePinPosition(r){if(!this._map)return;const l=this._map.tryLocationToPixel(r._location,Microsoft.Maps.PixelReference.control);r._wrapper&&l instanceof Microsoft.Maps.Point&&(r._wrapper.style.left=l.x+"px",r._wrapper.style.top=l.y+"px")}updatePinPositions(){this._pins.forEach(r=>this.updatePinPosition(r))}}N_=e}class tw extends rl{constructor(n){super(n);Ie(this,"wrapper");Ie(this,"map");Ie(this,"pinOverlay");this.wrapper=n.wrapper,this.wrapper&&(this.map=new Microsoft.Maps.Map(this.wrapper,{disablePanning:!n.controlEnabled,disableZooming:!n.controlEnabled,showLocateMeButton:!1,showMapTypeSelector:!1,showScalebar:!1,showTrafficButton:!1,...n.providerOptions}),this.pinOverlay=new N_(this.map),this.map.layers.insert(this.pinOverlay),Microsoft.Maps.Events.addHandler(this.map,"viewchangestart",()=>this._panStartHandler()),Microsoft.Maps.Events.addHandler(this.map,"viewchangeend",()=>this._panHandler()))}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d;const l=new Microsoft.Maps.Location(n.latitude,n.longitude);(d=this.map)==null||d.setView({center:l}),this.pinOverlay.updatePinPositions()}setZoom(n,r){var l;(l=this.map)==null||l.setView({zoom:Math.floor(n)}),this.pinOverlay.updatePinPositions()}}class C_ extends il{constructor(n){super(n);Ie(this,"_location");Ie(this,"_map");this._map=null,this._location=new Microsoft.Maps.Location(0,0)}static getId(){return this._pinId=(this._pinId||0)+1,this._pinId}setCoordinate(n){this._location=new Microsoft.Maps.Location(n.latitude,n.longitude),this._map&&this._map.getProviderMap().pinOverlay.updatePinPosition(this)}setMap(n,r){r&&r.getProviderMap().pinOverlay.removePin(this),n&&n.getProviderMap().pinOverlay.addPin(this),this._map=n}}Ie(C_,"_pinId");const lp="BingMapsCallback_593d7d33",nw="https://www.bing.com/api/maps/mapcontrol";function rw(e,t,n,{params:r={}}={}){window[lp]=()=>{ew(),e()};const l={callback:lp,key:n,...r};mp(nw+"?"+Object.entries(l).map(([d,f])=>d+"="+f).join("&"))}const iw=new ao().withLoadFunction(rw).withMapClass(tw).withPinClass(C_).withProviderName("Bing").build();class sw extends rl{constructor(n){var r,l,d;super(n);Ie(this,"map");if(n.wrapper&&(this.map=new mapboxgl.Map({container:n.wrapper,interactive:n.controlEnabled,style:"mapbox://styles/mapbox/streets-v9",...n.providerOptions})),n.controlEnabled){const f=new mapboxgl.NavigationControl({showCompass:!1});(r=this.map)==null||r.addControl(f)}(l=this.map)==null||l.on("movestart",()=>this._panStartHandler()),(d=this.map)==null||d.on("moveend",()=>this._panHandler())}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return(((n=this.map)==null?void 0:n.getZoom())??0)+1}setCenter(n,r){const l=new mapboxgl.LngLat(n.longitude,n.latitude);this.map&&this.map[r?"panTo":"setCenter"](l)}setZoom(n,r){this.map&&this.map[r?"zoomTo":"setZoom"](n-1)}setZoomCenter(n,r,l){const d=new mapboxgl.LngLat(r.longitude,r.latitude);this.map&&this.map[l?"easeTo":"jumpTo"]({center:d,zoom:n-1})}}class ow extends il{constructor(n){super(n);Ie(this,"pin");this._wrapper&&(this._wrapper.style.position="relative",this.pin=new mapboxgl.Marker({anchor:"top-left",element:this._wrapper}))}setCoordinate(n){var r;(r=this.pin)==null||r.setLngLat(new mapboxgl.LngLat(n.longitude,n.latitude))}setMap(n,r){var l,d;if(n){const f=n.getProviderMap().map;f&&((l=this.pin)==null||l.addTo(f))}else(d=this.pin)==null||d.remove()}}function lw(e,t,n,{version:r="v1.13.0"}={}){const l=`https://api.mapbox.com/mapbox-gl-js/${r}/mapbox-gl`,d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>{mapboxgl.accessToken=n,e()},document.head.appendChild(d),document.head.appendChild(f)}const aw=new ao().withLoadFunction(lw).withMapClass(sw).withPinClass(ow).withProviderName("Mapbox").build();var so;let E_=(so=class extends rl{constructor(n){var r,l,d;super(n);Ie(this,"map");this._initMap(n),n.controlEnabled&&((r=this.map)==null||r.zoomControl.setPosition("topright")),(l=this.map)==null||l.on("movestart",()=>this._panStartHandler()),(d=this.map)==null||d.on("moveend",()=>this._panHandler())}getCenter(){var n;return new dn(((n=this.map)==null?void 0:n.getCenter())??{lat:0,lng:0})}getZoom(){var n;return((n=this.map)==null?void 0:n.getZoom())??0}setCenter(n,r){var d;const l=new L.LatLng(n.latitude,n.longitude);(d=this.map)==null||d.panTo(l,{animate:r})}setZoom(n,r){var l;(l=this.map)==null||l.setZoom(n,{animate:r})}setZoomCenter(n,r,l){var f;const d=new L.LatLng(r.latitude,r.longitude);(f=this.map)==null||f.setView(d,n,{animate:l})}_initMap(n){n.wrapper&&(this.map=new L.Map(n.wrapper,{boxZoom:n.controlEnabled,doubleClickZoom:n.controlEnabled,dragging:n.controlEnabled,zoom:0,zoomControl:n.controlEnabled,zoomSnap:0,...n.providerOptions}));const r=n.providerOptions,l=r.tileLayerSrc||"https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}",d=r.tileLayerOptions||{attribution:'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',id:"mapbox/streets-v11"};d.accessToken=so.apiKey,this.map&&L.tileLayer(l,d).addTo(this.map)}},Ie(so,"apiKey"),so),cw=class extends _d{constructor(n){super(n);Ie(this,"pin");this.pin=new L.Marker(new L.LatLng(0,0)),this.pin.on("click",()=>this._clickHandler()),this.pin.on("mouseover",()=>this._hoverHandler(!0)),this.pin.on("mouseout",()=>this._hoverHandler(!1))}setCoordinate(n){const r=new L.LatLng(n.latitude,n.longitude);this.pin.setLatLng(r)}setMap(n,r){if(n){const l=n.getProviderMap().map;l&&this.pin.addTo(l)}else this.pin.remove()}setProperties(n){const r=n.getWidth(),l=n.getHeight(),d=n.getAnchorX(),f=n.getAnchorY();this.pin.setIcon(new L.Icon({iconUrl:this._icons[n.getIcon()],iconSize:[r,l],iconAnchor:[d*r,f*l],className:n.getClass()})),this.pin.setZIndexOffset(n.getZIndex())}};function uw(e,t,n,{version:r="1.7.1"}={}){const l=`https://unpkg.com/leaflet@${r}/dist/leaflet`;E_.apiKey=n;const d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>e(),document.head.appendChild(d),document.head.appendChild(f)}const Ud=new ao().withLoadFunction(uw).withMapClass(E_).withPinClass(cw).withProviderName("Leaflet").build(),dw=Ud.getMapClass(),fw=Ud.getPinClass();class hw extends dw{constructor(){super(...arguments);Ie(this,"map")}_initMap(n){this.map=L.mapquest.map(n.wrapper,{boxZoom:n.controlEnabled,center:new L.LatLng(0,0),doubleClickZoom:n.controlEnabled,dragging:n.controlEnabled,layers:L.mapquest.tileLayer("map"),zoom:0,zoomControl:n.controlEnabled,zoomSnap:0,...n.providerOptions})}}class gw extends fw{}function pw(e,t,n,{version:r="v1.3.2"}={}){const l=`https://api.mqcdn.com/sdk/mapquest-js/${r}/mapquest-maps`,d=document.createElement("link");d.rel="stylesheet",d.href=l+".css";const f=document.createElement("script");f.src=l+".js",f.onload=()=>{L.mapquest.key=n,e()},document.head.appendChild(d),document.head.appendChild(f)}const mw=new ao().withLoadFunction(pw).withMapClass(hw).withPinClass(gw).withProviderName("MapQuest").build();exports.Address=fy;exports.AddressSchema=Kd;exports.AggregateRatingSchema=p_;exports.Analytics=fp;exports.AnalyticsContext=pd;exports.AnalyticsProvider=Jy;exports.AnalyticsScopeProvider=Xy;exports.BaiduMaps=QS;exports.BaseSchema=Ac;exports.BingMaps=iw;exports.Clusterer=$N;exports.Coordinate=dn;exports.Day=Yt;exports.Event=LS;exports.FAQPage=KS;exports.GoogleMaps=Np;exports.HoursStatus=yS;exports.HoursTable=TS;exports.Image=oN;exports.ImageLayoutOption=Es;exports.LeafletMaps=Ud;exports.LegacyRichText=ox;exports.LexicalRichText=yE;exports.Link=pp;exports.ListingPublisherOption=ap;exports.LocalBusiness=PS;exports.LocationMap=HN;exports.LocationSchema=c_;exports.Map=Tp;exports.MapProviderOption=Uu;exports.MapQuestMaps=mw;exports.MapboxMaps=aw;exports.Marker=Cd;exports.OfferSchema=zd;exports.OpeningHoursSchema=h_;exports.OrganizationSchema=f_;exports.PerformerSchema=d_;exports.PhotoGallerySchema=Mc;exports.PhotoSchema=DS;exports.Product=BS;exports.ReviewSchema=g_;exports.SchemaWrapper=SS;exports.asciiAlpha=DE;exports.asciiAlphanumeric=ed;exports.asciiAtext=AE;exports.asciiControl=ME;exports.asciiDigit=RE;exports.asciiHexDigit=bE;exports.asciiPunctuation=LE;exports.c=lo;exports.classifyCharacter=aa;exports.combineExtensions=jp;exports.createState=VT;exports.debuggingParamDetected=uc;exports.getDefaultExportFromCjs=hd;exports.getDirections=uy;exports.getRichTextContent=m_;exports.getRuntime=Qo;exports.jsxRuntimeExports=nt;exports.markdownLineEnding=IE;exports.markdownLineEndingOrSpace=em;exports.markdownSpace=kE;exports.normalizeUri=ol;exports.push=Vo;exports.resolveAll=tm;exports.splice=Cc;exports.useAnalytics=nl;exports.useClusterContext=PN;exports.useIdentify=tN;exports.useMapContext=IN;exports.usePageView=eN;exports.useScope=md;exports.useTrack=Qy;exports.visit=Ld;
|